@qoretechnologies/reqore 0.76.0-pr.673.g960750c → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/CLAUDE.md +2 -32
- package/dist/components/Accordion/index.js +89 -53
- package/dist/components/Accordion/index.js.map +1 -1
- package/dist/components/Breadcrumbs/index.js +71 -33
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Breadcrumbs/item.js +13 -8
- package/dist/components/Breadcrumbs/item.js.map +1 -1
- package/dist/components/Bubble/index.js +93 -53
- package/dist/components/Bubble/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +11 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +156 -114
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Callout/index.js +84 -45
- package/dist/components/Callout/index.js.map +1 -1
- package/dist/components/Checkbox/index.js +106 -68
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Collapse/index.js +56 -19
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/CollapsibleContent/index.js +78 -39
- package/dist/components/CollapsibleContent/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +7 -8
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +117 -75
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.js +73 -33
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/column.js +39 -3
- package/dist/components/Columns/column.js.map +1 -1
- package/dist/components/Columns/index.js +47 -8
- package/dist/components/Columns/index.js.map +1 -1
- package/dist/components/Comment/index.js +29 -22
- package/dist/components/Comment/index.js.map +1 -1
- package/dist/components/CommentFeed/index.js +14 -7
- package/dist/components/CommentFeed/index.js.map +1 -1
- package/dist/components/Content/index.js +48 -10
- package/dist/components/Content/index.js.map +1 -1
- package/dist/components/Content/wrapper.js +13 -8
- package/dist/components/Content/wrapper.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +171 -58
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/ControlGroup/item.js +18 -12
- package/dist/components/ControlGroup/item.js.map +1 -1
- package/dist/components/DataView/helpers.js +53 -37
- package/dist/components/DataView/helpers.js.map +1 -1
- package/dist/components/DataView/index.js +234 -182
- package/dist/components/DataView/index.js.map +1 -1
- package/dist/components/DatePicker/MonthYearDropdowns.js +19 -12
- package/dist/components/DatePicker/MonthYearDropdowns.js.map +1 -1
- package/dist/components/DatePicker/index.js +65 -58
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DescriptionList/index.js +65 -26
- package/dist/components/DescriptionList/index.js.map +1 -1
- package/dist/components/Drawer/backdrop.js +23 -17
- package/dist/components/Drawer/backdrop.js.map +1 -1
- package/dist/components/Drawer/index.d.ts +89 -0
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +236 -69
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +23 -18
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/item.d.ts +1 -1
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/item.js +34 -11
- package/dist/components/Dropdown/item.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +96 -74
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Effect/index.d.ts +24 -1
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/Effect/index.js +107 -65
- package/dist/components/Effect/index.js.map +1 -1
- package/dist/components/EmptyState/index.js +26 -20
- package/dist/components/EmptyState/index.js.map +1 -1
- package/dist/components/EntityRow/index.js +98 -59
- package/dist/components/EntityRow/index.js.map +1 -1
- package/dist/components/ErrorBoundary/index.js +15 -12
- package/dist/components/ErrorBoundary/index.js.map +1 -1
- package/dist/components/ExportModal/index.js +24 -17
- package/dist/components/ExportModal/index.js.map +1 -1
- package/dist/components/FadeScroller/index.js +29 -23
- package/dist/components/FadeScroller/index.js.map +1 -1
- package/dist/components/FeatureCard/index.js +84 -45
- package/dist/components/FeatureCard/index.js.map +1 -1
- package/dist/components/GlobalModalsWrapper/index.js +16 -13
- package/dist/components/GlobalModalsWrapper/index.js.map +1 -1
- package/dist/components/Header/index.js +33 -21
- package/dist/components/Header/index.js.map +1 -1
- package/dist/components/Icon/index.js +77 -41
- package/dist/components/Icon/index.js.map +1 -1
- package/dist/components/IconPicker/index.js +80 -41
- package/dist/components/IconPicker/index.js.map +1 -1
- package/dist/components/Input/index.js +94 -55
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/InputClearButton/index.js +20 -14
- package/dist/components/InputClearButton/index.js.map +1 -1
- package/dist/components/InternalPopover/index.d.ts +1 -0
- package/dist/components/InternalPopover/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +190 -54
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyValueTable/index.js +18 -11
- package/dist/components/KeyValueTable/index.js.map +1 -1
- package/dist/components/KeyboardShortcut/index.js +28 -22
- package/dist/components/KeyboardShortcut/index.js.map +1 -1
- package/dist/components/Label/index.js +11 -5
- package/dist/components/Label/index.js.map +1 -1
- package/dist/components/Layout/content.js +10 -5
- package/dist/components/Layout/content.js.map +1 -1
- package/dist/components/Layout/index.js +46 -8
- package/dist/components/Layout/index.js.map +1 -1
- package/dist/components/Link/index.js +63 -24
- package/dist/components/Link/index.js.map +1 -1
- package/dist/components/Menu/divider.js +56 -20
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Menu/index.js +67 -29
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Menu/item.js +20 -18
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Menu/section.js +19 -12
- package/dist/components/Menu/section.js.map +1 -1
- package/dist/components/Message/index.js +33 -28
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Modal/index.js +18 -15
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +3 -3
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.js +10 -4
- package/dist/components/MultiSelect/index.js.map +1 -1
- package/dist/components/NavRail/index.js +145 -106
- package/dist/components/NavRail/index.js.map +1 -1
- package/dist/components/Navbar/divider.js +14 -9
- package/dist/components/Navbar/divider.js.map +1 -1
- package/dist/components/Navbar/group.js +45 -9
- package/dist/components/Navbar/group.js.map +1 -1
- package/dist/components/Navbar/index.js +53 -17
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Navbar/item.js +50 -15
- package/dist/components/Navbar/item.js.map +1 -1
- package/dist/components/Notifications/index.js +44 -9
- package/dist/components/Notifications/index.js.map +1 -1
- package/dist/components/Notifications/notification.js +125 -79
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Notifications/styles.js +69 -33
- package/dist/components/Notifications/styles.js.map +1 -1
- package/dist/components/Paging/index.js +63 -24
- package/dist/components/Paging/index.js.map +1 -1
- package/dist/components/Panel/LabelEditor.js +21 -15
- package/dist/components/Panel/LabelEditor.js.map +1 -1
- package/dist/components/Panel/NonResponsiveActions.js +15 -9
- package/dist/components/Panel/NonResponsiveActions.js.map +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +228 -180
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/responsive.d.ts +24 -0
- package/dist/components/Panel/responsive.d.ts.map +1 -0
- package/dist/components/Panel/responsive.js +30 -0
- package/dist/components/Panel/responsive.js.map +1 -0
- package/dist/components/Paragraph/index.d.ts +8 -0
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Paragraph/index.js +19 -13
- package/dist/components/Paragraph/index.js.map +1 -1
- package/dist/components/Popover/index.d.ts +46 -0
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +240 -42
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/Progress/index.js +78 -40
- package/dist/components/Progress/index.js.map +1 -1
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/RadioGroup/index.js +23 -9
- package/dist/components/RadioGroup/index.js.map +1 -1
- package/dist/components/Rating/index.js +81 -43
- package/dist/components/Rating/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +362 -114
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/SegmentedControl/index.js +97 -59
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/Select/index.d.ts +68 -29
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Select/index.js +75 -140
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/valuePreview.d.ts +11 -0
- package/dist/components/Select/valuePreview.d.ts.map +1 -0
- package/dist/components/Select/valuePreview.js +64 -0
- package/dist/components/Select/valuePreview.js.map +1 -0
- package/dist/components/SeverityRow/index.js +85 -47
- package/dist/components/SeverityRow/index.js.map +1 -1
- package/dist/components/Skeleton/index.js +46 -9
- package/dist/components/Skeleton/index.js.map +1 -1
- package/dist/components/Slider/index.js +76 -37
- package/dist/components/Slider/index.js.map +1 -1
- package/dist/components/Spacer/index.js +61 -25
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Span/index.js +19 -13
- package/dist/components/Span/index.js.map +1 -1
- package/dist/components/Spinner/index.js +16 -9
- package/dist/components/Spinner/index.js.map +1 -1
- package/dist/components/StackedBar/index.js +69 -34
- package/dist/components/StackedBar/index.js.map +1 -1
- package/dist/components/Statistic/index.js +73 -35
- package/dist/components/Statistic/index.js.map +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +107 -48
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +68 -29
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.js +69 -33
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.js +65 -26
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +62 -28
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +189 -111
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +30 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +142 -95
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +29 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +163 -60
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/scrollbar.js +37 -31
- package/dist/components/Table/scrollbar.js.map +1 -1
- package/dist/components/Table/value.js +15 -9
- package/dist/components/Table/value.js.map +1 -1
- package/dist/components/Tabs/content.js +17 -12
- package/dist/components/Tabs/content.js.map +1 -1
- package/dist/components/Tabs/index.js +52 -14
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/item.js +65 -26
- package/dist/components/Tabs/item.js.map +1 -1
- package/dist/components/Tabs/list.js +101 -60
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.js +49 -11
- package/dist/components/Tag/group.js.map +1 -1
- package/dist/components/Tag/index.d.ts +5 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +147 -92
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/components/Testimonial/index.js +82 -44
- package/dist/components/Testimonial/index.js.map +1 -1
- package/dist/components/Textarea/index.d.ts +10 -0
- package/dist/components/Textarea/index.d.ts.map +1 -1
- package/dist/components/Textarea/index.js +167 -63
- package/dist/components/Textarea/index.js.map +1 -1
- package/dist/components/Tier/index.js +58 -19
- package/dist/components/Tier/index.js.map +1 -1
- package/dist/components/TimeAgo/index.js +16 -9
- package/dist/components/TimeAgo/index.js.map +1 -1
- package/dist/components/Timeline/index.js +117 -78
- package/dist/components/Timeline/index.js.map +1 -1
- package/dist/components/TooltipComponent/index.js +10 -7
- package/dist/components/TooltipComponent/index.js.map +1 -1
- package/dist/components/Tree/index.d.ts +2 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +99 -70
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/components/Tree/modal.js +20 -13
- package/dist/components/Tree/modal.js.map +1 -1
- package/dist/constants/animations.js +5 -2
- package/dist/constants/animations.js.map +1 -1
- package/dist/constants/colors.js +5 -2
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/fonts.js +10 -6
- package/dist/constants/fonts.js.map +1 -1
- package/dist/constants/paging.js +6 -2
- package/dist/constants/paging.js.map +1 -1
- package/dist/constants/sizes.js +55 -51
- package/dist/constants/sizes.js.map +1 -1
- package/dist/constants/theme.js +22 -19
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/Paging.js +16 -13
- package/dist/containers/Paging.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +62 -52
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/ThemeProvider.js +13 -8
- package/dist/containers/ThemeProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +63 -31
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/CustomThemeContext.js +5 -3
- package/dist/context/CustomThemeContext.js.map +1 -1
- package/dist/context/ReqoreContext.js +6 -4
- package/dist/context/ReqoreContext.js.map +1 -1
- package/dist/context/ThemeContext.js +5 -3
- package/dist/context/ThemeContext.js.map +1 -1
- package/dist/helpers/animations.js +5 -2
- package/dist/helpers/animations.js.map +1 -1
- package/dist/helpers/colors.js +103 -78
- package/dist/helpers/colors.js.map +1 -1
- package/dist/helpers/dates.js +17 -8
- package/dist/helpers/dates.js.map +1 -1
- package/dist/helpers/search.js +11 -5
- package/dist/helpers/search.js.map +1 -1
- package/dist/helpers/selectItem.d.ts +23 -0
- package/dist/helpers/selectItem.d.ts.map +1 -0
- package/dist/helpers/selectItem.js +147 -0
- package/dist/helpers/selectItem.js.map +1 -0
- package/dist/helpers/shortcuts.js +14 -7
- package/dist/helpers/shortcuts.js.map +1 -1
- package/dist/helpers/styled.js +5 -1
- package/dist/helpers/styled.js.map +1 -1
- package/dist/helpers/time.js +5 -1
- package/dist/helpers/time.js.map +1 -1
- package/dist/helpers/utils.js +58 -38
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useAutoFocus.js +14 -10
- package/dist/hooks/useAutoFocus.js.map +1 -1
- package/dist/hooks/useCloneThroughFragments.js +45 -8
- package/dist/hooks/useCloneThroughFragments.js.map +1 -1
- package/dist/hooks/useCombinedRefs.js +11 -5
- package/dist/hooks/useCombinedRefs.js.map +1 -1
- package/dist/hooks/useComponentTooltip.js +11 -7
- package/dist/hooks/useComponentTooltip.js.map +1 -1
- package/dist/hooks/useFitTextSize.js +13 -9
- package/dist/hooks/useFitTextSize.js.map +1 -1
- package/dist/hooks/useFocusTrap.js +10 -7
- package/dist/hooks/useFocusTrap.js.map +1 -1
- package/dist/hooks/useLatestZIndex.js +8 -6
- package/dist/hooks/useLatestZIndex.js.map +1 -1
- package/dist/hooks/useMarqueeOnHover.js +34 -25
- package/dist/hooks/useMarqueeOnHover.js.map +1 -1
- package/dist/hooks/useNarrowContainer.js +12 -8
- package/dist/hooks/useNarrowContainer.js.map +1 -1
- package/dist/hooks/useOutsideClick.js +6 -4
- package/dist/hooks/useOutsideClick.js.map +1 -1
- package/dist/hooks/usePaging.js +27 -20
- package/dist/hooks/usePaging.js.map +1 -1
- package/dist/hooks/useQueryWithDelay.js +12 -8
- package/dist/hooks/useQueryWithDelay.js.map +1 -1
- package/dist/hooks/useReqore.js +11 -4
- package/dist/hooks/useReqore.js.map +1 -1
- package/dist/hooks/useReqoreContext.js +11 -4
- package/dist/hooks/useReqoreContext.js.map +1 -1
- package/dist/hooks/useReqoreEffect.js +9 -5
- package/dist/hooks/useReqoreEffect.js.map +1 -1
- package/dist/hooks/useScrollFade.js +12 -8
- package/dist/hooks/useScrollFade.js.map +1 -1
- package/dist/hooks/useTextareaAutoSize.js +5 -3
- package/dist/hooks/useTextareaAutoSize.js.map +1 -1
- package/dist/hooks/useTheme.js +22 -15
- package/dist/hooks/useTheme.js.map +1 -1
- package/dist/hooks/useWhyDidYouUpdate.js +7 -4
- package/dist/hooks/useWhyDidYouUpdate.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +284 -107
- package/dist/index.js.map +1 -1
- package/dist/styles.js +58 -22
- package/dist/styles.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +23 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/tableGeometry.d.ts +75 -0
- package/dist/testing/tableGeometry.d.ts.map +1 -0
- package/dist/testing/tableGeometry.js +168 -0
- package/dist/testing/tableGeometry.js.map +1 -0
- package/dist/types/global.js +2 -1
- package/dist/types/icons.js +2 -1
- package/package.json +13 -9
- package/testing/package.json +7 -0
- package/tests.json +1 -0
- package/dist/components/Accordion/index.cjs +0 -199
- package/dist/components/Accordion/index.cjs.map +0 -1
- package/dist/components/Breadcrumbs/index.cjs +0 -239
- package/dist/components/Breadcrumbs/index.cjs.map +0 -1
- package/dist/components/Breadcrumbs/item.cjs +0 -43
- package/dist/components/Breadcrumbs/item.cjs.map +0 -1
- package/dist/components/Bubble/index.cjs +0 -281
- package/dist/components/Bubble/index.cjs.map +0 -1
- package/dist/components/Button/index.cjs +0 -401
- package/dist/components/Button/index.cjs.map +0 -1
- package/dist/components/Callout/index.cjs +0 -203
- package/dist/components/Callout/index.cjs.map +0 -1
- package/dist/components/Checkbox/index.cjs +0 -222
- package/dist/components/Checkbox/index.cjs.map +0 -1
- package/dist/components/Collapse/index.cjs +0 -127
- package/dist/components/Collapse/index.cjs.map +0 -1
- package/dist/components/CollapsibleContent/index.cjs +0 -244
- package/dist/components/CollapsibleContent/index.cjs.map +0 -1
- package/dist/components/Collection/index.cjs +0 -362
- package/dist/components/Collection/index.cjs.map +0 -1
- package/dist/components/Collection/item.cjs +0 -196
- package/dist/components/Collection/item.cjs.map +0 -1
- package/dist/components/Columns/column.cjs +0 -47
- package/dist/components/Columns/column.cjs.map +0 -1
- package/dist/components/Columns/index.cjs +0 -79
- package/dist/components/Columns/index.cjs.map +0 -1
- package/dist/components/Comment/index.cjs +0 -72
- package/dist/components/Comment/index.cjs.map +0 -1
- package/dist/components/CommentFeed/index.cjs +0 -49
- package/dist/components/CommentFeed/index.cjs.map +0 -1
- package/dist/components/Content/index.cjs +0 -80
- package/dist/components/Content/index.cjs.map +0 -1
- package/dist/components/Content/wrapper.cjs +0 -43
- package/dist/components/Content/wrapper.cjs.map +0 -1
- package/dist/components/ControlGroup/index.cjs +0 -437
- package/dist/components/ControlGroup/index.cjs.map +0 -1
- package/dist/components/ControlGroup/item.cjs +0 -86
- package/dist/components/ControlGroup/item.cjs.map +0 -1
- package/dist/components/DataView/helpers.cjs +0 -350
- package/dist/components/DataView/helpers.cjs.map +0 -1
- package/dist/components/DataView/index.cjs +0 -961
- package/dist/components/DataView/index.cjs.map +0 -1
- package/dist/components/DatePicker/MonthYearDropdowns.cjs +0 -64
- package/dist/components/DatePicker/MonthYearDropdowns.cjs.map +0 -1
- package/dist/components/DatePicker/index.cjs +0 -289
- package/dist/components/DatePicker/index.cjs.map +0 -1
- package/dist/components/DescriptionList/index.cjs +0 -183
- package/dist/components/DescriptionList/index.cjs.map +0 -1
- package/dist/components/Drawer/backdrop.cjs +0 -73
- package/dist/components/Drawer/backdrop.cjs.map +0 -1
- package/dist/components/Drawer/index.cjs +0 -302
- package/dist/components/Drawer/index.cjs.map +0 -1
- package/dist/components/Dropdown/index.cjs +0 -77
- package/dist/components/Dropdown/index.cjs.map +0 -1
- package/dist/components/Dropdown/item.cjs +0 -42
- package/dist/components/Dropdown/item.cjs.map +0 -1
- package/dist/components/Dropdown/list.cjs +0 -346
- package/dist/components/Dropdown/list.cjs.map +0 -1
- package/dist/components/Effect/index.cjs +0 -331
- package/dist/components/Effect/index.cjs.map +0 -1
- package/dist/components/EmptyState/index.cjs +0 -60
- package/dist/components/EmptyState/index.cjs.map +0 -1
- package/dist/components/EntityRow/index.cjs +0 -249
- package/dist/components/EntityRow/index.cjs.map +0 -1
- package/dist/components/ErrorBoundary/index.cjs +0 -118
- package/dist/components/ErrorBoundary/index.cjs.map +0 -1
- package/dist/components/ExportModal/index.cjs +0 -91
- package/dist/components/ExportModal/index.cjs.map +0 -1
- package/dist/components/FadeScroller/index.cjs +0 -327
- package/dist/components/FadeScroller/index.cjs.map +0 -1
- package/dist/components/FeatureCard/index.cjs +0 -168
- package/dist/components/FeatureCard/index.cjs.map +0 -1
- package/dist/components/GlobalModalsWrapper/index.cjs +0 -46
- package/dist/components/GlobalModalsWrapper/index.cjs.map +0 -1
- package/dist/components/Header/index.cjs +0 -70
- package/dist/components/Header/index.cjs.map +0 -1
- package/dist/components/Icon/index.cjs +0 -195
- package/dist/components/Icon/index.cjs.map +0 -1
- package/dist/components/IconPicker/index.cjs +0 -236
- package/dist/components/IconPicker/index.cjs.map +0 -1
- package/dist/components/Input/index.cjs +0 -203
- package/dist/components/Input/index.cjs.map +0 -1
- package/dist/components/InputClearButton/index.cjs +0 -62
- package/dist/components/InputClearButton/index.cjs.map +0 -1
- package/dist/components/InternalPopover/index.cjs +0 -315
- package/dist/components/InternalPopover/index.cjs.map +0 -1
- package/dist/components/KeyValueTable/index.cjs +0 -108
- package/dist/components/KeyValueTable/index.cjs.map +0 -1
- package/dist/components/KeyboardShortcut/index.cjs +0 -69
- package/dist/components/KeyboardShortcut/index.cjs.map +0 -1
- package/dist/components/Label/index.cjs +0 -24
- package/dist/components/Label/index.cjs.map +0 -1
- package/dist/components/Layout/content.cjs +0 -41
- package/dist/components/Layout/content.cjs.map +0 -1
- package/dist/components/Layout/index.cjs +0 -79
- package/dist/components/Layout/index.cjs.map +0 -1
- package/dist/components/Link/index.cjs +0 -168
- package/dist/components/Link/index.cjs.map +0 -1
- package/dist/components/Menu/divider.cjs +0 -98
- package/dist/components/Menu/divider.cjs.map +0 -1
- package/dist/components/Menu/index.cjs +0 -135
- package/dist/components/Menu/index.cjs.map +0 -1
- package/dist/components/Menu/item.cjs +0 -99
- package/dist/components/Menu/item.cjs.map +0 -1
- package/dist/components/Menu/section.cjs +0 -59
- package/dist/components/Menu/section.cjs.map +0 -1
- package/dist/components/Message/index.cjs +0 -78
- package/dist/components/Message/index.cjs.map +0 -1
- package/dist/components/Modal/index.cjs +0 -67
- package/dist/components/Modal/index.cjs.map +0 -1
- package/dist/components/MultiSelect/index.cjs +0 -36
- package/dist/components/MultiSelect/index.cjs.map +0 -1
- package/dist/components/NavRail/index.cjs +0 -666
- package/dist/components/NavRail/index.cjs.map +0 -1
- package/dist/components/Navbar/divider.cjs +0 -47
- package/dist/components/Navbar/divider.cjs.map +0 -1
- package/dist/components/Navbar/group.cjs +0 -85
- package/dist/components/Navbar/group.cjs.map +0 -1
- package/dist/components/Navbar/index.cjs +0 -97
- package/dist/components/Navbar/index.cjs.map +0 -1
- package/dist/components/Navbar/item.cjs +0 -98
- package/dist/components/Navbar/item.cjs.map +0 -1
- package/dist/components/Notifications/index.cjs +0 -66
- package/dist/components/Notifications/index.cjs.map +0 -1
- package/dist/components/Notifications/notification.cjs +0 -343
- package/dist/components/Notifications/notification.cjs.map +0 -1
- package/dist/components/Notifications/styles.cjs +0 -131
- package/dist/components/Notifications/styles.cjs.map +0 -1
- package/dist/components/Paging/index.cjs +0 -173
- package/dist/components/Paging/index.cjs.map +0 -1
- package/dist/components/Panel/LabelEditor.cjs +0 -62
- package/dist/components/Panel/LabelEditor.cjs.map +0 -1
- package/dist/components/Panel/NonResponsiveActions.cjs +0 -47
- package/dist/components/Panel/NonResponsiveActions.cjs.map +0 -1
- package/dist/components/Panel/index.cjs +0 -1054
- package/dist/components/Panel/index.cjs.map +0 -1
- package/dist/components/Paragraph/index.cjs +0 -55
- package/dist/components/Paragraph/index.cjs.map +0 -1
- package/dist/components/Popover/index.cjs +0 -348
- package/dist/components/Popover/index.cjs.map +0 -1
- package/dist/components/Progress/index.cjs +0 -187
- package/dist/components/Progress/index.cjs.map +0 -1
- package/dist/components/RadioGroup/index.cjs +0 -42
- package/dist/components/RadioGroup/index.cjs.map +0 -1
- package/dist/components/Rating/index.cjs +0 -207
- package/dist/components/Rating/index.cjs.map +0 -1
- package/dist/components/RichTextEditor/index.cjs +0 -424
- package/dist/components/RichTextEditor/index.cjs.map +0 -1
- package/dist/components/SegmentedControl/index.cjs +0 -364
- package/dist/components/SegmentedControl/index.cjs.map +0 -1
- package/dist/components/Select/index.cjs +0 -363
- package/dist/components/Select/index.cjs.map +0 -1
- package/dist/components/SeverityRow/index.cjs +0 -207
- package/dist/components/SeverityRow/index.cjs.map +0 -1
- package/dist/components/Skeleton/index.cjs +0 -58
- package/dist/components/Skeleton/index.cjs.map +0 -1
- package/dist/components/Slider/index.cjs +0 -154
- package/dist/components/Slider/index.cjs.map +0 -1
- package/dist/components/Spacer/index.cjs +0 -138
- package/dist/components/Spacer/index.cjs.map +0 -1
- package/dist/components/Span/index.cjs +0 -61
- package/dist/components/Span/index.cjs.map +0 -1
- package/dist/components/Spinner/index.cjs +0 -44
- package/dist/components/Spinner/index.cjs.map +0 -1
- package/dist/components/StackedBar/index.cjs +0 -209
- package/dist/components/StackedBar/index.cjs.map +0 -1
- package/dist/components/Statistic/index.cjs +0 -161
- package/dist/components/Statistic/index.cjs.map +0 -1
- package/dist/components/Table/body.cjs +0 -265
- package/dist/components/Table/body.cjs.map +0 -1
- package/dist/components/Table/cell.cjs +0 -179
- package/dist/components/Table/cell.cjs.map +0 -1
- package/dist/components/Table/header.cjs +0 -170
- package/dist/components/Table/header.cjs.map +0 -1
- package/dist/components/Table/headerCell.cjs +0 -277
- package/dist/components/Table/headerCell.cjs.map +0 -1
- package/dist/components/Table/helpers.cjs +0 -386
- package/dist/components/Table/helpers.cjs.map +0 -1
- package/dist/components/Table/index.cjs +0 -682
- package/dist/components/Table/index.cjs.map +0 -1
- package/dist/components/Table/row.cjs +0 -345
- package/dist/components/Table/row.cjs.map +0 -1
- package/dist/components/Table/scrollbar.cjs +0 -201
- package/dist/components/Table/scrollbar.cjs.map +0 -1
- package/dist/components/Table/value.cjs +0 -26
- package/dist/components/Table/value.cjs.map +0 -1
- package/dist/components/Tabs/content.cjs +0 -63
- package/dist/components/Tabs/content.cjs.map +0 -1
- package/dist/components/Tabs/index.cjs +0 -109
- package/dist/components/Tabs/index.cjs.map +0 -1
- package/dist/components/Tabs/item.cjs +0 -136
- package/dist/components/Tabs/item.cjs.map +0 -1
- package/dist/components/Tabs/list.cjs +0 -322
- package/dist/components/Tabs/list.cjs.map +0 -1
- package/dist/components/Tag/group.cjs +0 -107
- package/dist/components/Tag/group.cjs.map +0 -1
- package/dist/components/Tag/index.cjs +0 -343
- package/dist/components/Tag/index.cjs.map +0 -1
- package/dist/components/Testimonial/index.cjs +0 -166
- package/dist/components/Testimonial/index.cjs.map +0 -1
- package/dist/components/Textarea/index.cjs +0 -220
- package/dist/components/Textarea/index.cjs.map +0 -1
- package/dist/components/Tier/index.cjs +0 -107
- package/dist/components/Tier/index.cjs.map +0 -1
- package/dist/components/TimeAgo/index.cjs +0 -27
- package/dist/components/TimeAgo/index.cjs.map +0 -1
- package/dist/components/Timeline/index.cjs +0 -416
- package/dist/components/Timeline/index.cjs.map +0 -1
- package/dist/components/TooltipComponent/index.cjs +0 -37
- package/dist/components/TooltipComponent/index.cjs.map +0 -1
- package/dist/components/Tree/index.cjs +0 -321
- package/dist/components/Tree/index.cjs.map +0 -1
- package/dist/components/Tree/modal.cjs +0 -38
- package/dist/components/Tree/modal.cjs.map +0 -1
- package/dist/constants/animations.cjs +0 -12
- package/dist/constants/animations.cjs.map +0 -1
- package/dist/constants/colors.cjs +0 -16
- package/dist/constants/colors.cjs.map +0 -1
- package/dist/constants/fonts.cjs +0 -28
- package/dist/constants/fonts.cjs.map +0 -1
- package/dist/constants/paging.cjs +0 -63
- package/dist/constants/paging.cjs.map +0 -1
- package/dist/constants/sizes.cjs +0 -462
- package/dist/constants/sizes.cjs.map +0 -1
- package/dist/constants/theme.cjs +0 -43
- package/dist/constants/theme.cjs.map +0 -1
- package/dist/containers/Paging.cjs +0 -52
- package/dist/containers/Paging.cjs.map +0 -1
- package/dist/containers/ReqoreProvider.cjs +0 -275
- package/dist/containers/ReqoreProvider.cjs.map +0 -1
- package/dist/containers/ThemeProvider.cjs +0 -17
- package/dist/containers/ThemeProvider.cjs.map +0 -1
- package/dist/containers/UIProvider.cjs +0 -96
- package/dist/containers/UIProvider.cjs.map +0 -1
- package/dist/context/CustomThemeContext.cjs +0 -6
- package/dist/context/CustomThemeContext.cjs.map +0 -1
- package/dist/context/ReqoreContext.cjs +0 -25
- package/dist/context/ReqoreContext.cjs.map +0 -1
- package/dist/context/ThemeContext.cjs +0 -6
- package/dist/context/ThemeContext.cjs.map +0 -1
- package/dist/helpers/animations.cjs +0 -11
- package/dist/helpers/animations.cjs.map +0 -1
- package/dist/helpers/colors.cjs +0 -273
- package/dist/helpers/colors.cjs.map +0 -1
- package/dist/helpers/dates.cjs +0 -62
- package/dist/helpers/dates.cjs.map +0 -1
- package/dist/helpers/portal.cjs +0 -32
- package/dist/helpers/portal.cjs.map +0 -1
- package/dist/helpers/portal.d.ts +0 -18
- package/dist/helpers/portal.d.ts.map +0 -1
- package/dist/helpers/portal.js +0 -27
- package/dist/helpers/portal.js.map +0 -1
- package/dist/helpers/search.cjs +0 -63
- package/dist/helpers/search.cjs.map +0 -1
- package/dist/helpers/shortcuts.cjs +0 -152
- package/dist/helpers/shortcuts.cjs.map +0 -1
- package/dist/helpers/styled.cjs +0 -46
- package/dist/helpers/styled.cjs.map +0 -1
- package/dist/helpers/time.cjs +0 -25
- package/dist/helpers/time.cjs.map +0 -1
- package/dist/helpers/utils.cjs +0 -294
- package/dist/helpers/utils.cjs.map +0 -1
- package/dist/hooks/useAutoFocus.cjs +0 -84
- package/dist/hooks/useAutoFocus.cjs.map +0 -1
- package/dist/hooks/useCloneThroughFragments.cjs +0 -63
- package/dist/hooks/useCloneThroughFragments.cjs.map +0 -1
- package/dist/hooks/useCombinedRefs.cjs +0 -44
- package/dist/hooks/useCombinedRefs.cjs.map +0 -1
- package/dist/hooks/useComponentTooltip.cjs +0 -34
- package/dist/hooks/useComponentTooltip.cjs.map +0 -1
- package/dist/hooks/useFitTextSize.cjs +0 -75
- package/dist/hooks/useFitTextSize.cjs.map +0 -1
- package/dist/hooks/useFocusTrap.cjs +0 -119
- package/dist/hooks/useFocusTrap.cjs.map +0 -1
- package/dist/hooks/useLatestZIndex.cjs +0 -12
- package/dist/hooks/useLatestZIndex.cjs.map +0 -1
- package/dist/hooks/useMarqueeOnHover.cjs +0 -292
- package/dist/hooks/useMarqueeOnHover.cjs.map +0 -1
- package/dist/hooks/useNarrowContainer.cjs +0 -68
- package/dist/hooks/useNarrowContainer.cjs.map +0 -1
- package/dist/hooks/useOutsideClick.cjs +0 -19
- package/dist/hooks/useOutsideClick.cjs.map +0 -1
- package/dist/hooks/usePaging.cjs +0 -152
- package/dist/hooks/usePaging.cjs.map +0 -1
- package/dist/hooks/useQueryWithDelay.cjs +0 -25
- package/dist/hooks/useQueryWithDelay.cjs.map +0 -1
- package/dist/hooks/useReqore.cjs +0 -17
- package/dist/hooks/useReqore.cjs.map +0 -1
- package/dist/hooks/useReqoreContext.cjs +0 -19
- package/dist/hooks/useReqoreContext.cjs.map +0 -1
- package/dist/hooks/useReqoreEffect.cjs +0 -34
- package/dist/hooks/useReqoreEffect.cjs.map +0 -1
- package/dist/hooks/useScrollFade.cjs +0 -70
- package/dist/hooks/useScrollFade.cjs.map +0 -1
- package/dist/hooks/useTextareaAutoSize.cjs +0 -22
- package/dist/hooks/useTextareaAutoSize.cjs.map +0 -1
- package/dist/hooks/useTheme.cjs +0 -49
- package/dist/hooks/useTheme.cjs.map +0 -1
- package/dist/hooks/useWhyDidYouUpdate.cjs +0 -46
- package/dist/hooks/useWhyDidYouUpdate.cjs.map +0 -1
- package/dist/index.cjs +0 -271
- package/dist/index.cjs.map +0 -1
- package/dist/package.json +0 -3
- package/dist/styles.cjs +0 -88
- package/dist/styles.cjs.map +0 -1
- package/dist/types/global.cjs +0 -3
- package/dist/types/global.cjs.map +0 -1
- package/dist/types/icons.cjs +0 -3
- package/dist/types/icons.cjs.map +0 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectItemLabel = exports.structuredValueTooltip = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A readable preview of a structured value, for the chip's tooltip.
|
|
6
|
+
*
|
|
7
|
+
* The label names WHICH preset was picked; it cannot show what is in it. For a
|
|
8
|
+
* hash the operator has otherwise no way to see what they chose without
|
|
9
|
+
* reopening the list and reading the source, so the contents are offered on
|
|
10
|
+
* hover instead.
|
|
11
|
+
*
|
|
12
|
+
* Capped, because a tooltip is a glance and a large hash is not: past the cap
|
|
13
|
+
* the reader is better served by opening the value properly. `JSON.stringify`
|
|
14
|
+
* throws on a circular structure, which is a thing a consumer's value can
|
|
15
|
+
* legitimately be, so a value that cannot be previewed simply gets no tooltip.
|
|
16
|
+
*/
|
|
17
|
+
var STRUCTURED_TOOLTIP_MAX = 600;
|
|
18
|
+
/**
|
|
19
|
+
* And a cap on LINES, which is the one that bounds the popover's HEIGHT.
|
|
20
|
+
*
|
|
21
|
+
* The character cap alone does not: pretty-printed JSON is mostly short lines, so 600
|
|
22
|
+
* characters of a nested hash is roughly forty of them — around 700px, most of a laptop
|
|
23
|
+
* screen, for something the reader triggered by pointing at it. Height is what makes a
|
|
24
|
+
* tooltip oppressive, and height is a count of lines, so that is what to count.
|
|
25
|
+
*
|
|
26
|
+
* There is no scrolling to fall back on: `InternalPopover` clamps its width to the
|
|
27
|
+
* viewport but sets no default max-height, and a hover popover closes when the pointer
|
|
28
|
+
* leaves the trigger — and is `pointer-events: none` besides — so anything past the fold
|
|
29
|
+
* could be neither seen nor reached. Better to stop early and say so with the ellipsis
|
|
30
|
+
* than to render a wall and clip it silently.
|
|
31
|
+
*
|
|
32
|
+
* Twelve because a tooltip is a glance. Past that the reader is better served by opening
|
|
33
|
+
* the value properly, which is the consumer's surface and not this one.
|
|
34
|
+
*/
|
|
35
|
+
var STRUCTURED_TOOLTIP_MAX_LINES = 12;
|
|
36
|
+
/**
|
|
37
|
+
* And a cap on the length of ONE line, which is the one that bounds the WIDTH.
|
|
38
|
+
*
|
|
39
|
+
* Neither cap above touches width, and the preview is set `white-space: pre`, which
|
|
40
|
+
* never wraps. A value whose bulk is one long scalar rather than deep structure —
|
|
41
|
+
* a SQL statement, a URL, a base64 blob, a stack trace — therefore serialises to a
|
|
42
|
+
* handful of enormous lines: measured, an 11.5kb hash holding one long `sql` string
|
|
43
|
+
* came out as 3 lines whose longest was 598 characters, about 4300px at this font.
|
|
44
|
+
* The line cap does not bite (3 < 12) and the character cap is a budget for the whole
|
|
45
|
+
* preview, not for one line of it, so it does not either.
|
|
46
|
+
*
|
|
47
|
+
* What happens then is the bad kind of failure: the popover wrapper clamps itself to
|
|
48
|
+
* the viewport and `StyledPopoverContent` is `overflow: hidden`, so the line is cut
|
|
49
|
+
* off mid-value with nothing to say that it was — a full-width tooltip showing a
|
|
50
|
+
* prefix that looks like the whole value.
|
|
51
|
+
*
|
|
52
|
+
* So each line is cut here instead, where an ellipsis can be put on it. A hundred
|
|
53
|
+
* characters is about 720px at `TEXT_FROM_SIZE.small` in `MONO_FONT`, comfortably
|
|
54
|
+
* inside a laptop viewport, and far past the width of any line that ordinary nested
|
|
55
|
+
* JSON produces — the 205-line config hash measured alongside the case above has a
|
|
56
|
+
* longest line of 44 characters, so this is inert for it.
|
|
57
|
+
*/
|
|
58
|
+
var STRUCTURED_TOOLTIP_MAX_LINE_CHARS = 100;
|
|
59
|
+
/**
|
|
60
|
+
* Previews already built, keyed by the value they describe.
|
|
61
|
+
*
|
|
62
|
+
* `selectItemTooltip` is called from a chip's render, so without this a select
|
|
63
|
+
* holding a large hash re-serialises the whole thing on every render that does
|
|
64
|
+
* not bail out of `memo` — 10kb of `JSON.stringify` to keep at most 600
|
|
65
|
+
* characters of it, and the caps cannot help because they apply to the result.
|
|
66
|
+
*
|
|
67
|
+
* Keyed on the value itself, which is sound for the same reason the editor's
|
|
68
|
+
* chip-props cache is: a value the consumer has not replaced is the same object,
|
|
69
|
+
* and a replaced one is a new object that misses. Entries go with the values.
|
|
70
|
+
* Only objects reach here — the scalar case returns before this — so a WeakMap
|
|
71
|
+
* can key on them, and `has` rather than `get` because `undefined` is a real
|
|
72
|
+
* answer (the circular case) and not an absence.
|
|
73
|
+
*/
|
|
74
|
+
var previewCache = new WeakMap();
|
|
75
|
+
/** Cuts one line to the width cap, marking it where it was cut. */
|
|
76
|
+
var capLine = function (line) {
|
|
77
|
+
return line.length > STRUCTURED_TOOLTIP_MAX_LINE_CHARS
|
|
78
|
+
? "".concat(line.slice(0, STRUCTURED_TOOLTIP_MAX_LINE_CHARS), "\u2026")
|
|
79
|
+
: line;
|
|
80
|
+
};
|
|
81
|
+
var structuredValueTooltip = function (value) {
|
|
82
|
+
if (value === null || typeof value !== 'object') {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
if (previewCache.has(value)) {
|
|
86
|
+
return previewCache.get(value);
|
|
87
|
+
}
|
|
88
|
+
var preview = buildStructuredPreview(value);
|
|
89
|
+
previewCache.set(value, preview);
|
|
90
|
+
return preview;
|
|
91
|
+
};
|
|
92
|
+
exports.structuredValueTooltip = structuredValueTooltip;
|
|
93
|
+
var buildStructuredPreview = function (value) {
|
|
94
|
+
try {
|
|
95
|
+
var preview = JSON.stringify(value, null, 2);
|
|
96
|
+
if (!preview) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
var lines = preview.split('\n');
|
|
100
|
+
var tooTall = lines.length > STRUCTURED_TOOLTIP_MAX_LINES;
|
|
101
|
+
var visible_1 = tooTall ? lines.slice(0, STRUCTURED_TOOLTIP_MAX_LINES) : lines;
|
|
102
|
+
/* Width before the character budget below, so the budget is spent on lines
|
|
103
|
+
the reader can see rather than on the tail of one already cut. Each cut
|
|
104
|
+
line carries its own ellipsis: it marks THAT value as continuing, which
|
|
105
|
+
the single trailing one at the end cannot say for a line in the middle. */
|
|
106
|
+
var kept = visible_1.map(capLine);
|
|
107
|
+
var tooWide = kept.some(function (line, index) { return line !== visible_1[index]; });
|
|
108
|
+
var capped = kept.join('\n');
|
|
109
|
+
var tooLong = capped.length > STRUCTURED_TOOLTIP_MAX;
|
|
110
|
+
// One TRAILING ellipsis however many of the three caps applied — two in a
|
|
111
|
+
// row there would read as part of the value.
|
|
112
|
+
return tooTall || tooLong || tooWide
|
|
113
|
+
? "".concat(tooLong ? capped.slice(0, STRUCTURED_TOOLTIP_MAX) : capped, "\n\u2026")
|
|
114
|
+
: capped;
|
|
115
|
+
}
|
|
116
|
+
catch (_a) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* What an item with no `label` shows: its own value.
|
|
122
|
+
*
|
|
123
|
+
* The fallback exists because a selected value with no matching item still has
|
|
124
|
+
* to be drawn as something — without it the value is held and nothing appears,
|
|
125
|
+
* which reads as "nothing is selected".
|
|
126
|
+
*
|
|
127
|
+
* The scalar is STRINGIFIED rather than passed through. `label` is rendered as
|
|
128
|
+
* a React child, and React renders `true` and `false` as nothing: a select over
|
|
129
|
+
* flags drew an empty chip with no accessible name — for exactly the values
|
|
130
|
+
* this fallback is meant to cover. `0` survived only because React renders a
|
|
131
|
+
* number.
|
|
132
|
+
*
|
|
133
|
+
* A structured value has no label form, so it gets none; `selectItemTooltip`
|
|
134
|
+
* previews it on hover instead. Shared with the dropdown's own rows so the two
|
|
135
|
+
* halves of one list cannot disagree about what an unlabelled item says.
|
|
136
|
+
*/
|
|
137
|
+
var selectItemLabel = function (item) {
|
|
138
|
+
if (item.label !== undefined && item.label !== null && item.label !== '') {
|
|
139
|
+
return item.label;
|
|
140
|
+
}
|
|
141
|
+
var value = item.value;
|
|
142
|
+
return value === undefined || value === null || typeof value === 'object' ?
|
|
143
|
+
undefined
|
|
144
|
+
: String(value);
|
|
145
|
+
};
|
|
146
|
+
exports.selectItemLabel = selectItemLabel;
|
|
147
|
+
//# sourceMappingURL=selectItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectItem.js","sourceRoot":"","sources":["../../src/helpers/selectItem.ts"],"names":[],"mappings":";;;AAsBA;;;;;;;;;;;;GAYG;AACH,IAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC;;;;;;;;;;;;;;;;GAgBG;AACH,IAAM,4BAA4B,GAAG,EAAE,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,IAAM,iCAAiC,GAAG,GAAG,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,IAAM,YAAY,GAAG,IAAI,OAAO,EAA8B,CAAC;AAE/D,mEAAmE;AACnE,IAAM,OAAO,GAAG,UAAC,IAAY;IAC3B,OAAA,IAAI,CAAC,MAAM,GAAG,iCAAiC;QAC7C,CAAC,CAAC,UAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iCAAiC,CAAC,WAAG;QACxD,CAAC,CAAC,IAAI;AAFR,CAEQ,CAAC;AAEJ,IAAM,sBAAsB,GAAG,UAAC,KAAc;IACnD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO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AC,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,MAAM,aAAK;YACpE,CAAC,CAAC,MAAM,CAAC;IACb,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACI,IAAM,eAAe,GAAG,UAC7B,IAAwD;IAExD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;QACzE,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAEO,IAAA,KAAK,GAAK,IAAI,MAAT,CAAU;IAEvB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC;QACvE,SAAS;QACX,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACpB,CAAC,CAAC;AAZW,QAAA,eAAe,mBAY1B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Helpers for parsing and displaying keyboard shortcuts.
|
|
3
4
|
*
|
|
@@ -6,6 +7,8 @@
|
|
|
6
7
|
* comma or passed as an array. The special `mod` key resolves to `⌘` on macOS
|
|
7
8
|
* and `Ctrl` everywhere else, so a single declaration works cross-platform.
|
|
8
9
|
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.shortcutHasModifier = exports.formatShortcut = exports.formatShortcutCombo = exports.isMacOS = void 0;
|
|
9
12
|
var MODIFIER_KEYS = [
|
|
10
13
|
'mod',
|
|
11
14
|
'meta',
|
|
@@ -82,13 +85,14 @@ var KEY_LABELS = {
|
|
|
82
85
|
* different source (e.g. `navigator.platform`) could make the hint say `⌘`
|
|
83
86
|
* while the binding expects `Ctrl`, or vice versa.
|
|
84
87
|
*/
|
|
85
|
-
|
|
88
|
+
var isMacOS = function () {
|
|
86
89
|
if (typeof navigator === 'undefined') {
|
|
87
90
|
return false;
|
|
88
91
|
}
|
|
89
92
|
var ua = navigator.userAgent;
|
|
90
93
|
return /mac/i.test(ua) && !/iphone|ipad|ipod/i.test(ua);
|
|
91
94
|
};
|
|
95
|
+
exports.isMacOS = isMacOS;
|
|
92
96
|
var formatToken = function (token, mac) {
|
|
93
97
|
var key = token.trim().toLowerCase();
|
|
94
98
|
// The `focusRules` shortcut on inputs supports these aliases that match any
|
|
@@ -118,28 +122,31 @@ var splitShortcut = function (shortcut) {
|
|
|
118
122
|
* Turn a single combo (e.g. `'mod+shift+k'`) into a display string.
|
|
119
123
|
* macOS concatenates glyphs (`⌘⇧K`), other platforms join with `+` (`Ctrl+Shift+K`).
|
|
120
124
|
*/
|
|
121
|
-
|
|
122
|
-
if (mac === void 0) { mac = isMacOS(); }
|
|
125
|
+
var formatShortcutCombo = function (combo, mac) {
|
|
126
|
+
if (mac === void 0) { mac = (0, exports.isMacOS)(); }
|
|
123
127
|
return combo
|
|
124
128
|
.split('+')
|
|
125
129
|
.map(function (token) { return formatToken(token, mac); })
|
|
126
130
|
.join(mac ? '' : '+');
|
|
127
131
|
};
|
|
132
|
+
exports.formatShortcutCombo = formatShortcutCombo;
|
|
128
133
|
/**
|
|
129
134
|
* Format a shortcut declaration into one display string per alternative combo.
|
|
130
135
|
*/
|
|
131
|
-
|
|
132
|
-
if (mac === void 0) { mac = isMacOS(); }
|
|
133
|
-
return splitShortcut(shortcut).map(function (combo) { return formatShortcutCombo(combo, mac); });
|
|
136
|
+
var formatShortcut = function (shortcut, mac) {
|
|
137
|
+
if (mac === void 0) { mac = (0, exports.isMacOS)(); }
|
|
138
|
+
return splitShortcut(shortcut).map(function (combo) { return (0, exports.formatShortcutCombo)(combo, mac); });
|
|
134
139
|
};
|
|
140
|
+
exports.formatShortcut = formatShortcut;
|
|
135
141
|
/**
|
|
136
142
|
* Whether any combo in the shortcut uses a modifier key. Used to decide if a
|
|
137
143
|
* button shortcut should still fire while a form field is focused (combos with a
|
|
138
144
|
* modifier are safe; bare single keys would clash with typing).
|
|
139
145
|
*/
|
|
140
|
-
|
|
146
|
+
var shortcutHasModifier = function (shortcut) {
|
|
141
147
|
return splitShortcut(shortcut).some(function (combo) {
|
|
142
148
|
return combo.split('+').some(function (token) { return MODIFIER_KEYS.includes(token.trim().toLowerCase()); });
|
|
143
149
|
});
|
|
144
150
|
};
|
|
151
|
+
exports.shortcutHasModifier = shortcutHasModifier;
|
|
145
152
|
//# sourceMappingURL=shortcuts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../src/helpers/shortcuts.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG
|
|
1
|
+
{"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../src/helpers/shortcuts.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAIH,IAAM,aAAa,GAAG;IACpB,KAAK;IACL,MAAM;IACN,KAAK;IACL,SAAS;IACT,MAAM;IACN,SAAS;IACT,KAAK;IACL,QAAQ;IACR,OAAO;CACR,CAAC;AAEF,IAAM,eAAe,GAA2B;IAC9C,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,GAAG;IACT,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,GAAG;IACZ,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,GAAG;IACZ,GAAG,EAAE,GAAG;IACR,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,GAAG;IACd,MAAM,EAAE,GAAG;IACX,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,KAAK,EAAE,OAAO;IACd,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,GAAG;IACZ,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SACV,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,EAAvB,CAAuB,CAAC;SACvC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAHvB,CAGuB,CAAC;AAJb,QAAA,mBAAmB,uBAIN;AAE1B;;GAEG;AACI,IAAM,cAAc,GAAG,UAC5B,QAAiC,EACjC,GAAwB;IAAxB,oBAAA,EAAA,UAAe,eAAO,GAAE;IACX,OAAA,aAAa,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,IAAA,2BAAmB,EAAC,KAAK,EAAE,GAAG,CAAC,EAA/B,CAA+B,CAAC;AAAvE,CAAuE,CAAC;AAH1E,QAAA,cAAc,kBAG4D;AAEvF;;;;GAIG;AACI,IAAM,mBAAmB,GAAG,UAAC,QAAiC;IACnE,OAAA,aAAa,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK;QACjC,OAAA,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,UAAC,KAAK,IAAK,OAAA,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,EAAlD,CAAkD,CAAC;IAApF,CAAoF,CACrF;AAFD,CAEC,CAAC;AAHS,QAAA,mBAAmB,uBAG5B"}
|
package/dist/helpers/styled.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.omitStyleProps = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Builds a `shouldForwardProp` predicate for `styled(...).withConfig({ ... })` that keeps the
|
|
3
6
|
* named props out of the rendered element while leaving every other prop alone.
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
* shouldForwardProp: omitStyleProps('fill'),
|
|
26
29
|
* })<IStyledPanel>`...`;
|
|
27
30
|
*/
|
|
28
|
-
|
|
31
|
+
var omitStyleProps = function () {
|
|
29
32
|
var propsToOmit = [];
|
|
30
33
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
31
34
|
propsToOmit[_i] = arguments[_i];
|
|
@@ -39,4 +42,5 @@ export var omitStyleProps = function () {
|
|
|
39
42
|
return typeof elementToBeCreated === 'string' ? defaultValidatorFn(prop) : true;
|
|
40
43
|
};
|
|
41
44
|
};
|
|
45
|
+
exports.omitStyleProps = omitStyleProps;
|
|
42
46
|
//# sourceMappingURL=styled.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../src/helpers/styled.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"styled.js","sourceRoot":"","sources":["../../src/helpers/styled.ts"],"names":[],"mappings":";;;AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,IAAM,cAAc,GAAG;IAAC,qBAAwB;SAAxB,UAAwB,EAAxB,qBAAwB,EAAxB,IAAwB;QAAxB,gCAAwB;;IACrD,IAAM,OAAO,GAAG,IAAI,GAAG,CAA2B,WAAW,CAAC,CAAC;IAE/D,OAAO,UACL,IAA8B,EAC9B,kBAA8C,EAC9C,kBAAwC;QAExC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,oFAAoF;QACpF,OAAO,OAAO,kBAAkB,KAAK,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,CAAC,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
package/dist/helpers/time.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimeAgoIntervalDelay = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* If the time is larger than one day, update once a day. If the time is larger than one hour,
|
|
3
6
|
update once an hour. Otherwise update every 5 seconds.
|
|
4
7
|
* @param {number} time - the time in milliseconds since the epoch
|
|
5
8
|
* @returns The interval ID.
|
|
6
9
|
*/
|
|
7
|
-
|
|
10
|
+
var getTimeAgoIntervalDelay = function (time) {
|
|
8
11
|
// If the time is larger than one day
|
|
9
12
|
if (Date.now() - time > 60000 * 60 * 24) {
|
|
10
13
|
// update once a day
|
|
@@ -18,4 +21,5 @@ export var getTimeAgoIntervalDelay = function (time) {
|
|
|
18
21
|
// Otherwise update every 5 seconds
|
|
19
22
|
return 5000;
|
|
20
23
|
};
|
|
24
|
+
exports.getTimeAgoIntervalDelay = getTimeAgoIntervalDelay;
|
|
21
25
|
//# sourceMappingURL=time.js.map
|
package/dist/helpers/time.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/helpers/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/helpers/time.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,IAAM,uBAAuB,GAAG,UAAC,IAAY;IAClD,qCAAqC;IACrC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;QACxC,oBAAoB;QACpB,OAAO,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC;IACzB,CAAC;IACD,sCAAsC;IACtC,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,EAAE,CAAC;QACnC,sBAAsB;QACtB,OAAO,KAAK,GAAG,EAAE,CAAC;IACpB,CAAC;IAED,mCAAmC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAdW,QAAA,uBAAuB,2BAclC"}
|
package/dist/helpers/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -43,39 +44,46 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
43
44
|
}
|
|
44
45
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
46
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.withStoppedPropagation = exports.stringifyAndDecycleObject = exports.alignToFlexAlign = exports.isActionShown = exports.getOneHigherSize = exports.resolvePadding = exports.getOneLessSize = exports.resolveAccentSize = exports.isStringSize = exports.calculateStringSizeInPixels = exports.convertToCSV = exports.getLineCount = exports.getTypeFromValue = exports.sleep = void 0;
|
|
49
|
+
exports.decycle = decycle;
|
|
50
|
+
exports.parseInputValue = parseInputValue;
|
|
51
|
+
exports.buildTooltipForComponents = buildTooltipForComponents;
|
|
52
|
+
var lodash_1 = require("lodash");
|
|
53
|
+
var sizes_1 = require("../constants/sizes");
|
|
54
|
+
var sleep = function (ms) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
49
55
|
switch (_a.label) {
|
|
50
56
|
case 0: return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, ms); })];
|
|
51
57
|
case 1: return [2 /*return*/, _a.sent()];
|
|
52
58
|
}
|
|
53
59
|
}); }); };
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
exports.sleep = sleep;
|
|
61
|
+
var getTypeFromValue = function (item) {
|
|
62
|
+
if ((0, lodash_1.isBoolean)(item)) {
|
|
56
63
|
return 'boolean';
|
|
57
64
|
}
|
|
58
|
-
if (isString(item)) {
|
|
65
|
+
if ((0, lodash_1.isString)(item)) {
|
|
59
66
|
return 'string';
|
|
60
67
|
}
|
|
61
|
-
if (isNumber(item)) {
|
|
68
|
+
if ((0, lodash_1.isNumber)(item)) {
|
|
62
69
|
return 'number';
|
|
63
70
|
}
|
|
64
|
-
if (isArray(item)) {
|
|
71
|
+
if ((0, lodash_1.isArray)(item)) {
|
|
65
72
|
return 'array';
|
|
66
73
|
}
|
|
67
|
-
if (isObject(item)) {
|
|
74
|
+
if ((0, lodash_1.isObject)(item)) {
|
|
68
75
|
return 'object';
|
|
69
76
|
}
|
|
70
|
-
if (isFunction(item)) {
|
|
77
|
+
if ((0, lodash_1.isFunction)(item)) {
|
|
71
78
|
return 'function';
|
|
72
79
|
}
|
|
73
|
-
if (isNull(item) || isUndefined(item)) {
|
|
80
|
+
if ((0, lodash_1.isNull)(item) || (0, lodash_1.isUndefined)(item)) {
|
|
74
81
|
return 'null';
|
|
75
82
|
}
|
|
76
83
|
return 'null';
|
|
77
84
|
};
|
|
78
|
-
|
|
85
|
+
exports.getTypeFromValue = getTypeFromValue;
|
|
86
|
+
var getLineCount = function (value) {
|
|
79
87
|
var _a, _b;
|
|
80
88
|
try {
|
|
81
89
|
return (_b = (_a = value === null || value === void 0 ? void 0 : value.match(/[^\n]*\n[^\n]*/gi)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -84,9 +92,10 @@ export var getLineCount = function (value) {
|
|
|
84
92
|
return 0;
|
|
85
93
|
}
|
|
86
94
|
};
|
|
95
|
+
exports.getLineCount = getLineCount;
|
|
87
96
|
// A function that takes list of objects and transforms it
|
|
88
97
|
// to a CSV string
|
|
89
|
-
|
|
98
|
+
var convertToCSV = function (objArray) {
|
|
90
99
|
var header = Object.keys(objArray[0]).join(',');
|
|
91
100
|
var rows = objArray.map(function (obj) {
|
|
92
101
|
return Object.values(obj)
|
|
@@ -95,7 +104,8 @@ export var convertToCSV = function (objArray) {
|
|
|
95
104
|
});
|
|
96
105
|
return __spreadArray([header], rows, true).join('\n');
|
|
97
106
|
};
|
|
98
|
-
|
|
107
|
+
exports.convertToCSV = convertToCSV;
|
|
108
|
+
var calculateStringSizeInPixels = function (value, fontSize, spaced) {
|
|
99
109
|
if (value === void 0) { value = ''; }
|
|
100
110
|
if (spaced === void 0) { spaced = 0; }
|
|
101
111
|
var widths = [
|
|
@@ -117,9 +127,11 @@ export var calculateStringSizeInPixels = function (value, fontSize, spaced) {
|
|
|
117
127
|
return (Array.from(value).reduce(function (acc, cur) { var _a; return acc + ((_a = widths[cur.charCodeAt(0)]) !== null && _a !== void 0 ? _a : avg); }, 0) *
|
|
118
128
|
(fontSize * (1.4 + spaced / 2)));
|
|
119
129
|
};
|
|
120
|
-
|
|
121
|
-
|
|
130
|
+
exports.calculateStringSizeInPixels = calculateStringSizeInPixels;
|
|
131
|
+
var isStringSize = function (value) {
|
|
132
|
+
return sizes_1.SIZES.includes(value);
|
|
122
133
|
};
|
|
134
|
+
exports.isStringSize = isStringSize;
|
|
123
135
|
/**
|
|
124
136
|
* Resolves an accent-strip thickness (`ReqoreCallout` / `ReqorePanel` `accentSize`) to pixels.
|
|
125
137
|
*
|
|
@@ -131,19 +143,21 @@ export var isStringSize = function (value) {
|
|
|
131
143
|
* result into `px` and do arithmetic with it (the padding reservation) — so the css must never
|
|
132
144
|
* see a string.
|
|
133
145
|
*/
|
|
134
|
-
|
|
146
|
+
var resolveAccentSize = function (accentSize) {
|
|
135
147
|
if (accentSize === void 0) { accentSize = 'normal'; }
|
|
136
|
-
return isStringSize(accentSize) ? ACCENT_SIZE_TO_PX[accentSize] : accentSize;
|
|
148
|
+
return (0, exports.isStringSize)(accentSize) ? sizes_1.ACCENT_SIZE_TO_PX[accentSize] : accentSize;
|
|
137
149
|
};
|
|
138
|
-
|
|
150
|
+
exports.resolveAccentSize = resolveAccentSize;
|
|
151
|
+
var getOneLessSize = function (size) {
|
|
139
152
|
if (size === void 0) { size = 'normal'; }
|
|
140
153
|
// Get the initial sizes number
|
|
141
|
-
var initialSizeNumber = SIZE_TO_NUMBER[size];
|
|
154
|
+
var initialSizeNumber = sizes_1.SIZE_TO_NUMBER[size];
|
|
142
155
|
// Reduce the size number by one
|
|
143
156
|
var oneLessSizeNumber = initialSizeNumber - 1 === 0 ? 1 : initialSizeNumber - 1;
|
|
144
157
|
// Get the size name from the number
|
|
145
|
-
return NUMBER_TO_SIZE[oneLessSizeNumber];
|
|
158
|
+
return sizes_1.NUMBER_TO_SIZE[oneLessSizeNumber];
|
|
146
159
|
};
|
|
160
|
+
exports.getOneLessSize = getOneLessSize;
|
|
147
161
|
/**
|
|
148
162
|
* Builds a CSS `padding` shorthand value for surface components that support
|
|
149
163
|
* the `padded` + `paddingSize` prop pair.
|
|
@@ -157,30 +171,33 @@ export var getOneLessSize = function (size) {
|
|
|
157
171
|
* <multiplier>`. Pass per-component multipliers (e.g. EntityRow uses `v=2,
|
|
158
172
|
* h=3`; Statistic uses `v=3, h=5`).
|
|
159
173
|
*/
|
|
160
|
-
|
|
174
|
+
var resolvePadding = function (_a) {
|
|
161
175
|
var padded = _a.padded, paddingSize = _a.paddingSize, verticalMultiplier = _a.verticalMultiplier, horizontalMultiplier = _a.horizontalMultiplier;
|
|
162
176
|
if (padded === false)
|
|
163
177
|
return '0';
|
|
164
|
-
var v = PADDING_FROM_SIZE[paddingSize] * verticalMultiplier;
|
|
165
|
-
var h = PADDING_FROM_SIZE[paddingSize] * horizontalMultiplier;
|
|
178
|
+
var v = sizes_1.PADDING_FROM_SIZE[paddingSize] * verticalMultiplier;
|
|
179
|
+
var h = sizes_1.PADDING_FROM_SIZE[paddingSize] * horizontalMultiplier;
|
|
166
180
|
if (padded === 'horizontal')
|
|
167
181
|
return "0 ".concat(h, "px");
|
|
168
182
|
if (padded === 'vertical')
|
|
169
183
|
return "".concat(v, "px 0");
|
|
170
184
|
return "".concat(v, "px ").concat(h, "px");
|
|
171
185
|
};
|
|
172
|
-
|
|
186
|
+
exports.resolvePadding = resolvePadding;
|
|
187
|
+
var getOneHigherSize = function (size) {
|
|
173
188
|
// Get the initial sizes number
|
|
174
|
-
var initialSizeNumber = SIZE_TO_NUMBER[size];
|
|
189
|
+
var initialSizeNumber = sizes_1.SIZE_TO_NUMBER[size];
|
|
175
190
|
// Reduce the size number by one
|
|
176
191
|
var oneHigherSizeNumber = initialSizeNumber + 1 === 8 ? 7 : initialSizeNumber + 1;
|
|
177
192
|
// Get the size name from the number
|
|
178
|
-
return NUMBER_TO_SIZE[oneHigherSizeNumber];
|
|
193
|
+
return sizes_1.NUMBER_TO_SIZE[oneHigherSizeNumber];
|
|
179
194
|
};
|
|
180
|
-
|
|
195
|
+
exports.getOneHigherSize = getOneHigherSize;
|
|
196
|
+
var isActionShown = function (action) {
|
|
181
197
|
return action.show !== false;
|
|
182
198
|
};
|
|
183
|
-
|
|
199
|
+
exports.isActionShown = isActionShown;
|
|
200
|
+
var alignToFlexAlign = function (align) {
|
|
184
201
|
switch (align) {
|
|
185
202
|
case 'left':
|
|
186
203
|
return 'flex-start';
|
|
@@ -192,7 +209,8 @@ export var alignToFlexAlign = function (align) {
|
|
|
192
209
|
return 'flex-start';
|
|
193
210
|
}
|
|
194
211
|
};
|
|
195
|
-
|
|
212
|
+
exports.alignToFlexAlign = alignToFlexAlign;
|
|
213
|
+
function decycle(obj, stack) {
|
|
196
214
|
if (stack === void 0) { stack = []; }
|
|
197
215
|
if (!obj || typeof obj !== 'object')
|
|
198
216
|
return obj;
|
|
@@ -206,7 +224,7 @@ export function decycle(obj, stack) {
|
|
|
206
224
|
return [k, decycle(v, s)];
|
|
207
225
|
}));
|
|
208
226
|
}
|
|
209
|
-
|
|
227
|
+
var stringifyAndDecycleObject = function (obj) {
|
|
210
228
|
return JSON.stringify(decycle(obj), function (_key, value) {
|
|
211
229
|
if (typeof value === 'function') {
|
|
212
230
|
return value.toString();
|
|
@@ -214,14 +232,15 @@ export var stringifyAndDecycleObject = function (obj) {
|
|
|
214
232
|
return value;
|
|
215
233
|
});
|
|
216
234
|
};
|
|
217
|
-
|
|
218
|
-
|
|
235
|
+
exports.stringifyAndDecycleObject = stringifyAndDecycleObject;
|
|
236
|
+
function parseInputValue(input) {
|
|
237
|
+
if ((0, lodash_1.isBoolean)(input)) {
|
|
219
238
|
return input;
|
|
220
239
|
}
|
|
221
|
-
if (isNumber(input)) {
|
|
240
|
+
if ((0, lodash_1.isNumber)(input)) {
|
|
222
241
|
return input;
|
|
223
242
|
}
|
|
224
|
-
if (!isString(input)) {
|
|
243
|
+
if (!(0, lodash_1.isString)(input)) {
|
|
225
244
|
return input;
|
|
226
245
|
}
|
|
227
246
|
// Check for explicit quotes to save as a string
|
|
@@ -243,8 +262,8 @@ export function parseInputValue(input) {
|
|
|
243
262
|
// Default to a string
|
|
244
263
|
return input;
|
|
245
264
|
}
|
|
246
|
-
|
|
247
|
-
if (isString(tooltip)) {
|
|
265
|
+
function buildTooltipForComponents(tooltip) {
|
|
266
|
+
if ((0, lodash_1.isString)(tooltip)) {
|
|
248
267
|
return { content: tooltip };
|
|
249
268
|
}
|
|
250
269
|
return tooltip;
|
|
@@ -265,10 +284,11 @@ export function buildTooltipForComponents(tooltip) {
|
|
|
265
284
|
*
|
|
266
285
|
* Call with no argument for a pure stopper (`onClick={withStoppedPropagation()}`).
|
|
267
286
|
*/
|
|
268
|
-
|
|
287
|
+
var withStoppedPropagation = function (onClick) {
|
|
269
288
|
return function (event) {
|
|
270
289
|
event.stopPropagation();
|
|
271
290
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
272
291
|
};
|
|
273
292
|
};
|
|
293
|
+
exports.withStoppedPropagation = withStoppedPropagation;
|
|
274
294
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","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,CAAC;IACnB,CAAC;AAHD,CAGC,CAAC;AALS,QAAA,sBAAsB,0BAK/B"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAutoFocus = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var react_use_1 = require("react-use");
|
|
6
|
+
var useAutoFocus = function (element, rules, onChange) {
|
|
7
|
+
var isInViewport = (0, react_1.useRef)(false);
|
|
8
|
+
var observer = (0, react_1.useRef)(null);
|
|
9
|
+
var focus = (0, react_1.useCallback)(function () {
|
|
7
10
|
if (!rules.viewportOnly || isInViewport.current) {
|
|
8
11
|
if (rules.clearOnFocus) {
|
|
9
12
|
onChange === null || onChange === void 0 ? void 0 : onChange({ target: { value: '' } });
|
|
@@ -13,7 +16,7 @@ export var useAutoFocus = function (element, rules, onChange) {
|
|
|
13
16
|
}
|
|
14
17
|
// Note: isInViewport.current is intentionally not in deps as it's a ref that's read at call time
|
|
15
18
|
}, [element, rules, onChange]);
|
|
16
|
-
var handleKeyDown = useCallback(function (e) {
|
|
19
|
+
var handleKeyDown = (0, react_1.useCallback)(function (e) {
|
|
17
20
|
// Check if this event came from another html input or a content-editable div
|
|
18
21
|
if (e.target &&
|
|
19
22
|
(e.target.tagName === 'INPUT' ||
|
|
@@ -32,7 +35,7 @@ export var useAutoFocus = function (element, rules, onChange) {
|
|
|
32
35
|
focus();
|
|
33
36
|
}
|
|
34
37
|
}, [rules === null || rules === void 0 ? void 0 : rules.shortcut, focus]);
|
|
35
|
-
useUpdateEffect(function () {
|
|
38
|
+
(0, react_use_1.useUpdateEffect)(function () {
|
|
36
39
|
if (element && rules) {
|
|
37
40
|
if (rules.viewportOnly) {
|
|
38
41
|
observer.current = new IntersectionObserver(function (entries) {
|
|
@@ -64,11 +67,11 @@ export var useAutoFocus = function (element, rules, onChange) {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
}, [element]);
|
|
67
|
-
useUnmount(function () {
|
|
70
|
+
(0, react_use_1.useUnmount)(function () {
|
|
68
71
|
var _a;
|
|
69
72
|
(_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
70
73
|
});
|
|
71
|
-
useEffect(function () {
|
|
74
|
+
(0, react_1.useEffect)(function () {
|
|
72
75
|
if (element && rules && rules.type === 'keypress') {
|
|
73
76
|
window.addEventListener(rules.doNotInsertShortcut ? 'keyup' : 'keydown', handleKeyDown);
|
|
74
77
|
}
|
|
@@ -77,4 +80,5 @@ export var useAutoFocus = function (element, rules, onChange) {
|
|
|
77
80
|
};
|
|
78
81
|
}, [element, rules, handleKeyDown]);
|
|
79
82
|
};
|
|
83
|
+
exports.useAutoFocus = useAutoFocus;
|
|
80
84
|
//# sourceMappingURL=useAutoFocus.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoFocus.js","sourceRoot":"","sources":["../../src/hooks/useAutoFocus.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useAutoFocus.js","sourceRoot":"","sources":["../../src/hooks/useAutoFocus.ts"],"names":[],"mappings":";;;AAAA,+BAAuD;AACvD,uCAAwD;AAcjD,IAAM,YAAY,GAAG,UAC1B,OAA+C,EAC/C,KAA6B,EAC7B,QAA+B;IAE/B,IAAM,YAAY,GAAG,IAAA,cAAM,EAAU,KAAK,CAAC,CAAC;IAC5C,IAAM,QAAQ,GAAG,IAAA,cAAM,EAAuB,IAAI,CAAC,CAAC;IAEpD,IAAM,KAAK,GAAG,IAAA,mBAAW,EAAC;QACxB,IAAI,CAAC,KAAK,CAAC,YAAY,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAChD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;gBACvB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,EAAE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