@ncds/ui-admin 1.5.2 → 1.5.4
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/src/components/date-picker/RangeDatePickerWithButtons.js +4 -2
- package/dist/cjs/src/components/image-file-input/ImageFileInput.js +12 -15
- package/dist/cjs/src/components/index.js +22 -11
- package/dist/cjs/src/components/input/PasswordInput.js +5 -20
- package/dist/cjs/src/components/tab/HorizontalTab.js +1 -1
- package/dist/esm/src/components/date-picker/RangeDatePickerWithButtons.js +4 -2
- package/dist/esm/src/components/image-file-input/ImageFileInput.js +8 -11
- package/dist/esm/src/components/index.js +3 -2
- package/dist/esm/src/components/input/PasswordInput.js +5 -20
- package/dist/esm/src/components/tab/HorizontalTab.js +1 -1
- package/dist/types/src/components/date-picker/RangeDatePickerWithButtons.d.ts +63 -6
- package/dist/types/src/components/image-file-input/ImageFileInput.d.ts +1 -8
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/constant/date-picker.d.ts +6 -0
- package/dist/ui-admin/assets/styles/style.css +9 -11
- package/package.json +1 -1
- /package/dist/cjs/src/components/{file-upload → file-input}/FileInput.js +0 -0
- /package/dist/cjs/src/components/{file-upload → file-input}/index.js +0 -0
- /package/dist/esm/src/components/{file-upload → file-input}/FileInput.js +0 -0
- /package/dist/esm/src/components/{file-upload → file-input}/index.js +0 -0
- /package/dist/types/src/components/{file-upload → file-input}/FileInput.d.ts +0 -0
- /package/dist/types/src/components/{file-upload → file-input}/index.d.ts +0 -0
|
@@ -31,9 +31,11 @@ var RangeDatePickerWithButtons = function (_a) {
|
|
|
31
31
|
endDateOptions = _a.endDateOptions,
|
|
32
32
|
validationOption = _a.validationOption,
|
|
33
33
|
periodKeys = _a.periodKeys,
|
|
34
|
+
periodItems = _a.periodItems,
|
|
34
35
|
onDateValidation = _a.onDateValidation;
|
|
36
|
+
var items = periodItems !== null && periodItems !== void 0 ? periodItems : _datePicker.PERIOD_ITEM;
|
|
35
37
|
var setCalculatedDate = function () {
|
|
36
|
-
var currentPeriodItem =
|
|
38
|
+
var currentPeriodItem = items[currentButtonId];
|
|
37
39
|
if (!currentPeriodItem) {
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
@@ -71,7 +73,7 @@ var RangeDatePickerWithButtons = function (_a) {
|
|
|
71
73
|
children: periodKeys.map(function (key) {
|
|
72
74
|
return (0, _jsxRuntime.jsx)(_button.ButtonGroup.Item, {
|
|
73
75
|
isCurrent: currentButtonId === key,
|
|
74
|
-
label:
|
|
76
|
+
label: items[key].text,
|
|
75
77
|
onClick: function () {
|
|
76
78
|
return setCurrentButtonId(key);
|
|
77
79
|
}
|
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ImageFileInput = void 0;
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
8
|
var _dynamic = _interopRequireDefault(require("@ncds/ui-admin-icon/dynamic"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _react = require("react");
|
|
11
11
|
var _button = require("../button");
|
|
12
|
+
var _FileInput = require("../file-input/FileInput");
|
|
12
13
|
var _shared = require("../shared");
|
|
13
|
-
var _ImagePreview = require("./components/ImagePreview");
|
|
14
14
|
var _tooltip = require("../tooltip");
|
|
15
|
+
var _ImagePreview = require("./components/ImagePreview");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
17
18
|
__assign = Object.assign || function (t) {
|
|
@@ -40,12 +41,6 @@ var __spreadArray = void 0 && (void 0).__spreadArray || function (to, from, pack
|
|
|
40
41
|
}
|
|
41
42
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
42
43
|
};
|
|
43
|
-
var ImageFileInputErrorType;
|
|
44
|
-
(function (ImageFileInputErrorType) {
|
|
45
|
-
ImageFileInputErrorType["ALREADY_UPLOADED"] = "ALREADY_UPLOADED";
|
|
46
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_SIZE"] = "EXCEED_MAX_FILE_SIZE";
|
|
47
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_COUNT"] = "EXCEED_MAX_FILE_COUNT";
|
|
48
|
-
})(ImageFileInputErrorType || (exports.ImageFileInputErrorType = ImageFileInputErrorType = {}));
|
|
49
44
|
var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef)(function (_a, ref) {
|
|
50
45
|
var _b = _a.size,
|
|
51
46
|
size = _b === void 0 ? 'sm' : _b,
|
|
@@ -123,20 +118,20 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
123
118
|
return f.name === file.name && f.size === file.size;
|
|
124
119
|
})) {
|
|
125
120
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
126
|
-
errorType:
|
|
121
|
+
errorType: _FileInput.FileInputErrorType.ALREADY_UPLOADED
|
|
127
122
|
}));
|
|
128
123
|
return "continue";
|
|
129
124
|
}
|
|
130
125
|
if (!!maxFileSize && file.size > maxFileSize) {
|
|
131
126
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
132
|
-
errorType:
|
|
127
|
+
errorType: _FileInput.FileInputErrorType.EXCEED_MAX_FILE_SIZE
|
|
133
128
|
}));
|
|
134
129
|
return "continue";
|
|
135
130
|
}
|
|
136
131
|
// Skip max count check if maxFileCount is 1 (allow replacement)
|
|
137
132
|
if (!!maxFileCount && maxFileCount !== 1 && files.length + validFiles.length >= maxFileCount) {
|
|
138
133
|
invalidFiles.push(__assign(__assign({}, file), {
|
|
139
|
-
errorType:
|
|
134
|
+
errorType: _FileInput.FileInputErrorType.EXCEED_MAX_FILE_COUNT
|
|
140
135
|
}));
|
|
141
136
|
return "continue";
|
|
142
137
|
}
|
|
@@ -189,7 +184,7 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
189
184
|
children: [(0, _jsxRuntime.jsx)(_button.Button, {
|
|
190
185
|
onlyIcon: true,
|
|
191
186
|
size: size,
|
|
192
|
-
className:
|
|
187
|
+
className: (0, _classnames.default)('ncua-image-file-input__preview-container'),
|
|
193
188
|
onClick: handleBrowseClick,
|
|
194
189
|
disabled: disabled,
|
|
195
190
|
label: imagePreviewTooltipLabel
|
|
@@ -215,7 +210,9 @@ var ImageFileInput = exports.ImageFileInput = /*#__PURE__*/(0, _react.forwardRef
|
|
|
215
210
|
}));
|
|
216
211
|
};
|
|
217
212
|
return (0, _jsxRuntime.jsxs)("div", __assign({
|
|
218
|
-
className: (0, _classnames.default)('ncua-image-file-input', "ncua-image-file-input--".concat(size)
|
|
213
|
+
className: (0, _classnames.default)('ncua-image-file-input', "ncua-image-file-input--".concat(size), {
|
|
214
|
+
destructive: destructive
|
|
215
|
+
})
|
|
219
216
|
}, {
|
|
220
217
|
children: [renderImagePreview(files), showFileInput && (0, _jsxRuntime.jsxs)("div", __assign({
|
|
221
218
|
className: (0, _classnames.default)('ncua-file-input', "ncua-file-input--".concat(size))
|
|
@@ -135,6 +135,28 @@ Object.keys(_featuredIcon).forEach(function (key) {
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
});
|
|
138
|
+
var _fileInput = require("./file-input");
|
|
139
|
+
Object.keys(_fileInput).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _fileInput[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () {
|
|
145
|
+
return _fileInput[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
var _imageFileInput = require("./image-file-input");
|
|
150
|
+
Object.keys(_imageFileInput).forEach(function (key) {
|
|
151
|
+
if (key === "default" || key === "__esModule") return;
|
|
152
|
+
if (key in exports && exports[key] === _imageFileInput[key]) return;
|
|
153
|
+
Object.defineProperty(exports, key, {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function () {
|
|
156
|
+
return _imageFileInput[key];
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
});
|
|
138
160
|
var _input = require("./input");
|
|
139
161
|
Object.keys(_input).forEach(function (key) {
|
|
140
162
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -332,15 +354,4 @@ Object.keys(_tooltip).forEach(function (key) {
|
|
|
332
354
|
return _tooltip[key];
|
|
333
355
|
}
|
|
334
356
|
});
|
|
335
|
-
});
|
|
336
|
-
var _imageFileInput = require("./image-file-input");
|
|
337
|
-
Object.keys(_imageFileInput).forEach(function (key) {
|
|
338
|
-
if (key === "default" || key === "__esModule") return;
|
|
339
|
-
if (key in exports && exports[key] === _imageFileInput[key]) return;
|
|
340
|
-
Object.defineProperty(exports, key, {
|
|
341
|
-
enumerable: true,
|
|
342
|
-
get: function () {
|
|
343
|
-
return _imageFileInput[key];
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
357
|
});
|
|
@@ -8,7 +8,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _uiAdminIcon = require("@ncds/ui-admin-icon");
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
-
var _hooks = require("../../hooks");
|
|
12
11
|
var _InputBase = require("./InputBase");
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
13
|
var __assign = void 0 && (void 0).__assign || function () {
|
|
@@ -40,37 +39,23 @@ var PasswordInput = exports.PasswordInput = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
40
39
|
var _c = (0, _react.useState)(false),
|
|
41
40
|
isVisible = _c[0],
|
|
42
41
|
setIsVisible = _c[1];
|
|
43
|
-
var _d = (0, _react.useState)(false),
|
|
44
|
-
hasContent = _d[0],
|
|
45
|
-
setHasContent = _d[1];
|
|
46
|
-
var callbackRef = (0, _hooks.useCallbackRef)(function (node) {
|
|
47
|
-
if (node) {
|
|
48
|
-
setHasContent(!!node.value);
|
|
49
|
-
var handleInput_1 = function () {
|
|
50
|
-
setHasContent(!!node.value);
|
|
51
|
-
};
|
|
52
|
-
node.addEventListener('input', handleInput_1);
|
|
53
|
-
return function () {
|
|
54
|
-
node.removeEventListener('input', handleInput_1);
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
var mergedRef = (0, _hooks.useMergeRefs)([ref, callbackRef]);
|
|
59
42
|
var svgProps = {
|
|
60
43
|
width: svgSize[size],
|
|
61
44
|
height: svgSize[size]
|
|
62
45
|
};
|
|
63
46
|
var handleVisibilityChange = function () {
|
|
64
|
-
setIsVisible(
|
|
47
|
+
setIsVisible(function (prev) {
|
|
48
|
+
return !prev;
|
|
49
|
+
});
|
|
65
50
|
};
|
|
66
51
|
return (0, _jsxRuntime.jsx)(_InputBase.InputBase, __assign({
|
|
67
|
-
ref:
|
|
52
|
+
ref: ref,
|
|
68
53
|
size: size,
|
|
69
54
|
type: isVisible ? 'text' : 'password',
|
|
70
55
|
leadingElement: {
|
|
71
56
|
type: 'icon',
|
|
72
57
|
icon: 'lock-01',
|
|
73
|
-
color:
|
|
58
|
+
color: props.value ? 'gray600' : 'gray300'
|
|
74
59
|
},
|
|
75
60
|
trailingElement: {
|
|
76
61
|
type: 'custom',
|
|
@@ -39,7 +39,7 @@ var HorizontalTab = function (_a) {
|
|
|
39
39
|
};
|
|
40
40
|
if (!menus.length) return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|
|
41
41
|
return (0, _jsxRuntime.jsx)("div", __assign({
|
|
42
|
-
className: (0, _classnames.default)('ncua-horizontal-tab', "ncua-horizontal-tab--".concat(type), {
|
|
42
|
+
className: (0, _classnames.default)('ncua-horizontal-tab', "ncua-horizontal-tab--".concat(type), "ncua-horizontal-tab--".concat(size), {
|
|
43
43
|
'ncua-horizontal-tab--fullWidth': fullWidth
|
|
44
44
|
})
|
|
45
45
|
}, {
|
|
@@ -25,9 +25,11 @@ export var RangeDatePickerWithButtons = function (_a) {
|
|
|
25
25
|
endDateOptions = _a.endDateOptions,
|
|
26
26
|
validationOption = _a.validationOption,
|
|
27
27
|
periodKeys = _a.periodKeys,
|
|
28
|
+
periodItems = _a.periodItems,
|
|
28
29
|
onDateValidation = _a.onDateValidation;
|
|
30
|
+
var items = periodItems !== null && periodItems !== void 0 ? periodItems : PERIOD_ITEM;
|
|
29
31
|
var setCalculatedDate = function () {
|
|
30
|
-
var currentPeriodItem =
|
|
32
|
+
var currentPeriodItem = items[currentButtonId];
|
|
31
33
|
if (!currentPeriodItem) {
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
@@ -65,7 +67,7 @@ export var RangeDatePickerWithButtons = function (_a) {
|
|
|
65
67
|
children: periodKeys.map(function (key) {
|
|
66
68
|
return _jsx(ButtonGroup.Item, {
|
|
67
69
|
isCurrent: currentButtonId === key,
|
|
68
|
-
label:
|
|
70
|
+
label: items[key].text,
|
|
69
71
|
onClick: function () {
|
|
70
72
|
return setCurrentButtonId(key);
|
|
71
73
|
}
|
|
@@ -26,19 +26,14 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
26
26
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
27
27
|
};
|
|
28
28
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
-
import { forwardRef, useState, useRef, useEffect } from 'react';
|
|
30
|
-
import classNames from 'classnames';
|
|
31
29
|
import Icon from '@ncds/ui-admin-icon/dynamic';
|
|
30
|
+
import classNames from 'classnames';
|
|
31
|
+
import { forwardRef, useEffect, useRef, useState } from 'react';
|
|
32
32
|
import { Button } from '../button';
|
|
33
|
+
import { FileInputErrorType as ImageFileInputErrorType } from '../file-input/FileInput';
|
|
33
34
|
import { HintText, Label } from '../shared';
|
|
34
|
-
import { ImagePreview } from './components/ImagePreview';
|
|
35
35
|
import { Tooltip } from '../tooltip';
|
|
36
|
-
|
|
37
|
-
(function (ImageFileInputErrorType) {
|
|
38
|
-
ImageFileInputErrorType["ALREADY_UPLOADED"] = "ALREADY_UPLOADED";
|
|
39
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_SIZE"] = "EXCEED_MAX_FILE_SIZE";
|
|
40
|
-
ImageFileInputErrorType["EXCEED_MAX_FILE_COUNT"] = "EXCEED_MAX_FILE_COUNT";
|
|
41
|
-
})(ImageFileInputErrorType || (ImageFileInputErrorType = {}));
|
|
36
|
+
import { ImagePreview } from './components/ImagePreview';
|
|
42
37
|
export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
43
38
|
var _b = _a.size,
|
|
44
39
|
size = _b === void 0 ? 'sm' : _b,
|
|
@@ -182,7 +177,7 @@ export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
182
177
|
children: [_jsx(Button, {
|
|
183
178
|
onlyIcon: true,
|
|
184
179
|
size: size,
|
|
185
|
-
className:
|
|
180
|
+
className: classNames('ncua-image-file-input__preview-container'),
|
|
186
181
|
onClick: handleBrowseClick,
|
|
187
182
|
disabled: disabled,
|
|
188
183
|
label: imagePreviewTooltipLabel
|
|
@@ -208,7 +203,9 @@ export var ImageFileInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
208
203
|
}));
|
|
209
204
|
};
|
|
210
205
|
return _jsxs("div", __assign({
|
|
211
|
-
className: classNames('ncua-image-file-input', "ncua-image-file-input--".concat(size)
|
|
206
|
+
className: classNames('ncua-image-file-input', "ncua-image-file-input--".concat(size), {
|
|
207
|
+
destructive: destructive
|
|
208
|
+
})
|
|
212
209
|
}, {
|
|
213
210
|
children: [renderImagePreview(files), showFileInput && _jsxs("div", __assign({
|
|
214
211
|
className: classNames('ncua-file-input', "ncua-file-input--".concat(size))
|
|
@@ -10,6 +10,8 @@ export * from './dot';
|
|
|
10
10
|
export * from './dropdown';
|
|
11
11
|
export * from './empty-state';
|
|
12
12
|
export * from './featured-icon';
|
|
13
|
+
export * from './file-input';
|
|
14
|
+
export * from './image-file-input';
|
|
13
15
|
export * from './input';
|
|
14
16
|
export * from './modal';
|
|
15
17
|
export * from './notification';
|
|
@@ -27,5 +29,4 @@ export * from './switch';
|
|
|
27
29
|
export * from './tab';
|
|
28
30
|
export * from './tag';
|
|
29
31
|
export * from './toggle';
|
|
30
|
-
export * from './tooltip';
|
|
31
|
-
export * from './image-file-input';
|
|
32
|
+
export * from './tooltip';
|
|
@@ -20,7 +20,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
20
20
|
import { Eye, EyeOff } from '@ncds/ui-admin-icon';
|
|
21
21
|
import classNames from 'classnames';
|
|
22
22
|
import { forwardRef, useState } from 'react';
|
|
23
|
-
import { useCallbackRef, useMergeRefs } from '../../hooks';
|
|
24
23
|
import { InputBase } from './InputBase';
|
|
25
24
|
var svgSize = {
|
|
26
25
|
xs: 14,
|
|
@@ -33,37 +32,23 @@ export var PasswordInput = /*#__PURE__*/forwardRef(function (_a, ref) {
|
|
|
33
32
|
var _c = useState(false),
|
|
34
33
|
isVisible = _c[0],
|
|
35
34
|
setIsVisible = _c[1];
|
|
36
|
-
var _d = useState(false),
|
|
37
|
-
hasContent = _d[0],
|
|
38
|
-
setHasContent = _d[1];
|
|
39
|
-
var callbackRef = useCallbackRef(function (node) {
|
|
40
|
-
if (node) {
|
|
41
|
-
setHasContent(!!node.value);
|
|
42
|
-
var handleInput_1 = function () {
|
|
43
|
-
setHasContent(!!node.value);
|
|
44
|
-
};
|
|
45
|
-
node.addEventListener('input', handleInput_1);
|
|
46
|
-
return function () {
|
|
47
|
-
node.removeEventListener('input', handleInput_1);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
var mergedRef = useMergeRefs([ref, callbackRef]);
|
|
52
35
|
var svgProps = {
|
|
53
36
|
width: svgSize[size],
|
|
54
37
|
height: svgSize[size]
|
|
55
38
|
};
|
|
56
39
|
var handleVisibilityChange = function () {
|
|
57
|
-
setIsVisible(
|
|
40
|
+
setIsVisible(function (prev) {
|
|
41
|
+
return !prev;
|
|
42
|
+
});
|
|
58
43
|
};
|
|
59
44
|
return _jsx(InputBase, __assign({
|
|
60
|
-
ref:
|
|
45
|
+
ref: ref,
|
|
61
46
|
size: size,
|
|
62
47
|
type: isVisible ? 'text' : 'password',
|
|
63
48
|
leadingElement: {
|
|
64
49
|
type: 'icon',
|
|
65
50
|
icon: 'lock-01',
|
|
66
|
-
color:
|
|
51
|
+
color: props.value ? 'gray600' : 'gray300'
|
|
67
52
|
},
|
|
68
53
|
trailingElement: {
|
|
69
54
|
type: 'custom',
|
|
@@ -32,7 +32,7 @@ export var HorizontalTab = function (_a) {
|
|
|
32
32
|
};
|
|
33
33
|
if (!menus.length) return _jsx(_Fragment, {});
|
|
34
34
|
return _jsx("div", __assign({
|
|
35
|
-
className: classNames('ncua-horizontal-tab', "ncua-horizontal-tab--".concat(type), {
|
|
35
|
+
className: classNames('ncua-horizontal-tab', "ncua-horizontal-tab--".concat(type), "ncua-horizontal-tab--".concat(size), {
|
|
36
36
|
'ncua-horizontal-tab--fullWidth': fullWidth
|
|
37
37
|
})
|
|
38
38
|
}, {
|
|
@@ -1,14 +1,71 @@
|
|
|
1
1
|
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
-
import { PERIOD_ITEM } from '../../constant/date-picker';
|
|
2
|
+
import { PERIOD_ITEM, type PeriodItemMap } from '../../constant/date-picker';
|
|
3
3
|
import { type RangeDatePickerProps } from './RangeDatePicker';
|
|
4
4
|
export type PeriodKeyType = keyof typeof PERIOD_ITEM;
|
|
5
|
-
type RangeDatePickerWithButtonsProps = {
|
|
5
|
+
type RangeDatePickerWithButtonsProps<T extends PeriodItemMap = typeof PERIOD_ITEM> = {
|
|
6
6
|
useYesterdayAsEndDate?: boolean;
|
|
7
|
-
currentButtonId:
|
|
8
|
-
setCurrentButtonId: Dispatch<SetStateAction<
|
|
9
|
-
periodKeys:
|
|
7
|
+
currentButtonId: keyof T & string;
|
|
8
|
+
setCurrentButtonId: Dispatch<SetStateAction<keyof T & string>>;
|
|
9
|
+
periodKeys: (keyof T & string)[];
|
|
10
|
+
periodItems?: T;
|
|
10
11
|
size?: 'xs' | 'sm';
|
|
11
12
|
} & RangeDatePickerProps;
|
|
12
|
-
export declare const RangeDatePickerWithButtons:
|
|
13
|
+
export declare const RangeDatePickerWithButtons: <T extends PeriodItemMap = {
|
|
14
|
+
TODAY: {
|
|
15
|
+
text: string;
|
|
16
|
+
period: number;
|
|
17
|
+
unit: string;
|
|
18
|
+
};
|
|
19
|
+
YESTERDAY: {
|
|
20
|
+
text: string;
|
|
21
|
+
period: number;
|
|
22
|
+
unit: string;
|
|
23
|
+
};
|
|
24
|
+
'3DAYS': {
|
|
25
|
+
text: string;
|
|
26
|
+
period: number;
|
|
27
|
+
unit: string;
|
|
28
|
+
};
|
|
29
|
+
'7DAYS': {
|
|
30
|
+
text: string;
|
|
31
|
+
period: number;
|
|
32
|
+
unit: string;
|
|
33
|
+
};
|
|
34
|
+
'1WEEK': {
|
|
35
|
+
text: string;
|
|
36
|
+
period: number;
|
|
37
|
+
unit: string;
|
|
38
|
+
};
|
|
39
|
+
'15DAYS': {
|
|
40
|
+
text: string;
|
|
41
|
+
period: number;
|
|
42
|
+
unit: string;
|
|
43
|
+
};
|
|
44
|
+
'1MONTHS': {
|
|
45
|
+
text: string;
|
|
46
|
+
period: number;
|
|
47
|
+
unit: string;
|
|
48
|
+
};
|
|
49
|
+
'3MONTHS': {
|
|
50
|
+
text: string;
|
|
51
|
+
period: number;
|
|
52
|
+
unit: string;
|
|
53
|
+
};
|
|
54
|
+
'1YEAR': {
|
|
55
|
+
text: string;
|
|
56
|
+
period: number;
|
|
57
|
+
unit: string;
|
|
58
|
+
};
|
|
59
|
+
ENTIRE: {
|
|
60
|
+
text: string;
|
|
61
|
+
period: number;
|
|
62
|
+
unit: null;
|
|
63
|
+
};
|
|
64
|
+
NONE: {
|
|
65
|
+
text: string;
|
|
66
|
+
period: number;
|
|
67
|
+
unit: null;
|
|
68
|
+
};
|
|
69
|
+
}>({ useYesterdayAsEndDate, size, currentButtonId, setCurrentButtonId, startDateOptions, endDateOptions, validationOption, periodKeys, periodItems, onDateValidation, }: RangeDatePickerWithButtonsProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
13
70
|
export {};
|
|
14
71
|
//# sourceMappingURL=RangeDatePickerWithButtons.d.ts.map
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
+
import { InvalidFile } from '../file-input/FileInput';
|
|
1
2
|
import { InputBaseProps } from '../input/InputBase';
|
|
2
|
-
export declare enum ImageFileInputErrorType {
|
|
3
|
-
ALREADY_UPLOADED = "ALREADY_UPLOADED",
|
|
4
|
-
EXCEED_MAX_FILE_SIZE = "EXCEED_MAX_FILE_SIZE",
|
|
5
|
-
EXCEED_MAX_FILE_COUNT = "EXCEED_MAX_FILE_COUNT"
|
|
6
|
-
}
|
|
7
|
-
export interface InvalidFile extends Omit<File, 'constructor'> {
|
|
8
|
-
errorType: ImageFileInputErrorType;
|
|
9
|
-
}
|
|
10
3
|
export interface ImageFileInputProps extends Omit<InputBaseProps, 'clearText' | 'onClearText' | 'hintText' | 'value' | 'onChange'> {
|
|
11
4
|
/**
|
|
12
5
|
* Accepted file types
|
|
@@ -10,6 +10,8 @@ export * from './dot';
|
|
|
10
10
|
export * from './dropdown';
|
|
11
11
|
export * from './empty-state';
|
|
12
12
|
export * from './featured-icon';
|
|
13
|
+
export * from './file-input';
|
|
14
|
+
export * from './image-file-input';
|
|
13
15
|
export * from './input';
|
|
14
16
|
export * from './modal';
|
|
15
17
|
export * from './notification';
|
|
@@ -28,5 +30,4 @@ export * from './tab';
|
|
|
28
30
|
export * from './tag';
|
|
29
31
|
export * from './toggle';
|
|
30
32
|
export * from './tooltip';
|
|
31
|
-
export * from './image-file-input';
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@charset "UTF-8";
|
|
2
1
|
:root {
|
|
3
2
|
--primary-red-50: #fffafd;
|
|
4
3
|
--primary-red-100: #ffeaee;
|
|
@@ -4158,6 +4157,10 @@ button {
|
|
|
4158
4157
|
background-color: var(--gray-500);
|
|
4159
4158
|
border-color: var(--gray-500);
|
|
4160
4159
|
}
|
|
4160
|
+
.ncua-date-picker .flatpickr-day.selected.nextMonthDay, .ncua-date-picker .flatpickr-day.selected.prevMonthDay {
|
|
4161
|
+
background-color: var(--gray-500);
|
|
4162
|
+
border-color: var(--gray-500);
|
|
4163
|
+
}
|
|
4161
4164
|
.ncua-date-picker .flatpickr-day.selected:hover {
|
|
4162
4165
|
border-color: var(--gray-700);
|
|
4163
4166
|
background-color: var(--gray-700);
|
|
@@ -5227,19 +5230,10 @@ button {
|
|
|
5227
5230
|
}
|
|
5228
5231
|
.ncua-file-input__hint-list {
|
|
5229
5232
|
margin: 0;
|
|
5230
|
-
|
|
5233
|
+
list-style: disc;
|
|
5231
5234
|
color: var(--gray-400);
|
|
5232
|
-
}
|
|
5233
|
-
.ncua-file-input__hint-item {
|
|
5234
|
-
position: relative;
|
|
5235
5235
|
padding-left: 16px;
|
|
5236
5236
|
}
|
|
5237
|
-
.ncua-file-input__hint-item::before {
|
|
5238
|
-
content: "•";
|
|
5239
|
-
position: absolute;
|
|
5240
|
-
left: 0;
|
|
5241
|
-
top: 0;
|
|
5242
|
-
}
|
|
5243
5237
|
.ncua-file-input--xs {
|
|
5244
5238
|
font-size: var(--font-size-xxs);
|
|
5245
5239
|
line-height: var(--line-heights-xxs);
|
|
@@ -5332,6 +5326,10 @@ button {
|
|
|
5332
5326
|
.ncua-image-file-input__preview-container[disabled], .ncua-image-file-input__preview-container.is-disable, .ncua-image-file-input__preview-container.ncua-btn:hover {
|
|
5333
5327
|
border: 1px dashed var(--gray-200);
|
|
5334
5328
|
}
|
|
5329
|
+
.ncua-image-file-input.destructive .ncua-image-file-input__preview-container {
|
|
5330
|
+
background-color: var(--primary-red-100);
|
|
5331
|
+
border: 1px solid var(--primary-red-600);
|
|
5332
|
+
}
|
|
5335
5333
|
.ncua-image-file-input__preview-remove-button {
|
|
5336
5334
|
position: absolute;
|
|
5337
5335
|
top: 50%;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|