diginet-core-ui 1.3.88 → 1.3.89
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/bem/WA3F0100.svg +6 -6
- package/assets/images/menu/bem/WA3F1025.svg +10 -10
- package/assets/images/menu/bem/WA3F2000.svg +10 -10
- package/assets/images/menu/bem/WA3F2020.svg +6 -6
- package/assets/images/menu/bem/WA3F2030.svg +14 -14
- package/assets/images/menu/bem/WA3F2040.svg +8 -8
- package/assets/images/menu/bem/WA3F2100.svg +6 -6
- 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/MHRM00N0002.svg +22 -22
- package/assets/images/menu/dhr/MHRM00N0003.svg +17 -17
- package/assets/images/menu/dhr/MHRM00N0004.svg +12 -12
- package/assets/images/menu/dhr/MHRM00N0005.svg +11 -11
- 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/MHRM09N1010.svg +12 -12
- package/assets/images/menu/dhr/MHRM09N1015.svg +18 -18
- package/assets/images/menu/dhr/MHRM09N1020.svg +13 -13
- package/assets/images/menu/dhr/MHRM09N1025.svg +12 -12
- package/assets/images/menu/dhr/MHRM09N1030.svg +11 -11
- package/assets/images/menu/dhr/MHRM09N1035.svg +15 -15
- package/assets/images/menu/dhr/MHRM09N1040.svg +8 -8
- package/assets/images/menu/dhr/MHRM09N1400.svg +11 -11
- package/assets/images/menu/dhr/MHRM13N0001.svg +16 -16
- package/assets/images/menu/dhr/MHRM13N0002.svg +13 -13
- package/assets/images/menu/dhr/MHRM13N0003.svg +12 -12
- package/assets/images/menu/dhr/MHRM13N0004.svg +21 -21
- 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 -13
- package/assets/images/menu/dhr/MHRM29N0003.svg +17 -17
- package/assets/images/menu/dhr/MHRM29N0004.svg +18 -18
- package/assets/images/menu/dhr/MHRM29N0005.svg +13 -13
- 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/MHRM39N0017.svg +14 -14
- package/assets/images/menu/dhr/MHRM39N0018.svg +5 -5
- package/assets/images/menu/dhr/MHRM39N0019.svg +11 -11
- package/assets/images/menu/dhr/MHRM39N0020.svg +11 -11
- package/assets/images/menu/dhr/MHRM39N0021.svg +11 -11
- package/assets/images/menu/dhr/MHRM39N0022.svg +18 -18
- package/assets/images/menu/dhr/MHRM39N0023.svg +13 -13
- package/assets/images/menu/dhr/MHRM77N0001.svg +28 -28
- package/assets/images/menu/dhr/MHRM82N0001.svg +8 -8
- package/assets/images/menu/dhr/MHRM82N0002.svg +5 -5
- 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/MHRP25L0101.svg +15 -15
- package/assets/images/menu/dhr/MHRP25L0501.svg +14 -14
- 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/MHRP29N0026.svg +13 -13
- package/assets/images/menu/dhr/MHRP29N0027.svg +14 -14
- package/assets/images/menu/dhr/MHRP29N0028.svg +15 -15
- 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 +7 -7
- 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 -11
- 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 +5 -5
- package/assets/images/menu/dhr/MHRP89N1001.svg +5 -5
- 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 +4 -4
- 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/assets/storybook/avatar01.svg +9 -9
- package/assets/storybook/cover01.svg +9 -9
- package/components/accordion/details.js +2 -6
- package/components/accordion/group.js +2 -9
- package/components/accordion/index.js +2 -15
- package/components/accordion/summary.js +4 -27
- package/components/alert/index.js +2 -33
- package/components/alert/notify.js +12 -22
- package/components/avatar/index.js +22 -81
- package/components/badge/index.js +20 -45
- package/components/button/icon.js +25 -56
- package/components/button/index.js +16 -65
- package/components/button/more.js +15 -35
- package/components/button/ripple-effect.js +0 -10
- package/components/card/body.js +2 -7
- package/components/card/extra.js +2 -7
- package/components/card/footer.js +2 -7
- package/components/card/header.js +2 -7
- package/components/card/index.js +2 -22
- package/components/chart/Pie/Circle.js +0 -1
- package/components/chart/Pie/Sector.js +2 -19
- package/components/chart/Pie/Sectors.js +0 -10
- package/components/chart/Pie/index.js +4 -36
- package/components/chart/Pie-v2/Circle.js +0 -1
- package/components/chart/Pie-v2/Sector.js +2 -15
- package/components/chart/Pie-v2/Sectors.js +0 -20
- package/components/chart/Pie-v2/index.js +11 -38
- package/components/chart/bar/Axis.js +0 -12
- package/components/chart/bar/Bar.js +13 -35
- package/components/chart/bar/Grid.js +0 -18
- package/components/chart/bar/Labels.js +4 -22
- package/components/chart/bar/Points.js +0 -17
- package/components/chart/bar/index.js +6 -26
- package/components/chart/bar-v2/Axis.js +0 -12
- package/components/chart/bar-v2/Bar.js +15 -36
- package/components/chart/bar-v2/Grid.js +0 -18
- package/components/chart/bar-v2/Labels.js +4 -22
- package/components/chart/bar-v2/Points.js +0 -17
- package/components/chart/bar-v2/index.js +6 -26
- package/components/chart/line/Axis.js +4 -16
- package/components/chart/line/Grid.js +2 -19
- package/components/chart/line/Labels.js +4 -22
- package/components/chart/line/Path.js +24 -34
- package/components/chart/line/Point.js +7 -41
- package/components/chart/line/Title.js +0 -3
- package/components/chart/line/index.js +12 -35
- package/components/chart/line-v2/Axis.js +0 -13
- package/components/chart/line-v2/Grid.js +0 -18
- package/components/chart/line-v2/Labels.js +4 -22
- package/components/chart/line-v2/Path.js +23 -33
- package/components/chart/line-v2/Point.js +6 -35
- package/components/chart/line-v2/Title.js +0 -3
- package/components/chart/line-v2/index.js +12 -30
- package/components/check-text/index.js +7 -15
- package/components/check-text/interview-confirmation.js +24 -31
- package/components/check-text/interview-status.js +24 -31
- package/components/chip/attach.js +9 -22
- package/components/chip/index.js +13 -38
- package/components/collapse/index.js +0 -13
- package/components/divider/index.js +2 -13
- package/components/form-control/attachment/index.js +41 -202
- package/components/form-control/calendar/function.js +154 -208
- package/components/form-control/calendar/index.js +21 -46
- package/components/form-control/calendar/range.js +11 -28
- package/components/form-control/checkbox/index.js +12 -46
- package/components/form-control/control/index.js +4 -14
- package/components/form-control/date-picker/index-old.js +18 -0
- package/components/form-control/date-picker/index.js +23 -99
- package/components/form-control/date-range-picker/index.js +44 -180
- package/components/form-control/dropdown/index.js +101 -314
- package/components/form-control/dropdown-box/index.js +7 -37
- package/components/form-control/form/index.js +0 -2
- package/components/form-control/form-group/index.js +1 -6
- package/components/form-control/helper-text/index.js +2 -9
- package/components/form-control/input-base/index.js +4 -68
- package/components/form-control/label/index.js +2 -12
- package/components/form-control/money-input/index.js +54 -143
- package/components/form-control/number-input/index.js +26 -124
- package/components/form-control/number-input/index2.js +95 -134
- package/components/form-control/phone-input/index.js +23 -85
- package/components/form-control/radio/index.js +16 -35
- package/components/form-control/text-input/index.js +10 -46
- package/components/form-control/time-picker/index.js +43 -100
- package/components/form-control/time-picker/swiper.js +21 -73
- package/components/form-control/toggle/index.js +26 -40
- package/components/form-view/helper-text.js +2 -2
- package/components/form-view/index.js +0 -14
- package/components/form-view/input.js +2 -13
- package/components/form-view/label.js +0 -2
- package/components/grid/Col.js +2 -16
- package/components/grid/Container.js +2 -21
- package/components/grid/Row.js +2 -21
- package/components/grid/index.js +2 -44
- package/components/image/index.js +2 -22
- package/components/index.js +62 -31
- package/components/list/list-item-action.js +12 -21
- package/components/list/list-item-icon.js +10 -19
- package/components/list/list-item-text.js +0 -5
- package/components/list/list-item.js +27 -38
- package/components/list/list.js +37 -50
- package/components/list/sub-header.js +13 -17
- package/components/modal/body.js +2 -6
- package/components/modal/footer.js +2 -11
- package/components/modal/header.js +2 -12
- package/components/modal/index.js +2 -10
- package/components/modal/modal.js +11 -52
- package/components/others/extra/index.js +3 -10
- package/components/others/import/index.js +0 -7
- package/components/others/option-wrapper/index.js +4 -7
- package/components/others/scrollbar/index.js +0 -3
- package/components/paging/page-info.js +35 -99
- package/components/paging/page-selector.js +10 -38
- package/components/paging/page-selector2.js +35 -74
- package/components/paper/index.js +23 -34
- package/components/popover/body.js +2 -6
- package/components/popover/footer.js +2 -11
- package/components/popover/header.js +2 -7
- package/components/popover/index.js +54 -146
- package/components/popup/danger_popup.js +0 -19
- package/components/popup/index.js +4 -50
- package/components/popup/proposals_popup.js +11 -50
- package/components/popup/v2/index.js +13 -47
- package/components/progress/circular.js +10 -48
- package/components/progress/linear.js +58 -74
- package/components/rating/index.js +10 -35
- package/components/slider/slider-container.js +4 -41
- package/components/slider/slider-item.js +10 -25
- package/components/status/index.js +2 -14
- package/components/tab/tab-container.js +4 -18
- package/components/tab/tab-header.js +4 -24
- package/components/tab/tab-panel.js +4 -16
- package/components/tab/tab.js +8 -33
- package/components/tooltip/index.js +12 -97
- package/components/tooltip/portal.js +0 -2
- package/components/transfer/index.js +28 -73
- package/components/tree-view/index.js +62 -202
- package/components/typography/index.js +14 -42
- package/global/index.js +0 -8
- package/icons/basic.js +0 -48
- package/icons/effect.js +15 -32
- package/icons/general/clock/clock.js +0 -2
- package/icons/general/color-handler/background.js +0 -2
- package/icons/general/color-handler/text.js +0 -2
- package/icons/general/emoji/emoji.js +0 -2
- package/icons/general/font-properties/bold.js +0 -2
- package/icons/general/font-properties/font-family.js +0 -2
- package/icons/general/font-properties/font-size.js +0 -2
- package/icons/general/font-properties/italic.js +0 -2
- package/icons/general/font-properties/underline.js +0 -2
- package/icons/general/hyperlink/hyperlink.js +0 -2
- package/icons/general/indent/decrease.js +0 -2
- package/icons/general/indent/increase.js +0 -2
- package/icons/general/list/bullets.js +0 -2
- package/icons/general/list/numbering.js +0 -2
- package/icons/general/picture/picture.js +0 -2
- package/icons/general/steps/redo.js +0 -2
- package/icons/general/steps/undo.js +0 -2
- package/icons/general/text-align/center.js +0 -2
- package/icons/general/text-align/justify.js +0 -2
- package/icons/general/text-align/left.js +0 -2
- package/icons/general/text-align/right.js +0 -2
- package/icons/menu/dhr.js +2 -1
- package/icons/menu/index.js +2 -2
- package/icons/menu/v2/index.js +2 -15
- package/package.json +42 -42
- package/readme.md +1034 -1027
- package/styles/animation.js +15 -58
- package/styles/color-helper.js +127 -157
- package/styles/colors.js +17 -9
- package/styles/general.js +16 -57
- package/styles/typography.js +4 -4
- package/styles/utils.js +18 -18
- package/theme/createBreakpoints.js +7 -18
- package/theme/make-styles.js +2 -5
- package/theme/set-theme.js +6 -9
- package/theme/settings.js +17 -22
- package/theme/theme-provider.js +0 -1
- package/utils/array/array.js +45 -54
- package/utils/classNames/index.js +0 -5
- package/utils/console.js +0 -6
- package/utils/date.js +69 -138
- package/utils/error/error.js +3 -11
- package/utils/error/errors.js +100 -147
- package/utils/getFileType.js +0 -9
- package/utils/handleBreakpoints.js +0 -5
- package/utils/intersectionObserver.js +0 -5
- package/utils/iterator.js +0 -9
- package/utils/map-parent.js +3 -10
- package/utils/object/extend.js +0 -10
- package/utils/object/object.js +12 -11
- package/utils/parseHTML.js +0 -1
- package/utils/promisify.js +0 -5
- package/utils/randomString.js +0 -7
- package/utils/remove-unicode.js +0 -1
- package/utils/render-portal.js +1 -9
- package/utils/renderHTML.js +4 -6
- package/utils/renderIcon.js +9 -19
- package/utils/sb-template.js +6 -5
- package/utils/string/capitalize.js +0 -1
- package/utils/string/capitalizeSentenceCase.js +0 -2
- package/utils/string/string.js +0 -13
- package/utils/type.js +0 -21
- package/utils/updatePosition.js +4 -5
- package/utils/useDelayUnmount.js +0 -4
- package/utils/useElementSize.js +9 -3
- package/utils/useEventListener.js +12 -6
- package/utils/useInput.js +0 -6
- package/utils/useMediaQuery/index.js +8 -10
- package/utils/useOnClickOutside.js +2 -4
- package/utils/usePortal.js +12 -19
- package/utils/validate.js +39 -53
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { css, jsx } from '@emotion/core';
|
|
5
4
|
import { Avatar, ButtonIcon, Checkbox, Chip, CircularProgress, HelperText, InputBase, Label, TreeView, Typography } from "../..";
|
|
@@ -39,25 +38,22 @@ const {
|
|
|
39
38
|
spacing
|
|
40
39
|
} = useTheme();
|
|
41
40
|
const timing = {},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
currentValue = {},
|
|
42
|
+
currentObjectDefault = {},
|
|
43
|
+
isSearch = {},
|
|
44
|
+
allValue = {};
|
|
46
45
|
const separatorPattern = /\{\w+\}/g;
|
|
47
46
|
const regexBetween = /[^{}]+(?=})/g;
|
|
48
47
|
const regexInclude = /{|}/g;
|
|
49
|
-
|
|
50
48
|
const checkHasValue = value => {
|
|
51
49
|
return Array.isArray(value) ? value.length > 0 : value === 0 || !!value;
|
|
52
50
|
};
|
|
53
|
-
|
|
54
51
|
const convertData = (dt, valueExpr) => {
|
|
55
52
|
let data = dt || [];
|
|
56
53
|
let valueTemp = Array.isArray(data) ? data : [data];
|
|
57
54
|
valueTemp = valueTemp.map(i => i[valueExpr] || i);
|
|
58
55
|
return valueTemp;
|
|
59
56
|
};
|
|
60
|
-
|
|
61
57
|
const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
62
58
|
allowSearch,
|
|
63
59
|
children,
|
|
@@ -129,36 +125,26 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
129
125
|
const [openState, setOpenState] = useState(false);
|
|
130
126
|
const [showClear, setShowClear] = useState(false);
|
|
131
127
|
const [textValue, setTextValue] = useState('');
|
|
132
|
-
let valueTemp = valueProp || defaultValue || [];
|
|
128
|
+
let valueTemp = valueProp || defaultValue || [];
|
|
133
129
|
|
|
130
|
+
// only mode multi
|
|
134
131
|
if (multiple) {
|
|
135
132
|
valueTemp = convertData(valueTemp, valueExpr);
|
|
136
133
|
}
|
|
137
|
-
|
|
138
134
|
const [valueMulti, setValueMulti] = useState(valueTemp);
|
|
139
|
-
|
|
140
135
|
const _isMobile = isMobile.any();
|
|
141
|
-
|
|
142
136
|
const _InputCSS = InputCSS(multiple, typeof renderSelectedItem === 'function');
|
|
143
|
-
|
|
144
137
|
const _DropdownInputCSS = DropdownInputCSS(viewType, multiple, placeholder, disabled, readOnly);
|
|
145
|
-
|
|
146
138
|
const _IconCSS = IconCSS(viewType);
|
|
147
|
-
|
|
148
139
|
const _DropdownFormCSS = DropdownFormCSS(viewType, multiple, disabled, placeholder, _DropdownInputCSS.name);
|
|
149
|
-
|
|
150
140
|
const _DropdownListCSS = DropdownListCSS(loading);
|
|
151
|
-
|
|
152
141
|
const _DropdownItemCSS = DropdownItemCSS(multiple, selectBox);
|
|
153
|
-
|
|
154
142
|
const _DropdownRootCSS = DropdownRootCSS(_DropdownFormCSS.name, _DropdownInputCSS.name);
|
|
155
|
-
/* Start handler */
|
|
156
|
-
|
|
157
143
|
|
|
144
|
+
/* Start handler */
|
|
158
145
|
const triggerInput = e => {
|
|
159
146
|
const target = e.currentTarget;
|
|
160
147
|
target.style.pointerEvents = 'none';
|
|
161
|
-
|
|
162
148
|
if (!dropdownListRef.current) {
|
|
163
149
|
onClickInput();
|
|
164
150
|
} else {
|
|
@@ -166,48 +152,38 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
166
152
|
target: null
|
|
167
153
|
});
|
|
168
154
|
}
|
|
169
|
-
|
|
170
155
|
setTimeout(() => {
|
|
171
156
|
target.style.pointerEvents = null;
|
|
172
157
|
}, 200);
|
|
173
158
|
};
|
|
174
|
-
|
|
175
159
|
const triggerBlur = (blur = true) => {
|
|
176
160
|
if ((currentValue[unique] || currentValue[unique] === 0) && !multiple) {
|
|
177
161
|
setValueIntoInput(currentValue[unique]);
|
|
178
162
|
} else if (!multiple) {
|
|
179
163
|
setValueIntoInput('');
|
|
180
164
|
}
|
|
181
|
-
|
|
182
165
|
!!blur && inputRef.current.blur();
|
|
183
166
|
};
|
|
184
|
-
|
|
185
167
|
const onClickInput = e => {
|
|
186
168
|
if (disabled || readOnly || loading) return;
|
|
187
|
-
|
|
188
169
|
if (!dropdownListRef.current) {
|
|
189
170
|
if (!multiple || !Array.from(inputRef.current.querySelectorAll('.DGN-UI-Chip')).some(item => item.contains(e === null || e === void 0 ? void 0 : e.target))) {
|
|
190
171
|
setOpenState(true);
|
|
191
172
|
}
|
|
192
173
|
}
|
|
193
174
|
};
|
|
194
|
-
|
|
195
175
|
const onClickOutsideOfInput = event => {
|
|
196
176
|
var _inputRef$current, _iconRef$current, _dropdownListRef$curr, _dropdownListRef$curr2, _dropdownListRef$curr3;
|
|
197
|
-
|
|
198
177
|
if (inputRef.current && !((_inputRef$current = inputRef.current) !== null && _inputRef$current !== void 0 && _inputRef$current.contains(event === null || event === void 0 ? void 0 : event.target)) && iconRef.current && !((_iconRef$current = iconRef.current) !== null && _iconRef$current !== void 0 && _iconRef$current.contains(event === null || event === void 0 ? void 0 : event.target)) && dropdownListRef.current && !((_dropdownListRef$curr = dropdownListRef.current) !== null && _dropdownListRef$curr !== void 0 && (_dropdownListRef$curr2 = _dropdownListRef$curr.parentNode) !== null && _dropdownListRef$curr2 !== void 0 && (_dropdownListRef$curr3 = _dropdownListRef$curr2.parentNode) !== null && _dropdownListRef$curr3 !== void 0 && _dropdownListRef$curr3.contains(event === null || event === void 0 ? void 0 : event.target))) {
|
|
199
178
|
closeDropdown();
|
|
200
179
|
triggerBlur(false);
|
|
201
180
|
}
|
|
202
181
|
};
|
|
203
|
-
|
|
204
182
|
const showDropdown = () => {
|
|
205
183
|
var _displayExpr, _searchRef$current;
|
|
206
|
-
|
|
207
184
|
if (displayExpr && Array.isArray(displayExpr)) {
|
|
208
185
|
displayExpr = displayExpr.join(' - ');
|
|
209
186
|
}
|
|
210
|
-
|
|
211
187
|
const keyArr = (_displayExpr = displayExpr) === null || _displayExpr === void 0 ? void 0 : _displayExpr.match(separatorPattern);
|
|
212
188
|
const dropdown = children ? jsx("div", {
|
|
213
189
|
css: _DropdownListCSS,
|
|
@@ -224,11 +200,11 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
224
200
|
left,
|
|
225
201
|
height,
|
|
226
202
|
width
|
|
227
|
-
} = formRef.current.getBoundingClientRect();
|
|
203
|
+
} = formRef.current.getBoundingClientRect();
|
|
228
204
|
|
|
205
|
+
// Calculate to set position of Dropdown box
|
|
229
206
|
const dropdownHeight = Math.min(Math.max(1, (itemMode === 'normal' ? dropdown.props.children : mapParent(dataSource, treeViewID, treeViewParentID)).length || 1), 7) * 40 + (multiple ? 43 : 0);
|
|
230
207
|
let positionTop = top + height + 4;
|
|
231
|
-
|
|
232
208
|
if (top + height + 4 + dropdownHeight + (allowSearch ? 40 : 0) > innerHeight) {
|
|
233
209
|
if (top - dropdownHeight > 0) {
|
|
234
210
|
positionTop = top - dropdownHeight;
|
|
@@ -236,11 +212,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
236
212
|
positionTop = innerHeight - dropdownHeight;
|
|
237
213
|
}
|
|
238
214
|
}
|
|
239
|
-
|
|
240
215
|
const defaultSearch = lastSearchRef.current || (onInput ? (_searchRef$current = searchRef.current) === null || _searchRef$current === void 0 ? void 0 : _searchRef$current.value : '');
|
|
241
|
-
|
|
242
216
|
const _DropdownCSS = DropdownCSS(positionTop, left, width, _isMobile, allowSearch);
|
|
243
|
-
|
|
244
217
|
const el = jsx("div", {
|
|
245
218
|
css: _DropdownCSS,
|
|
246
219
|
ref: dropdownRef,
|
|
@@ -269,34 +242,28 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
269
242
|
}, jsx(CircularProgress, {
|
|
270
243
|
size: 24
|
|
271
244
|
})) : null);
|
|
272
|
-
|
|
273
245
|
if (!((multiple || allowSearch) && itemMode === 'normal' && !children)) {
|
|
274
246
|
inputRef.current.addEventListener('keydown', pressESCHandler);
|
|
275
247
|
}
|
|
276
|
-
|
|
277
248
|
document.documentElement.style.overflow = 'hidden';
|
|
278
249
|
setTimeout(() => {
|
|
279
250
|
window.addEventListener('resize', customizeWidthDropdown);
|
|
280
251
|
document.addEventListener('wheel', onWheelHandler);
|
|
281
252
|
document.addEventListener('mousedown', onClickOutsideOfInput);
|
|
282
|
-
|
|
283
253
|
if (onLoadMore && dataSource.length < total) {
|
|
284
254
|
dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
|
|
285
255
|
}
|
|
286
256
|
}, 10);
|
|
287
257
|
return el;
|
|
288
258
|
};
|
|
289
|
-
|
|
290
259
|
const moveOnItem = e => {
|
|
291
260
|
if (e.key === 'Escape' || e.key === 'Tab') {
|
|
292
261
|
closeDropdown();
|
|
293
262
|
triggerBlur();
|
|
294
263
|
}
|
|
295
|
-
|
|
296
264
|
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
297
265
|
let activeEl = document.activeElement;
|
|
298
266
|
activeEl = e.key === 'ArrowDown' ? activeEl.nextElementSibling : activeEl.previousElementSibling;
|
|
299
|
-
|
|
300
267
|
if (activeEl) {
|
|
301
268
|
activeEl.focus();
|
|
302
269
|
activeEl.scrollIntoView({
|
|
@@ -306,7 +273,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
306
273
|
}
|
|
307
274
|
}
|
|
308
275
|
};
|
|
309
|
-
|
|
310
276
|
const pressESCHandler = e => {
|
|
311
277
|
if (e.key === 'Escape' || e.key === 'Tab') {
|
|
312
278
|
closeDropdown();
|
|
@@ -316,94 +282,74 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
316
282
|
dropdownListRef.current.firstChild.focus();
|
|
317
283
|
}
|
|
318
284
|
};
|
|
319
|
-
|
|
320
285
|
const onWheelHandler = e => {
|
|
321
286
|
var _dropdownRef$current;
|
|
322
|
-
|
|
323
287
|
if (!dropdownRef.current) {
|
|
324
288
|
document.removeEventListener('wheel', onWheelHandler);
|
|
325
289
|
return;
|
|
326
290
|
}
|
|
327
|
-
|
|
328
291
|
if (!((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(e.target))) {
|
|
329
292
|
closeDropdown();
|
|
330
293
|
triggerBlur();
|
|
331
294
|
}
|
|
332
295
|
};
|
|
333
|
-
|
|
334
296
|
const closeDropdown = () => {
|
|
335
297
|
if (dropdownRef.current) {
|
|
336
298
|
setOpenState(false);
|
|
337
299
|
document.removeEventListener('mousedown', onClickOutsideOfInput);
|
|
338
300
|
window.removeEventListener('resize', customizeWidthDropdown);
|
|
339
301
|
document.removeEventListener('wheel', onWheelHandler);
|
|
340
|
-
|
|
341
302
|
if (onLoadMore && dropdownListRef.current) {
|
|
342
303
|
dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
|
|
343
304
|
dropdownListRef.current = null;
|
|
344
305
|
}
|
|
345
306
|
}
|
|
346
|
-
|
|
347
307
|
document.documentElement.style.overflow = 'auto';
|
|
348
308
|
if (searchRef.current) lastSearchRef.current = '';
|
|
349
309
|
onClosed === null || onClosed === void 0 ? void 0 : onClosed();
|
|
350
310
|
};
|
|
351
|
-
|
|
352
311
|
const renderDropdown = pattern => {
|
|
353
312
|
var _displayExpr2;
|
|
354
|
-
|
|
355
313
|
const keyArr = (_displayExpr2 = displayExpr) === null || _displayExpr2 === void 0 ? void 0 : _displayExpr2.match(separatorPattern);
|
|
356
314
|
const dropdown = mapDropdown(pattern, keyArr);
|
|
357
315
|
const el = document.createElement('div');
|
|
358
316
|
el.className = `DGN-Dropdown-Box`;
|
|
359
|
-
|
|
360
317
|
if (dropdownRef.current) {
|
|
361
318
|
var _dropdownRef$current$;
|
|
362
|
-
|
|
363
319
|
(_dropdownRef$current$ = dropdownRef.current.querySelector('.DGN-Dropdown-Box')) === null || _dropdownRef$current$ === void 0 ? void 0 : _dropdownRef$current$.remove();
|
|
364
320
|
ReactDOM.render(dropdown, dropdownRef.current.appendChild(el));
|
|
365
321
|
setTimeout(() => {
|
|
366
322
|
if (onLoadMore && dataSource.length < total) {
|
|
367
323
|
dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
|
|
368
324
|
}
|
|
369
|
-
|
|
370
325
|
updatePositionDropdown();
|
|
371
326
|
}, 0);
|
|
372
327
|
}
|
|
373
328
|
};
|
|
374
|
-
|
|
375
329
|
const handleRenderBySearch = (data, searchValue) => {
|
|
376
330
|
let existExpr;
|
|
377
331
|
typeof data === 'object' ? existExpr = searchExpr.filter(value => Object.keys(data).includes(value)) : existExpr = [data];
|
|
378
332
|
return existExpr.every(key => {
|
|
379
333
|
const _data = (data === null || data === void 0 ? void 0 : data[key]) || key.toString();
|
|
380
|
-
|
|
381
334
|
if (searchMode === 'contains') {
|
|
382
335
|
if (_data.indexOf(searchValue) !== -1) return false;
|
|
383
336
|
}
|
|
384
|
-
|
|
385
337
|
if (searchMode === 'startswith') {
|
|
386
338
|
if (_data.lastIndexOf(searchValue) === 0) return false;
|
|
387
339
|
}
|
|
388
|
-
|
|
389
340
|
if (searchMode === 'equals') {
|
|
390
341
|
if (_data === searchValue) return false;
|
|
391
342
|
}
|
|
392
|
-
|
|
393
343
|
return true;
|
|
394
344
|
});
|
|
395
345
|
};
|
|
396
|
-
|
|
397
346
|
const mapDropdown = (pattern, keyArr) => {
|
|
398
347
|
var _currentObjectDefault;
|
|
399
|
-
|
|
400
348
|
const items = [];
|
|
401
349
|
const dataSourceUsable = [...dataSource];
|
|
402
|
-
|
|
403
350
|
if (currentObjectDefault[unique] && (_currentObjectDefault = currentObjectDefault[unique]) !== null && _currentObjectDefault !== void 0 && _currentObjectDefault.length) {
|
|
404
351
|
const length = currentObjectDefault[unique].length;
|
|
405
352
|
let existItemQuantity = 0;
|
|
406
|
-
|
|
407
353
|
for (let index = length - 1; index >= 0; index--) {
|
|
408
354
|
if (!dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
|
|
409
355
|
dataSourceUsable.unshift(currentObjectDefault[unique][index]);
|
|
@@ -412,26 +358,20 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
412
358
|
if (++existItemQuantity > limit) {
|
|
413
359
|
continue;
|
|
414
360
|
}
|
|
415
|
-
|
|
416
361
|
currentObjectDefault[unique].splice(index, 1);
|
|
417
362
|
}
|
|
418
363
|
}
|
|
419
364
|
}
|
|
420
|
-
|
|
421
365
|
const length = dataSourceUsable.length;
|
|
422
|
-
|
|
423
366
|
for (let index = 0; index < length; index++) {
|
|
424
367
|
var _searchExpr;
|
|
425
|
-
|
|
426
368
|
const data = dataSourceUsable[index];
|
|
427
369
|
const itemHidden = typeof data === 'object' ? data['hidden'] : false;
|
|
428
370
|
if (itemHidden) continue;
|
|
429
371
|
let displayText = typeof data === 'object' ? keyArr ? renderData(data, keyArr) : data[displayExpr] || data[valueExpr] : data;
|
|
430
|
-
|
|
431
372
|
if (((_searchExpr = searchExpr) === null || _searchExpr === void 0 ? void 0 : _searchExpr.length) > 0 && pattern) {
|
|
432
373
|
if (handleRenderBySearch(data, pattern)) continue;
|
|
433
374
|
} else if (pattern && !new RegExp(pattern).test(displayText.normalize())) continue;
|
|
434
|
-
|
|
435
375
|
if (renderItem && typeof renderItem === 'function') {
|
|
436
376
|
displayText = renderItem({
|
|
437
377
|
data,
|
|
@@ -450,14 +390,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
450
390
|
index
|
|
451
391
|
}) : data[subText] || subText));
|
|
452
392
|
}
|
|
453
|
-
|
|
454
393
|
const value = typeof data === 'object' ? data[valueExpr] : data;
|
|
455
394
|
let itemDisabled = typeof data === 'object' ? data['disabled'] : false;
|
|
456
395
|
const icon = getIconFromData(data);
|
|
457
396
|
const text = jsx(Typography, {
|
|
458
397
|
type: 'p1'
|
|
459
398
|
}, displayText);
|
|
460
|
-
|
|
461
399
|
if (multiple && selectBox) {
|
|
462
400
|
const checked = Array.isArray(valueMulti) ? valueMulti.includes(value) : valueMulti.includes(value);
|
|
463
401
|
const isMaximumSelection = maximumSelectionLength === (valueMulti === null || valueMulti === void 0 ? void 0 : valueMulti.length);
|
|
@@ -465,7 +403,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
465
403
|
items.push(jsx("div", {
|
|
466
404
|
key: index,
|
|
467
405
|
css: !itemDisabled ? _DropdownItemCSS : [DisabledCSS, _DropdownItemCSS],
|
|
468
|
-
className: 'DGN-UI-Dropdown-Item'
|
|
406
|
+
className: 'DGN-UI-Dropdown-Item'
|
|
407
|
+
// onClick={() => {
|
|
469
408
|
// if (itemDisabled) return;
|
|
470
409
|
// onChangeValueWithCheckbox(e) & onChangeValue(displayText, value, icon, data, index);
|
|
471
410
|
// onChangeValue(displayText, value, icon, data, index);
|
|
@@ -473,8 +412,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
473
412
|
,
|
|
474
413
|
onKeyPress: e => {
|
|
475
414
|
if (itemDisabled) return;
|
|
476
|
-
if (e.key === 'Enter') e.currentTarget.firstChild.click();
|
|
415
|
+
if (e.key === 'Enter') e.currentTarget.firstChild.click();
|
|
416
|
+
// if (e.key === 'Enter') onChangeValue(displayText, value, icon, data, index);
|
|
477
417
|
},
|
|
418
|
+
|
|
478
419
|
tabIndex: -1
|
|
479
420
|
}, jsx(Checkbox, {
|
|
480
421
|
css: CheckBoxCSS,
|
|
@@ -502,7 +443,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
502
443
|
}, icon, text));
|
|
503
444
|
}
|
|
504
445
|
}
|
|
505
|
-
|
|
506
446
|
return jsx("div", {
|
|
507
447
|
css: _DropdownListCSS,
|
|
508
448
|
ref: dropdownListRef,
|
|
@@ -511,7 +451,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
511
451
|
tabIndex: -1
|
|
512
452
|
}, items !== null && items !== void 0 && items.length ? items : EmptyDataText);
|
|
513
453
|
};
|
|
514
|
-
|
|
515
454
|
const mapTreeView = () => {
|
|
516
455
|
return jsx("div", {
|
|
517
456
|
css: _DropdownListCSS,
|
|
@@ -538,17 +477,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
538
477
|
renderItem: renderItem
|
|
539
478
|
}) : EmptyDataText);
|
|
540
479
|
};
|
|
541
|
-
|
|
542
480
|
const loadMoreItemsDropdown = (i = 0, pattern) => {
|
|
543
481
|
var _currentObjectDefault2, _displayExpr3;
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
482
|
+
const dataSourceUsable = [...dataSource];
|
|
483
|
+
// Nếu có load more thì đẩy đội tượng mặc định lên đầu
|
|
547
484
|
let notExistItem = 0;
|
|
548
|
-
|
|
549
485
|
if (onLoadMore && (_currentObjectDefault2 = currentObjectDefault[unique]) !== null && _currentObjectDefault2 !== void 0 && _currentObjectDefault2.length) {
|
|
550
486
|
const length = currentObjectDefault[unique].length;
|
|
551
|
-
|
|
552
487
|
for (let index = length - 1; index >= 0; index--) {
|
|
553
488
|
if (!dataSourceUsable.some(data => data[valueExpr] === currentObjectDefault[unique][index][valueExpr])) {
|
|
554
489
|
notExistItem++;
|
|
@@ -556,20 +491,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
556
491
|
}
|
|
557
492
|
}
|
|
558
493
|
}
|
|
559
|
-
|
|
560
494
|
const length = dataSourceUsable.length;
|
|
561
495
|
let num = 0;
|
|
562
|
-
|
|
563
496
|
if (displayExpr && Array.isArray(displayExpr)) {
|
|
564
497
|
displayExpr = displayExpr.join(' - ');
|
|
565
498
|
}
|
|
566
|
-
|
|
567
499
|
const keyArr = (_displayExpr3 = displayExpr) === null || _displayExpr3 === void 0 ? void 0 : _displayExpr3.match(separatorPattern);
|
|
568
|
-
|
|
569
500
|
for (i; i < length; i++) {
|
|
570
|
-
const data = {
|
|
571
|
-
|
|
572
|
-
|
|
501
|
+
const data = {
|
|
502
|
+
...dataSourceUsable[i]
|
|
503
|
+
};
|
|
504
|
+
// Nếu đối tượng đã được hiển thị ở trên rồi thì không hiển thị ra nữa
|
|
573
505
|
if (onLoadMore && i > notExistItem && currentObjectDefault[unique].some(valueObject => valueObject[valueExpr] === data[valueExpr])) continue;
|
|
574
506
|
let displayText = typeof data === 'object' ? keyArr ? renderData(data, keyArr) : data[displayExpr] || data[valueExpr] : data;
|
|
575
507
|
if (pattern && !new RegExp(pattern).test(displayText.normalize())) continue;
|
|
@@ -578,7 +510,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
578
510
|
const text = jsx(Typography, {
|
|
579
511
|
type: 'p1'
|
|
580
512
|
}, displayText);
|
|
581
|
-
|
|
582
513
|
if (renderItem && typeof renderItem === 'function') {
|
|
583
514
|
displayText = renderItem({
|
|
584
515
|
data,
|
|
@@ -597,7 +528,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
597
528
|
index: i
|
|
598
529
|
}) : data[subText] || subText));
|
|
599
530
|
}
|
|
600
|
-
|
|
601
531
|
const dropdownItem = document.createElement('div');
|
|
602
532
|
dropdownItem.className = `DGN-UI-Dropdown-Item css-${_DropdownItemCSS.name}`;
|
|
603
533
|
dropdownItem.tabIndex = -1;
|
|
@@ -606,7 +536,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
606
536
|
if (e.key === 'Enter') dropdownItem.firstChild.click();
|
|
607
537
|
});
|
|
608
538
|
let item = null;
|
|
609
|
-
|
|
610
539
|
if (multiple && selectBox) {
|
|
611
540
|
const checked = Array.isArray(currentValue[unique]) ? currentValue[unique].includes(value) : [currentValue[unique]].includes(value);
|
|
612
541
|
item = jsx(Checkbox, {
|
|
@@ -617,13 +546,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
617
546
|
} else {
|
|
618
547
|
item = jsx(Fragment, null, icon, text);
|
|
619
548
|
}
|
|
620
|
-
|
|
621
549
|
if (!dropdownListRef.current) {
|
|
622
550
|
return;
|
|
623
551
|
}
|
|
624
|
-
|
|
625
552
|
ReactDOM.render(item, dropdownListRef.current.appendChild(dropdownItem));
|
|
626
|
-
|
|
627
553
|
if (++num === 100) {
|
|
628
554
|
timerRef.current = setTimeout(() => {
|
|
629
555
|
loadMoreItemsDropdown(i + 1, pattern);
|
|
@@ -632,34 +558,26 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
632
558
|
}
|
|
633
559
|
}
|
|
634
560
|
};
|
|
635
|
-
|
|
636
561
|
const renderData = (data, keyArr) => {
|
|
637
562
|
const pattern = keyArr.join('|').replace(/([{}])/g, '\\$1');
|
|
638
563
|
const separatorArr = displayExpr.split(new RegExp(pattern));
|
|
639
564
|
let str = '';
|
|
640
565
|
let i = 0;
|
|
641
|
-
|
|
642
566
|
for (i; i < keyArr.length; i++) {
|
|
643
567
|
str += separatorArr[i] + (data[keyArr[i].replace(/\W/g, '')] !== undefined ? data[keyArr[i].replace(/\W/g, '')] : keyArr[i]);
|
|
644
568
|
}
|
|
645
|
-
|
|
646
569
|
return str + separatorArr[i];
|
|
647
570
|
};
|
|
648
|
-
|
|
649
571
|
const getIconFromData = (data, insideChip = false) => {
|
|
650
572
|
if (!iconExpr || iconExpr === 'none') return null;
|
|
651
|
-
|
|
652
573
|
let _src;
|
|
653
|
-
|
|
654
574
|
if (typeof iconExpr === 'string') _src = data[iconExpr];else {
|
|
655
575
|
let prefix = iconExpr.prefix || '';
|
|
656
576
|
const suffix = iconExpr.suffix || '';
|
|
657
577
|
const url = data[iconExpr.key];
|
|
658
|
-
|
|
659
578
|
if (prefix && /^http/i.test(prefix) && /^http/i.test(url)) {
|
|
660
579
|
prefix = '';
|
|
661
580
|
}
|
|
662
|
-
|
|
663
581
|
_src = prefix + url + suffix;
|
|
664
582
|
}
|
|
665
583
|
return jsx(Avatar, {
|
|
@@ -667,55 +585,45 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
667
585
|
src: _src,
|
|
668
586
|
width: insideChip ? 20 : 24,
|
|
669
587
|
height: insideChip ? 20 : 24,
|
|
670
|
-
style: {
|
|
588
|
+
style: {
|
|
589
|
+
...iconExpr.style,
|
|
671
590
|
marginRight: spacing([insideChip ? 0 : 2])
|
|
672
591
|
}
|
|
673
592
|
});
|
|
674
593
|
};
|
|
675
|
-
|
|
676
594
|
const customizeWidthDropdown = () => {
|
|
677
595
|
if (dropdownListRef.current && _isMobile) dropdownListRef.current.style.maxHeight = `${Math.min(280, window.innerHeight) - (allowSearch ? 40 : 0)}px`;
|
|
678
|
-
|
|
679
596
|
if (!ref.current) {
|
|
680
597
|
window.removeEventListener('resize', customizeWidthDropdown);
|
|
681
598
|
return;
|
|
682
599
|
}
|
|
683
|
-
|
|
684
600
|
const {
|
|
685
601
|
width
|
|
686
602
|
} = ref.current.getBoundingClientRect();
|
|
687
|
-
|
|
688
603
|
if (dropdownRef.current) {
|
|
689
604
|
dropdownRef.current.style.width = width + 'px';
|
|
690
605
|
}
|
|
691
|
-
|
|
692
606
|
updatePositionDropdown();
|
|
693
607
|
};
|
|
694
|
-
|
|
695
608
|
const updatePositionDropdown = () => {
|
|
696
609
|
if (!formRef.current || !dropdownRef.current) {
|
|
697
610
|
document.removeEventListener('wheel', onWheelHandler);
|
|
698
611
|
return;
|
|
699
612
|
}
|
|
700
|
-
|
|
701
613
|
_isMobile ? updatePosition(formRef.current, dropdownRef.current, null) : updatePosition(formRef.current, dropdownRef.current, closeDropdown);
|
|
702
614
|
};
|
|
703
|
-
|
|
704
615
|
const onLoadMoreHandler = e => {
|
|
705
616
|
if (loadMoreTimer.current) {
|
|
706
617
|
clearTimeout(loadMoreTimer.current);
|
|
707
618
|
}
|
|
708
|
-
|
|
709
619
|
loadMoreTimer.current = setTimeout(() => {
|
|
710
620
|
const {
|
|
711
621
|
scrollTop,
|
|
712
622
|
scrollHeight,
|
|
713
623
|
offsetHeight
|
|
714
624
|
} = e.target;
|
|
715
|
-
|
|
716
625
|
if (scrollHeight === Math.ceil(scrollTop) + offsetHeight && dropdownListRef.current) {
|
|
717
626
|
var _dropdownListRef$curr4, _currentObjectDefault3;
|
|
718
|
-
|
|
719
627
|
const length = ((_dropdownListRef$curr4 = dropdownListRef.current.children) === null || _dropdownListRef$curr4 === void 0 ? void 0 : _dropdownListRef$curr4.length) - (((_currentObjectDefault3 = currentObjectDefault[unique]) === null || _currentObjectDefault3 === void 0 ? void 0 : _currentObjectDefault3.length) || 0);
|
|
720
628
|
dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
|
|
721
629
|
!!onLoadMore && onLoadMore({
|
|
@@ -725,54 +633,47 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
725
633
|
}
|
|
726
634
|
});
|
|
727
635
|
};
|
|
728
|
-
|
|
729
636
|
const onPreventKeyDownHandler = e => {
|
|
730
637
|
e.preventDefault();
|
|
731
638
|
return false;
|
|
732
639
|
};
|
|
733
|
-
|
|
734
640
|
const onChangeInput = e => {
|
|
735
641
|
if (searchRef.current) lastSearchRef.current = searchRef.current.value;
|
|
736
642
|
const dataFilter = getData();
|
|
737
643
|
dataChoosen.current = [...dataFilter].filter(i => [...valueMulti].includes(i === null || i === void 0 ? void 0 : i[valueExpr]));
|
|
738
|
-
|
|
739
644
|
if (onInput) {
|
|
740
|
-
isSearch[unique] = true;
|
|
645
|
+
isSearch[unique] = true;
|
|
646
|
+
// const valueInput = e.target.value;
|
|
741
647
|
// const text = (valueInput || e.target.textContent).normalize();
|
|
742
|
-
|
|
743
648
|
if (timeout.current) {
|
|
744
649
|
if (timing[unique]) {
|
|
745
650
|
clearTimeout(timing[unique]);
|
|
746
651
|
}
|
|
747
|
-
|
|
748
652
|
timing[unique] = setTimeout(() => {
|
|
749
653
|
// e.target.value = text;
|
|
750
|
-
onInput(e);
|
|
654
|
+
onInput(e);
|
|
655
|
+
// e.target.value = valueInput;
|
|
751
656
|
}, timeout.current || searchDelayTime);
|
|
752
657
|
} else {
|
|
753
658
|
// e.target.value = text;
|
|
754
|
-
onInput(e);
|
|
659
|
+
onInput(e);
|
|
660
|
+
// e.target.value = valueInput;
|
|
755
661
|
}
|
|
756
662
|
|
|
757
663
|
return;
|
|
758
664
|
}
|
|
759
|
-
|
|
760
665
|
const value = e.target.value || e.target.textContent;
|
|
761
|
-
|
|
762
666
|
if (typeof renderSelectedItem === 'function' && e.target.childNodes && Array.from(e.target.childNodes).some(node => node.toString() !== '[object Text]')) {
|
|
763
667
|
const cursor = document.getSelection().anchorOffset;
|
|
764
668
|
e.target.innerHTML = value;
|
|
765
669
|
document.getSelection().collapse(e.target, cursor);
|
|
766
670
|
}
|
|
767
|
-
|
|
768
671
|
if (timing[unique]) clearTimeout(timing[unique]);
|
|
769
672
|
timing[unique] = setTimeout(() => {
|
|
770
673
|
var _searchExpr2;
|
|
771
|
-
|
|
772
674
|
renderDropdown(((_searchExpr2 = searchExpr) === null || _searchExpr2 === void 0 ? void 0 : _searchExpr2.length) > 0 ? value.normalize() : new RegExp(value.normalize(), 'gim'));
|
|
773
675
|
}, timeout.current || searchDelayTime);
|
|
774
676
|
};
|
|
775
|
-
|
|
776
677
|
const onChangeValue = (displayText, value, icon, data) => {
|
|
777
678
|
if (itemMode === 'treeview') {
|
|
778
679
|
if (valueProp === undefined) {
|
|
@@ -780,7 +681,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
780
681
|
setValueIntoInput(value);
|
|
781
682
|
setShowClear(clearAble && checkHasValue(value) && !disabled && !readOnly && !loading);
|
|
782
683
|
}
|
|
783
|
-
|
|
784
684
|
!!onChange && onChange({
|
|
785
685
|
value
|
|
786
686
|
});
|
|
@@ -789,10 +689,11 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
789
689
|
}, 0);
|
|
790
690
|
} else if (multiple) {
|
|
791
691
|
if (!Array.isArray(currentValue[unique])) currentValue[unique] = [];
|
|
792
|
-
const newValueArr = [...currentValue[unique]];
|
|
793
|
-
|
|
692
|
+
const newValueArr = [...currentValue[unique]];
|
|
693
|
+
// const newValueArrState = [...valueMulti];
|
|
794
694
|
if (!currentValue[unique].some(v => JSON.stringify(v) === JSON.stringify(value))) {
|
|
795
|
-
newValueArr.push(value);
|
|
695
|
+
newValueArr.push(value);
|
|
696
|
+
// newValueArrState.push(value);
|
|
796
697
|
// if (valueProp === undefined) {
|
|
797
698
|
// let item = null;
|
|
798
699
|
// if (typeof renderSelectedItem === 'function') {
|
|
@@ -817,14 +718,14 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
817
718
|
// }
|
|
818
719
|
} else {
|
|
819
720
|
const index = newValueArr.indexOf(value);
|
|
820
|
-
newValueArr.splice(index, 1);
|
|
721
|
+
newValueArr.splice(index, 1);
|
|
722
|
+
// newValueArrState.splice(index, 1);
|
|
821
723
|
// if (valueProp === undefined) {
|
|
822
724
|
// const nodes = inputRef.current.querySelectorAll('.dropdown-item');
|
|
823
725
|
// nodes[index]?.remove();
|
|
824
726
|
// }
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
|
|
727
|
+
}
|
|
728
|
+
// setValueMulti(newValueArrState);
|
|
828
729
|
!!onChange && onChange({
|
|
829
730
|
value: newValueArr,
|
|
830
731
|
data
|
|
@@ -834,14 +735,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
834
735
|
}, 0);
|
|
835
736
|
} else {
|
|
836
737
|
const isChanged = currentValue[unique] !== value;
|
|
837
|
-
|
|
838
738
|
if (isChanged) {
|
|
839
739
|
if (valueProp === undefined) {
|
|
840
740
|
allValue[unique].push(value);
|
|
841
741
|
setValueIntoInput(value);
|
|
842
742
|
setShowClear(clearAble && checkHasValue(value) && !disabled && !readOnly && !loading);
|
|
843
743
|
}
|
|
844
|
-
|
|
845
744
|
!!onChange && onChange({
|
|
846
745
|
value,
|
|
847
746
|
data
|
|
@@ -851,7 +750,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
851
750
|
triggerBlur(false);
|
|
852
751
|
}
|
|
853
752
|
}
|
|
854
|
-
|
|
855
753
|
if (closeAfterSelect === true || closeAfterSelect === undefined && !multiple) {
|
|
856
754
|
closeDropdown();
|
|
857
755
|
} else {
|
|
@@ -859,22 +757,22 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
859
757
|
updatePositionDropdown();
|
|
860
758
|
}, 0);
|
|
861
759
|
}
|
|
862
|
-
};
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
// const onChangeValueWithCheckbox = e => {
|
|
863
763
|
// const firstChild = e.currentTarget.firstChild;
|
|
864
764
|
// if (!firstChild.contains(e.target)) {
|
|
865
765
|
// firstChild.click();
|
|
866
766
|
// }
|
|
867
767
|
// };
|
|
868
768
|
|
|
869
|
-
|
|
870
769
|
const onRemove = (e, value) => {
|
|
871
770
|
var _ref;
|
|
872
|
-
|
|
873
771
|
if (readOnly || disabled) return;
|
|
874
772
|
const index = currentValue[unique].findIndex(v => JSON.stringify(v) === JSON.stringify(value));
|
|
875
|
-
|
|
876
773
|
if (index !== -1) {
|
|
877
|
-
currentValue[unique].splice(index, 1);
|
|
774
|
+
currentValue[unique].splice(index, 1);
|
|
775
|
+
// setTimeout(() => {
|
|
878
776
|
// if (dropdownListRef.current && multiple && selectBox && !children) {
|
|
879
777
|
// const input = dropdownListRef.current.querySelector(`input[value="${value}"]`);
|
|
880
778
|
// if (input) {
|
|
@@ -887,9 +785,9 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
887
785
|
// }, 0);
|
|
888
786
|
// setValueMulti([...valueMulti]?.filter(i=>i!==value) || []);
|
|
889
787
|
// !!onChange && onChange({ value: currentValue[unique], removed: value });
|
|
890
|
-
}
|
|
891
|
-
|
|
788
|
+
}
|
|
892
789
|
|
|
790
|
+
// logic mới
|
|
893
791
|
const newValueArrState = ((_ref = [...valueMulti]) === null || _ref === void 0 ? void 0 : _ref.filter(i => i !== value)) || [];
|
|
894
792
|
setValueMulti(newValueArrState);
|
|
895
793
|
!!onChange && onChange({
|
|
@@ -897,26 +795,25 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
897
795
|
removed: value
|
|
898
796
|
});
|
|
899
797
|
};
|
|
900
|
-
|
|
901
798
|
const onClear = e => {
|
|
902
799
|
if (disabled || readOnly || loading || !clearAble) return;
|
|
903
800
|
currentValue[unique] = multiple ? [] : '';
|
|
904
|
-
|
|
905
|
-
|
|
801
|
+
if (inputRef.current.tagName.toLowerCase() === 'div') {
|
|
802
|
+
// inputRef.current.innerHTML = '';
|
|
906
803
|
// if (dropdownListRef.current) {
|
|
907
804
|
// dropdownListRef.current.querySelectorAll('input').forEach(input => (input.checked = false));
|
|
908
805
|
// }
|
|
909
806
|
} else {
|
|
910
807
|
inputRef.current.value = '';
|
|
911
808
|
setTextValue('');
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
|
|
809
|
+
}
|
|
810
|
+
// onChangeValue('', '');
|
|
915
811
|
setValueMulti([]);
|
|
916
812
|
setShowClear(false);
|
|
917
813
|
e && e.target && e.target.blur();
|
|
918
814
|
updatePositionDropdown();
|
|
919
|
-
onInput === null || onInput === void 0 ? void 0 : onInput({
|
|
815
|
+
onInput === null || onInput === void 0 ? void 0 : onInput({
|
|
816
|
+
...(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current),
|
|
920
817
|
target: {
|
|
921
818
|
value: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current.value
|
|
922
819
|
}
|
|
@@ -925,12 +822,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
925
822
|
value: currentValue[unique]
|
|
926
823
|
});
|
|
927
824
|
};
|
|
928
|
-
|
|
929
825
|
const setPreviousValue = () => {
|
|
930
826
|
allValue[unique].pop();
|
|
931
827
|
setValueIntoInput(allValue[unique][allValue[unique].length - 1]);
|
|
932
828
|
};
|
|
933
|
-
|
|
934
829
|
const setValueIntoInput = source => {
|
|
935
830
|
if (!source && source !== 0) {
|
|
936
831
|
if (multiple) {
|
|
@@ -943,45 +838,34 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
943
838
|
inputRef.current.value = '';
|
|
944
839
|
setTextValue('');
|
|
945
840
|
}
|
|
946
|
-
|
|
947
841
|
currentValue[unique] = '';
|
|
948
842
|
}
|
|
949
|
-
|
|
950
843
|
return;
|
|
951
844
|
}
|
|
952
|
-
|
|
953
845
|
const length = dataSource.length;
|
|
954
846
|
const displayKey = typeof renderSelectedItem === 'string' ? renderSelectedItem : displayExpr;
|
|
955
|
-
|
|
956
847
|
if (displayKey && Array.isArray(displayKey)) {
|
|
957
848
|
displayExpr = displayExpr.join(' - ');
|
|
958
849
|
}
|
|
959
|
-
|
|
960
850
|
const keyArr = displayKey === null || displayKey === void 0 ? void 0 : displayKey.match(separatorPattern);
|
|
961
|
-
|
|
962
851
|
if (multiple) {
|
|
963
852
|
let valueArr = source;
|
|
964
|
-
|
|
965
853
|
if (!Array.isArray(valueArr)) {
|
|
966
854
|
valueArr = [valueArr];
|
|
967
855
|
}
|
|
968
|
-
|
|
969
856
|
valueArr = [...new Set(valueArr)];
|
|
970
|
-
currentValue[unique] = [];
|
|
971
|
-
|
|
857
|
+
currentValue[unique] = [];
|
|
858
|
+
// inputRef.current.innerHTML = '';
|
|
972
859
|
valueArr.forEach(v => {
|
|
973
860
|
var _currentObjectDefault4;
|
|
974
|
-
|
|
975
861
|
for (let i = 0; i < length; i++) {
|
|
976
862
|
if (typeof dataSource[i] === 'object' && dataSource[i][valueExpr] === v || dataSource[i] === v) {
|
|
977
863
|
setMultipleValueHandler(dataSource[i], v, keyArr, i);
|
|
978
864
|
return;
|
|
979
865
|
}
|
|
980
866
|
}
|
|
981
|
-
|
|
982
867
|
if ((_currentObjectDefault4 = currentObjectDefault[unique]) !== null && _currentObjectDefault4 !== void 0 && _currentObjectDefault4.length) {
|
|
983
868
|
const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === v || valueObject === v);
|
|
984
|
-
|
|
985
869
|
if (itemOfValue) {
|
|
986
870
|
setMultipleValueHandler(itemOfValue, v, keyArr);
|
|
987
871
|
}
|
|
@@ -989,31 +873,25 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
989
873
|
});
|
|
990
874
|
} else {
|
|
991
875
|
var _currentObjectDefault5;
|
|
992
|
-
|
|
993
876
|
currentValue[unique] = source;
|
|
994
|
-
|
|
995
877
|
for (let i = 0; i < length; i++) {
|
|
996
878
|
if (dataSource[i][valueExpr] === source || dataSource[i] === source) {
|
|
997
879
|
setSingleValueHandler(dataSource[i], keyArr);
|
|
998
880
|
return;
|
|
999
881
|
}
|
|
1000
882
|
}
|
|
1001
|
-
|
|
1002
883
|
if ((_currentObjectDefault5 = currentObjectDefault[unique]) !== null && _currentObjectDefault5 !== void 0 && _currentObjectDefault5.length) {
|
|
1003
884
|
const itemOfValue = currentObjectDefault[unique].find(valueObject => valueObject[valueExpr] === source || valueObject === source);
|
|
1004
|
-
|
|
1005
885
|
if (itemOfValue) {
|
|
1006
886
|
setSingleValueHandler(itemOfValue, keyArr);
|
|
1007
887
|
return;
|
|
1008
888
|
}
|
|
1009
889
|
}
|
|
1010
|
-
|
|
1011
890
|
if (!isSearch[unique]) {
|
|
1012
891
|
inputRef.current.value = source;
|
|
1013
892
|
}
|
|
1014
893
|
}
|
|
1015
894
|
};
|
|
1016
|
-
|
|
1017
895
|
const setMultipleValueHandler = (data, value) => {
|
|
1018
896
|
// let item = null;
|
|
1019
897
|
// if (typeof renderSelectedItem === 'function') {
|
|
@@ -1039,10 +917,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1039
917
|
// ReactDOM.render(item, inputRef.current.appendChild(el));
|
|
1040
918
|
currentValue[unique].push(value);
|
|
1041
919
|
};
|
|
1042
|
-
|
|
1043
920
|
const setSingleValueHandler = (data, keyArr) => {
|
|
1044
921
|
const text = keyArr ? renderData(data, keyArr) : typeof renderSelectedItem === 'string' ? data[renderSelectedItem] : data[displayExpr] || data[valueExpr] || data;
|
|
1045
|
-
|
|
1046
922
|
if (typeof renderSelectedItem === 'function') {
|
|
1047
923
|
inputRef.current.innerHTML = '';
|
|
1048
924
|
const item = renderSelectedItem({
|
|
@@ -1068,7 +944,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1068
944
|
setTextValue(text);
|
|
1069
945
|
}
|
|
1070
946
|
};
|
|
1071
|
-
|
|
1072
947
|
useImperativeHandle(reference, () => {
|
|
1073
948
|
const currentRef = ref.current || {};
|
|
1074
949
|
const _instance = {
|
|
@@ -1084,30 +959,22 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1084
959
|
if (allValue[unique][allValue[unique].length - 1] !== value) {
|
|
1085
960
|
allValue[unique].push(value);
|
|
1086
961
|
}
|
|
1087
|
-
|
|
1088
962
|
setValueIntoInput(value);
|
|
1089
963
|
}
|
|
1090
964
|
}; // methods
|
|
1091
|
-
|
|
1092
965
|
_instance.__proto__ = {}; // hidden methods
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
966
|
+
currentRef.instance = _instance;
|
|
967
|
+
// keep old method
|
|
1096
968
|
currentRef.closeDropdown = () => closeDropdown();
|
|
1097
|
-
|
|
1098
969
|
currentRef.showDropdown = () => setOpenState(true);
|
|
1099
|
-
|
|
1100
970
|
currentRef.onClear = onClear;
|
|
1101
971
|
currentRef.setPreviousValue = setPreviousValue;
|
|
1102
|
-
|
|
1103
972
|
currentRef.setValue = value => {
|
|
1104
973
|
if (allValue[unique][allValue[unique].length - 1] !== value) {
|
|
1105
974
|
allValue[unique].push(value);
|
|
1106
975
|
}
|
|
1107
|
-
|
|
1108
976
|
setValueIntoInput(value);
|
|
1109
977
|
};
|
|
1110
|
-
|
|
1111
978
|
currentRef.DOM = ref.current;
|
|
1112
979
|
return currentRef;
|
|
1113
980
|
});
|
|
@@ -1124,19 +991,16 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1124
991
|
} else {
|
|
1125
992
|
currentObjectDefault[unique] = [];
|
|
1126
993
|
}
|
|
1127
|
-
|
|
1128
994
|
return () => {
|
|
1129
995
|
currentObjectDefault[unique] = null;
|
|
1130
996
|
};
|
|
1131
997
|
}, [valueObjectDefault]);
|
|
1132
998
|
useEffect(() => {
|
|
1133
999
|
allValue[unique] = [];
|
|
1134
|
-
|
|
1135
1000
|
if (defaultValue !== undefined && JSON.stringify(defaultValue) !== '[]') {
|
|
1136
1001
|
setValueIntoInput(defaultValue);
|
|
1137
1002
|
setShowClear(clearAble && checkHasValue(defaultValue) && !disabled && !readOnly && !loading);
|
|
1138
1003
|
}
|
|
1139
|
-
|
|
1140
1004
|
return () => {
|
|
1141
1005
|
allValue[unique] = null;
|
|
1142
1006
|
closeDropdown();
|
|
@@ -1145,7 +1009,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1145
1009
|
useEffect(() => {
|
|
1146
1010
|
if (searchDelayTime) {
|
|
1147
1011
|
var _searchDelayTime$matc, _searchDelayTime$matc2;
|
|
1148
|
-
|
|
1149
1012
|
if (searchDelayTime === true) searchDelayTime = getGlobal('delayOnInput');
|
|
1150
1013
|
const units = {
|
|
1151
1014
|
m: 60000,
|
|
@@ -1162,12 +1025,10 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1162
1025
|
if (allValue[unique][allValue[unique].length - 1] !== valueProp) {
|
|
1163
1026
|
allValue[unique].push(valueProp);
|
|
1164
1027
|
}
|
|
1165
|
-
|
|
1166
1028
|
if (multiple && valueProp) {
|
|
1167
1029
|
setValueMulti(convertData(valueProp, valueExpr));
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1030
|
+
}
|
|
1031
|
+
// Close dropdown treeview by children when select item
|
|
1171
1032
|
if (children && (closeAfterSelect === true || closeAfterSelect === undefined && !multiple)) {
|
|
1172
1033
|
closeDropdown();
|
|
1173
1034
|
}
|
|
@@ -1179,26 +1040,21 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1179
1040
|
}, [valueProp, dataSource]);
|
|
1180
1041
|
useEffect(() => {
|
|
1181
1042
|
inputRef.current.readOnly = readOnly || inputProps.readOnly;
|
|
1182
|
-
|
|
1183
1043
|
if (!readOnly && !disabled) {
|
|
1184
1044
|
!!onLoadMore && dropdownListRef.current && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
|
|
1185
1045
|
}
|
|
1186
|
-
|
|
1187
1046
|
if (disabled || readOnly || children) {
|
|
1188
1047
|
inputRef.current.addEventListener('keydown', onPreventKeyDownHandler);
|
|
1189
1048
|
} else {
|
|
1190
1049
|
inputRef.current.addEventListener('keydown', onKeyDown);
|
|
1191
1050
|
}
|
|
1192
|
-
|
|
1193
1051
|
return () => {
|
|
1194
1052
|
if (!ref.current || !inputRef.current || !iconRef.current) return;
|
|
1195
|
-
|
|
1196
1053
|
if (disabled || readOnly || children) {
|
|
1197
1054
|
inputRef.current.removeEventListener('keydown', onPreventKeyDownHandler);
|
|
1198
1055
|
} else {
|
|
1199
1056
|
inputRef.current.removeEventListener('keydown', onKeyDown);
|
|
1200
1057
|
}
|
|
1201
|
-
|
|
1202
1058
|
closeDropdown();
|
|
1203
1059
|
};
|
|
1204
1060
|
}, [disabled, readOnly, displayExpr, multiple, allowSearch, viewType, closeAfterSelect, selectBox]);
|
|
@@ -1207,7 +1063,6 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1207
1063
|
inputRef.current.addEventListener('click', onClickInput);
|
|
1208
1064
|
inputRef.current.addEventListener('input', onChangeInput);
|
|
1209
1065
|
}
|
|
1210
|
-
|
|
1211
1066
|
return () => {
|
|
1212
1067
|
if (!disabled && !readOnly && inputRef.current) {
|
|
1213
1068
|
inputRef.current.removeEventListener('click', onClickInput);
|
|
@@ -1219,16 +1074,12 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1219
1074
|
if (!disabled && !readOnly) {
|
|
1220
1075
|
inputRef.current.addEventListener('click', onClickInput);
|
|
1221
1076
|
}
|
|
1222
|
-
|
|
1223
1077
|
if (dropdownListRef.current) {
|
|
1224
1078
|
var _dropdownListRef$curr5, _dropdownListRef$curr6, _currentObjectDefault6;
|
|
1225
|
-
|
|
1226
1079
|
if (!disabled && !readOnly) {
|
|
1227
1080
|
inputRef.current.addEventListener('input', onChangeInput);
|
|
1228
1081
|
}
|
|
1229
|
-
|
|
1230
1082
|
const length = (_dropdownListRef$curr5 = dropdownListRef.current) === null || _dropdownListRef$curr5 === void 0 ? void 0 : (_dropdownListRef$curr6 = _dropdownListRef$curr5.children) === null || _dropdownListRef$curr6 === void 0 ? void 0 : _dropdownListRef$curr6.length;
|
|
1231
|
-
|
|
1232
1083
|
if (length < dataSource.length + ((_currentObjectDefault6 = currentObjectDefault[unique]) === null || _currentObjectDefault6 === void 0 ? void 0 : _currentObjectDefault6.length) && !isSearch[unique]) {
|
|
1233
1084
|
loadMoreItemsDropdown(length);
|
|
1234
1085
|
!!onLoadMore && dataSource.length < total && dropdownListRef.current.addEventListener('scroll', onLoadMoreHandler);
|
|
@@ -1240,20 +1091,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1240
1091
|
inputRef.current.addEventListener('input', onChangeInput);
|
|
1241
1092
|
}
|
|
1242
1093
|
}
|
|
1243
|
-
|
|
1244
1094
|
return () => {
|
|
1245
1095
|
if (inputRef.current) {
|
|
1246
1096
|
inputRef.current.removeEventListener('input', onChangeInput);
|
|
1247
1097
|
inputRef.current.removeEventListener('click', onClickInput);
|
|
1248
1098
|
}
|
|
1249
|
-
|
|
1250
1099
|
!!dropdownListRef.current && dropdownListRef.current.removeEventListener('scroll', onLoadMoreHandler);
|
|
1251
1100
|
};
|
|
1252
1101
|
}, [dataSource]);
|
|
1253
1102
|
/* End handler */
|
|
1254
1103
|
|
|
1255
1104
|
/* Start component */
|
|
1256
|
-
|
|
1257
1105
|
const EmptyDataText = jsx("div", {
|
|
1258
1106
|
css: _DropdownItemCSS,
|
|
1259
1107
|
className: 'no-data'
|
|
@@ -1263,20 +1111,17 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1263
1111
|
disabled: disabled,
|
|
1264
1112
|
...labelProps
|
|
1265
1113
|
}, label) : null, [label, required, disabled, labelProps]);
|
|
1266
|
-
|
|
1267
1114
|
const getData = () => {
|
|
1268
1115
|
let dataFilter = JSON.parse(JSON.stringify(dataSource));
|
|
1269
|
-
|
|
1270
1116
|
if (Array.isArray(valueObjectDefault)) {
|
|
1271
1117
|
dataFilter = [...dataFilter, ...dataChoosen.current, ...valueObjectDefault];
|
|
1272
1118
|
} else if (typeof valueObjectDefault === 'object') {
|
|
1273
|
-
dataFilter = [...dataFilter, ...dataChoosen.current, {
|
|
1119
|
+
dataFilter = [...dataFilter, ...dataChoosen.current, {
|
|
1120
|
+
...valueObjectDefault
|
|
1274
1121
|
}];
|
|
1275
1122
|
}
|
|
1276
|
-
|
|
1277
1123
|
return dataFilter;
|
|
1278
1124
|
};
|
|
1279
|
-
|
|
1280
1125
|
const InputView = useMemo(() => {
|
|
1281
1126
|
return jsx("div", {
|
|
1282
1127
|
css: _DropdownFormCSS,
|
|
@@ -1285,7 +1130,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1285
1130
|
}, jsx("div", {
|
|
1286
1131
|
css: _InputCSS,
|
|
1287
1132
|
className: 'DGN-UI-Dropdown-Form-Input'
|
|
1288
|
-
}, multiple && valueMulti !== null && valueMulti !== void 0 && valueMulti.length ? jsx("div", {
|
|
1133
|
+
}, multiple && valueMulti !== null && valueMulti !== void 0 && valueMulti.length ? jsx("div", {
|
|
1134
|
+
...inputProps,
|
|
1289
1135
|
style: {
|
|
1290
1136
|
gap: spacing(0.5),
|
|
1291
1137
|
...inputStyle
|
|
@@ -1301,24 +1147,19 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1301
1147
|
let dataFilter = getData();
|
|
1302
1148
|
const data = dataFilter.find(v => v[valueExpr] === vl);
|
|
1303
1149
|
let text = '';
|
|
1304
|
-
|
|
1305
1150
|
if (data) {
|
|
1306
1151
|
var _mask;
|
|
1307
|
-
|
|
1308
1152
|
displayExpr = typeof renderSelectedItem === 'string' ? renderSelectedItem : displayExpr || valueExpr;
|
|
1309
|
-
let mask = data === null || data === void 0 ? void 0 : data[displayExpr];
|
|
1153
|
+
let mask = data === null || data === void 0 ? void 0 : data[displayExpr];
|
|
1310
1154
|
|
|
1155
|
+
// convert {id} - {name} to {<data[id]>} - {<data[name]>}
|
|
1311
1156
|
if (!mask && regexBetween.test(displayExpr)) {
|
|
1312
1157
|
var _displayExpr4;
|
|
1313
|
-
|
|
1314
1158
|
mask = (_displayExpr4 = displayExpr) === null || _displayExpr4 === void 0 ? void 0 : _displayExpr4.replace(regexBetween, _ => data[_]);
|
|
1315
1159
|
}
|
|
1316
|
-
|
|
1317
1160
|
text = (_mask = mask) === null || _mask === void 0 ? void 0 : _mask.replace(regexInclude, '');
|
|
1318
1161
|
}
|
|
1319
|
-
|
|
1320
1162
|
let item;
|
|
1321
|
-
|
|
1322
1163
|
if (typeof renderSelectedItem === 'function') {
|
|
1323
1164
|
item = renderSelectedItem({
|
|
1324
1165
|
data,
|
|
@@ -1335,9 +1176,9 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1335
1176
|
onRemove: e => onRemove(e, vl)
|
|
1336
1177
|
});
|
|
1337
1178
|
}
|
|
1338
|
-
|
|
1339
1179
|
return item;
|
|
1340
|
-
})) : typeof renderSelectedItem === 'function' || iconExpr && iconExpr !== 'none' ? jsx("div", {
|
|
1180
|
+
})) : typeof renderSelectedItem === 'function' || iconExpr && iconExpr !== 'none' ? jsx("div", {
|
|
1181
|
+
...inputProps,
|
|
1341
1182
|
style: inputStyle,
|
|
1342
1183
|
ref: inputRef,
|
|
1343
1184
|
css: _DropdownInputCSS,
|
|
@@ -1382,7 +1223,8 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1382
1223
|
}) : null));
|
|
1383
1224
|
}, [openState, showClear, textValue, valueMulti, clearAble, dataSource, disabled, displayExpr, inputProps, inputStyle, loading, multilineSelectedItem, multiple, onChange, placeholder, readOnly, renderSelectedItem, valueExpr, valueObjectDefault, viewType]);
|
|
1384
1225
|
const ErrorView = useMemo(() => {
|
|
1385
|
-
return error ? jsx(HelperText, {
|
|
1226
|
+
return error ? jsx(HelperText, {
|
|
1227
|
+
...helperTextProps,
|
|
1386
1228
|
disabled: disabled
|
|
1387
1229
|
}, error) : null;
|
|
1388
1230
|
}, [disabled, error, helperTextProps]);
|
|
@@ -1398,14 +1240,13 @@ const Dropdown = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1398
1240
|
className: classNames('DGN-UI-Dropdown', className, error && 'error', loading && 'dgn-dropdown-loading', disabled ? 'disabled' : readOnly && 'readOnly')
|
|
1399
1241
|
}, LabelView, InputView, ErrorView), DropdownView);
|
|
1400
1242
|
}));
|
|
1401
|
-
/* Start styled */
|
|
1402
1243
|
|
|
1244
|
+
/* Start styled */
|
|
1403
1245
|
const InputCSS = (multiple, renderSelectedItem) => css`
|
|
1404
1246
|
${displayFlex};
|
|
1405
1247
|
${positionRelative};
|
|
1406
1248
|
${parseWidth(!multiple && renderSelectedItem ? 'calc(100% - 34px)' : '100%')};
|
|
1407
1249
|
`;
|
|
1408
|
-
|
|
1409
1250
|
const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) => css`
|
|
1410
1251
|
${displayFlex};
|
|
1411
1252
|
${itemsCenter};
|
|
@@ -1458,14 +1299,12 @@ const DropdownInputCSS = (viewType, multiple, placeholder, disabled, readOnly) =
|
|
|
1458
1299
|
${disabled && `color: ${systemDisabled}`};
|
|
1459
1300
|
}
|
|
1460
1301
|
`;
|
|
1461
|
-
|
|
1462
1302
|
const IconCSS = viewType => css`
|
|
1463
1303
|
${displayFlex};
|
|
1464
1304
|
${itemsCenter};
|
|
1465
1305
|
${mgl([2])};
|
|
1466
1306
|
${mgr([viewType !== 'outlined' ? 0 : 4])};
|
|
1467
1307
|
`;
|
|
1468
|
-
|
|
1469
1308
|
const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInputCSSName) => viewType !== 'outlined' ? css`
|
|
1470
1309
|
${displayFlex};
|
|
1471
1310
|
${flexRow};
|
|
@@ -1577,7 +1416,6 @@ const DropdownFormCSS = (viewType, multiple, disabled, placeholder, DropdownInpu
|
|
|
1577
1416
|
content: '';
|
|
1578
1417
|
}
|
|
1579
1418
|
`;
|
|
1580
|
-
|
|
1581
1419
|
const DropdownListCSS = loading => css`
|
|
1582
1420
|
${displayBlock};
|
|
1583
1421
|
${positionRelative};
|
|
@@ -1605,7 +1443,6 @@ const DropdownListCSS = loading => css`
|
|
|
1605
1443
|
${pd([0.25])};
|
|
1606
1444
|
}
|
|
1607
1445
|
`;
|
|
1608
|
-
|
|
1609
1446
|
const DropdownItemCSS = (multiple, selectBox) => css`
|
|
1610
1447
|
${displayFlex};
|
|
1611
1448
|
${flexRow};
|
|
@@ -1632,7 +1469,6 @@ const DropdownItemCSS = (multiple, selectBox) => css`
|
|
|
1632
1469
|
color: ${systemActive};
|
|
1633
1470
|
}
|
|
1634
1471
|
`;
|
|
1635
|
-
|
|
1636
1472
|
const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
|
|
1637
1473
|
${displayBlock};
|
|
1638
1474
|
${positionRelative};
|
|
@@ -1666,7 +1502,6 @@ const DropdownRootCSS = (DropdownFormCSSName, DropdownInputCSSName) => css`
|
|
|
1666
1502
|
}
|
|
1667
1503
|
}
|
|
1668
1504
|
`;
|
|
1669
|
-
|
|
1670
1505
|
const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
|
|
1671
1506
|
${positionFixed};
|
|
1672
1507
|
${parseWidth(width)};
|
|
@@ -1681,7 +1516,6 @@ const DropdownCSS = (top, left, width, isMobile, allowSearch) => css`
|
|
|
1681
1516
|
top: auto;
|
|
1682
1517
|
`}
|
|
1683
1518
|
`;
|
|
1684
|
-
|
|
1685
1519
|
const LoadingProgressCSS = css`
|
|
1686
1520
|
${displayFlex};
|
|
1687
1521
|
${flexRow};
|
|
@@ -1733,51 +1567,39 @@ Dropdown.defaultProps = {
|
|
|
1733
1567
|
Dropdown.propTypes = {
|
|
1734
1568
|
/** If `true`, display input box search. */
|
|
1735
1569
|
allowSearch: PropTypes.bool,
|
|
1736
|
-
|
|
1737
1570
|
/** The contents in Dropdown box (Exp: TreeView). */
|
|
1738
1571
|
children: PropTypes.node,
|
|
1739
|
-
|
|
1740
1572
|
/** Class for component. */
|
|
1741
1573
|
className: PropTypes.string,
|
|
1742
|
-
|
|
1743
1574
|
/** If `true`, display clear icon.*/
|
|
1744
1575
|
clearAble: PropTypes.bool,
|
|
1745
|
-
|
|
1746
1576
|
/** If `true`, dropdown will close after select an item. */
|
|
1747
1577
|
closeAfterSelect: PropTypes.bool,
|
|
1748
|
-
|
|
1749
1578
|
/** The array of elements that appear in the dropdown list. */
|
|
1750
1579
|
dataSource: PropTypes.array,
|
|
1751
|
-
|
|
1752
1580
|
/** Default value displayed when first render. */
|
|
1753
1581
|
defaultValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1754
|
-
|
|
1755
1582
|
/** If `true`, the component is disabled. */
|
|
1756
1583
|
disabled: PropTypes.bool,
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
*
|
|
1760
|
-
* Note: don't use 'id - name', return undefined
|
|
1584
|
+
/** Field name used for text display in dropdown list.<br/>
|
|
1585
|
+
* Example: 'name', '{id} - {name}', '{age} age(s)'<br/>
|
|
1586
|
+
* Note: don't use 'id - name', return undefined
|
|
1761
1587
|
*/
|
|
1762
1588
|
displayExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1763
|
-
|
|
1764
1589
|
/** Style inline of dropdown items. */
|
|
1765
1590
|
dropdownItemStyle: PropTypes.object,
|
|
1766
|
-
|
|
1767
1591
|
/** Error displayed below input. */
|
|
1768
1592
|
error: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
1769
|
-
|
|
1770
1593
|
/** Props applied to the [HelperText](https://core.diginet.com.vn/ui/?path=/story/form-control-text-helpertext) element. */
|
|
1771
1594
|
helperTextProps: PropTypes.object,
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
*
|
|
1775
|
-
*
|
|
1776
|
-
*
|
|
1777
|
-
*
|
|
1778
|
-
*
|
|
1779
|
-
*  
|
|
1780
|
-
* }
|
|
1595
|
+
/** Field name used for icon display.<br/>
|
|
1596
|
+
* Example:<br/>
|
|
1597
|
+
* string: 'icon'<br/>
|
|
1598
|
+
* object: {<br/>
|
|
1599
|
+
* key: 'icon',<br/>
|
|
1600
|
+
* prefix: 'https://imglink.com',<br/>
|
|
1601
|
+
* suffix: '.jpg'<br/>
|
|
1602
|
+
* }
|
|
1781
1603
|
*/
|
|
1782
1604
|
iconExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
1783
1605
|
key: PropTypes.string,
|
|
@@ -1785,133 +1607,98 @@ Dropdown.propTypes = {
|
|
|
1785
1607
|
suffix: PropTypes.string,
|
|
1786
1608
|
style: PropTypes.object
|
|
1787
1609
|
})]),
|
|
1788
|
-
|
|
1789
1610
|
/** Attributes applied to the input element. */
|
|
1790
1611
|
inputProps: PropTypes.object,
|
|
1791
|
-
|
|
1792
1612
|
/** Style inline of input element. */
|
|
1793
1613
|
inputStyle: PropTypes.object,
|
|
1794
|
-
|
|
1795
1614
|
/** The mode of item when rendering. */
|
|
1796
1615
|
itemMode: PropTypes.oneOf(['normal', 'table', 'treeview']),
|
|
1797
|
-
|
|
1798
1616
|
/** The label of the input. */
|
|
1799
1617
|
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
1800
|
-
|
|
1801
1618
|
/** [Props](https://core.diginet.com.vn/ui/?path=/docs/form-control-text-label--simple) of label. */
|
|
1802
1619
|
labelProps: PropTypes.object,
|
|
1803
|
-
|
|
1804
1620
|
/** Number of items that are rendered each time. */
|
|
1805
1621
|
limit: PropTypes.number,
|
|
1806
|
-
|
|
1807
1622
|
/** If `true`, the loading indicator is shown. */
|
|
1808
1623
|
loading: PropTypes.bool,
|
|
1809
|
-
|
|
1810
1624
|
/** Set restrictions regarding the maximum number of options that can be selected. (Use with prop `multiple`) */
|
|
1811
1625
|
maximumSelectionLength: PropTypes.number,
|
|
1812
|
-
|
|
1813
1626
|
/** If `true`, show multi-line selected item(s). */
|
|
1814
1627
|
multilineSelectedItem: PropTypes.bool,
|
|
1815
|
-
|
|
1816
1628
|
/** If `true`, value must be an array and the dropdown will support multiple selections. */
|
|
1817
1629
|
multiple: PropTypes.bool,
|
|
1818
|
-
|
|
1819
1630
|
/** Specifies a text string shown when there is no data. */
|
|
1820
1631
|
noDataText: PropTypes.string,
|
|
1821
|
-
|
|
1822
1632
|
/** Callback fired when the value changes. */
|
|
1823
1633
|
onChange: PropTypes.func,
|
|
1824
|
-
|
|
1825
1634
|
/** Callback fired when dropdown closed. */
|
|
1826
1635
|
onClosed: PropTypes.func,
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
* if undefined: the filter function will run (default)
|
|
1636
|
+
/** Callback fired when the input value changes.<br/>
|
|
1637
|
+
* if undefined: the filter function will run (default)
|
|
1830
1638
|
*/
|
|
1831
1639
|
onInput: PropTypes.func,
|
|
1832
|
-
|
|
1833
1640
|
/** Callback fired when key down input */
|
|
1834
1641
|
onKeyDown: PropTypes.func,
|
|
1835
|
-
|
|
1836
1642
|
/** Callback fired when scroll near the end. */
|
|
1837
1643
|
onLoadMore: PropTypes.func,
|
|
1838
|
-
|
|
1839
1644
|
/** The short hint displayed in the input before the user select a value. */
|
|
1840
1645
|
placeholder: PropTypes.string,
|
|
1841
|
-
|
|
1842
1646
|
/** If `true`, the component is read-only. */
|
|
1843
1647
|
readOnly: PropTypes.bool,
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
*
|
|
1847
|
-
* --> such as: displayExpr={'name - role'}
|
|
1648
|
+
/** Function displays items by custom.<br/>
|
|
1649
|
+
* renderItem={(data, index) => data.name + ' - ' + data.role}<br/>
|
|
1650
|
+
* --> such as: displayExpr={'name - role'}
|
|
1848
1651
|
*/
|
|
1849
1652
|
renderItem: PropTypes.func,
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1653
|
+
/** Function or field name used for display selected items, example:<br/>
|
|
1654
|
+
* renderSelectedItem={(data, index) => index + ' - ' + data.name}<br/>
|
|
1853
1655
|
*/
|
|
1854
1656
|
renderSelectedItem: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
1855
|
-
|
|
1856
1657
|
/** If `true`, the label will indicate that the input is required. */
|
|
1857
1658
|
required: PropTypes.bool,
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
*
|
|
1861
|
-
*
|
|
1862
|
-
* If `true`, used default delayOnInput.
|
|
1659
|
+
/**
|
|
1660
|
+
* Duration wait enter search content on search.<br/>
|
|
1661
|
+
* Example: 700 -> 700ms, '700ms' -> 700ms, '0.7s' -> 700ms, '1m' -> 60000ms
|
|
1662
|
+
* If `true`, used default delayOnInput.
|
|
1863
1663
|
*/
|
|
1864
1664
|
searchDelayTime: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
|
|
1865
|
-
|
|
1866
1665
|
/** Specifies a data object's field name or an expression whose value is compared to the search string. */
|
|
1867
1666
|
searchExpr: PropTypes.oneOfType([PropTypes.array, PropTypes.string]),
|
|
1868
|
-
|
|
1869
1667
|
/** Specifies a comparison operation used to search items. */
|
|
1870
1668
|
searchMode: PropTypes.oneOf(['contains', 'startswith', 'equals']),
|
|
1871
|
-
|
|
1872
1669
|
/** If `true`, show checkbox in each dropdown item. */
|
|
1873
1670
|
selectBox: PropTypes.bool,
|
|
1874
|
-
|
|
1875
1671
|
/** Style inline of component. */
|
|
1876
1672
|
style: PropTypes.object,
|
|
1877
|
-
|
|
1878
1673
|
/** Display sub content. */
|
|
1879
1674
|
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
|
|
1880
|
-
|
|
1881
1675
|
/** The total number of items in the dropdown list. */
|
|
1882
1676
|
total: PropTypes.number,
|
|
1883
|
-
|
|
1884
1677
|
/** Used to identify the parent key (only used for `itemMode` is 'treeview'). */
|
|
1885
1678
|
treeViewID: PropTypes.string,
|
|
1886
|
-
|
|
1887
1679
|
/** Used for mapping into a nested list (only used for `itemMode` is 'treeview'). */
|
|
1888
1680
|
treeViewParentID: PropTypes.string,
|
|
1889
|
-
|
|
1890
1681
|
/** The displayed value of component. */
|
|
1891
1682
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
|
|
1892
|
-
|
|
1893
1683
|
/** The field name used for the returned result. */
|
|
1894
1684
|
valueExpr: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
1895
|
-
|
|
1896
1685
|
/** An object default for value (use for load more). */
|
|
1897
1686
|
valueObjectDefault: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
1898
|
-
|
|
1899
1687
|
/**The variant to use. */
|
|
1900
1688
|
viewType: PropTypes.oneOf(['underlined', 'outlined', 'none']),
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1908
|
-
*
|
|
1909
|
-
* *
|
|
1910
|
-
* *
|
|
1911
|
-
* *
|
|
1912
|
-
* *
|
|
1913
|
-
*
|
|
1914
|
-
* * @param {value} - string || number || array
|
|
1689
|
+
/**
|
|
1690
|
+
* ref methods
|
|
1691
|
+
*
|
|
1692
|
+
* how to get component element? ref.current
|
|
1693
|
+
*
|
|
1694
|
+
* how to call method? ref.current.instance.{method}
|
|
1695
|
+
*
|
|
1696
|
+
* * showDropdown(): Show dropdown
|
|
1697
|
+
* * closeDropdown(): Close dropdown
|
|
1698
|
+
* * onClear(): Clear selected value
|
|
1699
|
+
* * setPreviousValue(): Set value to previous value
|
|
1700
|
+
* * setValue(value): Set value of dropdown
|
|
1701
|
+
* * @param {value} - string || number || array
|
|
1915
1702
|
*/
|
|
1916
1703
|
reference: ref
|
|
1917
1704
|
};
|