diginet-core-ui 1.3.36 → 1.3.38
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/assets/avatar/default.svg +3 -3
- package/assets/images/icons/wifi.svg +3 -3
- package/assets/images/menu/dhr/ALL.svg +6 -6
- package/assets/images/menu/dhr/D00.svg +12 -12
- package/assets/images/menu/dhr/D09.svg +8 -8
- package/assets/images/menu/dhr/D13.svg +10 -10
- package/assets/images/menu/dhr/D15.svg +10 -10
- package/assets/images/menu/dhr/D21.svg +10 -10
- package/assets/images/menu/dhr/D25.svg +11 -11
- package/assets/images/menu/dhr/D29.svg +11 -11
- package/assets/images/menu/dhr/D38.svg +6 -6
- package/assets/images/menu/dhr/D39.svg +10 -10
- package/assets/images/menu/dhr/D51.svg +12 -12
- package/assets/images/menu/dhr/D52.svg +16 -16
- package/assets/images/menu/dhr/D77.svg +16 -16
- package/assets/images/menu/dhr/D84.svg +12 -12
- package/assets/images/menu/dhr/D89.svg +8 -8
- package/assets/images/menu/dhr/Default.svg +13 -13
- package/assets/images/menu/dhr/MHRM00N0001.svg +14 -14
- package/assets/images/menu/dhr/MHRM09N0002.svg +3 -3
- package/assets/images/menu/dhr/MHRM09N0003.svg +25 -25
- package/assets/images/menu/dhr/MHRM09N0004.svg +14 -14
- package/assets/images/menu/dhr/MHRM09N0005.svg +7 -7
- package/assets/images/menu/dhr/MHRM13N0001.svg +16 -16
- package/assets/images/menu/dhr/MHRM25N0001.svg +26 -26
- package/assets/images/menu/dhr/MHRM29N0001.svg +30 -30
- package/assets/images/menu/dhr/MHRM29N0002.svg +13 -0
- package/assets/images/menu/dhr/MHRM29N0003.svg +17 -0
- package/assets/images/menu/dhr/MHRM29N0015.svg +63 -63
- package/assets/images/menu/dhr/MHRM39N0012.svg +43 -43
- package/assets/images/menu/dhr/MHRM39N0013.svg +24 -24
- package/assets/images/menu/dhr/MHRM39N0014.svg +14 -14
- package/assets/images/menu/dhr/MHRM39N0015.svg +36 -36
- package/assets/images/menu/dhr/MHRM39N0016.svg +23 -23
- package/assets/images/menu/dhr/MHRM77N0001.svg +28 -28
- package/assets/images/menu/dhr/MHRM84N0001.svg +27 -27
- package/assets/images/menu/dhr/MHRM84N0002.svg +24 -24
- package/assets/images/menu/dhr/MHRM89N0001.svg +16 -16
- package/assets/images/menu/dhr/MHRP00N0001.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0001.svg +22 -22
- package/assets/images/menu/dhr/MHRP09N0002.svg +19 -19
- package/assets/images/menu/dhr/MHRP09N0003.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0004.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0005.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0006.svg +17 -17
- package/assets/images/menu/dhr/MHRP09N0007.svg +15 -15
- package/assets/images/menu/dhr/MHRP09N0008.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0009.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0010.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0011.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0012.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0013.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0014.svg +11 -11
- package/assets/images/menu/dhr/MHRP09N0015.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0016.svg +18 -18
- package/assets/images/menu/dhr/MHRP09N0017.svg +18 -18
- package/assets/images/menu/dhr/MHRP09N0018.svg +12 -12
- package/assets/images/menu/dhr/MHRP09N0019.svg +13 -13
- package/assets/images/menu/dhr/MHRP09N0020.svg +17 -17
- package/assets/images/menu/dhr/MHRP09N0021.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0022.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0023.svg +8 -8
- package/assets/images/menu/dhr/MHRP09N0024.svg +15 -15
- package/assets/images/menu/dhr/MHRP09N0025.svg +16 -16
- package/assets/images/menu/dhr/MHRP09N0026.svg +13 -13
- package/assets/images/menu/dhr/MHRP09N0027.svg +10 -10
- package/assets/images/menu/dhr/MHRP09N0028.svg +6 -6
- package/assets/images/menu/dhr/MHRP09N0029.svg +14 -14
- package/assets/images/menu/dhr/MHRP09N0030.svg +4 -4
- package/assets/images/menu/dhr/MHRP09N0031.svg +5 -5
- package/assets/images/menu/dhr/MHRP09N0032.svg +7 -7
- package/assets/images/menu/dhr/MHRP13N0001.svg +9 -9
- package/assets/images/menu/dhr/MHRP21N0001.svg +12 -12
- package/assets/images/menu/dhr/MHRP21N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP25N0001.svg +13 -13
- package/assets/images/menu/dhr/MHRP25N0002.svg +16 -16
- package/assets/images/menu/dhr/MHRP25N0003.svg +38 -38
- package/assets/images/menu/dhr/MHRP25N0004.svg +17 -17
- package/assets/images/menu/dhr/MHRP25N0005.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0001.svg +18 -18
- package/assets/images/menu/dhr/MHRP29N0002.svg +15 -15
- package/assets/images/menu/dhr/MHRP29N0003.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0004.svg +21 -21
- package/assets/images/menu/dhr/MHRP29N0005.svg +21 -21
- package/assets/images/menu/dhr/MHRP29N0006.svg +14 -14
- package/assets/images/menu/dhr/MHRP29N0007.svg +19 -19
- package/assets/images/menu/dhr/MHRP29N0008.svg +20 -20
- package/assets/images/menu/dhr/MHRP29N0009.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0010.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0011.svg +12 -12
- package/assets/images/menu/dhr/MHRP29N0012.svg +7 -7
- package/assets/images/menu/dhr/MHRP29N0013.svg +27 -27
- package/assets/images/menu/dhr/MHRP29N0014.svg +32 -32
- package/assets/images/menu/dhr/MHRP29N0016.svg +54 -54
- package/assets/images/menu/dhr/MHRP29N0017.svg +24 -24
- package/assets/images/menu/dhr/MHRP29N0018.svg +44 -44
- package/assets/images/menu/dhr/MHRP29N0019.svg +17 -17
- package/assets/images/menu/dhr/MHRP29N0020.svg +11 -11
- package/assets/images/menu/dhr/MHRP29N0021.svg +8 -8
- package/assets/images/menu/dhr/MHRP29N0022.svg +9 -9
- package/assets/images/menu/dhr/MHRP29N0023.svg +22 -22
- package/assets/images/menu/dhr/MHRP38N0001.svg +13 -13
- package/assets/images/menu/dhr/MHRP38N0002.svg +14 -14
- package/assets/images/menu/dhr/MHRP39N0001.svg +15 -15
- package/assets/images/menu/dhr/MHRP39N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP39N0003.svg +16 -16
- package/assets/images/menu/dhr/MHRP39N0004.svg +22 -22
- package/assets/images/menu/dhr/MHRP39N0005.svg +16 -16
- package/assets/images/menu/dhr/MHRP39N0006.svg +17 -17
- package/assets/images/menu/dhr/MHRP39N0007.svg +13 -13
- package/assets/images/menu/dhr/MHRP39N0008.svg +3 -3
- package/assets/images/menu/dhr/MHRP39N0009.svg +3 -3
- package/assets/images/menu/dhr/MHRP39N0010.svg +7 -7
- package/assets/images/menu/dhr/MHRP39N0011.svg +14 -14
- package/assets/images/menu/dhr/MHRP39N0013.svg +10 -10
- package/assets/images/menu/dhr/MHRP39N0014.svg +11 -11
- package/assets/images/menu/dhr/MHRP39N0015.svg +5 -5
- package/assets/images/menu/dhr/MHRP39N0017.svg +11 -11
- package/assets/images/menu/dhr/MHRP39N0018.svg +11 -0
- package/assets/images/menu/dhr/MHRP39N1222.svg +12 -12
- package/assets/images/menu/dhr/MHRP51N0001.svg +9 -9
- package/assets/images/menu/dhr/MHRP51N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRP52N0001.svg +21 -21
- package/assets/images/menu/dhr/MHRP52N0002.svg +21 -21
- package/assets/images/menu/dhr/MHRP52N0003.svg +16 -16
- package/assets/images/menu/dhr/MHRP75N0001.svg +19 -19
- package/assets/images/menu/dhr/MHRP75N0002.svg +25 -25
- package/assets/images/menu/dhr/MHRP75N0003.svg +3 -3
- package/assets/images/menu/dhr/MHRP75N0006.svg +14 -14
- package/assets/images/menu/dhr/MHRP75N0007.svg +19 -19
- package/assets/images/menu/dhr/MHRP75N0008.svg +19 -19
- package/assets/images/menu/dhr/MHRP77N0007.svg +28 -28
- package/assets/images/menu/dhr/MHRP77N0008.svg +17 -17
- package/assets/images/menu/dhr/MHRP77N0009.svg +19 -19
- package/assets/images/menu/dhr/MHRP77N0010.svg +20 -20
- package/assets/images/menu/dhr/MHRP89N1000.svg +6 -6
- package/assets/images/menu/dhr/MHRP89N1001.svg +6 -6
- package/assets/images/menu/dhr/TASK.svg +9 -9
- package/assets/images/menu/dhr/W00F0001.svg +3 -3
- package/assets/images/menu/dhr/W00F0002.svg +3 -3
- package/assets/images/menu/dhr/W00F0003.svg +3 -3
- package/assets/images/menu/dhr/W00F0004.svg +3 -3
- package/assets/images/menu/dhr/W09F2000-WEB5.svg +17 -17
- package/assets/images/menu/dhr/W09F2000.svg +6 -6
- package/assets/images/menu/dhr/W09F2002-WEB5.svg +21 -21
- package/assets/images/menu/dhr/W09F2005-WEB5.svg +13 -13
- package/assets/images/menu/dhr/W09F2020-WEB5.svg +16 -16
- package/assets/images/menu/dhr/W09F2022-WEB5.svg +20 -20
- package/assets/images/menu/dhr/W09F2150-WEB5.svg +16 -16
- package/assets/images/menu/dhr/W09F2152-WEB5.svg +20 -20
- package/assets/images/menu/dhr/W09F2160-WEB5.svg +14 -14
- package/assets/images/menu/dhr/W09F2162-WEB5.svg +18 -18
- package/assets/images/menu/dhr/W29F4006-WEB5.svg +19 -19
- package/assets/images/menu/dhr/W75F2260-WEB5.svg +15 -15
- package/assets/images/menu/dhr/W75F2261-WEB5.svg +19 -19
- package/assets/images/menu/dhr/W75F3005-WEB5.svg +13 -13
- package/assets/images/menu/dhr/W75F4070-WEB5.svg +21 -21
- package/assets/images/menu/dhr/W75F4071-WEB5.svg +17 -17
- package/assets/images/menu/dhr/W75F4100-WEB5.svg +14 -14
- package/assets/images/menu/dhr/W77F1011.svg +19 -19
- package/assets/images/menu/dhr/W77F1013.svg +22 -22
- package/assets/images/menu/erp/D05.svg +8 -8
- package/assets/images/menu/erp/D06.svg +4 -4
- package/assets/images/menu/erp/D90R.svg +9 -9
- package/assets/images/menu/erp/DBC.svg +9 -9
- package/assets/images/menu/erp/W00F0001.svg +3 -3
- package/assets/images/menu/erp/W00F0002.svg +3 -3
- package/assets/images/menu/erp/W00F0003.svg +3 -3
- package/assets/images/menu/erp/W00F0004.svg +3 -3
- package/assets/images/menu/erp/W05F0001.svg +16 -16
- package/assets/images/menu/erp/W05F0001N0000.svg +16 -16
- package/assets/images/menu/erp/W05F0004N0000.svg +6 -6
- package/assets/images/menu/erp/W05F0006N0000.svg +30 -30
- package/assets/images/menu/erp/W05F0007N0000.svg +6 -6
- package/assets/images/menu/erp/W05F0008N0000.svg +14 -14
- package/assets/images/menu/erp/W05F0011N0000.svg +20 -20
- package/assets/images/menu/erp/W05F0013N0000.svg +9 -9
- package/assets/images/menu/erp/W05F4000N0000.svg +9 -9
- package/assets/images/menu/erp/W06F0001.svg +17 -17
- package/assets/images/menu/erp/W06F0001N0000.svg +17 -17
- package/assets/images/menu/erp/W06F0004N0000.svg +22 -22
- package/assets/images/menu/erp/W06F0005N0000.svg +22 -22
- package/assets/images/menu/erp/W06F0006N0000.svg +55 -55
- package/assets/images/menu/erp/W06F0008N0000.svg +17 -17
- package/assets/images/menu/erp/W94F1000N0000.svg +9 -9
- package/assets/images/menu/erp/W94F1000N0001.svg +9 -9
- package/assets/images/menu/erp/WA3F1025.svg +5 -5
- package/assets/images/menu/erp/WA3F2100.svg +10 -10
- package/components/accordion/css.js +42 -35
- package/components/accordion/details.js +48 -42
- package/components/accordion/group.js +88 -82
- package/components/accordion/index.js +54 -48
- package/components/accordion/summary.js +52 -43
- package/components/alert/index.js +115 -103
- package/components/alert/notify.js +16 -18
- package/components/badge/index.js +5 -5
- package/components/button/icon.js +21 -21
- package/components/button/index.js +13 -13
- package/components/chart/Pie/Sector.js +2 -2
- package/components/chart/Pie-v2/Sector.js +2 -2
- package/components/chip/attach.js +5 -5
- package/components/chip/index.js +13 -10
- package/components/divider/index.js +17 -15
- package/components/form-control/attachment/index.js +1 -0
- package/components/form-control/calendar/function.js +295 -289
- package/components/form-control/calendar/index.js +16 -16
- package/components/form-control/checkbox/index.js +5 -5
- package/components/form-control/date-picker/index.js +7 -3
- package/components/form-control/date-range-picker/index.js +12 -8
- package/components/form-control/dropdown/index.js +139 -81
- package/components/form-control/input-base/index.js +32 -27
- package/components/form-control/money-input/index.js +17 -17
- package/components/form-control/number-input/index.js +11 -11
- package/components/form-control/number-input/index2.js +432 -0
- package/components/form-control/phone-input/index.js +7 -7
- package/components/form-control/radio/index.js +98 -146
- package/components/form-control/text-input/index.js +4 -4
- package/components/form-control/time-picker/index.js +305 -300
- package/components/form-control/toggle/index.js +92 -90
- package/components/index.js +1 -1
- package/components/modal/header.js +63 -65
- package/components/modal/modal.js +84 -130
- package/components/paging/page-selector.js +53 -49
- package/components/popup/index.js +5 -1
- package/components/popup/proposals_popup.js +5 -1
- package/components/popup/v2/index.js +12 -8
- package/components/progress/circular.js +12 -12
- package/components/rating/index.js +3 -3
- package/components/slider/slider-item.js +65 -25
- package/components/tab/tab-container.js +2 -2
- package/components/tab/tab-header.js +2 -2
- package/components/tab/tab-panel.js +2 -2
- package/components/tab/tab.js +2 -2
- package/components/transfer/index.js +3 -3
- package/components/tree-view/index.js +38 -38
- package/components/typography/index.js +10 -10
- package/icons/basic.js +75 -408
- package/icons/effect.js +15 -15
- package/package.json +45 -45
- package/readme.md +677 -654
- package/styles/color-helper.js +103 -103
- package/styles/colors.js +7 -7
- package/styles/general.js +40 -12
- package/styles/utils.js +5 -5
- package/theme/set-theme.js +3 -3
- package/theme/settings.js +3 -2
- package/utils/array/array.js +36 -36
- package/utils/date.js +56 -56
- package/utils/error/error.js +2 -2
- package/utils/error/errors.js +99 -99
- package/utils/number.js +6 -6
- package/utils/render-portal.js +5 -1
- package/utils/renderIcon.js +5 -5
- package/utils/useOnClickOutside.js +2 -2
- package/utils/usePortal.js +9 -9
- package/utils/validate.js +33 -33
|
@@ -41,8 +41,8 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
41
41
|
limit: 'DGN-UI-Calendar-Day-limit'
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
/**
|
|
45
|
-
* START REFERENCE
|
|
44
|
+
/**
|
|
45
|
+
* START REFERENCE
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
const ref = useRef(null);
|
|
@@ -61,12 +61,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
61
61
|
};
|
|
62
62
|
const firstDayOfMax = new Date(new Date(max).setDate(1)).setHours(0, 0, 0, 0);
|
|
63
63
|
const firstDayOfMin = new Date(new Date(min).setDate(1)).setHours(0, 0, 0, 0);
|
|
64
|
-
/**
|
|
65
|
-
* END REFERENCE
|
|
64
|
+
/**
|
|
65
|
+
* END REFERENCE
|
|
66
66
|
*/
|
|
67
67
|
|
|
68
|
-
/**
|
|
69
|
-
* START FUNCTION
|
|
68
|
+
/**
|
|
69
|
+
* START FUNCTION
|
|
70
70
|
*/
|
|
71
71
|
|
|
72
72
|
const onUpdateNavigatorValue = useCallback(value => {
|
|
@@ -152,12 +152,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
152
152
|
onUpdateCalendar(time, navigatorRefs, min, max, tableRef.current, activeValue.current, unique, displayAnotherMonth, onDayClick, onUpdateNavigatorValue);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
/**
|
|
156
|
-
* END FUNCTION
|
|
155
|
+
/**
|
|
156
|
+
* END FUNCTION
|
|
157
157
|
*/
|
|
158
158
|
|
|
159
|
-
/**
|
|
160
|
-
* START EFFECT
|
|
159
|
+
/**
|
|
160
|
+
* START EFFECT
|
|
161
161
|
*/
|
|
162
162
|
|
|
163
163
|
|
|
@@ -198,12 +198,12 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
198
198
|
onUpdate(activeValue.current);
|
|
199
199
|
}
|
|
200
200
|
}, [onClick, min, max]);
|
|
201
|
-
/**
|
|
202
|
-
* END FUNCTION
|
|
201
|
+
/**
|
|
202
|
+
* END FUNCTION
|
|
203
203
|
*/
|
|
204
204
|
|
|
205
|
-
/**
|
|
206
|
-
* START COMPONENT
|
|
205
|
+
/**
|
|
206
|
+
* START COMPONENT
|
|
207
207
|
*/
|
|
208
208
|
|
|
209
209
|
const tableMemo = jsx("div", {
|
|
@@ -212,8 +212,8 @@ const Calendar = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
212
212
|
className: unique.table.table,
|
|
213
213
|
ref: tableRef
|
|
214
214
|
}, renderHeader(unique), jsx("tbody", null)));
|
|
215
|
-
/**
|
|
216
|
-
* END COMPONENT
|
|
215
|
+
/**
|
|
216
|
+
* END COMPONENT
|
|
217
217
|
*/
|
|
218
218
|
|
|
219
219
|
return jsx("div", { ...props,
|
|
@@ -318,11 +318,11 @@ Checkbox.propTypes = {
|
|
|
318
318
|
/** The function will run to return a true or false value of Radio Component */
|
|
319
319
|
onChange: PropTypes.func,
|
|
320
320
|
|
|
321
|
-
/**
|
|
322
|
-
* ref methods
|
|
323
|
-
*
|
|
324
|
-
* * setChecked: Set check for input
|
|
325
|
-
* * getChecked: Get check of input
|
|
321
|
+
/**
|
|
322
|
+
* ref methods
|
|
323
|
+
*
|
|
324
|
+
* * setChecked: Set check for input
|
|
325
|
+
* * getChecked: Get check of input
|
|
326
326
|
*/
|
|
327
327
|
ref: PropTypes.any
|
|
328
328
|
};
|
|
@@ -14,6 +14,10 @@ import { ButtonIcon, HelperText, InputBase, Label } from '../../index';
|
|
|
14
14
|
import Button from '../../button';
|
|
15
15
|
import Tooltip from '../../tooltip';
|
|
16
16
|
import { isValidDate } from '../calendar/function';
|
|
17
|
+
import { useTheme } from '../../../theme';
|
|
18
|
+
const {
|
|
19
|
+
zIndex
|
|
20
|
+
} = useTheme();
|
|
17
21
|
const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
18
22
|
actionIconAt,
|
|
19
23
|
clearAble,
|
|
@@ -116,7 +120,7 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
116
120
|
display: 'block'
|
|
117
121
|
};
|
|
118
122
|
const pickerCSS = {
|
|
119
|
-
backGr:
|
|
123
|
+
backGr: `background-color: transparent; inset: 0px; pointer-events: auto; position: fixed; z-index: ${zIndex(1)};`,
|
|
120
124
|
picker: (position, left, width) => css`
|
|
121
125
|
background-color: ${theme.colors.white};
|
|
122
126
|
border-radius: ${theme.border.radius};
|
|
@@ -132,7 +136,7 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
132
136
|
transition: opacity 120ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
133
137
|
transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
134
138
|
width: ${width}px;
|
|
135
|
-
z-index:
|
|
139
|
+
z-index: ${zIndex(2)};
|
|
136
140
|
`,
|
|
137
141
|
active: {
|
|
138
142
|
opacity: 1,
|
|
@@ -399,7 +403,7 @@ const DatePicker = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
399
403
|
|
|
400
404
|
if (!el.classList.contains(unique.focus)) {
|
|
401
405
|
el.classList.add(unique.focus);
|
|
402
|
-
el.style.zIndex =
|
|
406
|
+
el.style.zIndex = zIndex(2);
|
|
403
407
|
openPicker();
|
|
404
408
|
}
|
|
405
409
|
};
|
|
@@ -12,6 +12,10 @@ import { randomString, updatePosition, date as moment, capitalizeSentenceCase, i
|
|
|
12
12
|
import { getGlobal } from '../../../global';
|
|
13
13
|
import { generateCalendarCSS, onUpdateNavigator, renderHeader, renderNavigator } from '../calendar/function';
|
|
14
14
|
import locale from '../../../locale';
|
|
15
|
+
import { useTheme } from '../../../theme';
|
|
16
|
+
const {
|
|
17
|
+
zIndex
|
|
18
|
+
} = useTheme();
|
|
15
19
|
const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
16
20
|
actionIconAt,
|
|
17
21
|
controls,
|
|
@@ -224,7 +228,7 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
224
228
|
visibility: hidden;
|
|
225
229
|
white-space: nowrap;
|
|
226
230
|
will-change: left top visibility;
|
|
227
|
-
z-index:
|
|
231
|
+
z-index: ${zIndex(3)};
|
|
228
232
|
}
|
|
229
233
|
@media only screen and (max-width: 599px) {
|
|
230
234
|
max-width: 400px;
|
|
@@ -253,7 +257,7 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
253
257
|
transition: opacity 120ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
|
|
254
258
|
transform 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
|
|
255
259
|
width: ${width}px;
|
|
256
|
-
z-index:
|
|
260
|
+
z-index: ${zIndex(2)};
|
|
257
261
|
`,
|
|
258
262
|
active: {
|
|
259
263
|
opacity: 1,
|
|
@@ -458,8 +462,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
458
462
|
tableData = [],
|
|
459
463
|
weekDateFirst = getDateOfWeek(firstDay),
|
|
460
464
|
weekDateLast = getDateOfWeek(lastDay);
|
|
461
|
-
/**
|
|
462
|
-
* days of previous month
|
|
465
|
+
/**
|
|
466
|
+
* days of previous month
|
|
463
467
|
*/
|
|
464
468
|
|
|
465
469
|
for (let i = weekDateFirst; i > 0; i--) {
|
|
@@ -472,8 +476,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
472
476
|
className: unique.day.day
|
|
473
477
|
})));
|
|
474
478
|
}
|
|
475
|
-
/**
|
|
476
|
-
* days of current month
|
|
479
|
+
/**
|
|
480
|
+
* days of current month
|
|
477
481
|
*/
|
|
478
482
|
|
|
479
483
|
|
|
@@ -487,8 +491,8 @@ const DateRangePickerV2 = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
487
491
|
}, jsx(Typography, { ...typographyProps(unique.day.day)
|
|
488
492
|
}, i + 1)));
|
|
489
493
|
}
|
|
490
|
-
/**
|
|
491
|
-
* days of next month
|
|
494
|
+
/**
|
|
495
|
+
* days of next month
|
|
492
496
|
*/
|
|
493
497
|
|
|
494
498
|
|
|
@@ -8,13 +8,17 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { jsx, css } from '@emotion/core';
|
|
9
9
|
import { Account } from '../../../icons';
|
|
10
10
|
import AvatarDefault from '../../../assets/avatar/default.svg';
|
|
11
|
-
import { InputBase, Chip, CircularProgress, Checkbox, TreeView, HelperText, Label, ButtonIcon } from '../../';
|
|
11
|
+
import { InputBase, Chip, CircularProgress, Checkbox, TreeView, HelperText, Label, ButtonIcon, Typography } from '../../';
|
|
12
12
|
import { mapParent, randomString, updatePosition } from '../../../utils';
|
|
13
13
|
import { getGlobal } from '../../../global';
|
|
14
14
|
import { color as colors } from '../../../styles/colors';
|
|
15
15
|
import { typography } from '../../../styles/typography';
|
|
16
16
|
import { alignCenter, backgroundTransparent, border, borderBox, borderNone, borderRadius4px, breakWord, cursorPointer, displayBlock, flexRow, flexWrap, inlineFlex, justifyCenter, justifyStart, outlineNone, overflowHidden, pointerEventsNone, positionAbsolute, positionRelative, userSelectNone } from '../../../styles/general';
|
|
17
17
|
import isMobile from '../../../utils/isMobile';
|
|
18
|
+
import { useTheme } from '../../../theme';
|
|
19
|
+
const {
|
|
20
|
+
zIndex
|
|
21
|
+
} = useTheme();
|
|
18
22
|
const {
|
|
19
23
|
paragraph1,
|
|
20
24
|
paragraph3
|
|
@@ -88,6 +92,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
88
92
|
onInput,
|
|
89
93
|
onChange,
|
|
90
94
|
onLoadMore,
|
|
95
|
+
onClosed,
|
|
91
96
|
renderItem,
|
|
92
97
|
renderSelectedItem,
|
|
93
98
|
valueObjectDefault,
|
|
@@ -97,10 +102,9 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
97
102
|
formStyle,
|
|
98
103
|
labelProps,
|
|
99
104
|
errorStyle,
|
|
100
|
-
refs,
|
|
101
105
|
children,
|
|
102
106
|
dropdownItemStyle
|
|
103
|
-
},
|
|
107
|
+
}, reference) => {
|
|
104
108
|
const dropdownRef = useRef(null);
|
|
105
109
|
const timerRef = useRef(null);
|
|
106
110
|
const formRef = useRef(null);
|
|
@@ -115,7 +119,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
115
119
|
allowSymbol: false
|
|
116
120
|
}));
|
|
117
121
|
const [openState, setOpenState] = useState(false);
|
|
118
|
-
const [errorState, setErrorState] = useState(error && !valueProp && valueProp !== 0);
|
|
119
122
|
const [showClear, setShowClear] = useState(false);
|
|
120
123
|
|
|
121
124
|
const _isMobile = isMobile.any();
|
|
@@ -230,7 +233,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
230
233
|
left: `${left}px`,
|
|
231
234
|
width: `${width}px`,
|
|
232
235
|
backgroundColor: '#FFF',
|
|
233
|
-
zIndex:
|
|
236
|
+
zIndex: zIndex(1)
|
|
234
237
|
};
|
|
235
238
|
if (_isMobile && allowSearch) dropdownStyle = { ...dropdownStyle,
|
|
236
239
|
bottom: 0,
|
|
@@ -249,7 +252,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
249
252
|
height: '100%',
|
|
250
253
|
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
251
254
|
borderRadius: 4,
|
|
252
|
-
zIndex:
|
|
255
|
+
zIndex: zIndex(2)
|
|
253
256
|
};
|
|
254
257
|
const defaultSearch = lastSearchRef.current || (onInput ? (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.value : '');
|
|
255
258
|
const el = jsx("div", {
|
|
@@ -377,6 +380,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
377
380
|
}
|
|
378
381
|
|
|
379
382
|
document.documentElement.style.overflow = 'auto';
|
|
383
|
+
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
380
384
|
};
|
|
381
385
|
|
|
382
386
|
const renderDropdown = pattern => {
|
|
@@ -838,10 +842,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
838
842
|
startIcon: icon,
|
|
839
843
|
label: displayText,
|
|
840
844
|
size: itemMultipleSize,
|
|
845
|
+
disabled: disabled,
|
|
841
846
|
clearAble: true,
|
|
842
847
|
onRemove: e => onRemove(e, value),
|
|
843
848
|
style: {
|
|
844
|
-
margin: '3px 0'
|
|
849
|
+
margin: '3px 0',
|
|
850
|
+
width: '100%'
|
|
845
851
|
}
|
|
846
852
|
});
|
|
847
853
|
}
|
|
@@ -1049,10 +1055,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1049
1055
|
startIcon: icon,
|
|
1050
1056
|
label: text,
|
|
1051
1057
|
size: itemMultipleSize,
|
|
1058
|
+
disabled: disabled,
|
|
1052
1059
|
clearAble: true,
|
|
1053
1060
|
onRemove: e => onRemove(e, value),
|
|
1054
1061
|
style: {
|
|
1055
|
-
margin: '3px 0'
|
|
1062
|
+
margin: '3px 0',
|
|
1063
|
+
width: '100%'
|
|
1056
1064
|
}
|
|
1057
1065
|
});
|
|
1058
1066
|
}
|
|
@@ -1081,8 +1089,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1081
1089
|
const icon = getIconFromData(data);
|
|
1082
1090
|
const valueWithIcon = jsx(Fragment, null, icon && jsx("div", {
|
|
1083
1091
|
css: DropdownIconCSS
|
|
1084
|
-
}, icon), jsx(
|
|
1085
|
-
|
|
1092
|
+
}, icon), jsx(Typography, {
|
|
1093
|
+
type: 'p1',
|
|
1094
|
+
lineClamp: 1,
|
|
1095
|
+
hoverTooltip: !_isMobile
|
|
1086
1096
|
}, text));
|
|
1087
1097
|
const el = document.createElement('div');
|
|
1088
1098
|
el.style.cssText = 'display: flex; align-items: center; min-height:24px;';
|
|
@@ -1092,17 +1102,43 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1092
1102
|
}
|
|
1093
1103
|
};
|
|
1094
1104
|
|
|
1095
|
-
useImperativeHandle(
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1105
|
+
useImperativeHandle(reference, () => {
|
|
1106
|
+
const currentRef = dropdownRef.current || {};
|
|
1107
|
+
const _instance = {
|
|
1108
|
+
closeDropdown: () => {
|
|
1109
|
+
closeDropdown();
|
|
1110
|
+
},
|
|
1111
|
+
showDropdown: () => {
|
|
1112
|
+
showDropdown();
|
|
1113
|
+
},
|
|
1114
|
+
onClear,
|
|
1115
|
+
setPreviousValue,
|
|
1116
|
+
setValue: value => {
|
|
1117
|
+
if (allValue[unique][allValue[unique].length - 1] !== value) {
|
|
1118
|
+
allValue[unique].push(value);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
setValueIntoInput(value);
|
|
1122
|
+
}
|
|
1123
|
+
}; // methods
|
|
1124
|
+
|
|
1125
|
+
_instance.__proto__ = {}; // hidden methods
|
|
1126
|
+
|
|
1127
|
+
currentRef.instance = _instance; // keep old method
|
|
1128
|
+
|
|
1129
|
+
currentRef.closeDropdown = () => closeDropdown();
|
|
1130
|
+
|
|
1131
|
+
currentRef.showDropdown = () => showDropdown();
|
|
1132
|
+
|
|
1133
|
+
currentRef.onClear = onClear, currentRef.setPreviousValue = setPreviousValue, currentRef.setValue = value => {
|
|
1134
|
+
if (allValue[unique][allValue[unique].length - 1] !== value) {
|
|
1135
|
+
allValue[unique].push(value);
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
setValueIntoInput(value);
|
|
1139
|
+
}, currentRef.DOM = dropdownRef.current;
|
|
1140
|
+
return currentRef;
|
|
1141
|
+
});
|
|
1106
1142
|
useEffect(() => {
|
|
1107
1143
|
setShowClear(clearAble && checkHasValue(valueProp) && !disabled && !readOnly && !loading);
|
|
1108
1144
|
}, [clearAble, valueProp, disabled, readOnly, loading]);
|
|
@@ -1122,7 +1158,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1122
1158
|
};
|
|
1123
1159
|
}, [valueObjectDefault]);
|
|
1124
1160
|
useEffect(() => {
|
|
1125
|
-
!!refs && refs(dropdownRef);
|
|
1126
1161
|
allValue[unique] = [];
|
|
1127
1162
|
|
|
1128
1163
|
if (defaultValue !== undefined && JSON.stringify(defaultValue) !== '[]') {
|
|
@@ -1186,9 +1221,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1186
1221
|
};
|
|
1187
1222
|
}
|
|
1188
1223
|
}, [loading]);
|
|
1189
|
-
useEffect(() => {
|
|
1190
|
-
setErrorState(error && (!valueProp && valueProp !== 0 || (valueProp === null || valueProp === void 0 ? void 0 : valueProp.length) === 0));
|
|
1191
|
-
}, [error, valueProp]);
|
|
1192
1224
|
useEffect(() => {
|
|
1193
1225
|
if (valueProp !== undefined && (!boxRef.current || children || JSON.stringify(valueProp) !== JSON.stringify(currentValue[unique]))) {
|
|
1194
1226
|
setValueIntoInput(valueProp);
|
|
@@ -1295,7 +1327,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1295
1327
|
const inputComp = useMemo(() => {
|
|
1296
1328
|
const _InputCSS = InputCSS(multiple, renderSelectedItem, clearAble);
|
|
1297
1329
|
|
|
1298
|
-
const _DropdownFormCSS = DropdownFormCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem);
|
|
1330
|
+
const _DropdownFormCSS = DropdownFormCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem, disabled);
|
|
1299
1331
|
|
|
1300
1332
|
const _DropdownInputCSS = DropdownInputCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem);
|
|
1301
1333
|
|
|
@@ -1305,7 +1337,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1305
1337
|
className: ['DGN-UI-Dropdown-Form', openState && 'dropdown-showing'].join(' ').trim().replace(/\s+/g, ' '),
|
|
1306
1338
|
style: formStyle
|
|
1307
1339
|
}, jsx("div", {
|
|
1308
|
-
css: _InputCSS
|
|
1340
|
+
css: _InputCSS,
|
|
1341
|
+
className: 'DGN-UI-Dropdown-Form-Input'
|
|
1309
1342
|
}, multiple ? jsx("div", { ...inputProps,
|
|
1310
1343
|
style: {
|
|
1311
1344
|
cursor: 'text',
|
|
@@ -1337,7 +1370,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1337
1370
|
ref: inputRef,
|
|
1338
1371
|
css: _DropdownInputCSS,
|
|
1339
1372
|
type: "text",
|
|
1340
|
-
placeholder: placeholder
|
|
1373
|
+
placeholder: placeholder,
|
|
1374
|
+
disabled: disabled
|
|
1341
1375
|
})), jsx("div", {
|
|
1342
1376
|
ref: iconRef,
|
|
1343
1377
|
css: IconCSS(viewType, loading, showClear),
|
|
@@ -1363,7 +1397,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1363
1397
|
disabled: disabled || readOnly
|
|
1364
1398
|
})));
|
|
1365
1399
|
}, [viewType, inputProps, inputStyle, multiple, clearAble, onChange, disabled, readOnly, loading, renderSelectedItem, placeholder, itemMultipleSize, openState, showClear]);
|
|
1366
|
-
const errorComp = useMemo(() =>
|
|
1400
|
+
const errorComp = useMemo(() => error && jsx(HelperText, {
|
|
1367
1401
|
disabled: disabled,
|
|
1368
1402
|
style: {
|
|
1369
1403
|
minHeight: '16px',
|
|
@@ -1371,13 +1405,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1371
1405
|
top: '100%',
|
|
1372
1406
|
...errorStyle
|
|
1373
1407
|
}
|
|
1374
|
-
}, error), [error,
|
|
1408
|
+
}, error), [error, disabled, errorStyle]);
|
|
1375
1409
|
/* End component */
|
|
1376
1410
|
|
|
1377
1411
|
return jsx(Fragment, null, jsx("div", {
|
|
1378
1412
|
ref: dropdownRef,
|
|
1379
1413
|
css: DropdownRootCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem, loading, showClear),
|
|
1380
|
-
className: ['DGN-UI-Dropdown', className,
|
|
1414
|
+
className: ['DGN-UI-Dropdown', className, error && 'error', loading && 'dgn-dropdown-loading', disabled ? 'disabled' : readOnly && 'readOnly'].join(' ').trim().replace(/\s+/g, ' '),
|
|
1381
1415
|
style: style
|
|
1382
1416
|
}, labelComp, inputComp, errorComp), openState ? /*#__PURE__*/createPortal(showDropdown(), document.body) : null);
|
|
1383
1417
|
}));
|
|
@@ -1385,7 +1419,7 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1385
1419
|
|
|
1386
1420
|
const InputCSS = (multiple, renderSelectedItem, clearAble) => css`
|
|
1387
1421
|
${flexRow};
|
|
1388
|
-
|
|
1422
|
+
width: 100%;
|
|
1389
1423
|
${!multiple && renderSelectedItem ? `width: calc(100% - 34px${clearAble ? ' - 18px' : ''})` : ''}
|
|
1390
1424
|
`;
|
|
1391
1425
|
|
|
@@ -1397,11 +1431,15 @@ const DropdownIconCSS = css`
|
|
|
1397
1431
|
height: inherit;
|
|
1398
1432
|
margin-right: 8px;
|
|
1399
1433
|
height: 32px;
|
|
1434
|
+
min-height: 32px;
|
|
1400
1435
|
width: 32px;
|
|
1436
|
+
min-width: 32px;
|
|
1401
1437
|
border-radius: 16px;
|
|
1402
1438
|
img {
|
|
1403
1439
|
height: 32px;
|
|
1440
|
+
min-height: 32px;
|
|
1404
1441
|
width: 32px;
|
|
1442
|
+
min-width: 32px;
|
|
1405
1443
|
object-fit: cover;
|
|
1406
1444
|
}
|
|
1407
1445
|
`;
|
|
@@ -1423,8 +1461,7 @@ const DropdownInputCSS = (viewType, multiple, placeholder, itemMultipleSize, ren
|
|
|
1423
1461
|
${flexWrap};
|
|
1424
1462
|
${overflowHidden};
|
|
1425
1463
|
${breakWord};
|
|
1426
|
-
|
|
1427
|
-
${!multiple ? 'min-height: 24px; max-width: 100%; white-space: nowrap;' : ''}
|
|
1464
|
+
${!multiple ? 'min-height: 24px; max-width: 100%;' : ''}
|
|
1428
1465
|
&::after {
|
|
1429
1466
|
${flexRow};
|
|
1430
1467
|
${positionAbsolute};
|
|
@@ -1455,10 +1492,14 @@ const DropdownInputCSS = (viewType, multiple, placeholder, itemMultipleSize, ren
|
|
|
1455
1492
|
min-width: 24px;
|
|
1456
1493
|
` : `
|
|
1457
1494
|
height: 24px;
|
|
1495
|
+
min-height: 24px;
|
|
1458
1496
|
width: 24px;
|
|
1497
|
+
min-width: 24px;
|
|
1459
1498
|
img {
|
|
1460
1499
|
height: 24px;
|
|
1500
|
+
min-height: 24px;
|
|
1461
1501
|
width: 24px;
|
|
1502
|
+
min-width: 24px;
|
|
1462
1503
|
}
|
|
1463
1504
|
`}
|
|
1464
1505
|
}
|
|
@@ -1479,22 +1520,25 @@ const IconCSS = (viewType, loading, showClear) => css`
|
|
|
1479
1520
|
}
|
|
1480
1521
|
`;
|
|
1481
1522
|
|
|
1482
|
-
const DropdownFormCSS = (viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem) => viewType !== 'outlined' ? css`
|
|
1523
|
+
const DropdownFormCSS = (viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem, disabled) => viewType !== 'outlined' ? css`
|
|
1483
1524
|
${flexRow};
|
|
1484
1525
|
${alignCenter};
|
|
1485
1526
|
${positionRelative};
|
|
1486
1527
|
${borderBox};
|
|
1487
|
-
|
|
1528
|
+
width: 100%;
|
|
1488
1529
|
padding-bottom: ${multiple ? 1 : 4}px;
|
|
1489
1530
|
padding-top: ${multiple ? 1 : 4}px;
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1531
|
+
${!disabled && `
|
|
1532
|
+
&:not(:focus-within):hover {
|
|
1533
|
+
&::before {
|
|
1534
|
+
border-bottom-color: ${active};
|
|
1535
|
+
}
|
|
1536
|
+
.css-${DropdownInputCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem).name} {
|
|
1537
|
+
color: ${active};
|
|
1538
|
+
}
|
|
1497
1539
|
}
|
|
1540
|
+
`}
|
|
1541
|
+
|
|
1498
1542
|
&:focus-within {
|
|
1499
1543
|
border-bottom-color: ${focus};
|
|
1500
1544
|
&::after {
|
|
@@ -1539,15 +1583,17 @@ const DropdownFormCSS = (viewType, multiple, placeholder, itemMultipleSize, rend
|
|
|
1539
1583
|
${borderRadius4px};
|
|
1540
1584
|
${borderBox};
|
|
1541
1585
|
${border(1, rest)};
|
|
1542
|
-
|
|
1586
|
+
width: 100%;
|
|
1543
1587
|
min-height: 40px;
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1588
|
+
${!disabled && `
|
|
1589
|
+
&:not(:focus-within):hover {
|
|
1590
|
+
background-color: ${hover};
|
|
1591
|
+
border-color: ${active};
|
|
1592
|
+
input {
|
|
1593
|
+
background-color: ${hover};
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
`}
|
|
1551
1597
|
&:focus-within {
|
|
1552
1598
|
border-color: ${focus};
|
|
1553
1599
|
}
|
|
@@ -1582,7 +1628,7 @@ const DropdownBoxCSS = css`
|
|
|
1582
1628
|
overflow: auto;
|
|
1583
1629
|
background-color: ${white};
|
|
1584
1630
|
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
1585
|
-
z-index:
|
|
1631
|
+
z-index: ${zIndex(1)};
|
|
1586
1632
|
&::-webkit-scrollbar {
|
|
1587
1633
|
${borderRadius4px};
|
|
1588
1634
|
width: 24px;
|
|
@@ -1644,7 +1690,6 @@ const DropdownRootCSS = (viewType, multiple, placeholder, itemMultipleSize, rend
|
|
|
1644
1690
|
${displayBlock};
|
|
1645
1691
|
${positionRelative};
|
|
1646
1692
|
margin-bottom: 20px;
|
|
1647
|
-
/* min-width: 150px; */
|
|
1648
1693
|
height: max-content;
|
|
1649
1694
|
&.error {
|
|
1650
1695
|
.css-${DropdownFormCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem).name} {
|
|
@@ -1659,8 +1704,6 @@ const DropdownRootCSS = (viewType, multiple, placeholder, itemMultipleSize, rend
|
|
|
1659
1704
|
}
|
|
1660
1705
|
&.dgn-dropdown-loading,
|
|
1661
1706
|
&.disabled {
|
|
1662
|
-
${pointerEventsNone};
|
|
1663
|
-
${userSelectNone};
|
|
1664
1707
|
.css-${DropdownFormCSS(viewType, multiple, placeholder, itemMultipleSize, renderSelectedItem).name} {
|
|
1665
1708
|
border-color: ${systemDisabled};
|
|
1666
1709
|
.css-${IconCSS(viewType, loading, showClear).name} {
|
|
@@ -1754,14 +1797,14 @@ Dropdown.propTypes = {
|
|
|
1754
1797
|
/** display this icon if not found the icon follow iconExpr */
|
|
1755
1798
|
iconDefault: PropTypes.string,
|
|
1756
1799
|
|
|
1757
|
-
/** field name used for icon display<br/>
|
|
1758
|
-
* Example:<br/>
|
|
1759
|
-
* string: 'icon'<br/>
|
|
1760
|
-
* object: {<br/>
|
|
1761
|
-
* key: 'icon',<br/>
|
|
1762
|
-
* prefix: 'https://imglink.com',<br/>
|
|
1763
|
-
* suffix: '.jpg'<br/>
|
|
1764
|
-
* }
|
|
1800
|
+
/** field name used for icon display<br/>
|
|
1801
|
+
* Example:<br/>
|
|
1802
|
+
* string: 'icon'<br/>
|
|
1803
|
+
* object: {<br/>
|
|
1804
|
+
* key: 'icon',<br/>
|
|
1805
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1806
|
+
* suffix: '.jpg'<br/>
|
|
1807
|
+
* }
|
|
1765
1808
|
*/
|
|
1766
1809
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1767
1810
|
key: PropTypes.string,
|
|
@@ -1779,9 +1822,9 @@ Dropdown.propTypes = {
|
|
|
1779
1822
|
/** field name used for text display in input */
|
|
1780
1823
|
keyExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1781
1824
|
|
|
1782
|
-
/** field name used for text display<br/>
|
|
1783
|
-
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1784
|
-
* Note: don't use 'id - name', return undefined
|
|
1825
|
+
/** field name used for text display<br/>
|
|
1826
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1827
|
+
* Note: don't use 'id - name', return undefined
|
|
1785
1828
|
*/
|
|
1786
1829
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1787
1830
|
|
|
@@ -1791,9 +1834,9 @@ Dropdown.propTypes = {
|
|
|
1791
1834
|
/** the field name used for the returned result */
|
|
1792
1835
|
valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1793
1836
|
|
|
1794
|
-
/**
|
|
1795
|
-
* duration wait enter search content on search<br/>
|
|
1796
|
-
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1837
|
+
/**
|
|
1838
|
+
* duration wait enter search content on search<br/>
|
|
1839
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1797
1840
|
*/
|
|
1798
1841
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1799
1842
|
|
|
@@ -1860,22 +1903,19 @@ Dropdown.propTypes = {
|
|
|
1860
1903
|
/** The array of elements that appear in the dropdown */
|
|
1861
1904
|
dataSource: PropTypes.array,
|
|
1862
1905
|
|
|
1863
|
-
/**
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
/** function displays items by custom<br/>
|
|
1867
|
-
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1868
|
-
* --> such as: displayExpr={'name - role'}
|
|
1906
|
+
/** function displays items by custom<br/>
|
|
1907
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1908
|
+
* --> such as: displayExpr={'name - role'}
|
|
1869
1909
|
*/
|
|
1870
1910
|
renderItem: PropTypes.func,
|
|
1871
1911
|
|
|
1872
|
-
/** function displays selected items by custom, example:<br/>
|
|
1873
|
-
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1912
|
+
/** function displays selected items by custom, example:<br/>
|
|
1913
|
+
* renderItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1874
1914
|
*/
|
|
1875
1915
|
renderSelectedItem: PropTypes.func,
|
|
1876
1916
|
|
|
1877
|
-
/** the function will run when entering input<br/>
|
|
1878
|
-
* if undefined: the filter function will run (default)
|
|
1917
|
+
/** the function will run when entering input<br/>
|
|
1918
|
+
* if undefined: the filter function will run (default)
|
|
1879
1919
|
*/
|
|
1880
1920
|
onInput: PropTypes.func,
|
|
1881
1921
|
|
|
@@ -1888,10 +1928,28 @@ Dropdown.propTypes = {
|
|
|
1888
1928
|
/** the function will run when scroll near the end */
|
|
1889
1929
|
onLoadMore: PropTypes.func,
|
|
1890
1930
|
|
|
1931
|
+
/** the function will run when dropdown closed */
|
|
1932
|
+
onClosed: PropTypes.func,
|
|
1933
|
+
|
|
1891
1934
|
/** the contents in Dropdown box (Exp: TreeView) */
|
|
1892
1935
|
children: PropTypes.node,
|
|
1893
1936
|
|
|
1894
|
-
/**
|
|
1895
|
-
|
|
1937
|
+
/**
|
|
1938
|
+
* ref methods
|
|
1939
|
+
*
|
|
1940
|
+
* how to get component element? ref.current
|
|
1941
|
+
*
|
|
1942
|
+
* how to call method? ref.current.instance.{method}
|
|
1943
|
+
*
|
|
1944
|
+
* * showDropdown(): Show dropdown
|
|
1945
|
+
* * closeDropdown(): Close dropdown
|
|
1946
|
+
* * onClear(): Clear selected value
|
|
1947
|
+
* * setPreviousValue(): Set value to previous value
|
|
1948
|
+
* * setValue(value): Set value of dropdown
|
|
1949
|
+
* * @param {value} - string || number || array
|
|
1950
|
+
*/
|
|
1951
|
+
reference: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
1952
|
+
current: PropTypes.instanceOf(Element)
|
|
1953
|
+
})])
|
|
1896
1954
|
};
|
|
1897
1955
|
export default Dropdown;
|