revdev-components 0.8.0 → 0.10.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/back-layout/index.d.ts +17 -0
- package/build/back-sidebar/hooks.d.ts +2 -0
- package/build/back-sidebar/index.d.ts +11 -0
- package/build/back-sidebar/interfaces.d.ts +12 -0
- package/build/back-sidebar/menu-item/index.d.ts +8 -0
- package/build/back-sidebar/short-menu-item/index.d.ts +8 -0
- package/build/back-sidebar/sub-menu-item/index.d.ts +8 -0
- package/build/index.d.ts +3 -0
- package/build/index.js +143 -29
- package/build/link/button/index.d.ts +5 -0
- package/build/link/index.d.ts +2 -0
- package/build/link/link/index.d.ts +5 -0
- package/build/styles.css +145 -0
- package/package.json +4 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BackSidebarProps } from "src/back-sidebar";
|
|
3
|
+
interface Props {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
shortMode?: boolean;
|
|
6
|
+
header?: React.ReactNode;
|
|
7
|
+
sidebar?: React.ReactNode;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
headerClassName?: string;
|
|
11
|
+
sidebarClassName?: string;
|
|
12
|
+
contentClassName?: string;
|
|
13
|
+
loadingClassName?: string;
|
|
14
|
+
sidebarProps: BackSidebarProps;
|
|
15
|
+
}
|
|
16
|
+
export declare const BackLayout: React.FC<Props>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { BackSidebarOption } from "./interfaces";
|
|
3
|
+
export * from "./interfaces";
|
|
4
|
+
export interface BackSidebarProps {
|
|
5
|
+
className?: string;
|
|
6
|
+
options: BackSidebarOption[];
|
|
7
|
+
top?: React.ReactNode;
|
|
8
|
+
shortMode?: boolean;
|
|
9
|
+
activePath?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const BackSidebar: React.FC<BackSidebarProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PagePath } from "page-path";
|
|
2
|
+
import { RegularIconName } from "src/icon";
|
|
3
|
+
export interface BackSidebarSubOption {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: RegularIconName;
|
|
6
|
+
path: PagePath;
|
|
7
|
+
}
|
|
8
|
+
export interface BackSidebarOption {
|
|
9
|
+
label: string;
|
|
10
|
+
icon?: RegularIconName;
|
|
11
|
+
options?: BackSidebarSubOption[];
|
|
12
|
+
}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var antd = require('antd');
|
|
6
|
+
var Link = require('next/link');
|
|
6
7
|
|
|
7
8
|
function _interopNamespaceDefault(e) {
|
|
8
9
|
var n = Object.create(null);
|
|
@@ -1519,13 +1520,13 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
1519
1520
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
1520
1521
|
};
|
|
1521
1522
|
|
|
1522
|
-
var s$
|
|
1523
|
+
var s$h = {"root":"index-module_root__-LDR1"};
|
|
1523
1524
|
|
|
1524
1525
|
// https://www.svgrepo.com/
|
|
1525
1526
|
function useBasicIcon(_a, icons) {
|
|
1526
1527
|
var className = _a.className, name = _a.name, props = __rest(_a, ["className", "name"]);
|
|
1527
1528
|
var svgAttrs = React.useMemo(function () {
|
|
1528
|
-
return __assign({ className: classNames(s$
|
|
1529
|
+
return __assign({ className: classNames(s$h.root, className), fill: "currentColor" }, props);
|
|
1529
1530
|
}, [className, props]);
|
|
1530
1531
|
var Icon = icons[name];
|
|
1531
1532
|
return Icon ? React.createElement(Icon, __assign({}, svgAttrs)) : undefined;
|
|
@@ -4612,7 +4613,7 @@ var SocialIcon = function (props) {
|
|
|
4612
4613
|
return useBasicIcon(props, icons);
|
|
4613
4614
|
};
|
|
4614
4615
|
|
|
4615
|
-
var s$
|
|
4616
|
+
var s$g = {"root":"index-module_root__gtTIa","action":"index-module_action__pOSde"};
|
|
4616
4617
|
|
|
4617
4618
|
function useForm(form) {
|
|
4618
4619
|
var newForm = antd.Form.useForm()[0];
|
|
@@ -4649,10 +4650,10 @@ var AppForm = function (_a) {
|
|
|
4649
4650
|
React.useEffect(function () {
|
|
4650
4651
|
onValid === null || onValid === void 0 ? void 0 : onValid(valid);
|
|
4651
4652
|
}, [onValid, valid]);
|
|
4652
|
-
return (React.createElement(antd.Form, { form: form, onFinish: onFinish, className: classNames(s$
|
|
4653
|
+
return (React.createElement(antd.Form, { form: form, onFinish: onFinish, className: classNames(s$g.root, className), layout: "vertical", onValuesChange: handleValuesChange, onFieldsChange: handleFieldsChange, initialValues: initialValues }, typeof children === "function" ? children({ valid: valid }) : children));
|
|
4653
4654
|
};
|
|
4654
4655
|
|
|
4655
|
-
var s$
|
|
4656
|
+
var s$f = {"root":"index-module_root__2S1Jp"};
|
|
4656
4657
|
|
|
4657
4658
|
function useLineProps(_a) {
|
|
4658
4659
|
var lineClassName = _a.lineClassName, name = _a.name, label = _a.label, rules = _a.rules, valuePropName = _a.valuePropName, noStyle = _a.noStyle, rest = __rest(_a, ["lineClassName", "name", "label", "rules", "valuePropName", "noStyle"]);
|
|
@@ -4666,7 +4667,7 @@ var FormLine = function (_a) {
|
|
|
4666
4667
|
}
|
|
4667
4668
|
return [];
|
|
4668
4669
|
}, [validateRules]);
|
|
4669
|
-
return React.createElement(antd.Form.Item, __assign({ className: classNames(s$
|
|
4670
|
+
return React.createElement(antd.Form.Item, __assign({ className: classNames(s$f.root, className), rules: rules }, props));
|
|
4670
4671
|
};
|
|
4671
4672
|
|
|
4672
4673
|
var DatePickerField = function (props) {
|
|
@@ -4687,12 +4688,12 @@ var InputField = function (props) {
|
|
|
4687
4688
|
React.createElement(antd.Input, __assign({}, controlProps))));
|
|
4688
4689
|
};
|
|
4689
4690
|
|
|
4690
|
-
var s$
|
|
4691
|
+
var s$e = {"input":"index-module_input__LxXnu"};
|
|
4691
4692
|
|
|
4692
4693
|
var InputNumberField = function (props) {
|
|
4693
4694
|
var _a = useLineProps(props), lineProps = _a[0], _b = _a[1], className = _b.className, controlProps = __rest(_b, ["className"]);
|
|
4694
4695
|
return (React.createElement(FormLine, __assign({}, lineProps),
|
|
4695
|
-
React.createElement(antd.InputNumber, __assign({ className: classNames(s$
|
|
4696
|
+
React.createElement(antd.InputNumber, __assign({ className: classNames(s$e.input, className) }, controlProps))));
|
|
4696
4697
|
};
|
|
4697
4698
|
|
|
4698
4699
|
var RadioButtonField = function (props) {
|
|
@@ -4701,13 +4702,13 @@ var RadioButtonField = function (props) {
|
|
|
4701
4702
|
React.createElement(antd.Radio.Group, __assign({ buttonStyle: buttonStyle }, controlProps))));
|
|
4702
4703
|
};
|
|
4703
4704
|
|
|
4704
|
-
var s$
|
|
4705
|
+
var s$d = {"popup":"index-module_popup__5L587"};
|
|
4705
4706
|
|
|
4706
4707
|
var RangePicker = antd.DatePicker.RangePicker;
|
|
4707
4708
|
var RangePickerField = function (props) {
|
|
4708
4709
|
var _a = useLineProps(props), lineProps = _a[0], _b = _a[1], oneMonth = _b.oneMonth, controlProps = __rest(_b, ["oneMonth"]);
|
|
4709
4710
|
return (React.createElement(FormLine, __assign({}, lineProps),
|
|
4710
|
-
React.createElement(RangePicker, __assign({}, controlProps, { popupClassName: oneMonth ? s$
|
|
4711
|
+
React.createElement(RangePicker, __assign({}, controlProps, { popupClassName: oneMonth ? s$d.popup : undefined }))));
|
|
4711
4712
|
};
|
|
4712
4713
|
|
|
4713
4714
|
var SelectField = function (props) {
|
|
@@ -4763,29 +4764,29 @@ function usePrevious(value) {
|
|
|
4763
4764
|
return ref === null || ref === void 0 ? void 0 : ref.current;
|
|
4764
4765
|
}
|
|
4765
4766
|
|
|
4766
|
-
var s$
|
|
4767
|
+
var s$c = {"root":"index-module_root__f8fnA"};
|
|
4767
4768
|
|
|
4768
4769
|
var DivisionRow = function (_a) {
|
|
4769
4770
|
var children = _a.children, className = _a.className;
|
|
4770
|
-
return React.createElement("div", { className: classNames(s$
|
|
4771
|
+
return React.createElement("div", { className: classNames(s$c.root, className) }, children);
|
|
4771
4772
|
};
|
|
4772
4773
|
|
|
4773
|
-
var s$
|
|
4774
|
+
var s$b = {"root":"index-module_root__xH-TN"};
|
|
4774
4775
|
|
|
4775
4776
|
var FormButton = function (_a) {
|
|
4776
4777
|
var className = _a.className, _b = _a.submitText, submitText = _b === void 0 ? "Save" : _b;
|
|
4777
|
-
return (React.createElement("div", { className: classNames(s$
|
|
4778
|
+
return (React.createElement("div", { className: classNames(s$b.root, className) },
|
|
4778
4779
|
React.createElement(antd.Button, { htmlType: "submit", type: "primary" }, submitText)));
|
|
4779
4780
|
};
|
|
4780
4781
|
|
|
4781
|
-
var s$
|
|
4782
|
+
var s$a = {"root":"index-module_root__Xj8zb"};
|
|
4782
4783
|
|
|
4783
4784
|
var FormError = function (_a) {
|
|
4784
4785
|
var children = _a.children, className = _a.className;
|
|
4785
|
-
return children ? React.createElement("div", { className: classNames(s$
|
|
4786
|
+
return children ? React.createElement("div", { className: classNames(s$a.root, className) }, children) : null;
|
|
4786
4787
|
};
|
|
4787
4788
|
|
|
4788
|
-
var s$
|
|
4789
|
+
var s$9 = {"root":"index-module_root__C7wx2","content":"index-module_content__RsiJT","close":"index-module_close__lBc6p"};
|
|
4789
4790
|
|
|
4790
4791
|
var InfoDialog = function (_a) {
|
|
4791
4792
|
var children = _a.children, className = _a.className, width = _a.width, hideClose = _a.hideClose, onClose = _a.onClose, _b = _a.open, open = _b === void 0 ? true : _b, contentClassName = _a.contentClassName, _c = _a.maskClosable, maskClosable = _c === void 0 ? false : _c;
|
|
@@ -4797,22 +4798,22 @@ var InfoDialog = function (_a) {
|
|
|
4797
4798
|
}
|
|
4798
4799
|
return result;
|
|
4799
4800
|
}, [width]);
|
|
4800
|
-
return (React.createElement(antd.Modal, { open: open, onCancel: onClose, style: style, className: classNames(s$
|
|
4801
|
-
React.createElement("div", { className: classNames(s$
|
|
4801
|
+
return (React.createElement(antd.Modal, { open: open, onCancel: onClose, style: style, className: classNames(s$9.root, className), maskClosable: maskClosable, footer: null },
|
|
4802
|
+
React.createElement("div", { className: classNames(s$9.content, contentClassName) },
|
|
4802
4803
|
children,
|
|
4803
|
-
hideClose ? null : React.createElement(RegularIcon, { name: "cross", className: s$
|
|
4804
|
+
hideClose ? null : React.createElement(RegularIcon, { name: "cross", className: s$9.close, onClick: onClose }))));
|
|
4804
4805
|
};
|
|
4805
4806
|
|
|
4806
|
-
var s$
|
|
4807
|
+
var s$8 = {"root":"index-module_root__BQI-i","header":"index-module_header__OUCQj","close":"index-module_close__-FN6K","content":"index-module_content__BpXha","footer":"index-module_footer__xqKte"};
|
|
4807
4808
|
|
|
4808
4809
|
var RegularDialog = function (_a) {
|
|
4809
4810
|
var titlePrefix = _a.titlePrefix, title = _a.title, children = _a.children, _b = _a.hideFooter, hideFooter = _b === void 0 ? false : _b, className = _a.className, width = _a.width, okText = _a.okText, cancelText = _a.cancelText, footerClassName = _a.footerClassName, contentClassName = _a.contentClassName, hideOk = _a.hideOk, onOk = _a.onOk, onClose = _a.onClose, _c = _a.open, open = _c === void 0 ? true : _c;
|
|
4810
4811
|
var close = React.useMemo(function () {
|
|
4811
|
-
return React.createElement(RegularIcon, { name: "cross", className: s$
|
|
4812
|
+
return React.createElement(RegularIcon, { name: "cross", className: s$8.close, onClick: onClose });
|
|
4812
4813
|
}, [onClose]);
|
|
4813
4814
|
var titleContent = React.useMemo(function () {
|
|
4814
4815
|
if (typeof title === "string") {
|
|
4815
|
-
return (React.createElement("div", { className: s$
|
|
4816
|
+
return (React.createElement("div", { className: s$8.header },
|
|
4816
4817
|
React.createElement("div", null, ((titlePrefix || "") + " " || "") + title),
|
|
4817
4818
|
close));
|
|
4818
4819
|
}
|
|
@@ -4820,7 +4821,7 @@ var RegularDialog = function (_a) {
|
|
|
4820
4821
|
return title(close);
|
|
4821
4822
|
}
|
|
4822
4823
|
return null;
|
|
4823
|
-
}, [s$
|
|
4824
|
+
}, [s$8, title, titlePrefix, close]);
|
|
4824
4825
|
var style = React.useMemo(function () {
|
|
4825
4826
|
var result = {};
|
|
4826
4827
|
if (width) {
|
|
@@ -4834,15 +4835,15 @@ var RegularDialog = function (_a) {
|
|
|
4834
4835
|
onOk();
|
|
4835
4836
|
}
|
|
4836
4837
|
}, [onOk]);
|
|
4837
|
-
return (React.createElement(antd.Modal, { open: open, onCancel: onClose, style: style, className: classNames(s$
|
|
4838
|
+
return (React.createElement(antd.Modal, { open: open, onCancel: onClose, style: style, className: classNames(s$8.root, className), maskClosable: false, footer: null },
|
|
4838
4839
|
titleContent,
|
|
4839
|
-
React.createElement("div", { className: classNames(s$
|
|
4840
|
-
hideFooter ? null : (React.createElement("div", { className: classNames(s$
|
|
4840
|
+
React.createElement("div", { className: classNames(s$8.content, contentClassName) }, children),
|
|
4841
|
+
hideFooter ? null : (React.createElement("div", { className: classNames(s$8.footer, footerClassName) },
|
|
4841
4842
|
React.createElement(antd.Button, { onClick: onClose }, cancelText || "Cancel"),
|
|
4842
4843
|
hideOk ? null : (React.createElement(antd.Button, { type: "primary", onClick: handleOk }, okText || "OK"))))));
|
|
4843
4844
|
};
|
|
4844
4845
|
|
|
4845
|
-
var s = {"root":"index-module_root__9mhio"};
|
|
4846
|
+
var s$7 = {"root":"index-module_root__9mhio"};
|
|
4846
4847
|
|
|
4847
4848
|
function isRegular(icon) {
|
|
4848
4849
|
return RegularIconNameList.includes(icon);
|
|
@@ -4852,13 +4853,126 @@ function isSocial(icon) {
|
|
|
4852
4853
|
}
|
|
4853
4854
|
var FlatButton = function (_a) {
|
|
4854
4855
|
var children = _a.children, className = _a.className, icon = _a.icon, onClick = _a.onClick;
|
|
4855
|
-
return (React.createElement("div", { className: classNames(s.root, className), onClick: onClick },
|
|
4856
|
+
return (React.createElement("div", { className: classNames(s$7.root, className), onClick: onClick },
|
|
4856
4857
|
isRegular(icon) ? React.createElement(RegularIcon, { name: icon }) : null,
|
|
4857
4858
|
isSocial(icon) ? React.createElement(SocialIcon, { name: icon }) : null,
|
|
4858
4859
|
children ? React.createElement("span", null, children) : null));
|
|
4859
4860
|
};
|
|
4860
4861
|
|
|
4862
|
+
var s$6 = {"root":"index-module_root__r-dVh"};
|
|
4863
|
+
|
|
4864
|
+
var AppLink = function (_a) {
|
|
4865
|
+
var href = _a.href, className = _a.className, children = _a.children, rest = __rest(_a, ["href", "className", "children"]);
|
|
4866
|
+
return (React.createElement(Link, __assign({ href: href, className: classNames(s$6.root, className) }, rest), children));
|
|
4867
|
+
};
|
|
4868
|
+
|
|
4869
|
+
var s$5 = {"root":"index-module_root__gpEkZ"};
|
|
4870
|
+
|
|
4871
|
+
var AppLinkButton = function (_a) {
|
|
4872
|
+
var className = _a.className, children = _a.children, rest = __rest(_a, ["className", "children"]);
|
|
4873
|
+
return (React.createElement("div", __assign({ className: classNames(s$5.root, className) }, rest), children));
|
|
4874
|
+
};
|
|
4875
|
+
|
|
4876
|
+
var s$4 = {"root":"index-module_root__DRIJ9","title":"index-module_title__IrIK1","title__active":"index-module_title__active__tmRVg","title__label":"index-module_title__label__KtjaK","list":"index-module_list__lL8Kc","list__open":"index-module_list__open__WhqVg"};
|
|
4877
|
+
|
|
4878
|
+
var s$3 = {"root":"index-module_root__En9mt","root__active":"index-module_root__active__32aMB"};
|
|
4879
|
+
|
|
4880
|
+
var BackSidebarSubMenuItem = function (_a) {
|
|
4881
|
+
var _b;
|
|
4882
|
+
var _c = _a.activePath, activePath = _c === void 0 ? "" : _c, option = _a.option;
|
|
4883
|
+
var icon = option.icon, label = option.label, path = option.path;
|
|
4884
|
+
var isActive = path.isActive(activePath);
|
|
4885
|
+
return (React.createElement(AppLink, { className: classNames(s$3.root, (_b = {}, _b[s$3.root__active] = isActive, _b)), href: path.build() },
|
|
4886
|
+
icon && React.createElement(RegularIcon, { name: icon }),
|
|
4887
|
+
React.createElement("span", null, label)));
|
|
4888
|
+
};
|
|
4889
|
+
|
|
4890
|
+
function useIsOptionActive(activePath, options) {
|
|
4891
|
+
if (activePath === void 0) { activePath = ""; }
|
|
4892
|
+
return React.useMemo(function () {
|
|
4893
|
+
return !!options.find(function (x) {
|
|
4894
|
+
return x.path.isActive(activePath);
|
|
4895
|
+
});
|
|
4896
|
+
}, [activePath, options]);
|
|
4897
|
+
}
|
|
4898
|
+
|
|
4899
|
+
var BackSidebarMenuItem = function (_a) {
|
|
4900
|
+
var _b, _c;
|
|
4901
|
+
var option = _a.option, activePath = _a.activePath;
|
|
4902
|
+
var icon = option.icon, label = option.label, _d = option.options, options = _d === void 0 ? [] : _d;
|
|
4903
|
+
var isActive = useIsOptionActive(activePath, options);
|
|
4904
|
+
var _e = React.useState(isActive), open = _e[0], setOpen = _e[1];
|
|
4905
|
+
React.useEffect(function () {
|
|
4906
|
+
if (isActive) {
|
|
4907
|
+
setOpen(true);
|
|
4908
|
+
}
|
|
4909
|
+
}, [isActive]);
|
|
4910
|
+
var handleClick = React.useCallback(function () {
|
|
4911
|
+
setOpen(!open);
|
|
4912
|
+
}, [open]);
|
|
4913
|
+
return (React.createElement("div", { className: s$4.root },
|
|
4914
|
+
React.createElement("div", { className: classNames(s$4.title, (_b = {}, _b[s$4.title__active] = isActive, _b)), onClick: handleClick },
|
|
4915
|
+
icon && React.createElement(RegularIcon, { name: icon }),
|
|
4916
|
+
React.createElement("span", { className: s$4.title__label }, label),
|
|
4917
|
+
React.createElement(RegularIcon, { name: open ? "keyboard-arrow-down" : "keyboard-arrow-right" })),
|
|
4918
|
+
React.createElement("div", { className: classNames(s$4.list, (_c = {}, _c[s$4.list__open] = open, _c)) }, options.map(function (x, i) {
|
|
4919
|
+
return React.createElement(BackSidebarSubMenuItem, { key: i, option: x });
|
|
4920
|
+
}))));
|
|
4921
|
+
};
|
|
4922
|
+
|
|
4923
|
+
var s$2 = {"root":"index-module_root__v-d7O","list":"index-module_list__v1Yma","master":"index-module_master__Jhlca","master__active":"index-module_master__active__KPHU1"};
|
|
4924
|
+
|
|
4925
|
+
var BackSidebarShortMenuItem = function (_a) {
|
|
4926
|
+
var _b;
|
|
4927
|
+
var option = _a.option, activePath = _a.activePath;
|
|
4928
|
+
var icon = option.icon, _c = option.options, options = _c === void 0 ? [] : _c;
|
|
4929
|
+
var isActive = useIsOptionActive(activePath, options);
|
|
4930
|
+
var _d = React.useState(isActive), open = _d[0], setOpen = _d[1];
|
|
4931
|
+
React.useEffect(function () {
|
|
4932
|
+
if (isActive) {
|
|
4933
|
+
setOpen(true);
|
|
4934
|
+
}
|
|
4935
|
+
}, [isActive]);
|
|
4936
|
+
var handleClick = React.useCallback(function () {
|
|
4937
|
+
setOpen(!open);
|
|
4938
|
+
}, [open]);
|
|
4939
|
+
return (React.createElement("div", { className: s$2.root },
|
|
4940
|
+
React.createElement("div", { className: classNames(s$2.master, (_b = {}, _b[s$2.master__active] = isActive, _b)), onClick: handleClick }, icon && React.createElement(RegularIcon, { name: icon })),
|
|
4941
|
+
React.createElement("div", { className: classNames(s$2.list) }, options.map(function (x, i) {
|
|
4942
|
+
return React.createElement(BackSidebarSubMenuItem, { key: i, option: x });
|
|
4943
|
+
}))));
|
|
4944
|
+
};
|
|
4945
|
+
|
|
4946
|
+
var s$1 = {"root":"index-module_root__oQRmx"};
|
|
4947
|
+
|
|
4948
|
+
// https://www.einfosoft.com/templates/admin/spice/source/edit_booking.html#
|
|
4949
|
+
var BackSidebar = function (_a) {
|
|
4950
|
+
var className = _a.className, options = _a.options, top = _a.top, shortMode = _a.shortMode, activePath = _a.activePath;
|
|
4951
|
+
return (React.createElement("div", { className: classNames(s$1.root, className) },
|
|
4952
|
+
top ? React.createElement("div", { className: classNames(s$1.top) }, top) : null,
|
|
4953
|
+
React.createElement("div", { className: s$1.menu }, options.map(function (option, i) {
|
|
4954
|
+
return shortMode ? (React.createElement(BackSidebarShortMenuItem, { key: i, option: option, activePath: activePath })) : (React.createElement(BackSidebarMenuItem, { key: i, option: option, activePath: activePath }));
|
|
4955
|
+
}))));
|
|
4956
|
+
};
|
|
4957
|
+
|
|
4958
|
+
var s = {"root":"index-module_root__BkOp7","root__short":"index-module_root__short__maBe-","header":"index-module_header__34B0-","sidebar":"index-module_sidebar__xjW3v","content":"index-module_content__cMuen","loading":"index-module_loading__KxkST"};
|
|
4959
|
+
|
|
4960
|
+
var BackLayout = function (_a) {
|
|
4961
|
+
var _b;
|
|
4962
|
+
var className = _a.className, loading = _a.loading, shortMode = _a.shortMode, header = _a.header, children = _a.children, headerClassName = _a.headerClassName, sidebarClassName = _a.sidebarClassName, contentClassName = _a.contentClassName, loadingClassName = _a.loadingClassName, sidebarProps = _a.sidebarProps;
|
|
4963
|
+
return (React.createElement("div", { className: classNames(s.root, className, (_b = {}, _b[s.root__short] = shortMode, _b)) },
|
|
4964
|
+
React.createElement("div", { className: classNames(s.header, headerClassName) }, header),
|
|
4965
|
+
React.createElement("div", { className: classNames(s.sidebar, sidebarClassName) },
|
|
4966
|
+
React.createElement(BackSidebar, __assign({}, sidebarProps))),
|
|
4967
|
+
loading ? (React.createElement("div", { className: classNames(s.loading, loadingClassName) },
|
|
4968
|
+
React.createElement(antd.Spin, { size: "large" }))) : (React.createElement("div", { className: classNames(s.content, contentClassName) }, children))));
|
|
4969
|
+
};
|
|
4970
|
+
|
|
4861
4971
|
exports.AppForm = AppForm;
|
|
4972
|
+
exports.AppLink = AppLink;
|
|
4973
|
+
exports.AppLinkButton = AppLinkButton;
|
|
4974
|
+
exports.BackLayout = BackLayout;
|
|
4975
|
+
exports.BackSidebar = BackSidebar;
|
|
4862
4976
|
exports.DatePickerField = DatePickerField;
|
|
4863
4977
|
exports.DivisionRow = DivisionRow;
|
|
4864
4978
|
exports.FlagIcon = FlagIcon;
|
package/build/styles.css
CHANGED
|
@@ -112,4 +112,149 @@
|
|
|
112
112
|
}
|
|
113
113
|
.index-module_root__9mhio:hover {
|
|
114
114
|
background-color: rgb(221, 221, 221);
|
|
115
|
+
}
|
|
116
|
+
.index-module_root__r-dVh {
|
|
117
|
+
color: var(--linkColor) !important;
|
|
118
|
+
text-decoration: none;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
.index-module_root__r-dVh:hover {
|
|
122
|
+
color: var(--linkColor);
|
|
123
|
+
text-decoration: underline;
|
|
124
|
+
}
|
|
125
|
+
.index-module_root__gpEkZ {
|
|
126
|
+
display: inline;
|
|
127
|
+
color: var(--linkColor) !important;
|
|
128
|
+
text-decoration: none;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
}
|
|
131
|
+
.index-module_root__gpEkZ:hover {
|
|
132
|
+
color: var(--linkColor);
|
|
133
|
+
text-decoration: underline;
|
|
134
|
+
}
|
|
135
|
+
.index-module_root__DRIJ9 {
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.index-module_title__IrIK1 {
|
|
140
|
+
height: 46px;
|
|
141
|
+
display: flex;
|
|
142
|
+
flex-direction: row;
|
|
143
|
+
gap: 10px;
|
|
144
|
+
align-items: center;
|
|
145
|
+
padding: 0 15px;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
font-weight: 500;
|
|
148
|
+
}
|
|
149
|
+
.index-module_title__active__tmRVg, .index-module_title__IrIK1:hover {
|
|
150
|
+
background-color: var(--backSidebarHoverItemBackgroundColor);
|
|
151
|
+
color: var(--backSidebarActiveColor);
|
|
152
|
+
}
|
|
153
|
+
.index-module_title__label__KtjaK {
|
|
154
|
+
flex: 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.index-module_list__lL8Kc {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
.index-module_list__open__WhqVg {
|
|
161
|
+
display: block;
|
|
162
|
+
}
|
|
163
|
+
.index-module_root__En9mt {
|
|
164
|
+
height: 46px;
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: row;
|
|
167
|
+
gap: 10px;
|
|
168
|
+
align-items: center;
|
|
169
|
+
padding: 0 15px;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
font-weight: 500;
|
|
172
|
+
padding-left: 30px;
|
|
173
|
+
background-color: var(--backSidebarSubItemBackgroundColor);
|
|
174
|
+
}
|
|
175
|
+
.index-module_root__En9mt:hover > svg,
|
|
176
|
+
.index-module_root__En9mt:hover span {
|
|
177
|
+
color: var(--backSidebarActiveColor) !important;
|
|
178
|
+
text-decoration: none !important;
|
|
179
|
+
}
|
|
180
|
+
.index-module_root__active__32aMB > svg,
|
|
181
|
+
.index-module_root__active__32aMB span {
|
|
182
|
+
color: var(--backSidebarActiveColor) !important;
|
|
183
|
+
}
|
|
184
|
+
.index-module_root__En9mt > svg,
|
|
185
|
+
.index-module_root__En9mt span {
|
|
186
|
+
color: var(--backSidebarColor) !important;
|
|
187
|
+
}
|
|
188
|
+
.index-module_root__v-d7O {
|
|
189
|
+
position: relative;
|
|
190
|
+
}
|
|
191
|
+
.index-module_root__v-d7O:hover .index-module_list__v1Yma {
|
|
192
|
+
display: block;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.index-module_master__Jhlca {
|
|
196
|
+
height: 46px;
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-direction: row;
|
|
199
|
+
gap: 10px;
|
|
200
|
+
align-items: center;
|
|
201
|
+
padding: 0 15px;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
}
|
|
205
|
+
.index-module_master__active__KPHU1, .index-module_master__Jhlca:hover {
|
|
206
|
+
background-color: var(--backSidebarHoverItemBackgroundColor);
|
|
207
|
+
color: var(--backSidebarActiveColor);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.index-module_list__v1Yma {
|
|
211
|
+
display: none;
|
|
212
|
+
position: absolute;
|
|
213
|
+
top: 0;
|
|
214
|
+
left: 100%;
|
|
215
|
+
z-index: 10;
|
|
216
|
+
}
|
|
217
|
+
.index-module_root__oQRmx {
|
|
218
|
+
padding: 10px 0;
|
|
219
|
+
display: flex;
|
|
220
|
+
flex-direction: column;
|
|
221
|
+
gap: 20px;
|
|
222
|
+
color: var(--backSidebarColor);
|
|
223
|
+
background-color: var(--backSidebarBackgroundColor);
|
|
224
|
+
}
|
|
225
|
+
.index-module_root__BkOp7 {
|
|
226
|
+
background-color: var(--backLayoutBackgroundColor);
|
|
227
|
+
display: grid;
|
|
228
|
+
grid-template: "sidebar header" var(--backHeaderHeight) "sidebar content" 1fr/250px 1fr;
|
|
229
|
+
height: 100vh;
|
|
230
|
+
transition: grid-template 0.5s;
|
|
231
|
+
gap: 0;
|
|
232
|
+
}
|
|
233
|
+
.index-module_root__short__maBe- {
|
|
234
|
+
grid-template: "sidebar header" var(--backHeaderHeight) "sidebar content" 1fr/50px 1fr;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.index-module_header__34B0- {
|
|
238
|
+
grid-area: header;
|
|
239
|
+
background-color: var(--backLayoutHeaderBackgroundColor);
|
|
240
|
+
border-bottom: 1px solid var(--backLayoutBorderColor);
|
|
241
|
+
box-shadow: var(--backHeaderBoxShadow);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.index-module_sidebar__xjW3v {
|
|
245
|
+
grid-area: sidebar;
|
|
246
|
+
background-color: var(--backSidebarBackgroundColor);
|
|
247
|
+
color: var(--backSidebarColor);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.index-module_content__cMuen {
|
|
251
|
+
grid-area: content;
|
|
252
|
+
overflow: auto;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.index-module_loading__KxkST {
|
|
256
|
+
grid-area: content;
|
|
257
|
+
display: flex;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
align-items: center;
|
|
115
260
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "revdev-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"module": "build/index.esm.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"lodash.debounce": ">=4",
|
|
27
27
|
"next": ">=13",
|
|
28
28
|
"react": ">=18",
|
|
29
|
-
"react-dom": ">=18"
|
|
29
|
+
"react-dom": ">=18",
|
|
30
|
+
"page-path": ">=0.7"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
33
|
"@chromatic-com/storybook": "^3.2.2",
|
|
@@ -47,6 +48,7 @@
|
|
|
47
48
|
"classnames": "^2.5.1",
|
|
48
49
|
"eslint-config-varp": "^1.10.0",
|
|
49
50
|
"next": "14.2.16",
|
|
51
|
+
"page-path": "^0.7.0",
|
|
50
52
|
"postcss": "^8",
|
|
51
53
|
"rollup": "^4.24.4",
|
|
52
54
|
"rollup-obfuscator": "^4.1.1",
|