@splendidlabz/svelte 4.0.1 → 4.2.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/CHANGELOG.md +25 -2
- package/components/Breadcrumbs/Breadcrumbs.svelte +10 -10
- package/components/Codepen/Codepen.svelte +11 -14
- package/components/Codepen/index.js +0 -1
- package/components/Disclosure/Disclosure/DisclosureContent.svelte +2 -2
- package/components/Disclosure/Drawer/DrawerCloseButton.svelte +2 -2
- package/{dist/components/Disclosure/DrawerNew/DrawerClose.svelte → components/Disclosure/DrawerNew/DrawerCloseButton.svelte} +8 -4
- package/{dist/components/Disclosure/DrawerNew/Drawer.svelte → components/Disclosure/DrawerNew/DrawerContent.svelte} +10 -8
- package/components/Disclosure/DrawerNew/index.js +8 -3
- package/{dist/components/Disclosure/ModalNew/Modal.svelte → components/Disclosure/ModalNew/ModalContent.svelte} +23 -7
- package/components/Disclosure/ModalNew/index.js +2 -2
- package/{dist/components/Disclosure/PopoverNew/Popover.svelte → components/Disclosure/PopoverNew/PopoverContent.svelte} +1 -1
- package/components/Disclosure/PopoverNew/PopoverTrigger.svelte +16 -6
- package/components/Disclosure/PopoverNew/floating.js +5 -2
- package/components/Disclosure/PopoverNew/index.js +2 -1
- package/components/FancyList/FancyList.svelte +54 -29
- package/components/Form/ButtonGroup.svelte +65 -0
- package/components/Form/Checkbox.svelte +7 -7
- package/components/Form/Combobox/TimepickerOptions.svelte +3 -4
- package/{dist/components/Form/Select.svelte → components/Form/CustomSelect.svelte} +65 -35
- package/components/Form/Form.svelte +37 -22
- package/components/Form/Honeypot.svelte +12 -0
- package/components/Form/Radios.svelte +2 -2
- package/components/Form/Select.svelte +50 -35
- package/components/Form/Textarea.svelte +0 -5
- package/components/Form/index.js +3 -0
- package/components/Link/Link.svelte +15 -0
- package/components/Link/index.js +1 -0
- package/components/PushToLocalStorage.svelte +9 -18
- package/components/SVG/SVG.svelte +49 -0
- package/components/SVG/index.js +2 -0
- package/components/SVG/parser.js +133 -0
- package/components/Status.svelte +8 -1
- package/components/Tabs/Tablist.svelte +2 -0
- package/components/Tabs/Tabpanels.svelte +1 -0
- package/components/Vimeo.svelte +3 -3
- package/components/Youtube.svelte +18 -7
- package/index.js +8 -7
- package/package.json +6 -5
- package/utils/accessibility.js +6 -0
- package/utils/index.js +2 -0
- package/utils/map-store.svelte.js +71 -0
- package/components/Codepen/Codepen.astro +0 -29
- package/components/Disclosure/DrawerNew/Drawer.svelte +0 -43
- package/components/Disclosure/DrawerNew/DrawerClose.svelte +0 -17
- package/components/Disclosure/ModalNew/Modal.svelte +0 -116
- package/components/Form/SelectOld2.svelte +0 -127
- package/dist/actions/breakpoint-observer.d.ts +0 -3
- package/dist/actions/breakpoint-observer.js +0 -71
- package/dist/actions/index.d.ts +0 -5
- package/dist/actions/index.js +0 -5
- package/dist/actions/portal.d.ts +0 -3
- package/dist/actions/portal.js +0 -20
- package/dist/actions/resize-observer.d.ts +0 -7
- package/dist/actions/resize-observer.js +0 -43
- package/dist/actions/scroll-observer.d.ts +0 -8
- package/dist/actions/scroll-observer.js +0 -47
- package/dist/actions/sync.svelte.d.ts +0 -5
- package/dist/actions/sync.svelte.js +0 -21
- package/dist/actions/use-actions.d.ts +0 -4
- package/dist/actions/use-actions.js +0 -27
- package/dist/actions/use-transition.d.ts +0 -4
- package/dist/actions/use-transition.js +0 -32
- package/dist/common.d.ts +0 -17
- package/dist/common.js +0 -21
- package/dist/components/Accordion/Accordion.svelte +0 -111
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -23
- package/dist/components/Accordion/index.d.ts +0 -2
- package/dist/components/Accordion/index.js +0 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte +0 -92
- package/dist/components/Breadcrumbs/Breadcrumbs.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/Crumb.svelte +0 -51
- package/dist/components/Breadcrumbs/Crumb.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/CrumbCustom.svelte +0 -18
- package/dist/components/Breadcrumbs/CrumbCustom.svelte.d.ts +0 -23
- package/dist/components/Breadcrumbs/index.d.ts +0 -4
- package/dist/components/Breadcrumbs/index.js +0 -5
- package/dist/components/BrowserFrame/BrowserFrame.svelte +0 -101
- package/dist/components/BrowserFrame/BrowserFrame.svelte.d.ts +0 -23
- package/dist/components/BrowserFrame/BrowserWithTabs.svelte +0 -37
- package/dist/components/BrowserFrame/BrowserWithTabs.svelte.d.ts +0 -41
- package/dist/components/BrowserFrame/index.d.ts +0 -3
- package/dist/components/BrowserFrame/index.js +0 -3
- package/dist/components/CQChecker/CQChecker.astro +0 -20
- package/dist/components/CQChecker/CQChecker.svelte +0 -89
- package/dist/components/CQChecker/CQChecker.svelte.d.ts +0 -35
- package/dist/components/Callout/Callout.svelte +0 -17
- package/dist/components/Callout/Callout.svelte.d.ts +0 -29
- package/dist/components/Callout/index.d.ts +0 -2
- package/dist/components/Callout/index.js +0 -3
- package/dist/components/Codepen/Codepen.astro +0 -29
- package/dist/components/Codepen/Codepen.svelte +0 -24
- package/dist/components/Codepen/Codepen.svelte.d.ts +0 -35
- package/dist/components/Codepen/index.d.ts +0 -2
- package/dist/components/Codepen/index.js +0 -3
- package/dist/components/ContentList/ContentList-old.svelte +0 -117
- package/dist/components/ContentList/ContentList-old.svelte.d.ts +0 -31
- package/dist/components/ContentList/ContentList.svelte +0 -68
- package/dist/components/ContentList/ContentList.svelte.d.ts +0 -45
- package/dist/components/ContentList/index.d.ts +0 -2
- package/dist/components/ContentList/index.js +0 -3
- package/dist/components/Copyright.svelte +0 -19
- package/dist/components/Copyright.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureCloseButton.svelte +0 -37
- package/dist/components/Disclosure/Disclosure/DisclosureCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureContent.svelte +0 -97
- package/dist/components/Disclosure/Disclosure/DisclosureContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/DisclosureTrigger.svelte +0 -51
- package/dist/components/Disclosure/Disclosure/DisclosureTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Disclosure/disclosure-popover.svelte.d.ts +0 -2
- package/dist/components/Disclosure/Disclosure/disclosure-popover.svelte.js +0 -7
- package/dist/components/Disclosure/Disclosure/disclosure.svelte.d.ts +0 -81
- package/dist/components/Disclosure/Disclosure/disclosure.svelte.js +0 -461
- package/dist/components/Disclosure/Disclosure/index.d.ts +0 -3
- package/dist/components/Disclosure/Disclosure/index.js +0 -4
- package/dist/components/Disclosure/DisclosureNew/DisclosureCloseButton.svelte +0 -38
- package/dist/components/Disclosure/DisclosureNew/DisclosureCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/DisclosureContent.svelte +0 -53
- package/dist/components/Disclosure/DisclosureNew/DisclosureContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/DisclosureTrigger.svelte +0 -79
- package/dist/components/Disclosure/DisclosureNew/DisclosureTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DisclosureNew/disclosures.svelte.d.ts +0 -3
- package/dist/components/Disclosure/DisclosureNew/disclosures.svelte.js +0 -55
- package/dist/components/Disclosure/DisclosureNew/index.d.ts +0 -4
- package/dist/components/Disclosure/DisclosureNew/index.js +0 -5
- package/dist/components/Disclosure/Drawer/Drawer.svelte +0 -31
- package/dist/components/Disclosure/Drawer/Drawer.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerCloseButton.svelte +0 -37
- package/dist/components/Disclosure/Drawer/DrawerCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerContent.svelte +0 -92
- package/dist/components/Disclosure/Drawer/DrawerContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerNew.svelte +0 -0
- package/dist/components/Disclosure/Drawer/DrawerNew.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/DrawerTrigger.svelte +0 -11
- package/dist/components/Disclosure/Drawer/DrawerTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Drawer/drawer.d.ts +0 -35
- package/dist/components/Disclosure/Drawer/drawer.js +0 -44
- package/dist/components/Disclosure/Drawer/index.d.ts +0 -5
- package/dist/components/Disclosure/Drawer/index.js +0 -6
- package/dist/components/Disclosure/DrawerNew/Drawer.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/DrawerClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/DrawerTrigger.svelte +0 -15
- package/dist/components/Disclosure/DrawerNew/DrawerTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/DrawerNew/drawer.d.ts +0 -35
- package/dist/components/Disclosure/DrawerNew/drawer.js +0 -44
- package/dist/components/Disclosure/DrawerNew/index.d.ts +0 -4
- package/dist/components/Disclosure/DrawerNew/index.js +0 -5
- package/dist/components/Disclosure/Dropdown/DropdownContent.svelte +0 -15
- package/dist/components/Disclosure/Dropdown/DropdownContent.svelte.d.ts +0 -29
- package/dist/components/Disclosure/Dropdown/DropdownTrigger.svelte +0 -14
- package/dist/components/Disclosure/Dropdown/DropdownTrigger.svelte.d.ts +0 -31
- package/dist/components/Disclosure/Dropdown/dropdown.d.ts +0 -4
- package/dist/components/Disclosure/Dropdown/dropdown.js +0 -4
- package/dist/components/Disclosure/Dropdown/index.d.ts +0 -3
- package/dist/components/Disclosure/Dropdown/index.js +0 -4
- package/dist/components/Disclosure/Modal/Modal.svelte +0 -30
- package/dist/components/Disclosure/Modal/Modal.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalCloseButton.svelte +0 -7
- package/dist/components/Disclosure/Modal/ModalCloseButton.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalContent.svelte +0 -42
- package/dist/components/Disclosure/Modal/ModalContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/ModalTrigger.svelte +0 -11
- package/dist/components/Disclosure/Modal/ModalTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Modal/exit-intent.d.ts +0 -3
- package/dist/components/Disclosure/Modal/exit-intent.js +0 -17
- package/dist/components/Disclosure/Modal/index.d.ts +0 -4
- package/dist/components/Disclosure/Modal/index.js +0 -5
- package/dist/components/Disclosure/Modal/modal.d.ts +0 -4
- package/dist/components/Disclosure/Modal/modal.js +0 -4
- package/dist/components/Disclosure/ModalNew/Modal.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/ModalClose.svelte +0 -42
- package/dist/components/Disclosure/ModalNew/ModalClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/ModalTrigger.svelte +0 -68
- package/dist/components/Disclosure/ModalNew/ModalTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/ModalNew/index.d.ts +0 -4
- package/dist/components/Disclosure/ModalNew/index.js +0 -5
- package/dist/components/Disclosure/Popover/PopoverCloseButton.svelte +0 -29
- package/dist/components/Disclosure/Popover/PopoverCloseButton.svelte.d.ts +0 -35
- package/dist/components/Disclosure/Popover/PopoverContent.svelte +0 -107
- package/dist/components/Disclosure/Popover/PopoverContent.svelte.d.ts +0 -47
- package/dist/components/Disclosure/Popover/PopoverTrigger.svelte +0 -33
- package/dist/components/Disclosure/Popover/PopoverTrigger.svelte.d.ts +0 -41
- package/dist/components/Disclosure/Popover/floating.d.ts +0 -11
- package/dist/components/Disclosure/Popover/floating.js +0 -171
- package/dist/components/Disclosure/Popover/index.d.ts +0 -4
- package/dist/components/Disclosure/Popover/index.js +0 -5
- package/dist/components/Disclosure/Popover/popover.d.ts +0 -16
- package/dist/components/Disclosure/Popover/popover.js +0 -18
- package/dist/components/Disclosure/Popover/references/FollowTheMouse.svelte +0 -45
- package/dist/components/Disclosure/Popover/references/FollowTheMouse.svelte.d.ts +0 -14
- package/dist/components/Disclosure/PopoverNew/Popover.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/PopoverClose.svelte +0 -38
- package/dist/components/Disclosure/PopoverNew/PopoverClose.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/PopoverTrigger.svelte +0 -67
- package/dist/components/Disclosure/PopoverNew/PopoverTrigger.svelte.d.ts +0 -23
- package/dist/components/Disclosure/PopoverNew/floating.d.ts +0 -15
- package/dist/components/Disclosure/PopoverNew/floating.js +0 -329
- package/dist/components/Disclosure/PopoverNew/index.d.ts +0 -4
- package/dist/components/Disclosure/PopoverNew/index.js +0 -5
- package/dist/components/Disclosure/Tooltip/Tooltip.svelte +0 -14
- package/dist/components/Disclosure/Tooltip/Tooltip.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Tooltip/TooltipContent.svelte +0 -7
- package/dist/components/Disclosure/Tooltip/TooltipContent.svelte.d.ts +0 -23
- package/dist/components/Disclosure/Tooltip/TooltipTrigger.svelte +0 -33
- package/dist/components/Disclosure/Tooltip/TooltipTrigger.svelte.d.ts +0 -35
- package/dist/components/Disclosure/Tooltip/index.d.ts +0 -4
- package/dist/components/Disclosure/Tooltip/index.js +0 -5
- package/dist/components/Disclosure/Tooltip/tooltip.d.ts +0 -19
- package/dist/components/Disclosure/Tooltip/tooltip.js +0 -22
- package/dist/components/Disclosure/disclosure-store.d.ts +0 -21
- package/dist/components/Disclosure/disclosure-store.js +0 -48
- package/dist/components/Disclosure/disclosure.d.ts +0 -81
- package/dist/components/Disclosure/disclosure.js +0 -439
- package/dist/components/Disclosure/disclosure.svelte.d.ts +0 -83
- package/dist/components/Disclosure/disclosure.svelte.js +0 -432
- package/dist/components/Disclosure/index.d.ts +0 -3
- package/dist/components/Disclosure/index.js +0 -7
- package/dist/components/Disclosure/shared.d.ts +0 -2
- package/dist/components/Disclosure/shared.js +0 -9
- package/dist/components/Disclosure/state.svelte.d.ts +0 -0
- package/dist/components/Disclosure/state.svelte.js +0 -138
- package/dist/components/FancyList/FancyList.svelte +0 -49
- package/dist/components/FancyList/FancyList.svelte.d.ts +0 -42
- package/dist/components/FancyList/index.d.ts +0 -2
- package/dist/components/FancyList/index.js +0 -3
- package/dist/components/Form/Button.svelte +0 -24
- package/dist/components/Form/Button.svelte.d.ts +0 -35
- package/dist/components/Form/Checkbox.svelte +0 -95
- package/dist/components/Form/Checkbox.svelte.d.ts +0 -23
- package/dist/components/Form/Checkboxes.svelte +0 -66
- package/dist/components/Form/Checkboxes.svelte.d.ts +0 -23
- package/dist/components/Form/Combobox/AutocompleteInput.svelte +0 -63
- package/dist/components/Form/Combobox/AutocompleteInput.svelte.d.ts +0 -31
- package/dist/components/Form/Combobox/AutocompleteOptions.svelte +0 -74
- package/dist/components/Form/Combobox/AutocompleteOptions.svelte.d.ts +0 -35
- package/dist/components/Form/Combobox/TimepickerInput.svelte +0 -81
- package/dist/components/Form/Combobox/TimepickerInput.svelte.d.ts +0 -31
- package/dist/components/Form/Combobox/TimepickerOptions.svelte +0 -100
- package/dist/components/Form/Combobox/TimepickerOptions.svelte.d.ts +0 -27
- package/dist/components/Form/Combobox/autocomplete-matching.d.ts +0 -13
- package/dist/components/Form/Combobox/autocomplete-matching.js +0 -114
- package/dist/components/Form/Combobox/autocomplete.d.ts +0 -38
- package/dist/components/Form/Combobox/autocomplete.js +0 -393
- package/dist/components/Form/Combobox/combobox-store.d.ts +0 -24
- package/dist/components/Form/Combobox/combobox-store.js +0 -65
- package/dist/components/Form/Combobox/combobox.d.ts +0 -46
- package/dist/components/Form/Combobox/combobox.js +0 -360
- package/dist/components/Form/Combobox/index.d.ts +0 -5
- package/dist/components/Form/Combobox/index.js +0 -14
- package/dist/components/Form/Combobox/timepicker.d.ts +0 -22
- package/dist/components/Form/Combobox/timepicker.js +0 -119
- package/dist/components/Form/Form.svelte +0 -54
- package/dist/components/Form/Form.svelte.d.ts +0 -23
- package/dist/components/Form/Hidden.svelte +0 -6
- package/dist/components/Form/Hidden.svelte.d.ts +0 -23
- package/dist/components/Form/HiddenInput.svelte +0 -16
- package/dist/components/Form/HiddenInput.svelte.d.ts +0 -31
- package/dist/components/Form/Radio.svelte +0 -86
- package/dist/components/Form/Radio.svelte.d.ts +0 -23
- package/dist/components/Form/Radios.svelte +0 -68
- package/dist/components/Form/Radios.svelte.d.ts +0 -23
- package/dist/components/Form/Select.svelte.d.ts +0 -23
- package/dist/components/Form/SelectOld2.svelte +0 -127
- package/dist/components/Form/SelectOld2.svelte.d.ts +0 -55
- package/dist/components/Form/Switch.svelte +0 -50
- package/dist/components/Form/Switch.svelte.d.ts +0 -39
- package/dist/components/Form/TextInput.svelte +0 -110
- package/dist/components/Form/TextInput.svelte.d.ts +0 -23
- package/dist/components/Form/Textarea.svelte +0 -126
- package/dist/components/Form/Textarea.svelte.d.ts +0 -23
- package/dist/components/Form/check.svg +0 -3
- package/dist/components/Form/index.d.ts +0 -13
- package/dist/components/Form/index.js +0 -13
- package/dist/components/Highlight/Highlight.svelte +0 -27
- package/dist/components/Highlight/Highlight.svelte.d.ts +0 -31
- package/dist/components/Highlight/_Highlight.scss +0 -19
- package/dist/components/Highlight/index.d.ts +0 -2
- package/dist/components/Highlight/index.js +0 -2
- package/dist/components/Highlight.svelte +0 -46
- package/dist/components/Highlight.svelte.d.ts +0 -27
- package/dist/components/Icon/Icon.svelte +0 -44
- package/dist/components/Icon/Icon.svelte.d.ts +0 -27
- package/dist/components/Icon/IconSnippet.svelte +0 -14
- package/dist/components/Icon/IconSnippet.svelte.d.ts +0 -30
- package/dist/components/Icon/index.d.ts +0 -3
- package/dist/components/Icon/index.js +0 -3
- package/dist/components/Image.svelte +0 -24
- package/dist/components/Image.svelte.d.ts +0 -33
- package/dist/components/InteractiveRegion/InteractiveRegion.svelte +0 -47
- package/dist/components/InteractiveRegion/InteractiveRegion.svelte.d.ts +0 -27
- package/dist/components/InteractiveRegion/index.d.ts +0 -2
- package/dist/components/InteractiveRegion/index.js +0 -3
- package/dist/components/List/Lia.svelte +0 -12
- package/dist/components/List/Lia.svelte.d.ts +0 -37
- package/dist/components/List/NestedListItem.svelte +0 -50
- package/dist/components/List/NestedListItem.svelte.d.ts +0 -27
- package/dist/components/List/index.d.ts +0 -3
- package/dist/components/List/index.js +0 -3
- package/dist/components/Markdown/Markdown.svelte +0 -25
- package/dist/components/Markdown/Markdown.svelte.d.ts +0 -28
- package/dist/components/Markdown/MarkdownSnippet.svelte +0 -27
- package/dist/components/Markdown/MarkdownSnippet.svelte.d.ts +0 -29
- package/dist/components/Masonry/Masonry.svelte +0 -79
- package/dist/components/Masonry/Masonry.svelte.d.ts +0 -29
- package/dist/components/Masonry/index.d.ts +0 -2
- package/dist/components/Masonry/index.js +0 -3
- package/dist/components/PerspectiveHover/PerspectiveHover.svelte +0 -10
- package/dist/components/PerspectiveHover/PerspectiveHover.svelte.d.ts +0 -27
- package/dist/components/PerspectiveHover/perspective-hover.d.ts +0 -3
- package/dist/components/PerspectiveHover/perspective-hover.js +0 -46
- package/dist/components/Populate/ConditionalPopulate.svelte +0 -33
- package/dist/components/Populate/ConditionalPopulate.svelte.d.ts +0 -27
- package/dist/components/Populate/Populate.svelte +0 -45
- package/dist/components/Populate/Populate.svelte.d.ts +0 -24
- package/dist/components/Populate/actions.d.ts +0 -2
- package/dist/components/Populate/actions.js +0 -29
- package/dist/components/Populate/get-value.d.ts +0 -5
- package/dist/components/Populate/get-value.js +0 -17
- package/dist/components/Populate/index.d.ts +0 -3
- package/dist/components/Populate/index.js +0 -4
- package/dist/components/Portal.svelte +0 -30
- package/dist/components/Portal.svelte.d.ts +0 -23
- package/dist/components/PushToLocalStorage.svelte +0 -30
- package/dist/components/PushToLocalStorage.svelte.d.ts +0 -23
- package/dist/components/Resizer/Resizer.svelte +0 -38
- package/dist/components/Resizer/Resizer.svelte.d.ts +0 -23
- package/dist/components/Resizer/index.d.ts +0 -2
- package/dist/components/Resizer/index.js +0 -3
- package/dist/components/Resizer/resizer.d.ts +0 -3
- package/dist/components/Resizer/resizer.js +0 -134
- package/dist/components/Scrambler/Scrambler.svelte +0 -20
- package/dist/components/Scrambler/Scrambler.svelte.d.ts +0 -23
- package/dist/components/Scrambler/index.d.ts +0 -2
- package/dist/components/Scrambler/index.js +0 -3
- package/dist/components/Spotlight/PointerPosition.d.ts +0 -3
- package/dist/components/Spotlight/PointerPosition.js +0 -32
- package/dist/components/Spotlight/Spotlight.svelte +0 -9
- package/dist/components/Spotlight/Spotlight.svelte.d.ts +0 -27
- package/dist/components/Status.svelte +0 -27
- package/dist/components/Status.svelte.d.ts +0 -23
- package/dist/components/Switcheroo/Switcheroo.svelte +0 -70
- package/dist/components/Switcheroo/Switcheroo.svelte.d.ts +0 -34
- package/dist/components/Switcheroo/index.d.ts +0 -2
- package/dist/components/Switcheroo/index.js +0 -3
- package/dist/components/Table/RowGroup.svelte +0 -8
- package/dist/components/Table/RowGroup.svelte.d.ts +0 -27
- package/dist/components/Table/Table.svelte +0 -23
- package/dist/components/Table/Table.svelte.d.ts +0 -33
- package/dist/components/Table/Td.svelte +0 -20
- package/dist/components/Table/Td.svelte.d.ts +0 -35
- package/dist/components/Table/Th.svelte +0 -27
- package/dist/components/Table/Th.svelte.d.ts +0 -35
- package/dist/components/Table/Thead.svelte +0 -8
- package/dist/components/Table/Thead.svelte.d.ts +0 -27
- package/dist/components/Table/Tr.svelte +0 -8
- package/dist/components/Table/Tr.svelte.d.ts +0 -29
- package/dist/components/Table/index.d.ts +0 -6
- package/dist/components/Table/index.js +0 -17
- package/dist/components/Table/table.d.ts +0 -2
- package/dist/components/Table/table.js +0 -35
- package/dist/components/Tabs/Tab.svelte +0 -9
- package/dist/components/Tabs/Tab.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tablist.svelte +0 -79
- package/dist/components/Tabs/Tablist.svelte.d.ts +0 -39
- package/dist/components/Tabs/Tabpanel.svelte +0 -9
- package/dist/components/Tabs/Tabpanel.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tabpanels.svelte +0 -11
- package/dist/components/Tabs/Tabpanels.svelte.d.ts +0 -23
- package/dist/components/Tabs/Tabs.svelte +0 -46
- package/dist/components/Tabs/Tabs.svelte.d.ts +0 -23
- package/dist/components/Tabs/index.d.ts +0 -6
- package/dist/components/Tabs/index.js +0 -7
- package/dist/components/Tabs/tab-store.d.ts +0 -21
- package/dist/components/Tabs/tab-store.js +0 -59
- package/dist/components/Tabs/tabs.d.ts +0 -32
- package/dist/components/Tabs/tabs.js +0 -364
- package/dist/components/Textwall/Repeat.svelte +0 -10
- package/dist/components/Textwall/Repeat.svelte.d.ts +0 -29
- package/dist/components/Textwall/Textwall.svelte +0 -29
- package/dist/components/Textwall/Textwall.svelte.d.ts +0 -37
- package/dist/components/Textwall/index.d.ts +0 -3
- package/dist/components/Textwall/index.js +0 -4
- package/dist/components/Typewriter/Typewriter.svelte +0 -70
- package/dist/components/Typewriter/Typewriter.svelte.d.ts +0 -27
- package/dist/components/Typewriter/index.d.ts +0 -2
- package/dist/components/Typewriter/index.js +0 -3
- package/dist/components/Video.svelte +0 -46
- package/dist/components/Video.svelte.d.ts +0 -33
- package/dist/components/Vimeo.svelte +0 -18
- package/dist/components/Vimeo.svelte.d.ts +0 -29
- package/dist/components/Wrapper.svelte +0 -22
- package/dist/components/Wrapper.svelte.d.ts +0 -33
- package/dist/components/Youtube.svelte +0 -15
- package/dist/components/Youtube.svelte.d.ts +0 -25
- package/dist/components/_Shared/Snippet.svelte +0 -10
- package/dist/components/_Shared/Snippet.svelte.d.ts +0 -27
- package/dist/components/effects/index.d.ts +0 -0
- package/dist/components/effects/index.js +0 -0
- package/dist/index.d.ts +0 -34
- package/dist/index.js +0 -41
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
export function comboboxAssociatedInput(node: any, props?: {}): void;
|
|
2
|
-
/**
|
|
3
|
-
* Initializes Combobox Input
|
|
4
|
-
* @param {HTMLElement} node - The DOM node to which the combobox input behavior will be attached.
|
|
5
|
-
* @param {Object} [props={}] - An optional object containing properties to configure the combobox input.
|
|
6
|
-
* @returns {Object} An object with a `destroy` method to clean up the combobox input behavior.
|
|
7
|
-
*/
|
|
8
|
-
export function comboboxInput(node: HTMLElement, props?: any): any;
|
|
9
|
-
export function listboxTrigger(): void;
|
|
10
|
-
/**
|
|
11
|
-
* Initializes a listbox component on the given DOM node with the specified properties.
|
|
12
|
-
* @param {HTMLElement} node - The DOM node to which the listbox behavior will be attached.
|
|
13
|
-
* @param {Object} [passedProps={}] - An optional object containing properties to configure the listbox.
|
|
14
|
-
* @param {boolean} [passedProps.multiple=false] - If true, allows multiple selections; otherwise, only one item can be selected.
|
|
15
|
-
* @param {Function} [passedProps.onSelect] - A callback function that is called when an item is selected.
|
|
16
|
-
*/
|
|
17
|
-
export function listbox(node: HTMLElement, props?: {}): {
|
|
18
|
-
destroy(): void;
|
|
19
|
-
};
|
|
20
|
-
export namespace DEFAULT_COMBOBOX_INPUT_OPTIONS {
|
|
21
|
-
namespace disclosure {
|
|
22
|
-
let showOnClick: boolean;
|
|
23
|
-
let focusTriggerOnClose: boolean;
|
|
24
|
-
let shiftTabBackToContent: boolean;
|
|
25
|
-
}
|
|
26
|
-
namespace input {
|
|
27
|
-
let showDisclosureOnClick: boolean;
|
|
28
|
-
let loop: boolean;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export const COMBOBOX_INPUT_OPTION_KEYS: string[];
|
|
32
|
-
export namespace DEFAULT_LISTBOX_OPTIONS {
|
|
33
|
-
export namespace disclosure_1 {
|
|
34
|
-
let focusTarget: any;
|
|
35
|
-
}
|
|
36
|
-
export { disclosure_1 as disclosure };
|
|
37
|
-
export namespace floating {
|
|
38
|
-
let placement: string;
|
|
39
|
-
let offset: string;
|
|
40
|
-
}
|
|
41
|
-
export namespace options {
|
|
42
|
-
let onSelect: any;
|
|
43
|
-
let preserveSelectedIndex: boolean;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export const LISTBOX_OPTION_KEYS: string[];
|
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addListeners,
|
|
3
|
-
getSiblingElements,
|
|
4
|
-
isArrowKey,
|
|
5
|
-
isShiftTab,
|
|
6
|
-
isTab,
|
|
7
|
-
randomString,
|
|
8
|
-
removeListeners,
|
|
9
|
-
} from '@splendidlabz/utils/dom'
|
|
10
|
-
import {
|
|
11
|
-
close as closeDisclosure,
|
|
12
|
-
open as openDisclosure,
|
|
13
|
-
} from '../../Disclosure/disclosure.js'
|
|
14
|
-
import { initCombobox, updateCombobox } from './combobox-store.js'
|
|
15
|
-
|
|
16
|
-
import { getDisclosure } from '../../Disclosure/disclosure-store.js'
|
|
17
|
-
import { omitEmpty } from '@splendidlabz/utils'
|
|
18
|
-
|
|
19
|
-
// Shifted focusTriggerOnClose to disclosureContent
|
|
20
|
-
export const DEFAULT_COMBOBOX_INPUT_OPTIONS = {
|
|
21
|
-
disclosure: {
|
|
22
|
-
showOnClick: false,
|
|
23
|
-
focusTriggerOnClose: false,
|
|
24
|
-
shiftTabBackToContent: false,
|
|
25
|
-
},
|
|
26
|
-
input: {
|
|
27
|
-
showDisclosureOnClick: true,
|
|
28
|
-
loop: true,
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const COMBOBOX_INPUT_OPTION_KEYS = Object.keys(
|
|
33
|
-
DEFAULT_COMBOBOX_INPUT_OPTIONS.input,
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
export const DEFAULT_LISTBOX_OPTIONS = {
|
|
37
|
-
disclosure: {
|
|
38
|
-
focusTarget: null,
|
|
39
|
-
},
|
|
40
|
-
floating: {
|
|
41
|
-
placement: 'bottom-start',
|
|
42
|
-
offset: '0.75rem',
|
|
43
|
-
},
|
|
44
|
-
options: {
|
|
45
|
-
onSelect: null,
|
|
46
|
-
preserveSelectedIndex: true,
|
|
47
|
-
},
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export const LISTBOX_OPTION_KEYS = Object.keys(DEFAULT_LISTBOX_OPTIONS.options)
|
|
51
|
-
|
|
52
|
-
// Allows tampering of submitted value to the database.
|
|
53
|
-
export function comboboxAssociatedInput(node, props = {}) {
|
|
54
|
-
const listboxId = node.getAttribute('listbox-id')
|
|
55
|
-
|
|
56
|
-
const comboboxInfo = {
|
|
57
|
-
id: listboxId,
|
|
58
|
-
nodes: { toSubmit: node },
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
initCombobox(comboboxInfo)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Initializes Combobox Input
|
|
66
|
-
* @param {HTMLElement} node - The DOM node to which the combobox input behavior will be attached.
|
|
67
|
-
* @param {Object} [props={}] - An optional object containing properties to configure the combobox input.
|
|
68
|
-
* @returns {Object} An object with a `destroy` method to clean up the combobox input behavior.
|
|
69
|
-
*/
|
|
70
|
-
export function comboboxInput(node, props = {}) {
|
|
71
|
-
const listboxId = node.getAttribute('listbox-id')
|
|
72
|
-
const disclosureId = listboxId.split('-')[0]
|
|
73
|
-
|
|
74
|
-
const comboboxInfo = {
|
|
75
|
-
id: listboxId,
|
|
76
|
-
state: {
|
|
77
|
-
...omitEmpty(props.state),
|
|
78
|
-
selectedOptionId: null,
|
|
79
|
-
},
|
|
80
|
-
options: props.options,
|
|
81
|
-
nodes: { input: node },
|
|
82
|
-
stores: { disclosure: getDisclosure(disclosureId) },
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const Box = initCombobox(comboboxInfo)
|
|
86
|
-
|
|
87
|
-
node.setAttribute('role', 'combobox')
|
|
88
|
-
node.setAttribute('aria-controls', listboxId)
|
|
89
|
-
node.setAttribute('aria-owns', listboxId)
|
|
90
|
-
// aria-expanded is handled by disclosure.
|
|
91
|
-
|
|
92
|
-
// I can probably set activedescendant here directly too... Shall explore later.
|
|
93
|
-
// Aria haspopup is implied and defaults to listbox. No need to set unless there is dialog... but popover IS dialog? So have to set on Popover too...
|
|
94
|
-
// node.setAttribute('aria-haspopup', 'listbox')
|
|
95
|
-
|
|
96
|
-
const listeners = [
|
|
97
|
-
{
|
|
98
|
-
event: 'click',
|
|
99
|
-
node,
|
|
100
|
-
handler: handleClick,
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
event: 'keydown',
|
|
104
|
-
node,
|
|
105
|
-
handler: handleKeydown,
|
|
106
|
-
},
|
|
107
|
-
]
|
|
108
|
-
|
|
109
|
-
addListeners(listeners)
|
|
110
|
-
|
|
111
|
-
function handleClick(event) {
|
|
112
|
-
const { showDisclosureOnClick } = Box.options
|
|
113
|
-
if (showDisclosureOnClick) openDisclosure(Box.stores.disclosure)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function handleKeydown(event) {
|
|
117
|
-
const { key } = event
|
|
118
|
-
|
|
119
|
-
if (isArrowKey(key)) {
|
|
120
|
-
if (key === 'ArrowUp') highlightPrevOption(Box)
|
|
121
|
-
if (key === 'ArrowDown') highlightNextOption(Box)
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (key === 'Enter') {
|
|
125
|
-
event.preventDefault()
|
|
126
|
-
selectCurrentOption(Box)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (isTab(event)) selectCurrentOption(Box)
|
|
130
|
-
if (isShiftTab(event)) closeDisclosure(Box.stores.disclosure)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return {
|
|
134
|
-
destroy() {
|
|
135
|
-
removeListeners(listeners)
|
|
136
|
-
},
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export function listboxTrigger() {}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Initializes a listbox component on the given DOM node with the specified properties.
|
|
144
|
-
* @param {HTMLElement} node - The DOM node to which the listbox behavior will be attached.
|
|
145
|
-
* @param {Object} [passedProps={}] - An optional object containing properties to configure the listbox.
|
|
146
|
-
* @param {boolean} [passedProps.multiple=false] - If true, allows multiple selections; otherwise, only one item can be selected.
|
|
147
|
-
* @param {Function} [passedProps.onSelect] - A callback function that is called when an item is selected.
|
|
148
|
-
*/
|
|
149
|
-
export function listbox(node, props = {}) {
|
|
150
|
-
const id = node.getAttribute('id')
|
|
151
|
-
const disclosureId = id.split('-')[0]
|
|
152
|
-
|
|
153
|
-
const comboboxInfo = {
|
|
154
|
-
id,
|
|
155
|
-
state: omitEmpty(props.state),
|
|
156
|
-
options: omitEmpty(props.options),
|
|
157
|
-
nodes: { listbox: node },
|
|
158
|
-
stores: { disclosure: getDisclosure(disclosureId) },
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const Box = initCombobox(comboboxInfo)
|
|
162
|
-
|
|
163
|
-
// Initialize with appropriate aria attributes for listbox node and options
|
|
164
|
-
node.setAttribute('role', 'listbox')
|
|
165
|
-
node.setAttribute('tabindex', '0')
|
|
166
|
-
|
|
167
|
-
const options = getOptions(Box)
|
|
168
|
-
for (const option of options) {
|
|
169
|
-
if (!option.id) option.id = randomString(8)
|
|
170
|
-
option.setAttribute('role', 'option')
|
|
171
|
-
option.setAttribute('aria-selected', 'false')
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// Highlighted selected option (if any)
|
|
175
|
-
// We need to use selectedIndex because id is regenerated on each render.
|
|
176
|
-
// This cannot be changed unless Svelte key works with Astro slots (they don't at 2024/07/25).
|
|
177
|
-
setTimeout(_ => {
|
|
178
|
-
console.log(Box)
|
|
179
|
-
const { selectedOptionIndex } = Box.state
|
|
180
|
-
console.log(selectedOptionIndex)
|
|
181
|
-
const option = getOptions(Box)[selectedOptionIndex]
|
|
182
|
-
console.log(option)
|
|
183
|
-
if (option) highlightOption(Box, option)
|
|
184
|
-
}, 0)
|
|
185
|
-
|
|
186
|
-
const listeners = [
|
|
187
|
-
{
|
|
188
|
-
event: 'click',
|
|
189
|
-
node,
|
|
190
|
-
handler: handleClick,
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
event: 'pointerover',
|
|
194
|
-
node,
|
|
195
|
-
handler: handlePointerOver,
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
event: 'pointerout',
|
|
199
|
-
node,
|
|
200
|
-
handler: handlePointerOut,
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
event: 'keydown',
|
|
204
|
-
node,
|
|
205
|
-
handler: handleKeydown,
|
|
206
|
-
},
|
|
207
|
-
]
|
|
208
|
-
|
|
209
|
-
addListeners(listeners)
|
|
210
|
-
|
|
211
|
-
function handleClick(event) {
|
|
212
|
-
const { target } = event
|
|
213
|
-
if (target.getAttribute('role') !== 'option') return
|
|
214
|
-
selectOption(Box, target)
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function handlePointerOver(event) {
|
|
218
|
-
const { target } = event
|
|
219
|
-
|
|
220
|
-
// Do not disturb pointer interactions with automatic scrolling.
|
|
221
|
-
if (target.getAttribute('role') === 'option')
|
|
222
|
-
highlightOption(Box, target, { scroll: false })
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function handlePointerOut(event) {
|
|
226
|
-
removeAllHighlightedOptions(Box)
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
return {
|
|
230
|
-
destroy() {
|
|
231
|
-
removeListeners(listeners)
|
|
232
|
-
},
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// But this should NOT be triggered if there it is in popover + Combobox mode... have to check
|
|
236
|
-
// This will only activate if the listbox is focused.
|
|
237
|
-
function handleKeydown(event) {
|
|
238
|
-
const { key } = event
|
|
239
|
-
|
|
240
|
-
if (isArrowKey(key)) {
|
|
241
|
-
if (key === 'ArrowUp') highlightPrevOption(Box)
|
|
242
|
-
if (key === 'ArrowDown') highlightNextOption(Box)
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
if (key === 'Enter') {
|
|
246
|
-
event.preventDefault()
|
|
247
|
-
selectCurrentOption(Box)
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if (isTab(event)) selectCurrentOption(Box)
|
|
251
|
-
if (isShiftTab(event)) closeDisclosure(Box.stores.disclosure)
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Highlighting methods
|
|
256
|
-
// ------------------------
|
|
257
|
-
function getOptions(Box) {
|
|
258
|
-
return Array.from(Box.nodes.listbox.children)
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
function highlightOption(Box, option, { scroll = true } = {}) {
|
|
262
|
-
const optionId = option.getAttribute('id')
|
|
263
|
-
const siblings = getSiblingElements(option)
|
|
264
|
-
|
|
265
|
-
option.setAttribute('aria-selected', true)
|
|
266
|
-
for (const sibling of siblings) {
|
|
267
|
-
sibling.setAttribute('aria-selected', false)
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// Adjust scroll so highlighted option remains visible
|
|
271
|
-
if (scroll) option.scrollIntoView({ block: 'nearest', behavior: 'instant' })
|
|
272
|
-
|
|
273
|
-
Box.state.highlightedOptionId = optionId
|
|
274
|
-
|
|
275
|
-
updateCombobox(Box)
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
function getHighlightedOptionIndex(Box) {
|
|
279
|
-
const options = getOptions(Box)
|
|
280
|
-
return options.findIndex(
|
|
281
|
-
option => option.id === Box.state.highlightedOptionId,
|
|
282
|
-
)
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
function removeAllHighlightedOptions(Box) {
|
|
286
|
-
const options = getOptions(Box)
|
|
287
|
-
for (const option of options) {
|
|
288
|
-
option.setAttribute('aria-selected', false)
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
Box.state.highlightedOptionId = null
|
|
292
|
-
updateCombobox(Box)
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
function highlightFirstOption(Box) {
|
|
296
|
-
const options = getOptions(Box)
|
|
297
|
-
const firstOption = options[0]
|
|
298
|
-
highlightOption(Box, firstOption)
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
function highlightLastOption(Box) {
|
|
302
|
-
const options = getOptions(Box)
|
|
303
|
-
const lastOption = options[options.length - 1]
|
|
304
|
-
highlightOption(Box, lastOption)
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
function highlightNextOption(Box) {
|
|
308
|
-
const options = getOptions(Box)
|
|
309
|
-
const index = getHighlightedOptionIndex(Box)
|
|
310
|
-
|
|
311
|
-
const nextOption = options[index + 1]
|
|
312
|
-
if (nextOption) highlightOption(Box, nextOption)
|
|
313
|
-
else if (Box.options.loop) highlightFirstOption(Box)
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function highlightPrevOption(Box) {
|
|
317
|
-
const options = getOptions(Box)
|
|
318
|
-
const index = getHighlightedOptionIndex(Box)
|
|
319
|
-
|
|
320
|
-
const prevOption = options[index - 1]
|
|
321
|
-
if (prevOption) highlightOption(Box, prevOption)
|
|
322
|
-
else if (Box.options.loop) highlightLastOption(Box)
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Selecting methods
|
|
326
|
-
// ------------------------
|
|
327
|
-
function selectOption(Box, option) {
|
|
328
|
-
const { onSelect, preserveSelectedIndex } = Box.options
|
|
329
|
-
if (onSelect)
|
|
330
|
-
onSelect(option) // Custom select handler
|
|
331
|
-
else {
|
|
332
|
-
// Default select handler
|
|
333
|
-
// Cannot use 'value' directly value is 0 when used on non-input elements. So we use 'data-value' instead.
|
|
334
|
-
const text = option.textContent.trim()
|
|
335
|
-
const value = option.dataset.value
|
|
336
|
-
|
|
337
|
-
// Fill input with option text if standard select handler
|
|
338
|
-
Box.nodes.input.value = text
|
|
339
|
-
|
|
340
|
-
// Fill associated input with option value
|
|
341
|
-
Box.nodes.toSubmit.value = value
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
if (preserveSelectedIndex) {
|
|
345
|
-
const index = getHighlightedOptionIndex(Box)
|
|
346
|
-
Box.state.selectedOptionIndex = index
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
Box.state.highlightedOptionId = null
|
|
350
|
-
|
|
351
|
-
updateCombobox(Box)
|
|
352
|
-
closeDisclosure(Box.stores.disclosure)
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function selectCurrentOption(Box) {
|
|
356
|
-
const options = getOptions(Box)
|
|
357
|
-
const index = getHighlightedOptionIndex(Box)
|
|
358
|
-
const option = options[index]
|
|
359
|
-
selectOption(Box, option)
|
|
360
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import AutocompleteInput from './AutocompleteInput.svelte';
|
|
2
|
-
import AutocompleteOptions from './AutocompleteOptions.svelte';
|
|
3
|
-
import TimepickerInput from './TimepickerInput.svelte';
|
|
4
|
-
import TimepickerOptions from './TimepickerOptions.svelte';
|
|
5
|
-
export { AutocompleteInput, AutocompleteOptions, AutocompleteInput as ComboboxInput, AutocompleteOptions as ComboboxOptions, TimepickerInput, TimepickerOptions };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import AutocompleteInput from './AutocompleteInput.svelte'
|
|
2
|
-
import AutocompleteOptions from './AutocompleteOptions.svelte'
|
|
3
|
-
import TimepickerInput from './TimepickerInput.svelte'
|
|
4
|
-
import TimepickerOptions from './TimepickerOptions.svelte'
|
|
5
|
-
|
|
6
|
-
// Combobox has been renamed to Autocomplete
|
|
7
|
-
export {
|
|
8
|
-
AutocompleteInput,
|
|
9
|
-
AutocompleteOptions,
|
|
10
|
-
AutocompleteInput as ComboboxInput,
|
|
11
|
-
AutocompleteOptions as ComboboxOptions,
|
|
12
|
-
TimepickerInput,
|
|
13
|
-
TimepickerOptions,
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export function detailedTimepicker(node: any, options?: {}): void;
|
|
2
|
-
export function generateTimings(options?: {}): {
|
|
3
|
-
blocked: any;
|
|
4
|
-
minutes: any;
|
|
5
|
-
timeString: string;
|
|
6
|
-
timeString24H: string;
|
|
7
|
-
}[];
|
|
8
|
-
export namespace DEFAULT_TIMEPICKER_OPTIONS {
|
|
9
|
-
let mode: string;
|
|
10
|
-
let selection: string;
|
|
11
|
-
let start: string;
|
|
12
|
-
let end: string;
|
|
13
|
-
let interval: string;
|
|
14
|
-
let format: string;
|
|
15
|
-
let blockedTimes: any[];
|
|
16
|
-
let showBlockedTimes: boolean;
|
|
17
|
-
}
|
|
18
|
-
export namespace DEFAULT_TIMEPICKER_DISCLOSURE_OPTS {
|
|
19
|
-
let showOnClick: boolean;
|
|
20
|
-
let focusTriggerOnClose: boolean;
|
|
21
|
-
let shiftTabBackToContent: boolean;
|
|
22
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
export const DEFAULT_TIMEPICKER_OPTIONS = {
|
|
2
|
-
mode: 'listbox', // list, listbox, detailed
|
|
3
|
-
selection: 'single', // single/multiple
|
|
4
|
-
start: '00:00',
|
|
5
|
-
end: '24:00',
|
|
6
|
-
interval: '30m', // m or h
|
|
7
|
-
format: 'hh:mm', // HH == 24h clock hh == 12h clock mm = minutes ss = seconds
|
|
8
|
-
blockedTimes: [], // Example blocked interval
|
|
9
|
-
showBlockedTimes: true,
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const DEFAULT_TIMEPICKER_DISCLOSURE_OPTS = {
|
|
13
|
-
showOnClick: true,
|
|
14
|
-
focusTriggerOnClose: false,
|
|
15
|
-
shiftTabBackToContent: false,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function detailedTimepicker(node, options = {}) {}
|
|
19
|
-
|
|
20
|
-
export function generateTimings(options = {}) {
|
|
21
|
-
options = Object.assign({}, DEFAULT_TIMEPICKER_OPTIONS, options)
|
|
22
|
-
const { start, end, interval, format, blockedTimes, showBlockedTimes } =
|
|
23
|
-
options
|
|
24
|
-
|
|
25
|
-
// Initialize timings array
|
|
26
|
-
const timings = []
|
|
27
|
-
const intervalInMinutes =
|
|
28
|
-
parseInt(interval, 10) * (interval.includes('h') ? 60 : 1)
|
|
29
|
-
const blockedMinutes = blockedTimes.map(([start, end]) => {
|
|
30
|
-
return [timeStringToMinutes(start), timeStringToMinutes(end)]
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
let minutes = timeStringToMinutes(start);
|
|
35
|
-
minutes <= timeStringToMinutes(end);
|
|
36
|
-
minutes += intervalInMinutes
|
|
37
|
-
) {
|
|
38
|
-
const time = {
|
|
39
|
-
minutes,
|
|
40
|
-
timeString: minutesToTimeString(minutes, format),
|
|
41
|
-
timeString24H: minutesToTimeString(minutes, 'HH:mm'),
|
|
42
|
-
}
|
|
43
|
-
const blocked = isBlockedMinutes(minutes, blockedMinutes)
|
|
44
|
-
if (showBlockedTimes) timings.push({ ...time, blocked })
|
|
45
|
-
else {
|
|
46
|
-
if (!blocked) {
|
|
47
|
-
timings.push({ ...time, blocked: false })
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return timings
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Helper function to convert time string to minutes
|
|
56
|
-
function timeStringToMinutes(time) {
|
|
57
|
-
const [hours, minutes] = time.split(':').map(Number)
|
|
58
|
-
return hours * 60 + minutes
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Helper function to convert minutes back to time string
|
|
62
|
-
function minutesToTimeString(minutes, format) {
|
|
63
|
-
let hours = Math.floor(minutes / 60)
|
|
64
|
-
const mins = minutes % 60
|
|
65
|
-
const seconds = 0 // Assuming seconds are always 0 as input is in minutes
|
|
66
|
-
const timestringParts = []
|
|
67
|
-
|
|
68
|
-
// Adjust for the 24:00 case to correctly represent it as 00:00
|
|
69
|
-
if (hours === 24) hours = 0
|
|
70
|
-
|
|
71
|
-
// Determine if AM/PM is needed
|
|
72
|
-
const isAmPm = format.includes('h') || format.includes('hh')
|
|
73
|
-
const ampm = hours >= 12 ? 'PM' : 'AM'
|
|
74
|
-
|
|
75
|
-
// Define time components based on the format
|
|
76
|
-
const timeComponents = {
|
|
77
|
-
HH: hours.toString().padStart(2, '0'),
|
|
78
|
-
H: hours.toString(),
|
|
79
|
-
hh: (hours % 12 || 12).toString().padStart(2, '0'),
|
|
80
|
-
h: (hours % 12 || 12).toString(),
|
|
81
|
-
mm: mins.toString().padStart(2, '0'),
|
|
82
|
-
m: mins.toString(),
|
|
83
|
-
ss: seconds.toString().padStart(2, '0'),
|
|
84
|
-
s: seconds.toString(),
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (format.includes('H')) {
|
|
88
|
-
if (format.includes('HH')) timestringParts.push(timeComponents.HH)
|
|
89
|
-
else timestringParts.push(timeComponents.H)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (format.includes('h')) {
|
|
93
|
-
if (format.includes('hh')) timestringParts.push(timeComponents.hh)
|
|
94
|
-
else timestringParts.push(timeComponents.h)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (format.includes('m')) {
|
|
98
|
-
if (format.includes('mm')) timestringParts.push(timeComponents.mm)
|
|
99
|
-
else timestringParts.push(timeComponents.m)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (format.includes('s')) {
|
|
103
|
-
if (format.includes('ss')) timestringParts.push(timeComponents.ss)
|
|
104
|
-
else timestringParts.push(timeComponents.s)
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Join the parts with colon separator and append AM/PM if needed
|
|
108
|
-
let timeString = timestringParts.join(':')
|
|
109
|
-
if (isAmPm) timeString += ` ${ampm}`
|
|
110
|
-
|
|
111
|
-
return timeString
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Check if a time is within any blocked intervals
|
|
115
|
-
function isBlockedMinutes(minutes, blockedIntervals) {
|
|
116
|
-
return blockedIntervals.some(([startMinutes, endMinutes]) => {
|
|
117
|
-
return minutes >= startMinutes && minutes <= endMinutes
|
|
118
|
-
})
|
|
119
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { flattenArrayFields, formDataToObject } from '@splendidlabz/utils'
|
|
3
|
-
import { sanitize } from '@splendidlabz/utils/dom'
|
|
4
|
-
import { mergeOpts } from '../../utils'
|
|
5
|
-
import HiddenInput from './Hidden.svelte'
|
|
6
|
-
|
|
7
|
-
let p = $props()
|
|
8
|
-
const DEFAULT_OPTIONS = {
|
|
9
|
-
sanitize: true,
|
|
10
|
-
preventSpam: true,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
p = mergeOpts(DEFAULT_OPTIONS, p)
|
|
14
|
-
|
|
15
|
-
const {
|
|
16
|
-
class: klass = '',
|
|
17
|
-
method = 'post',
|
|
18
|
-
action = null,
|
|
19
|
-
|
|
20
|
-
sanitize: shouldSanitize = true,
|
|
21
|
-
preventSpam,
|
|
22
|
-
|
|
23
|
-
onsubmit = null,
|
|
24
|
-
children,
|
|
25
|
-
...rest
|
|
26
|
-
} = p
|
|
27
|
-
|
|
28
|
-
let spam = $state('')
|
|
29
|
-
|
|
30
|
-
function submit(event) {
|
|
31
|
-
const form = event.target
|
|
32
|
-
// Do a standard form submit without JS if the user did not provide a custom onSubmit callback
|
|
33
|
-
if (!onsubmit) return form.submit()
|
|
34
|
-
|
|
35
|
-
event.preventDefault()
|
|
36
|
-
|
|
37
|
-
// Format form data before submitting
|
|
38
|
-
let data = formDataToObject(new FormData(form))
|
|
39
|
-
if (shouldSanitize) data = sanitize(data)
|
|
40
|
-
data = flattenArrayFields(data)
|
|
41
|
-
|
|
42
|
-
// Prevent spam submission by not even trying to submit
|
|
43
|
-
if (data.spam) return
|
|
44
|
-
|
|
45
|
-
onsubmit(data)
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<form {...rest} class="form {klass}" {action} {method} onsubmit={submit}>
|
|
50
|
-
{#if preventSpam}
|
|
51
|
-
<HiddenInput name="spam" bind:value={spam} />
|
|
52
|
-
{/if}
|
|
53
|
-
{@render children?.()}
|
|
54
|
-
</form>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} FormProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} FormEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} FormSlots */
|
|
4
|
-
export default class Form extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: never;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type FormProps = typeof __propDef.props;
|
|
11
|
-
export type FormEvents = typeof __propDef.events;
|
|
12
|
-
export type FormSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: never;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} HiddenProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} HiddenEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} HiddenSlots */
|
|
4
|
-
export default class Hidden extends SvelteComponentTyped<{
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {}> {
|
|
9
|
-
}
|
|
10
|
-
export type HiddenProps = typeof __propDef.props;
|
|
11
|
-
export type HiddenEvents = typeof __propDef.events;
|
|
12
|
-
export type HiddenSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {
|
|
16
|
-
[x: string]: any;
|
|
17
|
-
};
|
|
18
|
-
events: {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { useActions } from '../../actions/use-actions'
|
|
3
|
-
export let name
|
|
4
|
-
export let ref = null
|
|
5
|
-
export let value = ''
|
|
6
|
-
export let actions = []
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<input
|
|
10
|
-
bind:this={ref}
|
|
11
|
-
{name}
|
|
12
|
-
type="hidden"
|
|
13
|
-
bind:value
|
|
14
|
-
use:useActions={actions}
|
|
15
|
-
{...$$restProps}
|
|
16
|
-
/>
|