@pathscale/ui 1.2.6 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -22
- package/README.md +59 -59
- package/dist/components/_shared/index.js +1 -3
- package/dist/components/_shared/overlayPosition.js +6 -6
- package/dist/components/accordion/Accordion.css +158 -158
- package/dist/components/accordion/Accordion.js +46 -45
- package/dist/components/accordion/index.js +3 -9
- package/dist/components/alert/Alert.css +116 -116
- package/dist/components/alert/Alert.js +34 -33
- package/dist/components/alert/index.js +1 -8
- package/dist/components/auth-card/AuthCard.js +21 -21
- package/dist/components/auth-card/index.js +1 -3
- package/dist/components/auth-error-message/AuthErrorMessage.js +10 -10
- package/dist/components/auth-error-message/index.js +1 -3
- package/dist/components/auth-field-group/AuthFieldGroup.js +9 -9
- package/dist/components/auth-field-group/index.js +1 -3
- package/dist/components/auth-footer-links/AuthFooterLinks.js +21 -21
- package/dist/components/auth-footer-links/index.js +1 -3
- package/dist/components/auth-form/AuthForm.js +11 -11
- package/dist/components/auth-form/index.js +1 -3
- package/dist/components/auth-powered-by/AuthPoweredBy.js +15 -15
- package/dist/components/auth-powered-by/index.js +1 -3
- package/dist/components/auth-submit-button/AuthSubmitButton.js +10 -10
- package/dist/components/auth-submit-button/index.js +1 -3
- package/dist/components/auth-success-message/AuthSuccessMessage.js +12 -12
- package/dist/components/auth-success-message/index.js +1 -3
- package/dist/components/avatar/Avatar.css +124 -124
- package/dist/components/avatar/Avatar.js +28 -27
- package/dist/components/avatar/AvatarGroup.js +11 -11
- package/dist/components/avatar/index.js +1 -6
- package/dist/components/badge/Badge.css +164 -164
- package/dist/components/badge/Badge.js +19 -19
- package/dist/components/badge/index.js +7 -9
- package/dist/components/breadcrumbs/Breadcrumbs.css +63 -63
- package/dist/components/breadcrumbs/Breadcrumbs.js +27 -26
- package/dist/components/breadcrumbs/index.js +1 -5
- package/dist/components/button/Button.css +194 -194
- package/dist/components/button/Button.js +23 -23
- package/dist/components/button/index.js +1 -3
- package/dist/components/button-group/ButtonGroup.css +117 -117
- package/dist/components/button-group/ButtonGroup.js +16 -15
- package/dist/components/button-group/context.js +2 -2
- package/dist/components/button-group/index.js +3 -6
- package/dist/components/calendar/Calendar.css +258 -258
- package/dist/components/calendar/Calendar.js +88 -88
- package/dist/components/calendar/index.js +1 -3
- package/dist/components/card/Card.css +110 -110
- package/dist/components/card/Card.js +23 -22
- package/dist/components/card/index.js +3 -8
- package/dist/components/chatbubble/ChatBubble.css +164 -164
- package/dist/components/chatbubble/ChatBubble.js +20 -20
- package/dist/components/chatbubble/ChatBubbleAvatar.js +9 -9
- package/dist/components/chatbubble/ChatBubbleFooter.js +9 -9
- package/dist/components/chatbubble/ChatBubbleHeader.js +11 -11
- package/dist/components/chatbubble/ChatBubbleMessage.js +12 -12
- package/dist/components/chatbubble/ChatBubbleTime.js +9 -9
- package/dist/components/chatbubble/index.js +1 -3
- package/dist/components/checkbox/Checkbox.css +183 -183
- package/dist/components/checkbox/Checkbox.js +32 -32
- package/dist/components/checkbox/index.js +1 -3
- package/dist/components/checkbox-group/CheckboxGroup.css +10 -10
- package/dist/components/checkbox-group/CheckboxGroup.js +14 -14
- package/dist/components/checkbox-group/context.js +2 -2
- package/dist/components/checkbox-group/index.js +4 -4
- package/dist/components/chip/Chip.css +197 -197
- package/dist/components/chip/Chip.js +32 -32
- package/dist/components/chip/index.js +6 -7
- package/dist/components/close-button/CloseButton.css +81 -81
- package/dist/components/close-button/CloseButton.js +22 -22
- package/dist/components/close-button/index.js +1 -3
- package/dist/components/color-area/ColorArea.css +54 -54
- package/dist/components/color-area/ColorArea.js +16 -16
- package/dist/components/color-area/index.js +3 -3
- package/dist/components/color-field/ColorField.css +88 -88
- package/dist/components/color-field/ColorField.js +21 -21
- package/dist/components/color-field/index.js +3 -3
- package/dist/components/color-picker/ColorPicker.css +28 -28
- package/dist/components/color-picker/ColorPicker.js +46 -45
- package/dist/components/color-picker/index.js +3 -8
- package/dist/components/color-slider/ColorSlider.css +57 -57
- package/dist/components/color-slider/ColorSlider.js +19 -19
- package/dist/components/color-slider/index.js +3 -3
- package/dist/components/color-swatch/ColorSwatch.css +84 -84
- package/dist/components/color-swatch/ColorSwatch.js +12 -12
- package/dist/components/color-swatch/index.js +3 -3
- package/dist/components/color-swatch-picker/ColorSwatchPicker.css +12 -12
- package/dist/components/color-swatch-picker/ColorSwatchPicker.js +16 -15
- package/dist/components/color-swatch-picker/index.js +1 -5
- package/dist/components/color-wheel-flower/ColorWheelFlower.css +147 -147
- package/dist/components/color-wheel-flower/ColorWheelFlower.js +84 -84
- package/dist/components/color-wheel-flower/colorWheelFlowerContext.js +3 -3
- package/dist/components/color-wheel-flower/index.js +2 -6
- package/dist/components/combo-box/ComboBox.css +344 -344
- package/dist/components/combo-box/ComboBox.js +92 -91
- package/dist/components/combo-box/index.js +3 -10
- package/dist/components/date-field/DateField.css +215 -215
- package/dist/components/date-field/DateField.js +45 -44
- package/dist/components/date-field/index.js +3 -11
- package/dist/components/date-picker/DatePicker.css +143 -143
- package/dist/components/date-picker/DatePicker.js +38 -38
- package/dist/components/date-picker/index.js +1 -3
- package/dist/components/date-range-picker/DateRangePicker.css +149 -149
- package/dist/components/date-range-picker/DateRangePicker.js +53 -53
- package/dist/components/date-range-picker/index.js +1 -3
- package/dist/components/description/Description.css +10 -10
- package/dist/components/description/Description.js +11 -10
- package/dist/components/description/index.js +3 -5
- package/dist/components/disclosure/Disclosure.css +84 -84
- package/dist/components/disclosure/Disclosure.js +44 -43
- package/dist/components/disclosure/index.js +4 -9
- package/dist/components/disclosure-group/DisclosureGroup.css +9 -9
- package/dist/components/disclosure-group/DisclosureGroup.js +15 -14
- package/dist/components/disclosure-group/index.js +5 -6
- package/dist/components/disclosure-group/useDisclosureGroupNavigation.js +4 -4
- package/dist/components/drawer/Drawer.context.js +3 -3
- package/dist/components/drawer/Drawer.css +463 -463
- package/dist/components/drawer/Drawer.js +109 -108
- package/dist/components/drawer/index.js +1 -15
- package/dist/components/dropdown/Dropdown.css +211 -211
- package/dist/components/dropdown/Dropdown.js +68 -67
- package/dist/components/dropdown/index.js +3 -4
- package/dist/components/empty-state/EmptyState.css +39 -39
- package/dist/components/empty-state/EmptyState.js +27 -26
- package/dist/components/empty-state/index.js +1 -8
- package/dist/components/error-message/ErrorMessage.css +20 -20
- package/dist/components/error-message/ErrorMessage.js +13 -12
- package/dist/components/error-message/index.js +1 -5
- package/dist/components/field-error/FieldError.css +27 -27
- package/dist/components/field-error/FieldError.js +18 -17
- package/dist/components/field-error/index.js +1 -5
- package/dist/components/fieldset/Fieldset.css +30 -30
- package/dist/components/fieldset/Fieldset.js +23 -22
- package/dist/components/fieldset/index.js +3 -8
- package/dist/components/flex/Flex.css +5 -5
- package/dist/components/flex/Flex.js +14 -14
- package/dist/components/flex/index.js +1 -3
- package/dist/components/floating-dock/FloatingDock.css +208 -208
- package/dist/components/floating-dock/FloatingDock.js +78 -78
- package/dist/components/floating-dock/index.js +1 -3
- package/dist/components/footer/Footer.js +12 -12
- package/dist/components/footer/FooterTitle.js +9 -9
- package/dist/components/footer/footer.css +51 -51
- package/dist/components/footer/index.js +1 -3
- package/dist/components/form/FieldErrorMessage.js +10 -9
- package/dist/components/form/Form.css +5 -5
- package/dist/components/form/Form.js +18 -17
- package/dist/components/form/FormField.js +21 -20
- package/dist/components/form/FormSubmitButton.js +12 -11
- package/dist/components/form/index.js +6 -12
- package/dist/components/glass-panel/GlassPanel.classes.d.ts +3 -0
- package/dist/components/glass-panel/GlassPanel.classes.js +3 -0
- package/dist/components/glass-panel/GlassPanel.css +359 -282
- package/dist/components/glass-panel/GlassPanel.d.ts +3 -0
- package/dist/components/glass-panel/GlassPanel.js +30 -27
- package/dist/components/glass-panel/index.js +1 -3
- package/dist/components/glow-card/GlowCard.css +100 -100
- package/dist/components/glow-card/GlowCard.js +11 -11
- package/dist/components/glow-card/index.js +1 -3
- package/dist/components/grid/Grid.css +5 -5
- package/dist/components/grid/Grid.js +15 -15
- package/dist/components/grid/index.js +1 -3
- package/dist/components/header/Header.css +13 -13
- package/dist/components/header/Header.js +11 -10
- package/dist/components/header/index.js +3 -5
- package/dist/components/icon/Icon.css +10 -10
- package/dist/components/icon/Icon.js +9 -9
- package/dist/components/icon/index.js +1 -3
- package/dist/components/immersive-landing/ImmersiveLanding.css +565 -565
- package/dist/components/immersive-landing/ImmersiveLanding.js +45 -45
- package/dist/components/immersive-landing/ImmersiveLandingArrows.js +18 -18
- package/dist/components/immersive-landing/ImmersiveLandingContext.js +3 -3
- package/dist/components/immersive-landing/ImmersiveLandingNavigation.js +34 -34
- package/dist/components/immersive-landing/ImmersiveLandingPage.js +16 -16
- package/dist/components/immersive-landing/components/CookieConsent.js +71 -71
- package/dist/components/immersive-landing/components/FirefoxPWABanner.js +42 -42
- package/dist/components/immersive-landing/components/PWAInstallPrompt.js +40 -40
- package/dist/components/immersive-landing/index.js +6 -14
- package/dist/components/immersive-landing/useImmersiveLanding.js +8 -8
- package/dist/components/input/Input.css +155 -155
- package/dist/components/input/Input.js +46 -46
- package/dist/components/input/index.js +3 -3
- package/dist/components/input-group/InputGroup.css +172 -172
- package/dist/components/input-group/InputGroup.js +32 -31
- package/dist/components/input-group/index.js +3 -9
- package/dist/components/input-otp/InputOTP.css +170 -170
- package/dist/components/input-otp/InputOTP.js +52 -51
- package/dist/components/input-otp/index.js +1 -11
- package/dist/components/join/Join.js +15 -15
- package/dist/components/join/index.js +1 -3
- package/dist/components/kbd/Kbd.css +60 -60
- package/dist/components/kbd/Kbd.js +39 -38
- package/dist/components/kbd/index.js +1 -8
- package/dist/components/label/Label.css +30 -30
- package/dist/components/label/Label.js +11 -10
- package/dist/components/label/index.js +3 -5
- package/dist/components/language-switcher/LanguageSwitcher.css +56 -56
- package/dist/components/language-switcher/LanguageSwitcher.js +24 -24
- package/dist/components/language-switcher/createI18n.js +10 -10
- package/dist/components/language-switcher/index.js +2 -8
- package/dist/components/link/Link.css +131 -131
- package/dist/components/link/Link.js +21 -20
- package/dist/components/link/index.js +1 -5
- package/dist/components/list-box/ListBox.css +148 -148
- package/dist/components/list-box/ListBox.js +19 -18
- package/dist/components/list-box/ListBoxItem.js +31 -30
- package/dist/components/list-box/ListBoxSection.js +15 -14
- package/dist/components/list-box/context.js +2 -2
- package/dist/components/list-box/index.js +11 -16
- package/dist/components/live-chat/LiveChat.css +324 -324
- package/dist/components/live-chat/LiveChatBubble.js +28 -28
- package/dist/components/live-chat/LiveChatPanel.js +67 -67
- package/dist/components/live-chat/index.js +2 -5
- package/dist/components/menu/Menu.css +199 -199
- package/dist/components/menu/Menu.js +24 -28
- package/dist/components/menu/MenuItem.js +37 -36
- package/dist/components/menu/MenuSection.js +15 -14
- package/dist/components/menu/context.js +2 -2
- package/dist/components/menu/index.js +4 -12
- package/dist/components/meter/Meter.css +89 -89
- package/dist/components/meter/Meter.js +35 -34
- package/dist/components/meter/index.js +1 -8
- package/dist/components/modal/Modal.css +320 -320
- package/dist/components/modal/Modal.js +79 -78
- package/dist/components/modal/index.js +1 -13
- package/dist/components/navbar/Navbar.classes.d.ts +9 -0
- package/dist/components/navbar/Navbar.classes.js +9 -0
- package/dist/components/navbar/Navbar.css +110 -110
- package/dist/components/navbar/Navbar.js +16 -16
- package/dist/components/navbar/NavbarRow.js +11 -11
- package/dist/components/navbar/NavbarSection.js +10 -10
- package/dist/components/navbar/NavbarStack.js +11 -11
- package/dist/components/navbar/index.js +1 -3
- package/dist/components/noise-background/NoiseBackground.css +66 -66
- package/dist/components/noise-background/NoiseBackground.js +33 -33
- package/dist/components/noise-background/index.js +1 -3
- package/dist/components/number-field/NumberField.css +198 -198
- package/dist/components/number-field/NumberField.js +43 -42
- package/dist/components/number-field/index.js +1 -9
- package/dist/components/pagination/Pagination.css +121 -121
- package/dist/components/pagination/Pagination.js +32 -32
- package/dist/components/pagination/index.js +1 -3
- package/dist/components/password-field/PasswordField.js +18 -17
- package/dist/components/password-field/index.js +1 -3
- package/dist/components/password-requirements/PasswordRequirements.js +22 -22
- package/dist/components/password-requirements/index.js +1 -3
- package/dist/components/password-rules/index.js +1 -4
- package/dist/components/popover/Popover.css +117 -117
- package/dist/components/popover/Popover.js +52 -51
- package/dist/components/popover/index.js +4 -9
- package/dist/components/progress-bar/ProgressBar.css +104 -104
- package/dist/components/progress-bar/ProgressBar.js +28 -28
- package/dist/components/progress-bar/index.js +1 -3
- package/dist/components/progress-circle/ProgressCircle.css +82 -82
- package/dist/components/progress-circle/ProgressCircle.js +30 -30
- package/dist/components/progress-circle/index.js +1 -3
- package/dist/components/radio/Radio.css +129 -129
- package/dist/components/radio/Radio.js +28 -28
- package/dist/components/radio/index.js +1 -3
- package/dist/components/radio-group/RadioGroup.css +58 -58
- package/dist/components/radio-group/RadioGroup.js +31 -31
- package/dist/components/radio-group/context.js +2 -2
- package/dist/components/radio-group/index.js +4 -4
- package/dist/components/range-calendar/RangeCalendar.css +51 -51
- package/dist/components/range-calendar/RangeCalendar.js +18 -18
- package/dist/components/range-calendar/index.js +1 -3
- package/dist/components/scroll-shadow/ScrollShadow.css +93 -93
- package/dist/components/scroll-shadow/ScrollShadow.js +17 -17
- package/dist/components/scroll-shadow/index.js +1 -3
- package/dist/components/scroll-shadow/useScrollShadow.js +4 -4
- package/dist/components/search-field/SearchField.css +183 -183
- package/dist/components/search-field/SearchField.js +42 -41
- package/dist/components/search-field/index.js +1 -9
- package/dist/components/select/Select.css +284 -284
- package/dist/components/select/Select.js +130 -130
- package/dist/components/select/index.js +1 -3
- package/dist/components/separator/Separator.css +35 -35
- package/dist/components/separator/Separator.js +12 -11
- package/dist/components/separator/index.js +1 -4
- package/dist/components/size-picker/SizePicker.js +17 -17
- package/dist/components/size-picker/index.js +2 -6
- package/dist/components/size-picker/sizeStore.js +5 -5
- package/dist/components/skeleton/Skeleton.css +95 -95
- package/dist/components/skeleton/Skeleton.js +9 -9
- package/dist/components/skeleton/index.js +1 -3
- package/dist/components/slider/Slider.css +122 -122
- package/dist/components/slider/Slider.js +27 -27
- package/dist/components/slider/index.js +1 -3
- package/dist/components/spinner/Spinner.css +131 -131
- package/dist/components/spinner/Spinner.js +17 -17
- package/dist/components/spinner/index.js +1 -5
- package/dist/components/surface/Surface.css +37 -37
- package/dist/components/surface/Surface.js +11 -10
- package/dist/components/surface/index.js +1 -4
- package/dist/components/table/ExpandToggle.js +14 -14
- package/dist/components/table/InlineConfirm.js +12 -12
- package/dist/components/table/MobileListView.js +24 -24
- package/dist/components/table/SortIcon.js +11 -11
- package/dist/components/table/Table.css +426 -426
- package/dist/components/table/Table.js +82 -81
- package/dist/components/table/VirtualSpacerRow.js +9 -9
- package/dist/components/table/index.js +7 -38
- package/dist/components/tabs/Tabs.css +203 -203
- package/dist/components/tabs/Tabs.js +62 -61
- package/dist/components/tabs/index.js +1 -4
- package/dist/components/tag/Tag.css +121 -121
- package/dist/components/tag/Tag.js +41 -40
- package/dist/components/tag/index.js +3 -6
- package/dist/components/tag-group/TagGroup.css +22 -22
- package/dist/components/tag-group/TagGroup.js +24 -23
- package/dist/components/tag-group/context.js +2 -2
- package/dist/components/tag-group/index.js +1 -6
- package/dist/components/text/Text.css +66 -66
- package/dist/components/text/Text.js +11 -10
- package/dist/components/text/index.js +1 -5
- package/dist/components/text-area/TextArea.css +95 -95
- package/dist/components/text-area/TextArea.js +14 -13
- package/dist/components/text-area/index.js +1 -5
- package/dist/components/text-field/TextField.css +33 -33
- package/dist/components/text-field/TextField.js +14 -13
- package/dist/components/text-field/index.js +3 -7
- package/dist/components/textarea/Textarea.js +10 -11
- package/dist/components/textarea/index.js +1 -6
- package/dist/components/theme-color-picker/ThemeColorPicker.js +52 -52
- package/dist/components/theme-color-picker/hueShift.js +8 -8
- package/dist/components/theme-color-picker/index.js +2 -7
- package/dist/components/time-field/TimeField.css +215 -215
- package/dist/components/time-field/TimeField.js +43 -42
- package/dist/components/time-field/index.js +3 -11
- package/dist/components/toast/Toast.css +344 -344
- package/dist/components/toast/Toast.js +101 -100
- package/dist/components/toast/index.js +1 -19
- package/dist/components/toggle/Toggle.css +237 -237
- package/dist/components/toggle/Toggle.js +31 -31
- package/dist/components/toggle/index.js +1 -3
- package/dist/components/toolbar/Toolbar.css +55 -55
- package/dist/components/toolbar/Toolbar.js +12 -11
- package/dist/components/toolbar/index.js +1 -5
- package/dist/components/tooltip/Tooltip.css +153 -153
- package/dist/components/tooltip/Tooltip.js +40 -39
- package/dist/components/tooltip/index.js +1 -7
- package/dist/components/utils.js +6 -7
- package/dist/components/video-preview/VideoPreview.js +14 -13
- package/dist/components/video-preview/index.js +1 -3
- package/dist/hooks/date/useCalendarNavigation.js +18 -18
- package/dist/hooks/date/useCalendarState.js +19 -19
- package/dist/hooks/date/useDateSelection.js +7 -7
- package/dist/hooks/date/usePickerOpenState.js +8 -8
- package/dist/hooks/date/useRangeSelection.js +16 -16
- package/dist/hooks/form/FormContext.js +3 -3
- package/dist/hooks/form/createForm.js +4 -4
- package/dist/hooks/form/index.js +4 -10
- package/dist/hooks/form/useFieldNew.js +10 -10
- package/dist/hooks/layout/index.js +1 -3
- package/dist/hooks/layout/useDesktop.js +4 -4
- package/dist/hooks/table/index.js +8 -18
- package/dist/hooks/table/useAnchoredOverlayPosition.js +5 -5
- package/dist/hooks/table/useTableExpansion.js +4 -4
- package/dist/hooks/table/useTableFiltering.js +8 -8
- package/dist/hooks/table/useTableModel.js +10 -10
- package/dist/hooks/table/useTablePagination.js +4 -4
- package/dist/hooks/table/useTableSelection.js +4 -4
- package/dist/hooks/table/useTableSorting.js +6 -6
- package/dist/index.css +74 -74
- package/dist/index.js +108 -398
- package/dist/lib/refs/index.js +1 -3
- package/dist/lib/refs/mergeRefs.js +2 -2
- package/dist/lib/style/index.js +1 -4
- package/dist/lib/tag/createIsButton.js +4 -4
- package/dist/lib/tag/createTagName.js +2 -2
- package/dist/lib/tag/index.js +2 -7
- package/dist/motion/engine.js +4 -4
- package/dist/motion/index.js +10 -39
- package/dist/motion/popmotion.js +2 -2
- package/dist/motion/presets.js +4 -4
- package/dist/motion/route.js +7 -7
- package/dist/motion/solid/AnimatedCollapse.js +27 -26
- package/dist/motion/solid/MotionDiv.js +17 -16
- package/dist/motion/solid/Presence.js +13 -12
- package/dist/motion/solid/index.js +3 -10
- package/dist/motion/system.js +9 -9
- package/dist/primitives/streaming/index.js +2 -5
- package/dist/primitives/streaming/useStreamingBuffer.js +2 -2
- package/dist/primitives/streaming/useStreamingSubscription.js +7 -7
- package/dist/primitives/virtualizer/index.js +1 -3
- package/dist/primitives/virtualizer/useVirtualRows.js +7 -7
- package/dist/purge-manifest.json +15350 -15141
- package/dist/styles/base/index.css +43 -43
- package/dist/styles/icons/generated-icons.css +1 -173
- package/dist/styles/themes/dark.css +141 -141
- package/dist/styles/themes/light.css +143 -143
- package/package.json +31 -31
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, memo, mergeProps, spread, template } from "solid-js/web";
|
|
2
2
|
import "./NumberField.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
7
|
-
const NumberFieldContext =
|
|
3
|
+
import { createContext, createEffect, createSignal, splitProps, useContext } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./NumberField.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<div>"), _tmpl$2 = /*#__PURE__*/ template("<input>"), _tmpl$3 = /*#__PURE__*/ template("<button>"), _tmpl$4 = /*#__PURE__*/ template('<svg aria-hidden=true data-slot=number-field-increment-button-icon fill=none role=presentation viewBox="0 0 16 16"><path d="M8 3.25a.75.75 0 0 1 .75.75v3.25H12a.75.75 0 0 1 0 1.5H8.75V12a.75.75 0 0 1-1.5 0V8.75H4a.75.75 0 0 1 0-1.5h3.25V4A.75.75 0 0 1 8 3.25Z"fill=currentColor>'), _tmpl$5 = /*#__PURE__*/ template('<svg aria-hidden=true data-slot=number-field-decrement-button-icon fill=none role=presentation viewBox="0 0 16 16"><path d="M4 7.25a.75.75 0 0 0 0 1.5h8a.75.75 0 0 0 0-1.5H4Z"fill=currentColor>');
|
|
7
|
+
const NumberFieldContext = createContext();
|
|
8
8
|
const invokeEventHandler = (handler, event)=>{
|
|
9
9
|
if ("function" == typeof handler) return void handler(event);
|
|
10
10
|
if (Array.isArray(handler) && "function" == typeof handler[0]) handler[0](handler[1], event);
|
|
@@ -23,7 +23,7 @@ const clamp = (value, min, max)=>{
|
|
|
23
23
|
};
|
|
24
24
|
const formatNumber = (value)=>void 0 === value ? "" : `${value}`;
|
|
25
25
|
const NumberFieldRoot = (props)=>{
|
|
26
|
-
const [local, others] =
|
|
26
|
+
const [local, others] = splitProps(props, [
|
|
27
27
|
"children",
|
|
28
28
|
"class",
|
|
29
29
|
"className",
|
|
@@ -43,8 +43,8 @@ const NumberFieldRoot = (props)=>{
|
|
|
43
43
|
"disabled",
|
|
44
44
|
"isInvalid"
|
|
45
45
|
]);
|
|
46
|
-
const [internalValue, setInternalValue] =
|
|
47
|
-
const [inputValue, setInputValue] =
|
|
46
|
+
const [internalValue, setInternalValue] = createSignal(local.defaultValue);
|
|
47
|
+
const [inputValue, setInputValue] = createSignal(formatNumber(local.defaultValue));
|
|
48
48
|
const isControlled = ()=>void 0 !== local.value;
|
|
49
49
|
const value = ()=>isControlled() ? local.value : internalValue();
|
|
50
50
|
const variant = ()=>local.variant ?? "primary";
|
|
@@ -54,7 +54,7 @@ const NumberFieldRoot = (props)=>{
|
|
|
54
54
|
const step = ()=>local.step && Number.isFinite(local.step) ? local.step : 1;
|
|
55
55
|
const min = ()=>local.min;
|
|
56
56
|
const max = ()=>local.max;
|
|
57
|
-
|
|
57
|
+
createEffect(()=>{
|
|
58
58
|
if (!isControlled()) return;
|
|
59
59
|
setInputValue(formatNumber(local.value));
|
|
60
60
|
});
|
|
@@ -102,12 +102,12 @@ const NumberFieldRoot = (props)=>{
|
|
|
102
102
|
increment: ()=>adjustValue(1),
|
|
103
103
|
decrement: ()=>adjustValue(-1)
|
|
104
104
|
};
|
|
105
|
-
return
|
|
105
|
+
return createComponent(NumberFieldContext.Provider, {
|
|
106
106
|
value: contextValue,
|
|
107
107
|
get children () {
|
|
108
108
|
var _el$ = _tmpl$();
|
|
109
|
-
|
|
110
|
-
class:
|
|
109
|
+
spread(_el$, mergeProps(others, ()=>({
|
|
110
|
+
class: twMerge(CLASSES.Root.base, CLASSES.Root.variant[variant()], fullWidth() && CLASSES.Root.flag.fullWidth, local.class, local.className)
|
|
111
111
|
}), {
|
|
112
112
|
"data-slot": "number-field",
|
|
113
113
|
get ["data-invalid"] () {
|
|
@@ -129,14 +129,14 @@ const NumberFieldRoot = (props)=>{
|
|
|
129
129
|
return local.style;
|
|
130
130
|
}
|
|
131
131
|
}), false, true);
|
|
132
|
-
|
|
133
|
-
var _c$ =
|
|
134
|
-
return ()=>_c$() ? local.children(renderProps()) :
|
|
132
|
+
insert(_el$, (()=>{
|
|
133
|
+
var _c$ = memo(()=>"function" == typeof local.children);
|
|
134
|
+
return ()=>_c$() ? local.children(renderProps()) : memo(()=>!!local.children)() ? local.children : createComponent(NumberFieldGroup, {
|
|
135
135
|
get children () {
|
|
136
136
|
return [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
createComponent(NumberFieldDecrementButton, {}),
|
|
138
|
+
createComponent(NumberFieldInput, {}),
|
|
139
|
+
createComponent(NumberFieldIncrementButton, {})
|
|
140
140
|
];
|
|
141
141
|
}
|
|
142
142
|
});
|
|
@@ -146,8 +146,8 @@ const NumberFieldRoot = (props)=>{
|
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
const NumberFieldGroup = (props)=>{
|
|
149
|
-
const context =
|
|
150
|
-
const [local, others] =
|
|
149
|
+
const context = useContext(NumberFieldContext);
|
|
150
|
+
const [local, others] = splitProps(props, [
|
|
151
151
|
"children",
|
|
152
152
|
"class",
|
|
153
153
|
"className",
|
|
@@ -161,8 +161,8 @@ const NumberFieldGroup = (props)=>{
|
|
|
161
161
|
});
|
|
162
162
|
return (()=>{
|
|
163
163
|
var _el$2 = _tmpl$();
|
|
164
|
-
|
|
165
|
-
class:
|
|
164
|
+
spread(_el$2, mergeProps(others, ()=>({
|
|
165
|
+
class: twMerge(CLASSES.Group.base, context?.fullWidth() && CLASSES.Group.flag.fullWidth, local.class, local.className)
|
|
166
166
|
}), {
|
|
167
167
|
"data-slot": "number-field-group",
|
|
168
168
|
get ["data-invalid"] () {
|
|
@@ -178,16 +178,16 @@ const NumberFieldGroup = (props)=>{
|
|
|
178
178
|
return local.style;
|
|
179
179
|
}
|
|
180
180
|
}), false, true);
|
|
181
|
-
|
|
182
|
-
var _c$2 =
|
|
181
|
+
insert(_el$2, (()=>{
|
|
182
|
+
var _c$2 = memo(()=>"function" == typeof local.children);
|
|
183
183
|
return ()=>_c$2() ? local.children(renderProps()) : local.children;
|
|
184
184
|
})());
|
|
185
185
|
return _el$2;
|
|
186
186
|
})();
|
|
187
187
|
};
|
|
188
188
|
const NumberFieldInput = (props)=>{
|
|
189
|
-
const context =
|
|
190
|
-
const [local, others] =
|
|
189
|
+
const context = useContext(NumberFieldContext);
|
|
190
|
+
const [local, others] = splitProps(props, [
|
|
191
191
|
"class",
|
|
192
192
|
"className",
|
|
193
193
|
"dataTheme",
|
|
@@ -207,11 +207,11 @@ const NumberFieldInput = (props)=>{
|
|
|
207
207
|
};
|
|
208
208
|
return (()=>{
|
|
209
209
|
var _el$3 = _tmpl$2();
|
|
210
|
-
|
|
210
|
+
spread(_el$3, mergeProps(others, {
|
|
211
211
|
type: "text",
|
|
212
212
|
inputmode: "decimal"
|
|
213
213
|
}, ()=>({
|
|
214
|
-
class:
|
|
214
|
+
class: twMerge(CLASSES.Input.base, local.class, local.className)
|
|
215
215
|
}), {
|
|
216
216
|
"data-slot": "number-field-input",
|
|
217
217
|
get ["data-theme"] () {
|
|
@@ -251,8 +251,8 @@ const NumberFieldInput = (props)=>{
|
|
|
251
251
|
})();
|
|
252
252
|
};
|
|
253
253
|
const NumberFieldIncrementButton = (props)=>{
|
|
254
|
-
const context =
|
|
255
|
-
const [local, others] =
|
|
254
|
+
const context = useContext(NumberFieldContext);
|
|
255
|
+
const [local, others] = splitProps(props, [
|
|
256
256
|
"children",
|
|
257
257
|
"class",
|
|
258
258
|
"className",
|
|
@@ -267,10 +267,10 @@ const NumberFieldIncrementButton = (props)=>{
|
|
|
267
267
|
};
|
|
268
268
|
return (()=>{
|
|
269
269
|
var _el$4 = _tmpl$3();
|
|
270
|
-
|
|
270
|
+
spread(_el$4, mergeProps(others, {
|
|
271
271
|
type: "button"
|
|
272
272
|
}, ()=>({
|
|
273
|
-
class:
|
|
273
|
+
class: twMerge(CLASSES.IncrementButton.base, local.class, local.className)
|
|
274
274
|
}), {
|
|
275
275
|
"data-slot": "number-field-increment-button",
|
|
276
276
|
get ["data-theme"] () {
|
|
@@ -288,13 +288,13 @@ const NumberFieldIncrementButton = (props)=>{
|
|
|
288
288
|
slot: "increment",
|
|
289
289
|
onClick: handleClick
|
|
290
290
|
}), false, true);
|
|
291
|
-
|
|
291
|
+
insert(_el$4, ()=>local.children ?? _tmpl$4());
|
|
292
292
|
return _el$4;
|
|
293
293
|
})();
|
|
294
294
|
};
|
|
295
295
|
const NumberFieldDecrementButton = (props)=>{
|
|
296
|
-
const context =
|
|
297
|
-
const [local, others] =
|
|
296
|
+
const context = useContext(NumberFieldContext);
|
|
297
|
+
const [local, others] = splitProps(props, [
|
|
298
298
|
"children",
|
|
299
299
|
"class",
|
|
300
300
|
"className",
|
|
@@ -309,10 +309,10 @@ const NumberFieldDecrementButton = (props)=>{
|
|
|
309
309
|
};
|
|
310
310
|
return (()=>{
|
|
311
311
|
var _el$6 = _tmpl$3();
|
|
312
|
-
|
|
312
|
+
spread(_el$6, mergeProps(others, {
|
|
313
313
|
type: "button"
|
|
314
314
|
}, ()=>({
|
|
315
|
-
class:
|
|
315
|
+
class: twMerge(CLASSES.DecrementButton.base, local.class, local.className)
|
|
316
316
|
}), {
|
|
317
317
|
"data-slot": "number-field-decrement-button",
|
|
318
318
|
get ["data-theme"] () {
|
|
@@ -330,16 +330,17 @@ const NumberFieldDecrementButton = (props)=>{
|
|
|
330
330
|
slot: "decrement",
|
|
331
331
|
onClick: handleClick
|
|
332
332
|
}), false, true);
|
|
333
|
-
|
|
333
|
+
insert(_el$6, ()=>local.children ?? _tmpl$5());
|
|
334
334
|
return _el$6;
|
|
335
335
|
})();
|
|
336
336
|
};
|
|
337
|
-
const
|
|
337
|
+
const NumberField = Object.assign(NumberFieldRoot, {
|
|
338
338
|
Root: NumberFieldRoot,
|
|
339
339
|
Group: NumberFieldGroup,
|
|
340
340
|
Input: NumberFieldInput,
|
|
341
341
|
IncrementButton: NumberFieldIncrementButton,
|
|
342
342
|
DecrementButton: NumberFieldDecrementButton
|
|
343
343
|
});
|
|
344
|
-
const
|
|
345
|
-
export
|
|
344
|
+
const number_field_NumberField = NumberField;
|
|
345
|
+
export default number_field_NumberField;
|
|
346
|
+
export { NumberField, NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot };
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __webpack_exports__NumberField = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberField;
|
|
3
|
-
var __webpack_exports__NumberFieldDecrementButton = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberFieldDecrementButton;
|
|
4
|
-
var __webpack_exports__NumberFieldGroup = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberFieldGroup;
|
|
5
|
-
var __webpack_exports__NumberFieldIncrementButton = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberFieldIncrementButton;
|
|
6
|
-
var __webpack_exports__NumberFieldInput = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberFieldInput;
|
|
7
|
-
var __webpack_exports__NumberFieldRoot = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__.NumberFieldRoot;
|
|
8
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__NumberField_js_68db54de__["default"];
|
|
9
|
-
export { __webpack_exports__NumberField as NumberField, __webpack_exports__NumberFieldDecrementButton as NumberFieldDecrementButton, __webpack_exports__NumberFieldGroup as NumberFieldGroup, __webpack_exports__NumberFieldIncrementButton as NumberFieldIncrementButton, __webpack_exports__NumberFieldInput as NumberFieldInput, __webpack_exports__NumberFieldRoot as NumberFieldRoot, __webpack_exports__default as default };
|
|
1
|
+
export { NumberField, NumberFieldDecrementButton, NumberFieldGroup, NumberFieldIncrementButton, NumberFieldInput, NumberFieldRoot, default } from "./NumberField.js";
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
@layer components {
|
|
2
|
-
.pagination {
|
|
3
|
-
display: flex;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: center;
|
|
7
|
-
justify-content: space-between;
|
|
8
|
-
gap: 1rem;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@media (min-width: 640px) {
|
|
12
|
-
.pagination {
|
|
13
|
-
flex-direction: row;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.pagination__summary {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
gap: 0.5rem;
|
|
21
|
-
align-self: flex-start;
|
|
22
|
-
font-size: 0.875rem;
|
|
23
|
-
opacity: 0.7;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@media (min-width: 640px) {
|
|
27
|
-
.pagination__summary {
|
|
28
|
-
align-self: center;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.pagination__content {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
gap: 0.25rem;
|
|
36
|
-
align-self: flex-start;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
@media (min-width: 640px) {
|
|
40
|
-
.pagination__content {
|
|
41
|
-
align-self: center;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.pagination__item {
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.pagination__link {
|
|
50
|
-
position: relative;
|
|
51
|
-
isolation: isolate;
|
|
52
|
-
display: inline-flex;
|
|
53
|
-
height: 2.25rem;
|
|
54
|
-
width: 2.25rem;
|
|
55
|
-
transform-origin: center;
|
|
56
|
-
align-items: center;
|
|
57
|
-
justify-content: center;
|
|
58
|
-
border-radius: 9999px;
|
|
59
|
-
border: 0;
|
|
60
|
-
background-color: transparent;
|
|
61
|
-
color: var(--color-base-content);
|
|
62
|
-
font-size: 0.875rem;
|
|
63
|
-
font-weight: 500;
|
|
64
|
-
white-space: nowrap;
|
|
65
|
-
outline: none;
|
|
66
|
-
user-select: none;
|
|
67
|
-
cursor: pointer;
|
|
68
|
-
transition:
|
|
69
|
-
transform 250ms var(--ease-smooth, cubic-bezier(0.22, 1, 0.36, 1)),
|
|
70
|
-
background-color 100ms ease-out,
|
|
71
|
-
box-shadow 100ms ease-out;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.pagination__link:focus-visible,
|
|
75
|
-
.pagination__link[data-focus-visible="true"] {
|
|
76
|
-
outline: none;
|
|
77
|
-
box-shadow: 0 0 0 2px var(--color-focus, var(--color-accent));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.pagination__link:disabled,
|
|
81
|
-
.pagination__link[aria-disabled="true"] {
|
|
82
|
-
opacity: 0.5;
|
|
83
|
-
cursor: not-allowed;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@media (hover: hover) {
|
|
87
|
-
.pagination__link:hover:not(:disabled),
|
|
88
|
-
.pagination__link[data-hovered="true"]:not(:disabled) {
|
|
89
|
-
background-color: var(--color-base-200);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
.pagination__link:active:not(:disabled),
|
|
94
|
-
.pagination__link[data-pressed="true"]:not(:disabled) {
|
|
95
|
-
background-color: var(--color-base-300);
|
|
96
|
-
transform: scale(0.97);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.pagination__link[data-active="true"] {
|
|
100
|
-
background-color: var(--color-base-300);
|
|
101
|
-
color: var(--color-base-content);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.pagination__ellipsis {
|
|
105
|
-
display: inline-flex;
|
|
106
|
-
height: 2.25rem;
|
|
107
|
-
width: 2.25rem;
|
|
108
|
-
align-items: center;
|
|
109
|
-
justify-content: center;
|
|
110
|
-
font-size: 0.875rem;
|
|
111
|
-
opacity: 0.65;
|
|
112
|
-
user-select: none;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.pagination__link--nav {
|
|
116
|
-
width: auto;
|
|
117
|
-
gap: 0.375rem;
|
|
118
|
-
padding-inline: 0.625rem;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
1
|
+
@layer components {
|
|
2
|
+
.pagination {
|
|
3
|
+
display: flex;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
gap: 1rem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 640px) {
|
|
12
|
+
.pagination {
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pagination__summary {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: 0.5rem;
|
|
21
|
+
align-self: flex-start;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
opacity: 0.7;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@media (min-width: 640px) {
|
|
27
|
+
.pagination__summary {
|
|
28
|
+
align-self: center;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pagination__content {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 0.25rem;
|
|
36
|
+
align-self: flex-start;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@media (min-width: 640px) {
|
|
40
|
+
.pagination__content {
|
|
41
|
+
align-self: center;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.pagination__item {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pagination__link {
|
|
50
|
+
position: relative;
|
|
51
|
+
isolation: isolate;
|
|
52
|
+
display: inline-flex;
|
|
53
|
+
height: 2.25rem;
|
|
54
|
+
width: 2.25rem;
|
|
55
|
+
transform-origin: center;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
border-radius: 9999px;
|
|
59
|
+
border: 0;
|
|
60
|
+
background-color: transparent;
|
|
61
|
+
color: var(--color-base-content);
|
|
62
|
+
font-size: 0.875rem;
|
|
63
|
+
font-weight: 500;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
outline: none;
|
|
66
|
+
user-select: none;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
transition:
|
|
69
|
+
transform 250ms var(--ease-smooth, cubic-bezier(0.22, 1, 0.36, 1)),
|
|
70
|
+
background-color 100ms ease-out,
|
|
71
|
+
box-shadow 100ms ease-out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pagination__link:focus-visible,
|
|
75
|
+
.pagination__link[data-focus-visible="true"] {
|
|
76
|
+
outline: none;
|
|
77
|
+
box-shadow: 0 0 0 2px var(--color-focus, var(--color-accent));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pagination__link:disabled,
|
|
81
|
+
.pagination__link[aria-disabled="true"] {
|
|
82
|
+
opacity: 0.5;
|
|
83
|
+
cursor: not-allowed;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (hover: hover) {
|
|
87
|
+
.pagination__link:hover:not(:disabled),
|
|
88
|
+
.pagination__link[data-hovered="true"]:not(:disabled) {
|
|
89
|
+
background-color: var(--color-base-200);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.pagination__link:active:not(:disabled),
|
|
94
|
+
.pagination__link[data-pressed="true"]:not(:disabled) {
|
|
95
|
+
background-color: var(--color-base-300);
|
|
96
|
+
transform: scale(0.97);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pagination__link[data-active="true"] {
|
|
100
|
+
background-color: var(--color-base-300);
|
|
101
|
+
color: var(--color-base-content);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.pagination__ellipsis {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
height: 2.25rem;
|
|
107
|
+
width: 2.25rem;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
font-size: 0.875rem;
|
|
111
|
+
opacity: 0.65;
|
|
112
|
+
user-select: none;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.pagination__link--nav {
|
|
116
|
+
width: auto;
|
|
117
|
+
gap: 0.375rem;
|
|
118
|
+
padding-inline: 0.625rem;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createComponent, insert, mergeProps, spread, template } from "solid-js/web";
|
|
2
2
|
import "./Pagination.css";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/
|
|
3
|
+
import { For, splitProps } from "solid-js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { CLASSES } from "./Pagination.classes.js";
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/ template("<nav><div>Page <!> of </div><ul><li><button type=button><span aria-hidden=true>‹</span><span>Previous</span></button></li><li><button type=button><span>Next</span><span aria-hidden=true>›"), _tmpl$2 = /*#__PURE__*/ template("<li>"), _tmpl$3 = /*#__PURE__*/ template("<button type=button>"), _tmpl$4 = /*#__PURE__*/ template("<span>…");
|
|
7
7
|
const clampPage = (page, total)=>{
|
|
8
8
|
if (!Number.isFinite(page)) return 1;
|
|
9
9
|
return Math.min(Math.max(1, Math.floor(page)), total);
|
|
@@ -42,7 +42,7 @@ const getPaginationTokens = (page, total)=>{
|
|
|
42
42
|
];
|
|
43
43
|
};
|
|
44
44
|
const Pagination = (props)=>{
|
|
45
|
-
const [local, others] =
|
|
45
|
+
const [local, others] = splitProps(props, [
|
|
46
46
|
"class",
|
|
47
47
|
"className",
|
|
48
48
|
"dataTheme",
|
|
@@ -63,36 +63,36 @@ const Pagination = (props)=>{
|
|
|
63
63
|
};
|
|
64
64
|
return (()=>{
|
|
65
65
|
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$5 = _el$3.nextSibling, _el$6 = (_el$5.nextSibling, _el$2.nextSibling), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild, _el$9 = _el$7.nextSibling, _el$0 = _el$9.firstChild;
|
|
66
|
-
|
|
66
|
+
spread(_el$, mergeProps(others, {
|
|
67
67
|
"aria-label": "pagination",
|
|
68
68
|
role: "navigation"
|
|
69
69
|
}, ()=>({
|
|
70
|
-
class:
|
|
70
|
+
class: twMerge(CLASSES.base, local.class, local.className)
|
|
71
71
|
}), {
|
|
72
72
|
get ["data-theme"] () {
|
|
73
73
|
return local.dataTheme;
|
|
74
74
|
},
|
|
75
75
|
"data-slot": "pagination"
|
|
76
76
|
}), false, true);
|
|
77
|
-
|
|
78
|
-
class:
|
|
77
|
+
spread(_el$2, mergeProps(()=>({
|
|
78
|
+
class: CLASSES.slot.summary
|
|
79
79
|
}), {
|
|
80
80
|
"data-slot": "pagination-summary"
|
|
81
81
|
}), false, true);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
class:
|
|
82
|
+
insert(_el$2, currentPage, _el$5);
|
|
83
|
+
insert(_el$2, safeTotal, null);
|
|
84
|
+
spread(_el$6, mergeProps(()=>({
|
|
85
|
+
class: CLASSES.slot.content
|
|
86
86
|
}), {
|
|
87
87
|
"data-slot": "pagination-content"
|
|
88
88
|
}), false, true);
|
|
89
|
-
|
|
90
|
-
class:
|
|
89
|
+
spread(_el$7, mergeProps(()=>({
|
|
90
|
+
class: CLASSES.slot.item
|
|
91
91
|
}), {
|
|
92
92
|
"data-slot": "pagination-item"
|
|
93
93
|
}), false, true);
|
|
94
|
-
|
|
95
|
-
class:
|
|
94
|
+
spread(_el$8, mergeProps(()=>({
|
|
95
|
+
class: twMerge(CLASSES.slot.link, CLASSES.slot.linkNav)
|
|
96
96
|
}), {
|
|
97
97
|
"data-slot": "pagination-previous",
|
|
98
98
|
onClick: ()=>handleChange(currentPage() - 1),
|
|
@@ -101,21 +101,21 @@ const Pagination = (props)=>{
|
|
|
101
101
|
},
|
|
102
102
|
"aria-label": "Go to previous page"
|
|
103
103
|
}), false, true);
|
|
104
|
-
|
|
104
|
+
insert(_el$6, createComponent(For, {
|
|
105
105
|
get each () {
|
|
106
106
|
return tokens();
|
|
107
107
|
},
|
|
108
108
|
children: (token)=>(()=>{
|
|
109
109
|
var _el$1 = _tmpl$2();
|
|
110
|
-
|
|
111
|
-
class:
|
|
110
|
+
spread(_el$1, mergeProps(()=>({
|
|
111
|
+
class: CLASSES.slot.item
|
|
112
112
|
}), {
|
|
113
113
|
"data-slot": "pagination-item"
|
|
114
114
|
}), false, true);
|
|
115
|
-
|
|
115
|
+
insert(_el$1, "number" == typeof token ? (()=>{
|
|
116
116
|
var _el$10 = _tmpl$3();
|
|
117
|
-
|
|
118
|
-
class:
|
|
117
|
+
spread(_el$10, mergeProps(()=>({
|
|
118
|
+
class: CLASSES.slot.link
|
|
119
119
|
}), {
|
|
120
120
|
"data-slot": "pagination-link",
|
|
121
121
|
get ["data-active"] () {
|
|
@@ -130,12 +130,12 @@ const Pagination = (props)=>{
|
|
|
130
130
|
},
|
|
131
131
|
onClick: ()=>handleChange(token)
|
|
132
132
|
}), false, true);
|
|
133
|
-
|
|
133
|
+
insert(_el$10, token);
|
|
134
134
|
return _el$10;
|
|
135
135
|
})() : (()=>{
|
|
136
136
|
var _el$11 = _tmpl$4();
|
|
137
|
-
|
|
138
|
-
class:
|
|
137
|
+
spread(_el$11, mergeProps(()=>({
|
|
138
|
+
class: CLASSES.slot.ellipsis
|
|
139
139
|
}), {
|
|
140
140
|
"data-slot": "pagination-ellipsis",
|
|
141
141
|
"aria-hidden": "true"
|
|
@@ -145,13 +145,13 @@ const Pagination = (props)=>{
|
|
|
145
145
|
return _el$1;
|
|
146
146
|
})()
|
|
147
147
|
}), _el$9);
|
|
148
|
-
|
|
149
|
-
class:
|
|
148
|
+
spread(_el$9, mergeProps(()=>({
|
|
149
|
+
class: CLASSES.slot.item
|
|
150
150
|
}), {
|
|
151
151
|
"data-slot": "pagination-item"
|
|
152
152
|
}), false, true);
|
|
153
|
-
|
|
154
|
-
class:
|
|
153
|
+
spread(_el$0, mergeProps(()=>({
|
|
154
|
+
class: twMerge(CLASSES.slot.link, CLASSES.slot.linkNav)
|
|
155
155
|
}), {
|
|
156
156
|
"data-slot": "pagination-next",
|
|
157
157
|
onClick: ()=>handleChange(currentPage() + 1),
|
|
@@ -164,4 +164,4 @@ const Pagination = (props)=>{
|
|
|
164
164
|
})();
|
|
165
165
|
};
|
|
166
166
|
const pagination_Pagination = Pagination;
|
|
167
|
-
export
|
|
167
|
+
export default pagination_Pagination;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __webpack_exports__default = __WEBPACK_EXTERNAL_MODULE__Pagination_js_1510fb78__["default"];
|
|
3
|
-
export { __webpack_exports__default as default };
|
|
1
|
+
export { default } from "./Pagination.js";
|