@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.
|
@@ -1,5 +1 @@
|
|
|
1
1
|
export declare const MarkdownWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
-
export declare const SocialIconsWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
3
|
-
export declare const SocialIconLabel: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
4
|
-
export declare const SocialIcon: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
5
|
-
export declare const ExpandButton: import('styled-components').StyledComponent<import('react').FC<import('@evergis/uilib-gl').IIconButtonProps>, any, {}, never>;
|
package/dist/index.js
CHANGED
|
@@ -5163,7 +5163,8 @@ const Container = styled(uilibGl.Flex) `
|
|
|
5163
5163
|
|
|
5164
5164
|
${({ isColumn }) => isColumn
|
|
5165
5165
|
? styled.css `
|
|
5166
|
-
> * {
|
|
5166
|
+
&&& > * {
|
|
5167
|
+
justify-content: flex-start;
|
|
5167
5168
|
width: 100%;
|
|
5168
5169
|
|
|
5169
5170
|
:not(:last-child) {
|
|
@@ -5681,7 +5682,7 @@ const OneColumnContainer = React.memo(({ elementConfig, renderElement }) => {
|
|
|
5681
5682
|
const hasUnits = elementConfig?.children?.some(({ id }) => id === "units");
|
|
5682
5683
|
if (!value && hideEmpty)
|
|
5683
5684
|
return null;
|
|
5684
|
-
return (jsxRuntime.jsxs(Container, { id: id, style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5685
|
+
return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: innerTemplateStyle || style, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && jsxRuntime.jsx(ContainerUnits, { children: renderElement({ id: "units" }) })] })] }));
|
|
5685
5686
|
});
|
|
5686
5687
|
|
|
5687
5688
|
const TwoColumnContainer = React.memo(({ config, elementConfig, type, renderElement }) => {
|
|
@@ -7751,10 +7752,11 @@ const ElementChart = React.memo(({ type, elementConfig, renderElement }) => {
|
|
|
7751
7752
|
const ElementChips = React.memo(({ type, elementConfig }) => {
|
|
7752
7753
|
const { attributes } = useWidgetContext(type);
|
|
7753
7754
|
const { attributeName, options, style } = elementConfig || {};
|
|
7754
|
-
const { separator, bgColor, fontColor, fontSize } = options || {};
|
|
7755
|
-
const
|
|
7756
|
-
const
|
|
7757
|
-
|
|
7755
|
+
const { separator, bgColor, fontColor, fontSize, colorAttribute } = options || {};
|
|
7756
|
+
const valueAttr = getAttributeByName(attributeName, attributes);
|
|
7757
|
+
const colorAttr = getAttributeByName(colorAttribute, attributes);
|
|
7758
|
+
const tags = valueAttr?.value?.split(separator || ",");
|
|
7759
|
+
return (jsxRuntime.jsx(DashboardChipsContainer, { style: style, children: tags?.map(tag => (jsxRuntime.jsx(DashboardChip$1, { text: tag, "$bgColor": colorAttr?.value || bgColor, "$fontColor": fontColor, "$fontSize": fontSize, "$isDefault": !colorAttr?.value }, tag))) }));
|
|
7758
7760
|
});
|
|
7759
7761
|
|
|
7760
7762
|
const StyledIconFontSizeMixin = styled.css `
|
|
@@ -8013,37 +8015,6 @@ const MarkdownWrapper = styled.div `
|
|
|
8013
8015
|
display: none;
|
|
8014
8016
|
}
|
|
8015
8017
|
`;
|
|
8016
|
-
styled(uilibGl.Flex) `
|
|
8017
|
-
align-items: center;
|
|
8018
|
-
gap: 1rem;
|
|
8019
|
-
margin-top: 1rem;
|
|
8020
|
-
`;
|
|
8021
|
-
styled.span `
|
|
8022
|
-
display: block;
|
|
8023
|
-
font-size: 0.75rem;
|
|
8024
|
-
line-height: 0.875rem;
|
|
8025
|
-
opacity: 0.36;
|
|
8026
|
-
margin: 0 0 0.5rem 0;
|
|
8027
|
-
`;
|
|
8028
|
-
styled.div `
|
|
8029
|
-
width: 1.25rem;
|
|
8030
|
-
height: 1.25rem;
|
|
8031
|
-
cursor: pointer;
|
|
8032
|
-
transition: opacity 0.2s;
|
|
8033
|
-
|
|
8034
|
-
&:hover {
|
|
8035
|
-
opacity: 0.7;
|
|
8036
|
-
}
|
|
8037
|
-
|
|
8038
|
-
img, svg {
|
|
8039
|
-
width: 100%;
|
|
8040
|
-
height: 100%;
|
|
8041
|
-
display: block;
|
|
8042
|
-
}
|
|
8043
|
-
`;
|
|
8044
|
-
const ExpandButton = styled(uilibGl.IconButton) `
|
|
8045
|
-
margin-bottom: 1rem;
|
|
8046
|
-
`;
|
|
8047
8018
|
|
|
8048
8019
|
const ElementMarkdown = React.memo(({ elementConfig, type }) => {
|
|
8049
8020
|
const { attributes } = useWidgetContext(type);
|
|
@@ -8067,14 +8038,14 @@ const ElementMarkdown = React.memo(({ elementConfig, type }) => {
|
|
|
8067
8038
|
if (!shouldShowExpand) {
|
|
8068
8039
|
return (jsxRuntime.jsx(MarkdownWrapper, { children: jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }) }));
|
|
8069
8040
|
}
|
|
8070
|
-
// Truncated content for collapsed state
|
|
8071
|
-
const truncatedContent = markdownString.substring(0, expandLength);
|
|
8072
8041
|
// Collapsed state
|
|
8073
8042
|
if (!expanded) {
|
|
8074
|
-
|
|
8043
|
+
// Truncated content for collapsed state
|
|
8044
|
+
const truncatedContent = markdownString.substring(0, expandLength);
|
|
8045
|
+
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: truncatedContent }), jsxRuntime.jsx(uilibGl.LegendToggler, { onClick: () => setExpanded(true), children: t("more", { ns: "dashboard", defaultValue: "Подробнее" }) })] }));
|
|
8075
8046
|
}
|
|
8076
8047
|
// Expanded state
|
|
8077
|
-
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(
|
|
8048
|
+
return (jsxRuntime.jsxs(MarkdownWrapper, { children: [jsxRuntime.jsx(ReactMarkdown, { remarkPlugins: [remarkGfm], children: markdownString }), jsxRuntime.jsx(uilibGl.LegendToggler, { toggled: true, onClick: () => setExpanded(false), children: t("hide", { ns: "dashboard", defaultValue: "Свернуть" }) })] }));
|
|
8078
8049
|
});
|
|
8079
8050
|
|
|
8080
8051
|
const SmallPreviewContainer = styled.div `
|