@sdcorejs/angular 21.3.5 → 21.3.6
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/assets/STYLE-GUIDE.md +78 -1
- package/assets/THEME.md +45 -3
- package/assets/scss/core/_popover-panel.scss +90 -0
- package/assets/scss/core/form.scss +5 -2
- package/assets/scss/core/utilities/_grid.scss +15 -0
- package/assets/scss/core/utilities/_sizing.scss +4 -0
- package/assets/scss/themes/_component-tokens.scss +9 -4
- package/assets/scss/themes/_semantic.scss +6 -5
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +62 -3
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +14 -6
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-calendar.mjs +2479 -0
- package/fesm2022/sdcorejs-angular-components-calendar.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-card.mjs +486 -23
- package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +4 -18
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +7 -7
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +833 -154
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +23 -7
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +1312 -220
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +68 -2
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-scheduler.mjs +1932 -0
- package/fesm2022/sdcorejs-angular-components-scheduler.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +126 -26
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +31 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +615 -104
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-timeline.mjs +473 -0
- package/fesm2022/sdcorejs-angular-components-timeline.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-tree.mjs +597 -36
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +2 -4
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +3 -1
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +109 -22
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +140 -42
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +70 -21
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-directives.mjs +4 -3
- package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +622 -52
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs → sdcorejs-angular-modules-generic-generic-configuration.page-BfvRoiKg.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map → sdcorejs-angular-modules-generic-generic-configuration.page-BfvRoiKg.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs → sdcorejs-angular-modules-generic-generic-form-host.page-C9jW2AkB.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map → sdcorejs-angular-modules-generic-generic-form-host.page-C9jW2AkB.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs → sdcorejs-angular-modules-generic-generic-list.page-BwGHv8k-.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map → sdcorejs-angular-modules-generic-generic-list.page-BwGHv8k-.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BhUf_wyg.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs.map → sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-BhUf_wyg.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-generic.mjs +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +7 -2
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs → sdcorejs-angular-modules-pattern-base-api.service-VnxHofZl.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-base-api.service-5uIBONB3.mjs.map → sdcorejs-angular-modules-pattern-base-api.service-VnxHofZl.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs → sdcorejs-angular-modules-pattern-create.component-7VOgxRio.mjs} +11 -7
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-7VOgxRio.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs → sdcorejs-angular-modules-pattern-create.component-COnQ3U15.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-B35CvNrI.mjs.map → sdcorejs-angular-modules-pattern-create.component-COnQ3U15.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.mjs → sdcorejs-angular-modules-pattern-create.component-CggApoVx.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-create.component-Cvxx5s1o.mjs.map → sdcorejs-angular-modules-pattern-create.component-CggApoVx.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-5hBM9st3.mjs → sdcorejs-angular-modules-pattern-customer.service-5th_X0wz.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-customer.service-5hBM9st3.mjs.map → sdcorejs-angular-modules-pattern-customer.service-5th_X0wz.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs → sdcorejs-angular-modules-pattern-detail.component-BBqMMusi.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BuvAy1by.mjs.map → sdcorejs-angular-modules-pattern-detail.component-BBqMMusi.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs → sdcorejs-angular-modules-pattern-detail.component-LS8QNECh.mjs} +58 -55
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-LS8QNECh.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs → sdcorejs-angular-modules-pattern-flow.component-CQajWHBR.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-flow.component-BDixzOA6.mjs.map → sdcorejs-angular-modules-pattern-flow.component-CQajWHBR.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs → sdcorejs-angular-modules-pattern-index.component-DHRtqSRm.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-index.component-iRIG7WQo.mjs.map → sdcorejs-angular-modules-pattern-index.component-DHRtqSRm.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs → sdcorejs-angular-modules-pattern-lines-table-form.component-DBPMTKqD.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-lines-table-form.component-BqKJDK9M.mjs.map → sdcorejs-angular-modules-pattern-lines-table-form.component-DBPMTKqD.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CIkZmM47.mjs +501 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CIkZmM47.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CgKUBP46.mjs +506 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CgKUBP46.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs → sdcorejs-angular-modules-pattern-list.component-Co22ltOo.mjs} +30 -39
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Co22ltOo.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs → sdcorejs-angular-modules-pattern-list.component-D1Q69_3M.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-DH3CroK1.mjs.map → sdcorejs-angular-modules-pattern-list.component-D1Q69_3M.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs → sdcorejs-angular-modules-pattern-list.component-DBnStJM_.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-list.component-BMpOXn7E.mjs.map → sdcorejs-angular-modules-pattern-list.component-DBnStJM_.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs → sdcorejs-angular-modules-pattern-mock-backend.factory-DexrG-bI.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-mock-backend.factory-DnB5_C1D.mjs.map → sdcorejs-angular-modules-pattern-mock-backend.factory-DexrG-bI.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs → sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs} +4 -22
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-DuhyXsGn.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs → sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs} +26 -27
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-bfpj85ke.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-DZ3fY-yQ.mjs → sdcorejs-angular-modules-pattern-product.service-DG1pe8fb.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-product.service-DZ3fY-yQ.mjs.map → sdcorejs-angular-modules-pattern-product.service-DG1pe8fb.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs → sdcorejs-angular-modules-pattern-profile.component-CLvjGnbA.mjs} +24 -14
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-CLvjGnbA.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8ceLXT4.mjs +65 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-B8ceLXT4.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C1YBKLdb.mjs +56 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-C1YBKLdb.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs → sdcorejs-angular-modules-pattern-routes-CntNjuzb.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-BGZzmwY2.mjs.map → sdcorejs-angular-modules-pattern-routes-CntNjuzb.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs → sdcorejs-angular-modules-pattern-routes-CwfyLo_V.mjs} +5 -5
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-CdSiqJCz.mjs.map → sdcorejs-angular-modules-pattern-routes-CwfyLo_V.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs → sdcorejs-angular-modules-pattern-routes-DAw75sbm.mjs} +8 -8
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-B8i5MUtz.mjs.map → sdcorejs-angular-modules-pattern-routes-DAw75sbm.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs → sdcorejs-angular-modules-pattern-routes-DZmBTvxf.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-C_CLbNSs.mjs.map → sdcorejs-angular-modules-pattern-routes-DZmBTvxf.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs → sdcorejs-angular-modules-pattern-routes-Dp3-TMG3.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-uRsy0zag.mjs.map → sdcorejs-angular-modules-pattern-routes-Dp3-TMG3.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs → sdcorejs-angular-modules-pattern-routes-WyOa9Q3H.mjs} +3 -3
- package/fesm2022/{sdcorejs-angular-modules-pattern-routes-p7lQcGGX.mjs.map → sdcorejs-angular-modules-pattern-routes-WyOa9Q3H.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CsipDO_7.mjs} +12 -12
- package/fesm2022/{sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-els-Wxch.mjs.map → sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-CsipDO_7.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs → sdcorejs-angular-modules-pattern-shell.component-Dy1a9seQ.mjs} +4 -4
- package/fesm2022/{sdcorejs-angular-modules-pattern-shell.component-5G4lKoLv.mjs.map → sdcorejs-angular-modules-pattern-shell.component-Dy1a9seQ.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-CBpuQnHp.mjs +480 -0
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-CBpuQnHp.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs → sdcorejs-angular-modules-pattern-update.component-B8N158up.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-CpGbjd_m.mjs.map → sdcorejs-angular-modules-pattern-update.component-B8N158up.mjs.map} +1 -1
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs → sdcorejs-angular-modules-pattern-update.component-BBktRBkQ.mjs} +9 -6
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-BBktRBkQ.mjs.map +1 -0
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs → sdcorejs-angular-modules-pattern-update.component-C9Wf6jhW.mjs} +2 -2
- package/fesm2022/{sdcorejs-angular-modules-pattern-update.component-Bq_5H0xM.mjs.map → sdcorejs-angular-modules-pattern-update.component-C9Wf6jhW.mjs.map} +1 -1
- package/fesm2022/sdcorejs-angular-modules-pattern.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +171 -158
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-query-params.mjs +226 -0
- package/fesm2022/sdcorejs-angular-services-query-params.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +24 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
- package/modules/pattern/README.md +5 -4
- package/modules/pattern/docs/detail.md +18 -9
- package/modules/pattern/docs/drawer.md +185 -83
- package/modules/pattern/docs/header-actions.md +1 -1
- package/modules/pattern/docs/list.md +3 -3
- package/modules/pattern/docs/states.md +1 -1
- package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +12 -16
- package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +58 -29
- package/modules/pattern/features/category/pages/list/list.component.html +11 -3
- package/modules/pattern/features/category/pages/list/list.component.ts +36 -10
- package/modules/pattern/features/category/routes.ts +5 -22
- package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +7 -11
- package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +70 -27
- package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +9 -53
- package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +53 -19
- package/modules/pattern/features/customer/entity.resolver.ts +1 -1
- package/modules/pattern/features/customer/pages/list/list.component.html +18 -3
- package/modules/pattern/features/customer/pages/list/list.component.ts +43 -16
- package/modules/pattern/features/customer/pages/profile/profile.component.ts +17 -8
- package/modules/pattern/features/customer/routes.ts +6 -27
- package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +37 -56
- package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +14 -76
- package/modules/pattern/features/order/pages/create/create.component.ts +7 -3
- package/modules/pattern/features/order/pages/detail/detail.component.ts +1 -1
- package/modules/pattern/features/order/pages/update/update.component.ts +5 -2
- package/package.json +17 -5
- package/types/sdcorejs-angular-components-anchor.d.ts +6 -1
- package/types/sdcorejs-angular-components-button.d.ts +7 -1
- package/types/sdcorejs-angular-components-calendar.d.ts +1092 -0
- package/types/sdcorejs-angular-components-card.d.ts +247 -9
- package/types/sdcorejs-angular-components-kanban.d.ts +191 -74
- package/types/sdcorejs-angular-components-modal.d.ts +10 -1
- package/types/sdcorejs-angular-components-query-bar.d.ts +176 -36
- package/types/sdcorejs-angular-components-quick-action.d.ts +65 -1
- package/types/sdcorejs-angular-components-scheduler.d.ts +544 -0
- package/types/sdcorejs-angular-components-tab.d.ts +6 -1
- package/types/sdcorejs-angular-components-table.d.ts +56 -7
- package/types/sdcorejs-angular-components-timeline.d.ts +216 -0
- package/types/sdcorejs-angular-components-tree.d.ts +119 -6
- package/types/sdcorejs-angular-components.d.ts +3 -1
- package/types/sdcorejs-angular-directives.d.ts +4 -2
- package/types/sdcorejs-angular-forms-date.d.ts +2 -0
- package/types/sdcorejs-angular-forms-directives.d.ts +1 -1
- package/types/sdcorejs-angular-i18n.d.ts +121 -9
- package/types/sdcorejs-angular-modules-layout.d.ts +2 -1
- package/types/sdcorejs-angular-services-confirm.d.ts +22 -81
- package/types/sdcorejs-angular-services-query-params.d.ts +67 -0
- package/types/sdcorejs-angular-utilities-extensions.d.ts +10 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +0 -54
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs +0 -144
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-7d4hJjAo.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs +0 -145
- package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-CGkdzJ-A.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-create.component-CCHeD5tf.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +0 -18
- package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs +0 -148
- package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bza4JOdZ.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BcxxJCVt.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +0 -232
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +0 -87
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +0 -70
- package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs +0 -164
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-B6_x5N3F.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Cj03DgF1.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs +0 -118
- package/fesm2022/sdcorejs-angular-modules-pattern-list.component-D-pHPHFP.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BqHwKfoc.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-CIiLOizq.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-DVYnHOtn.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs +0 -99
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-BPofy0Oq.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs +0 -74
- package/fesm2022/sdcorejs-angular-modules-pattern-routes-CYeHFGl1.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs +0 -132
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-BF0hAVrv.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs +0 -143
- package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-DJeQxfDA.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-modules-pattern-update.component-Bwsqvl4A.mjs.map +0 -1
- package/modules/pattern/features/category/entity.resolver.ts +0 -27
- package/types/sdcorejs-angular-components-history.d.ts +0 -23
|
@@ -0,0 +1,1932 @@
|
|
|
1
|
+
import { CdkDrag } from '@angular/cdk/drag-drop';
|
|
2
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, TemplateRef, Directive, input, NgZone, ElementRef, Injector, model, booleanAttribute, output, contentChild, viewChild, signal, computed, DestroyRef, effect, untracked, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
5
|
+
import { ɵsdCalendarStartOfWeek as _sdCalendarStartOfWeek, ɵsdCalendarDaysBetween as _sdCalendarDaysBetween, ɵsdCalendarAddDays as _sdCalendarAddDays, ɵsdCalendarAddMonths as _sdCalendarAddMonths, ɵsdCalendarIsWeekend as _sdCalendarIsWeekend, SD_CALENDAR_CONFIGURATION, ɵSdCalendarReporter as _SdCalendarReporter, ɵSdCalendarLoader as _SdCalendarLoader, ɵSdCalendarOperation as _SdCalendarOperation, ɵSdCalendarAnnouncer as _SdCalendarAnnouncer, ɵSdCalendarHostWidth as _SdCalendarHostWidth, ɵSdCalendarMinuteTimer as _SdCalendarMinuteTimer, ɵSdCalendarScopeBar as _SdCalendarScopeBar, ɵSdCalendarFocusKeeper as _SdCalendarFocusKeeper, ɵsdCalendarCssEscape as _sdCalendarCssEscape, ɵSdCalendarEdgeScroller as _SdCalendarEdgeScroller, ɵSdCalendarMoveRunner as _SdCalendarMoveRunner, ɵSdCalendarCreateRunner as _SdCalendarCreateRunner, ɵsdCalendarResolveStep as _sdCalendarResolveStep, ɵsdCalendarResolveFirstDayOfWeek as _sdCalendarResolveFirstDayOfWeek, ɵsdCalendarResolveWorkingHours as _sdCalendarResolveWorkingHours, ɵsdCalendarHolidayMap as _sdCalendarHolidayMap, ɵsdCalendarCarrierDay as _sdCalendarCarrierDay, ɵsdCalendarReadDay as _sdCalendarReadDay, ɵsdCalendarBoundDay as _sdCalendarBoundDay, ɵsdCalendarRangeKey as _sdCalendarRangeKey, ɵsdCalendarSameList as _sdCalendarSameList, ɵsdCalendarFormats as _sdCalendarFormats, ɵsdCalendarDateText as _sdCalendarDateText, ɵsdCalendarTitle as _sdCalendarTitle, ɵsdCalendarInvalidItems as _sdCalendarInvalidItems, ɵsdCalendarPlace as _sdCalendarPlace, ɵsdCalendarNormalizeStep as _sdCalendarNormalizeStep, ɵsdCalendarBrokenWeekdays as _sdCalendarBrokenWeekdays, ɵsdCalendarSelectionGone as _sdCalendarSelectionGone, ɵsdCalendarMoveTarget as _sdCalendarMoveTarget, ɵsdCalendarShiftDate as _sdCalendarShiftDate, ɵsdCalendarPointOf as _sdCalendarPointOf, ɵsdCalendarTargetOf as _sdCalendarTargetOf, ɵsdCalendarResizeEnd as _sdCalendarResizeEnd, ɵsdCalendarMoveStep as _sdCalendarMoveStep, ɵsdCalendarShiftDays as _sdCalendarShiftDays, ɵsdCalendarWeekdayLong as _sdCalendarWeekdayLong, ɵsdCalendarClockText as _sdCalendarClockText, ɵsdCalendarWorkingRanges as _sdCalendarWorkingRanges, ɵsdCalendarWeekday as _sdCalendarWeekday, ɵsdCalendarTimeToMinutes as _sdCalendarTimeToMinutes, ɵSD_CALENDAR_DEFAULTS as _SD_CALENDAR_DEFAULTS, ɵsdCalendarSlot as _sdCalendarSlot, ɵsdCalendarSweep as _sdCalendarSweep, ɵsdCalendarRangeOf as _sdCalendarRangeOf, ɵsdCalendarAllows as _sdCalendarAllows, ɵsdCalendarOutOfRange as _sdCalendarOutOfRange, ɵsdCalendarColor as _sdCalendarColor, ɵsdCalendarSnapMove as _sdCalendarSnapMove, ɵsdCalendarDayDiff as _sdCalendarDayDiff, ɵsdCalendarLastDayOf as _sdCalendarLastDayOf, ɵsdCalendarMovedText as _sdCalendarMovedText, ɵsdCalendarDayParts as _sdCalendarDayParts, ɵsdCalendarIsOffDay as _sdCalendarIsOffDay, ɵsdCalendarOffSegments as _sdCalendarOffSegments, ɵsdCalendarIsRtl as _sdCalendarIsRtl } from '@sdcorejs/angular/components/calendar';
|
|
6
|
+
import { SdAvatar } from '@sdcorejs/angular/components/avatar';
|
|
7
|
+
import { SdDataState } from '@sdcorejs/angular/components/data-state';
|
|
8
|
+
import { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';
|
|
9
|
+
import { SdIcon } from '@sdcorejs/angular/modules/icon';
|
|
10
|
+
import { SdDateTimeService } from '@sdcorejs/angular/services/date-time';
|
|
11
|
+
|
|
12
|
+
/** Replaces the content of an event block; frame, colour, handle and states stay. `let-event`. */
|
|
13
|
+
class SdSchedulerEventTemplateDirective {
|
|
14
|
+
template = inject(TemplateRef);
|
|
15
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerEventTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
19
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SdSchedulerEventTemplateDirective, isStandalone: true, selector: "ng-template[sdSchedulerEventTemplate]", ngImport: i0 });
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerEventTemplateDirective, decorators: [{
|
|
22
|
+
type: Directive,
|
|
23
|
+
args: [{ selector: 'ng-template[sdSchedulerEventTemplate]', standalone: true }]
|
|
24
|
+
}] });
|
|
25
|
+
/** Replaces the content of a resource cell; its frame, width and sticky position stay. `let-resource`. */
|
|
26
|
+
class SdSchedulerResourceTemplateDirective {
|
|
27
|
+
template = inject(TemplateRef);
|
|
28
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerResourceTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
32
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SdSchedulerResourceTemplateDirective, isStandalone: true, selector: "ng-template[sdSchedulerResourceTemplate]", ngImport: i0 });
|
|
33
|
+
}
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerResourceTemplateDirective, decorators: [{
|
|
35
|
+
type: Directive,
|
|
36
|
+
args: [{ selector: 'ng-template[sdSchedulerResourceTemplate]', standalone: true }]
|
|
37
|
+
}] });
|
|
38
|
+
/**
|
|
39
|
+
* Draws one cell per resource and day instead of event blocks (a timesheet). In the views it applies to there are
|
|
40
|
+
* no blocks, no drag and no resize: a cell with events emits `sdCellSelect`, an empty one creates. `let-date`.
|
|
41
|
+
*/
|
|
42
|
+
class SdSchedulerCellTemplateDirective {
|
|
43
|
+
template = inject(TemplateRef);
|
|
44
|
+
/** Views the template applies to. Defaults to week and month; the day view always draws blocks. */
|
|
45
|
+
views = input(['week', 'month'], ...(ngDevMode ? [{ debugName: "views" }] : /* istanbul ignore next */ []));
|
|
46
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerCellTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
50
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.17", type: SdSchedulerCellTemplateDirective, isStandalone: true, selector: "ng-template[sdSchedulerCellTemplate]", inputs: { views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
51
|
+
}
|
|
52
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerCellTemplateDirective, decorators: [{
|
|
53
|
+
type: Directive,
|
|
54
|
+
args: [{ selector: 'ng-template[sdSchedulerCellTemplate]', standalone: true }]
|
|
55
|
+
}], propDecorators: { views: [{ type: i0.Input, args: [{ isSignal: true, alias: "views", required: false }] }] } });
|
|
56
|
+
/** Replaces the "No resources" state. `let-range`. */
|
|
57
|
+
class SdSchedulerEmptyTemplateDirective {
|
|
58
|
+
template = inject(TemplateRef);
|
|
59
|
+
static ngTemplateContextGuard(_directive, _context) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerEmptyTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
63
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: SdSchedulerEmptyTemplateDirective, isStandalone: true, selector: "ng-template[sdSchedulerEmptyTemplate]", ngImport: i0 });
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSchedulerEmptyTemplateDirective, decorators: [{
|
|
66
|
+
type: Directive,
|
|
67
|
+
args: [{ selector: 'ng-template[sdSchedulerEmptyTemplate]', standalone: true }]
|
|
68
|
+
}] });
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Pure helpers of `sd-scheduler` (scheduler.md §1): only what the calendar does not have. Day arithmetic, rounding,
|
|
72
|
+
* reading and writing dates come from the `ɵ` exports of `@sdcorejs/angular/components/calendar`.
|
|
73
|
+
*/
|
|
74
|
+
const MINUTES_PER_DAY = 1440;
|
|
75
|
+
/** Row height without events and per lane (§7). */
|
|
76
|
+
const ROW_MIN = 48;
|
|
77
|
+
const LANE = 32;
|
|
78
|
+
/** Smallest block on the hour axis (§8.2). */
|
|
79
|
+
const MIN_BLOCK = 12;
|
|
80
|
+
/** Days of the visible range, both ends: one day, the week of `firstDayOfWeek` that holds `date`, or its month (§6). */
|
|
81
|
+
function sdSchedulerVisibleDays(view, date, firstDayOfWeek) {
|
|
82
|
+
if (view === 'week') {
|
|
83
|
+
const start = _sdCalendarStartOfWeek(date, firstDayOfWeek);
|
|
84
|
+
return _sdCalendarDaysBetween(start, _sdCalendarAddDays(start, 6));
|
|
85
|
+
}
|
|
86
|
+
if (view === 'month') {
|
|
87
|
+
const first = _sdCalendarAddMonths(date, 0);
|
|
88
|
+
return _sdCalendarDaysBetween(first, _sdCalendarAddDays(_sdCalendarAddMonths(date, 1), -1));
|
|
89
|
+
}
|
|
90
|
+
return [date];
|
|
91
|
+
}
|
|
92
|
+
/** `from`/`to` of the visible range; `hideWeekends` does not change them (§6). */
|
|
93
|
+
function sdSchedulerVisibleRange(view, date, firstDayOfWeek) {
|
|
94
|
+
const days = sdSchedulerVisibleDays(view, date, firstDayOfWeek);
|
|
95
|
+
return { from: days[0], to: days[days.length - 1], view };
|
|
96
|
+
}
|
|
97
|
+
/** Columns drawn: the visible days, Saturday and Sunday left out of a week or a month with `hideWeekends`. */
|
|
98
|
+
function sdSchedulerColumns(days, view, hideWeekends) {
|
|
99
|
+
return view !== 'day' && hideWeekends ? days.filter(day => !_sdCalendarIsWeekend(day)) : [...days];
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Lanes of one resource row (§8.4): sorted by start, all-day first on a tie, then by `at`, then the longer first; each
|
|
103
|
+
* item takes the first lane whose last end is at or before its start, otherwise a new lane.
|
|
104
|
+
*/
|
|
105
|
+
function sdSchedulerLanes(items) {
|
|
106
|
+
const sorted = items
|
|
107
|
+
.map((item, index) => ({ item, index }))
|
|
108
|
+
.sort((a, b) => a.item.start - b.item.start ||
|
|
109
|
+
Number(b.item.allDay) - Number(a.item.allDay) ||
|
|
110
|
+
(a.item.at ?? 0) - (b.item.at ?? 0) ||
|
|
111
|
+
b.item.end - a.item.end);
|
|
112
|
+
const ends = [];
|
|
113
|
+
const order = sorted.map(({ item, index }) => {
|
|
114
|
+
let lane = ends.findIndex(end => end <= item.start);
|
|
115
|
+
if (lane < 0)
|
|
116
|
+
lane = ends.push(item.end) - 1;
|
|
117
|
+
else
|
|
118
|
+
ends[lane] = item.end;
|
|
119
|
+
return { index, lane };
|
|
120
|
+
});
|
|
121
|
+
return { count: Math.max(1, ends.length), order };
|
|
122
|
+
}
|
|
123
|
+
/** Row height in px: `max(48, 8 + 32 × lanes)` (§7). */
|
|
124
|
+
function sdSchedulerRowHeight(lanes) {
|
|
125
|
+
return Math.max(ROW_MIN, 8 + LANE * Math.max(1, lanes));
|
|
126
|
+
}
|
|
127
|
+
/** Top of a block in its row (px): 10 with one lane, `6 + lane × 32` from two lanes (§7). */
|
|
128
|
+
function sdSchedulerLaneTop(lane, lanes) {
|
|
129
|
+
return lanes <= 1 ? 10 : 6 + lane * LANE;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Part of `day` an event covers on the hour axis (§8.2). All-day events cover the whole day. A side that goes past
|
|
133
|
+
* `day` is clipped. `null` when the event does not touch `day` (a timed event that ends at 00:00 of `day` included).
|
|
134
|
+
*/
|
|
135
|
+
function sdSchedulerDaySpan(placement, day) {
|
|
136
|
+
if (placement.firstDay > day || placement.lastDay < day)
|
|
137
|
+
return null;
|
|
138
|
+
if (placement.allDay) {
|
|
139
|
+
return { start: 0, end: MINUTES_PER_DAY, clippedStart: placement.firstDay < day, clippedEnd: placement.lastDay > day };
|
|
140
|
+
}
|
|
141
|
+
// An end at 24:00 of the start day is read as the start day at 1440, so it is not clipped.
|
|
142
|
+
const clippedStart = placement.startDay < day;
|
|
143
|
+
const clippedEnd = placement.endDay > day;
|
|
144
|
+
const start = clippedStart ? 0 : placement.startMinutes;
|
|
145
|
+
return { start, end: clippedEnd ? MINUTES_PER_DAY : placement.endMinutes, clippedStart, clippedEnd };
|
|
146
|
+
}
|
|
147
|
+
/** Inline start and size (px) of a block on the hour axis: 1px gap before, 2px after, at least 12px (§7, §8.2). */
|
|
148
|
+
function sdSchedulerDayBox(span, hourWidth) {
|
|
149
|
+
return {
|
|
150
|
+
left: (span.start / 60) * hourWidth + 1,
|
|
151
|
+
width: Math.max(MIN_BLOCK, ((span.end - span.start) / 60) * hourWidth - 3),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Columns an event covers on the day axis (§8.2): a timed event that stays in its day takes the column of its start
|
|
156
|
+
* day; all-day events and timed events across midnight take every column they cover. `null` when none is drawn.
|
|
157
|
+
*/
|
|
158
|
+
function sdSchedulerColumnSpan(placement, columns) {
|
|
159
|
+
if (!columns.length)
|
|
160
|
+
return null;
|
|
161
|
+
if (placement.inGrid) {
|
|
162
|
+
const column = columns.indexOf(placement.startDay);
|
|
163
|
+
return column < 0 ? null : { from: column, to: column, clippedStart: false, clippedEnd: false };
|
|
164
|
+
}
|
|
165
|
+
const from = columns.findIndex(day => day >= placement.firstDay);
|
|
166
|
+
let to = columns.length - 1;
|
|
167
|
+
while (to >= 0 && columns[to] > placement.lastDay)
|
|
168
|
+
to--;
|
|
169
|
+
if (from < 0 || to < from)
|
|
170
|
+
return null;
|
|
171
|
+
return { from, to, clippedStart: placement.firstDay < columns[0], clippedEnd: placement.lastDay > columns[columns.length - 1] };
|
|
172
|
+
}
|
|
173
|
+
/** Inline start and size of a column span as fractions of the row (0–1). */
|
|
174
|
+
function sdSchedulerColumnBox(span, count) {
|
|
175
|
+
return { start: span.from / count, size: (span.to - span.from + 1) / count };
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Resource of `Alt` + `↑` `↓` (§9.7): the nearest one in `direction` that `accept` allows. `ids` are every resource in
|
|
179
|
+
* row order, those of collapsed groups included (the move opens the group, Step 0 H4); group rows are not resources.
|
|
180
|
+
*/
|
|
181
|
+
function sdSchedulerNextResource(ids, current, direction, accept) {
|
|
182
|
+
for (let index = ids.indexOf(current) + direction; index >= 0 && index < ids.length; index += direction) {
|
|
183
|
+
if (accept(ids[index]))
|
|
184
|
+
return ids[index];
|
|
185
|
+
}
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* New last day of an all-day event whose end moved by `shift` columns (§9.4): along the columns on screen, so
|
|
190
|
+
* `hideWeekends` skips the weekend; at least its first column, at most the last column. `null` when the last day has no
|
|
191
|
+
* column (cut by the end of the range, or on a hidden weekend day): the end on screen is not the event's end, so that
|
|
192
|
+
* block has no end handle and a resize there would cut the event short.
|
|
193
|
+
*/
|
|
194
|
+
function sdSchedulerResizeLastDay(placement, columns, shift) {
|
|
195
|
+
const end = columns.indexOf(placement.lastDay);
|
|
196
|
+
if (end < 0)
|
|
197
|
+
return null;
|
|
198
|
+
const first = columns.findIndex(day => day >= placement.firstDay);
|
|
199
|
+
return columns[Math.min(columns.length - 1, Math.max(first, end + shift))];
|
|
200
|
+
}
|
|
201
|
+
/** Resources in row order (§10): those without a group first, then each group in the order of its first resource. */
|
|
202
|
+
function sdSchedulerGroups(resources) {
|
|
203
|
+
const ungrouped = [];
|
|
204
|
+
const groups = new Map();
|
|
205
|
+
for (const resource of resources) {
|
|
206
|
+
if (!resource.group) {
|
|
207
|
+
ungrouped.push(resource);
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const list = groups.get(resource.group);
|
|
211
|
+
if (list)
|
|
212
|
+
list.push(resource);
|
|
213
|
+
else
|
|
214
|
+
groups.set(resource.group, [resource]);
|
|
215
|
+
}
|
|
216
|
+
return { ungrouped, groups: [...groups].map(([name, list]) => ({ name, resources: list })) };
|
|
217
|
+
}
|
|
218
|
+
/** Row under `y` (content coordinates), by binary search over rows sorted by `top`; `null` above or below every row. */
|
|
219
|
+
function sdSchedulerRowAt(rows, y) {
|
|
220
|
+
let low = 0;
|
|
221
|
+
let high = rows.length - 1;
|
|
222
|
+
while (low <= high) {
|
|
223
|
+
const middle = (low + high) >> 1;
|
|
224
|
+
const row = rows[middle];
|
|
225
|
+
if (y < row.top)
|
|
226
|
+
high = middle - 1;
|
|
227
|
+
else if (y >= row.bottom)
|
|
228
|
+
low = middle + 1;
|
|
229
|
+
else
|
|
230
|
+
return row;
|
|
231
|
+
}
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const ALL_VIEWS = ['day', 'week', 'month'];
|
|
236
|
+
const MINUTE = 60_000;
|
|
237
|
+
/** Pointer travel (px) under which a press is a click (§9.1). */
|
|
238
|
+
const CLICK_SLOP = 5;
|
|
239
|
+
/** Sizes of §7 and §11, used until the real ones are measured on the rendered element. */
|
|
240
|
+
const SIZES = { hour: 80, resource: 240, day: 120, month: 28 };
|
|
241
|
+
const COMPACT_SIZES = { hour: 64, resource: 120, day: 96, month: 28 };
|
|
242
|
+
/** Gaps around a block (px): before and after on the hour axis, before and after on the day axis (§7). */
|
|
243
|
+
const DAY_GAP = { before: 1, after: 2 };
|
|
244
|
+
const COLUMN_GAP = { before: 2, after: 3 };
|
|
245
|
+
/** Floating label (§8.3): 6px from the block; under 160px of track left after the block it goes before it. */
|
|
246
|
+
const LABEL_GAP = 6;
|
|
247
|
+
const LABEL_ROOM = 160;
|
|
248
|
+
/** Where the first-load skeleton draws its blocks on the first three rows: [inline start, size] as fractions (§12). */
|
|
249
|
+
const SKELETON = [
|
|
250
|
+
[0.08, 0.22],
|
|
251
|
+
[0.3, 0.16],
|
|
252
|
+
[0.14, 0.3],
|
|
253
|
+
];
|
|
254
|
+
let nextSchedulerId = 0;
|
|
255
|
+
/** Resource scheduler: one row per resource, day / week / month on the inline axis (see `sd-scheduler.md`). */
|
|
256
|
+
class SdScheduler {
|
|
257
|
+
#clock = inject(SdDateTimeService);
|
|
258
|
+
#i18n = inject(I18nService);
|
|
259
|
+
#configuration = inject(SD_CALENDAR_CONFIGURATION, { optional: true });
|
|
260
|
+
#zone = inject(NgZone);
|
|
261
|
+
#host = inject(ElementRef);
|
|
262
|
+
#injector = inject(Injector);
|
|
263
|
+
#reporter = new _SdCalendarReporter('[sd-scheduler]');
|
|
264
|
+
baseId = `sd-scheduler-${nextSchedulerId++}`;
|
|
265
|
+
/** Data source and capabilities. A new object is the signal to load again. */
|
|
266
|
+
option = input.required(...(ngDevMode ? [{ debugName: "option" }] : /* istanbul ignore next */ []));
|
|
267
|
+
/** Rows, in this order (grouped by `group`). A new array loads again; an empty one shows the empty state. */
|
|
268
|
+
resources = input.required(...(ngDevMode ? [{ debugName: "resources" }] : /* istanbul ignore next */ []));
|
|
269
|
+
/** Layout on screen; one of `views`, otherwise the first of `views`. */
|
|
270
|
+
view = model('day', ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
271
|
+
/** Anchor day; the scheduler writes back `'yyyy/MM/dd'`. Defaults to today in the zone. */
|
|
272
|
+
date = model(undefined, ...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
|
|
273
|
+
/** Id of the selected event; back to `null` when the event is no longer loaded. */
|
|
274
|
+
selectedId = model(null, ...(ngDevMode ? [{ debugName: "selectedId" }] : /* istanbul ignore next */ []));
|
|
275
|
+
/** Views offered by the switcher, in this order. */
|
|
276
|
+
views = input(ALL_VIEWS, ...(ngDevMode ? [{ debugName: "views" }] : /* istanbul ignore next */ []));
|
|
277
|
+
/** Text of the corner cell; defaults to the translated "Resources". */
|
|
278
|
+
resourceLabel = input(undefined, ...(ngDevMode ? [{ debugName: "resourceLabel" }] : /* istanbul ignore next */ []));
|
|
279
|
+
/** Minutes of one slot of the day view, a divisor of 60. Configuration, then 30. */
|
|
280
|
+
step = input(undefined, ...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
281
|
+
/** 0–6, 0 is Sunday. Configuration, then 1. */
|
|
282
|
+
firstDayOfWeek = input(undefined, ...(ngDevMode ? [{ debugName: "firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
283
|
+
/** Hides Saturday and Sunday in the week and month views; `from`/`to` still span the whole week or month. */
|
|
284
|
+
hideWeekends = input(false, { ...(ngDevMode ? { debugName: "hideWeekends" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
285
|
+
/** `null` turns the off-hours shading off. Configuration, then Monday–Friday. A resource can override it. */
|
|
286
|
+
workingHours = input(undefined, ...(ngDevMode ? [{ debugName: "workingHours" }] : /* istanbul ignore next */ []));
|
|
287
|
+
/** Configuration, then none. */
|
|
288
|
+
holidays = input(undefined, ...(ngDevMode ? [{ debugName: "holidays" }] : /* istanbul ignore next */ []));
|
|
289
|
+
/** First day that can be shown and edited, compared as a calendar day in the zone. */
|
|
290
|
+
minDate = input(undefined, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
291
|
+
/** Last day that can be shown and edited, compared as a calendar day in the zone. */
|
|
292
|
+
maxDate = input(undefined, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
293
|
+
/** `'HH:mm'` the day view scrolls to. Configuration, then the earliest working hour, then 08:00. */
|
|
294
|
+
scrollTime = input(undefined, ...(ngDevMode ? [{ debugName: "scrollTime" }] : /* istanbul ignore next */ []));
|
|
295
|
+
/** Fades events that have ended. */
|
|
296
|
+
dimPast = input(false, { ...(ngDevMode ? { debugName: "dimPast" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
297
|
+
/** Serialization of the values the scheduler emits; see "Date values" in `sd-calendar.md`. */
|
|
298
|
+
transform = input(undefined, ...(ngDevMode ? [{ debugName: "transform" }] : /* istanbul ignore next */ []));
|
|
299
|
+
/** No create, move or selection; events leave the tab order. Navigation still works. */
|
|
300
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
301
|
+
/** No create or move. Selection and navigation still work. */
|
|
302
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
303
|
+
/** Accessible name of the region and of the scroll area; defaults to the translated "Resource schedule". */
|
|
304
|
+
ariaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
305
|
+
/** E2E scope: `data-autoid="components-scheduler-{autoId}"` and derived child ids. */
|
|
306
|
+
autoId = input(undefined, ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
|
|
307
|
+
/** An event was clicked, tapped or activated with Enter/Space. */
|
|
308
|
+
sdSelect = output();
|
|
309
|
+
/** Once on init, then whenever `from`, `to` or the view changes (not when only `resources` change). */
|
|
310
|
+
sdRangeChange = output();
|
|
311
|
+
/** `onMove` accepted and the data changed. */
|
|
312
|
+
sdMove = output();
|
|
313
|
+
/** `onMove` rejected or failed. */
|
|
314
|
+
sdMoveError = output();
|
|
315
|
+
/** `onLoad` threw or rejected (never for an aborted load). */
|
|
316
|
+
sdLoadError = output();
|
|
317
|
+
/** Cell template only: a cell with at least one event was clicked, tapped or activated with Enter. */
|
|
318
|
+
sdCellSelect = output();
|
|
319
|
+
eventTemplate = contentChild(SdSchedulerEventTemplateDirective, ...(ngDevMode ? [{ debugName: "eventTemplate" }] : /* istanbul ignore next */ []));
|
|
320
|
+
resourceTemplate = contentChild(SdSchedulerResourceTemplateDirective, ...(ngDevMode ? [{ debugName: "resourceTemplate" }] : /* istanbul ignore next */ []));
|
|
321
|
+
cellTemplate = contentChild(SdSchedulerCellTemplateDirective, ...(ngDevMode ? [{ debugName: "cellTemplate" }] : /* istanbul ignore next */ []));
|
|
322
|
+
emptyTemplate = contentChild(SdSchedulerEmptyTemplateDirective, ...(ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []));
|
|
323
|
+
scroller = viewChild('scroller', ...(ngDevMode ? [{ debugName: "scroller" }] : /* istanbul ignore next */ []));
|
|
324
|
+
gridElement = viewChild('grid', ...(ngDevMode ? [{ debugName: "gridElement" }] : /* istanbul ignore next */ []));
|
|
325
|
+
root = viewChild('root', ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
|
|
326
|
+
#loader = new _SdCalendarLoader();
|
|
327
|
+
#operation = new _SdCalendarOperation();
|
|
328
|
+
#announcer = new _SdCalendarAnnouncer();
|
|
329
|
+
#now = signal(this.#clock.now(), ...(ngDevMode ? [{ debugName: "#now" }] : /* istanbul ignore next */ []));
|
|
330
|
+
#hostWidth = new _SdCalendarHostWidth(this.#host.nativeElement, this.#zone);
|
|
331
|
+
#width = this.#hostWidth.width;
|
|
332
|
+
#timer = new _SdCalendarMinuteTimer(this.#zone, () => this.#now.set(this.#clock.now()));
|
|
333
|
+
#sizes = signal(SIZES, ...(ngDevMode ? [{ debugName: "#sizes" }] : /* istanbul ignore next */ []));
|
|
334
|
+
/** Collapsed groups (§10): kept across ranges and views, pruned when `resources` drops a group. */
|
|
335
|
+
#collapsed = signal(new Set(), ...(ngDevMode ? [{ debugName: "#collapsed" }] : /* istanbul ignore next */ []));
|
|
336
|
+
/** Move waiting for `onMove`: the event is drawn at its target. */
|
|
337
|
+
#moving = signal(null, ...(ngDevMode ? [{ debugName: "#moving" }] : /* istanbul ignore next */ []));
|
|
338
|
+
#failure = signal(null, ...(ngDevMode ? [{ debugName: "#failure" }] : /* istanbul ignore next */ []));
|
|
339
|
+
/** Dashed block of a create (§9.2): minutes (day view) or column indexes, both inclusive (week, month). */
|
|
340
|
+
#ghost = signal(null, ...(ngDevMode ? [{ debugName: "#ghost" }] : /* istanbul ignore next */ []));
|
|
341
|
+
/** Keyboard cursor of the grid (§9.7): a row (`r:<id>` or `g:<group>`), a day and minutes of the day view. */
|
|
342
|
+
#cursor = signal(null, ...(ngDevMode ? [{ debugName: "#cursor" }] : /* istanbul ignore next */ []));
|
|
343
|
+
/** A drag just ended: the click that follows its mouseup must not select. Reset on the next press. */
|
|
344
|
+
#justDragged = false;
|
|
345
|
+
/** Where the press that may start a drag happened (CDK's start event is the move that crossed the threshold). */
|
|
346
|
+
#pickup = null;
|
|
347
|
+
#press = null;
|
|
348
|
+
/** Where a dragged block would land (§9.3); `null` while nothing is dragged. */
|
|
349
|
+
#drag = signal(null, ...(ngDevMode ? [{ debugName: "#drag" }] : /* istanbul ignore next */ []));
|
|
350
|
+
/** Live end of a resize (§9.4): minutes (day view) or the last day (week, month). */
|
|
351
|
+
#resize = signal(null, ...(ngDevMode ? [{ debugName: "#resize" }] : /* istanbul ignore next */ []));
|
|
352
|
+
/** Scope bar of a recurring event (§9.6); it holds the one waiting operation until answered. */
|
|
353
|
+
scopeBar = new _SdCalendarScopeBar(this.#host.nativeElement, this.#injector);
|
|
354
|
+
#focus = new _SdCalendarFocusKeeper(this.#host.nativeElement, this.#injector, id => `[data-event-id="${_sdCalendarCssEscape(id)}"][tabindex]`, '.sd-scheduler__scope');
|
|
355
|
+
#edge = new _SdCalendarEdgeScroller(this.#zone);
|
|
356
|
+
#t = (key, params) => this.#i18n.t(key, params);
|
|
357
|
+
#runner = new _SdCalendarMoveRunner({
|
|
358
|
+
operation: this.#operation,
|
|
359
|
+
announcer: this.#announcer,
|
|
360
|
+
focus: this.#focus,
|
|
361
|
+
t: this.#t,
|
|
362
|
+
ask: (title, signal) => this.scopeBar.ask(title, signal),
|
|
363
|
+
band: failure => this.#failure.set(failure),
|
|
364
|
+
reload: () => this.reload(),
|
|
365
|
+
});
|
|
366
|
+
#creator = new _SdCalendarCreateRunner({
|
|
367
|
+
operation: this.#operation,
|
|
368
|
+
announcer: this.#announcer,
|
|
369
|
+
t: this.#t,
|
|
370
|
+
band: failure => this.#failure.set(failure),
|
|
371
|
+
});
|
|
372
|
+
#dragSession = null;
|
|
373
|
+
#dragPointer = null;
|
|
374
|
+
#resizeSession = null;
|
|
375
|
+
#emittedKey = null;
|
|
376
|
+
#lastOption = null;
|
|
377
|
+
/** The ids of the resources of the last load, in order: only a change of this list loads again (R1 #7, PD). */
|
|
378
|
+
#lastResourceIds = null;
|
|
379
|
+
#lastRangeKey = null;
|
|
380
|
+
/** Bumped by every new `resources` array: part of the load key, so the grid clears until the new events arrive. */
|
|
381
|
+
#generation = 0;
|
|
382
|
+
#lastView = null;
|
|
383
|
+
/** Host narrower than 600px (§11): measured on the host, not the viewport. */
|
|
384
|
+
compact = computed(() => {
|
|
385
|
+
const width = this.#width();
|
|
386
|
+
return width !== null && width < 600;
|
|
387
|
+
}, ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
|
|
388
|
+
phase = this.#loader.phase.asReadonly();
|
|
389
|
+
announcement = this.#announcer.text;
|
|
390
|
+
failure = this.#failure.asReadonly();
|
|
391
|
+
busy = computed(() => this.#loader.phase() === 'loading' || this.#loader.phase() === 'reloading', ...(ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []));
|
|
392
|
+
skeleton = computed(() => this.#loader.phase() === 'loading' && !this.#loader.everLoaded(), ...(ngDevMode ? [{ debugName: "skeleton" }] : /* istanbul ignore next */ []));
|
|
393
|
+
rootAutoId = computed(() => (this.autoId() ? `components-scheduler-${this.autoId()}` : null), ...(ngDevMode ? [{ debugName: "rootAutoId" }] : /* istanbul ignore next */ []));
|
|
394
|
+
regionLabel = computed(() => this.ariaLabel() || this.#i18n.t('core.component.scheduler.label'), ...(ngDevMode ? [{ debugName: "regionLabel" }] : /* istanbul ignore next */ []));
|
|
395
|
+
cornerLabel = computed(() => this.resourceLabel() || this.#i18n.t('core.component.scheduler.resources'), ...(ngDevMode ? [{ debugName: "cornerLabel" }] : /* istanbul ignore next */ []));
|
|
396
|
+
stepValue = computed(() => _sdCalendarResolveStep(this.step(), this.#configuration), ...(ngDevMode ? [{ debugName: "stepValue" }] : /* istanbul ignore next */ []));
|
|
397
|
+
#firstDayOfWeek = computed(() => _sdCalendarResolveFirstDayOfWeek(this.firstDayOfWeek(), this.#configuration), ...(ngDevMode ? [{ debugName: "#firstDayOfWeek" }] : /* istanbul ignore next */ []));
|
|
398
|
+
#workingHours = computed(() => _sdCalendarResolveWorkingHours(this.workingHours(), this.#configuration), ...(ngDevMode ? [{ debugName: "#workingHours" }] : /* istanbul ignore next */ []));
|
|
399
|
+
#holidays = computed(() => _sdCalendarHolidayMap(this.holidays(), this.#configuration, this.#clock), ...(ngDevMode ? [{ debugName: "#holidays" }] : /* istanbul ignore next */ []));
|
|
400
|
+
today = computed(() => _sdCalendarCarrierDay(this.#now()), ...(ngDevMode ? [{ debugName: "today" }] : /* istanbul ignore next */ []));
|
|
401
|
+
#nowMinutes = computed(() => this.#now().getHours() * 60 + this.#now().getMinutes(), ...(ngDevMode ? [{ debugName: "#nowMinutes" }] : /* istanbul ignore next */ []));
|
|
402
|
+
#nowInstant = computed(() => this.#clock.fromWallClock(this.#now()).getTime(), ...(ngDevMode ? [{ debugName: "#nowInstant" }] : /* istanbul ignore next */ []));
|
|
403
|
+
#anchor = computed(() => {
|
|
404
|
+
const value = this.date();
|
|
405
|
+
return (value === null || value === undefined ? null : _sdCalendarReadDay(value, this.#clock)) ?? this.today();
|
|
406
|
+
}, ...(ngDevMode ? [{ debugName: "#anchor" }] : /* istanbul ignore next */ []));
|
|
407
|
+
#minDay = computed(() => _sdCalendarBoundDay(this.minDate(), this.today(), this.#clock), ...(ngDevMode ? [{ debugName: "#minDay" }] : /* istanbul ignore next */ []));
|
|
408
|
+
#maxDay = computed(() => _sdCalendarBoundDay(this.maxDate(), this.today(), this.#clock), ...(ngDevMode ? [{ debugName: "#maxDay" }] : /* istanbul ignore next */ []));
|
|
409
|
+
viewOptions = computed(() => (this.views().length ? this.views() : ALL_VIEWS), ...(ngDevMode ? [{ debugName: "viewOptions" }] : /* istanbul ignore next */ []));
|
|
410
|
+
activeView = computed(() => {
|
|
411
|
+
const views = this.viewOptions();
|
|
412
|
+
return views.includes(this.view()) ? this.view() : views[0];
|
|
413
|
+
}, ...(ngDevMode ? [{ debugName: "activeView" }] : /* istanbul ignore next */ []));
|
|
414
|
+
visible = computed(() => sdSchedulerVisibleRange(this.activeView(), this.#anchor(), this.#firstDayOfWeek()), { ...(ngDevMode ? { debugName: "visible" } : /* istanbul ignore next */ {}), equal: (a, b) => _sdCalendarRangeKey(a) === _sdCalendarRangeKey(b) });
|
|
415
|
+
/** Days drawn on the axis: the visible days without the weekend when `hideWeekends` (week, month). */
|
|
416
|
+
columns = computed(() => sdSchedulerColumns(sdSchedulerVisibleDays(this.activeView(), this.#anchor(), this.#firstDayOfWeek()), this.activeView(), this.hideWeekends()), { ...(ngDevMode ? { debugName: "columns" } : /* istanbul ignore next */ {}), equal: _sdCalendarSameList });
|
|
417
|
+
#formats = computed(() => _sdCalendarFormats(this.#i18n.locale(), this.#i18n.language()), ...(ngDevMode ? [{ debugName: "#formats" }] : /* istanbul ignore next */ []));
|
|
418
|
+
title = computed(() => {
|
|
419
|
+
const view = this.activeView();
|
|
420
|
+
const formats = this.#formats();
|
|
421
|
+
const columns = this.columns();
|
|
422
|
+
// why: with `hideWeekends` the week names the days of its columns, as sd-calendar (R2 #12, PD).
|
|
423
|
+
const { from, to } = view === 'week' && columns.length ? { from: columns[0], to: columns[columns.length - 1] } : this.visible();
|
|
424
|
+
// why: narrow, Day and Week use numeric dates, which fit one line (R2 #5, PD); Month keeps its name.
|
|
425
|
+
if (this.compact() && view === 'day')
|
|
426
|
+
return _sdCalendarDateText(formats, from, true);
|
|
427
|
+
const kind = this.compact() && view === 'week' ? 'range' : view;
|
|
428
|
+
return _sdCalendarTitle(kind, { anchor: this.#anchor(), from, to }, formats, (key, params) => this.#i18n.t(key, params));
|
|
429
|
+
}, ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
430
|
+
prevLabel = computed(() => this.#i18n.t(`core.component.calendar.prev-${this.activeView()}`), ...(ngDevMode ? [{ debugName: "prevLabel" }] : /* istanbul ignore next */ []));
|
|
431
|
+
nextLabel = computed(() => this.#i18n.t(`core.component.calendar.next-${this.activeView()}`), ...(ngDevMode ? [{ debugName: "nextLabel" }] : /* istanbul ignore next */ []));
|
|
432
|
+
prevDisabled = computed(() => {
|
|
433
|
+
const min = this.#minDay();
|
|
434
|
+
return !!min && this.#shiftedRange(-1).to < min;
|
|
435
|
+
}, ...(ngDevMode ? [{ debugName: "prevDisabled" }] : /* istanbul ignore next */ []));
|
|
436
|
+
nextDisabled = computed(() => {
|
|
437
|
+
const max = this.#maxDay();
|
|
438
|
+
return !!max && this.#shiftedRange(1).from > max;
|
|
439
|
+
}, ...(ngDevMode ? [{ debugName: "nextDisabled" }] : /* istanbul ignore next */ []));
|
|
440
|
+
/** Duplicate or empty ids, or an empty title, in `resources` or in the loaded events: nothing is shown (§12). */
|
|
441
|
+
invalid = computed(() => _sdCalendarInvalidItems(this.resources()) || _sdCalendarInvalidItems(this.#loader.items()), ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
442
|
+
empty = computed(() => !this.resources().length, ...(ngDevMode ? [{ debugName: "empty" }] : /* istanbul ignore next */ []));
|
|
443
|
+
/** No create and no move: disabled, readonly, loading, load error, invalid data or no resources (§4.1). */
|
|
444
|
+
locked = computed(() => this.disabled() || this.readonly() || this.busy() || this.#loader.phase() === 'error' || this.invalid() || this.empty(), ...(ngDevMode ? [{ debugName: "locked" }] : /* istanbul ignore next */ []));
|
|
445
|
+
/** A cell template applies to the view on screen: cells instead of blocks, no drag (§8.5). */
|
|
446
|
+
cellTemplateActive = computed(() => {
|
|
447
|
+
const template = this.cellTemplate();
|
|
448
|
+
const view = this.activeView();
|
|
449
|
+
return !!template && view !== 'day' && template.views().includes(view);
|
|
450
|
+
}, ...(ngDevMode ? [{ debugName: "cellTemplateActive" }] : /* istanbul ignore next */ []));
|
|
451
|
+
/** Create is on: `option.create` and not locked. */
|
|
452
|
+
canCreate = computed(() => !!this.option().create && !this.locked(), ...(ngDevMode ? [{ debugName: "canCreate" }] : /* istanbul ignore next */ []));
|
|
453
|
+
ghost = this.#ghost.asReadonly();
|
|
454
|
+
#resourceById = computed(() => new Map(this.resources().map(resource => [resource.id, resource])), ...(ngDevMode ? [{ debugName: "#resourceById" }] : /* istanbul ignore next */ []));
|
|
455
|
+
/** Effective working hours of a resource: its own (even `null`) when it declares them, otherwise the component's. */
|
|
456
|
+
#hoursOf = (resource) => resource.workingHours !== undefined ? resource.workingHours : this.#workingHours();
|
|
457
|
+
#reading = computed(() => {
|
|
458
|
+
const placed = [];
|
|
459
|
+
const unknown = [];
|
|
460
|
+
const unreadable = [];
|
|
461
|
+
const resources = this.#resourceById();
|
|
462
|
+
const moving = this.#moving();
|
|
463
|
+
for (const loaded of this.#loader.items()) {
|
|
464
|
+
const event = moving?.id === loaded.id ? moving.event : loaded;
|
|
465
|
+
if (!resources.has(event.resourceId)) {
|
|
466
|
+
unknown.push(event.id);
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
const placement = _sdCalendarPlace(event, this.#clock);
|
|
470
|
+
if (!placement) {
|
|
471
|
+
unreadable.push(event.id);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
const pending = moving?.id === loaded.id;
|
|
475
|
+
placed.push({ event, placement, pending, saving: pending && moving.saving });
|
|
476
|
+
}
|
|
477
|
+
return { placed, unknown, unreadable };
|
|
478
|
+
}, ...(ngDevMode ? [{ debugName: "#reading" }] : /* istanbul ignore next */ []));
|
|
479
|
+
#byResource = computed(() => {
|
|
480
|
+
const { from, to } = this.visible();
|
|
481
|
+
const map = new Map();
|
|
482
|
+
for (const item of this.#reading().placed) {
|
|
483
|
+
if (item.placement.lastDay < from || item.placement.firstDay > to)
|
|
484
|
+
continue;
|
|
485
|
+
const list = map.get(item.event.resourceId);
|
|
486
|
+
if (list)
|
|
487
|
+
list.push(item);
|
|
488
|
+
else
|
|
489
|
+
map.set(item.event.resourceId, [item]);
|
|
490
|
+
}
|
|
491
|
+
return map;
|
|
492
|
+
}, ...(ngDevMode ? [{ debugName: "#byResource" }] : /* istanbul ignore next */ []));
|
|
493
|
+
dayViews = computed(() => this.columns().map(day => this.#dayView(day)), ...(ngDevMode ? [{ debugName: "dayViews" }] : /* istanbul ignore next */ []));
|
|
494
|
+
hours = Array.from({ length: 24 }, (_, hour) => ({ hour, label: `${hour < 10 ? '0' : ''}${hour}:00` }));
|
|
495
|
+
rows = computed(() => {
|
|
496
|
+
const { ungrouped, groups } = sdSchedulerGroups(this.resources());
|
|
497
|
+
const collapsed = this.#collapsed();
|
|
498
|
+
const rows = ungrouped.map(resource => this.#resourceRow(resource, null));
|
|
499
|
+
groups.forEach((group, index) => {
|
|
500
|
+
const closed = collapsed.has(group.name);
|
|
501
|
+
const countText = this.#i18n.t('core.component.scheduler.group-count', { count: group.resources.length });
|
|
502
|
+
rows.push({
|
|
503
|
+
kind: 'group',
|
|
504
|
+
key: `g:${group.name}`,
|
|
505
|
+
headerId: `${this.baseId}-group-${index}`,
|
|
506
|
+
name: group.name,
|
|
507
|
+
count: group.resources.length,
|
|
508
|
+
collapsed: closed,
|
|
509
|
+
label: `${group.name}, ${countText}`,
|
|
510
|
+
hint: this.#i18n.t(`core.component.scheduler.group-${closed ? 'expand' : 'collapse'}`, { group: group.name }),
|
|
511
|
+
countText,
|
|
512
|
+
});
|
|
513
|
+
if (!closed)
|
|
514
|
+
rows.push(...group.resources.map(resource => this.#resourceRow(resource, group.name)));
|
|
515
|
+
});
|
|
516
|
+
return rows;
|
|
517
|
+
}, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
|
|
518
|
+
/** First three resource rows: where the skeleton draws (§12). */
|
|
519
|
+
skeletonRows = computed(() => {
|
|
520
|
+
const keys = new Map();
|
|
521
|
+
for (const row of this.rows()) {
|
|
522
|
+
if (row.kind === 'resource' && keys.size < SKELETON.length)
|
|
523
|
+
keys.set(row.key, keys.size);
|
|
524
|
+
}
|
|
525
|
+
return keys;
|
|
526
|
+
}, ...(ngDevMode ? [{ debugName: "skeletonRows" }] : /* istanbul ignore next */ []));
|
|
527
|
+
skeletonShapes = SKELETON;
|
|
528
|
+
/** Inline offset of the now line from the start of the time area, day view on today only (§7). */
|
|
529
|
+
nowOffset = computed(() => {
|
|
530
|
+
if (this.activeView() !== 'day' || this.#anchor() !== this.today())
|
|
531
|
+
return null;
|
|
532
|
+
return `calc(var(--sd-scheduler-hour-width) * ${this.#nowMinutes() / 60})`;
|
|
533
|
+
}, ...(ngDevMode ? [{ debugName: "nowOffset" }] : /* istanbul ignore next */ []));
|
|
534
|
+
gridHelpId = `${this.baseId}-grid-help`;
|
|
535
|
+
eventHelpId = `${this.baseId}-event-help`;
|
|
536
|
+
constructor() {
|
|
537
|
+
const destroyRef = inject(DestroyRef);
|
|
538
|
+
// why: one effect owns loading and the range output, so a range emits once and only together with its load.
|
|
539
|
+
effect(() => {
|
|
540
|
+
untracked(() => this.#hostWidth.measureOnce());
|
|
541
|
+
const option = this.option();
|
|
542
|
+
const resources = this.resources();
|
|
543
|
+
const range = this.visible();
|
|
544
|
+
untracked(() => {
|
|
545
|
+
const key = _sdCalendarRangeKey(range);
|
|
546
|
+
if (key !== this.#emittedKey) {
|
|
547
|
+
this.#emittedKey = key;
|
|
548
|
+
this.sdRangeChange.emit(range);
|
|
549
|
+
}
|
|
550
|
+
// why: a new array with the same ids only changes what the rows show (title, group, working hours), which the
|
|
551
|
+
// computed views redraw; it does not load again, clear the grid or abort a waiting create or move (R1 #7, PD).
|
|
552
|
+
const ids = JSON.stringify(resources.map(resource => resource.id));
|
|
553
|
+
this.#pruneGroups(resources);
|
|
554
|
+
if (option === this.#lastOption && ids === this.#lastResourceIds && key === this.#lastRangeKey)
|
|
555
|
+
return;
|
|
556
|
+
const changedSource = (this.#lastOption !== null && this.#lastOption !== option) || (this.#lastResourceIds !== null && this.#lastResourceIds !== ids);
|
|
557
|
+
if (this.#lastResourceIds !== ids)
|
|
558
|
+
this.#generation++;
|
|
559
|
+
// SC-15: a new source also aborts a waiting create; a range change or a reload aborts a waiting move only.
|
|
560
|
+
if (changedSource && this.#operation.abort(['create']))
|
|
561
|
+
this.#ghost.set(null);
|
|
562
|
+
this.#lastOption = option;
|
|
563
|
+
this.#lastResourceIds = ids;
|
|
564
|
+
this.#lastRangeKey = key;
|
|
565
|
+
this.#startLoad(option, resources, range);
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
effect(() => {
|
|
569
|
+
const { unknown, unreadable } = this.#reading();
|
|
570
|
+
for (const id of unknown)
|
|
571
|
+
this.#report('warn', `resource:${id}`, `event "${id}" has a resourceId that is not in resources; it is not shown.`);
|
|
572
|
+
for (const id of unreadable)
|
|
573
|
+
this.#report('warn', `date:${id}`, `event "${id}" has an unreadable date or does not end after it starts; it is not shown.`);
|
|
574
|
+
});
|
|
575
|
+
effect(() => {
|
|
576
|
+
const step = this.step() ?? this.#configuration?.step;
|
|
577
|
+
if (step !== undefined && _sdCalendarNormalizeStep(step) === null) {
|
|
578
|
+
this.#report('warn', `step:${step}`, `step ${step} is not one of 5, 10, 15, 20, 30, 60; 30 is used.`);
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
// The working hours of the component, then those of each resource that has its own.
|
|
582
|
+
effect(() => {
|
|
583
|
+
const scopes = [['', this.#workingHours()]];
|
|
584
|
+
for (const resource of this.resources())
|
|
585
|
+
scopes.push([resource.id, resource.workingHours]);
|
|
586
|
+
for (const [resourceId, hours] of scopes) {
|
|
587
|
+
for (const weekday of _sdCalendarBrokenWeekdays(hours)) {
|
|
588
|
+
this.#report('warn', `hours:${resourceId}:${weekday}`, `workingHours[${weekday}]${resourceId ? ` of resource "${resourceId}"` : ''} has a range without both ends or that does not end after it starts; it is ignored.`);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
// SC-15: turning disabled or readonly on aborts a waiting move.
|
|
593
|
+
effect(() => {
|
|
594
|
+
if (this.disabled() || this.readonly())
|
|
595
|
+
untracked(() => this.#abortMove());
|
|
596
|
+
});
|
|
597
|
+
// why: the timer only runs while today is on the day view, and outside the zone so it does not tick change detection.
|
|
598
|
+
effect(() => this.#timer.run(this.nowOffset() !== null));
|
|
599
|
+
// §6: the day view scrolls to scrollTime when it opens (init or from another view), not when only the day changes;
|
|
600
|
+
// the week and month views bring today's column into view when it is hidden. The vertical scroll is kept.
|
|
601
|
+
effect(() => {
|
|
602
|
+
const view = this.activeView();
|
|
603
|
+
this.visible();
|
|
604
|
+
untracked(() => {
|
|
605
|
+
const entered = view !== this.#lastView;
|
|
606
|
+
this.#lastView = view;
|
|
607
|
+
afterNextRender(() => {
|
|
608
|
+
if (view === 'day') {
|
|
609
|
+
if (entered)
|
|
610
|
+
this.#scrollToTime();
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
// A week or a month opens at its first column, then brings today into view (§6).
|
|
614
|
+
if (entered && this.scroller())
|
|
615
|
+
this.scroller().nativeElement.scrollLeft = 0;
|
|
616
|
+
this.#revealToday();
|
|
617
|
+
}, { injector: this.#injector });
|
|
618
|
+
});
|
|
619
|
+
});
|
|
620
|
+
// Sizes of the rendered layout (§7, §11): the block content tiers are measured in pixels.
|
|
621
|
+
effect(() => {
|
|
622
|
+
this.compact();
|
|
623
|
+
untracked(() => afterNextRender(() => this.#measureSizes(), { injector: this.#injector }));
|
|
624
|
+
});
|
|
625
|
+
effect(() => {
|
|
626
|
+
if (_sdCalendarSelectionGone(this.selectedId(), this.#loader.phase(), this.#loader.items()))
|
|
627
|
+
untracked(() => this.selectedId.set(null));
|
|
628
|
+
});
|
|
629
|
+
destroyRef.onDestroy(() => {
|
|
630
|
+
this.#loader.abort();
|
|
631
|
+
this.#operation.abort();
|
|
632
|
+
this.#hostWidth.disconnect();
|
|
633
|
+
this.#timer.stop();
|
|
634
|
+
this.#edge.stop();
|
|
635
|
+
document.removeEventListener('keydown', this.#onDocumentKeydown, true);
|
|
636
|
+
document.removeEventListener('keydown', this.#onDragKeydown, true);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
/** Aborts a running load and a waiting move, then calls `onLoad` again for the range on screen. */
|
|
640
|
+
reload() {
|
|
641
|
+
this.#startLoad(untracked(this.option), untracked(this.resources), untracked(this.visible));
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Moves an event through the pipeline of `sd-scheduler.md` ("Moving"): `onMove` decides. Resolves `true` only when
|
|
645
|
+
* accepted; `false` without `option.move`, while locked or another operation waits, for an unknown id or resource, a
|
|
646
|
+
* move against `axis`, a refused `movable` or `droppable`, the same position, a position outside `minDate` /
|
|
647
|
+
* `maxDate`, a rejection, `'cancel'` or an error. Without `resourceId` the event keeps its resource.
|
|
648
|
+
*/
|
|
649
|
+
move(eventId, to, source = 'api') {
|
|
650
|
+
const placed = untracked(this.#reading).placed.find(item => item.event.id === eventId);
|
|
651
|
+
const target = placed ? _sdCalendarMoveTarget(placed.placement, to, !!placed.event.allDay, this.#clock) : null;
|
|
652
|
+
if (!placed || !target)
|
|
653
|
+
return Promise.resolve(false);
|
|
654
|
+
return this.#runMove(eventId, { ...target, resourceId: to.resourceId ?? placed.event.resourceId }, source, false);
|
|
655
|
+
}
|
|
656
|
+
// ---- toolbar ----
|
|
657
|
+
setView(view) {
|
|
658
|
+
this.view.set(view);
|
|
659
|
+
this.#announceTitle();
|
|
660
|
+
}
|
|
661
|
+
shift(direction) {
|
|
662
|
+
if (direction < 0 ? this.prevDisabled() : this.nextDisabled())
|
|
663
|
+
return;
|
|
664
|
+
this.date.set(_sdCalendarShiftDate(this.#rangeInput(), direction));
|
|
665
|
+
this.#announceTitle();
|
|
666
|
+
}
|
|
667
|
+
goToday() {
|
|
668
|
+
this.#now.set(this.#clock.now());
|
|
669
|
+
this.date.set(this.today());
|
|
670
|
+
this.#announceTitle();
|
|
671
|
+
}
|
|
672
|
+
openDay(day) {
|
|
673
|
+
this.date.set(day);
|
|
674
|
+
this.view.set('day');
|
|
675
|
+
this.#announceTitle();
|
|
676
|
+
}
|
|
677
|
+
dismissFailure() {
|
|
678
|
+
this.#failure.set(null);
|
|
679
|
+
}
|
|
680
|
+
toggleGroup(name) {
|
|
681
|
+
this.#collapsed.update(groups => {
|
|
682
|
+
const next = new Set(groups);
|
|
683
|
+
if (!next.delete(name))
|
|
684
|
+
next.add(name);
|
|
685
|
+
return next;
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
viewLabel(view) {
|
|
689
|
+
return this.#i18n.t(`core.component.calendar.view-${view}`);
|
|
690
|
+
}
|
|
691
|
+
childAutoId(kind) {
|
|
692
|
+
const root = this.rootAutoId();
|
|
693
|
+
return root ? `${root}-${kind}` : null;
|
|
694
|
+
}
|
|
695
|
+
isFailed(id) {
|
|
696
|
+
return this.#failure()?.id === id;
|
|
697
|
+
}
|
|
698
|
+
// ---- selection (§9.1) ----
|
|
699
|
+
selectItem(event, domEvent) {
|
|
700
|
+
domEvent?.stopPropagation();
|
|
701
|
+
if (this.#justDragged) {
|
|
702
|
+
this.#justDragged = false;
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
if (this.disabled())
|
|
706
|
+
return;
|
|
707
|
+
this.selectedId.set(event.id);
|
|
708
|
+
this.sdSelect.emit(event);
|
|
709
|
+
}
|
|
710
|
+
/** Press inside a row: on a block it starts a new gesture and records the pickup point of a possible drag. */
|
|
711
|
+
onTrackPress(domEvent) {
|
|
712
|
+
if (!domEvent.target?.closest?.('[data-event-id]'))
|
|
713
|
+
return;
|
|
714
|
+
this.#justDragged = false;
|
|
715
|
+
this.#pickup = _sdCalendarPointOf(domEvent);
|
|
716
|
+
}
|
|
717
|
+
onTrackClick(domEvent, row) {
|
|
718
|
+
const block = this.#blockAt(domEvent.target, row);
|
|
719
|
+
if (block)
|
|
720
|
+
this.selectItem(block.event, domEvent);
|
|
721
|
+
}
|
|
722
|
+
onTrackKeydown(domEvent, row) {
|
|
723
|
+
const block = this.#blockAt(domEvent.target, row);
|
|
724
|
+
if (block)
|
|
725
|
+
this.onItemKeydown(domEvent, block);
|
|
726
|
+
}
|
|
727
|
+
/**
|
|
728
|
+
* Keys on a block (§9.7): Enter and Space select, Esc clears the selection and goes back to the grid, Alt + ← →
|
|
729
|
+
* moves the time, Alt + Shift + ← → the end, Alt + ↑ ↓ the resource.
|
|
730
|
+
*/
|
|
731
|
+
onItemKeydown(domEvent, block) {
|
|
732
|
+
const key = domEvent.key;
|
|
733
|
+
if (key === 'Enter' || key === ' ') {
|
|
734
|
+
domEvent.preventDefault();
|
|
735
|
+
this.selectItem(block.event, domEvent);
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
if (key === 'Escape') {
|
|
739
|
+
domEvent.preventDefault();
|
|
740
|
+
domEvent.stopPropagation();
|
|
741
|
+
this.selectedId.set(null);
|
|
742
|
+
this.gridElement()?.nativeElement.focus();
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
if (!domEvent.altKey || !key.startsWith('Arrow'))
|
|
746
|
+
return;
|
|
747
|
+
domEvent.preventDefault();
|
|
748
|
+
domEvent.stopPropagation();
|
|
749
|
+
const move = this.option().move;
|
|
750
|
+
if (!move)
|
|
751
|
+
return;
|
|
752
|
+
const axis = move.axis ?? 'both';
|
|
753
|
+
const { placement, event } = block;
|
|
754
|
+
if (key === 'ArrowUp' || key === 'ArrowDown') {
|
|
755
|
+
// §9.7: Alt + ↑ ↓ moves to the nearest resource droppable allows, collapsed groups included (Step 0 H4).
|
|
756
|
+
if (axis === 'time')
|
|
757
|
+
return;
|
|
758
|
+
const ids = this.#resourceOrder();
|
|
759
|
+
const direction = key === 'ArrowDown' ? 1 : -1;
|
|
760
|
+
const same = _sdCalendarTargetOf(placement);
|
|
761
|
+
const next = sdSchedulerNextResource(ids, event.resourceId, direction, id => this.#droppable(event, { ...same, resourceId: id }));
|
|
762
|
+
if (!next) {
|
|
763
|
+
// Nothing to name at the first or the last resource: the key does nothing there.
|
|
764
|
+
const neighbour = ids[ids.indexOf(event.resourceId) + direction];
|
|
765
|
+
if (neighbour)
|
|
766
|
+
this.#announceBlocked(neighbour);
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
769
|
+
void this.#runMove(event.id, { ...same, resourceId: next }, 'keyboard', true);
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
if (axis === 'resource')
|
|
773
|
+
return;
|
|
774
|
+
const forward = (key === 'ArrowRight') !== this.#rtl() ? 1 : -1;
|
|
775
|
+
const day = this.activeView() === 'day';
|
|
776
|
+
const step = this.stepValue();
|
|
777
|
+
let target = null;
|
|
778
|
+
if (domEvent.shiftKey) {
|
|
779
|
+
// Alt + Shift + ← →: the end (§9.4), where the end handle is.
|
|
780
|
+
if (day && placement.inGrid) {
|
|
781
|
+
const end = _sdCalendarResizeEnd(placement.startMinutes, placement.endMinutes, _sdCalendarMoveStep(step) * forward, step);
|
|
782
|
+
target = { ..._sdCalendarTargetOf(placement), endMinutes: end, resourceId: event.resourceId };
|
|
783
|
+
}
|
|
784
|
+
else if (!day && placement.allDay) {
|
|
785
|
+
const lastDay = sdSchedulerResizeLastDay(placement, this.columns(), forward);
|
|
786
|
+
if (lastDay)
|
|
787
|
+
target = { ..._sdCalendarTargetOf(placement), endDay: lastDay, resourceId: event.resourceId };
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
else if (day && placement.inGrid) {
|
|
791
|
+
target = this.#shiftTarget(placement, (forward * _sdCalendarMoveStep(step)) / 60, event.resourceId);
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
target = { ..._sdCalendarShiftDays(placement, forward), resourceId: event.resourceId };
|
|
795
|
+
}
|
|
796
|
+
if (target)
|
|
797
|
+
void this.#runMove(event.id, target, domEvent.shiftKey ? 'resize' : 'keyboard', true);
|
|
798
|
+
}
|
|
799
|
+
// ---- grid keyboard (§9.7) ----
|
|
800
|
+
cursor = this.#cursor.asReadonly();
|
|
801
|
+
/** `aria-activedescendant` of the grid: the track of the cursor row, its cell, or the header of a collapsed group. */
|
|
802
|
+
cursorTarget = computed(() => {
|
|
803
|
+
const cursor = this.#cursor();
|
|
804
|
+
const row = cursor ? this.rows().find(item => item.key === cursor.rowKey) : null;
|
|
805
|
+
if (!cursor || !row)
|
|
806
|
+
return null;
|
|
807
|
+
if (row.kind === 'group')
|
|
808
|
+
return row.headerId;
|
|
809
|
+
return row.cells ? `${row.trackId}-${cursor.day}` : row.trackId;
|
|
810
|
+
}, ...(ngDevMode ? [{ debugName: "cursorTarget" }] : /* istanbul ignore next */ []));
|
|
811
|
+
cursorLabel = computed(() => {
|
|
812
|
+
const cursor = this.#cursor();
|
|
813
|
+
const row = cursor ? this.rows().find(item => item.key === cursor.rowKey) : null;
|
|
814
|
+
if (!cursor || !row)
|
|
815
|
+
return '';
|
|
816
|
+
if (row.kind === 'group')
|
|
817
|
+
return row.label;
|
|
818
|
+
const formats = this.#formats();
|
|
819
|
+
const params = {
|
|
820
|
+
resource: row.resource.title,
|
|
821
|
+
weekday: _sdCalendarWeekdayLong(formats, cursor.day),
|
|
822
|
+
date: _sdCalendarDateText(formats, cursor.day, false),
|
|
823
|
+
};
|
|
824
|
+
return this.activeView() === 'day'
|
|
825
|
+
? this.#i18n.t('core.component.scheduler.cursor-time', { ...params, time: _sdCalendarClockText(cursor.minutes) })
|
|
826
|
+
: this.#i18n.t('core.component.scheduler.cursor-day', params);
|
|
827
|
+
}, ...(ngDevMode ? [{ debugName: "cursorLabel" }] : /* istanbul ignore next */ []));
|
|
828
|
+
/** Inline start and size of the cursor in its row: one step (day view) or one column. */
|
|
829
|
+
cursorBox = computed(() => {
|
|
830
|
+
const cursor = this.#cursor();
|
|
831
|
+
if (!cursor)
|
|
832
|
+
return null;
|
|
833
|
+
if (this.activeView() === 'day') {
|
|
834
|
+
return {
|
|
835
|
+
start: `calc(var(--sd-scheduler-hour-width) * ${cursor.minutes / 60})`,
|
|
836
|
+
size: `calc(var(--sd-scheduler-hour-width) * ${this.stepValue() / 60})`,
|
|
837
|
+
text: _sdCalendarClockText(cursor.minutes),
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
const columns = this.columns();
|
|
841
|
+
const column = Math.max(0, columns.indexOf(cursor.day));
|
|
842
|
+
const box = sdSchedulerColumnBox({ from: column, to: column }, columns.length);
|
|
843
|
+
return { start: `${box.start * 100}%`, size: `${box.size * 100}%`, text: '' };
|
|
844
|
+
}, ...(ngDevMode ? [{ debugName: "cursorBox" }] : /* istanbul ignore next */ []));
|
|
845
|
+
/** The cursor starts on the first resource, on the anchor day (or the first column), at its working hour. */
|
|
846
|
+
onGridFocus() {
|
|
847
|
+
const cursor = this.#cursor();
|
|
848
|
+
const rows = this.#cursorRows();
|
|
849
|
+
const columns = this.columns();
|
|
850
|
+
if (cursor && rows.some(row => row.key === cursor.rowKey) && columns.includes(cursor.day))
|
|
851
|
+
return;
|
|
852
|
+
const first = rows.find(row => row.kind === 'resource') ?? rows[0];
|
|
853
|
+
if (!first)
|
|
854
|
+
return;
|
|
855
|
+
const day = columns.includes(this.#anchor()) ? this.#anchor() : columns[0];
|
|
856
|
+
this.#cursor.set({ rowKey: first.key, day, minutes: this.#workStart(first, day) });
|
|
857
|
+
}
|
|
858
|
+
onGridKeydown(domEvent) {
|
|
859
|
+
if (domEvent.target !== domEvent.currentTarget)
|
|
860
|
+
return;
|
|
861
|
+
this.onGridFocus();
|
|
862
|
+
const cursor = this.#cursor();
|
|
863
|
+
if (!cursor)
|
|
864
|
+
return;
|
|
865
|
+
const rows = this.#cursorRows();
|
|
866
|
+
const index = Math.max(0, rows.findIndex(row => row.key === cursor.rowKey));
|
|
867
|
+
const row = rows[index];
|
|
868
|
+
const step = this.stepValue();
|
|
869
|
+
const day = this.activeView() === 'day';
|
|
870
|
+
const columns = this.columns();
|
|
871
|
+
const key = domEvent.key;
|
|
872
|
+
let next = { ...cursor };
|
|
873
|
+
switch (key) {
|
|
874
|
+
case 'ArrowLeft':
|
|
875
|
+
case 'ArrowRight': {
|
|
876
|
+
const forward = (key === 'ArrowRight') !== this.#rtl() ? 1 : -1;
|
|
877
|
+
if (day) {
|
|
878
|
+
const minutes = cursor.minutes + forward * step;
|
|
879
|
+
if (minutes >= 0 && minutes <= 1440 - step)
|
|
880
|
+
next.minutes = minutes;
|
|
881
|
+
else {
|
|
882
|
+
// Past the edge of the day: the next or previous day, at its first or last slot.
|
|
883
|
+
this.shift(forward);
|
|
884
|
+
next = { ...next, day: this.columns()[0], minutes: forward > 0 ? 0 : 1440 - step };
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
else {
|
|
888
|
+
const column = columns.indexOf(cursor.day) + forward;
|
|
889
|
+
if (column >= 0 && column < columns.length)
|
|
890
|
+
next.day = columns[column];
|
|
891
|
+
else {
|
|
892
|
+
this.shift(forward);
|
|
893
|
+
const shifted = this.columns();
|
|
894
|
+
next.day = forward > 0 ? shifted[0] : shifted[shifted.length - 1];
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
break;
|
|
898
|
+
}
|
|
899
|
+
case 'ArrowUp':
|
|
900
|
+
case 'ArrowDown':
|
|
901
|
+
next.rowKey = rows[Math.min(rows.length - 1, Math.max(0, index + (key === 'ArrowDown' ? 1 : -1)))].key;
|
|
902
|
+
break;
|
|
903
|
+
case 'Home':
|
|
904
|
+
case 'End': {
|
|
905
|
+
if (domEvent.ctrlKey || domEvent.metaKey) {
|
|
906
|
+
const resources = rows.filter(item => item.kind === 'resource');
|
|
907
|
+
next.rowKey = (key === 'Home' ? resources[0] : resources[resources.length - 1])?.key ?? next.rowKey;
|
|
908
|
+
}
|
|
909
|
+
else if (day) {
|
|
910
|
+
next.minutes = key === 'Home' ? this.#workStart(row, cursor.day) : this.#workEnd(row, cursor.day);
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
next.day = key === 'Home' ? columns[0] : columns[columns.length - 1];
|
|
914
|
+
}
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
case 'PageUp':
|
|
918
|
+
case 'PageDown': {
|
|
919
|
+
this.shift(key === 'PageDown' ? 1 : -1);
|
|
920
|
+
const shifted = this.columns();
|
|
921
|
+
next.day = day ? shifted[0] : (shifted[columns.indexOf(cursor.day)] ?? shifted[0]);
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
924
|
+
case 't':
|
|
925
|
+
case 'T':
|
|
926
|
+
this.goToday();
|
|
927
|
+
next.day = this.today();
|
|
928
|
+
break;
|
|
929
|
+
case 'Enter':
|
|
930
|
+
case ' ':
|
|
931
|
+
domEvent.preventDefault();
|
|
932
|
+
if (domEvent.altKey && key === 'Enter') {
|
|
933
|
+
// Alt + Enter: collapse the group of the resource under the cursor, or open the collapsed group.
|
|
934
|
+
const group = row.kind === 'group' ? row.name : row.group;
|
|
935
|
+
if (!group)
|
|
936
|
+
return;
|
|
937
|
+
this.toggleGroup(group);
|
|
938
|
+
this.#cursor.set({ ...cursor, rowKey: `g:${group}` });
|
|
939
|
+
return;
|
|
940
|
+
}
|
|
941
|
+
if (row.kind === 'resource')
|
|
942
|
+
this.#activateSlot(row, cursor);
|
|
943
|
+
return;
|
|
944
|
+
default:
|
|
945
|
+
return;
|
|
946
|
+
}
|
|
947
|
+
domEvent.preventDefault();
|
|
948
|
+
this.#cursor.set(next);
|
|
949
|
+
afterNextRender(() => this.#revealCursor(), { injector: this.#injector });
|
|
950
|
+
this.#announcer.announce(untracked(this.cursorLabel));
|
|
951
|
+
}
|
|
952
|
+
onCellClick(row, cell) {
|
|
953
|
+
this.#activateSlot(row, { day: cell.day, minutes: 0 });
|
|
954
|
+
}
|
|
955
|
+
/** Rows the cursor stops at: resources on screen and collapsed group rows (§9.7). */
|
|
956
|
+
#cursorRows() {
|
|
957
|
+
return this.rows().filter(row => row.kind === 'resource' || row.collapsed);
|
|
958
|
+
}
|
|
959
|
+
/** Start of the working day of the row's resource, on a slot; 08:00 without working hours. */
|
|
960
|
+
#workStart(row, day) {
|
|
961
|
+
const hours = row.kind === 'resource' ? this.#hoursOf(row.resource) : this.#workingHours();
|
|
962
|
+
const start = _sdCalendarWorkingRanges(hours, _sdCalendarWeekday(day))?.[0]?.start ?? _sdCalendarTimeToMinutes(_SD_CALENDAR_DEFAULTS.scrollTime);
|
|
963
|
+
return _sdCalendarSlot(start, this.stepValue()).start;
|
|
964
|
+
}
|
|
965
|
+
/** Last slot before the end of the working day of the row's resource (§9.7, SCH-C-13). */
|
|
966
|
+
#workEnd(row, day) {
|
|
967
|
+
const hours = row.kind === 'resource' ? this.#hoursOf(row.resource) : this.#workingHours();
|
|
968
|
+
const working = _sdCalendarWorkingRanges(hours, _sdCalendarWeekday(day)) ?? [];
|
|
969
|
+
const end = working[working.length - 1]?.end ?? 1440;
|
|
970
|
+
return _sdCalendarSlot(end - this.stepValue(), this.stepValue()).start;
|
|
971
|
+
}
|
|
972
|
+
/** Enter or Space on a slot: a cell with events emits `sdCellSelect`; otherwise one step or one day is created. */
|
|
973
|
+
#activateSlot(row, cursor) {
|
|
974
|
+
const cell = row.cells?.find(item => item.day === cursor.day);
|
|
975
|
+
if (cell?.events.length) {
|
|
976
|
+
// As a selection: not while disabled, still while readonly (SC-28).
|
|
977
|
+
if (!this.disabled())
|
|
978
|
+
this.sdCellSelect.emit({ resource: row.resource, date: cell.day, events: cell.events });
|
|
979
|
+
return;
|
|
980
|
+
}
|
|
981
|
+
if (this.activeView() === 'day') {
|
|
982
|
+
void this.#create(row.resource.id, { start: cursor.minutes, end: Math.min(1440, cursor.minutes + this.stepValue()) });
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
const column = this.columns().indexOf(cursor.day);
|
|
986
|
+
void this.#create(row.resource.id, { start: column, end: column });
|
|
987
|
+
}
|
|
988
|
+
#revealCursor() {
|
|
989
|
+
this.#host.nativeElement.querySelector('[data-cursor]')?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
|
|
990
|
+
}
|
|
991
|
+
/** Every resource in row order, those of collapsed groups included. */
|
|
992
|
+
#resourceOrder() {
|
|
993
|
+
const { ungrouped, groups } = sdSchedulerGroups(this.resources());
|
|
994
|
+
return [...ungrouped, ...groups.flatMap(group => group.resources)].map(resource => resource.id);
|
|
995
|
+
}
|
|
996
|
+
#blockAt(target, row) {
|
|
997
|
+
const element = target?.closest?.('[data-event-id]');
|
|
998
|
+
const id = element?.getAttribute('data-event-id');
|
|
999
|
+
return id ? (row.blocks.find(block => block.key === id) ?? null) : null;
|
|
1000
|
+
}
|
|
1001
|
+
// ---- create (§9.2) ----
|
|
1002
|
+
onTrackPointerDown(domEvent, resourceId) {
|
|
1003
|
+
// §8.5: with a cell template the cells take the click (onCellClick).
|
|
1004
|
+
if (!domEvent.isPrimary || domEvent.button !== 0 || this.cellTemplateActive())
|
|
1005
|
+
return;
|
|
1006
|
+
const target = domEvent.target;
|
|
1007
|
+
if (target.closest('[data-event-id], [data-resize-handle]'))
|
|
1008
|
+
return;
|
|
1009
|
+
const track = domEvent.currentTarget;
|
|
1010
|
+
this.#press = {
|
|
1011
|
+
resourceId,
|
|
1012
|
+
anchor: this.#valueAt(domEvent.clientX, track),
|
|
1013
|
+
x: domEvent.clientX,
|
|
1014
|
+
y: domEvent.clientY,
|
|
1015
|
+
touch: domEvent.pointerType === 'touch',
|
|
1016
|
+
track,
|
|
1017
|
+
moved: false,
|
|
1018
|
+
};
|
|
1019
|
+
// why: on touch the browser scrolls the grid; capturing would keep the pointer from the scroll.
|
|
1020
|
+
if (!this.#press.touch) {
|
|
1021
|
+
try {
|
|
1022
|
+
track.setPointerCapture(domEvent.pointerId);
|
|
1023
|
+
}
|
|
1024
|
+
catch {
|
|
1025
|
+
// why: a synthetic or already released pointer cannot be captured; the press still works without capture.
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
document.addEventListener('keydown', this.#onDocumentKeydown, true);
|
|
1029
|
+
}
|
|
1030
|
+
onTrackPointerMove(domEvent) {
|
|
1031
|
+
const press = this.#press;
|
|
1032
|
+
if (!press)
|
|
1033
|
+
return;
|
|
1034
|
+
if (!press.moved && Math.hypot(domEvent.clientX - press.x, domEvent.clientY - press.y) < CLICK_SLOP)
|
|
1035
|
+
return;
|
|
1036
|
+
press.moved = true;
|
|
1037
|
+
// §11: on touch a move scrolls; there is no sweep.
|
|
1038
|
+
if (press.touch || !this.canCreate() || this.#operation.busy())
|
|
1039
|
+
return;
|
|
1040
|
+
// §9.2: the sweep follows the inline axis only; the row stays the one pressed.
|
|
1041
|
+
const span = this.#sweep(press.anchor, this.#valueAt(domEvent.clientX, press.track));
|
|
1042
|
+
const blocked = this.#outOfRangeSpan(span) || !this.#creatable(press.resourceId, span);
|
|
1043
|
+
this.#ghost.set({ resourceId: press.resourceId, ...span, pending: false, blocked });
|
|
1044
|
+
}
|
|
1045
|
+
onTrackPointerUp() {
|
|
1046
|
+
const press = this.#press;
|
|
1047
|
+
if (!press)
|
|
1048
|
+
return;
|
|
1049
|
+
this.#press = null;
|
|
1050
|
+
document.removeEventListener('keydown', this.#onDocumentKeydown, true);
|
|
1051
|
+
const ghost = this.#ghost();
|
|
1052
|
+
if (!this.#operation.busy())
|
|
1053
|
+
this.#ghost.set(null);
|
|
1054
|
+
// §9.1: a press on an empty slot clears the selection; with option.create it also creates there.
|
|
1055
|
+
this.selectedId.set(null);
|
|
1056
|
+
if (press.moved && (press.touch || !ghost))
|
|
1057
|
+
return;
|
|
1058
|
+
void this.#create(press.resourceId, press.moved && ghost ? { start: ghost.start, end: ghost.end } : this.#slot(press.anchor));
|
|
1059
|
+
}
|
|
1060
|
+
onTrackPointerCancel() {
|
|
1061
|
+
this.#press = null;
|
|
1062
|
+
document.removeEventListener('keydown', this.#onDocumentKeydown, true);
|
|
1063
|
+
if (!this.#operation.busy())
|
|
1064
|
+
this.#ghost.set(null);
|
|
1065
|
+
}
|
|
1066
|
+
/** Esc cancels a sweep. */
|
|
1067
|
+
#onDocumentKeydown = (domEvent) => {
|
|
1068
|
+
if (domEvent.key !== 'Escape')
|
|
1069
|
+
return;
|
|
1070
|
+
this.#zone.run(() => {
|
|
1071
|
+
if (this.#press) {
|
|
1072
|
+
this.#press = null;
|
|
1073
|
+
if (!this.#operation.busy())
|
|
1074
|
+
this.#ghost.set(null);
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
1077
|
+
document.removeEventListener('keydown', this.#onDocumentKeydown, true);
|
|
1078
|
+
};
|
|
1079
|
+
/** Inline start and size of the dashed block (as the blocks of §8.2). */
|
|
1080
|
+
ghostBox(ghost) {
|
|
1081
|
+
if (this.activeView() === 'day') {
|
|
1082
|
+
return {
|
|
1083
|
+
start: `calc(var(--sd-scheduler-hour-width) * ${ghost.start / 60} + ${DAY_GAP.before}px)`,
|
|
1084
|
+
size: `max(12px, calc(var(--sd-scheduler-hour-width) * ${(ghost.end - ghost.start) / 60} - ${DAY_GAP.before + DAY_GAP.after}px))`,
|
|
1085
|
+
time: `${_sdCalendarClockText(ghost.start)}–${_sdCalendarClockText(ghost.end)}`,
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
const box = sdSchedulerColumnBox({ from: ghost.start, to: ghost.end }, this.columns().length);
|
|
1089
|
+
return {
|
|
1090
|
+
start: `calc(${box.start * 100}% + ${COLUMN_GAP.before}px)`,
|
|
1091
|
+
size: `calc(${box.size * 100}% - ${COLUMN_GAP.before + COLUMN_GAP.after}px)`,
|
|
1092
|
+
time: '',
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
/** Minutes (day view) or the column index (week, month) under `clientX` on a track. */
|
|
1096
|
+
#valueAt(clientX, track) {
|
|
1097
|
+
const rect = track.getBoundingClientRect();
|
|
1098
|
+
const offset = this.#rtl() ? rect.right - clientX : clientX - rect.left;
|
|
1099
|
+
if (this.activeView() === 'day')
|
|
1100
|
+
return Math.min(1439, Math.max(0, (offset / this.#sizes().hour) * 60));
|
|
1101
|
+
const count = this.columns().length;
|
|
1102
|
+
return Math.min(count - 1, Math.max(0, Math.floor((offset / (rect.width || 1)) * count)));
|
|
1103
|
+
}
|
|
1104
|
+
/** One slot of `step` minutes, or one day. */
|
|
1105
|
+
#slot(value) {
|
|
1106
|
+
if (this.activeView() === 'day')
|
|
1107
|
+
return _sdCalendarSlot(value, this.stepValue());
|
|
1108
|
+
return { start: value, end: value };
|
|
1109
|
+
}
|
|
1110
|
+
#sweep(anchor, current) {
|
|
1111
|
+
if (this.activeView() === 'day')
|
|
1112
|
+
return _sdCalendarSweep(anchor, current, this.stepValue());
|
|
1113
|
+
return { start: Math.min(anchor, current), end: Math.max(anchor, current) };
|
|
1114
|
+
}
|
|
1115
|
+
/** Wall clock of a create span: a timed span of the day on screen, or all-day columns (§9.2). */
|
|
1116
|
+
#createTarget(span) {
|
|
1117
|
+
const columns = this.columns();
|
|
1118
|
+
if (this.activeView() === 'day') {
|
|
1119
|
+
return { allDay: false, startDay: columns[0], startMinutes: span.start, endDay: columns[0], endMinutes: span.end };
|
|
1120
|
+
}
|
|
1121
|
+
return { allDay: true, startDay: columns[span.start], startMinutes: 0, endDay: columns[span.end], endMinutes: 1440 };
|
|
1122
|
+
}
|
|
1123
|
+
#createContext(resource, target) {
|
|
1124
|
+
const range = _sdCalendarRangeOf(target, this.#clock, untracked(this.transform));
|
|
1125
|
+
return { ...range, resourceId: resource.id, resource };
|
|
1126
|
+
}
|
|
1127
|
+
#creatable(resourceId, span) {
|
|
1128
|
+
const resource = untracked(this.#resourceById).get(resourceId);
|
|
1129
|
+
if (!resource)
|
|
1130
|
+
return false;
|
|
1131
|
+
return _sdCalendarAllows(untracked(this.option).create?.creatable, this.#createContext(resource, this.#createTarget(span)));
|
|
1132
|
+
}
|
|
1133
|
+
#outOfRangeSpan(span) {
|
|
1134
|
+
const target = this.#createTarget(span);
|
|
1135
|
+
return this.#outOfRange(target.startDay) || this.#outOfRange(target.endDay);
|
|
1136
|
+
}
|
|
1137
|
+
async #create(resourceId, span) {
|
|
1138
|
+
const create = untracked(this.option).create;
|
|
1139
|
+
const resource = untracked(this.#resourceById).get(resourceId);
|
|
1140
|
+
if (!create || !resource || untracked(this.locked) || untracked(this.#operation.busy))
|
|
1141
|
+
return;
|
|
1142
|
+
if (this.#outOfRangeSpan(span)) {
|
|
1143
|
+
this.#announcer.announce(this.#i18n.t('core.component.calendar.out-of-range'));
|
|
1144
|
+
return;
|
|
1145
|
+
}
|
|
1146
|
+
const context = this.#createContext(resource, this.#createTarget(span));
|
|
1147
|
+
if (!_sdCalendarAllows(create.creatable, context))
|
|
1148
|
+
return;
|
|
1149
|
+
await this.#creator.run({
|
|
1150
|
+
args: context,
|
|
1151
|
+
onCreate: create.onCreate,
|
|
1152
|
+
show: waiting => this.#ghost.set(waiting ? { resourceId, ...span, pending: true, blocked: false } : null),
|
|
1153
|
+
accept: event => {
|
|
1154
|
+
this.#loader.items.update(items => [...items, event]);
|
|
1155
|
+
this.selectedId.set(event.id);
|
|
1156
|
+
},
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
#outOfRange(day) {
|
|
1160
|
+
return _sdCalendarOutOfRange(day, untracked(this.#minDay), untracked(this.#maxDay));
|
|
1161
|
+
}
|
|
1162
|
+
// ---- drag on two axes (§9.3) ----
|
|
1163
|
+
/** `cdkDragLockAxis` of `move.axis` (§9.3); the real lock is in the target computation (Step 0 D.6). */
|
|
1164
|
+
lockAxis = computed(() => {
|
|
1165
|
+
const axis = this.option().move?.axis ?? 'both';
|
|
1166
|
+
return axis === 'time' ? 'x' : axis === 'resource' ? 'y' : null;
|
|
1167
|
+
}, ...(ngDevMode ? [{ debugName: "lockAxis" }] : /* istanbul ignore next */ []));
|
|
1168
|
+
dragProposal = this.#drag.asReadonly();
|
|
1169
|
+
dragDelay = { touch: 400, mouse: 0 };
|
|
1170
|
+
/**
|
|
1171
|
+
* Keeps the dragged element in place (the proposal is drawn instead) and computes the target from the real pointer.
|
|
1172
|
+
* CDK runs this outside the zone on every pointer move; the zone is entered only when the target changes.
|
|
1173
|
+
*/
|
|
1174
|
+
constrainDrag = (point, _ref, rect) => {
|
|
1175
|
+
this.#dragPointer = point;
|
|
1176
|
+
this.#updateDrag();
|
|
1177
|
+
this.#edgeScroll();
|
|
1178
|
+
return { x: rect.left, y: rect.top };
|
|
1179
|
+
};
|
|
1180
|
+
onDragStarted(start, block) {
|
|
1181
|
+
const scroller = this.scroller()?.nativeElement;
|
|
1182
|
+
const placed = untracked(this.#reading).placed.find(item => item.event.id === block.key);
|
|
1183
|
+
if (!scroller || !placed)
|
|
1184
|
+
return;
|
|
1185
|
+
const area = scroller.getBoundingClientRect();
|
|
1186
|
+
const rows = Array.from(scroller.querySelectorAll('.sd-scheduler__body > [role="row"]')).map(row => {
|
|
1187
|
+
const box = row.getBoundingClientRect();
|
|
1188
|
+
const top = box.top - area.top + scroller.scrollTop;
|
|
1189
|
+
return {
|
|
1190
|
+
key: row.dataset['group'] ?? row.dataset['resourceId'] ?? '',
|
|
1191
|
+
resourceId: row.dataset['resourceId'] ?? null,
|
|
1192
|
+
top,
|
|
1193
|
+
bottom: top + box.height,
|
|
1194
|
+
};
|
|
1195
|
+
});
|
|
1196
|
+
const rtl = this.#rtl();
|
|
1197
|
+
const sizes = this.#sizes();
|
|
1198
|
+
const pickup = this.#pickup ?? _sdCalendarPointOf(start.event) ?? { x: 0, y: 0 };
|
|
1199
|
+
const trackWidth = (scroller.querySelector('[data-track]')?.getBoundingClientRect().width ?? this.#trackWidth()) || 1;
|
|
1200
|
+
this.#dragSession = {
|
|
1201
|
+
placed,
|
|
1202
|
+
rows,
|
|
1203
|
+
stickyBlock: scroller.querySelector('.sd-scheduler__head')?.offsetHeight ?? 0,
|
|
1204
|
+
stickyInline: sizes.resource,
|
|
1205
|
+
rtl,
|
|
1206
|
+
pickup: this.#inlineOffset(pickup.x, area, scroller, rtl, sizes.resource),
|
|
1207
|
+
unit: this.activeView() === 'day' ? sizes.hour : trackWidth / this.columns().length,
|
|
1208
|
+
axis: untracked(this.option).move?.axis ?? 'both',
|
|
1209
|
+
tier: block.tier,
|
|
1210
|
+
memo: new Map(),
|
|
1211
|
+
lastResource: placed.event.resourceId,
|
|
1212
|
+
lastShift: 0,
|
|
1213
|
+
lastKey: null,
|
|
1214
|
+
cancelled: false,
|
|
1215
|
+
};
|
|
1216
|
+
this.#failure.set(null);
|
|
1217
|
+
if (typeof TouchEvent !== 'undefined' && start.event instanceof TouchEvent)
|
|
1218
|
+
navigator.vibrate?.(10);
|
|
1219
|
+
document.addEventListener('keydown', this.#onDragKeydown, true);
|
|
1220
|
+
}
|
|
1221
|
+
onDragEnded(end) {
|
|
1222
|
+
end.source.reset();
|
|
1223
|
+
this.#edge.stop();
|
|
1224
|
+
document.removeEventListener('keydown', this.#onDragKeydown, true);
|
|
1225
|
+
const session = this.#dragSession;
|
|
1226
|
+
const proposal = this.#drag();
|
|
1227
|
+
this.#dragSession = null;
|
|
1228
|
+
this.#dragPointer = null;
|
|
1229
|
+
this.#drag.set(null);
|
|
1230
|
+
this.#justDragged = true;
|
|
1231
|
+
if (!session || !proposal || session.cancelled || proposal.outside || proposal.onGroup)
|
|
1232
|
+
return;
|
|
1233
|
+
if (proposal.blocked) {
|
|
1234
|
+
this.#announceBlocked(proposal.target.resourceId);
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
void this.#runMove(proposal.id, proposal.target, 'drag', false);
|
|
1238
|
+
}
|
|
1239
|
+
isDragging(id) {
|
|
1240
|
+
return this.#drag()?.id === id;
|
|
1241
|
+
}
|
|
1242
|
+
/** Esc cancels a drag or a resize. */
|
|
1243
|
+
#onDragKeydown = (domEvent) => {
|
|
1244
|
+
if (domEvent.key !== 'Escape')
|
|
1245
|
+
return;
|
|
1246
|
+
this.#zone.run(() => {
|
|
1247
|
+
if (this.#dragSession) {
|
|
1248
|
+
this.#dragSession.cancelled = true;
|
|
1249
|
+
this.#drag.set(null);
|
|
1250
|
+
}
|
|
1251
|
+
if (this.#resizeSession) {
|
|
1252
|
+
this.#resizeSession = null;
|
|
1253
|
+
this.#resize.set(null);
|
|
1254
|
+
document.removeEventListener('keydown', this.#onDragKeydown, true);
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
};
|
|
1258
|
+
/** Inline distance of `clientX` from the start of the time area, in content coordinates (RTL measured from the right). */
|
|
1259
|
+
#inlineOffset(clientX, area, scroller, rtl, stickyInline) {
|
|
1260
|
+
const inArea = rtl ? area.right - clientX : clientX - area.left;
|
|
1261
|
+
return inArea + Math.abs(scroller.scrollLeft) - stickyInline;
|
|
1262
|
+
}
|
|
1263
|
+
#updateDrag() {
|
|
1264
|
+
const session = this.#dragSession;
|
|
1265
|
+
const pointer = this.#dragPointer;
|
|
1266
|
+
const scroller = this.scroller()?.nativeElement;
|
|
1267
|
+
if (!session || !pointer || !scroller || session.cancelled)
|
|
1268
|
+
return;
|
|
1269
|
+
const area = scroller.getBoundingClientRect();
|
|
1270
|
+
const outside = pointer.x < area.left || pointer.x > area.right || pointer.y < area.top || pointer.y > area.bottom;
|
|
1271
|
+
const { placement, event } = session.placed;
|
|
1272
|
+
// Vertical: the row under the pointer; over the sticky axis, or with axis 'time', the row stays (Step 0 H10).
|
|
1273
|
+
let resourceId = session.lastResource;
|
|
1274
|
+
let onGroup = false;
|
|
1275
|
+
if (session.axis === 'time')
|
|
1276
|
+
resourceId = event.resourceId;
|
|
1277
|
+
else if (pointer.y >= area.top + session.stickyBlock) {
|
|
1278
|
+
const row = sdSchedulerRowAt(session.rows, pointer.y - area.top + scroller.scrollTop);
|
|
1279
|
+
if (row?.resourceId)
|
|
1280
|
+
resourceId = row.resourceId;
|
|
1281
|
+
else if (row)
|
|
1282
|
+
onGroup = true;
|
|
1283
|
+
}
|
|
1284
|
+
if (!onGroup)
|
|
1285
|
+
session.lastResource = resourceId;
|
|
1286
|
+
// Inline: a time shift; over the sticky resource column, or with axis 'resource', the time stays.
|
|
1287
|
+
const inArea = session.rtl ? area.right - pointer.x : pointer.x - area.left;
|
|
1288
|
+
if (session.axis !== 'resource' && inArea >= session.stickyInline) {
|
|
1289
|
+
const offset = this.#inlineOffset(pointer.x, area, scroller, session.rtl, session.stickyInline);
|
|
1290
|
+
session.lastShift = (offset - session.pickup) / session.unit;
|
|
1291
|
+
}
|
|
1292
|
+
const target = this.#shiftTarget(placement, session.axis === 'resource' ? 0 : session.lastShift, resourceId);
|
|
1293
|
+
const key = `${resourceId}|${onGroup}|${target.startDay}|${target.startMinutes}|${outside}`;
|
|
1294
|
+
if (key === session.lastKey)
|
|
1295
|
+
return;
|
|
1296
|
+
session.lastKey = key;
|
|
1297
|
+
const memoKey = `${resourceId}|${target.startDay} ${target.startMinutes}`;
|
|
1298
|
+
let blocked = false;
|
|
1299
|
+
if (!onGroup) {
|
|
1300
|
+
if (!session.memo.has(memoKey))
|
|
1301
|
+
session.memo.set(memoKey, !this.#droppable(event, target));
|
|
1302
|
+
blocked = session.memo.get(memoKey);
|
|
1303
|
+
}
|
|
1304
|
+
const label = this.#proposalLabel(target, resourceId !== event.resourceId);
|
|
1305
|
+
const flip = this.#labelFlips(target);
|
|
1306
|
+
const { color, customColor } = _sdCalendarColor(event.color);
|
|
1307
|
+
const look = { title: event.title, color, customColor, tier: session.tier };
|
|
1308
|
+
this.#zone.run(() => this.#drag.set({ id: event.id, target, onGroup, blocked, outside, label, flip, ...look }));
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Target of a drag by `shift` hours (day view: rounded to `moveStep`, kept in the day) or `shift` columns (week,
|
|
1312
|
+
* month: whole days along the columns on screen, kept in the range, start time and duration kept).
|
|
1313
|
+
*/
|
|
1314
|
+
#shiftTarget(placement, shift, resourceId) {
|
|
1315
|
+
if (this.activeView() === 'day') {
|
|
1316
|
+
if (!placement.inGrid)
|
|
1317
|
+
return { ..._sdCalendarTargetOf(placement), resourceId };
|
|
1318
|
+
const day = this.columns()[0];
|
|
1319
|
+
const duration = placement.endMinutes - placement.startMinutes;
|
|
1320
|
+
const start = _sdCalendarSnapMove(placement.startMinutes, shift * 60, duration, _sdCalendarMoveStep(this.stepValue()));
|
|
1321
|
+
return { allDay: false, startDay: day, startMinutes: start, endDay: day, endMinutes: start + duration, resourceId };
|
|
1322
|
+
}
|
|
1323
|
+
const columns = this.columns();
|
|
1324
|
+
const span = sdSchedulerColumnSpan(placement, columns);
|
|
1325
|
+
const from = span?.from ?? 0;
|
|
1326
|
+
const width = span ? span.to - span.from : 0;
|
|
1327
|
+
const next = Math.min(columns.length - 1 - width, Math.max(0, from + Math.round(shift)));
|
|
1328
|
+
return { ..._sdCalendarShiftDays(placement, _sdCalendarDayDiff(columns[from], columns[next])), resourceId };
|
|
1329
|
+
}
|
|
1330
|
+
#proposalLabel(target, otherRow) {
|
|
1331
|
+
const formats = this.#formats();
|
|
1332
|
+
const time = target.allDay
|
|
1333
|
+
? `${_sdCalendarDateText(formats, target.startDay, false)} – ${_sdCalendarDateText(formats, target.endDay, false)}`
|
|
1334
|
+
: `${_sdCalendarClockText(target.startMinutes)} – ${_sdCalendarClockText(target.endMinutes)}`;
|
|
1335
|
+
const resource = untracked(this.#resourceById).get(target.resourceId);
|
|
1336
|
+
return otherRow && resource ? `${resource.title} · ${time}` : time;
|
|
1337
|
+
}
|
|
1338
|
+
/** Scrolls both axes while the pointer is within 40px of the visible grid area (§9.3), sticky parts left out. */
|
|
1339
|
+
#edgeScroll() {
|
|
1340
|
+
const scroller = this.scroller()?.nativeElement;
|
|
1341
|
+
const session = this.#dragSession;
|
|
1342
|
+
if (!scroller || !session)
|
|
1343
|
+
return this.#edge.stop();
|
|
1344
|
+
const box = scroller.getBoundingClientRect();
|
|
1345
|
+
const area = {
|
|
1346
|
+
top: box.top + session.stickyBlock,
|
|
1347
|
+
bottom: box.bottom,
|
|
1348
|
+
left: session.rtl ? box.left : box.left + session.stickyInline,
|
|
1349
|
+
right: session.rtl ? box.right - session.stickyInline : box.right,
|
|
1350
|
+
};
|
|
1351
|
+
const axes = { x: session.axis !== 'resource', y: session.axis !== 'time' };
|
|
1352
|
+
this.#edge.update(scroller, area, this.#dragPointer, axes, () => {
|
|
1353
|
+
if (!this.#dragSession)
|
|
1354
|
+
return;
|
|
1355
|
+
this.#dragSession.lastKey = null;
|
|
1356
|
+
this.#updateDrag();
|
|
1357
|
+
this.#edgeScroll();
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
/** Position of the proposal block of a row (lane 0, on top of the other blocks, §8.4 step 5). */
|
|
1361
|
+
proposalBox(proposal) {
|
|
1362
|
+
const { target } = proposal;
|
|
1363
|
+
const lastDay = _sdCalendarLastDayOf(target);
|
|
1364
|
+
const placement = { ...target, inGrid: !target.allDay && lastDay === target.startDay, firstDay: target.startDay, lastDay };
|
|
1365
|
+
if (this.activeView() === 'day') {
|
|
1366
|
+
const span = sdSchedulerDaySpan(placement, this.columns()[0]) ?? { start: 0, end: 1440 };
|
|
1367
|
+
return {
|
|
1368
|
+
start: `calc(var(--sd-scheduler-hour-width) * ${span.start / 60} + ${DAY_GAP.before}px)`,
|
|
1369
|
+
size: `max(12px, calc(var(--sd-scheduler-hour-width) * ${(span.end - span.start) / 60} - ${DAY_GAP.before + DAY_GAP.after}px))`,
|
|
1370
|
+
};
|
|
1371
|
+
}
|
|
1372
|
+
const columns = this.columns();
|
|
1373
|
+
const box = sdSchedulerColumnBox(sdSchedulerColumnSpan(placement, columns) ?? { from: 0, to: 0 }, columns.length);
|
|
1374
|
+
return {
|
|
1375
|
+
start: `calc(${box.start * 100}% + ${COLUMN_GAP.before}px)`,
|
|
1376
|
+
size: `calc(${box.size * 100}% - ${COLUMN_GAP.before + COLUMN_GAP.after}px)`,
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
// ---- resize the end (§9.4) ----
|
|
1380
|
+
onResizeDown(domEvent, block) {
|
|
1381
|
+
domEvent.stopPropagation();
|
|
1382
|
+
if (!domEvent.isPrimary || !block.resizable)
|
|
1383
|
+
return;
|
|
1384
|
+
const track = domEvent.currentTarget.closest('[data-track]');
|
|
1385
|
+
this.#resizeSession = {
|
|
1386
|
+
id: block.key,
|
|
1387
|
+
placement: block.placement,
|
|
1388
|
+
x: domEvent.clientX,
|
|
1389
|
+
columnWidth: (track?.getBoundingClientRect().width || 1) / this.columns().length,
|
|
1390
|
+
rtl: this.#rtl(),
|
|
1391
|
+
};
|
|
1392
|
+
this.#failure.set(null);
|
|
1393
|
+
try {
|
|
1394
|
+
domEvent.currentTarget.setPointerCapture(domEvent.pointerId);
|
|
1395
|
+
}
|
|
1396
|
+
catch {
|
|
1397
|
+
// why: see onTrackPointerDown.
|
|
1398
|
+
}
|
|
1399
|
+
document.addEventListener('keydown', this.#onDragKeydown, true);
|
|
1400
|
+
}
|
|
1401
|
+
onResizeMove(domEvent) {
|
|
1402
|
+
const session = this.#resizeSession;
|
|
1403
|
+
if (!session)
|
|
1404
|
+
return;
|
|
1405
|
+
const dx = (session.rtl ? -1 : 1) * (domEvent.clientX - session.x);
|
|
1406
|
+
const { placement } = session;
|
|
1407
|
+
if (this.activeView() === 'day') {
|
|
1408
|
+
const end = _sdCalendarResizeEnd(placement.startMinutes, placement.endMinutes, (dx / this.#sizes().hour) * 60, this.stepValue());
|
|
1409
|
+
this.#resize.set({ id: session.id, endMinutes: end, lastDay: placement.lastDay });
|
|
1410
|
+
return;
|
|
1411
|
+
}
|
|
1412
|
+
// Whole columns on screen, not calendar days: with hideWeekends Thursday + 2 columns is Monday.
|
|
1413
|
+
const lastDay = sdSchedulerResizeLastDay(placement, this.columns(), Math.round(dx / session.columnWidth)) ?? placement.lastDay;
|
|
1414
|
+
this.#resize.set({ id: session.id, endMinutes: placement.endMinutes, lastDay });
|
|
1415
|
+
}
|
|
1416
|
+
onResizeUp(domEvent) {
|
|
1417
|
+
domEvent.stopPropagation();
|
|
1418
|
+
const session = this.#resizeSession;
|
|
1419
|
+
const resize = this.#resize();
|
|
1420
|
+
this.#resizeSession = null;
|
|
1421
|
+
this.#resize.set(null);
|
|
1422
|
+
document.removeEventListener('keydown', this.#onDragKeydown, true);
|
|
1423
|
+
if (!session || !resize)
|
|
1424
|
+
return;
|
|
1425
|
+
const { placement } = session;
|
|
1426
|
+
const resourceId = untracked(this.#reading).placed.find(item => item.event.id === session.id)?.event.resourceId;
|
|
1427
|
+
if (!resourceId)
|
|
1428
|
+
return;
|
|
1429
|
+
const target = placement.allDay
|
|
1430
|
+
? { ..._sdCalendarTargetOf(placement), endDay: resize.lastDay, resourceId }
|
|
1431
|
+
: { ..._sdCalendarTargetOf(placement), endMinutes: resize.endMinutes, resourceId };
|
|
1432
|
+
void this.#runMove(session.id, target, 'resize', false);
|
|
1433
|
+
}
|
|
1434
|
+
/** The browser took the pointer away (a scroll or a system gesture): the live resize is dropped. */
|
|
1435
|
+
onResizeCancel() {
|
|
1436
|
+
this.#resizeSession = null;
|
|
1437
|
+
this.#resize.set(null);
|
|
1438
|
+
document.removeEventListener('keydown', this.#onDragKeydown, true);
|
|
1439
|
+
}
|
|
1440
|
+
/** Floating label of a live resize (§8.3): after the block, or before it when the row has no room left. */
|
|
1441
|
+
resizeLabel(block) {
|
|
1442
|
+
const resize = this.#resize();
|
|
1443
|
+
if (resize?.id !== block.key)
|
|
1444
|
+
return null;
|
|
1445
|
+
const target = block.placement.allDay
|
|
1446
|
+
? { ..._sdCalendarTargetOf(block.placement), endDay: resize.lastDay, resourceId: block.event.resourceId }
|
|
1447
|
+
: { ..._sdCalendarTargetOf(block.placement), endMinutes: resize.endMinutes, resourceId: block.event.resourceId };
|
|
1448
|
+
const { from, to } = this.#inlineOffsets(target);
|
|
1449
|
+
const flip = this.#labelFlips(target);
|
|
1450
|
+
return {
|
|
1451
|
+
text: this.#proposalLabel(target, false),
|
|
1452
|
+
start: flip ? null : `calc(${to} + ${LABEL_GAP}px)`,
|
|
1453
|
+
end: flip ? `calc(100% - ${from} + ${LABEL_GAP}px)` : null,
|
|
1454
|
+
top: `calc(${block.top} + var(--sd-scheduler-lane-height) / 2)`,
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
/** Inline start and end of a target in its track, as CSS lengths. */
|
|
1458
|
+
#inlineOffsets(target) {
|
|
1459
|
+
const lastDay = _sdCalendarLastDayOf(target);
|
|
1460
|
+
const placement = { ...target, inGrid: !target.allDay && lastDay === target.startDay, firstDay: target.startDay, lastDay };
|
|
1461
|
+
if (this.activeView() === 'day') {
|
|
1462
|
+
const span = sdSchedulerDaySpan(placement, this.columns()[0]) ?? { start: 0, end: 1440 };
|
|
1463
|
+
return { from: `var(--sd-scheduler-hour-width) * ${span.start / 60}`, to: `var(--sd-scheduler-hour-width) * ${span.end / 60}` };
|
|
1464
|
+
}
|
|
1465
|
+
const columns = this.columns();
|
|
1466
|
+
const span = sdSchedulerColumnSpan(placement, columns) ?? { from: 0, to: 0 };
|
|
1467
|
+
return { from: `${(span.from / columns.length) * 100}%`, to: `${((span.to + 1) / columns.length) * 100}%` };
|
|
1468
|
+
}
|
|
1469
|
+
/** The space after a target up to the end of its track is too narrow for the floating label (§8.3). */
|
|
1470
|
+
#labelFlips(target) {
|
|
1471
|
+
const lastDay = _sdCalendarLastDayOf(target);
|
|
1472
|
+
if (this.activeView() === 'day') {
|
|
1473
|
+
const hour = this.#sizes().hour;
|
|
1474
|
+
const end = target.endDay > this.columns()[0] || target.allDay ? 1440 : target.endMinutes;
|
|
1475
|
+
return hour * 24 - (end / 60) * hour < LABEL_ROOM;
|
|
1476
|
+
}
|
|
1477
|
+
const columns = this.columns();
|
|
1478
|
+
const span = sdSchedulerColumnSpan({ ...target, inGrid: false, firstDay: target.startDay, lastDay }, columns);
|
|
1479
|
+
const width = this.#trackWidth();
|
|
1480
|
+
return width - (((span?.to ?? 0) + 1) / columns.length) * width < LABEL_ROOM;
|
|
1481
|
+
}
|
|
1482
|
+
/** Inline size of a block, following a live resize. */
|
|
1483
|
+
blockSize(block) {
|
|
1484
|
+
const resize = this.#resize();
|
|
1485
|
+
if (resize?.id !== block.key)
|
|
1486
|
+
return block.size;
|
|
1487
|
+
if (this.activeView() === 'day') {
|
|
1488
|
+
const start = block.placement.startDay < this.columns()[0] ? 0 : block.placement.startMinutes;
|
|
1489
|
+
return `max(12px, calc(var(--sd-scheduler-hour-width) * ${(resize.endMinutes - start) / 60} - ${DAY_GAP.before + DAY_GAP.after}px))`;
|
|
1490
|
+
}
|
|
1491
|
+
const span = sdSchedulerColumnSpan({ ...block.placement, lastDay: resize.lastDay, endDay: resize.lastDay }, this.columns());
|
|
1492
|
+
const box = sdSchedulerColumnBox(span ?? { from: 0, to: 0 }, this.columns().length);
|
|
1493
|
+
return `calc(${box.size * 100}% - ${COLUMN_GAP.before + COLUMN_GAP.after}px)`;
|
|
1494
|
+
}
|
|
1495
|
+
// ---- move pipeline (§9.5) ----
|
|
1496
|
+
scopeMessageId = `${this.baseId}-scope`;
|
|
1497
|
+
#droppable(event, target) {
|
|
1498
|
+
const resource = untracked(this.#resourceById).get(target.resourceId);
|
|
1499
|
+
if (!resource)
|
|
1500
|
+
return false;
|
|
1501
|
+
const to = { ..._sdCalendarRangeOf(target, this.#clock, untracked(this.transform)), resourceId: target.resourceId };
|
|
1502
|
+
try {
|
|
1503
|
+
return _sdCalendarAllows(untracked(this.option).move?.droppable, { event, to, resource });
|
|
1504
|
+
}
|
|
1505
|
+
catch {
|
|
1506
|
+
// Step 0 L11: droppable is synchronous by contract; a throw refuses, with a dev-mode warning.
|
|
1507
|
+
this.#report('warn', `droppable:${event.id}`, `move.droppable threw for event "${event.id}"; the target is refused.`);
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
#announceBlocked(resourceId) {
|
|
1512
|
+
const resource = untracked(this.#resourceById).get(resourceId);
|
|
1513
|
+
this.#announcer.announce(this.#t('core.component.scheduler.drop-blocked', { resource: resource?.title ?? resourceId }));
|
|
1514
|
+
}
|
|
1515
|
+
/** The checks of the scheduler (§9.5 steps 1–3), then the shared pipeline of `ɵSdCalendarMoveRunner`. */
|
|
1516
|
+
async #runMove(id, target, source, keyboard) {
|
|
1517
|
+
const move = untracked(this.option).move;
|
|
1518
|
+
if (!move || untracked(this.locked) || untracked(this.cellTemplateActive) || untracked(this.#operation.busy))
|
|
1519
|
+
return false;
|
|
1520
|
+
const placed = untracked(this.#reading).placed.find(item => item.event.id === id);
|
|
1521
|
+
const resource = untracked(this.#resourceById).get(target.resourceId);
|
|
1522
|
+
if (!placed || !resource || !_sdCalendarAllows(move.movable, placed.event))
|
|
1523
|
+
return false;
|
|
1524
|
+
const { event } = placed;
|
|
1525
|
+
const transform = untracked(this.transform);
|
|
1526
|
+
const from = { ..._sdCalendarRangeOf(placed.placement, this.#clock, transform), resourceId: event.resourceId };
|
|
1527
|
+
const to = { ..._sdCalendarRangeOf(target, this.#clock, transform), resourceId: target.resourceId };
|
|
1528
|
+
const sameTime = from.start === to.start && from.end === to.end && from.allDay === to.allDay;
|
|
1529
|
+
// §4.3, §9.5: a move against axis is refused.
|
|
1530
|
+
const axis = move.axis ?? 'both';
|
|
1531
|
+
if ((axis === 'time' && to.resourceId !== from.resourceId) || (axis === 'resource' && !sameTime))
|
|
1532
|
+
return false;
|
|
1533
|
+
if (sameTime && to.resourceId === from.resourceId)
|
|
1534
|
+
return false;
|
|
1535
|
+
if (this.#outOfRange(target.startDay) || this.#outOfRange(_sdCalendarLastDayOf(target))) {
|
|
1536
|
+
this.#announcer.announce(this.#t('core.component.calendar.out-of-range'));
|
|
1537
|
+
return false;
|
|
1538
|
+
}
|
|
1539
|
+
// SC-08, Step 0 H3: droppable is checked for every source, move() included.
|
|
1540
|
+
if (!this.#droppable(event, target)) {
|
|
1541
|
+
this.#announceBlocked(target.resourceId);
|
|
1542
|
+
return false;
|
|
1543
|
+
}
|
|
1544
|
+
const moved = { ...event, start: to.start, end: to.end, allDay: to.allDay, resourceId: to.resourceId };
|
|
1545
|
+
return this.#runner.run({
|
|
1546
|
+
id,
|
|
1547
|
+
title: event.title,
|
|
1548
|
+
recurring: !!event.occurrence,
|
|
1549
|
+
source,
|
|
1550
|
+
keyboard,
|
|
1551
|
+
// SC-06: both flags are evaluated once more right before the callback.
|
|
1552
|
+
allowed: () => _sdCalendarAllows(move.movable, event) && this.#droppable(event, target),
|
|
1553
|
+
request: (scope, signal) => ({ event, from, to, resource, source, scope, signal }),
|
|
1554
|
+
onMove: move.onMove,
|
|
1555
|
+
show: saving => this.#moving.set(saving === null ? null : { id, event: moved, saving }),
|
|
1556
|
+
accept: request => {
|
|
1557
|
+
this.#loader.items.update(items => items.map(item => (item.id === event.id ? moved : item)));
|
|
1558
|
+
// §9.5 step 6: a target in a collapsed group opens it; a target outside the range moves the range.
|
|
1559
|
+
if (resource.group && untracked(this.#collapsed).has(resource.group))
|
|
1560
|
+
this.toggleGroup(resource.group);
|
|
1561
|
+
const visible = untracked(this.visible);
|
|
1562
|
+
if (target.startDay < visible.from || target.startDay > visible.to)
|
|
1563
|
+
this.date.set(target.startDay);
|
|
1564
|
+
this.sdMove.emit(request);
|
|
1565
|
+
return this.#movedMessage(event, target, resource, from, to, source);
|
|
1566
|
+
},
|
|
1567
|
+
fail: (request, outcome) => this.sdMoveError.emit(outcome.kind === 'error' ? { request, reason: 'error', error: outcome.error } : { request, reason: 'rejected' }),
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
/** Live region text of an accepted move: "Moved to {resource}, {start}" across rows, otherwise as sd-calendar. */
|
|
1571
|
+
#movedMessage(event, target, resource, from, to, source) {
|
|
1572
|
+
const formats = this.#formats();
|
|
1573
|
+
if (to.resourceId === from.resourceId)
|
|
1574
|
+
return _sdCalendarMovedText(event.title, target, from, to, source, formats, this.#t);
|
|
1575
|
+
const day = `${_sdCalendarWeekdayLong(formats, target.startDay)} ${_sdCalendarDateText(formats, target.startDay, false)}`;
|
|
1576
|
+
const time = _sdCalendarClockText(target.startMinutes);
|
|
1577
|
+
const start = target.allDay ? day : this.activeView() === 'day' ? time : `${day}, ${time}`;
|
|
1578
|
+
return this.#t('core.component.scheduler.moved-resource', { resource: resource.title, start });
|
|
1579
|
+
}
|
|
1580
|
+
// ---- loading ----
|
|
1581
|
+
#startLoad(option, resources, range) {
|
|
1582
|
+
this.#abortMove();
|
|
1583
|
+
this.#now.set(this.#clock.now());
|
|
1584
|
+
if (!resources.length) {
|
|
1585
|
+
// §4.1, §12: no resources, no load.
|
|
1586
|
+
this.#loader.abort();
|
|
1587
|
+
this.#loader.items.set([]);
|
|
1588
|
+
this.#loader.phase.set('idle');
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
const resourceIds = resources.map(resource => resource.id);
|
|
1592
|
+
void this.#loader
|
|
1593
|
+
.load(`${_sdCalendarRangeKey(range)}|${this.#generation}`, signal => option.dataSource.onLoad({ from: range.from, to: range.to, view: range.view, resourceIds, signal }), error => {
|
|
1594
|
+
this.#announcer.announce(this.#i18n.t('core.component.calendar.load-error'));
|
|
1595
|
+
this.sdLoadError.emit(error);
|
|
1596
|
+
})
|
|
1597
|
+
.then(() => this.#focus.pending());
|
|
1598
|
+
}
|
|
1599
|
+
#abortMove() {
|
|
1600
|
+
if (!this.#operation.abort(['move']))
|
|
1601
|
+
return;
|
|
1602
|
+
this.#moving.set(null);
|
|
1603
|
+
this.scopeBar.answer(null);
|
|
1604
|
+
}
|
|
1605
|
+
#pruneGroups(resources) {
|
|
1606
|
+
const groups = new Set(resources.map(resource => resource.group).filter((group) => !!group));
|
|
1607
|
+
const collapsed = untracked(this.#collapsed);
|
|
1608
|
+
if ([...collapsed].every(group => groups.has(group)))
|
|
1609
|
+
return;
|
|
1610
|
+
this.#collapsed.set(new Set([...collapsed].filter(group => groups.has(group))));
|
|
1611
|
+
}
|
|
1612
|
+
// ---- views ----
|
|
1613
|
+
#rangeInput() {
|
|
1614
|
+
return { view: this.activeView(), date: this.#anchor(), firstDayOfWeek: this.#firstDayOfWeek(), hideWeekends: false, agendaDays: 14 };
|
|
1615
|
+
}
|
|
1616
|
+
#shiftedRange(direction) {
|
|
1617
|
+
return sdSchedulerVisibleRange(this.activeView(), _sdCalendarShiftDate(this.#rangeInput(), direction), this.#firstDayOfWeek());
|
|
1618
|
+
}
|
|
1619
|
+
#dayView(day) {
|
|
1620
|
+
const weekday = _sdCalendarWeekday(day);
|
|
1621
|
+
const label = `${_sdCalendarWeekdayLong(this.#formats(), day)} ${_sdCalendarDateText(this.#formats(), day, false)}`;
|
|
1622
|
+
return {
|
|
1623
|
+
day,
|
|
1624
|
+
dayNumber: _sdCalendarDayParts(day).day,
|
|
1625
|
+
weekdayShort: this.#i18n.t(`core.component.calendar.weekday-short-${weekday}`),
|
|
1626
|
+
label,
|
|
1627
|
+
openLabel: this.#i18n.t('core.component.scheduler.open-day', {
|
|
1628
|
+
weekday: _sdCalendarWeekdayLong(this.#formats(), day),
|
|
1629
|
+
date: _sdCalendarDateText(this.#formats(), day, false),
|
|
1630
|
+
}),
|
|
1631
|
+
today: day === this.today(),
|
|
1632
|
+
holiday: this.#holidays().get(day) ?? null,
|
|
1633
|
+
};
|
|
1634
|
+
}
|
|
1635
|
+
/** A day is off for a resource: an `off` holiday, or a weekday without working hours (not with `null` hours). */
|
|
1636
|
+
#offDay(day, hours) {
|
|
1637
|
+
return _sdCalendarIsOffDay(day, this.#holidays().get(day), hours);
|
|
1638
|
+
}
|
|
1639
|
+
#resourceRow(resource, group) {
|
|
1640
|
+
const view = this.activeView();
|
|
1641
|
+
const columns = this.columns();
|
|
1642
|
+
const placed = this.#byResource().get(resource.id) ?? [];
|
|
1643
|
+
// §8.4 step 5: a pending block is left out of the lanes and drawn in lane 0, on top.
|
|
1644
|
+
const laid = [];
|
|
1645
|
+
for (const item of placed) {
|
|
1646
|
+
if (view === 'day') {
|
|
1647
|
+
const span = sdSchedulerDaySpan(item.placement, columns[0]);
|
|
1648
|
+
if (span)
|
|
1649
|
+
laid.push({ item, lane: { start: span.start, end: span.end, allDay: item.placement.allDay }, ...span });
|
|
1650
|
+
}
|
|
1651
|
+
else {
|
|
1652
|
+
const span = sdSchedulerColumnSpan(item.placement, columns);
|
|
1653
|
+
if (span) {
|
|
1654
|
+
laid.push({
|
|
1655
|
+
item,
|
|
1656
|
+
lane: { start: span.from, end: span.to + 1, allDay: item.placement.allDay, at: item.placement.startInstant },
|
|
1657
|
+
start: span.from,
|
|
1658
|
+
end: span.to,
|
|
1659
|
+
clippedStart: span.clippedStart,
|
|
1660
|
+
clippedEnd: span.clippedEnd,
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
const stacking = laid.filter(entry => !entry.item.pending);
|
|
1666
|
+
const layout = sdSchedulerLanes(stacking.map(entry => entry.lane));
|
|
1667
|
+
const blocks = layout.order.map(({ index, lane }) => this.#blockView(stacking[index], resource, lane, layout.count));
|
|
1668
|
+
for (const entry of laid)
|
|
1669
|
+
if (entry.item.pending)
|
|
1670
|
+
blocks.push(this.#blockView(entry, resource, 0, layout.count));
|
|
1671
|
+
const token = encodeURIComponent(resource.id);
|
|
1672
|
+
const root = this.rootAutoId();
|
|
1673
|
+
const cells = this.cellTemplateActive() ? this.#cells(resource, placed) : null;
|
|
1674
|
+
return {
|
|
1675
|
+
kind: 'resource',
|
|
1676
|
+
key: `r:${resource.id}`,
|
|
1677
|
+
resource,
|
|
1678
|
+
group,
|
|
1679
|
+
height: sdSchedulerRowHeight(cells ? 1 : layout.count),
|
|
1680
|
+
headerId: `${this.baseId}-resource-${token}`,
|
|
1681
|
+
trackId: `${this.baseId}-track-${token}`,
|
|
1682
|
+
autoId: root ? `${root}-resource-${token}` : null,
|
|
1683
|
+
token,
|
|
1684
|
+
// §8.5: a cell template draws cells; no blocks, no drag, no resize.
|
|
1685
|
+
blocks: cells ? [] : blocks,
|
|
1686
|
+
shades: this.#shades(resource),
|
|
1687
|
+
cells,
|
|
1688
|
+
context: { $implicit: resource, resource, group, compact: this.compact() },
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
/** Cells of a cell template: one per resource and day on screen, with the events that touch that day. */
|
|
1692
|
+
#cells(resource, placed) {
|
|
1693
|
+
const hours = this.#hoursOf(resource);
|
|
1694
|
+
const formats = this.#formats();
|
|
1695
|
+
return this.columns().map(day => {
|
|
1696
|
+
const events = placed.filter(({ placement }) => placement.firstDay <= day && placement.lastDay >= day).map(({ event }) => event);
|
|
1697
|
+
const holiday = this.#holidays().get(day) ?? null;
|
|
1698
|
+
const today = day === this.today();
|
|
1699
|
+
const off = this.#offDay(day, hours);
|
|
1700
|
+
return {
|
|
1701
|
+
day,
|
|
1702
|
+
label: this.#i18n.t('core.component.scheduler.cursor-day', {
|
|
1703
|
+
resource: resource.title,
|
|
1704
|
+
weekday: _sdCalendarWeekdayLong(formats, day),
|
|
1705
|
+
date: _sdCalendarDateText(formats, day, false),
|
|
1706
|
+
}),
|
|
1707
|
+
events,
|
|
1708
|
+
off,
|
|
1709
|
+
today,
|
|
1710
|
+
context: { $implicit: day, date: day, resource, events, holiday, today, off },
|
|
1711
|
+
};
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
/** Off hours (day view) or days off (week, month) of a resource, merged into spans (§7); days outside `minDate` / `maxDate` too. */
|
|
1715
|
+
#shades(resource) {
|
|
1716
|
+
const hours = this.#hoursOf(resource);
|
|
1717
|
+
const columns = this.columns();
|
|
1718
|
+
const min = this.#minDay();
|
|
1719
|
+
const max = this.#maxDay();
|
|
1720
|
+
const shaded = (day) => this.#offDay(day, hours) || _sdCalendarOutOfRange(day, min, max);
|
|
1721
|
+
if (this.activeView() === 'day') {
|
|
1722
|
+
const day = columns[0];
|
|
1723
|
+
const off = shaded(day)
|
|
1724
|
+
? [{ start: 0, end: 1440 }]
|
|
1725
|
+
: _sdCalendarOffSegments(_sdCalendarWorkingRanges(hours, _sdCalendarWeekday(day)));
|
|
1726
|
+
return off.map(span => ({
|
|
1727
|
+
key: `${span.start}`,
|
|
1728
|
+
start: `calc(var(--sd-scheduler-hour-width) * ${span.start / 60})`,
|
|
1729
|
+
size: `calc(var(--sd-scheduler-hour-width) * ${(span.end - span.start) / 60})`,
|
|
1730
|
+
}));
|
|
1731
|
+
}
|
|
1732
|
+
const shades = [];
|
|
1733
|
+
let from = -1;
|
|
1734
|
+
const close = (to) => {
|
|
1735
|
+
if (from < 0)
|
|
1736
|
+
return;
|
|
1737
|
+
const box = sdSchedulerColumnBox({ from, to }, columns.length);
|
|
1738
|
+
shades.push({ key: `${from}`, start: `${box.start * 100}%`, size: `${box.size * 100}%` });
|
|
1739
|
+
from = -1;
|
|
1740
|
+
};
|
|
1741
|
+
columns.forEach((day, column) => {
|
|
1742
|
+
if (shaded(day)) {
|
|
1743
|
+
if (from < 0)
|
|
1744
|
+
from = column;
|
|
1745
|
+
}
|
|
1746
|
+
else
|
|
1747
|
+
close(column - 1);
|
|
1748
|
+
});
|
|
1749
|
+
close(columns.length - 1);
|
|
1750
|
+
return shades;
|
|
1751
|
+
}
|
|
1752
|
+
#blockView(entry, resource, lane, lanes) {
|
|
1753
|
+
const { item } = entry;
|
|
1754
|
+
const { event, placement } = item;
|
|
1755
|
+
const view = this.activeView();
|
|
1756
|
+
const sizes = this.#sizes();
|
|
1757
|
+
const { color, customColor } = _sdCalendarColor(event.color);
|
|
1758
|
+
const recurring = !!event.occurrence;
|
|
1759
|
+
const startText = _sdCalendarClockText(placement.startMinutes);
|
|
1760
|
+
const endText = _sdCalendarClockText(placement.endMinutes);
|
|
1761
|
+
let start;
|
|
1762
|
+
let size;
|
|
1763
|
+
let pixels;
|
|
1764
|
+
if (view === 'day') {
|
|
1765
|
+
const box = sdSchedulerDayBox(entry, sizes.hour);
|
|
1766
|
+
start = `calc(var(--sd-scheduler-hour-width) * ${entry.start / 60} + ${DAY_GAP.before}px)`;
|
|
1767
|
+
size = `max(12px, calc(var(--sd-scheduler-hour-width) * ${(entry.end - entry.start) / 60} - ${DAY_GAP.before + DAY_GAP.after}px))`;
|
|
1768
|
+
pixels = box.width;
|
|
1769
|
+
}
|
|
1770
|
+
else {
|
|
1771
|
+
const box = sdSchedulerColumnBox({ from: entry.start, to: entry.end }, this.columns().length);
|
|
1772
|
+
start = `calc(${box.start * 100}% + ${COLUMN_GAP.before}px)`;
|
|
1773
|
+
size = `calc(${box.size * 100}% - ${COLUMN_GAP.before + COLUMN_GAP.after}px)`;
|
|
1774
|
+
pixels = box.size * this.#trackWidth() - COLUMN_GAP.before - COLUMN_GAP.after;
|
|
1775
|
+
}
|
|
1776
|
+
const tier = pixels >= 120 ? 'lg' : pixels >= 48 ? 'md' : 'sm';
|
|
1777
|
+
const timed = !placement.allDay;
|
|
1778
|
+
const range = { ..._sdCalendarRangeOf(placement, this.#clock, this.transform()), resourceId: event.resourceId };
|
|
1779
|
+
const root = this.rootAutoId();
|
|
1780
|
+
const move = this.option().move;
|
|
1781
|
+
const label = this.#eventLabel(event, placement, resource);
|
|
1782
|
+
const movable = !!move && !this.locked() && !this.cellTemplateActive() && _sdCalendarAllows(move.movable, event);
|
|
1783
|
+
// Week and month: the handle sits on the last day, so a block whose last day has no column has none (§9.4).
|
|
1784
|
+
const resizable = movable &&
|
|
1785
|
+
(move?.axis ?? 'both') !== 'resource' &&
|
|
1786
|
+
(view === 'day' ? placement.inGrid : placement.allDay && sdSchedulerResizeLastDay(placement, this.columns(), 0) !== null);
|
|
1787
|
+
return {
|
|
1788
|
+
key: event.id,
|
|
1789
|
+
event,
|
|
1790
|
+
placement,
|
|
1791
|
+
range,
|
|
1792
|
+
label,
|
|
1793
|
+
title: label,
|
|
1794
|
+
autoId: root ? `${root}-event-${encodeURIComponent(event.id)}` : null,
|
|
1795
|
+
color,
|
|
1796
|
+
customColor,
|
|
1797
|
+
recurring,
|
|
1798
|
+
past: this.dimPast() && placement.endInstant <= this.#nowInstant(),
|
|
1799
|
+
pending: item.pending,
|
|
1800
|
+
saving: item.saving,
|
|
1801
|
+
movable,
|
|
1802
|
+
resizable,
|
|
1803
|
+
start,
|
|
1804
|
+
size,
|
|
1805
|
+
top: `${sdSchedulerLaneTop(item.pending ? 0 : lane, lanes)}px`,
|
|
1806
|
+
tier,
|
|
1807
|
+
leadTime: view !== 'day' && timed && pixels >= 96 ? startText : null,
|
|
1808
|
+
timeText: placement.allDay ? this.#i18n.t('core.component.calendar.all-day') : `${startText}–${endText}`,
|
|
1809
|
+
clippedStart: entry.clippedStart,
|
|
1810
|
+
clippedEnd: entry.clippedEnd,
|
|
1811
|
+
context: {
|
|
1812
|
+
$implicit: event,
|
|
1813
|
+
event,
|
|
1814
|
+
range,
|
|
1815
|
+
resource,
|
|
1816
|
+
view,
|
|
1817
|
+
compact: pixels < 48,
|
|
1818
|
+
pending: item.pending,
|
|
1819
|
+
},
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
#eventLabel(event, placement, resource) {
|
|
1823
|
+
const formats = this.#formats();
|
|
1824
|
+
let label;
|
|
1825
|
+
if (placement.allDay) {
|
|
1826
|
+
label = this.#i18n.t('core.component.scheduler.event-label-all-day', {
|
|
1827
|
+
title: event.title,
|
|
1828
|
+
resource: resource.title,
|
|
1829
|
+
from: _sdCalendarDateText(formats, placement.firstDay, false),
|
|
1830
|
+
to: _sdCalendarDateText(formats, placement.lastDay, false),
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
else {
|
|
1834
|
+
const end = _sdCalendarClockText(placement.endMinutes);
|
|
1835
|
+
label = this.#i18n.t('core.component.scheduler.event-label', {
|
|
1836
|
+
title: event.title,
|
|
1837
|
+
resource: resource.title,
|
|
1838
|
+
weekday: _sdCalendarWeekdayLong(formats, placement.startDay),
|
|
1839
|
+
date: _sdCalendarDateText(formats, placement.startDay, false),
|
|
1840
|
+
start: _sdCalendarClockText(placement.startMinutes),
|
|
1841
|
+
end: placement.inGrid ? end : `${_sdCalendarDateText(formats, placement.endDay, false)} ${end}`,
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
return event.occurrence ? `${label}, ${this.#i18n.t('core.component.calendar.recurring')}` : label;
|
|
1845
|
+
}
|
|
1846
|
+
/** Width (px) of the time area of a row in the week and month views. */
|
|
1847
|
+
#trackWidth() {
|
|
1848
|
+
const sizes = this.#sizes();
|
|
1849
|
+
const count = this.columns().length;
|
|
1850
|
+
const minimum = count * (this.activeView() === 'month' ? sizes.month : sizes.day);
|
|
1851
|
+
// why: 2px are the left and right borders of the scheduler frame.
|
|
1852
|
+
return Math.max(minimum, (this.#width() ?? 0) - sizes.resource - 2);
|
|
1853
|
+
}
|
|
1854
|
+
// ---- scrolling and measuring ----
|
|
1855
|
+
#scrollToTime() {
|
|
1856
|
+
const scroller = this.scroller()?.nativeElement;
|
|
1857
|
+
if (!scroller)
|
|
1858
|
+
return;
|
|
1859
|
+
// why: this can run before the measuring hook of the first render; the compact sizes must already apply.
|
|
1860
|
+
this.#measureSizes();
|
|
1861
|
+
const minutes = _sdCalendarTimeToMinutes(this.scrollTime() ?? this.#configuration?.scrollTime) ?? this.#earliestWorkingMinute();
|
|
1862
|
+
const offset = (minutes / 60) * this.#sizes().hour;
|
|
1863
|
+
scroller.scrollLeft = this.#rtl() ? -offset : offset;
|
|
1864
|
+
}
|
|
1865
|
+
/** Week and month: when today is on screen but its column is hidden, it is brought next to the resource column (§6). */
|
|
1866
|
+
#revealToday() {
|
|
1867
|
+
const scroller = this.scroller()?.nativeElement;
|
|
1868
|
+
const cell = scroller?.querySelector('[data-axis-day][data-today]');
|
|
1869
|
+
if (!scroller || !cell)
|
|
1870
|
+
return;
|
|
1871
|
+
this.#measureSizes();
|
|
1872
|
+
const area = scroller.getBoundingClientRect();
|
|
1873
|
+
const box = cell.getBoundingClientRect();
|
|
1874
|
+
const sticky = this.#sizes().resource;
|
|
1875
|
+
if (this.#rtl()) {
|
|
1876
|
+
const right = area.right - sticky;
|
|
1877
|
+
if (box.right > right || box.left < area.left)
|
|
1878
|
+
scroller.scrollLeft += box.right - right;
|
|
1879
|
+
}
|
|
1880
|
+
else {
|
|
1881
|
+
const left = area.left + sticky;
|
|
1882
|
+
if (box.left < left || box.right > area.right)
|
|
1883
|
+
scroller.scrollLeft += box.left - left;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
#earliestWorkingMinute() {
|
|
1887
|
+
const starts = this.resources()
|
|
1888
|
+
.map(resource => _sdCalendarWorkingRanges(this.#hoursOf(resource), _sdCalendarWeekday(this.columns()[0]))?.[0]?.start)
|
|
1889
|
+
.filter((start) => start !== undefined);
|
|
1890
|
+
return starts.length ? Math.min(...starts) : _sdCalendarTimeToMinutes(_SD_CALENDAR_DEFAULTS.scrollTime);
|
|
1891
|
+
}
|
|
1892
|
+
#measureSizes() {
|
|
1893
|
+
const element = this.root()?.nativeElement;
|
|
1894
|
+
if (!element)
|
|
1895
|
+
return;
|
|
1896
|
+
const style = getComputedStyle(element);
|
|
1897
|
+
const read = (name, fallback) => parseFloat(style.getPropertyValue(name)) || fallback;
|
|
1898
|
+
const fallback = this.compact() ? COMPACT_SIZES : SIZES;
|
|
1899
|
+
const sizes = {
|
|
1900
|
+
hour: read('--sd-scheduler-hour-width', fallback.hour),
|
|
1901
|
+
resource: read('--sd-scheduler-resource-width', fallback.resource),
|
|
1902
|
+
day: read('--sd-scheduler-day-min-width', fallback.day),
|
|
1903
|
+
month: read('--sd-scheduler-month-day-min-width', fallback.month),
|
|
1904
|
+
};
|
|
1905
|
+
const current = untracked(this.#sizes);
|
|
1906
|
+
if (Object.entries(sizes).some(([name, value]) => current[name] !== value))
|
|
1907
|
+
this.#sizes.set(sizes);
|
|
1908
|
+
}
|
|
1909
|
+
#rtl() {
|
|
1910
|
+
return _sdCalendarIsRtl(this.#host.nativeElement);
|
|
1911
|
+
}
|
|
1912
|
+
#announceTitle() {
|
|
1913
|
+
this.#announcer.announce(untracked(this.title));
|
|
1914
|
+
}
|
|
1915
|
+
/** Logs a dev-mode diagnostic once per instance and key. */
|
|
1916
|
+
#report(level, key, message) {
|
|
1917
|
+
this.#reporter.report(level, key, message);
|
|
1918
|
+
}
|
|
1919
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdScheduler, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1920
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdScheduler, isStandalone: true, selector: "sd-scheduler", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null }, resources: { classPropertyName: "resources", publicName: "resources", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, date: { classPropertyName: "date", publicName: "date", isSignal: true, isRequired: false, transformFunction: null }, selectedId: { classPropertyName: "selectedId", publicName: "selectedId", isSignal: true, isRequired: false, transformFunction: null }, views: { classPropertyName: "views", publicName: "views", isSignal: true, isRequired: false, transformFunction: null }, resourceLabel: { classPropertyName: "resourceLabel", publicName: "resourceLabel", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, hideWeekends: { classPropertyName: "hideWeekends", publicName: "hideWeekends", isSignal: true, isRequired: false, transformFunction: null }, workingHours: { classPropertyName: "workingHours", publicName: "workingHours", isSignal: true, isRequired: false, transformFunction: null }, holidays: { classPropertyName: "holidays", publicName: "holidays", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, scrollTime: { classPropertyName: "scrollTime", publicName: "scrollTime", isSignal: true, isRequired: false, transformFunction: null }, dimPast: { classPropertyName: "dimPast", publicName: "dimPast", isSignal: true, isRequired: false, transformFunction: null }, transform: { classPropertyName: "transform", publicName: "transform", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { view: "viewChange", date: "dateChange", selectedId: "selectedIdChange", sdSelect: "sdSelect", sdRangeChange: "sdRangeChange", sdMove: "sdMove", sdMoveError: "sdMoveError", sdLoadError: "sdLoadError", sdCellSelect: "sdCellSelect" }, queries: [{ propertyName: "eventTemplate", first: true, predicate: SdSchedulerEventTemplateDirective, descendants: true, isSignal: true }, { propertyName: "resourceTemplate", first: true, predicate: SdSchedulerResourceTemplateDirective, descendants: true, isSignal: true }, { propertyName: "cellTemplate", first: true, predicate: SdSchedulerCellTemplateDirective, descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: SdSchedulerEmptyTemplateDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "scroller", first: true, predicate: ["scroller"], descendants: true, isSignal: true }, { propertyName: "gridElement", first: true, predicate: ["grid"], descendants: true, isSignal: true }, { propertyName: "root", first: true, predicate: ["root"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _view = activeView();\n@let _disabled = disabled();\n@let _selected = selectedId();\n@let _failure = failure();\n@let _days = dayViews();\n@let _ghost = ghost();\n@let _canCreate = canCreate();\n@let _proposal = dragProposal();\n@let _lockAxis = lockAxis();\n@let _cursor = cursor();\n<section\n #root\n class=\"sd-scheduler\"\n role=\"region\"\n [class.sd-scheduler--compact]=\"compact()\"\n [attr.data-compact]=\"compact() || null\"\n [attr.aria-label]=\"regionLabel()\"\n [attr.data-autoid]=\"rootAutoId()\"\n [attr.data-view]=\"_view\"\n [attr.data-from]=\"visible().from\"\n [attr.data-to]=\"visible().to\">\n <header class=\"sd-scheduler__toolbar\">\n <div class=\"sd-scheduler__nav\">\n <button type=\"button\" class=\"sd-scheduler__today\" data-action=\"today\" [attr.data-autoid]=\"childAutoId('today')\" (click)=\"goToday()\">\n {{ 'core.component.calendar.today' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__icon-button\"\n data-action=\"prev\"\n [attr.aria-label]=\"prevLabel()\"\n [attr.data-autoid]=\"childAutoId('prev')\"\n [disabled]=\"prevDisabled()\"\n (click)=\"shift(-1)\">\n <sd-icon name=\"chevron_left\" size=\"22px\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__icon-button\"\n data-action=\"next\"\n [attr.aria-label]=\"nextLabel()\"\n [attr.data-autoid]=\"childAutoId('next')\"\n [disabled]=\"nextDisabled()\"\n (click)=\"shift(1)\">\n <sd-icon name=\"chevron_right\" size=\"22px\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"sd-scheduler__title\" data-title>{{ title() }}</div>\n <div class=\"sd-scheduler__views\" role=\"group\" [attr.aria-label]=\"'core.component.calendar.views' | sdTranslate\">\n @for (option of viewOptions(); track option) {\n <button\n type=\"button\"\n class=\"sd-scheduler__view\"\n [attr.data-view-option]=\"option\"\n [attr.data-autoid]=\"childAutoId('view-' + option)\"\n [attr.aria-pressed]=\"option === _view\"\n (click)=\"setView(option)\">\n {{ viewLabel(option) }}\n </button>\n }\n </div>\n </header>\n\n @if (busy()) {\n <div class=\"sd-scheduler__progress\" role=\"progressbar\" [attr.aria-label]=\"regionLabel()\">\n <span class=\"sd-scheduler__progress-bar\"></span>\n </div>\n }\n @if (phase() === 'error') {\n <div class=\"sd-scheduler__band\" data-band=\"load-error\">\n <sd-icon class=\"sd-scheduler__band-icon\" name=\"error\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__band-text\">{{ 'core.component.calendar.load-error' | sdTranslate }}</span>\n <button type=\"button\" class=\"sd-scheduler__band-button\" data-action=\"retry\" [attr.data-autoid]=\"childAutoId('retry')\" (click)=\"reload()\">\n {{ 'core.common.retry' | sdTranslate }}\n </button>\n </div>\n }\n @if (_failure) {\n <div class=\"sd-scheduler__band\" data-band=\"move-error\">\n <sd-icon class=\"sd-scheduler__band-icon\" name=\"error\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__band-text\">{{ _failure.message }}</span>\n <button type=\"button\" class=\"sd-scheduler__band-button\" data-action=\"dismiss\" [attr.data-autoid]=\"childAutoId('dismiss')\" (click)=\"dismissFailure()\">\n {{ 'core.common.dismiss' | sdTranslate }}\n </button>\n </div>\n }\n <div class=\"sd-scheduler__status\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n <span class=\"sd-scheduler__status\" [id]=\"gridHelpId\">{{ 'core.component.scheduler.grid-help' | sdTranslate }}</span>\n <span class=\"sd-scheduler__status\" [id]=\"eventHelpId\">{{ 'core.component.scheduler.event-help' | sdTranslate }}</span>\n @if (scopeBar.asking(); as _ask) {\n <div class=\"sd-scheduler__scope\" role=\"alertdialog\" [attr.aria-labelledby]=\"scopeMessageId\" (keydown)=\"scopeBar.onKeydown($event)\">\n <p class=\"sd-scheduler__scope-message\" [id]=\"scopeMessageId\">\n {{ 'core.component.calendar.scope-message' | sdTranslate: { title: _ask.title } }}\n </p>\n <div class=\"sd-scheduler__scope-actions\">\n <button type=\"button\" class=\"sd-scheduler__scope-button\" data-scope=\"this\" [attr.data-autoid]=\"childAutoId('scope-this')\" (click)=\"scopeBar.answer('this')\">\n {{ 'core.component.calendar.scope-this' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__scope-button\"\n data-scope=\"following\"\n [attr.data-autoid]=\"childAutoId('scope-following')\"\n (click)=\"scopeBar.answer('following')\">\n {{ 'core.component.calendar.scope-following' | sdTranslate }}\n </button>\n <button type=\"button\" class=\"sd-scheduler__scope-button\" data-scope=\"all\" [attr.data-autoid]=\"childAutoId('scope-all')\" (click)=\"scopeBar.answer('all')\">\n {{ 'core.component.calendar.scope-all' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__scope-button sd-scheduler__scope-button--cancel\"\n data-scope=\"cancel\"\n [attr.data-autoid]=\"childAutoId('scope-cancel')\"\n (click)=\"scopeBar.answer(null)\">\n {{ 'core.common.cancel' | sdTranslate }}\n </button>\n </div>\n </div>\n }\n\n @if (invalid()) {\n <sd-data-state class=\"sd-scheduler__invalid\" state=\"error\" compact [title]=\"'core.component.calendar.invalid-data' | sdTranslate\" />\n } @else {\n <div\n #scroller\n class=\"sd-scheduler__scroller\"\n data-region=\"scroller\"\n [attr.data-view]=\"_view\"\n [style.--sd-scheduler-columns]=\"_days.length\">\n <div\n #grid\n class=\"sd-scheduler__grid\"\n role=\"grid\"\n tabindex=\"0\"\n data-region=\"grid\"\n [attr.aria-label]=\"regionLabel() + ', ' + title()\"\n [attr.aria-describedby]=\"gridHelpId\"\n [attr.aria-activedescendant]=\"cursorTarget()\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-disabled]=\"_disabled || null\"\n (focus)=\"onGridFocus()\"\n (keydown)=\"onGridKeydown($event)\">\n <div class=\"sd-scheduler__head\" role=\"rowgroup\">\n <div class=\"sd-scheduler__head-row\" role=\"row\">\n <div class=\"sd-scheduler__corner\" role=\"columnheader\" data-corner>\n <span class=\"sd-scheduler__corner-label\">{{ cornerLabel() }}</span>\n <span class=\"sd-scheduler__corner-count\">\u00B7 {{ resources().length }}</span>\n </div>\n <div class=\"sd-scheduler__axis\" data-axis>\n @if (_view === 'day') {\n @for (hour of hours; track hour.hour) {\n <div class=\"sd-scheduler__hour\" role=\"columnheader\" data-axis-hour>{{ hour.label }}</div>\n }\n } @else {\n @for (day of _days; track day.day) {\n <div\n class=\"sd-scheduler__axis-day\"\n role=\"columnheader\"\n data-axis-day\n [attr.data-date]=\"day.day\"\n [attr.data-today]=\"day.today || null\"\n [attr.data-holiday]=\"day.holiday?.type ?? null\"\n [attr.title]=\"day.holiday?.label ?? null\">\n <span class=\"sd-scheduler__weekday\">{{ day.weekdayShort }}</span>\n <button type=\"button\" class=\"sd-scheduler__day-number\" tabindex=\"-1\" [attr.aria-label]=\"day.openLabel\" (click)=\"openDay(day.day)\">\n {{ day.dayNumber }}\n </button>\n @if (_view === 'month' && day.holiday?.type === 'observance') {\n <span class=\"sd-scheduler__holiday-dot\" data-holiday-dot aria-hidden=\"true\"></span>\n }\n </div>\n }\n }\n </div>\n </div>\n </div>\n <div class=\"sd-scheduler__body\" role=\"rowgroup\" data-rows>\n @if (empty()) {\n <div class=\"sd-scheduler__empty-row\" role=\"row\">\n <div class=\"sd-scheduler__empty\" role=\"gridcell\" data-empty>\n @if (emptyTemplate(); as _empty) {\n <ng-container [ngTemplateOutlet]=\"_empty.template\" [ngTemplateOutletContext]=\"{ $implicit: visible() }\" />\n } @else {\n <sd-icon class=\"sd-scheduler__empty-icon\" name=\"event_busy\" size=\"28px\" aria-hidden=\"true\" />\n <p class=\"sd-scheduler__empty-text\">{{ 'core.component.scheduler.empty' | sdTranslate }}</p>\n }\n </div>\n </div>\n } @else {\n @for (row of rows(); track row.key) {\n @if (row.kind === 'group') {\n <div class=\"sd-scheduler__group\" role=\"row\" [attr.data-group]=\"row.name\" [attr.data-collapsed]=\"row.collapsed || null\">\n <div\n class=\"sd-scheduler__group-cell\"\n role=\"rowheader\"\n [id]=\"row.headerId\"\n [attr.data-cursor-row]=\"_cursor?.rowKey === row.key || null\">\n <button\n type=\"button\"\n class=\"sd-scheduler__group-button\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"!row.collapsed\"\n [attr.aria-label]=\"row.label\"\n [attr.title]=\"row.hint\"\n (click)=\"toggleGroup(row.name)\">\n <sd-icon class=\"sd-scheduler__group-icon\" [name]=\"row.collapsed ? 'chevron_right' : 'expand_more'\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__group-label\">{{ row.name }}</span>\n <span class=\"sd-scheduler__group-count\">\u00B7 {{ row.countText }}</span>\n </button>\n </div>\n </div>\n } @else {\n <div\n class=\"sd-scheduler__row\"\n role=\"row\"\n [attr.data-resource-id]=\"row.resource.id\"\n [attr.data-autoid]=\"row.autoId\"\n [attr.data-drop]=\"_proposal && !_proposal.outside && _proposal.target.resourceId === row.resource.id ? (_proposal.blocked ? 'blocked' : 'ok') : null\"\n [attr.data-blocked]=\"(_proposal?.blocked && !_proposal?.outside && _proposal?.target?.resourceId === row.resource.id) || null\"\n [style.height.px]=\"row.height\">\n <div class=\"sd-scheduler__resource\" role=\"rowheader\" [id]=\"row.headerId\" [attr.title]=\"row.resource.title\">\n @if (resourceTemplate(); as _template) {\n <ng-container [ngTemplateOutlet]=\"_template.template\" [ngTemplateOutletContext]=\"row.context\" />\n } @else {\n @if (row.resource.avatar) {\n <sd-avatar class=\"sd-scheduler__avatar\" [src]=\"row.resource.avatar\" [name]=\"row.resource.title\" [size]=\"compact() ? 24 : 28\" />\n } @else if (row.resource.icon) {\n <span class=\"sd-scheduler__resource-icon\" aria-hidden=\"true\">\n <sd-icon [name]=\"row.resource.icon\" size=\"18px\" />\n </span>\n }\n <span class=\"sd-scheduler__resource-text\">\n <span class=\"sd-scheduler__resource-title\">{{ row.resource.title }}</span>\n @if (row.resource.description) {\n <span class=\"sd-scheduler__resource-description\" [attr.title]=\"row.resource.description\">{{ row.resource.description }}</span>\n }\n </span>\n }\n </div>\n <!-- why: one set of listeners per row instead of per block (Step 0 H6, way 2); blocks are found by data-event-id.\n The row itself is not a tab stop: the grid is (aria-activedescendant), and blocks are buttons. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"sd-scheduler__track\"\n data-track\n [id]=\"row.trackId\"\n [attr.role]=\"row.cells ? 'presentation' : 'gridcell'\"\n [attr.aria-label]=\"!row.cells && _cursor?.rowKey === row.key ? cursorLabel() : null\"\n [class.sd-scheduler__track--cells]=\"!!row.cells\"\n [class.sd-scheduler__track--create]=\"_canCreate\"\n [class.sd-scheduler__track--blocked]=\"!!_ghost?.blocked && _ghost?.resourceId === row.resource.id\"\n [attr.data-resource-id]=\"row.resource.id\"\n (pointerdown)=\"onTrackPointerDown($event, row.resource.id)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp()\"\n (pointercancel)=\"onTrackPointerCancel()\"\n (mousedown)=\"onTrackPress($event)\"\n (touchstart)=\"onTrackPress($event)\"\n (click)=\"onTrackClick($event, row)\"\n (keydown)=\"onTrackKeydown($event, row)\">\n @for (shade of row.shades; track shade.key) {\n <div class=\"sd-scheduler__off\" data-off-hours aria-hidden=\"true\" [style.inset-inline-start]=\"shade.start\" [style.inline-size]=\"shade.size\"></div>\n }\n @if (row.cells) {\n @for (cell of row.cells; track cell.day) {\n <!-- why: a cell is reached with the grid cursor (aria-activedescendant + Enter), not with Tab. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"sd-scheduler__cell\"\n role=\"gridcell\"\n [id]=\"row.trackId + '-' + cell.day\"\n [attr.aria-label]=\"cell.label\"\n [attr.data-date]=\"cell.day\"\n [attr.data-resource-id]=\"row.resource.id\"\n [attr.data-off]=\"cell.off || null\"\n [attr.data-today]=\"cell.today || null\"\n [attr.data-cursor-cell]=\"(_cursor?.rowKey === row.key && _cursor?.day === cell.day) || null\"\n (click)=\"onCellClick(row, cell)\">\n <ng-container [ngTemplateOutlet]=\"cellTemplate()!.template\" [ngTemplateOutletContext]=\"cell.context\" />\n </div>\n }\n }\n @if (_cursor?.rowKey === row.key && cursorBox(); as _cursorBox) {\n <div class=\"sd-scheduler__cursor\" data-cursor aria-hidden=\"true\" [style.inset-inline-start]=\"_cursorBox.start\" [style.inline-size]=\"_cursorBox.size\">\n <bdi>{{ _cursorBox.text }}</bdi>\n </div>\n }\n @if (skeleton() && skeletonRows().has(row.key)) {\n @let _shape = skeletonShapes[skeletonRows().get(row.key)!];\n <div\n class=\"sd-scheduler__skeleton\"\n data-skeleton\n aria-hidden=\"true\"\n [style.inset-inline-start.%]=\"_shape[0] * 100\"\n [style.inline-size.%]=\"_shape[1] * 100\"></div>\n }\n @for (block of row.blocks; track block.key) {\n <div\n class=\"sd-scheduler__event\"\n role=\"button\"\n cdkDrag\n [cdkDragDisabled]=\"!block.movable\"\n [cdkDragStartDelay]=\"dragDelay\"\n [cdkDragConstrainPosition]=\"constrainDrag\"\n [cdkDragLockAxis]=\"_lockAxis\"\n (cdkDragStarted)=\"onDragStarted($event, block)\"\n (cdkDragEnded)=\"onDragEnded($event)\"\n [attr.tabindex]=\"_disabled ? -1 : 0\"\n [attr.aria-label]=\"block.label\"\n [attr.aria-describedby]=\"row.headerId + ' ' + eventHelpId\"\n [attr.title]=\"block.title\"\n [attr.data-event-id]=\"block.event.id\"\n [attr.data-autoid]=\"block.autoId\"\n [attr.data-resource-id]=\"block.event.resourceId\"\n [attr.data-start]=\"block.range.start\"\n [attr.data-end]=\"block.range.end\"\n [attr.data-all-day]=\"block.placement.allDay\"\n [attr.data-color]=\"block.color\"\n [attr.data-tier]=\"block.tier\"\n [attr.data-past]=\"block.past || null\"\n [attr.data-pending]=\"block.pending || null\"\n [attr.data-selected]=\"block.key === _selected || null\"\n [attr.data-failed]=\"isFailed(block.key) || null\"\n [attr.data-movable]=\"block.movable || null\"\n [attr.data-dragging]=\"isDragging(block.key) || null\"\n [attr.data-clipped-start]=\"block.clippedStart || null\"\n [attr.data-clipped-end]=\"block.clippedEnd || null\"\n [style.--sd-scheduler-event-color]=\"block.customColor\"\n [style.inset-inline-start]=\"block.start\"\n [style.inline-size]=\"blockSize(block)\"\n [style.top]=\"block.top\">\n <span class=\"sd-scheduler__dot\" aria-hidden=\"true\"></span>\n @if (eventTemplate(); as _template) {\n <div class=\"sd-scheduler__event-content\">\n <ng-container [ngTemplateOutlet]=\"_template.template\" [ngTemplateOutletContext]=\"block.context\" />\n </div>\n } @else if (block.tier !== 'sm') {\n @if (block.recurring) {\n <sd-icon class=\"sd-scheduler__repeat\" name=\"repeat\" size=\"13px\" aria-hidden=\"true\" />\n }\n <span class=\"sd-scheduler__event-title\">\n @if (block.leadTime) {\n <span class=\"sd-scheduler__lead-time\">{{ block.leadTime }}</span>\n }\n {{ block.event.title }}\n </span>\n @if (block.tier === 'lg' && _view === 'day') {\n <span class=\"sd-scheduler__event-time\">{{ block.timeText }}</span>\n }\n }\n @if (block.saving) {\n <sd-icon class=\"sd-scheduler__sync\" name=\"sync\" size=\"14px\" aria-hidden=\"true\" />\n }\n @if (block.resizable) {\n <div\n class=\"sd-scheduler__resize\"\n data-resize-handle\n aria-hidden=\"true\"\n (mousedown)=\"$event.stopPropagation()\"\n (touchstart)=\"$event.stopPropagation()\"\n (pointerdown)=\"onResizeDown($event, block)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeUp($event)\"\n (pointercancel)=\"onResizeCancel()\"></div>\n }\n </div>\n @if (resizeLabel(block); as _resize) {\n <span\n class=\"sd-scheduler__label sd-scheduler__label--resize\"\n data-resize-label\n aria-hidden=\"true\"\n [attr.data-flip]=\"_resize.end ? true : null\"\n [style.inset-inline-start]=\"_resize.start\"\n [style.inset-inline-end]=\"_resize.end\"\n [style.top]=\"_resize.top\">\n <bdi>{{ _resize.text }}</bdi>\n </span>\n }\n }\n @if (_proposal && !_proposal.outside && !_proposal.onGroup && _proposal.target.resourceId === row.resource.id) {\n @let _drop = proposalBox(_proposal);\n <div\n class=\"sd-scheduler__event sd-scheduler__proposal\"\n data-drag-proposal\n aria-hidden=\"true\"\n [attr.data-color]=\"_proposal.color\"\n [attr.data-tier]=\"_proposal.tier\"\n [attr.data-blocked]=\"_proposal.blocked || null\"\n [style.--sd-scheduler-event-color]=\"_proposal.customColor\"\n [style.inset-inline-start]=\"_drop.start\"\n [style.inline-size]=\"_drop.size\"\n [style.top.px]=\"row.height > 48 ? 6 : 10\">\n <span class=\"sd-scheduler__dot\"></span>\n @if (_proposal.tier !== 'sm') {\n <span class=\"sd-scheduler__event-title\">{{ _proposal.title }}</span>\n }\n <span class=\"sd-scheduler__label\" data-drag-label [attr.data-flip]=\"_proposal.flip || null\"><bdi>{{ _proposal.label }}</bdi></span>\n </div>\n }\n @if (_ghost && _ghost.resourceId === row.resource.id) {\n @let _box = ghostBox(_ghost);\n <div\n class=\"sd-scheduler__ghost\"\n data-create-ghost\n aria-hidden=\"true\"\n [attr.data-pending]=\"_ghost.pending || null\"\n [attr.data-blocked]=\"_ghost.blocked || null\"\n [style.inset-inline-start]=\"_box.start\"\n [style.inline-size]=\"_box.size\">\n <span class=\"sd-scheduler__event-title\">{{ 'core.component.calendar.new-event' | sdTranslate }}</span>\n @if (_box.time) {\n <span class=\"sd-scheduler__event-time\">{{ _box.time }}</span>\n }\n @if (_ghost.pending) {\n <sd-icon class=\"sd-scheduler__sync\" name=\"sync\" size=\"14px\" aria-hidden=\"true\" />\n }\n </div>\n }\n </div>\n </div>\n }\n }\n @if (nowOffset(); as _now) {\n <div class=\"sd-scheduler__now\" data-now aria-hidden=\"true\" [style.--sd-scheduler-now-offset]=\"_now\"></div>\n }\n }\n </div>\n </div>\n </div>\n }\n</section>\n", styles: [":host{--sd-scheduler-resource-width: 240px;--sd-scheduler-hour-width: 80px;--sd-scheduler-day-min-width: 120px;--sd-scheduler-month-day-min-width: 28px;--sd-scheduler-row-min-height: 48px;--sd-scheduler-lane-height: 28px;--sd-scheduler-event-radius: var(--sd-radius-6, 6px);--sd-scheduler-group-height: 32px;display:block;min-width:0;text-align:start}.sd-scheduler{--sd-scheduler-track: calc(var(--sd-scheduler-hour-width) * 24);position:relative;display:flex;flex-direction:column;box-sizing:border-box;height:100%;overflow:hidden;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-12, 12px);background:var(--sd-surface, #fdfbff);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-scheduler__toolbar{display:flex;flex:none;align-items:center;gap:12px;height:56px;padding-block:0;padding-inline:14px 12px;border-bottom:1px solid var(--sd-calendar-line, #dedee5)}.sd-scheduler__nav{display:flex;flex:none;align-items:center;gap:4px}.sd-scheduler__today{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__today:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__today{height:var(--sd-control-height-sm, 32px);margin-inline-end:4px;padding:0 14px;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__icon-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__icon-button{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-control-height-sm, 32px);height:var(--sd-control-height-sm, 32px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary, #44474f)}.sd-scheduler__icon-button:disabled{cursor:default;opacity:.38}.sd-scheduler__title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:var(--sd-font-size-18, 18px);line-height:var(--sd-line-height-24, 24px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__views{display:flex;flex:none;overflow:hidden;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-8, 8px)}.sd-scheduler__view{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__view:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__view{height:30px;padding:0 12px;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__view+.sd-scheduler__view{border-inline-start:1px solid var(--sd-border, #c4c6d0)}.sd-scheduler__view[aria-pressed=true]{background:var(--sd-primary-light, #dbe8f5);color:var(--sd-text, #1a1b1f)}.sd-scheduler__view:focus-visible{outline-offset:-2px}@media(hover:hover){.sd-scheduler__today:hover,.sd-scheduler__icon-button:not(:disabled):hover,.sd-scheduler__view:not([aria-pressed=true]):hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,transparent)}}.sd-scheduler__progress{position:relative;flex:none;height:2px;overflow:hidden;background:var(--sd-primary-light, #dbe8f5)}.sd-scheduler__progress-bar{position:absolute;inset:0 auto 0 0;width:40%;background:var(--sd-primary, #005cbb);animation:sd-scheduler-progress 1.2s ease-in-out infinite}@keyframes sd-scheduler-progress{0%{transform:translate(-100%)}to{transform:translate(250%)}}.sd-scheduler__band{display:flex;flex:none;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid color-mix(in srgb,var(--sd-error, #ba1a1a) 28%,var(--sd-surface, #fdfbff));background:var(--sd-status-error-bg, #f5dfdf);color:var(--sd-status-error-fg, #9c1616);font-size:var(--sd-font-size-13, 13px)}.sd-scheduler__band-icon{flex:none;color:var(--sd-error, #ba1a1a)}.sd-scheduler__band-text{flex:1;min-width:0}.sd-scheduler__band-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__band-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__band-button{flex:none;height:28px;padding:0 12px;border:1px solid var(--sd-error, #ba1a1a);border-radius:var(--sd-radius-8, 8px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.sd-scheduler__invalid{flex:1;min-height:0}.sd-scheduler__scroller{position:relative;flex:1 1 640px;min-height:0;max-height:max-content;overflow:auto;contain:inline-size;overscroll-behavior:contain}.sd-scheduler__scroller[data-view=week]{--sd-scheduler-track: max(100% - var(--sd-scheduler-resource-width), var(--sd-scheduler-day-min-width) * var(--sd-scheduler-columns))}.sd-scheduler__scroller[data-view=month]{--sd-scheduler-track: max( 100% - var(--sd-scheduler-resource-width), var(--sd-scheduler-month-day-min-width) * var(--sd-scheduler-columns) )}.sd-scheduler__grid{position:relative;display:flex;flex-direction:column;width:max-content;min-width:100%}.sd-scheduler__grid:focus-visible{outline:none}.sd-scheduler__head{position:sticky;top:0;z-index:3}.sd-scheduler__head-row,.sd-scheduler__row,.sd-scheduler__group{display:flex}.sd-scheduler__corner{position:sticky;inset-inline-start:0;z-index:4;display:flex;flex:none;align-items:center;gap:4px;box-sizing:border-box;width:var(--sd-scheduler-resource-width);padding:0 14px;overflow:hidden;border-inline-end:1px solid var(--sd-border, #c4c6d0);border-bottom:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff);color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.sd-scheduler__corner-count{font-weight:400}.sd-scheduler__axis{display:flex;flex:none;width:var(--sd-scheduler-track);height:40px;border-bottom:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff);color:var(--sd-text-secondary, #44474f)}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__axis{display:grid;grid-template-columns:repeat(var(--sd-scheduler-columns),minmax(0,1fr));height:48px}.sd-scheduler__hour{flex:none;box-sizing:border-box;width:var(--sd-scheduler-hour-width);padding-inline-start:6px;border-inline-end:1px solid var(--sd-calendar-line, #dedee5);font-size:var(--sd-font-size-11, 11px);line-height:40px;font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__axis-day{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;border-inline-end:1px solid var(--sd-calendar-line, #dedee5);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__axis-day:last-child{border-inline-end:0}.sd-scheduler__axis-day[data-holiday=off] .sd-scheduler__weekday{color:var(--sd-error, #ba1a1a)}.sd-scheduler__axis-day[data-today] .sd-scheduler__weekday{color:var(--sd-calendar-today, #005cbb)}.sd-scheduler__axis-day[data-today] .sd-scheduler__day-number{background:var(--sd-calendar-today, #005cbb);color:var(--sd-primary-contrast, #ffffff)}.sd-scheduler__weekday{letter-spacing:.04em}.sd-scheduler__day-number{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__day-number:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__day-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--sd-radius-999, 999px);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500)}@media(hover:hover){.sd-scheduler__axis-day:not([data-today]) .sd-scheduler__day-number:hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,transparent)}}.sd-scheduler__scroller[data-view=month] .sd-scheduler__axis-day{flex-direction:column;gap:0;font-size:var(--sd-font-size-10, 10px);line-height:var(--sd-line-height-12, 12px)}.sd-scheduler__scroller[data-view=month] .sd-scheduler__day-number{width:22px;height:22px;font-size:var(--sd-font-size-12, 12px)}.sd-scheduler__holiday-dot{width:4px;height:4px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-text-secondary, #44474f)}.sd-scheduler__body{position:relative}.sd-scheduler__row{box-sizing:border-box;min-height:var(--sd-scheduler-row-min-height);border-bottom:1px solid var(--sd-calendar-line, #dedee5)}.sd-scheduler__resource{position:sticky;inset-inline-start:0;z-index:2;display:flex;flex:none;align-items:center;gap:10px;box-sizing:border-box;width:var(--sd-scheduler-resource-width);padding-block:0;padding-inline:14px 12px;overflow:hidden;border-inline-end:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff)}.sd-scheduler__resource-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,var(--sd-surface, #fdfbff));color:var(--sd-text-secondary, #44474f)}.sd-scheduler__avatar{flex:none}.sd-scheduler__resource-text{display:flex;flex-direction:column;min-width:0}.sd-scheduler__resource-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__resource-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-scheduler__track{position:relative;isolation:isolate;-webkit-user-select:none;user-select:none;flex:none;box-sizing:border-box;width:var(--sd-scheduler-track)}.sd-scheduler__track:after{position:absolute;inset:0;background-image:inherit;content:\"\";pointer-events:none}.sd-scheduler__track{background-size:0 0;background-image:repeating-linear-gradient(to right,transparent 0 calc(var(--sd-scheduler-hour-width) / 2 - 1px),var(--sd-calendar-line-half, #efeef3) calc(var(--sd-scheduler-hour-width) / 2 - 1px) calc(var(--sd-scheduler-hour-width) / 2),transparent calc(var(--sd-scheduler-hour-width) / 2) calc(var(--sd-scheduler-hour-width) - 1px),var(--sd-calendar-line, #dedee5) calc(var(--sd-scheduler-hour-width) - 1px) var(--sd-scheduler-hour-width))}.sd-scheduler__track:dir(rtl){background-image:repeating-linear-gradient(to left,transparent 0 calc(var(--sd-scheduler-hour-width) / 2 - 1px),var(--sd-calendar-line-half, #efeef3) calc(var(--sd-scheduler-hour-width) / 2 - 1px) calc(var(--sd-scheduler-hour-width) / 2),transparent calc(var(--sd-scheduler-hour-width) / 2) calc(var(--sd-scheduler-hour-width) - 1px),var(--sd-calendar-line, #dedee5) calc(var(--sd-scheduler-hour-width) - 1px) var(--sd-scheduler-hour-width))}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__track{background-image:repeating-linear-gradient(to right,transparent 0 calc(calc(100% / var(--sd-scheduler-columns)) - 1px),var(--sd-calendar-line, #dedee5) calc(calc(100% / var(--sd-scheduler-columns)) - 1px) calc(100% / var(--sd-scheduler-columns)))}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__track:dir(rtl){background-image:repeating-linear-gradient(to left,transparent 0 calc(calc(100% / var(--sd-scheduler-columns)) - 1px),var(--sd-calendar-line, #dedee5) calc(calc(100% / var(--sd-scheduler-columns)) - 1px) calc(100% / var(--sd-scheduler-columns)))}.sd-scheduler__off{position:absolute;inset-block:0;background:var(--sd-calendar-off-hours, #f3f3f7);pointer-events:none}.sd-scheduler__skeleton{position:absolute;top:10px;height:28px;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface-muted, #e7e8ed)}.sd-scheduler__group{box-sizing:border-box;height:var(--sd-scheduler-group-height);border-bottom:1px solid var(--sd-calendar-line, #dedee5);background:var(--sd-surface, #fdfbff)}.sd-scheduler__group-cell{position:sticky;inset-inline-start:0;z-index:2;display:flex;min-width:0}.sd-scheduler__group-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__group-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__group-button{display:flex;align-items:center;gap:4px;height:var(--sd-scheduler-group-height);padding-inline:10px 14px;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);font-weight:600;white-space:nowrap}.sd-scheduler__group-button:focus-visible{outline-offset:-2px}.sd-scheduler__group-count{font-weight:400}.sd-scheduler__group-icon:dir(rtl){transform:scaleX(-1)}.sd-scheduler__empty-row{display:flex}.sd-scheduler__empty{position:sticky;inset-inline-start:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;min-height:144px;padding:24px;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__empty-text{margin:0;color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__now{position:absolute;inset-block:0;inset-inline-start:calc(var(--sd-scheduler-resource-width) + var(--sd-scheduler-now-offset) - 1px);z-index:1;width:2px;background:var(--sd-calendar-now, #ba1a1a);pointer-events:none}.sd-scheduler__now:before{position:absolute;top:0;inset-inline-start:-4px;width:10px;height:10px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-calendar-now, #ba1a1a);content:\"\"}.sd-scheduler__event{--sd-scheduler-event-bg: color-mix(in srgb, var(--sd-scheduler-event-color) 14%, var(--sd-surface, #fdfbff));--sd-scheduler-event-border: color-mix(in srgb, var(--sd-scheduler-event-color) 28%, var(--sd-surface, #fdfbff));--sd-scheduler-event-dot: var(--sd-scheduler-event-color);position:absolute;z-index:1;display:flex;align-items:center;gap:6px;box-sizing:border-box;height:var(--sd-scheduler-lane-height);padding:0 8px;overflow:hidden;border:1px solid var(--sd-scheduler-event-border);border-radius:var(--sd-scheduler-event-radius);background:var(--sd-scheduler-event-bg);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap;cursor:pointer;transition:box-shadow .15s,background-color .15s}.sd-scheduler__event[data-color=primary]{--sd-scheduler-event-color: var(--sd-primary, #005cbb);--sd-scheduler-event-bg: var(--sd-primary-light, #dbe8f5)}.sd-scheduler__event[data-color=secondary]{--sd-scheduler-event-color: var(--sd-secondary, #5c6270);--sd-scheduler-event-bg: var(--sd-secondary-light, #ebecee)}.sd-scheduler__event[data-color=info]{--sd-scheduler-event-color: var(--sd-info, #006a6a);--sd-scheduler-event-bg: var(--sd-info-light, #dbeaea)}.sd-scheduler__event[data-color=success]{--sd-scheduler-event-color: var(--sd-success, #2e7d32);--sd-scheduler-event-bg: var(--sd-success-light, #e2ede2)}.sd-scheduler__event[data-color=warning]{--sd-scheduler-event-color: var(--sd-warning, #a66300);--sd-scheduler-event-bg: var(--sd-warning-light, #f3e9db)}.sd-scheduler__event[data-color=error]{--sd-scheduler-event-color: var(--sd-error, #ba1a1a);--sd-scheduler-event-bg: var(--sd-error-light, #f5dfdf)}.sd-scheduler__event[data-past]{--sd-scheduler-event-dot: color-mix(in srgb, var(--sd-scheduler-event-color) 45%, var(--sd-surface, #fdfbff));border-color:color-mix(in srgb,var(--sd-scheduler-event-border) 50%,var(--sd-surface, #fdfbff));background:color-mix(in srgb,var(--sd-scheduler-event-bg) 45%,var(--sd-surface, #fdfbff))}.sd-scheduler__event[data-tier=sm]{justify-content:center;padding:0}.sd-scheduler__event[data-clipped-start]{border-start-start-radius:0;border-end-start-radius:0}.sd-scheduler__event[data-clipped-end]{border-start-end-radius:0;border-end-end-radius:0}.sd-scheduler__event[data-selected]{z-index:2;border-color:var(--sd-scheduler-event-color);box-shadow:var(--sd-shadow-md)}.sd-scheduler__event[data-failed]{outline:2px solid var(--sd-error, #ba1a1a);outline-offset:1px}.sd-scheduler__event[data-pending]{z-index:3;border:1px dashed var(--sd-scheduler-event-color)}.sd-scheduler__event:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}@media(hover:hover){.sd-scheduler__event:hover{background:color-mix(in srgb,var(--sd-scheduler-event-color) 7%,var(--sd-scheduler-event-bg));box-shadow:var(--sd-shadow-sm)}}.sd-scheduler__dot{flex:none;width:6px;height:6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-scheduler-event-dot, var(--sd-scheduler-event-color))}.sd-scheduler__repeat{flex:none;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__event-content{display:flex;flex:1;align-items:center;min-width:0}.sd-scheduler__event-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:0 1 auto;min-width:0;font-weight:600}.sd-scheduler__lead-time{margin-inline-end:4px;font-weight:400}.sd-scheduler__event-time{flex:none;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__lead-time,.sd-scheduler__event-time{direction:ltr;unicode-bidi:isolate}.sd-scheduler__sync{flex:none;margin-inline-start:auto;color:var(--sd-scheduler-event-color, var(--sd-primary, #005cbb));animation:sd-scheduler-spin 1s linear infinite}@keyframes sd-scheduler-spin{to{transform:rotate(360deg)}}.sd-scheduler__cursor{position:absolute;inset-block:6px;z-index:5;display:none;box-sizing:border-box;padding:0 4px;border:2px solid var(--sd-focus-ring-color, #005cbb);border-radius:var(--sd-radius-4, 4px);background:color-mix(in srgb,var(--sd-primary, #005cbb) 8%,transparent);font-size:var(--sd-font-size-10, 10px);line-height:var(--sd-line-height-12, 12px);font-weight:var(--sd-font-weight-medium, 500);pointer-events:none}.sd-scheduler__grid:focus-visible .sd-scheduler__cursor{display:block}.sd-scheduler__grid:focus-visible [data-cursor-row]{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px);outline-offset:-2px}.sd-scheduler__scroller{scroll-padding-block-start:48px;scroll-padding-inline-start:var(--sd-scheduler-resource-width)}.sd-scheduler__track--cells{display:grid;grid-template-columns:repeat(var(--sd-scheduler-columns),minmax(0,1fr))}.sd-scheduler__cell{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;min-width:0;overflow:hidden;cursor:pointer}.sd-scheduler__grid:focus-visible .sd-scheduler__cell[data-cursor-cell]{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px);outline-offset:-3px}@media(hover:hover){.sd-scheduler__cell:hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 4%,transparent)}}.sd-scheduler__track--create{cursor:cell}.sd-scheduler__track--blocked{cursor:not-allowed}.sd-scheduler__ghost{position:absolute;top:10px;z-index:4;display:flex;align-items:center;gap:6px;box-sizing:border-box;height:var(--sd-scheduler-lane-height);padding:0 8px;overflow:hidden;border:1px dashed var(--sd-primary, #005cbb);border-radius:var(--sd-scheduler-event-radius);background:color-mix(in srgb,var(--sd-primary-light, #dbe8f5) 92%,transparent);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap;pointer-events:none}.sd-scheduler__ghost[data-blocked]{border-color:var(--sd-border-strong, #74777f)}.sd-scheduler__event[data-movable]{cursor:grab;touch-action:none}.sd-scheduler__event[data-dragging]{border:1px dashed var(--sd-scheduler-event-border);background:transparent;box-shadow:none;opacity:.55}.sd-scheduler__event.sd-scheduler__proposal{z-index:4;overflow:visible;border-color:var(--sd-scheduler-event-color);box-shadow:var(--sd-shadow-lg);pointer-events:none}.sd-scheduler__event.sd-scheduler__proposal[data-blocked]{border-style:dashed;border-color:var(--sd-border-strong, #74777f);background:transparent;box-shadow:none}.sd-scheduler__label{position:absolute;top:50%;inset-inline-start:calc(100% + 6px);padding:2px 6px;border-radius:var(--sd-radius-4, 4px);background:var(--sd-surface-inverse, #1a1b1f);color:var(--sd-surface, #fdfbff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-14, 14px);font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;transform:translateY(-50%);pointer-events:none}.sd-scheduler__label[data-flip]{inset-inline-start:auto;inset-inline-end:calc(100% + 6px)}.sd-scheduler__label--resize{z-index:6}.sd-scheduler__label--resize[data-flip]{inset-inline-start:auto}.sd-scheduler__row[data-drop] .sd-scheduler__track:before{position:absolute;inset:0;z-index:1;content:\"\";pointer-events:none}.sd-scheduler__row[data-drop=ok] .sd-scheduler__track:before{background:color-mix(in srgb,var(--sd-primary, #005cbb) 6%,transparent)}.sd-scheduler__row[data-drop=blocked]{cursor:not-allowed}.sd-scheduler__row[data-drop=blocked] .sd-scheduler__track:before{background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--sd-text, #1a1b1f) 5%,transparent) 0 6px,transparent 6px 12px)}.sd-scheduler__row[data-drop=blocked] .sd-scheduler__resource{opacity:.5}.sd-scheduler__resize{position:absolute;inset-block:0;inset-inline-end:0;width:8px;cursor:ew-resize;touch-action:none}.sd-scheduler__resize:after{position:absolute;top:50%;inset-inline-end:3px;width:3px;height:12px;margin-top:-6px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-scheduler-event-color);content:\"\";opacity:0}@media(hover:hover){.sd-scheduler__event:hover .sd-scheduler__resize:after{opacity:1}}@media(pointer:coarse){.sd-scheduler__event:not([data-selected]) .sd-scheduler__resize{display:none}.sd-scheduler__event[data-selected] .sd-scheduler__resize{width:24px}.sd-scheduler__event[data-selected] .sd-scheduler__resize:after{width:6px;height:24px;margin-top:-12px;opacity:1}}@media(pointer:coarse){.sd-scheduler__today,.sd-scheduler__band-button,.sd-scheduler__scope-button{min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler__icon-button{min-width:var(--sd-control-height-coarse, 44px);min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler__view{min-height:calc(var(--sd-control-height-coarse, 44px) - 2px)}.sd-scheduler{--sd-scheduler-group-height: 44px}.sd-scheduler[data-view=week] .sd-scheduler__day-number{position:relative}.sd-scheduler[data-view=week] .sd-scheduler__day-number:after{position:absolute;inset:-8px;content:\"\"}}.sd-scheduler__scope{position:absolute;inset-inline-end:12px;bottom:12px;inset-inline-start:12px;z-index:10;padding:12px 14px;border-radius:var(--sd-radius-10, 10px);background:var(--sd-surface-inverse, #1a1b1f);box-shadow:var(--sd-shadow-lg);color:var(--sd-surface, #fdfbff);font-size:var(--sd-font-size-14, 14px)}.sd-scheduler__scope-message{margin:0 0 10px}.sd-scheduler__scope-actions{display:flex;flex-wrap:wrap;gap:8px}.sd-scheduler__scope-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__scope-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__scope-button{height:36px;padding:0 10px;border-radius:var(--sd-radius-6, 6px);color:var(--sd-primary-light, #dbe8f5);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__scope-button--cancel{color:var(--sd-surface, #fdfbff)}@media(hover:hover){.sd-scheduler__scope-button:hover{background:color-mix(in srgb,var(--sd-surface, #fdfbff) 12%,transparent)}}.sd-scheduler__icon-button sd-icon:dir(rtl),.sd-scheduler__progress:dir(rtl){transform:scaleX(-1)}.sd-scheduler--compact .sd-scheduler__title{white-space:normal}.sd-scheduler--compact .sd-scheduler__band-button,.sd-scheduler--compact .sd-scheduler__scope-button{min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact[data-view=week] .sd-scheduler__day-number{position:relative}.sd-scheduler--compact[data-view=week] .sd-scheduler__day-number:after{position:absolute;inset:-8px;content:\"\"}.sd-scheduler--compact{--sd-scheduler-resource-width: 120px;--sd-scheduler-hour-width: 64px;--sd-scheduler-day-min-width: 96px;--sd-scheduler-group-height: 44px}.sd-scheduler--compact .sd-scheduler__toolbar{flex-wrap:wrap;gap:8px;height:auto;padding:8px 12px}.sd-scheduler--compact .sd-scheduler__title{order:-2;flex:1 1 0}.sd-scheduler--compact .sd-scheduler__nav{order:-1}.sd-scheduler--compact .sd-scheduler__today,.sd-scheduler--compact .sd-scheduler__icon-button{height:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact .sd-scheduler__icon-button{width:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact .sd-scheduler__views{flex:1 0 100%}.sd-scheduler--compact .sd-scheduler__view{flex:1;height:42px}.sd-scheduler--compact .sd-scheduler__resource{gap:8px;padding-inline:10px 8px}.sd-scheduler--compact .sd-scheduler__resource-title{display:-webkit-box;overflow:hidden;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-16, 16px);white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.sd-scheduler--compact .sd-scheduler__resource-description{display:none}.sd-scheduler--compact .sd-scheduler__resource-icon{width:24px;height:24px}@media(prefers-reduced-motion:reduce){.sd-scheduler__event{transition:none}.sd-scheduler__sync,.sd-scheduler__progress-bar{animation:none}}@media(forced-colors:active){.sd-scheduler__dot{border:1px solid CanvasText}.sd-scheduler__axis-day[data-today] .sd-scheduler__day-number{outline:2px solid Highlight}.sd-scheduler,.sd-scheduler__event{border-color:CanvasText}.sd-scheduler__event[data-selected]{border:2px solid Highlight}.sd-scheduler__event[data-pending]{border-color:Highlight}.sd-scheduler__now,.sd-scheduler__now:before{background-color:Highlight}}\n"], dependencies: [{ kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size", "name", "status", "statusLabel", "statusPulse", "tooltip"] }, { kind: "component", type: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "iconShape", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1921
|
+
}
|
|
1922
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdScheduler, decorators: [{
|
|
1923
|
+
type: Component,
|
|
1924
|
+
args: [{ selector: 'sd-scheduler', standalone: true, imports: [CdkDrag, NgTemplateOutlet, SdAvatar, SdDataState, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _view = activeView();\n@let _disabled = disabled();\n@let _selected = selectedId();\n@let _failure = failure();\n@let _days = dayViews();\n@let _ghost = ghost();\n@let _canCreate = canCreate();\n@let _proposal = dragProposal();\n@let _lockAxis = lockAxis();\n@let _cursor = cursor();\n<section\n #root\n class=\"sd-scheduler\"\n role=\"region\"\n [class.sd-scheduler--compact]=\"compact()\"\n [attr.data-compact]=\"compact() || null\"\n [attr.aria-label]=\"regionLabel()\"\n [attr.data-autoid]=\"rootAutoId()\"\n [attr.data-view]=\"_view\"\n [attr.data-from]=\"visible().from\"\n [attr.data-to]=\"visible().to\">\n <header class=\"sd-scheduler__toolbar\">\n <div class=\"sd-scheduler__nav\">\n <button type=\"button\" class=\"sd-scheduler__today\" data-action=\"today\" [attr.data-autoid]=\"childAutoId('today')\" (click)=\"goToday()\">\n {{ 'core.component.calendar.today' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__icon-button\"\n data-action=\"prev\"\n [attr.aria-label]=\"prevLabel()\"\n [attr.data-autoid]=\"childAutoId('prev')\"\n [disabled]=\"prevDisabled()\"\n (click)=\"shift(-1)\">\n <sd-icon name=\"chevron_left\" size=\"22px\" aria-hidden=\"true\" />\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__icon-button\"\n data-action=\"next\"\n [attr.aria-label]=\"nextLabel()\"\n [attr.data-autoid]=\"childAutoId('next')\"\n [disabled]=\"nextDisabled()\"\n (click)=\"shift(1)\">\n <sd-icon name=\"chevron_right\" size=\"22px\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"sd-scheduler__title\" data-title>{{ title() }}</div>\n <div class=\"sd-scheduler__views\" role=\"group\" [attr.aria-label]=\"'core.component.calendar.views' | sdTranslate\">\n @for (option of viewOptions(); track option) {\n <button\n type=\"button\"\n class=\"sd-scheduler__view\"\n [attr.data-view-option]=\"option\"\n [attr.data-autoid]=\"childAutoId('view-' + option)\"\n [attr.aria-pressed]=\"option === _view\"\n (click)=\"setView(option)\">\n {{ viewLabel(option) }}\n </button>\n }\n </div>\n </header>\n\n @if (busy()) {\n <div class=\"sd-scheduler__progress\" role=\"progressbar\" [attr.aria-label]=\"regionLabel()\">\n <span class=\"sd-scheduler__progress-bar\"></span>\n </div>\n }\n @if (phase() === 'error') {\n <div class=\"sd-scheduler__band\" data-band=\"load-error\">\n <sd-icon class=\"sd-scheduler__band-icon\" name=\"error\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__band-text\">{{ 'core.component.calendar.load-error' | sdTranslate }}</span>\n <button type=\"button\" class=\"sd-scheduler__band-button\" data-action=\"retry\" [attr.data-autoid]=\"childAutoId('retry')\" (click)=\"reload()\">\n {{ 'core.common.retry' | sdTranslate }}\n </button>\n </div>\n }\n @if (_failure) {\n <div class=\"sd-scheduler__band\" data-band=\"move-error\">\n <sd-icon class=\"sd-scheduler__band-icon\" name=\"error\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__band-text\">{{ _failure.message }}</span>\n <button type=\"button\" class=\"sd-scheduler__band-button\" data-action=\"dismiss\" [attr.data-autoid]=\"childAutoId('dismiss')\" (click)=\"dismissFailure()\">\n {{ 'core.common.dismiss' | sdTranslate }}\n </button>\n </div>\n }\n <div class=\"sd-scheduler__status\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ announcement() }}</div>\n <span class=\"sd-scheduler__status\" [id]=\"gridHelpId\">{{ 'core.component.scheduler.grid-help' | sdTranslate }}</span>\n <span class=\"sd-scheduler__status\" [id]=\"eventHelpId\">{{ 'core.component.scheduler.event-help' | sdTranslate }}</span>\n @if (scopeBar.asking(); as _ask) {\n <div class=\"sd-scheduler__scope\" role=\"alertdialog\" [attr.aria-labelledby]=\"scopeMessageId\" (keydown)=\"scopeBar.onKeydown($event)\">\n <p class=\"sd-scheduler__scope-message\" [id]=\"scopeMessageId\">\n {{ 'core.component.calendar.scope-message' | sdTranslate: { title: _ask.title } }}\n </p>\n <div class=\"sd-scheduler__scope-actions\">\n <button type=\"button\" class=\"sd-scheduler__scope-button\" data-scope=\"this\" [attr.data-autoid]=\"childAutoId('scope-this')\" (click)=\"scopeBar.answer('this')\">\n {{ 'core.component.calendar.scope-this' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__scope-button\"\n data-scope=\"following\"\n [attr.data-autoid]=\"childAutoId('scope-following')\"\n (click)=\"scopeBar.answer('following')\">\n {{ 'core.component.calendar.scope-following' | sdTranslate }}\n </button>\n <button type=\"button\" class=\"sd-scheduler__scope-button\" data-scope=\"all\" [attr.data-autoid]=\"childAutoId('scope-all')\" (click)=\"scopeBar.answer('all')\">\n {{ 'core.component.calendar.scope-all' | sdTranslate }}\n </button>\n <button\n type=\"button\"\n class=\"sd-scheduler__scope-button sd-scheduler__scope-button--cancel\"\n data-scope=\"cancel\"\n [attr.data-autoid]=\"childAutoId('scope-cancel')\"\n (click)=\"scopeBar.answer(null)\">\n {{ 'core.common.cancel' | sdTranslate }}\n </button>\n </div>\n </div>\n }\n\n @if (invalid()) {\n <sd-data-state class=\"sd-scheduler__invalid\" state=\"error\" compact [title]=\"'core.component.calendar.invalid-data' | sdTranslate\" />\n } @else {\n <div\n #scroller\n class=\"sd-scheduler__scroller\"\n data-region=\"scroller\"\n [attr.data-view]=\"_view\"\n [style.--sd-scheduler-columns]=\"_days.length\">\n <div\n #grid\n class=\"sd-scheduler__grid\"\n role=\"grid\"\n tabindex=\"0\"\n data-region=\"grid\"\n [attr.aria-label]=\"regionLabel() + ', ' + title()\"\n [attr.aria-describedby]=\"gridHelpId\"\n [attr.aria-activedescendant]=\"cursorTarget()\"\n [attr.aria-busy]=\"busy() || null\"\n [attr.aria-disabled]=\"_disabled || null\"\n (focus)=\"onGridFocus()\"\n (keydown)=\"onGridKeydown($event)\">\n <div class=\"sd-scheduler__head\" role=\"rowgroup\">\n <div class=\"sd-scheduler__head-row\" role=\"row\">\n <div class=\"sd-scheduler__corner\" role=\"columnheader\" data-corner>\n <span class=\"sd-scheduler__corner-label\">{{ cornerLabel() }}</span>\n <span class=\"sd-scheduler__corner-count\">\u00B7 {{ resources().length }}</span>\n </div>\n <div class=\"sd-scheduler__axis\" data-axis>\n @if (_view === 'day') {\n @for (hour of hours; track hour.hour) {\n <div class=\"sd-scheduler__hour\" role=\"columnheader\" data-axis-hour>{{ hour.label }}</div>\n }\n } @else {\n @for (day of _days; track day.day) {\n <div\n class=\"sd-scheduler__axis-day\"\n role=\"columnheader\"\n data-axis-day\n [attr.data-date]=\"day.day\"\n [attr.data-today]=\"day.today || null\"\n [attr.data-holiday]=\"day.holiday?.type ?? null\"\n [attr.title]=\"day.holiday?.label ?? null\">\n <span class=\"sd-scheduler__weekday\">{{ day.weekdayShort }}</span>\n <button type=\"button\" class=\"sd-scheduler__day-number\" tabindex=\"-1\" [attr.aria-label]=\"day.openLabel\" (click)=\"openDay(day.day)\">\n {{ day.dayNumber }}\n </button>\n @if (_view === 'month' && day.holiday?.type === 'observance') {\n <span class=\"sd-scheduler__holiday-dot\" data-holiday-dot aria-hidden=\"true\"></span>\n }\n </div>\n }\n }\n </div>\n </div>\n </div>\n <div class=\"sd-scheduler__body\" role=\"rowgroup\" data-rows>\n @if (empty()) {\n <div class=\"sd-scheduler__empty-row\" role=\"row\">\n <div class=\"sd-scheduler__empty\" role=\"gridcell\" data-empty>\n @if (emptyTemplate(); as _empty) {\n <ng-container [ngTemplateOutlet]=\"_empty.template\" [ngTemplateOutletContext]=\"{ $implicit: visible() }\" />\n } @else {\n <sd-icon class=\"sd-scheduler__empty-icon\" name=\"event_busy\" size=\"28px\" aria-hidden=\"true\" />\n <p class=\"sd-scheduler__empty-text\">{{ 'core.component.scheduler.empty' | sdTranslate }}</p>\n }\n </div>\n </div>\n } @else {\n @for (row of rows(); track row.key) {\n @if (row.kind === 'group') {\n <div class=\"sd-scheduler__group\" role=\"row\" [attr.data-group]=\"row.name\" [attr.data-collapsed]=\"row.collapsed || null\">\n <div\n class=\"sd-scheduler__group-cell\"\n role=\"rowheader\"\n [id]=\"row.headerId\"\n [attr.data-cursor-row]=\"_cursor?.rowKey === row.key || null\">\n <button\n type=\"button\"\n class=\"sd-scheduler__group-button\"\n tabindex=\"-1\"\n [attr.aria-expanded]=\"!row.collapsed\"\n [attr.aria-label]=\"row.label\"\n [attr.title]=\"row.hint\"\n (click)=\"toggleGroup(row.name)\">\n <sd-icon class=\"sd-scheduler__group-icon\" [name]=\"row.collapsed ? 'chevron_right' : 'expand_more'\" size=\"18px\" aria-hidden=\"true\" />\n <span class=\"sd-scheduler__group-label\">{{ row.name }}</span>\n <span class=\"sd-scheduler__group-count\">\u00B7 {{ row.countText }}</span>\n </button>\n </div>\n </div>\n } @else {\n <div\n class=\"sd-scheduler__row\"\n role=\"row\"\n [attr.data-resource-id]=\"row.resource.id\"\n [attr.data-autoid]=\"row.autoId\"\n [attr.data-drop]=\"_proposal && !_proposal.outside && _proposal.target.resourceId === row.resource.id ? (_proposal.blocked ? 'blocked' : 'ok') : null\"\n [attr.data-blocked]=\"(_proposal?.blocked && !_proposal?.outside && _proposal?.target?.resourceId === row.resource.id) || null\"\n [style.height.px]=\"row.height\">\n <div class=\"sd-scheduler__resource\" role=\"rowheader\" [id]=\"row.headerId\" [attr.title]=\"row.resource.title\">\n @if (resourceTemplate(); as _template) {\n <ng-container [ngTemplateOutlet]=\"_template.template\" [ngTemplateOutletContext]=\"row.context\" />\n } @else {\n @if (row.resource.avatar) {\n <sd-avatar class=\"sd-scheduler__avatar\" [src]=\"row.resource.avatar\" [name]=\"row.resource.title\" [size]=\"compact() ? 24 : 28\" />\n } @else if (row.resource.icon) {\n <span class=\"sd-scheduler__resource-icon\" aria-hidden=\"true\">\n <sd-icon [name]=\"row.resource.icon\" size=\"18px\" />\n </span>\n }\n <span class=\"sd-scheduler__resource-text\">\n <span class=\"sd-scheduler__resource-title\">{{ row.resource.title }}</span>\n @if (row.resource.description) {\n <span class=\"sd-scheduler__resource-description\" [attr.title]=\"row.resource.description\">{{ row.resource.description }}</span>\n }\n </span>\n }\n </div>\n <!-- why: one set of listeners per row instead of per block (Step 0 H6, way 2); blocks are found by data-event-id.\n The row itself is not a tab stop: the grid is (aria-activedescendant), and blocks are buttons. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"sd-scheduler__track\"\n data-track\n [id]=\"row.trackId\"\n [attr.role]=\"row.cells ? 'presentation' : 'gridcell'\"\n [attr.aria-label]=\"!row.cells && _cursor?.rowKey === row.key ? cursorLabel() : null\"\n [class.sd-scheduler__track--cells]=\"!!row.cells\"\n [class.sd-scheduler__track--create]=\"_canCreate\"\n [class.sd-scheduler__track--blocked]=\"!!_ghost?.blocked && _ghost?.resourceId === row.resource.id\"\n [attr.data-resource-id]=\"row.resource.id\"\n (pointerdown)=\"onTrackPointerDown($event, row.resource.id)\"\n (pointermove)=\"onTrackPointerMove($event)\"\n (pointerup)=\"onTrackPointerUp()\"\n (pointercancel)=\"onTrackPointerCancel()\"\n (mousedown)=\"onTrackPress($event)\"\n (touchstart)=\"onTrackPress($event)\"\n (click)=\"onTrackClick($event, row)\"\n (keydown)=\"onTrackKeydown($event, row)\">\n @for (shade of row.shades; track shade.key) {\n <div class=\"sd-scheduler__off\" data-off-hours aria-hidden=\"true\" [style.inset-inline-start]=\"shade.start\" [style.inline-size]=\"shade.size\"></div>\n }\n @if (row.cells) {\n @for (cell of row.cells; track cell.day) {\n <!-- why: a cell is reached with the grid cursor (aria-activedescendant + Enter), not with Tab. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"sd-scheduler__cell\"\n role=\"gridcell\"\n [id]=\"row.trackId + '-' + cell.day\"\n [attr.aria-label]=\"cell.label\"\n [attr.data-date]=\"cell.day\"\n [attr.data-resource-id]=\"row.resource.id\"\n [attr.data-off]=\"cell.off || null\"\n [attr.data-today]=\"cell.today || null\"\n [attr.data-cursor-cell]=\"(_cursor?.rowKey === row.key && _cursor?.day === cell.day) || null\"\n (click)=\"onCellClick(row, cell)\">\n <ng-container [ngTemplateOutlet]=\"cellTemplate()!.template\" [ngTemplateOutletContext]=\"cell.context\" />\n </div>\n }\n }\n @if (_cursor?.rowKey === row.key && cursorBox(); as _cursorBox) {\n <div class=\"sd-scheduler__cursor\" data-cursor aria-hidden=\"true\" [style.inset-inline-start]=\"_cursorBox.start\" [style.inline-size]=\"_cursorBox.size\">\n <bdi>{{ _cursorBox.text }}</bdi>\n </div>\n }\n @if (skeleton() && skeletonRows().has(row.key)) {\n @let _shape = skeletonShapes[skeletonRows().get(row.key)!];\n <div\n class=\"sd-scheduler__skeleton\"\n data-skeleton\n aria-hidden=\"true\"\n [style.inset-inline-start.%]=\"_shape[0] * 100\"\n [style.inline-size.%]=\"_shape[1] * 100\"></div>\n }\n @for (block of row.blocks; track block.key) {\n <div\n class=\"sd-scheduler__event\"\n role=\"button\"\n cdkDrag\n [cdkDragDisabled]=\"!block.movable\"\n [cdkDragStartDelay]=\"dragDelay\"\n [cdkDragConstrainPosition]=\"constrainDrag\"\n [cdkDragLockAxis]=\"_lockAxis\"\n (cdkDragStarted)=\"onDragStarted($event, block)\"\n (cdkDragEnded)=\"onDragEnded($event)\"\n [attr.tabindex]=\"_disabled ? -1 : 0\"\n [attr.aria-label]=\"block.label\"\n [attr.aria-describedby]=\"row.headerId + ' ' + eventHelpId\"\n [attr.title]=\"block.title\"\n [attr.data-event-id]=\"block.event.id\"\n [attr.data-autoid]=\"block.autoId\"\n [attr.data-resource-id]=\"block.event.resourceId\"\n [attr.data-start]=\"block.range.start\"\n [attr.data-end]=\"block.range.end\"\n [attr.data-all-day]=\"block.placement.allDay\"\n [attr.data-color]=\"block.color\"\n [attr.data-tier]=\"block.tier\"\n [attr.data-past]=\"block.past || null\"\n [attr.data-pending]=\"block.pending || null\"\n [attr.data-selected]=\"block.key === _selected || null\"\n [attr.data-failed]=\"isFailed(block.key) || null\"\n [attr.data-movable]=\"block.movable || null\"\n [attr.data-dragging]=\"isDragging(block.key) || null\"\n [attr.data-clipped-start]=\"block.clippedStart || null\"\n [attr.data-clipped-end]=\"block.clippedEnd || null\"\n [style.--sd-scheduler-event-color]=\"block.customColor\"\n [style.inset-inline-start]=\"block.start\"\n [style.inline-size]=\"blockSize(block)\"\n [style.top]=\"block.top\">\n <span class=\"sd-scheduler__dot\" aria-hidden=\"true\"></span>\n @if (eventTemplate(); as _template) {\n <div class=\"sd-scheduler__event-content\">\n <ng-container [ngTemplateOutlet]=\"_template.template\" [ngTemplateOutletContext]=\"block.context\" />\n </div>\n } @else if (block.tier !== 'sm') {\n @if (block.recurring) {\n <sd-icon class=\"sd-scheduler__repeat\" name=\"repeat\" size=\"13px\" aria-hidden=\"true\" />\n }\n <span class=\"sd-scheduler__event-title\">\n @if (block.leadTime) {\n <span class=\"sd-scheduler__lead-time\">{{ block.leadTime }}</span>\n }\n {{ block.event.title }}\n </span>\n @if (block.tier === 'lg' && _view === 'day') {\n <span class=\"sd-scheduler__event-time\">{{ block.timeText }}</span>\n }\n }\n @if (block.saving) {\n <sd-icon class=\"sd-scheduler__sync\" name=\"sync\" size=\"14px\" aria-hidden=\"true\" />\n }\n @if (block.resizable) {\n <div\n class=\"sd-scheduler__resize\"\n data-resize-handle\n aria-hidden=\"true\"\n (mousedown)=\"$event.stopPropagation()\"\n (touchstart)=\"$event.stopPropagation()\"\n (pointerdown)=\"onResizeDown($event, block)\"\n (pointermove)=\"onResizeMove($event)\"\n (pointerup)=\"onResizeUp($event)\"\n (pointercancel)=\"onResizeCancel()\"></div>\n }\n </div>\n @if (resizeLabel(block); as _resize) {\n <span\n class=\"sd-scheduler__label sd-scheduler__label--resize\"\n data-resize-label\n aria-hidden=\"true\"\n [attr.data-flip]=\"_resize.end ? true : null\"\n [style.inset-inline-start]=\"_resize.start\"\n [style.inset-inline-end]=\"_resize.end\"\n [style.top]=\"_resize.top\">\n <bdi>{{ _resize.text }}</bdi>\n </span>\n }\n }\n @if (_proposal && !_proposal.outside && !_proposal.onGroup && _proposal.target.resourceId === row.resource.id) {\n @let _drop = proposalBox(_proposal);\n <div\n class=\"sd-scheduler__event sd-scheduler__proposal\"\n data-drag-proposal\n aria-hidden=\"true\"\n [attr.data-color]=\"_proposal.color\"\n [attr.data-tier]=\"_proposal.tier\"\n [attr.data-blocked]=\"_proposal.blocked || null\"\n [style.--sd-scheduler-event-color]=\"_proposal.customColor\"\n [style.inset-inline-start]=\"_drop.start\"\n [style.inline-size]=\"_drop.size\"\n [style.top.px]=\"row.height > 48 ? 6 : 10\">\n <span class=\"sd-scheduler__dot\"></span>\n @if (_proposal.tier !== 'sm') {\n <span class=\"sd-scheduler__event-title\">{{ _proposal.title }}</span>\n }\n <span class=\"sd-scheduler__label\" data-drag-label [attr.data-flip]=\"_proposal.flip || null\"><bdi>{{ _proposal.label }}</bdi></span>\n </div>\n }\n @if (_ghost && _ghost.resourceId === row.resource.id) {\n @let _box = ghostBox(_ghost);\n <div\n class=\"sd-scheduler__ghost\"\n data-create-ghost\n aria-hidden=\"true\"\n [attr.data-pending]=\"_ghost.pending || null\"\n [attr.data-blocked]=\"_ghost.blocked || null\"\n [style.inset-inline-start]=\"_box.start\"\n [style.inline-size]=\"_box.size\">\n <span class=\"sd-scheduler__event-title\">{{ 'core.component.calendar.new-event' | sdTranslate }}</span>\n @if (_box.time) {\n <span class=\"sd-scheduler__event-time\">{{ _box.time }}</span>\n }\n @if (_ghost.pending) {\n <sd-icon class=\"sd-scheduler__sync\" name=\"sync\" size=\"14px\" aria-hidden=\"true\" />\n }\n </div>\n }\n </div>\n </div>\n }\n }\n @if (nowOffset(); as _now) {\n <div class=\"sd-scheduler__now\" data-now aria-hidden=\"true\" [style.--sd-scheduler-now-offset]=\"_now\"></div>\n }\n }\n </div>\n </div>\n </div>\n }\n</section>\n", styles: [":host{--sd-scheduler-resource-width: 240px;--sd-scheduler-hour-width: 80px;--sd-scheduler-day-min-width: 120px;--sd-scheduler-month-day-min-width: 28px;--sd-scheduler-row-min-height: 48px;--sd-scheduler-lane-height: 28px;--sd-scheduler-event-radius: var(--sd-radius-6, 6px);--sd-scheduler-group-height: 32px;display:block;min-width:0;text-align:start}.sd-scheduler{--sd-scheduler-track: calc(var(--sd-scheduler-hour-width) * 24);position:relative;display:flex;flex-direction:column;box-sizing:border-box;height:100%;overflow:hidden;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-12, 12px);background:var(--sd-surface, #fdfbff);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-scheduler__toolbar{display:flex;flex:none;align-items:center;gap:12px;height:56px;padding-block:0;padding-inline:14px 12px;border-bottom:1px solid var(--sd-calendar-line, #dedee5)}.sd-scheduler__nav{display:flex;flex:none;align-items:center;gap:4px}.sd-scheduler__today{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__today:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__today{height:var(--sd-control-height-sm, 32px);margin-inline-end:4px;padding:0 14px;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__icon-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__icon-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__icon-button{display:inline-flex;align-items:center;justify-content:center;width:var(--sd-control-height-sm, 32px);height:var(--sd-control-height-sm, 32px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary, #44474f)}.sd-scheduler__icon-button:disabled{cursor:default;opacity:.38}.sd-scheduler__title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;font-size:var(--sd-font-size-18, 18px);line-height:var(--sd-line-height-24, 24px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__views{display:flex;flex:none;overflow:hidden;border:1px solid var(--sd-border, #c4c6d0);border-radius:var(--sd-radius-8, 8px)}.sd-scheduler__view{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__view:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__view{height:30px;padding:0 12px;font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__view+.sd-scheduler__view{border-inline-start:1px solid var(--sd-border, #c4c6d0)}.sd-scheduler__view[aria-pressed=true]{background:var(--sd-primary-light, #dbe8f5);color:var(--sd-text, #1a1b1f)}.sd-scheduler__view:focus-visible{outline-offset:-2px}@media(hover:hover){.sd-scheduler__today:hover,.sd-scheduler__icon-button:not(:disabled):hover,.sd-scheduler__view:not([aria-pressed=true]):hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,transparent)}}.sd-scheduler__progress{position:relative;flex:none;height:2px;overflow:hidden;background:var(--sd-primary-light, #dbe8f5)}.sd-scheduler__progress-bar{position:absolute;inset:0 auto 0 0;width:40%;background:var(--sd-primary, #005cbb);animation:sd-scheduler-progress 1.2s ease-in-out infinite}@keyframes sd-scheduler-progress{0%{transform:translate(-100%)}to{transform:translate(250%)}}.sd-scheduler__band{display:flex;flex:none;align-items:center;gap:8px;padding:8px 10px;border-bottom:1px solid color-mix(in srgb,var(--sd-error, #ba1a1a) 28%,var(--sd-surface, #fdfbff));background:var(--sd-status-error-bg, #f5dfdf);color:var(--sd-status-error-fg, #9c1616);font-size:var(--sd-font-size-13, 13px)}.sd-scheduler__band-icon{flex:none;color:var(--sd-error, #ba1a1a)}.sd-scheduler__band-text{flex:1;min-width:0}.sd-scheduler__band-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__band-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__band-button{flex:none;height:28px;padding:0 12px;border:1px solid var(--sd-error, #ba1a1a);border-radius:var(--sd-radius-8, 8px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__status{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.sd-scheduler__invalid{flex:1;min-height:0}.sd-scheduler__scroller{position:relative;flex:1 1 640px;min-height:0;max-height:max-content;overflow:auto;contain:inline-size;overscroll-behavior:contain}.sd-scheduler__scroller[data-view=week]{--sd-scheduler-track: max(100% - var(--sd-scheduler-resource-width), var(--sd-scheduler-day-min-width) * var(--sd-scheduler-columns))}.sd-scheduler__scroller[data-view=month]{--sd-scheduler-track: max( 100% - var(--sd-scheduler-resource-width), var(--sd-scheduler-month-day-min-width) * var(--sd-scheduler-columns) )}.sd-scheduler__grid{position:relative;display:flex;flex-direction:column;width:max-content;min-width:100%}.sd-scheduler__grid:focus-visible{outline:none}.sd-scheduler__head{position:sticky;top:0;z-index:3}.sd-scheduler__head-row,.sd-scheduler__row,.sd-scheduler__group{display:flex}.sd-scheduler__corner{position:sticky;inset-inline-start:0;z-index:4;display:flex;flex:none;align-items:center;gap:4px;box-sizing:border-box;width:var(--sd-scheduler-resource-width);padding:0 14px;overflow:hidden;border-inline-end:1px solid var(--sd-border, #c4c6d0);border-bottom:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff);color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap}.sd-scheduler__corner-count{font-weight:400}.sd-scheduler__axis{display:flex;flex:none;width:var(--sd-scheduler-track);height:40px;border-bottom:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff);color:var(--sd-text-secondary, #44474f)}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__axis{display:grid;grid-template-columns:repeat(var(--sd-scheduler-columns),minmax(0,1fr));height:48px}.sd-scheduler__hour{flex:none;box-sizing:border-box;width:var(--sd-scheduler-hour-width);padding-inline-start:6px;border-inline-end:1px solid var(--sd-calendar-line, #dedee5);font-size:var(--sd-font-size-11, 11px);line-height:40px;font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__axis-day{display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;border-inline-end:1px solid var(--sd-calendar-line, #dedee5);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__axis-day:last-child{border-inline-end:0}.sd-scheduler__axis-day[data-holiday=off] .sd-scheduler__weekday{color:var(--sd-error, #ba1a1a)}.sd-scheduler__axis-day[data-today] .sd-scheduler__weekday{color:var(--sd-calendar-today, #005cbb)}.sd-scheduler__axis-day[data-today] .sd-scheduler__day-number{background:var(--sd-calendar-today, #005cbb);color:var(--sd-primary-contrast, #ffffff)}.sd-scheduler__weekday{letter-spacing:.04em}.sd-scheduler__day-number{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__day-number:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__day-number{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--sd-radius-999, 999px);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500)}@media(hover:hover){.sd-scheduler__axis-day:not([data-today]) .sd-scheduler__day-number:hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,transparent)}}.sd-scheduler__scroller[data-view=month] .sd-scheduler__axis-day{flex-direction:column;gap:0;font-size:var(--sd-font-size-10, 10px);line-height:var(--sd-line-height-12, 12px)}.sd-scheduler__scroller[data-view=month] .sd-scheduler__day-number{width:22px;height:22px;font-size:var(--sd-font-size-12, 12px)}.sd-scheduler__holiday-dot{width:4px;height:4px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-text-secondary, #44474f)}.sd-scheduler__body{position:relative}.sd-scheduler__row{box-sizing:border-box;min-height:var(--sd-scheduler-row-min-height);border-bottom:1px solid var(--sd-calendar-line, #dedee5)}.sd-scheduler__resource{position:sticky;inset-inline-start:0;z-index:2;display:flex;flex:none;align-items:center;gap:10px;box-sizing:border-box;width:var(--sd-scheduler-resource-width);padding-block:0;padding-inline:14px 12px;overflow:hidden;border-inline-end:1px solid var(--sd-border, #c4c6d0);background:var(--sd-surface, #fdfbff)}.sd-scheduler__resource-icon{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text, #1a1b1f) 6%,var(--sd-surface, #fdfbff));color:var(--sd-text-secondary, #44474f)}.sd-scheduler__avatar{flex:none}.sd-scheduler__resource-text{display:flex;flex-direction:column;min-width:0}.sd-scheduler__resource-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__resource-description{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-scheduler__track{position:relative;isolation:isolate;-webkit-user-select:none;user-select:none;flex:none;box-sizing:border-box;width:var(--sd-scheduler-track)}.sd-scheduler__track:after{position:absolute;inset:0;background-image:inherit;content:\"\";pointer-events:none}.sd-scheduler__track{background-size:0 0;background-image:repeating-linear-gradient(to right,transparent 0 calc(var(--sd-scheduler-hour-width) / 2 - 1px),var(--sd-calendar-line-half, #efeef3) calc(var(--sd-scheduler-hour-width) / 2 - 1px) calc(var(--sd-scheduler-hour-width) / 2),transparent calc(var(--sd-scheduler-hour-width) / 2) calc(var(--sd-scheduler-hour-width) - 1px),var(--sd-calendar-line, #dedee5) calc(var(--sd-scheduler-hour-width) - 1px) var(--sd-scheduler-hour-width))}.sd-scheduler__track:dir(rtl){background-image:repeating-linear-gradient(to left,transparent 0 calc(var(--sd-scheduler-hour-width) / 2 - 1px),var(--sd-calendar-line-half, #efeef3) calc(var(--sd-scheduler-hour-width) / 2 - 1px) calc(var(--sd-scheduler-hour-width) / 2),transparent calc(var(--sd-scheduler-hour-width) / 2) calc(var(--sd-scheduler-hour-width) - 1px),var(--sd-calendar-line, #dedee5) calc(var(--sd-scheduler-hour-width) - 1px) var(--sd-scheduler-hour-width))}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__track{background-image:repeating-linear-gradient(to right,transparent 0 calc(calc(100% / var(--sd-scheduler-columns)) - 1px),var(--sd-calendar-line, #dedee5) calc(calc(100% / var(--sd-scheduler-columns)) - 1px) calc(100% / var(--sd-scheduler-columns)))}.sd-scheduler__scroller:not([data-view=day]) .sd-scheduler__track:dir(rtl){background-image:repeating-linear-gradient(to left,transparent 0 calc(calc(100% / var(--sd-scheduler-columns)) - 1px),var(--sd-calendar-line, #dedee5) calc(calc(100% / var(--sd-scheduler-columns)) - 1px) calc(100% / var(--sd-scheduler-columns)))}.sd-scheduler__off{position:absolute;inset-block:0;background:var(--sd-calendar-off-hours, #f3f3f7);pointer-events:none}.sd-scheduler__skeleton{position:absolute;top:10px;height:28px;border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface-muted, #e7e8ed)}.sd-scheduler__group{box-sizing:border-box;height:var(--sd-scheduler-group-height);border-bottom:1px solid var(--sd-calendar-line, #dedee5);background:var(--sd-surface, #fdfbff)}.sd-scheduler__group-cell{position:sticky;inset-inline-start:0;z-index:2;display:flex;min-width:0}.sd-scheduler__group-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__group-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__group-button{display:flex;align-items:center;gap:4px;height:var(--sd-scheduler-group-height);padding-inline:10px 14px;color:var(--sd-text-secondary, #44474f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);font-weight:600;white-space:nowrap}.sd-scheduler__group-button:focus-visible{outline-offset:-2px}.sd-scheduler__group-count{font-weight:400}.sd-scheduler__group-icon:dir(rtl){transform:scaleX(-1)}.sd-scheduler__empty-row{display:flex}.sd-scheduler__empty{position:sticky;inset-inline-start:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;box-sizing:border-box;width:100%;min-height:144px;padding:24px;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__empty-text{margin:0;color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__now{position:absolute;inset-block:0;inset-inline-start:calc(var(--sd-scheduler-resource-width) + var(--sd-scheduler-now-offset) - 1px);z-index:1;width:2px;background:var(--sd-calendar-now, #ba1a1a);pointer-events:none}.sd-scheduler__now:before{position:absolute;top:0;inset-inline-start:-4px;width:10px;height:10px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-calendar-now, #ba1a1a);content:\"\"}.sd-scheduler__event{--sd-scheduler-event-bg: color-mix(in srgb, var(--sd-scheduler-event-color) 14%, var(--sd-surface, #fdfbff));--sd-scheduler-event-border: color-mix(in srgb, var(--sd-scheduler-event-color) 28%, var(--sd-surface, #fdfbff));--sd-scheduler-event-dot: var(--sd-scheduler-event-color);position:absolute;z-index:1;display:flex;align-items:center;gap:6px;box-sizing:border-box;height:var(--sd-scheduler-lane-height);padding:0 8px;overflow:hidden;border:1px solid var(--sd-scheduler-event-border);border-radius:var(--sd-scheduler-event-radius);background:var(--sd-scheduler-event-bg);color:var(--sd-text, #1a1b1f);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap;cursor:pointer;transition:box-shadow .15s,background-color .15s}.sd-scheduler__event[data-color=primary]{--sd-scheduler-event-color: var(--sd-primary, #005cbb);--sd-scheduler-event-bg: var(--sd-primary-light, #dbe8f5)}.sd-scheduler__event[data-color=secondary]{--sd-scheduler-event-color: var(--sd-secondary, #5c6270);--sd-scheduler-event-bg: var(--sd-secondary-light, #ebecee)}.sd-scheduler__event[data-color=info]{--sd-scheduler-event-color: var(--sd-info, #006a6a);--sd-scheduler-event-bg: var(--sd-info-light, #dbeaea)}.sd-scheduler__event[data-color=success]{--sd-scheduler-event-color: var(--sd-success, #2e7d32);--sd-scheduler-event-bg: var(--sd-success-light, #e2ede2)}.sd-scheduler__event[data-color=warning]{--sd-scheduler-event-color: var(--sd-warning, #a66300);--sd-scheduler-event-bg: var(--sd-warning-light, #f3e9db)}.sd-scheduler__event[data-color=error]{--sd-scheduler-event-color: var(--sd-error, #ba1a1a);--sd-scheduler-event-bg: var(--sd-error-light, #f5dfdf)}.sd-scheduler__event[data-past]{--sd-scheduler-event-dot: color-mix(in srgb, var(--sd-scheduler-event-color) 45%, var(--sd-surface, #fdfbff));border-color:color-mix(in srgb,var(--sd-scheduler-event-border) 50%,var(--sd-surface, #fdfbff));background:color-mix(in srgb,var(--sd-scheduler-event-bg) 45%,var(--sd-surface, #fdfbff))}.sd-scheduler__event[data-tier=sm]{justify-content:center;padding:0}.sd-scheduler__event[data-clipped-start]{border-start-start-radius:0;border-end-start-radius:0}.sd-scheduler__event[data-clipped-end]{border-start-end-radius:0;border-end-end-radius:0}.sd-scheduler__event[data-selected]{z-index:2;border-color:var(--sd-scheduler-event-color);box-shadow:var(--sd-shadow-md)}.sd-scheduler__event[data-failed]{outline:2px solid var(--sd-error, #ba1a1a);outline-offset:1px}.sd-scheduler__event[data-pending]{z-index:3;border:1px dashed var(--sd-scheduler-event-color)}.sd-scheduler__event:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}@media(hover:hover){.sd-scheduler__event:hover{background:color-mix(in srgb,var(--sd-scheduler-event-color) 7%,var(--sd-scheduler-event-bg));box-shadow:var(--sd-shadow-sm)}}.sd-scheduler__dot{flex:none;width:6px;height:6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-scheduler-event-dot, var(--sd-scheduler-event-color))}.sd-scheduler__repeat{flex:none;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__event-content{display:flex;flex:1;align-items:center;min-width:0}.sd-scheduler__event-title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:0 1 auto;min-width:0;font-weight:600}.sd-scheduler__lead-time{margin-inline-end:4px;font-weight:400}.sd-scheduler__event-time{flex:none;color:var(--sd-text-secondary, #44474f)}.sd-scheduler__lead-time,.sd-scheduler__event-time{direction:ltr;unicode-bidi:isolate}.sd-scheduler__sync{flex:none;margin-inline-start:auto;color:var(--sd-scheduler-event-color, var(--sd-primary, #005cbb));animation:sd-scheduler-spin 1s linear infinite}@keyframes sd-scheduler-spin{to{transform:rotate(360deg)}}.sd-scheduler__cursor{position:absolute;inset-block:6px;z-index:5;display:none;box-sizing:border-box;padding:0 4px;border:2px solid var(--sd-focus-ring-color, #005cbb);border-radius:var(--sd-radius-4, 4px);background:color-mix(in srgb,var(--sd-primary, #005cbb) 8%,transparent);font-size:var(--sd-font-size-10, 10px);line-height:var(--sd-line-height-12, 12px);font-weight:var(--sd-font-weight-medium, 500);pointer-events:none}.sd-scheduler__grid:focus-visible .sd-scheduler__cursor{display:block}.sd-scheduler__grid:focus-visible [data-cursor-row]{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px);outline-offset:-2px}.sd-scheduler__scroller{scroll-padding-block-start:48px;scroll-padding-inline-start:var(--sd-scheduler-resource-width)}.sd-scheduler__track--cells{display:grid;grid-template-columns:repeat(var(--sd-scheduler-columns),minmax(0,1fr))}.sd-scheduler__cell{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;min-width:0;overflow:hidden;cursor:pointer}.sd-scheduler__grid:focus-visible .sd-scheduler__cell[data-cursor-cell]{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px);outline-offset:-3px}@media(hover:hover){.sd-scheduler__cell:hover{background:color-mix(in srgb,var(--sd-text, #1a1b1f) 4%,transparent)}}.sd-scheduler__track--create{cursor:cell}.sd-scheduler__track--blocked{cursor:not-allowed}.sd-scheduler__ghost{position:absolute;top:10px;z-index:4;display:flex;align-items:center;gap:6px;box-sizing:border-box;height:var(--sd-scheduler-lane-height);padding:0 8px;overflow:hidden;border:1px dashed var(--sd-primary, #005cbb);border-radius:var(--sd-scheduler-event-radius);background:color-mix(in srgb,var(--sd-primary-light, #dbe8f5) 92%,transparent);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap;pointer-events:none}.sd-scheduler__ghost[data-blocked]{border-color:var(--sd-border-strong, #74777f)}.sd-scheduler__event[data-movable]{cursor:grab;touch-action:none}.sd-scheduler__event[data-dragging]{border:1px dashed var(--sd-scheduler-event-border);background:transparent;box-shadow:none;opacity:.55}.sd-scheduler__event.sd-scheduler__proposal{z-index:4;overflow:visible;border-color:var(--sd-scheduler-event-color);box-shadow:var(--sd-shadow-lg);pointer-events:none}.sd-scheduler__event.sd-scheduler__proposal[data-blocked]{border-style:dashed;border-color:var(--sd-border-strong, #74777f);background:transparent;box-shadow:none}.sd-scheduler__label{position:absolute;top:50%;inset-inline-start:calc(100% + 6px);padding:2px 6px;border-radius:var(--sd-radius-4, 4px);background:var(--sd-surface-inverse, #1a1b1f);color:var(--sd-surface, #fdfbff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-14, 14px);font-weight:var(--sd-font-weight-medium, 500);white-space:nowrap;transform:translateY(-50%);pointer-events:none}.sd-scheduler__label[data-flip]{inset-inline-start:auto;inset-inline-end:calc(100% + 6px)}.sd-scheduler__label--resize{z-index:6}.sd-scheduler__label--resize[data-flip]{inset-inline-start:auto}.sd-scheduler__row[data-drop] .sd-scheduler__track:before{position:absolute;inset:0;z-index:1;content:\"\";pointer-events:none}.sd-scheduler__row[data-drop=ok] .sd-scheduler__track:before{background:color-mix(in srgb,var(--sd-primary, #005cbb) 6%,transparent)}.sd-scheduler__row[data-drop=blocked]{cursor:not-allowed}.sd-scheduler__row[data-drop=blocked] .sd-scheduler__track:before{background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--sd-text, #1a1b1f) 5%,transparent) 0 6px,transparent 6px 12px)}.sd-scheduler__row[data-drop=blocked] .sd-scheduler__resource{opacity:.5}.sd-scheduler__resize{position:absolute;inset-block:0;inset-inline-end:0;width:8px;cursor:ew-resize;touch-action:none}.sd-scheduler__resize:after{position:absolute;top:50%;inset-inline-end:3px;width:3px;height:12px;margin-top:-6px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-scheduler-event-color);content:\"\";opacity:0}@media(hover:hover){.sd-scheduler__event:hover .sd-scheduler__resize:after{opacity:1}}@media(pointer:coarse){.sd-scheduler__event:not([data-selected]) .sd-scheduler__resize{display:none}.sd-scheduler__event[data-selected] .sd-scheduler__resize{width:24px}.sd-scheduler__event[data-selected] .sd-scheduler__resize:after{width:6px;height:24px;margin-top:-12px;opacity:1}}@media(pointer:coarse){.sd-scheduler__today,.sd-scheduler__band-button,.sd-scheduler__scope-button{min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler__icon-button{min-width:var(--sd-control-height-coarse, 44px);min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler__view{min-height:calc(var(--sd-control-height-coarse, 44px) - 2px)}.sd-scheduler{--sd-scheduler-group-height: 44px}.sd-scheduler[data-view=week] .sd-scheduler__day-number{position:relative}.sd-scheduler[data-view=week] .sd-scheduler__day-number:after{position:absolute;inset:-8px;content:\"\"}}.sd-scheduler__scope{position:absolute;inset-inline-end:12px;bottom:12px;inset-inline-start:12px;z-index:10;padding:12px 14px;border-radius:var(--sd-radius-10, 10px);background:var(--sd-surface-inverse, #1a1b1f);box-shadow:var(--sd-shadow-lg);color:var(--sd-surface, #fdfbff);font-size:var(--sd-font-size-14, 14px)}.sd-scheduler__scope-message{margin:0 0 10px}.sd-scheduler__scope-actions{display:flex;flex-wrap:wrap;gap:8px}.sd-scheduler__scope-button{margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}.sd-scheduler__scope-button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, #005cbb);outline-offset:var(--sd-focus-ring-offset, 2px)}.sd-scheduler__scope-button{height:36px;padding:0 10px;border-radius:var(--sd-radius-6, 6px);color:var(--sd-primary-light, #dbe8f5);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500)}.sd-scheduler__scope-button--cancel{color:var(--sd-surface, #fdfbff)}@media(hover:hover){.sd-scheduler__scope-button:hover{background:color-mix(in srgb,var(--sd-surface, #fdfbff) 12%,transparent)}}.sd-scheduler__icon-button sd-icon:dir(rtl),.sd-scheduler__progress:dir(rtl){transform:scaleX(-1)}.sd-scheduler--compact .sd-scheduler__title{white-space:normal}.sd-scheduler--compact .sd-scheduler__band-button,.sd-scheduler--compact .sd-scheduler__scope-button{min-height:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact[data-view=week] .sd-scheduler__day-number{position:relative}.sd-scheduler--compact[data-view=week] .sd-scheduler__day-number:after{position:absolute;inset:-8px;content:\"\"}.sd-scheduler--compact{--sd-scheduler-resource-width: 120px;--sd-scheduler-hour-width: 64px;--sd-scheduler-day-min-width: 96px;--sd-scheduler-group-height: 44px}.sd-scheduler--compact .sd-scheduler__toolbar{flex-wrap:wrap;gap:8px;height:auto;padding:8px 12px}.sd-scheduler--compact .sd-scheduler__title{order:-2;flex:1 1 0}.sd-scheduler--compact .sd-scheduler__nav{order:-1}.sd-scheduler--compact .sd-scheduler__today,.sd-scheduler--compact .sd-scheduler__icon-button{height:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact .sd-scheduler__icon-button{width:var(--sd-control-height-coarse, 44px)}.sd-scheduler--compact .sd-scheduler__views{flex:1 0 100%}.sd-scheduler--compact .sd-scheduler__view{flex:1;height:42px}.sd-scheduler--compact .sd-scheduler__resource{gap:8px;padding-inline:10px 8px}.sd-scheduler--compact .sd-scheduler__resource-title{display:-webkit-box;overflow:hidden;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-16, 16px);white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.sd-scheduler--compact .sd-scheduler__resource-description{display:none}.sd-scheduler--compact .sd-scheduler__resource-icon{width:24px;height:24px}@media(prefers-reduced-motion:reduce){.sd-scheduler__event{transition:none}.sd-scheduler__sync,.sd-scheduler__progress-bar{animation:none}}@media(forced-colors:active){.sd-scheduler__dot{border:1px solid CanvasText}.sd-scheduler__axis-day[data-today] .sd-scheduler__day-number{outline:2px solid Highlight}.sd-scheduler,.sd-scheduler__event{border-color:CanvasText}.sd-scheduler__event[data-selected]{border:2px solid Highlight}.sd-scheduler__event[data-pending]{border-color:Highlight}.sd-scheduler__now,.sd-scheduler__now:before{background-color:Highlight}}\n"] }]
|
|
1925
|
+
}], ctorParameters: () => [], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], resources: [{ type: i0.Input, args: [{ isSignal: true, alias: "resources", required: true }] }], 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"] }], selectedId: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedId", required: false }] }, { type: i0.Output, args: ["selectedIdChange"] }], views: [{ type: i0.Input, args: [{ isSignal: true, alias: "views", required: false }] }], resourceLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resourceLabel", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], hideWeekends: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideWeekends", required: false }] }], workingHours: [{ type: i0.Input, args: [{ isSignal: true, alias: "workingHours", required: false }] }], holidays: [{ type: i0.Input, args: [{ isSignal: true, alias: "holidays", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], scrollTime: [{ type: i0.Input, args: [{ isSignal: true, alias: "scrollTime", required: false }] }], dimPast: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimPast", required: false }] }], transform: [{ type: i0.Input, args: [{ isSignal: true, alias: "transform", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], sdSelect: [{ type: i0.Output, args: ["sdSelect"] }], sdRangeChange: [{ type: i0.Output, args: ["sdRangeChange"] }], sdMove: [{ type: i0.Output, args: ["sdMove"] }], sdMoveError: [{ type: i0.Output, args: ["sdMoveError"] }], sdLoadError: [{ type: i0.Output, args: ["sdLoadError"] }], sdCellSelect: [{ type: i0.Output, args: ["sdCellSelect"] }], eventTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSchedulerEventTemplateDirective), { isSignal: true }] }], resourceTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSchedulerResourceTemplateDirective), { isSignal: true }] }], cellTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSchedulerCellTemplateDirective), { isSignal: true }] }], emptyTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => SdSchedulerEmptyTemplateDirective), { isSignal: true }] }], scroller: [{ type: i0.ViewChild, args: ['scroller', { isSignal: true }] }], gridElement: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }], root: [{ type: i0.ViewChild, args: ['root', { isSignal: true }] }] } });
|
|
1926
|
+
|
|
1927
|
+
/**
|
|
1928
|
+
* Generated bundle index. Do not edit.
|
|
1929
|
+
*/
|
|
1930
|
+
|
|
1931
|
+
export { SdScheduler, SdSchedulerCellTemplateDirective, SdSchedulerEmptyTemplateDirective, SdSchedulerEventTemplateDirective, SdSchedulerResourceTemplateDirective };
|
|
1932
|
+
//# sourceMappingURL=sdcorejs-angular-components-scheduler.mjs.map
|