@rbxts/uiblox 0.2.0-alpha.3 → 0.2.0-alpha.30
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 +27 -109
- package/out/hooks/index.d.ts +1 -0
- package/out/hooks/init.luau +3 -0
- package/out/hooks/useBreakpoints.luau +2 -11
- package/out/hooks/viewportObserver.d.ts +10 -0
- package/out/hooks/viewportObserver.luau +75 -0
- package/out/theme/interfaces/theme/Theme.d.ts +15 -0
- package/out/theme/styles/utilities/componentStyles.luau +45 -3
- package/out/theme/styles/utilities/componentTheme.d.ts +15 -0
- package/out/theme/styles/utilities/index.d.ts +2 -0
- package/out/theme/styles/utilities/init.luau +7 -0
- package/out/theme/styles/utilities/resolveStyle.d.ts +10 -2
- package/out/theme/styles/utilities/resolveStyle.luau +7 -3
- package/out/theme/styles/utilities/resolveSx.d.ts +110 -0
- package/out/theme/styles/utilities/resolveSx.luau +479 -0
- package/out/theme/styles/utilities/styleCache.d.ts +2 -0
- package/out/theme/styles/utilities/styleCache.luau +9 -0
- package/out/ui/packages/accordion/components/Accordion.d.ts +2 -0
- package/out/ui/packages/accordion/components/Accordion.luau +46 -30
- package/out/ui/packages/accordion/components/Accordion.styles.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.styles.luau +16 -4
- package/out/ui/packages/accordion/components/accordionOpen.d.ts +1 -0
- package/out/ui/packages/accordion/components/accordionOpen.luau +4 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +48 -42
- package/out/ui/packages/alert/components/Alert.styles.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.styles.luau +17 -8
- package/out/ui/packages/appBar/components/AppBar.d.ts +2 -1
- package/out/ui/packages/appBar/components/AppBar.luau +47 -36
- package/out/ui/packages/appBar/components/AppBar.styles.d.ts +2 -0
- package/out/ui/packages/appBar/components/AppBar.styles.luau +16 -5
- package/out/ui/packages/assetField/components/AssetField.luau +12 -16
- package/out/ui/packages/autocomplete/components/Autocomplete.luau +8 -0
- package/out/ui/packages/avatar/components/Avatar.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.luau +27 -26
- package/out/ui/packages/avatar/components/Avatar.styles.d.ts +2 -0
- package/out/ui/packages/avatar/components/Avatar.styles.luau +5 -1
- package/out/ui/packages/backdrop/components/Backdrop.d.ts +10 -0
- package/out/ui/packages/backdrop/components/Backdrop.luau +51 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.d.ts +4 -0
- package/out/ui/packages/backdrop/components/Backdrop.styles.luau +24 -0
- package/out/ui/packages/backdrop/index.d.ts +2 -0
- package/out/ui/packages/backdrop/init.luau +5 -0
- package/out/ui/packages/badge/components/Badge.d.ts +3 -0
- package/out/ui/packages/badge/components/Badge.luau +32 -24
- package/out/ui/packages/badge/components/Badge.styles.d.ts +5 -1
- package/out/ui/packages/badge/components/Badge.styles.luau +20 -8
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +1 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +20 -18
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.d.ts +3 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +6 -2
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +67 -40
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +9 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +68 -0
- package/out/ui/packages/breadcrumbs/index.d.ts +1 -0
- package/out/ui/packages/breadcrumbs/init.luau +3 -0
- package/out/ui/packages/brickColorPicker/components/BrickColorPicker.luau +12 -16
- package/out/ui/packages/button/components/Button.luau +28 -22
- package/out/ui/packages/card/components/Card.d.ts +3 -1
- package/out/ui/packages/card/components/Card.luau +10 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +75 -53
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +26 -9
- 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 +6 -1
- package/out/ui/packages/chip/components/Chip.luau +61 -17
- package/out/ui/packages/chip/components/Chip.styles.d.ts +6 -0
- package/out/ui/packages/chip/components/Chip.styles.luau +54 -9
- package/out/ui/packages/circularProgress/components/CircularProgress.luau +29 -18
- package/out/ui/packages/colorPicker/components/ColorPicker.luau +16 -20
- package/out/ui/packages/colorPicker/components/ColorPicker.styles.luau +34 -20
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +34 -35
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +65 -62
- package/out/ui/packages/dialog/components/Dialog.d.ts +3 -2
- package/out/ui/packages/dialog/components/Dialog.luau +41 -21
- package/out/ui/packages/divider/components/Divider.d.ts +1 -0
- package/out/ui/packages/divider/components/Divider.luau +52 -17
- package/out/ui/packages/divider/components/Divider.styles.luau +32 -0
- package/out/ui/packages/divider/components/dividerLabel.d.ts +1 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +10 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.luau +71 -37
- package/out/ui/packages/drawer/components/Drawer.styles.d.ts +3 -1
- package/out/ui/packages/drawer/components/Drawer.styles.luau +3 -2
- package/out/ui/packages/fab/components/Fab.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.luau +79 -37
- package/out/ui/packages/fab/components/Fab.styles.d.ts +3 -0
- package/out/ui/packages/fab/components/Fab.styles.luau +39 -3
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -0
- package/out/ui/packages/fab/components/fabSize.luau +4 -0
- package/out/ui/packages/fab/index.d.ts +1 -1
- package/out/ui/packages/fab/init.luau +1 -0
- package/out/ui/packages/fontEditor/components/FontEditor.luau +12 -16
- package/out/ui/packages/formText/components/FormHelperText.d.ts +8 -0
- package/out/ui/packages/formText/components/FormHelperText.luau +40 -0
- package/out/ui/packages/formText/components/FormLabel.d.ts +9 -0
- package/out/ui/packages/formText/components/FormLabel.luau +42 -0
- package/out/ui/packages/formText/components/FormText.styles.d.ts +5 -0
- package/out/ui/packages/formText/components/FormText.styles.luau +33 -0
- package/out/ui/packages/formText/index.d.ts +4 -0
- package/out/ui/packages/formText/init.luau +6 -0
- package/out/ui/packages/gradientEditor/components/GradientEditor.luau +56 -42
- package/out/ui/packages/gradientEditor/components/GradientEditor.styles.luau +37 -4
- package/out/ui/packages/host/components/SxHost.d.ts +18 -0
- package/out/ui/packages/host/components/SxHost.luau +202 -0
- package/out/ui/packages/host/hostPaint.d.ts +11 -0
- package/out/ui/packages/host/hostPaint.luau +33 -0
- package/out/ui/packages/host/hostRules.d.ts +15 -0
- package/out/ui/packages/host/hostRules.luau +92 -0
- package/out/ui/packages/host/index.d.ts +3 -0
- package/out/ui/packages/host/init.luau +13 -0
- package/out/ui/packages/icon/components/Icon.luau +9 -16
- package/out/ui/packages/iconButton/components/IconButton.luau +22 -17
- package/out/ui/packages/iconButton/components/IconButton.styles.luau +3 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +14 -0
- package/out/ui/packages/imageList/components/ImageList.luau +93 -0
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +6 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +73 -0
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +4 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +31 -0
- package/out/ui/packages/imageList/index.d.ts +2 -0
- package/out/ui/packages/imageList/init.luau +5 -0
- package/out/ui/packages/index.d.ts +8 -0
- package/out/ui/packages/init.luau +24 -0
- package/out/ui/packages/input/components/Input.d.ts +1 -0
- package/out/ui/packages/input/components/Input.luau +22 -19
- package/out/ui/packages/layout/components/Box.d.ts +11 -0
- package/out/ui/packages/layout/components/Box.luau +40 -0
- package/out/ui/packages/layout/components/Box.styles.d.ts +7 -0
- package/out/ui/packages/layout/components/Box.styles.luau +34 -0
- package/out/ui/packages/layout/components/Container.d.ts +10 -0
- package/out/ui/packages/layout/components/Container.luau +45 -0
- package/out/ui/packages/layout/components/Container.styles.d.ts +6 -0
- package/out/ui/packages/layout/components/Container.styles.luau +41 -0
- package/out/ui/packages/layout/components/FlexItem.d.ts +12 -0
- package/out/ui/packages/layout/components/FlexItem.luau +40 -0
- package/out/ui/packages/layout/components/FlexItem.styles.d.ts +8 -0
- package/out/ui/packages/layout/components/FlexItem.styles.luau +66 -0
- package/out/ui/packages/layout/components/Grid.d.ts +5 -1
- package/out/ui/packages/layout/components/Grid.luau +41 -19
- package/out/ui/packages/layout/components/List.luau +9 -16
- package/out/ui/packages/layout/components/Stack.d.ts +14 -0
- package/out/ui/packages/layout/components/Stack.luau +44 -0
- package/out/ui/packages/layout/components/Stack.styles.d.ts +10 -0
- package/out/ui/packages/layout/components/Stack.styles.luau +101 -0
- package/out/ui/packages/layout/components/boxPad.d.ts +14 -0
- package/out/ui/packages/layout/components/boxPad.luau +59 -0
- package/out/ui/packages/layout/components/containerWidth.d.ts +2 -0
- package/out/ui/packages/layout/components/containerWidth.luau +17 -0
- package/out/ui/packages/layout/components/flexItemMode.d.ts +6 -0
- package/out/ui/packages/layout/components/flexItemMode.luau +36 -0
- package/out/ui/packages/layout/components/gridProps.d.ts +3 -0
- package/out/ui/packages/layout/components/gridProps.luau +20 -0
- package/out/ui/packages/layout/components/stackAlign.d.ts +10 -0
- package/out/ui/packages/layout/components/stackAlign.luau +43 -0
- package/out/ui/packages/layout/index.d.ts +14 -0
- package/out/ui/packages/layout/init.luau +5 -0
- package/out/ui/packages/link/components/Link.d.ts +11 -0
- package/out/ui/packages/link/components/Link.luau +80 -0
- package/out/ui/packages/link/components/Link.styles.d.ts +8 -0
- package/out/ui/packages/link/components/Link.styles.luau +59 -0
- package/out/ui/packages/link/index.d.ts +3 -0
- package/out/ui/packages/link/init.luau +5 -0
- package/out/ui/packages/listItem/components/ListItem.d.ts +4 -1
- package/out/ui/packages/listItem/components/ListItem.luau +44 -4
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +1 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +16 -5
- package/out/ui/packages/loadingStroke/components/LoadingStroke.d.ts +7 -1
- package/out/ui/packages/loadingStroke/components/LoadingStroke.luau +23 -19
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.d.ts +11 -0
- package/out/ui/packages/loadingStroke/components/loadingStrokeSx.luau +2 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +6 -0
- package/out/ui/packages/markdown/components/Markdown.luau +221 -0
- package/out/ui/packages/markdown/components/Markdown.styles.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.styles.luau +101 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.d.ts +16 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.luau +315 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.d.ts +6 -0
- package/out/ui/packages/markdown/components/MarkdownEditor.styles.luau +132 -0
- package/out/ui/packages/markdown/htmlToMarkdown.d.ts +2 -0
- package/out/ui/packages/markdown/htmlToMarkdown.luau +350 -0
- package/out/ui/packages/markdown/index.d.ts +8 -0
- package/out/ui/packages/markdown/init.luau +11 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +42 -0
- package/out/ui/packages/markdown/parseMarkdown.luau +459 -0
- package/out/ui/packages/menu/components/Menu.d.ts +7 -1
- package/out/ui/packages/menu/components/Menu.luau +68 -26
- package/out/ui/packages/menu/components/Menu.styles.luau +5 -1
- package/out/ui/packages/modal/components/Modal.d.ts +2 -1
- package/out/ui/packages/modal/components/Modal.luau +79 -37
- package/out/ui/packages/motion/index.d.ts +1 -1
- package/out/ui/packages/motion/init.luau +1 -0
- package/out/ui/packages/motion/unit.d.ts +5 -0
- package/out/ui/packages/motion/unit.luau +23 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +2 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +16 -3
- package/out/ui/packages/numberInput/components/numberValue.d.ts +1 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +45 -0
- package/out/ui/packages/numberRangeEditor/components/NumberRangeEditor.luau +12 -16
- package/out/ui/packages/pagination/components/Pagination.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.luau +62 -38
- package/out/ui/packages/pagination/components/Pagination.styles.d.ts +6 -1
- package/out/ui/packages/pagination/components/Pagination.styles.luau +36 -4
- package/out/ui/packages/pagination/components/pageRange.d.ts +2 -1
- package/out/ui/packages/pagination/components/pageRange.luau +91 -8
- package/out/ui/packages/pagination/index.d.ts +1 -0
- package/out/ui/packages/pagination/init.luau +1 -0
- package/out/ui/packages/paper/components/Paper.d.ts +4 -2
- package/out/ui/packages/paper/components/Paper.luau +31 -9
- package/out/ui/packages/paper/components/Paper.styles.d.ts +1 -1
- package/out/ui/packages/paper/components/Paper.styles.luau +6 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +63 -38
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau +21 -7
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +2 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +14 -0
- package/out/ui/packages/popup/components/Popup.d.ts +2 -1
- package/out/ui/packages/popup/components/Popup.luau +35 -18
- package/out/ui/packages/popup/index.d.ts +1 -0
- package/out/ui/packages/popup/init.luau +1 -0
- package/out/ui/packages/preloader/components/Preloader.luau +9 -16
- package/out/ui/packages/progressBar/components/ProgressBar.luau +12 -16
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +16 -18
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.d.ts +1 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +4 -1
- package/out/ui/packages/rating/components/Rating.d.ts +11 -0
- package/out/ui/packages/rating/components/Rating.luau +97 -0
- package/out/ui/packages/rating/components/Rating.styles.d.ts +6 -0
- package/out/ui/packages/rating/components/Rating.styles.luau +44 -0
- package/out/ui/packages/rating/index.d.ts +2 -0
- package/out/ui/packages/rating/init.luau +5 -0
- package/out/ui/packages/rayEditor/components/RayEditor.luau +12 -16
- package/out/ui/packages/rectEditor/components/RectEditor.luau +86 -43
- package/out/ui/packages/rectEditor/components/RectEditor.styles.luau +30 -7
- package/out/ui/packages/select/components/Select.d.ts +5 -0
- package/out/ui/packages/select/components/Select.luau +61 -77
- package/out/ui/packages/select/components/Select.styles.luau +1 -1
- package/out/ui/packages/shadow/components/Shadow.d.ts +2 -1
- package/out/ui/packages/shadow/components/Shadow.luau +39 -17
- package/out/ui/packages/shadow/components/Shadow.styles.luau +7 -2
- package/out/ui/packages/sidebar/components/Sidebar.luau +9 -16
- package/out/ui/packages/skeleton/components/Skeleton.luau +22 -30
- package/out/ui/packages/skeleton/components/Skeleton.styles.luau +7 -2
- package/out/ui/packages/skeleton/components/skeletonMotion.luau +1 -1
- package/out/ui/packages/skeleton/components/skeletonTone.d.ts +20 -0
- package/out/ui/packages/skeleton/components/skeletonTone.luau +14 -0
- package/out/ui/packages/slider/components/Slider.d.ts +3 -0
- package/out/ui/packages/slider/components/Slider.luau +47 -19
- package/out/ui/packages/slider/components/Slider.styles.d.ts +2 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +14 -1
- package/out/ui/packages/slider/components/sliderMarks.d.ts +1 -0
- package/out/ui/packages/slider/components/sliderMarks.luau +37 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +2 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +5 -0
- package/out/ui/packages/snackbar/components/snackbarAction.d.ts +1 -0
- package/out/ui/packages/snackbar/components/snackbarAction.luau +10 -0
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +19 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +97 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +5 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +31 -0
- package/out/ui/packages/speedDial/index.d.ts +3 -0
- package/out/ui/packages/speedDial/init.luau +5 -0
- package/out/ui/packages/splitPane/components/SplitPane.luau +13 -17
- package/out/ui/packages/splitPane/components/splitLook.d.ts +1 -1
- package/out/ui/packages/stateMatrix.d.ts +2 -0
- package/out/ui/packages/stateMatrix.luau +872 -881
- package/out/ui/packages/stepper/components/Stepper.d.ts +1 -0
- package/out/ui/packages/stepper/components/Stepper.luau +16 -17
- package/out/ui/packages/stepper/components/Stepper.styles.d.ts +3 -1
- package/out/ui/packages/stepper/components/Stepper.styles.luau +6 -2
- package/out/ui/packages/switch/components/Switch.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.luau +21 -16
- package/out/ui/packages/switch/components/Switch.styles.d.ts +2 -0
- package/out/ui/packages/switch/components/Switch.styles.luau +6 -1
- package/out/ui/packages/switch/components/switchLook.d.ts +1 -1
- package/out/ui/packages/table/components/Table.d.ts +1 -0
- package/out/ui/packages/table/components/Table.luau +15 -19
- package/out/ui/packages/table/components/Table.styles.d.ts +3 -1
- package/out/ui/packages/table/components/Table.styles.luau +10 -6
- package/out/ui/packages/tabs/components/Tabs.d.ts +3 -0
- package/out/ui/packages/tabs/components/Tabs.luau +24 -19
- package/out/ui/packages/tabs/components/Tabs.styles.d.ts +5 -1
- package/out/ui/packages/tabs/components/Tabs.styles.luau +26 -10
- package/out/ui/packages/tabs/components/tabsOrientation.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabsOrientation.luau +7 -0
- package/out/ui/packages/tabs/index.d.ts +1 -0
- package/out/ui/packages/tabs/init.luau +1 -0
- package/out/ui/packages/toast/components/Toast.d.ts +2 -0
- package/out/ui/packages/toast/components/Toast.luau +41 -13
- package/out/ui/packages/toast/components/Toast.styles.luau +23 -5
- package/out/ui/packages/toggleButton/components/ToggleButton.d.ts +21 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.luau +129 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.d.ts +9 -0
- package/out/ui/packages/toggleButton/components/ToggleButton.styles.luau +69 -0
- package/out/ui/packages/toggleButton/index.d.ts +2 -0
- package/out/ui/packages/toggleButton/init.luau +7 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +9 -16
- package/out/ui/packages/treeView/components/TreeView.luau +9 -16
- package/out/ui/packages/typography/components/Typography.luau +13 -14
- package/out/ui/packages/udimEditor/components/UDimEditor.luau +12 -16
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +12 -16
- package/out/ui/packages/virtualList/components/EmptyListHint.d.ts +7 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.luau +43 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.d.ts +5 -0
- package/out/ui/packages/virtualList/components/EmptyListHint.styles.luau +26 -0
- package/out/ui/packages/virtualList/components/VirtualList.luau +9 -16
- package/out/ui/packages/virtualList/index.d.ts +2 -0
- package/out/ui/packages/virtualList/init.luau +1 -0
- package/package.json +2 -2
- package/out/ui/packages/select/components/selectMotion.d.ts +0 -2
- package/out/ui/packages/select/components/selectMotion.luau +0 -12
|
@@ -1,23 +1,106 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local function pageRange(count)
|
|
3
|
-
|
|
2
|
+
local function pageRange(count, page, siblingCount, boundaryCount)
|
|
3
|
+
if page == nil then
|
|
4
|
+
page = 1
|
|
5
|
+
end
|
|
6
|
+
if siblingCount == nil then
|
|
7
|
+
siblingCount = 1
|
|
8
|
+
end
|
|
9
|
+
if boundaryCount == nil then
|
|
10
|
+
boundaryCount = 1
|
|
11
|
+
end
|
|
12
|
+
local total = math.max(0, math.floor(count))
|
|
13
|
+
if total == 0 then
|
|
14
|
+
return {}
|
|
15
|
+
end
|
|
16
|
+
local current = math.clamp(math.floor(page), 1, total)
|
|
17
|
+
local siblings = math.max(0, math.floor(siblingCount))
|
|
18
|
+
local boundaries = math.max(0, math.floor(boundaryCount))
|
|
19
|
+
local rangeLength = boundaries * 2 + siblings * 2 + 3
|
|
20
|
+
if total <= rangeLength then
|
|
21
|
+
local all = {}
|
|
22
|
+
do
|
|
23
|
+
local i = 1
|
|
24
|
+
local _shouldIncrement = false
|
|
25
|
+
while true do
|
|
26
|
+
if _shouldIncrement then
|
|
27
|
+
i += 1
|
|
28
|
+
else
|
|
29
|
+
_shouldIncrement = true
|
|
30
|
+
end
|
|
31
|
+
if not (i <= total) then
|
|
32
|
+
break
|
|
33
|
+
end
|
|
34
|
+
local _i = i
|
|
35
|
+
table.insert(all, _i)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
return all
|
|
39
|
+
end
|
|
40
|
+
local startFrom = math.max(current - siblings, boundaries + 2)
|
|
41
|
+
local endAt = math.min(current + siblings, total - (boundaries + 1))
|
|
42
|
+
local tokens = {}
|
|
43
|
+
do
|
|
44
|
+
local i = 1
|
|
45
|
+
local _shouldIncrement = false
|
|
46
|
+
while true do
|
|
47
|
+
if _shouldIncrement then
|
|
48
|
+
i += 1
|
|
49
|
+
else
|
|
50
|
+
_shouldIncrement = true
|
|
51
|
+
end
|
|
52
|
+
if not (i <= boundaries) then
|
|
53
|
+
break
|
|
54
|
+
end
|
|
55
|
+
local _i = i
|
|
56
|
+
table.insert(tokens, _i)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
if startFrom > boundaries + 2 then
|
|
60
|
+
table.insert(tokens, "ellipsis")
|
|
61
|
+
elseif boundaries + 1 < startFrom then
|
|
62
|
+
local _arg0 = boundaries + 1
|
|
63
|
+
table.insert(tokens, _arg0)
|
|
64
|
+
end
|
|
65
|
+
do
|
|
66
|
+
local i = startFrom
|
|
67
|
+
local _shouldIncrement = false
|
|
68
|
+
while true do
|
|
69
|
+
if _shouldIncrement then
|
|
70
|
+
i += 1
|
|
71
|
+
else
|
|
72
|
+
_shouldIncrement = true
|
|
73
|
+
end
|
|
74
|
+
if not (i <= endAt) then
|
|
75
|
+
break
|
|
76
|
+
end
|
|
77
|
+
local _i = i
|
|
78
|
+
table.insert(tokens, _i)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
if endAt < total - (boundaries + 1) then
|
|
82
|
+
table.insert(tokens, "ellipsis")
|
|
83
|
+
elseif endAt + 1 < total - boundaries + 1 then
|
|
84
|
+
local _arg0 = endAt + 1
|
|
85
|
+
table.insert(tokens, _arg0)
|
|
86
|
+
end
|
|
4
87
|
do
|
|
5
|
-
local
|
|
88
|
+
local i = total - boundaries + 1
|
|
6
89
|
local _shouldIncrement = false
|
|
7
90
|
while true do
|
|
8
91
|
if _shouldIncrement then
|
|
9
|
-
|
|
92
|
+
i += 1
|
|
10
93
|
else
|
|
11
94
|
_shouldIncrement = true
|
|
12
95
|
end
|
|
13
|
-
if not (
|
|
96
|
+
if not (i <= total) then
|
|
14
97
|
break
|
|
15
98
|
end
|
|
16
|
-
local
|
|
17
|
-
table.insert(
|
|
99
|
+
local _i = i
|
|
100
|
+
table.insert(tokens, _i)
|
|
18
101
|
end
|
|
19
102
|
end
|
|
20
|
-
return
|
|
103
|
+
return tokens
|
|
21
104
|
end
|
|
22
105
|
return {
|
|
23
106
|
pageRange = pageRange,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
-
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
3
|
+
export type PaperElevation = "flat" | "raised" | "outlined";
|
|
3
4
|
export interface PaperProps {
|
|
4
5
|
elevation?: PaperElevation;
|
|
6
|
+
square?: boolean;
|
|
5
7
|
children?: React.ReactNode;
|
|
6
8
|
}
|
|
7
|
-
declare function Paper(props: PaperProps): JSX.Element;
|
|
9
|
+
declare function Paper(props: CustomizedProps<Frame, PaperProps>): JSX.Element;
|
|
8
10
|
export default Paper;
|
|
@@ -1,6 +1,8 @@
|
|
|
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
|
+
local Shadow = TS.import(script, script.Parent.Parent.Parent, "shadow").Shadow
|
|
4
6
|
local usePaperStyles = TS.import(script, script.Parent, "Paper.styles").default
|
|
5
7
|
local function Paper(props)
|
|
6
8
|
local _binding = props
|
|
@@ -8,22 +10,42 @@ local function Paper(props)
|
|
|
8
10
|
if elevation == nil then
|
|
9
11
|
elevation = "flat"
|
|
10
12
|
end
|
|
13
|
+
local square = _binding.square
|
|
11
14
|
local children = _binding.children
|
|
15
|
+
local className = _binding.className
|
|
16
|
+
local sx = _binding.sx
|
|
17
|
+
local id = _binding.id
|
|
18
|
+
local ref = _binding.ref
|
|
12
19
|
local styles = usePaperStyles({
|
|
13
20
|
elevation = elevation,
|
|
14
21
|
})
|
|
15
|
-
local _attributes = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_attributes[_k] = _v
|
|
22
|
+
local _attributes = {}
|
|
23
|
+
local _condition = id
|
|
24
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
25
|
+
_condition = "Paper"
|
|
20
26
|
end
|
|
27
|
+
_attributes.key = _condition
|
|
28
|
+
_attributes.hostRef = ref
|
|
29
|
+
_attributes.base = styles.root
|
|
30
|
+
_attributes.className = className
|
|
31
|
+
_attributes.sx = sx
|
|
32
|
+
local _exp = elevation == "raised" and React.createElement(Shadow)
|
|
21
33
|
local _attributes_1 = table.clone(styles.padding)
|
|
22
34
|
setmetatable(_attributes_1, nil)
|
|
23
|
-
local
|
|
24
|
-
local
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
local _exp_1 = React.createElement("uipadding", _attributes_1)
|
|
36
|
+
local _condition_1 = square ~= true
|
|
37
|
+
if _condition_1 then
|
|
38
|
+
local _attributes_2 = table.clone(styles.corner)
|
|
39
|
+
setmetatable(_attributes_2, nil)
|
|
40
|
+
_condition_1 = React.createElement("uicorner", _attributes_2)
|
|
41
|
+
end
|
|
42
|
+
local _condition_2 = elevation == "outlined"
|
|
43
|
+
if _condition_2 then
|
|
44
|
+
local _attributes_2 = table.clone(styles.stroke)
|
|
45
|
+
setmetatable(_attributes_2, nil)
|
|
46
|
+
_condition_2 = React.createElement("uistroke", _attributes_2)
|
|
47
|
+
end
|
|
48
|
+
return React.createElement(SxHost, _attributes, _exp, _exp_1, _condition_1, _condition_2, children)
|
|
27
49
|
end
|
|
28
50
|
local default = Paper
|
|
29
51
|
return {
|
|
@@ -15,6 +15,12 @@ local usePaperStyles = componentStyles("Paper", function(theme, _param)
|
|
|
15
15
|
BackgroundColor3 = if elevation == "raised" then theme.palette.surface.elevated else theme.palette.surface.paper,
|
|
16
16
|
BorderSizePixel = 0,
|
|
17
17
|
},
|
|
18
|
+
stroke = {
|
|
19
|
+
Color = theme.palette.border,
|
|
20
|
+
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
21
|
+
Thickness = 1,
|
|
22
|
+
Transparency = 0,
|
|
23
|
+
},
|
|
18
24
|
padding = {
|
|
19
25
|
PaddingTop = UDim.new(0, theme.padding.calc(2)),
|
|
20
26
|
PaddingBottom = UDim.new(0, theme.padding.calc(2)),
|
|
@@ -1,11 +1,13 @@
|
|
|
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
|
|
4
5
|
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
5
6
|
local usePhysicalPropertiesEditorStyles = TS.import(script, script.Parent, "PhysicalPropertiesEditor.styles").default
|
|
6
7
|
local _physicalParts = TS.import(script, script.Parent, "physicalParts")
|
|
7
8
|
local patchPhysicalParts = _physicalParts.patchPhysicalParts
|
|
8
|
-
local
|
|
9
|
+
local physicalCaption = _physicalParts.physicalCaption
|
|
10
|
+
local physicalRows = _physicalParts.physicalRows
|
|
9
11
|
local function PhysicalPropertiesEditor(props)
|
|
10
12
|
local _binding = props
|
|
11
13
|
local value = _binding.value
|
|
@@ -16,68 +18,91 @@ local function PhysicalPropertiesEditor(props)
|
|
|
16
18
|
local id = _binding.id
|
|
17
19
|
local ref = _binding.ref
|
|
18
20
|
local styles = usePhysicalPropertiesEditorStyles()
|
|
19
|
-
local amounts = {
|
|
21
|
+
local amounts = {
|
|
22
|
+
Density = value.Density,
|
|
23
|
+
Friction = value.Friction,
|
|
24
|
+
Elasticity = value.Elasticity,
|
|
25
|
+
FrictionWeight = value.FrictionWeight,
|
|
26
|
+
ElasticityWeight = value.ElasticityWeight,
|
|
27
|
+
}
|
|
20
28
|
local commit = function(field, amount)
|
|
21
29
|
local parts = patchPhysicalParts(value.Density, value.Friction, value.Elasticity, value.FrictionWeight, value.ElasticityWeight, field, amount)
|
|
22
30
|
onChange(PhysicalProperties.new(parts[1], parts[2], parts[3], parts[4], parts[5]))
|
|
23
31
|
end
|
|
24
|
-
local _attributes = {
|
|
32
|
+
local _attributes = {
|
|
33
|
+
tag = "frame",
|
|
34
|
+
}
|
|
25
35
|
local _condition = id
|
|
26
36
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
27
37
|
_condition = "PhysicalPropertiesEditor"
|
|
28
38
|
end
|
|
29
39
|
_attributes.key = _condition
|
|
30
|
-
_attributes.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
if sx then
|
|
40
|
-
for _k, _v in sx do
|
|
41
|
-
_attributes[_k] = _v
|
|
42
|
-
end
|
|
43
|
-
end
|
|
40
|
+
_attributes.hostRef = ref
|
|
41
|
+
_attributes.base = styles.root
|
|
42
|
+
_attributes.className = className
|
|
43
|
+
_attributes.sx = sx
|
|
44
|
+
_attributes.state = {
|
|
45
|
+
disabled = disabled,
|
|
46
|
+
}
|
|
44
47
|
local _attributes_1 = table.clone(styles.wrap)
|
|
45
48
|
setmetatable(_attributes_1, nil)
|
|
46
49
|
local _exp = React.createElement("uilistlayout", _attributes_1)
|
|
47
|
-
local _exp_1 =
|
|
50
|
+
local _exp_1 = physicalRows()
|
|
48
51
|
-- ▼ ReadonlyArray.map ▼
|
|
49
52
|
local _newValue = table.create(#_exp_1)
|
|
50
|
-
local _callback = function(
|
|
53
|
+
local _callback = function(row, rowIndex)
|
|
51
54
|
local _attributes_2 = {
|
|
52
|
-
key =
|
|
55
|
+
key = `Row-{rowIndex}`,
|
|
53
56
|
}
|
|
54
|
-
for _k, _v in styles.
|
|
57
|
+
for _k, _v in styles.row do
|
|
55
58
|
_attributes_2[_k] = _v
|
|
56
59
|
end
|
|
57
|
-
_attributes_2.LayoutOrder =
|
|
58
|
-
local _attributes_3 = table.clone(styles.
|
|
60
|
+
_attributes_2.LayoutOrder = rowIndex + 1
|
|
61
|
+
local _attributes_3 = table.clone(styles.pair)
|
|
59
62
|
setmetatable(_attributes_3, nil)
|
|
60
63
|
local _exp_2 = React.createElement("uilistlayout", _attributes_3)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
-- ▼ ReadonlyArray.map ▼
|
|
65
|
+
local _newValue_1 = table.create(#row)
|
|
66
|
+
local _callback_1 = function(field, index)
|
|
67
|
+
local _attributes_4 = {
|
|
68
|
+
key = field,
|
|
69
|
+
}
|
|
70
|
+
for _k, _v in styles.cell do
|
|
71
|
+
_attributes_4[_k] = _v
|
|
72
|
+
end
|
|
73
|
+
_attributes_4.LayoutOrder = index + 1
|
|
74
|
+
local _attributes_5 = table.clone(styles.stack)
|
|
75
|
+
setmetatable(_attributes_5, nil)
|
|
76
|
+
local _exp_3 = React.createElement("uilistlayout", _attributes_5)
|
|
77
|
+
local _attributes_6 = table.clone(styles.label)
|
|
78
|
+
setmetatable(_attributes_6, nil)
|
|
79
|
+
_attributes_6.Text = physicalCaption(field)
|
|
80
|
+
_attributes_6.LayoutOrder = 1
|
|
81
|
+
local _exp_4 = React.createElement("textlabel", _attributes_6)
|
|
82
|
+
local _attributes_7 = table.clone(styles.field)
|
|
83
|
+
setmetatable(_attributes_7, nil)
|
|
84
|
+
_attributes_7.LayoutOrder = 2
|
|
85
|
+
return React.createElement("frame", _attributes_4, _exp_3, _exp_4, React.createElement("frame", _attributes_7, React.createElement(NumberInput, {
|
|
86
|
+
value = amounts[field],
|
|
87
|
+
places = 4,
|
|
88
|
+
disabled = disabled,
|
|
89
|
+
width = UDim.new(1, 0),
|
|
90
|
+
onChange = function(amount)
|
|
91
|
+
return commit(field, amount)
|
|
92
|
+
end,
|
|
93
|
+
})))
|
|
94
|
+
end
|
|
95
|
+
for _k, _v in row do
|
|
96
|
+
_newValue_1[_k] = _callback_1(_v, _k - 1, row)
|
|
97
|
+
end
|
|
98
|
+
-- ▲ ReadonlyArray.map ▲
|
|
99
|
+
return React.createElement("frame", _attributes_2, _exp_2, React.createElement(React.Fragment, nil, _newValue_1))
|
|
75
100
|
end
|
|
76
101
|
for _k, _v in _exp_1 do
|
|
77
102
|
_newValue[_k] = _callback(_v, _k - 1, _exp_1)
|
|
78
103
|
end
|
|
79
104
|
-- ▲ ReadonlyArray.map ▲
|
|
80
|
-
return React.createElement(
|
|
105
|
+
return React.createElement(SxHost, _attributes, _exp, React.createElement(React.Fragment, nil, _newValue))
|
|
81
106
|
end
|
|
82
107
|
local default = PhysicalPropertiesEditor
|
|
83
108
|
return {
|
package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.styles.luau
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme")
|
|
4
|
+
local controlMetrics = _theme.controlMetrics
|
|
4
5
|
local createStyles = _theme.createStyles
|
|
5
6
|
local componentStyles = _theme.componentStyles
|
|
6
7
|
local usePhysicalPropertiesEditorStyles = componentStyles("PhysicalPropertiesEditor", function(theme)
|
|
8
|
+
local gap = theme.padding.calc(1)
|
|
7
9
|
return createStyles({
|
|
8
10
|
root = {
|
|
9
11
|
Size = UDim2.new(1, 0, 0, 0),
|
|
@@ -16,26 +18,38 @@ local usePhysicalPropertiesEditorStyles = componentStyles("PhysicalPropertiesEdi
|
|
|
16
18
|
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
17
19
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
18
20
|
},
|
|
19
|
-
|
|
21
|
+
pair = {
|
|
20
22
|
FillDirection = Enum.FillDirection.Horizontal,
|
|
21
|
-
Padding = UDim.new(0,
|
|
22
|
-
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
23
|
+
Padding = UDim.new(0, gap),
|
|
23
24
|
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
24
25
|
},
|
|
25
|
-
|
|
26
|
-
Size = UDim2.new(1, 0, 0,
|
|
26
|
+
row = {
|
|
27
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
28
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
29
|
+
BackgroundTransparency = 1,
|
|
30
|
+
},
|
|
31
|
+
cell = {
|
|
32
|
+
Size = UDim2.new(0.5, -gap / 2, 0, 0),
|
|
33
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
27
34
|
BackgroundTransparency = 1,
|
|
28
35
|
},
|
|
36
|
+
stack = {
|
|
37
|
+
FillDirection = Enum.FillDirection.Vertical,
|
|
38
|
+
Padding = UDim.new(0, theme.padding.calc(0.5)),
|
|
39
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
40
|
+
},
|
|
29
41
|
label = {
|
|
30
|
-
Size = UDim2.new(
|
|
42
|
+
Size = UDim2.new(1, 0, 0, 0),
|
|
43
|
+
AutomaticSize = Enum.AutomaticSize.Y,
|
|
31
44
|
BackgroundTransparency = 1,
|
|
32
45
|
Font = theme.typography.fontFamilies.default,
|
|
33
46
|
TextSize = theme.typography.fontSizes.caption,
|
|
34
47
|
TextColor3 = theme.palette.text.secondary,
|
|
35
48
|
TextXAlignment = Enum.TextXAlignment.Left,
|
|
49
|
+
TextTruncate = Enum.TextTruncate.AtEnd,
|
|
36
50
|
},
|
|
37
51
|
field = {
|
|
38
|
-
Size = UDim2.new(1,
|
|
52
|
+
Size = UDim2.new(1, 0, 0, controlMetrics(theme.density).height),
|
|
39
53
|
BackgroundTransparency = 1,
|
|
40
54
|
},
|
|
41
55
|
})
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export type PhysicalField = "Density" | "Friction" | "Elasticity" | "FrictionWeight" | "ElasticityWeight";
|
|
2
2
|
export declare function physicalFields(): PhysicalField[];
|
|
3
|
+
export declare function physicalCaption(field: PhysicalField): "Density" | "Friction" | "Elasticity" | "Friction wt" | "Elasticity wt";
|
|
4
|
+
export declare function physicalRows(): PhysicalField[][];
|
|
3
5
|
export declare function patchPhysicalParts(density: number, friction: number, elasticity: number, frictionWeight: number, elasticityWeight: number, field: PhysicalField, amount: number): number[];
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
local function physicalFields()
|
|
3
3
|
return { "Density", "Friction", "Elasticity", "FrictionWeight", "ElasticityWeight" }
|
|
4
4
|
end
|
|
5
|
+
local function physicalCaption(field)
|
|
6
|
+
if field == "FrictionWeight" then
|
|
7
|
+
return "Friction wt"
|
|
8
|
+
end
|
|
9
|
+
if field == "ElasticityWeight" then
|
|
10
|
+
return "Elasticity wt"
|
|
11
|
+
end
|
|
12
|
+
return field
|
|
13
|
+
end
|
|
14
|
+
local function physicalRows()
|
|
15
|
+
return { { "Density", "Friction" }, { "Elasticity", "FrictionWeight" }, { "ElasticityWeight" } }
|
|
16
|
+
end
|
|
5
17
|
local function patchPhysicalParts(density, friction, elasticity, frictionWeight, elasticityWeight, field, amount)
|
|
6
18
|
local parts = { density, friction, elasticity, frictionWeight, elasticityWeight }
|
|
7
19
|
local index = if field == "Density" then 0 elseif field == "Friction" then 1 elseif field == "Elasticity" then 2 elseif field == "FrictionWeight" then 3 else 4
|
|
@@ -10,5 +22,7 @@ local function patchPhysicalParts(density, friction, elasticity, frictionWeight,
|
|
|
10
22
|
end
|
|
11
23
|
return {
|
|
12
24
|
physicalFields = physicalFields,
|
|
25
|
+
physicalCaption = physicalCaption,
|
|
26
|
+
physicalRows = physicalRows,
|
|
13
27
|
patchPhysicalParts = patchPhysicalParts,
|
|
14
28
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "@rbxts/react";
|
|
2
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
3
|
export interface PopupProps {
|
|
3
4
|
anchor?: GuiObject;
|
|
4
5
|
/** Content height. Flips above the anchor and caps the shell. */
|
|
@@ -9,5 +10,5 @@ export interface PopupProps {
|
|
|
9
10
|
onInput?: (input: InputObject) => void;
|
|
10
11
|
children?: React.ReactNode;
|
|
11
12
|
}
|
|
12
|
-
declare function Popup(props: PopupProps): JSX.Element | undefined;
|
|
13
|
+
declare function Popup(props: CustomizedProps<Frame, PopupProps>): JSX.Element | undefined;
|
|
13
14
|
export default Popup;
|
|
@@ -5,6 +5,7 @@ local React = _react
|
|
|
5
5
|
local useEffect = _react.useEffect
|
|
6
6
|
local useRef = _react.useRef
|
|
7
7
|
local useState = _react.useState
|
|
8
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
8
9
|
local popupPlacement = TS.import(script, script.Parent, "placement").popupPlacement
|
|
9
10
|
local Portal = TS.import(script, script.Parent, "Portal").default
|
|
10
11
|
local portalTarget = TS.import(script, script.Parent, "portalTarget").portalTarget
|
|
@@ -16,6 +17,10 @@ local function Popup(props)
|
|
|
16
17
|
local onDismiss = _binding.onDismiss
|
|
17
18
|
local onInput = _binding.onInput
|
|
18
19
|
local children = _binding.children
|
|
20
|
+
local className = _binding.className
|
|
21
|
+
local sx = _binding.sx
|
|
22
|
+
local id = _binding.id
|
|
23
|
+
local ref = _binding.ref
|
|
19
24
|
local dismiss = useRef(onDismiss)
|
|
20
25
|
dismiss.current = onDismiss
|
|
21
26
|
local _, bump = useState(0)
|
|
@@ -88,14 +93,7 @@ local function Popup(props)
|
|
|
88
93
|
end
|
|
89
94
|
local place = popupPlacement(_exp, _exp_1, _exp_2, _exp_3, _exp_4, _exp_5, _exp_6, _exp_7, _condition, _condition_1)
|
|
90
95
|
local capped = place.height > 0
|
|
91
|
-
|
|
92
|
-
host = layer,
|
|
93
|
-
}, React.createElement("frame", {
|
|
94
|
-
key = "Popup",
|
|
95
|
-
Size = UDim2.fromScale(1, 1),
|
|
96
|
-
BackgroundTransparency = 1,
|
|
97
|
-
ZIndex = 20000,
|
|
98
|
-
}, onDismiss and (React.createElement("textbutton", {
|
|
96
|
+
local _exp_8 = onDismiss and (React.createElement("textbutton", {
|
|
99
97
|
key = "Backdrop",
|
|
100
98
|
Size = UDim2.fromScale(1, 1),
|
|
101
99
|
BackgroundTransparency = 1,
|
|
@@ -113,17 +111,36 @@ local function Popup(props)
|
|
|
113
111
|
return _result
|
|
114
112
|
end,
|
|
115
113
|
},
|
|
116
|
-
}))
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
}))
|
|
115
|
+
local _attributes = {
|
|
116
|
+
tag = "frame",
|
|
117
|
+
}
|
|
118
|
+
local _condition_2 = id
|
|
119
|
+
if not (_condition_2 ~= 0 and _condition_2 == _condition_2 and _condition_2 ~= "" and _condition_2) then
|
|
120
|
+
_condition_2 = "Content"
|
|
121
|
+
end
|
|
122
|
+
_attributes.key = _condition_2
|
|
123
|
+
_attributes.hostRef = ref
|
|
124
|
+
_attributes.base = {
|
|
123
125
|
BackgroundTransparency = 1,
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
126
|
+
}
|
|
127
|
+
_attributes.className = className
|
|
128
|
+
_attributes.sx = sx
|
|
129
|
+
_attributes.Position = UDim2.fromOffset(place.x, place.y)
|
|
130
|
+
_attributes.AnchorPoint = Vector2.new(0, if place.above then 1 else 0)
|
|
131
|
+
_attributes.Size = if capped then UDim2.fromOffset(place.width, place.height) else UDim2.fromOffset(place.width, 0)
|
|
132
|
+
_attributes.AutomaticSize = if capped then Enum.AutomaticSize.None else Enum.AutomaticSize.Y
|
|
133
|
+
_attributes.ClipsDescendants = capped
|
|
134
|
+
_attributes.Active = false
|
|
135
|
+
_attributes.ZIndex = 20001
|
|
136
|
+
return React.createElement(Portal, {
|
|
137
|
+
host = layer,
|
|
138
|
+
}, React.createElement("frame", {
|
|
139
|
+
key = "Popup",
|
|
140
|
+
Size = UDim2.fromScale(1, 1),
|
|
141
|
+
BackgroundTransparency = 1,
|
|
142
|
+
ZIndex = 20000,
|
|
143
|
+
}, _exp_8, React.createElement(SxHost, _attributes, children)))
|
|
127
144
|
end
|
|
128
145
|
local default = Popup
|
|
129
146
|
return {
|
|
@@ -2,3 +2,4 @@ export { default as Popup } from "./components/Popup";
|
|
|
2
2
|
export { PopupProps } from "./components/Popup";
|
|
3
3
|
export { default as Portal } from "./components/Portal";
|
|
4
4
|
export { PortalProps } from "./components/Portal";
|
|
5
|
+
export { portalTarget } from "./components/portalTarget";
|
|
@@ -3,4 +3,5 @@ local TS = _G[script]
|
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Popup = TS.import(script, script, "components", "Popup").default
|
|
5
5
|
exports.Portal = TS.import(script, script, "components", "Portal").default
|
|
6
|
+
exports.portalTarget = TS.import(script, script, "components", "portalTarget").portalTarget
|
|
6
7
|
return exports
|
|
@@ -9,6 +9,7 @@ local _pretty_react_hooks = TS.import(script, TS.getModule(script, "@rbxts", "pr
|
|
|
9
9
|
local useAsyncEffect = _pretty_react_hooks.useAsyncEffect
|
|
10
10
|
local useDeferState = _pretty_react_hooks.useDeferState
|
|
11
11
|
local ContentProvider = TS.import(script, TS.getModule(script, "@rbxts", "services")).ContentProvider
|
|
12
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
12
13
|
local ProgressBar = TS.import(script, script.Parent.Parent.Parent, "progressBar").ProgressBar
|
|
13
14
|
local usePreloaderStyles = TS.import(script, script.Parent, "Preloader.styles").default
|
|
14
15
|
local function Preloader(props)
|
|
@@ -103,26 +104,18 @@ local function Preloader(props)
|
|
|
103
104
|
children = children,
|
|
104
105
|
})
|
|
105
106
|
else
|
|
106
|
-
local _attributes = {
|
|
107
|
+
local _attributes = {
|
|
108
|
+
tag = "frame",
|
|
109
|
+
}
|
|
107
110
|
local _condition = id
|
|
108
111
|
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
109
112
|
_condition = "Preloader"
|
|
110
113
|
end
|
|
111
114
|
_attributes.key = _condition
|
|
112
|
-
_attributes.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if className then
|
|
117
|
-
for _k, _v in className do
|
|
118
|
-
_attributes[_k] = _v
|
|
119
|
-
end
|
|
120
|
-
end
|
|
121
|
-
if sx then
|
|
122
|
-
for _k, _v in sx do
|
|
123
|
-
_attributes[_k] = _v
|
|
124
|
-
end
|
|
125
|
-
end
|
|
115
|
+
_attributes.hostRef = ref
|
|
116
|
+
_attributes.base = container
|
|
117
|
+
_attributes.className = className
|
|
118
|
+
_attributes.sx = sx
|
|
126
119
|
local _exp = Adornment ~= nil and React.createElement(Adornment, {
|
|
127
120
|
progress = percentage,
|
|
128
121
|
})
|
|
@@ -142,7 +135,7 @@ local function Preloader(props)
|
|
|
142
135
|
progress = percentage,
|
|
143
136
|
})))
|
|
144
137
|
end
|
|
145
|
-
_result = (React.createElement(
|
|
138
|
+
_result = (React.createElement(SxHost, _attributes, _exp, _condition_1, _condition_2))
|
|
146
139
|
end
|
|
147
140
|
return React.createElement(React.Fragment, nil, _result)
|
|
148
141
|
end
|