@revolist/ui 4.0.4-rc → 4.0.4
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/MIGRATION.md +36 -0
- package/OWNERSHIP.md +36 -36
- package/README.md +65 -392
- package/_button.scss +6 -2
- package/_chunks/arrow-up-Cw8hW9vp.js +4 -0
- package/_chunks/calculator-CDWOuAcp.js +4 -0
- package/_chunks/{calendar-xpZ0v3xf.js → calendar-BQYQLu8Q.js} +23 -23
- package/_chunks/{cell-visuals-E-2oEKHg.js → cell-visuals-r6DOOhGh.js} +7 -7
- package/_chunks/chart-frame-GprenwEg.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-C5OxD0GV.js +126 -0
- package/_chunks/{color-palette-D8vyPfld.js → color-palette-7siNch__.js} +22 -24
- package/_chunks/color-picker-Cfc9eqZb.js +143 -0
- package/_chunks/{component-C_T2VN5u.js → component-C3k_8uIq.js} +290 -275
- package/_chunks/{component-metadata-BMOOmqx5.js → component-metadata-DlVkpW3h.js} +1 -9
- package/_chunks/configurator-actions-vRnI54mO.js +155 -0
- package/_chunks/configurator-field-icon-CmcM_sPs.js +53 -0
- package/_chunks/control-BRfF5DWQ.js +118 -0
- package/_chunks/{controller-hRBm_Lfz.js → controller-BbiQuRt-.js} +5 -5
- package/_chunks/controls-B3EgM_DS.js +650 -0
- package/_chunks/{date-control-DrVFX13g.js → date-control-87dcA5br.js} +5 -5
- package/_chunks/{date-time-qIhp5vaX.js → date-time-CfiFYodx.js} +332 -293
- package/_chunks/{delete-button-CW9vjLnk.js → delete-button-jneO24wa.js} +1 -1
- package/_chunks/dialog.parts-NqEEVc9P.js +131 -0
- package/_chunks/{duration-CL68Em0o.js → duration-BGZ_qJ99.js} +10 -10
- package/_chunks/{editor-commit-Bq3wSgvr.js → editor-commit-Dyo-FMgD.js} +1 -1
- package/_chunks/editor-popup-NNP9Fh9U.js +82 -0
- package/_chunks/field-configurator-DPulsY3l.js +288 -0
- package/_chunks/{field-context-D57PnBbH.js → field-context-C4_WrO2z.js} +1 -1
- package/_chunks/{framework-mount--RTLIqE-.js → framework-mount-D4I8HpVp.js} +2 -2
- package/_chunks/icon-toolbar-BAAdEvr9.js +134 -0
- package/_chunks/{icons-Ci5mADVc.js → icons-B4qN13Yj.js} +1 -1
- package/_chunks/{iso-B0YHBK7m.js → iso-CJQl2kmq.js} +1 -1
- package/_chunks/magnifying-glass-CvrTDSkB.js +4 -0
- package/_chunks/minus-BOAR3A1C.js +4 -0
- package/_chunks/{model-mPO2tG2f.js → model-CFrBgRHm.js} +3 -3
- package/_chunks/mount-C8CnIW9k.js +267 -0
- package/_chunks/{native.view-ByyZ1CT5.js → native-CJm3eq3-.js} +1 -1
- package/_chunks/native-control-um1L1wgZ.js +649 -0
- package/_chunks/{number-input-BKwA5FnM.js → number-input-CKiA4d1N.js} +9 -9
- package/_chunks/{picker-h1P5RUgp.js → picker-igNshTRC.js} +5 -5
- package/_chunks/plus-CbGRkIGl.js +4 -0
- package/_chunks/{popup-CT2uD3go.js → popup-DECYM9FI.js} +116 -105
- package/_chunks/{rating-choice-DZgmaic0.js → rating-choice-CepVfGUq.js} +2 -2
- package/_chunks/{render-m5eMMwFR.js → render-bTk3curw.js} +2 -2
- package/_chunks/{reorder-list-CSlqAGHw.js → reorder-list-B4w3aARt.js} +2 -2
- package/_chunks/request-trail-B1zVRPEf.js +762 -0
- package/_chunks/rich-text-Ci4d6dHn.js +842 -0
- package/_chunks/rotate-left-BF6G883o.js +4 -0
- package/_chunks/selection-list-tooltips-m00U3L6z.js +42 -0
- package/_chunks/title-tooltip-ncldbUwS.js +11 -0
- package/_chunks/tooltip-h-Z8yFBY.js +54 -0
- package/_chunks/tooltip-owner-BYho-vJl.js +19 -0
- package/_chunks/tooltip-session-CBtRMBPr.js +110 -0
- package/_chunks/tooltip-text-BN5WdGHn.js +12 -0
- package/_chunks/top-layer-popup-CKJ7VJOF.js +59 -0
- package/_dialog.scss +57 -22
- package/_form.scss +71 -21
- package/_legend.scss +25 -7
- package/_variables.scss +34 -32
- package/_view-switcher.scss +6 -0
- package/activity-message.d.ts +1 -1
- package/activity-message.js +1 -1
- package/ai/_chat.scss +35 -3
- package/ai/_style.scss +76 -16
- package/ai/chat.d.ts +3 -1
- package/ai/components.d.ts +16 -3
- package/ai/index.d.ts +1 -0
- package/ai/index.js +3 -3
- package/ai/mount.d.ts +30 -6
- 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 +2 -0
- package/ai/translations.d.ts +1 -1
- package/angular/angular.d.ts +1 -1
- package/angular/angular.js +13 -7
- package/assignee/assignee.scss +28 -6
- package/assignee/index.js +6 -6
- package/avatar/avatar.style.scss +23 -6
- package/avatar/index.d.ts +25 -2
- package/avatar/index.js +33 -32
- package/badge.d.ts +1 -1
- package/badge.js +1 -1
- package/badge.view.d.ts +8 -0
- package/brush-range/_brush-range.scss +55 -49
- package/brush-range/component.d.ts +1 -3
- package/brush-range/component.js +28 -28
- package/buttons/delete-button.js +1 -1
- package/buttons/delete-button.style.scss +6 -2
- package/buttons/remove-button.d.ts +1 -1
- package/buttons/remove-button.js +2 -2
- package/buttons/remove-button.style.scss +1 -1
- package/buttons/svg-button.d.ts +1 -1
- package/buttons/svg-button.js +17 -17
- package/calendar/_calendar.scss +21 -25
- package/calendar/calendar.js +1 -1
- package/calendar/day.js +2 -2
- package/calendar/header.js +2 -3
- package/calendar/index.js +3 -3
- package/calendar/model.js +1 -1
- package/calendar/month-grid.js +2 -2
- package/calendar/translations.js +1 -1
- package/calendar/year-grid.js +2 -2
- package/cell-input.js +1 -1
- 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/column-type.style.css +12 -0
- package/cell-visuals/index.js +1 -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.js +1 -1
- package/choice-chips/index.d.ts +3 -1
- package/choice-chips/index.js +1 -1
- package/color-palette/built-in-palettes.js +1 -1
- package/color-palette/chart-palettes.js +1 -1
- package/color-palette/color-palette.js +1 -1
- package/color-palette/color-palette.style.scss +88 -25
- package/color-palette/color-picker.constants.js +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 +2 -2
- package/color-palette/gantt-palettes.js +1 -1
- package/color-palette/native.d.ts +15 -2
- package/color-palette/palette.js +1 -1
- package/color-palette/pivot-palettes.js +1 -1
- package/color-palette/platform-palettes.js +1 -1
- package/color-palette/pro-palettes.js +1 -1
- package/color-palette/scheduler-palettes.js +1 -1
- package/component-catalog.d.ts +9 -7
- 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 +1 -1
- package/control-presentation.d.ts +8 -2
- package/control-presentation.js +25 -20
- package/controls.d.ts +12 -2
- package/controls.js +4 -3
- package/core/anchored-popover.js +1 -1
- package/core/control-id.js +1 -1
- package/core/editor-popup-position.d.ts +6 -2
- package/core/editor-popup.d.ts +4 -0
- package/core/editor-popup.js +1 -1
- package/core/motion.js +1 -1
- package/core/popover-controller.d.ts +35 -0
- package/core/popover-controller.js +102 -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 +1 -1
- package/date-time/field.d.ts +4 -2
- package/date-time/index.js +1 -1
- package/date-time/style.scss +239 -36
- package/date-time/time-selection.d.ts +3 -1
- package/date-time/types.d.ts +5 -1
- package/dialog/dialog-action-footer.d.ts +17 -2
- package/dialog/dialog.dom.d.ts +15 -2
- package/dialog/dialog.dom.js +9 -9
- package/dialog/dialog.drag.js +1 -1
- package/dialog/dialog.parts.d.ts +1 -1
- package/dialog/dialog.parts.js +1 -1
- package/dialog/dialog.preact.js +1 -1
- package/distribution-chart/_distribution-chart.scss +113 -77
- package/distribution-chart/area-chart.js +2 -2
- package/distribution-chart/bar-chart.js +2 -2
- package/distribution-chart/chart-frame.d.ts +1 -1
- package/distribution-chart/index.d.ts +1 -1
- package/distribution-chart/index.js +1 -1
- package/distribution-chart/line-chart.js +2 -2
- package/dropdown/content.js +1 -1
- package/dropdown/control.js +1 -1
- package/dropdown/dropdown.service.js +1 -1
- package/dropdown/dropdown.types.d.ts +1 -1
- package/dropdown/editor-dropdown.style.scss +19 -9
- package/dropdown/index.js +2 -2
- package/dropdown/lookup-field.d.ts +5 -0
- package/dropdown/lookup-field.js +4 -3
- package/dropdown/popup.d.ts +2 -2
- package/dropdown/popup.js +1 -1
- package/duration/index.js +1 -1
- package/editor-actions.js +2 -2
- package/editor-layout/index.d.ts +4 -4
- package/editor-layout/index.js +40 -35
- package/editor-layout/style.scss +82 -18
- package/favicon.svg +9 -0
- package/field-configurator.d.ts +39 -1
- package/field-configurator.js +4 -170
- package/field-expansion.d.ts +9 -0
- package/field-reorder.hook.js +1 -1
- package/field-reorder.js +1 -1
- package/filter/filters/slider/_single-slider.scss +57 -38
- package/filter/filters/slider/_slider.scss +41 -33
- package/filter/filters/slider/component.js +1 -1
- package/filter/filters/slider/control.js +3 -1
- package/filter/filters/slider/inputs.js +1 -1
- package/filter/filters/slider/logic.js +1 -1
- package/filter/filters/slider/preact.js +1 -1
- package/filter/filters/slider/runtime.js +50 -23
- package/filter/filters/slider/single.js +2 -2
- package/filter-badge.js +2 -2
- package/filter-controls.d.ts +0 -1
- package/filter-controls.js +6 -7
- package/form-controls/index.d.ts +10 -2
- package/form-controls/index.js +7 -7
- package/form-controls/presentation.d.ts +1 -1
- package/form-controls/presentation.js +13 -13
- package/formatting/index.d.ts +1 -1
- package/formatting/index.js +26 -25
- package/formatting/styles.scss +14 -57
- package/framework.js +228 -225
- package/history-controls.js +27 -1
- package/html-controls.js +1 -1
- package/icon-toolbar.d.ts +62 -0
- package/icon-toolbar.js +1 -0
- package/icons/icon.d.ts +1 -1
- package/icons/icon.js +1 -1
- package/legend.d.ts +1 -1
- package/legend.js +1 -1
- package/masked-input/index.js +4 -4
- package/native-control.d.ts +1 -2
- package/native-control.js +1 -1
- 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 +48 -45
- package/number-input/index.d.ts +1 -1
- package/number-input/index.js +1 -1
- package/package.json +84 -1
- package/pagination.js +12 -12
- package/pdf-viewer/controller.js +1 -1
- package/pdf-viewer/header.d.ts +1 -1
- package/pdf-viewer/index.d.ts +2 -2
- package/pdf-viewer/index.js +3 -3
- package/pdf-viewer/search-bar.d.ts +1 -1
- package/pdf-viewer/status.d.ts +1 -1
- package/pdf-viewer/style.scss +203 -42
- package/pickers.d.ts +5 -1
- package/preact-mount.js +1 -1
- package/preact.d.ts +13 -10
- package/preact.js +109 -64
- package/progress/_bar.scss +9 -3
- package/progress/_circular.scss +2 -1
- package/progress/bar.js +1 -1
- package/progress/circular.js +1 -1
- package/progress/range.js +1 -1
- package/rating-choice.js +1 -1
- package/react-adapter.d.ts +4 -2
- package/react-control.d.ts +2 -0
- package/react-control.js +3 -3
- package/react.d.ts +7 -8
- package/react.js +69 -68
- package/reorder-list.d.ts +1 -1
- package/reorder-list.js +1 -1
- package/reorder-list.scss +59 -17
- package/resource-picker/resource-picker-avatar.js +1 -1
- package/resource-picker/resource-picker-option.js +1 -1
- package/resource-picker/resource-picker-popup.js +2 -2
- package/resource-picker/resource-picker.js +75 -73
- package/resource-picker/resource-picker.scss +62 -34
- package/resource-picker/resource-picker.utils.js +1 -1
- package/rich-text/engine.d.ts +1 -0
- package/rich-text/format-html.d.ts +2 -0
- package/rich-text/index.d.ts +4 -0
- package/rich-text/index.js +1 -1
- package/rich-text/model.d.ts +2 -0
- package/rich-text/style.scss +293 -44
- package/rich-text/syntax.d.ts +5 -0
- package/rich-text/toolbar.d.ts +1 -1
- package/rich-text/translations.d.ts +2 -0
- package/robots.txt +4 -0
- package/search-input/index.js +2 -2
- package/search-input/native.d.ts +21 -2
- package/segmented-switch/index.js +1 -1
- package/select.d.ts +3 -1
- package/select.js +1 -1
- package/selection-list.d.ts +1 -0
- package/selection-list.js +3 -1
- package/status-feedback/badge.js +2 -2
- package/status-feedback/exit-snapshot.js +5 -5
- package/status-feedback/header.js +2 -2
- package/status-feedback/icons.js +1 -1
- package/status-feedback/index.js +1 -1
- package/status-feedback/item.js +2 -2
- package/status-feedback/motion.js +1 -1
- package/status-feedback/placement.js +1 -1
- package/status-feedback/popover.js +5 -5
- package/status-feedback/render.js +1 -1
- package/status-feedback/status-feedback.scss +124 -35
- 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 +400 -80
- package/styles/_control.scss +30 -8
- 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 +369 -110
- 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/color-roles.js +1 -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.svelte +44 -11
- package/svelte-control.js +1 -1
- package/svelte.d.ts +1 -1
- package/svelte.js +5 -5
- package/switch/index.js +16 -15
- package/time-grid.d.ts +0 -1
- package/time-grid.js +39 -38
- package/timeline-track/_style.scss +96 -24
- package/timeline-track/index.js +3 -3
- package/timeline-track/model.js +1 -1
- package/ui.css +1 -1
- package/view-switcher.d.ts +23 -0
- package/vue-badge.js +1 -1
- package/vue-control.js +1 -1
- package/vue-segmented-switch.js +1 -1
- package/vue.d.ts +29 -32
- package/vue.js +118 -123
- package/_chunks/chart-frame-Cmc7xU1i.js +0 -130
- package/_chunks/choice-chips-CHQTUdLs.js +0 -110
- package/_chunks/color-picker-CudqPYZo.js +0 -138
- package/_chunks/control-AHKXD5Eu.js +0 -93
- package/_chunks/control-tooltip-uscKfAnV.js +0 -100
- package/_chunks/controls-DsNi8V8I.js +0 -630
- package/_chunks/dialog.parts-CKGkC5zP.js +0 -134
- package/_chunks/editor-popup-WDdtVDNA.js +0 -81
- package/_chunks/history-controls-B3u3INEK.js +0 -27
- package/_chunks/mount-DQ1cpppK.js +0 -257
- package/_chunks/native-control-C_yok8_-.js +0 -605
- package/_chunks/request-trail-DSlFix6i.js +0 -618
- package/_chunks/rich-text-CH7gIqOS.js +0 -636
- package/_shared/data-query/binding.d.ts +0 -30
- package/_shared/data-query/blocks.d.ts +0 -30
- package/_shared/data-query/commands.d.ts +0 -47
- package/_shared/data-query/contracts.d.ts +0 -106
- package/_shared/data-query/cursor-reader.d.ts +0 -25
- package/_shared/data-query/direct-binding.d.ts +0 -3
- package/_shared/data-query/index.d.ts +0 -23
- package/_shared/data-query/infinite-binding.d.ts +0 -18
- package/_shared/data-query/keys.d.ts +0 -9
- package/_shared/data-query/limiter.d.ts +0 -12
- package/_shared/data-query/load-options.d.ts +0 -25
- package/_shared/data-query/materialize.d.ts +0 -2
- package/_shared/data-query/policy.d.ts +0 -14
- package/_shared/data-query/provider-queries.d.ts +0 -22
- package/_shared/data-query/reader.d.ts +0 -23
- package/_shared/data-query/remote-load.d.ts +0 -7
- package/_shared/data-query/source.d.ts +0 -40
- 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 -10
- package/formatting/control-tooltip.d.ts +0 -27
- package/native-controls.view.d.ts +0 -54
- package/search-input/native.view.d.ts +0 -21
- package/styles/legacy-pagination.css +0 -112
- package/surfaces.view.d.ts +0 -63
package/styles.scss
CHANGED
|
@@ -21,12 +21,9 @@
|
|
|
21
21
|
@use './styles/editor-slider';
|
|
22
22
|
@use './styles/editor-counter';
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
24
|
@use './progress/circular';
|
|
27
|
-
@use './styles/
|
|
28
|
-
@use './styles/
|
|
29
|
-
|
|
25
|
+
@use './styles/rating.css';
|
|
26
|
+
@use './styles/pagination.css';
|
|
30
27
|
|
|
31
28
|
@use './distribution-chart/distribution-chart';
|
|
32
29
|
@use './brush-range/brush-range';
|
|
@@ -40,6 +37,7 @@
|
|
|
40
37
|
@use './styles/activity-message';
|
|
41
38
|
@use './styles/motion';
|
|
42
39
|
|
|
40
|
+
@use './view-switcher';
|
|
43
41
|
|
|
44
42
|
@include slider.styles;
|
|
45
43
|
|
package/surfaces.d.ts
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import { DialogHandle, DialogOpenOptions } from './dialog/dialog.types';
|
|
2
|
+
export interface DialogEnvironment {
|
|
3
|
+
beforeMount?: (root: HTMLElement) => void;
|
|
4
|
+
onOpen?: (options: DialogOpenOptions) => void;
|
|
5
|
+
restoreFocus?: (explicit?: HTMLElement, previous?: HTMLElement) => void;
|
|
6
|
+
}
|
|
7
|
+
/** Standalone modal lifecycle. Integration hooks belong to the host application. */
|
|
8
|
+
export declare class DialogController {
|
|
9
|
+
private readonly document;
|
|
10
|
+
private readonly environment;
|
|
11
|
+
private active?;
|
|
12
|
+
constructor(document: Document, environment?: DialogEnvironment);
|
|
13
|
+
get isOpen(): boolean;
|
|
14
|
+
open(options: DialogOpenOptions): DialogHandle;
|
|
15
|
+
close(root?: HTMLElement): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
18
|
+
export { PopoverController, TooltipController, createTooltipElement, type PopoverOptions, } from './core/popover-controller';
|
|
19
|
+
/** Keyboard behavior for menu surfaces; activation stays on native buttons. */
|
|
20
|
+
export declare function attachMenuKeyboard(menu: HTMLElement, onClose?: () => void, options?: {
|
|
21
|
+
closeOnEscape?: boolean;
|
|
22
|
+
}): () => void;
|
|
23
|
+
export interface ResizeOptions {
|
|
24
|
+
value: number;
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
step?: number;
|
|
28
|
+
label: string;
|
|
29
|
+
/** Rejects a proposed width without changing the handle's current value. */
|
|
30
|
+
acceptValue?: (value: number) => boolean;
|
|
31
|
+
onChange: (value: number) => void;
|
|
32
|
+
direction?: 'ltr' | 'rtl';
|
|
33
|
+
}
|
|
34
|
+
/** Width resize controller. An options reader keeps controlled updates from interrupting a drag. */
|
|
35
|
+
export declare function attachResizeHandle(handle: HTMLElement, options: ResizeOptions | (() => ResizeOptions)): () => void;
|
|
36
|
+
export { useTooltip, ControlTooltip } from './core/tooltip';
|
|
37
|
+
export { prepareTooltipSurface, ensureTooltipStyles, } from './core/tooltip-surface';
|
|
38
|
+
export { TooltipText } from './core/tooltip-text';
|
package/surfaces.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./_chunks/
|
|
3
|
-
import { inheritUiMotion as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
//#region
|
|
10
|
-
var
|
|
1
|
+
import { releasePreactElement as e } from "./preact-mount.js";
|
|
2
|
+
import { c as t, s as n } from "./_chunks/top-layer-popup-CKJ7VJOF.js";
|
|
3
|
+
import { inheritUiMotion as r } from "./core/motion.js";
|
|
4
|
+
import { PopoverController as i, TooltipController as a, createTooltipElement as o } from "./core/popover-controller.js";
|
|
5
|
+
import { r as s, t as c } from "./_chunks/tooltip-h-Z8yFBY.js";
|
|
6
|
+
import { createDialogElements as l, getDialogFocusableElements as u, trapDialogFocus as d } from "./dialog/dialog.dom.js";
|
|
7
|
+
import { attachDialogDrag as f } from "./dialog/dialog.drag.js";
|
|
8
|
+
import { t as p } from "./_chunks/tooltip-text-BN5WdGHn.js";
|
|
9
|
+
//#region package/surfaces.tsx
|
|
10
|
+
var m = /* @__PURE__ */ new WeakMap(), h = class {
|
|
11
11
|
document;
|
|
12
12
|
environment;
|
|
13
13
|
active;
|
|
@@ -17,33 +17,33 @@ var f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = cl
|
|
|
17
17
|
get isOpen() {
|
|
18
18
|
return !!this.active;
|
|
19
19
|
}
|
|
20
|
-
open(
|
|
20
|
+
open(t) {
|
|
21
21
|
this.close();
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
22
|
+
let n = this.document, i = n.activeElement, a = !1, o, s, c = m.get(n) ?? [];
|
|
23
|
+
m.set(n, c);
|
|
24
|
+
let p = () => {
|
|
25
|
+
if (a) return;
|
|
26
|
+
a = !0, o?.(), s?.(), e(h.root);
|
|
27
|
+
let n = c.indexOf(h.root), r = n === c.length - 1;
|
|
28
|
+
n !== -1 && c.splice(n, 1), this.active?.root === h.root && (this.active = void 0);
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
t.onClose?.();
|
|
31
31
|
} finally {
|
|
32
|
-
|
|
32
|
+
r && (this.environment.restoreFocus ? this.environment.restoreFocus(t.returnFocus, i ?? void 0) : [t.returnFocus, i].find((e) => e?.isConnected)?.focus?.({ preventScroll: !0 }));
|
|
33
33
|
}
|
|
34
|
-
}, h =
|
|
34
|
+
}, h = l(n, t, p), g = {
|
|
35
35
|
...h,
|
|
36
|
-
close:
|
|
36
|
+
close: p
|
|
37
37
|
};
|
|
38
|
-
return this.environment.beforeMount?.(h.root), s =
|
|
39
|
-
e.target === h.root &&
|
|
38
|
+
return this.environment.beforeMount?.(h.root), s = r(t.returnFocus ?? i, h.root), h.root.addEventListener("mousedown", (e) => {
|
|
39
|
+
e.target === h.root && c.at(-1) === h.root && p();
|
|
40
40
|
}), h.root.addEventListener("keydown", (e) => {
|
|
41
|
-
|
|
42
|
-
}),
|
|
41
|
+
c.at(-1) === h.root && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), p()) : e.key === "Tab" && d(h.root, e));
|
|
42
|
+
}), n.body.append(h.root), c.push(h.root), t.draggable !== !1 && (o = f({
|
|
43
43
|
target: h.surface,
|
|
44
44
|
handle: h.header
|
|
45
|
-
})), this.active = g, this.environment.onOpen?.(
|
|
46
|
-
!
|
|
45
|
+
})), this.active = g, this.environment.onOpen?.(t), queueMicrotask(() => {
|
|
46
|
+
!a && c.at(-1) === h.root && (u(h.root)[0] ?? h.root).focus({ preventScroll: !0 });
|
|
47
47
|
}), g;
|
|
48
48
|
}
|
|
49
49
|
close(e) {
|
|
@@ -52,123 +52,26 @@ var f = /* @__PURE__ */ new WeakMap(), p = /* @__PURE__ */ new WeakMap(), m = cl
|
|
|
52
52
|
destroy() {
|
|
53
53
|
this.close();
|
|
54
54
|
}
|
|
55
|
-
}, h = class {
|
|
56
|
-
active;
|
|
57
|
-
get isOpen() {
|
|
58
|
-
return !!this.active;
|
|
59
|
-
}
|
|
60
|
-
open(t) {
|
|
61
|
-
this.close(!1);
|
|
62
|
-
let { anchor: a, content: o } = t, s = a.ownerDocument, c = s.defaultView, l = f.get(s) ?? [];
|
|
63
|
-
f.set(s, l);
|
|
64
|
-
let u = o.parentNode, d = o.nextSibling, p = o.hidden, m = o.getAttribute("style"), h = o.getAttribute("popover"), g = n(a, o), _ = () => {
|
|
65
|
-
if (!a.isConnected) {
|
|
66
|
-
b(!1);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
let t = e(a.getBoundingClientRect(), o.getBoundingClientRect(), {
|
|
70
|
-
width: s.documentElement.clientWidth || c?.innerWidth || 0,
|
|
71
|
-
height: s.documentElement.clientHeight || c?.innerHeight || 0
|
|
72
|
-
});
|
|
73
|
-
Object.assign(o.style, {
|
|
74
|
-
left: `${t.left}px`,
|
|
75
|
-
top: `${t.top}px`
|
|
76
|
-
});
|
|
77
|
-
}, v, y = !1, b = (e = t.restoreFocus !== !1) => {
|
|
78
|
-
if (y) return;
|
|
79
|
-
y = !0, s.removeEventListener("pointerdown", x, !0), o.removeEventListener("keydown", S), s.removeEventListener("keydown", S), c?.removeEventListener("resize", _), s.removeEventListener("scroll", _, !0), C?.disconnect();
|
|
80
|
-
let n = l.indexOf(o);
|
|
81
|
-
n !== -1 && l.splice(n, 1), r(o, v), g(), u?.isConnected ? u.insertBefore(o, d?.parentNode === u ? d : null) : o.remove(), m === null ? o.removeAttribute("style") : o.setAttribute("style", m), o.hidden = p, h === null ? o.removeAttribute("popover") : o.setAttribute("popover", h), this.active?.content === o && (this.active = void 0), e && a.isConnected && a.focus({ preventScroll: !0 }), t.onClose?.();
|
|
82
|
-
}, x = (e) => {
|
|
83
|
-
if (l.at(-1) !== o) return;
|
|
84
|
-
let n = e.composedPath();
|
|
85
|
-
t.closeOnOutside !== !1 && !n.includes(a) && !n.includes(o) && b(!1);
|
|
86
|
-
}, S = (e) => {
|
|
87
|
-
l.at(-1) === o && e.key === "Escape" && t.closeOnEscape !== !1 && !e.defaultPrevented && (e.preventDefault(), e.stopPropagation(), b());
|
|
88
|
-
};
|
|
89
|
-
(t.appendTo ?? s.body).append(o), o.hidden = !1, Object.assign(o.style, {
|
|
90
|
-
position: "fixed",
|
|
91
|
-
inset: "auto",
|
|
92
|
-
margin: "0"
|
|
93
|
-
}), v = i(o, t.display ?? "block");
|
|
94
|
-
let C = c?.ResizeObserver ? new c.ResizeObserver(_) : void 0;
|
|
95
|
-
return C?.observe(a), C?.observe(o), this.active = {
|
|
96
|
-
content: o,
|
|
97
|
-
close: b,
|
|
98
|
-
position: _
|
|
99
|
-
}, l.push(o), s.addEventListener("pointerdown", x, !0), o.addEventListener("keydown", S), s.addEventListener("keydown", S), c?.addEventListener("resize", _), s.addEventListener("scroll", _, !0), _(), {
|
|
100
|
-
close: b,
|
|
101
|
-
refresh: _
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
refresh() {
|
|
105
|
-
this.active?.position();
|
|
106
|
-
}
|
|
107
|
-
close(e) {
|
|
108
|
-
this.active?.close(e);
|
|
109
|
-
}
|
|
110
|
-
destroy() {
|
|
111
|
-
this.close(!1);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
function g(e, n = "grid-tooltip") {
|
|
115
|
-
return a(e, /* @__PURE__ */ t("div", {
|
|
116
|
-
id: s("rv-tooltip"),
|
|
117
|
-
class: n,
|
|
118
|
-
role: "tooltip",
|
|
119
|
-
hidden: !0
|
|
120
|
-
}));
|
|
121
|
-
}
|
|
122
|
-
var _ = /* @__PURE__ */ new WeakMap(), v = class {
|
|
123
|
-
popover = new h();
|
|
124
|
-
release;
|
|
125
|
-
bind(e, t, n = {}) {
|
|
126
|
-
this.destroy();
|
|
127
|
-
let r = g(e.ownerDocument, "rv-tooltip");
|
|
128
|
-
r.textContent = t;
|
|
129
|
-
let i = () => {
|
|
130
|
-
_.get(e.ownerDocument) === a && _.delete(e.ownerDocument);
|
|
131
|
-
}, a = () => {
|
|
132
|
-
i(), this.popover.close(!1), r.hidden = !0, e.setAttribute("aria-describedby", s ?? ""), s === null && e.removeAttribute("aria-describedby");
|
|
133
|
-
}, s = e.getAttribute("aria-describedby"), c = n.trigger === "click", l = e.getAttribute("aria-expanded");
|
|
134
|
-
c && e.setAttribute("aria-expanded", "false");
|
|
135
|
-
let u = () => {
|
|
136
|
-
this.popover.isOpen || (_.get(e.ownerDocument)?.(), _.set(e.ownerDocument, a), r.hidden = !1, c && e.setAttribute("aria-expanded", "true"), e.setAttribute("aria-describedby", [s, r.id].filter(Boolean).join(" ")), this.popover.open({
|
|
137
|
-
anchor: e,
|
|
138
|
-
content: r,
|
|
139
|
-
restoreFocus: !1,
|
|
140
|
-
onClose: () => {
|
|
141
|
-
i(), r.hidden = !0, c && e.setAttribute("aria-expanded", "false"), s === null ? e.removeAttribute("aria-describedby") : e.setAttribute("aria-describedby", s);
|
|
142
|
-
}
|
|
143
|
-
}));
|
|
144
|
-
}, d = () => this.popover.isOpen ? a() : u();
|
|
145
|
-
return c ? e.addEventListener("click", d) : (e.addEventListener("pointerenter", u), e.addEventListener("pointerleave", a), e.addEventListener("focus", u), e.addEventListener("blur", a)), this.release = () => {
|
|
146
|
-
a(), e.removeEventListener("click", d), c && (l === null ? e.removeAttribute("aria-expanded") : e.setAttribute("aria-expanded", l)), e.removeEventListener("pointerenter", u), e.removeEventListener("pointerleave", a), e.removeEventListener("focus", u), e.removeEventListener("blur", a), o(r);
|
|
147
|
-
}, () => this.destroy();
|
|
148
|
-
}
|
|
149
|
-
destroy() {
|
|
150
|
-
this.release?.(), this.release = void 0, this.popover.destroy();
|
|
151
|
-
}
|
|
152
55
|
};
|
|
153
|
-
function
|
|
154
|
-
let
|
|
155
|
-
let
|
|
56
|
+
function g(e, t = () => {}, n = {}) {
|
|
57
|
+
let r = (r) => {
|
|
58
|
+
let i = Array.from(e.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]")).filter((t) => t.closest("[role=\"menu\"]") === e && t.getAttribute("aria-disabled") !== "true" && !t.hasAttribute("disabled") && !t.hidden), a = i.indexOf(e.ownerDocument.activeElement);
|
|
156
59
|
[
|
|
157
60
|
"ArrowDown",
|
|
158
61
|
"ArrowUp",
|
|
159
62
|
"Home",
|
|
160
63
|
"End"
|
|
161
|
-
].includes(
|
|
64
|
+
].includes(r.key) && i.length ? (r.preventDefault(), r.stopPropagation(), i[r.key === "Home" ? 0 : r.key === "End" ? i.length - 1 : (a + (r.key === "ArrowUp" ? -1 : 1) + i.length) % i.length]?.focus()) : r.key === "Escape" && n.closeOnEscape !== !1 && (r.preventDefault(), r.stopPropagation(), t());
|
|
162
65
|
};
|
|
163
|
-
return e.addEventListener("keydown",
|
|
66
|
+
return e.addEventListener("keydown", r), () => e.removeEventListener("keydown", r);
|
|
164
67
|
}
|
|
165
|
-
function
|
|
68
|
+
function _(e, t) {
|
|
166
69
|
let n = typeof t == "function" ? t : () => t, r = n().value, i = r, a = () => {
|
|
167
70
|
let e = n();
|
|
168
71
|
return e.value !== i && (i = e.value, r = e.value), e;
|
|
169
72
|
}, o = () => {}, s = (t) => {
|
|
170
|
-
let n = a();
|
|
171
|
-
|
|
73
|
+
let n = a(), i = Math.min(n.max ?? Infinity, Math.max(n.min ?? 0, t));
|
|
74
|
+
n.acceptValue?.(i) !== !1 && (r = i, e.setAttribute("aria-valuenow", String(r)), n.onChange(r));
|
|
172
75
|
}, c = n();
|
|
173
76
|
e.setAttribute("role", "separator"), e.setAttribute("aria-orientation", "vertical"), e.setAttribute("aria-label", c.label), e.tabIndex = 0, e.setAttribute("aria-valuenow", String(r)), c.min !== void 0 && e.setAttribute("aria-valuemin", String(c.min)), c.max !== void 0 && e.setAttribute("aria-valuemax", String(c.max));
|
|
174
77
|
let l = (e) => {
|
|
@@ -195,4 +98,4 @@ function b(e, t) {
|
|
|
195
98
|
};
|
|
196
99
|
}
|
|
197
100
|
//#endregion
|
|
198
|
-
export {
|
|
101
|
+
export { c as ControlTooltip, h as DialogController, i as PopoverController, a as TooltipController, p as TooltipText, g as attachMenuKeyboard, _ as attachResizeHandle, o as createTooltipElement, n as ensureTooltipStyles, t as prepareTooltipSurface, s as useTooltip };
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount, untrack, type Snippet } from 'svelte';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
uiComponents,
|
|
5
|
+
componentModels,
|
|
6
|
+
createFrameworkMount,
|
|
7
|
+
withFrameworkContent,
|
|
8
|
+
type UiContentTarget,
|
|
9
|
+
type UiFrameworkMount,
|
|
10
|
+
} from '../framework';
|
|
4
11
|
import type { SvelteUiProps } from '../svelte-props';
|
|
5
12
|
|
|
6
|
-
let {
|
|
13
|
+
let {
|
|
14
|
+
component,
|
|
15
|
+
props = {},
|
|
16
|
+
children,
|
|
17
|
+
slots = {},
|
|
18
|
+
onValueChange,
|
|
19
|
+
onUiEvent,
|
|
20
|
+
}: SvelteUiProps = $props();
|
|
7
21
|
type Content = Snippet<[Record<string, unknown>]>;
|
|
8
22
|
let host: HTMLSpanElement;
|
|
9
23
|
let targets = $state.raw<UiContentTarget<Content>[]>([]);
|
|
10
24
|
let mount = $state.raw<UiFrameworkMount<Content>>();
|
|
11
25
|
onMount(() => {
|
|
12
|
-
const current = createFrameworkMount<Content>(host, next => {
|
|
26
|
+
const current = createFrameworkMount<Content>(host, (next) => {
|
|
27
|
+
targets = next;
|
|
28
|
+
});
|
|
13
29
|
mount = current;
|
|
14
|
-
return () => {
|
|
30
|
+
return () => {
|
|
31
|
+
current.destroy();
|
|
32
|
+
};
|
|
15
33
|
});
|
|
16
34
|
$effect(() => {
|
|
17
35
|
const next = { ...props };
|
|
@@ -21,8 +39,11 @@
|
|
|
21
39
|
const event = onUiEvent;
|
|
22
40
|
const renderer = mount;
|
|
23
41
|
const model = componentModels[name];
|
|
24
|
-
const callbacks = new Set([
|
|
25
|
-
|
|
42
|
+
const callbacks = new Set([
|
|
43
|
+
...Object.keys(next).filter((key) => /^on[A-Z]/.test(key)),
|
|
44
|
+
'onClose',
|
|
45
|
+
...(model ? [model.callback] : []),
|
|
46
|
+
]);
|
|
26
47
|
for (const key of callbacks) {
|
|
27
48
|
const original = next[key];
|
|
28
49
|
next[key] = (...args: unknown[]) => {
|
|
@@ -32,18 +53,30 @@
|
|
|
32
53
|
return result;
|
|
33
54
|
};
|
|
34
55
|
}
|
|
35
|
-
untrack(() =>
|
|
36
|
-
(
|
|
56
|
+
untrack(() =>
|
|
57
|
+
renderer?.render(uiComponents[name], next, (props, content) =>
|
|
58
|
+
withFrameworkContent(name, props, contents, content),
|
|
59
|
+
),
|
|
60
|
+
);
|
|
37
61
|
});
|
|
38
62
|
function portal(node: HTMLElement, target: HTMLElement) {
|
|
39
63
|
target.appendChild(node);
|
|
40
|
-
return {
|
|
64
|
+
return {
|
|
65
|
+
update(next: HTMLElement) {
|
|
66
|
+
next.appendChild(node);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
41
69
|
}
|
|
42
70
|
</script>
|
|
43
71
|
|
|
44
|
-
<span bind:this={host} style="display: contents" data-rv-svelte-host={component}
|
|
72
|
+
<span bind:this={host} style="display: contents" data-rv-svelte-host={component}
|
|
73
|
+
></span>
|
|
45
74
|
{#each targets as target (target.id)}
|
|
46
|
-
<span
|
|
75
|
+
<span
|
|
76
|
+
use:portal={target.element}
|
|
77
|
+
style="display: contents"
|
|
78
|
+
data-rv-svelte-content
|
|
79
|
+
>
|
|
47
80
|
{@render target.content(target.scope)}
|
|
48
81
|
</span>
|
|
49
82
|
{/each}
|
package/svelte-control.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { controlAttributes as e } from "./control-attributes.js";
|
|
2
|
-
//#region
|
|
2
|
+
//#region package/svelte-control.ts
|
|
3
3
|
function t(t) {
|
|
4
4
|
let n = [], r = () => {
|
|
5
5
|
let r = t.localName, i = e(r, { ...r === "input" ? { type: t.type } : {} }), a = i.class.split(/\s+/).filter(Boolean);
|
package/svelte.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export type { SvelteUiProps } from './svelte-props';
|
|
|
5
5
|
export type { UiComponentName, UiComponentProps } from './component-catalog';
|
|
6
6
|
export type { PdfViewerProps, PdfViewerText } from './pdf-viewer/component';
|
|
7
7
|
export type { PdfViewerToolbarProps } from './pdf-viewer/toolbar';
|
|
8
|
-
export type { PdfViewerButton, PdfViewerButtonOptions, PdfViewerToolbarOptions, PdfViewerToolbarConfig } from './pdf-viewer/toolbar-options';
|
|
8
|
+
export type { PdfViewerButton, PdfViewerButtonOptions, PdfViewerToolbarOptions, PdfViewerToolbarConfig, } from './pdf-viewer/toolbar-options';
|
|
9
9
|
export { defaultPdfViewerText } from './pdf-viewer/translations';
|
package/svelte.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as e } from "./_chunks/component-
|
|
2
|
-
import { t } from "./_chunks/component-metadata-
|
|
3
|
-
import { n, t as r } from "./_chunks/framework-mount
|
|
1
|
+
import { i as e } from "./_chunks/component-C3k_8uIq.js";
|
|
2
|
+
import { t } from "./_chunks/component-metadata-DlVkpW3h.js";
|
|
3
|
+
import { n, t as r } from "./_chunks/framework-mount-D4I8HpVp.js";
|
|
4
4
|
import { uiComponents as i } from "./framework.js";
|
|
5
5
|
import "svelte/internal/disclose-version";
|
|
6
6
|
import * as a from "svelte/internal/client";
|
|
7
7
|
import { onMount as o, untrack as s } from "svelte";
|
|
8
|
-
//#region
|
|
8
|
+
//#region package/svelte/UiComponent.svelte
|
|
9
9
|
var c = a.from_html("<span style=\"display: contents\" data-rv-svelte-content=\"\"><!></span>"), l = a.from_html("<span style=\"display: contents\"></span> <!>", 1);
|
|
10
10
|
function u(e, u) {
|
|
11
11
|
a.push(u, !0);
|
|
@@ -52,7 +52,7 @@ function u(e, u) {
|
|
|
52
52
|
}), a.template_effect(() => a.set_attribute(v, "data-rv-svelte-host", u.component)), a.append(e, _), a.pop();
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
|
-
//#region
|
|
55
|
+
//#region package/svelte.ts
|
|
56
56
|
var d = u;
|
|
57
57
|
//#endregion
|
|
58
58
|
export { d as UiComponent, e as defaultPdfViewerText };
|
package/switch/index.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { t as e } from "../_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { t } from "../_chunks/native-control-um1L1wgZ.js";
|
|
3
|
+
//#region package/switch/index.tsx
|
|
4
|
+
function n({ checked: n, onChange: r, label: i, ariaLabel: a, className: o = "", disabled: s = !1, labelPosition: c = "before", title: l, testId: u }) {
|
|
5
|
+
let d = /* @__PURE__ */ e("span", {
|
|
5
6
|
class: "rv-switch-label",
|
|
6
|
-
children:
|
|
7
|
-
}),
|
|
7
|
+
children: i
|
|
8
|
+
}), f = /* @__PURE__ */ e("span", {
|
|
8
9
|
class: "rv-switch-track",
|
|
9
10
|
"aria-hidden": "true",
|
|
10
11
|
children: /* @__PURE__ */ e("span", { class: "rv-switch-thumb" })
|
|
11
12
|
});
|
|
12
|
-
return /* @__PURE__ */ e(
|
|
13
|
+
return /* @__PURE__ */ e(t, {
|
|
13
14
|
type: "button",
|
|
14
|
-
class: `rv-switch ${
|
|
15
|
+
class: `rv-switch ${o}`.trim(),
|
|
15
16
|
role: "switch",
|
|
16
|
-
"aria-checked":
|
|
17
|
-
"aria-label":
|
|
18
|
-
disabled:
|
|
19
|
-
title:
|
|
20
|
-
"data-testid":
|
|
21
|
-
onClick: () =>
|
|
22
|
-
children: [
|
|
17
|
+
"aria-checked": n,
|
|
18
|
+
"aria-label": a ?? (typeof i == "string" ? i : void 0),
|
|
19
|
+
disabled: s,
|
|
20
|
+
title: l,
|
|
21
|
+
"data-testid": u,
|
|
22
|
+
onClick: () => r(!n),
|
|
23
|
+
children: [c === "before" ? d : f, c === "before" ? f : d]
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
//#endregion
|
|
26
|
-
export {
|
|
27
|
+
export { n as Switch };
|
package/time-grid.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export interface TimeGridDayLabel {
|
|
|
11
11
|
}
|
|
12
12
|
export interface TimeGridProps {
|
|
13
13
|
readonly disabled?: boolean;
|
|
14
|
-
readonly legacyClassPrefix?: string;
|
|
15
14
|
readonly days: readonly TimeGridDayLabel[];
|
|
16
15
|
readonly cells: ReadonlySet<string>;
|
|
17
16
|
readonly focused: string;
|
package/time-grid.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { r as e, t } from "./_chunks/hooks.module-CG3gN83z.js";
|
|
2
2
|
import { t as n } from "./_chunks/jsxRuntime.module-F6UFnpT-.js";
|
|
3
|
-
import { t as r } from "./_chunks/native-control-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { t as r } from "./_chunks/native-control-um1L1wgZ.js";
|
|
4
|
+
import { t as i } from "./_chunks/tooltip-text-BN5WdGHn.js";
|
|
5
|
+
//#region package/time-grid.tsx
|
|
6
|
+
var a = (e, t) => `${e}:${t}`;
|
|
7
|
+
function o(e) {
|
|
7
8
|
return [
|
|
8
9
|
"rv-time-grid__cell",
|
|
9
10
|
e.weekend && "is-weekend",
|
|
10
11
|
e.outsideWorkHours && "is-outside-work-hours"
|
|
11
12
|
].filter(Boolean).join(" ");
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
let t = (
|
|
14
|
+
function s(e) {
|
|
15
|
+
let t = (e) => `rv-time-grid__${e}`, s = Array.from({ length: 12 }, (e, t) => t * 2);
|
|
15
16
|
return /* @__PURE__ */ n("div", {
|
|
16
17
|
class: t("schedule"),
|
|
17
18
|
children: [/* @__PURE__ */ n("div", {
|
|
18
19
|
class: t("hours"),
|
|
19
20
|
"aria-hidden": "true",
|
|
20
|
-
children: [/* @__PURE__ */ n("span", {}),
|
|
21
|
+
children: [/* @__PURE__ */ n("span", {}), s.map((r) => /* @__PURE__ */ n("span", {
|
|
21
22
|
class: t("hour"),
|
|
22
23
|
children: e.hourLabel(r)
|
|
23
24
|
}, r))]
|
|
@@ -28,53 +29,53 @@ function o(e) {
|
|
|
28
29
|
"aria-label": e.gridLabel,
|
|
29
30
|
"aria-rowcount": e.days.length,
|
|
30
31
|
"aria-colcount": 12,
|
|
31
|
-
children: e.days.map((
|
|
32
|
-
let { weekday:
|
|
32
|
+
children: e.days.map((c) => {
|
|
33
|
+
let { weekday: l, short: u, long: d } = c, f = e.weekendDays.includes(l);
|
|
33
34
|
return /* @__PURE__ */ n("div", {
|
|
34
|
-
class: `${t("row")}${
|
|
35
|
+
class: `${t("row")}${f ? " is-weekend" : ""}`,
|
|
35
36
|
role: "row",
|
|
36
|
-
children: [/* @__PURE__ */ n(
|
|
37
|
+
children: [/* @__PURE__ */ n(i, {
|
|
37
38
|
class: t("weekday"),
|
|
38
39
|
role: "rowheader",
|
|
39
|
-
title:
|
|
40
|
-
children:
|
|
41
|
-
}),
|
|
42
|
-
let
|
|
40
|
+
title: d,
|
|
41
|
+
children: u
|
|
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;
|
|
43
44
|
return /* @__PURE__ */ n(r, {
|
|
44
45
|
type: "button",
|
|
45
46
|
disabled: e.disabled,
|
|
46
47
|
role: "gridcell",
|
|
47
|
-
"data-time-cell":
|
|
48
|
-
class:
|
|
49
|
-
weekend:
|
|
48
|
+
"data-time-cell": i,
|
|
49
|
+
class: o({
|
|
50
|
+
weekend: f,
|
|
50
51
|
outsideWorkHours: u
|
|
51
|
-
})
|
|
52
|
-
"aria-selected":
|
|
53
|
-
"aria-label": e.cellLabel(
|
|
54
|
-
tabIndex: e.focused ===
|
|
55
|
-
onFocus: () => e.onFocus(
|
|
56
|
-
onKeyDown: (n) => e.onKeyDown(n,
|
|
57
|
-
onClick: (n) => e.onClick(n,
|
|
58
|
-
onPointerDown: (n) => e.onPointerDown(n,
|
|
59
|
-
onPointerEnter: () => e.onPointerEnter(
|
|
60
|
-
},
|
|
52
|
+
}),
|
|
53
|
+
"aria-selected": s,
|
|
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)
|
|
61
|
+
}, i);
|
|
61
62
|
})]
|
|
62
|
-
},
|
|
63
|
+
}, l);
|
|
63
64
|
})
|
|
64
65
|
})]
|
|
65
66
|
});
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function c(n) {
|
|
68
69
|
let r = t(n);
|
|
69
70
|
r.current = n;
|
|
70
|
-
let
|
|
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) => {
|
|
77
|
-
let n =
|
|
78
|
+
let n = a(e, t);
|
|
78
79
|
r.current.onFocus(n), s.current !== void 0 && cancelAnimationFrame(s.current), s.current = requestAnimationFrame(() => r.current.matrixRef.current?.querySelector(`[data-time-cell="${n}"]`)?.focus());
|
|
79
80
|
};
|
|
80
81
|
return {
|
|
@@ -97,18 +98,18 @@ function s(n) {
|
|
|
97
98
|
},
|
|
98
99
|
onPointerDown: (e, t, n, s) => {
|
|
99
100
|
if (r.current.disabled || e.button !== 0) return;
|
|
100
|
-
e.preventDefault(), c(),
|
|
101
|
+
e.preventDefault(), c(), i.current = { selected: !s };
|
|
101
102
|
let l = e.currentTarget.ownerDocument, u = () => {
|
|
102
|
-
|
|
103
|
+
i.current && (i.current = void 0, c(), r.current.onCommit());
|
|
103
104
|
};
|
|
104
105
|
l.addEventListener("pointerup", u), l.addEventListener("pointercancel", u), o.current = () => {
|
|
105
106
|
l.removeEventListener("pointerup", u), l.removeEventListener("pointercancel", u);
|
|
106
|
-
}, r.current.onPaint(t, n, !s), r.current.onFocus(
|
|
107
|
+
}, r.current.onPaint(t, n, !s), r.current.onFocus(a(t, n));
|
|
107
108
|
},
|
|
108
109
|
onPointerEnter: (e, t) => {
|
|
109
|
-
|
|
110
|
+
i.current && !r.current.disabled && r.current.onPaint(e, t, i.current.selected);
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
114
|
//#endregion
|
|
114
|
-
export {
|
|
115
|
+
export { s as TimeGrid, a as timeGridCellKey, c as useTimeGridInteraction };
|