@qoretechnologies/reqore 0.76.0-pr.673.gfcc9a9f → 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 -37
- 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 +15 -11
- 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
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Helpers for parsing and displaying keyboard shortcuts.
|
|
4
|
-
*
|
|
5
|
-
* Shortcuts follow the `react-hotkeys-hook` syntax: keys joined with `+`
|
|
6
|
-
* (e.g. `'mod+k'`, `'ctrl+shift+s'`) and multiple alternatives separated by a
|
|
7
|
-
* comma or passed as an array. The special `mod` key resolves to `⌘` on macOS
|
|
8
|
-
* and `Ctrl` everywhere else, so a single declaration works cross-platform.
|
|
9
|
-
*/
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.shortcutHasModifier = exports.formatShortcut = exports.formatShortcutCombo = exports.isMacOS = void 0;
|
|
12
|
-
var MODIFIER_KEYS = [
|
|
13
|
-
'mod',
|
|
14
|
-
'meta',
|
|
15
|
-
'cmd',
|
|
16
|
-
'command',
|
|
17
|
-
'ctrl',
|
|
18
|
-
'control',
|
|
19
|
-
'alt',
|
|
20
|
-
'option',
|
|
21
|
-
'shift',
|
|
22
|
-
];
|
|
23
|
-
var KEY_SYMBOLS_MAC = {
|
|
24
|
-
mod: '⌘',
|
|
25
|
-
meta: '⌘',
|
|
26
|
-
cmd: '⌘',
|
|
27
|
-
command: '⌘',
|
|
28
|
-
ctrl: '⌃',
|
|
29
|
-
control: '⌃',
|
|
30
|
-
alt: '⌥',
|
|
31
|
-
option: '⌥',
|
|
32
|
-
shift: '⇧',
|
|
33
|
-
enter: '↵',
|
|
34
|
-
return: '↵',
|
|
35
|
-
esc: 'Esc',
|
|
36
|
-
escape: 'Esc',
|
|
37
|
-
backspace: '⌫',
|
|
38
|
-
delete: '⌦',
|
|
39
|
-
del: '⌦',
|
|
40
|
-
tab: '⇥',
|
|
41
|
-
space: 'Space',
|
|
42
|
-
up: '↑',
|
|
43
|
-
arrowup: '↑',
|
|
44
|
-
down: '↓',
|
|
45
|
-
arrowdown: '↓',
|
|
46
|
-
left: '←',
|
|
47
|
-
arrowleft: '←',
|
|
48
|
-
right: '→',
|
|
49
|
-
arrowright: '→',
|
|
50
|
-
};
|
|
51
|
-
var KEY_LABELS = {
|
|
52
|
-
mod: 'Ctrl',
|
|
53
|
-
meta: 'Meta',
|
|
54
|
-
cmd: 'Win',
|
|
55
|
-
command: 'Win',
|
|
56
|
-
ctrl: 'Ctrl',
|
|
57
|
-
control: 'Ctrl',
|
|
58
|
-
alt: 'Alt',
|
|
59
|
-
option: 'Alt',
|
|
60
|
-
shift: 'Shift',
|
|
61
|
-
enter: 'Enter',
|
|
62
|
-
return: 'Enter',
|
|
63
|
-
esc: 'Esc',
|
|
64
|
-
escape: 'Esc',
|
|
65
|
-
backspace: 'Backspace',
|
|
66
|
-
delete: 'Del',
|
|
67
|
-
del: 'Del',
|
|
68
|
-
tab: 'Tab',
|
|
69
|
-
space: 'Space',
|
|
70
|
-
up: '↑',
|
|
71
|
-
arrowup: '↑',
|
|
72
|
-
down: '↓',
|
|
73
|
-
arrowdown: '↓',
|
|
74
|
-
left: '←',
|
|
75
|
-
arrowleft: '←',
|
|
76
|
-
right: '→',
|
|
77
|
-
arrowright: '→',
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
* Detect macOS so we can render the platform-appropriate modifier glyphs.
|
|
81
|
-
*
|
|
82
|
-
* This intentionally mirrors `react-hotkeys-hook`'s own Apple detection
|
|
83
|
-
* (`/mac/i.test(navigator.userAgent)` excluding iOS) so the displayed hint
|
|
84
|
-
* always matches the modifier the library actually listens for — using a
|
|
85
|
-
* different source (e.g. `navigator.platform`) could make the hint say `⌘`
|
|
86
|
-
* while the binding expects `Ctrl`, or vice versa.
|
|
87
|
-
*/
|
|
88
|
-
var isMacOS = function () {
|
|
89
|
-
if (typeof navigator === 'undefined') {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
var ua = navigator.userAgent;
|
|
93
|
-
return /mac/i.test(ua) && !/iphone|ipad|ipod/i.test(ua);
|
|
94
|
-
};
|
|
95
|
-
exports.isMacOS = isMacOS;
|
|
96
|
-
var formatToken = function (token, mac) {
|
|
97
|
-
var key = token.trim().toLowerCase();
|
|
98
|
-
// The `focusRules` shortcut on inputs supports these aliases that match any
|
|
99
|
-
// letter / number key — render a readable range instead of the literal word.
|
|
100
|
-
if (key === 'letters') {
|
|
101
|
-
return 'A-Z';
|
|
102
|
-
}
|
|
103
|
-
if (key === 'numbers') {
|
|
104
|
-
return '0-9';
|
|
105
|
-
}
|
|
106
|
-
var map = mac ? KEY_SYMBOLS_MAC : KEY_LABELS;
|
|
107
|
-
if (map[key]) {
|
|
108
|
-
return map[key];
|
|
109
|
-
}
|
|
110
|
-
if (key.length === 1) {
|
|
111
|
-
return key.toUpperCase();
|
|
112
|
-
}
|
|
113
|
-
return key.charAt(0).toUpperCase() + key.slice(1);
|
|
114
|
-
};
|
|
115
|
-
var splitShortcut = function (shortcut) {
|
|
116
|
-
return (Array.isArray(shortcut) ? shortcut : [shortcut])
|
|
117
|
-
.flatMap(function (combo) { return (typeof combo === 'string' ? combo.split(',') : []); })
|
|
118
|
-
.map(function (combo) { return combo.trim(); })
|
|
119
|
-
.filter(Boolean);
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Turn a single combo (e.g. `'mod+shift+k'`) into a display string.
|
|
123
|
-
* macOS concatenates glyphs (`⌘⇧K`), other platforms join with `+` (`Ctrl+Shift+K`).
|
|
124
|
-
*/
|
|
125
|
-
var formatShortcutCombo = function (combo, mac) {
|
|
126
|
-
if (mac === void 0) { mac = (0, exports.isMacOS)(); }
|
|
127
|
-
return combo
|
|
128
|
-
.split('+')
|
|
129
|
-
.map(function (token) { return formatToken(token, mac); })
|
|
130
|
-
.join(mac ? '' : '+');
|
|
131
|
-
};
|
|
132
|
-
exports.formatShortcutCombo = formatShortcutCombo;
|
|
133
|
-
/**
|
|
134
|
-
* Format a shortcut declaration into one display string per alternative combo.
|
|
135
|
-
*/
|
|
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); });
|
|
139
|
-
};
|
|
140
|
-
exports.formatShortcut = formatShortcut;
|
|
141
|
-
/**
|
|
142
|
-
* Whether any combo in the shortcut uses a modifier key. Used to decide if a
|
|
143
|
-
* button shortcut should still fire while a form field is focused (combos with a
|
|
144
|
-
* modifier are safe; bare single keys would clash with typing).
|
|
145
|
-
*/
|
|
146
|
-
var shortcutHasModifier = function (shortcut) {
|
|
147
|
-
return splitShortcut(shortcut).some(function (combo) {
|
|
148
|
-
return combo.split('+').some(function (token) { return MODIFIER_KEYS.includes(token.trim().toLowerCase()); });
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
exports.shortcutHasModifier = shortcutHasModifier;
|
|
152
|
-
//# sourceMappingURL=shortcuts.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shortcuts.cjs","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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,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.cjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.omitStyleProps = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Builds a `shouldForwardProp` predicate for `styled(...).withConfig({ ... })` that keeps the
|
|
6
|
-
* named props out of the rendered element while leaving every other prop alone.
|
|
7
|
-
*
|
|
8
|
-
* Reqore layout flags (`fill`, `wrap`, ...) are meaningful to a parent — a `ReqoreControlGroup`
|
|
9
|
-
* propagates `fill` through polymorphic children, a `ReqoreTable` threads `wrap` into rows and
|
|
10
|
-
* cells — but they are not valid HTML attributes. Without this filter React renders them as
|
|
11
|
-
* boolean attributes and logs a "received `true` for a non-boolean attribute" warning.
|
|
12
|
-
*
|
|
13
|
-
* IMPORTANT — why the target type is checked. Supplying `shouldForwardProp` *replaces*
|
|
14
|
-
* styled-components' built-in rule outright; it does not layer on top of it. That built-in rule
|
|
15
|
-
* is `isTargetTag ? isPropValid(prop) : true` — a DOM tag only receives real HTML attributes,
|
|
16
|
-
* but a **component** target receives everything, because a component's props are its own API
|
|
17
|
-
* and `isPropValid` knows nothing about them. Chaining `defaultValidatorFn` unconditionally
|
|
18
|
-
* therefore strips a component's entire prop surface: `styled(ReqoreIcon)` silently lost
|
|
19
|
-
* `icon` / `wrapperElement` / `wrapperSize` (the input clear button rendered as an empty span),
|
|
20
|
-
* `styled(StyledEffect) as={Resizable}` lost re-resizable's `enable` / size / handle config, and
|
|
21
|
-
* `ReqoreTextarea as={Editable}` lost Slate's `renderElement` / `renderLeaf` / `decorate`. Each
|
|
22
|
-
* was previously patched with a bespoke per-call-site allow-list; mirroring the built-in rule
|
|
23
|
-
* here fixes all of them at the source, so `styled(SomeComponent)` keeps working like plain
|
|
24
|
-
* styled-components while the explicitly-omitted props still never reach the DOM.
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* const StyledPanel = styled(StyledEffect).withConfig({
|
|
28
|
-
* shouldForwardProp: omitStyleProps('fill'),
|
|
29
|
-
* })<IStyledPanel>`...`;
|
|
30
|
-
*/
|
|
31
|
-
var omitStyleProps = function () {
|
|
32
|
-
var propsToOmit = [];
|
|
33
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
34
|
-
propsToOmit[_i] = arguments[_i];
|
|
35
|
-
}
|
|
36
|
-
var omitted = new Set(propsToOmit);
|
|
37
|
-
return function (prop, defaultValidatorFn, elementToBeCreated) {
|
|
38
|
-
if (omitted.has(prop)) {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
// Mirror styled-components' own default so only the omitted props change behaviour.
|
|
42
|
-
return typeof elementToBeCreated === 'string' ? defaultValidatorFn(prop) : true;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
exports.omitStyleProps = omitStyleProps;
|
|
46
|
-
//# sourceMappingURL=styled.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styled.cjs","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.cjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimeAgoIntervalDelay = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* If the time is larger than one day, update once a day. If the time is larger than one hour,
|
|
6
|
-
update once an hour. Otherwise update every 5 seconds.
|
|
7
|
-
* @param {number} time - the time in milliseconds since the epoch
|
|
8
|
-
* @returns The interval ID.
|
|
9
|
-
*/
|
|
10
|
-
var getTimeAgoIntervalDelay = function (time) {
|
|
11
|
-
// If the time is larger than one day
|
|
12
|
-
if (Date.now() - time > 60000 * 60 * 24) {
|
|
13
|
-
// update once a day
|
|
14
|
-
return 60000 * 60 * 24;
|
|
15
|
-
}
|
|
16
|
-
// If the time is larger than one hour
|
|
17
|
-
if (Date.now() - time > 60000 * 60) {
|
|
18
|
-
// update once an hour
|
|
19
|
-
return 60000 * 60;
|
|
20
|
-
}
|
|
21
|
-
// Otherwise update every 5 seconds
|
|
22
|
-
return 5000;
|
|
23
|
-
};
|
|
24
|
-
exports.getTimeAgoIntervalDelay = getTimeAgoIntervalDelay;
|
|
25
|
-
//# sourceMappingURL=time.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"time.cjs","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.cjs
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
39
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
40
|
-
if (ar || !(i in from)) {
|
|
41
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
42
|
-
ar[i] = from[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
46
|
-
};
|
|
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.cjs");
|
|
54
|
-
var sleep = function (ms) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
55
|
-
switch (_a.label) {
|
|
56
|
-
case 0: return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, ms); })];
|
|
57
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
58
|
-
}
|
|
59
|
-
}); }); };
|
|
60
|
-
exports.sleep = sleep;
|
|
61
|
-
var getTypeFromValue = function (item) {
|
|
62
|
-
if ((0, lodash_1.isBoolean)(item)) {
|
|
63
|
-
return 'boolean';
|
|
64
|
-
}
|
|
65
|
-
if ((0, lodash_1.isString)(item)) {
|
|
66
|
-
return 'string';
|
|
67
|
-
}
|
|
68
|
-
if ((0, lodash_1.isNumber)(item)) {
|
|
69
|
-
return 'number';
|
|
70
|
-
}
|
|
71
|
-
if ((0, lodash_1.isArray)(item)) {
|
|
72
|
-
return 'array';
|
|
73
|
-
}
|
|
74
|
-
if ((0, lodash_1.isObject)(item)) {
|
|
75
|
-
return 'object';
|
|
76
|
-
}
|
|
77
|
-
if ((0, lodash_1.isFunction)(item)) {
|
|
78
|
-
return 'function';
|
|
79
|
-
}
|
|
80
|
-
if ((0, lodash_1.isNull)(item) || (0, lodash_1.isUndefined)(item)) {
|
|
81
|
-
return 'null';
|
|
82
|
-
}
|
|
83
|
-
return 'null';
|
|
84
|
-
};
|
|
85
|
-
exports.getTypeFromValue = getTypeFromValue;
|
|
86
|
-
var getLineCount = function (value) {
|
|
87
|
-
var _a, _b;
|
|
88
|
-
try {
|
|
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;
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
return 0;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
exports.getLineCount = getLineCount;
|
|
96
|
-
// A function that takes list of objects and transforms it
|
|
97
|
-
// to a CSV string
|
|
98
|
-
var convertToCSV = function (objArray) {
|
|
99
|
-
var header = Object.keys(objArray[0]).join(',');
|
|
100
|
-
var rows = objArray.map(function (obj) {
|
|
101
|
-
return Object.values(obj)
|
|
102
|
-
.map(function (value) { return JSON.stringify(value); })
|
|
103
|
-
.join(',');
|
|
104
|
-
});
|
|
105
|
-
return __spreadArray([header], rows, true).join('\n');
|
|
106
|
-
};
|
|
107
|
-
exports.convertToCSV = convertToCSV;
|
|
108
|
-
var calculateStringSizeInPixels = function (value, fontSize, spaced) {
|
|
109
|
-
if (value === void 0) { value = ''; }
|
|
110
|
-
if (spaced === void 0) { spaced = 0; }
|
|
111
|
-
var widths = [
|
|
112
|
-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
113
|
-
0.2796875, 0.2765625, 0.3546875, 0.5546875, 0.5546875, 0.8890625, 0.665625, 0.190625, 0.3328125,
|
|
114
|
-
0.3328125, 0.3890625, 0.5828125, 0.2765625, 0.3328125, 0.2765625, 0.3015625, 0.5546875,
|
|
115
|
-
0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875, 0.5546875,
|
|
116
|
-
0.5546875, 0.2765625, 0.2765625, 0.584375, 0.5828125, 0.584375, 0.5546875, 1.0140625, 0.665625,
|
|
117
|
-
0.665625, 0.721875, 0.721875, 0.665625, 0.609375, 0.7765625, 0.721875, 0.2765625, 0.5, 0.665625,
|
|
118
|
-
0.5546875, 0.8328125, 0.721875, 0.7765625, 0.665625, 0.7765625, 0.721875, 0.665625, 0.609375,
|
|
119
|
-
0.721875, 0.665625, 0.94375, 0.665625, 0.665625, 0.609375, 0.2765625, 0.3546875, 0.2765625,
|
|
120
|
-
0.4765625, 0.5546875, 0.3328125, 0.5546875, 0.5546875, 0.5, 0.5546875, 0.5546875, 0.2765625,
|
|
121
|
-
0.5546875, 0.5546875, 0.221875, 0.240625, 0.5, 0.221875, 0.8328125, 0.5546875, 0.5546875,
|
|
122
|
-
0.5546875, 0.5546875, 0.3328125, 0.5, 0.2765625, 0.5546875, 0.5, 0.721875, 0.5, 0.5, 0.5,
|
|
123
|
-
0.3546875, 0.259375, 0.353125, 0.5890625,
|
|
124
|
-
];
|
|
125
|
-
var avg = 0.5279276315789471;
|
|
126
|
-
/* It's calculating the width of a string in pixels. */
|
|
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) *
|
|
128
|
-
(fontSize * (1.4 + spaced / 2)));
|
|
129
|
-
};
|
|
130
|
-
exports.calculateStringSizeInPixels = calculateStringSizeInPixels;
|
|
131
|
-
var isStringSize = function (value) {
|
|
132
|
-
return sizes_1.SIZES.includes(value);
|
|
133
|
-
};
|
|
134
|
-
exports.isStringSize = isStringSize;
|
|
135
|
-
/**
|
|
136
|
-
* Resolves an accent-strip thickness (`ReqoreCallout` / `ReqorePanel` `accentSize`) to pixels.
|
|
137
|
-
*
|
|
138
|
-
* Accepts a raw pixel number or a `TSizes` name looked up in `ACCENT_SIZE_TO_PX`. `'normal'` is
|
|
139
|
-
* the default, which makes that map the SINGLE source of the default thickness — components must
|
|
140
|
-
* NOT re-declare a numeric default of their own, or the string and number forms drift apart.
|
|
141
|
-
*
|
|
142
|
-
* Resolution happens once, at the component level, because the accent styles interpolate the
|
|
143
|
-
* result into `px` and do arithmetic with it (the padding reservation) — so the css must never
|
|
144
|
-
* see a string.
|
|
145
|
-
*/
|
|
146
|
-
var resolveAccentSize = function (accentSize) {
|
|
147
|
-
if (accentSize === void 0) { accentSize = 'normal'; }
|
|
148
|
-
return (0, exports.isStringSize)(accentSize) ? sizes_1.ACCENT_SIZE_TO_PX[accentSize] : accentSize;
|
|
149
|
-
};
|
|
150
|
-
exports.resolveAccentSize = resolveAccentSize;
|
|
151
|
-
var getOneLessSize = function (size) {
|
|
152
|
-
if (size === void 0) { size = 'normal'; }
|
|
153
|
-
// Get the initial sizes number
|
|
154
|
-
var initialSizeNumber = sizes_1.SIZE_TO_NUMBER[size];
|
|
155
|
-
// Reduce the size number by one
|
|
156
|
-
var oneLessSizeNumber = initialSizeNumber - 1 === 0 ? 1 : initialSizeNumber - 1;
|
|
157
|
-
// Get the size name from the number
|
|
158
|
-
return sizes_1.NUMBER_TO_SIZE[oneLessSizeNumber];
|
|
159
|
-
};
|
|
160
|
-
exports.getOneLessSize = getOneLessSize;
|
|
161
|
-
/**
|
|
162
|
-
* Builds a CSS `padding` shorthand value for surface components that support
|
|
163
|
-
* the `padded` + `paddingSize` prop pair.
|
|
164
|
-
*
|
|
165
|
-
* - `padded={false}` → no padding
|
|
166
|
-
* - `padded='horizontal'` → only left/right padding
|
|
167
|
-
* - `padded='vertical'` → only top/bottom padding
|
|
168
|
-
* - `padded={true}` (default) → padding on both axes
|
|
169
|
-
*
|
|
170
|
-
* The base padding for each axis is `PADDING_FROM_SIZE[paddingSize] *
|
|
171
|
-
* <multiplier>`. Pass per-component multipliers (e.g. EntityRow uses `v=2,
|
|
172
|
-
* h=3`; Statistic uses `v=3, h=5`).
|
|
173
|
-
*/
|
|
174
|
-
var resolvePadding = function (_a) {
|
|
175
|
-
var padded = _a.padded, paddingSize = _a.paddingSize, verticalMultiplier = _a.verticalMultiplier, horizontalMultiplier = _a.horizontalMultiplier;
|
|
176
|
-
if (padded === false)
|
|
177
|
-
return '0';
|
|
178
|
-
var v = sizes_1.PADDING_FROM_SIZE[paddingSize] * verticalMultiplier;
|
|
179
|
-
var h = sizes_1.PADDING_FROM_SIZE[paddingSize] * horizontalMultiplier;
|
|
180
|
-
if (padded === 'horizontal')
|
|
181
|
-
return "0 ".concat(h, "px");
|
|
182
|
-
if (padded === 'vertical')
|
|
183
|
-
return "".concat(v, "px 0");
|
|
184
|
-
return "".concat(v, "px ").concat(h, "px");
|
|
185
|
-
};
|
|
186
|
-
exports.resolvePadding = resolvePadding;
|
|
187
|
-
var getOneHigherSize = function (size) {
|
|
188
|
-
// Get the initial sizes number
|
|
189
|
-
var initialSizeNumber = sizes_1.SIZE_TO_NUMBER[size];
|
|
190
|
-
// Reduce the size number by one
|
|
191
|
-
var oneHigherSizeNumber = initialSizeNumber + 1 === 8 ? 7 : initialSizeNumber + 1;
|
|
192
|
-
// Get the size name from the number
|
|
193
|
-
return sizes_1.NUMBER_TO_SIZE[oneHigherSizeNumber];
|
|
194
|
-
};
|
|
195
|
-
exports.getOneHigherSize = getOneHigherSize;
|
|
196
|
-
var isActionShown = function (action) {
|
|
197
|
-
return action.show !== false;
|
|
198
|
-
};
|
|
199
|
-
exports.isActionShown = isActionShown;
|
|
200
|
-
var alignToFlexAlign = function (align) {
|
|
201
|
-
switch (align) {
|
|
202
|
-
case 'left':
|
|
203
|
-
return 'flex-start';
|
|
204
|
-
case 'right':
|
|
205
|
-
return 'flex-end';
|
|
206
|
-
case 'center':
|
|
207
|
-
return 'center';
|
|
208
|
-
default:
|
|
209
|
-
return 'flex-start';
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
exports.alignToFlexAlign = alignToFlexAlign;
|
|
213
|
-
function decycle(obj, stack) {
|
|
214
|
-
if (stack === void 0) { stack = []; }
|
|
215
|
-
if (!obj || typeof obj !== 'object')
|
|
216
|
-
return obj;
|
|
217
|
-
if (stack.includes(obj))
|
|
218
|
-
return null;
|
|
219
|
-
var s = stack.concat([obj]);
|
|
220
|
-
return Array.isArray(obj)
|
|
221
|
-
? obj.map(function (x) { return decycle(x, s); })
|
|
222
|
-
: Object.fromEntries(Object.entries(obj).map(function (_a) {
|
|
223
|
-
var k = _a[0], v = _a[1];
|
|
224
|
-
return [k, decycle(v, s)];
|
|
225
|
-
}));
|
|
226
|
-
}
|
|
227
|
-
var stringifyAndDecycleObject = function (obj) {
|
|
228
|
-
return JSON.stringify(decycle(obj), function (_key, value) {
|
|
229
|
-
if (typeof value === 'function') {
|
|
230
|
-
return value.toString();
|
|
231
|
-
}
|
|
232
|
-
return value;
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
exports.stringifyAndDecycleObject = stringifyAndDecycleObject;
|
|
236
|
-
function parseInputValue(input) {
|
|
237
|
-
if ((0, lodash_1.isBoolean)(input)) {
|
|
238
|
-
return input;
|
|
239
|
-
}
|
|
240
|
-
if ((0, lodash_1.isNumber)(input)) {
|
|
241
|
-
return input;
|
|
242
|
-
}
|
|
243
|
-
if (!(0, lodash_1.isString)(input)) {
|
|
244
|
-
return input;
|
|
245
|
-
}
|
|
246
|
-
// Check for explicit quotes to save as a string
|
|
247
|
-
if (input.startsWith('"') && input.endsWith('"')) {
|
|
248
|
-
return input.slice(1, -1); // Remove the quotes
|
|
249
|
-
}
|
|
250
|
-
// Attempt to parse as a number
|
|
251
|
-
var parsedNumber = Number(input);
|
|
252
|
-
if (!isNaN(parsedNumber)) {
|
|
253
|
-
return parsedNumber;
|
|
254
|
-
}
|
|
255
|
-
// Attempt to parse as a boolean
|
|
256
|
-
if (input === 'true') {
|
|
257
|
-
return true;
|
|
258
|
-
}
|
|
259
|
-
else if (input === 'false') {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
// Default to a string
|
|
263
|
-
return input;
|
|
264
|
-
}
|
|
265
|
-
function buildTooltipForComponents(tooltip) {
|
|
266
|
-
if ((0, lodash_1.isString)(tooltip)) {
|
|
267
|
-
return { content: tooltip };
|
|
268
|
-
}
|
|
269
|
-
return tooltip;
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Wraps a click handler so the click stops at the element that owns it.
|
|
273
|
-
*
|
|
274
|
-
* Row-shaped components (`ReqoreSeverityRow`, `ReqoreEntityRow`) and
|
|
275
|
-
* `ReqorePanel` all render their actions *inside* a surface that may carry its
|
|
276
|
-
* own `onClick`. Without this the two handlers both run, and where they do the
|
|
277
|
-
* same thing — the common "the row and its caret toggle one disclosure" shape —
|
|
278
|
-
* they cancel out and the action reads as dead.
|
|
279
|
-
*
|
|
280
|
-
* The wrapper is what each of those components applies to every action it
|
|
281
|
-
* renders, so a consumer never has to remember. An action that genuinely wants
|
|
282
|
-
* the surface to react as well calls the surface's handler itself: explicit, at
|
|
283
|
-
* one call site, rather than implicit at all of them.
|
|
284
|
-
*
|
|
285
|
-
* Call with no argument for a pure stopper (`onClick={withStoppedPropagation()}`).
|
|
286
|
-
*/
|
|
287
|
-
var withStoppedPropagation = function (onClick) {
|
|
288
|
-
return function (event) {
|
|
289
|
-
event.stopPropagation();
|
|
290
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
291
|
-
};
|
|
292
|
-
};
|
|
293
|
-
exports.withStoppedPropagation = withStoppedPropagation;
|
|
294
|
-
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgMA,0BAUC;AAYD,0CAiCC;AAED,8DAMC;AA/PD,iCASgB;AAEhB,4CAO4B;AAGrB,IAAM,KAAK,GAAG,UAAO,EAAU;;gBAAK,qBAAM,IAAI,OAAO,CAAC,UAAC,CAAC,IAAK,OAAA,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EAAjB,CAAiB,CAAC,EAAA;gBAA3C,sBAAA,SAA2C,EAAA;;SAAA,CAAC;AAA1E,QAAA,KAAK,SAAqE;AAEhF,IAAM,gBAAgB,GA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AAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB;IACjD,CAAC;IAED,+BAA+B;IAC/B,IAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QACzB,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,gCAAgC;IAChC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,sBAAsB;IACtB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,yBAAyB,CAAC,OAA2B;IACnE,IAAI,IAAA,iBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACI,IAAM,sBAAsB,GACjC,UAAwB,OAA8C;IACtE,OAAA,UAAC,KAA0B;QACzB,KAAK,CAAC,eAAe,EAAE,CAAC;QACxB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,KAAK,CAAC,CAAC;IACnB,CAAC;AAHD,CAGC,CAAC;AALS,QAAA,sBAAsB,0BAK/B"}
|
|
@@ -1,84 +0,0 @@
|
|
|
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 () {
|
|
10
|
-
if (!rules.viewportOnly || isInViewport.current) {
|
|
11
|
-
if (rules.clearOnFocus) {
|
|
12
|
-
onChange === null || onChange === void 0 ? void 0 : onChange({ target: { value: '' } });
|
|
13
|
-
}
|
|
14
|
-
element.setSelectionRange(-1, -1);
|
|
15
|
-
element.focus();
|
|
16
|
-
}
|
|
17
|
-
// Note: isInViewport.current is intentionally not in deps as it's a ref that's read at call time
|
|
18
|
-
}, [element, rules, onChange]);
|
|
19
|
-
var handleKeyDown = (0, react_1.useCallback)(function (e) {
|
|
20
|
-
// Check if this event came from another html input or a content-editable div
|
|
21
|
-
if (e.target &&
|
|
22
|
-
(e.target.tagName === 'INPUT' ||
|
|
23
|
-
e.target.tagName === 'TEXTAREA' ||
|
|
24
|
-
e.target.isContentEditable)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
var shortcut = Array.isArray(rules === null || rules === void 0 ? void 0 : rules.shortcut) ? rules === null || rules === void 0 ? void 0 : rules.shortcut : [rules === null || rules === void 0 ? void 0 : rules.shortcut];
|
|
28
|
-
if (shortcut.includes('letters') && e.key.length === 1 && e.key.match(/[a-z]/i)) {
|
|
29
|
-
focus();
|
|
30
|
-
}
|
|
31
|
-
if (shortcut.includes('numbers') && e.key.length === 1 && e.key.match(/[0-9]/i)) {
|
|
32
|
-
focus();
|
|
33
|
-
}
|
|
34
|
-
if (shortcut.includes(e.key)) {
|
|
35
|
-
focus();
|
|
36
|
-
}
|
|
37
|
-
}, [rules === null || rules === void 0 ? void 0 : rules.shortcut, focus]);
|
|
38
|
-
(0, react_use_1.useUpdateEffect)(function () {
|
|
39
|
-
if (element && rules) {
|
|
40
|
-
if (rules.viewportOnly) {
|
|
41
|
-
observer.current = new IntersectionObserver(function (entries) {
|
|
42
|
-
entries.forEach(function (entry) {
|
|
43
|
-
var _a;
|
|
44
|
-
if (entry.isIntersecting) {
|
|
45
|
-
isInViewport.current = true;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
isInViewport.current = false;
|
|
49
|
-
}
|
|
50
|
-
// If the focus type is auto, we focus the element now if its in the viewport
|
|
51
|
-
// and set the observer to null so it doesn't run again
|
|
52
|
-
if (rules.type === 'auto' && isInViewport.current) {
|
|
53
|
-
element.focus();
|
|
54
|
-
(_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
55
|
-
observer.current = null;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}, {
|
|
59
|
-
root: rules === null || rules === void 0 ? void 0 : rules.viewport,
|
|
60
|
-
rootMargin: rules === null || rules === void 0 ? void 0 : rules.viewportMargin,
|
|
61
|
-
threshold: 0.8,
|
|
62
|
-
});
|
|
63
|
-
observer.current.observe(element);
|
|
64
|
-
}
|
|
65
|
-
else if (rules.type === 'auto') {
|
|
66
|
-
focus();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}, [element]);
|
|
70
|
-
(0, react_use_1.useUnmount)(function () {
|
|
71
|
-
var _a;
|
|
72
|
-
(_a = observer.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
73
|
-
});
|
|
74
|
-
(0, react_1.useEffect)(function () {
|
|
75
|
-
if (element && rules && rules.type === 'keypress') {
|
|
76
|
-
window.addEventListener(rules.doNotInsertShortcut ? 'keyup' : 'keydown', handleKeyDown);
|
|
77
|
-
}
|
|
78
|
-
return function () {
|
|
79
|
-
return window.removeEventListener((rules === null || rules === void 0 ? void 0 : rules.doNotInsertShortcut) ? 'keyup' : 'keydown', handleKeyDown);
|
|
80
|
-
};
|
|
81
|
-
}, [element, rules, handleKeyDown]);
|
|
82
|
-
};
|
|
83
|
-
exports.useAutoFocus = useAutoFocus;
|
|
84
|
-
//# sourceMappingURL=useAutoFocus.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoFocus.cjs","sourceRoot":"","sources":["../../src/hooks/useAutoFocus.ts"],"names":[],"mappings":";;;AAAA,+BAAuD;AACvD,uCAAwD;AAcjD,IAAM,YAAY,GAAG,UAC1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