diginet-core-ui 1.3.69-beta.5 → 1.3.69-beta.6
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/money-input/index.js +9 -3
- package/components/form-control/number-input/index2.js +18 -18
- package/components/form-control/phone-input/index.js +7 -7
- package/components/paging/page-info.js +23 -23
- package/components/paging/page-selector2.js +23 -23
- package/package.json +2 -2
|
@@ -124,6 +124,7 @@ const MoneyInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
124
124
|
prefix,
|
|
125
125
|
suffix,
|
|
126
126
|
labelProps,
|
|
127
|
+
helperTextProps,
|
|
127
128
|
...props
|
|
128
129
|
}, reference) => {
|
|
129
130
|
const ref = useRef(null);
|
|
@@ -446,9 +447,11 @@ const MoneyInput = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
446
447
|
onKeyUp: onKeyUp,
|
|
447
448
|
onPaste: onPasteHandler
|
|
448
449
|
}), isError && jsx(HelperText, {
|
|
449
|
-
disabled: disabled
|
|
450
|
+
disabled: disabled,
|
|
451
|
+
...helperTextProps
|
|
450
452
|
}, error), !isError && validateResult && jsx(HelperText, {
|
|
451
|
-
disabled: disabled
|
|
453
|
+
disabled: disabled,
|
|
454
|
+
...helperTextProps
|
|
452
455
|
}, validateResult));
|
|
453
456
|
}));
|
|
454
457
|
const MoneyInputRoot = css`
|
|
@@ -585,6 +588,9 @@ MoneyInput.propTypes = {
|
|
|
585
588
|
inputRef: PropTypes.any,
|
|
586
589
|
|
|
587
590
|
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label) of label. */
|
|
588
|
-
labelProps: PropTypes.object
|
|
591
|
+
labelProps: PropTypes.object,
|
|
592
|
+
|
|
593
|
+
/** [Props](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) of helper text. */
|
|
594
|
+
helperTextProps: PropTypes.object
|
|
589
595
|
};
|
|
590
596
|
export default MoneyInput;
|
|
@@ -79,13 +79,13 @@ const NumberInput = /*#__PURE__*/forwardRef(({
|
|
|
79
79
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
80
80
|
|
|
81
81
|
if (valueProps || valueProps === 0) valueProps = clamp(valueProps, min, max);
|
|
82
|
-
/**
|
|
83
|
-
* Convert number to format money
|
|
84
|
-
* @param vl {number} - value
|
|
85
|
-
* @type {function(*): number}
|
|
86
|
-
* @return {string}
|
|
87
|
-
* @example 1200300.123 => 1,200,300.123
|
|
88
|
-
* @example 1200300,123 => 1.200.300,123
|
|
82
|
+
/**
|
|
83
|
+
* Convert number to format money
|
|
84
|
+
* @param vl {number} - value
|
|
85
|
+
* @type {function(*): number}
|
|
86
|
+
* @return {string}
|
|
87
|
+
* @example 1200300.123 => 1,200,300.123
|
|
88
|
+
* @example 1200300,123 => 1.200.300,123
|
|
89
89
|
*/
|
|
90
90
|
|
|
91
91
|
const parseNumberToMoney = useCallback((vl, isNumber) => {
|
|
@@ -119,13 +119,13 @@ const NumberInput = /*#__PURE__*/forwardRef(({
|
|
|
119
119
|
|
|
120
120
|
return number;
|
|
121
121
|
}, [decimalSymbol, max, value]);
|
|
122
|
-
/**
|
|
123
|
-
* Convert money to format number
|
|
124
|
-
* @param vl {string} - value
|
|
125
|
-
* @type {function(*): number}
|
|
126
|
-
* @return {number}
|
|
127
|
-
* @example 1,200,300.123 => 1200300.123
|
|
128
|
-
* @example 1.200.300,123 => 1200300.123
|
|
122
|
+
/**
|
|
123
|
+
* Convert money to format number
|
|
124
|
+
* @param vl {string} - value
|
|
125
|
+
* @type {function(*): number}
|
|
126
|
+
* @return {number}
|
|
127
|
+
* @example 1,200,300.123 => 1200300.123
|
|
128
|
+
* @example 1.200.300,123 => 1200300.123
|
|
129
129
|
*/
|
|
130
130
|
|
|
131
131
|
const convertMoneyToNumber = useCallback((vl, isNumber) => {
|
|
@@ -397,10 +397,10 @@ NumberInput.propTypes = {
|
|
|
397
397
|
/** style inline of input in NumberInput component */
|
|
398
398
|
inputStyle: PropTypes.object,
|
|
399
399
|
|
|
400
|
-
/** validation value, argument can:<br/>
|
|
401
|
-
* * string: the validation rule. Example required.<br/>
|
|
402
|
-
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
403
|
-
* * array: the validation rule list, insist object/string
|
|
400
|
+
/** validation value, argument can:<br/>
|
|
401
|
+
* * string: the validation rule. Example required.<br/>
|
|
402
|
+
* * object: the validation rule insist name, property, message. Example {name: 'min', compareValue: 9, message: 'Error'} or {max: 99}<br/>
|
|
403
|
+
* * array: the validation rule list, insist object/string
|
|
404
404
|
*/
|
|
405
405
|
validates: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.array, PropTypes.func]),
|
|
406
406
|
|
|
@@ -397,13 +397,13 @@ PhoneInput.propTypes = {
|
|
|
397
397
|
/** on input function */
|
|
398
398
|
onInput: PropTypes.func,
|
|
399
399
|
|
|
400
|
-
/**
|
|
401
|
-
* on change function. Return a object, example:<br/>
|
|
402
|
-
* {<br/>
|
|
403
|
-
* target: {value: "(+84) 123 456 789", ...}<br/>
|
|
404
|
-
* value: 0123456789<br/>
|
|
405
|
-
* countryCode: 84<br/>
|
|
406
|
-
* }
|
|
400
|
+
/**
|
|
401
|
+
* on change function. Return a object, example:<br/>
|
|
402
|
+
* {<br/>
|
|
403
|
+
* target: {value: "(+84) 123 456 789", ...}<br/>
|
|
404
|
+
* value: 0123456789<br/>
|
|
405
|
+
* countryCode: 84<br/>
|
|
406
|
+
* }
|
|
407
407
|
*/
|
|
408
408
|
onChange: PropTypes.func,
|
|
409
409
|
|
|
@@ -589,23 +589,23 @@ PagingInfo.propTypes = {
|
|
|
589
589
|
/** Callback fired when quantity on per page changed. */
|
|
590
590
|
onChangePerPage: PropTypes.func,
|
|
591
591
|
|
|
592
|
-
/**
|
|
593
|
-
* Callback fired when page number is changing.
|
|
594
|
-
*
|
|
595
|
-
* * prevPage: Page before changed
|
|
596
|
-
* * newPage: Page after changed
|
|
597
|
-
* * cancel(value): Function cancel change page
|
|
598
|
-
* * @param {value} - bool
|
|
592
|
+
/**
|
|
593
|
+
* Callback fired when page number is changing.
|
|
594
|
+
*
|
|
595
|
+
* * prevPage: Page before changed
|
|
596
|
+
* * newPage: Page after changed
|
|
597
|
+
* * cancel(value): Function cancel change page
|
|
598
|
+
* * @param {value} - bool
|
|
599
599
|
*/
|
|
600
600
|
onChangingPage: PropTypes.func,
|
|
601
601
|
|
|
602
|
-
/**
|
|
603
|
-
* Callback fired when quantity on item per page is changing.
|
|
604
|
-
*
|
|
605
|
-
* * prevPerPage: Items per page before changed
|
|
606
|
-
* * newPerPage: Items per page after changed
|
|
607
|
-
* * cancel(value): Function cancel change items per page
|
|
608
|
-
* * @param {value} - bool
|
|
602
|
+
/**
|
|
603
|
+
* Callback fired when quantity on item per page is changing.
|
|
604
|
+
*
|
|
605
|
+
* * prevPerPage: Items per page before changed
|
|
606
|
+
* * newPerPage: Items per page after changed
|
|
607
|
+
* * cancel(value): Function cancel change items per page
|
|
608
|
+
* * @param {value} - bool
|
|
609
609
|
*/
|
|
610
610
|
onChangingPerPage: PropTypes.func,
|
|
611
611
|
|
|
@@ -618,15 +618,15 @@ PagingInfo.propTypes = {
|
|
|
618
618
|
/** Compact type for mobile. */
|
|
619
619
|
typeShort: PropTypes.bool,
|
|
620
620
|
|
|
621
|
-
/**
|
|
622
|
-
* ref methods (ref.current.instance.*method*)
|
|
623
|
-
*
|
|
624
|
-
* * onChangePage(page): Change page number
|
|
625
|
-
* * @param {page} - number
|
|
626
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
627
|
-
* * @param {per} - number
|
|
628
|
-
* * setTotalItems(items): Set total items
|
|
629
|
-
* * @param {items} - number
|
|
621
|
+
/**
|
|
622
|
+
* ref methods (ref.current.instance.*method*)
|
|
623
|
+
*
|
|
624
|
+
* * onChangePage(page): Change page number
|
|
625
|
+
* * @param {page} - number
|
|
626
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
627
|
+
* * @param {per} - number
|
|
628
|
+
* * setTotalItems(items): Set total items
|
|
629
|
+
* * @param {items} - number
|
|
630
630
|
*/
|
|
631
631
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
632
632
|
current: PropTypes.instanceOf(Element)
|
|
@@ -368,23 +368,23 @@ PagingSelector.propTypes = {
|
|
|
368
368
|
/** Callback fired when quantity on per page changed. */
|
|
369
369
|
onChangePerPage: PropTypes.func,
|
|
370
370
|
|
|
371
|
-
/**
|
|
372
|
-
* Callback fired when page number is changing.
|
|
373
|
-
*
|
|
374
|
-
* * prevPage: Page before changed
|
|
375
|
-
* * newPage: Page after changed
|
|
376
|
-
* * cancel(value): Function cancel change page
|
|
377
|
-
* * @param {value} - bool
|
|
371
|
+
/**
|
|
372
|
+
* Callback fired when page number is changing.
|
|
373
|
+
*
|
|
374
|
+
* * prevPage: Page before changed
|
|
375
|
+
* * newPage: Page after changed
|
|
376
|
+
* * cancel(value): Function cancel change page
|
|
377
|
+
* * @param {value} - bool
|
|
378
378
|
*/
|
|
379
379
|
onChangingPage: PropTypes.func,
|
|
380
380
|
|
|
381
|
-
/**
|
|
382
|
-
* Callback fired when quantity on item per page is changing.
|
|
383
|
-
*
|
|
384
|
-
* * prevPerPage: Items per page before changed
|
|
385
|
-
* * newPerPage: Items per page after changed
|
|
386
|
-
* * cancel(value): Function cancel change items per page
|
|
387
|
-
* * @param {value} - bool
|
|
381
|
+
/**
|
|
382
|
+
* Callback fired when quantity on item per page is changing.
|
|
383
|
+
*
|
|
384
|
+
* * prevPerPage: Items per page before changed
|
|
385
|
+
* * newPerPage: Items per page after changed
|
|
386
|
+
* * cancel(value): Function cancel change items per page
|
|
387
|
+
* * @param {value} - bool
|
|
388
388
|
*/
|
|
389
389
|
onChangingPerPage: PropTypes.func,
|
|
390
390
|
|
|
@@ -394,15 +394,15 @@ PagingSelector.propTypes = {
|
|
|
394
394
|
/** Total items. */
|
|
395
395
|
totalItems: PropTypes.number,
|
|
396
396
|
|
|
397
|
-
/**
|
|
398
|
-
* ref methods (ref.current.instance.*method*)
|
|
399
|
-
*
|
|
400
|
-
* * onChangePage(page): Change page number
|
|
401
|
-
* * @param {page} - number
|
|
402
|
-
* * onChangePerPage(per): Change quantity on per page
|
|
403
|
-
* * @param {per} - number
|
|
404
|
-
* * setTotalItems(items): Set total items
|
|
405
|
-
* * @param {items} - number
|
|
397
|
+
/**
|
|
398
|
+
* ref methods (ref.current.instance.*method*)
|
|
399
|
+
*
|
|
400
|
+
* * onChangePage(page): Change page number
|
|
401
|
+
* * @param {page} - number
|
|
402
|
+
* * onChangePerPage(per): Change quantity on per page
|
|
403
|
+
* * @param {per} - number
|
|
404
|
+
* * setTotalItems(items): Set total items
|
|
405
|
+
* * @param {items} - number
|
|
406
406
|
*/
|
|
407
407
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
408
408
|
current: PropTypes.instanceOf(Element)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diginet-core-ui",
|
|
3
|
-
"version": "1.3.69-beta.
|
|
3
|
+
"version": "1.3.69-beta.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
25
|
"lint": "eslint --fix --config .eslintrc.js \"**/*.js\"",
|
|
26
26
|
"eslint-test": "onchange \"src/**/*.{js,jsx,json}\" -- eslint . --fix",
|
|
27
|
-
"test-storybook": "test-storybook"
|
|
27
|
+
"test-storybook": "test-storybook --url http://localhost:9050"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@emotion/core": "^10.0.35",
|