@evergis/react 3.1.76 → 3.1.78

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 }) => {
@@ -7749,10 +7750,11 @@ const ElementChart = memo(({ type, elementConfig, renderElement }) => {
7749
7750
  const ElementChips = memo(({ type, elementConfig }) => {
7750
7751
  const { attributes } = useWidgetContext(type);
7751
7752
  const { attributeName, options, style } = elementConfig || {};
7752
- const { separator, bgColor, fontColor, fontSize } = options || {};
7753
- const attribute = getAttributeByName(attributeName, attributes);
7754
- const tags = attribute?.value?.split(separator || ",");
7755
- return (jsx(DashboardChipsContainer, { style: style, children: tags?.map(tag => (jsx(DashboardChip$1, { text: tag, "$bgColor": bgColor, "$fontColor": fontColor, "$fontSize": fontSize, "$isDefault": true }, tag))) }));
7753
+ const { separator, bgColor, fontColor, fontSize, colorAttribute } = options || {};
7754
+ const valueAttr = getAttributeByName(attributeName, attributes);
7755
+ const colorAttr = getAttributeByName(colorAttribute, attributes);
7756
+ const tags = valueAttr?.value?.split(separator || ",");
7757
+ return (jsx(DashboardChipsContainer, { style: style, children: tags?.map(tag => (jsx(DashboardChip$1, { text: tag, "$bgColor": colorAttr?.value || bgColor, "$fontColor": fontColor, "$fontSize": fontSize, "$isDefault": !colorAttr?.value }, tag))) }));
7756
7758
  });
7757
7759
 
7758
7760
  const StyledIconFontSizeMixin = css `
@@ -8011,37 +8013,6 @@ const MarkdownWrapper = styled.div `
8011
8013
  display: none;
8012
8014
  }
8013
8015
  `;
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
8016
 
8046
8017
  const ElementMarkdown = memo(({ elementConfig, type }) => {
8047
8018
  const { attributes } = useWidgetContext(type);
@@ -8065,14 +8036,14 @@ const ElementMarkdown = memo(({ elementConfig, type }) => {
8065
8036
  if (!shouldShowExpand) {
8066
8037
  return (jsx(MarkdownWrapper, { children: jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }) }));
8067
8038
  }
8068
- // Truncated content for collapsed state
8069
- const truncatedContent = markdownString.substring(0, expandLength);
8070
8039
  // Collapsed state
8071
8040
  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 })] }));
8041
+ // Truncated content for collapsed state
8042
+ const truncatedContent = markdownString.substring(0, expandLength);
8043
+ return (jsxs(MarkdownWrapper, { children: [jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent }), jsx(LegendToggler, { onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
8073
8044
  }
8074
8045
  // 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 })] }));
8046
+ return (jsxs(MarkdownWrapper, { children: [jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }), jsx(LegendToggler, { toggled: true, onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) })] }));
8076
8047
  });
8077
8048
 
8078
8049
  const SmallPreviewContainer = styled.div `