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
package/utils/randomString.js
CHANGED
|
@@ -6,28 +6,21 @@ export default function getRandomString(length = 10, options = {}) {
|
|
|
6
6
|
allowSymbol = true
|
|
7
7
|
} = options;
|
|
8
8
|
let string = '';
|
|
9
|
-
|
|
10
9
|
if (allowNumber) {
|
|
11
10
|
string += '0123456789';
|
|
12
11
|
}
|
|
13
|
-
|
|
14
12
|
if (allowLowercase) {
|
|
15
13
|
string += 'abcdefghijklmnopqrstuvwxyz';
|
|
16
14
|
}
|
|
17
|
-
|
|
18
15
|
if (allowUppercase) {
|
|
19
16
|
string += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
20
17
|
}
|
|
21
|
-
|
|
22
18
|
if (allowSymbol) {
|
|
23
19
|
string += '@$%^&*_+-';
|
|
24
20
|
}
|
|
25
|
-
|
|
26
21
|
let newString = '';
|
|
27
|
-
|
|
28
22
|
for (let i = 0; i < length; i++) {
|
|
29
23
|
newString += string[Math.floor(Math.random() * string.length)];
|
|
30
24
|
}
|
|
31
|
-
|
|
32
25
|
return newString;
|
|
33
26
|
}
|
package/utils/remove-unicode.js
CHANGED
|
@@ -2,5 +2,4 @@ const removeUnicode = (str, spaceTo = ' ') => {
|
|
|
2
2
|
if (!str || typeof str !== 'string') return str;
|
|
3
3
|
return str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/gi, "a").replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/gi, "e").replace(/ì|í|ị|ỉ|ĩ/gi, "i").replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/gi, "o").replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/gi, "u").replace(/ỳ|ý|ỵ|ỷ|ỹ/gi, "y").replace(/đ/gi, "d").replaceAll(' ', spaceTo);
|
|
4
4
|
};
|
|
5
|
-
|
|
6
5
|
export default removeUnicode;
|
package/utils/render-portal.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Children } from 'react';
|
|
|
2
2
|
import { render, createPortal } from 'react-dom';
|
|
3
3
|
import { useTheme } from "../theme";
|
|
4
4
|
const idPortal = 'DGN-UI-Portal',
|
|
5
|
-
|
|
5
|
+
classNameCommon = 'DGN-UI-Portal';
|
|
6
6
|
const {
|
|
7
7
|
zIndex
|
|
8
8
|
} = useTheme();
|
|
@@ -16,13 +16,11 @@ export const getPortal = () => {
|
|
|
16
16
|
};
|
|
17
17
|
export const isLastChildNode = node => {
|
|
18
18
|
if (!node) return false;
|
|
19
|
-
|
|
20
19
|
if (typeof node === 'string') {
|
|
21
20
|
node = document.querySelector(node);
|
|
22
21
|
} else {
|
|
23
22
|
node = node.current || node.target || node;
|
|
24
23
|
}
|
|
25
|
-
|
|
26
24
|
const portal = getPortal();
|
|
27
25
|
const length = portal.childNodes.length;
|
|
28
26
|
return length && portal.lastChild.contains(node);
|
|
@@ -34,16 +32,13 @@ export const renderPortal = (node, containers, isCreate = false, options = {}) =
|
|
|
34
32
|
} = options;
|
|
35
33
|
let container = getPortal();
|
|
36
34
|
Object.assign(container, style);
|
|
37
|
-
|
|
38
35
|
if (className) {
|
|
39
36
|
container.classList.add(className);
|
|
40
37
|
}
|
|
41
|
-
|
|
42
38
|
if (containers) {
|
|
43
39
|
containers.classList.add(classNameCommon);
|
|
44
40
|
containers.style.pointerEvents = 'auto';
|
|
45
41
|
container = container.appendChild(containers);
|
|
46
|
-
|
|
47
42
|
if (isCreate) {
|
|
48
43
|
return /*#__PURE__*/createPortal(node, container);
|
|
49
44
|
} else {
|
|
@@ -67,7 +62,6 @@ export const renderPortal = (node, containers, isCreate = false, options = {}) =
|
|
|
67
62
|
parent.classList.add(classNameCommon);
|
|
68
63
|
parent.style.pointerEvents = 'auto';
|
|
69
64
|
container = container.appendChild(parent);
|
|
70
|
-
|
|
71
65
|
if (isCreate) {
|
|
72
66
|
return /*#__PURE__*/createPortal(children, container);
|
|
73
67
|
} else {
|
|
@@ -82,12 +76,10 @@ export const removePortal = node => {
|
|
|
82
76
|
removePortalCommon();
|
|
83
77
|
return true;
|
|
84
78
|
}
|
|
85
|
-
|
|
86
79
|
return false;
|
|
87
80
|
};
|
|
88
81
|
export const removePortalCommon = () => {
|
|
89
82
|
const portals = getPortal();
|
|
90
|
-
|
|
91
83
|
if (!portals.childNodes.length) {
|
|
92
84
|
portals.remove();
|
|
93
85
|
}
|
package/utils/renderHTML.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { jsx } from '@emotion/core';
|
|
5
4
|
import parseTextToHTML from "./parseHTML";
|
|
6
|
-
|
|
7
5
|
const renderHTML = (text = null, TagName = 'div', options = {}) => {
|
|
8
6
|
if (text && (text.$$typeof && String(text.$$typeof) === 'Symbol(react.element)' || Array.isArray(text) && text.some(node => node && String(node.$$typeof) === 'Symbol(react.element)'))) {
|
|
9
|
-
return jsx(TagName, {
|
|
7
|
+
return jsx(TagName, {
|
|
8
|
+
...options
|
|
10
9
|
}, text);
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return jsx(TagName, {
|
|
12
|
+
...options,
|
|
14
13
|
dangerouslySetInnerHTML: {
|
|
15
14
|
__html: parseTextToHTML(String(text))
|
|
16
15
|
}
|
|
17
16
|
});
|
|
18
17
|
};
|
|
19
|
-
|
|
20
18
|
export default renderHTML;
|
package/utils/renderIcon.js
CHANGED
|
@@ -1,63 +1,53 @@
|
|
|
1
1
|
/** @jsxRuntime classic */
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import { jsx } from '@emotion/core';
|
|
5
4
|
import { ButtonIcon } from "../components";
|
|
6
5
|
import * as Icons from "../icons";
|
|
7
6
|
import { parseTextToHTML, capitalize } from "./";
|
|
8
|
-
/**
|
|
9
|
-
* render icon form source (dynamic type)
|
|
10
|
-
* @param {String|jsx} source data of icon, maybe svg text | image link | name of icon in icons store or a jsx element
|
|
11
|
-
* @param {String} type text to parse text to HTML, img link to use img tag, name to use icon form icons store
|
|
12
|
-
* @param {Object} options properties of Icon component if us type is name {width, height, color, viewBox, ...}
|
|
7
|
+
/**
|
|
8
|
+
* render icon form source (dynamic type)
|
|
9
|
+
* @param {String|jsx} source data of icon, maybe svg text | image link | name of icon in icons store or a jsx element
|
|
10
|
+
* @param {String} type text to parse text to HTML, img link to use img tag, name to use icon form icons store
|
|
11
|
+
* @param {Object} options properties of Icon component if us type is name {width, height, color, viewBox, ...}
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
const renderIcon = (source, type, options = {}) => {
|
|
16
14
|
if (typeof source === 'string') {
|
|
17
15
|
switch (type) {
|
|
18
16
|
case 'name':
|
|
19
17
|
{
|
|
20
18
|
let IconComp = Icons[capitalize(source)];
|
|
21
|
-
|
|
22
19
|
if (IconComp) {
|
|
23
|
-
return jsx(IconComp, {
|
|
20
|
+
return jsx(IconComp, {
|
|
21
|
+
...options
|
|
24
22
|
});
|
|
25
23
|
}
|
|
26
|
-
|
|
27
24
|
return null;
|
|
28
25
|
}
|
|
29
|
-
|
|
30
26
|
case 'effect':
|
|
31
27
|
return jsx(ButtonIcon, {
|
|
32
28
|
viewType: 'ghost',
|
|
33
29
|
name: source,
|
|
34
30
|
...options
|
|
35
31
|
});
|
|
36
|
-
|
|
37
32
|
case 'link':
|
|
38
33
|
case 'imgLink':
|
|
39
34
|
return jsx("img", {
|
|
40
35
|
src: source,
|
|
41
36
|
...options
|
|
42
37
|
});
|
|
43
|
-
|
|
44
38
|
default:
|
|
45
39
|
if (source.length < 20) {
|
|
46
40
|
const IconComp = Icons[capitalize(source)];
|
|
47
|
-
|
|
48
41
|
if (IconComp) {
|
|
49
|
-
return jsx(IconComp, {
|
|
42
|
+
return jsx(IconComp, {
|
|
43
|
+
...options
|
|
50
44
|
});
|
|
51
45
|
}
|
|
52
|
-
|
|
53
46
|
return null;
|
|
54
47
|
}
|
|
55
|
-
|
|
56
48
|
return parseTextToHTML(source, options.output || options);
|
|
57
49
|
}
|
|
58
50
|
}
|
|
59
|
-
|
|
60
51
|
return source;
|
|
61
52
|
};
|
|
62
|
-
|
|
63
53
|
export default renderIcon;
|
package/utils/sb-template.js
CHANGED
|
@@ -40,7 +40,8 @@ export const Template = ({
|
|
|
40
40
|
${alignMap.get(align)};
|
|
41
41
|
`
|
|
42
42
|
}, [{}, ...propsCustom].map((itemProps, indexProps) => {
|
|
43
|
-
const argsTemp = {
|
|
43
|
+
const argsTemp = {
|
|
44
|
+
...args,
|
|
44
45
|
...itemProps
|
|
45
46
|
};
|
|
46
47
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -48,11 +49,11 @@ export const Template = ({
|
|
|
48
49
|
disabled: disabledTooltip,
|
|
49
50
|
key: indexProps,
|
|
50
51
|
title: JSON.stringify(argsTemp)
|
|
51
|
-
}, /*#__PURE__*/React.createElement(Component, {
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Component, {
|
|
53
|
+
...argsTemp
|
|
52
54
|
}));
|
|
53
55
|
})))));
|
|
54
56
|
};
|
|
55
|
-
|
|
56
57
|
const StoryBookTemplate = ({
|
|
57
58
|
args,
|
|
58
59
|
component,
|
|
@@ -79,7 +80,8 @@ const StoryBookTemplate = ({
|
|
|
79
80
|
key: idx,
|
|
80
81
|
horizontal: horizontal,
|
|
81
82
|
title: title,
|
|
82
|
-
args: {
|
|
83
|
+
args: {
|
|
84
|
+
...args,
|
|
83
85
|
...argsExtra
|
|
84
86
|
},
|
|
85
87
|
component: component,
|
|
@@ -89,7 +91,6 @@ const StoryBookTemplate = ({
|
|
|
89
91
|
});
|
|
90
92
|
})));
|
|
91
93
|
};
|
|
92
|
-
|
|
93
94
|
Template.defaultProps = {
|
|
94
95
|
propsCustom: [],
|
|
95
96
|
disabledTooltip: false,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import capitalize from "./capitalize";
|
|
2
2
|
export default function capitalizeSentenceCase(string, separator = ' ') {
|
|
3
3
|
const sentence = string.toLowerCase().split(`${separator}`);
|
|
4
|
-
|
|
5
4
|
for (let i in sentence) {
|
|
6
5
|
sentence[i] = capitalize(sentence[i]);
|
|
7
6
|
}
|
|
8
|
-
|
|
9
7
|
return sentence.join(`${separator}`);
|
|
10
8
|
}
|
package/utils/string/string.js
CHANGED
|
@@ -3,46 +3,36 @@ export const encodeHtml = str => {
|
|
|
3
3
|
const encodeRegExp = [new RegExp('&', 'g'), new RegExp('"', 'g'), new RegExp("'", 'g'), new RegExp('<', 'g'), new RegExp('>', 'g')];
|
|
4
4
|
return String(str).replace(encodeRegExp[0], '&').replace(encodeRegExp[1], '"').replace(encodeRegExp[2], ''').replace(encodeRegExp[3], '<').replace(encodeRegExp[4], '>');
|
|
5
5
|
};
|
|
6
|
-
|
|
7
6
|
const splitQuad = raw => {
|
|
8
7
|
switch (typeof raw) {
|
|
9
8
|
case 'string':
|
|
10
9
|
return raw.split(/\s+/, 4);
|
|
11
|
-
|
|
12
10
|
case 'object':
|
|
13
11
|
return [raw.x || raw.h || raw.left, raw.y || raw.v || raw.top, raw.x || raw.h || raw.right, raw.y || raw.v || raw.bottom];
|
|
14
|
-
|
|
15
12
|
case 'number':
|
|
16
13
|
return [raw];
|
|
17
|
-
|
|
18
14
|
default:
|
|
19
15
|
return raw;
|
|
20
16
|
}
|
|
21
17
|
};
|
|
22
|
-
|
|
23
18
|
export const quadToObject = raw => {
|
|
24
19
|
const quad = splitQuad(raw);
|
|
25
20
|
let left = parseInt(quad && quad[0], 10);
|
|
26
21
|
let top = parseInt(quad && quad[1], 10);
|
|
27
22
|
let right = parseInt(quad && quad[2], 10);
|
|
28
23
|
let bottom = parseInt(quad && quad[3], 10);
|
|
29
|
-
|
|
30
24
|
if (!isFinite(left)) {
|
|
31
25
|
left = 0;
|
|
32
26
|
}
|
|
33
|
-
|
|
34
27
|
if (!isFinite(top)) {
|
|
35
28
|
top = left;
|
|
36
29
|
}
|
|
37
|
-
|
|
38
30
|
if (!isFinite(right)) {
|
|
39
31
|
right = left;
|
|
40
32
|
}
|
|
41
|
-
|
|
42
33
|
if (!isFinite(bottom)) {
|
|
43
34
|
bottom = top;
|
|
44
35
|
}
|
|
45
|
-
|
|
46
36
|
return {
|
|
47
37
|
top: top,
|
|
48
38
|
right: right,
|
|
@@ -54,12 +44,10 @@ export const format = (template, ...values) => {
|
|
|
54
44
|
if (isFunction(template)) {
|
|
55
45
|
return template(...values);
|
|
56
46
|
}
|
|
57
|
-
|
|
58
47
|
values.forEach((value, index) => {
|
|
59
48
|
if (isString(value)) {
|
|
60
49
|
value = value.replace(/\$/g, '$$$$');
|
|
61
50
|
}
|
|
62
|
-
|
|
63
51
|
const placeholderReg = new RegExp('\\{' + index + '\\}', 'gm');
|
|
64
52
|
template = template.replace(placeholderReg, value);
|
|
65
53
|
});
|
|
@@ -68,6 +56,5 @@ export const format = (template, ...values) => {
|
|
|
68
56
|
export const replaceAll = (() => {
|
|
69
57
|
const quote = str => (str + '').replace(/([+*?.[^\]$(){}><|=!:])/g, '\\$1'); // lgtm[js/incomplete-sanitization]
|
|
70
58
|
|
|
71
|
-
|
|
72
59
|
return (text, searchToken, replacementToken) => text.replace(new RegExp('(' + quote(searchToken) + ')', 'gi'), replacementToken);
|
|
73
60
|
})();
|
package/utils/type.js
CHANGED
|
@@ -5,86 +5,65 @@ const types = {
|
|
|
5
5
|
'[object String]': 'string',
|
|
6
6
|
'[object Null]': 'null'
|
|
7
7
|
};
|
|
8
|
-
|
|
9
8
|
const type = object => {
|
|
10
9
|
const typeOfObject = Object.prototype.toString.call(object);
|
|
11
10
|
return typeof object === 'object' ? types[typeOfObject] || 'object' : typeof object;
|
|
12
11
|
};
|
|
13
|
-
|
|
14
12
|
const isBoolean = object => {
|
|
15
13
|
return typeof object === 'boolean';
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
const isExponential = value => {
|
|
19
16
|
return isNumeric(value) && value.toString().indexOf('e') !== -1;
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
const isDate = object => {
|
|
23
19
|
return type(object) === 'date';
|
|
24
20
|
};
|
|
25
|
-
|
|
26
21
|
const isDefined = object => {
|
|
27
22
|
return object !== null && object !== undefined;
|
|
28
23
|
};
|
|
29
|
-
|
|
30
24
|
const isFunction = object => {
|
|
31
25
|
return typeof object === 'function';
|
|
32
26
|
};
|
|
33
|
-
|
|
34
27
|
const isString = object => {
|
|
35
28
|
return typeof object === 'string';
|
|
36
29
|
};
|
|
37
|
-
|
|
38
30
|
const isNumeric = object => {
|
|
39
31
|
return typeof object === 'number' && isFinite(object) || !isNaN(object - parseFloat(object));
|
|
40
32
|
};
|
|
41
|
-
|
|
42
33
|
const isObject = object => {
|
|
43
34
|
return type(object) === 'object';
|
|
44
35
|
};
|
|
45
|
-
|
|
46
36
|
const isEmptyObject = object => {
|
|
47
37
|
let property;
|
|
48
|
-
|
|
49
38
|
for (property in object) {
|
|
50
39
|
return false;
|
|
51
40
|
}
|
|
52
|
-
|
|
53
41
|
return true;
|
|
54
42
|
};
|
|
55
|
-
|
|
56
43
|
const isPlainObject = object => {
|
|
57
44
|
if (!object || Object.prototype.toString.call(object) !== '[object Object]') {
|
|
58
45
|
return false;
|
|
59
46
|
}
|
|
60
|
-
|
|
61
47
|
const proto = Object.getPrototypeOf(object);
|
|
62
48
|
const ctor = Object.hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
63
49
|
return typeof ctor === 'function' && Object.toString.call(ctor) === Object.toString.call(Object);
|
|
64
50
|
};
|
|
65
|
-
|
|
66
51
|
const isPrimitive = value => {
|
|
67
52
|
return ['object', 'array', 'function'].indexOf(type(value)) === -1;
|
|
68
53
|
};
|
|
69
|
-
|
|
70
54
|
const isWindow = object => {
|
|
71
55
|
return object != null && object === object.window;
|
|
72
56
|
};
|
|
73
|
-
|
|
74
57
|
const isRenderer = object => {
|
|
75
58
|
return !!(object.jquery || object.dxRenderer);
|
|
76
59
|
};
|
|
77
|
-
|
|
78
60
|
const isPromise = object => {
|
|
79
61
|
return object && isFunction(object.then);
|
|
80
62
|
};
|
|
81
|
-
|
|
82
63
|
const isDeferred = object => {
|
|
83
64
|
return object && isFunction(object.done) && isFunction(object.fail);
|
|
84
65
|
};
|
|
85
|
-
|
|
86
66
|
const isEvent = object => {
|
|
87
67
|
return !!(object && object.preventDefault);
|
|
88
68
|
};
|
|
89
|
-
|
|
90
69
|
export { isBoolean, isExponential, isDate, isDefined, isFunction, isString, isNumeric, isObject, isEmptyObject, isPlainObject, isPrimitive, isWindow, isRenderer, isPromise, isDeferred, type, isEvent };
|
package/utils/updatePosition.js
CHANGED
|
@@ -11,8 +11,8 @@ const updatePosition = (anchorEl, transformEl, cb) => {
|
|
|
11
11
|
} = window;
|
|
12
12
|
const {
|
|
13
13
|
height: nodeHeight
|
|
14
|
-
} = transformEl.getBoundingClientRect();
|
|
15
|
-
|
|
14
|
+
} = transformEl.getBoundingClientRect();
|
|
15
|
+
// Vertical
|
|
16
16
|
if (bottom < 0 || top > innerHeight) {
|
|
17
17
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
18
18
|
} else if (bottom + 4 + nodeHeight > innerHeight) {
|
|
@@ -23,14 +23,13 @@ const updatePosition = (anchorEl, transformEl, cb) => {
|
|
|
23
23
|
}
|
|
24
24
|
} else {
|
|
25
25
|
transformEl.style.top = bottom + 4 + 'px';
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
}
|
|
28
27
|
|
|
28
|
+
// Horizontal
|
|
29
29
|
if (left < 0 || right > innerWidth) {
|
|
30
30
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
31
31
|
} else {
|
|
32
32
|
transformEl.style.left = left + 'px';
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
36
35
|
export default updatePosition;
|
package/utils/useDelayUnmount.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
|
|
3
2
|
const useDelayUnmount = (isMounted, delayTime) => {
|
|
4
3
|
const [show, setShow] = useState(false);
|
|
5
4
|
useEffect(() => {
|
|
6
5
|
let timeoutId;
|
|
7
|
-
|
|
8
6
|
if (isMounted && !show) {
|
|
9
7
|
setShow(true);
|
|
10
8
|
} else if (!isMounted && show) {
|
|
11
9
|
timeoutId = setTimeout(() => setShow(false), delayTime);
|
|
12
10
|
}
|
|
13
|
-
|
|
14
11
|
return () => clearTimeout(timeoutId);
|
|
15
12
|
}, [isMounted, delayTime, show]);
|
|
16
13
|
return show;
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
export default useDelayUnmount;
|
package/utils/useElementSize.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { useCallback, useLayoutEffect, useState } from 'react';
|
|
2
|
-
import { useEventListener } from "./useEventListener";
|
|
2
|
+
import { useEventListener } from "./useEventListener";
|
|
3
|
+
|
|
4
|
+
// Usage:
|
|
3
5
|
// export const Component = () => {
|
|
4
6
|
// const [isVisible, setVisible] = useState(true);
|
|
5
7
|
// const [squareRef, { width, height }] = useElementSize();
|
|
8
|
+
|
|
6
9
|
// const toggleVisibility = () => setVisible(x => !x);
|
|
10
|
+
|
|
7
11
|
// return (
|
|
8
12
|
// <>
|
|
9
13
|
// <p>{`The square width is ${width}px and height ${height}px`}</p>
|
|
10
14
|
// <p>Try, resize your window and-or click on the button.</p>
|
|
15
|
+
|
|
11
16
|
// <button onClick={toggleVisibility}>{isVisible ? 'Hide' : 'Show'} square</button>
|
|
17
|
+
|
|
12
18
|
// {isVisible && (
|
|
13
19
|
// <div
|
|
14
20
|
// ref={squareRef}
|
|
@@ -32,8 +38,8 @@ export const useElementSize = () => {
|
|
|
32
38
|
const [size, setSize] = useState({
|
|
33
39
|
width: 0,
|
|
34
40
|
height: 0
|
|
35
|
-
});
|
|
36
|
-
|
|
41
|
+
});
|
|
42
|
+
// Prevent too many rendering using useCallback
|
|
37
43
|
const handleSize = useCallback(() => {
|
|
38
44
|
setSize({
|
|
39
45
|
width: (ref === null || ref === void 0 ? void 0 : ref.offsetWidth) || 0,
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
1
|
+
import { useEffect, useLayoutEffect, useRef } from 'react';
|
|
2
|
+
|
|
3
|
+
// Usage:
|
|
2
4
|
// export const Component = () => {
|
|
3
5
|
// // Define button ref
|
|
4
6
|
// const buttonRef = useRef < HTMLButtonElement > null;
|
|
7
|
+
|
|
5
8
|
// const onScroll = (event: Event) => {
|
|
6
9
|
// console.log("window scrolled!", event);
|
|
7
10
|
// };
|
|
11
|
+
|
|
8
12
|
// const onClick = (event: Event) => {
|
|
9
13
|
// console.log("button clicked!", event);
|
|
10
14
|
// };
|
|
15
|
+
|
|
11
16
|
// // example with window based event
|
|
12
17
|
// useEventListener("scroll", onScroll);
|
|
18
|
+
|
|
13
19
|
// // example with element based event
|
|
14
20
|
// useEventListener("click", onClick, buttonRef);
|
|
21
|
+
|
|
15
22
|
// return (
|
|
16
23
|
// <div style={{ minHeight: "200vh" }}>
|
|
17
24
|
// <button ref={buttonRef}>Click me</button>
|
|
@@ -28,16 +35,15 @@ export const useEventListener = (eventName, handler, element) => {
|
|
|
28
35
|
useEffect(() => {
|
|
29
36
|
// Define the listening target
|
|
30
37
|
const targetElement = (element === null || element === void 0 ? void 0 : element.current) || window;
|
|
31
|
-
|
|
32
38
|
if (!(targetElement && targetElement.addEventListener)) {
|
|
33
39
|
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
40
|
+
}
|
|
36
41
|
|
|
42
|
+
// Create event listener that calls handler function stored in ref
|
|
37
43
|
const eventListener = event => savedHandler.current(event);
|
|
44
|
+
targetElement.addEventListener(eventName, eventListener);
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
// Remove event listener on cleanup
|
|
41
47
|
return () => {
|
|
42
48
|
targetElement.removeEventListener(eventName, eventListener);
|
|
43
49
|
};
|
package/utils/useInput.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
|
|
3
2
|
const useInput = (defaultValue, valueProp, onChange, onInput, delayOnChange) => {
|
|
4
3
|
const [value, setValue] = useState(defaultValue || valueProp);
|
|
5
4
|
const timer = useRef(null);
|
|
@@ -7,24 +6,20 @@ const useInput = (defaultValue, valueProp, onChange, onInput, delayOnChange) =>
|
|
|
7
6
|
useEffect(() => {
|
|
8
7
|
setValue(valueProp);
|
|
9
8
|
}, [valueProp]);
|
|
10
|
-
|
|
11
9
|
const _onChange = e => {
|
|
12
10
|
e.persist();
|
|
13
11
|
if (timer.current) clearTimeout(timer.current);
|
|
14
12
|
timer.current = setTimeout(() => {
|
|
15
13
|
const valueInput = e.target.value || e.value;
|
|
16
14
|
setValue(valueInput);
|
|
17
|
-
|
|
18
15
|
e.reset = () => {
|
|
19
16
|
setValue(valueProp);
|
|
20
17
|
e.target.value = valueProp;
|
|
21
18
|
onInput === null || onInput === void 0 ? void 0 : onInput(e);
|
|
22
19
|
};
|
|
23
|
-
|
|
24
20
|
onChange === null || onChange === void 0 ? void 0 : onChange(e);
|
|
25
21
|
}, delayOnChange);
|
|
26
22
|
};
|
|
27
|
-
|
|
28
23
|
return {
|
|
29
24
|
value,
|
|
30
25
|
setValue,
|
|
@@ -35,5 +30,4 @@ const useInput = (defaultValue, valueProp, onChange, onInput, delayOnChange) =>
|
|
|
35
30
|
}
|
|
36
31
|
};
|
|
37
32
|
};
|
|
38
|
-
|
|
39
33
|
export default useInput;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
// Usage:
|
|
2
4
|
// export default function Component() {
|
|
3
5
|
// const matches = useMediaQuery('(min-width: 768px)');
|
|
4
6
|
// return <div>{`The view port is ${matches ? 'at least' : 'less than'} 768 pixels wide`}</div>;
|
|
@@ -10,28 +12,25 @@ const useMediaQuery = query => {
|
|
|
10
12
|
if (typeof window !== 'undefined') {
|
|
11
13
|
return window.matchMedia(query).matches;
|
|
12
14
|
}
|
|
13
|
-
|
|
14
15
|
return false;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
17
|
const [matches, setMatches] = useState(getMatches(query));
|
|
18
|
-
|
|
19
18
|
const handleChange = () => {
|
|
20
19
|
setMatches(getMatches(query));
|
|
21
20
|
};
|
|
22
|
-
|
|
23
21
|
useEffect(() => {
|
|
24
|
-
const matchMedia = window.matchMedia(query);
|
|
22
|
+
const matchMedia = window.matchMedia(query);
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
// Triggered at the first client-side load and if query changes
|
|
25
|
+
handleChange();
|
|
28
26
|
|
|
27
|
+
// Listen matchMedia
|
|
28
|
+
// TODO: Use `addEventListener` once support for Safari < 14 is dropped
|
|
29
29
|
if (matchMedia.addListener) {
|
|
30
30
|
matchMedia.addListener(handleChange);
|
|
31
31
|
} else {
|
|
32
32
|
matchMedia.addEventListener('change', handleChange);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
34
|
return () => {
|
|
36
35
|
if (matchMedia.removeListener) {
|
|
37
36
|
matchMedia.removeListener(handleChange);
|
|
@@ -42,5 +41,4 @@ const useMediaQuery = query => {
|
|
|
42
41
|
}, [query]);
|
|
43
42
|
return matches;
|
|
44
43
|
};
|
|
45
|
-
|
|
46
44
|
export default useMediaQuery;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://usehooks.com/useOnClickOutside/
|
|
1
|
+
/**
|
|
2
|
+
* https://usehooks.com/useOnClickOutside/
|
|
3
3
|
*/
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
export default function useOnClickOutside(ref, handler) {
|
|
@@ -9,10 +9,8 @@ export default function useOnClickOutside(ref, handler) {
|
|
|
9
9
|
if (!ref.current || ref.current.contains(event.target)) {
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
12
|
handler(event);
|
|
14
13
|
};
|
|
15
|
-
|
|
16
14
|
document.addEventListener('mousedown', listener);
|
|
17
15
|
document.addEventListener('touchstart', listener);
|
|
18
16
|
return () => {
|