@ncds/ui-admin 0.0.8 → 0.0.10
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/const/Icon/FinanceECommerce.js +7 -15
- package/dist/const/Icon/alertAndFeedback.js +7 -1
- package/dist/const/Icon/arrow.js +7 -11
- package/dist/const/Icon/chart.js +7 -1
- package/dist/const/Icon/chevron.js +7 -1
- package/dist/const/Icon/circle.js +7 -1
- package/dist/const/Icon/communication.js +7 -1
- package/dist/const/Icon/development.js +7 -12
- package/dist/const/Icon/editor.js +7 -1
- package/dist/const/Icon/education.js +7 -1
- package/dist/const/Icon/files.js +7 -1
- package/dist/const/Icon/general.js +31 -57
- package/dist/const/Icon/index.js +37 -31
- package/dist/const/Icon/layout.js +9 -13
- package/dist/const/Icon/mapsTravel.js +7 -1
- package/dist/const/Icon/mediaDevices.js +7 -11
- package/dist/const/Icon/message.js +7 -1
- package/dist/const/Icon/sales.js +7 -1
- package/dist/const/Icon/security.js +7 -1
- package/dist/const/Icon/shapes.js +9 -4
- package/dist/const/Icon/tag.js +7 -1
- package/dist/const/Icon/time.js +7 -1
- package/dist/const/Icon/users.js +7 -11
- package/dist/const/Icon/weather.js +7 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-admin/assets/images/sprite.png +0 -0
- package/dist/ui-admin/assets/scripts/index.js +16 -1
- package/dist/ui-admin/assets/scripts/test.js +9 -2
- package/dist/ui-admin/assets/styles/style.css +1438 -0
- package/dist/ui-admin/constant/color.js +38 -32
- package/dist/ui-admin/constant/size.js +5 -1
- package/dist/ui-admin/index.js +148 -13
- package/dist/ui-admin/src/components/button/Button.js +103 -68
- package/dist/ui-admin/src/components/button/ButtonGroup.js +93 -54
- package/dist/ui-admin/src/components/button/index.js +27 -2
- package/dist/ui-admin/src/components/checkbox/Checkbox.js +67 -26
- package/dist/ui-admin/src/components/checkbox/CheckboxInput.js +65 -30
- package/dist/ui-admin/src/components/checkbox/index.js +27 -2
- package/dist/ui-admin/src/components/index.js +115 -10
- package/dist/ui-admin/src/components/input/FileInput.js +1 -1
- package/dist/ui-admin/src/components/input/InputBase.js +162 -77
- package/dist/ui-admin/src/components/input/PasswordInput.js +84 -66
- package/dist/ui-admin/src/components/input/index.d.ts +0 -1
- package/dist/ui-admin/src/components/input/index.d.ts.map +1 -1
- package/dist/ui-admin/src/components/input/index.js +27 -3
- package/dist/ui-admin/src/components/pagination/NavButton.js +87 -60
- package/dist/ui-admin/src/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/ui-admin/src/components/pagination/Pagination.js +169 -104
- package/dist/ui-admin/src/components/pagination/index.js +27 -2
- package/dist/ui-admin/src/components/radio/Radio.js +62 -26
- package/dist/ui-admin/src/components/radio/RadioInput.js +48 -27
- package/dist/ui-admin/src/components/radio/index.js +27 -2
- package/dist/ui-admin/src/components/select/Select.js +96 -33
- package/dist/ui-admin/src/components/select/index.js +16 -1
- package/dist/ui-admin/src/components/shared/hintText/HintText.js +40 -25
- package/dist/ui-admin/src/components/shared/hintText/index.js +16 -1
- package/dist/ui-admin/src/components/shared/index.js +27 -2
- package/dist/ui-admin/src/components/shared/label/Label.js +40 -25
- package/dist/ui-admin/src/components/shared/label/index.js +16 -1
- package/dist/ui-admin/src/components/spinner/Spinner.js +49 -17
- package/dist/ui-admin/src/components/spinner/index.js +16 -1
- package/dist/ui-admin/src/components/svg/SvgIcon.js +62 -27
- package/dist/ui-admin/src/components/svg/const.js +792 -786
- package/dist/ui-admin/src/components/svg/index.js +27 -2
- package/dist/ui-admin/src/components/tooltip/Tooltip.js +67 -18
- package/dist/ui-admin/src/components/tooltip/index.js +16 -1
- package/dist/ui-admin/src/constant/index.js +16 -1
- package/dist/ui-admin/src/constant/size.js +7 -1
- package/package.json +1 -1
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.COLOR = void 0;
|
|
7
|
+
var COLOR = exports.COLOR = {
|
|
8
|
+
gray200: '#D0D5DD',
|
|
9
|
+
gray300: '#98A2B3',
|
|
10
|
+
gray400: '#667085',
|
|
11
|
+
gray500: '#344054',
|
|
12
|
+
gray600: '#475467',
|
|
13
|
+
gray700: '#0C111D',
|
|
14
|
+
blue500: '#1570EF',
|
|
15
|
+
blue600: '#1849a9',
|
|
16
|
+
red500: '#ec1d31',
|
|
17
|
+
red600: '#dc0a2b',
|
|
18
|
+
orange500: '#e4501e',
|
|
19
|
+
orange600: '#b93815',
|
|
20
|
+
green500: '#099250',
|
|
21
|
+
green600: '#087443',
|
|
22
|
+
pink100: '#fce7f6',
|
|
23
|
+
pink600: '#c11574',
|
|
24
|
+
yellow600: '#c27004',
|
|
25
|
+
violet600: '#5720b7',
|
|
26
|
+
white: '#fff',
|
|
27
|
+
currentColor: 'currentColor',
|
|
28
|
+
black: '',
|
|
29
|
+
'secondary-gray-blue-50': '#f8f9fc',
|
|
30
|
+
'secondary-gray-blue-100': '#eaecf5',
|
|
31
|
+
'secondary-gray-blue-200': '#d5d9eb',
|
|
32
|
+
'secondary-gray-blue-300': '#b3b8db',
|
|
33
|
+
'secondary-gray-blue-400': '#717bbc',
|
|
34
|
+
'secondary-gray-blue-450': '#4e5ba6',
|
|
35
|
+
'secondary-gray-blue-500': '#3e4784',
|
|
36
|
+
'secondary-gray-blue-600': '#363f72',
|
|
37
|
+
'secondary-gray-blue-700': '#293056'
|
|
38
|
+
};
|
package/dist/ui-admin/index.js
CHANGED
|
@@ -1,13 +1,148 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _button = require("./src/components/button");
|
|
7
|
+
Object.keys(_button).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _button[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _button[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _checkbox = require("./src/components/checkbox");
|
|
18
|
+
Object.keys(_checkbox).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _checkbox[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _checkbox[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _input = require("./src/components/input");
|
|
29
|
+
Object.keys(_input).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _input[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _input[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _pagination = require("./src/components/pagination");
|
|
40
|
+
Object.keys(_pagination).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _pagination[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _pagination[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _radio = require("./src/components/radio");
|
|
51
|
+
Object.keys(_radio).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _radio[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _radio[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _select = require("./src/components/select");
|
|
62
|
+
Object.keys(_select).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _select[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _select[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _hintText = require("./src/components/shared/hintText");
|
|
73
|
+
Object.keys(_hintText).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _hintText[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _hintText[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _label = require("./src/components/shared/label");
|
|
84
|
+
Object.keys(_label).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _label[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _label[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var _shared = require("./src/components/shared");
|
|
95
|
+
Object.keys(_shared).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _shared[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
var _spinner = require("./src/components/spinner");
|
|
106
|
+
Object.keys(_spinner).forEach(function (key) {
|
|
107
|
+
if (key === "default" || key === "__esModule") return;
|
|
108
|
+
if (key in exports && exports[key] === _spinner[key]) return;
|
|
109
|
+
Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _spinner[key];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
var _svg = require("./src/components/svg");
|
|
117
|
+
Object.keys(_svg).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (key in exports && exports[key] === _svg[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _svg[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
var _tooltip = require("./src/components/tooltip");
|
|
128
|
+
Object.keys(_tooltip).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _tooltip[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _tooltip[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
var _components = require("./src/components");
|
|
139
|
+
Object.keys(_components).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _components[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _components[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
@@ -1,71 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.svgSize = exports.Button = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
var _color = require("../../../constant/color");
|
|
11
|
+
var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
14
|
+
__assign = Object.assign || function (t) {
|
|
15
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
16
|
+
s = arguments[i];
|
|
17
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
18
|
+
}
|
|
21
19
|
return t;
|
|
20
|
+
};
|
|
21
|
+
return __assign.apply(this, arguments);
|
|
22
22
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
sm: 14,
|
|
31
|
-
md: 16,
|
|
32
|
-
lg: 20,
|
|
23
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
24
|
+
var t = {};
|
|
25
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
26
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
29
|
+
return t;
|
|
33
30
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
31
|
+
var svgSize = exports.svgSize = {
|
|
32
|
+
xs: 12,
|
|
33
|
+
sm: 14,
|
|
34
|
+
md: 16,
|
|
35
|
+
lg: 20
|
|
36
|
+
};
|
|
37
|
+
var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
38
|
+
// NOTE: 엘리먼트 종류에 따라 props의 타입이 달라지므로 분리
|
|
39
|
+
var _a = props.as,
|
|
40
|
+
as = _a === void 0 ? 'button' : _a,
|
|
41
|
+
_b = props.size,
|
|
42
|
+
size = _b === void 0 ? 'md' : _b,
|
|
43
|
+
children = props.children,
|
|
44
|
+
onlyIcon = props.onlyIcon,
|
|
45
|
+
disabled = props.disabled,
|
|
46
|
+
className = props.className,
|
|
47
|
+
_c = props.hierarchy,
|
|
48
|
+
hierarchy = _c === void 0 ? 'secondary-gray' : _c,
|
|
49
|
+
label = props.label,
|
|
50
|
+
leadingIcon = props.leadingIcon,
|
|
51
|
+
trailingIcon = props.trailingIcon,
|
|
52
|
+
restProps = __rest(props, ["as", "size", "children", "onlyIcon", "disabled", "className", "hierarchy", "label", "leadingIcon", "trailingIcon"]);
|
|
53
|
+
var _d = (0, _react.useState)(null),
|
|
54
|
+
queryParams = _d[0],
|
|
55
|
+
setQueryParams = _d[1];
|
|
56
|
+
// Type guard to check if props is an AnchorElementProps
|
|
57
|
+
var isAnchorProps = function (p) {
|
|
58
|
+
return p.as === 'a';
|
|
59
|
+
};
|
|
60
|
+
var handleClickLink = function (e) {
|
|
61
|
+
var isRemote = (queryParams === null || queryParams === void 0 ? void 0 : queryParams.get('isRemote')) === 'true';
|
|
62
|
+
if (isAnchorProps(props) && isRemote) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
// INFO: 1. 사이트 리모트 페이지(디센/개센): 빌더에서 설정한 타겟(self or blank)에 따라 페이지 호출
|
|
65
|
+
// 2. 어드민 리모트 페이지: 빌더에서 설정한 타겟에 관계 없이 모두 blank
|
|
66
|
+
var isBlank = props.target === '_blank';
|
|
67
|
+
if (!isRemote && !isBlank && window.top) {
|
|
68
|
+
window.top.location.href = props.href;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
window.open(props.href);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var sideSlotRender = function (slot) {
|
|
75
|
+
if (slot.type === 'icon') {
|
|
76
|
+
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
77
|
+
name: slot.icon,
|
|
78
|
+
height: svgSize[size],
|
|
79
|
+
width: svgSize[size],
|
|
80
|
+
color: slot.color ? _color.COLOR[slot.color] : undefined
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return slot.children;
|
|
84
|
+
};
|
|
85
|
+
(0, _react.useEffect)(function () {
|
|
86
|
+
var _a;
|
|
87
|
+
setQueryParams(new URLSearchParams(((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.search) || ''));
|
|
88
|
+
}, []);
|
|
89
|
+
return /*#__PURE__*/(0, _react.createElement)(as, __assign(__assign({
|
|
90
|
+
className: (0, _classnames.default)('ncua-btn', "ncua-btn--".concat(size), {
|
|
91
|
+
'only-icon': onlyIcon,
|
|
92
|
+
'is-disable': disabled,
|
|
93
|
+
'has-underline': isAnchorProps(props) ? props.underline : false
|
|
94
|
+
}, className, hierarchy && "ncua-btn--".concat(hierarchy)),
|
|
95
|
+
onClick: isAnchorProps(props) ? handleClickLink : undefined,
|
|
96
|
+
disabled: disabled
|
|
97
|
+
}, restProps), {
|
|
98
|
+
ref: ref
|
|
99
|
+
}), (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
100
|
+
children: [leadingIcon && sideSlotRender(leadingIcon), !onlyIcon && label && (0, _jsxRuntime.jsx)("span", __assign({
|
|
101
|
+
className: "ncua-btn__label"
|
|
102
|
+
}, {
|
|
103
|
+
children: label
|
|
104
|
+
})), children, trailingIcon && sideSlotRender(trailingIcon)]
|
|
105
|
+
}));
|
|
106
|
+
});
|
|
@@ -1,60 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ButtonGroup = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _uiAdminIcon = _interopRequireDefault(require("@ncds/ui-admin-icon"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _color = require("../../../constant/color");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
16
|
+
__assign = Object.assign || function (t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
20
|
+
}
|
|
21
21
|
return t;
|
|
22
|
+
};
|
|
23
|
+
return __assign.apply(this, arguments);
|
|
24
|
+
};
|
|
25
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
28
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
29
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
22
32
|
};
|
|
23
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import Icon from '@ncds/ui-admin-icon';
|
|
25
|
-
import classNames from 'classnames';
|
|
26
|
-
import React, { createElement } from 'react';
|
|
27
|
-
import { COLOR } from '../../../constant/color';
|
|
28
33
|
var svgSize = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
xs: 12,
|
|
35
|
+
sm: 16,
|
|
36
|
+
md: 16,
|
|
37
|
+
lg: 20
|
|
33
38
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
var ButtonGroup = function (_a) {
|
|
40
|
+
var children = _a.children,
|
|
41
|
+
className = _a.className,
|
|
42
|
+
_b = _a.hasBorder,
|
|
43
|
+
hasBorder = _b === void 0 ? true : _b,
|
|
44
|
+
_c = _a.size,
|
|
45
|
+
size = _c === void 0 ? 'lg' : _c,
|
|
46
|
+
_d = _a.onlyIcon,
|
|
47
|
+
onlyIcon = _d === void 0 ? false : _d,
|
|
48
|
+
_e = _a.disabled,
|
|
49
|
+
disabled = _e === void 0 ? false : _e;
|
|
50
|
+
return (0, _jsxRuntime.jsx)("div", __assign({
|
|
51
|
+
className: (0, _classnames.default)('ncua-button-group', "ncua-button-group--".concat(size), {
|
|
52
|
+
'has-border': hasBorder
|
|
53
|
+
}, className)
|
|
54
|
+
}, {
|
|
55
|
+
children: _react.default.Children.map(children, function (child) {
|
|
56
|
+
if (! /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
60
|
+
onlyIcon: onlyIcon,
|
|
61
|
+
disabled: disabled || child.props.disabled
|
|
62
|
+
});
|
|
63
|
+
})
|
|
64
|
+
}));
|
|
45
65
|
};
|
|
66
|
+
exports.ButtonGroup = ButtonGroup;
|
|
46
67
|
ButtonGroup.Item = function (_a) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
68
|
+
var _b;
|
|
69
|
+
var _c = _a.as,
|
|
70
|
+
as = _c === void 0 ? 'button' : _c,
|
|
71
|
+
label = _a.label,
|
|
72
|
+
onlyIcon = _a.onlyIcon,
|
|
73
|
+
icon = _a.icon,
|
|
74
|
+
disabled = _a.disabled,
|
|
75
|
+
children = _a.children,
|
|
76
|
+
props = __rest(_a, ["as", "label", "onlyIcon", "icon", "disabled", "children"]);
|
|
77
|
+
var renderIcon = function () {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
if (!icon) return null;
|
|
80
|
+
if (icon.type === 'icon') {
|
|
81
|
+
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
82
|
+
name: icon.name,
|
|
83
|
+
width: svgSize[(_a = icon.size) !== null && _a !== void 0 ? _a : 'md'],
|
|
84
|
+
height: svgSize[(_b = icon.size) !== null && _b !== void 0 ? _b : 'md'],
|
|
85
|
+
color: _color.COLOR[(_c = icon.color) !== null && _c !== void 0 ? _c : 'gray500']
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return icon.children;
|
|
89
|
+
};
|
|
90
|
+
var position = (_b = icon === null || icon === void 0 ? void 0 : icon.position) !== null && _b !== void 0 ? _b : 'leading';
|
|
91
|
+
return /*#__PURE__*/(0, _react.createElement)(as, __assign({
|
|
92
|
+
className: (0, _classnames.default)('ncua-button-group__item', {
|
|
93
|
+
'is-disabled': disabled
|
|
94
|
+
}),
|
|
95
|
+
disabled: disabled
|
|
96
|
+
}, props), (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
97
|
+
children: [position === 'leading' && renderIcon(), !onlyIcon && label, children, position === 'trailing' && renderIcon()]
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Button = require("./Button");
|
|
7
|
+
Object.keys(_Button).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Button[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Button[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _ButtonGroup = require("./ButtonGroup");
|
|
18
|
+
Object.keys(_ButtonGroup).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ButtonGroup[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _ButtonGroup[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|