diginet-core-ui 1.4.51 → 1.4.52-beta.0
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/components/form-control/date-range-picker/index.js +1 -1
- package/components/form-control/dropdown/index.js +15 -13
- package/components/form-control/dropdown-box/index.js +63 -21
- package/components/form-control/number-input/index2.js +59 -46
- package/components/paging/page-info.js +1 -1
- package/package.json +78 -44
- package/readme.md +4 -0
|
@@ -815,8 +815,8 @@ const DateRangePicker = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, refe
|
|
|
815
815
|
};
|
|
816
816
|
}, []);
|
|
817
817
|
useEffect(() => {
|
|
818
|
+
update(value);
|
|
818
819
|
if (value && value[0] && value[1]) {
|
|
819
|
-
update(value);
|
|
820
820
|
closePicker();
|
|
821
821
|
} else {
|
|
822
822
|
ipRef.current.value = '';
|
|
@@ -330,19 +330,21 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
330
330
|
let dataSourceUsable = [...dataSourceState];
|
|
331
331
|
|
|
332
332
|
// search dataSource dựa trên txtSearch
|
|
333
|
-
if (!onInput
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
333
|
+
if (!onInput) {
|
|
334
|
+
if (!(action !== null && action !== void 0 && action.loadData) || !onLoadMore) {
|
|
335
|
+
var _dataSourceUsable;
|
|
336
|
+
dataSourceUsable = (_dataSourceUsable = dataSourceUsable) === null || _dataSourceUsable === void 0 ? void 0 : _dataSourceUsable.filter(i => {
|
|
337
|
+
if (searchExpr) {
|
|
338
|
+
// nếu map đc vs 1 trong những <key>(data[key]) của searchExpr
|
|
339
|
+
return !!searchExpr.find(j => handleRenderBySearch(i[j]));
|
|
340
|
+
} else {
|
|
341
|
+
// nếu map đc vs displayValue
|
|
342
|
+
return handleRenderBySearch(displayValue(i)) || handleRenderBySearch(i === null || i === void 0 ? void 0 : i[valueExpr]);
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
344
346
|
}
|
|
345
|
-
if (vlObjDefaultState && vlObjDefaultState
|
|
347
|
+
if (vlObjDefaultState && (vlObjDefaultState === null || vlObjDefaultState === void 0 ? void 0 : vlObjDefaultState.length) > 0) {
|
|
346
348
|
const length = vlObjDefaultState === null || vlObjDefaultState === void 0 ? void 0 : vlObjDefaultState.length;
|
|
347
349
|
let existItemQuantity = 0;
|
|
348
350
|
for (let index = length - 1; index >= 0; index--) {
|
|
@@ -1045,7 +1047,7 @@ const Dropdown = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference)
|
|
|
1045
1047
|
inputRef.current.removeEventListener('click', onClickInput);
|
|
1046
1048
|
}
|
|
1047
1049
|
};
|
|
1048
|
-
}, [dataSourceState]);
|
|
1050
|
+
}, [dataSourceState, disabled]);
|
|
1049
1051
|
useEffect(() => {
|
|
1050
1052
|
if (!openState && txtSearch) {
|
|
1051
1053
|
if (!onInput) {
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import { css, jsx } from '@emotion/core';
|
|
4
|
-
import { ButtonIcon, InputBase, Label, Popover, PopoverBody } from "../..";
|
|
4
|
+
import { ButtonIcon, InputBase, Label, Popover, PopoverBody, HelperText } from "../..";
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { Fragment, forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react';
|
|
6
|
+
import { Fragment, forwardRef, memo, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, useMemo } from 'react';
|
|
7
7
|
import { animation, borderColor, displayBlock, overflowHidden, parseHeight, parseMinWidth, positionRelative, scaleX } from "../../../styles/general";
|
|
8
8
|
import { useTheme } from "../../../theme";
|
|
9
9
|
import useThemeProps from "../../../theme/utils/useThemeProps";
|
|
10
10
|
import { classNames, getProp } from "../../../utils";
|
|
11
|
+
const regexBetween = /[^{}]+(?=})/g;
|
|
12
|
+
const regexInclude = /{|}/g;
|
|
11
13
|
const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, reference) => {
|
|
12
14
|
if (!reference) reference = useRef(null);
|
|
13
15
|
const theme = useTheme();
|
|
@@ -22,10 +24,14 @@ const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, referenc
|
|
|
22
24
|
});
|
|
23
25
|
const {
|
|
24
26
|
action = {},
|
|
27
|
+
allowInput,
|
|
25
28
|
bgColor: bgColorProp,
|
|
26
29
|
children,
|
|
27
30
|
className,
|
|
28
31
|
delayOnInput,
|
|
32
|
+
disabled,
|
|
33
|
+
displayExpr: displayExprProp,
|
|
34
|
+
error,
|
|
29
35
|
endIcon,
|
|
30
36
|
inputProps,
|
|
31
37
|
inputRef,
|
|
@@ -39,10 +45,19 @@ const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, referenc
|
|
|
39
45
|
placeholder,
|
|
40
46
|
startIcon,
|
|
41
47
|
style,
|
|
42
|
-
value,
|
|
43
|
-
|
|
48
|
+
value: valueProps,
|
|
49
|
+
valueExpr,
|
|
50
|
+
viewType,
|
|
51
|
+
helperTextProps
|
|
44
52
|
} = props;
|
|
53
|
+
let displayExpr = displayExprProp;
|
|
45
54
|
const bgColor = typeof bgColorProp === 'string' ? getProp(colors, bgColorProp, bgColorProp) : bgColorProp;
|
|
55
|
+
const ErrorView = useMemo(() => {
|
|
56
|
+
return error ? jsx(HelperText, {
|
|
57
|
+
...helperTextProps,
|
|
58
|
+
disabled: disabled
|
|
59
|
+
}, error) : null;
|
|
60
|
+
}, [disabled, error, helperTextProps]);
|
|
46
61
|
const ref = useRef(null);
|
|
47
62
|
const dropdownBoxRef = useRef(null);
|
|
48
63
|
const timer = useRef(null);
|
|
@@ -85,6 +100,28 @@ const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, referenc
|
|
|
85
100
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
86
101
|
}
|
|
87
102
|
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Chuyển đổi data thành giá trị cần hiện thị dựa vào displayExpr [string, string object {field} - {field}], renderSelectedItem, displayExpr, valueExpr
|
|
106
|
+
* @param data {object} rowData of dataSource
|
|
107
|
+
* @return {string}
|
|
108
|
+
*/
|
|
109
|
+
const displayValue = data => {
|
|
110
|
+
let text = '';
|
|
111
|
+
if (data || data === 0) {
|
|
112
|
+
displayExpr = displayExpr || valueExpr;
|
|
113
|
+
let mask = data === null || data === void 0 ? void 0 : data[displayExpr];
|
|
114
|
+
// convert {id} - {name} to {<data[id]>} - {<data[name]>}
|
|
115
|
+
if (!mask && regexBetween.test(displayExpr)) {
|
|
116
|
+
var _displayExpr;
|
|
117
|
+
mask = (_displayExpr = displayExpr) === null || _displayExpr === void 0 ? void 0 : _displayExpr.replace(regexBetween, _ => (data === null || data === void 0 ? void 0 : data[_]) || '');
|
|
118
|
+
} else if (!mask) {
|
|
119
|
+
mask = typeof data !== 'object' ? data : '';
|
|
120
|
+
}
|
|
121
|
+
text = mask.toString().replace(regexInclude, '');
|
|
122
|
+
}
|
|
123
|
+
return text;
|
|
124
|
+
};
|
|
88
125
|
useLayoutEffect(() => {
|
|
89
126
|
if (ref.current) {
|
|
90
127
|
const {
|
|
@@ -130,15 +167,17 @@ const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, referenc
|
|
|
130
167
|
onClick: openOnClickAt === 'icon' ? onTriggerDropdown : null
|
|
131
168
|
}) : null;
|
|
132
169
|
};
|
|
170
|
+
const value = displayValue(valueProps);
|
|
133
171
|
return jsx(Fragment, null, jsx("div", {
|
|
134
172
|
ref: ref,
|
|
135
173
|
css: _DropdownBoxRootCSS,
|
|
136
|
-
className: classNames('DGN-UI-Dropdown-Box', className),
|
|
174
|
+
className: classNames('DGN-UI-Dropdown-Box', className, error && 'error'),
|
|
137
175
|
style: style
|
|
138
176
|
}, label ? jsx(Label, {
|
|
139
177
|
...labelProps
|
|
140
178
|
}, label) : null, jsx(InputBase, {
|
|
141
179
|
...inputProps,
|
|
180
|
+
readOnly: !allowInput,
|
|
142
181
|
style: inputStyle,
|
|
143
182
|
viewType: viewType,
|
|
144
183
|
inputRef: inputRef,
|
|
@@ -157,7 +196,7 @@ const DropdownBox = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((inProps, referenc
|
|
|
157
196
|
anchor: ref.current,
|
|
158
197
|
width: popoverWidth,
|
|
159
198
|
onClose: closeDropdownBox
|
|
160
|
-
}, jsx(PopoverBody, null, children)));
|
|
199
|
+
}, jsx(PopoverBody, null, children)), ErrorView);
|
|
161
200
|
}));
|
|
162
201
|
const DropdownBoxRootCSS = (bgColorProp, {
|
|
163
202
|
colors
|
|
@@ -166,6 +205,17 @@ const DropdownBoxRootCSS = (bgColorProp, {
|
|
|
166
205
|
${positionRelative};
|
|
167
206
|
${parseMinWidth(150)};
|
|
168
207
|
${parseHeight('max-content')};
|
|
208
|
+
&.error {
|
|
209
|
+
.DGN-UI-InputBase {
|
|
210
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
211
|
+
&::before {
|
|
212
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
213
|
+
}
|
|
214
|
+
&::after {
|
|
215
|
+
${borderColor(getProp(colors, 'semantic/danger'))};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
169
219
|
.DGN-UI-InputBase {
|
|
170
220
|
background: ${bgColorProp ? bgColorProp === true ? getProp(colors, 'fill/disabled') : bgColorProp : 'inherit'} !important;
|
|
171
221
|
${openState && css`
|
|
@@ -183,20 +233,6 @@ const DropdownBoxCSS = ({
|
|
|
183
233
|
margin-top: ${spacing([1])};
|
|
184
234
|
${overflowHidden};
|
|
185
235
|
`;
|
|
186
|
-
|
|
187
|
-
// DropdownBox.defaultProps = {
|
|
188
|
-
// className: '',
|
|
189
|
-
// label: '',
|
|
190
|
-
// placeholder: '',
|
|
191
|
-
// startIcon: 'Search',
|
|
192
|
-
// endIcon: 'ArrowDown',
|
|
193
|
-
// openOnClickAt: 'icon',
|
|
194
|
-
// viewType: 'underlined',
|
|
195
|
-
// inputProps: {},
|
|
196
|
-
// delayOnInput: 700,
|
|
197
|
-
// zIndex: zIndexCORE(1),
|
|
198
|
-
// };
|
|
199
|
-
|
|
200
236
|
DropdownBox.propTypes = {
|
|
201
237
|
/** class for dropdown */
|
|
202
238
|
className: PropTypes.string,
|
|
@@ -233,6 +269,12 @@ DropdownBox.propTypes = {
|
|
|
233
269
|
/** the function will run after open */
|
|
234
270
|
onOpened: PropTypes.func,
|
|
235
271
|
/** the function will run after close */
|
|
236
|
-
onClosed: PropTypes.func
|
|
272
|
+
onClosed: PropTypes.func,
|
|
273
|
+
/** Error message displayed below the input. */
|
|
274
|
+
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
275
|
+
/** If `true`, the component is disabled. */
|
|
276
|
+
disabled: PropTypes.bool,
|
|
277
|
+
/** If `true`, the input is enable. */
|
|
278
|
+
allowInput: PropTypes.bool
|
|
237
279
|
};
|
|
238
280
|
export default DropdownBox;
|
|
@@ -79,6 +79,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
79
79
|
const ref = useRef(null);
|
|
80
80
|
const globalRef = useRef({});
|
|
81
81
|
const inputRef = useRef(null);
|
|
82
|
+
const inputTimer = useRef(null);
|
|
82
83
|
const [value, setValue] = useState(defaultValue);
|
|
83
84
|
const [error, setError] = useState(errorProp);
|
|
84
85
|
const _NumberInputRootCSS = NumberInputRootCSS(theme);
|
|
@@ -98,13 +99,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
98
99
|
|
|
99
100
|
// if (valueProps || valueProps === 0) valueProps = clamp(valueProps, min, max);
|
|
100
101
|
|
|
101
|
-
/**
|
|
102
|
-
* Convert number to format money
|
|
103
|
-
* @param vl {number} - value
|
|
104
|
-
* @type {function}
|
|
105
|
-
* @return {string}
|
|
106
|
-
* @example 1200300.123 => 1,200,300.123
|
|
107
|
-
* @example 1200300,123 => 1.200.300,123
|
|
102
|
+
/**
|
|
103
|
+
* Convert number to format money
|
|
104
|
+
* @param vl {number} - value
|
|
105
|
+
* @type {function}
|
|
106
|
+
* @return {string}
|
|
107
|
+
* @example 1200300.123 => 1,200,300.123
|
|
108
|
+
* @example 1200300,123 => 1.200.300,123
|
|
108
109
|
*/
|
|
109
110
|
const parseNumberToMoney = useCallback((vl, isNumber) => {
|
|
110
111
|
var _number, _number2, _number$, _number3;
|
|
@@ -137,16 +138,25 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
137
138
|
if (((_number3 = number) === null || _number3 === void 0 ? void 0 : _number3.indexOf(thousandSymbol)) > -1 && selectionStart !== number.length + 1) {
|
|
138
139
|
pos.current = selectionStart + (number.toString().length - 1 === vl.toString().length ? 1 : 0);
|
|
139
140
|
}
|
|
141
|
+
if (fixedDecimalDigit && !!decimalDigit) {
|
|
142
|
+
var _strVal$split;
|
|
143
|
+
const strVal = String(vl);
|
|
144
|
+
const isDecimalNum = strVal.indexOf('.') > -1 && (((_strVal$split = strVal.split('.')) === null || _strVal$split === void 0 ? void 0 : _strVal$split[1]) || '').length >= decimalDigit;
|
|
145
|
+
if (isDecimalNum) {
|
|
146
|
+
const val = Number(vl).toFixed(decimalDigit);
|
|
147
|
+
number = String(val);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
140
150
|
return number;
|
|
141
|
-
}, [decimalSymbol, max, value, decimalDigit]);
|
|
151
|
+
}, [decimalSymbol, max, value, decimalDigit, fixedDecimalDigit]);
|
|
142
152
|
|
|
143
|
-
/**
|
|
144
|
-
* Convert money to format number
|
|
145
|
-
* @param vl {string} - value
|
|
146
|
-
* @type {function}
|
|
147
|
-
* @return {number}
|
|
148
|
-
* @example 1,200,300.123 => 1200300.123
|
|
149
|
-
* @example 1.200.300,123 => 1200300.123
|
|
153
|
+
/**
|
|
154
|
+
* Convert money to format number
|
|
155
|
+
* @param vl {string} - value
|
|
156
|
+
* @type {function}
|
|
157
|
+
* @return {number}
|
|
158
|
+
* @example 1,200,300.123 => 1200300.123
|
|
159
|
+
* @example 1.200.300,123 => 1200300.123
|
|
150
160
|
*/
|
|
151
161
|
const convertMoneyToNumber = useCallback((vl, isNumber) => {
|
|
152
162
|
var _number4, _number4$toString, _number4$toString$rep, _number4$toString$rep2, _number4$toString$rep3;
|
|
@@ -170,7 +180,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
170
180
|
onInput === null || onInput === void 0 ? void 0 : onInput(e);
|
|
171
181
|
setValue(valueT);
|
|
172
182
|
if (flag) _onChange(e);
|
|
173
|
-
}, [min, max]);
|
|
183
|
+
}, [min, max, decimalDigit]);
|
|
174
184
|
const _onBlur = useCallback(e => {
|
|
175
185
|
var _e$value;
|
|
176
186
|
let value = (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : e.target.value;
|
|
@@ -304,14 +314,18 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
304
314
|
// if (typeof valueProps !== 'undefined')
|
|
305
315
|
// if (disabledNegative && Number(valueProps || 0) < 0) {
|
|
306
316
|
if (!isNaN(valueProps) || !isNaN(value)) {
|
|
307
|
-
var _valueProps;
|
|
308
317
|
if (min === 0 && Number(valueProps || 0) < 0) {
|
|
309
318
|
// nếu không cho nhập số âm mà value đầu vào là âm thì reset value về 0
|
|
310
319
|
valueProps = clamp(0, min, max);
|
|
311
320
|
}
|
|
312
|
-
|
|
321
|
+
if (delayOnChange) {
|
|
322
|
+
if (inputTimer.current) clearTimeout(inputTimer.current);
|
|
323
|
+
inputTimer.current = setTimeout(() => {
|
|
324
|
+
var _valueProps;
|
|
325
|
+
setValue(parseNumberToMoney((_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.toString().replace(regexValidNumber, ''), true));
|
|
326
|
+
}, delayOnChange);
|
|
327
|
+
}
|
|
313
328
|
// setValue(parseNumberToMoney(valueProps?.toString().replace(regexValidNumber, ''), true));
|
|
314
|
-
setValue(parseNumberToMoney((_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.toString().replace(regexValidNumber, ''), true));
|
|
315
329
|
}
|
|
316
330
|
}, [valueProps, decimalDigit]);
|
|
317
331
|
useEffect(() => {
|
|
@@ -378,29 +392,28 @@ const NumberInputRootCSS = ({
|
|
|
378
392
|
${cursorNotAllowed};
|
|
379
393
|
}
|
|
380
394
|
`;
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
//
|
|
386
|
-
//
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
//
|
|
391
|
-
//
|
|
392
|
-
//
|
|
393
|
-
//
|
|
394
|
-
//
|
|
395
|
-
//
|
|
396
|
-
//
|
|
397
|
-
//
|
|
398
|
-
//
|
|
399
|
-
//
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
|
|
403
|
-
|
|
395
|
+
NumberInput.defaultProps = {
|
|
396
|
+
delayOnChange: 500
|
|
397
|
+
// autoFocus: false,
|
|
398
|
+
// className: '',
|
|
399
|
+
// decimalDigit: Infinity,
|
|
400
|
+
// decimalSymbol: locale.get() === 'vi' ? ',' : '.',
|
|
401
|
+
// disabled: false,
|
|
402
|
+
// disabledNegative: false,
|
|
403
|
+
// endIcon: '',
|
|
404
|
+
// error: '',
|
|
405
|
+
// fixedDecimalDigit: false,
|
|
406
|
+
// label: '',
|
|
407
|
+
// max: Infinity,
|
|
408
|
+
// min: -Infinity,
|
|
409
|
+
// readOnly: false,
|
|
410
|
+
// required: false,
|
|
411
|
+
// startIcon: '',
|
|
412
|
+
// step: 1,
|
|
413
|
+
// style: {},
|
|
414
|
+
// thousandSeparator: false,
|
|
415
|
+
// viewType: 'underlined',
|
|
416
|
+
};
|
|
404
417
|
NumberInput.propTypes = {
|
|
405
418
|
/** If `true`, the input element is focused during the first mount. */
|
|
406
419
|
autoFocus: PropTypes.bool,
|
|
@@ -470,10 +483,10 @@ NumberInput.propTypes = {
|
|
|
470
483
|
style: PropTypes.object,
|
|
471
484
|
/** Thousand separator character. */
|
|
472
485
|
thousandSeparator: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['.', ','])]),
|
|
473
|
-
/** Validation value, argument can:<br/>
|
|
474
|
-
* * string: the validation rule. Example required.<br/>
|
|
475
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
476
|
-
* * array: the validation rule list, insist object/string
|
|
486
|
+
/** Validation value, argument can:<br/>
|
|
487
|
+
* * string: the validation rule. Example required.<br/>
|
|
488
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
489
|
+
* * array: the validation rule list, insist object/string
|
|
477
490
|
*/
|
|
478
491
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
479
492
|
/** The value of the input element, required for a controlled component. */
|
|
@@ -475,7 +475,7 @@ const PagingInfoCSS = (bgCl, typeShort, {
|
|
|
475
475
|
.DGN-UI-Dropdown {
|
|
476
476
|
margin-left: ${spacing([typeShort ? 0 : 2])};
|
|
477
477
|
margin-bottom: 0px;
|
|
478
|
-
${parseMinWidth(
|
|
478
|
+
${parseMinWidth(60)};
|
|
479
479
|
.DGN-UI-Dropdown-Form {
|
|
480
480
|
${parseMinHeight(24)};
|
|
481
481
|
padding: ${spacing([0])};
|
package/package.json
CHANGED
|
@@ -1,44 +1,78 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "diginet-core-ui",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start
|
|
9
|
-
"start": "
|
|
10
|
-
"build": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "diginet-core-ui",
|
|
3
|
+
"version": "1.4.52-beta.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "npm-run-all --parallel start-sb eslint-test",
|
|
9
|
+
"start-sb": "start-storybook -p 9050",
|
|
10
|
+
"build-storybook": "build-storybook -c .storybook -s src",
|
|
11
|
+
"build": "run-script-os",
|
|
12
|
+
"build:windows": "rimraf dist && mkdirp dist/components && npm run compile && sass --style=compressed src/scss:dist/css && xcopy src\\\\assets dist\\\\assets\\ /e /y",
|
|
13
|
+
"build:darwin:linux:default": "rm -rf dist && npm run compile && sass --style=compressed src/scss:dist/css && cp -rf src/assets dist/assets",
|
|
14
|
+
"compile": "babel src --out-dir dist --ignore **/*.stories.js",
|
|
15
|
+
"pack": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm pack",
|
|
16
|
+
"production-keep-version": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish",
|
|
17
|
+
"beta": "npm run build && cp *.md dist/ && cp package.json dist/ && cd dist && npm publish --tag beta",
|
|
18
|
+
"production": "npm run build && cp *.md dist/ && npm run version:bump --silent && npm run version:add --silent && cd dist && npm publish",
|
|
19
|
+
"version:add": "run-script-os",
|
|
20
|
+
"version:add:windows": "cat package.json.tmp | sed \"s/0.0.0/%npm_package_version%/g\" > dist/package.json",
|
|
21
|
+
"version:add:darwin:linux:default": "VERSION=$(npm run version:extract --silent) && cat package.json.tmp | sed \"s/0.0.0/${VERSION}/g\" > dist/package.json",
|
|
22
|
+
"version:bump": "npm version patch --no-git-tag-version --silent",
|
|
23
|
+
"version:extract": "cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g' | tr -d '[[:space:]]'",
|
|
24
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
|
+
"lint": "eslint --fix --config .eslintrc.js \"**/*.js\"",
|
|
26
|
+
"eslint-test": "onchange \"src/**/*.{js,jsx,json}\" -- eslint . --fix",
|
|
27
|
+
"freshtall": "npm cache clean --force && rm -rf node_modules && rm -f package-lock.json && npm install",
|
|
28
|
+
"test-storybook": "test-storybook --url http://localhost:9050",
|
|
29
|
+
"preinstall": "echo {} > package-lock.json"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@emotion/core": "^10.0.35",
|
|
33
|
+
"@emotion/css": "^11.11.0",
|
|
34
|
+
"@emotion/react": "^11.10.6",
|
|
35
|
+
"babel-plugin-module-resolver": "^4.1.0",
|
|
36
|
+
"date-fns": "^2.30.0",
|
|
37
|
+
"prop-types": "^15.7.2"
|
|
38
|
+
},
|
|
39
|
+
"lint-staged": {
|
|
40
|
+
"*/**/*.{js,jsx,json}": [
|
|
41
|
+
"prettier --write",
|
|
42
|
+
"git add"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/cli": "^7.14.3",
|
|
47
|
+
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
|
48
|
+
"@babel/plugin-proposal-logical-assignment-operators": "^7.16.0",
|
|
49
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
|
|
50
|
+
"@babel/plugin-proposal-optional-chaining": "^7.14.2",
|
|
51
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
52
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.18.6",
|
|
53
|
+
"@babel/preset-react": "^7.13.13",
|
|
54
|
+
"@storybook/addon-actions": "6.2.9",
|
|
55
|
+
"@storybook/addon-essentials": "6.2.9",
|
|
56
|
+
"@storybook/addon-links": "6.2.9",
|
|
57
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
58
|
+
"@storybook/react": "6.2.9",
|
|
59
|
+
"@storybook/test-runner": "^0.7.1",
|
|
60
|
+
"autoprefixer": "^10.3.1",
|
|
61
|
+
"babel-loader": "^8.2.2",
|
|
62
|
+
"eslint": "^8.4.1",
|
|
63
|
+
"eslint-plugin-react": "^7.27.1",
|
|
64
|
+
"eslint-plugin-regex": "^1.10.0",
|
|
65
|
+
"husky": "^7.0.4",
|
|
66
|
+
"jest": "^27.5.1",
|
|
67
|
+
"lint-staged": "^12.1.2",
|
|
68
|
+
"mkdirp": "^1.0.4",
|
|
69
|
+
"npm-run-all": "^4.1.5",
|
|
70
|
+
"onchange": "^7.1.0",
|
|
71
|
+
"postcss-flexbugs-fixes": "^5.0.2",
|
|
72
|
+
"react": "^17.0.1",
|
|
73
|
+
"react-dom": "^17.0.1",
|
|
74
|
+
"rimraf": "^3.0.2",
|
|
75
|
+
"run-script-os": "^1.1.6",
|
|
76
|
+
"sass": "1.58.3"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/readme.md
CHANGED
|
@@ -42,6 +42,10 @@ npm test
|
|
|
42
42
|
|
|
43
43
|
## Changelog
|
|
44
44
|
|
|
45
|
+
## 1.4.52
|
|
46
|
+
- \[Fixed\]: DropDown - Fix bug search data in Dropdown
|
|
47
|
+
- \[Fixed\]: NumberInput – NumberInput Core when changing 'decimalDigit'
|
|
48
|
+
|
|
45
49
|
## 1.4.51
|
|
46
50
|
- \[Changed\]: Treeview - Treeview keeps the search bar visible while scrolling
|
|
47
51
|
- \[Changed\]: DateRangePicker - Quick-selection in DateRangePicker
|