@foxford/ui 2.76.1 → 2.77.0-beta-90a741d-20250807
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/LICENSE +27 -0
- package/components/Accordion/Accordion.js +1 -1
- package/components/Accordion/Accordion.js.map +1 -1
- package/components/Accordion/Accordion.mjs +1 -1
- package/components/Accordion/Accordion.mjs.map +1 -1
- package/components/Accordion/hooks.js +1 -1
- package/components/Accordion/hooks.js.map +1 -1
- package/components/Accordion/hooks.mjs +1 -1
- package/components/Accordion/hooks.mjs.map +1 -1
- package/components/AccordionItem/AccordionItem.js +1 -1
- package/components/AccordionItem/AccordionItem.js.map +1 -1
- package/components/AccordionItem/AccordionItem.mjs +1 -1
- package/components/AccordionItem/AccordionItem.mjs.map +1 -1
- package/components/ActionBtn/ActionBtn.js +1 -1
- package/components/ActionBtn/ActionBtn.js.map +1 -1
- package/components/ActionBtn/ActionBtn.mjs +1 -1
- package/components/ActionBtn/ActionBtn.mjs.map +1 -1
- package/components/ActionBtn/style.js.map +1 -1
- package/components/ActionBtn/style.mjs.map +1 -1
- package/components/Alert/Alert.js +1 -1
- package/components/Alert/Alert.js.map +1 -1
- package/components/Alert/Alert.mjs +1 -1
- package/components/Alert/Alert.mjs.map +1 -1
- package/components/Amount/Amount.js +1 -1
- package/components/Amount/Amount.js.map +1 -1
- package/components/Amount/Amount.mjs +1 -1
- package/components/Amount/Amount.mjs.map +1 -1
- package/components/Amount/data/index.js.map +1 -1
- package/components/Amount/data/index.mjs.map +1 -1
- package/components/Amount/style.js.map +1 -1
- package/components/Amount/style.mjs.map +1 -1
- package/components/Anchor/Anchor.js +1 -1
- package/components/Anchor/Anchor.js.map +1 -1
- package/components/Anchor/Anchor.mjs +1 -1
- package/components/Anchor/Anchor.mjs.map +1 -1
- package/components/Arrow/Arrow.js.map +1 -1
- package/components/Arrow/Arrow.mjs.map +1 -1
- package/components/ArrowBadge/ArrowBadge.js.map +1 -1
- package/components/ArrowBadge/ArrowBadge.mjs.map +1 -1
- package/components/AspectRatio/style.js.map +1 -1
- package/components/AspectRatio/style.mjs.map +1 -1
- package/components/Avatar/Avatar.js +1 -1
- package/components/Avatar/Avatar.js.map +1 -1
- package/components/Avatar/Avatar.mjs +1 -1
- package/components/Avatar/Avatar.mjs.map +1 -1
- package/components/Avatar/utils.js.map +1 -1
- package/components/Avatar/utils.mjs.map +1 -1
- package/components/Badge/Badge.js +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/components/Badge/Badge.mjs +1 -1
- package/components/Badge/Badge.mjs.map +1 -1
- package/components/Button/Button.js +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/Button/Button.mjs +1 -1
- package/components/Button/Button.mjs.map +1 -1
- package/components/Button/hooks.js.map +1 -1
- package/components/Button/hooks.mjs.map +1 -1
- package/components/Button/style.js.map +1 -1
- package/components/Button/style.mjs.map +1 -1
- package/components/Checkbox/Checkbox.js +1 -1
- package/components/Checkbox/Checkbox.js.map +1 -1
- package/components/Checkbox/Checkbox.mjs +1 -1
- package/components/Checkbox/Checkbox.mjs.map +1 -1
- package/components/Chip/Chip.js +1 -1
- package/components/Chip/Chip.js.map +1 -1
- package/components/Chip/Chip.mjs +1 -1
- package/components/Chip/Chip.mjs.map +1 -1
- package/components/Container/Container.js.map +1 -1
- package/components/Container/Container.mjs.map +1 -1
- package/components/Container/style.js.map +1 -1
- package/components/Container/style.mjs.map +1 -1
- package/components/ContextMenu/ContextMenu.js +1 -1
- package/components/ContextMenu/ContextMenu.js.map +1 -1
- package/components/ContextMenu/ContextMenu.mjs +1 -1
- package/components/ContextMenu/ContextMenu.mjs.map +1 -1
- package/components/ContextMenu/Item.js.map +1 -1
- package/components/ContextMenu/Item.mjs.map +1 -1
- package/components/ContextMenu/style.js.map +1 -1
- package/components/ContextMenu/style.mjs.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.js.map +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs +1 -1
- package/components/ContextMenu.Multilevel/ContextMenu.Multilevel.mjs.map +1 -1
- package/components/ContextMenu.Multilevel/Controls.js.map +1 -1
- package/components/ContextMenu.Multilevel/Controls.mjs.map +1 -1
- package/components/Dialog/Dialog.js.map +1 -1
- package/components/Dialog/Dialog.mjs.map +1 -1
- package/components/DialogComponent/DialogComponent.js +1 -1
- package/components/DialogComponent/DialogComponent.js.map +1 -1
- package/components/DialogComponent/DialogComponent.mjs +1 -1
- package/components/DialogComponent/DialogComponent.mjs.map +1 -1
- package/components/DialogComponent/style.js.map +1 -1
- package/components/DialogComponent/style.mjs.map +1 -1
- package/components/Divider/style.js.map +1 -1
- package/components/Divider/style.mjs.map +1 -1
- package/components/Dropdown/Dropdown.js +1 -1
- package/components/Dropdown/Dropdown.js.map +1 -1
- package/components/Dropdown/Dropdown.mjs +1 -1
- package/components/Dropdown/Dropdown.mjs.map +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.js +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.js.map +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.mjs +1 -1
- package/components/Dropdown/DropdownMenuNoOptions.mjs.map +1 -1
- package/components/Dropdown/hooks.js.map +1 -1
- package/components/Dropdown/hooks.mjs.map +1 -1
- package/components/FormInput/FormInput.js.map +1 -1
- package/components/FormInput/FormInput.mjs.map +1 -1
- package/components/FormInputLabel/FormInputLabel.js +1 -1
- package/components/FormInputLabel/FormInputLabel.js.map +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs +1 -1
- package/components/FormInputLabel/FormInputLabel.mjs.map +1 -1
- package/components/FormLabel/FormLabel.js +1 -1
- package/components/FormLabel/FormLabel.js.map +1 -1
- package/components/FormLabel/FormLabel.mjs +1 -1
- package/components/FormLabel/FormLabel.mjs.map +1 -1
- package/components/Icon/Icon.js +1 -1
- package/components/Icon/Icon.js.map +1 -1
- package/components/Icon/Icon.mjs +1 -1
- package/components/Icon/Icon.mjs.map +1 -1
- package/components/Icon/bg-worker.js.map +1 -1
- package/components/Icon/bg-worker.mjs.map +1 -1
- package/components/Icon/list/default.js.map +1 -1
- package/components/Icon/list/default.mjs.map +1 -1
- package/components/Icon/list/icon-pack.js.map +1 -1
- package/components/Icon/list/icon-pack.mjs.map +1 -1
- package/components/IconButton/IconButton.js.map +1 -1
- package/components/IconButton/IconButton.mjs.map +1 -1
- package/components/Indicator/Indicator.js +1 -1
- package/components/Indicator/Indicator.js.map +1 -1
- package/components/Indicator/Indicator.mjs +1 -1
- package/components/Indicator/Indicator.mjs.map +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Input/Input.mjs.map +1 -1
- package/components/Input/helpers.js.map +1 -1
- package/components/Input/helpers.mjs.map +1 -1
- package/components/Input.Phone/Input.Phone.js.map +1 -1
- package/components/Input.Phone/Input.Phone.mjs.map +1 -1
- package/components/InputCheckbox/InputCheckbox.js.map +1 -1
- package/components/InputCheckbox/InputCheckbox.mjs.map +1 -1
- package/components/InputRadio/InputRadio.js.map +1 -1
- package/components/InputRadio/InputRadio.mjs.map +1 -1
- package/components/ListItem/ListItem.js +1 -1
- package/components/ListItem/ListItem.js.map +1 -1
- package/components/ListItem/ListItem.mjs +1 -1
- package/components/ListItem/ListItem.mjs.map +1 -1
- package/components/Menu/Menu.js.map +1 -1
- package/components/Menu/Menu.mjs.map +1 -1
- package/components/MenuComponent/MenuComponent.js.map +1 -1
- package/components/MenuComponent/MenuComponent.mjs.map +1 -1
- package/components/MenuComponent/style.js +1 -1
- package/components/MenuComponent/style.js.map +1 -1
- package/components/MenuComponent/style.mjs +1 -1
- package/components/MenuComponent/style.mjs.map +1 -1
- package/components/MenuContainer/MenuContainer.js +1 -1
- package/components/MenuContainer/MenuContainer.js.map +1 -1
- package/components/MenuContainer/MenuContainer.mjs +1 -1
- package/components/MenuContainer/MenuContainer.mjs.map +1 -1
- package/components/MenuDivider/MenuDivider.js +1 -1
- package/components/MenuDivider/MenuDivider.js.map +1 -1
- package/components/MenuDivider/MenuDivider.mjs +1 -1
- package/components/MenuDivider/MenuDivider.mjs.map +1 -1
- package/components/MenuList/MenuList.js.map +1 -1
- package/components/MenuList/MenuList.mjs.map +1 -1
- package/components/Modal/Modal.js.map +1 -1
- package/components/Modal/Modal.mjs.map +1 -1
- package/components/Modal/adapter.js.map +1 -1
- package/components/Modal/adapter.mjs.map +1 -1
- package/components/Modal/style.js +1 -1
- package/components/Modal/style.js.map +1 -1
- package/components/Modal/style.mjs +1 -1
- package/components/Modal/style.mjs.map +1 -1
- package/components/Notification/Notification.js +1 -1
- package/components/Notification/Notification.js.map +1 -1
- package/components/Notification/Notification.mjs +1 -1
- package/components/Notification/Notification.mjs.map +1 -1
- package/components/Paper/Paper.js.map +1 -1
- package/components/Paper/Paper.mjs.map +1 -1
- package/components/Paper/style.js.map +1 -1
- package/components/Paper/style.mjs.map +1 -1
- package/components/Popover/Popover.js.map +1 -1
- package/components/Popover/Popover.mjs.map +1 -1
- package/components/PopoverComponent/PopoverComponent.js +1 -1
- package/components/PopoverComponent/PopoverComponent.js.map +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs +1 -1
- package/components/PopoverComponent/PopoverComponent.mjs.map +1 -1
- package/components/Progress/Progress.js.map +1 -1
- package/components/Progress/Progress.mjs.map +1 -1
- package/components/Progress/style.js +1 -1
- package/components/Progress/style.js.map +1 -1
- package/components/Progress/style.mjs +1 -1
- package/components/Progress/style.mjs.map +1 -1
- package/components/Progress.Circle/Progress.Circle.js +1 -1
- package/components/Progress.Circle/Progress.Circle.js.map +1 -1
- package/components/Progress.Circle/Progress.Circle.mjs +1 -1
- package/components/Progress.Circle/Progress.Circle.mjs.map +1 -1
- package/components/Progress.Circle/style.js +1 -1
- package/components/Progress.Circle/style.js.map +1 -1
- package/components/Progress.Circle/style.mjs +1 -1
- package/components/Progress.Circle/style.mjs.map +1 -1
- package/components/Progress.Segmented/Progress.Segmented.js.map +1 -1
- package/components/Progress.Segmented/Progress.Segmented.mjs.map +1 -1
- package/components/Progress.Segmented/style.js.map +1 -1
- package/components/Progress.Segmented/style.mjs.map +1 -1
- package/components/ProgressCircle/ProgressCircle.js +1 -1
- package/components/ProgressCircle/ProgressCircle.js.map +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs +1 -1
- package/components/ProgressCircle/ProgressCircle.mjs.map +1 -1
- package/components/ProgressCircle/style.js +1 -1
- package/components/ProgressCircle/style.js.map +1 -1
- package/components/ProgressCircle/style.mjs +1 -1
- package/components/ProgressCircle/style.mjs.map +1 -1
- package/components/ProgressLine/ProgressLine.js +1 -1
- package/components/ProgressLine/ProgressLine.js.map +1 -1
- package/components/ProgressLine/ProgressLine.mjs +1 -1
- package/components/ProgressLine/ProgressLine.mjs.map +1 -1
- package/components/Radio/Group.js.map +1 -1
- package/components/Radio/Group.mjs.map +1 -1
- package/components/Radio/Radio.js +1 -1
- package/components/Radio/Radio.js.map +1 -1
- package/components/Radio/Radio.mjs +1 -1
- package/components/Radio/Radio.mjs.map +1 -1
- package/components/Radio/style.js.map +1 -1
- package/components/Radio/style.mjs.map +1 -1
- package/components/Scrollable/Scrollable.js +1 -1
- package/components/Scrollable/Scrollable.js.map +1 -1
- package/components/Scrollable/Scrollable.mjs +1 -1
- package/components/Scrollable/Scrollable.mjs.map +1 -1
- package/components/Section/Section.js.map +1 -1
- package/components/Section/Section.mjs.map +1 -1
- package/components/Section/style.js +1 -1
- package/components/Section/style.js.map +1 -1
- package/components/Section/style.mjs +1 -1
- package/components/Section/style.mjs.map +1 -1
- package/components/Select/Select.js.map +1 -1
- package/components/Select/Select.mjs.map +1 -1
- package/components/Select/style.js +1 -1
- package/components/Select/style.js.map +1 -1
- package/components/Select/style.mjs +1 -1
- package/components/Select/style.mjs.map +1 -1
- package/components/Separator/Separator.js.map +1 -1
- package/components/Separator/Separator.mjs.map +1 -1
- package/components/Separator/SeparatorText.js.map +1 -1
- package/components/Separator/SeparatorText.mjs.map +1 -1
- package/components/Separator/style.js +1 -1
- package/components/Separator/style.js.map +1 -1
- package/components/Separator/style.mjs +1 -1
- package/components/Separator/style.mjs.map +1 -1
- package/components/Spacer/Spacer.js.map +1 -1
- package/components/Spacer/Spacer.mjs.map +1 -1
- package/components/Spacer/style.js.map +1 -1
- package/components/Spacer/style.mjs.map +1 -1
- package/components/Spinner/Spinner.js.map +1 -1
- package/components/Spinner/Spinner.mjs.map +1 -1
- package/components/Spinner/style.js +1 -1
- package/components/Spinner/style.js.map +1 -1
- package/components/Spinner/style.mjs +1 -1
- package/components/Spinner/style.mjs.map +1 -1
- package/components/Switch/Switch.js.map +1 -1
- package/components/Switch/Switch.mjs.map +1 -1
- package/components/Switcher/style.js.map +1 -1
- package/components/Switcher/style.mjs.map +1 -1
- package/components/Tab/Tab.js +1 -1
- package/components/Tab/Tab.js.map +1 -1
- package/components/Tab/Tab.mjs +1 -1
- package/components/Tab/Tab.mjs.map +1 -1
- package/components/TabList/TabList.js +1 -1
- package/components/TabList/TabList.js.map +1 -1
- package/components/TabList/TabList.mjs +1 -1
- package/components/TabList/TabList.mjs.map +1 -1
- package/components/TabList/TabListMenuTab.js +1 -1
- package/components/TabList/TabListMenuTab.js.map +1 -1
- package/components/TabList/TabListMenuTab.mjs +1 -1
- package/components/TabList/TabListMenuTab.mjs.map +1 -1
- package/components/TabList/TabListPanel.js.map +1 -1
- package/components/TabList/TabListPanel.mjs.map +1 -1
- package/components/TabList/hooks.js +1 -1
- package/components/TabList/hooks.js.map +1 -1
- package/components/TabList/hooks.mjs +1 -1
- package/components/TabList/hooks.mjs.map +1 -1
- package/components/TabList/style.js +1 -1
- package/components/TabList/style.js.map +1 -1
- package/components/TabList/style.mjs +1 -1
- package/components/TabList/style.mjs.map +1 -1
- package/components/TabListTab/TabListTab.js.map +1 -1
- package/components/TabListTab/TabListTab.mjs.map +1 -1
- package/components/TabListTab/style.js +1 -1
- package/components/TabListTab/style.js.map +1 -1
- package/components/TabListTab/style.mjs +1 -1
- package/components/TabListTab/style.mjs.map +1 -1
- package/components/Tabs/Tabs.js.map +1 -1
- package/components/Tabs/Tabs.mjs.map +1 -1
- package/components/Tabs/style.js +1 -1
- package/components/Tabs/style.js.map +1 -1
- package/components/Tabs/style.mjs +1 -1
- package/components/Tabs/style.mjs.map +1 -1
- package/components/Tag/Tag.js +1 -1
- package/components/Tag/Tag.js.map +1 -1
- package/components/Tag/Tag.mjs +1 -1
- package/components/Tag/Tag.mjs.map +1 -1
- package/components/Tag/style.js +1 -1
- package/components/Tag/style.js.map +1 -1
- package/components/Tag/style.mjs +1 -1
- package/components/Tag/style.mjs.map +1 -1
- package/components/Text/Ellipsis.js +1 -1
- package/components/Text/Ellipsis.js.map +1 -1
- package/components/Text/Ellipsis.mjs +1 -1
- package/components/Text/Ellipsis.mjs.map +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/Text.mjs.map +1 -1
- package/components/Text/style.js.map +1 -1
- package/components/Text/style.mjs.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js +1 -1
- package/components/Text.Ellipse/Text.Ellipse.js.map +1 -1
- package/components/Text.Ellipse/Text.Ellipse.mjs +1 -1
- package/components/Text.Ellipse/Text.Ellipse.mjs.map +1 -1
- package/components/Textarea/Textarea.js +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/Textarea.mjs +1 -1
- package/components/Textarea/Textarea.mjs.map +1 -1
- package/components/Tooltip/Tooltip.js.map +1 -1
- package/components/Tooltip/Tooltip.mjs.map +1 -1
- package/components/Tooltip/TooltipWrapper.js.map +1 -1
- package/components/Tooltip/TooltipWrapper.mjs.map +1 -1
- package/components/TooltipComponent/TooltipComponent.js +1 -1
- package/components/TooltipComponent/TooltipComponent.js.map +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs +1 -1
- package/components/TooltipComponent/TooltipComponent.mjs.map +1 -1
- package/dts/index.d.ts +2630 -2557
- package/hocs/withMergedProps.js.map +1 -1
- package/hocs/withMergedProps.mjs.map +1 -1
- package/hocs/withTranslation.js +1 -1
- package/hocs/withTranslation.js.map +1 -1
- package/hocs/withTranslation.mjs +1 -1
- package/hocs/withTranslation.mjs.map +1 -1
- package/hooks/use-config-priority.js.map +1 -1
- package/hooks/use-config-priority.mjs +1 -1
- package/hooks/use-config-priority.mjs.map +1 -1
- package/hooks/useClickOutside.js.map +1 -1
- package/hooks/useClickOutside.mjs.map +1 -1
- package/hooks/useMergedPalette.js +1 -1
- package/hooks/useMergedPalette.js.map +1 -1
- package/hooks/useMergedPalette.mjs +1 -1
- package/hooks/useMergedPalette.mjs.map +1 -1
- package/hooks/useMergedProps.js.map +1 -1
- package/hooks/useMergedProps.mjs.map +1 -1
- package/hooks/useMergedSizes.js.map +1 -1
- package/hooks/useMergedSizes.mjs.map +1 -1
- package/hooks/useResizeObserver.js.map +1 -1
- package/hooks/useResizeObserver.mjs.map +1 -1
- package/hooks/useScrollMonitor.js +1 -1
- package/hooks/useScrollMonitor.js.map +1 -1
- package/hooks/useScrollMonitor.mjs +1 -1
- package/hooks/useScrollMonitor.mjs.map +1 -1
- package/hooks/useScrollThresholds.js.map +1 -1
- package/hooks/useScrollThresholds.mjs.map +1 -1
- package/mixins/color.js.map +1 -1
- package/mixins/color.mjs.map +1 -1
- package/mixins/create-responsive-props.js.map +1 -1
- package/mixins/create-responsive-props.mjs.map +1 -1
- package/mixins/display.js.map +1 -1
- package/mixins/display.mjs.map +1 -1
- package/mixins/responsive-margin.js.map +1 -1
- package/mixins/responsive-margin.mjs.map +1 -1
- package/mixins/responsive-property.js +1 -1
- package/mixins/responsive-property.js.map +1 -1
- package/mixins/responsive-property.mjs +1 -1
- package/mixins/responsive-property.mjs.map +1 -1
- package/mixins/screen.js +1 -1
- package/mixins/screen.js.map +1 -1
- package/mixins/screen.mjs +1 -1
- package/mixins/screen.mjs.map +1 -1
- package/mixins/shared.js +4 -4
- package/mixins/shared.js.map +1 -1
- package/mixins/shared.mjs +4 -4
- package/mixins/shared.mjs.map +1 -1
- package/mixins/vAlign.js.map +1 -1
- package/mixins/vAlign.mjs.map +1 -1
- package/package.json +7 -6
- package/shared/enums/sizeInput.js.map +1 -1
- package/shared/enums/sizeInput.mjs.map +1 -1
- package/shared/resize-observer.js.map +1 -1
- package/shared/resize-observer.mjs.map +1 -1
- package/shared/utils/colors.js.map +1 -1
- package/shared/utils/colors.mjs.map +1 -1
- package/shared/utils/dom.js.map +1 -1
- package/shared/utils/dom.mjs.map +1 -1
- package/shared/utils/react.js.map +1 -1
- package/shared/utils/react.mjs.map +1 -1
- package/shared/utils/rel-builder.js +1 -1
- package/shared/utils/rel-builder.js.map +1 -1
- package/shared/utils/rel-builder.mjs +1 -1
- package/shared/utils/rel-builder.mjs.map +1 -1
- package/theme/colors-dark.js.map +1 -1
- package/theme/colors-dark.mjs.map +1 -1
- package/theme/colors-light.js.map +1 -1
- package/theme/colors-light.mjs.map +1 -1
- package/theme/colors.js.map +1 -1
- package/theme/colors.mjs.map +1 -1
- package/theme/global-styled.js.map +1 -1
- package/theme/global-styled.mjs.map +1 -1
- package/theme/theme-provider.js.map +1 -1
- package/theme/theme-provider.mjs.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.js","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ContextMenu.js","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { cloneElement, PureComponent, isValidElement } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ContextMenuMultiLevel } from 'components/ContextMenu.Multilevel'\nimport { Tooltip } from '../Tooltip'\nimport { ContextMenuItem } from './Item'\nimport * as Styled from './style'\nimport { tooltipStyles } from './tooltip-styles'\n\nexport interface ContextMenuProps extends BaseProps {\n /**\n * Children react node\n */\n children: React.ReactNode\n /** Indicates if button is active (e.g. when context menu is open) */\n onClick?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** Manually controled state */\n isOpen?: boolean\n /** On open menu callback */\n onOpen?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** On close menu callback */\n onClose?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** Content */\n trigger?: React.ReactNode\n /** Properties for inner Tooltip component */\n tooltipProps?: Partial<Parameters<typeof Tooltip>[0]>\n /** Hide overlay for debug */\n hideOverlay?: boolean\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nexport class ContextMenu extends PureComponent<ContextMenuProps, { isOpen: boolean }> {\n static Item = ContextMenuItem\n static MultiLevel = ContextMenuMultiLevel\n static displayName = 'ContextMenu'\n\n static defaultProps = {\n tooltipProps: {\n event: 'click',\n placement: 'left-start',\n offset: 2,\n showCloseButton: false,\n styles: tooltipStyles,\n },\n hideOverlay: false,\n }\n\n constructor(props: ContextMenuProps) {\n super(props)\n\n this.state = {\n isOpen: this.props.isOpen || false,\n }\n }\n\n getOpen = () => {\n const { isOpen } = this.props\n\n if (isOpen !== undefined) return isOpen\n\n return this.state.isOpen || false\n }\n\n handleOpenMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n this.setState({ isOpen: true })\n\n const { onOpen } = this.props\n\n if (onOpen) {\n onOpen(e)\n }\n }\n\n handleCloseMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n this.setState({ isOpen: false })\n\n const { onClose } = this.props\n\n if (onClose) {\n onClose(e)\n }\n }\n\n handleToggleMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n const isOpen = this.getOpen()\n\n e.persist()\n e.preventDefault()\n e.stopPropagation()\n\n if (isOpen) {\n this.handleCloseMenu(e)\n } else {\n this.handleOpenMenu(e)\n }\n\n return false\n }\n\n render() {\n const { className, tooltipProps = {}, trigger, children, hideOverlay } = this.props\n const isOpen = this.getOpen()\n\n if (children) tooltipProps.content = children\n\n return (\n <Styled.Root className={className} isOpen={isOpen} onClick={this.handleToggleMenu} hideOverlay={hideOverlay}>\n <Tooltip {...tooltipProps} open={isOpen}>\n <div onClick={this.handleCloseMenu}>\n {isValidElement(trigger)\n ? cloneElement(trigger as React.ReactElement<{ active: boolean }>, { active: isOpen })\n : null}\n </div>\n </Tooltip>\n </Styled.Root>\n )\n }\n}\n"],"names":["ContextMenu","PureComponent","static","ContextMenuItem","ContextMenuMultiLevel","tooltipProps","event","placement","offset","showCloseButton","styles","tooltipStyles","hideOverlay","constructor","props","super","this","state","isOpen","getOpen","undefined","handleOpenMenu","e","setState","onOpen","handleCloseMenu","onClose","handleToggleMenu","persist","preventDefault","stopPropagation","render","className","trigger","children","content","_jsx","Styled","onClick","jsx","Tooltip","open","isValidElement","cloneElement","active"],"mappings":"8VAiCO,MAAMA,oBAAoBC,MAAAA,cAC/BC,YAAcC,KAAAA,gBACdD,kBAAoBE,uBAAAA,sBACpBF,mBAAqB,cAErBA,oBAAsB,CACpBG,aAAc,CACZC,MAAO,QACPC,UAAW,aACXC,OAAQ,EACRC,iBAAiB,EACjBC,OAAQC,cAAAA,eAEVC,aAAa,GAGfC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,OAAQF,KAAKF,MAAMI,SAAU,EAEjC,CAEAC,QAAUA,KACR,MAAMD,OAAEA,GAAWF,KAAKF,MAExB,OAAII,SAAWE,EAAkBF,EAE1BF,KAAKC,MAAMC,SAAU,CAAK,EAGnCG,eAAkBC,IAChBN,KAAKO,SAAS,CAAEL,QAAQ,IAExB,MAAMM,OAAEA,GAAWR,KAAKF,MAEpBU,GACFA,EAAOF,EACT,EAGFG,gBAAmBH,IACjBN,KAAKO,SAAS,CAAEL,QAAQ,IAExB,MAAMQ,QAAEA,GAAYV,KAAKF,MAErBY,GACFA,EAAQJ,EACV,EAGFK,iBAAoBL,IAClB,MAAMJ,EAASF,KAAKG,UAYpB,OAVAG,EAAEM,UACFN,EAAEO,iBACFP,EAAEQ,kBAEEZ,EACFF,KAAKS,gBAAgBH,GAErBN,KAAKK,eAAeC,IAGf,CAAK,EAGdS,MAAAA,GACE,MAAMC,UAAEA,EAAS3B,aAAEA,EAAe,CAAE,EAAA4B,QAAEA,EAAOC,SAAEA,EAAQtB,YAAEA,GAAgBI,KAAKF,MAC9E,MAAMI,EAASF,KAAKG,UAIpB,OAFIe,IAAU7B,EAAa8B,QAAUD,GAGnCE,WAAAA,IAACC,MAAAA,KAAW,CAACL,UAAWA,EAAWd,OAAQA,EAAQoB,QAAStB,KAAKW,iBAAkBf,YAAaA,EAAYsB,SAC1GE,WAAAG,IAACC,gBAAO,IAAKnC,EAAcoC,KAAMvB,EAAOgB,SACtCE,WAAAG,IAAA,MAAA,CAAKD,QAAStB,KAAKS,gBAAgBS,SAChCQ,MAAAA,eAAeT,GACZU,MAAAA,aAAaV,EAAoD,CAAEW,OAAQ1B,IAC3E,UAKd"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PureComponent,cloneElement}from'react';import{ContextMenuItem}from'./Item.mjs';import{Root}from'./style.mjs';import{tooltipStyles}from'./tooltip-styles.mjs';import{jsx}from'react/jsx-runtime';import{ContextMenuMultiLevel}from'../ContextMenu.Multilevel/ContextMenu.Multilevel.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';class ContextMenu extends PureComponent{static Item=ContextMenuItem;static MultiLevel=ContextMenuMultiLevel;static displayName='ContextMenu';static defaultProps={tooltipProps:{event:'click',placement:'left-start',offset:2,showCloseButton:!1,styles:tooltipStyles},hideOverlay:!1};constructor(
|
|
1
|
+
import{PureComponent,isValidElement,cloneElement}from'react';import{ContextMenuItem}from'./Item.mjs';import{Root}from'./style.mjs';import{tooltipStyles}from'./tooltip-styles.mjs';import{jsx}from'react/jsx-runtime';import{ContextMenuMultiLevel}from'../ContextMenu.Multilevel/ContextMenu.Multilevel.mjs';import{Tooltip}from'../Tooltip/Tooltip.mjs';class ContextMenu extends PureComponent{static Item=ContextMenuItem;static MultiLevel=ContextMenuMultiLevel;static displayName='ContextMenu';static defaultProps={tooltipProps:{event:'click',placement:'left-start',offset:2,showCloseButton:!1,styles:tooltipStyles},hideOverlay:!1};constructor(e){super(e),this.state={isOpen:this.props.isOpen||!1}}getOpen=()=>{const{isOpen:e}=this.props;return e!==void 0?e:this.state.isOpen||!1};handleOpenMenu=e=>{this.setState({isOpen:!0});const{onOpen:t}=this.props;t&&t(e)};handleCloseMenu=e=>{this.setState({isOpen:!1});const{onClose:t}=this.props;t&&t(e)};handleToggleMenu=e=>{const t=this.getOpen();return e.persist(),e.preventDefault(),e.stopPropagation(),t?this.handleCloseMenu(e):this.handleOpenMenu(e),!1};render(){const{className:e,tooltipProps:t={},trigger:o,children:n,hideOverlay:s}=this.props;const i=this.getOpen();return n&&(t.content=n),jsx(Root,{className:e,isOpen:i,onClick:this.handleToggleMenu,hideOverlay:s,children:jsx(Tooltip,{...t,open:i,children:jsx("div",{onClick:this.handleCloseMenu,children:isValidElement(o)?cloneElement(o,{active:i}):null})})})}}export{ContextMenu};
|
|
2
2
|
//# sourceMappingURL=ContextMenu.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"ContextMenu.mjs","sources":["../../../../src/components/ContextMenu/ContextMenu.tsx"],"sourcesContent":["import { cloneElement, PureComponent, isValidElement } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport { ContextMenuMultiLevel } from 'components/ContextMenu.Multilevel'\nimport { Tooltip } from '../Tooltip'\nimport { ContextMenuItem } from './Item'\nimport * as Styled from './style'\nimport { tooltipStyles } from './tooltip-styles'\n\nexport interface ContextMenuProps extends BaseProps {\n /**\n * Children react node\n */\n children: React.ReactNode\n /** Indicates if button is active (e.g. when context menu is open) */\n onClick?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** Manually controled state */\n isOpen?: boolean\n /** On open menu callback */\n onOpen?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** On close menu callback */\n onClose?: (_e: React.MouseEvent<HTMLDivElement>) => void\n /** Content */\n trigger?: React.ReactNode\n /** Properties for inner Tooltip component */\n tooltipProps?: Partial<Parameters<typeof Tooltip>[0]>\n /** Hide overlay for debug */\n hideOverlay?: boolean\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nexport class ContextMenu extends PureComponent<ContextMenuProps, { isOpen: boolean }> {\n static Item = ContextMenuItem\n static MultiLevel = ContextMenuMultiLevel\n static displayName = 'ContextMenu'\n\n static defaultProps = {\n tooltipProps: {\n event: 'click',\n placement: 'left-start',\n offset: 2,\n showCloseButton: false,\n styles: tooltipStyles,\n },\n hideOverlay: false,\n }\n\n constructor(props: ContextMenuProps) {\n super(props)\n\n this.state = {\n isOpen: this.props.isOpen || false,\n }\n }\n\n getOpen = () => {\n const { isOpen } = this.props\n\n if (isOpen !== undefined) return isOpen\n\n return this.state.isOpen || false\n }\n\n handleOpenMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n this.setState({ isOpen: true })\n\n const { onOpen } = this.props\n\n if (onOpen) {\n onOpen(e)\n }\n }\n\n handleCloseMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n this.setState({ isOpen: false })\n\n const { onClose } = this.props\n\n if (onClose) {\n onClose(e)\n }\n }\n\n handleToggleMenu = (e: React.MouseEvent<HTMLDivElement>) => {\n const isOpen = this.getOpen()\n\n e.persist()\n e.preventDefault()\n e.stopPropagation()\n\n if (isOpen) {\n this.handleCloseMenu(e)\n } else {\n this.handleOpenMenu(e)\n }\n\n return false\n }\n\n render() {\n const { className, tooltipProps = {}, trigger, children, hideOverlay } = this.props\n const isOpen = this.getOpen()\n\n if (children) tooltipProps.content = children\n\n return (\n <Styled.Root className={className} isOpen={isOpen} onClick={this.handleToggleMenu} hideOverlay={hideOverlay}>\n <Tooltip {...tooltipProps} open={isOpen}>\n <div onClick={this.handleCloseMenu}>\n {isValidElement(trigger)\n ? cloneElement(trigger as React.ReactElement<{ active: boolean }>, { active: isOpen })\n : null}\n </div>\n </Tooltip>\n </Styled.Root>\n )\n }\n}\n"],"names":["ContextMenu","PureComponent","static","ContextMenuItem","ContextMenuMultiLevel","tooltipProps","event","placement","offset","showCloseButton","styles","tooltipStyles","hideOverlay","constructor","props","super","this","state","isOpen","getOpen","undefined","handleOpenMenu","e","setState","onOpen","handleCloseMenu","onClose","handleToggleMenu","persist","preventDefault","stopPropagation","render","className","trigger","children","content","_jsx","Styled","onClick","Tooltip","open","isValidElement","cloneElement","active"],"mappings":"0VAiCO,MAAMA,oBAAoBC,cAC/BC,YAAcC,gBACdD,kBAAoBE,sBACpBF,mBAAqB,cAErBA,oBAAsB,CACpBG,aAAc,CACZC,MAAO,QACPC,UAAW,aACXC,OAAQ,EACRC,iBAAiB,EACjBC,OAAQC,eAEVC,aAAa,GAGfC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,OAAQF,KAAKF,MAAMI,SAAU,EAEjC,CAEAC,QAAUA,KACR,MAAMD,OAAEA,GAAWF,KAAKF,MAExB,OAAII,SAAWE,EAAkBF,EAE1BF,KAAKC,MAAMC,SAAU,CAAK,EAGnCG,eAAkBC,IAChBN,KAAKO,SAAS,CAAEL,QAAQ,IAExB,MAAMM,OAAEA,GAAWR,KAAKF,MAEpBU,GACFA,EAAOF,EACT,EAGFG,gBAAmBH,IACjBN,KAAKO,SAAS,CAAEL,QAAQ,IAExB,MAAMQ,QAAEA,GAAYV,KAAKF,MAErBY,GACFA,EAAQJ,EACV,EAGFK,iBAAoBL,IAClB,MAAMJ,EAASF,KAAKG,UAYpB,OAVAG,EAAEM,UACFN,EAAEO,iBACFP,EAAEQ,kBAEEZ,EACFF,KAAKS,gBAAgBH,GAErBN,KAAKK,eAAeC,IAGf,CAAK,EAGdS,MAAAA,GACE,MAAMC,UAAEA,EAAS3B,aAAEA,EAAe,CAAE,EAAA4B,QAAEA,EAAOC,SAAEA,EAAQtB,YAAEA,GAAgBI,KAAKF,MAC9E,MAAMI,EAASF,KAAKG,UAIpB,OAFIe,IAAU7B,EAAa8B,QAAUD,GAGnCE,IAACC,KAAW,CAACL,UAAWA,EAAWd,OAAQA,EAAQoB,QAAStB,KAAKW,iBAAkBf,YAAaA,EAAYsB,SAC1GE,IAACG,QAAO,IAAKlC,EAAcmC,KAAMtB,EAAOgB,SACtCE,IAAA,MAAA,CAAKE,QAAStB,KAAKS,gBAAgBS,SAChCO,eAAeR,GACZS,aAAaT,EAAoD,CAAEU,OAAQzB,IAC3E,UAKd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sources":["../../../../src/components/ContextMenu/Item.tsx"],"sourcesContent":["import { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nconst disabledHandler = (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.preventDefault()\n e.stopPropagation()\n\n return false\n}\n\nexport interface ContextMenuItemProps extends BaseProps {\n /**\n * Children react node\n */\n children?: React.ReactNode\n content?: string\n active?: boolean\n disabled?: boolean\n onClick?: React.MouseEventHandler<HTMLDivElement>\n id?: string | number\n}\n\
|
|
1
|
+
{"version":3,"file":"Item.js","sources":["../../../../src/components/ContextMenu/Item.tsx"],"sourcesContent":["import type { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nconst disabledHandler = (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.preventDefault()\n e.stopPropagation()\n\n return false\n}\n\nexport interface ContextMenuItemProps extends BaseProps {\n /**\n * Children react node\n */\n children?: React.ReactNode\n content?: string\n active?: boolean\n disabled?: boolean\n onClick?: React.MouseEventHandler<HTMLDivElement>\n id?: string | number\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nfunction ContextMenuItem({ children, id, content, active, disabled, onClick, className, style }: ContextMenuItemProps) {\n return (\n <Styled.RootItem\n style={style}\n className={className}\n active={active}\n disabled={disabled}\n onClick={disabled ? disabledHandler : onClick}\n data-id={id}\n >\n {children}\n <Text size='s' lineHeight='s' color={DefaultColorNames.mineShaft}>\n {content}\n </Text>\n </Styled.RootItem>\n )\n}\n\nContextMenuItem.displayName = 'ContextMenu.Item'\n\nexport { ContextMenuItem }\n"],"names":["disabledHandler","e","preventDefault","stopPropagation","ContextMenuItem","children","id","content","active","disabled","onClick","className","style","_jsxs","Styled","_jsx","jsx","Text","size","lineHeight","color","DefaultColorNames","mineShaft","displayName"],"mappings":"yKAKA,MAAMA,gBAAmBC,IACvBA,EAAEC,iBACFD,EAAEC,iBACFD,EAAEE,mBAEK,GAmBT,SAASC,iBAAgBC,SAAEA,EAAQC,GAAEA,EAAEC,QAAEA,EAAOC,OAAEA,EAAMC,SAAEA,EAAQC,QAAEA,EAAOC,UAAEA,EAAWC,MAAAA,IACtF,OACEC,WAAAA,KAACC,MAAAA,SAAe,CACdF,MAAOA,EACPD,UAAWA,EACXH,OAAQA,EACRC,SAAUA,EACVC,QAASD,EAAWT,gBAAkBU,EACtC,UAASJ,EAAGD,SAEXA,CAAAA,EACDU,WAAAC,IAACC,UAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOC,OAAiBA,kBAACC,UAAUjB,SAC9DE,MAIT,CAEAH,gBAAgBmB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.mjs","sources":["../../../../src/components/ContextMenu/Item.tsx"],"sourcesContent":["import { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nconst disabledHandler = (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.preventDefault()\n e.stopPropagation()\n\n return false\n}\n\nexport interface ContextMenuItemProps extends BaseProps {\n /**\n * Children react node\n */\n children?: React.ReactNode\n content?: string\n active?: boolean\n disabled?: boolean\n onClick?: React.MouseEventHandler<HTMLDivElement>\n id?: string | number\n}\n\
|
|
1
|
+
{"version":3,"file":"Item.mjs","sources":["../../../../src/components/ContextMenu/Item.tsx"],"sourcesContent":["import type { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport * as Styled from './style'\n\nconst disabledHandler = (e: React.MouseEvent<HTMLDivElement>) => {\n e.preventDefault()\n e.preventDefault()\n e.stopPropagation()\n\n return false\n}\n\nexport interface ContextMenuItemProps extends BaseProps {\n /**\n * Children react node\n */\n children?: React.ReactNode\n content?: string\n active?: boolean\n disabled?: boolean\n onClick?: React.MouseEventHandler<HTMLDivElement>\n id?: string | number\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nfunction ContextMenuItem({ children, id, content, active, disabled, onClick, className, style }: ContextMenuItemProps) {\n return (\n <Styled.RootItem\n style={style}\n className={className}\n active={active}\n disabled={disabled}\n onClick={disabled ? disabledHandler : onClick}\n data-id={id}\n >\n {children}\n <Text size='s' lineHeight='s' color={DefaultColorNames.mineShaft}>\n {content}\n </Text>\n </Styled.RootItem>\n )\n}\n\nContextMenuItem.displayName = 'ContextMenu.Item'\n\nexport { ContextMenuItem }\n"],"names":["disabledHandler","e","preventDefault","stopPropagation","ContextMenuItem","children","id","content","active","disabled","onClick","className","style","_jsxs","Styled","_jsx","Text","size","lineHeight","color","DefaultColorNames","mineShaft","displayName"],"mappings":"mKAKA,MAAMA,gBAAmBC,IACvBA,EAAEC,iBACFD,EAAEC,iBACFD,EAAEE,mBAEK,GAmBT,SAASC,iBAAgBC,SAAEA,EAAQC,GAAEA,EAAEC,QAAEA,EAAOC,OAAEA,EAAMC,SAAEA,EAAQC,QAAEA,EAAOC,UAAEA,EAASC,MAAEA,IACtF,OACEC,KAACC,SAAe,CACdF,MAAOA,EACPD,UAAWA,EACXH,OAAQA,EACRC,SAAUA,EACVC,QAASD,EAAWT,gBAAkBU,EACtC,UAASJ,EAAGD,SAEXA,CAAAA,EACDU,IAACC,KAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOC,kBAAkBC,UAAUhB,SAC9DE,MAIT,CAEAH,gBAAgBkB,YAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/ContextMenu/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { ContextMenuProps } from './ContextMenu'\nimport { ContextMenuItemProps } from './Item'\n\nconst isOpen = css`\n &:after {\n cursor: default;\n user-select: none;\n content: '';\n display: block;\n position: fixed;\n width: 100%;\n height: 100%;\n z-index: ${(props) => props.theme.zIndex.tooltip};\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n`\n\nconst disabledItem = css`\n background-color: ${(props) => props.theme.colors.alabaster};\n opacity: 0.6;\n cursor: default;\n`\n\nconst notDisabledItem = css`\n &:hover {\n background-color: ${(props) => props.theme.colors.onahau};\n }\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'style'].includes(prop),\n})<Pick<ContextMenuProps, 'isOpen' | 'hideOverlay'>>`\n display: inline-block;\n position: relative;\n [style*='cursor'] {\n cursor: default !important;\n }\n & + & {\n margin-left: 16px;\n }\n ${(props) => (props.isOpen && Boolean(props.hideOverlay) === false ? isOpen : null)}\n`\n\nexport const RootItem = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'data-id'].includes(prop),\n})<Pick<ContextMenuItemProps, 'active' | 'disabled'>>`\n display: block;\n padding: 8px 20px 7px;\n transition: background-color 0.4s ease-out;\n cursor: pointer;\n user-select: none;\n ${(props) =>\n props.active\n ? css`\n background-color: ${props.theme.colors.onahau};\n `\n : null}\n ${(props) => (props.disabled ? disabledItem : notDisabledItem)}\n`\n"],"names":["isOpen","css","props","theme","zIndex","tooltip","disabledItem","colors","alabaster","notDisabledItem","onahau","Root","styled","div","withConfig","shouldForwardProp","prop","includes","displayName","componentId","Boolean","hideOverlay","RootItem","active","disabled"],"mappings":"kKAIA,MAAMA,OAASC,OAAGA,IAAA,CAAA,kHAAA,qCASFC,GAAUA,EAAMC,MAAMC,OAAOC,UAQ7C,MAAMC,aAAeL,OAAGA,IAAA,CAAA,oBAAA,iCACDC,GAAUA,EAAMC,MAAMI,OAAOC,YAKpD,MAAMC,gBAAkBR,OAAGA,IAAA,CAAA,4BAAA,OAEFC,GAAUA,EAAMC,MAAMI,OAAOG,SAI/C,MAAMC,KAAOC,gBAAAA,QAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,SAASC,SAASD,KACpFF,WAAA,CAAAI,YAAA,oBAAAC,YAAA,mBAFkBP,CAElB,CAAA,+GAAA,KASGV,GAAWA,EAAMF,QAAUoB,QAAQlB,EAAMmB,gBAAiB,EAAQrB,OAAS,OAGzE,MAAMsB,SAAWV,gBAAAA,QAAOC,IAAIC,WAAW,CAC5CC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,WAAWC,SAASD,KACtFF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFsBP,CAQnBV,CAAAA,gHAAAA,IAAAA,KAAAA,GACDA,EAAMqB,OACFtB,OAAGA,IACmBC,CAAAA,oBAAAA,KAAAA,EAAMC,MAAMI,OAAOG,QAEzC,OACHR,GAAWA,EAAMsB,SAAWlB,aAAeG"}
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/ContextMenu/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { ContextMenuProps } from './ContextMenu'\nimport type { ContextMenuItemProps } from './Item'\n\nconst isOpen = css`\n &:after {\n cursor: default;\n user-select: none;\n content: '';\n display: block;\n position: fixed;\n width: 100%;\n height: 100%;\n z-index: ${(props) => props.theme.zIndex.tooltip};\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n`\n\nconst disabledItem = css`\n background-color: ${(props) => props.theme.colors.alabaster};\n opacity: 0.6;\n cursor: default;\n`\n\nconst notDisabledItem = css`\n &:hover {\n background-color: ${(props) => props.theme.colors.onahau};\n }\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'style'].includes(prop),\n})<Pick<ContextMenuProps, 'isOpen' | 'hideOverlay'>>`\n display: inline-block;\n position: relative;\n [style*='cursor'] {\n cursor: default !important;\n }\n & + & {\n margin-left: 16px;\n }\n ${(props) => (props.isOpen && Boolean(props.hideOverlay) === false ? isOpen : null)}\n`\n\nexport const RootItem = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'data-id'].includes(prop),\n})<Pick<ContextMenuItemProps, 'active' | 'disabled'>>`\n display: block;\n padding: 8px 20px 7px;\n transition: background-color 0.4s ease-out;\n cursor: pointer;\n user-select: none;\n ${(props) =>\n props.active\n ? css`\n background-color: ${props.theme.colors.onahau};\n `\n : null}\n ${(props) => (props.disabled ? disabledItem : notDisabledItem)}\n`\n"],"names":["isOpen","css","props","theme","zIndex","tooltip","disabledItem","colors","alabaster","notDisabledItem","onahau","Root","styled","div","withConfig","shouldForwardProp","prop","includes","displayName","componentId","Boolean","hideOverlay","RootItem","active","disabled"],"mappings":"kKAIA,MAAMA,OAASC,OAAGA,IAAA,CAAA,kHAAA,qCASFC,GAAUA,EAAMC,MAAMC,OAAOC,UAQ7C,MAAMC,aAAeL,OAAGA,IAAA,CAAA,oBAAA,iCACDC,GAAUA,EAAMC,MAAMI,OAAOC,YAKpD,MAAMC,gBAAkBR,OAAGA,IAAA,CAAA,4BAAA,OAEFC,GAAUA,EAAMC,MAAMI,OAAOG,SAI/C,MAAMC,KAAOC,gBAAAA,QAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,SAASC,SAASD,KACpFF,WAAA,CAAAI,YAAA,oBAAAC,YAAA,mBAFkBP,CAElB,CAAA,+GAAA,KASGV,GAAWA,EAAMF,QAAUoB,QAAQlB,EAAMmB,gBAAiB,EAAQrB,OAAS,OAGzE,MAAMsB,SAAWV,gBAAAA,QAAOC,IAAIC,WAAW,CAC5CC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,WAAWC,SAASD,KACtFF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFsBP,CAQnBV,CAAAA,gHAAAA,IAAAA,KAAAA,GACDA,EAAMqB,OACFtB,OAAGA,IACmBC,CAAAA,oBAAAA,KAAAA,EAAMC,MAAMI,OAAOG,QAEzC,OACHR,GAAWA,EAAMsB,SAAWlB,aAAeG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../src/components/ContextMenu/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { ContextMenuProps } from './ContextMenu'\nimport { ContextMenuItemProps } from './Item'\n\nconst isOpen = css`\n &:after {\n cursor: default;\n user-select: none;\n content: '';\n display: block;\n position: fixed;\n width: 100%;\n height: 100%;\n z-index: ${(props) => props.theme.zIndex.tooltip};\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n`\n\nconst disabledItem = css`\n background-color: ${(props) => props.theme.colors.alabaster};\n opacity: 0.6;\n cursor: default;\n`\n\nconst notDisabledItem = css`\n &:hover {\n background-color: ${(props) => props.theme.colors.onahau};\n }\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'style'].includes(prop),\n})<Pick<ContextMenuProps, 'isOpen' | 'hideOverlay'>>`\n display: inline-block;\n position: relative;\n [style*='cursor'] {\n cursor: default !important;\n }\n & + & {\n margin-left: 16px;\n }\n ${(props) => (props.isOpen && Boolean(props.hideOverlay) === false ? isOpen : null)}\n`\n\nexport const RootItem = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'data-id'].includes(prop),\n})<Pick<ContextMenuItemProps, 'active' | 'disabled'>>`\n display: block;\n padding: 8px 20px 7px;\n transition: background-color 0.4s ease-out;\n cursor: pointer;\n user-select: none;\n ${(props) =>\n props.active\n ? css`\n background-color: ${props.theme.colors.onahau};\n `\n : null}\n ${(props) => (props.disabled ? disabledItem : notDisabledItem)}\n`\n"],"names":["isOpen","css","props","theme","zIndex","tooltip","disabledItem","colors","alabaster","notDisabledItem","onahau","Root","styled","div","withConfig","shouldForwardProp","prop","includes","displayName","componentId","Boolean","hideOverlay","RootItem","active","disabled"],"mappings":"2CAIA,MAAMA,OAASC,IAAG,CAAA,kHAAA,qCASFC,GAAUA,EAAMC,MAAMC,OAAOC,UAQ7C,MAAMC,aAAeL,IAAG,CAAA,oBAAA,iCACDC,GAAUA,EAAMC,MAAMI,OAAOC,YAKpD,MAAMC,gBAAkBR,IAAG,CAAA,4BAAA,OAEFC,GAAUA,EAAMC,MAAMI,OAAOG,SAI/C,MAAMC,KAAOC,OAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,SAASC,SAASD,KACpFF,WAAA,CAAAI,YAAA,oBAAAC,YAAA,mBAFkBP,CAElB,CAAA,+GAAA,KASGV,GAAWA,EAAMF,QAAUoB,QAAQlB,EAAMmB,gBAAiB,EAAQrB,OAAS,OAGzE,MAAMsB,SAAWV,OAAOC,IAAIC,WAAW,CAC5CC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,WAAWC,SAASD,KACtFF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFsBP,CAQnBV,CAAAA,gHAAAA,IAAAA,KAAAA,GACDA,EAAMqB,OACFtB,IACsBC,CAAAA,oBAAAA,KAAAA,EAAMC,MAAMI,OAAOG,QAEzC,OACHR,GAAWA,EAAMsB,SAAWlB,aAAeG"}
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../src/components/ContextMenu/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport type { ContextMenuProps } from './ContextMenu'\nimport type { ContextMenuItemProps } from './Item'\n\nconst isOpen = css`\n &:after {\n cursor: default;\n user-select: none;\n content: '';\n display: block;\n position: fixed;\n width: 100%;\n height: 100%;\n z-index: ${(props) => props.theme.zIndex.tooltip};\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n }\n`\n\nconst disabledItem = css`\n background-color: ${(props) => props.theme.colors.alabaster};\n opacity: 0.6;\n cursor: default;\n`\n\nconst notDisabledItem = css`\n &:hover {\n background-color: ${(props) => props.theme.colors.onahau};\n }\n`\n\nexport const Root = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'style'].includes(prop),\n})<Pick<ContextMenuProps, 'isOpen' | 'hideOverlay'>>`\n display: inline-block;\n position: relative;\n [style*='cursor'] {\n cursor: default !important;\n }\n & + & {\n margin-left: 16px;\n }\n ${(props) => (props.isOpen && Boolean(props.hideOverlay) === false ? isOpen : null)}\n`\n\nexport const RootItem = styled.div.withConfig({\n shouldForwardProp: (prop) => ['className', 'onClick', 'children', 'data-id'].includes(prop),\n})<Pick<ContextMenuItemProps, 'active' | 'disabled'>>`\n display: block;\n padding: 8px 20px 7px;\n transition: background-color 0.4s ease-out;\n cursor: pointer;\n user-select: none;\n ${(props) =>\n props.active\n ? css`\n background-color: ${props.theme.colors.onahau};\n `\n : null}\n ${(props) => (props.disabled ? disabledItem : notDisabledItem)}\n`\n"],"names":["isOpen","css","props","theme","zIndex","tooltip","disabledItem","colors","alabaster","notDisabledItem","onahau","Root","styled","div","withConfig","shouldForwardProp","prop","includes","displayName","componentId","Boolean","hideOverlay","RootItem","active","disabled"],"mappings":"2CAIA,MAAMA,OAASC,IAAG,CAAA,kHAAA,qCASFC,GAAUA,EAAMC,MAAMC,OAAOC,UAQ7C,MAAMC,aAAeL,IAAG,CAAA,oBAAA,iCACDC,GAAUA,EAAMC,MAAMI,OAAOC,YAKpD,MAAMC,gBAAkBR,IAAG,CAAA,4BAAA,OAEFC,GAAUA,EAAMC,MAAMI,OAAOG,SAI/C,MAAMC,KAAOC,OAAOC,IAAIC,WAAW,CACxCC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,SAASC,SAASD,KACpFF,WAAA,CAAAI,YAAA,oBAAAC,YAAA,mBAFkBP,CAElB,CAAA,+GAAA,KASGV,GAAWA,EAAMF,QAAUoB,QAAQlB,EAAMmB,gBAAiB,EAAQrB,OAAS,OAGzE,MAAMsB,SAAWV,OAAOC,IAAIC,WAAW,CAC5CC,kBAAoBC,GAAS,CAAC,YAAa,UAAW,WAAY,WAAWC,SAASD,KACtFF,WAAA,CAAAI,YAAA,wBAAAC,YAAA,mBAFsBP,CAQnBV,CAAAA,gHAAAA,IAAAA,KAAAA,GACDA,EAAMqB,OACFtB,IACsBC,CAAAA,oBAAAA,KAAAA,EAAMC,MAAMI,OAAOG,QAEzC,OACHR,GAAWA,EAAMsB,SAAWlB,aAAeG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var ContextMenu=require('../ContextMenu/ContextMenu.js');var Heading=require('./Heading.js');var SubHeading=require('./SubHeading.js');var Controls=require('./Controls.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Spacer=require('../Spacer/Spacer.js');exports.ContextMenuMultiLevel=class ContextMenuMultiLevel extends React.PureComponent{static displayName='ContextMenu.MultiLevel';static defaultProps={config:{}};constructor(e){super(e),this.state={selectedItems:[]}}componentWillUnmount(){clearTimeout(this.resetTimeout)}onSelectItem=e=>{const{id:t,level:n}=e;const{selectedItems:s}=this.state;const i=[...s.slice(0,n),t];this.setState({selectedItems:i}),typeof this.props.onSelectItem=='function'&&this.props.onSelectItem(e,n)};getCurrentConfig=()=>{const{config:e}=this.props;const{selectedItems:t}=this.state;if(!e)return null;if(!t.length)return e;try{return t.reduce(((e,t)=>e.items&&e.items.find((e=>e.id===t))?.config||{}),e)}catch(e){return null}};reset=()=>{this.resetTimeout=setTimeout((()=>this.setState({selectedItems:[]})),200)};itemOnClickHandler=e=>{const t=this.getCurrentConfig();if(!t)throw new Error('Config not found');const{items:n=[]}=t;const{currentTarget:s}=e;const{id:i=null}=s.dataset;if(i===null)throw new Error('Data-id for item not found');const o=n.find((e=>`${e.id}`===i));if(!o)throw new Error('Item not found');(o.config||o.preventClosing)&&(e.preventDefault(),e.stopPropagation()),o.config&&this.onSelectItem(o),typeof o.onClick=='function'&&o.onClick(o)};render(){const{children:e,className:t,tooltipProps:n,isOpen:s,trigger:i,...o}=this.props;const{selectedItems:r}=this.state;const c=this.getCurrentConfig();const{config:l,onSelectItem:u,...a}=o;return jsxRuntime.jsxs(ContextMenu.ContextMenu,{className:t,tooltipProps:n,isOpen:s,onClose:this.reset,trigger:i,...a,children:[e,jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Spacer.Spacer,{top:9}),c?.heading?jsxRuntime.jsx(Heading.Heading,{content:c.heading}):null,c?.subheading?jsxRuntime.jsx(SubHeading.SubHeading,{content:c.subheading}):null,c?.items?jsxRuntime.jsx(style.MultilevelItems,{children:c.items.map((e=>jsxRuntime.jsx(ContextMenu.ContextMenu.Item,{id:e.id,content:e.content,active:e.level&&Boolean(r[e.level]===e.id)||e.active,onClick:this.itemOnClickHandler},e.id)))}):null,c?.controls?jsxRuntime.jsx(Controls.Controls,{...c.controls}):jsxRuntime.jsx(Spacer.Spacer,{top:9})]})]})}};
|
|
1
|
+
'use strict';var React=require('react');var ContextMenu=require('../ContextMenu/ContextMenu.js');var Heading=require('./Heading.js');var SubHeading=require('./SubHeading.js');var Controls=require('./Controls.js');var style=require('./style.js');var jsxRuntime=require('react/jsx-runtime');var Spacer=require('../Spacer/Spacer.js');exports.ContextMenuMultiLevel=class ContextMenuMultiLevel extends React.PureComponent{static displayName='ContextMenu.MultiLevel';static defaultProps={config:{}};constructor(e){super(e),this.state={selectedItems:[]}}componentWillUnmount(){clearTimeout(this.resetTimeout)}onSelectItem=e=>{const{id:t,level:n}=e;const{selectedItems:s}=this.state;const i=[...s.slice(0,n),t];this.setState({selectedItems:i}),typeof this.props.onSelectItem=='function'&&this.props.onSelectItem(e,n)};getCurrentConfig=()=>{const{config:e}=this.props;const{selectedItems:t}=this.state;if(!e)return null;if(!t.length)return e;try{return t.reduce(((e,t)=>e.items&&e.items.find((e=>e.id===t))?.config||{}),e)}catch(e){return console.error(e),null}};reset=()=>{this.resetTimeout=setTimeout((()=>this.setState({selectedItems:[]})),200)};itemOnClickHandler=e=>{const t=this.getCurrentConfig();if(!t)throw new Error('Config not found');const{items:n=[]}=t;const{currentTarget:s}=e;const{id:i=null}=s.dataset;if(i===null)throw new Error('Data-id for item not found');const o=n.find((e=>`${e.id}`===i));if(!o)throw new Error('Item not found');(o.config||o.preventClosing)&&(e.preventDefault(),e.stopPropagation()),o.config&&this.onSelectItem(o),typeof o.onClick=='function'&&o.onClick(o)};render(){const{children:e,className:t,tooltipProps:n,isOpen:s,trigger:i,...o}=this.props;const{selectedItems:r}=this.state;const c=this.getCurrentConfig();const{config:l,onSelectItem:u,...a}=o;return jsxRuntime.jsxs(ContextMenu.ContextMenu,{className:t,tooltipProps:n,isOpen:s,onClose:this.reset,trigger:i,...a,children:[e,jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Spacer.Spacer,{top:9}),c?.heading?jsxRuntime.jsx(Heading.Heading,{content:c.heading}):null,c?.subheading?jsxRuntime.jsx(SubHeading.SubHeading,{content:c.subheading}):null,c?.items?jsxRuntime.jsx(style.MultilevelItems,{children:c.items.map((e=>jsxRuntime.jsx(ContextMenu.ContextMenu.Item,{id:e.id,content:e.content,active:e.level&&Boolean(r[e.level]===e.id)||e.active,onClick:this.itemOnClickHandler},e.id)))}):null,c?.controls?jsxRuntime.jsx(Controls.Controls,{...c.controls}):jsxRuntime.jsx(Spacer.Spacer,{top:9})]})]})}};
|
|
2
2
|
//# sourceMappingURL=ContextMenu.Multilevel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.Multilevel.js","sources":["../../../../src/components/ContextMenu.Multilevel/ContextMenu.Multilevel.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { Color } from 'shared/types'\nimport { Spacer } from 'components/Spacer'\nimport { ContextMenu
|
|
1
|
+
{"version":3,"file":"ContextMenu.Multilevel.js","sources":["../../../../src/components/ContextMenu.Multilevel/ContextMenu.Multilevel.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { Color } from 'shared/types'\nimport { Spacer } from 'components/Spacer'\nimport { ContextMenu } from '../ContextMenu/ContextMenu'\nimport type { ContextMenuProps } from '../ContextMenu/ContextMenu'\nimport { Heading } from './Heading'\nimport { SubHeading } from './SubHeading'\nimport { Controls } from './Controls'\nimport * as Styled from './style'\n\nexport interface MultiLevelControls {\n cancel?: {\n content?: string\n onClick?(): void\n color?: Color\n }\n confirm?: {\n content?: string\n onClick?(): void\n color?: Color\n }\n}\n\nexport interface MultiLevelItem {\n id: string | number\n heading?: string\n subheading?: string\n content?: string\n preventClosing?: boolean\n config?: MultiLevelConfig\n items?: MultiLevelItem[]\n controls?: MultiLevelControls\n level?: number\n active?: boolean\n onClick?(_item: MultiLevelItem): void\n}\n\nexport interface MultiLevelConfig {\n items?: MultiLevelItem[]\n heading?: string\n subheading?: string\n controls?: MultiLevelControls\n}\n\nexport interface ContextMenuMultiLevelProps extends ContextMenuProps, BaseProps {\n /** Menu config */\n config?: MultiLevelConfig\n /** On select item callback */\n onSelectItem?(_item: MultiLevelItem, _level: MultiLevelItem['level']): void\n}\n\ninterface ContextMenuMultiLevelState {\n selectedItems: (number | string)[]\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nexport class ContextMenuMultiLevel extends PureComponent<ContextMenuMultiLevelProps, ContextMenuMultiLevelState> {\n resetTimeout?: ReturnType<typeof setTimeout>\n static displayName = 'ContextMenu.MultiLevel'\n static defaultProps = {\n config: {},\n }\n\n constructor(props: ContextMenuMultiLevelProps) {\n super(props)\n\n this.state = {\n selectedItems: [],\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.resetTimeout)\n }\n\n onSelectItem = (selectedItem: MultiLevelItem) => {\n const { id, level } = selectedItem\n\n const { selectedItems } = this.state\n const newSelectedItems = [...selectedItems.slice(0, level), id]\n\n this.setState({ selectedItems: newSelectedItems })\n\n if (typeof this.props.onSelectItem === 'function') this.props.onSelectItem(selectedItem, level)\n }\n\n getCurrentConfig = (): MultiLevelConfig | null => {\n const { config } = this.props\n const { selectedItems } = this.state\n\n if (!config) return null\n\n if (!selectedItems.length) return config\n\n try {\n const currentConfig = selectedItems.reduce((acc, levelId) => {\n return acc.items ? acc.items.find((item) => item.id === levelId)?.config || {} : {}\n }, config)\n\n return currentConfig\n } catch (error) {\n console.error(error)\n return null\n }\n }\n\n reset = () => {\n /* Reset timeout to prevent state switch due to slow tooltip closing animation */\n this.resetTimeout = setTimeout(() => this.setState({ selectedItems: [] }), 200)\n }\n\n itemOnClickHandler: React.MouseEventHandler<HTMLDivElement> = (e) => {\n const config = this.getCurrentConfig()\n if (!config) throw new Error('Config not found')\n\n const { items = [] } = config\n const { currentTarget } = e\n\n const { id = null } = currentTarget.dataset\n\n if (id === null) throw new Error('Data-id for item not found')\n\n const found = items.find((item) => `${item.id}` === id)\n\n if (!found) throw new Error('Item not found')\n\n if (found.config || found.preventClosing) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n if (found.config) {\n /* If menu item has config - select item to show inner level */\n this.onSelectItem(found)\n }\n\n if (typeof found.onClick === 'function') {\n found.onClick(found)\n }\n }\n\n render() {\n const { children, className, tooltipProps, isOpen, trigger, ...anotherProps } = this.props\n const { selectedItems } = this.state\n const config = this.getCurrentConfig()\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { config: _config, onSelectItem: _onSelectItem, ...restProps } = anotherProps\n\n return (\n <ContextMenu\n className={className}\n tooltipProps={tooltipProps}\n isOpen={isOpen}\n // eslint-disable-next-line react/jsx-handler-names\n onClose={this.reset}\n trigger={trigger}\n {...restProps}\n >\n {children}\n <>\n <Spacer top={9} />\n {config?.heading ? <Heading content={config.heading} /> : null}\n {config?.subheading ? <SubHeading content={config.subheading} /> : null}\n {config?.items ? (\n <Styled.MultilevelItems>\n {config.items.map((item) => (\n <ContextMenu.Item\n key={item.id}\n id={item.id}\n content={item.content}\n active={(item.level && Boolean(selectedItems[item.level] === item.id)) || item.active}\n // eslint-disable-next-line react/jsx-handler-names\n onClick={this.itemOnClickHandler}\n />\n ))}\n </Styled.MultilevelItems>\n ) : null}\n {config?.controls ? <Controls {...config.controls} /> : <Spacer top={9} />}\n </>\n </ContextMenu>\n )\n }\n}\n"],"names":["ContextMenuMultiLevel","PureComponent","static","config","constructor","props","super","this","state","selectedItems","componentWillUnmount","clearTimeout","resetTimeout","onSelectItem","selectedItem","id","level","newSelectedItems","slice","setState","getCurrentConfig","length","reduce","acc","levelId","items","find","item","error","console","reset","setTimeout","itemOnClickHandler","e","Error","currentTarget","dataset","found","preventClosing","preventDefault","stopPropagation","onClick","render","children","className","tooltipProps","isOpen","trigger","anotherProps","_config","_onSelectItem","restProps","_jsxs","ContextMenu","onClose","jsxs","_Fragment","_jsx","jsx","Spacer","top","heading","Heading","content","subheading","SubHeading","Styled","map","Item","active","Boolean","controls","Controls"],"mappings":"yWA4DO,MAAMA,8BAA8BC,MAAAA,cAEzCC,mBAAqB,yBACrBA,oBAAsB,CACpBC,OAAQ,CAAC,GAGXC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,cAAe,GAEnB,CAEAC,oBAAAA,GACEC,aAAaJ,KAAKK,aACpB,CAEAC,aAAgBC,IACd,MAAMC,GAAEA,EAAEC,MAAEA,GAAUF,EAEtB,MAAML,cAAEA,GAAkBF,KAAKC,MAC/B,MAAMS,EAAmB,IAAIR,EAAcS,MAAM,EAAGF,GAAQD,GAE5DR,KAAKY,SAAS,CAAEV,cAAeQ,WAEpBV,KAAKF,MAAMQ,cAAiB,YAAYN,KAAKF,MAAMQ,aAAaC,EAAcE,EAAM,EAGjGI,iBAAmBA,KACjB,MAAMjB,OAAEA,GAAW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C,KAAKuB,MACdiB,QAASA,KACLI,EAASR,SAEZA,CAAAA,EACDS,WAAAG,KAAAC,oBAAA,CAAAb,SAAA,CACEc,WAAAC,IAACC,cAAM,CAACC,IAAK,IACZzD,GAAQ0D,QAAUJ,WAAAA,IAACK,QAAAA,QAAO,CAACC,QAAS5D,EAAO0D,UAAc,KACzD1D,GAAQ6D,WAAaP,WAAAA,IAACQ,WAAAA,WAAU,CAACF,QAAS5D,EAAO6D,aAAiB,KAClE7D,GAAQsB,MACPgC,WAAAA,IAACS,MAAAA,gBAAsB,CAAAvB,SACpBxC,EAAOsB,MAAM0C,KAAKxC,GACjB8B,WAAAC,IAACL,YAAWA,YAACe,KAAI,CAEfrD,GAAIY,EAAKZ,GACTgD,QAASpC,EAAKoC,QACdM,OAAS1C,EAAKX,OAASsD,QAAQ7D,EAAckB,EAAKX,SAAWW,EAAKZ,KAAQY,EAAK0C,OAE/E5B,QAASlC,KAAKyB,oBALTL,EAAKZ,QASd,KACHZ,GAAQoE,SAAWd,WAAAA,IAACe,SAAAA,SAAQ,IAAKrE,EAAOoE,WAAed,WAAAC,IAACC,cAAM,CAACC,IAAK,SAI7E"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PureComponent}from'react';import{ContextMenu}from'../ContextMenu/ContextMenu.mjs';import{Heading}from'./Heading.mjs';import{SubHeading}from'./SubHeading.mjs';import{Controls}from'./Controls.mjs';import{MultilevelItems}from'./style.mjs';import{jsxs,Fragment,jsx}from'react/jsx-runtime';import{Spacer}from'../Spacer/Spacer.mjs';class ContextMenuMultiLevel extends PureComponent{static displayName='ContextMenu.MultiLevel';static defaultProps={config:{}};constructor(t){super(t),this.state={selectedItems:[]}}componentWillUnmount(){clearTimeout(this.resetTimeout)}onSelectItem=t=>{const{id:e,level:n}=t;const{selectedItems:o}=this.state;const s=[...o.slice(0,n),e];this.setState({selectedItems:s}),typeof this.props.onSelectItem=='function'&&this.props.onSelectItem(t,n)};getCurrentConfig=()=>{const{config:t}=this.props;const{selectedItems:e}=this.state;if(!t)return null;if(!e.length)return t;try{return e.reduce(((t,e)=>t.items&&t.items.find((t=>t.id===e))?.config||{}),t)}catch(t){return null}};reset=()=>{this.resetTimeout=setTimeout((()=>this.setState({selectedItems:[]})),200)};itemOnClickHandler=t=>{const e=this.getCurrentConfig();if(!e)throw new Error('Config not found');const{items:n=[]}=e;const{currentTarget:o}=t;const{id:s=null}=o.dataset;if(s===null)throw new Error('Data-id for item not found');const i=n.find((t=>`${t.id}`===s));if(!i)throw new Error('Item not found');(i.config||i.preventClosing)&&(t.preventDefault(),t.stopPropagation()),i.config&&this.onSelectItem(i),typeof i.onClick=='function'&&i.onClick(i)};render(){const{children:t,className:e,tooltipProps:n,isOpen:o,trigger:s,...i}=this.props;const{selectedItems:r}=this.state;const l=this.getCurrentConfig();const{config:c,onSelectItem:m,...u}=i;return jsxs(ContextMenu,{className:e,tooltipProps:n,isOpen:o,onClose:this.reset,trigger:s,...u,children:[t,jsxs(Fragment,{children:[jsx(Spacer,{top:9}),l?.heading?jsx(Heading,{content:l.heading}):null,l?.subheading?jsx(SubHeading,{content:l.subheading}):null,l?.items?jsx(MultilevelItems,{children:l.items.map((t=>jsx(ContextMenu.Item,{id:t.id,content:t.content,active:t.level&&Boolean(r[t.level]===t.id)||t.active,onClick:this.itemOnClickHandler},t.id)))}):null,l?.controls?jsx(Controls,{...l.controls}):jsx(Spacer,{top:9})]})]})}}export{ContextMenuMultiLevel};
|
|
1
|
+
import{PureComponent}from'react';import{ContextMenu}from'../ContextMenu/ContextMenu.mjs';import{Heading}from'./Heading.mjs';import{SubHeading}from'./SubHeading.mjs';import{Controls}from'./Controls.mjs';import{MultilevelItems}from'./style.mjs';import{jsxs,Fragment,jsx}from'react/jsx-runtime';import{Spacer}from'../Spacer/Spacer.mjs';class ContextMenuMultiLevel extends PureComponent{static displayName='ContextMenu.MultiLevel';static defaultProps={config:{}};constructor(t){super(t),this.state={selectedItems:[]}}componentWillUnmount(){clearTimeout(this.resetTimeout)}onSelectItem=t=>{const{id:e,level:n}=t;const{selectedItems:o}=this.state;const s=[...o.slice(0,n),e];this.setState({selectedItems:s}),typeof this.props.onSelectItem=='function'&&this.props.onSelectItem(t,n)};getCurrentConfig=()=>{const{config:t}=this.props;const{selectedItems:e}=this.state;if(!t)return null;if(!e.length)return t;try{return e.reduce(((t,e)=>t.items&&t.items.find((t=>t.id===e))?.config||{}),t)}catch(t){return console.error(t),null}};reset=()=>{this.resetTimeout=setTimeout((()=>this.setState({selectedItems:[]})),200)};itemOnClickHandler=t=>{const e=this.getCurrentConfig();if(!e)throw new Error('Config not found');const{items:n=[]}=e;const{currentTarget:o}=t;const{id:s=null}=o.dataset;if(s===null)throw new Error('Data-id for item not found');const i=n.find((t=>`${t.id}`===s));if(!i)throw new Error('Item not found');(i.config||i.preventClosing)&&(t.preventDefault(),t.stopPropagation()),i.config&&this.onSelectItem(i),typeof i.onClick=='function'&&i.onClick(i)};render(){const{children:t,className:e,tooltipProps:n,isOpen:o,trigger:s,...i}=this.props;const{selectedItems:r}=this.state;const l=this.getCurrentConfig();const{config:c,onSelectItem:m,...u}=i;return jsxs(ContextMenu,{className:e,tooltipProps:n,isOpen:o,onClose:this.reset,trigger:s,...u,children:[t,jsxs(Fragment,{children:[jsx(Spacer,{top:9}),l?.heading?jsx(Heading,{content:l.heading}):null,l?.subheading?jsx(SubHeading,{content:l.subheading}):null,l?.items?jsx(MultilevelItems,{children:l.items.map((t=>jsx(ContextMenu.Item,{id:t.id,content:t.content,active:t.level&&Boolean(r[t.level]===t.id)||t.active,onClick:this.itemOnClickHandler},t.id)))}):null,l?.controls?jsx(Controls,{...l.controls}):jsx(Spacer,{top:9})]})]})}}export{ContextMenuMultiLevel};
|
|
2
2
|
//# sourceMappingURL=ContextMenu.Multilevel.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextMenu.Multilevel.mjs","sources":["../../../../src/components/ContextMenu.Multilevel/ContextMenu.Multilevel.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { Color } from 'shared/types'\nimport { Spacer } from 'components/Spacer'\nimport { ContextMenu
|
|
1
|
+
{"version":3,"file":"ContextMenu.Multilevel.mjs","sources":["../../../../src/components/ContextMenu.Multilevel/ContextMenu.Multilevel.tsx"],"sourcesContent":["import { PureComponent } from 'react'\nimport type { BaseProps } from 'shared/interfaces'\nimport type { Color } from 'shared/types'\nimport { Spacer } from 'components/Spacer'\nimport { ContextMenu } from '../ContextMenu/ContextMenu'\nimport type { ContextMenuProps } from '../ContextMenu/ContextMenu'\nimport { Heading } from './Heading'\nimport { SubHeading } from './SubHeading'\nimport { Controls } from './Controls'\nimport * as Styled from './style'\n\nexport interface MultiLevelControls {\n cancel?: {\n content?: string\n onClick?(): void\n color?: Color\n }\n confirm?: {\n content?: string\n onClick?(): void\n color?: Color\n }\n}\n\nexport interface MultiLevelItem {\n id: string | number\n heading?: string\n subheading?: string\n content?: string\n preventClosing?: boolean\n config?: MultiLevelConfig\n items?: MultiLevelItem[]\n controls?: MultiLevelControls\n level?: number\n active?: boolean\n onClick?(_item: MultiLevelItem): void\n}\n\nexport interface MultiLevelConfig {\n items?: MultiLevelItem[]\n heading?: string\n subheading?: string\n controls?: MultiLevelControls\n}\n\nexport interface ContextMenuMultiLevelProps extends ContextMenuProps, BaseProps {\n /** Menu config */\n config?: MultiLevelConfig\n /** On select item callback */\n onSelectItem?(_item: MultiLevelItem, _level: MultiLevelItem['level']): void\n}\n\ninterface ContextMenuMultiLevelState {\n selectedItems: (number | string)[]\n}\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n */\nexport class ContextMenuMultiLevel extends PureComponent<ContextMenuMultiLevelProps, ContextMenuMultiLevelState> {\n resetTimeout?: ReturnType<typeof setTimeout>\n static displayName = 'ContextMenu.MultiLevel'\n static defaultProps = {\n config: {},\n }\n\n constructor(props: ContextMenuMultiLevelProps) {\n super(props)\n\n this.state = {\n selectedItems: [],\n }\n }\n\n componentWillUnmount() {\n clearTimeout(this.resetTimeout)\n }\n\n onSelectItem = (selectedItem: MultiLevelItem) => {\n const { id, level } = selectedItem\n\n const { selectedItems } = this.state\n const newSelectedItems = [...selectedItems.slice(0, level), id]\n\n this.setState({ selectedItems: newSelectedItems })\n\n if (typeof this.props.onSelectItem === 'function') this.props.onSelectItem(selectedItem, level)\n }\n\n getCurrentConfig = (): MultiLevelConfig | null => {\n const { config } = this.props\n const { selectedItems } = this.state\n\n if (!config) return null\n\n if (!selectedItems.length) return config\n\n try {\n const currentConfig = selectedItems.reduce((acc, levelId) => {\n return acc.items ? acc.items.find((item) => item.id === levelId)?.config || {} : {}\n }, config)\n\n return currentConfig\n } catch (error) {\n console.error(error)\n return null\n }\n }\n\n reset = () => {\n /* Reset timeout to prevent state switch due to slow tooltip closing animation */\n this.resetTimeout = setTimeout(() => this.setState({ selectedItems: [] }), 200)\n }\n\n itemOnClickHandler: React.MouseEventHandler<HTMLDivElement> = (e) => {\n const config = this.getCurrentConfig()\n if (!config) throw new Error('Config not found')\n\n const { items = [] } = config\n const { currentTarget } = e\n\n const { id = null } = currentTarget.dataset\n\n if (id === null) throw new Error('Data-id for item not found')\n\n const found = items.find((item) => `${item.id}` === id)\n\n if (!found) throw new Error('Item not found')\n\n if (found.config || found.preventClosing) {\n e.preventDefault()\n e.stopPropagation()\n }\n\n if (found.config) {\n /* If menu item has config - select item to show inner level */\n this.onSelectItem(found)\n }\n\n if (typeof found.onClick === 'function') {\n found.onClick(found)\n }\n }\n\n render() {\n const { children, className, tooltipProps, isOpen, trigger, ...anotherProps } = this.props\n const { selectedItems } = this.state\n const config = this.getCurrentConfig()\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { config: _config, onSelectItem: _onSelectItem, ...restProps } = anotherProps\n\n return (\n <ContextMenu\n className={className}\n tooltipProps={tooltipProps}\n isOpen={isOpen}\n // eslint-disable-next-line react/jsx-handler-names\n onClose={this.reset}\n trigger={trigger}\n {...restProps}\n >\n {children}\n <>\n <Spacer top={9} />\n {config?.heading ? <Heading content={config.heading} /> : null}\n {config?.subheading ? <SubHeading content={config.subheading} /> : null}\n {config?.items ? (\n <Styled.MultilevelItems>\n {config.items.map((item) => (\n <ContextMenu.Item\n key={item.id}\n id={item.id}\n content={item.content}\n active={(item.level && Boolean(selectedItems[item.level] === item.id)) || item.active}\n // eslint-disable-next-line react/jsx-handler-names\n onClick={this.itemOnClickHandler}\n />\n ))}\n </Styled.MultilevelItems>\n ) : null}\n {config?.controls ? <Controls {...config.controls} /> : <Spacer top={9} />}\n </>\n </ContextMenu>\n )\n }\n}\n"],"names":["ContextMenuMultiLevel","PureComponent","static","config","constructor","props","super","this","state","selectedItems","componentWillUnmount","clearTimeout","resetTimeout","onSelectItem","selectedItem","id","level","newSelectedItems","slice","setState","getCurrentConfig","length","reduce","acc","levelId","items","find","item","error","console","reset","setTimeout","itemOnClickHandler","e","Error","currentTarget","dataset","found","preventClosing","preventDefault","stopPropagation","onClick","render","children","className","tooltipProps","isOpen","trigger","anotherProps","_config","_onSelectItem","restProps","_jsxs","ContextMenu","onClose","_Fragment","_jsx","Spacer","top","heading","Heading","content","subheading","SubHeading","Styled","map","Item","active","Boolean","controls","Controls"],"mappings":"6UA4DO,MAAMA,8BAA8BC,cAEzCC,mBAAqB,yBACrBA,oBAAsB,CACpBC,OAAQ,CAAC,GAGXC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,MAAQ,CACXC,cAAe,GAEnB,CAEAC,oBAAAA,GACEC,aAAaJ,KAAKK,aACpB,CAEAC,aAAgBC,IACd,MAAMC,GAAEA,EAAEC,MAAEA,GAAUF,EAEtB,MAAML,cAAEA,GAAkBF,KAAKC,MAC/B,MAAMS,EAAmB,IAAIR,EAAcS,MAAM,EAAGF,GAAQD,GAE5DR,KAAKY,SAAS,CAAEV,cAAeQ,WAEpBV,KAAKF,MAAMQ,cAAiB,YAAYN,KAAKF,MAAMQ,aAAaC,EAAcE,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C,aAAcA,EACdC,OAAQA,EAERQ,QAAS/C,KAAKuB,MACdiB,QAASA,KACLI,EAASR,SAEZA,CAAAA,EACDS,KAAAG,SAAA,CAAAZ,SAAA,CACEa,IAACC,OAAM,CAACC,IAAK,IACZvD,GAAQwD,QAAUH,IAACI,QAAO,CAACC,QAAS1D,EAAOwD,UAAc,KACzDxD,GAAQ2D,WAAaN,IAACO,WAAU,CAACF,QAAS1D,EAAO2D,aAAiB,KAClE3D,GAAQsB,MACP+B,IAACQ,gBAAsB,CAAArB,SACpBxC,EAAOsB,MAAMwC,KAAKtC,GACjB6B,IAACH,YAAYa,KAAI,CAEfnD,GAAIY,EAAKZ,GACT8C,QAASlC,EAAKkC,QACdM,OAASxC,EAAKX,OAASoD,QAAQ3D,EAAckB,EAAKX,SAAWW,EAAKZ,KAAQY,EAAKwC,OAE/E1B,QAASlC,KAAKyB,oBALTL,EAAKZ,QASd,KACHZ,GAAQkE,SAAWb,IAACc,SAAQ,IAAKnE,EAAOkE,WAAeb,IAACC,OAAM,CAACC,IAAK,SAI7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.js","sources":["../../../../src/components/ContextMenu.Multilevel/Controls.tsx"],"sourcesContent":["import { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport { MultiLevelControls } from './ContextMenu.Multilevel'\nimport * as Styled from './style'\n\nexport interface ControlsProps extends BaseProps {\n /** Cancel Text element props */\n cancel?: MultiLevelControls['cancel']\n /** Confirm Text element props */\n confirm?: MultiLevelControls['confirm']\n}\n\nexport function Controls({ cancel, confirm, className, style }: ControlsProps) {\n return (\n <Styled.ControlsRoot className={className} style={style}>\n {cancel ? (\n <Styled.ControlsItem className='cancel' role='button' onClick={cancel.onClick}>\n <Text size='m' lineHeight='s' color={cancel.color || DefaultColorNames.silver}>\n {cancel.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n {confirm ? (\n <Styled.ControlsItem className='confirm' role='button' onClick={confirm.onClick}>\n <Text size='m' lineHeight='s' color={confirm.color || DefaultColorNames.accent}>\n {confirm.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n </Styled.ControlsRoot>\n )\n}\n"],"names":["cancel","confirm","className","style","_jsxs","Styled","children","_jsx","
|
|
1
|
+
{"version":3,"file":"Controls.js","sources":["../../../../src/components/ContextMenu.Multilevel/Controls.tsx"],"sourcesContent":["import type { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport type { MultiLevelControls } from './ContextMenu.Multilevel'\nimport * as Styled from './style'\n\nexport interface ControlsProps extends BaseProps {\n /** Cancel Text element props */\n cancel?: MultiLevelControls['cancel']\n /** Confirm Text element props */\n confirm?: MultiLevelControls['confirm']\n}\n\nexport function Controls({ cancel, confirm, className, style }: ControlsProps) {\n return (\n <Styled.ControlsRoot className={className} style={style}>\n {cancel ? (\n // eslint-disable-next-line react/jsx-handler-names\n <Styled.ControlsItem className='cancel' role='button' onClick={cancel.onClick}>\n <Text size='m' lineHeight='s' color={cancel.color || DefaultColorNames.silver}>\n {cancel.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n {confirm ? (\n // eslint-disable-next-line react/jsx-handler-names\n <Styled.ControlsItem className='confirm' role='button' onClick={confirm.onClick}>\n <Text size='m' lineHeight='s' color={confirm.color || DefaultColorNames.accent}>\n {confirm.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n </Styled.ControlsRoot>\n )\n}\n"],"names":["cancel","confirm","className","style","_jsxs","Styled","children","_jsx","role","onClick","jsx","Text","size","lineHeight","color","DefaultColorNames","silver","content","accent"],"mappings":"0LAaO,EAAkBA,OAAEA,EAAMC,QAAEA,EAAOC,UAAEA,EAAWC,MAAAA,KAEnDC,WAAAA,KAACC,MAAAA,aAAmB,CAACH,UAAWA,EAAWC,MAAOA,EAAMG,UACrDN,EAECO,WAAAA,IAACF,MAAAA,aAAmB,CAACH,UAAU,SAASM,KAAK,SAASC,QAAST,EAAOS,QAAQH,SAC5EC,WAAAG,IAACC,UAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOd,EAAOc,OAASC,OAAAA,kBAAkBC,OAAOV,SAC3EN,EAAOiB,YAGV,KACHhB,EAECM,WAAAA,IAACF,MAAAA,aAAmB,CAACH,UAAU,UAAUM,KAAK,SAASC,QAASR,EAAQQ,QAAQH,SAC9EC,WAAAG,IAACC,UAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOb,EAAQa,OAASC,OAAAA,kBAAkBG,OAAOZ,SAC5EL,EAAQgB,YAGX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.mjs","sources":["../../../../src/components/ContextMenu.Multilevel/Controls.tsx"],"sourcesContent":["import { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport { MultiLevelControls } from './ContextMenu.Multilevel'\nimport * as Styled from './style'\n\nexport interface ControlsProps extends BaseProps {\n /** Cancel Text element props */\n cancel?: MultiLevelControls['cancel']\n /** Confirm Text element props */\n confirm?: MultiLevelControls['confirm']\n}\n\nexport function Controls({ cancel, confirm, className, style }: ControlsProps) {\n return (\n <Styled.ControlsRoot className={className} style={style}>\n {cancel ? (\n <Styled.ControlsItem className='cancel' role='button' onClick={cancel.onClick}>\n <Text size='m' lineHeight='s' color={cancel.color || DefaultColorNames.silver}>\n {cancel.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n {confirm ? (\n <Styled.ControlsItem className='confirm' role='button' onClick={confirm.onClick}>\n <Text size='m' lineHeight='s' color={confirm.color || DefaultColorNames.accent}>\n {confirm.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n </Styled.ControlsRoot>\n )\n}\n"],"names":["Controls","cancel","confirm","className","style","_jsxs","Styled","children","_jsx","role","onClick","Text","size","lineHeight","color","DefaultColorNames","silver","content","accent"],"mappings":"oLAaO,SAASA,UAASC,OAAEA,EAAMC,QAAEA,EAAOC,UAAEA,EAASC,MAAEA,IACrD,OACEC,KAACC,aAAmB,CAACH,UAAWA,EAAWC,MAAOA,EAAMG,UACrDN,
|
|
1
|
+
{"version":3,"file":"Controls.mjs","sources":["../../../../src/components/ContextMenu.Multilevel/Controls.tsx"],"sourcesContent":["import type { BaseProps } from 'shared/interfaces'\nimport { DefaultColorNames } from 'theme/colors'\nimport { Text } from '../Text'\nimport type { MultiLevelControls } from './ContextMenu.Multilevel'\nimport * as Styled from './style'\n\nexport interface ControlsProps extends BaseProps {\n /** Cancel Text element props */\n cancel?: MultiLevelControls['cancel']\n /** Confirm Text element props */\n confirm?: MultiLevelControls['confirm']\n}\n\nexport function Controls({ cancel, confirm, className, style }: ControlsProps) {\n return (\n <Styled.ControlsRoot className={className} style={style}>\n {cancel ? (\n // eslint-disable-next-line react/jsx-handler-names\n <Styled.ControlsItem className='cancel' role='button' onClick={cancel.onClick}>\n <Text size='m' lineHeight='s' color={cancel.color || DefaultColorNames.silver}>\n {cancel.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n {confirm ? (\n // eslint-disable-next-line react/jsx-handler-names\n <Styled.ControlsItem className='confirm' role='button' onClick={confirm.onClick}>\n <Text size='m' lineHeight='s' color={confirm.color || DefaultColorNames.accent}>\n {confirm.content}\n </Text>\n </Styled.ControlsItem>\n ) : null}\n </Styled.ControlsRoot>\n )\n}\n"],"names":["Controls","cancel","confirm","className","style","_jsxs","Styled","children","_jsx","role","onClick","Text","size","lineHeight","color","DefaultColorNames","silver","content","accent"],"mappings":"oLAaO,SAASA,UAASC,OAAEA,EAAMC,QAAEA,EAAOC,UAAEA,EAASC,MAAEA,IACrD,OACEC,KAACC,aAAmB,CAACH,UAAWA,EAAWC,MAAOA,EAAMG,UACrDN,EAECO,IAACF,aAAmB,CAACH,UAAU,SAASM,KAAK,SAASC,QAAST,EAAOS,QAAQH,SAC5EC,IAACG,KAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOb,EAAOa,OAASC,kBAAkBC,OAAOT,SAC3EN,EAAOgB,YAGV,KACHf,EAECM,IAACF,aAAmB,CAACH,UAAU,UAAUM,KAAK,SAASC,QAASR,EAAQQ,QAAQH,SAC9EC,IAACG,KAAI,CAACC,KAAK,IAAIC,WAAW,IAAIC,MAAOZ,EAAQY,OAASC,kBAAkBG,OAAOX,SAC5EL,EAAQe,YAGX,OAGV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n
|
|
1
|
+
{"version":3,"file":"Dialog.js","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","jsx","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"qkBAcA,MAAMA,2BAA6BC,gBAAAA,gBACjCC,MAAAA,YACE,CAACC,EAAOC,KACN,MAAQC,UAAAA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,KAAAA,UAAUC,UAAAA,UAAWL,GAE/D,OAAOM,WAAAA,IAACC,MAAAA,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAWhGS,MAAAA,OAA+FC,OAAOC,OAC1GC,gBAAAA,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BAChBA,EAA2BC,eAC3BA,EAAcC,WACdA,EAAUC,WACVA,EAAUC,QACVA,EAAOC,YACPA,EAAWC,gBACXA,EAAeC,OACfA,EAAMC,YACNA,EAAWC,aACXA,EAAYC,eACZA,KACGC,GACDtC,EAEJ,MAAMuC,EAAyBD,EAAYE,WAAaP,EAExD,OACEzB,WAAAA,IAACiC,oBAAAA,QAAU,CACTC,OAAQzB,EACR0B,aAAa,EACbC,cAAe1B,EACfC,eAAgBA,EAChBC,gBAAiBA,EACjBC,UAAWA,EACXC,kBAAmBA,EACnBC,kBAAmBA,EACnBC,iBAAkBA,EAClBC,0BAA2BA,EAC3BC,iB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,WAoJrB,CACEC,UAAWC,gBAAAA,yCArJQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef((props, ref) => {\n
|
|
1
|
+
{"version":3,"file":"Dialog.mjs","sources":["../../../../src/components/Dialog/Dialog.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport ReactModal from 'react-modal'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { withTranslation } from 'hocs/withTranslation'\nimport type { InjectedTranslationProps } from 'hocs/withTranslation'\nimport { DialogComponent } from 'components/DialogComponent'\nimport { deepmerge } from 'shared/utils/misc'\nimport { SIZES, SIZES_FANCY } from './sizes'\nimport { POSITIONS } from './positions'\nimport * as Styled from './style'\nimport type { DialogProps, TranslationDialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'Dialog'\n\nconst TranslationDialogComponent = withTranslation<HTMLDivElement, TranslationDialogComponentProps>(\n forwardRef<HTMLDivElement, InjectedTranslationProps<HTMLDivElement, TranslationDialogComponentProps>>(\n (props, ref) => {\n const { positions = {}, translated, ...restProps } = props\n\n const dialogPositions = translated ? {} : deepmerge(POSITIONS, positions)\n\n return <Styled.PositionedDialogComponent {...restProps} positions={dialogPositions} ref={ref} />\n }\n )\n)\n\n/**\n *\n * Компонент для отображения контента поверх основного интерфейса.\n *\n * Поддерживаются все нативные атрибуты \\<div\\> элемента.\n */\nconst Dialog: React.ForwardRefExoticComponent<DialogProps> & { Component: typeof DialogComponent } = Object.assign(\n withMergedProps<DialogProps, HTMLDivElement>(\n (props) => {\n const {\n size = 's',\n position = 'center',\n role = 'dialog',\n open,\n preventScrollAfterClose,\n closeTimeoutMS,\n portalClassName,\n className,\n bodyOpenClassName,\n htmlOpenClassName,\n overlayClassName,\n shouldCloseOnOverlayClick,\n shouldCloseOnEsc,\n shouldReturnFocusAfterClose,\n parentSelector,\n overlayRef,\n contentRef,\n palette,\n overlayBlur,\n overlayDisabled,\n zIndex,\n onAfterOpen,\n onAfterClose,\n onRequestClose,\n ...dialogProps\n } = props\n\n const overlayElementDisabled = dialogProps.draggable || overlayDisabled\n\n return (\n <ReactModal\n isOpen={open}\n ariaHideApp={false}\n preventScroll={preventScrollAfterClose}\n closeTimeoutMS={closeTimeoutMS}\n portalClassName={portalClassName}\n className={className}\n bodyOpenClassName={bodyOpenClassName}\n htmlOpenClassName={htmlOpenClassName}\n overlayClassName={overlayClassName}\n shouldCloseOnOverlayClick={shouldCloseOnOverlayClick}\n shouldCloseOnEsc={shouldCloseOnEsc}\n shouldReturnFocusAfterClose={shouldReturnFocusAfterClose}\n parentSelector={parentSelector}\n overlayRef={overlayRef}\n contentRef={contentRef}\n onAfterOpen={onAfterOpen}\n onAfterClose={onAfterClose}\n onRequestClose={onRequestClose}\n contentElement={(contentProps) => {\n const {\n ref,\n className: contentElementClassName,\n tabIndex,\n onKeyDown,\n onMouseDown,\n onMouseUp,\n onClick,\n } = contentProps\n\n return (\n <TranslationDialogComponent\n {...dialogProps}\n ref={ref}\n size={size}\n role={role}\n className={contentElementClassName}\n tabIndex={tabIndex}\n position={position}\n aria-modal={!dialogProps.draggable && !overlayDisabled}\n palette={{\n color: palette.color,\n backgroundColor: palette.backgroundColor,\n shadowColor: palette.shadowColor,\n }}\n zIndex={overlayElementDisabled ? zIndex : undefined}\n onKeyDown={(evt) => {\n if (dialogProps.onKeyDown) dialogProps.onKeyDown(evt)\n if (onKeyDown) onKeyDown(evt)\n }}\n onMouseDown={(evt) => {\n if (dialogProps.onMouseDown) dialogProps.onMouseDown(evt)\n if (onMouseDown) onMouseDown(evt)\n }}\n onMouseUp={(evt) => {\n if (dialogProps.onMouseUp) dialogProps.onMouseUp(evt)\n if (onMouseUp) onMouseUp(evt)\n }}\n onClick={(evt) => {\n if (dialogProps.onClick) dialogProps.onClick(evt)\n if (onClick) onClick(evt)\n }}\n />\n )\n }}\n overlayElement={(overlayProps, contentElement) => {\n const { ref, className: overlayElementClassName, onClick, onMouseDown } = overlayProps\n\n return overlayElementDisabled ? (\n contentElement\n ) : (\n <Styled.DialogOverlay\n ref={ref}\n className={overlayElementClassName}\n blur={overlayBlur}\n palette={{\n backgroundColor: palette.overlayBackgroundColor,\n }}\n zIndex={zIndex}\n onClick={onClick}\n onMouseDown={onMouseDown}\n >\n {contentElement}\n </Styled.DialogOverlay>\n )\n }}\n />\n )\n },\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n ),\n {\n Component: DialogComponent,\n }\n)\n\nexport { Dialog }\n\nexport { COMPONENT_NAME }\n"],"names":["COMPONENT_NAME","TranslationDialogComponent","withTranslation","forwardRef","props","ref","positions","translated","restProps","dialogPositions","deepmerge","POSITIONS","_jsx","Styled","Dialog","Object","assign","withMergedProps","size","position","role","open","preventScrollAfterClose","closeTimeoutMS","portalClassName","className","bodyOpenClassName","htmlOpenClassName","overlayClassName","shouldCloseOnOverlayClick","shouldCloseOnEsc","shouldReturnFocusAfterClose","parentSelector","overlayRef","contentRef","palette","overlayBlur","overlayDisabled","zIndex","onAfterOpen","onAfterClose","onRequestClose","dialogProps","overlayElementDisabled","draggable","ReactModal","isOpen","ariaHideApp","preventScroll","contentElement","contentProps","contentElementClassName","tabIndex","onKeyDown","onMouseDown","onMouseUp","onClick","color","backgroundColor","shadowColor","undefined","evt","overlayElement","overlayProps","overlayElementClassName","blur","overlayBackgroundColor","children","sizes","fancy","SIZES_FANCY","SIZES","displayName","Component","DialogComponent"],"mappings":"ueAYMA,MAAAA,eAAiB,SAEvB,MAAMC,2BAA6BC,gBACjCC,YACE,CAACC,EAAOC,KACN,MAAMC,UAAEA,EAAY,CAAE,EAAAC,WAAEA,KAAeC,GAAcJ,EAErD,MAAMK,EAAkBF,EAAa,CAAA,EAAKG,UAAUC,UAAWL,GAE/D,OAAOM,IAACC,0BAAgC,IAAKL,EAAWF,UAAWG,EAAiBJ,IAAKA,GAAO,KAWhGS,MAAAA,OAA+FC,OAAOC,OAC1GC,iBACGb,IACC,MAAMc,KACJA,EAAO,IAAGC,SACVA,EAAW,SAAQC,KACnBA,EAAO,SAAQC,KACfA,EAAIC,wBACJA,EAAuBC,eACvBA,EAAcC,gBACdA,EAAeC,UACfA,EAASC,kBACTA,EAAiBC,kBACjBA,EAAiBC,iBACjBA,EAAgBC,0BAChBA,EAAyBC,iBACzBA,EAAgBC,4BAChBA,EAA2BC,eAC3BA,EAAcC,WACdA,EAAUC,WACVA,EAAUC,QACVA,EAAOC,YACPA,EAAWC,gBACXA,EAAeC,OACfA,EAAMC,YACNA,EAAWC,aACXA,EAAYC,eACZA,KACGC,GACDtC,EAEJ,MAAMuC,EAAyBD,EAAYE,WAAaP,EAExD,OACEzB,IAACiC,WAAU,CACTC,OAAQzB,EACR0B,aAAa,EACbC,cAAe1B,EACfC,eAAgBA,EAChBC,gBAAiBA,EACjBC,UAAWA,EACXC,kBAAmBA,EACnBC,kBAAmBA,EACnBC,iBAAkBA,EAClBC,0BAA2BA,EAC3BC,iBAAkBA,EAClBC,4BAA6BA,EAC7BC,eAAgBA,EAChBC,WAAYA,EACZC,WAAYA,EACZK,YAAaA,EACbC,aAAcA,EACdC,eAAgBA,EAChBQ,eAAiBC,IACf,MAAM7C,IACJA,EACAoB,UAAW0B,EAAuBC,SAClCA,EAAQC,UACRA,EAASC,YACTA,EAAWC,UACXA,EAASC,QACTA,GACEN,EAEJ,OACEtC,IAACX,2BAA0B,IACrByC,EACJrC,IAAKA,EACLa,KAAMA,EACNE,KAAMA,EACNK,UAAW0B,EACXC,SAAUA,EACVjC,SAAUA,EACV,cAAauB,EAAYE,YAAcP,EACvCF,QAAS,CACPsB,MAAOtB,EAAQsB,MACfC,gBAAiBvB,EAAQuB,gBACzBC,YAAaxB,EAAQwB,aAEvBrB,OAAQK,EAAyBL,OAASsB,EAC1CP,UAAYQ,IACNnB,EAAYW,WAAWX,EAAYW,UAAUQ,GAC7CR,GAAWA,EAAUQ,EAAI,EAE/BP,YAAcO,IACRnB,EAAYY,aAAaZ,EAAYY,YAAYO,GACjDP,GAAaA,EAAYO,EAAI,EAEnCN,UAAYM,IACNnB,EAAYa,WAAWb,EAAYa,UAAUM,GAC7CN,GAAWA,EAAUM,EAAI,EAE/BL,QAAUK,IACJnB,EAAYc,SAASd,EAAYc,QAAQK,GACzCL,GAASA,EAAQK,EAAI,GAE3B,EAGNC,eAAgBA,CAACC,EAAcd,KAC7B,MAAM5C,IAAEA,EAAKoB,UAAWuC,EAAuBR,QAAEA,EAAOF,YAAEA,GAAgBS,EAE1E,OAAOpB,EACLM,EAEArC,IAACC,cAAoB,CACnBR,IAAKA,EACLoB,UAAWuC,EACXC,KAAM7B,EACND,QAAS,CACPuB,gBAAiBvB,EAAQ+B,wBAE3B5B,OAAQA,EACRkB,QAASA,EACTF,YAAaA,EAAYa,SAExBlB,GAEJ,GAEH,GAGN,CACEmB,MAAQhE,GAAWA,EAAMiE,MAAQC,YAAcC,MAC/CC,YAjJiB,WAoJrB,CACEC,UAAWC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useScrollThresholds=require('../../hooks/useScrollThresholds.js');var constants=require('../../shared/constants.js');var dom=require('../../shared/utils/dom.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",layout:
|
|
1
|
+
'use strict';var React=require('react');var withMergedProps=require('../../hocs/withMergedProps.js');var useScrollThresholds=require('../../hooks/useScrollThresholds.js');var constants=require('../../shared/constants.js');var dom=require('../../shared/utils/dom.js');var dragging=require('./images/dragging.svg.js');var style=require('./style.js');var sizes=require('./sizes.js');var layouts=require('./layouts.js');var jsxRuntime=require('react/jsx-runtime');var Icon=require('../Icon/Icon.js');var AspectRatio=require('../AspectRatio/AspectRatio.js');var Skeleton=require('../Skeleton/Skeleton.js');var Text=require('../Text/Text.js');const DialogComponent=withMergedProps.withMergedProps(React.forwardRef(((e,t)=>{const{size:s="s",layout:n="vertical",scrollable:o=!1,scrollFading:i=!1,sizeXXS:l,sizeXS:r,sizeS:a,sizeM:u,sizeL:c,sizeXL:x,layoutXXS:m,layoutXS:d,layoutS:j,layoutM:y,layoutL:R,layoutXL:g,root:S,floats:p,media:h,body:T,caption:I,title:z,subtitle:A,children:f,footer:E,closeButton:b,progressLine:L,fancy:k,imgSrcVertical:w,imgSrcHorizontal:C,draggable:N,loading:v,className:_,backgroundClassName:O,onGrab:B,onNudge:P,...D}=e;const V={size:s,sizeXXS:l,sizeXS:r,sizeS:a,sizeM:u,sizeL:c,sizeXL:x};const X={layout:n,layoutXXS:m,layoutXS:d,layoutS:j,layoutM:y,layoutL:R,layoutXL:g};const q={...V,appearance:'body',color:'content-onmain-tertiary',wordBreak:'break-word',marginBottom:'0.8em',sizes:sizes.SIZES_CAPTION};const Y={...V,as:'h2',appearance:'heading',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.5em',sizes:sizes.SIZES_TITLE};const M={...V,as:'p',appearance:'body',color:'content-onmain-primary',wordBreak:'break-word',marginBottom:'0.8em',sizes:sizes.SIZES_SUBTITLE};const Z=k?{icon:'close',size:'xxl',secondary:!0}:{icon:'close',size:'l',marginTop:8,marginRight:8};const F={size:'xs'};const U=k?_:dom.concatClassNames(_,O);const H=o&&i;const[K,G]=React.useState(null);const{scrollThresholds:J,setScrollThresholds:Q}=useScrollThresholds.useScrollThresholds({enabled:H,target:K});return jsxRuntime.jsxs(style.Root,{...D,...V,...X,layouts:k?layouts.LAYOUTS_FANCY:layouts.LAYOUTS,className:U,fancy:k,ref:t,children:[k?jsxRuntime.jsx(style.FancyBackground,{className:O}):null,React.isValidElement(S)?S:typeof S=='function'?S({captionProps:q,titleProps:Y,subtitleProps:M,closeButtonProps:Z,progressLineProps:F,onGrab:B,onNudge:P}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[p,N?jsxRuntime.jsx(style.DraggingHandle,{...X,layouts:layouts.VISIBILITY_VERTICAL,onPointerDown:B,children:jsxRuntime.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:P,children:jsxRuntime.jsx(Icon.Icon,{icon:jsxRuntime.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary"})})}):null,b?jsxRuntime.jsx(style.ButtonPosition,{children:React.isValidElement(b)?b:typeof b=='function'?b(Z):null}):null,v||h||w?jsxRuntime.jsx(style.Media,{...X,layouts:k?layouts.LAYOUTS_FANCY_MEDIA_VERTICAL:layouts.LAYOUTS_MEDIA_VERTICAL,children:v?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"3:1",width:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:0})}):React.isValidElement(h)?h:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"3:1",width:"100%",children:jsxRuntime.jsx(style.Img,{src:w})})}):null,v||h||C?jsxRuntime.jsx(style.Media,{...X,layouts:layouts.LAYOUTS_MEDIA_HORIZONTAL,children:v?jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"5:7",height:"100%",children:jsxRuntime.jsx(Skeleton.Skeleton,{borderRadius:0})}):React.isValidElement(h)?h:jsxRuntime.jsx(AspectRatio.AspectRatio,{ratio:"5:7",height:"100%",children:jsxRuntime.jsx(style.Img,{src:C})})}):null,jsxRuntime.jsxs(style.Body,{children:[L&&!v?jsxRuntime.jsx(style.ProgressPosition,{...X,layouts:k?layouts.LAYOUTS_FANCY_PROGRESS:layouts.LAYOUTS_PROGRESS,children:React.isValidElement(L)?L:typeof L=='function'?L(F):null}):null,N?jsxRuntime.jsx(style.DraggingHandle,{...X,layouts:layouts.VISIBILITY_HORIZONTAL,onPointerDown:B,children:jsxRuntime.jsx(style.DraggingIconContainer,{tabIndex:0,onKeyDown:P,children:jsxRuntime.jsx(Icon.Icon,{icon:jsxRuntime.jsx(dragging.default,{}),size:34,color:"content-onmain-tertiary"})})}):null,k?jsxRuntime.jsx(style.LayoutSpacer,{...X,layouts:layouts.VISIBILITY_HORIZONTAL,paddingTop:76}):null,v?jsxRuntime.jsx(style.Container,{...V,sizes:sizes.SIZES_CONTAINER,children:jsxRuntime.jsxs(style.Content,{...V,sizes:sizes.SIZES_CONTENT,children:[jsxRuntime.jsx(Skeleton.Skeleton,{children:jsxRuntime.jsx(Text.Text,{...Y,marginBottom:"1.5em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"90%",children:jsxRuntime.jsx(Text.Text,{...M,marginBottom:"0.4em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"70%",children:jsxRuntime.jsx(Text.Text,{...M,marginBottom:"0.4em"})}),jsxRuntime.jsx(Skeleton.Skeleton,{width:"50%",children:jsxRuntime.jsx(Text.Text,{...M,marginBottom:"0.8em"})})]})}):React.isValidElement(T)?T:typeof T=='function'?T({captionProps:q,titleProps:Y,subtitleProps:M}):jsxRuntime.jsxs(style.Container,{...V,sizes:sizes.SIZES_CONTAINER,children:[H?jsxRuntime.jsx(style.Fading,{visible:J.top===!1}):null,jsxRuntime.jsxs(style.Content,{...V,sizes:sizes.SIZES_CONTENT,ref:e=>{G(e)},scrollable:o,tabIndex:o?0:void 0,onScroll:e=>{H&&Q(e.currentTarget)},onKeyDown:e=>{constants.keyboardKeys.ArrowUp.validate(e.key)?(e.preventDefault(),e.currentTarget.scrollBy(0,-13)):constants.keyboardKeys.ArrowDown.validate(e.key)&&(e.preventDefault(),e.currentTarget.scrollBy(0,13))},children:[React.isValidElement(I)?I:typeof I=='function'?I(q):typeof I=='string'||typeof I=='number'?jsxRuntime.jsx(Text.Text,{...q,children:I}):null,React.isValidElement(z)?z:typeof z=='function'?z(Y):typeof z=='string'||typeof z=='number'?jsxRuntime.jsx(Text.Text,{...Y,children:z}):null,React.isValidElement(A)?A:typeof A=='function'?A(M):typeof A=='string'||typeof A=='number'?jsxRuntime.jsx(Text.Text,{...M,children:A}):null,f]}),H?jsxRuntime.jsx(style.Fading,{visible:J.bottom===!1,after:!0}):null,E?jsxRuntime.jsx(style.Footer,{...V,sizes:sizes.SIZES_FOOTER,children:E}):null]})]})]})]})})),{sizes:e=>e.fancy?sizes.SIZES_FANCY:sizes.SIZES,displayName:'DialogComponent'});exports.DialogComponent=DialogComponent;
|
|
2
2
|
//# sourceMappingURL=DialogComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy && <Styled.FancyBackground className={backgroundClassName} />}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable && (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {closeButton && (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n )}\n {(loading || media || imgSrcVertical) && (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n {(loading || media || imgSrcHorizontal) && (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n )}\n <Styled.Body>\n {progressLine && !loading && (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n )}\n {draggable && (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n )}\n {fancy && <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} />}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {scrollFadingEnabled && <Styled.Fading visible={scrollThresholds.top === false} />}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(ref) => {\n setContentRef(ref)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled && <Styled.Fading visible={scrollThresholds.bottom === false} after />}\n {footer && (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n )}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","jsx","isValidElement","jsxs","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","default","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","visible","top","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"6nBAuCMA,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAAW,CAACC,EAAOC,KACjB,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,WACnBA,GAAa,EAAKC,aAClBA,GAAe,EAAKC,QACpBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SAC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,MAAOyE,MAAaA,aAAA9F,SAC/CC,eAQH,IAGlB,CACEoB,MAAQ9C,GAAWA,EAAM6B,MAAQ2F,MAAWA,YAAGC,MAAMA,MACrDC,YAvSmB"}
|
|
1
|
+
{"version":3,"file":"DialogComponent.js","sources":["../../../../src/components/DialogComponent/DialogComponent.tsx"],"sourcesContent":["import { forwardRef, useState, isValidElement } from 'react'\nimport { withMergedProps } from 'hocs/withMergedProps'\nimport type { MergedProps } from 'hocs/withMergedProps'\nimport { useScrollThresholds } from 'hooks/useScrollThresholds'\nimport { keyboardKeys } from 'shared/constants'\nimport { Text } from 'components/Text'\nimport { Icon } from 'components/Icon'\nimport { Skeleton } from 'components/Skeleton'\nimport { AspectRatio } from 'components/AspectRatio'\nimport type { TextProps } from 'components/Text'\nimport type { IconButtonProps } from 'components/IconButton'\nimport type { ProgressLineProps } from 'components/ProgressLine'\nimport { concatClassNames } from 'shared/utils/dom'\nimport Dragging from './images/dragging.svg?module'\nimport * as Styled from './style'\nimport {\n SIZES,\n SIZES_FANCY,\n SIZES_CONTAINER,\n SIZES_CONTENT,\n SIZES_FOOTER,\n SIZES_CAPTION,\n SIZES_TITLE,\n SIZES_SUBTITLE,\n} from './sizes'\nimport {\n LAYOUTS,\n LAYOUTS_FANCY,\n LAYOUTS_MEDIA_VERTICAL,\n LAYOUTS_FANCY_MEDIA_VERTICAL,\n LAYOUTS_MEDIA_HORIZONTAL,\n LAYOUTS_PROGRESS,\n LAYOUTS_FANCY_PROGRESS,\n VISIBILITY_VERTICAL,\n VISIBILITY_HORIZONTAL,\n} from './layouts'\nimport type { DialogComponentProps } from './types'\n\nconst COMPONENT_NAME = 'DialogComponent'\n\nconst DialogComponent: React.ForwardRefExoticComponent<DialogComponentProps> = withMergedProps<\n DialogComponentProps,\n HTMLDivElement\n>(\n forwardRef<HTMLDivElement, MergedProps<DialogComponentProps>>((props, ref) => {\n const {\n size = 's',\n layout = 'vertical',\n scrollable = false,\n scrollFading = false,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n root,\n floats,\n media,\n body,\n caption,\n title,\n subtitle,\n children,\n footer,\n closeButton,\n progressLine,\n fancy,\n imgSrcVertical,\n imgSrcHorizontal,\n draggable,\n loading,\n className,\n backgroundClassName,\n onGrab,\n onNudge,\n ...restProps\n } = props\n\n const sizeProps = {\n size,\n sizeXXS,\n sizeXS,\n sizeS,\n sizeM,\n sizeL,\n sizeXL,\n }\n\n const layoutProps = {\n layout,\n layoutXXS,\n layoutXS,\n layoutS,\n layoutM,\n layoutL,\n layoutXL,\n }\n\n const captionProps: TextProps = {\n ...sizeProps,\n appearance: 'body',\n color: 'content-onmain-tertiary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_CAPTION,\n }\n\n const titleProps: TextProps = {\n ...sizeProps,\n as: 'h2',\n appearance: 'heading',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.5em',\n sizes: SIZES_TITLE,\n }\n\n const subtitleProps: TextProps = {\n ...sizeProps,\n as: 'p',\n appearance: 'body',\n color: 'content-onmain-primary',\n wordBreak: 'break-word',\n marginBottom: '0.8em',\n sizes: SIZES_SUBTITLE,\n }\n\n const closeButtonProps: IconButtonProps = fancy\n ? { icon: 'close', size: 'xxl', secondary: true }\n : { icon: 'close', size: 'l', marginTop: 8, marginRight: 8 }\n\n const progressLineProps: ProgressLineProps = {\n size: 'xs',\n }\n\n const rootClassName = !fancy ? concatClassNames(className, backgroundClassName) : className\n\n const scrollFadingEnabled = scrollable && scrollFading\n\n const [contentRef, setContentRef] = useState<HTMLDivElement | null>(null)\n\n const { scrollThresholds, setScrollThresholds } = useScrollThresholds({\n enabled: scrollFadingEnabled,\n target: contentRef,\n })\n\n return (\n <Styled.Root\n {...restProps}\n {...sizeProps}\n {...layoutProps}\n layouts={fancy ? LAYOUTS_FANCY : LAYOUTS}\n className={rootClassName}\n fancy={fancy}\n ref={ref}\n >\n {fancy ? <Styled.FancyBackground className={backgroundClassName} /> : null}\n {isValidElement(root) ? (\n root\n ) : typeof root === 'function' ? (\n root({\n captionProps,\n titleProps,\n subtitleProps,\n closeButtonProps,\n progressLineProps,\n onGrab,\n onNudge,\n })\n ) : (\n <>\n {floats}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_VERTICAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {closeButton ? (\n <Styled.ButtonPosition>\n {isValidElement(closeButton)\n ? closeButton\n : typeof closeButton === 'function'\n ? closeButton(closeButtonProps)\n : null}\n </Styled.ButtonPosition>\n ) : null}\n {loading || media || imgSrcVertical ? (\n <Styled.Media {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_MEDIA_VERTICAL : LAYOUTS_MEDIA_VERTICAL}>\n {loading ? (\n <AspectRatio ratio='3:1' width='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='3:1' width='100%'>\n <Styled.Img src={imgSrcVertical} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n {loading || media || imgSrcHorizontal ? (\n <Styled.Media {...layoutProps} layouts={LAYOUTS_MEDIA_HORIZONTAL}>\n {loading ? (\n <AspectRatio ratio='5:7' height='100%'>\n <Skeleton borderRadius={0} />\n </AspectRatio>\n ) : isValidElement(media) ? (\n media\n ) : (\n <AspectRatio ratio='5:7' height='100%'>\n <Styled.Img src={imgSrcHorizontal} />\n </AspectRatio>\n )}\n </Styled.Media>\n ) : null}\n <Styled.Body>\n {progressLine && !loading ? (\n <Styled.ProgressPosition {...layoutProps} layouts={fancy ? LAYOUTS_FANCY_PROGRESS : LAYOUTS_PROGRESS}>\n {isValidElement(progressLine)\n ? progressLine\n : typeof progressLine === 'function'\n ? progressLine(progressLineProps)\n : null}\n </Styled.ProgressPosition>\n ) : null}\n {draggable ? (\n <Styled.DraggingHandle {...layoutProps} layouts={VISIBILITY_HORIZONTAL} onPointerDown={onGrab}>\n <Styled.DraggingIconContainer tabIndex={0} onKeyDown={onNudge}>\n <Icon icon={<Dragging />} size={34} color='content-onmain-tertiary' />\n </Styled.DraggingIconContainer>\n </Styled.DraggingHandle>\n ) : null}\n {fancy ? <Styled.LayoutSpacer {...layoutProps} layouts={VISIBILITY_HORIZONTAL} paddingTop={76} /> : null}\n {loading ? (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n <Styled.Content {...sizeProps} sizes={SIZES_CONTENT}>\n <Skeleton>\n <Text {...titleProps} marginBottom='1.5em' />\n </Skeleton>\n <Skeleton width='90%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='70%'>\n <Text {...subtitleProps} marginBottom='0.4em' />\n </Skeleton>\n <Skeleton width='50%'>\n <Text {...subtitleProps} marginBottom='0.8em' />\n </Skeleton>\n </Styled.Content>\n </Styled.Container>\n ) : isValidElement(body) ? (\n body\n ) : typeof body === 'function' ? (\n body({\n captionProps,\n titleProps,\n subtitleProps,\n })\n ) : (\n <Styled.Container {...sizeProps} sizes={SIZES_CONTAINER}>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.top === false} /> : null}\n <Styled.Content\n {...sizeProps}\n sizes={SIZES_CONTENT}\n ref={(node) => {\n setContentRef(node)\n }}\n scrollable={scrollable}\n tabIndex={scrollable ? 0 : undefined}\n onScroll={(evt) => {\n if (scrollFadingEnabled) {\n setScrollThresholds(evt.currentTarget)\n }\n }}\n onKeyDown={(evt) => {\n if (keyboardKeys.ArrowUp.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, -13)\n } else if (keyboardKeys.ArrowDown.validate(evt.key)) {\n evt.preventDefault()\n evt.currentTarget.scrollBy(0, 13)\n }\n }}\n >\n {isValidElement(caption) ? (\n caption\n ) : typeof caption === 'function' ? (\n caption(captionProps)\n ) : typeof caption === 'string' || typeof caption === 'number' ? (\n <Text {...captionProps}>{caption}</Text>\n ) : null}\n {isValidElement(title) ? (\n title\n ) : typeof title === 'function' ? (\n title(titleProps)\n ) : typeof title === 'string' || typeof title === 'number' ? (\n <Text {...titleProps}>{title}</Text>\n ) : null}\n {isValidElement(subtitle) ? (\n subtitle\n ) : typeof subtitle === 'function' ? (\n subtitle(subtitleProps)\n ) : typeof subtitle === 'string' || typeof subtitle === 'number' ? (\n <Text {...subtitleProps}>{subtitle}</Text>\n ) : null}\n {children}\n </Styled.Content>\n {scrollFadingEnabled ? <Styled.Fading visible={scrollThresholds.bottom === false} after /> : null}\n {footer ? (\n <Styled.Footer {...sizeProps} sizes={SIZES_FOOTER}>\n {footer}\n </Styled.Footer>\n ) : null}\n </Styled.Container>\n )}\n </Styled.Body>\n </>\n )}\n </Styled.Root>\n )\n }),\n {\n sizes: (props) => (props.fancy ? SIZES_FANCY : SIZES),\n displayName: COMPONENT_NAME,\n }\n)\n\nexport { DialogComponent }\n"],"names":["DialogComponent","withMergedProps","forwardRef","props","ref","size","layout","scrollable","scrollFading","sizeXXS","sizeXS","sizeS","sizeM","sizeL","sizeXL","layoutXXS","layoutXS","layoutS","layoutM","layoutL","layoutXL","root","floats","media","body","caption","title","subtitle","children","footer","closeButton","progressLine","fancy","imgSrcVertical","imgSrcHorizontal","draggable","loading","className","backgroundClassName","onGrab","onNudge","restProps","sizeProps","layoutProps","captionProps","appearance","color","wordBreak","marginBottom","sizes","SIZES_CAPTION","titleProps","as","SIZES_TITLE","subtitleProps","SIZES_SUBTITLE","closeButtonProps","icon","secondary","marginTop","marginRight","progressLineProps","rootClassName","concatClassNames","scrollFadingEnabled","contentRef","setContentRef","useState","scrollThresholds","setScrollThresholds","useScrollThresholds","enabled","target","_jsxs","Styled","layouts","LAYOUTS_FANCY","LAYOUTS","_jsx","jsx","isValidElement","jsxs","_Fragment","VISIBILITY_VERTICAL","onPointerDown","tabIndex","onKeyDown","Icon","Dragging","default","LAYOUTS_FANCY_MEDIA_VERTICAL","LAYOUTS_MEDIA_VERTICAL","AspectRatio","ratio","width","Skeleton","borderRadius","src","LAYOUTS_MEDIA_HORIZONTAL","height","LAYOUTS_FANCY_PROGRESS","LAYOUTS_PROGRESS","VISIBILITY_HORIZONTAL","paddingTop","SIZES_CONTAINER","SIZES_CONTENT","Text","visible","top","node","undefined","onScroll","evt","currentTarget","keyboardKeys","ArrowUp","validate","key","preventDefault","scrollBy","ArrowDown","bottom","after","SIZES_FOOTER","SIZES_FANCY","SIZES","displayName"],"mappings":"6nBAwCMA,MAAAA,gBAAyEC,gBAAAA,gBAI7EC,MAAAA,YAA8D,CAACC,EAAOC,KACpE,MAAMC,KACJA,EAAO,IAAGC,OACVA,EAAS,WAAUC,WACnBA,GAAa,EAAKC,aAClBA,GAAe,EAAKC,QACpBA,EAAOC,OACPA,EAAMC,MACNA,EAAKC,MACLA,EAAKC,MACLA,EAAKC,OACLA,EAAMC,UACNA,EAASC,SACTA,EAAQC,QACRA,EAAOC,QACPA,EAAOC,QACPA,EAAOC,SACPA,EAAQC,KACRA,EAAIC,OACJA,EAAMC,MACNA,EAAKC,KACLA,EAAIC,QACJA,EAAOC,MACPA,EAAKC,SACLA,EAAQC,SACRA,EAAQC,OACRA,EAAMC,YACNA,EAAWC,aACXA,EAAYC,MACZA,EAAKC,eACLA,EAAcC,iBACdA,EAAgBC,UAChBA,EAASC,QACTA,EAAOC,UACPA,EAASC,oBACTA,EAAmBC,OACnBA,EAAMC,QACNA,KACGC,GACDtC,EAEJ,MAAMuC,EAAY,CAChBrC,OACAI,UACAC,SACAC,QACAC,QACAC,QACAC,UAGF,MAAM6B,EAAc,CAClBrC,SACAS,YACAC,WACAC,UACAC,UACAC,UACAC,YAGF,MAAMwB,EAA0B,IAC3BF,EACHG,WAAY,OACZC,MAAO,0BACPC,UA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