diginet-core-ui 1.3.75 → 1.3.76
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/avatar/index.js +19 -19
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +21 -21
- package/components/button/index.js +13 -13
- package/components/form-control/attachment/index.js +21 -21
- package/components/form-control/checkbox/index.js +41 -37
- package/components/form-control/date-picker/index.js +1 -4
- package/components/form-control/date-range-picker/index.js +6 -6
- package/components/form-control/dropdown/index.js +43 -39
- package/components/form-control/helper-text/index.js +29 -15
- package/components/form-control/number-input/index2.js +152 -147
- package/components/form-control/text-input/index.js +4 -4
- package/components/paging/page-info.js +23 -23
- package/components/paging/page-selector2.js +23 -23
- package/components/popover/index.js +21 -21
- package/components/progress/circular.js +201 -145
- package/components/tab/tab-container.js +19 -17
- package/components/tab/tab-header.js +37 -35
- package/components/tab/tab-panel.js +13 -11
- package/components/tab/tab.js +16 -14
- package/components/tooltip/index.js +61 -58
- package/components/tree-view/index.js +38 -38
- package/components/typography/index.js +10 -10
- package/icons/effect.js +15 -15
- package/package.json +1 -1
- package/readme.md +11 -0
- package/styles/general.js +11 -11
- package/utils/useInput.js +4 -1
|
@@ -437,15 +437,15 @@ Avatar.propTypes = {
|
|
|
437
437
|
/** If `true`, display remove avatar icon. */
|
|
438
438
|
clearAble: PropTypes.bool,
|
|
439
439
|
|
|
440
|
-
/**
|
|
441
|
-
* data to display when hoverAble is true<br />
|
|
442
|
-
* data is an object or function return a jsx element
|
|
440
|
+
/**
|
|
441
|
+
* data to display when hoverAble is true<br />
|
|
442
|
+
* data is an object or function return a jsx element
|
|
443
443
|
*/
|
|
444
444
|
data: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
|
|
445
445
|
|
|
446
|
-
/**
|
|
447
|
-
* it is used to display the default if there is no src<br />
|
|
448
|
-
* if undefined, will display icons available in the icons store
|
|
446
|
+
/**
|
|
447
|
+
* it is used to display the default if there is no src<br />
|
|
448
|
+
* if undefined, will display icons available in the icons store
|
|
449
449
|
*/
|
|
450
450
|
defaultSrc: PropTypes.string,
|
|
451
451
|
|
|
@@ -500,19 +500,19 @@ Avatar.propTypes = {
|
|
|
500
500
|
/** the error to show on wrong type */
|
|
501
501
|
wrongTypeError: PropTypes.string,
|
|
502
502
|
|
|
503
|
-
/**
|
|
504
|
-
* ref methods
|
|
505
|
-
*
|
|
506
|
-
* * option(): Gets all UI component properties
|
|
507
|
-
* * Returns value - object
|
|
508
|
-
* * option(optionName): Gets the value of a single property
|
|
509
|
-
* * @param {optionName} - string
|
|
510
|
-
* * Returns value - any
|
|
511
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
512
|
-
* * @param {optionName} - string
|
|
513
|
-
* * @param {optionValue} - any
|
|
514
|
-
* * option(options): Updates the values of several properties
|
|
515
|
-
* * @param {options} - object
|
|
503
|
+
/**
|
|
504
|
+
* ref methods
|
|
505
|
+
*
|
|
506
|
+
* * option(): Gets all UI component properties
|
|
507
|
+
* * Returns value - object
|
|
508
|
+
* * option(optionName): Gets the value of a single property
|
|
509
|
+
* * @param {optionName} - string
|
|
510
|
+
* * Returns value - any
|
|
511
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
512
|
+
* * @param {optionName} - string
|
|
513
|
+
* * @param {optionValue} - any
|
|
514
|
+
* * option(options): Updates the values of several properties
|
|
515
|
+
* * @param {options} - object
|
|
516
516
|
*/
|
|
517
517
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
518
518
|
current: PropTypes.instanceOf(Element)
|
|
@@ -213,11 +213,11 @@ Badge.propTypes = {
|
|
|
213
213
|
/** other icon props when use prop name */
|
|
214
214
|
iconProps: PropTypes.object,
|
|
215
215
|
|
|
216
|
-
/** size of Badge
|
|
217
|
-
*
|
|
218
|
-
* * medium (dot 8px, typography p3)
|
|
219
|
-
* * large (button 10px, typography p2)
|
|
220
|
-
* * giant (button 12px, typography p1)
|
|
216
|
+
/** size of Badge
|
|
217
|
+
*
|
|
218
|
+
* * medium (dot 8px, typography p3)
|
|
219
|
+
* * large (button 10px, typography p2)
|
|
220
|
+
* * giant (button 12px, typography p1)
|
|
221
221
|
* */
|
|
222
222
|
size: PropTypes.oneOf(['medium', 'large', 'giant']),
|
|
223
223
|
|
|
@@ -376,14 +376,14 @@ ButtonIcon.propTypes = {
|
|
|
376
376
|
/** Name of [icon](https://core.diginet.com.vn/ui/?path=/story/icon-basic). */
|
|
377
377
|
name: PropTypes.string,
|
|
378
378
|
|
|
379
|
-
/**
|
|
380
|
-
* The size of the component.
|
|
381
|
-
*
|
|
382
|
-
* * tiny (button 24px, icon 16px)
|
|
383
|
-
* * small (button 32px, icon 20px)
|
|
384
|
-
* * medium (button 40px, icon 24px)
|
|
385
|
-
* * large (button 48px, icon 32px)
|
|
386
|
-
* * giant (button 56px, icon 40px)
|
|
379
|
+
/**
|
|
380
|
+
* The size of the component.
|
|
381
|
+
*
|
|
382
|
+
* * tiny (button 24px, icon 16px)
|
|
383
|
+
* * small (button 32px, icon 20px)
|
|
384
|
+
* * medium (button 40px, icon 24px)
|
|
385
|
+
* * large (button 48px, icon 32px)
|
|
386
|
+
* * giant (button 56px, icon 40px)
|
|
387
387
|
* */
|
|
388
388
|
size: PropTypes.oneOf(['tiny', 'small', 'medium', 'large', 'giant']),
|
|
389
389
|
|
|
@@ -399,19 +399,19 @@ ButtonIcon.propTypes = {
|
|
|
399
399
|
/** Width of the component. */
|
|
400
400
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
401
401
|
|
|
402
|
-
/**
|
|
403
|
-
* ref methods (ref.current.instance.*method*)
|
|
404
|
-
*
|
|
405
|
-
* * option(): Gets all UI component properties
|
|
406
|
-
* * Returns value - object
|
|
407
|
-
* * option(optionName): Gets the value of a single property
|
|
408
|
-
* * @param {optionName} - string
|
|
409
|
-
* * Returns value - any
|
|
410
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
411
|
-
* * @param {optionName} - string
|
|
412
|
-
* * @param {optionValue} - any
|
|
413
|
-
* * option(options): Updates the values of several properties
|
|
414
|
-
* * @param {options} - object
|
|
402
|
+
/**
|
|
403
|
+
* ref methods (ref.current.instance.*method*)
|
|
404
|
+
*
|
|
405
|
+
* * option(): Gets all UI component properties
|
|
406
|
+
* * Returns value - object
|
|
407
|
+
* * option(optionName): Gets the value of a single property
|
|
408
|
+
* * @param {optionName} - string
|
|
409
|
+
* * Returns value - any
|
|
410
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
411
|
+
* * @param {optionName} - string
|
|
412
|
+
* * @param {optionValue} - any
|
|
413
|
+
* * option(options): Updates the values of several properties
|
|
414
|
+
* * @param {options} - object
|
|
415
415
|
*/
|
|
416
416
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
417
417
|
current: PropTypes.instanceOf(Element)
|
|
@@ -491,19 +491,19 @@ Button.propTypes = {
|
|
|
491
491
|
/** The variant to use. */
|
|
492
492
|
viewType: PropTypes.oneOf(['text', 'outlined', 'filled', 'link']),
|
|
493
493
|
|
|
494
|
-
/**
|
|
495
|
-
* ref methods (ref.current.instance.*method*)
|
|
496
|
-
*
|
|
497
|
-
* * option(): Gets all UI component properties
|
|
498
|
-
* * Returns value - object
|
|
499
|
-
* * option(optionName): Gets the value of a single property
|
|
500
|
-
* * @param {optionName} - string
|
|
501
|
-
* * Returns value - any
|
|
502
|
-
* * option(optionName, optionValue): Updates the value of a single property
|
|
503
|
-
* * @param {optionName} - string
|
|
504
|
-
* * @param {optionValue} - any
|
|
505
|
-
* * option(options): Updates the values of several properties
|
|
506
|
-
* * @param {options} - object
|
|
494
|
+
/**
|
|
495
|
+
* ref methods (ref.current.instance.*method*)
|
|
496
|
+
*
|
|
497
|
+
* * option(): Gets all UI component properties
|
|
498
|
+
* * Returns value - object
|
|
499
|
+
* * option(optionName): Gets the value of a single property
|
|
500
|
+
* * @param {optionName} - string
|
|
501
|
+
* * Returns value - any
|
|
502
|
+
* * option(optionName, optionValue): Updates the value of a single property
|
|
503
|
+
* * @param {optionName} - string
|
|
504
|
+
* * @param {optionValue} - any
|
|
505
|
+
* * option(options): Updates the values of several properties
|
|
506
|
+
* * @param {options} - object
|
|
507
507
|
*/
|
|
508
508
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
509
509
|
current: PropTypes.instanceOf(Element)
|
|
@@ -1791,17 +1791,17 @@ Attachment.propTypes = {
|
|
|
1791
1791
|
/** Class for component. */
|
|
1792
1792
|
className: PropTypes.string,
|
|
1793
1793
|
|
|
1794
|
-
/** List attachment:<br />
|
|
1795
|
-
* [{<br />
|
|
1796
|
-
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1797
|
-
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1798
|
-
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1799
|
-
* "FileSize": 248837,<br />
|
|
1800
|
-
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1801
|
-
* "CreateUserID": "LEMONADMIN",<br />
|
|
1802
|
-
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1803
|
-
* "UserName": "Quản trị hệ thống"<br />
|
|
1804
|
-
* }, ...]
|
|
1794
|
+
/** List attachment:<br />
|
|
1795
|
+
* [{<br />
|
|
1796
|
+
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1797
|
+
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1798
|
+
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1799
|
+
* "FileSize": 248837,<br />
|
|
1800
|
+
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1801
|
+
* "CreateUserID": "LEMONADMIN",<br />
|
|
1802
|
+
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1803
|
+
* "UserName": "Quản trị hệ thống"<br />
|
|
1804
|
+
* }, ...]
|
|
1805
1805
|
*/
|
|
1806
1806
|
data: PropTypes.array,
|
|
1807
1807
|
|
|
@@ -1844,16 +1844,16 @@ Attachment.propTypes = {
|
|
|
1844
1844
|
/** Download attached event, if not it will use default. */
|
|
1845
1845
|
onDownload: PropTypes.func,
|
|
1846
1846
|
|
|
1847
|
-
/**
|
|
1848
|
-
* event when removed file(s)
|
|
1849
|
-
*
|
|
1850
|
-
* return data: {<br/>
|
|
1851
|
-
* attached: [Files] (insist old and all new files )<br/>
|
|
1852
|
-
* allNewAttached: [Files]<br/>
|
|
1853
|
-
* oldAttached: [Files]<br/>
|
|
1854
|
-
* removedAttached: [Files]<br/>
|
|
1855
|
-
* element: [NodeList (just removed)]<br/>
|
|
1856
|
-
* }
|
|
1847
|
+
/**
|
|
1848
|
+
* event when removed file(s)
|
|
1849
|
+
*
|
|
1850
|
+
* return data: {<br/>
|
|
1851
|
+
* attached: [Files] (insist old and all new files )<br/>
|
|
1852
|
+
* allNewAttached: [Files]<br/>
|
|
1853
|
+
* oldAttached: [Files]<br/>
|
|
1854
|
+
* removedAttached: [Files]<br/>
|
|
1855
|
+
* element: [NodeList (just removed)]<br/>
|
|
1856
|
+
* }
|
|
1857
1857
|
*/
|
|
1858
1858
|
onRemove: PropTypes.func,
|
|
1859
1859
|
|
|
@@ -5,8 +5,8 @@ import { css, jsx } from '@emotion/core';
|
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { forwardRef, memo, useEffect, useRef, useState, useImperativeHandle, Fragment } from 'react';
|
|
7
7
|
import { Typography } from '../..';
|
|
8
|
-
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative, cursorNoDrop, parseWidthHeight } from '../../../styles/general';
|
|
9
|
-
import { randomString } from '../../../utils';
|
|
8
|
+
import { alignCenter, alignStart, borderBox, cursorPointer, displayBlock, flexRow, positionAbsolute, positionRelative, cursorNoDrop, parseWidthHeight, border } from '../../../styles/general';
|
|
9
|
+
import { classNames, randomString, refType as ref } from '../../../utils';
|
|
10
10
|
import { color as colors } from '../../../styles/colors';
|
|
11
11
|
import theme from '../../../theme/settings';
|
|
12
12
|
const {
|
|
@@ -29,26 +29,27 @@ const {
|
|
|
29
29
|
} = theme;
|
|
30
30
|
const padding = spacing(0.75);
|
|
31
31
|
const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
32
|
-
|
|
32
|
+
action = {},
|
|
33
|
+
checked,
|
|
34
|
+
children,
|
|
33
35
|
className,
|
|
34
|
-
disabled,
|
|
35
|
-
readOnly,
|
|
36
|
-
name,
|
|
37
|
-
label,
|
|
38
36
|
color,
|
|
39
|
-
value,
|
|
40
|
-
checked,
|
|
41
37
|
defaultChecked,
|
|
42
38
|
determinate,
|
|
43
|
-
|
|
44
|
-
inputRef,
|
|
45
|
-
children,
|
|
46
|
-
inputProps,
|
|
39
|
+
disabled,
|
|
47
40
|
forTreeView,
|
|
48
|
-
|
|
41
|
+
id,
|
|
42
|
+
inputProps,
|
|
43
|
+
inputRef,
|
|
44
|
+
label,
|
|
49
45
|
labelProps,
|
|
50
|
-
|
|
46
|
+
name,
|
|
47
|
+
onChange,
|
|
48
|
+
readOnly,
|
|
51
49
|
required,
|
|
50
|
+
stopPropagation,
|
|
51
|
+
value,
|
|
52
|
+
width,
|
|
52
53
|
...props
|
|
53
54
|
}, reference) => {
|
|
54
55
|
if (!inputRef) {
|
|
@@ -82,11 +83,11 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
setChecked(checked !== undefined ? Boolean(checked) : !checkedState);
|
|
86
|
+
const currentInputRef = inputRef.current;
|
|
87
|
+
if (!forTreeView) inputRef.current.checked = !checkedState;
|
|
85
88
|
const e = {
|
|
86
89
|
value: forTreeView ? oldLogicChecked : !checkedState,
|
|
87
|
-
target:
|
|
88
|
-
checked: !checkedState
|
|
89
|
-
}
|
|
90
|
+
target: currentInputRef
|
|
90
91
|
};
|
|
91
92
|
if (onChange) onChange(e, checkedState);
|
|
92
93
|
};
|
|
@@ -102,10 +103,12 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
102
103
|
}, [checked]);
|
|
103
104
|
useImperativeHandle(reference, () => {
|
|
104
105
|
const currentRef = ref.current || {};
|
|
106
|
+
currentRef.element = ref.current;
|
|
105
107
|
const _instance = {
|
|
106
108
|
determinate: determinate,
|
|
107
109
|
setChecked: setChecked,
|
|
108
|
-
getChecked: () => checkedState
|
|
110
|
+
getChecked: () => checkedState,
|
|
111
|
+
...action
|
|
109
112
|
}; // methods
|
|
110
113
|
|
|
111
114
|
_instance.__proto__ = {}; // hidden methods
|
|
@@ -121,17 +124,17 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
121
124
|
return jsx("div", {
|
|
122
125
|
id: 'DGN-UI-Checkbox-' + id.replace('DGN-UI-', ''),
|
|
123
126
|
css: CheckboxContainerCSS,
|
|
124
|
-
className:
|
|
127
|
+
className: classNames('DGN-UI-Checkbox', className),
|
|
125
128
|
ref: ref,
|
|
126
129
|
...props,
|
|
127
130
|
onClick: handleChange
|
|
128
131
|
}, jsx("div", {
|
|
129
132
|
css: CheckBoxRootCSS,
|
|
130
|
-
className:
|
|
133
|
+
className: classNames('DGN-UI-Checkbox-Root', disabled && 'disabled', readOnly && 'read-only')
|
|
131
134
|
}, jsx("input", {
|
|
132
135
|
value: value,
|
|
133
136
|
...inputProps,
|
|
134
|
-
className:
|
|
137
|
+
className: classNames(determinate ? 'determinate' : 'indeterminate', inputProps === null || inputProps === void 0 ? void 0 : inputProps.className),
|
|
135
138
|
readOnly: readOnly || inputProps.readOnly,
|
|
136
139
|
disabled: disabled || inputProps.disabled,
|
|
137
140
|
ref: inputRef,
|
|
@@ -145,7 +148,7 @@ const Checkbox = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
145
148
|
}), jsx("label", {
|
|
146
149
|
css: CheckBoxLabelCSS
|
|
147
150
|
}, jsx("span", {
|
|
148
|
-
className:
|
|
151
|
+
className: classNames(determinate ? 'determinate' : 'indeterminate', readOnly && 'read-only', disabled && 'disabled'),
|
|
149
152
|
css: _CheckBoxSquareCSS
|
|
150
153
|
}), (children || label) && jsx(Typography, {
|
|
151
154
|
type: 'p1',
|
|
@@ -167,35 +170,33 @@ const CheckBoxSquareCSS = (width, clMain) => css`
|
|
|
167
170
|
${cursorPointer};
|
|
168
171
|
${borderBox};
|
|
169
172
|
${parseWidthHeight(width, width)};
|
|
173
|
+
${border(2, rest)};
|
|
170
174
|
min-width: ${width};
|
|
171
175
|
min-height: ${width};
|
|
172
176
|
background-color: ${white};
|
|
173
|
-
border: 2px solid ${rest};
|
|
174
177
|
border-radius: 2px;
|
|
175
178
|
margin: ${padding}px;
|
|
176
179
|
&.determinate {
|
|
177
180
|
&::after {
|
|
178
181
|
${displayBlock};
|
|
179
182
|
${positionAbsolute};
|
|
183
|
+
${parseWidthHeight(12.6, 7)};
|
|
180
184
|
content: '';
|
|
181
|
-
height: 7px;
|
|
182
185
|
left: 50%;
|
|
183
186
|
top: 43%;
|
|
184
187
|
transform: translate(-50%, -50%) scale(0) rotate(45deg);
|
|
185
188
|
transition: transform 0.3s;
|
|
186
|
-
width: 12.6px;
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
&.indeterminate {
|
|
190
192
|
&::after {
|
|
191
193
|
${flexRow};
|
|
192
194
|
${positionAbsolute};
|
|
195
|
+
${parseWidthHeight(10, 2)};
|
|
193
196
|
content: '';
|
|
194
197
|
background-color: white;
|
|
195
198
|
left: 2px;
|
|
196
199
|
top: 6px;
|
|
197
|
-
width: 10px;
|
|
198
|
-
height: 2px;
|
|
199
200
|
transition: transform 0.3s;
|
|
200
201
|
transform: scale(0);
|
|
201
202
|
}
|
|
@@ -278,17 +279,17 @@ const CheckboxContainerCSS = css`
|
|
|
278
279
|
width: fit-content;
|
|
279
280
|
`;
|
|
280
281
|
Checkbox.defaultProps = {
|
|
281
|
-
label: '',
|
|
282
282
|
className: '',
|
|
283
283
|
color: 'primary',
|
|
284
|
-
disabled: false,
|
|
285
|
-
readOnly: false,
|
|
286
284
|
defaultChecked: false,
|
|
287
285
|
determinate: true,
|
|
286
|
+
disabled: false,
|
|
288
287
|
inputProps: {},
|
|
288
|
+
label: '',
|
|
289
289
|
labelProps: {},
|
|
290
|
-
|
|
291
|
-
stopPropagation: true
|
|
290
|
+
readOnly: false,
|
|
291
|
+
stopPropagation: true,
|
|
292
|
+
width: 18
|
|
292
293
|
};
|
|
293
294
|
Checkbox.propTypes = {
|
|
294
295
|
/** If `true`, the component is checked. */
|
|
@@ -315,6 +316,9 @@ Checkbox.propTypes = {
|
|
|
315
316
|
/** [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element. */
|
|
316
317
|
inputProps: PropTypes.object,
|
|
317
318
|
|
|
319
|
+
/** Pass a ref to the input element. */
|
|
320
|
+
inputRef: ref,
|
|
321
|
+
|
|
318
322
|
/** The name of the Radio is displayed on the interface. */
|
|
319
323
|
label: PropTypes.string,
|
|
320
324
|
|
|
@@ -334,13 +338,13 @@ Checkbox.propTypes = {
|
|
|
334
338
|
/** If `true`, the component is readonly. */
|
|
335
339
|
readOnly: PropTypes.bool,
|
|
336
340
|
|
|
337
|
-
/**
|
|
338
|
-
|
|
341
|
+
/** If `true`, the label will indicate that the checkbox is required. */
|
|
342
|
+
required: PropTypes.bool,
|
|
339
343
|
|
|
340
344
|
/** The value of input */
|
|
341
345
|
value: PropTypes.any,
|
|
342
346
|
|
|
343
|
-
/**
|
|
344
|
-
|
|
347
|
+
/** The width of checkbox. */
|
|
348
|
+
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
345
349
|
};
|
|
346
350
|
export default Checkbox;
|
|
@@ -536,10 +536,7 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
536
536
|
required: required,
|
|
537
537
|
...labelProps
|
|
538
538
|
}, label), jsx(Tooltip, {
|
|
539
|
-
title: (ipRef === null || ipRef === void 0 ? void 0 : (_ipRef$current = ipRef.current) === null || _ipRef$current === void 0 ? void 0 : _ipRef$current.clientWidth) < 200 ? ipRef === null || ipRef === void 0 ? void 0 : (_ipRef$current2 = ipRef.current) === null || _ipRef$current2 === void 0 ? void 0 : _ipRef$current2.value : ''
|
|
540
|
-
style: {
|
|
541
|
-
width: 'none'
|
|
542
|
-
}
|
|
539
|
+
title: (ipRef === null || ipRef === void 0 ? void 0 : (_ipRef$current = ipRef.current) === null || _ipRef$current === void 0 ? void 0 : _ipRef$current.clientWidth) < 200 ? ipRef === null || ipRef === void 0 ? void 0 : (_ipRef$current2 = ipRef.current) === null || _ipRef$current2 === void 0 ? void 0 : _ipRef$current2.value : ''
|
|
543
540
|
}, jsx(InputBase, {
|
|
544
541
|
inputProps: {
|
|
545
542
|
placeholder: !readOnly && !disabled ? placeholder : '',
|
|
@@ -463,8 +463,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
463
463
|
tableData = [],
|
|
464
464
|
weekDateFirst = getDateOfWeek(firstDay),
|
|
465
465
|
weekDateLast = getDateOfWeek(lastDay);
|
|
466
|
-
/**
|
|
467
|
-
* days of previous month
|
|
466
|
+
/**
|
|
467
|
+
* days of previous month
|
|
468
468
|
*/
|
|
469
469
|
|
|
470
470
|
for (let i = weekDateFirst; i > 0; i--) {
|
|
@@ -477,8 +477,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
477
477
|
className: unique.day.day
|
|
478
478
|
})));
|
|
479
479
|
}
|
|
480
|
-
/**
|
|
481
|
-
* days of current month
|
|
480
|
+
/**
|
|
481
|
+
* days of current month
|
|
482
482
|
*/
|
|
483
483
|
|
|
484
484
|
|
|
@@ -492,8 +492,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
492
492
|
}, jsx(Typography, { ...typographyProps(unique.day.day)
|
|
493
493
|
}, i + 1)));
|
|
494
494
|
}
|
|
495
|
-
/**
|
|
496
|
-
* days of next month
|
|
495
|
+
/**
|
|
496
|
+
* days of next month
|
|
497
497
|
*/
|
|
498
498
|
|
|
499
499
|
|
|
@@ -1574,8 +1574,10 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1574
1574
|
content: '${placeholder}';
|
|
1575
1575
|
color: ${sub};
|
|
1576
1576
|
height: 100%;
|
|
1577
|
-
${
|
|
1578
|
-
|
|
1577
|
+
${overflowHidden}
|
|
1578
|
+
display: -webkit-box;
|
|
1579
|
+
-webkit-line-clamp: 1;
|
|
1580
|
+
-webkit-box-orient: vertical;
|
|
1579
1581
|
}
|
|
1580
1582
|
&::placeholder {
|
|
1581
1583
|
color: ${sub};
|
|
@@ -1629,8 +1631,10 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1629
1631
|
content: '${placeholder}';
|
|
1630
1632
|
color: ${sub};
|
|
1631
1633
|
height: 100%;
|
|
1632
|
-
${
|
|
1633
|
-
|
|
1634
|
+
${overflowHidden}
|
|
1635
|
+
display: -webkit-box;
|
|
1636
|
+
-webkit-line-clamp: 1;
|
|
1637
|
+
-webkit-box-orient: vertical;
|
|
1634
1638
|
}
|
|
1635
1639
|
&::placeholder {
|
|
1636
1640
|
color: ${sub};
|
|
@@ -1850,14 +1854,14 @@ Dropdown.propTypes = {
|
|
|
1850
1854
|
/** The icon to display if not found the icon follow `iconExpr`. */
|
|
1851
1855
|
iconDefault: PropTypes.string,
|
|
1852
1856
|
|
|
1853
|
-
/** Field name used for icon display.<br/>
|
|
1854
|
-
* Example:<br/>
|
|
1855
|
-
* string: 'icon'<br/>
|
|
1856
|
-
* object: {<br/>
|
|
1857
|
-
* key: 'icon',<br/>
|
|
1858
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1859
|
-
* suffix: '.jpg'<br/>
|
|
1860
|
-
* }
|
|
1857
|
+
/** Field name used for icon display.<br/>
|
|
1858
|
+
* Example:<br/>
|
|
1859
|
+
* string: 'icon'<br/>
|
|
1860
|
+
* object: {<br/>
|
|
1861
|
+
* key: 'icon',<br/>
|
|
1862
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1863
|
+
* suffix: '.jpg'<br/>
|
|
1864
|
+
* }
|
|
1861
1865
|
*/
|
|
1862
1866
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1863
1867
|
key: PropTypes.string,
|
|
@@ -1872,9 +1876,9 @@ Dropdown.propTypes = {
|
|
|
1872
1876
|
/** The displayed value of component. */
|
|
1873
1877
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1874
1878
|
|
|
1875
|
-
/** Field name used for text display in dropdown list.<br/>
|
|
1876
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1877
|
-
* Note: don't use 'id - name', return undefined
|
|
1879
|
+
/** Field name used for text display in dropdown list.<br/>
|
|
1880
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1881
|
+
* Note: don't use 'id - name', return undefined
|
|
1878
1882
|
*/
|
|
1879
1883
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1880
1884
|
|
|
@@ -1884,10 +1888,10 @@ Dropdown.propTypes = {
|
|
|
1884
1888
|
/** The field name used for the returned result. */
|
|
1885
1889
|
valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1886
1890
|
|
|
1887
|
-
/**
|
|
1888
|
-
* Duration wait enter search content on search.<br/>
|
|
1889
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1890
|
-
* If `true`, used default delayOnInput.
|
|
1891
|
+
/**
|
|
1892
|
+
* Duration wait enter search content on search.<br/>
|
|
1893
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1894
|
+
* If `true`, used default delayOnInput.
|
|
1891
1895
|
*/
|
|
1892
1896
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1893
1897
|
|
|
@@ -1954,19 +1958,19 @@ Dropdown.propTypes = {
|
|
|
1954
1958
|
/** The array of elements that appear in the dropdown list. */
|
|
1955
1959
|
dataSource: PropTypes.array,
|
|
1956
1960
|
|
|
1957
|
-
/** Function displays items by custom.<br/>
|
|
1958
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1959
|
-
* --> such as: displayExpr={'name - role'}
|
|
1961
|
+
/** Function displays items by custom.<br/>
|
|
1962
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1963
|
+
* --> such as: displayExpr={'name - role'}
|
|
1960
1964
|
*/
|
|
1961
1965
|
renderItem: PropTypes.func,
|
|
1962
1966
|
|
|
1963
|
-
/** Function or field name used for display selected items, example:<br/>
|
|
1964
|
-
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1967
|
+
/** Function or field name used for display selected items, example:<br/>
|
|
1968
|
+
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1965
1969
|
*/
|
|
1966
1970
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1967
1971
|
|
|
1968
|
-
/** Callback fired when the input value changes.<br/>
|
|
1969
|
-
* if undefined: the filter function will run (default)
|
|
1972
|
+
/** Callback fired when the input value changes.<br/>
|
|
1973
|
+
* if undefined: the filter function will run (default)
|
|
1970
1974
|
*/
|
|
1971
1975
|
onInput: PropTypes.func,
|
|
1972
1976
|
|
|
@@ -1997,19 +2001,19 @@ Dropdown.propTypes = {
|
|
|
1997
2001
|
/** If `true`, show multi-line selected item(s). */
|
|
1998
2002
|
multilineSelectedItem: PropTypes.bool,
|
|
1999
2003
|
|
|
2000
|
-
/**
|
|
2001
|
-
* ref methods
|
|
2002
|
-
*
|
|
2003
|
-
* how to get component element? ref.current
|
|
2004
|
-
*
|
|
2005
|
-
* how to call method? ref.current.instance.{method}
|
|
2006
|
-
*
|
|
2007
|
-
* * showDropdown(): Show dropdown
|
|
2008
|
-
* * closeDropdown(): Close dropdown
|
|
2009
|
-
* * onClear(): Clear selected value
|
|
2010
|
-
* * setPreviousValue(): Set value to previous value
|
|
2011
|
-
* * setValue(value): Set value of dropdown
|
|
2012
|
-
* * @param {value} - string || number || array
|
|
2004
|
+
/**
|
|
2005
|
+
* ref methods
|
|
2006
|
+
*
|
|
2007
|
+
* how to get component element? ref.current
|
|
2008
|
+
*
|
|
2009
|
+
* how to call method? ref.current.instance.{method}
|
|
2010
|
+
*
|
|
2011
|
+
* * showDropdown(): Show dropdown
|
|
2012
|
+
* * closeDropdown(): Close dropdown
|
|
2013
|
+
* * onClear(): Clear selected value
|
|
2014
|
+
* * setPreviousValue(): Set value to previous value
|
|
2015
|
+
* * setValue(value): Set value of dropdown
|
|
2016
|
+
* * @param {value} - string || number || array
|
|
2013
2017
|
*/
|
|
2014
2018
|
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
2015
2019
|
current: PropTypes.instanceOf(Element)
|