@evergis/react 3.1.76 → 3.1.77

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/dist/react.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
2
- import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip as Tooltip$1, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, Dialog, DialogTitle, ThemeProvider, darkTheme, DialogContent, CircularProgress, LinearProgress, H2, defaultTheme, Preview, Blank, Popover, Expander, UploaderItemArea, UploaderTitleWrapper, Uploader, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
2
+ import { IconButton, Flex, transition, Chip, Icon, Description, FlexSpan, IconToggle, Popup, Menu, DraggableTree, shadows, Divider, LegendToggler, Tooltip as Tooltip$1, DropdownField, MultiSelectContainer, IconButtonButton, FlatButton, DraggableTreeContainer, Dialog, DialogTitle, ThemeProvider, darkTheme, DialogContent, CircularProgress, LinearProgress, H2, defaultTheme, Preview, Blank, Popover, UploaderItemArea, UploaderTitleWrapper, Uploader, NumberRangeSlider, useAsyncAutocomplete, AutoComplete, Dropdown, Checkbox, RangeNumberInput, dateFormat } from '@evergis/uilib-gl';
3
3
  import { createContext, memo, useRef, useState, useEffect, useCallback, useContext, useMemo, Fragment } from 'react';
4
4
  import styled, { createGlobalStyle, css, useTheme } from 'styled-components';
5
5
  import { lineChartClassNames, BarChart as BarChart$1, barChartClassNames, LineChart, PieChart } from '@evergis/charts';
@@ -5161,7 +5161,8 @@ const Container = styled(Flex) `
5161
5161
 
5162
5162
  ${({ isColumn }) => isColumn
5163
5163
  ? css `
5164
- > * {
5164
+ &&& > * {
5165
+ justify-content: flex-start;
5165
5166
  width: 100%;
5166
5167
 
5167
5168
  :not(:last-child) {
@@ -5679,7 +5680,7 @@ const OneColumnContainer = memo(({ elementConfig, renderElement }) => {
5679
5680
  const hasUnits = elementConfig?.children?.some(({ id }) => id === "units");
5680
5681
  if (!value && hideEmpty)
5681
5682
  return null;
5682
- return (jsxs(Container, { id: id, style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [value, hasUnits && jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
5683
+ return (jsxs(Container, { id: id, isColumn: true, style: innerTemplateStyle || style, children: [jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxs(ContainerValue, { children: [value, hasUnits && jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
5683
5684
  });
5684
5685
 
5685
5686
  const TwoColumnContainer = memo(({ config, elementConfig, type, renderElement }) => {
@@ -8011,37 +8012,6 @@ const MarkdownWrapper = styled.div `
8011
8012
  display: none;
8012
8013
  }
8013
8014
  `;
8014
- styled(Flex) `
8015
- align-items: center;
8016
- gap: 1rem;
8017
- margin-top: 1rem;
8018
- `;
8019
- styled.span `
8020
- display: block;
8021
- font-size: 0.75rem;
8022
- line-height: 0.875rem;
8023
- opacity: 0.36;
8024
- margin: 0 0 0.5rem 0;
8025
- `;
8026
- styled.div `
8027
- width: 1.25rem;
8028
- height: 1.25rem;
8029
- cursor: pointer;
8030
- transition: opacity 0.2s;
8031
-
8032
- &:hover {
8033
- opacity: 0.7;
8034
- }
8035
-
8036
- img, svg {
8037
- width: 100%;
8038
- height: 100%;
8039
- display: block;
8040
- }
8041
- `;
8042
- const ExpandButton = styled(IconButton) `
8043
- margin-bottom: 1rem;
8044
- `;
8045
8015
 
8046
8016
  const ElementMarkdown = memo(({ elementConfig, type }) => {
8047
8017
  const { attributes } = useWidgetContext(type);
@@ -8065,14 +8035,14 @@ const ElementMarkdown = memo(({ elementConfig, type }) => {
8065
8035
  if (!shouldShowExpand) {
8066
8036
  return (jsx(MarkdownWrapper, { children: jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }) }));
8067
8037
  }
8068
- // Truncated content for collapsed state
8069
- const truncatedContent = markdownString.substring(0, expandLength);
8070
8038
  // Collapsed state
8071
8039
  if (!expanded) {
8072
- return (jsxs(MarkdownWrapper, { children: [jsx(ExpandButton, { primary: true, icon: jsx(Expander, { isSelected: false }), onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) }), jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent })] }));
8040
+ // Truncated content for collapsed state
8041
+ const truncatedContent = markdownString.substring(0, expandLength);
8042
+ return (jsxs(MarkdownWrapper, { children: [jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent }), jsx(LegendToggler, { onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
8073
8043
  }
8074
8044
  // Expanded state
8075
- return (jsxs(MarkdownWrapper, { children: [jsx(ExpandButton, { primary: true, icon: jsx(Expander, { isSelected: true }), onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) }), jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString })] }));
8045
+ return (jsxs(MarkdownWrapper, { children: [jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }), jsx(LegendToggler, { toggled: true, onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) })] }));
8076
8046
  });
8077
8047
 
8078
8048
  const SmallPreviewContainer = styled.div `