@banch0u/core-project-test-repository 1.8.0 → 1.8.1
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/assets/css/antd.css +7 -0
- package/dist/components/Select/index.js +67 -21
- package/dist/index.css +33 -0
- package/dist/index.js +3 -0
- package/package.json +1 -1
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import style from "./index.module.scss";
|
|
3
|
+
import { Select as AntdSelect, Divider } from "antd";
|
|
3
4
|
import Button from "../Button";
|
|
4
|
-
import { Divider, Select as AntdSelect } from "antd";
|
|
5
5
|
var Select = function Select(_ref) {
|
|
6
6
|
var children = _ref.children,
|
|
7
7
|
className = _ref.className,
|
|
8
8
|
_ref$placeholder = _ref.placeholder,
|
|
9
9
|
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
10
|
-
_ref$divider = _ref.divider,
|
|
11
|
-
divider = _ref$divider === void 0 ? false : _ref$divider,
|
|
12
|
-
_ref$dividerButtonNam = _ref.dividerButtonName,
|
|
13
|
-
dividerButtonName = _ref$dividerButtonNam === void 0 ? "" : _ref$dividerButtonNam,
|
|
14
|
-
_ref$onOpen = _ref.onOpen,
|
|
15
|
-
onOpen = _ref$onOpen === void 0 ? function () {} : _ref$onOpen,
|
|
16
10
|
_ref$onChange = _ref.onChange,
|
|
17
11
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
12
|
+
_ref$onOpen = _ref.onOpen,
|
|
13
|
+
onOpen = _ref$onOpen === void 0 ? function () {} : _ref$onOpen,
|
|
18
14
|
_ref$disabled = _ref.disabled,
|
|
19
15
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
20
|
-
_ref$mode = _ref.mode,
|
|
21
|
-
mode = _ref$mode === void 0 ? "single" : _ref$mode,
|
|
22
|
-
_ref$optionLabelProp = _ref.optionLabelProp,
|
|
23
|
-
optionLabelProp = _ref$optionLabelProp === void 0 ? "children" : _ref$optionLabelProp,
|
|
24
|
-
_ref$tagRender = _ref.tagRender,
|
|
25
|
-
tagRender = _ref$tagRender === void 0 ? function () {} : _ref$tagRender,
|
|
26
16
|
value = _ref.value,
|
|
27
|
-
defaultValue = _ref.defaultValue
|
|
28
|
-
|
|
17
|
+
defaultValue = _ref.defaultValue,
|
|
18
|
+
mode = _ref.mode,
|
|
19
|
+
text = _ref.text;
|
|
20
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, mode === "multiple" ? /*#__PURE__*/React.createElement(AntdSelect, {
|
|
29
21
|
className: className || style.select,
|
|
30
22
|
showSearch: true,
|
|
23
|
+
allowClear: true,
|
|
31
24
|
placeholder: placeholder,
|
|
32
25
|
optionFilterProp: "children",
|
|
33
26
|
filterOption: function filterOption(input, option) {
|
|
@@ -39,8 +32,33 @@ var Select = function Select(_ref) {
|
|
|
39
32
|
var normalizedOption = normalizeAz(option.children);
|
|
40
33
|
return normalizedOption.includes(normalizedInput);
|
|
41
34
|
},
|
|
35
|
+
onChange: onChange,
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
value: value,
|
|
38
|
+
defaultValue: defaultValue,
|
|
39
|
+
mode: "multiple",
|
|
40
|
+
optionLabelProp: "label"
|
|
41
|
+
}, children) : mode === "divider" ? /*#__PURE__*/React.createElement(AntdSelect, {
|
|
42
|
+
className: className || style.select,
|
|
43
|
+
showSearch: true,
|
|
44
|
+
allowClear: true,
|
|
45
|
+
placeholder: placeholder,
|
|
46
|
+
optionFilterProp: "children",
|
|
47
|
+
filterOption: function filterOption(input, option) {
|
|
48
|
+
if (!(option !== null && option !== void 0 && option.children) || typeof option.children !== "string") return false;
|
|
49
|
+
var normalizeAz = function normalizeAz(str) {
|
|
50
|
+
return str.replace(/I/g, "i").toLocaleLowerCase("az").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ç/g, "c").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ü/g, "u").replace(/ö/g, "o").replace(/ə/g, "e");
|
|
51
|
+
};
|
|
52
|
+
var normalizedInput = normalizeAz(input);
|
|
53
|
+
var normalizedOption = normalizeAz(option.children);
|
|
54
|
+
return normalizedOption.includes(normalizedInput);
|
|
55
|
+
},
|
|
56
|
+
onChange: onChange,
|
|
57
|
+
disabled: disabled,
|
|
58
|
+
value: value,
|
|
59
|
+
defaultValue: defaultValue,
|
|
42
60
|
dropdownRender: function dropdownRender(menu) {
|
|
43
|
-
return /*#__PURE__*/React.createElement(
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", null, menu, /*#__PURE__*/React.createElement(Divider, {
|
|
44
62
|
style: {
|
|
45
63
|
margin: "4px 0"
|
|
46
64
|
}
|
|
@@ -48,15 +66,43 @@ var Select = function Select(_ref) {
|
|
|
48
66
|
className: style.select_add_button
|
|
49
67
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
50
68
|
onClick: onOpen
|
|
51
|
-
},
|
|
69
|
+
}, text)));
|
|
70
|
+
}
|
|
71
|
+
}, children) : /*#__PURE__*/React.createElement(AntdSelect, {
|
|
72
|
+
className: className || style.select,
|
|
73
|
+
showSearch: true,
|
|
74
|
+
allowClear: true,
|
|
75
|
+
placeholder: placeholder,
|
|
76
|
+
optionFilterProp: "children",
|
|
77
|
+
filterOption: function filterOption(input, option) {
|
|
78
|
+
if (!(option !== null && option !== void 0 && option.children) || typeof option.children !== "string") return false;
|
|
79
|
+
var normalizeAz = function normalizeAz(str) {
|
|
80
|
+
return str.replace(/I/g, "i").toLocaleLowerCase("az").normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/ç/g, "c").replace(/ş/g, "s").replace(/ğ/g, "g").replace(/ü/g, "u").replace(/ö/g, "o").replace(/ə/g, "e");
|
|
81
|
+
};
|
|
82
|
+
var normalizedInput = normalizeAz(input);
|
|
83
|
+
var normalizedOption = normalizeAz(option.children);
|
|
84
|
+
return normalizedOption.includes(normalizedInput);
|
|
52
85
|
},
|
|
53
86
|
onChange: onChange,
|
|
54
87
|
disabled: disabled,
|
|
55
|
-
mode: mode,
|
|
56
|
-
optionLabelProp: optionLabelProp,
|
|
57
|
-
tagRender: tagRender,
|
|
58
88
|
value: value,
|
|
59
89
|
defaultValue: defaultValue
|
|
60
|
-
}, children)
|
|
90
|
+
}, children))
|
|
91
|
+
// dropdownRender={(menu) => (
|
|
92
|
+
// <>
|
|
93
|
+
// <div>
|
|
94
|
+
// {menu}
|
|
95
|
+
// {divider ? (
|
|
96
|
+
// <>
|
|
97
|
+
// <Divider style={{ margin: "4px 0" }} />
|
|
98
|
+
// <div className={style.select_add_button}>
|
|
99
|
+
// <Button onClick={onOpen}>{dividerButtonName}</Button>
|
|
100
|
+
// </div>
|
|
101
|
+
// </>
|
|
102
|
+
// ) : null}
|
|
103
|
+
// </div>
|
|
104
|
+
// </>
|
|
105
|
+
// )}
|
|
106
|
+
;
|
|
61
107
|
};
|
|
62
108
|
export default Select;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
body * {
|
|
2
|
+
font-family: var(--defaultFont) !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* Apply styles globally to all scrollbars */
|
|
6
|
+
* {
|
|
7
|
+
/* For modern browsers (Firefox) */
|
|
8
|
+
scrollbar-width: thin !important;
|
|
9
|
+
scrollbar-color: #eaeaea transparent !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* For WebKit-based browsers (Chrome, Edge, Safari) */
|
|
13
|
+
*::-webkit-scrollbar {
|
|
14
|
+
width: 6px !important;
|
|
15
|
+
/* Vertical scrollbar width */
|
|
16
|
+
height: 6px !important;
|
|
17
|
+
/* Horizontal scrollbar height */
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
*::-webkit-scrollbar-thumb {
|
|
21
|
+
background: #eaeaea !important;
|
|
22
|
+
border-radius: 3px !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
26
|
+
background: #cccccc !important;
|
|
27
|
+
/* Darker color on hover */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
*::-webkit-scrollbar-track {
|
|
31
|
+
background: transparent !important;
|
|
32
|
+
/* Transparent track */
|
|
33
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import "./assets/fonts/fonts.css";
|
|
3
|
+
import "./assets/css/antd.css";
|
|
4
|
+
import "./index.css";
|
|
2
5
|
export { default as Button } from "./components/Button";
|
|
3
6
|
export { default as ColSort } from "./components/ColSort";
|
|
4
7
|
export { default as Filter } from "./components/Filter";
|