@rbxts/uiblox 0.2.0-alpha.35 → 0.2.0-alpha.37
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/out/theme/styles/utilities/focusRing.d.ts +5 -0
- package/out/theme/styles/utilities/focusRing.luau +11 -0
- package/out/theme/styles/utilities/index.d.ts +1 -0
- package/out/theme/styles/utilities/init.luau +1 -0
- package/out/theme/styles/utilities/resolveSx.d.ts +6 -1
- package/out/theme/styles/utilities/resolveSx.luau +53 -12
- package/out/ui/packages/accordion/components/Accordion.d.ts +1 -0
- package/out/ui/packages/accordion/components/Accordion.luau +55 -19
- package/out/ui/packages/accordion/components/Accordion.styles.luau +49 -29
- package/out/ui/packages/accordion/components/accordionNote.d.ts +2 -0
- package/out/ui/packages/accordion/components/accordionNote.luau +11 -0
- package/out/ui/packages/alert/components/Alert.d.ts +2 -0
- package/out/ui/packages/alert/components/Alert.luau +24 -1
- package/out/ui/packages/alert/components/Alert.styles.luau +11 -0
- package/out/ui/packages/alert/components/alertAction.d.ts +2 -0
- package/out/ui/packages/alert/components/alertAction.luau +11 -0
- package/out/ui/packages/appBar/components/AppBar.d.ts +1 -0
- package/out/ui/packages/appBar/components/AppBar.luau +59 -15
- package/out/ui/packages/appBar/components/AppBar.styles.luau +24 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.d.ts +2 -0
- package/out/ui/packages/appBar/components/appBarSubtitle.luau +11 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.d.ts +14 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.luau +102 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.d.ts +6 -0
- package/out/ui/packages/avatarGroup/components/AvatarGroup.styles.luau +50 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.d.ts +2 -0
- package/out/ui/packages/avatarGroup/components/avatarGroupCut.luau +11 -0
- package/out/ui/packages/avatarGroup/index.d.ts +3 -0
- package/out/ui/packages/avatarGroup/init.luau +6 -0
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.d.ts +4 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.luau +19 -1
- package/out/ui/packages/bottomNavigation/components/BottomNavigation.styles.luau +20 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.d.ts +2 -0
- package/out/ui/packages/bottomNavigation/components/navBadge.luau +14 -0
- package/out/ui/packages/bottomNavigation/index.d.ts +1 -1
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.luau +16 -5
- package/out/ui/packages/breadcrumbs/components/Breadcrumbs.styles.luau +6 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.d.ts +2 -0
- package/out/ui/packages/breadcrumbs/components/breadcrumbItems.luau +8 -0
- package/out/ui/packages/button/components/Button.d.ts +2 -0
- package/out/ui/packages/button/components/Button.luau +59 -10
- package/out/ui/packages/button/components/Button.styles.luau +2 -0
- package/out/ui/packages/button/components/buttonLook.d.ts +2 -0
- package/out/ui/packages/button/components/buttonLook.luau +11 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.d.ts +13 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.luau +102 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.d.ts +5 -0
- package/out/ui/packages/buttonGroup/components/ButtonGroup.styles.luau +57 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.d.ts +2 -0
- package/out/ui/packages/buttonGroup/components/buttonGroupEdge.luau +16 -0
- package/out/ui/packages/buttonGroup/index.d.ts +3 -0
- package/out/ui/packages/buttonGroup/init.luau +6 -0
- package/out/ui/packages/card/components/Card.d.ts +1 -0
- package/out/ui/packages/card/components/Card.luau +21 -2
- package/out/ui/packages/card/components/Card.styles.d.ts +3 -1
- package/out/ui/packages/card/components/Card.styles.luau +16 -7
- package/out/ui/packages/card/components/cardWidth.d.ts +10 -0
- package/out/ui/packages/card/components/cardWidth.luau +36 -0
- package/out/ui/packages/cframeEditor/components/CFrameEditor.luau +9 -4
- package/out/ui/packages/cframeEditor/components/CFrameEditor.styles.luau +10 -1
- package/out/ui/packages/cframeEditor/components/cframeValue.d.ts +1 -0
- package/out/ui/packages/cframeEditor/components/cframeValue.luau +13 -0
- package/out/ui/packages/checkbox/components/Checkbox.luau +2 -1
- package/out/ui/packages/checkbox/components/Checkbox.styles.luau +2 -0
- package/out/ui/packages/chip/components/Chip.styles.d.ts +2 -1
- package/out/ui/packages/chip/components/Chip.styles.luau +9 -6
- package/out/ui/packages/chip/components/chipTone.d.ts +3 -0
- package/out/ui/packages/chip/components/chipTone.luau +11 -0
- package/out/ui/packages/collapse/components/Collapse.d.ts +8 -0
- package/out/ui/packages/collapse/components/Collapse.luau +34 -0
- package/out/ui/packages/collapse/components/Collapse.styles.d.ts +2 -0
- package/out/ui/packages/collapse/components/Collapse.styles.luau +20 -0
- package/out/ui/packages/collapse/components/collapseOpen.d.ts +1 -0
- package/out/ui/packages/collapse/components/collapseOpen.luau +7 -0
- package/out/ui/packages/collapse/index.d.ts +3 -0
- package/out/ui/packages/collapse/init.luau +6 -0
- package/out/ui/packages/colorPicker/components/ColorSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/NumberSequenceEditor.luau +4 -2
- package/out/ui/packages/colorPicker/components/sequenceValue.d.ts +2 -0
- package/out/ui/packages/colorPicker/components/sequenceValue.luau +8 -0
- package/out/ui/packages/colorPicker/index.d.ts +1 -1
- package/out/ui/packages/colorPicker/init.luau +2 -0
- package/out/ui/packages/copyButton/components/CopyButton.d.ts +8 -0
- package/out/ui/packages/copyButton/components/CopyButton.luau +32 -0
- package/out/ui/packages/copyButton/components/copyInvoke.d.ts +2 -0
- package/out/ui/packages/copyButton/components/copyInvoke.luau +12 -0
- package/out/ui/packages/copyButton/index.d.ts +3 -0
- package/out/ui/packages/copyButton/init.luau +6 -0
- package/out/ui/packages/cover/components/Cover.d.ts +8 -0
- package/out/ui/packages/cover/components/Cover.luau +47 -0
- package/out/ui/packages/cover/components/coverFill.d.ts +2 -0
- package/out/ui/packages/cover/components/coverFill.luau +14 -0
- package/out/ui/packages/cover/index.d.ts +3 -0
- package/out/ui/packages/cover/init.luau +6 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.d.ts +3 -0
- package/out/ui/packages/dateRange/components/DateRangePicker.luau +167 -88
- package/out/ui/packages/dateRange/dateRangeValue.d.ts +5 -0
- package/out/ui/packages/dateRange/dateRangeValue.luau +34 -0
- package/out/ui/packages/dateRange/index.d.ts +1 -1
- package/out/ui/packages/dateRange/init.luau +3 -0
- package/out/ui/packages/dialog/components/Dialog.d.ts +1 -0
- package/out/ui/packages/dialog/components/Dialog.luau +55 -6
- package/out/ui/packages/dialog/components/Dialog.styles.luau +5 -3
- package/out/ui/packages/dialog/components/dialogWidth.d.ts +7 -0
- package/out/ui/packages/dialog/components/dialogWidth.luau +35 -0
- package/out/ui/packages/divider/components/Divider.luau +57 -12
- package/out/ui/packages/divider/components/dividerLabel.d.ts +2 -0
- package/out/ui/packages/divider/components/dividerLabel.luau +11 -0
- package/out/ui/packages/drawer/components/Drawer.d.ts +1 -0
- package/out/ui/packages/drawer/components/Drawer.luau +18 -3
- package/out/ui/packages/drawer/components/drawerPlacement.d.ts +13 -1
- package/out/ui/packages/drawer/components/drawerPlacement.luau +28 -0
- package/out/ui/packages/fab/components/fabSize.d.ts +1 -1
- package/out/ui/packages/iconButton/components/IconButton.d.ts +2 -0
- package/out/ui/packages/iconButton/components/IconButton.luau +37 -3
- package/out/ui/packages/iconButton/components/transportGlyph.d.ts +9 -0
- package/out/ui/packages/iconButton/components/transportGlyph.luau +73 -0
- package/out/ui/packages/imageList/components/ImageList.d.ts +4 -0
- package/out/ui/packages/imageList/components/ImageList.luau +57 -11
- package/out/ui/packages/imageList/components/ImageList.styles.d.ts +1 -0
- package/out/ui/packages/imageList/components/ImageList.styles.luau +16 -10
- package/out/ui/packages/imageList/components/imageListLayout.d.ts +10 -0
- package/out/ui/packages/imageList/components/imageListLayout.luau +44 -0
- package/out/ui/packages/index.d.ts +12 -0
- package/out/ui/packages/init.luau +36 -0
- package/out/ui/packages/input/components/Input.d.ts +4 -0
- package/out/ui/packages/input/components/Input.luau +29 -9
- package/out/ui/packages/input/components/Input.styles.d.ts +1 -0
- package/out/ui/packages/input/components/Input.styles.luau +42 -12
- package/out/ui/packages/input/components/clampText.d.ts +2 -0
- package/out/ui/packages/input/components/clampText.luau +16 -0
- package/out/ui/packages/input/components/multilineHeight.d.ts +1 -0
- package/out/ui/packages/input/components/multilineHeight.luau +11 -0
- package/out/ui/packages/link/components/Link.luau +13 -9
- package/out/ui/packages/link/components/Link.styles.d.ts +0 -1
- package/out/ui/packages/link/components/Link.styles.luau +1 -12
- package/out/ui/packages/listItem/components/ListItem.d.ts +6 -0
- package/out/ui/packages/listItem/components/ListItem.luau +97 -39
- package/out/ui/packages/listItem/components/ListItem.styles.d.ts +3 -0
- package/out/ui/packages/listItem/components/ListItem.styles.luau +52 -30
- package/out/ui/packages/listItem/components/listItemInk.d.ts +3 -0
- package/out/ui/packages/listItem/components/listItemInk.luau +14 -0
- package/out/ui/packages/listItem/components/listItemLayout.d.ts +12 -0
- package/out/ui/packages/listItem/components/listItemLayout.luau +41 -0
- package/out/ui/packages/markdown/components/Markdown.d.ts +2 -0
- package/out/ui/packages/markdown/components/Markdown.luau +91 -6
- package/out/ui/packages/markdown/components/Markdown.styles.luau +25 -0
- package/out/ui/packages/markdown/index.d.ts +2 -2
- package/out/ui/packages/markdown/init.luau +2 -0
- package/out/ui/packages/markdown/parseMarkdown.d.ts +21 -1
- package/out/ui/packages/markdown/parseMarkdown.luau +109 -2
- package/out/ui/packages/menu/components/Menu.d.ts +3 -0
- package/out/ui/packages/menu/components/Menu.luau +68 -21
- package/out/ui/packages/menu/components/menuIcon.d.ts +6 -0
- package/out/ui/packages/menu/components/menuIcon.luau +32 -0
- package/out/ui/packages/numberInput/components/NumberInput.d.ts +1 -0
- package/out/ui/packages/numberInput/components/NumberInput.luau +67 -1
- package/out/ui/packages/numberInput/components/numberValue.d.ts +2 -0
- package/out/ui/packages/numberInput/components/numberValue.luau +10 -0
- package/out/ui/packages/pager/components/Pager.d.ts +11 -0
- package/out/ui/packages/pager/components/Pager.luau +112 -0
- package/out/ui/packages/pager/components/Pager.styles.d.ts +2 -0
- package/out/ui/packages/pager/components/Pager.styles.luau +61 -0
- package/out/ui/packages/pager/components/pagerStep.d.ts +3 -0
- package/out/ui/packages/pager/components/pagerStep.luau +24 -0
- package/out/ui/packages/pager/index.d.ts +3 -0
- package/out/ui/packages/pager/init.luau +9 -0
- package/out/ui/packages/physicalPropertiesEditor/components/PhysicalPropertiesEditor.luau +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.d.ts +5 -0
- package/out/ui/packages/physicalPropertiesEditor/components/physicalParts.luau +22 -0
- package/out/ui/packages/popover/components/Popover.d.ts +12 -0
- package/out/ui/packages/popover/components/Popover.luau +50 -0
- package/out/ui/packages/popover/components/Popover.styles.d.ts +2 -0
- package/out/ui/packages/popover/components/Popover.styles.luau +26 -0
- package/out/ui/packages/popover/index.d.ts +2 -0
- package/out/ui/packages/popover/init.luau +5 -0
- package/out/ui/packages/radioGroup/components/RadioGroup.d.ts +4 -1
- package/out/ui/packages/radioGroup/components/RadioGroup.luau +51 -8
- package/out/ui/packages/radioGroup/components/RadioGroup.styles.luau +26 -2
- package/out/ui/packages/radioGroup/components/radioHint.d.ts +2 -0
- package/out/ui/packages/radioGroup/components/radioHint.luau +11 -0
- package/out/ui/packages/radioGroup/index.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.d.ts +1 -1
- package/out/ui/packages/rating/components/Rating.luau +4 -2
- package/out/ui/packages/rating/components/ratingCommit.d.ts +2 -0
- package/out/ui/packages/rating/components/ratingCommit.luau +11 -0
- package/out/ui/packages/reorder/index.d.ts +2 -0
- package/out/ui/packages/reorder/init.luau +14 -0
- package/out/ui/packages/reorder/reorder.d.ts +24 -0
- package/out/ui/packages/reorder/reorder.luau +178 -0
- package/out/ui/packages/reorder/useReorderDrag.d.ts +15 -0
- package/out/ui/packages/reorder/useReorderDrag.luau +129 -0
- package/out/ui/packages/scroll/components/ScrollView.luau +76 -7
- package/out/ui/packages/select/components/Select.luau +18 -1
- package/out/ui/packages/select/components/Select.styles.luau +2 -5
- package/out/ui/packages/select/components/selectWidth.d.ts +2 -0
- package/out/ui/packages/select/components/selectWidth.luau +15 -0
- package/out/ui/packages/shadow/components/Shadow.luau +14 -2
- package/out/ui/packages/slider/components/RangeSlider.d.ts +16 -0
- package/out/ui/packages/slider/components/RangeSlider.luau +231 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.d.ts +7 -0
- package/out/ui/packages/slider/components/RangeSlider.styles.luau +48 -0
- package/out/ui/packages/slider/components/Slider.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.luau +44 -11
- package/out/ui/packages/slider/components/Slider.styles.d.ts +1 -0
- package/out/ui/packages/slider/components/Slider.styles.luau +19 -5
- package/out/ui/packages/slider/components/rangeValue.d.ts +21 -0
- package/out/ui/packages/slider/components/rangeValue.luau +77 -0
- package/out/ui/packages/slider/components/sliderLabel.d.ts +4 -0
- package/out/ui/packages/slider/components/sliderLabel.luau +30 -0
- package/out/ui/packages/slider/index.d.ts +3 -0
- package/out/ui/packages/slider/init.luau +6 -0
- package/out/ui/packages/snackbar/components/Snackbar.d.ts +1 -0
- package/out/ui/packages/snackbar/components/Snackbar.luau +2 -0
- package/out/ui/packages/sparkline/components/Sparkline.d.ts +3 -0
- package/out/ui/packages/sparkline/components/Sparkline.luau +69 -7
- package/out/ui/packages/sparkline/index.d.ts +1 -1
- package/out/ui/packages/sparkline/init.luau +6 -1
- package/out/ui/packages/sparkline/sparklineLayout.d.ts +17 -0
- package/out/ui/packages/sparkline/sparklineLayout.luau +132 -8
- package/out/ui/packages/speedDial/components/SpeedDial.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.luau +56 -9
- package/out/ui/packages/speedDial/components/SpeedDial.styles.d.ts +1 -0
- package/out/ui/packages/speedDial/components/SpeedDial.styles.luau +45 -3
- package/out/ui/packages/speedDial/components/speedDialLabel.d.ts +4 -0
- package/out/ui/packages/speedDial/components/speedDialLabel.luau +16 -0
- package/out/ui/packages/stateMatrix.d.ts +1 -0
- package/out/ui/packages/stateMatrix.luau +9 -0
- package/out/ui/packages/stepper/components/Stepper.d.ts +2 -0
- package/out/ui/packages/stepper/components/Stepper.luau +35 -7
- package/out/ui/packages/stepper/components/Stepper.styles.luau +3 -0
- package/out/ui/packages/stepper/components/stepState.d.ts +4 -2
- package/out/ui/packages/stepper/components/stepState.luau +12 -1
- package/out/ui/packages/stepper/index.d.ts +1 -1
- package/out/ui/packages/stepper/init.luau +3 -1
- package/out/ui/packages/switch/components/Switch.styles.luau +2 -5
- package/out/ui/packages/table/components/Table.luau +8 -5
- package/out/ui/packages/table/components/tableSort.d.ts +2 -0
- package/out/ui/packages/table/components/tableSort.luau +95 -0
- package/out/ui/packages/table/index.d.ts +1 -0
- package/out/ui/packages/table/init.luau +1 -0
- package/out/ui/packages/tabs/components/Tabs.luau +70 -2
- package/out/ui/packages/tabs/components/tabScroll.d.ts +2 -0
- package/out/ui/packages/tabs/components/tabScroll.luau +18 -0
- package/out/ui/packages/text/components/Text.d.ts +7 -0
- package/out/ui/packages/text/components/Text.luau +54 -0
- package/out/ui/packages/text/components/textBox.d.ts +12 -0
- package/out/ui/packages/text/components/textBox.luau +21 -0
- package/out/ui/packages/text/index.d.ts +2 -0
- package/out/ui/packages/text/init.luau +5 -0
- package/out/ui/packages/timeField/components/TimeField.d.ts +13 -0
- package/out/ui/packages/timeField/components/TimeField.luau +102 -0
- package/out/ui/packages/timeField/index.d.ts +4 -0
- package/out/ui/packages/timeField/init.luau +9 -0
- package/out/ui/packages/timeField/timeValue.d.ts +8 -0
- package/out/ui/packages/timeField/timeValue.luau +49 -0
- package/out/ui/packages/timeline/components/Timeline.d.ts +12 -0
- package/out/ui/packages/timeline/components/Timeline.luau +99 -0
- package/out/ui/packages/timeline/components/Timeline.styles.d.ts +2 -0
- package/out/ui/packages/timeline/components/Timeline.styles.luau +106 -0
- package/out/ui/packages/timeline/components/timelineRail.d.ts +4 -0
- package/out/ui/packages/timeline/components/timelineRail.luau +15 -0
- package/out/ui/packages/timeline/index.d.ts +3 -0
- package/out/ui/packages/timeline/init.luau +8 -0
- package/out/ui/packages/toast/components/Toast.d.ts +1 -0
- package/out/ui/packages/toast/components/Toast.luau +59 -12
- package/out/ui/packages/toast/components/Toast.styles.luau +6 -3
- package/out/ui/packages/toast/components/toastPlace.d.ts +12 -0
- package/out/ui/packages/toast/components/toastPlace.luau +31 -0
- package/out/ui/packages/tooltip/components/Tooltip.d.ts +1 -0
- package/out/ui/packages/tooltip/components/Tooltip.luau +109 -31
- package/out/ui/packages/tooltip/components/Tooltip.styles.luau +30 -0
- package/out/ui/packages/tooltip/components/tooltipBox.d.ts +4 -0
- package/out/ui/packages/tooltip/components/tooltipBox.luau +12 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.d.ts +2 -0
- package/out/ui/packages/tooltip/components/tooltipPointer.luau +11 -0
- package/out/ui/packages/vectorEditor/components/VectorEditor.luau +1 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.d.ts +24 -0
- package/out/ui/packages/weekGrid/components/WeekGrid.luau +187 -0
- package/out/ui/packages/weekGrid/components/weekColumns.d.ts +9 -0
- package/out/ui/packages/weekGrid/components/weekColumns.luau +25 -0
- package/out/ui/packages/weekGrid/index.d.ts +3 -0
- package/out/ui/packages/weekGrid/init.luau +8 -0
- package/package.json +67 -69
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
|
-
local function stepState(index, activeStep)
|
|
2
|
+
local function stepState(index, activeStep, errorStep)
|
|
3
|
+
if errorStep ~= nil and index == errorStep then
|
|
4
|
+
return "error"
|
|
5
|
+
end
|
|
3
6
|
if index < activeStep then
|
|
4
7
|
return "complete"
|
|
5
8
|
end
|
|
@@ -8,6 +11,14 @@ local function stepState(index, activeStep)
|
|
|
8
11
|
end
|
|
9
12
|
return "pending"
|
|
10
13
|
end
|
|
14
|
+
--* Completed and current steps can be pressed. A later step cannot.
|
|
15
|
+
local function stepPress(index, activeStep)
|
|
16
|
+
if index < 0 or index > activeStep then
|
|
17
|
+
return nil
|
|
18
|
+
end
|
|
19
|
+
return index
|
|
20
|
+
end
|
|
11
21
|
return {
|
|
12
22
|
stepState = stepState,
|
|
23
|
+
stepPress = stepPress,
|
|
13
24
|
}
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
local TS = _G[script]
|
|
3
3
|
local exports = {}
|
|
4
4
|
exports.Stepper = TS.import(script, script, "components", "Stepper").default
|
|
5
|
-
|
|
5
|
+
local _stepState = TS.import(script, script, "components", "stepState")
|
|
6
|
+
exports.stepPress = _stepState.stepPress
|
|
7
|
+
exports.stepState = _stepState.stepState
|
|
6
8
|
return exports
|
|
@@ -4,6 +4,7 @@ local _theme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "the
|
|
|
4
4
|
local controlMetrics = _theme.controlMetrics
|
|
5
5
|
local createStyles = _theme.createStyles
|
|
6
6
|
local componentStyles = _theme.componentStyles
|
|
7
|
+
local focusRing = _theme.focusRing
|
|
7
8
|
local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
8
9
|
local size = _param.size
|
|
9
10
|
local color = _param.color
|
|
@@ -54,11 +55,7 @@ local useSwitchStyles = componentStyles("Switch", function(theme, _param)
|
|
|
54
55
|
corner = {
|
|
55
56
|
CornerRadius = UDim.new(theme.shape.pillScale, 0),
|
|
56
57
|
},
|
|
57
|
-
stroke =
|
|
58
|
-
Color = theme.palette.focus,
|
|
59
|
-
Thickness = 2,
|
|
60
|
-
ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
|
|
61
|
-
},
|
|
58
|
+
stroke = focusRing(theme.palette.focus),
|
|
62
59
|
})
|
|
63
60
|
end)
|
|
64
61
|
local default = useSwitchStyles
|
|
@@ -4,6 +4,7 @@ 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 SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
6
|
local rowSelected = TS.import(script, script.Parent, "rowSelected").rowSelected
|
|
7
|
+
local sortedRowOrder = TS.import(script, script.Parent, "tableSort").sortedRowOrder
|
|
7
8
|
local _tableColumns = TS.import(script, script.Parent, "tableColumns")
|
|
8
9
|
local canSort = _tableColumns.canSort
|
|
9
10
|
local columnSizes = _tableColumns.columnSizes
|
|
@@ -48,6 +49,7 @@ local function Table(props)
|
|
|
48
49
|
-- ▲ ReadonlyArray.map ▲
|
|
49
50
|
local resolved = _newValue
|
|
50
51
|
local sizes = columnSizes(resolved)
|
|
52
|
+
local order = sortedRowOrder(rows, sortColumn, sortDirection)
|
|
51
53
|
local _attributes = {
|
|
52
54
|
tag = "frame",
|
|
53
55
|
}
|
|
@@ -144,15 +146,16 @@ local function Table(props)
|
|
|
144
146
|
-- ▲ ReadonlyArray.map ▲
|
|
145
147
|
local _exp_4 = React.createElement("frame", _attributes_3, _exp_2, _exp_3, React.createElement(React.Fragment, nil, _newValue_1))
|
|
146
148
|
-- ▼ ReadonlyArray.map ▼
|
|
147
|
-
local _newValue_2 = table.create(#
|
|
148
|
-
local _callback_2 = function(
|
|
149
|
+
local _newValue_2 = table.create(#order)
|
|
150
|
+
local _callback_2 = function(rowIndex, place)
|
|
151
|
+
local cells = rows[rowIndex + 1]
|
|
149
152
|
local _attributes_6 = {
|
|
150
153
|
key = `r-{rowIndex}`,
|
|
151
154
|
}
|
|
152
155
|
for _k, _v in cx(styles.row, rowSelected(rowIndex, selected) and styles.selected) do
|
|
153
156
|
_attributes_6[_k] = _v
|
|
154
157
|
end
|
|
155
|
-
_attributes_6.LayoutOrder =
|
|
158
|
+
_attributes_6.LayoutOrder = place + 1
|
|
156
159
|
_attributes_6.Event = {
|
|
157
160
|
Activated = function()
|
|
158
161
|
local _result = onRowActivated
|
|
@@ -206,8 +209,8 @@ local function Table(props)
|
|
|
206
209
|
-- ▲ ReadonlyArray.map ▲
|
|
207
210
|
return React.createElement("textbutton", _attributes_6, _exp_5, _exp_6, React.createElement(React.Fragment, nil, _newValue_3))
|
|
208
211
|
end
|
|
209
|
-
for _k, _v in
|
|
210
|
-
_newValue_2[_k] = _callback_2(_v, _k - 1,
|
|
212
|
+
for _k, _v in order do
|
|
213
|
+
_newValue_2[_k] = _callback_2(_v, _k - 1, order)
|
|
211
214
|
end
|
|
212
215
|
-- ▲ ReadonlyArray.map ▲
|
|
213
216
|
return React.createElement(SxHost, _attributes, _exp, _exp_1, _exp_4, React.createElement(React.Fragment, nil, _newValue_2))
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local function sortKey(value)
|
|
3
|
+
local _value = value
|
|
4
|
+
if type(_value) == "number" then
|
|
5
|
+
return value
|
|
6
|
+
end
|
|
7
|
+
local _value_1 = value
|
|
8
|
+
local _condition = type(_value_1) == "string"
|
|
9
|
+
if _condition then
|
|
10
|
+
_condition = value ~= ""
|
|
11
|
+
end
|
|
12
|
+
if _condition then
|
|
13
|
+
local numeric = tonumber(value)
|
|
14
|
+
if numeric ~= nil then
|
|
15
|
+
return numeric
|
|
16
|
+
end
|
|
17
|
+
return value
|
|
18
|
+
end
|
|
19
|
+
return ""
|
|
20
|
+
end
|
|
21
|
+
local function keyBefore(left, right)
|
|
22
|
+
local _left = left
|
|
23
|
+
local _condition = type(_left) == "number"
|
|
24
|
+
if _condition then
|
|
25
|
+
local _right = right
|
|
26
|
+
_condition = type(_right) == "number"
|
|
27
|
+
end
|
|
28
|
+
if _condition then
|
|
29
|
+
return left < right
|
|
30
|
+
end
|
|
31
|
+
local _left_1 = left
|
|
32
|
+
local leftText = if type(_left_1) == "number" then `{left}` else left
|
|
33
|
+
local _right = right
|
|
34
|
+
local rightText = if type(_right) == "number" then `{right}` else right
|
|
35
|
+
return leftText < rightText
|
|
36
|
+
end
|
|
37
|
+
local function rowBefore(rows, left, right, column, desc)
|
|
38
|
+
local leftKey = sortKey(rows[left + 1][column + 1])
|
|
39
|
+
local rightKey = sortKey(rows[right + 1][column + 1])
|
|
40
|
+
if leftKey == rightKey then
|
|
41
|
+
return false
|
|
42
|
+
end
|
|
43
|
+
local before = keyBefore(leftKey, rightKey)
|
|
44
|
+
return if desc then not before else before
|
|
45
|
+
end
|
|
46
|
+
--* Source indexes in sort order. Ties keep the original row order.
|
|
47
|
+
local function sortedRowOrder(rows, column, direction)
|
|
48
|
+
local count = #rows
|
|
49
|
+
local order = {}
|
|
50
|
+
do
|
|
51
|
+
local index = 0
|
|
52
|
+
local _shouldIncrement = false
|
|
53
|
+
while true do
|
|
54
|
+
if _shouldIncrement then
|
|
55
|
+
index += 1
|
|
56
|
+
else
|
|
57
|
+
_shouldIncrement = true
|
|
58
|
+
end
|
|
59
|
+
if not (index < count) then
|
|
60
|
+
break
|
|
61
|
+
end
|
|
62
|
+
local _index = index
|
|
63
|
+
table.insert(order, _index)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
if column == nil then
|
|
67
|
+
return order
|
|
68
|
+
end
|
|
69
|
+
local desc = direction == "desc"
|
|
70
|
+
do
|
|
71
|
+
local index = 1
|
|
72
|
+
local _shouldIncrement = false
|
|
73
|
+
while true do
|
|
74
|
+
if _shouldIncrement then
|
|
75
|
+
index += 1
|
|
76
|
+
else
|
|
77
|
+
_shouldIncrement = true
|
|
78
|
+
end
|
|
79
|
+
if not (index < count) then
|
|
80
|
+
break
|
|
81
|
+
end
|
|
82
|
+
local current = order[index + 1]
|
|
83
|
+
local slot = index
|
|
84
|
+
while slot > 0 and rowBefore(rows, current, order[slot], column, desc) do
|
|
85
|
+
order[slot + 1] = order[slot]
|
|
86
|
+
slot -= 1
|
|
87
|
+
end
|
|
88
|
+
order[slot + 1] = current
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
return order
|
|
92
|
+
end
|
|
93
|
+
return {
|
|
94
|
+
sortedRowOrder = sortedRowOrder,
|
|
95
|
+
}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
-- Compiled with roblox-ts v3.0.0
|
|
2
2
|
local TS = _G[script]
|
|
3
|
-
local
|
|
3
|
+
local _react = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local React = _react
|
|
5
|
+
local useEffect = _react.useEffect
|
|
6
|
+
local useRef = _react.useRef
|
|
4
7
|
local cx = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").cx
|
|
5
8
|
local canActivate = TS.import(script, script.Parent.Parent.Parent, "button", "components", "activation").canActivate
|
|
6
9
|
local stepChoice = TS.import(script, script.Parent.Parent.Parent, "select", "components", "stepChoice").stepChoice
|
|
7
10
|
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
11
|
+
local tabScroll = TS.import(script, script.Parent, "tabScroll").tabScroll
|
|
8
12
|
local tabsIsVertical = TS.import(script, script.Parent, "tabsOrientation").tabsIsVertical
|
|
9
13
|
local useTabsStyles = TS.import(script, script.Parent, "Tabs.styles").default
|
|
10
14
|
local function Tabs(props)
|
|
@@ -24,12 +28,61 @@ local function Tabs(props)
|
|
|
24
28
|
centered = centered,
|
|
25
29
|
})
|
|
26
30
|
local vertical = tabsIsVertical(orientation)
|
|
31
|
+
local frame = useRef()
|
|
32
|
+
local tabs = useRef({})
|
|
27
33
|
local choose = function(index)
|
|
28
34
|
local choice = options[index + 1]
|
|
29
35
|
if choice ~= nil and canActivate(disabled or choice.disabled) and choice.value ~= value then
|
|
30
36
|
onChange(choice.value)
|
|
31
37
|
end
|
|
32
38
|
end
|
|
39
|
+
useEffect(function()
|
|
40
|
+
local alive = true
|
|
41
|
+
local reveal = function()
|
|
42
|
+
if not alive then
|
|
43
|
+
return nil
|
|
44
|
+
end
|
|
45
|
+
local host = frame.current
|
|
46
|
+
if host == nil then
|
|
47
|
+
return nil
|
|
48
|
+
end
|
|
49
|
+
-- ▼ ReadonlyArray.findIndex ▼
|
|
50
|
+
local _callback = function(option)
|
|
51
|
+
return option.value == value
|
|
52
|
+
end
|
|
53
|
+
local _result = -1
|
|
54
|
+
for _i, _v in options do
|
|
55
|
+
if _callback(_v, _i - 1, options) == true then
|
|
56
|
+
_result = _i - 1
|
|
57
|
+
break
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
-- ▲ ReadonlyArray.findIndex ▲
|
|
61
|
+
local index = _result
|
|
62
|
+
local tab = tabs.current[index + 1]
|
|
63
|
+
if tab == nil then
|
|
64
|
+
return nil
|
|
65
|
+
end
|
|
66
|
+
local current = if vertical then host.CanvasPosition.Y else host.CanvasPosition.X
|
|
67
|
+
local origin = if vertical then host.AbsolutePosition.Y else host.AbsolutePosition.X
|
|
68
|
+
local start = if vertical then tab.AbsolutePosition.Y else tab.AbsolutePosition.X
|
|
69
|
+
local size = if vertical then tab.AbsoluteSize.Y else tab.AbsoluteSize.X
|
|
70
|
+
local view = if vertical then host.AbsoluteSize.Y else host.AbsoluteSize.X
|
|
71
|
+
if view <= 0 then
|
|
72
|
+
return nil
|
|
73
|
+
end
|
|
74
|
+
local scrolled = tabScroll(current, start - (origin - current), size, view)
|
|
75
|
+
if math.abs(scrolled - current) < 1 then
|
|
76
|
+
return nil
|
|
77
|
+
end
|
|
78
|
+
host.CanvasPosition = if vertical then Vector2.new(host.CanvasPosition.X, scrolled) else Vector2.new(scrolled, host.CanvasPosition.Y)
|
|
79
|
+
end
|
|
80
|
+
-- Next frame. A deferred scroll write runs inside this effect flush and re-enters render.
|
|
81
|
+
task.delay(0, reveal)
|
|
82
|
+
return function()
|
|
83
|
+
alive = false
|
|
84
|
+
end
|
|
85
|
+
end, { value, vertical, #options })
|
|
33
86
|
local onKey = function(_, input)
|
|
34
87
|
-- ▼ ReadonlyArray.findIndex ▼
|
|
35
88
|
local _callback = function(option)
|
|
@@ -60,7 +113,17 @@ local function Tabs(props)
|
|
|
60
113
|
_condition = "Tabs"
|
|
61
114
|
end
|
|
62
115
|
_attributes.key = _condition
|
|
63
|
-
_attributes.hostRef =
|
|
116
|
+
_attributes.hostRef = function(instance)
|
|
117
|
+
frame.current = instance
|
|
118
|
+
if ref == nil then
|
|
119
|
+
return nil
|
|
120
|
+
end
|
|
121
|
+
if type(ref) == "function" then
|
|
122
|
+
ref(instance)
|
|
123
|
+
else
|
|
124
|
+
ref.current = instance
|
|
125
|
+
end
|
|
126
|
+
end
|
|
64
127
|
_attributes.base = styles.root
|
|
65
128
|
_attributes.className = className
|
|
66
129
|
_attributes.sx = sx
|
|
@@ -83,6 +146,11 @@ local function Tabs(props)
|
|
|
83
146
|
end
|
|
84
147
|
_attributes_2.Text = choice.label
|
|
85
148
|
_attributes_2.LayoutOrder = index
|
|
149
|
+
_attributes_2.ref = function(rbx)
|
|
150
|
+
if rbx ~= nil then
|
|
151
|
+
tabs.current[index + 1] = rbx
|
|
152
|
+
end
|
|
153
|
+
end
|
|
86
154
|
_attributes_2.Active = active
|
|
87
155
|
_attributes_2.Selectable = active
|
|
88
156
|
_attributes_2.Event = {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Canvas offset that keeps the selected tab inside the view.
|
|
3
|
+
local function tabScroll(current, tabStart, tabSize, view)
|
|
4
|
+
if view <= 0 then
|
|
5
|
+
return current
|
|
6
|
+
end
|
|
7
|
+
if tabStart < current then
|
|
8
|
+
return if tabStart < 0 then 0 else tabStart
|
|
9
|
+
end
|
|
10
|
+
local tabEnd = tabStart + tabSize
|
|
11
|
+
if tabEnd > current + view then
|
|
12
|
+
return tabEnd - view
|
|
13
|
+
end
|
|
14
|
+
return current
|
|
15
|
+
end
|
|
16
|
+
return {
|
|
17
|
+
tabScroll = tabScroll,
|
|
18
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
5
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
6
|
+
local textBox = TS.import(script, script.Parent, "textBox").textBox
|
|
7
|
+
local function Text(props)
|
|
8
|
+
local _binding = props
|
|
9
|
+
local text = _binding.text
|
|
10
|
+
if text == nil then
|
|
11
|
+
text = ""
|
|
12
|
+
end
|
|
13
|
+
local wrap = _binding.wrap
|
|
14
|
+
local className = _binding.className
|
|
15
|
+
local sx = _binding.sx
|
|
16
|
+
local id = _binding.id
|
|
17
|
+
local ref = _binding.ref
|
|
18
|
+
local _binding_1 = useTheme()
|
|
19
|
+
local theme = _binding_1.theme
|
|
20
|
+
local box = textBox(wrap)
|
|
21
|
+
local _attributes = {
|
|
22
|
+
tag = "textlabel",
|
|
23
|
+
}
|
|
24
|
+
local _condition = id
|
|
25
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
26
|
+
_condition = "Text"
|
|
27
|
+
end
|
|
28
|
+
_attributes.key = _condition
|
|
29
|
+
_attributes.hostRef = ref
|
|
30
|
+
local _object = {
|
|
31
|
+
Text = text,
|
|
32
|
+
Size = UDim2.new(box.widthScale, 0, box.heightScale, 0),
|
|
33
|
+
AutomaticSize = if box.automatic == "Y" then Enum.AutomaticSize.Y else Enum.AutomaticSize.XY,
|
|
34
|
+
TextWrapped = box.wrapped,
|
|
35
|
+
TextXAlignment = Enum.TextXAlignment.Left,
|
|
36
|
+
BackgroundTransparency = 1,
|
|
37
|
+
BorderSizePixel = 0,
|
|
38
|
+
Font = theme.typography.fontFamilies.default,
|
|
39
|
+
TextSize = theme.typography.fontSizes.body,
|
|
40
|
+
TextColor3 = theme.palette.text.primary,
|
|
41
|
+
}
|
|
42
|
+
if className then
|
|
43
|
+
for _k, _v in className do
|
|
44
|
+
_object[_k] = _v
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
_attributes.base = _object
|
|
48
|
+
_attributes.sx = sx
|
|
49
|
+
return React.createElement(SxHost, _attributes)
|
|
50
|
+
end
|
|
51
|
+
local default = Text
|
|
52
|
+
return {
|
|
53
|
+
default = default,
|
|
54
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Shrink-wrap by default. Wrap uses the parent width and grows with the text. */
|
|
2
|
+
export declare function textBox(wrap?: boolean): {
|
|
3
|
+
widthScale: number;
|
|
4
|
+
heightScale: number;
|
|
5
|
+
automatic: "Y";
|
|
6
|
+
wrapped: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
widthScale: number;
|
|
9
|
+
heightScale: number;
|
|
10
|
+
automatic: "XY";
|
|
11
|
+
wrapped: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
--* Shrink-wrap by default. Wrap uses the parent width and grows with the text.
|
|
3
|
+
local function textBox(wrap)
|
|
4
|
+
if wrap == true then
|
|
5
|
+
return {
|
|
6
|
+
widthScale = 1,
|
|
7
|
+
heightScale = 0,
|
|
8
|
+
automatic = "Y",
|
|
9
|
+
wrapped = true,
|
|
10
|
+
}
|
|
11
|
+
end
|
|
12
|
+
return {
|
|
13
|
+
widthScale = 0,
|
|
14
|
+
heightScale = 0,
|
|
15
|
+
automatic = "XY",
|
|
16
|
+
wrapped = false,
|
|
17
|
+
}
|
|
18
|
+
end
|
|
19
|
+
return {
|
|
20
|
+
textBox = textBox,
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { TimeOfDay } from "../timeValue";
|
|
3
|
+
export interface TimeFieldProps {
|
|
4
|
+
value: TimeOfDay;
|
|
5
|
+
onChange: (value: TimeOfDay) => void;
|
|
6
|
+
step?: number;
|
|
7
|
+
wrap?: boolean;
|
|
8
|
+
min?: number;
|
|
9
|
+
max?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function TimeField(props: CustomizedProps<Frame, TimeFieldProps>): JSX.Element;
|
|
13
|
+
export default TimeField;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local React = TS.import(script, TS.getModule(script, "@rbxts", "react"))
|
|
4
|
+
local useTheme = TS.import(script, script.Parent.Parent.Parent.Parent.Parent, "theme").useTheme
|
|
5
|
+
local NumberInput = TS.import(script, script.Parent.Parent.Parent, "numberInput").NumberInput
|
|
6
|
+
local SxHost = TS.import(script, script.Parent.Parent.Parent, "host").SxHost
|
|
7
|
+
local resolveTime = TS.import(script, script.Parent.Parent, "timeValue").resolveTime
|
|
8
|
+
local function TimeField(props)
|
|
9
|
+
local _binding = props
|
|
10
|
+
local value = _binding.value
|
|
11
|
+
local onChange = _binding.onChange
|
|
12
|
+
local step = _binding.step
|
|
13
|
+
if step == nil then
|
|
14
|
+
step = 1
|
|
15
|
+
end
|
|
16
|
+
local wrap = _binding.wrap
|
|
17
|
+
if wrap == nil then
|
|
18
|
+
wrap = true
|
|
19
|
+
end
|
|
20
|
+
local min = _binding.min
|
|
21
|
+
local max = _binding.max
|
|
22
|
+
local disabled = _binding.disabled
|
|
23
|
+
local className = _binding.className
|
|
24
|
+
local sx = _binding.sx
|
|
25
|
+
local id = _binding.id
|
|
26
|
+
local ref = _binding.ref
|
|
27
|
+
local _binding_1 = useTheme()
|
|
28
|
+
local theme = _binding_1.theme
|
|
29
|
+
local commit = function(hour, minute)
|
|
30
|
+
local resolved = resolveTime({
|
|
31
|
+
hour = hour,
|
|
32
|
+
minute = minute,
|
|
33
|
+
}, step, wrap, min, max)
|
|
34
|
+
if resolved == nil then
|
|
35
|
+
return nil
|
|
36
|
+
end
|
|
37
|
+
if resolved.hour == value.hour and resolved.minute == value.minute then
|
|
38
|
+
return nil
|
|
39
|
+
end
|
|
40
|
+
onChange(resolved)
|
|
41
|
+
end
|
|
42
|
+
local _attributes = {
|
|
43
|
+
tag = "frame",
|
|
44
|
+
}
|
|
45
|
+
local _condition = id
|
|
46
|
+
if not (_condition ~= 0 and _condition == _condition and _condition ~= "" and _condition) then
|
|
47
|
+
_condition = "TimeField"
|
|
48
|
+
end
|
|
49
|
+
_attributes.key = _condition
|
|
50
|
+
_attributes.hostRef = ref
|
|
51
|
+
_attributes.base = {
|
|
52
|
+
AutomaticSize = Enum.AutomaticSize.XY,
|
|
53
|
+
Size = UDim2.fromScale(0, 0),
|
|
54
|
+
BackgroundTransparency = 1,
|
|
55
|
+
BorderSizePixel = 0,
|
|
56
|
+
}
|
|
57
|
+
_attributes.className = className
|
|
58
|
+
_attributes.sx = sx
|
|
59
|
+
return React.createElement(SxHost, _attributes, React.createElement("uilistlayout", {
|
|
60
|
+
FillDirection = Enum.FillDirection.Horizontal,
|
|
61
|
+
Padding = UDim.new(0, 4),
|
|
62
|
+
VerticalAlignment = Enum.VerticalAlignment.Center,
|
|
63
|
+
SortOrder = Enum.SortOrder.LayoutOrder,
|
|
64
|
+
}), React.createElement(NumberInput, {
|
|
65
|
+
value = value.hour,
|
|
66
|
+
step = 1,
|
|
67
|
+
disabled = disabled,
|
|
68
|
+
size = "small",
|
|
69
|
+
width = UDim.new(0, 56),
|
|
70
|
+
sx = {
|
|
71
|
+
LayoutOrder = 0,
|
|
72
|
+
},
|
|
73
|
+
onChange = function(hour)
|
|
74
|
+
return commit(hour, value.minute)
|
|
75
|
+
end,
|
|
76
|
+
}), React.createElement("textlabel", {
|
|
77
|
+
Text = ":",
|
|
78
|
+
LayoutOrder = 1,
|
|
79
|
+
BackgroundTransparency = 1,
|
|
80
|
+
BorderSizePixel = 0,
|
|
81
|
+
Size = UDim2.fromOffset(8, 24),
|
|
82
|
+
Font = theme.typography.fontFamilies.default,
|
|
83
|
+
TextSize = theme.typography.fontSizes.body,
|
|
84
|
+
TextColor3 = theme.palette.text.secondary,
|
|
85
|
+
}), React.createElement(NumberInput, {
|
|
86
|
+
value = value.minute,
|
|
87
|
+
step = step,
|
|
88
|
+
disabled = disabled,
|
|
89
|
+
size = "small",
|
|
90
|
+
width = UDim.new(0, 56),
|
|
91
|
+
sx = {
|
|
92
|
+
LayoutOrder = 2,
|
|
93
|
+
},
|
|
94
|
+
onChange = function(minute)
|
|
95
|
+
return commit(value.hour, minute)
|
|
96
|
+
end,
|
|
97
|
+
}))
|
|
98
|
+
end
|
|
99
|
+
local default = TimeField
|
|
100
|
+
return {
|
|
101
|
+
default = default,
|
|
102
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local TS = _G[script]
|
|
3
|
+
local exports = {}
|
|
4
|
+
exports.TimeField = TS.import(script, script, "components", "TimeField").default
|
|
5
|
+
local _timeValue = TS.import(script, script, "timeValue")
|
|
6
|
+
exports.resolveTime = _timeValue.resolveTime
|
|
7
|
+
exports.timeRangeOk = _timeValue.timeRangeOk
|
|
8
|
+
exports.timeToMinutes = _timeValue.timeToMinutes
|
|
9
|
+
return exports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TimeOfDay {
|
|
2
|
+
hour: number;
|
|
3
|
+
minute: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function timeToMinutes(value: TimeOfDay): number;
|
|
6
|
+
/** Snap to a minute step. Wrap into the day, or reject an invalid range. */
|
|
7
|
+
export declare function resolveTime(value: TimeOfDay, step?: number, wrap?: boolean, min?: number, max?: number): TimeOfDay | undefined;
|
|
8
|
+
export declare function timeRangeOk(start: TimeOfDay, finish: TimeOfDay): boolean;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
-- Compiled with roblox-ts v3.0.0
|
|
2
|
+
local DAY = 1440
|
|
3
|
+
local function modDay(total)
|
|
4
|
+
local remainder = total % DAY
|
|
5
|
+
return if remainder < 0 then remainder + DAY else remainder
|
|
6
|
+
end
|
|
7
|
+
local function timeToMinutes(value)
|
|
8
|
+
return value.hour * 60 + value.minute
|
|
9
|
+
end
|
|
10
|
+
--* Snap to a minute step. Wrap into the day, or reject an invalid range.
|
|
11
|
+
local function resolveTime(value, step, wrap, min, max)
|
|
12
|
+
if step == nil then
|
|
13
|
+
step = 1
|
|
14
|
+
end
|
|
15
|
+
if wrap == nil then
|
|
16
|
+
wrap = true
|
|
17
|
+
end
|
|
18
|
+
if step <= 0 then
|
|
19
|
+
return nil
|
|
20
|
+
end
|
|
21
|
+
if min ~= nil and max ~= nil and min > max then
|
|
22
|
+
return nil
|
|
23
|
+
end
|
|
24
|
+
local size = math.max(1, math.floor(step))
|
|
25
|
+
local total = math.floor((value.hour * 60 + value.minute) / size + 0.5) * size
|
|
26
|
+
if wrap then
|
|
27
|
+
total = modDay(total)
|
|
28
|
+
elseif total < 0 or total >= DAY then
|
|
29
|
+
return nil
|
|
30
|
+
end
|
|
31
|
+
if min ~= nil and total < min then
|
|
32
|
+
return nil
|
|
33
|
+
end
|
|
34
|
+
if max ~= nil and total > max then
|
|
35
|
+
return nil
|
|
36
|
+
end
|
|
37
|
+
return {
|
|
38
|
+
hour = math.floor(total / 60),
|
|
39
|
+
minute = total % 60,
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
local function timeRangeOk(start, finish)
|
|
43
|
+
return timeToMinutes(finish) > timeToMinutes(start)
|
|
44
|
+
end
|
|
45
|
+
return {
|
|
46
|
+
timeToMinutes = timeToMinutes,
|
|
47
|
+
resolveTime = resolveTime,
|
|
48
|
+
timeRangeOk = timeRangeOk,
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CustomizedProps } from "../../../../theme/index";
|
|
2
|
+
import { TimelineTone } from "./timelineRail";
|
|
3
|
+
export interface TimelineItem {
|
|
4
|
+
title: string;
|
|
5
|
+
caption?: string;
|
|
6
|
+
tone?: TimelineTone;
|
|
7
|
+
}
|
|
8
|
+
export interface TimelineProps {
|
|
9
|
+
items: TimelineItem[];
|
|
10
|
+
}
|
|
11
|
+
declare function Timeline(props: CustomizedProps<Frame, TimelineProps>): JSX.Element;
|
|
12
|
+
export default Timeline;
|