@evergis/react 4.0.86 → 4.0.88

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/index.js CHANGED
@@ -7624,13 +7624,14 @@ const RoundedBackgroundContainerWrapper = styled(uilibGl.Flex) `
7624
7624
  const ALIAS_DEFAULT_MAX_LENGTH = 28;
7625
7625
  const RoundedBackgroundContainer = React.memo(({ type, elementConfig, feature, renderElement, }) => {
7626
7626
  const { t } = useGlobalContext();
7627
- const { dataSources } = useWidgetContext(type);
7628
- const { attributes } = useRelatedDataSourceAttributes({
7627
+ const { dataSources, attributes: ctxAttributes } = useWidgetContext(type);
7628
+ const { attributes: dsAttributes } = useRelatedDataSourceAttributes({
7629
7629
  type,
7630
7630
  elementConfig,
7631
7631
  dataSources,
7632
7632
  feature,
7633
7633
  });
7634
+ const attributes = lodash.isEmpty(dsAttributes) ? ctxAttributes : dsAttributes;
7634
7635
  const { id, options, style, children } = elementConfig || {};
7635
7636
  const { maxLength, wordBreak, center, fontColor, innerTemplateStyle, inlineUnits, big, bigIcon, hideEmpty, colorAttribute } = options || {};
7636
7637
  const iconElement = children?.find(item => item.id === "icon");
@@ -9170,11 +9171,12 @@ const HeaderLayerIcon = ({ noFeature }) => {
9170
9171
  };
9171
9172
 
9172
9173
  const FeatureCardDefaultHeader = ({ noFeature }) => {
9174
+ const { themeName: pageThemeName } = useGlobalContext();
9173
9175
  const { config } = useWidgetConfig(exports.WidgetType.FeatureCard);
9174
9176
  const { header } = config || {};
9175
9177
  const { options } = header || {};
9176
9178
  const { themeName, withPadding, column, height, overlay } = options || {};
9177
- return (jsxRuntime.jsx(DefaultHeaderWrapper, { withPadding: withPadding, height: height, "$noFeature": noFeature, children: jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName), children: jsxRuntime.jsx(Header, { "$overlay": overlay, "$isRow": !column, "$noFeature": noFeature, children: jsxRuntime.jsxs(HeaderFrontView, { isDefault: !column, children: [jsxRuntime.jsxs(HeaderContainer, { children: [jsxRuntime.jsx(HeaderLayerIcon, { noFeature: noFeature }), jsxRuntime.jsx(HeaderTitle, { noFeature: noFeature })] }), jsxRuntime.jsx(FeatureCardButtons, {})] }) }) }) }));
9179
+ return (jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName ?? pageThemeName), children: jsxRuntime.jsx(DefaultHeaderWrapper, { withPadding: withPadding, height: height, "$noFeature": noFeature, children: jsxRuntime.jsx(Header, { "$overlay": overlay, "$isRow": !column, "$noFeature": noFeature, children: jsxRuntime.jsxs(HeaderFrontView, { isDefault: !column, children: [jsxRuntime.jsxs(HeaderContainer, { children: [jsxRuntime.jsx(HeaderLayerIcon, { noFeature: noFeature }), jsxRuntime.jsx(HeaderTitle, { noFeature: noFeature })] }), jsxRuntime.jsx(FeatureCardButtons, {})] }) }) }) }));
9178
9180
  };
9179
9181
 
9180
9182
  const ImageContainerButton = styled(uilibGl.FlatButton) `
