@rbxts/uiblox 0.2.0-alpha.36 → 0.2.0-alpha.5
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/README.md +109 -27
- package/out/hooks/index.d.ts +0 -1
- package/out/hooks/init.luau +0 -3
- package/out/hooks/useBreakpoints.luau +11 -2
- package/out/theme/interfaces/theme/Theme.d.ts +0 -15
- package/out/theme/styles/utilities/componentStyles.luau +3 -45
- package/out/theme/styles/utilities/componentTheme.d.ts +0 -15
- package/out/theme/styles/utilities/index.d.ts +0 -2
- package/out/theme/styles/utilities/init.luau +0 -7
- package/out/theme/styles/utilities/resolveStyle.d.ts +2 -10
- package/out/theme/styles/utilities/resolveStyle.luau +3 -7
- package/out/theme/styles/utilities/styleCache.d.ts +0 -2
- package/out/theme/styles/utilities/styleCache.luau +0 -9
- package/out/theme/types/types.d.ts +1 -2
- package/out/ui/packages/accordion/components/Accordion.d.ts +0 -2
- package/out/ui/packages/accordion/components/Accordion.luau +30 -46
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +0 -1
- package/out/ui/packages/accordion/components/Accordion.styles.luau +4 -16
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +0 -1
- package/out/ui/packages/accordion/components/accordionOpen.luau +0 -4
- package/out/ui/packages/alert/components/Alert.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.luau +42 -48
- package/out/ui/packages/alert/components/Alert.styles.d.ts +0 -2
- package/out/ui/packages/alert/components/Alert.styles.luau +8 -17
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -2
- package/out/ui/packages/appBar/components/AppBar.luau +36 -47
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +0 -2
- package/out/ui/packages/appBar/components/AppBar.styles.luau +5 -16
- package/out/ui/packages/assetField/components/AssetField.luau +16 -12
- package/out/ui/packages/avatar/components/Avatar.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.luau +26 -27
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +0 -2
- package/out/ui/packages/avatar/components/Avatar.styles.luau +1 -5
- package/out/ui/packages/badge/components/Badge.d.ts +0 -3
- package/out/ui/packages/badge/components/Badge.luau +24 -32
- package/out/ui/packages/badge/components/Badge.styles.d.ts +1 -5
- package/out/ui/packages/badge/components/Badge.styles.luau +8 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +0 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +18 -20
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +1 -3
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +2 -6
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +40 -67
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +0 -9
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +0 -68
- package/out/ui/packages/breadcrumbs/index.d.ts +0 -1
- package/out/ui/packages/breadcrumbs/init.luau +0 -3
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +16 -12
- package/out/ui/packages/button/components/Button.luau +18 -20
- package/out/ui/packages/card/components/Card.d.ts +1 -3
- package/out/ui/packages/card/components/Card.luau +0 -10
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +53 -75
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +9 -26
- package/out/ui/packages/checkbox/components/Checkbox.luau +16 -16
- package/out/ui/packages/checkbox/components/checkboxLook.d.ts +1 -1
- package/out/ui/packages/chip/components/Chip.d.ts +1 -5
- package/out/ui/packages/chip/components/Chip.luau +16 -25
- package/out/ui/packages/chip/components/Chip.styles.d.ts +0 -5
- package/out/ui/packages/chip/components/Chip.styles.luau +13 -30
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +18 -29
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +20 -16
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +20 -34
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +35 -34
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +62 -65
- package/out/ui/packages/dialog/components/Dialog.d.ts +2 -3
- package/out/ui/packages/dialog/components/Dialog.luau +21 -41
- package/out/ui/packages/divider/components/Divider.d.ts +0 -1
- package/out/ui/packages/divider/components/Divider.luau +17 -52
- package/out/ui/packages/divider/components/Divider.styles.luau +0 -32
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.luau +37 -71
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +1 -3
- package/out/ui/packages/drawer/components/Drawer.styles.luau +2 -3
- package/out/ui/packages/fab/components/Fab.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.luau +37 -79
- package/out/ui/packages/fab/components/Fab.styles.d.ts +0 -3
- package/out/ui/packages/fab/components/Fab.styles.luau +3 -39
- package/out/ui/packages/fab/components/fabSize.d.ts +0 -1
- package/out/ui/packages/fab/components/fabSize.luau +0 -4
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +0 -1
- package/out/ui/packages/fontEditor/components/FontEditor.luau +16 -12
- package/out/ui/packages/formText/components/FormHelperText.luau +16 -12
- package/out/ui/packages/formText/components/FormLabel.luau +16 -12
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +42 -56
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +4 -37
- package/out/ui/packages/icon/components/Icon.luau +16 -9
- package/out/ui/packages/iconButton/components/IconButton.luau +16 -16
- package/out/ui/packages/index.d.ts +0 -6
- package/out/ui/packages/init.luau +0 -18
- package/out/ui/packages/input/components/Input.d.ts +0 -1
- package/out/ui/packages/input/components/Input.luau +18 -21
- package/out/ui/packages/layout/components/Grid.d.ts +1 -5
- package/out/ui/packages/layout/components/Grid.luau +19 -41
- package/out/ui/packages/layout/components/List.luau +16 -9
- package/out/ui/packages/layout/components/Stack.d.ts +0 -2
- package/out/ui/packages/layout/components/Stack.luau +15 -10
- package/out/ui/packages/layout/components/Stack.styles.d.ts +0 -2
- package/out/ui/packages/layout/components/Stack.styles.luau +5 -34
- package/out/ui/packages/layout/components/stackAlign.d.ts +2 -4
- package/out/ui/packages/layout/components/stackAlign.luau +2 -16
- package/out/ui/packages/layout/index.d.ts +0 -11
- package/out/ui/packages/layout/init.luau +0 -4
- package/out/ui/packages/link/components/Link.luau +16 -13
- package/out/ui/packages/listItem/components/ListItem.d.ts +1 -4
- package/out/ui/packages/listItem/components/ListItem.luau +4 -44
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +0 -1
- package/out/ui/packages/listItem/components/ListItem.styles.luau +5 -16
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +1 -5
- package/out/ui/packages/menu/components/Menu.d.ts +1 -4
- package/out/ui/packages/menu/components/Menu.luau +15 -32
- package/out/ui/packages/modal/components/Modal.d.ts +1 -2
- package/out/ui/packages/modal/components/Modal.luau +37 -79
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +0 -1
- package/out/ui/packages/motion/unit.d.ts +0 -5
- package/out/ui/packages/motion/unit.luau +0 -23
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +0 -2
- package/out/ui/packages/numberInput/components/NumberInput.luau +3 -16
- package/out/ui/packages/numberInput/components/numberValue.d.ts +0 -1
- package/out/ui/packages/numberInput/components/numberValue.luau +0 -45
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +16 -12
- package/out/ui/packages/pagination/components/Pagination.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.luau +38 -62
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +1 -6
- package/out/ui/packages/pagination/components/Pagination.styles.luau +4 -36
- package/out/ui/packages/pagination/components/pageRange.d.ts +1 -2
- package/out/ui/packages/pagination/components/pageRange.luau +8 -91
- package/out/ui/packages/pagination/index.d.ts +0 -1
- package/out/ui/packages/pagination/init.luau +0 -1
- package/out/ui/packages/paper/components/Paper.d.ts +2 -4
- package/out/ui/packages/paper/components/Paper.luau +9 -31
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +0 -6
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +38 -63
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +7 -21
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +0 -2
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +0 -14
- package/out/ui/packages/popup/components/Popup.d.ts +1 -2
- package/out/ui/packages/popup/components/Popup.luau +18 -35
- package/out/ui/packages/popup/index.d.ts +0 -1
- package/out/ui/packages/popup/init.luau +0 -1
- package/out/ui/packages/preloader/components/Preloader.luau +16 -9
- package/out/ui/packages/progressBar/components/ProgressBar.luau +16 -12
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +18 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +0 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +1 -4
- package/out/ui/packages/rating/components/Rating.d.ts +1 -3
- package/out/ui/packages/rating/components/Rating.luau +17 -19
- package/out/ui/packages/rating/components/Rating.styles.d.ts +0 -2
- package/out/ui/packages/rating/components/Rating.styles.luau +2 -7
- package/out/ui/packages/rayEditor/components/RayEditor.luau +16 -12
- package/out/ui/packages/rectEditor/components/RectEditor.luau +43 -86
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +7 -30
- package/out/ui/packages/scroll/index.d.ts +0 -2
- package/out/ui/packages/scroll/init.luau +0 -1
- package/out/ui/packages/select/components/Select.luau +55 -15
- package/out/ui/packages/select/components/selectMotion.d.ts +2 -0
- package/out/ui/packages/select/components/selectMotion.luau +12 -0
- package/out/ui/packages/shadow/components/Shadow.d.ts +1 -2
- package/out/ui/packages/shadow/components/Shadow.luau +17 -39
- package/out/ui/packages/shadow/components/Shadow.styles.luau +2 -7
- package/out/ui/packages/sidebar/components/Sidebar.luau +16 -9
- package/out/ui/packages/skeleton/components/Skeleton.luau +28 -19
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +3 -7
- package/out/ui/packages/slider/components/Slider.d.ts +0 -3
- package/out/ui/packages/slider/components/Slider.luau +19 -47
- package/out/ui/packages/slider/components/Slider.styles.d.ts +0 -2
- package/out/ui/packages/slider/components/Slider.styles.luau +1 -14
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +0 -2
- package/out/ui/packages/snackbar/components/Snackbar.luau +0 -5
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +0 -2
- package/out/ui/packages/speedDial/components/SpeedDial.luau +20 -25
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -4
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +4 -9
- package/out/ui/packages/speedDial/index.d.ts +0 -1
- package/out/ui/packages/splitPane/components/SplitPane.luau +17 -13
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +0 -2
- package/out/ui/packages/stateMatrix.luau +997 -793
- package/out/ui/packages/stepper/components/Stepper.d.ts +0 -1
- package/out/ui/packages/stepper/components/Stepper.luau +17 -16
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +1 -3
- package/out/ui/packages/stepper/components/Stepper.styles.luau +2 -6
- package/out/ui/packages/switch/components/Switch.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.luau +16 -21
- package/out/ui/packages/switch/components/Switch.styles.d.ts +0 -2
- package/out/ui/packages/switch/components/Switch.styles.luau +1 -6
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +2 -16
- package/out/ui/packages/table/components/Table.luau +53 -136
- package/out/ui/packages/table/components/Table.styles.d.ts +1 -3
- package/out/ui/packages/table/components/Table.styles.luau +6 -10
- package/out/ui/packages/table/index.d.ts +1 -2
- package/out/ui/packages/tabs/components/Tabs.d.ts +0 -3
- package/out/ui/packages/tabs/components/Tabs.luau +19 -24
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +1 -5
- package/out/ui/packages/tabs/components/Tabs.styles.luau +10 -26
- package/out/ui/packages/tabs/index.d.ts +0 -1
- package/out/ui/packages/tabs/init.luau +0 -1
- package/out/ui/packages/toast/components/Toast.d.ts +0 -2
- package/out/ui/packages/toast/components/Toast.luau +13 -41
- package/out/ui/packages/toast/components/Toast.styles.luau +5 -23
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +1 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +33 -36
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +0 -4
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +5 -16
- package/out/ui/packages/tooltip/components/Tooltip.luau +16 -9
- package/out/ui/packages/treeView/components/TreeView.luau +16 -9
- package/out/ui/packages/typography/components/Typography.luau +14 -13
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +16 -12
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +16 -12
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +1 -2
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +4 -15
- package/out/ui/packages/virtualList/components/VirtualList.luau +16 -9
- package/package.json +2 -2
- package/out/hooks/viewportObserver.d.ts +0 -10
- package/out/hooks/viewportObserver.luau +0 -75
- package/out/theme/styles/utilities/resolveSx.d.ts +0 -120
- package/out/theme/styles/utilities/resolveSx.luau +0 -524
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +0 -10
- package/out/ui/packages/backdrop/components/Backdrop.luau +0 -51
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +0 -4
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +0 -24
- package/out/ui/packages/backdrop/index.d.ts +0 -2
- package/out/ui/packages/backdrop/init.luau +0 -5
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +0 -11
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +0 -253
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +0 -18
- package/out/ui/packages/dateRange/dateRangeValue.luau +0 -121
- package/out/ui/packages/dateRange/index.d.ts +0 -3
- package/out/ui/packages/dateRange/init.luau +0 -16
- package/out/ui/packages/divider/components/dividerLabel.d.ts +0 -1
- package/out/ui/packages/divider/components/dividerLabel.luau +0 -10
- package/out/ui/packages/host/components/SxHost.d.ts +0 -18
- package/out/ui/packages/host/components/SxHost.luau +0 -210
- package/out/ui/packages/host/hostPaint.d.ts +0 -12
- package/out/ui/packages/host/hostPaint.luau +0 -34
- package/out/ui/packages/host/hostRules.d.ts +0 -15
- package/out/ui/packages/host/hostRules.luau +0 -92
- package/out/ui/packages/host/index.d.ts +0 -3
- package/out/ui/packages/host/init.luau +0 -13
- package/out/ui/packages/imageList/components/ImageList.d.ts +0 -14
- package/out/ui/packages/imageList/components/ImageList.luau +0 -93
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +0 -6
- package/out/ui/packages/imageList/components/ImageList.styles.luau +0 -73
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +0 -4
- package/out/ui/packages/imageList/components/imageListLayout.luau +0 -31
- package/out/ui/packages/imageList/index.d.ts +0 -2
- package/out/ui/packages/imageList/init.luau +0 -5
- package/out/ui/packages/layout/components/Box.d.ts +0 -11
- package/out/ui/packages/layout/components/Box.luau +0 -40
- package/out/ui/packages/layout/components/Box.styles.d.ts +0 -7
- package/out/ui/packages/layout/components/Box.styles.luau +0 -34
- package/out/ui/packages/layout/components/Container.d.ts +0 -10
- package/out/ui/packages/layout/components/Container.luau +0 -45
- package/out/ui/packages/layout/components/Container.styles.d.ts +0 -6
- package/out/ui/packages/layout/components/Container.styles.luau +0 -41
- package/out/ui/packages/layout/components/FlexItem.d.ts +0 -12
- package/out/ui/packages/layout/components/FlexItem.luau +0 -40
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +0 -8
- package/out/ui/packages/layout/components/FlexItem.styles.luau +0 -66
- package/out/ui/packages/layout/components/boxPad.d.ts +0 -14
- package/out/ui/packages/layout/components/boxPad.luau +0 -59
- package/out/ui/packages/layout/components/containerWidth.d.ts +0 -2
- package/out/ui/packages/layout/components/containerWidth.luau +0 -17
- package/out/ui/packages/layout/components/flexItemMode.d.ts +0 -6
- package/out/ui/packages/layout/components/flexItemMode.luau +0 -36
- package/out/ui/packages/layout/components/gridProps.d.ts +0 -3
- package/out/ui/packages/layout/components/gridProps.luau +0 -20
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +0 -11
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +0 -2
- package/out/ui/packages/markdown/components/Markdown.d.ts +0 -6
- package/out/ui/packages/markdown/components/Markdown.luau +0 -221
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +0 -2
- package/out/ui/packages/markdown/components/Markdown.styles.luau +0 -101
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +0 -22
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +0 -433
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +0 -6
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +0 -161
- package/out/ui/packages/markdown/components/markdownEditorHeight.d.ts +0 -1
- package/out/ui/packages/markdown/components/markdownEditorHeight.luau +0 -13
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +0 -2
- package/out/ui/packages/markdown/htmlToMarkdown.luau +0 -350
- package/out/ui/packages/markdown/index.d.ts +0 -8
- package/out/ui/packages/markdown/init.luau +0 -11
- package/out/ui/packages/markdown/parseMarkdown.d.ts +0 -42
- package/out/ui/packages/markdown/parseMarkdown.luau +0 -459
- package/out/ui/packages/reorder/index.d.ts +0 -2
- package/out/ui/packages/reorder/init.luau +0 -14
- package/out/ui/packages/reorder/reorder.d.ts +0 -24
- package/out/ui/packages/reorder/reorder.luau +0 -178
- package/out/ui/packages/reorder/useReorderDrag.d.ts +0 -15
- package/out/ui/packages/reorder/useReorderDrag.luau +0 -129
- package/out/ui/packages/scroll/components/ScrollView.d.ts +0 -7
- package/out/ui/packages/scroll/components/ScrollView.luau +0 -42
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +0 -20
- package/out/ui/packages/skeleton/components/skeletonTone.luau +0 -14
- package/out/ui/packages/slider/components/sliderMarks.d.ts +0 -1
- package/out/ui/packages/slider/components/sliderMarks.luau +0 -37
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +0 -1
- package/out/ui/packages/snackbar/components/snackbarAction.luau +0 -10
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +0 -9
- package/out/ui/packages/sparkline/components/Sparkline.luau +0 -66
- package/out/ui/packages/sparkline/index.d.ts +0 -3
- package/out/ui/packages/sparkline/init.luau +0 -6
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +0 -8
- package/out/ui/packages/sparkline/sparklineLayout.luau +0 -75
- package/out/ui/packages/table/components/tableColumns.d.ts +0 -26
- package/out/ui/packages/table/components/tableColumns.luau +0 -92
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +0 -2
- package/out/ui/packages/tabs/components/tabsOrientation.luau +0 -7
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
4
|
local ListItem = TS.import(script, script.Parent.Parent.Parent, "listItem").ListItem
|
|
6
5
|
local Popup = TS.import(script, script.Parent.Parent.Parent, "popup").Popup
|
|
7
6
|
local EmptyListHint = TS.import(script, script.Parent.Parent.Parent, "virtualList").EmptyListHint
|
|
8
7
|
local useMenuStyles = TS.import(script, script.Parent, "Menu.styles").default
|
|
9
8
|
local ROW = 28
|
|
10
|
-
local ROW_DENSE = 22
|
|
11
9
|
local function Menu(props)
|
|
12
10
|
local _binding = props
|
|
13
11
|
local anchor = _binding.anchor
|
|
@@ -17,31 +15,18 @@ local function Menu(props)
|
|
|
17
15
|
local onClose = _binding.onClose
|
|
18
16
|
local emptyText = _binding.emptyText
|
|
19
17
|
local empty = _binding.empty
|
|
20
|
-
local dense = _binding.dense
|
|
21
|
-
local selected = _binding.selected
|
|
22
|
-
local className = _binding.className
|
|
23
|
-
local sx = _binding.sx
|
|
24
|
-
local id = _binding.id
|
|
25
|
-
local ref = _binding.ref
|
|
26
18
|
local styles = useMenuStyles()
|
|
27
19
|
if not open then
|
|
28
20
|
return nil
|
|
29
21
|
end
|
|
30
22
|
local vacant = #items == 0
|
|
31
|
-
local
|
|
32
|
-
local height = if vacant then row else #items * row
|
|
23
|
+
local height = if vacant then ROW else #items * ROW
|
|
33
24
|
local _attributes = {
|
|
34
|
-
|
|
25
|
+
key = "Surface",
|
|
35
26
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
_condition = "Surface"
|
|
27
|
+
for _k, _v in styles.surface do
|
|
28
|
+
_attributes[_k] = _v
|
|
39
29
|
end
|
|
40
|
-
_attributes.key = _condition
|
|
41
|
-
_attributes.hostRef = ref
|
|
42
|
-
_attributes.base = styles.surface
|
|
43
|
-
_attributes.className = className
|
|
44
|
-
_attributes.sx = sx
|
|
45
30
|
local _attributes_1 = table.clone(styles.corner)
|
|
46
31
|
setmetatable(_attributes_1, nil)
|
|
47
32
|
local _exp = React.createElement("uicorner", _attributes_1)
|
|
@@ -53,18 +38,18 @@ local function Menu(props)
|
|
|
53
38
|
local _exp_2 = React.createElement("uilistlayout", _attributes_3)
|
|
54
39
|
local _result
|
|
55
40
|
if vacant then
|
|
56
|
-
local
|
|
57
|
-
if
|
|
41
|
+
local _condition = empty
|
|
42
|
+
if _condition == nil then
|
|
58
43
|
local _attributes_4 = {}
|
|
59
|
-
local
|
|
60
|
-
if
|
|
61
|
-
|
|
44
|
+
local _condition_1 = emptyText
|
|
45
|
+
if _condition_1 == nil then
|
|
46
|
+
_condition_1 = "No options"
|
|
62
47
|
end
|
|
63
|
-
_attributes_4.text =
|
|
64
|
-
_attributes_4.height =
|
|
65
|
-
|
|
48
|
+
_attributes_4.text = _condition_1
|
|
49
|
+
_attributes_4.height = ROW
|
|
50
|
+
_condition = React.createElement(EmptyListHint, _attributes_4)
|
|
66
51
|
end
|
|
67
|
-
_result =
|
|
52
|
+
_result = _condition
|
|
68
53
|
else
|
|
69
54
|
-- ▼ ReadonlyArray.map ▼
|
|
70
55
|
local _newValue = table.create(#items)
|
|
@@ -73,8 +58,6 @@ local function Menu(props)
|
|
|
73
58
|
key = item.id,
|
|
74
59
|
text = item.text,
|
|
75
60
|
disabled = item.disabled,
|
|
76
|
-
dense = dense,
|
|
77
|
-
selected = item.id == selected,
|
|
78
61
|
onActivated = function()
|
|
79
62
|
if item.disabled == true then
|
|
80
63
|
return nil
|
|
@@ -88,13 +71,13 @@ local function Menu(props)
|
|
|
88
71
|
_newValue[_k] = _callback(_v, _k - 1, items)
|
|
89
72
|
end
|
|
90
73
|
-- ▲ ReadonlyArray.map ▲
|
|
91
|
-
_result =
|
|
74
|
+
_result = _newValue
|
|
92
75
|
end
|
|
93
76
|
return React.createElement(Popup, {
|
|
94
77
|
anchor = anchor,
|
|
95
78
|
preferredHeight = height,
|
|
96
79
|
onDismiss = onClose,
|
|
97
|
-
}, React.createElement(
|
|
80
|
+
}, React.createElement("frame", _attributes, _exp, _exp_1, _exp_2, _result))
|
|
98
81
|
end
|
|
99
82
|
local default = Menu
|
|
100
83
|
return {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
import { CustomizedProps } from "../../../../theme/index";
|
|
3
2
|
export interface ModalProps {
|
|
4
3
|
host?: Instance;
|
|
5
4
|
open: boolean;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
children?: React.ReactNode;
|
|
8
7
|
}
|
|
9
|
-
declare function Modal(props:
|
|
8
|
+
declare function Modal(props: ModalProps): JSX.Element | undefined;
|
|
10
9
|
export default Modal;
|
|
@@ -4,14 +4,10 @@ local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
|
4
4
|
local React = _react
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
|
-
local useState = _react.useState
|
|
8
7
|
local _services = TS.import(script, TS.getModule(script, "@rbxts", "services"))
|
|
9
8
|
local GuiService = _services.GuiService
|
|
10
9
|
local UserInputService = _services.UserInputService
|
|
11
|
-
local
|
|
12
|
-
local _popup = TS.import(script, script.Parent.Parent.Parent, "popup")
|
|
13
|
-
local Portal = _popup.Portal
|
|
14
|
-
local portalTarget = _popup.portalTarget
|
|
10
|
+
local Portal = TS.import(script, script.Parent.Parent.Parent, "popup").Portal
|
|
15
11
|
local isDismissInput = TS.import(script, script.Parent, "dismissInput").isDismissInput
|
|
16
12
|
local _focusTrap = TS.import(script, script.Parent, "focusTrap")
|
|
17
13
|
local isFocusable = _focusTrap.isFocusable
|
|
@@ -23,21 +19,10 @@ local function Modal(props)
|
|
|
23
19
|
local open = _binding.open
|
|
24
20
|
local onClose = _binding.onClose
|
|
25
21
|
local children = _binding.children
|
|
26
|
-
local className = _binding.className
|
|
27
|
-
local sx = _binding.sx
|
|
28
|
-
local id = _binding.id
|
|
29
|
-
local ref = _binding.ref
|
|
30
22
|
local styles = useModalStyles()
|
|
31
23
|
local close = useRef(onClose)
|
|
32
24
|
local surface = useRef()
|
|
33
|
-
local anchor = useRef()
|
|
34
|
-
local layer, setLayer = useState(function()
|
|
35
|
-
return portalTarget(host)
|
|
36
|
-
end)
|
|
37
25
|
close.current = onClose
|
|
38
|
-
useEffect(function()
|
|
39
|
-
setLayer(portalTarget(host or anchor.current))
|
|
40
|
-
end, { host, open })
|
|
41
26
|
useEffect(function()
|
|
42
27
|
if not open then
|
|
43
28
|
return nil
|
|
@@ -68,70 +53,43 @@ local function Modal(props)
|
|
|
68
53
|
GuiService.SelectedObject = previous
|
|
69
54
|
end
|
|
70
55
|
end
|
|
71
|
-
end, { open
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
local _exp_1 = React.createElement("textbutton", _attributes_1)
|
|
100
|
-
local _attributes_2 = {
|
|
101
|
-
tag = "frame",
|
|
102
|
-
}
|
|
103
|
-
local _condition_1 = id
|
|
104
|
-
if not (_condition_1 ~= 0 and _condition_1 == _condition_1 and _condition_1 ~= "" and _condition_1) then
|
|
105
|
-
_condition_1 = "Surface"
|
|
106
|
-
end
|
|
107
|
-
_attributes_2.key = _condition_1
|
|
108
|
-
_attributes_2.hostRef = function(instance)
|
|
109
|
-
surface.current = instance
|
|
110
|
-
if ref == nil then
|
|
111
|
-
return nil
|
|
112
|
-
end
|
|
113
|
-
if type(ref) == "function" then
|
|
114
|
-
ref(instance)
|
|
115
|
-
return nil
|
|
116
|
-
end
|
|
117
|
-
ref.current = instance
|
|
118
|
-
end
|
|
119
|
-
_attributes_2.base = surfaceStyle
|
|
120
|
-
_attributes_2.className = className
|
|
121
|
-
_attributes_2.sx = sx
|
|
122
|
-
_attributes_2.AnchorPoint = surfaceStyle.AnchorPoint
|
|
123
|
-
_attributes_2.Position = surfaceStyle.Position
|
|
124
|
-
_attributes_2.ZIndex = surfaceStyle.ZIndex
|
|
125
|
-
local _attributes_3 = table.clone(styles.padding)
|
|
126
|
-
setmetatable(_attributes_3, nil)
|
|
127
|
-
local _exp_2 = React.createElement("uipadding", _attributes_3)
|
|
128
|
-
local _attributes_4 = table.clone(styles.corner)
|
|
129
|
-
setmetatable(_attributes_4, nil)
|
|
130
|
-
_condition = (React.createElement(Portal, {
|
|
131
|
-
host = layer,
|
|
132
|
-
}, React.createElement("frame", _attributes, _exp_1, React.createElement(SxHost, _attributes_2, _exp_2, React.createElement("uicorner", _attributes_4), children))))
|
|
56
|
+
end, { open })
|
|
57
|
+
if not open then
|
|
58
|
+
return nil
|
|
59
|
+
end
|
|
60
|
+
local _attributes = {
|
|
61
|
+
key = "Modal",
|
|
62
|
+
}
|
|
63
|
+
for _k, _v in styles.root do
|
|
64
|
+
_attributes[_k] = _v
|
|
65
|
+
end
|
|
66
|
+
local _attributes_1 = {
|
|
67
|
+
key = "Backdrop",
|
|
68
|
+
}
|
|
69
|
+
for _k, _v in styles.backdrop do
|
|
70
|
+
_attributes_1[_k] = _v
|
|
71
|
+
end
|
|
72
|
+
_attributes_1.Event = {
|
|
73
|
+
Activated = function()
|
|
74
|
+
return close.current()
|
|
75
|
+
end,
|
|
76
|
+
}
|
|
77
|
+
local _exp = React.createElement("textbutton", _attributes_1)
|
|
78
|
+
local _attributes_2 = {
|
|
79
|
+
key = "Surface",
|
|
80
|
+
ref = surface,
|
|
81
|
+
}
|
|
82
|
+
for _k, _v in styles.surface do
|
|
83
|
+
_attributes_2[_k] = _v
|
|
133
84
|
end
|
|
134
|
-
|
|
85
|
+
local _attributes_3 = table.clone(styles.padding)
|
|
86
|
+
setmetatable(_attributes_3, nil)
|
|
87
|
+
local _exp_1 = React.createElement("uipadding", _attributes_3)
|
|
88
|
+
local _attributes_4 = table.clone(styles.corner)
|
|
89
|
+
setmetatable(_attributes_4, nil)
|
|
90
|
+
return React.createElement(Portal, {
|
|
91
|
+
host = host,
|
|
92
|
+
}, React.createElement("frame", _attributes, _exp, React.createElement("frame", _attributes_2, _exp_1, React.createElement("uicorner", _attributes_4), children)))
|
|
135
93
|
end
|
|
136
94
|
local default = Modal
|
|
137
95
|
return {
|
|
@@ -2,4 +2,4 @@ export { loopProperty } from "./loop";
|
|
|
2
2
|
export { motionDuration, assignGoal } from "./duration";
|
|
3
3
|
export { playProperty } from "./play";
|
|
4
4
|
export { resolveReduced } from "./resolveReduced";
|
|
5
|
-
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys
|
|
5
|
+
export { clampUnit, stopOnce, progressUnit, progressSpin, arcKeys } from "./unit";
|
|
@@ -6,8 +6,3 @@ export declare function arcKeys(value: number): {
|
|
|
6
6
|
time: number;
|
|
7
7
|
transparency: number;
|
|
8
8
|
}[];
|
|
9
|
-
/** Indeterminate ring: long clear trail, bright head — reads as a sweep. */
|
|
10
|
-
export declare function spinArcKeys(): {
|
|
11
|
-
time: number;
|
|
12
|
-
transparency: number;
|
|
13
|
-
}[];
|
|
@@ -71,33 +71,10 @@ local function arcKeys(value)
|
|
|
71
71
|
transparency = 1,
|
|
72
72
|
} }
|
|
73
73
|
end
|
|
74
|
-
--* Indeterminate ring: long clear trail, bright head — reads as a sweep.
|
|
75
|
-
local function spinArcKeys()
|
|
76
|
-
return { {
|
|
77
|
-
time = 0,
|
|
78
|
-
transparency = 1,
|
|
79
|
-
}, {
|
|
80
|
-
time = 0.45,
|
|
81
|
-
transparency = 1,
|
|
82
|
-
}, {
|
|
83
|
-
time = 0.7,
|
|
84
|
-
transparency = 0.55,
|
|
85
|
-
}, {
|
|
86
|
-
time = 0.88,
|
|
87
|
-
transparency = 0,
|
|
88
|
-
}, {
|
|
89
|
-
time = 0.96,
|
|
90
|
-
transparency = 0.35,
|
|
91
|
-
}, {
|
|
92
|
-
time = 1,
|
|
93
|
-
transparency = 1,
|
|
94
|
-
} }
|
|
95
|
-
end
|
|
96
74
|
return {
|
|
97
75
|
clampUnit = clampUnit,
|
|
98
76
|
stopOnce = stopOnce,
|
|
99
77
|
progressUnit = progressUnit,
|
|
100
78
|
progressSpin = progressSpin,
|
|
101
79
|
arcKeys = arcKeys,
|
|
102
|
-
spinArcKeys = spinArcKeys,
|
|
103
80
|
}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local Input = TS.import(script, script.Parent.Parent.Parent, "input").Input
|
|
5
|
-
local
|
|
6
|
-
local formatNumber = _numberValue.formatNumber
|
|
7
|
-
local parseNumberDraft = _numberValue.parseNumberDraft
|
|
5
|
+
local parseNumberDraft = TS.import(script, script.Parent, "numberValue").parseNumberDraft
|
|
8
6
|
local function NumberInput(props)
|
|
9
7
|
local _binding = props
|
|
10
8
|
local value = _binding.value
|
|
@@ -12,16 +10,13 @@ local function NumberInput(props)
|
|
|
12
10
|
local min = _binding.min
|
|
13
11
|
local max = _binding.max
|
|
14
12
|
local step = _binding.step
|
|
15
|
-
local places = _binding.places
|
|
16
13
|
local disabled = _binding.disabled
|
|
17
|
-
local readOnly = _binding.readOnly
|
|
18
14
|
local loading = _binding.loading
|
|
19
15
|
local placeholder = _binding.placeholder
|
|
20
16
|
local width = _binding.width
|
|
21
17
|
local size = _binding.size
|
|
22
18
|
local reducedMotion = _binding.reducedMotion
|
|
23
19
|
local className = _binding.className
|
|
24
|
-
local sx = _binding.sx
|
|
25
20
|
local id = _binding.id
|
|
26
21
|
local ref = _binding.ref
|
|
27
22
|
local _attributes = {}
|
|
@@ -32,24 +27,16 @@ local function NumberInput(props)
|
|
|
32
27
|
_attributes.id = _condition
|
|
33
28
|
_attributes.ref = ref
|
|
34
29
|
_attributes.className = className
|
|
35
|
-
_attributes.
|
|
36
|
-
_attributes.text = if places ~= nil then formatNumber(value, places) else tostring(value)
|
|
30
|
+
_attributes.text = tostring(value)
|
|
37
31
|
_attributes.placeholder = placeholder
|
|
38
32
|
_attributes.width = width
|
|
39
33
|
_attributes.disabled = disabled
|
|
40
|
-
_attributes.readOnly = readOnly
|
|
41
34
|
_attributes.loading = loading
|
|
42
35
|
_attributes.size = size
|
|
43
36
|
_attributes.reducedMotion = reducedMotion
|
|
44
37
|
_attributes.onTextChanged = function(text)
|
|
45
38
|
local committed = parseNumberDraft(text, min, max, step)
|
|
46
|
-
if committed
|
|
47
|
-
return nil
|
|
48
|
-
end
|
|
49
|
-
if places ~= nil and formatNumber(committed, places) == formatNumber(value, places) then
|
|
50
|
-
return nil
|
|
51
|
-
end
|
|
52
|
-
if committed ~= value then
|
|
39
|
+
if committed ~= nil and committed ~= value then
|
|
53
40
|
onChange(committed)
|
|
54
41
|
end
|
|
55
42
|
end
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
export declare function commitNumber(value: number | undefined, min?: number, max?: number, step?: number): number | undefined;
|
|
2
2
|
export declare function parseNumberDraft(text: string, min?: number, max?: number, step?: number): number | undefined;
|
|
3
|
-
export declare function formatNumber(value: number, places?: number): string;
|
|
@@ -23,52 +23,7 @@ end
|
|
|
23
23
|
local function parseNumberDraft(text, min, max, step)
|
|
24
24
|
return commitNumber(tonumber(text), min, max, step)
|
|
25
25
|
end
|
|
26
|
-
local function formatNumber(value, places)
|
|
27
|
-
if places == nil then
|
|
28
|
-
places = 4
|
|
29
|
-
end
|
|
30
|
-
if value ~= value or value == math.huge or value == -math.huge then
|
|
31
|
-
return tostring(value)
|
|
32
|
-
end
|
|
33
|
-
local scale = 10 ^ places
|
|
34
|
-
local scaled = math.floor(math.abs(value) * scale + 0.5)
|
|
35
|
-
if scaled == 0 then
|
|
36
|
-
return "0"
|
|
37
|
-
end
|
|
38
|
-
local sign = if value < 0 then "-" else ""
|
|
39
|
-
local whole = math.floor(scaled / scale)
|
|
40
|
-
local frac = scaled % scale
|
|
41
|
-
if frac == 0 then
|
|
42
|
-
return `{sign}{whole}`
|
|
43
|
-
end
|
|
44
|
-
local digits = ""
|
|
45
|
-
local rest = frac
|
|
46
|
-
while rest > 0 do
|
|
47
|
-
digits = `{rest % 10}{digits}`
|
|
48
|
-
rest = math.floor(rest / 10)
|
|
49
|
-
end
|
|
50
|
-
while #digits < places do
|
|
51
|
-
digits = `0{digits}`
|
|
52
|
-
end
|
|
53
|
-
while true do
|
|
54
|
-
local _condition = #digits > 0
|
|
55
|
-
if _condition then
|
|
56
|
-
local _digits = digits
|
|
57
|
-
local _arg0 = #digits
|
|
58
|
-
local _arg1 = #digits
|
|
59
|
-
_condition = string.sub(_digits, _arg0, _arg1) == "0"
|
|
60
|
-
end
|
|
61
|
-
if not _condition then
|
|
62
|
-
break
|
|
63
|
-
end
|
|
64
|
-
local _digits = digits
|
|
65
|
-
local _arg1 = #digits - 1
|
|
66
|
-
digits = string.sub(_digits, 1, _arg1)
|
|
67
|
-
end
|
|
68
|
-
return `{sign}{whole}.{digits}`
|
|
69
|
-
end
|
|
70
26
|
return {
|
|
71
27
|
commitNumber = commitNumber,
|
|
72
28
|
parseNumberDraft = parseNumberDraft,
|
|
73
|
-
formatNumber = formatNumber,
|
|
74
29
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
5
4
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
6
5
|
local useNumberRangeEditorStyles = TS.import(script, script.Parent, "NumberRangeEditor.styles").default
|
|
7
6
|
local writeNumberRange = TS.import(script, script.Parent, "numberRangeValue").writeNumberRange
|
|
@@ -19,21 +18,26 @@ local function NumberRangeEditor(props)
|
|
|
19
18
|
local parts = writeNumberRange(value.Min, value.Max, field, amount)
|
|
20
19
|
onChange(NumberRange.new(parts.Min, parts.Max))
|
|
21
20
|
end
|
|
22
|
-
local _attributes = {
|
|
23
|
-
tag = "frame",
|
|
24
|
-
}
|
|
21
|
+
local _attributes = {}
|
|
25
22
|
local _condition = id
|
|
26
23
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
27
24
|
_condition = "NumberRangeEditor"
|
|
28
25
|
end
|
|
29
26
|
_attributes.key = _condition
|
|
30
|
-
_attributes.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
_attributes.ref = ref
|
|
28
|
+
for _k, _v in styles.root do
|
|
29
|
+
_attributes[_k] = _v
|
|
30
|
+
end
|
|
31
|
+
if className then
|
|
32
|
+
for _k, _v in className do
|
|
33
|
+
_attributes[_k] = _v
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
if sx then
|
|
37
|
+
for _k, _v in sx do
|
|
38
|
+
_attributes[_k] = _v
|
|
39
|
+
end
|
|
40
|
+
end
|
|
37
41
|
local _attributes_1 = table.clone(styles.row)
|
|
38
42
|
setmetatable(_attributes_1, nil)
|
|
39
43
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
@@ -77,7 +81,7 @@ local function NumberRangeEditor(props)
|
|
|
77
81
|
local _exp_5 = React.createElement("textlabel", _attributes_8)
|
|
78
82
|
local _attributes_9 = table.clone(styles.field)
|
|
79
83
|
setmetatable(_attributes_9, nil)
|
|
80
|
-
return React.createElement(
|
|
84
|
+
return React.createElement("frame", _attributes, _exp, _exp_3, React.createElement("frame", _attributes_6, _exp_4, _exp_5, React.createElement("frame", _attributes_9, React.createElement(NumberInput, {
|
|
81
85
|
value = value.Max,
|
|
82
86
|
disabled = disabled,
|
|
83
87
|
width = UDim.new(1, 0),
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PaginationVariant } from "./Pagination.styles";
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
2
|
export interface PaginationProps {
|
|
4
3
|
count: number;
|
|
5
4
|
page: number;
|
|
6
5
|
disabled?: boolean;
|
|
7
|
-
siblingCount?: number;
|
|
8
|
-
boundaryCount?: number;
|
|
9
|
-
size?: ControlSize;
|
|
10
|
-
variant?: PaginationVariant;
|
|
11
6
|
onChange: (page: number) => void;
|
|
12
7
|
}
|
|
13
8
|
declare function Pagination(props: CustomizedProps<Frame, PaginationProps>): JSX.Element;
|
|
@@ -3,92 +3,68 @@ local TS = _G[script]
|
|
|
3
3
|
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
4
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
5
|
local pageRange = TS.import(script, script.Parent, "pageRange").pageRange
|
|
6
|
-
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
6
|
local usePaginationStyles = TS.import(script, script.Parent, "Pagination.styles").default
|
|
8
7
|
local function Pagination(props)
|
|
9
8
|
local _binding = props
|
|
10
9
|
local count = _binding.count
|
|
11
10
|
local page = _binding.page
|
|
12
11
|
local disabled = _binding.disabled
|
|
13
|
-
local siblingCount = _binding.siblingCount
|
|
14
|
-
local boundaryCount = _binding.boundaryCount
|
|
15
|
-
local size = _binding.size
|
|
16
|
-
local variant = _binding.variant
|
|
17
12
|
local onChange = _binding.onChange
|
|
18
13
|
local className = _binding.className
|
|
19
14
|
local sx = _binding.sx
|
|
20
15
|
local id = _binding.id
|
|
21
16
|
local ref = _binding.ref
|
|
22
|
-
local styles = usePaginationStyles(
|
|
23
|
-
|
|
24
|
-
variant = variant,
|
|
25
|
-
})
|
|
26
|
-
local tokens = pageRange(count, page, siblingCount, boundaryCount)
|
|
27
|
-
local _attributes = {
|
|
28
|
-
tag = "frame",
|
|
29
|
-
}
|
|
17
|
+
local styles = usePaginationStyles()
|
|
18
|
+
local _attributes = {}
|
|
30
19
|
local _condition = id
|
|
31
20
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
32
21
|
_condition = "Pagination"
|
|
33
22
|
end
|
|
34
23
|
_attributes.key = _condition
|
|
35
|
-
_attributes.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
_attributes.ref = ref
|
|
25
|
+
for _k, _v in styles.root do
|
|
26
|
+
_attributes[_k] = _v
|
|
27
|
+
end
|
|
28
|
+
if className then
|
|
29
|
+
for _k, _v in className do
|
|
30
|
+
_attributes[_k] = _v
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
if sx then
|
|
34
|
+
for _k, _v in sx do
|
|
35
|
+
_attributes[_k] = _v
|
|
36
|
+
end
|
|
37
|
+
end
|
|
42
38
|
local _attributes_1 = table.clone(styles.list)
|
|
43
39
|
setmetatable(_attributes_1, nil)
|
|
44
40
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
41
|
+
local _exp_1 = pageRange(count)
|
|
45
42
|
-- ▼ ReadonlyArray.map ▼
|
|
46
|
-
local _newValue = table.create(#
|
|
47
|
-
local _callback = function(item
|
|
48
|
-
local
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
for _k, _v in styles.ellipsis do
|
|
54
|
-
_attributes_2[_k] = _v
|
|
55
|
-
end
|
|
56
|
-
_attributes_2.LayoutOrder = index
|
|
57
|
-
_result = (React.createElement("textlabel", _attributes_2))
|
|
58
|
-
else
|
|
59
|
-
local _attributes_2 = {
|
|
60
|
-
key = tostring(item),
|
|
61
|
-
}
|
|
62
|
-
for _k, _v in cx(styles.page, item == page and styles.selected) do
|
|
63
|
-
_attributes_2[_k] = _v
|
|
64
|
-
end
|
|
65
|
-
_attributes_2.Text = tostring(item)
|
|
66
|
-
_attributes_2.LayoutOrder = index
|
|
67
|
-
_attributes_2.Active = disabled ~= true
|
|
68
|
-
_attributes_2.Selectable = disabled ~= true
|
|
69
|
-
_attributes_2.Event = {
|
|
70
|
-
Activated = function()
|
|
71
|
-
return disabled ~= true and item ~= page and onChange(item)
|
|
72
|
-
end,
|
|
73
|
-
}
|
|
74
|
-
local _attributes_3 = table.clone(styles.corner)
|
|
75
|
-
setmetatable(_attributes_3, nil)
|
|
76
|
-
local _exp_1 = React.createElement("uicorner", _attributes_3)
|
|
77
|
-
local _condition_1 = variant == "outlined"
|
|
78
|
-
if _condition_1 then
|
|
79
|
-
local _attributes_4 = table.clone((if item == page then styles.selectedStroke else styles.stroke))
|
|
80
|
-
setmetatable(_attributes_4, nil)
|
|
81
|
-
_condition_1 = React.createElement("uistroke", _attributes_4)
|
|
82
|
-
end
|
|
83
|
-
_result = (React.createElement("textbutton", _attributes_2, _exp_1, _condition_1))
|
|
43
|
+
local _newValue = table.create(#_exp_1)
|
|
44
|
+
local _callback = function(item)
|
|
45
|
+
local _attributes_2 = {
|
|
46
|
+
key = tostring(item),
|
|
47
|
+
}
|
|
48
|
+
for _k, _v in cx(styles.page, item == page and styles.selected) do
|
|
49
|
+
_attributes_2[_k] = _v
|
|
84
50
|
end
|
|
85
|
-
|
|
51
|
+
_attributes_2.Text = tostring(item)
|
|
52
|
+
_attributes_2.Active = disabled ~= true
|
|
53
|
+
_attributes_2.Selectable = disabled ~= true
|
|
54
|
+
_attributes_2.Event = {
|
|
55
|
+
Activated = function()
|
|
56
|
+
return disabled ~= true and item ~= page and onChange(item)
|
|
57
|
+
end,
|
|
58
|
+
}
|
|
59
|
+
local _attributes_3 = table.clone(styles.corner)
|
|
60
|
+
setmetatable(_attributes_3, nil)
|
|
61
|
+
return React.createElement("textbutton", _attributes_2, React.createElement("uicorner", _attributes_3))
|
|
86
62
|
end
|
|
87
|
-
for _k, _v in
|
|
88
|
-
_newValue[_k] = _callback(_v, _k - 1,
|
|
63
|
+
for _k, _v in _exp_1 do
|
|
64
|
+
_newValue[_k] = _callback(_v, _k - 1, _exp_1)
|
|
89
65
|
end
|
|
90
66
|
-- ▲ ReadonlyArray.map ▲
|
|
91
|
-
return React.createElement(
|
|
67
|
+
return React.createElement("frame", _attributes, _exp, _newValue)
|
|
92
68
|
end
|
|
93
69
|
local default = Pagination
|
|
94
70
|
return {
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type PaginationVariant = "text" | "outlined";
|
|
3
|
-
declare const usePaginationStyles: (props: {
|
|
4
|
-
size?: ControlSize;
|
|
5
|
-
variant?: PaginationVariant;
|
|
6
|
-
}) => import("../../../../theme/index").ClassNameMap<string>;
|
|
1
|
+
declare const usePaginationStyles: () => import("../../../../theme/index").ClassNameMap<string>;
|
|
7
2
|
export default usePaginationStyles;
|