@ncds/ui-admin 0.0.22 → 0.0.23
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/cjs/assets/scripts/index.js +11 -0
- package/dist/cjs/assets/scripts/slider.js +341 -0
- package/dist/cjs/index.js +0 -33
- package/dist/cjs/src/components/button/Button.js +15 -7
- package/dist/cjs/src/components/button/ButtonGroup.js +1 -1
- package/dist/cjs/src/components/date-picker/index.js +0 -11
- package/dist/cjs/src/components/divider/Divider.js +43 -0
- package/dist/cjs/src/components/divider/index.js +16 -0
- package/dist/cjs/src/components/empty-state/EmptyState.js +58 -0
- package/dist/cjs/src/components/empty-state/index.js +16 -0
- package/dist/cjs/src/components/featured-icon/FeaturedIcon.js +79 -0
- package/dist/cjs/src/components/featured-icon/index.js +16 -0
- package/dist/cjs/src/components/index.js +81 -4
- package/dist/cjs/src/components/modal/Modal.js +193 -0
- package/dist/cjs/src/components/modal/index.js +12 -0
- package/dist/cjs/src/components/notification/FloatingNotification.js +104 -0
- package/dist/cjs/src/components/notification/FullWidthNotification.js +112 -0
- package/dist/cjs/src/components/notification/Notification.js +66 -0
- package/dist/cjs/src/components/notification/index.js +38 -0
- package/dist/cjs/src/components/pagination/NavButton.js +6 -4
- package/dist/cjs/src/components/pagination/Pagination.js +4 -19
- package/dist/cjs/src/components/progress-bar/ProgressBar.js +57 -0
- package/dist/cjs/src/components/progress-bar/index.js +16 -0
- package/dist/cjs/src/components/progress-circle/ProgressCircle.js +121 -0
- package/dist/cjs/src/components/progress-circle/index.js +16 -0
- package/dist/cjs/src/components/slider/Slider.js +64 -0
- package/dist/cjs/src/components/slider/index.js +16 -0
- package/dist/cjs/src/components/tab/HorizontalTab.js +77 -0
- package/dist/cjs/src/components/tab/TabButton.js +76 -0
- package/dist/cjs/src/components/tab/VerticalTab.js +75 -0
- package/dist/cjs/src/components/tab/index.js +38 -0
- package/dist/esm/assets/scripts/index.js +2 -1
- package/dist/esm/assets/scripts/slider.js +336 -0
- package/dist/esm/index.js +0 -3
- package/dist/esm/src/components/button/Button.js +14 -6
- package/dist/esm/src/components/button/ButtonGroup.js +1 -1
- package/dist/esm/src/components/date-picker/index.js +1 -2
- package/dist/esm/src/components/divider/Divider.js +36 -0
- package/dist/esm/src/components/divider/index.js +1 -0
- package/dist/esm/src/components/empty-state/EmptyState.js +51 -0
- package/dist/esm/src/components/empty-state/index.js +1 -0
- package/dist/esm/src/components/featured-icon/FeaturedIcon.js +72 -0
- package/dist/esm/src/components/featured-icon/index.js +1 -0
- package/dist/esm/src/components/index.js +8 -1
- package/dist/esm/src/components/modal/Modal.js +185 -0
- package/dist/esm/src/components/modal/index.js +1 -0
- package/dist/esm/src/components/notification/FloatingNotification.js +97 -0
- package/dist/esm/src/components/notification/FullWidthNotification.js +105 -0
- package/dist/esm/src/components/notification/Notification.js +59 -0
- package/dist/esm/src/components/notification/index.js +3 -0
- package/dist/esm/src/components/pagination/NavButton.js +6 -4
- package/dist/esm/src/components/pagination/Pagination.js +4 -19
- package/dist/esm/src/components/progress-bar/ProgressBar.js +50 -0
- package/dist/esm/src/components/progress-bar/index.js +1 -0
- package/dist/esm/src/components/progress-circle/ProgressCircle.js +114 -0
- package/dist/esm/src/components/progress-circle/index.js +1 -0
- package/dist/esm/src/components/slider/Slider.js +57 -0
- package/dist/esm/src/components/slider/index.js +1 -0
- package/dist/esm/src/components/tab/HorizontalTab.js +69 -0
- package/dist/esm/src/components/tab/TabButton.js +68 -0
- package/dist/esm/src/components/tab/VerticalTab.js +67 -0
- package/dist/esm/src/components/tab/index.js +3 -0
- package/dist/types/assets/scripts/index.d.ts +1 -0
- package/dist/types/assets/scripts/slider.d.ts +42 -0
- package/dist/types/index.d.ts +0 -3
- package/dist/types/src/components/button/Button.d.ts +2 -1
- package/dist/types/src/components/button/ButtonGroup.d.ts +6 -5
- package/dist/types/src/components/date-picker/index.d.ts +0 -1
- package/dist/types/src/components/divider/Divider.d.ts +11 -0
- package/dist/types/src/components/divider/index.d.ts +2 -0
- package/dist/types/src/components/empty-state/EmptyState.d.ts +14 -0
- package/dist/types/src/components/empty-state/index.d.ts +2 -0
- package/dist/types/src/components/featured-icon/FeaturedIcon.d.ts +14 -0
- package/dist/types/src/components/featured-icon/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts +8 -1
- package/dist/types/src/components/modal/Modal.d.ts +75 -0
- package/dist/types/src/components/modal/index.d.ts +3 -0
- package/dist/types/src/components/notification/FloatingNotification.d.ts +32 -0
- package/dist/types/src/components/notification/FullWidthNotification.d.ts +32 -0
- package/dist/types/src/components/notification/Notification.d.ts +59 -0
- package/dist/types/src/components/notification/index.d.ts +4 -0
- package/dist/types/src/components/pagination/NavButton.d.ts +2 -2
- package/dist/types/src/components/progress-bar/ProgressBar.d.ts +7 -0
- package/dist/types/src/components/progress-bar/index.d.ts +2 -0
- package/dist/types/src/components/progress-circle/ProgressCircle.d.ts +8 -0
- package/dist/types/src/components/progress-circle/index.d.ts +2 -0
- package/dist/types/src/components/slider/Slider.d.ts +15 -0
- package/dist/types/src/components/slider/index.d.ts +2 -0
- package/dist/types/src/components/tab/HorizontalTab.d.ts +12 -0
- package/dist/types/src/components/tab/TabButton.d.ts +26 -0
- package/dist/types/src/components/tab/VerticalTab.d.ts +10 -0
- package/dist/types/src/components/tab/index.d.ts +4 -0
- package/dist/ui-admin/assets/styles/style.css +1249 -97
- package/package.json +1 -1
|
@@ -13,4 +13,15 @@ Object.keys(_test).forEach(function (key) {
|
|
|
13
13
|
return _test[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _slider = require("./slider");
|
|
18
|
+
Object.keys(_slider).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _slider[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _slider[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
16
27
|
});
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Slider = void 0;
|
|
7
|
+
var Slider = exports.Slider = /** @class */function () {
|
|
8
|
+
function Slider(element, options) {
|
|
9
|
+
var _this = this;
|
|
10
|
+
this.activeHandle = null;
|
|
11
|
+
this.isDragging = false;
|
|
12
|
+
this.handleElements = [];
|
|
13
|
+
this.progressElement = null;
|
|
14
|
+
this.trackElement = null;
|
|
15
|
+
this.handleMouseDown = function (e) {
|
|
16
|
+
var targetElement = e.target;
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
_this.handleInteractionStart(e.clientX, targetElement);
|
|
19
|
+
if (_this.isDragging) {
|
|
20
|
+
// 드래그 이벤트 추가
|
|
21
|
+
document.addEventListener('mousemove', _this.handleMouseMove);
|
|
22
|
+
document.addEventListener('mouseup', _this.handleMouseUp);
|
|
23
|
+
// 텍스트 선택 방지
|
|
24
|
+
document.body.style.userSelect = 'none';
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
this.handleTouchStart = function (e) {
|
|
28
|
+
if (e.touches.length > 0) {
|
|
29
|
+
var targetElement = e.target;
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
_this.handleInteractionStart(e.touches[0].clientX, targetElement);
|
|
32
|
+
if (_this.isDragging) {
|
|
33
|
+
// 드래그 이벤트 추가
|
|
34
|
+
document.addEventListener('touchmove', _this.handleTouchMove, {
|
|
35
|
+
passive: false
|
|
36
|
+
});
|
|
37
|
+
document.addEventListener('touchend', _this.handleTouchEnd);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
this.handleMouseMove = function (e) {
|
|
42
|
+
if (_this.isDragging) {
|
|
43
|
+
_this.updateValueFromClientX(e.clientX);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
this.handleTouchMove = function (e) {
|
|
47
|
+
if (_this.isDragging && e.touches.length > 0) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
_this.updateValueFromClientX(e.touches[0].clientX);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
this.handleMouseUp = function () {
|
|
53
|
+
_this.isDragging = false;
|
|
54
|
+
document.body.style.userSelect = '';
|
|
55
|
+
document.removeEventListener('mousemove', _this.handleMouseMove);
|
|
56
|
+
document.removeEventListener('mouseup', _this.handleMouseUp);
|
|
57
|
+
};
|
|
58
|
+
this.handleTouchEnd = function () {
|
|
59
|
+
_this.isDragging = false;
|
|
60
|
+
document.removeEventListener('touchmove', _this.handleTouchMove);
|
|
61
|
+
document.removeEventListener('touchend', _this.handleTouchEnd);
|
|
62
|
+
};
|
|
63
|
+
this.element = element;
|
|
64
|
+
this.options = Object.assign({
|
|
65
|
+
min: 0,
|
|
66
|
+
max: 100,
|
|
67
|
+
step: 1,
|
|
68
|
+
value: 0,
|
|
69
|
+
disabled: false
|
|
70
|
+
}, options);
|
|
71
|
+
this.value = this.options.value;
|
|
72
|
+
this.options.min = Number(this.options.min);
|
|
73
|
+
this.options.max = Number(this.options.max);
|
|
74
|
+
this.options.step = Number(this.options.step);
|
|
75
|
+
this.init();
|
|
76
|
+
}
|
|
77
|
+
Slider.prototype.init = function () {
|
|
78
|
+
if (this.options.disabled) {
|
|
79
|
+
this.element.style.opacity = '0.5';
|
|
80
|
+
}
|
|
81
|
+
// 기존 내용 제거
|
|
82
|
+
this.element.innerHTML = '';
|
|
83
|
+
// Track 생성
|
|
84
|
+
this.trackElement = document.createElement('div');
|
|
85
|
+
this.trackElement.className = 'ncua-slider__track';
|
|
86
|
+
this.element.appendChild(this.trackElement);
|
|
87
|
+
// Progress 생성
|
|
88
|
+
this.progressElement = document.createElement('div');
|
|
89
|
+
this.progressElement.className = 'ncua-slider__progress';
|
|
90
|
+
this.element.appendChild(this.progressElement);
|
|
91
|
+
// Handle(s) 생성
|
|
92
|
+
if (Array.isArray(this.value)) {
|
|
93
|
+
// Range slider (2 handles)
|
|
94
|
+
var _a = this.value,
|
|
95
|
+
leftValue = _a[0],
|
|
96
|
+
rightValue = _a[1];
|
|
97
|
+
this.createHandle(0, leftValue);
|
|
98
|
+
this.createHandle(1, rightValue);
|
|
99
|
+
} else {
|
|
100
|
+
// Single slider (1 handle)
|
|
101
|
+
this.createHandle(0, this.value);
|
|
102
|
+
}
|
|
103
|
+
// 이벤트 리스너 추가
|
|
104
|
+
if (!this.options.disabled) {
|
|
105
|
+
this.element.addEventListener('mousedown', this.handleMouseDown);
|
|
106
|
+
this.element.addEventListener('touchstart', this.handleTouchStart, {
|
|
107
|
+
passive: false
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// 초기 위치 설정
|
|
111
|
+
this.updateHandlePositions();
|
|
112
|
+
};
|
|
113
|
+
Slider.prototype.createHandle = function (index, value) {
|
|
114
|
+
var _this = this;
|
|
115
|
+
var handle = document.createElement('div');
|
|
116
|
+
handle.className = 'ncua-slider__handle';
|
|
117
|
+
handle.setAttribute('role', 'slider');
|
|
118
|
+
handle.setAttribute('tabindex', this.options.disabled ? '-1' : '0');
|
|
119
|
+
handle.setAttribute('aria-valuemin', Array.isArray(this.value) && index === 1 ? String(this.value[0]) : String(this.options.min));
|
|
120
|
+
handle.setAttribute('aria-valuemax', Array.isArray(this.value) && index === 0 ? String(this.value[1]) : String(this.options.max));
|
|
121
|
+
handle.setAttribute('aria-valuenow', String(value));
|
|
122
|
+
handle.setAttribute('aria-disabled', String(this.options.disabled));
|
|
123
|
+
handle.dataset.index = String(index);
|
|
124
|
+
handle.addEventListener('focus', function () {
|
|
125
|
+
_this.activeHandle = index;
|
|
126
|
+
_this.updateHandleClasses();
|
|
127
|
+
});
|
|
128
|
+
handle.addEventListener('blur', function () {
|
|
129
|
+
_this.activeHandle = null;
|
|
130
|
+
_this.updateHandleClasses();
|
|
131
|
+
});
|
|
132
|
+
if (this.options.labelPosition === 'bottom') {
|
|
133
|
+
var label = document.createElement('div');
|
|
134
|
+
label.className = "ncua-slider__label";
|
|
135
|
+
label.textContent = "".concat(value, "%");
|
|
136
|
+
handle.appendChild(label);
|
|
137
|
+
}
|
|
138
|
+
if (this.options.labelPosition === 'top-floating') {
|
|
139
|
+
var label = document.createElement('div');
|
|
140
|
+
label.className = "ncua-slider__label ncua-slider__label--tooltip";
|
|
141
|
+
label.textContent = "".concat(value, "%");
|
|
142
|
+
handle.appendChild(label);
|
|
143
|
+
}
|
|
144
|
+
this.element.appendChild(handle);
|
|
145
|
+
this.handleElements[index] = handle;
|
|
146
|
+
};
|
|
147
|
+
Slider.prototype.updateHandlePositions = function () {
|
|
148
|
+
if (Array.isArray(this.value)) {
|
|
149
|
+
// Range slider
|
|
150
|
+
var _a = this.value,
|
|
151
|
+
leftValue = _a[0],
|
|
152
|
+
rightValue = _a[1];
|
|
153
|
+
var leftPosition = this.getPositionFromValue(leftValue);
|
|
154
|
+
var rightPosition = this.getPositionFromValue(rightValue);
|
|
155
|
+
this.handleElements[0].style.left = "".concat(leftPosition, "%");
|
|
156
|
+
this.handleElements[1].style.left = "".concat(rightPosition, "%");
|
|
157
|
+
if (this.options.labelPosition) {
|
|
158
|
+
var leftLabel = this.handleElements[0].querySelector('.ncua-slider__label');
|
|
159
|
+
var rightLabel = this.handleElements[1].querySelector('.ncua-slider__label');
|
|
160
|
+
if (leftLabel) leftLabel.textContent = "".concat(leftValue, "%");
|
|
161
|
+
if (rightLabel) rightLabel.textContent = "".concat(rightValue, "%");
|
|
162
|
+
}
|
|
163
|
+
if (this.progressElement) {
|
|
164
|
+
this.progressElement.style.left = "".concat(leftPosition, "%");
|
|
165
|
+
this.progressElement.style.width = "".concat(rightPosition - leftPosition, "%");
|
|
166
|
+
}
|
|
167
|
+
} else {
|
|
168
|
+
// Single slider
|
|
169
|
+
var position = this.getPositionFromValue(this.value);
|
|
170
|
+
this.handleElements[0].style.left = "".concat(position, "%");
|
|
171
|
+
if (this.options.labelPosition) {
|
|
172
|
+
var label = this.handleElements[0].querySelector('.ncua-slider__label');
|
|
173
|
+
if (label) label.textContent = "".concat(this.value, "%");
|
|
174
|
+
}
|
|
175
|
+
if (this.progressElement) {
|
|
176
|
+
this.progressElement.style.left = '0';
|
|
177
|
+
this.progressElement.style.width = "".concat(position, "%");
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// ARIA 속성 업데이트
|
|
181
|
+
this.updateAriaAttributes();
|
|
182
|
+
};
|
|
183
|
+
Slider.prototype.updateHandleClasses = function () {
|
|
184
|
+
var _this = this;
|
|
185
|
+
this.handleElements.forEach(function (handle, index) {
|
|
186
|
+
if (index === _this.activeHandle) {
|
|
187
|
+
handle.classList.add('is-active');
|
|
188
|
+
} else {
|
|
189
|
+
handle.classList.remove('is-active');
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
Slider.prototype.updateAriaAttributes = function () {
|
|
194
|
+
if (Array.isArray(this.value)) {
|
|
195
|
+
// Range slider
|
|
196
|
+
var _a = this.value,
|
|
197
|
+
leftValue = _a[0],
|
|
198
|
+
rightValue = _a[1];
|
|
199
|
+
this.handleElements[0].setAttribute('aria-valuenow', String(leftValue));
|
|
200
|
+
this.handleElements[0].setAttribute('aria-valuemax', String(rightValue));
|
|
201
|
+
this.handleElements[1].setAttribute('aria-valuenow', String(rightValue));
|
|
202
|
+
this.handleElements[1].setAttribute('aria-valuemin', String(leftValue));
|
|
203
|
+
} else {
|
|
204
|
+
// Single slider
|
|
205
|
+
this.handleElements[0].setAttribute('aria-valuenow', String(this.value));
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
Slider.prototype.getPositionFromValue = function (value) {
|
|
209
|
+
return (value - this.options.min) / (this.options.max - this.options.min) * 100;
|
|
210
|
+
};
|
|
211
|
+
Slider.prototype.getValueFromPosition = function (position) {
|
|
212
|
+
var percentage = Math.min(Math.max(position, 0), 100);
|
|
213
|
+
var exactValue = this.options.min + percentage / 100 * (this.options.max - this.options.min);
|
|
214
|
+
var steppedValue = Math.round(exactValue / this.options.step) * this.options.step;
|
|
215
|
+
return Math.min(Math.max(steppedValue, this.options.min), this.options.max);
|
|
216
|
+
};
|
|
217
|
+
Slider.prototype.handleInteractionStart = function (clientX, target) {
|
|
218
|
+
// 슬라이더 영역 내부를 클릭/터치한 경우
|
|
219
|
+
if (target.closest('.ncua-slider')) {
|
|
220
|
+
// 핸들을 직접 클릭/터치했는지 확인
|
|
221
|
+
var handleElement = target.closest('.ncua-slider__handle');
|
|
222
|
+
if (handleElement) {
|
|
223
|
+
if (Array.isArray(this.value) && this.value[0] === this.value[1] && this.value[0] === this.options.max) {
|
|
224
|
+
this.activeHandle = 0;
|
|
225
|
+
} else if (Array.isArray(this.value) && this.value[0] === this.value[1] && this.value[0] === this.options.min) {
|
|
226
|
+
this.activeHandle = 1;
|
|
227
|
+
} else {
|
|
228
|
+
this.activeHandle = parseInt(handleElement.dataset.index || '0', 10);
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
// 슬라이더 트랙을 클릭/터치한 경우, 가장 가까운 핸들을 결정
|
|
232
|
+
var rect = this.element.getBoundingClientRect();
|
|
233
|
+
var position = (clientX - rect.left) / rect.width * 100;
|
|
234
|
+
if (Array.isArray(this.value)) {
|
|
235
|
+
var _a = this.value,
|
|
236
|
+
leftValue = _a[0],
|
|
237
|
+
rightValue = _a[1];
|
|
238
|
+
var leftPosition = this.getPositionFromValue(leftValue);
|
|
239
|
+
var rightPosition = this.getPositionFromValue(rightValue);
|
|
240
|
+
if (position < leftPosition) {
|
|
241
|
+
this.activeHandle = 0;
|
|
242
|
+
} else if (position > rightPosition) {
|
|
243
|
+
this.activeHandle = 1;
|
|
244
|
+
} else {
|
|
245
|
+
this.activeHandle = Math.abs(position - leftPosition) < Math.abs(position - rightPosition) ? 0 : 1;
|
|
246
|
+
}
|
|
247
|
+
} else {
|
|
248
|
+
this.activeHandle = 0;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
this.updateHandleClasses();
|
|
252
|
+
this.isDragging = true;
|
|
253
|
+
// 클릭/터치 위치로 값 업데이트
|
|
254
|
+
this.updateValueFromClientX(clientX);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
Slider.prototype.updateValueFromClientX = function (clientX) {
|
|
258
|
+
if (!this.element || this.activeHandle === null) return;
|
|
259
|
+
var rect = this.element.getBoundingClientRect();
|
|
260
|
+
var position = (clientX - rect.left) / rect.width * 100;
|
|
261
|
+
var newValue = this.getValueFromPosition(position);
|
|
262
|
+
var prevValue = this.value;
|
|
263
|
+
if (Array.isArray(this.value)) {
|
|
264
|
+
// Range slider
|
|
265
|
+
var _a = this.value,
|
|
266
|
+
leftValue = _a[0],
|
|
267
|
+
rightValue = _a[1];
|
|
268
|
+
if (this.activeHandle === 0) {
|
|
269
|
+
// 왼쪽 핸들
|
|
270
|
+
this.value = [Math.min(newValue, rightValue), rightValue];
|
|
271
|
+
} else if (this.activeHandle === 1) {
|
|
272
|
+
// 오른쪽 핸들
|
|
273
|
+
this.value = [leftValue, Math.max(newValue, leftValue)];
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
// Single slider
|
|
277
|
+
this.value = newValue;
|
|
278
|
+
}
|
|
279
|
+
this.notifyChange(prevValue);
|
|
280
|
+
this.updateHandlePositions();
|
|
281
|
+
};
|
|
282
|
+
Slider.prototype.notifyChange = function (prevValue) {
|
|
283
|
+
var _this = this;
|
|
284
|
+
var isSingle = !Array.isArray(prevValue);
|
|
285
|
+
var checkChangedSingle = function () {
|
|
286
|
+
return prevValue !== _this.value;
|
|
287
|
+
};
|
|
288
|
+
var checkChangedRange = function () {
|
|
289
|
+
return Array.isArray(prevValue) && Array.isArray(_this.value) && (prevValue[0] !== _this.value[0] || prevValue[1] !== _this.value[1]);
|
|
290
|
+
};
|
|
291
|
+
var isChanged = isSingle ? checkChangedSingle() : checkChangedRange();
|
|
292
|
+
if (this.options.onChange && isChanged) {
|
|
293
|
+
this.options.onChange(this.value);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
Slider.prototype.setValue = function (value) {
|
|
297
|
+
this.value = value;
|
|
298
|
+
this.updateHandlePositions();
|
|
299
|
+
};
|
|
300
|
+
Slider.prototype.getValue = function () {
|
|
301
|
+
return this.value;
|
|
302
|
+
};
|
|
303
|
+
Slider.prototype.disable = function () {
|
|
304
|
+
this.options.disabled = true;
|
|
305
|
+
this.element.style.opacity = '0.5';
|
|
306
|
+
this.handleElements.forEach(function (handle) {
|
|
307
|
+
handle.setAttribute('tabindex', '-1');
|
|
308
|
+
handle.setAttribute('aria-disabled', 'true');
|
|
309
|
+
});
|
|
310
|
+
this.element.removeEventListener('mousedown', this.handleMouseDown);
|
|
311
|
+
this.element.removeEventListener('touchstart', this.handleTouchStart);
|
|
312
|
+
};
|
|
313
|
+
Slider.prototype.enable = function () {
|
|
314
|
+
this.options.disabled = false;
|
|
315
|
+
this.element.style.opacity = '1';
|
|
316
|
+
this.handleElements.forEach(function (handle) {
|
|
317
|
+
handle.setAttribute('tabindex', '0');
|
|
318
|
+
handle.setAttribute('aria-disabled', 'false');
|
|
319
|
+
});
|
|
320
|
+
this.element.addEventListener('mousedown', this.handleMouseDown);
|
|
321
|
+
this.element.addEventListener('touchstart', this.handleTouchStart, {
|
|
322
|
+
passive: false
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
Slider.prototype.destroy = function () {
|
|
326
|
+
// 모든 이벤트 리스너 제거
|
|
327
|
+
this.element.removeEventListener('mousedown', this.handleMouseDown);
|
|
328
|
+
this.element.removeEventListener('touchstart', this.handleTouchStart);
|
|
329
|
+
document.removeEventListener('mousemove', this.handleMouseMove);
|
|
330
|
+
document.removeEventListener('mouseup', this.handleMouseUp);
|
|
331
|
+
document.removeEventListener('touchmove', this.handleTouchMove);
|
|
332
|
+
document.removeEventListener('touchend', this.handleTouchEnd);
|
|
333
|
+
// 모든 내용 제거
|
|
334
|
+
this.element.innerHTML = '';
|
|
335
|
+
// 참조 정리
|
|
336
|
+
this.handleElements = [];
|
|
337
|
+
this.progressElement = null;
|
|
338
|
+
this.trackElement = null;
|
|
339
|
+
};
|
|
340
|
+
return Slider;
|
|
341
|
+
}();
|
package/dist/cjs/index.js
CHANGED
|
@@ -14,17 +14,6 @@ Object.keys(_badge).forEach(function (key) {
|
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var _breadcrumb = require("./src/components/breadcrumb");
|
|
18
|
-
Object.keys(_breadcrumb).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _breadcrumb[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _breadcrumb[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
17
|
var _button = require("./src/components/button");
|
|
29
18
|
Object.keys(_button).forEach(function (key) {
|
|
30
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -69,17 +58,6 @@ Object.keys(_datePicker).forEach(function (key) {
|
|
|
69
58
|
}
|
|
70
59
|
});
|
|
71
60
|
});
|
|
72
|
-
var _dropdown = require("./src/components/dropdown");
|
|
73
|
-
Object.keys(_dropdown).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _dropdown[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _dropdown[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
61
|
var _input = require("./src/components/input");
|
|
84
62
|
Object.keys(_input).forEach(function (key) {
|
|
85
63
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -168,17 +146,6 @@ Object.keys(_spinner).forEach(function (key) {
|
|
|
168
146
|
}
|
|
169
147
|
});
|
|
170
148
|
});
|
|
171
|
-
var _tag = require("./src/components/tag");
|
|
172
|
-
Object.keys(_tag).forEach(function (key) {
|
|
173
|
-
if (key === "default" || key === "__esModule") return;
|
|
174
|
-
if (key in exports && exports[key] === _tag[key]) return;
|
|
175
|
-
Object.defineProperty(exports, key, {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
get: function () {
|
|
178
|
-
return _tag[key];
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
});
|
|
182
149
|
var _toggle = require("./src/components/toggle");
|
|
183
150
|
Object.keys(_toggle).forEach(function (key) {
|
|
184
151
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.svgSize = exports.Button = void 0;
|
|
6
|
+
exports.svgSize = exports.iconOnlySvgSize = exports.Button = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
var _react = require("react");
|
|
@@ -29,10 +29,16 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
29
29
|
return t;
|
|
30
30
|
};
|
|
31
31
|
var svgSize = exports.svgSize = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
xxs: 12,
|
|
33
|
+
xs: 14,
|
|
34
|
+
sm: 16,
|
|
35
|
+
md: 20
|
|
36
|
+
};
|
|
37
|
+
var iconOnlySvgSize = exports.iconOnlySvgSize = {
|
|
38
|
+
xxs: 14,
|
|
39
|
+
xs: 16,
|
|
40
|
+
sm: 20,
|
|
41
|
+
md: 20
|
|
36
42
|
};
|
|
37
43
|
var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
38
44
|
// NOTE: 엘리먼트 종류에 따라 props의 타입이 달라지므로 분리
|
|
@@ -72,11 +78,13 @@ var Button = exports.Button = /*#__PURE__*/(0, _react.forwardRef)(function (prop
|
|
|
72
78
|
}
|
|
73
79
|
};
|
|
74
80
|
var sideSlotRender = function (slot) {
|
|
81
|
+
var _a, _b;
|
|
75
82
|
if (slot.type === 'icon') {
|
|
83
|
+
var iconSize = onlyIcon ? iconOnlySvgSize[size] : svgSize[size];
|
|
76
84
|
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
77
85
|
name: slot.icon,
|
|
78
|
-
height:
|
|
79
|
-
width:
|
|
86
|
+
height: (_a = slot.size) !== null && _a !== void 0 ? _a : iconSize,
|
|
87
|
+
width: (_b = slot.size) !== null && _b !== void 0 ? _b : iconSize,
|
|
80
88
|
color: slot.color ? _color.COLOR[slot.color] : undefined
|
|
81
89
|
});
|
|
82
90
|
}
|
|
@@ -79,7 +79,7 @@ ButtonGroup.Item = function (_a) {
|
|
|
79
79
|
if (!icon) return null;
|
|
80
80
|
if (icon.type === 'icon') {
|
|
81
81
|
return (0, _jsxRuntime.jsx)(_uiAdminIcon.default, {
|
|
82
|
-
name: icon.
|
|
82
|
+
name: icon.icon,
|
|
83
83
|
width: svgSize[(_a = icon.size) !== null && _a !== void 0 ? _a : 'md'],
|
|
84
84
|
height: svgSize[(_b = icon.size) !== null && _b !== void 0 ? _b : 'md'],
|
|
85
85
|
color: _color.COLOR[(_c = icon.color) !== null && _c !== void 0 ? _c : 'gray500']
|
|
@@ -24,15 +24,4 @@ Object.keys(_RangeDatePicker).forEach(function (key) {
|
|
|
24
24
|
return _RangeDatePicker[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
});
|
|
28
|
-
var _utils = require("./utils");
|
|
29
|
-
Object.keys(_utils).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _utils[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _utils[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
27
|
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Divider = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
12
|
+
__assign = Object.assign || function (t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
var Divider = exports.Divider = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
22
|
+
var className = _a.className,
|
|
23
|
+
type = _a.type,
|
|
24
|
+
_b = _a.style,
|
|
25
|
+
style = _b === void 0 ? 'single-line' : _b,
|
|
26
|
+
children = _a.children;
|
|
27
|
+
var componentClassName = (0, _classnames.default)('ncua-divider', "ncua-divider--".concat(type), "ncua-divider--".concat(style), className);
|
|
28
|
+
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
29
|
+
className: componentClassName,
|
|
30
|
+
ref: ref
|
|
31
|
+
}, {
|
|
32
|
+
children: [style === 'single-line' && (0, _jsxRuntime.jsx)("div", {
|
|
33
|
+
className: "ncua-divider__line"
|
|
34
|
+
}), (0, _jsxRuntime.jsx)("div", __assign({
|
|
35
|
+
className: "ncua-divider__content"
|
|
36
|
+
}, {
|
|
37
|
+
children: children
|
|
38
|
+
})), style === 'single-line' && (0, _jsxRuntime.jsx)("div", {
|
|
39
|
+
className: "ncua-divider__line"
|
|
40
|
+
})]
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
Divider.displayName = 'Divider';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Divider = require("./Divider");
|
|
7
|
+
Object.keys(_Divider).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Divider[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Divider[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EmptyState = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _Button = require("../button/Button");
|
|
9
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
10
|
+
__assign = Object.assign || function (t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
return __assign.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
20
|
+
var t = {};
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
22
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
var EmptyState = function (_a) {
|
|
28
|
+
var title = _a.title,
|
|
29
|
+
description = _a.description,
|
|
30
|
+
buttons = _a.buttons;
|
|
31
|
+
var emptyStateButtons = buttons ? Array.isArray(buttons) ? buttons : [buttons] : [];
|
|
32
|
+
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
33
|
+
className: "ncua-empty-state"
|
|
34
|
+
}, {
|
|
35
|
+
children: [(0, _jsxRuntime.jsx)("p", __assign({
|
|
36
|
+
className: "ncua-empty-state__title"
|
|
37
|
+
}, {
|
|
38
|
+
children: title
|
|
39
|
+
})), (0, _jsxRuntime.jsx)("span", __assign({
|
|
40
|
+
className: "ncua-empty-state__description"
|
|
41
|
+
}, {
|
|
42
|
+
children: description
|
|
43
|
+
})), emptyStateButtons.length > 0 && (0, _jsxRuntime.jsx)("div", __assign({
|
|
44
|
+
className: "ncua-empty-state__button-group"
|
|
45
|
+
}, {
|
|
46
|
+
children: emptyStateButtons.map(function (_a) {
|
|
47
|
+
var size = _a.size,
|
|
48
|
+
label = _a.label,
|
|
49
|
+
rest = __rest(_a, ["size", "label"]);
|
|
50
|
+
return (0, _jsxRuntime.jsx)(_Button.Button, __assign({
|
|
51
|
+
size: size !== null && size !== void 0 ? size : 'xs',
|
|
52
|
+
label: label
|
|
53
|
+
}, rest), label);
|
|
54
|
+
})
|
|
55
|
+
}))]
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
exports.EmptyState = EmptyState;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _EmptyState = require("./EmptyState");
|
|
7
|
+
Object.keys(_EmptyState).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _EmptyState[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _EmptyState[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|