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