revdev-components 0.73.0 → 0.76.0
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/build/headerActionPanel/index.d.ts +7 -2
- package/build/index.js +35 -11
- package/build/navigator/index.d.ts +6 -1
- package/build/styles.css +14 -1
- package/package.json +1 -1
|
@@ -3,13 +3,18 @@ import { RegularIconName } from "src/icon/regular";
|
|
|
3
3
|
interface BaseHeaderActionProps {
|
|
4
4
|
icon: RegularIconName;
|
|
5
5
|
label?: string;
|
|
6
|
-
onClick: () => void;
|
|
7
6
|
tooltip?: string;
|
|
8
7
|
}
|
|
8
|
+
interface ClickHeaderActionProps extends BaseHeaderActionProps {
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
interface LinkHeaderActionProps extends BaseHeaderActionProps {
|
|
12
|
+
href: string;
|
|
13
|
+
}
|
|
9
14
|
interface ContentHeaderActionProps {
|
|
10
15
|
content: React.ReactNode;
|
|
11
16
|
}
|
|
12
|
-
export type HeaderActionProps =
|
|
17
|
+
export type HeaderActionProps = ClickHeaderActionProps | LinkHeaderActionProps | ContentHeaderActionProps;
|
|
13
18
|
export interface HeaderActionPanelProps {
|
|
14
19
|
className?: string;
|
|
15
20
|
actions?: HeaderActionProps[];
|
package/build/index.js
CHANGED
|
@@ -5201,18 +5201,25 @@ var FrontLayout = function (_a) {
|
|
|
5201
5201
|
React.createElement(FrontFooter, __assign({}, footer)))));
|
|
5202
5202
|
};
|
|
5203
5203
|
|
|
5204
|
-
var s$3 = {"root":"index-module_root__OWeNb"};
|
|
5204
|
+
var s$3 = {"root":"index-module_root__OWeNb","link":"index-module_link__H8HcA","button":"index-module_button__UVt6a"};
|
|
5205
5205
|
|
|
5206
5206
|
var HeaderActionPanel = function (_a) {
|
|
5207
5207
|
var className = _a.className, actions = _a.actions;
|
|
5208
5208
|
return (actions === null || actions === void 0 ? void 0 : actions.length) ? (React.createElement("div", { className: classNames(s$3.root, className) }, actions.map(function (action, i) {
|
|
5209
|
-
var content = action
|
|
5210
|
-
|
|
5211
|
-
|
|
5209
|
+
var content = action;
|
|
5210
|
+
var button = action;
|
|
5211
|
+
var link = action;
|
|
5212
|
+
if (content === null || content === void 0 ? void 0 : content.content) {
|
|
5213
|
+
return React.createElement(React.Fragment, { key: i }, content === null || content === void 0 ? void 0 : content.content);
|
|
5212
5214
|
}
|
|
5213
|
-
else {
|
|
5214
|
-
var
|
|
5215
|
-
return (React.createElement(IconDivision, { key: i, icon: icon, onClick: onClick, tooltip: tooltip }, label));
|
|
5215
|
+
else if (!!(button === null || button === void 0 ? void 0 : button.onClick)) {
|
|
5216
|
+
var icon = button.icon, label = button.label, tooltip = button.tooltip;
|
|
5217
|
+
return (React.createElement(IconDivision, { key: i, icon: icon, onClick: button === null || button === void 0 ? void 0 : button.onClick, tooltip: tooltip, className: s$3.button }, label));
|
|
5218
|
+
}
|
|
5219
|
+
else if (!!(link === null || link === void 0 ? void 0 : link.href)) {
|
|
5220
|
+
var icon = button.icon, label = button.label, tooltip = button.tooltip;
|
|
5221
|
+
return (React.createElement(AppLink, { key: i, href: link.href, className: s$3.link },
|
|
5222
|
+
React.createElement(IconDivision, { icon: icon, tooltip: tooltip }, label)));
|
|
5216
5223
|
}
|
|
5217
5224
|
}))) : null;
|
|
5218
5225
|
};
|
|
@@ -5220,11 +5227,28 @@ var HeaderActionPanel = function (_a) {
|
|
|
5220
5227
|
var s$2 = {"root":"index-module_root__t3gxi"};
|
|
5221
5228
|
|
|
5222
5229
|
var AlfaNavigator = function (_a) {
|
|
5223
|
-
var className = _a.className, stepClassName = _a.stepClassName, rootOption = _a.rootOption,
|
|
5230
|
+
var className = _a.className, stepClassName = _a.stepClassName, rootOption = _a.rootOption, _b = _a.options, options = _b === void 0 ? [] : _b, isMobile = _a.isMobile, mapper = _a.mapper, path = _a.path;
|
|
5224
5231
|
var innerOptions = React.useMemo(function () {
|
|
5225
|
-
var
|
|
5226
|
-
|
|
5227
|
-
|
|
5232
|
+
var result = [];
|
|
5233
|
+
if (mapper && Array.isArray(path)) {
|
|
5234
|
+
result = path
|
|
5235
|
+
.map(function (p) {
|
|
5236
|
+
var _a = Array.isArray(p) ? p : [p, undefined], key = _a[0], param = _a[1];
|
|
5237
|
+
var o = mapper[key];
|
|
5238
|
+
if (o) {
|
|
5239
|
+
return typeof o === "function" ? o((param === null || param === void 0 ? void 0 : param.toString()) || "") : o;
|
|
5240
|
+
}
|
|
5241
|
+
return undefined;
|
|
5242
|
+
})
|
|
5243
|
+
.filter(function (x) { return x; });
|
|
5244
|
+
}
|
|
5245
|
+
else {
|
|
5246
|
+
result = options;
|
|
5247
|
+
}
|
|
5248
|
+
result = rootOption ? __spreadArray([rootOption], result, true) : result;
|
|
5249
|
+
result = isMobile ? result.slice(options.length - 1) : result;
|
|
5250
|
+
return result;
|
|
5251
|
+
}, [rootOption, options, isMobile, mapper, path]);
|
|
5228
5252
|
return innerOptions.length ? (React.createElement("div", { className: classNames(s$2.root, className) }, innerOptions.map(function (_a, index) {
|
|
5229
5253
|
var href = _a.href, label = _a.label;
|
|
5230
5254
|
return (React.createElement(React.Fragment, { key: index },
|
|
@@ -3,12 +3,17 @@ export interface AlfaNavigatorOption {
|
|
|
3
3
|
href: string;
|
|
4
4
|
label: string;
|
|
5
5
|
}
|
|
6
|
+
export type AlfaNavigatorMapper = Record<string, AlfaNavigatorOption | ((param: string) => AlfaNavigatorOption)>;
|
|
7
|
+
export type AlfaNavigatorPathPart<TKey extends string = string> = TKey | [TKey, string | number];
|
|
8
|
+
export type AlfaNavigatorPart<TKey extends string = string> = AlfaNavigatorPathPart<TKey>[];
|
|
6
9
|
interface Props {
|
|
7
10
|
rootOption?: AlfaNavigatorOption;
|
|
8
|
-
options
|
|
11
|
+
options?: AlfaNavigatorOption[];
|
|
9
12
|
className?: string;
|
|
10
13
|
stepClassName?: string;
|
|
11
14
|
isMobile?: boolean;
|
|
15
|
+
mapper?: AlfaNavigatorMapper;
|
|
16
|
+
path?: AlfaNavigatorPart;
|
|
12
17
|
}
|
|
13
18
|
export declare const AlfaNavigator: React.FC<Props>;
|
|
14
19
|
export {};
|
package/build/styles.css
CHANGED
|
@@ -526,7 +526,6 @@ body {
|
|
|
526
526
|
display: flex;
|
|
527
527
|
flex-direction: row;
|
|
528
528
|
align-items: center;
|
|
529
|
-
color: var(--passiveColor);
|
|
530
529
|
gap: 8px;
|
|
531
530
|
}
|
|
532
531
|
@media all and (max-width: 700px) {
|
|
@@ -534,6 +533,20 @@ body {
|
|
|
534
533
|
margin: 0;
|
|
535
534
|
}
|
|
536
535
|
}
|
|
536
|
+
|
|
537
|
+
.index-module_link__H8HcA {
|
|
538
|
+
color: var(--passiveColor) !important;
|
|
539
|
+
}
|
|
540
|
+
.index-module_link__H8HcA:hover {
|
|
541
|
+
color: var(--color) !important;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.index-module_button__UVt6a {
|
|
545
|
+
color: var(--passiveColor);
|
|
546
|
+
}
|
|
547
|
+
.index-module_button__UVt6a:hover {
|
|
548
|
+
color: var(--color);
|
|
549
|
+
}
|
|
537
550
|
.index-module_root__t3gxi {
|
|
538
551
|
--linkColor: var(--passiveColor);
|
|
539
552
|
display: flex;
|