@k2b/ui 0.59.0 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/actions/CommandList.js +67 -74
- package/dist/browser/actions/CommandList.js.map +1 -1
- package/dist/browser/actions/ContextMenu.js +11 -2
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +187 -169
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +18 -7
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/SelectionAction.js +232 -0
- package/dist/browser/actions/SelectionAction.js.map +1 -0
- package/dist/browser/actions/command-items.js.map +1 -1
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet-open.js +19 -0
- package/dist/browser/actions/menu-sheet-open.js.map +1 -0
- package/dist/browser/charts/core/line-details.js +2 -2
- package/dist/browser/charts/core/line-details.js.map +1 -1
- package/dist/browser/charts/core/render.js +2 -1
- package/dist/browser/charts/core/render.js.map +1 -1
- package/dist/browser/chat/ChatActivityWords.js +142 -0
- package/dist/browser/chat/ChatActivityWords.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +540 -515
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatComposerQuotes.js +56 -0
- package/dist/browser/chat/ChatComposerQuotes.js.map +1 -0
- package/dist/browser/chat/ChatPrimitives.js +281 -245
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/index.js +4 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/content/ActivityList.js +789 -0
- package/dist/browser/content/ActivityList.js.map +1 -0
- package/dist/browser/content/DataTableTools.js +3 -0
- package/dist/browser/content/DataTableTools.js.map +1 -1
- package/dist/browser/content/Lightbox.js +2 -0
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/MessageQuote.js +57 -0
- package/dist/browser/content/MessageQuote.js.map +1 -0
- package/dist/browser/content/MessageRow.js +413 -391
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/VirtualFeed.js +29 -2
- package/dist/browser/content/VirtualFeed.js.map +1 -1
- package/dist/browser/content/activity-messages.js +47 -0
- package/dist/browser/content/activity-messages.js.map +1 -0
- package/dist/browser/content/activity-timeline.js +144 -0
- package/dist/browser/content/activity-timeline.js.map +1 -0
- package/dist/browser/content/chart-time-calendar.js +12 -18
- package/dist/browser/content/chart-time-calendar.js.map +1 -1
- package/dist/browser/content/find-text.js +47 -0
- package/dist/browser/content/find-text.js.map +1 -0
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/quote-messages.js +25 -0
- package/dist/browser/content/quote-messages.js.map +1 -0
- package/dist/browser/feedback/dialog-core.js +118 -14
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/dialog-frame-motion.js +274 -0
- package/dist/browser/feedback/dialog-frame-motion.js.map +1 -0
- package/dist/browser/feedback/prompt-sheet-view.js +2 -1
- package/dist/browser/feedback/prompt-sheet-view.js.map +1 -1
- package/dist/browser/feedback/prompts.js +49 -53
- package/dist/browser/feedback/prompts.js.map +1 -1
- package/dist/browser/hover-card.js +6 -0
- package/dist/browser/hover-card.js.map +1 -0
- package/dist/browser/inputs/AutocompleteEditor.js +2 -1
- package/dist/browser/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/browser/inputs/AutocompleteSelect.js +3 -12
- package/dist/browser/inputs/AutocompleteSelect.js.map +1 -1
- package/dist/browser/inputs/ChoiceList.js +131 -127
- package/dist/browser/inputs/ChoiceList.js.map +1 -1
- package/dist/browser/inputs/Combobox.js +6 -15
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/MultiSelectInput.js +7 -16
- package/dist/browser/inputs/MultiSelectInput.js.map +1 -1
- package/dist/browser/inputs/PeriodPicker.js +475 -252
- package/dist/browser/inputs/PeriodPicker.js.map +1 -1
- package/dist/browser/inputs/RichSelect.js +431 -431
- package/dist/browser/inputs/RichSelect.js.map +1 -1
- package/dist/browser/inputs/Select.js +3 -12
- package/dist/browser/inputs/Select.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +1 -0
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/TimeInput.js +181 -0
- package/dist/browser/inputs/TimeInput.js.map +1 -0
- package/dist/browser/inputs/choice.js.map +1 -1
- package/dist/browser/inputs/date-picker.js +2 -1
- package/dist/browser/inputs/date-picker.js.map +1 -1
- package/dist/browser/inputs/file-drop.js +2 -0
- package/dist/browser/inputs/file-drop.js.map +1 -1
- package/dist/browser/inputs/index.js +1 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/input-messages.js +20 -2
- package/dist/browser/inputs/input-messages.js.map +1 -1
- package/dist/browser/inputs/period-picker-messages.js +20 -2
- package/dist/browser/inputs/period-picker-messages.js.map +1 -1
- package/dist/browser/inputs/period.js +83 -0
- package/dist/browser/inputs/period.js.map +1 -1
- package/dist/browser/inputs/time-input.js +93 -0
- package/dist/browser/inputs/time-input.js.map +1 -0
- package/dist/browser/internal/exit-motion.js +23 -0
- package/dist/browser/internal/exit-motion.js.map +1 -0
- package/dist/browser/internal/option-description.js +47 -0
- package/dist/browser/internal/option-description.js.map +1 -0
- package/dist/browser/internal/scroll-places.js +15 -0
- package/dist/browser/internal/scroll-places.js.map +1 -0
- package/dist/browser/layout/AppWorkspace.js +572 -495
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +2 -14
- package/dist/browser/layout/BottomSheet.js.map +1 -1
- package/dist/browser/layout/Navigation.js +7 -2
- package/dist/browser/layout/Navigation.js.map +1 -1
- package/dist/browser/layout/SidebarSwitcher.js +28 -37
- package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -1
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/bottom-sheet-load.js +17 -0
- package/dist/browser/layout/bottom-sheet-load.js.map +1 -0
- package/dist/browser/layout/bottom-sheet-options.js +27 -0
- package/dist/browser/layout/bottom-sheet-options.js.map +1 -0
- package/dist/browser/layout/index.js +2 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/sheet-motion.js +10 -11
- package/dist/browser/layout/sheet-motion.js.map +1 -1
- package/dist/browser/layout/sidebar-scroll-memory.js +30 -0
- package/dist/browser/layout/sidebar-scroll-memory.js.map +1 -1
- package/dist/browser/surfaces/AvatarStack.js +59 -43
- package/dist/browser/surfaces/AvatarStack.js.map +1 -1
- package/dist/browser/surfaces/LinkCard.js.map +1 -1
- package/dist/browser/surfaces/Section.js +4 -2
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatCell.js +56 -28
- package/dist/browser/surfaces/StatCell.js.map +1 -1
- package/dist/browser/surfaces/StatGrid.js +17 -8
- package/dist/browser/surfaces/StatGrid.js.map +1 -1
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/CommandList.js +23 -26
- package/dist/ssr/actions/CommandList.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +8 -2
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +79 -55
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +18 -7
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/SelectionAction.js +212 -0
- package/dist/ssr/actions/SelectionAction.js.map +1 -0
- package/dist/ssr/actions/command-items.js.map +1 -1
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet-open.js +19 -0
- package/dist/ssr/actions/menu-sheet-open.js.map +1 -0
- package/dist/ssr/charts/core/line-details.js +2 -2
- package/dist/ssr/charts/core/line-details.js.map +1 -1
- package/dist/ssr/charts/core/render.js +2 -1
- package/dist/ssr/charts/core/render.js.map +1 -1
- package/dist/ssr/chat/ChatActivityWords.js +126 -0
- package/dist/ssr/chat/ChatActivityWords.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +24 -3
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatComposerQuotes.js +26 -0
- package/dist/ssr/chat/ChatComposerQuotes.js.map +1 -0
- package/dist/ssr/chat/ChatPrimitives.js +53 -47
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/index.js +4 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/content/ActivityList.js +553 -0
- package/dist/ssr/content/ActivityList.js.map +1 -0
- package/dist/ssr/content/DataTableTools.js +3 -0
- package/dist/ssr/content/DataTableTools.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +2 -0
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/MessageQuote.js +36 -0
- package/dist/ssr/content/MessageQuote.js.map +1 -0
- package/dist/ssr/content/MessageRow.js +112 -95
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/VirtualFeed.js +29 -2
- package/dist/ssr/content/VirtualFeed.js.map +1 -1
- package/dist/ssr/content/activity-messages.js +47 -0
- package/dist/ssr/content/activity-messages.js.map +1 -0
- package/dist/ssr/content/activity-timeline.js +144 -0
- package/dist/ssr/content/activity-timeline.js.map +1 -0
- package/dist/ssr/content/chart-time-calendar.js +12 -18
- package/dist/ssr/content/chart-time-calendar.js.map +1 -1
- package/dist/ssr/content/find-text.js +47 -0
- package/dist/ssr/content/find-text.js.map +1 -0
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/quote-messages.js +25 -0
- package/dist/ssr/content/quote-messages.js.map +1 -0
- package/dist/ssr/feedback/dialog-core.js +118 -14
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/dialog-frame-motion.js +274 -0
- package/dist/ssr/feedback/dialog-frame-motion.js.map +1 -0
- package/dist/ssr/feedback/prompt-sheet-view.js +2 -1
- package/dist/ssr/feedback/prompt-sheet-view.js.map +1 -1
- package/dist/ssr/feedback/prompts.js +16 -16
- package/dist/ssr/feedback/prompts.js.map +1 -1
- package/dist/ssr/hover-card.js +6 -0
- package/dist/ssr/hover-card.js.map +1 -0
- package/dist/ssr/inputs/AutocompleteEditor.js +2 -1
- package/dist/ssr/inputs/AutocompleteEditor.js.map +1 -1
- package/dist/ssr/inputs/AutocompleteSelect.js +3 -8
- package/dist/ssr/inputs/AutocompleteSelect.js.map +1 -1
- package/dist/ssr/inputs/ChoiceList.js +25 -25
- package/dist/ssr/inputs/ChoiceList.js.map +1 -1
- package/dist/ssr/inputs/Combobox.js +4 -9
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/MultiSelectInput.js +4 -9
- package/dist/ssr/inputs/MultiSelectInput.js.map +1 -1
- package/dist/ssr/inputs/PeriodPicker.js +241 -46
- package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
- package/dist/ssr/inputs/RichSelect.js +135 -121
- package/dist/ssr/inputs/RichSelect.js.map +1 -1
- package/dist/ssr/inputs/Select.js +3 -8
- package/dist/ssr/inputs/Select.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +1 -0
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/TimeInput.js +145 -0
- package/dist/ssr/inputs/TimeInput.js.map +1 -0
- package/dist/ssr/inputs/choice.js.map +1 -1
- package/dist/ssr/inputs/date-picker.js +2 -1
- package/dist/ssr/inputs/date-picker.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js +2 -0
- package/dist/ssr/inputs/file-drop.js.map +1 -1
- package/dist/ssr/inputs/index.js +1 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/input-messages.js +20 -2
- package/dist/ssr/inputs/input-messages.js.map +1 -1
- package/dist/ssr/inputs/period-picker-messages.js +20 -2
- package/dist/ssr/inputs/period-picker-messages.js.map +1 -1
- package/dist/ssr/inputs/period.js +83 -0
- package/dist/ssr/inputs/period.js.map +1 -1
- package/dist/ssr/inputs/time-input.js +93 -0
- package/dist/ssr/inputs/time-input.js.map +1 -0
- package/dist/ssr/internal/exit-motion.js +23 -0
- package/dist/ssr/internal/exit-motion.js.map +1 -0
- package/dist/ssr/internal/option-description.js +27 -0
- package/dist/ssr/internal/option-description.js.map +1 -0
- package/dist/ssr/internal/scroll-places.js +15 -0
- package/dist/ssr/internal/scroll-places.js.map +1 -0
- package/dist/ssr/layout/AppWorkspace.js +191 -121
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +2 -14
- package/dist/ssr/layout/BottomSheet.js.map +1 -1
- package/dist/ssr/layout/Navigation.js +7 -2
- package/dist/ssr/layout/Navigation.js.map +1 -1
- package/dist/ssr/layout/SidebarSwitcher.js +8 -13
- package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -1
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/bottom-sheet-load.js +17 -0
- package/dist/ssr/layout/bottom-sheet-load.js.map +1 -0
- package/dist/ssr/layout/bottom-sheet-options.js +27 -0
- package/dist/ssr/layout/bottom-sheet-options.js.map +1 -0
- package/dist/ssr/layout/index.js +2 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/sheet-motion.js +10 -11
- package/dist/ssr/layout/sheet-motion.js.map +1 -1
- package/dist/ssr/layout/sidebar-scroll-memory.js +30 -0
- package/dist/ssr/layout/sidebar-scroll-memory.js.map +1 -1
- package/dist/ssr/surfaces/AvatarStack.js +56 -40
- package/dist/ssr/surfaces/AvatarStack.js.map +1 -1
- package/dist/ssr/surfaces/LinkCard.js.map +1 -1
- package/dist/ssr/surfaces/Section.js +4 -2
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatCell.js +24 -12
- package/dist/ssr/surfaces/StatCell.js.map +1 -1
- package/dist/ssr/surfaces/StatGrid.js +12 -6
- package/dist/ssr/surfaces/StatGrid.js.map +1 -1
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +10 -0
- package/dist/types/actions/SelectionAction.d.ts +34 -0
- package/dist/types/actions/command-items.d.ts +5 -0
- package/dist/types/actions/index.d.ts +2 -0
- package/dist/types/actions/menu-sheet-open.d.ts +13 -0
- package/dist/types/charts/core/line-details.d.ts +1 -1
- package/dist/types/chat/ChatActivityWords.d.ts +31 -0
- package/dist/types/chat/ChatComposer.d.ts +17 -1
- package/dist/types/chat/ChatComposerQuotes.d.ts +10 -0
- package/dist/types/chat/ChatPrimitives.d.ts +17 -1
- package/dist/types/chat/index.d.ts +6 -2
- package/dist/types/content/ActivityList.d.ts +166 -0
- package/dist/types/content/DataTableTools.d.ts +2 -0
- package/dist/types/content/MessageQuote.d.ts +9 -0
- package/dist/types/content/MessageRow.d.ts +5 -0
- package/dist/types/content/VirtualFeed.d.ts +6 -0
- package/dist/types/content/activity-messages.d.ts +22 -0
- package/dist/types/content/activity-timeline.d.ts +52 -0
- package/dist/types/content/chart-time-calendar.d.ts +6 -0
- package/dist/types/content/find-text.d.ts +10 -0
- package/dist/types/content/index.d.ts +1 -0
- package/dist/types/content/quote-messages.d.ts +6 -0
- package/dist/types/feedback/dialog-core.d.ts +2 -0
- package/dist/types/feedback/dialog-frame-motion.d.ts +37 -0
- package/dist/types/feedback/prompts.d.ts +5 -0
- package/dist/types/hover-card.d.ts +5 -0
- package/dist/types/inputs/ChoiceList.d.ts +12 -5
- package/dist/types/inputs/Combobox.d.ts +5 -0
- package/dist/types/inputs/MultiSelectInput.d.ts +1 -0
- package/dist/types/inputs/PeriodPicker.d.ts +10 -0
- package/dist/types/inputs/RichSelect.d.ts +5 -0
- package/dist/types/inputs/Select.d.ts +1 -0
- package/dist/types/inputs/SelectChip.d.ts +5 -0
- package/dist/types/inputs/TimeInput.d.ts +16 -0
- package/dist/types/inputs/choice.d.ts +6 -1
- package/dist/types/inputs/index.d.ts +2 -0
- package/dist/types/inputs/input-messages.d.ts +9 -0
- package/dist/types/inputs/period-picker-messages.d.ts +9 -0
- package/dist/types/inputs/period.d.ts +41 -0
- package/dist/types/inputs/time-input.d.ts +43 -0
- package/dist/types/internal/exit-motion.d.ts +10 -0
- package/dist/types/internal/option-description.d.ts +20 -0
- package/dist/types/internal/scroll-places.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -0
- package/dist/types/layout/BottomSheet.d.ts +1 -14
- package/dist/types/layout/SidebarSwitcher.d.ts +5 -0
- package/dist/types/layout/bottom-sheet-load.d.ts +9 -0
- package/dist/types/layout/bottom-sheet-options.d.ts +18 -0
- package/dist/types/layout/index.d.ts +3 -2
- package/dist/types/layout/sheet-motion.d.ts +0 -5
- package/dist/types/layout/sidebar-scroll-memory.d.ts +6 -0
- package/dist/types/surfaces/LinkCard.d.ts +2 -1
- package/dist/types/surfaces/StatCell.d.ts +7 -2
- package/dist/types/surfaces/StatGrid.d.ts +15 -3
- package/dist/types/surfaces/index.d.ts +1 -1
- package/package.json +12 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type { ChoiceChipOption, ChoiceChipsProps } from \"./ChoiceChips\";\nexport { ChoiceChips } from \"./ChoiceChips\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ChoiceListOption, ChoiceListProps } from \"./ChoiceList\";\nexport { ChoiceList } from \"./ChoiceList\";\nexport type { ChoiceSliderIndicatorProps, ChoiceSliderOption, ChoiceSliderProps } from \"./ChoiceSlider\";\nexport { ChoiceSlider, ChoiceSliderIndicator } from \"./ChoiceSlider\";\nexport type { ChoiceTileOption, ChoiceTilesProps } from \"./ChoiceTiles\";\nexport { ChoiceTiles } from \"./ChoiceTiles\";\nexport type { ColorChoiceOption, ColorChoicesProps } from \"./ColorChoices\";\nexport { ColorChoices } from \"./ColorChoices\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { DictationController, DictationNotice, DictationOptions, DictationStatus } from \"./dictation/create-dictation\";\nexport { createDictation } from \"./dictation/create-dictation\";\nexport type { DictationBarProps, DictationButtonProps } from \"./dictation/Dictation\";\nexport { DictationBar, DictationButton, dictationBarShown } from \"./dictation/Dictation\";\nexport type {\n DictationAlternative,\n DictationDevice,\n DictationEndReason,\n DictationErrorCode,\n DictationEvent,\n DictationSession,\n DictationSource,\n DictationTarget,\n} from \"./dictation/types\";\nexport type { EmojiPickerPopoverProps, EmojiPickerProps } from \"./emoji/EmojiPicker\";\nexport { EmojiPicker } from \"./emoji/EmojiPicker\";\nexport type { EmojiSkinTone } from \"./emoji/emoji-index\";\nexport { rememberEmoji } from \"./emoji/emoji-index\";\nexport type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from \"./FileDropTarget\";\nexport { FileDropTarget, fileDropTarget } from \"./FileDropTarget\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, FieldSuggestion, FieldSuggestionProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport type { SuggestionGroupProps } from \"./field-suggestion\";\nexport { SuggestionGroup } from \"./field-suggestion\";\nexport type { IconChoiceOption, IconChoicesProps } from \"./IconChoices\";\nexport { IconChoices } from \"./IconChoices\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { MarkdownSelectionToolbarProps } from \"./markdown/MarkdownSelectionToolbar\";\nexport { MarkdownSelectionToolbar } from \"./markdown/MarkdownSelectionToolbar\";\nexport type { SlashCommandsProps } from \"./markdown/SlashCommands\";\nexport { SlashCommands } from \"./markdown/SlashCommands\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { PeriodPickerProps } from \"./PeriodPicker\";\nexport { PeriodPicker } from \"./PeriodPicker\";\nexport type { PeriodClock, PeriodContext, PeriodPreset, PeriodRange, PeriodValue } from \"./period\";\nexport {\n formatPeriodDays,\n formatPeriodRange,\n isPeriodDay,\n parsePeriodValue,\n periodContext,\n periodDayCount,\n periodInstants,\n periodPresets,\n resolvePeriod,\n} from \"./period\";\nexport type { QrScannerError, QrScannerProps } from \"./QrScanner\";\nexport { QrScanner } from \"./QrScanner\";\nexport type {\n RichSelectFact,\n RichSelectFooter,\n RichSelectItem,\n RichSelectProps,\n RichSelectSection,\n RichSelectStatus,\n} from \"./RichSelect\";\nexport { RichSelect, RichSelectFacts } from \"./RichSelect\";\nexport type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { SignatureInputProps } from \"./SignatureInput\";\nexport { SignatureInput } from \"./SignatureInput\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { SignaturePngOptions, SignatureValue } from \"./signature\";\nexport { parseSignature, signatureToPng } from \"./signature\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputPro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,WAAW,QAAQ,eAAe;AAE3C,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SACE,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,aAAa,EACb,aAAa,QACR,UAAU;AAEjB,SAAS,SAAS,QAAQ,aAAa;AASvC,SAAS,UAAU,EAAE,eAAe,QAAQ,cAAc;AAE1D,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,cAAc,QAAQ,kBAAkB;AAEjD,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,cAAc,EAAE,cAAc,QAAQ,aAAa;AAE5D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/index.ts"],"sourcesContent":["export type { AutocompleteEditorProps } from \"./AutocompleteEditor\";\nexport { AutocompleteEditor } from \"./AutocompleteEditor\";\nexport type {\n AutocompleteSelectOption,\n AutocompleteSelectProps,\n AutocompleteSelectSearchResult,\n} from \"./AutocompleteSelect\";\nexport { AutocompleteSelect } from \"./AutocompleteSelect\";\nexport type { CheckboxProps } from \"./Checkbox\";\nexport { Checkbox } from \"./Checkbox\";\nexport type { CheckboxCardProps } from \"./CheckboxCard\";\nexport { CheckboxCard } from \"./CheckboxCard\";\nexport type { ChoiceChipOption, ChoiceChipsProps } from \"./ChoiceChips\";\nexport { ChoiceChips } from \"./ChoiceChips\";\nexport type {\n ColorInputProps,\n PinInputProps,\n SliderProps,\n} from \"./ChoiceInputs\";\nexport { ColorInput, PinInput, Slider } from \"./ChoiceInputs\";\nexport type { ChoiceListOption, ChoiceListProps } from \"./ChoiceList\";\nexport { ChoiceList } from \"./ChoiceList\";\nexport type { ChoiceSliderIndicatorProps, ChoiceSliderOption, ChoiceSliderProps } from \"./ChoiceSlider\";\nexport { ChoiceSlider, ChoiceSliderIndicator } from \"./ChoiceSlider\";\nexport type { ChoiceTileOption, ChoiceTilesProps } from \"./ChoiceTiles\";\nexport { ChoiceTiles } from \"./ChoiceTiles\";\nexport type { ColorChoiceOption, ColorChoicesProps } from \"./ColorChoices\";\nexport { ColorChoices } from \"./ColorChoices\";\nexport type { ComboboxOption, ComboboxProps } from \"./Combobox\";\nexport { Combobox } from \"./Combobox\";\nexport type { ChoiceOption, ChoiceOptionsLoader } from \"./choice\";\nexport type {\n Completion,\n QueryContext,\n SuggestContext,\n Suggestion,\n} from \"./completion\";\nexport { abbreviations } from \"./completion\";\nexport type {\n DatePickerBaseProps,\n DatePickerProps,\n DatePreset,\n DateRangePickerProps,\n DateRangeValue,\n DateTimePickerProps,\n DurationPreset,\n} from \"./DatePicker\";\nexport { DatePicker, DateRangePicker, DateTimePicker } from \"./DatePicker\";\nexport type { DictationController, DictationNotice, DictationOptions, DictationStatus } from \"./dictation/create-dictation\";\nexport { createDictation } from \"./dictation/create-dictation\";\nexport type { DictationBarProps, DictationButtonProps } from \"./dictation/Dictation\";\nexport { DictationBar, DictationButton, dictationBarShown } from \"./dictation/Dictation\";\nexport type {\n DictationAlternative,\n DictationDevice,\n DictationEndReason,\n DictationErrorCode,\n DictationEvent,\n DictationSession,\n DictationSource,\n DictationTarget,\n} from \"./dictation/types\";\nexport type { EmojiPickerPopoverProps, EmojiPickerProps } from \"./emoji/EmojiPicker\";\nexport { EmojiPicker } from \"./emoji/EmojiPicker\";\nexport type { EmojiSkinTone } from \"./emoji/emoji-index\";\nexport { rememberEmoji } from \"./emoji/emoji-index\";\nexport type { FileDropDetails, FileDropOptions, FileDropRejection, FileDropTargetProps } from \"./FileDropTarget\";\nexport { FileDropTarget, fileDropTarget } from \"./FileDropTarget\";\nexport type { FileDropzoneProps, ImageCropperProps, ImageInputProps } from \"./FileInputs\";\nexport { FileDropzone, ImageCropper, ImageInput } from \"./FileInputs\";\nexport type { DateContext, FieldProps, FieldSuggestion, FieldSuggestionProps, MaybeAccessor, ValueFieldProps } from \"./field-contract\";\nexport type { SuggestionGroupProps } from \"./field-suggestion\";\nexport { SuggestionGroup } from \"./field-suggestion\";\nexport type { IconChoiceOption, IconChoicesProps } from \"./IconChoices\";\nexport { IconChoices } from \"./IconChoices\";\nexport { DEFAULT_ICON_GROUPS, DEFAULT_ICON_OPTIONS } from \"./icon-options\";\nexport type {\n ImageCropAspect,\n ImageCropOutput,\n ImageCropRect,\n ImageCropRotation,\n ImageCropSize,\n ImageCropSource,\n ImageCropState,\n} from \"./image-crop\";\nexport {\n clampImageCropRect,\n createCroppedImageCanvas,\n createCroppedImageDataUrl,\n getInitialImageCropRect,\n imageCropRectToPixels,\n normalizeImageCropRotation,\n resizeImageCropAroundCenter,\n rotateImageCropRight,\n} from \"./image-crop\";\nexport type {\n MultiSelectFetchDataFn,\n MultiSelectInputProps,\n MultiSelectOption,\n} from \"./MultiSelectInput\";\nexport { MultiSelectInput } from \"./MultiSelectInput\";\nexport type { MarkdownEditorProps } from \"./markdown/MarkdownEditor\";\nexport { MarkdownEditor } from \"./markdown/MarkdownEditor\";\nexport type { MarkdownSelectionToolbarProps } from \"./markdown/MarkdownSelectionToolbar\";\nexport { MarkdownSelectionToolbar } from \"./markdown/MarkdownSelectionToolbar\";\nexport type { SlashCommandsProps } from \"./markdown/SlashCommands\";\nexport { SlashCommands } from \"./markdown/SlashCommands\";\nexport type { NumberInputProps } from \"./NumberInput\";\nexport { NumberInput } from \"./NumberInput\";\nexport type { PeriodPickerProps } from \"./PeriodPicker\";\nexport { PeriodPicker } from \"./PeriodPicker\";\nexport type { PeriodClock, PeriodContext, PeriodPreset, PeriodRange, PeriodValue } from \"./period\";\nexport {\n formatPeriodDays,\n formatPeriodRange,\n isPeriodDay,\n parsePeriodValue,\n periodContext,\n periodDayCount,\n periodInstants,\n periodPresets,\n resolvePeriod,\n} from \"./period\";\nexport type { QrScannerError, QrScannerProps } from \"./QrScanner\";\nexport { QrScanner } from \"./QrScanner\";\nexport type {\n RichSelectFact,\n RichSelectFooter,\n RichSelectItem,\n RichSelectProps,\n RichSelectSection,\n RichSelectStatus,\n} from \"./RichSelect\";\nexport { RichSelect, RichSelectFacts } from \"./RichSelect\";\nexport type { ChoiceAppearance, SelectGridSize, SelectGroup, SelectOption, SelectProps, SelectSourceOption, SelectView } from \"./Select\";\nexport { Select } from \"./Select\";\nexport type { SelectChipOption, SelectChipProps } from \"./SelectChip\";\nexport { SelectChip } from \"./SelectChip\";\nexport type { SignatureInputProps } from \"./SignatureInput\";\nexport { SignatureInput } from \"./SignatureInput\";\nexport type { IconInputProps, IconOption } from \"./SpecialInputs\";\nexport { IconInput } from \"./SpecialInputs\";\nexport type { SwitchProps } from \"./Switch\";\nexport { Switch } from \"./Switch\";\nexport type { SignaturePngOptions, SignatureValue } from \"./signature\";\nexport { parseSignature, signatureToPng } from \"./signature\";\nexport type { TagEditorItem, TagEditorLabels, TagEditorProps, TagEditorValue } from \"./TagEditor\";\nexport { TagEditor } from \"./TagEditor\";\nexport type { TagsInputProps } from \"./TagsInput\";\nexport { TagsInput } from \"./TagsInput\";\nexport type {\n TemplateEditorLayout,\n TemplateEditorProps,\n TemplatePreviewProps,\n TemplateSampleDataProps,\n TemplateVariable,\n TemplateVariableKind,\n} from \"./TemplateEditor\";\nexport {\n createTemplateEditorPanesLayout,\n TemplateEditor,\n TemplatePreview,\n TemplateSampleData,\n} from \"./TemplateEditor\";\nexport type { TextInputProps } from \"./TextInput\";\nexport { TextInput } from \"./TextInput\";\nexport type { TimeInputProps } from \"./TimeInput\";\nexport { TimeInput } from \"./TimeInput\";\n"],"mappings":"AACA,SAAS,kBAAkB,QAAQ,sBAAsB;AAMzD,SAAS,kBAAkB,QAAQ,sBAAsB;AAEzD,SAAS,QAAQ,QAAQ,YAAY;AAEr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EACb,aAAa,QACR,UAAU;AAEjB,SAAS,SAAS,QAAQ,aAAa;AASvC,SAAS,UAAU,EAAE,eAAe,QAAQ,cAAc;AAE1D,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,cAAc,QAAQ,kBAAkB;AAEjD,SAAS,SAAS,QAAQ,iBAAiB;AAE3C,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,cAAc,EAAE,cAAc,QAAQ,aAAa;AAE5D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa;AASvC,SACE,+BAA+B,EAC/B,cAAc,EACd,eAAe,EACf,kBAAkB,QACb,kBAAkB;AAEzB,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,SAAS,QAAQ,aAAa","ignoreList":[]}
|
|
@@ -16,7 +16,16 @@ const inputMessages = i18n.define({
|
|
|
16
16
|
}) => `PIN digit ${index} of ${total}`,
|
|
17
17
|
resetTo: ({
|
|
18
18
|
value
|
|
19
|
-
}) => `Reset to ${value}
|
|
19
|
+
}) => `Reset to ${value}`,
|
|
20
|
+
timeLetters: "hh:mm",
|
|
21
|
+
notATime: "Not a time. Example: 09:30",
|
|
22
|
+
timeRequired: "Enter a time.",
|
|
23
|
+
earliestTime: ({
|
|
24
|
+
time
|
|
25
|
+
}) => `${time} at the earliest.`,
|
|
26
|
+
latestTime: ({
|
|
27
|
+
time
|
|
28
|
+
}) => `${time} at the latest.`
|
|
20
29
|
},
|
|
21
30
|
de: {
|
|
22
31
|
decreaseValue: "Wert verringern",
|
|
@@ -31,7 +40,16 @@ const inputMessages = i18n.define({
|
|
|
31
40
|
}) => `PIN-Ziffer ${index} von ${total}`,
|
|
32
41
|
resetTo: ({
|
|
33
42
|
value
|
|
34
|
-
}) => `Zurücksetzen auf ${value}
|
|
43
|
+
}) => `Zurücksetzen auf ${value}`,
|
|
44
|
+
timeLetters: "hh:mm",
|
|
45
|
+
notATime: "Keine Uhrzeit. Beispiel: 09:30",
|
|
46
|
+
timeRequired: "Bitte eine Uhrzeit eingeben.",
|
|
47
|
+
earliestTime: ({
|
|
48
|
+
time
|
|
49
|
+
}) => `Frühestens ${time}.`,
|
|
50
|
+
latestTime: ({
|
|
51
|
+
time
|
|
52
|
+
}) => `Spätestens ${time}.`
|
|
35
53
|
}
|
|
36
54
|
}
|
|
37
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/input-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst inputMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n decreaseValue: \"Decrease value\",\n increaseValue: \"Increase value\",\n hidePassword: \"Hide password\",\n showPassword: \"Show password\",\n useColor: \"Use a color\",\n useTransparent: \"Use transparent\",\n pinDigit: ({ index, total }: { index: number; total: number }) => `PIN digit ${index} of ${total}`,\n resetTo: ({ value }: { value: string }) => `Reset to ${value}`,\n },\n de: {\n decreaseValue: \"Wert verringern\",\n increaseValue: \"Wert erhöhen\",\n hidePassword: \"Passwort ausblenden\",\n showPassword: \"Passwort anzeigen\",\n useColor: \"Farbe verwenden\",\n useTransparent: \"Transparent verwenden\",\n pinDigit: ({ index, total }) => `PIN-Ziffer ${index} von ${total}`,\n resetTo: ({ value }) => `Zurücksetzen auf ${value}`,\n },\n },\n});\n\nexport type InputMessages = ReturnType<(typeof inputMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useInputMessages = (): (() => InputMessages) => {\n const locale = useLocale();\n return () => inputMessages.resolve([locale()]).t;\n};\n\nexport const checkInputMessages = () => inputMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;EAChC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,gBAAgB;MAC/B,aAAa,EAAE,gBAAgB;MAC/B,YAAY,EAAE,eAAe;MAC7B,YAAY,EAAE,eAAe;MAC7B,QAAQ,EAAE,aAAa;MACvB,cAAc,EAAE,iBAAiB;MACjC,QAAQ,EAAE,CAAC;QAAE,KAAK;QAAE;MAAwC,CAAC,KAAK,aAAa,KAAK,OAAO,KAAK,EAAE;MAClG,OAAO,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,YAAY,KAAK;
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/input-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\nconst inputMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n decreaseValue: \"Decrease value\",\n increaseValue: \"Increase value\",\n hidePassword: \"Hide password\",\n showPassword: \"Show password\",\n useColor: \"Use a color\",\n useTransparent: \"Use transparent\",\n pinDigit: ({ index, total }: { index: number; total: number }) => `PIN digit ${index} of ${total}`,\n resetTo: ({ value }: { value: string }) => `Reset to ${value}`,\n timeLetters: \"hh:mm\",\n notATime: \"Not a time. Example: 09:30\",\n timeRequired: \"Enter a time.\",\n earliestTime: ({ time }: { time: string }) => `${time} at the earliest.`,\n latestTime: ({ time }: { time: string }) => `${time} at the latest.`,\n },\n de: {\n decreaseValue: \"Wert verringern\",\n increaseValue: \"Wert erhöhen\",\n hidePassword: \"Passwort ausblenden\",\n showPassword: \"Passwort anzeigen\",\n useColor: \"Farbe verwenden\",\n useTransparent: \"Transparent verwenden\",\n pinDigit: ({ index, total }) => `PIN-Ziffer ${index} von ${total}`,\n resetTo: ({ value }) => `Zurücksetzen auf ${value}`,\n timeLetters: \"hh:mm\",\n notATime: \"Keine Uhrzeit. Beispiel: 09:30\",\n timeRequired: \"Bitte eine Uhrzeit eingeben.\",\n earliestTime: ({ time }) => `Frühestens ${time}.`,\n latestTime: ({ time }) => `Spätestens ${time}.`,\n },\n },\n});\n\nexport type InputMessages = ReturnType<(typeof inputMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useInputMessages = (): (() => InputMessages) => {\n const locale = useLocale();\n return () => inputMessages.resolve([locale()]).t;\n};\n\nexport const checkInputMessages = () => inputMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAE1C,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;EAChC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,aAAa,EAAE,gBAAgB;MAC/B,aAAa,EAAE,gBAAgB;MAC/B,YAAY,EAAE,eAAe;MAC7B,YAAY,EAAE,eAAe;MAC7B,QAAQ,EAAE,aAAa;MACvB,cAAc,EAAE,iBAAiB;MACjC,QAAQ,EAAE,CAAC;QAAE,KAAK;QAAE;MAAwC,CAAC,KAAK,aAAa,KAAK,OAAO,KAAK,EAAE;MAClG,OAAO,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,YAAY,KAAK,EAAE;MAC9D,WAAW,EAAE,OAAO;MACpB,QAAQ,EAAE,4BAA4B;MACtC,YAAY,EAAE,eAAe;MAC7B,YAAY,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,GAAG,IAAI,mBAAmB;MACxE,UAAU,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,GAAG,IAAI;IACrD,CAAC;IACD,EAAE,EAAE;MACF,aAAa,EAAE,iBAAiB;MAChC,aAAa,EAAE,cAAc;MAC7B,YAAY,EAAE,qBAAqB;MACnC,YAAY,EAAE,mBAAmB;MACjC,QAAQ,EAAE,iBAAiB;MAC3B,cAAc,EAAE,uBAAuB;MACvC,QAAQ,EAAE,CAAC;QAAE,KAAK;QAAE;MAAM,CAAC,KAAK,cAAc,KAAK,QAAQ,KAAK,EAAE;MAClE,OAAO,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,oBAAoB,KAAK,EAAE;MACnD,WAAW,EAAE,OAAO;MACpB,QAAQ,EAAE,gCAAgC;MAC1C,YAAY,EAAE,8BAA8B;MAC5C,YAAY,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,cAAc,IAAI,GAAG;MACjD,UAAU,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,cAAc,IAAI;IAC9C;EACF;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,gBAAgB,GAAG,MAA6B;EAC3D,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,aAAa,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,OAAO,MAAM,kBAAkB,GAAG,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -28,7 +28,16 @@ const periodPickerMessages = i18n.define({
|
|
|
28
28
|
"last-quarter": "Last quarter",
|
|
29
29
|
"this-year": "This year",
|
|
30
30
|
"last-year": "Last year",
|
|
31
|
-
all: "All time"
|
|
31
|
+
all: "All time",
|
|
32
|
+
previousPeriod: "Previous period",
|
|
33
|
+
nextPeriod: "Next period",
|
|
34
|
+
currentPeriod: "Current period",
|
|
35
|
+
nothingBefore: ({
|
|
36
|
+
date
|
|
37
|
+
}) => `nothing before ${date}`,
|
|
38
|
+
nothingAfter: ({
|
|
39
|
+
date
|
|
40
|
+
}) => `nothing after ${date}`
|
|
32
41
|
},
|
|
33
42
|
de: {
|
|
34
43
|
period: "Zeitraum",
|
|
@@ -53,7 +62,16 @@ const periodPickerMessages = i18n.define({
|
|
|
53
62
|
"last-quarter": "Letztes Quartal",
|
|
54
63
|
"this-year": "Dieses Jahr",
|
|
55
64
|
"last-year": "Letztes Jahr",
|
|
56
|
-
all: "Gesamt"
|
|
65
|
+
all: "Gesamt",
|
|
66
|
+
previousPeriod: "Vorheriger Zeitraum",
|
|
67
|
+
nextPeriod: "Nächster Zeitraum",
|
|
68
|
+
currentPeriod: "Aktueller Zeitraum",
|
|
69
|
+
nothingBefore: ({
|
|
70
|
+
date
|
|
71
|
+
}) => `nichts vor dem ${date}`,
|
|
72
|
+
nothingAfter: ({
|
|
73
|
+
date
|
|
74
|
+
}) => `nichts nach dem ${date}`
|
|
57
75
|
}
|
|
58
76
|
}
|
|
59
77
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/period-picker-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Labels of the built-in period presets and the picker's own words. */\nconst periodPickerMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n period: \"Period\",\n choosePeriod: \"Choose a period\",\n custom: \"Custom range\",\n from: \"From\",\n to: \"To\",\n backToPresets: \"Back to presets\",\n since: ({ date }: { date: string }) => `since ${date}`,\n days: ({ count }: { count: number }) => (count === 1 ? \"1 day\" : `${count} days`),\n today: \"Today\",\n yesterday: \"Yesterday\",\n \"this-week\": \"This week\",\n \"last-week\": \"Last week\",\n \"this-month\": \"This month\",\n \"last-month\": \"Last month\",\n \"this-quarter\": \"This quarter\",\n \"last-quarter\": \"Last quarter\",\n \"this-year\": \"This year\",\n \"last-year\": \"Last year\",\n all: \"All time\",\n },\n de: {\n period: \"Zeitraum\",\n choosePeriod: \"Zeitraum wählen\",\n custom: \"Frei wählen\",\n from: \"Von\",\n to: \"Bis\",\n backToPresets: \"Zurück zu den Vorgaben\",\n since: ({ date }) => `seit ${date}`,\n days: ({ count }) => (count === 1 ? \"1 Tag\" : `${count} Tage`),\n today: \"Heute\",\n yesterday: \"Gestern\",\n \"this-week\": \"Diese Woche\",\n \"last-week\": \"Letzte Woche\",\n \"this-month\": \"Dieser Monat\",\n \"last-month\": \"Letzter Monat\",\n \"this-quarter\": \"Dieses Quartal\",\n \"last-quarter\": \"Letztes Quartal\",\n \"this-year\": \"Dieses Jahr\",\n \"last-year\": \"Letztes Jahr\",\n all: \"Gesamt\",\n },\n },\n});\n\nexport type PeriodPickerMessages = ReturnType<(typeof periodPickerMessages)[\"resolve\"]>[\"t\"];\n\nconst builtInKeys = new Set([\n \"today\",\n \"yesterday\",\n \"this-week\",\n \"last-week\",\n \"this-month\",\n \"last-month\",\n \"this-quarter\",\n \"last-quarter\",\n \"this-year\",\n \"last-year\",\n \"all\",\n] as const);\ntype BuiltInKey = typeof builtInKeys extends Set<infer K> ? K : never;\n\n/** The translated label of a built-in preset key, if it is one. */\nexport const builtInPresetLabel = (t: PeriodPickerMessages, key: string): string | undefined =>\n builtInKeys.has(key as BuiltInKey) ? t[key as BuiltInKey] : undefined;\n\n/** Resolved from the inherited render locale. */\nexport const usePeriodPickerMessages = (): (() => PeriodPickerMessages) => {\n const locale = useLocale();\n return () => periodPickerMessages.resolve([locale()]).t;\n};\n\nexport const resolvePeriodPickerMessages = (locale?: string): PeriodPickerMessages => periodPickerMessages.resolve([locale ?? \"en\"]).t;\n\nexport const checkPeriodPickerMessages = () => periodPickerMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;EACvC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,MAAM,EAAE,QAAQ;MAChB,YAAY,EAAE,iBAAiB;MAC/B,MAAM,EAAE,cAAc;MACtB,IAAI,EAAE,MAAM;MACZ,EAAE,EAAE,IAAI;MACR,aAAa,EAAE,iBAAiB;MAChC,KAAK,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,SAAS,IAAI,EAAE;MACtD,IAAI,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAM,KAAK,KAAK,CAAC,GAAG,OAAO,GAAG,GAAG,KAAK,OAAQ;MACjF,KAAK,EAAE,OAAO;MACd,SAAS,EAAE,WAAW;MACtB,WAAW,EAAE,WAAW;MACxB,WAAW,EAAE,WAAW;MACxB,YAAY,EAAE,YAAY;MAC1B,YAAY,EAAE,YAAY;MAC1B,cAAc,EAAE,cAAc;MAC9B,cAAc,EAAE,cAAc;MAC9B,WAAW,EAAE,WAAW;MACxB,WAAW,EAAE,WAAW;MACxB,GAAG,EAAE;
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/period-picker-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Labels of the built-in period presets and the picker's own words. */\nconst periodPickerMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n period: \"Period\",\n choosePeriod: \"Choose a period\",\n custom: \"Custom range\",\n from: \"From\",\n to: \"To\",\n backToPresets: \"Back to presets\",\n since: ({ date }: { date: string }) => `since ${date}`,\n days: ({ count }: { count: number }) => (count === 1 ? \"1 day\" : `${count} days`),\n today: \"Today\",\n yesterday: \"Yesterday\",\n \"this-week\": \"This week\",\n \"last-week\": \"Last week\",\n \"this-month\": \"This month\",\n \"last-month\": \"Last month\",\n \"this-quarter\": \"This quarter\",\n \"last-quarter\": \"Last quarter\",\n \"this-year\": \"This year\",\n \"last-year\": \"Last year\",\n all: \"All time\",\n previousPeriod: \"Previous period\",\n nextPeriod: \"Next period\",\n currentPeriod: \"Current period\",\n nothingBefore: ({ date }: { date: string }) => `nothing before ${date}`,\n nothingAfter: ({ date }: { date: string }) => `nothing after ${date}`,\n },\n de: {\n period: \"Zeitraum\",\n choosePeriod: \"Zeitraum wählen\",\n custom: \"Frei wählen\",\n from: \"Von\",\n to: \"Bis\",\n backToPresets: \"Zurück zu den Vorgaben\",\n since: ({ date }) => `seit ${date}`,\n days: ({ count }) => (count === 1 ? \"1 Tag\" : `${count} Tage`),\n today: \"Heute\",\n yesterday: \"Gestern\",\n \"this-week\": \"Diese Woche\",\n \"last-week\": \"Letzte Woche\",\n \"this-month\": \"Dieser Monat\",\n \"last-month\": \"Letzter Monat\",\n \"this-quarter\": \"Dieses Quartal\",\n \"last-quarter\": \"Letztes Quartal\",\n \"this-year\": \"Dieses Jahr\",\n \"last-year\": \"Letztes Jahr\",\n all: \"Gesamt\",\n previousPeriod: \"Vorheriger Zeitraum\",\n nextPeriod: \"Nächster Zeitraum\",\n currentPeriod: \"Aktueller Zeitraum\",\n nothingBefore: ({ date }) => `nichts vor dem ${date}`,\n nothingAfter: ({ date }) => `nichts nach dem ${date}`,\n },\n },\n});\n\nexport type PeriodPickerMessages = ReturnType<(typeof periodPickerMessages)[\"resolve\"]>[\"t\"];\n\nconst builtInKeys = new Set([\n \"today\",\n \"yesterday\",\n \"this-week\",\n \"last-week\",\n \"this-month\",\n \"last-month\",\n \"this-quarter\",\n \"last-quarter\",\n \"this-year\",\n \"last-year\",\n \"all\",\n] as const);\ntype BuiltInKey = typeof builtInKeys extends Set<infer K> ? K : never;\n\n/** The translated label of a built-in preset key, if it is one. */\nexport const builtInPresetLabel = (t: PeriodPickerMessages, key: string): string | undefined =>\n builtInKeys.has(key as BuiltInKey) ? t[key as BuiltInKey] : undefined;\n\n/** Resolved from the inherited render locale. */\nexport const usePeriodPickerMessages = (): (() => PeriodPickerMessages) => {\n const locale = useLocale();\n return () => periodPickerMessages.resolve([locale()]).t;\n};\n\nexport const resolvePeriodPickerMessages = (locale?: string): PeriodPickerMessages => periodPickerMessages.resolve([locale ?? \"en\"]).t;\n\nexport const checkPeriodPickerMessages = () => periodPickerMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;EACvC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,MAAM,EAAE,QAAQ;MAChB,YAAY,EAAE,iBAAiB;MAC/B,MAAM,EAAE,cAAc;MACtB,IAAI,EAAE,MAAM;MACZ,EAAE,EAAE,IAAI;MACR,aAAa,EAA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a;MAC1B,WAAW,EAAE,cAAc;MAC3B,GAAG,EAAE,QAAQ;MACb,cAAc,EAAE,qBAAqB;MACrC,UAAU,EAAE,mBAAmB;MAC/B,aAAa,EAAE,oBAAoB;MACnC,aAAa,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,kBAAkB,IAAI,EAAE;MACrD,YAAY,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,mBAAmB,IAAI;IACrD;EACF;AACF,CAAC,CAAC;AAIF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAC1B,OAAO,EACP,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,WAAW,EACX,WAAW,EACX,KAAK,CACG,CAAC;AAGX;AACA,OAAO,MAAM,kBAAkB,GAAG,CAAC,CAAuB,EAAE,GAAW,KACrE,WAAW,CAAC,GAAG,CAAC,GAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAe,GAAG,SAAS;;AAEvE;AACA,OAAO,MAAM,uBAAuB,GAAG,MAAoC;EACzE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,OAAO,MAAM,2BAA2B,GAAI,MAAe,IAA2B,oBAAoB,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAEtI,OAAO,MAAM,yBAAyB,GAAG,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -199,6 +199,70 @@ export const periodInstants = (range, timeZone) => {
|
|
|
199
199
|
to: range.end ? midnight(addPeriodDays(range.end, 1)) : null
|
|
200
200
|
};
|
|
201
201
|
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* How a period steps to its neighbour: calendar months, quarters and years keep their unit; every other range
|
|
205
|
+
* keeps its own number of days, even when its edges happen to be month boundaries.
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
/** What a period is, for its text and the way back to the current one. */
|
|
209
|
+
|
|
210
|
+
const monthIndex = key => parts(key).year * 12 + parts(key).month;
|
|
211
|
+
const daysBetween = (from, to) => Math.round((keyDate(to).getTime() - keyDate(from).getTime()) / 86_400_000);
|
|
212
|
+
|
|
213
|
+
/** The step of a period; `undefined` for an open edge, which has no neighbour. */
|
|
214
|
+
export const periodStep = range => {
|
|
215
|
+
if (!range.start || !range.end) return undefined;
|
|
216
|
+
if (range.start.endsWith("-01") && addPeriodDays(range.end, 1).endsWith("-01")) {
|
|
217
|
+
const months = monthIndex(range.end) - monthIndex(range.start) + 1;
|
|
218
|
+
const first = parts(range.start).month;
|
|
219
|
+
if (months === 1 || months === 3 && first % 3 === 0 || months === 12 && first === 0) return {
|
|
220
|
+
months
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
days: periodDayCount({
|
|
225
|
+
start: range.start,
|
|
226
|
+
end: range.end
|
|
227
|
+
})
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
/** The period `count` steps away: `-1` is the previous one, `1` the next. */
|
|
232
|
+
export const stepPeriod = (range, step, count) => {
|
|
233
|
+
if ("months" in step) {
|
|
234
|
+
const {
|
|
235
|
+
year,
|
|
236
|
+
month
|
|
237
|
+
} = parts(range.start);
|
|
238
|
+
const first = month + step.months * count;
|
|
239
|
+
return {
|
|
240
|
+
start: day(year, first, 1),
|
|
241
|
+
end: day(year, first + step.months, 0)
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
start: addPeriodDays(range.start, step.days * count),
|
|
246
|
+
end: addPeriodDays(range.end, step.days * count)
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/** The period of the same kind and rhythm that contains today: this week for a week, this month for a month. */
|
|
251
|
+
export const currentPeriodOf = (range, step, today) => stepPeriod(range, step, "months" in step ? Math.floor((monthIndex(today) - monthIndex(range.start)) / step.months) : Math.floor(daysBetween(range.start, today) / step.days));
|
|
252
|
+
export const periodKind = (range, weekStartsOn) => {
|
|
253
|
+
const step = periodStep(range);
|
|
254
|
+
if (!step) return "range";
|
|
255
|
+
if ("months" in step) {
|
|
256
|
+
const first = parts(range.start).month;
|
|
257
|
+
if (step.months === 1) return "month";
|
|
258
|
+
if (step.months === 3 && first % 3 === 0) return "quarter";
|
|
259
|
+
if (step.months === 12 && first === 0) return "year";
|
|
260
|
+
return "range";
|
|
261
|
+
}
|
|
262
|
+
if (step.days === 1) return "day";
|
|
263
|
+
if (step.days === 7 && keyDate(range.start).getUTCDay() === weekStartsOn) return "week";
|
|
264
|
+
return "range";
|
|
265
|
+
};
|
|
202
266
|
const utcFormat = (locale, options) => new Intl.DateTimeFormat(locale, {
|
|
203
267
|
...options,
|
|
204
268
|
timeZone: "UTC"
|
|
@@ -252,6 +316,25 @@ export const formatPeriodRange = (range, locale) => {
|
|
|
252
316
|
return range.start === range.end ? format.format(keyDate(range.start)) : format.formatRange(keyDate(range.start), keyDate(range.end));
|
|
253
317
|
};
|
|
254
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Explicit days that are one calendar week, month or year read as that: "9.–15. Nov. 2026", "Oktober 2026", "2025".
|
|
321
|
+
* `undefined` for any other range, which keeps its numeric days and count.
|
|
322
|
+
*/
|
|
323
|
+
export const formatPeriodUnit = (range, weekStartsOn, locale) => {
|
|
324
|
+
const kind = periodKind(range, weekStartsOn);
|
|
325
|
+
if (kind === "year") return range.start.slice(0, 4);
|
|
326
|
+
if (kind === "month") return utcFormat(locale, {
|
|
327
|
+
month: "long",
|
|
328
|
+
year: "numeric"
|
|
329
|
+
}).format(keyDate(range.start));
|
|
330
|
+
if (kind === "week") return utcFormat(locale, {
|
|
331
|
+
day: "numeric",
|
|
332
|
+
month: "short",
|
|
333
|
+
year: "numeric"
|
|
334
|
+
}).formatRange(keyDate(range.start), keyDate(range.end));
|
|
335
|
+
return undefined;
|
|
336
|
+
};
|
|
337
|
+
|
|
255
338
|
/** The widest explicit range within today's year, all of it (two-digit days, a three-digit count), so a trigger can reserve its width. */
|
|
256
339
|
export const widePeriodRangeSample = today => {
|
|
257
340
|
const year = today.slice(0, 4);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["inputs/period.ts"],"sourcesContent":["import { dates } from \"@k2b/stdlib\";\n\n/**\n * A period as an app stores it: a preset key that stays relative (\"this month\" is next month's month too), or two\n * explicit days. Days are date keys such as `2026-11-01`; `end` is inclusive.\n */\nexport type PeriodValue = { preset: string } | { start: string; end: string };\n\n/** Inclusive days of a period. `null` is an open edge, for example \"All time\" without a known first day. */\nexport type PeriodRange = { start: string | null; end: string | null };\n\n/** What a preset resolves against: today in the period's time zone and the first day of the week. */\nexport type PeriodContext = { today: string; weekStartsOn: 0 | 1 };\n\nexport type PeriodPreset = {\n key: string;\n /** Shown in the list and the trigger. Built-in presets bring a translated label; app presets name their own. */\n label?: string;\n resolve: (context: PeriodContext) => PeriodRange;\n};\n\n/** The clock a period is resolved with. Server and browser pass the same values so the first render agrees. */\nexport type PeriodClock = {\n /** The instant \"today\" is read from; defaults to now. */\n now?: Date;\n /** IANA time zone the days belong to, for example a base's zone; defaults to the runtime zone. */\n timeZone?: string;\n /** First day of the week, as in the calendar's date config; Monday by default. */\n weekStartsOn?: 0 | 1;\n /** Alias of `weekStartsOn`, accepted from a shared date config. */\n firstDayOfWeek?: 0 | 1;\n};\n\nconst keyDate = (key: string): Date => new Date(`${key}T00:00:00Z`);\nconst dateKeyOf = (date: Date): string => date.toISOString().slice(0, 10);\nconst day = (year: number, month: number, date: number): string => dateKeyOf(new Date(Date.UTC(year, month, date)));\nconst parts = (key: string) => ({ year: Number(key.slice(0, 4)), month: Number(key.slice(5, 7)) - 1, date: Number(key.slice(8, 10)) });\n\n/** Adds whole days to a date key; calendar days, so a DST change never moves it. */\nexport const addPeriodDays = (key: string, count: number): string => {\n const date = keyDate(key);\n date.setUTCDate(date.getUTCDate() + count);\n return dateKeyOf(date);\n};\n\n/** Number of days in an inclusive range of date keys. */\nexport const periodDayCount = (range: { start: string; end: string }): number =>\n Math.round((keyDate(range.end).getTime() - keyDate(range.start).getTime()) / 86_400_000) + 1;\n\nconst month = (key: string, offset: number): PeriodRange => {\n const { year, month } = parts(key);\n return { start: day(year, month + offset, 1), end: day(year, month + offset + 1, 0) };\n};\nconst quarter = (key: string, offset: number): PeriodRange => {\n const { year, month } = parts(key);\n const first = Math.floor(month / 3) * 3 + offset * 3;\n return { start: day(year, first, 1), end: day(year, first + 3, 0) };\n};\nconst year = (key: string, offset: number): PeriodRange => {\n const value = parts(key).year + offset;\n return { start: `${value}-01-01`, end: `${value}-12-31` };\n};\nconst week = (context: PeriodContext, offset: number): PeriodRange => {\n const weekday = keyDate(context.today).getUTCDay();\n const start = addPeriodDays(context.today, -((weekday - context.weekStartsOn + 7) % 7) + offset * 7);\n return { start, end: addPeriodDays(start, 6) };\n};\n\n/**\n * Built-in presets. Each covers its whole calendar period (\"This month\" is the 1st to the last day, not up to\n * today) in the period's time zone; weeks start on the context's first day of the week.\n */\nexport const periodPresets = {\n today: { key: \"today\", resolve: ({ today }) => ({ start: today, end: today }) },\n yesterday: { key: \"yesterday\", resolve: ({ today }) => ({ start: addPeriodDays(today, -1), end: addPeriodDays(today, -1) }) },\n thisWeek: { key: \"this-week\", resolve: (context) => week(context, 0) },\n lastWeek: { key: \"last-week\", resolve: (context) => week(context, -1) },\n thisMonth: { key: \"this-month\", resolve: ({ today }) => month(today, 0) },\n lastMonth: { key: \"last-month\", resolve: ({ today }) => month(today, -1) },\n thisQuarter: { key: \"this-quarter\", resolve: ({ today }) => quarter(today, 0) },\n lastQuarter: { key: \"last-quarter\", resolve: ({ today }) => quarter(today, -1) },\n thisYear: { key: \"this-year\", resolve: ({ today }) => year(today, 0) },\n lastYear: { key: \"last-year\", resolve: ({ today }) => year(today, -1) },\n /** Everything up to today; `since` is the first day with data when the app knows it, else the start stays open. */\n all: (options: { since?: string | null } = {}): PeriodPreset => ({\n key: \"all\",\n resolve: ({ today }) => ({ start: options.since ?? null, end: today }),\n }),\n} satisfies Record<string, PeriodPreset | ((options?: { since?: string | null }) => PeriodPreset)>;\n\nconst dateKeyPattern = /^\\d{4}-\\d{2}-\\d{2}$/;\n/** A real calendar day key, not only the shape (`2026-02-30` is refused). */\nexport const isPeriodDay = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !dateKeyPattern.test(value)) return false;\n const date = keyDate(value);\n return !Number.isNaN(date.getTime()) && dateKeyOf(date) === value;\n};\n\n/** Accepts a stored or URL value only when it is a known preset key or two real days in order. */\nexport const parsePeriodValue = (value: unknown, presets: readonly PeriodPreset[]): PeriodValue | undefined => {\n if (!value || typeof value !== \"object\") return undefined;\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.preset === \"string\")\n return presets.some((preset) => preset.key === candidate.preset) ? { preset: candidate.preset } : undefined;\n if (isPeriodDay(candidate.start) && isPeriodDay(candidate.end) && candidate.start <= candidate.end)\n return { start: candidate.start, end: candidate.end };\n return undefined;\n};\n\n/** The context presets resolve against: today in the clock's time zone. */\nexport const periodContext = (clock: PeriodClock = {}): PeriodContext => ({\n today: dates.formatDateKey(clock.now ?? new Date(), { timeZone: clock.timeZone }),\n weekStartsOn: clock.weekStartsOn ?? clock.firstDayOfWeek ?? 1,\n});\n\n/**\n * Resolves a value to inclusive days. Returns `undefined` for a preset key the list does not contain, so a stored\n * period that no longer exists is never silently replaced.\n */\nexport const resolvePeriod = (value: PeriodValue, presets: readonly PeriodPreset[], clock: PeriodClock = {}): PeriodRange | undefined => {\n if (!(\"preset\" in value)) return { start: value.start, end: value.end };\n return presets.find((preset) => preset.key === value.preset)?.resolve(periodContext(clock));\n};\n\n/**\n * The instants a query uses for a resolved period: `from` is the start of the first day and `to` the start of the\n * day after the last one (exclusive), both in the time zone. Days are never assumed to last 24 hours.\n */\nexport const periodInstants = (range: PeriodRange, timeZone: string): { from: string | null; to: string | null } => {\n const midnight = (key: string) => dates.zonedDateTimeToInstant(`${key}T00:00`, timeZone, { disambiguation: \"compatible\" });\n return { from: range.start ? midnight(range.start) : null, to: range.end ? midnight(addPeriodDays(range.end, 1)) : null };\n};\n\nconst utcFormat = (locale: string, options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: \"UTC\" });\n\n/**\n * Short days of a preset, for the list and the trigger: \"Sat, Nov 7\", \"Nov 1 – 30\", \"2025\", \"since 3/14/2019\".\n * The year is added only when the period is not in today's year.\n */\nexport const formatPeriodDays = (range: PeriodRange, today: string, locale: string, since: (date: string) => string): string => {\n if (!range.start) return \"\";\n if (!range.end) return since(utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).format(keyDate(range.start)));\n const start = keyDate(range.start);\n const end = keyDate(range.end);\n const sameYear = range.start.slice(0, 4) === range.end.slice(0, 4);\n if (sameYear && range.start.endsWith(\"-01-01\") && range.end.endsWith(\"-12-31\")) return range.start.slice(0, 4);\n if (range.end === today && range.start.slice(0, 4) !== today.slice(0, 4))\n return since(utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).format(start));\n const withYear = !sameYear || range.start.slice(0, 4) !== today.slice(0, 4);\n if (range.start === range.end)\n return utcFormat(locale, { weekday: \"short\", day: \"numeric\", month: \"short\", ...(withYear ? { year: \"numeric\" } : {}) }).format(start);\n return utcFormat(locale, { day: \"numeric\", month: \"short\", ...(withYear ? { year: \"numeric\" } : {}) }).formatRange(start, end);\n};\n\n/** Explicit days as numbers with the year: \"01.–07.11.2026\" in German, \"11/1/2026 – 11/7/2026\" in English. */\nexport const formatPeriodRange = (range: { start: string; end: string }, locale: string): string => {\n const format = utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\n return range.start === range.end ? format.format(keyDate(range.start)) : format.formatRange(keyDate(range.start), keyDate(range.end));\n};\n\n/** The widest explicit range within today's year, all of it (two-digit days, a three-digit count), so a trigger can reserve its width. */\nexport const widePeriodRangeSample = (today: string): { start: string; end: string } => {\n const year = today.slice(0, 4);\n return { start: `${year}-01-01`, end: `${year}-12-31` };\n};\n"],"mappings":"AAAA,SAAS,KAAK,QAAQ,aAAa;;AAEnC;AACA;AACA;AACA;;AAGA;;AAGA;;AAUA;;AAYA,MAAM,OAAO,GAAI,GAAW,IAAW,IAAI,IAAI,CAAC,GAAG,GAAG,YAAY,CAAC;AACnE,MAAM,SAAS,GAAI,IAAU,IAAa,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AACzE,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAY,KAAa,SAAS,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AACnH,MAAM,KAAK,GAAI,GAAW,KAAM;EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAAE,CAAC,CAAC;;AAEtI;AACA,OAAO,MAAM,aAAa,GAAG,CAAC,GAAW,EAAE,KAAa,KAAa;EACnE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;EACzB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,KAAK,CAAC;EAC1C,OAAO,SAAS,CAAC,IAAI,CAAC;AACxB,CAAC;;AAED;AACA,OAAO,MAAM,cAAc,GAAI,KAAqC,IAClE,IAAI,CAAC,KAAK,CAAC,CAAC,OAA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AAC,CAAC;EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC;AAChI,CAAC;;AAED;AACA,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAqC,EAAE,MAAc,KAAa;EAClG,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,SAAS;IAAE,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE;EAAU,CAAC,CAAC;EACvF,OAAO,KAAK,CAAC,KAAK,KAAK,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACvI,CAAC;;AAED;AACA,OAAO,MAAM,qBAAqB,GAAI,KAAa,IAAqC;EACtF,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;EAC9B,OAAO;IAAE,KAAK,EAAE,GAAG,IAAI,QAAQ;IAAE,GAAG,EAAE,GAAG,IAAI;EAAS,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/period.ts"],"sourcesContent":["import { dates } from \"@k2b/stdlib\";\n\n/**\n * A period as an app stores it: a preset key that stays relative (\"this month\" is next month's month too), or two\n * explicit days. Days are date keys such as `2026-11-01`; `end` is inclusive.\n */\nexport type PeriodValue = { preset: string } | { start: string; end: string };\n\n/** Inclusive days of a period. `null` is an open edge, for example \"All time\" without a known first day. */\nexport type PeriodRange = { start: string | null; end: string | null };\n\n/** What a preset resolves against: today in the period's time zone and the first day of the week. */\nexport type PeriodContext = { today: string; weekStartsOn: 0 | 1 };\n\nexport type PeriodPreset = {\n key: string;\n /** Shown in the list and the trigger. Built-in presets bring a translated label; app presets name their own. */\n label?: string;\n resolve: (context: PeriodContext) => PeriodRange;\n};\n\n/** The clock a period is resolved with. Server and browser pass the same values so the first render agrees. */\nexport type PeriodClock = {\n /** The instant \"today\" is read from; defaults to now. */\n now?: Date;\n /** IANA time zone the days belong to, for example a base's zone; defaults to the runtime zone. */\n timeZone?: string;\n /** First day of the week, as in the calendar's date config; Monday by default. */\n weekStartsOn?: 0 | 1;\n /** Alias of `weekStartsOn`, accepted from a shared date config. */\n firstDayOfWeek?: 0 | 1;\n};\n\nconst keyDate = (key: string): Date => new Date(`${key}T00:00:00Z`);\nconst dateKeyOf = (date: Date): string => date.toISOString().slice(0, 10);\nconst day = (year: number, month: number, date: number): string => dateKeyOf(new Date(Date.UTC(year, month, date)));\nconst parts = (key: string) => ({ year: Number(key.slice(0, 4)), month: Number(key.slice(5, 7)) - 1, date: Number(key.slice(8, 10)) });\n\n/** Adds whole days to a date key; calendar days, so a DST change never moves it. */\nexport const addPeriodDays = (key: string, count: number): string => {\n const date = keyDate(key);\n date.setUTCDate(date.getUTCDate() + count);\n return dateKeyOf(date);\n};\n\n/** Number of days in an inclusive range of date keys. */\nexport const periodDayCount = (range: { start: string; end: string }): number =>\n Math.round((keyDate(range.end).getTime() - keyDate(range.start).getTime()) / 86_400_000) + 1;\n\nconst month = (key: string, offset: number): PeriodRange => {\n const { year, month } = parts(key);\n return { start: day(year, month + offset, 1), end: day(year, month + offset + 1, 0) };\n};\nconst quarter = (key: string, offset: number): PeriodRange => {\n const { year, month } = parts(key);\n const first = Math.floor(month / 3) * 3 + offset * 3;\n return { start: day(year, first, 1), end: day(year, first + 3, 0) };\n};\nconst year = (key: string, offset: number): PeriodRange => {\n const value = parts(key).year + offset;\n return { start: `${value}-01-01`, end: `${value}-12-31` };\n};\nconst week = (context: PeriodContext, offset: number): PeriodRange => {\n const weekday = keyDate(context.today).getUTCDay();\n const start = addPeriodDays(context.today, -((weekday - context.weekStartsOn + 7) % 7) + offset * 7);\n return { start, end: addPeriodDays(start, 6) };\n};\n\n/**\n * Built-in presets. Each covers its whole calendar period (\"This month\" is the 1st to the last day, not up to\n * today) in the period's time zone; weeks start on the context's first day of the week.\n */\nexport const periodPresets = {\n today: { key: \"today\", resolve: ({ today }) => ({ start: today, end: today }) },\n yesterday: { key: \"yesterday\", resolve: ({ today }) => ({ start: addPeriodDays(today, -1), end: addPeriodDays(today, -1) }) },\n thisWeek: { key: \"this-week\", resolve: (context) => week(context, 0) },\n lastWeek: { key: \"last-week\", resolve: (context) => week(context, -1) },\n thisMonth: { key: \"this-month\", resolve: ({ today }) => month(today, 0) },\n lastMonth: { key: \"last-month\", resolve: ({ today }) => month(today, -1) },\n thisQuarter: { key: \"this-quarter\", resolve: ({ today }) => quarter(today, 0) },\n lastQuarter: { key: \"last-quarter\", resolve: ({ today }) => quarter(today, -1) },\n thisYear: { key: \"this-year\", resolve: ({ today }) => year(today, 0) },\n lastYear: { key: \"last-year\", resolve: ({ today }) => year(today, -1) },\n /** Everything up to today; `since` is the first day with data when the app knows it, else the start stays open. */\n all: (options: { since?: string | null } = {}): PeriodPreset => ({\n key: \"all\",\n resolve: ({ today }) => ({ start: options.since ?? null, end: today }),\n }),\n} satisfies Record<string, PeriodPreset | ((options?: { since?: string | null }) => PeriodPreset)>;\n\nconst dateKeyPattern = /^\\d{4}-\\d{2}-\\d{2}$/;\n/** A real calendar day key, not only the shape (`2026-02-30` is refused). */\nexport const isPeriodDay = (value: unknown): value is string => {\n if (typeof value !== \"string\" || !dateKeyPattern.test(value)) return false;\n const date = keyDate(value);\n return !Number.isNaN(date.getTime()) && dateKeyOf(date) === value;\n};\n\n/** Accepts a stored or URL value only when it is a known preset key or two real days in order. */\nexport const parsePeriodValue = (value: unknown, presets: readonly PeriodPreset[]): PeriodValue | undefined => {\n if (!value || typeof value !== \"object\") return undefined;\n const candidate = value as Record<string, unknown>;\n if (typeof candidate.preset === \"string\")\n return presets.some((preset) => preset.key === candidate.preset) ? { preset: candidate.preset } : undefined;\n if (isPeriodDay(candidate.start) && isPeriodDay(candidate.end) && candidate.start <= candidate.end)\n return { start: candidate.start, end: candidate.end };\n return undefined;\n};\n\n/** The context presets resolve against: today in the clock's time zone. */\nexport const periodContext = (clock: PeriodClock = {}): PeriodContext => ({\n today: dates.formatDateKey(clock.now ?? new Date(), { timeZone: clock.timeZone }),\n weekStartsOn: clock.weekStartsOn ?? clock.firstDayOfWeek ?? 1,\n});\n\n/**\n * Resolves a value to inclusive days. Returns `undefined` for a preset key the list does not contain, so a stored\n * period that no longer exists is never silently replaced.\n */\nexport const resolvePeriod = (value: PeriodValue, presets: readonly PeriodPreset[], clock: PeriodClock = {}): PeriodRange | undefined => {\n if (!(\"preset\" in value)) return { start: value.start, end: value.end };\n return presets.find((preset) => preset.key === value.preset)?.resolve(periodContext(clock));\n};\n\n/**\n * The instants a query uses for a resolved period: `from` is the start of the first day and `to` the start of the\n * day after the last one (exclusive), both in the time zone. Days are never assumed to last 24 hours.\n */\nexport const periodInstants = (range: PeriodRange, timeZone: string): { from: string | null; to: string | null } => {\n const midnight = (key: string) => dates.zonedDateTimeToInstant(`${key}T00:00`, timeZone, { disambiguation: \"compatible\" });\n return { from: range.start ? midnight(range.start) : null, to: range.end ? midnight(addPeriodDays(range.end, 1)) : null };\n};\n\n/**\n * How a period steps to its neighbour: calendar months, quarters and years keep their unit; every other range\n * keeps its own number of days, even when its edges happen to be month boundaries.\n */\nexport type PeriodStep = { months: number } | { days: number };\n\n/** What a period is, for its text and the way back to the current one. */\nexport type PeriodKind = \"day\" | \"week\" | \"month\" | \"quarter\" | \"year\" | \"range\";\n\nconst monthIndex = (key: string): number => parts(key).year * 12 + parts(key).month;\nconst daysBetween = (from: string, to: string): number => Math.round((keyDate(to).getTime() - keyDate(from).getTime()) / 86_400_000);\n\n/** The step of a period; `undefined` for an open edge, which has no neighbour. */\nexport const periodStep = (range: PeriodRange): PeriodStep | undefined => {\n if (!range.start || !range.end) return undefined;\n if (range.start.endsWith(\"-01\") && addPeriodDays(range.end, 1).endsWith(\"-01\")) {\n const months = monthIndex(range.end) - monthIndex(range.start) + 1;\n const first = parts(range.start).month;\n if (months === 1 || (months === 3 && first % 3 === 0) || (months === 12 && first === 0)) return { months };\n }\n return { days: periodDayCount({ start: range.start, end: range.end }) };\n};\n\n/** The period `count` steps away: `-1` is the previous one, `1` the next. */\nexport const stepPeriod = (range: { start: string; end: string }, step: PeriodStep, count: number): { start: string; end: string } => {\n if (\"months\" in step) {\n const { year, month } = parts(range.start);\n const first = month + step.months * count;\n return { start: day(year, first, 1), end: day(year, first + step.months, 0) };\n }\n return { start: addPeriodDays(range.start, step.days * count), end: addPeriodDays(range.end, step.days * count) };\n};\n\n/** The period of the same kind and rhythm that contains today: this week for a week, this month for a month. */\nexport const currentPeriodOf = (range: { start: string; end: string }, step: PeriodStep, today: string): { start: string; end: string } =>\n stepPeriod(\n range,\n step,\n \"months\" in step\n ? Math.floor((monthIndex(today) - monthIndex(range.start)) / step.months)\n : Math.floor(daysBetween(range.start, today) / step.days),\n );\n\nexport const periodKind = (range: { start: string; end: string }, weekStartsOn: 0 | 1): PeriodKind => {\n const step = periodStep(range);\n if (!step) return \"range\";\n if (\"months\" in step) {\n const first = parts(range.start).month;\n if (step.months === 1) return \"month\";\n if (step.months === 3 && first % 3 === 0) return \"quarter\";\n if (step.months === 12 && first === 0) return \"year\";\n return \"range\";\n }\n if (step.days === 1) return \"day\";\n if (step.days === 7 && keyDate(range.start).getUTCDay() === weekStartsOn) return \"week\";\n return \"range\";\n};\n\nconst utcFormat = (locale: string, options: Intl.DateTimeFormatOptions) => new Intl.DateTimeFormat(locale, { ...options, timeZone: \"UTC\" });\n\n/**\n * Short days of a preset, for the list and the trigger: \"Sat, Nov 7\", \"Nov 1 – 30\", \"2025\", \"since 3/14/2019\".\n * The year is added only when the period is not in today's year.\n */\nexport const formatPeriodDays = (range: PeriodRange, today: string, locale: string, since: (date: string) => string): string => {\n if (!range.start) return \"\";\n if (!range.end) return since(utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).format(keyDate(range.start)));\n const start = keyDate(range.start);\n const end = keyDate(range.end);\n const sameYear = range.start.slice(0, 4) === range.end.slice(0, 4);\n if (sameYear && range.start.endsWith(\"-01-01\") && range.end.endsWith(\"-12-31\")) return range.start.slice(0, 4);\n if (range.end === today && range.start.slice(0, 4) !== today.slice(0, 4))\n return since(utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" }).format(start));\n const withYear = !sameYear || range.start.slice(0, 4) !== today.slice(0, 4);\n if (range.start === range.end)\n return utcFormat(locale, { weekday: \"short\", day: \"numeric\", month: \"short\", ...(withYear ? { year: \"numeric\" } : {}) }).format(start);\n return utcFormat(locale, { day: \"numeric\", month: \"short\", ...(withYear ? { year: \"numeric\" } : {}) }).formatRange(start, end);\n};\n\n/** Explicit days as numbers with the year: \"01.–07.11.2026\" in German, \"11/1/2026 – 11/7/2026\" in English. */\nexport const formatPeriodRange = (range: { start: string; end: string }, locale: string): string => {\n const format = utcFormat(locale, { day: \"2-digit\", month: \"2-digit\", year: \"numeric\" });\n return range.start === range.end ? format.format(keyDate(range.start)) : format.formatRange(keyDate(range.start), keyDate(range.end));\n};\n\n/**\n * Explicit days that are one calendar week, month or year read as that: \"9.–15. Nov. 2026\", \"Oktober 2026\", \"2025\".\n * `undefined` for any other range, which keeps its numeric days and count.\n */\nexport const formatPeriodUnit = (range: { start: string; end: string }, weekStartsOn: 0 | 1, locale: string): string | undefined => {\n const kind = periodKind(range, weekStartsOn);\n if (kind === \"year\") return range.start.slice(0, 4);\n if (kind === \"month\") return utcFormat(locale, { month: \"long\", year: \"numeric\" }).format(keyDate(range.start));\n if (kind === \"week\")\n return utcFormat(locale, { day: \"numeric\", month: \"short\", year: \"numeric\" }).formatRange(keyDate(range.start), keyDate(range.end));\n return undefined;\n};\n\n/** The widest explicit range within today's year, all of it (two-digit days, a three-digit count), so a trigger can reserve its width. */\nexport const widePeriodRangeSample = (today: string): { start: string; end: string } => {\n const year = today.slice(0, 4);\n return { start: `${year}-01-01`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K,EAAE,MAAM;IAAE,IAAI,EAAE;EAAU,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;EAC/G,IAAI,IAAI,KAAK,MAAM,EACjB,OAAO,SAAS,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,SAAS;IAAE,KAAK,EAAE,OAAO;IAAE,IAAI,EAAE;EAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;EACrI,OAAO,SAAS;AAClB,CAAC;;AAED;AACA,OAAO,MAAM,qBAAqB,GAAI,KAAa,IAAqC;EACtF,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;EAC9B,OAAO;IAAE,KAAK,EAAE,GAAG,IAAI,QAAQ;IAAE,GAAG,EAAE,GAAG,IAAI;EAAS,CAAC;AACzD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rules of the typed time field: what a text means as a 24-hour clock time `HH:mm`, the minute grid of `step`, and
|
|
3
|
+
* the bounds `min` and `max`. `24:00` is a time only where `max` allows it, as the end of a day.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const DAY_END = 24 * 60;
|
|
7
|
+
const pad = value => String(value).padStart(2, "0");
|
|
8
|
+
|
|
9
|
+
/** `HH:mm` from minutes after midnight; 1440 is `24:00`. */
|
|
10
|
+
export const timeFromMinutes = minutes => `${pad(Math.floor(minutes / 60))}:${pad(minutes % 60)}`;
|
|
11
|
+
|
|
12
|
+
/** Minutes after midnight of an `HH:mm` value, or `null` for anything else. `24:00` is 1440. */
|
|
13
|
+
export const timeToMinutes = value => {
|
|
14
|
+
const match = value ? /^(\d{2}):(\d{2})$/.exec(value) : null;
|
|
15
|
+
if (!match) return null;
|
|
16
|
+
const minutes = Number(match[1]) * 60 + Number(match[2]);
|
|
17
|
+
return Number(match[2]) <= 59 && minutes <= DAY_END ? minutes : null;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Keeps what can still become a time while someone types: up to four digits and one separator after the hour.
|
|
22
|
+
* `.`, `h` and a space count as the separator and become `:`.
|
|
23
|
+
*/
|
|
24
|
+
export const filterTimeText = value => {
|
|
25
|
+
let hours = "";
|
|
26
|
+
let minutes = "";
|
|
27
|
+
let separated = false;
|
|
28
|
+
for (const character of value) {
|
|
29
|
+
if (/\d/.test(character)) {
|
|
30
|
+
if (separated) {
|
|
31
|
+
if (minutes.length < 2) minutes += character;
|
|
32
|
+
} else if (hours.length < 4) hours += character;
|
|
33
|
+
} else if (/[:.h\s]/i.test(character) && !separated && hours.length >= 1 && hours.length <= 2) {
|
|
34
|
+
separated = true;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return separated ? `${hours}:${minutes}` : hours;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* What a typed text means: `9` and `09` are 09:00, `930` and `0930` are 09:30, `9:5` is 09:05. Hours above 24 and
|
|
42
|
+
* minutes above 59 are no time; `24:00` is, and the bounds decide whether it is allowed.
|
|
43
|
+
*/
|
|
44
|
+
export const parseTimeText = text => {
|
|
45
|
+
const value = text.trim();
|
|
46
|
+
if (!value) return {
|
|
47
|
+
kind: "empty"
|
|
48
|
+
};
|
|
49
|
+
const parts = /^(\d{1,2})(?:[:.h\s](\d{1,2})?)?$/i.exec(value) ?? /^(\d{1,2})(\d{2})$/.exec(value);
|
|
50
|
+
if (!parts) return {
|
|
51
|
+
kind: "error"
|
|
52
|
+
};
|
|
53
|
+
const hours = Number(parts[1]);
|
|
54
|
+
const minutes = Number(parts[2] ?? 0);
|
|
55
|
+
if (minutes > 59 || hours * 60 + minutes > DAY_END) return {
|
|
56
|
+
kind: "error"
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
kind: "time",
|
|
60
|
+
value: timeFromMinutes(hours * 60 + minutes)
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The nearest time on the grid of `step` minutes, counted from `min` (or midnight). A time of the day that would round
|
|
66
|
+
* up to midnight takes the last grid line before it instead, so snapping never leaves the day.
|
|
67
|
+
*/
|
|
68
|
+
export const snapTime = (value, step, min) => {
|
|
69
|
+
const minutes = timeToMinutes(value);
|
|
70
|
+
if (minutes === null || !step || step <= 1) return value;
|
|
71
|
+
const anchor = timeToMinutes(min) ?? 0;
|
|
72
|
+
let snapped = Math.round((minutes - anchor) / step) * step + anchor;
|
|
73
|
+
if (snapped >= DAY_END && minutes < DAY_END) snapped -= step;
|
|
74
|
+
return timeFromMinutes(Math.max(0, snapped));
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/** Why a time lies outside `min`/`max`; without `max`, 23:59 is the last time of the day. */
|
|
78
|
+
export const timeLimitError = (value, limits) => {
|
|
79
|
+
const minutes = timeToMinutes(value);
|
|
80
|
+
if (minutes === null) return undefined;
|
|
81
|
+
const min = timeToMinutes(limits.min);
|
|
82
|
+
const max = timeToMinutes(limits.max) ?? DAY_END - 1;
|
|
83
|
+
if (min !== null && minutes < min) return {
|
|
84
|
+
code: "earliest",
|
|
85
|
+
time: timeFromMinutes(min)
|
|
86
|
+
};
|
|
87
|
+
if (minutes > max) return {
|
|
88
|
+
code: "latest",
|
|
89
|
+
time: timeFromMinutes(max)
|
|
90
|
+
};
|
|
91
|
+
return undefined;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=time-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["inputs/time-input.ts"],"sourcesContent":["/**\n * Rules of the typed time field: what a text means as a 24-hour clock time `HH:mm`, the minute grid of `step`, and\n * the bounds `min` and `max`. `24:00` is a time only where `max` allows it, as the end of a day.\n */\n\nexport type TimeTextResult = { kind: \"empty\" } | { kind: \"time\"; value: string } | { kind: \"error\" };\nexport type TimeLimitError = { code: \"earliest\"; time: string } | { code: \"latest\"; time: string };\n\nconst DAY_END = 24 * 60;\nconst pad = (value: number) => String(value).padStart(2, \"0\");\n\n/** `HH:mm` from minutes after midnight; 1440 is `24:00`. */\nexport const timeFromMinutes = (minutes: number): string => `${pad(Math.floor(minutes / 60))}:${pad(minutes % 60)}`;\n\n/** Minutes after midnight of an `HH:mm` value, or `null` for anything else. `24:00` is 1440. */\nexport const timeToMinutes = (value: string | null | undefined): number | null => {\n const match = value ? /^(\\d{2}):(\\d{2})$/.exec(value) : null;\n if (!match) return null;\n const minutes = Number(match[1]) * 60 + Number(match[2]);\n return Number(match[2]) <= 59 && minutes <= DAY_END ? minutes : null;\n};\n\n/**\n * Keeps what can still become a time while someone types: up to four digits and one separator after the hour.\n * `.`, `h` and a space count as the separator and become `:`.\n */\nexport const filterTimeText = (value: string): string => {\n let hours = \"\";\n let minutes = \"\";\n let separated = false;\n for (const character of value) {\n if (/\\d/.test(character)) {\n if (separated) {\n if (minutes.length < 2) minutes += character;\n } else if (hours.length < 4) hours += character;\n } else if (/[:.h\\s]/i.test(character) && !separated && hours.length >= 1 && hours.length <= 2) {\n separated = true;\n }\n }\n return separated ? `${hours}:${minutes}` : hours;\n};\n\n/**\n * What a typed text means: `9` and `09` are 09:00, `930` and `0930` are 09:30, `9:5` is 09:05. Hours above 24 and\n * minutes above 59 are no time; `24:00` is, and the bounds decide whether it is allowed.\n */\nexport const parseTimeText = (text: string): TimeTextResult => {\n const value = text.trim();\n if (!value) return { kind: \"empty\" };\n const parts = /^(\\d{1,2})(?:[:.h\\s](\\d{1,2})?)?$/i.exec(value) ?? /^(\\d{1,2})(\\d{2})$/.exec(value);\n if (!parts) return { kind: \"error\" };\n const hours = Number(parts[1]);\n const minutes = Number(parts[2] ?? 0);\n if (minutes > 59 || hours * 60 + minutes > DAY_END) return { kind: \"error\" };\n return { kind: \"time\", value: timeFromMinutes(hours * 60 + minutes) };\n};\n\n/**\n * The nearest time on the grid of `step` minutes, counted from `min` (or midnight). A time of the day that would round\n * up to midnight takes the last grid line before it instead, so snapping never leaves the day.\n */\nexport const snapTime = (value: string, step: number | undefined, min?: string): string => {\n const minutes = timeToMinutes(value);\n if (minutes === null || !step || step <= 1) return value;\n const anchor = timeToMinutes(min) ?? 0;\n let snapped = Math.round((minutes - anchor) / step) * step + anchor;\n if (snapped >= DAY_END && minutes < DAY_END) snapped -= step;\n return timeFromMinutes(Math.max(0, snapped));\n};\n\n/** Why a time lies outside `min`/`max`; without `max`, 23:59 is the last time of the day. */\nexport const timeLimitError = (value: string, limits: { min?: string; max?: string }): TimeLimitError | undefined => {\n const minutes = timeToMinutes(value);\n if (minutes === null) return undefined;\n const min = timeToMinutes(limits.min);\n const max = timeToMinutes(limits.max) ?? DAY_END - 1;\n if (min !== null && minutes < min) return { code: \"earliest\", time: timeFromMinutes(min) };\n if (minutes > max) return { code: \"latest\", time: timeFromMinutes(max) };\n return undefined;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAKA,MAAM,OAAO,GAAG,EAAE,GAAG,EAAE;AACvB,MAAM,GAAG,GAAI,KAAa,IAAK,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;;AAE7D;AACA,OAAO,MAAM,eAAe,GAAI,OAAe,IAAa,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,EAAE;;AAEnH;AACA,OAAO,MAAM,aAAa,GAAI,KAAgC,IAAoB;EAChF,MAAM,KAAK,GAAG,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI;EAC5D,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI;EACvB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,G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AAC,IAAI,OAAO,GAAG,CAAC;EACpD,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,GAAG,EAAE,OAAO;IAAE,IAAI,EAAE,UAAU;IAAE,IAAI,EAAE,eAAe,CAAC,GAAG;EAAE,CAAC;EAC1F,IAAI,OAAO,GAAG,GAAG,EAAE,OAAO;IAAE,IAAI,EAAE,QAAQ;IAAE,IAAI,EAAE,eAAe,CAAC,GAAG;EAAE,CAAC;EACxE,OAAO,SAAS;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Waits for the exit transitions that the stylesheet starts on an element that just closed, such as a dialog whose
|
|
3
|
+
* `[open]` went away, and then calls `done` once. Without a running transition (reduced motion, a sheet that moves
|
|
4
|
+
* itself, a document without the stylesheet) `done` runs at once. Only the element's own transitions count: a spinner
|
|
5
|
+
* inside it may loop forever.
|
|
6
|
+
*
|
|
7
|
+
* Returns a function that ends the wait at once and calls `done` now, for a new dialog that opens meanwhile or a page
|
|
8
|
+
* swap that disposes everything.
|
|
9
|
+
*/
|
|
10
|
+
export const afterExitTransitions = (element, done) => {
|
|
11
|
+
let pending = true;
|
|
12
|
+
const finish = () => {
|
|
13
|
+
if (pending) {
|
|
14
|
+
pending = false;
|
|
15
|
+
done();
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
// When the element's own transitions end (a timer also fires in a hidden tab, which renders no frames).
|
|
19
|
+
const ends = (element.getAnimations?.() ?? []).filter(animation => "transitionProperty" in animation).map(animation => Number(animation.effect?.getComputedTiming().endTime) || 0);
|
|
20
|
+
if (ends.length > 0) setTimeout(finish, Math.max(...ends));else finish();
|
|
21
|
+
return finish;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=exit-motion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["internal/exit-motion.ts"],"sourcesContent":["/**\n * Waits for the exit transitions that the stylesheet starts on an element that just closed, such as a dialog whose\n * `[open]` went away, and then calls `done` once. Without a running transition (reduced motion, a sheet that moves\n * itself, a document without the stylesheet) `done` runs at once. Only the element's own transitions count: a spinner\n * inside it may loop forever.\n *\n * Returns a function that ends the wait at once and calls `done` now, for a new dialog that opens meanwhile or a page\n * swap that disposes everything.\n */\nexport const afterExitTransitions = (element: Element, done: () => void): (() => void) => {\n let pending = true;\n const finish = () => {\n if (pending) {\n pending = false;\n done();\n }\n };\n // When the element's own transitions end (a timer also fires in a hidden tab, which renders no frames).\n const ends = (element.getAnimations?.() ?? [])\n .filter((animation) => \"transitionProperty\" in animation)\n .map((animation) => Number(animation.effect?.getComputedTiming().endTime) || 0);\n if (ends.length > 0) setTimeout(finish, Math.max(...ends));\n else finish();\n return finish;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,oBAAoB,GAAG,CAAC,OAAgB,EAAE,IAAgB,KAAmB;EACxF,IAAI,OAAO,GAAG,IAAI;EAClB,MAAM,MAAM,GAAG,MAAM;IACnB,IAAI,OAAO,EAAE;MACX,OAAO,GAAG,KAAK;MACf,IAAI,CAAC,CAAC;IACR;EACF,CAAC;EACD;EACA,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,aAAa,GAAG,CAAC,IAAI,EAAE,EAC1C,MAAM,CAAE,SAAS,IAAK,oBAAoB,IAAI,SAAS,CAAC,CACxD,GAAG,CAAE,SAAS,IAAK,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;EACjF,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,KACtD,MAAM,CAAC,CAAC;EACb,OAAO,MAAM;AACf,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
2
|
+
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
3
|
+
import { escape as _$escape } from "solid-js/web";
|
|
4
|
+
var _tmpl$ = ["<small", ">", "</small>"],
|
|
5
|
+
_tmpl$2 = ["<span class=\"k2b-option-visual\" aria-hidden=\"true\">", "</span>"],
|
|
6
|
+
_tmpl$3 = ["<span class=\"k2b-sr-only\">", "</span>"];
|
|
7
|
+
import { createMemo } from "solid-js";
|
|
8
|
+
/**
|
|
9
|
+
* The second line of an option row, as a `<small>`, or nothing without a
|
|
10
|
+
* description. With a `descriptionVisual`, such as a colored `Tag`, the visual
|
|
11
|
+
* shows in place of the description. The text stays in the row, hidden from
|
|
12
|
+
* view, so search, the accessible name, and the description a screen reader
|
|
13
|
+
* reads do not change. The visual keeps the line's height.
|
|
14
|
+
*
|
|
15
|
+
* Every option list calls this one function, so each call stays small in the
|
|
16
|
+
* islands that ship several lists. Only whether the line exists decides when
|
|
17
|
+
* its element is made: a host that rebuilds equal options, such as a menu
|
|
18
|
+
* whose entries come and go while someone types, keeps the element, and only
|
|
19
|
+
* its content follows.
|
|
20
|
+
*/
|
|
21
|
+
export const optionDescription = (option, className, id) => {
|
|
22
|
+
const line = () => typeof option === "function" ? option() : option;
|
|
23
|
+
const shown = createMemo(() => !!line().description);
|
|
24
|
+
// Read here, inside the caller's insert: it re-runs only when the line comes or goes.
|
|
25
|
+
return shown() && _$ssr(_tmpl$, _$ssrAttribute("class", _$escape(className, true), false) + _$ssrAttribute("id", _$escape(id, true), false), line().descriptionVisual ? _$escape([_$ssr(_tmpl$2, _$escape(line().descriptionVisual?.())), _$ssr(_tmpl$3, _$escape(line().description))]) : _$escape(line().description));
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=option-description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["internal/option-description.tsx"],"sourcesContent":["import { createMemo, type JSX } from \"solid-js\";\n\ntype OptionLine = { description?: string; descriptionVisual?: () => JSX.Element };\n\n/**\n * The second line of an option row, as a `<small>`, or nothing without a\n * description. With a `descriptionVisual`, such as a colored `Tag`, the visual\n * shows in place of the description. The text stays in the row, hidden from\n * view, so search, the accessible name, and the description a screen reader\n * reads do not change. The visual keeps the line's height.\n *\n * Every option list calls this one function, so each call stays small in the\n * islands that ship several lists. Only whether the line exists decides when\n * its element is made: a host that rebuilds equal options, such as a menu\n * whose entries come and go while someone types, keeps the element, and only\n * its content follows.\n */\nexport const optionDescription = (option: OptionLine | (() => OptionLine), className?: string, id?: string): JSX.Element => {\n const line = () => (typeof option === \"function\" ? option() : option);\n const shown = createMemo(() => !!line().description);\n // Read here, inside the caller's insert: it re-runs only when the line comes or goes.\n return (\n shown() && (\n <small class={className} id={id}>\n {line().descriptionVisual\n ? [\n <span class=\"k2b-option-visual\" aria-hidden=\"true\">\n {line().descriptionVisual?.()}\n </span>,\n <span class=\"k2b-sr-only\">{line().description}</span>,\n ]\n : line().description}\n </small>\n )\n );\n};\n"],"mappings":";;;;;;AAAA,SAAS,UAAU,QAAkB,UAAU;AAI/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,iBAAiB,GAAG,CAAC,MAAuC,EAAE,SAAkB,EAAE,EAAW,KAAkB;EAC1H,MAAM,IAAI,GAAG,MAAO,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,CAAC,CAAC,GAAG,MAAO;EACrE,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC;EACpD;EACA,OACE,KAAK,CAAC,CAAC,mDACS,SAAS,gDAAM,EAAE,iBAC5B,IAAI,CAAC,CAAC,CAAC,iBAAiB,YACrB,yBAEK,IAAI,CAAC,CAAC,CAAC,iBAAiB,GAAG,CAAC,4BAEJ,IAAI,CAAC,CAAC,CAAC,WAAW,GAC9C,aACD,IAAI,CAAC,CAAC,CAAC,WAAW,EAEzB;AAEL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll places of a dialog level that is hidden or moved, given back when it shows again: its own scrollers and the
|
|
3
|
+
* frame's, when the frame itself scrolls the level.
|
|
4
|
+
*/
|
|
5
|
+
const places = new WeakMap();
|
|
6
|
+
export const keepScroll = (level, frame) => places.set(level, [frame, level, ...level.querySelectorAll("*")].filter(element => element.scrollTop > 0 || element.scrollLeft > 0).map(element => [element, element.scrollTop, element.scrollLeft]));
|
|
7
|
+
export const restoreScroll = level => {
|
|
8
|
+
for (const [element, top, left] of places.get(level) ?? []) element.scrollTo({
|
|
9
|
+
top,
|
|
10
|
+
left,
|
|
11
|
+
behavior: "instant"
|
|
12
|
+
});
|
|
13
|
+
places.delete(level);
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=scroll-places.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["internal/scroll-places.ts"],"sourcesContent":["/**\n * Scroll places of a dialog level that is hidden or moved, given back when it shows again: its own scrollers and the\n * frame's, when the frame itself scrolls the level.\n */\nconst places = new WeakMap<HTMLElement, (readonly [HTMLElement, number, number])[]>();\n\nexport const keepScroll = (level: HTMLElement, frame: HTMLElement) =>\n places.set(\n level,\n [frame, level, ...level.querySelectorAll<HTMLElement>(\"*\")]\n .filter((element) => element.scrollTop > 0 || element.scrollLeft > 0)\n .map((element) => [element, element.scrollTop, element.scrollLeft] as const),\n );\n\nexport const restoreScroll = (level: HTMLElement) => {\n for (const [element, top, left] of places.get(level) ?? []) element.scrollTo({ top, left, behavior: \"instant\" });\n places.delete(level);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,MAAM,MAAM,GAAG,IAAI,OAAO,CAA0D,CAAC;AAErF,OAAO,MAAM,UAAU,GAAG,CAAC,KAAkB,EAAE,KAAkB,KAC/D,MAAM,CAAC,GAAG,CACR,KAAK,EACL,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,gBAAgB,CAAc,GAAG,CAAC,CAAC,CACxD,MAAM,CAAE,OAAO,IAAK,OAAO,CAAC,SAAS,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CACpE,GAAG,CAAE,OAAO,IAAK,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAU,CAC/E,CAAC;AAEH,OAAO,MAAM,aAAa,GAAI,KAAkB,IAAK;EACnD,KAAK,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC;IAAE,GAAG;IAAE,IAAI;IAAE,QAAQ,EAAE;EAAU,CAAC,CAAC;EAChH,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;AACtB,CAAC","ignoreList":[]}
|