fui-material 2.7.6 → 2.7.7
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/f-ui-kit.es.js +93 -42
- package/dist/f-ui-kit.es.js.map +1 -1
- package/dist/f-ui-kit.umd.js +2 -2
- package/dist/f-ui-kit.umd.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/types/material/MenuLinks/FMenuBlockLinks/FMenuBlockLinks.d.ts +4 -0
- package/dist/types/material/MenuLinks/FMenuLinks/FMenuLinks.d.ts +29 -18
- package/package.json +1 -1
package/dist/f-ui-kit.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useLayoutEffect, Fragment as Fragment$1, isValidElement, cloneElement, useDeferredValue, createContext, useContext } from "react";
|
|
2
|
+
import React, { forwardRef, useRef, useState, useEffect, useMemo, useCallback, useLayoutEffect, Fragment as Fragment$1, isValidElement, cloneElement, Children, useDeferredValue, createContext, useContext } from "react";
|
|
3
3
|
import ReactDOM, { createPortal } from "react-dom";
|
|
4
4
|
import JSZip from "jszip";
|
|
5
5
|
import initializeModule from "allorion-exporting-html-to-docx";
|
|
@@ -1620,12 +1620,12 @@ const FOpenImgFull = ({
|
|
|
1620
1620
|
}
|
|
1621
1621
|
);
|
|
1622
1622
|
};
|
|
1623
|
-
const card$
|
|
1623
|
+
const card$2 = "_card_1pttw_1";
|
|
1624
1624
|
const warning$3 = "_warning_1pttw_16";
|
|
1625
1625
|
const info$1 = "_info_1pttw_24";
|
|
1626
1626
|
const alert = "_alert_1pttw_32";
|
|
1627
1627
|
const styles$j = {
|
|
1628
|
-
card: card$
|
|
1628
|
+
card: card$2,
|
|
1629
1629
|
warning: warning$3,
|
|
1630
1630
|
info: info$1,
|
|
1631
1631
|
alert,
|
|
@@ -3088,13 +3088,13 @@ const FSkeleton = ({ children, enable, width, height }) => {
|
|
|
3088
3088
|
}, [enable]);
|
|
3089
3089
|
return /* @__PURE__ */ jsx("div", { ref: elementRef, className: styles$a["skeleton-block"], children });
|
|
3090
3090
|
};
|
|
3091
|
-
const active = "
|
|
3091
|
+
const active = "_active_lv3xi_122";
|
|
3092
3092
|
const styles$9 = {
|
|
3093
|
-
"wave-nav-wrapper": "_wave-nav-
|
|
3094
|
-
"wave-nav-grid-item": "_wave-nav-grid-
|
|
3095
|
-
"wave-nav-bar": "_wave-nav-
|
|
3096
|
-
"wave-nav-list": "_wave-nav-
|
|
3097
|
-
"wave-nav-item": "_wave-nav-
|
|
3093
|
+
"wave-nav-wrapper": "_wave-nav-wrapper_lv3xi_5",
|
|
3094
|
+
"wave-nav-grid-item": "_wave-nav-grid-item_lv3xi_17",
|
|
3095
|
+
"wave-nav-bar": "_wave-nav-bar_lv3xi_27",
|
|
3096
|
+
"wave-nav-list": "_wave-nav-list_lv3xi_48",
|
|
3097
|
+
"wave-nav-item": "_wave-nav-item_lv3xi_75",
|
|
3098
3098
|
active
|
|
3099
3099
|
};
|
|
3100
3100
|
const FNavigateBar = ({
|
|
@@ -3125,12 +3125,26 @@ const FNavigateBarItem = ({
|
|
|
3125
3125
|
}
|
|
3126
3126
|
);
|
|
3127
3127
|
};
|
|
3128
|
-
const
|
|
3128
|
+
const reportsPageContainer = "_reportsPageContainer_9rgyr_3";
|
|
3129
|
+
const searchBar = "_searchBar_9rgyr_11";
|
|
3130
|
+
const reportsGrid = "_reportsGrid_9rgyr_45";
|
|
3131
|
+
const card$1 = "_card_9rgyr_53";
|
|
3132
|
+
const cardHeader = "_cardHeader_9rgyr_70";
|
|
3133
|
+
const countBadge = "_countBadge_9rgyr_87";
|
|
3134
|
+
const linksList = "_linksList_9rgyr_97";
|
|
3135
|
+
const linkItem = "_linkItem_9rgyr_104";
|
|
3136
|
+
const badge = "_badge_9rgyr_145";
|
|
3137
|
+
const disabled = "_disabled_9rgyr_170";
|
|
3129
3138
|
const styles$8 = {
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3139
|
+
reportsPageContainer,
|
|
3140
|
+
searchBar,
|
|
3141
|
+
reportsGrid,
|
|
3142
|
+
card: card$1,
|
|
3143
|
+
cardHeader,
|
|
3144
|
+
countBadge,
|
|
3145
|
+
linksList,
|
|
3146
|
+
linkItem,
|
|
3147
|
+
badge,
|
|
3134
3148
|
disabled
|
|
3135
3149
|
};
|
|
3136
3150
|
const FMenuBlockLinks = ({
|
|
@@ -3138,18 +3152,37 @@ const FMenuBlockLinks = ({
|
|
|
3138
3152
|
className,
|
|
3139
3153
|
st,
|
|
3140
3154
|
id,
|
|
3141
|
-
columns
|
|
3155
|
+
columns,
|
|
3156
|
+
withSearch = false
|
|
3142
3157
|
}) => {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
{
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
children
|
|
3158
|
+
const [searchValue, setSearchValue] = useState("");
|
|
3159
|
+
const gridStyle = columns ? { gridTemplateColumns: `repeat(${columns}, 1fr)`, ...st } : st;
|
|
3160
|
+
const enhancedChildren = Children.map(children, (child) => {
|
|
3161
|
+
if (isValidElement(child)) {
|
|
3162
|
+
return cloneElement(child, {
|
|
3163
|
+
searchTerm: searchValue
|
|
3164
|
+
});
|
|
3151
3165
|
}
|
|
3152
|
-
|
|
3166
|
+
return child;
|
|
3167
|
+
});
|
|
3168
|
+
return /* @__PURE__ */ jsxs("div", { className: `${styles$8.reportsPageContainer} ${className ?? ""}`.trim(), id, children: [
|
|
3169
|
+
withSearch && /* @__PURE__ */ jsx("div", { className: styles$8.searchBar, children: /* @__PURE__ */ jsx(
|
|
3170
|
+
"input",
|
|
3171
|
+
{
|
|
3172
|
+
type: "text",
|
|
3173
|
+
placeholder: "Быстрый поиск",
|
|
3174
|
+
value: searchValue,
|
|
3175
|
+
onChange: (e) => setSearchValue(e.target.value)
|
|
3176
|
+
}
|
|
3177
|
+
) }),
|
|
3178
|
+
/* @__PURE__ */ jsx("div", { className: styles$8.reportsGrid, style: gridStyle, children: enhancedChildren })
|
|
3179
|
+
] });
|
|
3180
|
+
};
|
|
3181
|
+
const getElementText = (node) => {
|
|
3182
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3183
|
+
if (Array.isArray(node)) return node.map(getElementText).join("");
|
|
3184
|
+
if (React.isValidElement(node) && node.props) return getElementText(node.props.children);
|
|
3185
|
+
return "";
|
|
3153
3186
|
};
|
|
3154
3187
|
const FMenuLinks = ({
|
|
3155
3188
|
children,
|
|
@@ -3157,33 +3190,51 @@ const FMenuLinks = ({
|
|
|
3157
3190
|
st,
|
|
3158
3191
|
id,
|
|
3159
3192
|
disabled: disabled2 = [],
|
|
3160
|
-
|
|
3193
|
+
badges = [],
|
|
3194
|
+
title: title2,
|
|
3195
|
+
searchTerm = ""
|
|
3161
3196
|
}) => {
|
|
3162
|
-
const
|
|
3197
|
+
const originalArray = React.Children.toArray(children);
|
|
3198
|
+
const filteredChildren = originalArray.filter((child) => {
|
|
3199
|
+
if (!searchTerm) return true;
|
|
3200
|
+
const text = getElementText(child).toLowerCase();
|
|
3201
|
+
const originalIndex = originalArray.indexOf(child);
|
|
3202
|
+
const badge2 = badges[originalIndex] || (React.isValidElement(child) ? child.props["data-badge"] : "");
|
|
3203
|
+
const searchString = badge2 ? `${badge2} ${text}`.toLowerCase() : text;
|
|
3204
|
+
return searchString.includes(searchTerm.toLowerCase());
|
|
3205
|
+
});
|
|
3206
|
+
if (filteredChildren.length === 0) return null;
|
|
3207
|
+
const enhancedChildren = filteredChildren.map((child) => {
|
|
3163
3208
|
if (!React.isValidElement(child)) return child;
|
|
3164
|
-
const
|
|
3209
|
+
const originalIndex = originalArray.indexOf(child);
|
|
3210
|
+
const isDisabled = disabled2.includes(originalIndex);
|
|
3211
|
+
const badgeText = badges[originalIndex] || child.props["data-badge"];
|
|
3165
3212
|
const childClass = [
|
|
3166
3213
|
child.props.className,
|
|
3167
|
-
styles$8.
|
|
3168
|
-
isDisabled
|
|
3214
|
+
styles$8.linkItem,
|
|
3215
|
+
isDisabled ? styles$8.disabled : ""
|
|
3169
3216
|
].filter(Boolean).join(" ");
|
|
3217
|
+
const innerContent = badgeText ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3218
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.badge, children: badgeText }),
|
|
3219
|
+
child.props.children
|
|
3220
|
+
] }) : child.props.children;
|
|
3170
3221
|
return React.cloneElement(child, {
|
|
3171
3222
|
className: childClass,
|
|
3172
|
-
|
|
3223
|
+
children: innerContent,
|
|
3224
|
+
...isDisabled && {
|
|
3225
|
+
onClick: (e) => e.preventDefault(),
|
|
3226
|
+
tabIndex: -1,
|
|
3227
|
+
"aria-disabled": true
|
|
3228
|
+
}
|
|
3173
3229
|
});
|
|
3174
3230
|
});
|
|
3175
|
-
return /* @__PURE__ */ jsxs(
|
|
3176
|
-
"div",
|
|
3177
|
-
|
|
3178
|
-
className:
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
title2 && /* @__PURE__ */ jsx("div", { className: styles$8["sections-routes_card__title"], children: title2 }),
|
|
3183
|
-
/* @__PURE__ */ jsx("div", { className: styles$8["sections-routes_card__links"], children: enhancedChildren })
|
|
3184
|
-
]
|
|
3185
|
-
}
|
|
3186
|
-
);
|
|
3231
|
+
return /* @__PURE__ */ jsxs("div", { className: `${styles$8.card} ${className ?? ""}`.trim(), style: st, id, children: [
|
|
3232
|
+
title2 && /* @__PURE__ */ jsxs("div", { className: styles$8.cardHeader, children: [
|
|
3233
|
+
/* @__PURE__ */ jsx("h3", { children: title2 }),
|
|
3234
|
+
/* @__PURE__ */ jsx("span", { className: styles$8.countBadge, children: filteredChildren.length })
|
|
3235
|
+
] }),
|
|
3236
|
+
/* @__PURE__ */ jsx("div", { className: styles$8.linksList, children: enhancedChildren })
|
|
3237
|
+
] });
|
|
3187
3238
|
};
|
|
3188
3239
|
const styles$7 = {
|
|
3189
3240
|
"f-tooltip": "_f-tooltip_xpnbo_1",
|