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