@revolist/ui 4.0.1-rc → 4.0.1
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/LICENSE +21 -0
- package/MIGRATION.md +36 -0
- package/OWNERSHIP.md +32 -32
- package/README.md +405 -264
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/calendar-DJqiFwFT.js +258 -0
- package/_chunks/chart-frame-hcOlnQ1K.js +145 -0
- package/_chunks/{chevron-right-sxHQMSkq.js → check-BwI7iCAm.js} +2 -2
- package/_chunks/{chevron-left-D0nc4Z5S.js → chevron-right-CM3ljziP.js} +2 -2
- package/_chunks/choice-chips-yr6Uzmof.js +126 -0
- package/_chunks/clock-BOhPNlW3.js +4 -0
- package/_chunks/color-palette-DMJUChWC.js +92 -0
- package/_chunks/{color-picker-BRv-__AM.js → color-picker-CMWxQlWt.js} +61 -56
- package/_chunks/component-DyWiItBR.js +878 -0
- package/_chunks/{component-metadata-BENbgTjU.js → component-metadata-BKd7U8OW.js} +0 -12
- package/_chunks/configurator-actions-DCodxcUw.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-CbOYUakE.js +118 -0
- package/_chunks/{controller-CmLo-Ajc.js → controller-hRBm_Lfz.js} +15 -15
- package/_chunks/controls-DD1qvPfE.js +650 -0
- package/_chunks/{date-control-CYCkb1aQ.js → date-control-XI2cpKI_.js} +21 -21
- package/_chunks/date-time-CGJdC1Qa.js +807 -0
- package/_chunks/{delete-button-DnpmDNEJ.js → delete-button-CW9vjLnk.js} +7 -7
- package/_chunks/dialog.parts-CJ3FVxC9.js +131 -0
- package/_chunks/duration-CBJWK82T.js +272 -0
- package/_chunks/editor-commit-Bq3wSgvr.js +12 -0
- package/_chunks/editor-popup-ByU7qiub.js +82 -0
- package/_chunks/field-configurator-B-qtIwx1.js +288 -0
- package/_chunks/field-context-D57PnBbH.js +5 -0
- package/_chunks/framework-mount-Bk4O_T7T.js +54 -0
- package/_chunks/hooks.module-CG3gN83z.js +157 -0
- package/_chunks/icon-toolbar-DSjOdwM7.js +134 -0
- package/_chunks/jsxRuntime.module-F6UFnpT-.js +30 -0
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/mount-C7i5gsKI.js +267 -0
- package/_chunks/native-Blr3byjO.js +32 -0
- package/_chunks/native-control-B9MNibfa.js +649 -0
- package/_chunks/{number-input-NnH57J4j.js → number-input-CgbZes5B.js} +89 -89
- package/_chunks/picker-DqpjDC90.js +122 -0
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/popover-controller-D-AvKQ7B.js +102 -0
- package/_chunks/popup-C35Isk7p.js +378 -0
- package/_chunks/preact.module-BBM36DnO.js +290 -0
- package/_chunks/{rating-choice-CWAsNQNS.js → rating-choice-WDrfiluf.js} +10 -10
- package/_chunks/render-m5eMMwFR.js +83 -0
- package/_chunks/reorder-list-C4HSda4n.js +59 -0
- package/_chunks/request-trail-SHynDFdM.js +762 -0
- package/_chunks/rich-text-CtjqRvv8.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/rotate-right-Iha5ScJ1.js +4 -0
- package/_chunks/selection-list-tooltips-BtWjpP6M.js +41 -0
- package/_chunks/title-tooltip-Cw6LOZhb.js +11 -0
- package/_chunks/tooltip-D4xkio5G.js +54 -0
- package/_chunks/tooltip-owner-DjdvqKzz.js +19 -0
- package/_chunks/tooltip-session-B6X6x8G_.js +110 -0
- package/_chunks/tooltip-text-BXsUEmBH.js +12 -0
- package/_chunks/top-layer-popup-CNSDdfJV.js +59 -0
- package/_dialog.scss +55 -21
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_shared/data-query/index.d.ts +2 -2
- package/_shared/data-query/load-options.d.ts +2 -2
- package/_variables.scss +34 -32
- package/_vendor/preact/LICENSE +21 -0
- package/_vendor/preact/compat/src/index.d.ts +353 -0
- package/_vendor/preact/compat/src/suspense-list.d.ts +16 -0
- package/_vendor/preact/compat/src/suspense.d.ts +19 -0
- package/_vendor/preact/hooks/src/index.d.ts +145 -0
- package/_vendor/preact/src/dom.d.ts +2548 -0
- package/_vendor/preact/src/index.d.ts +373 -0
- package/_vendor/preact/src/jsx.d.ts +2958 -0
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +2 -2
- package/activity-message.js +16 -16
- package/ai/_chat.scss +227 -0
- package/ai/_style.scss +170 -39
- package/ai/chat.d.ts +65 -0
- package/ai/components.d.ts +35 -6
- package/ai/index.d.ts +3 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +59 -6
- package/ai/prompt-history.d.ts +13 -0
- package/ai/request-trail.d.ts +9 -3
- package/ai/results/_style.scss +83 -0
- package/ai/results/index.d.ts +11 -0
- package/ai/results/metrics.d.ts +5 -0
- package/ai/results/table.d.ts +5 -0
- package/ai/results/text.d.ts +5 -0
- package/ai/results/types.d.ts +29 -0
- package/ai/transcript.d.ts +27 -0
- package/ai/translation-context.d.ts +1 -1
- package/ai/translations.d.ts +1 -1
- package/alert.d.ts +2 -2
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -10
- package/assignee/assignee.scss +28 -6
- package/assignee/field.d.ts +2 -2
- package/assignee/index.js +86 -87
- package/assignee/layout.d.ts +2 -2
- package/assignee/picker.d.ts +1 -1
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +42 -41
- package/badge.d.ts +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +2 -4
- package/brush-range/component.js +19 -19
- package/buttons/delete-button.d.ts +2 -1
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +2 -2
- package/buttons/remove-button.js +3 -3
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +3 -2
- package/buttons/svg-button.js +23 -23
- package/calendar/_calendar.scss +27 -26
- package/calendar/calendar.d.ts +1 -1
- package/calendar/calendar.js +1 -1
- package/calendar/caption.d.ts +1 -1
- package/calendar/day.d.ts +1 -1
- package/calendar/day.js +4 -4
- package/calendar/header.d.ts +1 -1
- package/calendar/header.js +34 -35
- package/calendar/index.js +2 -2
- package/calendar/month-grid.d.ts +1 -1
- package/calendar/month-grid.js +37 -37
- package/calendar/picker.d.ts +1 -1
- package/calendar/types.d.ts +1 -1
- package/calendar/year-grid.d.ts +1 -1
- package/calendar/year-grid.js +12 -12
- package/cell-input.scss +3 -7
- package/cell-visuals/badge.style.scss +6 -3
- package/cell-visuals/bar-chart.style.scss +2 -1
- package/cell-visuals/progress-line-value.renderer.style.scss +4 -2
- package/cell-visuals/progress-line.style.scss +1 -4
- package/cell-visuals/sparkline.style.scss +2 -1
- package/cell-visuals/timeline.style.css +4 -2
- package/checkbox/checkbox.scss +6 -24
- package/checkbox/index.d.ts +2 -2
- package/checkbox/index.js +9 -9
- package/choice-chips/index.d.ts +4 -2
- package/choice-chips/index.js +1 -1
- package/color-palette/color-palette.d.ts +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.d.ts +1 -1
- package/color-palette/color-picker.js +2 -2
- package/color-palette/color-picker.style.scss +23 -10
- package/color-palette/common-palettes.d.ts +1 -1
- package/color-palette/common-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/component-catalog.d.ts +42 -29
- package/configurator-actions.d.ts +67 -0
- package/configurator-actions.js +1 -0
- package/configurator-aggregation-list.d.ts +14 -0
- package/configurator-aggregation-list.js +63 -0
- package/configurator-drop-zone.d.ts +39 -0
- package/configurator-drop-zone.js +66 -0
- package/configurator-field-icon.d.ts +10 -0
- package/configurator-field-icon.js +1 -0
- package/configurator-focus.d.ts +4 -0
- package/configurator-focus.js +39 -0
- package/configurator-sections.d.ts +42 -0
- package/configurator-sections.js +71 -0
- package/control-attributes.js +7 -7
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +31 -26
- package/controls.d.ts +23 -11
- package/controls.js +4 -3
- package/core/editor-commit.d.ts +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +5 -1
- package/core/editor-popup.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popup-ownership.d.ts +2 -0
- package/core/selection-list-tooltips.d.ts +2 -0
- package/core/title-tooltip.d.ts +2 -0
- package/core/tooltip-session.d.ts +29 -0
- package/core/tooltip-surface.d.ts +13 -0
- package/core/tooltip-text.d.ts +6 -0
- package/core/tooltip.d.ts +35 -0
- package/core/top-layer-popup.d.ts +4 -0
- package/core/top-layer-popup.js +1 -23
- package/date-time/attach.d.ts +1 -1
- package/date-time/date-control.d.ts +2 -2
- package/date-time/field.d.ts +4 -3
- package/date-time/index.js +1 -1
- package/date-time/picker.d.ts +1 -1
- package/date-time/style.scss +242 -39
- package/date-time/time-control.d.ts +1 -1
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +6 -2
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +53 -53
- package/dialog/dialog.parts.d.ts +18 -18
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.d.ts +1 -1
- package/dialog/dialog.preact.js +6 -6
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.d.ts +1 -1
- package/distribution-chart/area-chart.js +25 -25
- package/distribution-chart/bar-chart.d.ts +6 -3
- package/distribution-chart/bar-chart.js +10 -6
- package/distribution-chart/chart-frame.d.ts +3 -2
- package/distribution-chart/index.d.ts +2 -2
- package/distribution-chart/index.js +6 -6
- package/distribution-chart/line-chart.d.ts +1 -1
- package/distribution-chart/line-chart.js +9 -9
- package/distribution-chart/types.d.ts +1 -1
- package/dropdown/content.d.ts +3 -2
- package/dropdown/content.js +1 -141
- package/dropdown/control.d.ts +14 -0
- package/dropdown/control.js +1 -0
- package/dropdown/control.view.d.ts +6 -0
- package/dropdown/dropdown.service.d.ts +1 -1
- package/dropdown/dropdown.service.js +9 -9
- package/dropdown/dropdown.types.d.ts +5 -1
- package/dropdown/editor-dropdown.style.scss +54 -16
- package/dropdown/index.d.ts +1 -1
- package/dropdown/index.js +3 -4
- package/dropdown/lookup-field.d.ts +6 -1
- package/dropdown/lookup-field.js +42 -41
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -140
- package/duration/controls.d.ts +1 -1
- package/duration/index.d.ts +2 -2
- package/duration/index.js +1 -1
- package/duration/style.scss +1 -1
- package/editor-actions.d.ts +1 -1
- package/editor-actions.js +21 -20
- package/editor-layout/index.d.ts +5 -5
- package/editor-layout/index.js +43 -38
- package/editor-layout/style.scss +82 -18
- package/field-configurator.d.ts +40 -2
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +32 -32
- package/fieldset.d.ts +3 -0
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/control.js +2 -0
- package/filter/filters/slider/preact.js +3 -3
- package/filter/filters/slider/runtime.js +49 -22
- package/filter/filters/slider/single.d.ts +1 -1
- package/filter/filters/slider/single.js +23 -23
- package/filter-badge.d.ts +1 -1
- package/filter-badge.js +23 -22
- package/filter-controls.d.ts +1 -2
- package/filter-controls.js +29 -30
- package/form-controls/field-context.d.ts +5 -0
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +17 -22
- package/form-controls/presentation.d.ts +2 -2
- package/form-controls/presentation.js +59 -51
- package/formatting/comparison-preview.d.ts +1 -1
- package/formatting/icon-controls.d.ts +1 -1
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +106 -100
- package/formatting/inspector-section.d.ts +1 -1
- package/formatting/styles.scss +14 -57
- package/formatting/typography-controls.d.ts +1 -1
- package/framework-mount.d.ts +1 -1
- package/framework.js +237 -226
- package/history-controls.d.ts +14 -0
- package/history-controls.js +27 -0
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +2 -2
- package/icons/icon.js +1 -1
- package/legend.d.ts +2 -2
- package/legend.js +12 -12
- package/masked-input/index.d.ts +1 -1
- package/masked-input/index.js +109 -109
- package/native-control.d.ts +14 -13
- package/native-control.js +3 -26
- package/native-controls.d.ts +54 -2
- package/native-styles.css +1 -1
- package/native-styles.scss +6 -2
- package/native.d.ts +3 -3
- package/native.js +49 -45
- package/number-input/index.d.ts +2 -2
- package/number-input/index.js +1 -1
- package/package.json +88 -15
- package/pagination.d.ts +3 -0
- package/pagination.js +50 -40
- package/pdf-viewer/component.d.ts +1 -1
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +2 -2
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +13 -13
- package/pdf-viewer/search-bar.d.ts +2 -2
- package/pdf-viewer/status.d.ts +2 -2
- package/pdf-viewer/style.scss +205 -45
- package/pdf-viewer/toolbar.d.ts +1 -1
- package/pickers.d.ts +6 -2
- package/preact-mount.d.ts +1 -1
- package/preact-mount.js +2 -2
- package/preact.d.ts +15 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/rating-choice.d.ts +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +5 -3
- package/react-control.d.ts +1 -0
- package/react.d.ts +20 -11
- package/react.js +72 -88
- package/reorder-list.d.ts +2 -2
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.d.ts +1 -1
- package/resource-picker/resource-picker-avatar.js +14 -14
- package/resource-picker/resource-picker-option.d.ts +1 -1
- package/resource-picker/resource-picker-option.js +28 -28
- package/resource-picker/resource-picker-popup.d.ts +1 -1
- package/resource-picker/resource-picker-popup.js +3 -3
- package/resource-picker/resource-picker.d.ts +1 -1
- package/resource-picker/resource-picker.js +68 -66
- package/resource-picker/resource-picker.scss +66 -35
- package/rich-text/engine.d.ts +17 -19
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +11 -7
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +6 -3
- package/rich-text/render-model.d.ts +4 -5
- package/rich-text/style.scss +295 -55
- package/rich-text/syntax.d.ts +5 -2
- package/rich-text/toolbar.d.ts +7 -7
- package/rich-text/translations.d.ts +5 -15
- package/search-input/index.js +12 -12
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.d.ts +1 -1
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +22 -0
- package/select.js +1 -0
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/exit-snapshot.js +1 -1
- package/status-feedback/index.js +2 -2
- package/status-feedback/popover.js +9 -9
- package/status-feedback/render.d.ts +2 -2
- package/status-feedback/render.js +3 -44
- package/status-feedback/status-feedback.scss +130 -34
- package/status-feedback/types.d.ts +4 -0
- package/status-feedback/use-auto-dismiss.d.ts +3 -0
- package/styles/_activity-message.scss +24 -7
- package/styles/_alert.scss +78 -17
- package/styles/_cell-editor-frame.scss +11 -0
- package/styles/_compositions.scss +404 -82
- package/styles/_control.scss +42 -12
- package/styles/_disclosure.scss +15 -5
- package/styles/_editor-counter.scss +16 -6
- package/styles/_editor-slider.scss +8 -4
- package/styles/_field-configurator.scss +321 -23
- package/styles/_fields-grid.scss +49 -0
- package/styles/_filter-controls.scss +10 -2
- package/styles/_icon-action.scss +48 -15
- package/styles/_loading.scss +12 -3
- package/styles/_motion.scss +32 -9
- package/styles/_palette.scss +0 -24
- package/styles/_primitives.scss +376 -116
- package/styles/_theme.scss +130 -86
- package/styles/_thresholds.scss +28 -25
- package/styles/_time-grid.scss +8 -3
- package/styles/_tokens.scss +6 -1
- package/styles/configurator-actions.scss +241 -0
- package/styles/pagination.css +213 -0
- package/styles/{legacy-rating.css → rating.css} +8 -3
- package/styles.css +1 -1
- package/styles.scss +3 -5
- package/surfaces.d.ts +38 -2
- package/surfaces.js +37 -134
- package/svelte/UiComponent.server.js +1 -48
- package/svelte/UiComponent.svelte +44 -32
- package/svelte.d.ts +1 -1
- package/svelte.js +33 -68
- package/switch/index.js +3 -2
- package/time-grid.d.ts +1 -2
- package/time-grid.js +43 -42
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/component.d.ts +5 -1
- package/timeline-track/index.js +91 -74
- package/timeline-track/model.d.ts +9 -0
- package/timeline-track/model.js +10 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-adapter.d.ts +1 -1
- package/vue.d.ts +160 -144
- package/vue.js +149 -178
- package/_chunks/calendar-BsDxCYhI.js +0 -248
- package/_chunks/chart-frame-BvxbmEU9.js +0 -126
- package/_chunks/choice-chips-0HfOnK_4.js +0 -110
- package/_chunks/color-palette-BmZ7kH9R.js +0 -94
- package/_chunks/component-D4PH5UZT.js +0 -859
- package/_chunks/control-tooltip-BCNzQCXE.js +0 -100
- package/_chunks/controls-NEL5tDaz.js +0 -615
- package/_chunks/date-time-DjucJmbc.js +0 -769
- package/_chunks/dialog.parts-Dt3KinUz.js +0 -134
- package/_chunks/dropdown-CkGQBm1Q.js +0 -357
- package/_chunks/duration-BCaktcvz.js +0 -270
- package/_chunks/editor-commit-D6Rf5rGz.js +0 -12
- package/_chunks/editor-popup-B7fu_A_T.js +0 -81
- package/_chunks/framework-mount-BKIOsvY-.js +0 -54
- package/_chunks/mount-0-8opf1j.js +0 -90
- package/_chunks/native.view-8q_nwQ7x.js +0 -32
- package/_chunks/picker-oazJ7sO_.js +0 -121
- package/_chunks/reorder-list-BV3kZXso.js +0 -59
- package/_chunks/request-trail-D0oVzdRd.js +0 -347
- package/_chunks/rich-text-2Rla349o.js +0 -477
- package/avatar/index.view.d.ts +0 -25
- package/color-palette/native.view.d.ts +0 -15
- package/control-presentation.view.d.ts +0 -8
- package/dialog/dialog-action-footer.view.d.ts +0 -20
- package/dialog/dialog.dom.view.d.ts +0 -15
- package/form-controls/index.view.d.ts +0 -12
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/react-native-select.d.ts +0 -6
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
- package/vue-native-select.d.ts +0 -9
package/time-grid.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t as n } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { t as r } from "./_chunks/native-control-B9MNibfa.js";
|
|
4
|
+
import { t as i } from "./_chunks/tooltip-text-BXsUEmBH.js";
|
|
4
5
|
//#region src/time-grid.tsx
|
|
5
6
|
var a = (e, t) => `${e}:${t}`;
|
|
6
7
|
function o(e) {
|
|
@@ -10,53 +11,53 @@ function o(e) {
|
|
|
10
11
|
e.outsideWorkHours && "is-outside-work-hours"
|
|
11
12
|
].filter(Boolean).join(" ");
|
|
12
13
|
}
|
|
13
|
-
function s(
|
|
14
|
-
let
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
class:
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
-
class:
|
|
14
|
+
function s(e) {
|
|
15
|
+
let t = (e) => `rv-time-grid__${e}`, s = Array.from({ length: 12 }, (e, t) => t * 2);
|
|
16
|
+
return /* @__PURE__ */ n("div", {
|
|
17
|
+
class: t("schedule"),
|
|
18
|
+
children: [/* @__PURE__ */ n("div", {
|
|
19
|
+
class: t("hours"),
|
|
19
20
|
"aria-hidden": "true",
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
class:
|
|
22
|
-
children:
|
|
23
|
-
},
|
|
24
|
-
}), /* @__PURE__ */
|
|
25
|
-
ref:
|
|
26
|
-
class:
|
|
21
|
+
children: [/* @__PURE__ */ n("span", {}), s.map((r) => /* @__PURE__ */ n("span", {
|
|
22
|
+
class: t("hour"),
|
|
23
|
+
children: e.hourLabel(r)
|
|
24
|
+
}, r))]
|
|
25
|
+
}), /* @__PURE__ */ n("div", {
|
|
26
|
+
ref: e.matrixRef,
|
|
27
|
+
class: t("matrix"),
|
|
27
28
|
role: "grid",
|
|
28
|
-
"aria-label":
|
|
29
|
-
"aria-rowcount":
|
|
29
|
+
"aria-label": e.gridLabel,
|
|
30
|
+
"aria-rowcount": e.days.length,
|
|
30
31
|
"aria-colcount": 12,
|
|
31
|
-
children:
|
|
32
|
-
let { weekday: l, short: u, long: d } = c, f =
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
class: `${
|
|
32
|
+
children: e.days.map((c) => {
|
|
33
|
+
let { weekday: l, short: u, long: d } = c, f = e.weekendDays.includes(l);
|
|
34
|
+
return /* @__PURE__ */ n("div", {
|
|
35
|
+
class: `${t("row")}${f ? " is-weekend" : ""}`,
|
|
35
36
|
role: "row",
|
|
36
|
-
children: [/* @__PURE__ */
|
|
37
|
-
class:
|
|
37
|
+
children: [/* @__PURE__ */ n(i, {
|
|
38
|
+
class: t("weekday"),
|
|
38
39
|
role: "rowheader",
|
|
39
40
|
title: d,
|
|
40
41
|
children: u
|
|
41
|
-
}), s.map((
|
|
42
|
-
let i = a(l,
|
|
43
|
-
return /* @__PURE__ */ r
|
|
42
|
+
}), s.map((t) => {
|
|
43
|
+
let i = a(l, t), s = e.cells.has(i) || e.cells.has(a(l, t + 1)), u = e.workingHours ? t < e.workingHours.startHour || t + 2 > e.workingHours.endHour : !1;
|
|
44
|
+
return /* @__PURE__ */ n(r, {
|
|
44
45
|
type: "button",
|
|
45
|
-
disabled:
|
|
46
|
+
disabled: e.disabled,
|
|
46
47
|
role: "gridcell",
|
|
47
48
|
"data-time-cell": i,
|
|
48
|
-
class:
|
|
49
|
+
class: o({
|
|
49
50
|
weekend: f,
|
|
50
51
|
outsideWorkHours: u
|
|
51
|
-
})
|
|
52
|
+
}),
|
|
52
53
|
"aria-selected": s,
|
|
53
|
-
"aria-label":
|
|
54
|
-
tabIndex:
|
|
55
|
-
onFocus: () =>
|
|
56
|
-
onKeyDown: (
|
|
57
|
-
onClick: (
|
|
58
|
-
onPointerDown: (
|
|
59
|
-
onPointerEnter: () =>
|
|
54
|
+
"aria-label": e.cellLabel(c, e.hourLabel(t), e.hourLabel(t + 2), s),
|
|
55
|
+
tabIndex: e.focused === i ? 0 : -1,
|
|
56
|
+
onFocus: () => e.onFocus(i),
|
|
57
|
+
onKeyDown: (n) => e.onKeyDown(n, l, t),
|
|
58
|
+
onClick: (n) => e.onClick(n, l, t, s),
|
|
59
|
+
onPointerDown: (n) => e.onPointerDown(n, l, t, s),
|
|
60
|
+
onPointerEnter: () => e.onPointerEnter(l, t)
|
|
60
61
|
}, i);
|
|
61
62
|
})]
|
|
62
63
|
}, l);
|
|
@@ -64,13 +65,13 @@ function s(t) {
|
|
|
64
65
|
})]
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
function c(
|
|
68
|
-
let r = n
|
|
69
|
-
r.current =
|
|
70
|
-
let i =
|
|
68
|
+
function c(n) {
|
|
69
|
+
let r = t(n);
|
|
70
|
+
r.current = n;
|
|
71
|
+
let i = t(), o = t(), s = t(), c = () => {
|
|
71
72
|
o.current?.(), o.current = void 0;
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
+
e(() => () => {
|
|
74
75
|
i.current = void 0, c(), s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
75
76
|
}, []);
|
|
76
77
|
let l = (e, t) => {
|
|
@@ -6,11 +6,29 @@
|
|
|
6
6
|
height: 112px;
|
|
7
7
|
margin: 0 0 12px;
|
|
8
8
|
overflow: hidden;
|
|
9
|
-
border: 1px solid
|
|
9
|
+
border: 1px solid
|
|
10
|
+
var(--rv-ui-border, var(--rv-dialog-border, var(--rv-ui-border)));
|
|
10
11
|
border-radius: 11px;
|
|
11
12
|
background:
|
|
12
|
-
repeating-linear-gradient(
|
|
13
|
-
|
|
13
|
+
repeating-linear-gradient(
|
|
14
|
+
to right,
|
|
15
|
+
transparent 0,
|
|
16
|
+
transparent calc(25% - 1px),
|
|
17
|
+
color-mix(
|
|
18
|
+
in srgb,
|
|
19
|
+
var(--rv-ui-border, var(--rv-dialog-border, var(--rv-ui-border))) 58%,
|
|
20
|
+
transparent
|
|
21
|
+
)
|
|
22
|
+
25%
|
|
23
|
+
),
|
|
24
|
+
var(
|
|
25
|
+
--rv-ui-surface-sunken,
|
|
26
|
+
color-mix(
|
|
27
|
+
in srgb,
|
|
28
|
+
var(--rv-dialog-bg, var(--rv-ui-surface)) 96%,
|
|
29
|
+
var(--rv-ui-text-muted, var(--rv-dialog-muted, var(--rv-ui-text-muted)))
|
|
30
|
+
)
|
|
31
|
+
);
|
|
14
32
|
}
|
|
15
33
|
.rv-timeline-control__track::before {
|
|
16
34
|
position: absolute;
|
|
@@ -18,12 +36,29 @@
|
|
|
18
36
|
right: 0;
|
|
19
37
|
left: 0;
|
|
20
38
|
height: 1px;
|
|
21
|
-
background: color-mix(
|
|
39
|
+
background: color-mix(
|
|
40
|
+
in srgb,
|
|
41
|
+
var(--rv-ui-border, var(--rv-dialog-border, var(--rv-ui-border))) 82%,
|
|
42
|
+
transparent
|
|
43
|
+
);
|
|
22
44
|
content: '';
|
|
23
45
|
}
|
|
24
|
-
.rv-timeline-control__range {
|
|
25
|
-
|
|
26
|
-
|
|
46
|
+
.rv-timeline-control__range {
|
|
47
|
+
position: absolute;
|
|
48
|
+
bottom: 8px;
|
|
49
|
+
color: var(
|
|
50
|
+
--rv-ui-text-muted,
|
|
51
|
+
var(--rv-dialog-muted, var(--rv-ui-text-muted))
|
|
52
|
+
);
|
|
53
|
+
font-size: 11px;
|
|
54
|
+
font-variant-numeric: tabular-nums;
|
|
55
|
+
}
|
|
56
|
+
.rv-timeline-control__range--start {
|
|
57
|
+
left: 10px;
|
|
58
|
+
}
|
|
59
|
+
.rv-timeline-control__range--end {
|
|
60
|
+
right: 10px;
|
|
61
|
+
}
|
|
27
62
|
.rv-timeline-control__bar {
|
|
28
63
|
position: absolute;
|
|
29
64
|
top: 39px;
|
|
@@ -37,7 +72,11 @@
|
|
|
37
72
|
color: var(--timeline-event-text-color, #0f172a);
|
|
38
73
|
box-shadow: 0 1px 2px var(--rv-ui-shadow);
|
|
39
74
|
touch-action: none;
|
|
40
|
-
transition:
|
|
75
|
+
transition:
|
|
76
|
+
border-color var(--rv-ui-motion-fast, 120ms)
|
|
77
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1)),
|
|
78
|
+
box-shadow var(--rv-ui-motion-fast, 120ms)
|
|
79
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
41
80
|
}
|
|
42
81
|
.rv-timeline-control__bar-move {
|
|
43
82
|
position: absolute;
|
|
@@ -55,14 +94,28 @@
|
|
|
55
94
|
cursor: grab;
|
|
56
95
|
touch-action: none;
|
|
57
96
|
}
|
|
58
|
-
.rv-timeline-control__bar-move:active {
|
|
97
|
+
.rv-timeline-control__bar-move:active {
|
|
98
|
+
cursor: grabbing;
|
|
99
|
+
}
|
|
59
100
|
.rv-timeline-control__bar:hover {
|
|
60
101
|
border-color: var(--timeline-event-hover-color-end, #166534);
|
|
61
102
|
}
|
|
62
|
-
.rv-timeline-control__bar--selected {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
103
|
+
.rv-timeline-control__bar--selected {
|
|
104
|
+
box-shadow:
|
|
105
|
+
0 0 0 3px
|
|
106
|
+
color-mix(in srgb, var(--timeline-event-color, #16a34a) 22%, transparent),
|
|
107
|
+
0 1px 2px var(--rv-ui-shadow);
|
|
108
|
+
}
|
|
109
|
+
.rv-timeline-control__bar--milestone {
|
|
110
|
+
border-radius: 50%;
|
|
111
|
+
}
|
|
112
|
+
.rv-timeline-control__bar--milestone .rv-timeline-control__bar-label {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
.rv-timeline-control__bar--outside {
|
|
116
|
+
outline: 2px dashed var(--rv-structured-warning, var(--rv-ui-warning));
|
|
117
|
+
outline-offset: 2px;
|
|
118
|
+
}
|
|
66
119
|
.rv-timeline-control__bar-label {
|
|
67
120
|
display: block;
|
|
68
121
|
overflow: hidden;
|
|
@@ -89,16 +142,27 @@
|
|
|
89
142
|
width: 4px;
|
|
90
143
|
border-radius: 999px;
|
|
91
144
|
background: rgb(255 255 255 / 82%);
|
|
92
|
-
opacity: .45;
|
|
93
|
-
transition: opacity var(--rv-ui-motion-fast, 120ms)
|
|
145
|
+
opacity: 0.45;
|
|
146
|
+
transition: opacity var(--rv-ui-motion-fast, 120ms)
|
|
147
|
+
var(--rv-ui-motion-ease, cubic-bezier(0.2, 0, 0, 1));
|
|
94
148
|
content: '';
|
|
95
149
|
}
|
|
96
150
|
.rv-timeline-control__bar:hover .rv-timeline-control__handle::after,
|
|
97
|
-
.rv-timeline-control__bar--selected .rv-timeline-control__handle::after {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
.rv-timeline-control__handle--
|
|
101
|
-
|
|
151
|
+
.rv-timeline-control__bar--selected .rv-timeline-control__handle::after {
|
|
152
|
+
opacity: 1;
|
|
153
|
+
}
|
|
154
|
+
.rv-timeline-control__handle--start {
|
|
155
|
+
left: -12px;
|
|
156
|
+
}
|
|
157
|
+
.rv-timeline-control__handle--start::after {
|
|
158
|
+
left: 10px;
|
|
159
|
+
}
|
|
160
|
+
.rv-timeline-control__handle--end {
|
|
161
|
+
right: -12px;
|
|
162
|
+
}
|
|
163
|
+
.rv-timeline-control__handle--end::after {
|
|
164
|
+
right: 10px;
|
|
165
|
+
}
|
|
102
166
|
|
|
103
167
|
.rv-timeline-control__track button:focus-visible {
|
|
104
168
|
outline: 0;
|
|
@@ -106,16 +170,24 @@
|
|
|
106
170
|
box-shadow: 0 0 0 3px var(--rv-ui-focus-ring);
|
|
107
171
|
}
|
|
108
172
|
@media (prefers-reduced-motion: reduce) {
|
|
109
|
-
.rv-timeline-control__bar {
|
|
173
|
+
.rv-timeline-control__bar {
|
|
174
|
+
transition: none;
|
|
175
|
+
}
|
|
110
176
|
}
|
|
111
177
|
@media (forced-colors: active) {
|
|
112
|
-
.rv-timeline-control__track {
|
|
178
|
+
.rv-timeline-control__track {
|
|
179
|
+
border-color: CanvasText;
|
|
180
|
+
}
|
|
113
181
|
.rv-timeline-control__bar {
|
|
114
182
|
border-color: Highlight;
|
|
115
183
|
background: Highlight;
|
|
116
184
|
color: HighlightText;
|
|
117
185
|
forced-color-adjust: auto;
|
|
118
186
|
}
|
|
119
|
-
.rv-timeline-control__bar--selected {
|
|
120
|
-
|
|
187
|
+
.rv-timeline-control__bar--selected {
|
|
188
|
+
outline: 2px solid Highlight;
|
|
189
|
+
}
|
|
190
|
+
.rv-timeline-control__handle::after {
|
|
191
|
+
background: HighlightText;
|
|
192
|
+
}
|
|
121
193
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from '../_vendor/preact/src/index';
|
|
1
2
|
import { TimelineTrackEvent, TimelineTrackRange } from './model';
|
|
2
3
|
export type TimelineTrackPointerMode = 'move' | 'start' | 'end';
|
|
3
4
|
export interface TimelineTrackItem<T extends TimelineTrackEvent> {
|
|
@@ -12,6 +13,9 @@ export interface TimelineTrackLabels {
|
|
|
12
13
|
}
|
|
13
14
|
export interface TimelineTrackProps<T extends TimelineTrackEvent> {
|
|
14
15
|
readonly rows: readonly TimelineTrackItem<T>[];
|
|
16
|
+
readonly tooltip?: boolean;
|
|
17
|
+
readonly formatValue?: (value: number) => string;
|
|
18
|
+
readonly getTooltip?: (event: T) => string;
|
|
15
19
|
readonly selected?: string | number;
|
|
16
20
|
/** Finite bounds with end greater than start. */
|
|
17
21
|
readonly range: TimelineTrackRange;
|
|
@@ -20,4 +24,4 @@ export interface TimelineTrackProps<T extends TimelineTrackEvent> {
|
|
|
20
24
|
readonly onEventChange: (id: string | number, event: T) => void;
|
|
21
25
|
}
|
|
22
26
|
/** Controlled numeric timeline. Changes preserve event metadata; consumers own commits. */
|
|
23
|
-
export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>):
|
|
27
|
+
export declare function TimelineTrack<T extends TimelineTrackEvent>({ rows, tooltip, formatValue, getTooltip, selected, range, labels, onSelect, onEventChange, }: TimelineTrackProps<T>): JSX.Element;
|
package/timeline-track/index.js
CHANGED
|
@@ -1,139 +1,156 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "../_chunks/hooks.module-CG3gN83z.js";
|
|
2
|
+
import { t } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
+
import { t as n } from "../_chunks/native-control-B9MNibfa.js";
|
|
4
|
+
import { n as r } from "../_chunks/tooltip-D4xkio5G.js";
|
|
5
|
+
import { eventOutsideRange as i, moveTimelineEvent as a, niceTimelineStep as o, resizeTimelineEvent as s, timelineEventBackground as c, timelineGeometry as l } from "./model.js";
|
|
5
6
|
//#region src/timeline-track/component.tsx
|
|
6
|
-
var
|
|
7
|
+
var u = {
|
|
7
8
|
preview: "Timeline preview",
|
|
8
9
|
moveEvent: (e) => `Move event ${e}`,
|
|
9
10
|
resizeStart: (e) => `Resize start of ${e}`,
|
|
10
11
|
resizeEnd: (e) => `Resize end of ${e}`
|
|
11
12
|
};
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
...
|
|
15
|
-
...
|
|
16
|
-
},
|
|
13
|
+
function d({ rows: r, tooltip: d = !0, formatValue: p = String, getTooltip: m, selected: h, range: g, labels: _, onSelect: v, onEventChange: y }) {
|
|
14
|
+
let b = {
|
|
15
|
+
...u,
|
|
16
|
+
..._
|
|
17
|
+
}, x = e(), S = (e, t, n) => {
|
|
17
18
|
let r = e.currentTarget.closest(".rv-timeline-control__track");
|
|
18
|
-
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId),
|
|
19
|
+
r && (e.preventDefault(), e.currentTarget.setPointerCapture?.(e.pointerId), x.current = {
|
|
19
20
|
id: t.id,
|
|
20
21
|
mode: n,
|
|
21
22
|
clientX: e.clientX,
|
|
22
23
|
event: t.event,
|
|
23
24
|
width: r.getBoundingClientRect().width
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
let t =
|
|
25
|
+
}, v(t.id));
|
|
26
|
+
}, C = (e) => {
|
|
27
|
+
let t = x.current;
|
|
27
28
|
if (!t) return;
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
29
|
+
let n = o(g), r = (e.clientX - t.clientX) / Math.max(1, t.width) * (g.end - g.start), i = Math.round(r / n) * n, c = t.mode === "move" ? a(t.event, i, g) : s(t.event, t.mode, i, g);
|
|
30
|
+
y(t.id, c);
|
|
31
|
+
}, w = () => {
|
|
32
|
+
x.current = void 0;
|
|
33
|
+
}, T = (e, t, n) => {
|
|
33
34
|
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
34
35
|
e.preventDefault();
|
|
35
|
-
let
|
|
36
|
-
|
|
36
|
+
let r = o(g) * (e.key === "ArrowLeft" ? -1 : 1);
|
|
37
|
+
y(t.id, n === "move" ? a(t.event, r, g) : s(t.event, n, r, g));
|
|
37
38
|
};
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ t("div", {
|
|
39
40
|
class: "rv-timeline-editor__track rv-timeline-control__track",
|
|
40
41
|
role: "group",
|
|
41
|
-
"aria-label":
|
|
42
|
+
"aria-label": b.preview,
|
|
42
43
|
children: [
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ t("span", {
|
|
44
45
|
class: "rv-timeline-editor__range rv-timeline-editor__range--start rv-timeline-control__range rv-timeline-control__range--start",
|
|
45
|
-
children:
|
|
46
|
+
children: g.start
|
|
46
47
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ t("span", {
|
|
48
49
|
class: "rv-timeline-editor__range rv-timeline-editor__range--end rv-timeline-control__range rv-timeline-control__range--end",
|
|
49
|
-
children:
|
|
50
|
+
children: g.end
|
|
50
51
|
}),
|
|
51
|
-
|
|
52
|
+
r.map((e, t) => ({
|
|
52
53
|
row: e,
|
|
53
54
|
index: t
|
|
54
|
-
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row:
|
|
55
|
-
let
|
|
56
|
-
return /* @__PURE__ */
|
|
55
|
+
})).filter(({ row: e }) => Number.isFinite(e.event.start) && Number.isFinite(e.event.end) && e.event.end >= e.event.start).map(({ row: e, index: r }) => {
|
|
56
|
+
let a = l(e.event, g), o = i(e.event, g), s = e.event.label || b.moveEvent(r + 1);
|
|
57
|
+
return /* @__PURE__ */ t(f, {
|
|
58
|
+
tooltipText: d ? m?.(e.event) ?? `${s}: ${p(e.event.start)} – ${p(e.event.end)}` : void 0,
|
|
57
59
|
class: [
|
|
58
60
|
"rv-timeline-editor__bar rv-timeline-control__bar",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
h === e.id ? "rv-timeline-editor__bar--selected rv-timeline-control__bar--selected" : "",
|
|
62
|
+
e.event.start === e.event.end ? "rv-timeline-editor__bar--milestone rv-timeline-control__bar--milestone" : "",
|
|
61
63
|
o ? "rv-timeline-editor__bar--outside rv-timeline-control__bar--outside" : ""
|
|
62
64
|
].filter(Boolean).join(" "),
|
|
63
65
|
style: {
|
|
64
|
-
left: `${
|
|
65
|
-
width: `${
|
|
66
|
+
left: `${a.left}%`,
|
|
67
|
+
width: `${a.width}%`,
|
|
68
|
+
background: c(e.event),
|
|
69
|
+
color: e.event.textColor,
|
|
70
|
+
"--timeline-event-color": e.event.color,
|
|
71
|
+
"--timeline-event-color-end": e.event.color
|
|
66
72
|
},
|
|
67
73
|
role: "group",
|
|
68
|
-
"aria-label":
|
|
74
|
+
"aria-label": s,
|
|
69
75
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ t(n, {
|
|
71
77
|
unstyled: !0,
|
|
72
78
|
type: "button",
|
|
73
79
|
class: "rv-timeline-editor__bar-move rv-timeline-control__bar-move",
|
|
74
80
|
"data-autofocus": r === 0 ? "" : void 0,
|
|
75
|
-
"aria-label":
|
|
81
|
+
"aria-label": e.event.label ? `${b.moveEvent(r + 1)}: ${e.event.label}` : b.moveEvent(r + 1),
|
|
76
82
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
77
|
-
onFocus: () =>
|
|
78
|
-
onPointerDown: (
|
|
79
|
-
onPointerMove:
|
|
80
|
-
onPointerUp:
|
|
81
|
-
onPointerCancel:
|
|
82
|
-
onKeyDown: (
|
|
83
|
-
children: /* @__PURE__ */
|
|
83
|
+
onFocus: () => v(e.id),
|
|
84
|
+
onPointerDown: (t) => S(t, e, "move"),
|
|
85
|
+
onPointerMove: C,
|
|
86
|
+
onPointerUp: w,
|
|
87
|
+
onPointerCancel: w,
|
|
88
|
+
onKeyDown: (t) => T(t, e, "move"),
|
|
89
|
+
children: /* @__PURE__ */ t("span", {
|
|
84
90
|
class: "rv-timeline-editor__bar-label rv-timeline-control__bar-label",
|
|
85
|
-
children:
|
|
91
|
+
children: e.event.label
|
|
86
92
|
})
|
|
87
93
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ t(n, {
|
|
89
95
|
unstyled: !0,
|
|
90
96
|
type: "button",
|
|
91
97
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--start rv-timeline-control__handle rv-timeline-control__handle--start",
|
|
92
98
|
role: "slider",
|
|
93
99
|
"aria-orientation": "horizontal",
|
|
94
|
-
"aria-label":
|
|
95
|
-
"aria-valuemin": Math.min(
|
|
96
|
-
"aria-valuemax":
|
|
97
|
-
"aria-valuenow":
|
|
100
|
+
"aria-label": b.resizeStart(s),
|
|
101
|
+
"aria-valuemin": Math.min(g.start, e.event.start),
|
|
102
|
+
"aria-valuemax": e.event.end,
|
|
103
|
+
"aria-valuenow": e.event.start,
|
|
98
104
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
99
|
-
onFocus: () =>
|
|
100
|
-
onPointerDown: (
|
|
101
|
-
|
|
105
|
+
onFocus: () => v(e.id),
|
|
106
|
+
onPointerDown: (t) => {
|
|
107
|
+
t.stopPropagation(), S(t, e, "start");
|
|
102
108
|
},
|
|
103
|
-
onPointerMove:
|
|
104
|
-
onPointerUp:
|
|
105
|
-
onPointerCancel:
|
|
106
|
-
onKeyDown: (
|
|
107
|
-
|
|
109
|
+
onPointerMove: C,
|
|
110
|
+
onPointerUp: w,
|
|
111
|
+
onPointerCancel: w,
|
|
112
|
+
onKeyDown: (t) => {
|
|
113
|
+
t.stopPropagation(), T(t, e, "start");
|
|
108
114
|
}
|
|
109
115
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ t(n, {
|
|
111
117
|
unstyled: !0,
|
|
112
118
|
type: "button",
|
|
113
119
|
class: "rv-timeline-editor__handle rv-timeline-editor__handle--end rv-timeline-control__handle rv-timeline-control__handle--end",
|
|
114
120
|
role: "slider",
|
|
115
121
|
"aria-orientation": "horizontal",
|
|
116
|
-
"aria-label":
|
|
117
|
-
"aria-valuemin":
|
|
118
|
-
"aria-valuemax": Math.max(
|
|
119
|
-
"aria-valuenow":
|
|
122
|
+
"aria-label": b.resizeEnd(s),
|
|
123
|
+
"aria-valuemin": e.event.start,
|
|
124
|
+
"aria-valuemax": Math.max(g.end, e.event.end),
|
|
125
|
+
"aria-valuenow": e.event.end,
|
|
120
126
|
"aria-keyshortcuts": "ArrowLeft ArrowRight",
|
|
121
|
-
onFocus: () =>
|
|
122
|
-
onPointerDown: (
|
|
123
|
-
|
|
127
|
+
onFocus: () => v(e.id),
|
|
128
|
+
onPointerDown: (t) => {
|
|
129
|
+
t.stopPropagation(), S(t, e, "end");
|
|
124
130
|
},
|
|
125
|
-
onPointerMove:
|
|
126
|
-
onPointerUp:
|
|
127
|
-
onPointerCancel:
|
|
128
|
-
onKeyDown: (
|
|
129
|
-
|
|
131
|
+
onPointerMove: C,
|
|
132
|
+
onPointerUp: w,
|
|
133
|
+
onPointerCancel: w,
|
|
134
|
+
onKeyDown: (t) => {
|
|
135
|
+
t.stopPropagation(), T(t, e, "end");
|
|
130
136
|
}
|
|
131
137
|
})
|
|
132
138
|
]
|
|
133
|
-
},
|
|
139
|
+
}, e.id);
|
|
134
140
|
})
|
|
135
141
|
]
|
|
136
142
|
});
|
|
137
143
|
}
|
|
144
|
+
function f({ tooltipText: e, children: n, ...i }) {
|
|
145
|
+
let a = r(e ?? "", !0, {
|
|
146
|
+
className: "rv-control-tooltip",
|
|
147
|
+
placement: "above"
|
|
148
|
+
});
|
|
149
|
+
return /* @__PURE__ */ t("div", {
|
|
150
|
+
...i,
|
|
151
|
+
...e ? a.triggerProps : {},
|
|
152
|
+
children: [n, e && a.tooltip]
|
|
153
|
+
});
|
|
154
|
+
}
|
|
138
155
|
//#endregion
|
|
139
|
-
export {
|
|
156
|
+
export { d as TimelineTrack, i as eventOutsideRange, a as moveTimelineEvent, o as niceTimelineStep, s as resizeTimelineEvent, c as timelineEventBackground, l as timelineGeometry };
|
|
@@ -2,6 +2,13 @@ export interface TimelineTrackEvent {
|
|
|
2
2
|
readonly start: number;
|
|
3
3
|
readonly end: number;
|
|
4
4
|
readonly label?: string;
|
|
5
|
+
/** Single CSS color, or weighted phases within this event. */
|
|
6
|
+
readonly color?: string;
|
|
7
|
+
readonly textColor?: string;
|
|
8
|
+
readonly segments?: readonly {
|
|
9
|
+
readonly color: string;
|
|
10
|
+
readonly weight: number;
|
|
11
|
+
}[];
|
|
5
12
|
}
|
|
6
13
|
export interface TimelineTrackRange {
|
|
7
14
|
readonly start: number;
|
|
@@ -15,3 +22,5 @@ export declare function timelineGeometry(event: TimelineTrackEvent, range: Timel
|
|
|
15
22
|
export declare function niceTimelineStep(range: TimelineTrackRange): number;
|
|
16
23
|
export declare function moveTimelineEvent<T extends TimelineTrackEvent>(event: T, delta: number, range: TimelineTrackRange): T;
|
|
17
24
|
export declare function resizeTimelineEvent<T extends TimelineTrackEvent>(event: T, edge: 'start' | 'end', delta: number, range: TimelineTrackRange): T;
|
|
25
|
+
/** Weighted phase colors use hard stops and scale with the event on resize. */
|
|
26
|
+
export declare function timelineEventBackground(event: TimelineTrackEvent): string | undefined;
|
package/timeline-track/model.js
CHANGED
|
@@ -34,5 +34,14 @@ function i(e, t, n, r) {
|
|
|
34
34
|
end: Math.min(r.end, Math.max(e.start, e.end + n))
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
+
function a(e) {
|
|
38
|
+
let t = e.segments?.filter((e) => Number.isFinite(e.weight) && e.weight > 0);
|
|
39
|
+
if (!t?.length) return e.color;
|
|
40
|
+
let n = t.reduce((e, t) => e + t.weight, 0), r = 0;
|
|
41
|
+
return `linear-gradient(to right, ${t.map((e) => {
|
|
42
|
+
let t = r / n * 100;
|
|
43
|
+
return r += e.weight, `${e.color} ${t}% ${r / n * 100}%`;
|
|
44
|
+
}).join(", ")})`;
|
|
45
|
+
}
|
|
37
46
|
//#endregion
|
|
38
|
-
export { e as eventOutsideRange, r as moveTimelineEvent, n as niceTimelineStep, i as resizeTimelineEvent, t as timelineGeometry };
|
|
47
|
+
export { e as eventOutsideRange, r as moveTimelineEvent, n as niceTimelineStep, i as resizeTimelineEvent, a as timelineEventBackground, t as timelineGeometry };
|