@ncds/ui-admin 0.0.15 → 0.0.17
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/ui-admin/index.js +154 -0
- package/dist/cjs/ui-admin/src/components/button/index.js +11 -0
- package/dist/cjs/ui-admin/src/components/carousel/index.js +8 -8
- package/dist/cjs/ui-admin/src/components/date-picker/RangeDatePicker.js +118 -0
- package/dist/cjs/ui-admin/src/components/date-picker/index.js +38 -0
- package/dist/cjs/ui-admin/src/components/date-picker/utils.js +18 -0
- package/dist/cjs/ui-admin/src/components/index.js +75 -20
- package/dist/cjs/ui-admin/src/components/input/index.js +38 -0
- package/dist/cjs/ui-admin/src/components/pagination/index.js +11 -0
- package/dist/cjs/ui-admin/src/components/shared/hintText/index.js +16 -0
- package/dist/cjs/ui-admin/src/components/shared/index.js +27 -0
- package/dist/cjs/ui-admin/src/components/shared/label/index.js +16 -0
- package/dist/cjs/ui-admin/src/components/spinner/index.js +27 -0
- package/dist/esm/ui-admin/index.js +14 -0
- package/dist/esm/ui-admin/src/components/button/index.js +2 -1
- package/dist/esm/ui-admin/src/components/carousel/index.js +2 -2
- package/dist/esm/ui-admin/src/components/date-picker/RangeDatePicker.js +110 -0
- package/dist/esm/ui-admin/src/components/date-picker/index.js +3 -0
- package/dist/esm/ui-admin/src/components/date-picker/utils.js +10 -0
- package/dist/esm/ui-admin/src/components/index.js +8 -3
- package/dist/esm/ui-admin/src/components/input/index.js +3 -0
- package/dist/esm/ui-admin/src/components/pagination/index.js +1 -0
- package/dist/esm/ui-admin/src/components/shared/hintText/index.js +1 -0
- package/dist/esm/ui-admin/src/components/shared/index.js +2 -0
- package/dist/esm/ui-admin/src/components/shared/label/index.js +1 -0
- package/dist/esm/ui-admin/src/components/spinner/index.js +2 -0
- package/dist/types/ui-admin/index.d.ts +14 -0
- package/dist/types/ui-admin/src/components/button/ButtonGroup.d.ts +1 -1
- package/dist/types/ui-admin/src/components/button/index.d.ts +1 -0
- package/dist/types/ui-admin/src/components/carousel/index.d.ts +1 -1
- package/dist/types/ui-admin/src/components/date-picker/RangeDatePicker.d.ts +24 -0
- package/dist/types/ui-admin/src/components/date-picker/index.d.ts +4 -0
- package/dist/types/ui-admin/src/components/date-picker/utils.d.ts +3 -0
- package/dist/types/ui-admin/src/components/index.d.ts +7 -2
- package/dist/types/ui-admin/src/components/input/index.d.ts +4 -0
- package/dist/types/ui-admin/src/components/pagination/index.d.ts +1 -0
- package/dist/types/ui-admin/src/components/shared/hintText/index.d.ts +2 -0
- package/dist/types/ui-admin/src/components/shared/index.d.ts +3 -0
- package/dist/types/ui-admin/src/components/shared/label/index.d.ts +2 -0
- package/dist/types/ui-admin/src/components/spinner/index.d.ts +3 -0
- package/dist/ui-admin/assets/styles/style.css +7 -0
- package/package.json +1 -1
- package/dist/cjs/ui-admin/src/components/input/FileInput.js +0 -1
- package/dist/esm/ui-admin/src/components/input/FileInput.js +0 -1
- package/dist/types/ui-admin/src/components/input/FileInput.d.ts +0 -1
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _badge = require("./src/components/badge");
|
|
7
|
+
Object.keys(_badge).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _badge[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _badge[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
6
17
|
var _button = require("./src/components/button");
|
|
7
18
|
Object.keys(_button).forEach(function (key) {
|
|
8
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -14,6 +25,127 @@ Object.keys(_button).forEach(function (key) {
|
|
|
14
25
|
}
|
|
15
26
|
});
|
|
16
27
|
});
|
|
28
|
+
var _carousel = require("./src/components/carousel");
|
|
29
|
+
Object.keys(_carousel).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _carousel[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _carousel[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
var _checkbox = require("./src/components/checkbox");
|
|
40
|
+
Object.keys(_checkbox).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _checkbox[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _checkbox[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _datePicker = require("./src/components/date-picker");
|
|
51
|
+
Object.keys(_datePicker).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _datePicker[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _datePicker[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _input = require("./src/components/input");
|
|
62
|
+
Object.keys(_input).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _input[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _input[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _pagination = require("./src/components/pagination");
|
|
73
|
+
Object.keys(_pagination).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _pagination[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _pagination[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
var _radio = require("./src/components/radio");
|
|
84
|
+
Object.keys(_radio).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _radio[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _radio[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
var _select = require("./src/components/select");
|
|
95
|
+
Object.keys(_select).forEach(function (key) {
|
|
96
|
+
if (key === "default" || key === "__esModule") return;
|
|
97
|
+
if (key in exports && exports[key] === _select[key]) return;
|
|
98
|
+
Object.defineProperty(exports, key, {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () {
|
|
101
|
+
return _select[key];
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
var _hintText = require("./src/components/shared/hintText");
|
|
106
|
+
Object.keys(_hintText).forEach(function (key) {
|
|
107
|
+
if (key === "default" || key === "__esModule") return;
|
|
108
|
+
if (key in exports && exports[key] === _hintText[key]) return;
|
|
109
|
+
Object.defineProperty(exports, key, {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
get: function () {
|
|
112
|
+
return _hintText[key];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
var _label = require("./src/components/shared/label");
|
|
117
|
+
Object.keys(_label).forEach(function (key) {
|
|
118
|
+
if (key === "default" || key === "__esModule") return;
|
|
119
|
+
if (key in exports && exports[key] === _label[key]) return;
|
|
120
|
+
Object.defineProperty(exports, key, {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _label[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
var _shared = require("./src/components/shared");
|
|
128
|
+
Object.keys(_shared).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _shared[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
var _spinner = require("./src/components/spinner");
|
|
139
|
+
Object.keys(_spinner).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _spinner[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _spinner[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
17
149
|
var _svg = require("./src/components/svg");
|
|
18
150
|
Object.keys(_svg).forEach(function (key) {
|
|
19
151
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -25,6 +157,28 @@ Object.keys(_svg).forEach(function (key) {
|
|
|
25
157
|
}
|
|
26
158
|
});
|
|
27
159
|
});
|
|
160
|
+
var _toggle = require("./src/components/toggle");
|
|
161
|
+
Object.keys(_toggle).forEach(function (key) {
|
|
162
|
+
if (key === "default" || key === "__esModule") return;
|
|
163
|
+
if (key in exports && exports[key] === _toggle[key]) return;
|
|
164
|
+
Object.defineProperty(exports, key, {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function () {
|
|
167
|
+
return _toggle[key];
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
var _tooltip = require("./src/components/tooltip");
|
|
172
|
+
Object.keys(_tooltip).forEach(function (key) {
|
|
173
|
+
if (key === "default" || key === "__esModule") return;
|
|
174
|
+
if (key in exports && exports[key] === _tooltip[key]) return;
|
|
175
|
+
Object.defineProperty(exports, key, {
|
|
176
|
+
enumerable: true,
|
|
177
|
+
get: function () {
|
|
178
|
+
return _tooltip[key];
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
});
|
|
28
182
|
var _components = require("./src/components");
|
|
29
183
|
Object.keys(_components).forEach(function (key) {
|
|
30
184
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -13,4 +13,15 @@ Object.keys(_Button).forEach(function (key) {
|
|
|
13
13
|
return _Button[key];
|
|
14
14
|
}
|
|
15
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
|
+
});
|
|
16
27
|
});
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
Object.keys(
|
|
6
|
+
var _CarouselArrow = require("./CarouselArrow");
|
|
7
|
+
Object.keys(_CarouselArrow).forEach(function (key) {
|
|
8
8
|
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] ===
|
|
9
|
+
if (key in exports && exports[key] === _CarouselArrow[key]) return;
|
|
10
10
|
Object.defineProperty(exports, key, {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
get: function () {
|
|
13
|
-
return
|
|
13
|
+
return _CarouselArrow[key];
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
|
-
var
|
|
18
|
-
Object.keys(
|
|
17
|
+
var _CarouselNumberGroup = require("./CarouselNumberGroup");
|
|
18
|
+
Object.keys(_CarouselNumberGroup).forEach(function (key) {
|
|
19
19
|
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _CarouselNumberGroup[key]) return;
|
|
21
21
|
Object.defineProperty(exports, key, {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function () {
|
|
24
|
-
return
|
|
24
|
+
return _CarouselNumberGroup[key];
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RangeDatePicker = void 0;
|
|
7
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _lodash = require("lodash");
|
|
10
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
11
|
+
var _DatePicker = require("./DatePicker");
|
|
12
|
+
var _utils = require("./utils");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
15
|
+
__assign = Object.assign || function (t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
return __assign.apply(this, arguments);
|
|
23
|
+
};
|
|
24
|
+
var RangeDatePicker = function (_a) {
|
|
25
|
+
var startDateOptions = _a.startDateOptions,
|
|
26
|
+
endDateOptions = _a.endDateOptions,
|
|
27
|
+
validationOption = _a.validationOption,
|
|
28
|
+
onDateValidation = _a.onDateValidation;
|
|
29
|
+
var resetDateAndAlert = (0, _react.useCallback)(function (type) {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
var newDate = type === 'start' ? ((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.startDate) || '' : ((_b = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _b === void 0 ? void 0 : _b.endDate) || '';
|
|
32
|
+
if (type === 'start') {
|
|
33
|
+
startDateOptions.onChangeDate(newDate);
|
|
34
|
+
} else {
|
|
35
|
+
endDateOptions.onChangeDate(newDate);
|
|
36
|
+
}
|
|
37
|
+
onDateValidation === null || onDateValidation === void 0 ? void 0 : onDateValidation({
|
|
38
|
+
type: 'end',
|
|
39
|
+
errorType: 'reset',
|
|
40
|
+
newDate: newDate,
|
|
41
|
+
currentDate: type === 'start' ? startDateOptions.currentDate : endDateOptions.currentDate
|
|
42
|
+
});
|
|
43
|
+
}, [startDateOptions, endDateOptions, validationOption, onDateValidation]);
|
|
44
|
+
var changeSettingDateAndAlert = (0, _react.useCallback)(function (type, isOverPeriod) {
|
|
45
|
+
if (isOverPeriod === void 0) {
|
|
46
|
+
isOverPeriod = false;
|
|
47
|
+
}
|
|
48
|
+
var _a = validationOption.setting,
|
|
49
|
+
unit = _a.unit,
|
|
50
|
+
period = _a.period;
|
|
51
|
+
var newDate = '';
|
|
52
|
+
if (type === 'start') {
|
|
53
|
+
newDate = (0, _utils.getDateFormat)((0, _moment.default)(startDateOptions.currentDate).add(period, unit).toDate());
|
|
54
|
+
} else {
|
|
55
|
+
newDate = (0, _utils.getDateFormat)((0, _moment.default)(endDateOptions.currentDate).subtract(period, unit).toDate());
|
|
56
|
+
}
|
|
57
|
+
onDateValidation === null || onDateValidation === void 0 ? void 0 : onDateValidation({
|
|
58
|
+
type: type,
|
|
59
|
+
errorType: isOverPeriod ? 'period' : 'overlap',
|
|
60
|
+
newDate: newDate,
|
|
61
|
+
currentDate: type === 'start' ? startDateOptions.currentDate : endDateOptions.currentDate
|
|
62
|
+
});
|
|
63
|
+
}, [startDateOptions, endDateOptions, validationOption, onDateValidation]);
|
|
64
|
+
var validateDateType = function (date) {
|
|
65
|
+
return !isNaN(Date.parse(date));
|
|
66
|
+
};
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
var _a;
|
|
69
|
+
var needResetDate = validateDateType(startDateOptions.currentDate) && !(0, _lodash.isNil)((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.startDate) && (0, _moment.default)(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
70
|
+
if (needResetDate) {
|
|
71
|
+
resetDateAndAlert('start');
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!(validationOption === null || validationOption === void 0 ? void 0 : validationOption.setting)) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
var isOverDate = (0, _moment.default)(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
78
|
+
var _b = validationOption.setting,
|
|
79
|
+
unit = _b.unit,
|
|
80
|
+
period = _b.period;
|
|
81
|
+
var isValidPeriod = (0, _moment.default)(startDateOptions.currentDate).isSameOrAfter((0, _moment.default)(endDateOptions.currentDate).subtract(period, unit));
|
|
82
|
+
if (isOverDate) {
|
|
83
|
+
changeSettingDateAndAlert('start');
|
|
84
|
+
}
|
|
85
|
+
if (!isValidPeriod) {
|
|
86
|
+
changeSettingDateAndAlert('start', !isValidPeriod);
|
|
87
|
+
}
|
|
88
|
+
}, [startDateOptions.currentDate]);
|
|
89
|
+
(0, _react.useEffect)(function () {
|
|
90
|
+
var _a;
|
|
91
|
+
var needResetDate = validateDateType(endDateOptions.currentDate) && !(0, _lodash.isNil)((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.endDate) && (0, _moment.default)(endDateOptions.currentDate).isBefore(startDateOptions.currentDate);
|
|
92
|
+
if (needResetDate) {
|
|
93
|
+
resetDateAndAlert('end');
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
var isNotTodayEndDate = endDateOptions.currentDate !== (0, _utils.getDateFormat)();
|
|
97
|
+
if (!(validationOption === null || validationOption === void 0 ? void 0 : validationOption.setting) || !isNotTodayEndDate) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
var isOverDate = (0, _moment.default)(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
101
|
+
var _b = validationOption.setting,
|
|
102
|
+
unit = _b.unit,
|
|
103
|
+
period = _b.period;
|
|
104
|
+
var isValidPeriod = (0, _moment.default)(endDateOptions.currentDate).isSameOrBefore((0, _moment.default)(startDateOptions.currentDate).add(period, unit));
|
|
105
|
+
if (isOverDate) {
|
|
106
|
+
changeSettingDateAndAlert('end');
|
|
107
|
+
}
|
|
108
|
+
if (!isValidPeriod) {
|
|
109
|
+
changeSettingDateAndAlert('end', !isValidPeriod);
|
|
110
|
+
}
|
|
111
|
+
}, [endDateOptions.currentDate]);
|
|
112
|
+
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
113
|
+
className: "ncua-range-date-picker"
|
|
114
|
+
}, {
|
|
115
|
+
children: [(0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, startDateOptions)), "-", (0, _jsxRuntime.jsx)(_DatePicker.DatePicker, __assign({}, endDateOptions))]
|
|
116
|
+
}));
|
|
117
|
+
};
|
|
118
|
+
exports.RangeDatePicker = RangeDatePicker;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _DatePicker = require("./DatePicker");
|
|
7
|
+
Object.keys(_DatePicker).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _DatePicker[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _DatePicker[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _RangeDatePicker = require("./RangeDatePicker");
|
|
18
|
+
Object.keys(_RangeDatePicker).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _RangeDatePicker[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _RangeDatePicker[key];
|
|
25
|
+
}
|
|
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
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getDateFormat = getDateFormat;
|
|
7
|
+
exports.getToday = getToday;
|
|
8
|
+
var _moment = _interopRequireDefault(require("moment"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function getToday() {
|
|
11
|
+
return (0, _moment.default)().toDate();
|
|
12
|
+
}
|
|
13
|
+
function getDateFormat(date) {
|
|
14
|
+
if (date === void 0) {
|
|
15
|
+
date = getToday();
|
|
16
|
+
}
|
|
17
|
+
return (0, _moment.default)(date).format('YYYY-MM-DD');
|
|
18
|
+
}
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _badge = require("./badge");
|
|
7
|
+
Object.keys(_badge).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _badge[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _badge[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
6
17
|
var _button = require("./button");
|
|
7
18
|
Object.keys(_button).forEach(function (key) {
|
|
8
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -14,6 +25,17 @@ Object.keys(_button).forEach(function (key) {
|
|
|
14
25
|
}
|
|
15
26
|
});
|
|
16
27
|
});
|
|
28
|
+
var _carousel = require("./carousel");
|
|
29
|
+
Object.keys(_carousel).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _carousel[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _carousel[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
17
39
|
var _checkbox = require("./checkbox");
|
|
18
40
|
Object.keys(_checkbox).forEach(function (key) {
|
|
19
41
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -25,6 +47,39 @@ Object.keys(_checkbox).forEach(function (key) {
|
|
|
25
47
|
}
|
|
26
48
|
});
|
|
27
49
|
});
|
|
50
|
+
var _datePicker = require("./date-picker");
|
|
51
|
+
Object.keys(_datePicker).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _datePicker[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _datePicker[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var _input = require("./input");
|
|
62
|
+
Object.keys(_input).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _input[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function () {
|
|
68
|
+
return _input[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
var _pagination = require("./pagination");
|
|
73
|
+
Object.keys(_pagination).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _pagination[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _pagination[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
});
|
|
28
83
|
var _radio = require("./radio");
|
|
29
84
|
Object.keys(_radio).forEach(function (key) {
|
|
30
85
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -47,58 +102,58 @@ Object.keys(_select).forEach(function (key) {
|
|
|
47
102
|
}
|
|
48
103
|
});
|
|
49
104
|
});
|
|
50
|
-
var
|
|
51
|
-
Object.keys(
|
|
105
|
+
var _shared = require("./shared");
|
|
106
|
+
Object.keys(_shared).forEach(function (key) {
|
|
52
107
|
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] ===
|
|
108
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
|
54
109
|
Object.defineProperty(exports, key, {
|
|
55
110
|
enumerable: true,
|
|
56
111
|
get: function () {
|
|
57
|
-
return
|
|
112
|
+
return _shared[key];
|
|
58
113
|
}
|
|
59
114
|
});
|
|
60
115
|
});
|
|
61
|
-
var
|
|
62
|
-
Object.keys(
|
|
116
|
+
var _spinner = require("./spinner");
|
|
117
|
+
Object.keys(_spinner).forEach(function (key) {
|
|
63
118
|
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] ===
|
|
119
|
+
if (key in exports && exports[key] === _spinner[key]) return;
|
|
65
120
|
Object.defineProperty(exports, key, {
|
|
66
121
|
enumerable: true,
|
|
67
122
|
get: function () {
|
|
68
|
-
return
|
|
123
|
+
return _spinner[key];
|
|
69
124
|
}
|
|
70
125
|
});
|
|
71
126
|
});
|
|
72
|
-
var
|
|
73
|
-
Object.keys(
|
|
127
|
+
var _svg = require("./svg");
|
|
128
|
+
Object.keys(_svg).forEach(function (key) {
|
|
74
129
|
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] ===
|
|
130
|
+
if (key in exports && exports[key] === _svg[key]) return;
|
|
76
131
|
Object.defineProperty(exports, key, {
|
|
77
132
|
enumerable: true,
|
|
78
133
|
get: function () {
|
|
79
|
-
return
|
|
134
|
+
return _svg[key];
|
|
80
135
|
}
|
|
81
136
|
});
|
|
82
137
|
});
|
|
83
|
-
var
|
|
84
|
-
Object.keys(
|
|
138
|
+
var _toggle = require("./toggle");
|
|
139
|
+
Object.keys(_toggle).forEach(function (key) {
|
|
85
140
|
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] ===
|
|
141
|
+
if (key in exports && exports[key] === _toggle[key]) return;
|
|
87
142
|
Object.defineProperty(exports, key, {
|
|
88
143
|
enumerable: true,
|
|
89
144
|
get: function () {
|
|
90
|
-
return
|
|
145
|
+
return _toggle[key];
|
|
91
146
|
}
|
|
92
147
|
});
|
|
93
148
|
});
|
|
94
|
-
var
|
|
95
|
-
Object.keys(
|
|
149
|
+
var _tooltip = require("./tooltip");
|
|
150
|
+
Object.keys(_tooltip).forEach(function (key) {
|
|
96
151
|
if (key === "default" || key === "__esModule") return;
|
|
97
|
-
if (key in exports && exports[key] ===
|
|
152
|
+
if (key in exports && exports[key] === _tooltip[key]) return;
|
|
98
153
|
Object.defineProperty(exports, key, {
|
|
99
154
|
enumerable: true,
|
|
100
155
|
get: function () {
|
|
101
|
-
return
|
|
156
|
+
return _tooltip[key];
|
|
102
157
|
}
|
|
103
158
|
});
|
|
104
159
|
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _InputBase = require("./InputBase");
|
|
7
|
+
Object.keys(_InputBase).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _InputBase[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _InputBase[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _PasswordInput = require("./PasswordInput");
|
|
18
|
+
Object.keys(_PasswordInput).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _PasswordInput[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _PasswordInput[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _Textarea = require("./Textarea");
|
|
29
|
+
Object.keys(_Textarea).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Textarea[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _Textarea[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _NavButton = require("./NavButton");
|
|
7
|
+
Object.keys(_NavButton).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _NavButton[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _NavButton[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
6
17
|
var _Pagination = require("./Pagination");
|
|
7
18
|
Object.keys(_Pagination).forEach(function (key) {
|
|
8
19
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _HintText = require("./HintText");
|
|
7
|
+
Object.keys(_HintText).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _HintText[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _HintText[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _hintText = require("./hintText");
|
|
7
|
+
Object.keys(_hintText).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _hintText[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _hintText[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _label = require("./label");
|
|
18
|
+
Object.keys(_label).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _label[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _label[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Label = require("./Label");
|
|
7
|
+
Object.keys(_Label).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Label[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Label[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Spinner = require("./Spinner");
|
|
7
|
+
Object.keys(_Spinner).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Spinner[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _Spinner[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _index = require("./index");
|
|
18
|
+
Object.keys(_index).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _index[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _index[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
export * from './src/components/badge';
|
|
1
2
|
export * from './src/components/button';
|
|
3
|
+
export * from './src/components/carousel';
|
|
4
|
+
export * from './src/components/checkbox';
|
|
5
|
+
export * from './src/components/date-picker';
|
|
6
|
+
export * from './src/components/input';
|
|
7
|
+
export * from './src/components/pagination';
|
|
8
|
+
export * from './src/components/radio';
|
|
9
|
+
export * from './src/components/select';
|
|
10
|
+
export * from './src/components/shared/hintText';
|
|
11
|
+
export * from './src/components/shared/label';
|
|
12
|
+
export * from './src/components/shared';
|
|
13
|
+
export * from './src/components/spinner';
|
|
2
14
|
export * from './src/components/svg';
|
|
15
|
+
export * from './src/components/toggle';
|
|
16
|
+
export * from './src/components/tooltip';
|
|
3
17
|
export * from './src/components';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './Button';
|
|
1
|
+
export * from './Button';
|
|
2
|
+
export * from './ButtonGroup';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './CarouselArrow';
|
|
2
|
+
export * from './CarouselNumberGroup';
|
|
@@ -0,0 +1,110 @@
|
|
|
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)) t[p] = s[p];
|
|
6
|
+
}
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
return __assign.apply(this, arguments);
|
|
10
|
+
};
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { useCallback, useEffect } from 'react';
|
|
13
|
+
import { isNil } from 'lodash';
|
|
14
|
+
import moment from 'moment';
|
|
15
|
+
import { DatePicker } from './DatePicker';
|
|
16
|
+
import { getDateFormat } from './utils';
|
|
17
|
+
export var RangeDatePicker = function (_a) {
|
|
18
|
+
var startDateOptions = _a.startDateOptions,
|
|
19
|
+
endDateOptions = _a.endDateOptions,
|
|
20
|
+
validationOption = _a.validationOption,
|
|
21
|
+
onDateValidation = _a.onDateValidation;
|
|
22
|
+
var resetDateAndAlert = useCallback(function (type) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
var newDate = type === 'start' ? ((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.startDate) || '' : ((_b = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _b === void 0 ? void 0 : _b.endDate) || '';
|
|
25
|
+
if (type === 'start') {
|
|
26
|
+
startDateOptions.onChangeDate(newDate);
|
|
27
|
+
} else {
|
|
28
|
+
endDateOptions.onChangeDate(newDate);
|
|
29
|
+
}
|
|
30
|
+
onDateValidation === null || onDateValidation === void 0 ? void 0 : onDateValidation({
|
|
31
|
+
type: 'end',
|
|
32
|
+
errorType: 'reset',
|
|
33
|
+
newDate: newDate,
|
|
34
|
+
currentDate: type === 'start' ? startDateOptions.currentDate : endDateOptions.currentDate
|
|
35
|
+
});
|
|
36
|
+
}, [startDateOptions, endDateOptions, validationOption, onDateValidation]);
|
|
37
|
+
var changeSettingDateAndAlert = useCallback(function (type, isOverPeriod) {
|
|
38
|
+
if (isOverPeriod === void 0) {
|
|
39
|
+
isOverPeriod = false;
|
|
40
|
+
}
|
|
41
|
+
var _a = validationOption.setting,
|
|
42
|
+
unit = _a.unit,
|
|
43
|
+
period = _a.period;
|
|
44
|
+
var newDate = '';
|
|
45
|
+
if (type === 'start') {
|
|
46
|
+
newDate = getDateFormat(moment(startDateOptions.currentDate).add(period, unit).toDate());
|
|
47
|
+
} else {
|
|
48
|
+
newDate = getDateFormat(moment(endDateOptions.currentDate).subtract(period, unit).toDate());
|
|
49
|
+
}
|
|
50
|
+
onDateValidation === null || onDateValidation === void 0 ? void 0 : onDateValidation({
|
|
51
|
+
type: type,
|
|
52
|
+
errorType: isOverPeriod ? 'period' : 'overlap',
|
|
53
|
+
newDate: newDate,
|
|
54
|
+
currentDate: type === 'start' ? startDateOptions.currentDate : endDateOptions.currentDate
|
|
55
|
+
});
|
|
56
|
+
}, [startDateOptions, endDateOptions, validationOption, onDateValidation]);
|
|
57
|
+
var validateDateType = function (date) {
|
|
58
|
+
return !isNaN(Date.parse(date));
|
|
59
|
+
};
|
|
60
|
+
useEffect(function () {
|
|
61
|
+
var _a;
|
|
62
|
+
var needResetDate = validateDateType(startDateOptions.currentDate) && !isNil((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.startDate) && moment(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
63
|
+
if (needResetDate) {
|
|
64
|
+
resetDateAndAlert('start');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!(validationOption === null || validationOption === void 0 ? void 0 : validationOption.setting)) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
var isOverDate = moment(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
71
|
+
var _b = validationOption.setting,
|
|
72
|
+
unit = _b.unit,
|
|
73
|
+
period = _b.period;
|
|
74
|
+
var isValidPeriod = moment(startDateOptions.currentDate).isSameOrAfter(moment(endDateOptions.currentDate).subtract(period, unit));
|
|
75
|
+
if (isOverDate) {
|
|
76
|
+
changeSettingDateAndAlert('start');
|
|
77
|
+
}
|
|
78
|
+
if (!isValidPeriod) {
|
|
79
|
+
changeSettingDateAndAlert('start', !isValidPeriod);
|
|
80
|
+
}
|
|
81
|
+
}, [startDateOptions.currentDate]);
|
|
82
|
+
useEffect(function () {
|
|
83
|
+
var _a;
|
|
84
|
+
var needResetDate = validateDateType(endDateOptions.currentDate) && !isNil((_a = validationOption === null || validationOption === void 0 ? void 0 : validationOption.initDate) === null || _a === void 0 ? void 0 : _a.endDate) && moment(endDateOptions.currentDate).isBefore(startDateOptions.currentDate);
|
|
85
|
+
if (needResetDate) {
|
|
86
|
+
resetDateAndAlert('end');
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
var isNotTodayEndDate = endDateOptions.currentDate !== getDateFormat();
|
|
90
|
+
if (!(validationOption === null || validationOption === void 0 ? void 0 : validationOption.setting) || !isNotTodayEndDate) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
var isOverDate = moment(startDateOptions.currentDate).isAfter(endDateOptions.currentDate);
|
|
94
|
+
var _b = validationOption.setting,
|
|
95
|
+
unit = _b.unit,
|
|
96
|
+
period = _b.period;
|
|
97
|
+
var isValidPeriod = moment(endDateOptions.currentDate).isSameOrBefore(moment(startDateOptions.currentDate).add(period, unit));
|
|
98
|
+
if (isOverDate) {
|
|
99
|
+
changeSettingDateAndAlert('end');
|
|
100
|
+
}
|
|
101
|
+
if (!isValidPeriod) {
|
|
102
|
+
changeSettingDateAndAlert('end', !isValidPeriod);
|
|
103
|
+
}
|
|
104
|
+
}, [endDateOptions.currentDate]);
|
|
105
|
+
return _jsxs("div", __assign({
|
|
106
|
+
className: "ncua-range-date-picker"
|
|
107
|
+
}, {
|
|
108
|
+
children: [_jsx(DatePicker, __assign({}, startDateOptions)), "-", _jsx(DatePicker, __assign({}, endDateOptions))]
|
|
109
|
+
}));
|
|
110
|
+
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
export * from './badge';
|
|
1
2
|
export * from './button';
|
|
3
|
+
export * from './carousel';
|
|
2
4
|
export * from './checkbox';
|
|
5
|
+
export * from './date-picker';
|
|
6
|
+
export * from './input';
|
|
7
|
+
export * from './pagination';
|
|
3
8
|
export * from './radio';
|
|
4
9
|
export * from './select';
|
|
10
|
+
export * from './shared';
|
|
11
|
+
export * from './spinner';
|
|
5
12
|
export * from './svg';
|
|
6
13
|
export * from './toggle';
|
|
7
|
-
export * from './tooltip';
|
|
8
|
-
export * from './carousel';
|
|
9
|
-
export * from './badge';
|
|
14
|
+
export * from './tooltip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HintText';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Label';
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
+
export * from './src/components/badge';
|
|
1
2
|
export * from './src/components/button';
|
|
3
|
+
export * from './src/components/carousel';
|
|
4
|
+
export * from './src/components/checkbox';
|
|
5
|
+
export * from './src/components/date-picker';
|
|
6
|
+
export * from './src/components/input';
|
|
7
|
+
export * from './src/components/pagination';
|
|
8
|
+
export * from './src/components/radio';
|
|
9
|
+
export * from './src/components/select';
|
|
10
|
+
export * from './src/components/shared/hintText';
|
|
11
|
+
export * from './src/components/shared/label';
|
|
12
|
+
export * from './src/components/shared';
|
|
13
|
+
export * from './src/components/spinner';
|
|
2
14
|
export * from './src/components/svg';
|
|
15
|
+
export * from './src/components/toggle';
|
|
16
|
+
export * from './src/components/tooltip';
|
|
3
17
|
export * from './src/components';
|
|
4
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -51,7 +51,7 @@ export declare const ButtonGroup: {
|
|
|
51
51
|
formNoValidate?: boolean | undefined;
|
|
52
52
|
formTarget?: string | undefined;
|
|
53
53
|
name?: string | undefined;
|
|
54
|
-
type?: "button" | "
|
|
54
|
+
type?: "button" | "submit" | "reset" | undefined;
|
|
55
55
|
value?: string | number | readonly string[] | undefined;
|
|
56
56
|
defaultChecked?: boolean | undefined;
|
|
57
57
|
defaultValue?: string | number | readonly string[] | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { unitOfTime } from 'moment';
|
|
2
|
+
import { DatePickerProps } from './DatePicker';
|
|
3
|
+
export type RangeDatePickerProps = {
|
|
4
|
+
startDateOptions: DatePickerProps;
|
|
5
|
+
endDateOptions: DatePickerProps;
|
|
6
|
+
validationOption?: {
|
|
7
|
+
initDate?: {
|
|
8
|
+
startDate?: string;
|
|
9
|
+
endDate?: string;
|
|
10
|
+
};
|
|
11
|
+
setting?: {
|
|
12
|
+
unit: unitOfTime.Diff;
|
|
13
|
+
period: number;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
onDateValidation?: (params: {
|
|
17
|
+
type: 'start' | 'end';
|
|
18
|
+
errorType: 'reset' | 'period' | 'overlap';
|
|
19
|
+
newDate: string;
|
|
20
|
+
currentDate: string;
|
|
21
|
+
}) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const RangeDatePicker: ({ startDateOptions, endDateOptions, validationOption, onDateValidation, }: RangeDatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=RangeDatePicker.d.ts.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
export * from './badge';
|
|
1
2
|
export * from './button';
|
|
3
|
+
export * from './carousel';
|
|
2
4
|
export * from './checkbox';
|
|
5
|
+
export * from './date-picker';
|
|
6
|
+
export * from './input';
|
|
7
|
+
export * from './pagination';
|
|
3
8
|
export * from './radio';
|
|
4
9
|
export * from './select';
|
|
10
|
+
export * from './shared';
|
|
11
|
+
export * from './spinner';
|
|
5
12
|
export * from './svg';
|
|
6
13
|
export * from './toggle';
|
|
7
14
|
export * from './tooltip';
|
|
8
|
-
export * from './carousel';
|
|
9
|
-
export * from './badge';
|
|
10
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1616,6 +1616,7 @@ button {
|
|
|
1616
1616
|
|
|
1617
1617
|
.ncua-date-picker {
|
|
1618
1618
|
position: relative;
|
|
1619
|
+
display: inline-block;
|
|
1619
1620
|
}
|
|
1620
1621
|
.ncua-date-picker .flatpickr-wrapper {
|
|
1621
1622
|
border: 1px solid var(--gray-200);
|
|
@@ -1785,6 +1786,12 @@ button {
|
|
|
1785
1786
|
color: var(--gray-300);
|
|
1786
1787
|
}
|
|
1787
1788
|
|
|
1789
|
+
.ncua-range-date-picker {
|
|
1790
|
+
display: inline-flex;
|
|
1791
|
+
align-items: center;
|
|
1792
|
+
gap: 8px;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1788
1795
|
.ncua-carousel-number-group {
|
|
1789
1796
|
display: inline-flex;
|
|
1790
1797
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=FileInput.d.ts.map
|