@@ -10195,7 +10197,7 @@ const BackgroundHeaderWrapper = styled.div `
10195
10197
  content: "";
10196
10198
  position: absolute;
10197
10199
  inset: 0;
10198
- z-index: 0;
10200
+ z-index: 100;
10199
10201
  pointer-events: none;
10200
10202
  background: ${({ $bgColor }) => $bgColor || "linear-gradient(96.55deg, #FFFCD3 0%, #B4DC47 100%)"};
10201
10203
  }
@@ -10217,7 +10219,7 @@ const FeatureCardBackgroundHeader = () => {
10217
10219
  const { options } = header || {};
10218
10220
  const { fontColor, bgColor, height, overlay, bigIcon, withPadding, bottomBlur, themeName, column } = options || {};
10219
10221
  const renderElement = useHeaderRender(header);
10220
- return (jsxRuntime.jsx(BackgroundHeaderWrapper, { "$fontColor": fontColor, "$bgColor": bgColor, "$height": height, "$bigIcon": bigIcon, "$withPadding": withPadding, "$bottomBlur": bottomBlur, children: jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName ?? pageThemeName), children: jsxRuntime.jsxs(Header, { "$overlay": overlay, "$isRow": !column, children: [jsxRuntime.jsxs(HeaderFrontView, { children: [jsxRuntime.jsxs(HeaderContainer, { column: column, children: [jsxRuntime.jsx(HeaderLayerIcon, {}), jsxRuntime.jsx(FeatureCardTitle, { title: renderElement({
10222
+ return (jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName ?? pageThemeName), children: jsxRuntime.jsx(BackgroundHeaderWrapper, { "$fontColor": fontColor, "$bgColor": bgColor, "$height": height, "$bigIcon": bigIcon, "$withPadding": withPadding, "$bottomBlur": bottomBlur, children: jsxRuntime.jsxs(Header, { "$overlay": overlay, "$isRow": !column, children: [jsxRuntime.jsxs(HeaderFrontView, { children: [jsxRuntime.jsxs(HeaderContainer, { column: column, children: [jsxRuntime.jsx(HeaderLayerIcon, {}), jsxRuntime.jsx(FeatureCardTitle, { title: renderElement({
10221
10223
  id: "title",
10222
10224
  wrap: false,
10223
10225
  }), description: renderElement({
@@ -10238,7 +10240,7 @@ const FeatureCardSlideshowHeader = () => {
10238
10240
  const { options } = header || {};
10239
10241
  const { height, fontColor, withPadding, themeName, column, overlay } = options || {};
10240
10242
  const renderElement = useHeaderRender(header);
10241
- return (jsxRuntime.jsx(SlideshowHeaderWrapper, { fontColor: fontColor, withPadding: withPadding, height: height, big: true, children: jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName), children: jsxRuntime.jsxs(Header, { "$overlay": overlay, "$isRow": !column, children: [jsxRuntime.jsxs(HeaderFrontView, { children: [jsxRuntime.jsxs(HeaderContainer, { column: column, children: [jsxRuntime.jsx(HeaderLayerIcon, {}), jsxRuntime.jsx(FeatureCardTitle, { title: renderElement({
10243
+ return (jsxRuntime.jsx(uilibGl.ThemeProvider, { theme: getThemeByName(themeName), children: jsxRuntime.jsx(SlideshowHeaderWrapper, { fontColor: fontColor, withPadding: withPadding, height: height, big: true, children: jsxRuntime.jsxs(Header, { "$overlay": overlay, "$isRow": !column, children: [jsxRuntime.jsxs(HeaderFrontView, { children: [jsxRuntime.jsxs(HeaderContainer, { column: column, children: [jsxRuntime.jsx(HeaderLayerIcon, {}), jsxRuntime.jsx(FeatureCardTitle, { title: renderElement({
10242
10244
  id: "title",
10243
10245
  wrap: false,
10244
10246
  }), description: renderElement({
@@ -12853,7 +12855,18 @@ const useDataSources = ({ type: widgetType, config, attributes, filters, layerPa
12853
12855
  if (!diffFilterNames.length)
12854
12856
  return;
12855
12857
  const filteredDataSources = configDataSources?.filter(({ parameters = {}, query }) => lodash.isNil(query) ||
12856
- diffFilterNames.some(diffFilterName => Object.keys(parameters).some(paramName => parameters[paramName] === `${FILTER_PREFIX}${diffFilterName}`)));
12858
+ diffFilterNames.some(diffFilterName => {
12859
+ // Плейсхолдер параметра может ссылаться на фильтр целиком (`%name`)
12860
+ // либо на его свойство — уровень tree-фильтра или границу range
12861
+ // (`%name.lN`, `%name.min`, `%name.max`). Граница `.` обязательна,
12862
+ // иначе `%name` ложно матчит `%name2.l1`.
12863
+ const placeholder = `${FILTER_PREFIX}${diffFilterName}`;
12864
+ return Object.keys(parameters).some(paramName => {
12865
+ const paramValue = parameters[paramName];
12866
+ return (typeof paramValue === "string" &&
12867
+ (paramValue === placeholder || paramValue.startsWith(`${placeholder}.`)));
12868
+ });
12869
+ }));
12857
12870
  if (!filteredDataSources?.length) {
12858
12871
  return;
12859
12872
  }