@enact/limestone 1.3.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/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- package/.github/workflows/update-copyright-years.yml +25 -0
- package/.travis.yml +40 -0
- package/ActionGuide/ActionGuide.d.ts +73 -0
- package/ActionGuide/ActionGuide.js +164 -0
- package/ActionGuide/ActionGuide.module.css +73 -0
- package/ActionGuide/package.json +3 -0
- package/ActionGuide/tests/ActionGuide-specs.js +51 -0
- package/Alert/Alert.d.ts +155 -0
- package/Alert/Alert.js +313 -0
- package/Alert/Alert.module.css +190 -0
- package/Alert/AlertImage.js +102 -0
- package/Alert/AlertImage.module.css +15 -0
- package/Alert/package.json +3 -0
- package/Alert/tests/Alert-specs.js +204 -0
- package/BodyText/BodyText.d.ts +74 -0
- package/BodyText/BodyText.js +170 -0
- package/BodyText/BodyText.module.css +95 -0
- package/BodyText/package.json +3 -0
- package/BodyText/tests/BodyText-specs.js +55 -0
- package/Button/Button.d.ts +131 -0
- package/Button/Button.js +351 -0
- package/Button/Button.module.css +2518 -0
- package/Button/package.json +3 -0
- package/Button/tests/Button-specs.js +252 -0
- package/CHANGELOG.md +170 -0
- package/Card/Card.d.ts +138 -0
- package/Card/Card.js +396 -0
- package/Card/Card.module.css +1296 -0
- package/Card/package.json +3 -0
- package/Card/tests/Card-specs.js +65 -0
- package/Checkbox/Checkbox.d.ts +99 -0
- package/Checkbox/Checkbox.js +222 -0
- package/Checkbox/Checkbox.module.css +1395 -0
- package/Checkbox/package.json +3 -0
- package/Checkbox/tests/Checkbox-specs.js +79 -0
- package/CheckboxItem/CheckboxItem.d.ts +99 -0
- package/CheckboxItem/CheckboxItem.js +210 -0
- package/CheckboxItem/CheckboxItem.module.css +50 -0
- package/CheckboxItem/package.json +3 -0
- package/CheckboxItem/tests/CheckboxItem-specs.js +52 -0
- package/Chips/Chip.js +252 -0
- package/Chips/Chip.module.css +30 -0
- package/Chips/Chips.js +215 -0
- package/Chips/Chips.module.css +8 -0
- package/Chips/index.js +86 -0
- package/Chips/tests/Chip-specs.js +186 -0
- package/Chips/tests/Chips-specs.js +312 -0
- package/ColorPicker/ColorPicker.js +416 -0
- package/ColorPicker/ColorPicker.module.css +78 -0
- package/ColorPicker/package.json +3 -0
- package/ColorPicker/tests/ColorPicker-specs.js +225 -0
- package/ColorPicker/utils.js +135 -0
- package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +106 -0
- package/ContextualMenuDecorator/ContextualMenuDecorator.js +264 -0
- package/ContextualMenuDecorator/ContextualMenuDecorator.module.css +42 -0
- package/ContextualMenuDecorator/package.json +3 -0
- package/ContextualMenuDecorator/tests/ContextualMenuDecorator-specs.js +136 -0
- package/ContextualPopupDecorator/ContextualPopup.js +200 -0
- package/ContextualPopupDecorator/ContextualPopup.module.css +270 -0
- package/ContextualPopupDecorator/ContextualPopupDecorator.d.ts +182 -0
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +867 -0
- package/ContextualPopupDecorator/ContextualPopupDecorator.module.css +3 -0
- package/ContextualPopupDecorator/HolePunchScrim.js +69 -0
- package/ContextualPopupDecorator/HolePunchScrim.module.css +38 -0
- package/ContextualPopupDecorator/package.json +3 -0
- package/ContextualPopupDecorator/tests/ContextualPopupDecorator-specs.js +621 -0
- package/DatePicker/DatePicker.d.ts +173 -0
- package/DatePicker/DatePicker.js +175 -0
- package/DatePicker/DatePicker.module.css +5 -0
- package/DatePicker/DatePickerBase.js +348 -0
- package/DatePicker/package.json +3 -0
- package/DatePicker/tests/DatePicker-specs.js +247 -0
- package/DayPicker/DayPicker.d.ts +92 -0
- package/DayPicker/DayPicker.js +188 -0
- package/DayPicker/DayPicker.module.css +35 -0
- package/DayPicker/DaySelectorDecorator.js +301 -0
- package/DayPicker/package.json +3 -0
- package/DayPicker/tests/DayPicker-specs.js +138 -0
- package/Dropdown/Dropdown.d.ts +135 -0
- package/Dropdown/Dropdown.js +460 -0
- package/Dropdown/Dropdown.module.css +160 -0
- package/Dropdown/DropdownList.js +360 -0
- package/Dropdown/package.json +3 -0
- package/Dropdown/tests/Dropdown-specs.js +267 -0
- package/FixedPopupPanels/FixedPopupPanels.d.ts +72 -0
- package/FixedPopupPanels/FixedPopupPanels.js +170 -0
- package/FixedPopupPanels/FixedPopupPanels.module.css +146 -0
- package/FixedPopupPanels/package.json +3 -0
- package/FixedPopupPanels/tests/FixedPopupPanels-specs.js +142 -0
- package/FlexiblePopupPanels/FlexiblePopupPanels.js +177 -0
- package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +291 -0
- package/FlexiblePopupPanels/Header.js +110 -0
- package/FlexiblePopupPanels/Panel.js +256 -0
- package/FlexiblePopupPanels/index.d.ts +145 -0
- package/FlexiblePopupPanels/index.js +68 -0
- package/FlexiblePopupPanels/package.json +3 -0
- package/FlexiblePopupPanels/tests/FlexiblePopupPanels-specs.js +305 -0
- package/FlexiblePopupPanels/useNavButtonFocus.js +65 -0
- package/FormCheckboxItem/FormCheckboxItem.d.ts +87 -0
- package/FormCheckboxItem/FormCheckboxItem.js +200 -0
- package/FormCheckboxItem/FormCheckboxItem.module.css +374 -0
- package/FormCheckboxItem/package.json +3 -0
- package/FormCheckboxItem/tests/FormCheckboxItem-specs.js +164 -0
- package/Heading/Heading.d.ts +104 -0
- package/Heading/Heading.js +203 -0
- package/Heading/Heading.module.css +217 -0
- package/Heading/package.json +3 -0
- package/Heading/tests/Heading-specs.js +57 -0
- package/Icon/Icon.d.ts +377 -0
- package/Icon/Icon.js +503 -0
- package/Icon/Icon.module.css +121 -0
- package/Icon/IconList.js +611 -0
- package/Icon/package.json +3 -0
- package/Icon/tests/Icon-specs.js +131 -0
- package/IconItem/IconItem.d.ts +137 -0
- package/IconItem/IconItem.js +360 -0
- package/IconItem/IconItem.module.css +414 -0
- package/IconItem/package.json +3 -0
- package/IconItem/tests/IconItem-specs.js +106 -0
- package/Image/Image.d.ts +60 -0
- package/Image/Image.js +165 -0
- package/Image/Image.module.css +5 -0
- package/Image/package.json +3 -0
- package/Image/tests/Image-specs.js +62 -0
- package/ImageItem/ImageItem.d.ts +134 -0
- package/ImageItem/ImageItem.js +377 -0
- package/ImageItem/ImageItem.module.css +1079 -0
- package/ImageItem/package.json +3 -0
- package/ImageItem/tests/ImageItem-specs.js +223 -0
- package/Input/Input.js +715 -0
- package/Input/Input.module.css +699 -0
- package/Input/InputField.js +487 -0
- package/Input/InputField.module.css +763 -0
- package/Input/InputFieldDecoratorIcon.js +66 -0
- package/Input/InputFieldSpotlightDecorator.js +380 -0
- package/Input/Keypad.js +111 -0
- package/Input/NumberField.js +311 -0
- package/Input/index.d.ts +423 -0
- package/Input/index.js +87 -0
- package/Input/package.json +3 -0
- package/Input/pointer.js +103 -0
- package/Input/tests/Input-specs.js +537 -0
- package/Input/tests/InputField-specs.js +292 -0
- package/Input/tests/InputPopup-specs.js +56 -0
- package/Input/util.js +130 -0
- package/Item/Item.d.ts +108 -0
- package/Item/Item.js +360 -0
- package/Item/Item.module.css +665 -0
- package/Item/package.json +3 -0
- package/Item/tests/Item-specs.js +108 -0
- package/KeyGuide/KeyGuide.d.ts +103 -0
- package/KeyGuide/KeyGuide.js +254 -0
- package/KeyGuide/KeyGuide.module.css +431 -0
- package/KeyGuide/package.json +3 -0
- package/KeyGuide/tests/KeyGuide-specs.js +168 -0
- package/LICENSE +201 -0
- package/Marquee/Marquee.d.ts +42 -0
- package/Marquee/Marquee.js +45 -0
- package/Marquee/package.json +3 -0
- package/MediaOverlay/MediaOverlay.d.ts +134 -0
- package/MediaOverlay/MediaOverlay.js +304 -0
- package/MediaOverlay/MediaOverlay.module.css +292 -0
- package/MediaOverlay/package.json +3 -0
- package/MediaOverlay/tests/MediaOverlay-specs.js +127 -0
- package/MediaPlayer/MediaControls.js +934 -0
- package/MediaPlayer/MediaControls.module.css +86 -0
- package/MediaPlayer/MediaKnob.js +61 -0
- package/MediaPlayer/MediaSlider.js +131 -0
- package/MediaPlayer/MediaSlider.module.css +319 -0
- package/MediaPlayer/MediaSliderDecorator.js +245 -0
- package/MediaPlayer/Times.js +152 -0
- package/MediaPlayer/Times.module.css +34 -0
- package/MediaPlayer/index.d.ts +223 -0
- package/MediaPlayer/index.js +34 -0
- package/MediaPlayer/package.json +3 -0
- package/MediaPlayer/tests/MediaSlider-specs.js +126 -0
- package/MediaPlayer/tests/util-specs.js +114 -0
- package/MediaPlayer/util.js +83 -0
- package/PageViews/Page.js +77 -0
- package/PageViews/Page.module.css +3 -0
- package/PageViews/PageViews.js +440 -0
- package/PageViews/PageViews.module.css +175 -0
- package/PageViews/PageViewsRouter.js +150 -0
- package/PageViews/index.js +45 -0
- package/PageViews/tests/PageViews-specs.js +192 -0
- package/Panels/Header.js +599 -0
- package/Panels/Header.module.css +243 -0
- package/Panels/Panel.js +347 -0
- package/Panels/Panel.module.css +33 -0
- package/Panels/Panels.js +258 -0
- package/Panels/Panels.module.css +12 -0
- package/Panels/index.d.ts +376 -0
- package/Panels/index.js +66 -0
- package/Panels/package.json +3 -0
- package/Panels/tests/Header-specs.js +146 -0
- package/Panels/tests/Panels-specs.js +257 -0
- package/Picker/Picker.d.ts +193 -0
- package/Picker/Picker.js +389 -0
- package/Picker/Picker.module.css +46 -0
- package/Picker/package.json +3 -0
- package/Picker/tests/Picker-specs.js +91 -0
- package/Popup/Popup.d.ts +169 -0
- package/Popup/Popup.js +690 -0
- package/Popup/Popup.module.css +180 -0
- package/Popup/package.json +3 -0
- package/Popup/tests/Popup-specs.js +475 -0
- package/PopupTabLayout/PopupTabLayout.d.ts +196 -0
- package/PopupTabLayout/PopupTabLayout.js +605 -0
- package/PopupTabLayout/PopupTabLayout.module.css +226 -0
- package/PopupTabLayout/package.json +3 -0
- package/PopupTabLayout/tests/PopupTabLayout-specs.js +285 -0
- package/ProgressBar/ProgressBar.d.ts +171 -0
- package/ProgressBar/ProgressBar.js +223 -0
- package/ProgressBar/ProgressBar.module.css +264 -0
- package/ProgressBar/ProgressBarTooltip.js +359 -0
- package/ProgressBar/ProgressBarTooltip.module.css +86 -0
- package/ProgressBar/package.json +3 -0
- package/ProgressBar/tests/ProgressBar-specs.js +400 -0
- package/ProgressButton/ProgressButton.d.ts +57 -0
- package/ProgressButton/ProgressButton.js +143 -0
- package/ProgressButton/ProgressButton.module.css +147 -0
- package/ProgressButton/package.json +3 -0
- package/ProgressButton/tests/ProgressButton-specs.js +71 -0
- package/QuickGuidePanels/Panel.js +90 -0
- package/QuickGuidePanels/QuickGuidePanels.js +463 -0
- package/QuickGuidePanels/QuickGuidePanels.module.css +26 -0
- package/QuickGuidePanels/index.js +52 -0
- package/QuickGuidePanels/tests/QuickGuidePanels-specs.js +250 -0
- package/README.md +59 -0
- package/RadioItem/RadioItem.d.ts +59 -0
- package/RadioItem/RadioItem.js +146 -0
- package/RadioItem/RadioItem.module.css +233 -0
- package/RadioItem/package.json +3 -0
- package/RadioItem/tests/RadioItem-specs.js +62 -0
- package/RangePicker/RangePicker.d.ts +174 -0
- package/RangePicker/RangePicker.js +372 -0
- package/RangePicker/RangePicker.module.css +55 -0
- package/RangePicker/package.json +3 -0
- package/RangePicker/tests/RangePicker-specs.js +122 -0
- package/Region/Region.d.ts +33 -0
- package/Region/Region.js +91 -0
- package/Region/package.json +3 -0
- package/Region/tests/Region-specs.js +28 -0
- package/Scroller/ContentContainerDecorator.js +24 -0
- package/Scroller/EditableWrapper.js +1036 -0
- package/Scroller/EditableWrapper.module.css +22 -0
- package/Scroller/Scroller.d.ts +270 -0
- package/Scroller/Scroller.js +470 -0
- package/Scroller/Scroller.module.css +41 -0
- package/Scroller/package.json +3 -0
- package/Scroller/tests/ContentContainerDecorator-specs.js +20 -0
- package/Scroller/tests/EditableWrapper-specs.js +133 -0
- package/Scroller/tests/Scroller-specs.js +159 -0
- package/Scroller/useEvent.js +39 -0
- package/Scroller/useThemeScroller.js +410 -0
- package/Skinnable/Skinnable.d.ts +27 -0
- package/Skinnable/Skinnable.js +65 -0
- package/Skinnable/package.json +3 -0
- package/Slider/Slider.d.ts +218 -0
- package/Slider/Slider.js +441 -0
- package/Slider/Slider.module.css +880 -0
- package/Slider/SliderBehaviorDecorator.js +184 -0
- package/Slider/package.json +3 -0
- package/Slider/tests/Slider-specs.js +573 -0
- package/Slider/utils.js +114 -0
- package/Spinner/Spinner.d.ts +64 -0
- package/Spinner/Spinner.js +254 -0
- package/Spinner/Spinner.module.css +368 -0
- package/Spinner/package.json +3 -0
- package/Spinner/tests/Spinner-specs.js +70 -0
- package/Sprite/Sprite.d.ts +100 -0
- package/Sprite/Sprite.js +345 -0
- package/Sprite/Sprite.module.css +32 -0
- package/Sprite/package.json +3 -0
- package/Sprite/tests/Sprite-specs.js +59 -0
- package/Steps/Steps.d.ts +119 -0
- package/Steps/Steps.js +303 -0
- package/Steps/Steps.module.css +130 -0
- package/Steps/package.json +3 -0
- package/Steps/tests/Steps-specs.js +175 -0
- package/Switch/Switch.d.ts +54 -0
- package/Switch/Switch.js +143 -0
- package/Switch/Switch.module.css +714 -0
- package/Switch/package.json +3 -0
- package/Switch/tests/Switch-specs.js +54 -0
- package/SwitchItem/SwitchItem.d.ts +56 -0
- package/SwitchItem/SwitchItem.js +144 -0
- package/SwitchItem/SwitchItem.module.css +31 -0
- package/SwitchItem/package.json +3 -0
- package/SwitchItem/tests/SwitchItem-specs.js +49 -0
- package/TabLayout/RefocusDecorator.js +142 -0
- package/TabLayout/Tab.js +84 -0
- package/TabLayout/TabGroup.js +377 -0
- package/TabLayout/TabGroup.module.css +280 -0
- package/TabLayout/TabLayout.d.ts +161 -0
- package/TabLayout/TabLayout.js +661 -0
- package/TabLayout/TabLayout.module.css +101 -0
- package/TabLayout/package.json +3 -0
- package/TabLayout/tests/TabGroup-specs.js +214 -0
- package/TabLayout/tests/TabLayout-specs.js +740 -0
- package/ThemeDecorator/AccessibilityDecorator.js +151 -0
- package/ThemeDecorator/I18nFontDecorator.js +33 -0
- package/ThemeDecorator/ThemeDecorator.d.ts +143 -0
- package/ThemeDecorator/ThemeDecorator.js +307 -0
- package/ThemeDecorator/ThemeDecorator.module.css +1250 -0
- package/ThemeDecorator/fontGenerator.js +76 -0
- package/ThemeDecorator/package.json +3 -0
- package/ThemeDecorator/screenTypes.json +10 -0
- package/ThemeDecorator/tests/ThemeDecorator-specs.js +151 -0
- package/TimePicker/TimePicker.d.ts +147 -0
- package/TimePicker/TimePicker.js +255 -0
- package/TimePicker/TimePicker.module.css +61 -0
- package/TimePicker/TimePickerBase.js +396 -0
- package/TimePicker/package.json +3 -0
- package/TimePicker/tests/TimePicker-specs.js +248 -0
- package/TooltipDecorator/Tooltip.js +252 -0
- package/TooltipDecorator/Tooltip.module.css +496 -0
- package/TooltipDecorator/TooltipDecorator.d.ts +229 -0
- package/TooltipDecorator/TooltipDecorator.js +260 -0
- package/TooltipDecorator/TooltipLabel.js +117 -0
- package/TooltipDecorator/package.json +3 -0
- package/TooltipDecorator/tests/TooltipDecorator-specs.js +224 -0
- package/TooltipDecorator/tests/useTooltip-specs.js +266 -0
- package/TooltipDecorator/useTooltip.js +278 -0
- package/TooltipDecorator/util.js +273 -0
- package/VideoPlayer/Feedback.js +110 -0
- package/VideoPlayer/Feedback.module.css +55 -0
- package/VideoPlayer/FeedbackContent.js +99 -0
- package/VideoPlayer/FeedbackIcon.js +67 -0
- package/VideoPlayer/FeedbackIcons.js +76 -0
- package/VideoPlayer/FeedbackTooltip.js +242 -0
- package/VideoPlayer/FeedbackTooltip.module.css +160 -0
- package/VideoPlayer/MediaTitle.js +143 -0
- package/VideoPlayer/MediaTitle.module.css +95 -0
- package/VideoPlayer/Overlay.js +51 -0
- package/VideoPlayer/Video.js +345 -0
- package/VideoPlayer/VideoPlayer.d.ts +582 -0
- package/VideoPlayer/VideoPlayer.js +2116 -0
- package/VideoPlayer/VideoPlayer.module.css +164 -0
- package/VideoPlayer/package.json +3 -0
- package/VideoPlayer/tests/Video-specs.js +235 -0
- package/VideoPlayer/tests/VideoPlayer-specs.js +180 -0
- package/VirtualList/VirtualList.d.ts +411 -0
- package/VirtualList/VirtualList.js +931 -0
- package/VirtualList/VirtualList.module.css +52 -0
- package/VirtualList/package.json +3 -0
- package/VirtualList/tests/VirtualGridList-specs.js +289 -0
- package/VirtualList/tests/VirtualGridList-translate-specs.js +711 -0
- package/VirtualList/tests/VirtualList-specs.js +288 -0
- package/VirtualList/tests/VirtualList-translate-specs.js +704 -0
- package/VirtualList/tests/useEvent-specs.js +172 -0
- package/VirtualList/tests/useEvent-translate-specs.js +309 -0
- package/VirtualList/useEvent.js +324 -0
- package/VirtualList/usePreventScroll.js +31 -0
- package/VirtualList/useSpotlight.js +157 -0
- package/VirtualList/useThemeVirtualList.js +471 -0
- package/VirtualList/useThemeVirtualList.module.css +34 -0
- package/WizardPanels/Panel.js +99 -0
- package/WizardPanels/WizardPanels.js +501 -0
- package/WizardPanels/WizardPanels.module.css +15 -0
- package/WizardPanels/index.d.ts +182 -0
- package/WizardPanels/index.js +50 -0
- package/WizardPanels/package.json +3 -0
- package/WizardPanels/tests/WizardPanels-specs.js +713 -0
- package/codecov.yml +13 -0
- package/fonts/Limestone_Icons.ttf +0 -0
- package/fonts/Miso/LICENSE.txt +75 -0
- package/fonts/Miso/Miso-Bold.ttf +0 -0
- package/fonts/Miso/Miso-Light.ttf +0 -0
- package/fonts/Miso/Miso-Regular.ttf +0 -0
- package/fonts/MuseoSans/LICENSE.txt +75 -0
- package/fonts/MuseoSans/MuseoSans-Black.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-BlackItalic.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-Bold.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-BoldItalic.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-Light.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-Medium.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-MediumItalic.ttf +0 -0
- package/fonts/MuseoSans/MuseoSans-Thin.ttf +0 -0
- package/index.js +2 -0
- package/internal/$L/$L.d.ts +21 -0
- package/internal/$L/$L.js +97 -0
- package/internal/$L/package.json +3 -0
- package/internal/AsyncRenderChildren/AsyncRenderChildren.js +74 -0
- package/internal/AsyncRenderChildren/package.json +3 -0
- package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +49 -0
- package/internal/DateComponentPicker/DateComponentPicker.js +165 -0
- package/internal/DateComponentPicker/DateComponentPicker.module.css +53 -0
- package/internal/DateComponentPicker/DateComponentRangePicker.js +132 -0
- package/internal/DateComponentPicker/index.js +31 -0
- package/internal/DateComponentPicker/package.json +3 -0
- package/internal/DateTime/DateTime.js +83 -0
- package/internal/DateTime/DateTime.module.css +51 -0
- package/internal/DateTime/DateTimeDecorator.js +268 -0
- package/internal/DateTime/index.js +37 -0
- package/internal/DateTime/package.json +3 -0
- package/internal/DateTime/tests/DateTimeDecorator-specs.js +33 -0
- package/internal/DebounceDecorator/DebounceDecorator.js +125 -0
- package/internal/DebounceDecorator/package.json +3 -0
- package/internal/DebounceDecorator/tests/DebounceDecorator-specs.js +151 -0
- package/internal/Panels/Arrangers.js +248 -0
- package/internal/Panels/CancelDecorator.js +43 -0
- package/internal/Panels/FloatingLayerIdProvider.js +27 -0
- package/internal/Panels/NavigationButton.js +64 -0
- package/internal/Panels/NavigationButton.module.css +69 -0
- package/internal/Panels/PanelsRouter.js +223 -0
- package/internal/Panels/PopupDecorator.js +287 -0
- package/internal/Panels/TransitionDecorator.js +99 -0
- package/internal/Panels/Viewport.js +313 -0
- package/internal/Panels/Viewport.module.css +25 -0
- package/internal/Panels/captureKeys.js +48 -0
- package/internal/Panels/index.js +101 -0
- package/internal/Panels/package.json +3 -0
- package/internal/Panels/useAutoFocus.js +95 -0
- package/internal/Panels/useFocusOnTransition.js +45 -0
- package/internal/Panels/useToggleRole.js +30 -0
- package/internal/Panels/util.js +64 -0
- package/internal/Picker/Picker.js +942 -0
- package/internal/Picker/Picker.module.css +1145 -0
- package/internal/Picker/PickerButton.js +97 -0
- package/internal/Picker/PickerItem.js +38 -0
- package/internal/Picker/SpottablePicker.js +63 -0
- package/internal/Picker/package.json +3 -0
- package/internal/Picker/tests/Picker-specs.js +968 -0
- package/internal/SharedStateDecorator/SharedStateDecorator.js +167 -0
- package/internal/SharedStateDecorator/package.json +3 -0
- package/internal/SharedStateDecorator/tests/SharedStateDecorator-specs.js +277 -0
- package/internal/WindowEventable/WindowEventable.js +114 -0
- package/internal/WindowEventable/package.json +3 -0
- package/internal/util/package.json +3 -0
- package/internal/util/util.js +79 -0
- package/internal/validators/package.json +4 -0
- package/internal/validators/tests/validators-specs.js +80 -0
- package/internal/validators/validators.js +136 -0
- package/package.json +69 -0
- package/resources/ilibmanifest.json +3 -0
- package/styles/color-mixins.less +230 -0
- package/styles/colors-game-green.less +25 -0
- package/styles/colors-game-orange.less +25 -0
- package/styles/colors-game.less +56 -0
- package/styles/colors-highcontrast.less +21 -0
- package/styles/colors.less +435 -0
- package/styles/mixins.less +337 -0
- package/styles/skin.less +54 -0
- package/styles/variables-base.less +32 -0
- package/styles/variables-game.less +25 -0
- package/styles/variables.less +1182 -0
- package/useScroll/HoverToScroll.js +265 -0
- package/useScroll/HoverToScroll.module.css +38 -0
- package/useScroll/OverscrollEffect.module.css +14 -0
- package/useScroll/Scrollbar.js +171 -0
- package/useScroll/Scrollbar.module.css +19 -0
- package/useScroll/ScrollbarPlaceholder.js +64 -0
- package/useScroll/ScrollbarTrack.js +209 -0
- package/useScroll/ScrollbarTrack.module.css +136 -0
- package/useScroll/package.json +3 -0
- package/useScroll/useEvent.js +693 -0
- package/useScroll/useOverscrollEffect.js +105 -0
- package/useScroll/useScroll.js +523 -0
- package/useScroll/useScroll.module.css +49 -0
- package/useScroll/useSpotlight.js +32 -0
- package/useScroll/useThemeScrollContentHandle.js +32 -0
|
@@ -0,0 +1,942 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Picker = void 0;
|
|
7
|
+
Object.defineProperty(exports, "PickerItem", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _PickerItem["default"];
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports["default"] = void 0;
|
|
14
|
+
var _classnames3 = _interopRequireDefault(require("classnames"));
|
|
15
|
+
var _handle = require("@enact/core/handle");
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
17
|
+
var _keymap = require("@enact/core/keymap");
|
|
18
|
+
var _platform = _interopRequireDefault(require("@enact/core/platform"));
|
|
19
|
+
var _usePublicClassNames = require("@enact/core/usePublicClassNames");
|
|
20
|
+
var _util = require("@enact/core/util");
|
|
21
|
+
var _ForwardRef = _interopRequireDefault(require("@enact/ui/ForwardRef"));
|
|
22
|
+
var _IdProvider = _interopRequireDefault(require("@enact/ui/internal/IdProvider"));
|
|
23
|
+
var _Layout = _interopRequireWildcard(require("@enact/ui/Layout"));
|
|
24
|
+
var _Touchable = _interopRequireDefault(require("@enact/ui/Touchable"));
|
|
25
|
+
var _ViewManager = require("@enact/ui/ViewManager");
|
|
26
|
+
var _spotlight = _interopRequireWildcard(require("@enact/spotlight"));
|
|
27
|
+
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
28
|
+
var _react = require("react");
|
|
29
|
+
var _Skinnable = _interopRequireDefault(require("../../Skinnable"));
|
|
30
|
+
var _$L = _interopRequireDefault(require("../$L"));
|
|
31
|
+
var _validators = require("../validators");
|
|
32
|
+
var _util2 = require("../util");
|
|
33
|
+
var _PickerButton = _interopRequireDefault(require("./PickerButton"));
|
|
34
|
+
var _SpottablePicker = _interopRequireDefault(require("./SpottablePicker"));
|
|
35
|
+
var _PickerModule = _interopRequireDefault(require("./Picker.module.css"));
|
|
36
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
37
|
+
var _PickerItem = _interopRequireDefault(require("./PickerItem"));
|
|
38
|
+
var _excluded = ["ref"],
|
|
39
|
+
_excluded2 = ["aria-valuetext", "changedBy", "children", "css", "disabled", "id", "index", "joined", "max", "min", "onChange", "onSpotlightDisappear", "orientation", "reverse", "spotlightDisabled", "step", "value", "width", "wrap"];
|
|
40
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
41
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
42
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
43
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
44
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
45
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
46
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
47
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
48
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
49
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
50
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
51
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
52
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
53
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
54
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
55
|
+
var holdConfig = {
|
|
56
|
+
events: [{
|
|
57
|
+
name: 'hold',
|
|
58
|
+
time: 800
|
|
59
|
+
}]
|
|
60
|
+
};
|
|
61
|
+
var isDown = (0, _keymap.is)('down');
|
|
62
|
+
var isEnter = (0, _keymap.is)('enter');
|
|
63
|
+
var isLeft = (0, _keymap.is)('left');
|
|
64
|
+
var isRight = (0, _keymap.is)('right');
|
|
65
|
+
var isUp = (0, _keymap.is)('up');
|
|
66
|
+
var DivComponent = function DivComponent(_ref) {
|
|
67
|
+
var ref = _ref.ref,
|
|
68
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
69
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread({
|
|
70
|
+
ref: ref
|
|
71
|
+
}, rest));
|
|
72
|
+
};
|
|
73
|
+
DivComponent.propTypes = {
|
|
74
|
+
/**
|
|
75
|
+
* Called with the reference to the current node.
|
|
76
|
+
*
|
|
77
|
+
* @type {Object|Function}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
ref: _propTypes["default"].ref
|
|
81
|
+
};
|
|
82
|
+
var Div = (0, _Touchable["default"])(DivComponent);
|
|
83
|
+
var SpottableDiv = (0, _Touchable["default"])((0, _ForwardRef["default"])({
|
|
84
|
+
prop: 'containerRef'
|
|
85
|
+
}, _SpottablePicker["default"]));
|
|
86
|
+
var PickerViewManager = (0, _util2.onlyUpdateForProps)(_ViewManager.ViewManager, ['index', 'children']);
|
|
87
|
+
var wrapRange = function wrapRange(min, max, value) {
|
|
88
|
+
if (value > max) {
|
|
89
|
+
return min;
|
|
90
|
+
} else if (value < min) {
|
|
91
|
+
return max;
|
|
92
|
+
} else {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var selectIcon = function selectIcon(icon, v, h) {
|
|
97
|
+
return function (props) {
|
|
98
|
+
return props[icon] || (props.orientation === 'vertical' ? v : h);
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
var selectIncIcon = selectIcon('incrementIcon', 'triangleup', 'triangleright');
|
|
102
|
+
var selectDecIcon = selectIcon('decrementIcon', 'triangledown', 'triangleleft');
|
|
103
|
+
|
|
104
|
+
// Set-up event forwarding
|
|
105
|
+
var forwardBlur = (0, _handle.forward)('onBlur'),
|
|
106
|
+
forwardFocus = (0, _handle.forward)('onFocus'),
|
|
107
|
+
forwardKeyDown = (0, _handle.forward)('onKeyDown'),
|
|
108
|
+
forwardKeyUp = (0, _handle.forward)('onKeyUp'),
|
|
109
|
+
forwardWheel = (0, _handle.forward)('onWheel');
|
|
110
|
+
var allowedClassNames = ['picker', 'valueWrapper', 'joined', 'horizontal', 'vertical'];
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* The base component for {@link limestone/internal/Picker.Picker}.
|
|
114
|
+
*
|
|
115
|
+
* @class Picker
|
|
116
|
+
* @memberof limestone/internal/Picker
|
|
117
|
+
* @ui
|
|
118
|
+
* @private
|
|
119
|
+
*/
|
|
120
|
+
var _PickerBase = function PickerBase(props) {
|
|
121
|
+
// Set to `true` onFocus and `false` onBlur to prevent setting aria-valuetext (which
|
|
122
|
+
// will notify the user) when the component does not have focus
|
|
123
|
+
var _useState = (0, _react.useState)(false),
|
|
124
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
125
|
+
active = _useState2[0],
|
|
126
|
+
setActive = _useState2[1];
|
|
127
|
+
var _useState3 = (0, _react.useState)(0),
|
|
128
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
129
|
+
pressed = _useState4[0],
|
|
130
|
+
setPressed = _useState4[1];
|
|
131
|
+
var containerRef = (0, _react.useRef)(null);
|
|
132
|
+
var pickerButtonPressed = (0, _react.useRef)(0);
|
|
133
|
+
var reverseTransition = (0, _react.useRef)(false);
|
|
134
|
+
var ariaValueText = props['aria-valuetext'],
|
|
135
|
+
_props$changedBy = props.changedBy,
|
|
136
|
+
changedBy = _props$changedBy === void 0 ? 'enter' : _props$changedBy,
|
|
137
|
+
children = props.children,
|
|
138
|
+
customCss = props.css,
|
|
139
|
+
disabled = props.disabled,
|
|
140
|
+
id = props.id,
|
|
141
|
+
index = props.index,
|
|
142
|
+
joined = props.joined,
|
|
143
|
+
max = props.max,
|
|
144
|
+
min = props.min,
|
|
145
|
+
onChange = props.onChange,
|
|
146
|
+
onSpotlightDisappear = props.onSpotlightDisappear,
|
|
147
|
+
_props$orientation = props.orientation,
|
|
148
|
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
|
149
|
+
reverse = props.reverse,
|
|
150
|
+
_props$spotlightDisab = props.spotlightDisabled,
|
|
151
|
+
spotlightDisabled = _props$spotlightDisab === void 0 ? false : _props$spotlightDisab,
|
|
152
|
+
_props$step = props.step,
|
|
153
|
+
step = _props$step === void 0 ? 1 : _props$step,
|
|
154
|
+
_props$value = props.value,
|
|
155
|
+
value = _props$value === void 0 ? 0 : _props$value,
|
|
156
|
+
width = props.width,
|
|
157
|
+
wrap = props.wrap,
|
|
158
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
159
|
+
var css = (0, _usePublicClassNames.usePublicClassNames)({
|
|
160
|
+
componentCss: _PickerModule["default"],
|
|
161
|
+
customCss: customCss,
|
|
162
|
+
publicClassNames: allowedClassNames
|
|
163
|
+
});
|
|
164
|
+
var incrementIcon = selectIncIcon(props);
|
|
165
|
+
var decrementIcon = selectDecIcon(props);
|
|
166
|
+
var horizontal = orientation === 'horizontal';
|
|
167
|
+
var isHorizontalJoinedEnter = horizontal && joined && changedBy === 'enter';
|
|
168
|
+
var showIndicators = isHorizontalJoinedEnter && Array.isArray(children) && children.length > 1;
|
|
169
|
+
var voiceProps = (0, _util2.extractVoiceProps)(rest);
|
|
170
|
+
var voiceLabelsExt = voiceProps['data-webos-voice-labels-ext'];
|
|
171
|
+
var Component;
|
|
172
|
+
var arranger = horizontal ? _ViewManager.SlideLeftArranger : _ViewManager.SlideTopArranger;
|
|
173
|
+
var noAnimation = typeof ENACT_PACK_NO_ANIMATION !== 'undefined' && ENACT_PACK_NO_ANIMATION || props.noAnimation || disabled;
|
|
174
|
+
var sizingPlaceholder = null;
|
|
175
|
+
var clearPressedState = (0, _react.useCallback)(function () {
|
|
176
|
+
pickerButtonPressed.current = 0;
|
|
177
|
+
setPressed(0);
|
|
178
|
+
}, []);
|
|
179
|
+
var emulateMouseUp = (0, _react.useMemo)(function () {
|
|
180
|
+
return new _util.Job(clearPressedState, 175);
|
|
181
|
+
}, [clearPressedState]);
|
|
182
|
+
var handleVoice = (0, _react.useCallback)(function (ev) {
|
|
183
|
+
var voiceIndex = ev && ev.detail && typeof ev.detail.matchedIndex !== 'undefined' && Number(ev.detail.matchedIndex);
|
|
184
|
+
if (Number.isInteger(voiceIndex)) {
|
|
185
|
+
var voiceValue = min + voiceIndex;
|
|
186
|
+
if (onChange && voiceValue >= min && voiceValue <= max && voiceValue !== value) {
|
|
187
|
+
(0, _handle.forwardCustom)('onChange', function () {
|
|
188
|
+
return {
|
|
189
|
+
value: voiceValue
|
|
190
|
+
};
|
|
191
|
+
})(ev, props);
|
|
192
|
+
ev.preventDefault();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}, [max, min, onChange, props, value]);
|
|
196
|
+
var computeNextValue = (0, _react.useCallback)(function (delta) {
|
|
197
|
+
var horizontalJoined = orientation === 'horizontal' && joined && changedBy === 'enter';
|
|
198
|
+
var shouldWrap = horizontalJoined || wrap;
|
|
199
|
+
return shouldWrap ? wrapRange(min, max, value + delta) : (0, _util.clamp)(min, max, value + delta);
|
|
200
|
+
}, [changedBy, joined, orientation, min, max, value, wrap]);
|
|
201
|
+
var adjustDirection = (0, _react.useCallback)(function (dir) {
|
|
202
|
+
return reverse ? -dir : dir;
|
|
203
|
+
}, [reverse]);
|
|
204
|
+
var hasReachedBound = (0, _react.useCallback)(function (delta) {
|
|
205
|
+
return computeNextValue(adjustDirection(delta)) === value;
|
|
206
|
+
}, [adjustDirection, computeNextValue, value]);
|
|
207
|
+
var setTransitionDirection = (0, _react.useCallback)(function (dir) {
|
|
208
|
+
// change the transition direction based on the button press
|
|
209
|
+
reverseTransition.current = !(dir > 0);
|
|
210
|
+
}, []);
|
|
211
|
+
var updateValue = (0, _react.useCallback)(function (dir) {
|
|
212
|
+
dir = adjustDirection(dir);
|
|
213
|
+
setTransitionDirection(dir);
|
|
214
|
+
if (!disabled && onChange) {
|
|
215
|
+
var updatedValue = computeNextValue(dir * step);
|
|
216
|
+
(0, _handle.forwardCustom)('onChange', function () {
|
|
217
|
+
return {
|
|
218
|
+
value: updatedValue
|
|
219
|
+
};
|
|
220
|
+
})(null, props);
|
|
221
|
+
}
|
|
222
|
+
}, [adjustDirection, setTransitionDirection, disabled, onChange, computeNextValue, step, props]);
|
|
223
|
+
var setPressedState = (0, _react.useCallback)(function (pressedValue) {
|
|
224
|
+
if (joined) {
|
|
225
|
+
setPressed(pressedValue);
|
|
226
|
+
}
|
|
227
|
+
}, [joined]);
|
|
228
|
+
var handleDecrement = (0, _react.useCallback)(function () {
|
|
229
|
+
if (!hasReachedBound(-step)) {
|
|
230
|
+
updateValue(-1);
|
|
231
|
+
setPressedState(-1);
|
|
232
|
+
}
|
|
233
|
+
}, [hasReachedBound, setPressedState, step, updateValue]);
|
|
234
|
+
var handleIncrement = (0, _react.useCallback)(function () {
|
|
235
|
+
if (!hasReachedBound(step)) {
|
|
236
|
+
updateValue(1);
|
|
237
|
+
setPressedState(1);
|
|
238
|
+
}
|
|
239
|
+
}, [hasReachedBound, setPressedState, step, updateValue]);
|
|
240
|
+
var throttleWheelDec = (0, _react.useMemo)(function () {
|
|
241
|
+
return new _util.Job(handleDecrement, 100);
|
|
242
|
+
}, [handleDecrement]);
|
|
243
|
+
var throttleWheelInc = (0, _react.useMemo)(function () {
|
|
244
|
+
return new _util.Job(handleIncrement, 100);
|
|
245
|
+
}, [handleIncrement]);
|
|
246
|
+
var handleWheel = (0, _react.useCallback)(function (ev) {
|
|
247
|
+
forwardWheel(ev, props);
|
|
248
|
+
var isContainerSpotted = containerRef.current === _spotlight["default"].getCurrent();
|
|
249
|
+
if (isContainerSpotted) {
|
|
250
|
+
var dir = -Math.sign(ev.deltaY);
|
|
251
|
+
|
|
252
|
+
// We'll sometimes get a 0/-0 wheel event we need to ignore or the wheel event has reached
|
|
253
|
+
// the bounds of the picker
|
|
254
|
+
if (dir && !hasReachedBound(step * dir)) {
|
|
255
|
+
// fire the onChange event
|
|
256
|
+
if (dir > 0) {
|
|
257
|
+
throttleWheelInc.throttle();
|
|
258
|
+
} else if (dir < 0) {
|
|
259
|
+
throttleWheelDec.throttle();
|
|
260
|
+
}
|
|
261
|
+
// simulate mouse down
|
|
262
|
+
setPressedState(dir);
|
|
263
|
+
// set a timer to simulate the mouse up
|
|
264
|
+
emulateMouseUp.start();
|
|
265
|
+
// prevent the default scroll behavior to avoid bounce back
|
|
266
|
+
ev.preventDefault();
|
|
267
|
+
ev.stopPropagation();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}, [emulateMouseUp, hasReachedBound, props, setPressedState, step, throttleWheelDec, throttleWheelInc]);
|
|
271
|
+
(0, _react.useEffect)(function () {
|
|
272
|
+
var currentPicker = containerRef.current;
|
|
273
|
+
if (_platform["default"].type === 'webos') currentPicker.addEventListener('webOSVoice', handleVoice);
|
|
274
|
+
if (joined) {
|
|
275
|
+
currentPicker.addEventListener('wheel', handleWheel);
|
|
276
|
+
} else {
|
|
277
|
+
currentPicker.removeEventListener('wheel', handleWheel);
|
|
278
|
+
}
|
|
279
|
+
return function () {
|
|
280
|
+
if (joined) {
|
|
281
|
+
currentPicker.removeEventListener('wheel', handleWheel);
|
|
282
|
+
}
|
|
283
|
+
if (_platform["default"].type === 'webos') {
|
|
284
|
+
currentPicker.removeEventListener('webOSVoice', handleVoice);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
}, [joined, handleVoice, handleWheel]);
|
|
288
|
+
(0, _react.useEffect)(function () {
|
|
289
|
+
return function () {
|
|
290
|
+
emulateMouseUp.stop();
|
|
291
|
+
throttleWheelInc.stop();
|
|
292
|
+
throttleWheelDec.stop();
|
|
293
|
+
};
|
|
294
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
295
|
+
|
|
296
|
+
var handleBlur = (0, _react.useCallback)(function (ev) {
|
|
297
|
+
forwardBlur(ev, props);
|
|
298
|
+
setActive(false);
|
|
299
|
+
}, [props]);
|
|
300
|
+
var handleFocus = (0, _react.useCallback)(function (ev) {
|
|
301
|
+
forwardFocus(ev, props);
|
|
302
|
+
setActive(true);
|
|
303
|
+
}, [props]);
|
|
304
|
+
var handleUp = (0, _react.useCallback)(function () {
|
|
305
|
+
if (joined && (pickerButtonPressed.current !== 0 || pressed !== 0)) {
|
|
306
|
+
emulateMouseUp.start();
|
|
307
|
+
}
|
|
308
|
+
}, [emulateMouseUp, joined, pressed]);
|
|
309
|
+
var setIncPickerButtonPressed = (0, _react.useCallback)(function () {
|
|
310
|
+
pickerButtonPressed.current = 1;
|
|
311
|
+
}, []);
|
|
312
|
+
var handleDown = (0, _react.useCallback)(function () {
|
|
313
|
+
if (joined && orientation === 'horizontal' && changedBy === 'enter') {
|
|
314
|
+
setIncPickerButtonPressed();
|
|
315
|
+
}
|
|
316
|
+
if (joined && pickerButtonPressed.current === 1) {
|
|
317
|
+
handleIncrement();
|
|
318
|
+
if (orientation === 'vertical' || changedBy === 'arrow') {
|
|
319
|
+
emulateMouseUp.start();
|
|
320
|
+
}
|
|
321
|
+
} else if (joined && pickerButtonPressed.current === -1) {
|
|
322
|
+
handleDecrement();
|
|
323
|
+
emulateMouseUp.start();
|
|
324
|
+
}
|
|
325
|
+
}, [changedBy, emulateMouseUp, handleDecrement, handleIncrement, joined, orientation, setIncPickerButtonPressed]);
|
|
326
|
+
var setDecPickerButtonPressed = (0, _react.useCallback)(function () {
|
|
327
|
+
pickerButtonPressed.current = -1;
|
|
328
|
+
}, []);
|
|
329
|
+
var handleHold = (0, _react.useCallback)(function () {
|
|
330
|
+
if (joined && pickerButtonPressed.current === 1) {
|
|
331
|
+
handleIncrement();
|
|
332
|
+
} else if (joined && pickerButtonPressed.current === -1) {
|
|
333
|
+
handleDecrement();
|
|
334
|
+
}
|
|
335
|
+
}, [handleDecrement, handleIncrement, joined]);
|
|
336
|
+
var handleKeyDown = (0, _react.useCallback)(function (ev) {
|
|
337
|
+
var onSpotlightDown = props.onSpotlightDown,
|
|
338
|
+
onSpotlightLeft = props.onSpotlightLeft,
|
|
339
|
+
onSpotlightRight = props.onSpotlightRight,
|
|
340
|
+
onSpotlightUp = props.onSpotlightUp;
|
|
341
|
+
var keyCode = ev.keyCode;
|
|
342
|
+
forwardKeyDown(ev, props);
|
|
343
|
+
if (joined && !disabled) {
|
|
344
|
+
var direction = (0, _spotlight.getDirection)(keyCode);
|
|
345
|
+
var directions = {
|
|
346
|
+
up: setIncPickerButtonPressed,
|
|
347
|
+
down: setDecPickerButtonPressed,
|
|
348
|
+
right: setIncPickerButtonPressed,
|
|
349
|
+
left: setDecPickerButtonPressed
|
|
350
|
+
};
|
|
351
|
+
var isVertical = orientation === 'vertical' && (isUp(keyCode) || isDown(keyCode));
|
|
352
|
+
var isHorizontal = orientation === 'horizontal' && changedBy === 'enter' && isEnter(keyCode);
|
|
353
|
+
var isHorizontalArrow = orientation === 'horizontal' && changedBy === 'arrow' && (isRight(keyCode) || isLeft(keyCode));
|
|
354
|
+
if (isVertical || isHorizontalArrow) {
|
|
355
|
+
directions[direction]();
|
|
356
|
+
} else if (isHorizontal) {
|
|
357
|
+
setIncPickerButtonPressed();
|
|
358
|
+
} else if (orientation === 'horizontal' && isDown(keyCode) && onSpotlightDown) {
|
|
359
|
+
(0, _handle.forwardCustom)('onSpotlightDown')(ev, props);
|
|
360
|
+
} else if (orientation === 'horizontal' && isUp(keyCode) && onSpotlightUp) {
|
|
361
|
+
(0, _handle.forwardCustom)('onSpotlightUp')(ev, props);
|
|
362
|
+
} else if (orientation === 'vertical' && isLeft(keyCode) && onSpotlightLeft) {
|
|
363
|
+
(0, _handle.forwardCustom)('onSpotlightLeft')(ev, props);
|
|
364
|
+
} else if (orientation === 'vertical' && isRight(keyCode) && onSpotlightRight) {
|
|
365
|
+
(0, _handle.forwardCustom)('onSpotlightRight')(ev, props);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}, [changedBy, disabled, joined, orientation, props, setDecPickerButtonPressed, setIncPickerButtonPressed]);
|
|
369
|
+
var handleKeyUp = (0, _react.useCallback)(function (ev) {
|
|
370
|
+
var keyCode = ev.keyCode;
|
|
371
|
+
forwardKeyUp(ev, props);
|
|
372
|
+
if (joined && !disabled) {
|
|
373
|
+
var isVertical = orientation === 'vertical' && (isUp(keyCode) || isDown(keyCode));
|
|
374
|
+
var isHorizontal = orientation === 'horizontal' && isEnter(keyCode);
|
|
375
|
+
var isHorizontalArrow = orientation === 'horizontal' && changedBy === 'arrow' && (isRight(keyCode) || isLeft(keyCode));
|
|
376
|
+
if (isVertical || isHorizontal || isHorizontalArrow) {
|
|
377
|
+
pickerButtonPressed.current = 0;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}, [changedBy, disabled, joined, orientation, props]);
|
|
381
|
+
var handleDecKeyDown = (0, _react.useCallback)(function (ev) {
|
|
382
|
+
var keyCode = ev.keyCode;
|
|
383
|
+
var direction = (0, _spotlight.getDirection)(keyCode);
|
|
384
|
+
if (direction) {
|
|
385
|
+
if (!hasReachedBound(step) && (isRight(keyCode) && orientation === 'horizontal' || isUp(keyCode) && orientation === 'vertical')) {
|
|
386
|
+
ev.preventDefault();
|
|
387
|
+
// prevent parent handler behavior
|
|
388
|
+
(0, _handle.stop)(ev);
|
|
389
|
+
// prevent default spotlight behavior
|
|
390
|
+
(0, _handle.stopImmediate)(ev);
|
|
391
|
+
// set the pointer mode to false on keydown
|
|
392
|
+
_spotlight["default"].setPointerMode(false);
|
|
393
|
+
_spotlight["default"].focus(containerRef.current.querySelector(".".concat(_PickerModule["default"].incrementer)));
|
|
394
|
+
} else {
|
|
395
|
+
(0, _handle.forwardCustom)("onSpotlight".concat((0, _util.cap)(direction)))(ev, props);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
}, [hasReachedBound, orientation, props, step]);
|
|
399
|
+
var handleIncKeyDown = (0, _react.useCallback)(function (ev) {
|
|
400
|
+
var keyCode = ev.keyCode;
|
|
401
|
+
var direction = (0, _spotlight.getDirection)(keyCode);
|
|
402
|
+
if (direction) {
|
|
403
|
+
if (!hasReachedBound(step * -1) && (isLeft(keyCode) && orientation === 'horizontal' || isDown(keyCode) && orientation === 'vertical')) {
|
|
404
|
+
ev.preventDefault();
|
|
405
|
+
// prevent parent handler behavior
|
|
406
|
+
(0, _handle.stop)(ev);
|
|
407
|
+
// prevent default spotlight behavior
|
|
408
|
+
(0, _handle.stopImmediate)(ev);
|
|
409
|
+
// set the pointer mode to false on keydown
|
|
410
|
+
_spotlight["default"].setPointerMode(false);
|
|
411
|
+
_spotlight["default"].focus(containerRef.current.querySelector(".".concat(_PickerModule["default"].decrementer)));
|
|
412
|
+
} else {
|
|
413
|
+
(0, _handle.forwardCustom)("onSpotlight".concat((0, _util.cap)(direction)))(ev, props);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}, [hasReachedBound, orientation, props, step]);
|
|
417
|
+
var determineClasses = (0, _react.useCallback)(function (cssProps, decrementerDisabledProp, incrementerDisabledProp) {
|
|
418
|
+
var classNameVariable = props.className;
|
|
419
|
+
return (0, _classnames3["default"])(cssProps.picker, cssProps[changedBy], cssProps[orientation], cssProps[width], _defineProperty(_defineProperty(_defineProperty({}, cssProps.joined, joined), cssProps.decrementing, !decrementerDisabledProp && pressed === -1), cssProps.incrementing, !incrementerDisabledProp && pressed === 1), classNameVariable);
|
|
420
|
+
}, [changedBy, joined, orientation, pressed, props, width]);
|
|
421
|
+
var calcValueText = (0, _react.useCallback)(function () {
|
|
422
|
+
var _props$accessibilityH = props.accessibilityHint,
|
|
423
|
+
accessibilityHint = _props$accessibilityH === void 0 ? '' : _props$accessibilityH;
|
|
424
|
+
var valueTextVariable = value;
|
|
425
|
+
|
|
426
|
+
// Sometimes this.props.value is not equal to node text content. For example, when `PM`
|
|
427
|
+
// is shown in AM/PM picker, its value is `1` and its node.textContent is `PM`. In this
|
|
428
|
+
// case, Screen readers should read `PM` instead of `1`.
|
|
429
|
+
if (children && Array.isArray(children)) {
|
|
430
|
+
valueTextVariable = children[index] ? children[index].props.children : value;
|
|
431
|
+
} else if (children && children.props && !children.props.children) {
|
|
432
|
+
valueTextVariable = children.props.children;
|
|
433
|
+
}
|
|
434
|
+
if (accessibilityHint) {
|
|
435
|
+
valueTextVariable = "".concat(valueTextVariable, " ").concat(accessibilityHint);
|
|
436
|
+
}
|
|
437
|
+
return valueTextVariable;
|
|
438
|
+
}, [children, index, props, value]);
|
|
439
|
+
var calcButtonLabel = (0, _react.useCallback)(function (next, valueTextProp) {
|
|
440
|
+
var decrementAriaLabel = props.decrementAriaLabel,
|
|
441
|
+
incrementAriaLabel = props.incrementAriaLabel,
|
|
442
|
+
_props$type = props.type,
|
|
443
|
+
type = _props$type === void 0 ? 'string' : _props$type;
|
|
444
|
+
var titleText = props.title ? props.title + ' ' : '';
|
|
445
|
+
var label;
|
|
446
|
+
if (orientation === 'vertical') {
|
|
447
|
+
label = next ? decrementAriaLabel : incrementAriaLabel;
|
|
448
|
+
} else {
|
|
449
|
+
label = next ? incrementAriaLabel : decrementAriaLabel;
|
|
450
|
+
}
|
|
451
|
+
if (label != null) {
|
|
452
|
+
return titleText + label;
|
|
453
|
+
}
|
|
454
|
+
if (type === 'number') {
|
|
455
|
+
return titleText + "".concat(valueTextProp, " ").concat(next ? (0, _$L["default"])('press ok button to increase the value') : (0, _$L["default"])('press ok button to decrease the value'));
|
|
456
|
+
} else {
|
|
457
|
+
return titleText + "".concat(valueTextProp, " ").concat(next ? (0, _$L["default"])('next item') : (0, _$L["default"])('previous item'));
|
|
458
|
+
}
|
|
459
|
+
}, [orientation, props]);
|
|
460
|
+
var calcDecrementLabel = (0, _react.useCallback)(function (valueTextProp) {
|
|
461
|
+
return !joined ? calcButtonLabel(reverse, valueTextProp) : null;
|
|
462
|
+
}, [calcButtonLabel, joined, reverse]);
|
|
463
|
+
var calcIncrementLabel = (0, _react.useCallback)(function (valueTextProp) {
|
|
464
|
+
return !joined ? calcButtonLabel(!reverse, valueTextProp) : null;
|
|
465
|
+
}, [calcButtonLabel, joined, reverse]);
|
|
466
|
+
var calcAriaLabel = (0, _react.useCallback)(function (valueTextProp) {
|
|
467
|
+
var ariaLabel = props['aria-label'];
|
|
468
|
+
var hint;
|
|
469
|
+
if (orientation === 'horizontal') {
|
|
470
|
+
hint = changedBy === 'arrow' ? (0, _$L["default"])('change a value with left right button') : (0, _$L["default"])('press ok button to change the value');
|
|
471
|
+
} else {
|
|
472
|
+
hint = (0, _$L["default"])('change a value with up down button');
|
|
473
|
+
}
|
|
474
|
+
if (!joined || ariaLabel != null) {
|
|
475
|
+
return ariaLabel;
|
|
476
|
+
}
|
|
477
|
+
return "".concat(valueTextProp, " ").concat(hint);
|
|
478
|
+
}, [changedBy, joined, orientation, props]);
|
|
479
|
+
if (process.env.NODE_ENV !== "production") {
|
|
480
|
+
(0, _validators.validateRange)(value, min, max, _PickerBase.displayName);
|
|
481
|
+
(0, _validators.validateStepped)(value, min, step, _PickerBase.displayName);
|
|
482
|
+
(0, _validators.validateStepped)(max, min, step, _PickerBase.displayName, 'max');
|
|
483
|
+
}
|
|
484
|
+
var reachedStart = hasReachedBound(step * -1);
|
|
485
|
+
var decrementerDisabled = disabled || reachedStart;
|
|
486
|
+
var reachedEnd = hasReachedBound(step);
|
|
487
|
+
var incrementerDisabled = disabled || reachedEnd;
|
|
488
|
+
var className = determineClasses(css, decrementerDisabled, incrementerDisabled);
|
|
489
|
+
var valueText = ariaValueText != null ? ariaValueText : calcValueText();
|
|
490
|
+
var decrementerAriaControls = !incrementerDisabled ? id : null;
|
|
491
|
+
var incrementerAriaControls = !decrementerDisabled ? id : null;
|
|
492
|
+
var spottablePickerProps = {};
|
|
493
|
+
if (typeof width === 'number' && width > 0) {
|
|
494
|
+
sizingPlaceholder = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
495
|
+
"aria-hidden": true,
|
|
496
|
+
className: css.sizingPlaceholder,
|
|
497
|
+
children: '0'.repeat(width)
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
if (joined) {
|
|
501
|
+
Component = SpottableDiv;
|
|
502
|
+
spottablePickerProps.changedBy = changedBy;
|
|
503
|
+
spottablePickerProps.onSpotlightDisappear = onSpotlightDisappear;
|
|
504
|
+
spottablePickerProps.pickerOrientation = orientation;
|
|
505
|
+
spottablePickerProps.spotlightDisabled = spotlightDisabled;
|
|
506
|
+
} else {
|
|
507
|
+
Component = Div;
|
|
508
|
+
}
|
|
509
|
+
delete rest['aria-label'];
|
|
510
|
+
delete rest.accessibilityHint;
|
|
511
|
+
delete rest.decrementAriaLabel;
|
|
512
|
+
delete rest.decrementIcon;
|
|
513
|
+
delete rest.incrementAriaLabel;
|
|
514
|
+
delete rest.incrementIcon;
|
|
515
|
+
delete rest.noAnimation;
|
|
516
|
+
delete rest.onSpotlightDown;
|
|
517
|
+
delete rest.onSpotlightLeft;
|
|
518
|
+
delete rest.onSpotlightRight;
|
|
519
|
+
delete rest.onSpotlightUp;
|
|
520
|
+
delete rest.title;
|
|
521
|
+
delete voiceProps['data-webos-voice-label'];
|
|
522
|
+
delete voiceProps['data-webos-voice-labels'];
|
|
523
|
+
delete voiceProps['data-webos-voice-labels-ext'];
|
|
524
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout["default"], _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, voiceProps), rest), {}, {
|
|
525
|
+
align: "center space-around",
|
|
526
|
+
"aria-controls": joined ? id : null,
|
|
527
|
+
"aria-disabled": disabled,
|
|
528
|
+
"aria-label": calcAriaLabel(valueText),
|
|
529
|
+
className: className,
|
|
530
|
+
component: Component,
|
|
531
|
+
"data-webos-voice-intent": "Select",
|
|
532
|
+
"data-webos-voice-labels-ext": voiceLabelsExt,
|
|
533
|
+
disabled: disabled,
|
|
534
|
+
holdConfig: holdConfig,
|
|
535
|
+
inline: true,
|
|
536
|
+
onBlur: handleBlur,
|
|
537
|
+
onDown: handleDown,
|
|
538
|
+
onFocus: handleFocus,
|
|
539
|
+
onHold: handleHold,
|
|
540
|
+
onKeyDown: handleKeyDown,
|
|
541
|
+
onKeyUp: handleKeyUp,
|
|
542
|
+
onUp: handleUp,
|
|
543
|
+
onMouseLeave: clearPressedState,
|
|
544
|
+
orientation: orientation,
|
|
545
|
+
ref: containerRef
|
|
546
|
+
}, spottablePickerProps), {}, {
|
|
547
|
+
children: [isHorizontalJoinedEnter ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, voiceProps), {}, {
|
|
548
|
+
align: joined ? 'stretch' : null,
|
|
549
|
+
"aria-controls": !joined ? incrementerAriaControls : null,
|
|
550
|
+
"aria-label": calcIncrementLabel(valueText),
|
|
551
|
+
className: css.incrementer,
|
|
552
|
+
component: _PickerButton["default"],
|
|
553
|
+
"data-webos-voice-label": joined ? calcButtonLabel(!reverse, valueText) : null,
|
|
554
|
+
disabled: incrementerDisabled,
|
|
555
|
+
holdConfig: holdConfig,
|
|
556
|
+
icon: incrementIcon,
|
|
557
|
+
joined: joined,
|
|
558
|
+
onDown: handleIncrement,
|
|
559
|
+
onHold: handleIncrement,
|
|
560
|
+
onKeyDown: handleIncKeyDown,
|
|
561
|
+
onSpotlightDisappear: onSpotlightDisappear,
|
|
562
|
+
shrink: true,
|
|
563
|
+
spotlightDisabled: spotlightDisabled
|
|
564
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Cell, {
|
|
565
|
+
"aria-disabled": disabled,
|
|
566
|
+
"aria-hidden": !active,
|
|
567
|
+
"aria-valuetext": valueText,
|
|
568
|
+
className: css.valueWrapper,
|
|
569
|
+
id: id,
|
|
570
|
+
role: "spinbutton",
|
|
571
|
+
shrink: true,
|
|
572
|
+
children: [sizingPlaceholder, /*#__PURE__*/(0, _jsxRuntime.jsx)(PickerViewManager, {
|
|
573
|
+
"aria-hidden": true,
|
|
574
|
+
arranger: arranger,
|
|
575
|
+
className: css.viewManager,
|
|
576
|
+
duration: 100,
|
|
577
|
+
index: index,
|
|
578
|
+
noAnimation: noAnimation,
|
|
579
|
+
reverseTransition: reverseTransition.current,
|
|
580
|
+
children: children
|
|
581
|
+
}), showIndicators && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({
|
|
582
|
+
className: css.indicatorContainer
|
|
583
|
+
}, voiceProps), {}, {
|
|
584
|
+
children: children.map(function (c, indicator) {
|
|
585
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
586
|
+
className: (0, _classnames3["default"])(css.indicator, _defineProperty({}, css.active, index === indicator))
|
|
587
|
+
}, "indicator".concat(indicator));
|
|
588
|
+
})
|
|
589
|
+
}))]
|
|
590
|
+
}), isHorizontalJoinedEnter ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, voiceProps), {}, {
|
|
591
|
+
align: joined ? 'stretch' : null,
|
|
592
|
+
"aria-controls": !joined ? decrementerAriaControls : null,
|
|
593
|
+
"aria-label": calcDecrementLabel(valueText),
|
|
594
|
+
className: css.decrementer,
|
|
595
|
+
component: _PickerButton["default"],
|
|
596
|
+
"data-webos-voice-label": joined ? calcButtonLabel(reverse, valueText) : null,
|
|
597
|
+
disabled: decrementerDisabled,
|
|
598
|
+
holdConfig: holdConfig,
|
|
599
|
+
icon: decrementIcon,
|
|
600
|
+
joined: joined,
|
|
601
|
+
onDown: handleDecrement,
|
|
602
|
+
onHold: handleDecrement,
|
|
603
|
+
onKeyDown: handleDecKeyDown,
|
|
604
|
+
onSpotlightDisappear: onSpotlightDisappear,
|
|
605
|
+
shrink: true,
|
|
606
|
+
spotlightDisabled: spotlightDisabled
|
|
607
|
+
}))]
|
|
608
|
+
}));
|
|
609
|
+
};
|
|
610
|
+
_PickerBase.displayName = 'Picker';
|
|
611
|
+
_PickerBase.propTypes = /** @lends limestone/internal/Picker.Picker.prototype */{
|
|
612
|
+
/**
|
|
613
|
+
* Index for internal ViewManager
|
|
614
|
+
*
|
|
615
|
+
* @type {Number}
|
|
616
|
+
* @required
|
|
617
|
+
* @public
|
|
618
|
+
*/
|
|
619
|
+
index: _propTypes2["default"].number.isRequired,
|
|
620
|
+
/**
|
|
621
|
+
* The maximum value selectable by the picker (inclusive).
|
|
622
|
+
*
|
|
623
|
+
* The range between `min` and `max` should be evenly divisible by
|
|
624
|
+
* {@link limestone/internal/Picker.PickerBase.step|step}.
|
|
625
|
+
*
|
|
626
|
+
* @type {Number}
|
|
627
|
+
* @required
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
max: _propTypes2["default"].number.isRequired,
|
|
631
|
+
/**
|
|
632
|
+
* The minimum value selectable by the picker (inclusive).
|
|
633
|
+
*
|
|
634
|
+
* The range between `min` and `max` should be evenly divisible by
|
|
635
|
+
* {@link limestone/internal/Picker.PickerBase.step|step}.
|
|
636
|
+
*
|
|
637
|
+
* @type {Number}
|
|
638
|
+
* @required
|
|
639
|
+
* @public
|
|
640
|
+
*/
|
|
641
|
+
min: _propTypes2["default"].number.isRequired,
|
|
642
|
+
/**
|
|
643
|
+
* Accessibility hint
|
|
644
|
+
*
|
|
645
|
+
* For example, `hour`, `year`, and `meridiem`
|
|
646
|
+
*
|
|
647
|
+
* @type {String}
|
|
648
|
+
* @default ''
|
|
649
|
+
* @public
|
|
650
|
+
*/
|
|
651
|
+
accessibilityHint: _propTypes2["default"].string,
|
|
652
|
+
/**
|
|
653
|
+
* The "aria-label" for the picker.
|
|
654
|
+
*
|
|
655
|
+
* While the `aria-label` will always be set on the root node, that node is only focusable
|
|
656
|
+
* when the picker is `joined`.
|
|
657
|
+
*
|
|
658
|
+
* @type {String}
|
|
659
|
+
* @memberof limestone/internal/Picker.PickerBase.prototype
|
|
660
|
+
* @public
|
|
661
|
+
*/
|
|
662
|
+
'aria-label': _propTypes2["default"].string,
|
|
663
|
+
/**
|
|
664
|
+
* Overrides the `aria-valuetext` for the picker.
|
|
665
|
+
*
|
|
666
|
+
* By default, `aria-valuetext` is set to the current selected child and `accessibilityHint`
|
|
667
|
+
* text.
|
|
668
|
+
*
|
|
669
|
+
* @type {String}
|
|
670
|
+
* @memberof limestone/internal/Picker.PickerBase.prototype
|
|
671
|
+
* @public
|
|
672
|
+
*/
|
|
673
|
+
'aria-valuetext': _propTypes2["default"].string,
|
|
674
|
+
/**
|
|
675
|
+
* Determines which key to adjust the picker's value for the joined horizontal one.
|
|
676
|
+
*
|
|
677
|
+
* * `'enter'` allows the user to use the enter key to adjust the picker's value
|
|
678
|
+
* * `'arrow'` allows the user to use the left or right keys to adjust the picker's value.
|
|
679
|
+
*
|
|
680
|
+
* The default value for joined horizontal picker is `'enter'`.
|
|
681
|
+
* If {@link limestone/internal/Picker.PickerBase.orientation|orientation} is `'vertical'` or
|
|
682
|
+
* {@link limestone/internal/Picker.PickerBase.joined|joined} is undefined or is `false`, this prop is ignored.
|
|
683
|
+
*
|
|
684
|
+
* @type {('enter'|'arrow')}
|
|
685
|
+
* @default 'enter'
|
|
686
|
+
* @public
|
|
687
|
+
*/
|
|
688
|
+
changedBy: _propTypes2["default"].oneOf(['enter', 'arrow']),
|
|
689
|
+
/**
|
|
690
|
+
* Children from which to pick
|
|
691
|
+
*
|
|
692
|
+
* @type {Node}
|
|
693
|
+
* @public
|
|
694
|
+
*/
|
|
695
|
+
children: _propTypes2["default"].node,
|
|
696
|
+
/**
|
|
697
|
+
* Class name for component
|
|
698
|
+
*
|
|
699
|
+
* @type {String}
|
|
700
|
+
* @public
|
|
701
|
+
*/
|
|
702
|
+
className: _propTypes2["default"].string,
|
|
703
|
+
/**
|
|
704
|
+
* Customize component style
|
|
705
|
+
*
|
|
706
|
+
* @type {Object}
|
|
707
|
+
* @private
|
|
708
|
+
*/
|
|
709
|
+
css: _propTypes2["default"].object,
|
|
710
|
+
/**
|
|
711
|
+
* Disables voice control.
|
|
712
|
+
*
|
|
713
|
+
* @type {Boolean}
|
|
714
|
+
* @memberof limestone/internal/Picker.PickerBase.prototype
|
|
715
|
+
* @public
|
|
716
|
+
*/
|
|
717
|
+
'data-webos-voice-disabled': _propTypes2["default"].bool,
|
|
718
|
+
/**
|
|
719
|
+
* The `data-webos-voice-group-label` for the Button of Picker.
|
|
720
|
+
*
|
|
721
|
+
* @type {String}
|
|
722
|
+
* @memberof limestone/internal/Picker.PickerBase.prototype
|
|
723
|
+
* @public
|
|
724
|
+
*/
|
|
725
|
+
'data-webos-voice-group-label': _propTypes2["default"].string,
|
|
726
|
+
/**
|
|
727
|
+
* The "aria-label" for the decrement button.
|
|
728
|
+
*
|
|
729
|
+
* @type {String}
|
|
730
|
+
* @default 'previous item'
|
|
731
|
+
* @public
|
|
732
|
+
*/
|
|
733
|
+
decrementAriaLabel: _propTypes2["default"].string,
|
|
734
|
+
/**
|
|
735
|
+
* Assign a custom icon for the decrementer. All strings supported by {@link limestone/Icon.Icon|Icon} are
|
|
736
|
+
* supported. Without a custom icon, the default is used, and is automatically changed when
|
|
737
|
+
* the {@link limestone/internal/Picker.PickerBase.orientation|orientation} is changed.
|
|
738
|
+
*
|
|
739
|
+
* @type {String}
|
|
740
|
+
* @public
|
|
741
|
+
*/
|
|
742
|
+
decrementIcon: _propTypes2["default"].string,
|
|
743
|
+
/**
|
|
744
|
+
* When `true`, the Picker is shown as disabled and does not generate `onChange`
|
|
745
|
+
* {@link /docs/developer-guide/glossary/#event|events}.
|
|
746
|
+
*
|
|
747
|
+
* @type {Boolean}
|
|
748
|
+
* @public
|
|
749
|
+
*/
|
|
750
|
+
disabled: _propTypes2["default"].bool,
|
|
751
|
+
/**
|
|
752
|
+
* The picker id reference for setting aria-controls.
|
|
753
|
+
*
|
|
754
|
+
* @type {String}
|
|
755
|
+
* @private
|
|
756
|
+
*/
|
|
757
|
+
id: _propTypes2["default"].string,
|
|
758
|
+
/**
|
|
759
|
+
* The "aria-label" for the increment button.
|
|
760
|
+
*
|
|
761
|
+
* @type {String}
|
|
762
|
+
* @default 'next item'
|
|
763
|
+
* @public
|
|
764
|
+
*/
|
|
765
|
+
incrementAriaLabel: _propTypes2["default"].string,
|
|
766
|
+
/**
|
|
767
|
+
* Assign a custom icon for the incrementer. All strings supported by {@link limestone/Icon.Icon|Icon} are
|
|
768
|
+
* supported. Without a custom icon, the default is used, and is automatically changed when
|
|
769
|
+
* the {@link limestone/internal/Picker.PickerBase.orientation|orientation} is changed.
|
|
770
|
+
*
|
|
771
|
+
* @type {String}
|
|
772
|
+
* @public
|
|
773
|
+
*/
|
|
774
|
+
incrementIcon: _propTypes2["default"].string,
|
|
775
|
+
/**
|
|
776
|
+
* Determines the user interaction of the control. A joined picker allows the user to use
|
|
777
|
+
* the arrow keys or the enter key to adjust the picker's value.
|
|
778
|
+
* It depends on {@link limestone/internal/Picker.PickerBase.changedBy|changedBy}
|
|
779
|
+
* whether to use the arrow keys or the enter key.
|
|
780
|
+
* A split control allows full navigation,
|
|
781
|
+
* but requires individual ENTER presses on the incrementer and decrementer buttons.
|
|
782
|
+
* Pointer interaction is the same for both formats.
|
|
783
|
+
*
|
|
784
|
+
* @type {Boolean}
|
|
785
|
+
* @public
|
|
786
|
+
*/
|
|
787
|
+
joined: _propTypes2["default"].bool,
|
|
788
|
+
/**
|
|
789
|
+
* By default, the picker will animate transitions between items if it has a defined
|
|
790
|
+
* `width`. Specifying `noAnimation` will prevent any transition animation for the
|
|
791
|
+
* component.
|
|
792
|
+
*
|
|
793
|
+
* @type {Boolean}
|
|
794
|
+
* @public
|
|
795
|
+
*/
|
|
796
|
+
noAnimation: _propTypes2["default"].bool,
|
|
797
|
+
/**
|
|
798
|
+
* A function to run when the control should increment or decrement.
|
|
799
|
+
*
|
|
800
|
+
* @type {Function}
|
|
801
|
+
* @public
|
|
802
|
+
*/
|
|
803
|
+
onChange: _propTypes2["default"].func,
|
|
804
|
+
/**
|
|
805
|
+
* A function to run when the picker is removed while retaining focus.
|
|
806
|
+
*
|
|
807
|
+
* @type {Function}
|
|
808
|
+
* @private
|
|
809
|
+
*/
|
|
810
|
+
onSpotlightDisappear: _propTypes2["default"].func,
|
|
811
|
+
/**
|
|
812
|
+
* The handler to run prior to focus leaving the picker when the 5-way down key is pressed.
|
|
813
|
+
*
|
|
814
|
+
* @type {Function}
|
|
815
|
+
* @param {Object} event
|
|
816
|
+
* @public
|
|
817
|
+
*/
|
|
818
|
+
onSpotlightDown: _propTypes2["default"].func,
|
|
819
|
+
/**
|
|
820
|
+
* The handler to run prior to focus leaving the picker when the 5-way left key is pressed.
|
|
821
|
+
*
|
|
822
|
+
* @type {Function}
|
|
823
|
+
* @param {Object} event
|
|
824
|
+
* @public
|
|
825
|
+
*/
|
|
826
|
+
onSpotlightLeft: _propTypes2["default"].func,
|
|
827
|
+
/**
|
|
828
|
+
* The handler to run prior to focus leaving the picker when the 5-way right key is pressed.
|
|
829
|
+
*
|
|
830
|
+
* @type {Function}
|
|
831
|
+
* @param {Object} event
|
|
832
|
+
* @public
|
|
833
|
+
*/
|
|
834
|
+
onSpotlightRight: _propTypes2["default"].func,
|
|
835
|
+
/**
|
|
836
|
+
* The handler to run prior to focus leaving the picker when the 5-way up key is pressed.
|
|
837
|
+
*
|
|
838
|
+
* @type {Function}
|
|
839
|
+
* @param {Object} event
|
|
840
|
+
* @public
|
|
841
|
+
*/
|
|
842
|
+
onSpotlightUp: _propTypes2["default"].func,
|
|
843
|
+
/**
|
|
844
|
+
* Sets the orientation of the picker, whether the buttons are above and below or on the
|
|
845
|
+
* sides of the value. Must be either `'horizontal'` or `'vertical'`.
|
|
846
|
+
*
|
|
847
|
+
* @type {('horizontal'|'vertical')}
|
|
848
|
+
* @default 'horizontal'
|
|
849
|
+
* @public
|
|
850
|
+
*/
|
|
851
|
+
orientation: _propTypes2["default"].oneOf(['horizontal', 'vertical']),
|
|
852
|
+
/**
|
|
853
|
+
* When `true`, the picker buttons operate in the reverse direction such that pressing
|
|
854
|
+
* up/left decrements the value and down/right increments the value. This is more natural
|
|
855
|
+
* for vertical lists of text options where "up" implies a spatial change rather than
|
|
856
|
+
* incrementing the value.
|
|
857
|
+
*
|
|
858
|
+
* @type {Boolean}
|
|
859
|
+
* @public
|
|
860
|
+
*/
|
|
861
|
+
reverse: _propTypes2["default"].bool,
|
|
862
|
+
/**
|
|
863
|
+
* When `true`, the component cannot be navigated using spotlight.
|
|
864
|
+
*
|
|
865
|
+
* @type {Boolean}
|
|
866
|
+
* @default false
|
|
867
|
+
* @public
|
|
868
|
+
*/
|
|
869
|
+
spotlightDisabled: _propTypes2["default"].bool,
|
|
870
|
+
/**
|
|
871
|
+
* Allow the picker to only increment or decrement by a given value.
|
|
872
|
+
*
|
|
873
|
+
* A step of `2` would cause a picker to increment from 10 to 12 to 14, etc. It must evenly
|
|
874
|
+
* divide into the range designated by `min` and `max`.
|
|
875
|
+
*
|
|
876
|
+
* @type {Number}
|
|
877
|
+
* @default 1
|
|
878
|
+
* @public
|
|
879
|
+
*/
|
|
880
|
+
step: _propTypes2["default"].number,
|
|
881
|
+
/**
|
|
882
|
+
* The primary text of the `Picker`.
|
|
883
|
+
*
|
|
884
|
+
* The screen readers read out the title text when the `joined` prop is false
|
|
885
|
+
*
|
|
886
|
+
* @type {String}
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
889
|
+
title: _propTypes2["default"].string,
|
|
890
|
+
/**
|
|
891
|
+
* The type of picker. It determines the aria-label for the next and previous buttons.
|
|
892
|
+
*
|
|
893
|
+
* Depending on the `type`, `joined`, `decrementAriaLabel`, and `incrementAriaLabel`,
|
|
894
|
+
* the screen readers read out differently when Spotlight is on the next button, the previous button,
|
|
895
|
+
* or the picker itself.
|
|
896
|
+
*
|
|
897
|
+
* For example, if Spotlight is on the next button, the `joined` prop is false,
|
|
898
|
+
* and aria label props(`decrementAriaLabel` and `incrementAriaLabel`) are not defined,
|
|
899
|
+
* then the screen readers read out as follows.
|
|
900
|
+
* `'string'` type: `'next item'`
|
|
901
|
+
* `'number'` type: `'press ok button to increase the value'`
|
|
902
|
+
*
|
|
903
|
+
* @type {('number'|'string')}
|
|
904
|
+
* @default 'string'
|
|
905
|
+
* @public
|
|
906
|
+
*/
|
|
907
|
+
type: _propTypes2["default"].oneOf(['number', 'string']),
|
|
908
|
+
/**
|
|
909
|
+
* Index of the selected child
|
|
910
|
+
*
|
|
911
|
+
* @type {Number}
|
|
912
|
+
* @default 0
|
|
913
|
+
* @public
|
|
914
|
+
*/
|
|
915
|
+
value: _propTypes2["default"].number,
|
|
916
|
+
/**
|
|
917
|
+
* Choose a specific size for your picker. `'small'`, `'medium'`, `'large'`, or set to `null` to
|
|
918
|
+
* assume auto-sizing. `'small'` is good for numeric pickers, `'medium'` for single or short
|
|
919
|
+
* word pickers, `'large'` for maximum-sized pickers.
|
|
920
|
+
*
|
|
921
|
+
* You may also supply a number. This number will determine the minimum size of the Picker.
|
|
922
|
+
* Setting a number to less than the number of characters in your longest value may produce
|
|
923
|
+
* unexpected results.
|
|
924
|
+
*
|
|
925
|
+
* @type {('small'|'medium'|'large'|Number)}
|
|
926
|
+
* @public
|
|
927
|
+
*/
|
|
928
|
+
width: _propTypes2["default"].oneOfType([_propTypes2["default"].oneOf([null, 'small', 'medium', 'large']), _propTypes2["default"].number]),
|
|
929
|
+
/**
|
|
930
|
+
* Should the picker stop incrementing when the picker reaches the last element? Set `wrap`
|
|
931
|
+
* to `true` to allow the picker to continue from the opposite end of the list of options.
|
|
932
|
+
*
|
|
933
|
+
* @type {Boolean}
|
|
934
|
+
* @public
|
|
935
|
+
*/
|
|
936
|
+
wrap: _propTypes2["default"].bool
|
|
937
|
+
};
|
|
938
|
+
var Picker = exports.Picker = (0, _IdProvider["default"])({
|
|
939
|
+
generateProp: null,
|
|
940
|
+
prefix: 'p_'
|
|
941
|
+
}, (0, _Skinnable["default"])(_PickerBase));
|
|
942
|
+
var _default = exports["default"] = Picker;
|