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 OptionWrapper from "../others/option-wrapper";
|
|
@@ -22,7 +21,6 @@ const {
|
|
|
22
21
|
zIndex: zIndexCORE
|
|
23
22
|
} = useTheme();
|
|
24
23
|
const eventMap = new Map([['click', ['click']], ['hover', ['mouseenter', 'mouseleave']], ['focus', ['focus', 'blur']]]);
|
|
25
|
-
|
|
26
24
|
const getArrowPosition = (anchorOrigin, transformOrigin, translate) => {
|
|
27
25
|
if (anchorOrigin.horizontal === 'right' && transformOrigin.horizontal === 'left') {
|
|
28
26
|
translate.left = -6;
|
|
@@ -41,30 +39,25 @@ const getArrowPosition = (anchorOrigin, transformOrigin, translate) => {
|
|
|
41
39
|
return 'top';
|
|
42
40
|
}
|
|
43
41
|
};
|
|
44
|
-
|
|
45
42
|
const calPosition = (position, originBounding) => {
|
|
46
43
|
const {
|
|
47
44
|
width,
|
|
48
45
|
height
|
|
49
46
|
} = originBounding;
|
|
50
|
-
|
|
51
47
|
switch (position) {
|
|
52
48
|
case 'bottom':
|
|
53
49
|
case 'right':
|
|
54
50
|
{
|
|
55
51
|
return [height, width];
|
|
56
52
|
}
|
|
57
|
-
|
|
58
53
|
case 'center':
|
|
59
54
|
{
|
|
60
55
|
return [height / 2, width / 2];
|
|
61
56
|
}
|
|
62
|
-
|
|
63
57
|
default:
|
|
64
58
|
return [0, 0];
|
|
65
59
|
}
|
|
66
60
|
};
|
|
67
|
-
|
|
68
61
|
const getDirectionPopover = direction => {
|
|
69
62
|
switch (direction) {
|
|
70
63
|
case 'center':
|
|
@@ -78,7 +71,6 @@ const getDirectionPopover = direction => {
|
|
|
78
71
|
horizontal: 'center'
|
|
79
72
|
}
|
|
80
73
|
};
|
|
81
|
-
|
|
82
74
|
case 'top':
|
|
83
75
|
return {
|
|
84
76
|
anchorOrigin: {
|
|
@@ -90,7 +82,6 @@ const getDirectionPopover = direction => {
|
|
|
90
82
|
horizontal: 'center'
|
|
91
83
|
}
|
|
92
84
|
};
|
|
93
|
-
|
|
94
85
|
case 'left':
|
|
95
86
|
return {
|
|
96
87
|
anchorOrigin: {
|
|
@@ -102,7 +93,6 @@ const getDirectionPopover = direction => {
|
|
|
102
93
|
horizontal: 'right'
|
|
103
94
|
}
|
|
104
95
|
};
|
|
105
|
-
|
|
106
96
|
case 'right':
|
|
107
97
|
return {
|
|
108
98
|
anchorOrigin: {
|
|
@@ -114,7 +104,6 @@ const getDirectionPopover = direction => {
|
|
|
114
104
|
horizontal: 'left'
|
|
115
105
|
}
|
|
116
106
|
};
|
|
117
|
-
|
|
118
107
|
default:
|
|
119
108
|
return {
|
|
120
109
|
anchorOrigin: {
|
|
@@ -128,7 +117,6 @@ const getDirectionPopover = direction => {
|
|
|
128
117
|
};
|
|
129
118
|
}
|
|
130
119
|
};
|
|
131
|
-
|
|
132
120
|
const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
133
121
|
action = {},
|
|
134
122
|
anchor,
|
|
@@ -157,25 +145,18 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
157
145
|
const overflow = useRef(null);
|
|
158
146
|
const [openState, setOpenState] = useState(open);
|
|
159
147
|
const [element, setElement] = useState(null);
|
|
160
|
-
|
|
161
148
|
const _PortalPopoverCSS = PortalPopoverCSS(zIndex, fullScreen);
|
|
162
|
-
|
|
163
149
|
const _PopoverContainerCSS = PopoverContainerCSS(bgColor, width, height);
|
|
164
|
-
|
|
165
150
|
const _PopoverArrowCSS = PopoverArrowCSS(bgColor);
|
|
166
|
-
|
|
167
151
|
const arrowSize = arrow ? 6 : 0;
|
|
168
|
-
|
|
169
152
|
if (direction) {
|
|
170
153
|
const directionObject = getDirectionPopover(direction);
|
|
171
154
|
anchorOrigin = directionObject.anchorOrigin;
|
|
172
155
|
transformOrigin = directionObject.transformOrigin;
|
|
173
156
|
}
|
|
174
|
-
|
|
175
157
|
const onOpenPopover = () => {
|
|
176
158
|
if (!openState) setOpenState(true);
|
|
177
159
|
};
|
|
178
|
-
|
|
179
160
|
const onClosePopover = () => {
|
|
180
161
|
if (openState) {
|
|
181
162
|
if (ref.current) ref.current.style.opacity = 0;
|
|
@@ -183,116 +164,96 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
183
164
|
setOpenState(false);
|
|
184
165
|
}
|
|
185
166
|
};
|
|
186
|
-
|
|
187
167
|
const pressESCHandler = event => {
|
|
188
168
|
if (event.key === 'Escape') {
|
|
189
169
|
onClosePopover();
|
|
190
170
|
}
|
|
191
171
|
};
|
|
192
|
-
|
|
193
172
|
const onClickOutside = event => {
|
|
194
173
|
var _anchor2, _anchor3, _anchor3$current, _anchor4, _ref$current, _ref$current2, _ref$current2$parentN;
|
|
195
|
-
|
|
196
174
|
if (!ref.current) {
|
|
197
175
|
document.removeEventListener('click', onClickOutside);
|
|
198
176
|
return;
|
|
199
177
|
}
|
|
200
|
-
|
|
201
178
|
const _anchor = ((_anchor2 = anchor) === null || _anchor2 === void 0 ? void 0 : _anchor2.element) || ((_anchor3 = anchor) === null || _anchor3 === void 0 ? void 0 : (_anchor3$current = _anchor3.current) === null || _anchor3$current === void 0 ? void 0 : _anchor3$current.element) || ((_anchor4 = anchor) === null || _anchor4 === void 0 ? void 0 : _anchor4.current) || anchor;
|
|
202
|
-
|
|
203
179
|
if (clickOutsideToClose && !((_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.contains((event === null || event === void 0 ? void 0 : event.toElement) || (event === null || event === void 0 ? void 0 : event.target))) && (!fullScreen || (_ref$current2 = ref.current) !== null && _ref$current2 !== void 0 && (_ref$current2$parentN = _ref$current2.parentNode) !== null && _ref$current2$parentN !== void 0 && _ref$current2$parentN.contains(event === null || event === void 0 ? void 0 : event.target)) && !(_anchor !== null && _anchor !== void 0 && _anchor.contains((event === null || event === void 0 ? void 0 : event.toElement) || (event === null || event === void 0 ? void 0 : event.target))) && openState) {
|
|
204
180
|
onClosePopover();
|
|
205
181
|
}
|
|
206
182
|
};
|
|
207
|
-
|
|
208
183
|
const updatePositionPopover = (el = null, cb) => {
|
|
209
184
|
var _window, _window2, _anchor6, _anchorRect, _anchorRect2, _anchor7, _anchorRect3, _anchorRect4, _anchorRect5, _anchorRect6, _anchorRect7, _anchorRect8, _anchorRect9, _anchorRect10, _anchorRect11, _anchorRect12, _newDirectionObject, _newDirectionObject$t, _transformOrigin, _newDirectionObject2, _newDirectionObject2$, _transformOrigin2;
|
|
210
|
-
|
|
211
185
|
if (el instanceof Element) setElement(el);
|
|
212
|
-
|
|
213
186
|
if (!ref.current) {
|
|
214
187
|
window.removeEventListener('resize', updatePositionPopover);
|
|
215
188
|
return;
|
|
216
189
|
}
|
|
217
|
-
|
|
218
190
|
let top = 0,
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
191
|
+
left = 0,
|
|
192
|
+
vertical = 0,
|
|
193
|
+
verticalCenter = 0,
|
|
194
|
+
horizontal = 0,
|
|
195
|
+
horizontalCenter = 0,
|
|
196
|
+
arrowPosition = {},
|
|
197
|
+
translate = {
|
|
198
|
+
left: 0,
|
|
199
|
+
top: 0
|
|
200
|
+
},
|
|
201
|
+
anchorRect = null,
|
|
202
|
+
aPosition = '',
|
|
203
|
+
newDirectionObject = null;
|
|
233
204
|
if (transformOrigin === 'center') {
|
|
234
205
|
transformOrigin = {
|
|
235
206
|
vertical: 'center',
|
|
236
207
|
horizontal: 'center'
|
|
237
208
|
};
|
|
238
209
|
}
|
|
239
|
-
|
|
240
210
|
if (element || anchor) {
|
|
241
211
|
if (element) anchor = element;else if (anchor && !(anchor instanceof Element)) {
|
|
242
212
|
var _anchor5, _anchor$current;
|
|
243
|
-
|
|
244
213
|
anchor = ((_anchor5 = anchor) === null || _anchor5 === void 0 ? void 0 : _anchor5.element) || ((_anchor$current = anchor.current) === null || _anchor$current === void 0 ? void 0 : _anchor$current.element) || anchor.current;
|
|
245
214
|
}
|
|
246
215
|
if (!anchor) return;
|
|
247
|
-
|
|
248
216
|
if (arrow && anchorOrigin.vertical !== anchorOrigin.horizontal && transformOrigin.vertical !== transformOrigin.horizontal) {
|
|
249
217
|
aPosition = getArrowPosition(anchorOrigin, transformOrigin, translate);
|
|
250
218
|
}
|
|
251
|
-
|
|
252
219
|
anchorRect = anchor.getBoundingClientRect();
|
|
253
220
|
vertical = anchorRect.y + calPosition(anchorOrigin.vertical, anchorRect)[0] - translate.top;
|
|
254
221
|
verticalCenter = anchorRect.y + calPosition('center', anchorRect)[0];
|
|
255
222
|
horizontal = anchorRect.x + calPosition(anchorOrigin.horizontal, anchorRect)[1] - translate.left;
|
|
256
223
|
horizontalCenter = anchorRect.x + calPosition('center', anchorRect)[1];
|
|
257
|
-
}
|
|
258
|
-
|
|
224
|
+
}
|
|
259
225
|
|
|
226
|
+
// Calculate element positioning
|
|
260
227
|
const containerWindow = {
|
|
261
228
|
width: ((_window = window) === null || _window === void 0 ? void 0 : _window.innerWidth) || 0,
|
|
262
229
|
height: ((_window2 = window) === null || _window2 === void 0 ? void 0 : _window2.innerHeight) || 0
|
|
263
230
|
};
|
|
264
231
|
const popoverHeight = ref.current.offsetHeight;
|
|
265
232
|
const popoverWidth = ref.current.offsetWidth;
|
|
266
|
-
|
|
267
233
|
switch (transformOrigin.vertical) {
|
|
268
234
|
case 'center':
|
|
269
235
|
top = vertical - popoverHeight / 2;
|
|
270
236
|
break;
|
|
271
|
-
|
|
272
237
|
case 'bottom':
|
|
273
238
|
top = vertical - popoverHeight;
|
|
274
239
|
break;
|
|
275
|
-
|
|
276
240
|
default:
|
|
277
241
|
top = vertical;
|
|
278
242
|
break;
|
|
279
243
|
}
|
|
280
|
-
|
|
281
244
|
switch (transformOrigin.horizontal) {
|
|
282
245
|
case 'center':
|
|
283
246
|
left = horizontal - popoverWidth / 2;
|
|
284
247
|
break;
|
|
285
|
-
|
|
286
248
|
case 'right':
|
|
287
249
|
left = horizontal - popoverWidth;
|
|
288
250
|
break;
|
|
289
|
-
|
|
290
251
|
default:
|
|
291
252
|
left = horizontal;
|
|
292
253
|
break;
|
|
293
|
-
}
|
|
294
|
-
|
|
254
|
+
}
|
|
295
255
|
|
|
256
|
+
// Variables for check if needs shifting
|
|
296
257
|
const heightThreshold = containerWindow.height - marginThreshold;
|
|
297
258
|
const widthThreshold = containerWindow.width - marginThreshold;
|
|
298
259
|
const bottomOfAnchor = top + ((_anchor6 = anchor) === null || _anchor6 === void 0 ? void 0 : _anchor6.offsetHeight);
|
|
@@ -302,8 +263,9 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
302
263
|
const rightOfAnchor = left + ((_anchor7 = anchor) === null || _anchor7 === void 0 ? void 0 : _anchor7.offsetWidth);
|
|
303
264
|
const leftPos = ((_anchorRect3 = anchorRect) === null || _anchorRect3 === void 0 ? void 0 : _anchorRect3.right) + arrowSize;
|
|
304
265
|
const horizontalCenterPos = horizontalCenter - popoverWidth / 2;
|
|
305
|
-
const rightPos = ((_anchorRect4 = anchorRect) === null || _anchorRect4 === void 0 ? void 0 : _anchorRect4.left) - (popoverWidth + arrowSize);
|
|
266
|
+
const rightPos = ((_anchorRect4 = anchorRect) === null || _anchorRect4 === void 0 ? void 0 : _anchorRect4.left) - (popoverWidth + arrowSize);
|
|
306
267
|
|
|
268
|
+
// Check if the vertical axis needs shifting
|
|
307
269
|
if (top < marginThreshold) {
|
|
308
270
|
if (topPos > heightThreshold) {
|
|
309
271
|
top = verticalCenterPos;
|
|
@@ -324,9 +286,9 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
324
286
|
newDirectionObject = getDirectionPopover('top');
|
|
325
287
|
aPosition = getArrowPosition(newDirectionObject.anchorOrigin, newDirectionObject.transformOrigin, translate);
|
|
326
288
|
}
|
|
327
|
-
}
|
|
328
|
-
|
|
289
|
+
}
|
|
329
290
|
|
|
291
|
+
// Check if the horizontal axis needs shifting
|
|
330
292
|
if (left < marginThreshold) {
|
|
331
293
|
if (leftPos > widthThreshold) {
|
|
332
294
|
left = horizontalCenterPos;
|
|
@@ -347,58 +309,46 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
347
309
|
newDirectionObject = getDirectionPopover('left');
|
|
348
310
|
aPosition = getArrowPosition(newDirectionObject.anchorOrigin, newDirectionObject.transformOrigin, translate);
|
|
349
311
|
}
|
|
350
|
-
}
|
|
351
|
-
|
|
312
|
+
}
|
|
352
313
|
|
|
314
|
+
// Valid mean popover not at top-left, top-right, bottom-left, bottom-right
|
|
353
315
|
const validVerticalArrow = left >= ((_anchorRect5 = anchorRect) === null || _anchorRect5 === void 0 ? void 0 : _anchorRect5.left) + ((_anchorRect6 = anchorRect) === null || _anchorRect6 === void 0 ? void 0 : _anchorRect6.width) / 2 - popoverWidth && left <= ((_anchorRect7 = anchorRect) === null || _anchorRect7 === void 0 ? void 0 : _anchorRect7.right) - ((_anchorRect8 = anchorRect) === null || _anchorRect8 === void 0 ? void 0 : _anchorRect8.width) / 2 + popoverWidth;
|
|
354
|
-
const validHorizontalArrow = top >= ((_anchorRect9 = anchorRect) === null || _anchorRect9 === void 0 ? void 0 : _anchorRect9.top) + ((_anchorRect10 = anchorRect) === null || _anchorRect10 === void 0 ? void 0 : _anchorRect10.height) / 2 - popoverHeight && top <= ((_anchorRect11 = anchorRect) === null || _anchorRect11 === void 0 ? void 0 : _anchorRect11.bottom) - ((_anchorRect12 = anchorRect) === null || _anchorRect12 === void 0 ? void 0 : _anchorRect12.height) / 2;
|
|
316
|
+
const validHorizontalArrow = top >= ((_anchorRect9 = anchorRect) === null || _anchorRect9 === void 0 ? void 0 : _anchorRect9.top) + ((_anchorRect10 = anchorRect) === null || _anchorRect10 === void 0 ? void 0 : _anchorRect10.height) / 2 - popoverHeight && top <= ((_anchorRect11 = anchorRect) === null || _anchorRect11 === void 0 ? void 0 : _anchorRect11.bottom) - ((_anchorRect12 = anchorRect) === null || _anchorRect12 === void 0 ? void 0 : _anchorRect12.height) / 2;
|
|
355
317
|
|
|
318
|
+
// Get arrow's position
|
|
356
319
|
if (arrow && translate) {
|
|
357
320
|
switch (aPosition) {
|
|
358
321
|
case 'top':
|
|
359
322
|
if (validVerticalArrow) {
|
|
360
323
|
var _anchorRect13, _anchorRect14;
|
|
361
|
-
|
|
362
324
|
arrowPosition.left = ((_anchorRect13 = anchorRect) === null || _anchorRect13 === void 0 ? void 0 : _anchorRect13.width) / 2 + ((_anchorRect14 = anchorRect) === null || _anchorRect14 === void 0 ? void 0 : _anchorRect14.left) - arrowSize + 'px';
|
|
363
325
|
arrowPosition.top = Math.round(top) - arrowSize + 'px';
|
|
364
326
|
}
|
|
365
|
-
|
|
366
327
|
break;
|
|
367
|
-
|
|
368
328
|
case 'bottom':
|
|
369
329
|
if (validVerticalArrow) {
|
|
370
330
|
var _anchorRect15, _anchorRect16;
|
|
371
|
-
|
|
372
331
|
arrowPosition.left = ((_anchorRect15 = anchorRect) === null || _anchorRect15 === void 0 ? void 0 : _anchorRect15.width) / 2 + ((_anchorRect16 = anchorRect) === null || _anchorRect16 === void 0 ? void 0 : _anchorRect16.left) - arrowSize + 'px';
|
|
373
332
|
arrowPosition.top = Math.round(top) + popoverHeight + 'px';
|
|
374
333
|
}
|
|
375
|
-
|
|
376
334
|
break;
|
|
377
|
-
|
|
378
335
|
case 'left':
|
|
379
336
|
if (validHorizontalArrow) {
|
|
380
337
|
var _anchorRect17, _anchorRect18;
|
|
381
|
-
|
|
382
338
|
arrowPosition.top = ((_anchorRect17 = anchorRect) === null || _anchorRect17 === void 0 ? void 0 : _anchorRect17.height) / 2 + ((_anchorRect18 = anchorRect) === null || _anchorRect18 === void 0 ? void 0 : _anchorRect18.top) - arrowSize / 2 + 'px';
|
|
383
339
|
arrowPosition.left = Math.round(left) - 1.5 * arrowSize + 'px';
|
|
384
340
|
}
|
|
385
|
-
|
|
386
341
|
break;
|
|
387
|
-
|
|
388
342
|
case 'right':
|
|
389
343
|
if (validHorizontalArrow) {
|
|
390
344
|
var _anchorRect19, _anchorRect20;
|
|
391
|
-
|
|
392
345
|
arrowPosition.top = ((_anchorRect19 = anchorRect) === null || _anchorRect19 === void 0 ? void 0 : _anchorRect19.height) / 2 + ((_anchorRect20 = anchorRect) === null || _anchorRect20 === void 0 ? void 0 : _anchorRect20.top) - arrowSize / 2 + 'px';
|
|
393
346
|
arrowPosition.left = Math.round(left) + popoverWidth - arrowSize / 2 + 'px';
|
|
394
347
|
}
|
|
395
|
-
|
|
396
348
|
break;
|
|
397
|
-
|
|
398
349
|
default:
|
|
399
350
|
break;
|
|
400
351
|
}
|
|
401
|
-
|
|
402
352
|
if (arrowRef.current) {
|
|
403
353
|
Object.assign(arrowRef.current.style, arrowPosition, {
|
|
404
354
|
transform: translate.transform,
|
|
@@ -406,23 +356,19 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
406
356
|
});
|
|
407
357
|
}
|
|
408
358
|
}
|
|
409
|
-
|
|
410
359
|
if (top < marginThreshold) top = marginThreshold;
|
|
411
360
|
if (left < marginThreshold) left = marginThreshold;
|
|
412
361
|
const isVerticalOverFlow = left + popoverWidth > containerWindow.width;
|
|
413
362
|
ref.current.style.maxHeight = `calc(100% - ${spacing(8) + top}px)`;
|
|
414
363
|
ref.current.style.top = `${Math.round(top)}px`;
|
|
415
|
-
|
|
416
364
|
if (isVerticalOverFlow) {
|
|
417
365
|
ref.current.style.left = 0;
|
|
418
366
|
ref.current.style.margin = 'auto';
|
|
419
367
|
} else ref.current.style.left = `${Math.round(left)}px`;
|
|
420
|
-
|
|
421
368
|
ref.current.style.transformOrigin = `${((_newDirectionObject = newDirectionObject) === null || _newDirectionObject === void 0 ? void 0 : (_newDirectionObject$t = _newDirectionObject.transformOrigin) === null || _newDirectionObject$t === void 0 ? void 0 : _newDirectionObject$t.horizontal) || ((_transformOrigin = transformOrigin) === null || _transformOrigin === void 0 ? void 0 : _transformOrigin.horizontal) || 'left'} ${((_newDirectionObject2 = newDirectionObject) === null || _newDirectionObject2 === void 0 ? void 0 : (_newDirectionObject2$ = _newDirectionObject2.transformOrigin) === null || _newDirectionObject2$ === void 0 ? void 0 : _newDirectionObject2$.vertical) || ((_transformOrigin2 = transformOrigin) === null || _transformOrigin2 === void 0 ? void 0 : _transformOrigin2.vertical) || 'top'}`;
|
|
422
369
|
ref.current.style.opacity = 1;
|
|
423
370
|
cb === null || cb === void 0 ? void 0 : cb();
|
|
424
371
|
};
|
|
425
|
-
|
|
426
372
|
const handleEventTrigger = e => {
|
|
427
373
|
if (!openState) {
|
|
428
374
|
onOpenPopover();
|
|
@@ -430,23 +376,19 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
430
376
|
onClickOutside(e);
|
|
431
377
|
}
|
|
432
378
|
};
|
|
433
|
-
|
|
434
379
|
useEffect(() => {
|
|
435
380
|
return () => {
|
|
436
381
|
if (pressESCToClose) {
|
|
437
382
|
document.removeEventListener('keydown', pressESCHandler);
|
|
438
383
|
}
|
|
439
|
-
|
|
440
384
|
document.removeEventListener('click', onClickOutside);
|
|
441
385
|
window.removeEventListener('resize', updatePositionPopover);
|
|
442
386
|
};
|
|
443
387
|
}, []);
|
|
444
388
|
useEffect(() => {
|
|
445
389
|
var _anchor8, _anchor9;
|
|
446
|
-
|
|
447
390
|
const anchorEl = ((_anchor8 = anchor) === null || _anchor8 === void 0 ? void 0 : _anchor8.element) || ((_anchor9 = anchor) === null || _anchor9 === void 0 ? void 0 : _anchor9.current) || anchor;
|
|
448
391
|
const eventArr = eventMap.get(trigger) || [];
|
|
449
|
-
|
|
450
392
|
if (anchorEl && open === undefined && (eventArr === null || eventArr === void 0 ? void 0 : eventArr.length) > 0) {
|
|
451
393
|
eventArr.forEach(evt => anchorEl.addEventListener(evt, handleEventTrigger, false));
|
|
452
394
|
return () => {
|
|
@@ -460,27 +402,25 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
460
402
|
useEffect(() => {
|
|
461
403
|
if (openState && ref.current) {
|
|
462
404
|
overflow.current = document.body.style.overflow; // store overflow of <body /> before open
|
|
405
|
+
document.body.style.overflow = 'hidden';
|
|
406
|
+
// Position's anchor
|
|
407
|
+
updatePositionPopover();
|
|
463
408
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
updatePositionPopover(); // Allow press ESC to close popup
|
|
467
|
-
|
|
409
|
+
// Allow press ESC to close popup
|
|
468
410
|
if (pressESCToClose) {
|
|
469
411
|
document.addEventListener('keydown', pressESCHandler);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
document.addEventListener('click', onClickOutside); // Update position popover on resize
|
|
412
|
+
}
|
|
413
|
+
// Click out popover to close popover
|
|
414
|
+
document.addEventListener('click', onClickOutside);
|
|
474
415
|
|
|
416
|
+
// Update position popover on resize
|
|
475
417
|
window.addEventListener('resize', updatePositionPopover);
|
|
476
418
|
if (trigger === 'hover') ref.current.addEventListener('mouseleave', handleEventTrigger, false);
|
|
477
419
|
return () => {
|
|
478
420
|
document.body.style.overflow = overflow.current; // reset overflow of <body /> before open
|
|
479
|
-
|
|
480
421
|
if (pressESCToClose) {
|
|
481
422
|
document.removeEventListener('keydown', pressESCHandler);
|
|
482
423
|
}
|
|
483
|
-
|
|
484
424
|
document.removeEventListener('click', onClickOutside);
|
|
485
425
|
window.removeEventListener('resize', updatePositionPopover);
|
|
486
426
|
if (trigger === 'hover' && ref.current) ref.current.removeEventListener('mouseleave', handleEventTrigger, false);
|
|
@@ -507,28 +447,20 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
507
447
|
setPosition: el => updatePositionPopover(el),
|
|
508
448
|
...action
|
|
509
449
|
}; // methods
|
|
510
|
-
|
|
511
450
|
_instance.__proto__ = {
|
|
512
451
|
hide: () => onClosePopover()
|
|
513
452
|
}; // hidden methods
|
|
514
|
-
|
|
515
453
|
currentRef.instance = _instance;
|
|
516
|
-
|
|
517
454
|
currentRef.show = el => {
|
|
518
455
|
if (el) setElement(el);
|
|
519
456
|
!openState && el ? updatePositionPopover(el, onOpenPopover()) : onOpenPopover();
|
|
520
457
|
};
|
|
521
|
-
|
|
522
458
|
currentRef.close = onClosePopover;
|
|
523
|
-
|
|
524
459
|
currentRef.setPosition = el => updatePositionPopover(el);
|
|
525
|
-
|
|
526
460
|
return currentRef;
|
|
527
461
|
});
|
|
528
|
-
|
|
529
462
|
const renderAnchor = () => {
|
|
530
463
|
var _anchor10, _anchor11, _anchor11$props;
|
|
531
|
-
|
|
532
464
|
if (!((_anchor10 = anchor) !== null && _anchor10 !== void 0 && _anchor10.type)) return null;
|
|
533
465
|
const AnchorTag = /*#__PURE__*/React.cloneElement(anchor, {
|
|
534
466
|
ref: ref => {
|
|
@@ -541,7 +473,6 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
541
473
|
});
|
|
542
474
|
return AnchorTag;
|
|
543
475
|
};
|
|
544
|
-
|
|
545
476
|
const PopoverView = useMemo(() => {
|
|
546
477
|
if (openState) {
|
|
547
478
|
const node = jsx("div", {
|
|
@@ -558,19 +489,16 @@ const Popover = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
558
489
|
}));
|
|
559
490
|
return /*#__PURE__*/createPortal(node, document.body);
|
|
560
491
|
}
|
|
561
|
-
|
|
562
492
|
return null;
|
|
563
493
|
}, [openState, arrow, bgColor, children, className, clickOutsideToClose, fullScreen, height, style, width, zIndex]);
|
|
564
494
|
return jsx(React.Fragment, null, renderAnchor(), PopoverView);
|
|
565
495
|
}));
|
|
566
|
-
|
|
567
496
|
const PortalPopoverCSS = (zIndex, fullScreen) => css`
|
|
568
497
|
${positionFixed};
|
|
569
498
|
z-index: ${zIndex};
|
|
570
499
|
pointer-events: ${fullScreen ? 'initial' : 'none'};
|
|
571
500
|
inset: 0;
|
|
572
501
|
`;
|
|
573
|
-
|
|
574
502
|
const PopoverContainerCSS = (bgColor, width, height) => css`
|
|
575
503
|
${flexCol};
|
|
576
504
|
${positionRelative};
|
|
@@ -587,7 +515,6 @@ const PopoverContainerCSS = (bgColor, width, height) => css`
|
|
|
587
515
|
background-color: ${bgColor};
|
|
588
516
|
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
|
|
589
517
|
`;
|
|
590
|
-
|
|
591
518
|
const PopoverArrowCSS = bgColor => css`
|
|
592
519
|
${displayBlock};
|
|
593
520
|
${positionAbsolute};
|
|
@@ -596,7 +523,6 @@ const PopoverArrowCSS = bgColor => css`
|
|
|
596
523
|
border-right: 6px solid transparent;
|
|
597
524
|
border-bottom: 6px solid ${bgColor};
|
|
598
525
|
`;
|
|
599
|
-
|
|
600
526
|
Popover.defaultProps = {
|
|
601
527
|
anchorOrigin: {
|
|
602
528
|
vertical: 'bottom',
|
|
@@ -622,85 +548,67 @@ Popover.defaultProps = {
|
|
|
622
548
|
Popover.propTypes = {
|
|
623
549
|
/** If `true`, the component is shown. */
|
|
624
550
|
open: PropTypes.bool,
|
|
625
|
-
|
|
626
551
|
/** Trigger mode of the component. Will not work when use with `open` prop. */
|
|
627
552
|
trigger: PropTypes.oneOf(['click', 'hover', 'focus']),
|
|
628
|
-
|
|
629
553
|
/** An HTML element, or a function that returns one. It's used to set the position of the popover. */
|
|
630
554
|
anchor: PropTypes.oneOfType([PropTypes.instanceOf(Element), PropTypes.func, PropTypes.object, PropTypes.node, ref]),
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
*
|
|
634
|
-
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
555
|
+
/**
|
|
556
|
+
* This is the point on the anchor where the popover's anchor will attach to.
|
|
557
|
+
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
635
558
|
*/
|
|
636
559
|
anchorOrigin: PropTypes.shape({
|
|
637
560
|
horizontal: PropTypes.oneOf(['center', 'left', 'right']),
|
|
638
561
|
vertical: PropTypes.oneOf(['bottom', 'center', 'top'])
|
|
639
562
|
}),
|
|
640
|
-
|
|
641
563
|
/** If `true`, arrow is shown. */
|
|
642
564
|
arrow: PropTypes.bool,
|
|
643
|
-
|
|
644
565
|
/** Background color of the component. */
|
|
645
566
|
bgColor: PropTypes.string,
|
|
646
|
-
|
|
647
567
|
/** The content of the component. */
|
|
648
568
|
children: PropTypes.node,
|
|
649
|
-
|
|
650
569
|
/** Class for component. */
|
|
651
570
|
className: PropTypes.string,
|
|
652
|
-
|
|
653
571
|
/** If `true`, click outside will close component. */
|
|
654
572
|
clickOutsideToClose: PropTypes.bool,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
-
*
|
|
660
|
-
* *
|
|
661
|
-
* *
|
|
662
|
-
* *
|
|
663
|
-
* * bottom: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
|
|
573
|
+
/**
|
|
574
|
+
* Direction when Popover shown.
|
|
575
|
+
* Note: This prop will overwrite anchorOrigin & transformOrigin.
|
|
576
|
+
*
|
|
577
|
+
* * top: anchorOrigin: { vertical: 'top', horizontal: 'center' }, transformOrigin: { vertical: 'bottom', horizontal: 'center' }
|
|
578
|
+
* * left: anchorOrigin: { vertical: 'center', horizontal: 'left' }, transformOrigin: { vertical: 'center', horizontal: 'right' }
|
|
579
|
+
* * right: anchorOrigin: { vertical: 'center', horizontal: 'right' }, transformOrigin: { vertical: 'center', horizontal: 'left' }
|
|
580
|
+
* * bottom: anchorOrigin: { vertical: 'bottom', horizontal: 'center' }, transformOrigin: { vertical: 'top', horizontal: 'center' }
|
|
664
581
|
*/
|
|
665
582
|
direction: PropTypes.oneOf(['top', 'left', 'right', 'bottom']),
|
|
666
|
-
|
|
667
583
|
/** Height of the component. */
|
|
668
584
|
height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
669
|
-
|
|
670
585
|
/** Specifies how close to the edge of the window the popover can appear. */
|
|
671
586
|
marginThreshold: PropTypes.number,
|
|
672
|
-
|
|
673
587
|
/** Callback fired when the component requests to be closed. */
|
|
674
588
|
onClose: PropTypes.func,
|
|
675
|
-
|
|
676
589
|
/** If `true`, hitting escape will close component. */
|
|
677
590
|
pressESCToClose: PropTypes.bool,
|
|
678
|
-
|
|
679
591
|
/** Style inline of component. */
|
|
680
592
|
style: PropTypes.object,
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
*
|
|
684
|
-
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
593
|
+
/**
|
|
594
|
+
* This is the point on the popover which will attach to the anchor's origin.
|
|
595
|
+
* Options: vertical: [top, center, bottom]; horizontal: [left, center, right].
|
|
685
596
|
*/
|
|
686
597
|
transformOrigin: PropTypes.shape({
|
|
687
598
|
horizontal: PropTypes.oneOf(['center', 'left', 'right']),
|
|
688
599
|
vertical: PropTypes.oneOf(['bottom', 'center', 'top'])
|
|
689
600
|
}),
|
|
690
|
-
|
|
691
601
|
/** Width of the component. */
|
|
692
602
|
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
693
|
-
|
|
694
603
|
/** Config z-index of the component. */
|
|
695
604
|
zIndex: PropTypes.number,
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
* *
|
|
701
|
-
* *
|
|
702
|
-
*
|
|
703
|
-
* * @param {element} - element
|
|
605
|
+
/**
|
|
606
|
+
* ref methods (ref.current.instance.*method*)
|
|
607
|
+
*
|
|
608
|
+
* * show: Show popover
|
|
609
|
+
* * close: Close popover
|
|
610
|
+
* * setPosition(element): Set position of popover
|
|
611
|
+
* * @param {element} - element
|
|
704
612
|
*/
|
|
705
613
|
reference: ref
|
|
706
614
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* eslint-disable react/prop-types */
|
|
2
|
-
|
|
3
2
|
/** @jsxRuntime classic */
|
|
4
|
-
|
|
5
3
|
/** @jsx jsx */
|
|
6
4
|
import { memo, useEffect, useRef } from 'react';
|
|
7
5
|
import PropTypes from 'prop-types';
|
|
@@ -11,7 +9,6 @@ import { Button } from "../";
|
|
|
11
9
|
import { renderHTML } from "../../utils";
|
|
12
10
|
import { Warning } from "../../icons";
|
|
13
11
|
import { typography } from "../../styles/typography";
|
|
14
|
-
|
|
15
12
|
const DangerPopup = ({
|
|
16
13
|
open,
|
|
17
14
|
warningText,
|
|
@@ -78,18 +75,14 @@ const DangerPopup = ({
|
|
|
78
75
|
}
|
|
79
76
|
}
|
|
80
77
|
`;
|
|
81
|
-
|
|
82
78
|
const onConfirmHandler = () => {
|
|
83
79
|
if (onConfirm) onConfirm();
|
|
84
80
|
};
|
|
85
|
-
|
|
86
81
|
const onCancelHandler = () => {
|
|
87
82
|
if (onCancel) onCancel();
|
|
88
83
|
};
|
|
89
|
-
|
|
90
84
|
useEffect(() => {
|
|
91
85
|
let timer = null;
|
|
92
|
-
|
|
93
86
|
if (open) {
|
|
94
87
|
setTimeout(() => {
|
|
95
88
|
if (popupActionRef.current) {
|
|
@@ -108,14 +101,12 @@ const DangerPopup = ({
|
|
|
108
101
|
clearInterval(timer);
|
|
109
102
|
return;
|
|
110
103
|
}
|
|
111
|
-
|
|
112
104
|
time--;
|
|
113
105
|
childNode.textContent = `${confirmText} (${time}s)`;
|
|
114
106
|
}, 1000);
|
|
115
107
|
}
|
|
116
108
|
}, 0);
|
|
117
109
|
}
|
|
118
|
-
|
|
119
110
|
return () => {
|
|
120
111
|
if (open && popupActionRef.current) {
|
|
121
112
|
const button = popupActionRef.current.querySelector('button.button-confirm');
|
|
@@ -127,7 +118,6 @@ const DangerPopup = ({
|
|
|
127
118
|
childNode.textContent = confirmText;
|
|
128
119
|
}, 300);
|
|
129
120
|
}
|
|
130
|
-
|
|
131
121
|
if (timer) clearInterval(timer);
|
|
132
122
|
};
|
|
133
123
|
}, [open]);
|
|
@@ -165,7 +155,6 @@ const DangerPopup = ({
|
|
|
165
155
|
onClick: onCancelHandler
|
|
166
156
|
}, cancelText))));
|
|
167
157
|
};
|
|
168
|
-
|
|
169
158
|
DangerPopup.defaultProps = {
|
|
170
159
|
warningText: 'CẢNH BÁO NGUY HIỂM',
|
|
171
160
|
warningIconColor: '#E7000F',
|
|
@@ -179,28 +168,20 @@ DangerPopup.defaultProps = {
|
|
|
179
168
|
DangerPopup.propTypes = {
|
|
180
169
|
/** the title of Popup */
|
|
181
170
|
warningText: PropTypes.string,
|
|
182
|
-
|
|
183
171
|
/** the title of Popup */
|
|
184
172
|
warningIconColor: PropTypes.string,
|
|
185
|
-
|
|
186
173
|
/** the content to description for warning title */
|
|
187
174
|
warningDescription: PropTypes.string,
|
|
188
|
-
|
|
189
175
|
/** the content to display in confirm button */
|
|
190
176
|
confirmText: PropTypes.string,
|
|
191
|
-
|
|
192
177
|
/** the content to display in cancel button */
|
|
193
178
|
cancelText: PropTypes.string,
|
|
194
|
-
|
|
195
179
|
/** the color of button when timing */
|
|
196
180
|
buttonTimingColor: PropTypes.string,
|
|
197
|
-
|
|
198
181
|
/** the period to prevent click confirm button */
|
|
199
182
|
timing: PropTypes.number,
|
|
200
|
-
|
|
201
183
|
/** the function run when click confirm button */
|
|
202
184
|
onConfirm: PropTypes.func,
|
|
203
|
-
|
|
204
185
|
/** the function run when click cancel button */
|
|
205
186
|
onCancel: PropTypes.func
|
|
206
187
|
};
|