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 { ButtonIcon, HelperText, Label, LinearProgress, List, ListItem, ListItemText, ModalSample, Notify, Popover, Popup, ScrollBar, Slider, SliderItem, Typography } from "../..";
|
|
@@ -65,61 +66,75 @@ const oldAttached = [];
|
|
|
65
66
|
const allNewAttached = new FormData();
|
|
66
67
|
const attached = [];
|
|
67
68
|
const chosenItems = [];
|
|
69
|
+
|
|
68
70
|
const getType = data => {
|
|
69
71
|
if (data.type !== undefined) {
|
|
70
72
|
var _type$match;
|
|
73
|
+
|
|
71
74
|
const pattern = /word|sheet|presentation|pdf|image|compressed/i;
|
|
72
75
|
let type = data.type;
|
|
76
|
+
|
|
73
77
|
if (!type) {
|
|
74
78
|
if (/rar/.test(data.name)) {
|
|
75
79
|
type = 'compressed';
|
|
76
80
|
}
|
|
77
81
|
}
|
|
82
|
+
|
|
78
83
|
return ((_type$match = type.match(pattern)) === null || _type$match === void 0 ? void 0 : _type$match[0]) || 'default';
|
|
79
84
|
} else {
|
|
80
85
|
var _data$FileName;
|
|
86
|
+
|
|
81
87
|
const FileExt = (_data$FileName = data.FileName) === null || _data$FileName === void 0 ? void 0 : _data$FileName.slice(data.FileName.lastIndexOf('.'));
|
|
82
88
|
return getFileType(FileExt, 'default');
|
|
83
89
|
}
|
|
84
90
|
};
|
|
91
|
+
|
|
85
92
|
const getDateTime = date => {
|
|
86
93
|
if (String(date) === 'Invalid Date') return 'unknown';
|
|
87
94
|
return moment(date).format('DD/MM/YYYY, HH:mm:ss');
|
|
88
95
|
};
|
|
96
|
+
|
|
89
97
|
const getNewUnitSize = (sizeName, totalSize, num) => {
|
|
90
98
|
if (sizeName === 'B' && num === 1 || sizeName === 'TB' && num === -1) return [sizeName, totalSize];
|
|
91
99
|
const arraySize = ['TB', 'GB', 'MB', 'KB', 'B'];
|
|
92
100
|
const index = arraySize.indexOf(sizeName);
|
|
93
|
-
const newTotalSize = totalSize * Math.pow(1024, num);
|
|
94
|
-
|
|
101
|
+
const newTotalSize = totalSize * Math.pow(1024, num); // newTotalSize = Math.round(newTotalSize*100)/100;
|
|
102
|
+
|
|
95
103
|
return [arraySize[index + num], newTotalSize];
|
|
96
104
|
};
|
|
105
|
+
|
|
97
106
|
const getBit = (size, unit) => {
|
|
98
107
|
switch (true) {
|
|
99
108
|
case /^B$/i.test(unit):
|
|
100
109
|
return size * 1;
|
|
110
|
+
|
|
101
111
|
case /KB/i.test(unit):
|
|
102
112
|
return size * 1024;
|
|
113
|
+
|
|
103
114
|
case /MB/i.test(unit):
|
|
104
115
|
return size * 1024 ** 2;
|
|
116
|
+
|
|
105
117
|
case /GB/i.test(unit):
|
|
106
118
|
return size * 1024 ** 3;
|
|
119
|
+
|
|
107
120
|
case /TB/i.test(unit):
|
|
108
121
|
return size * 1024 ** 4;
|
|
122
|
+
|
|
109
123
|
default:
|
|
110
124
|
return size * 1024 * 1024;
|
|
111
125
|
}
|
|
112
126
|
};
|
|
127
|
+
|
|
113
128
|
const formatBytes = (bytes, decimals = 2) => {
|
|
114
129
|
if (!+bytes) return '0 Bytes';
|
|
115
130
|
const k = 1024;
|
|
116
131
|
const dm = decimals < 0 ? 0 : decimals;
|
|
117
132
|
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
118
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
133
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k)); // return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
|
|
119
134
|
|
|
120
|
-
// return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`
|
|
121
135
|
return [parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), sizes[i]];
|
|
122
136
|
};
|
|
137
|
+
|
|
123
138
|
const divideSizeMap = new Map([['B', 1], ['KB', 1024], ['MB', 1024 ** 2], ['GB', 1024 ** 3], ['TB', 1024 ** 4]]);
|
|
124
139
|
const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
125
140
|
accept,
|
|
@@ -173,12 +188,14 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
173
188
|
const [isEmpty, setIsEmpty] = useState(null);
|
|
174
189
|
const [newDataState, setNewDataState] = useState([]);
|
|
175
190
|
const isEnable = !readOnly && !disabled;
|
|
176
|
-
const _AttachmentRootCSS = AttachmentRootCSS(isEmpty, isEnable);
|
|
177
191
|
|
|
178
|
-
// Start handler
|
|
192
|
+
const _AttachmentRootCSS = AttachmentRootCSS(isEmpty, isEnable); // Start handler
|
|
193
|
+
|
|
194
|
+
|
|
179
195
|
const onSortElement = (e, type) => {
|
|
180
196
|
let multi = 1;
|
|
181
197
|
const currentActive = popoverRef.current.querySelector('.DGN-Active');
|
|
198
|
+
|
|
182
199
|
if (currentActive) {
|
|
183
200
|
if (e.currentTarget.classList.contains('DGN-Active')) {
|
|
184
201
|
if (e.currentTarget.classList.contains('DGN-Decrease')) {
|
|
@@ -192,11 +209,13 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
192
209
|
currentActive.classList.remove('DGN-Active');
|
|
193
210
|
}
|
|
194
211
|
}
|
|
212
|
+
|
|
195
213
|
e.currentTarget.classList.add('DGN-Active');
|
|
196
214
|
const attachedList = Array.from(attachedRef.current.querySelectorAll('.attachment-row'));
|
|
197
215
|
attachedList.sort((a, b) => {
|
|
198
216
|
let textA = a.querySelector('.' + (type === 'filesize' ? 'filename' : type)).textContent;
|
|
199
217
|
let textB = b.querySelector('.' + (type === 'filesize' ? 'filename' : type)).textContent;
|
|
218
|
+
|
|
200
219
|
if (type === 'datetime') {
|
|
201
220
|
textA = textA.replace(/.{10}/, text => moment(text, 'DD/MM/YYYY').format('YYYY/MM/DD'));
|
|
202
221
|
textB = textB.replace(/.{10}/, text => moment(text, 'DD/MM/YYYY').format('YYYY/MM/DD'));
|
|
@@ -206,12 +225,14 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
206
225
|
textA = (objA.size || objA.FileSize).toString();
|
|
207
226
|
textB = (objB.size || objB.FileSize).toString();
|
|
208
227
|
}
|
|
228
|
+
|
|
209
229
|
return multi * textA.localeCompare(textB, 'en', {
|
|
210
230
|
numeric: type === 'filesize'
|
|
211
231
|
});
|
|
212
232
|
});
|
|
213
233
|
attached.sort((a, b) => {
|
|
214
234
|
let valueA, valueB;
|
|
235
|
+
|
|
215
236
|
if (type === 'filesize' || type === 'datetime') {
|
|
216
237
|
if (type === 'filesize') {
|
|
217
238
|
valueA = a.size || a.FileSize;
|
|
@@ -228,6 +249,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
228
249
|
valueA = a[type === 'filename' ? 'FileName' : 'UserName'] || ownerName;
|
|
229
250
|
valueB = b[type === 'filename' ? 'FileName' : 'UserName'] || ownerName;
|
|
230
251
|
}
|
|
252
|
+
|
|
231
253
|
return multi * valueA.toString().localeCompare(valueB.toString(), 'en', {
|
|
232
254
|
numeric: type === 'filesize' || type === 'datetime'
|
|
233
255
|
});
|
|
@@ -236,47 +258,63 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
236
258
|
attachedRef.current.appendChild(el);
|
|
237
259
|
});
|
|
238
260
|
};
|
|
261
|
+
|
|
239
262
|
const afterChangeFile = (length = 0) => {
|
|
240
263
|
setIsEmpty(!length);
|
|
241
264
|
};
|
|
265
|
+
|
|
242
266
|
const onChangeFiles = async e => {
|
|
243
267
|
var _e$target, _e$target$files;
|
|
268
|
+
|
|
244
269
|
if (!isEnable) return;
|
|
245
270
|
e.persist();
|
|
271
|
+
|
|
246
272
|
if (e !== null && e !== void 0 && (_e$target = e.target) !== null && _e$target !== void 0 && (_e$target$files = _e$target.files) !== null && _e$target$files !== void 0 && _e$target$files.length) {
|
|
247
273
|
let files = e.target.files;
|
|
248
274
|
const lengthAttached = attached.length;
|
|
275
|
+
|
|
249
276
|
for (let i = 0; i < files.length; i++) {
|
|
250
277
|
if (i + 1 > maxFile - lengthAttached || files[i].size > maxSize.current || checkExistingFile(files[i]) || !checkAcceptFileType(files[i])) {
|
|
251
278
|
if (i + 1 > maxFile - lengthAttached) {
|
|
252
279
|
var _files$i;
|
|
280
|
+
|
|
253
281
|
notifyRef.current.instance.show(`${(_files$i = files[i]) === null || _files$i === void 0 ? void 0 : _files$i.name} - ${uploadErrorInfo['maxFile']}`);
|
|
254
282
|
} else if (files[i].size > maxSize.current) {
|
|
255
283
|
var _files$i2;
|
|
284
|
+
|
|
256
285
|
notifyRef.current.instance.show(`${(_files$i2 = files[i]) === null || _files$i2 === void 0 ? void 0 : _files$i2.name} - ${uploadErrorInfo['maxSize']}`);
|
|
257
286
|
} else if (!checkAcceptFileType(files[i])) {
|
|
258
287
|
var _files$i3;
|
|
288
|
+
|
|
259
289
|
notifyRef.current.instance.show(`${(_files$i3 = files[i]) === null || _files$i3 === void 0 ? void 0 : _files$i3.name} - ${uploadErrorInfo['fileType']}`);
|
|
260
290
|
} else {
|
|
261
291
|
var _files$i4;
|
|
292
|
+
|
|
262
293
|
notifyRef.current.instance.show(`${(_files$i4 = files[i]) === null || _files$i4 === void 0 ? void 0 : _files$i4.name} - ${uploadErrorInfo['existingFile']}`);
|
|
263
294
|
}
|
|
295
|
+
|
|
264
296
|
files = removeFileOutInputFiles(i, true);
|
|
265
297
|
i--;
|
|
266
298
|
}
|
|
267
299
|
}
|
|
300
|
+
|
|
268
301
|
const length = files.length;
|
|
302
|
+
|
|
269
303
|
if (!lengthAttached && !length) {
|
|
270
304
|
afterChangeFile();
|
|
271
305
|
return;
|
|
272
306
|
}
|
|
307
|
+
|
|
273
308
|
afterChangeFile(lengthAttached + length);
|
|
309
|
+
|
|
274
310
|
if (multiple || inputProps && inputProps.multiple) {
|
|
275
311
|
for (let i = 0; i < length; i++) {
|
|
276
312
|
files[i].FileName = files[i].name;
|
|
277
313
|
attached.push(files[i]);
|
|
278
314
|
}
|
|
315
|
+
|
|
279
316
|
setNewDataState([...newDataState, ...Array.from(files)]);
|
|
317
|
+
|
|
280
318
|
for (let i = 0; i < length; i++) {
|
|
281
319
|
files[i].URL = await onProgressing(files[i]);
|
|
282
320
|
}
|
|
@@ -286,6 +324,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
286
324
|
attached.push(files[0]);
|
|
287
325
|
files[0].URL = await onProgressing(files[0]);
|
|
288
326
|
}
|
|
327
|
+
|
|
289
328
|
insertAttached(files);
|
|
290
329
|
stripDomain();
|
|
291
330
|
if (onChange) onChange({
|
|
@@ -299,40 +338,49 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
299
338
|
afterChangeFile();
|
|
300
339
|
}
|
|
301
340
|
};
|
|
341
|
+
|
|
302
342
|
const onProgressing = file => {
|
|
303
343
|
return new Promise((resolve, reject) => {
|
|
304
344
|
const reader = new FileReader();
|
|
305
345
|
let url;
|
|
306
346
|
reader.readAsDataURL(file);
|
|
347
|
+
|
|
307
348
|
reader.onload = e => {
|
|
308
349
|
url = e.target.result;
|
|
309
350
|
};
|
|
351
|
+
|
|
310
352
|
reader.onloadstart = () => {
|
|
311
353
|
attachedRef.current.querySelector(`.css-${AttachedLinearCSS.name}-attached`).childNodes[0].style.width = '0%';
|
|
312
354
|
};
|
|
355
|
+
|
|
313
356
|
reader.onprogress = e => {
|
|
314
357
|
attachedRef.current.querySelector(`.css-${AttachedLinearCSS.name}-attached`).childNodes[0].style.width = e.loaded / e.total * 100 + '%';
|
|
315
358
|
};
|
|
359
|
+
|
|
316
360
|
reader.onloadend = () => {
|
|
317
361
|
setTimeout(() => {
|
|
318
362
|
attachedRef.current.querySelector(`.css-${AttachedLinearCSS.name}-attached`).parentNode.remove();
|
|
319
363
|
resolve(url);
|
|
320
364
|
}, 200);
|
|
321
365
|
};
|
|
366
|
+
|
|
322
367
|
reader.onerror = () => {
|
|
323
368
|
console.log('Upload file fail');
|
|
324
369
|
reject(false);
|
|
325
370
|
};
|
|
326
371
|
});
|
|
327
372
|
};
|
|
373
|
+
|
|
328
374
|
const calculateSize = size => {
|
|
329
375
|
if (!size && size !== 0) return 'unknown';
|
|
330
376
|
let totalSize;
|
|
331
377
|
let unitSizeName;
|
|
332
378
|
const divideSize = unitSize ? divideSizeMap.get(unitSize.toUpperCase()) : null;
|
|
379
|
+
|
|
333
380
|
if (divideSize) {
|
|
334
381
|
totalSize = size / divideSize;
|
|
335
382
|
unitSizeName = unitSize.toUpperCase();
|
|
383
|
+
|
|
336
384
|
while (totalSize < 0.01 && unitSizeName !== 'B') {
|
|
337
385
|
[unitSizeName, totalSize] = getNewUnitSize(unitSizeName, totalSize, 1);
|
|
338
386
|
}
|
|
@@ -340,27 +388,34 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
340
388
|
// auto-detect unit size name
|
|
341
389
|
[totalSize, unitSizeName] = formatBytes(size);
|
|
342
390
|
}
|
|
391
|
+
|
|
343
392
|
if (totalSize < 1000) {
|
|
344
393
|
totalSize = Math.round(totalSize * 100) / 100;
|
|
345
394
|
} else {
|
|
346
395
|
totalSize = Math.round(totalSize);
|
|
347
396
|
}
|
|
397
|
+
|
|
348
398
|
return totalSize + ' ' + unitSizeName;
|
|
349
399
|
};
|
|
400
|
+
|
|
350
401
|
const onShowPopup = () => {
|
|
351
402
|
setShowPopup(true);
|
|
352
403
|
};
|
|
404
|
+
|
|
353
405
|
const onClosePopup = () => {
|
|
354
406
|
setShowPopup(false);
|
|
407
|
+
|
|
355
408
|
if (isDeleteAll.current) {
|
|
356
409
|
isDeleteAll.current = false;
|
|
357
410
|
chosenItems.length = 0;
|
|
358
411
|
removeActiveChosenItem();
|
|
359
412
|
}
|
|
360
413
|
};
|
|
414
|
+
|
|
361
415
|
const onDownloadMultiple = () => {
|
|
362
416
|
const index = chosenItems[0];
|
|
363
417
|
let file;
|
|
418
|
+
|
|
364
419
|
if (index < oldAttached.length) {
|
|
365
420
|
file = mountDomain(oldAttached[index]);
|
|
366
421
|
onDownload(file.URL, file.FileName);
|
|
@@ -370,6 +425,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
370
425
|
onDownload(file.URL, file.name);
|
|
371
426
|
}
|
|
372
427
|
};
|
|
428
|
+
|
|
373
429
|
const onRemoveMultiple = () => {
|
|
374
430
|
const nodeList = attachedRef.current.querySelectorAll('.chosen');
|
|
375
431
|
const recentRemovedAttached = [];
|
|
@@ -377,18 +433,22 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
377
433
|
const parent = itemEl.parentNode;
|
|
378
434
|
const index = Array.from(attachedRef.current.children).indexOf(parent);
|
|
379
435
|
const deletedFile = attached.splice(index, 1)[0];
|
|
436
|
+
|
|
380
437
|
if (Object.prototype.toString.call(deletedFile) === '[object File]') {
|
|
381
438
|
removeFileOutInputFiles(allNewAttached.getAll('files').findIndex(attach => attach.FileName === deletedFile.FileName && attach.CreateDate === deletedFile.CreateDate));
|
|
382
439
|
} else {
|
|
383
440
|
oldAttached.splice(oldAttached.findIndex(attach => attach.FileName === deletedFile.FileName && attach.CreateDate === deletedFile.CreateDate), 1);
|
|
384
441
|
}
|
|
442
|
+
|
|
385
443
|
removedAttachedRef.current.push(deletedFile);
|
|
386
444
|
recentRemovedAttached.push(deletedFile);
|
|
387
445
|
parent.remove();
|
|
388
446
|
});
|
|
447
|
+
|
|
389
448
|
if (attached.length < 2) {
|
|
390
449
|
afterChangeFile(attached.length);
|
|
391
450
|
}
|
|
451
|
+
|
|
392
452
|
stripDomain();
|
|
393
453
|
if (onChange) onChange({
|
|
394
454
|
element: nodeList,
|
|
@@ -401,25 +461,30 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
401
461
|
!!onRemoveProp && onRemoveProp(recentRemovedAttached);
|
|
402
462
|
onClosePopup();
|
|
403
463
|
};
|
|
464
|
+
|
|
404
465
|
const clearAllAttached = (confirmPopup = false) => {
|
|
405
466
|
const allAttachEl = attachedRef.current.querySelectorAll('.attachment-row');
|
|
467
|
+
|
|
406
468
|
if (allAttachEl && allAttachEl.length) {
|
|
407
469
|
allAttachEl.forEach(attachEl => attachEl.firstChild.classList.add('chosen'));
|
|
408
470
|
isDeleteAll.current = true;
|
|
409
471
|
confirmPopup ? onShowPopup() : onRemoveMultiple();
|
|
410
472
|
}
|
|
411
473
|
};
|
|
474
|
+
|
|
412
475
|
const onGetViewItem = (i = 0) => {
|
|
413
476
|
const index = chosenItems[i];
|
|
414
477
|
const node = attachedRef.current.childNodes[index];
|
|
415
478
|
const AttachmentID = attached[index].AttachmentID;
|
|
416
479
|
onView(node, AttachmentID);
|
|
417
480
|
};
|
|
481
|
+
|
|
418
482
|
const onView = (node, AttachmentID) => {
|
|
419
483
|
if (timer.current) {
|
|
420
484
|
prevent.current = true;
|
|
421
485
|
clearTimeout(timer.current);
|
|
422
486
|
}
|
|
487
|
+
|
|
423
488
|
const index = Array.from(attachedRef.current.children).indexOf(node);
|
|
424
489
|
if (onViewProp) onViewProp(AttachmentID, index);else {
|
|
425
490
|
setShowModal(true);
|
|
@@ -428,14 +493,15 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
428
493
|
prevent.current = false;
|
|
429
494
|
}, 110);
|
|
430
495
|
};
|
|
496
|
+
|
|
431
497
|
const onDownload = (url, name) => {
|
|
432
498
|
if (!url) return;
|
|
433
499
|
fetch(url).then(resp => resp.blob()).then(blob => {
|
|
434
500
|
const url = window.URL.createObjectURL(blob);
|
|
435
501
|
const a = document.createElement('a');
|
|
436
502
|
a.style.display = 'none';
|
|
437
|
-
a.href = url;
|
|
438
|
-
|
|
503
|
+
a.href = url; // the filename you want
|
|
504
|
+
|
|
439
505
|
a.download = name;
|
|
440
506
|
document.body.appendChild(a);
|
|
441
507
|
a.click();
|
|
@@ -443,13 +509,16 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
443
509
|
}).catch(() => alert('File not found'));
|
|
444
510
|
if (onDownloadProp) onDownloadProp(url);
|
|
445
511
|
};
|
|
512
|
+
|
|
446
513
|
const removeFileOutInputFiles = (index, keeping) => {
|
|
447
514
|
const dt = new DataTransfer();
|
|
515
|
+
|
|
448
516
|
for (let file of attachmentInputRef.current.files) {
|
|
449
517
|
if (file !== attachmentInputRef.current.files[index]) {
|
|
450
518
|
dt.items.add(file);
|
|
451
519
|
}
|
|
452
520
|
}
|
|
521
|
+
|
|
453
522
|
if (!keeping) {
|
|
454
523
|
const files = allNewAttached.getAll('files');
|
|
455
524
|
files.splice(index, 1);
|
|
@@ -457,9 +526,11 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
457
526
|
files.forEach(file => allNewAttached.append('files', file));
|
|
458
527
|
newAttachedRef.current = files || [];
|
|
459
528
|
}
|
|
529
|
+
|
|
460
530
|
attachmentInputRef.current.files = dt.files;
|
|
461
531
|
return dt.files;
|
|
462
532
|
};
|
|
533
|
+
|
|
463
534
|
const insertAttached = files => {
|
|
464
535
|
if (multiple || inputProps && inputProps.multiple) {
|
|
465
536
|
for (let file of files) {
|
|
@@ -470,30 +541,37 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
470
541
|
allNewAttached.delete('files');
|
|
471
542
|
allNewAttached.append('files', files[0]);
|
|
472
543
|
newAttachedRef.current = [files[0]];
|
|
473
|
-
}
|
|
474
|
-
|
|
544
|
+
} // attachmentInputRef.current.files = allNewAttached.getAll('files');
|
|
545
|
+
|
|
475
546
|
};
|
|
476
547
|
|
|
477
548
|
const checkExistingFile = newFile => {
|
|
478
549
|
const files = allNewAttached.getAll('files');
|
|
550
|
+
|
|
479
551
|
if (files && files.length) {
|
|
480
552
|
const length = files.length;
|
|
553
|
+
|
|
481
554
|
for (let i = 0; i < length; i++) {
|
|
482
555
|
if (parseStringify(newFile) === parseStringify(files[i])) return true;
|
|
483
556
|
}
|
|
484
557
|
}
|
|
558
|
+
|
|
485
559
|
return false;
|
|
486
560
|
};
|
|
561
|
+
|
|
487
562
|
const checkAcceptFileType = newFile => {
|
|
488
563
|
if (!accept || !accept.length) return true;
|
|
489
564
|
const type = typeof accept === 'string' ? accept : accept.join('-');
|
|
565
|
+
|
|
490
566
|
if (typeof accept === 'string') {
|
|
491
567
|
const acceptType = type.replace('/*', '');
|
|
492
568
|
return newFile.type.includes(acceptType);
|
|
493
569
|
}
|
|
570
|
+
|
|
494
571
|
const extFile = newFile.name.slice(newFile.name.lastIndexOf('.') + 1);
|
|
495
572
|
return accept.join('-').includes(extFile);
|
|
496
573
|
};
|
|
574
|
+
|
|
497
575
|
const onChooseItem = e => {
|
|
498
576
|
const ctrlKey = e.ctrlKey;
|
|
499
577
|
const shiftKey = e.shiftKey;
|
|
@@ -501,24 +579,29 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
501
579
|
timer.current = setTimeout(() => {
|
|
502
580
|
if (!prevent.current) {
|
|
503
581
|
const index = Array.from(attachedRef.current.children).indexOf(itemEl.parentNode);
|
|
582
|
+
|
|
504
583
|
if (shiftKey && !ctrlKey) {
|
|
505
584
|
let startIndex = chosenItems[chosenItems.length - 1] || 0;
|
|
506
585
|
let endIndex = index;
|
|
586
|
+
|
|
507
587
|
if (startIndex > endIndex) {
|
|
508
588
|
endIndex = startIndex;
|
|
509
589
|
startIndex = index;
|
|
510
590
|
}
|
|
591
|
+
|
|
511
592
|
chosenItems.length = 0;
|
|
512
593
|
attachedRef.current.querySelectorAll(`.css-${AttachedItemCSS.name}`).forEach((itemEl, indexEl) => {
|
|
513
594
|
if (startIndex <= indexEl && indexEl <= endIndex) {
|
|
514
595
|
if (!itemEl.classList.contains('chosen')) {
|
|
515
596
|
itemEl.classList.add('chosen');
|
|
516
597
|
}
|
|
598
|
+
|
|
517
599
|
chosenItems.push(indexEl);
|
|
518
600
|
} else if (itemEl.classList.contains('chosen')) {
|
|
519
601
|
itemEl.classList.remove('chosen');
|
|
520
602
|
}
|
|
521
603
|
});
|
|
604
|
+
|
|
522
605
|
if (chosenItems[chosenItems.length - 1] !== index) {
|
|
523
606
|
chosenItems.shift();
|
|
524
607
|
chosenItems.push(index);
|
|
@@ -531,6 +614,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
531
614
|
} else if (itemEl.classList.contains('chosen')) {
|
|
532
615
|
chosenItems.splice(chosenItems.indexOf(index));
|
|
533
616
|
itemEl.classList.remove('chosen');
|
|
617
|
+
|
|
534
618
|
if (!chosenItems.length) {
|
|
535
619
|
setTimeout(() => {
|
|
536
620
|
removeAllChosenItems();
|
|
@@ -539,26 +623,32 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
539
623
|
} else {
|
|
540
624
|
chosenItems.push(index);
|
|
541
625
|
itemEl.classList.add('chosen');
|
|
542
|
-
}
|
|
543
|
-
|
|
626
|
+
} // Add event listener click out of item
|
|
627
|
+
|
|
628
|
+
|
|
544
629
|
if (!existClickOutOfItem.current) {
|
|
545
630
|
existClickOutOfItem.current = true;
|
|
546
631
|
attachmentHandleIconRef.current.style.display = 'block';
|
|
547
632
|
document.addEventListener('keydown', onKeyDown);
|
|
548
633
|
document.addEventListener('click', clickOutOfItem);
|
|
549
634
|
}
|
|
635
|
+
|
|
550
636
|
checkChosenMultiple();
|
|
551
637
|
}
|
|
638
|
+
|
|
552
639
|
prevent.current = false;
|
|
553
640
|
}, 100);
|
|
554
641
|
};
|
|
642
|
+
|
|
555
643
|
const removeActiveChosenItem = () => {
|
|
556
644
|
attachedRef.current.querySelectorAll('.chosen').forEach(itemEl => {
|
|
557
645
|
itemEl.classList.remove('chosen');
|
|
558
646
|
});
|
|
559
647
|
};
|
|
648
|
+
|
|
560
649
|
const checkChosenMultiple = () => {
|
|
561
650
|
const actionIcons = attachmentHandleIconRef.current.childNodes;
|
|
651
|
+
|
|
562
652
|
if (chosenItems.length > 1 && actionIcons[0].style.display !== 'none') {
|
|
563
653
|
actionIcons[0].style.display = 'none';
|
|
564
654
|
actionIcons[1].style.display = 'none';
|
|
@@ -567,8 +657,10 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
567
657
|
actionIcons[1].style.display = null;
|
|
568
658
|
}
|
|
569
659
|
};
|
|
660
|
+
|
|
570
661
|
const onKeyDown = event => {
|
|
571
662
|
const key = event.key;
|
|
663
|
+
|
|
572
664
|
if (key === 'Delete') {
|
|
573
665
|
// Press Delete key to delete item(s)
|
|
574
666
|
onShowPopup();
|
|
@@ -579,9 +671,11 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
579
671
|
} else if (/a/i.test(key) && event.ctrlKey) {
|
|
580
672
|
chosenItems.length = 0;
|
|
581
673
|
const allAttachEl = attachedRef.current.querySelectorAll('.attachment-row');
|
|
674
|
+
|
|
582
675
|
if (allAttachEl && allAttachEl.length) {
|
|
583
676
|
allAttachEl.forEach((attachEl, index) => chosenItems.push(index) & attachEl.firstChild.classList.add('chosen'));
|
|
584
677
|
}
|
|
678
|
+
|
|
585
679
|
event.preventDefault();
|
|
586
680
|
return false;
|
|
587
681
|
} else if (/Arrow/.test(key)) {
|
|
@@ -591,6 +685,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
591
685
|
const chosenItemsNode = Array.from(itemsNode).filter(el => el.firstChild.classList.contains('chosen'));
|
|
592
686
|
const length = itemsNode.length;
|
|
593
687
|
let index;
|
|
688
|
+
|
|
594
689
|
if (key === 'ArrowDown' || key === 'ArrowRight') {
|
|
595
690
|
for (let id = length - 1; id >= 0; id--) {
|
|
596
691
|
if (Array.from(itemsNode)[id].firstChild.classList.contains('chosen')) {
|
|
@@ -598,6 +693,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
598
693
|
break;
|
|
599
694
|
}
|
|
600
695
|
}
|
|
696
|
+
|
|
601
697
|
if (index === length - 1) {
|
|
602
698
|
if (chosenItemsNode.length !== 1 && !event.shiftKey) {
|
|
603
699
|
chosenItemsNode.forEach((node, i) => {
|
|
@@ -612,21 +708,26 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
612
708
|
behavior: 'smooth'
|
|
613
709
|
});
|
|
614
710
|
}
|
|
711
|
+
|
|
615
712
|
return;
|
|
616
713
|
}
|
|
714
|
+
|
|
617
715
|
Array.from(itemsNode)[index + 1].scrollIntoView({
|
|
618
716
|
block: 'center',
|
|
619
717
|
behavior: 'smooth'
|
|
620
718
|
});
|
|
719
|
+
|
|
621
720
|
if (!event.shiftKey) {
|
|
622
721
|
itemsNode.forEach(node => {
|
|
623
722
|
node.firstChild.classList.remove('chosen');
|
|
624
723
|
});
|
|
625
724
|
}
|
|
725
|
+
|
|
626
726
|
itemsNode[index + 1].firstChild.classList.add('chosen');
|
|
627
727
|
chosenItems.push(index + 1);
|
|
628
728
|
} else if (key === 'ArrowUp' || key === 'ArrowLeft') {
|
|
629
729
|
index = Array.from(itemsNode).findIndex(el => el.firstChild.classList.contains('chosen'));
|
|
730
|
+
|
|
630
731
|
if (index === 0) {
|
|
631
732
|
if (chosenItemsNode.length !== 1 && !event.shiftKey) {
|
|
632
733
|
chosenItemsNode.forEach((node, i) => {
|
|
@@ -641,37 +742,46 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
641
742
|
behavior: 'smooth'
|
|
642
743
|
});
|
|
643
744
|
}
|
|
745
|
+
|
|
644
746
|
return;
|
|
645
747
|
}
|
|
748
|
+
|
|
646
749
|
Array.from(itemsNode)[index - 1].scrollIntoView({
|
|
647
750
|
block: 'center',
|
|
648
751
|
behavior: 'smooth'
|
|
649
752
|
});
|
|
753
|
+
|
|
650
754
|
if (!event.shiftKey) {
|
|
651
755
|
chosenItemsNode.forEach(node => {
|
|
652
756
|
node.firstChild.classList.remove('chosen');
|
|
653
757
|
});
|
|
654
758
|
}
|
|
759
|
+
|
|
655
760
|
itemsNode[index - 1].firstChild.classList.add('chosen');
|
|
656
761
|
chosenItems.push(index - 1);
|
|
657
762
|
}
|
|
763
|
+
|
|
658
764
|
if (!event.shiftKey) {
|
|
659
765
|
chosenItems.length = 1;
|
|
660
766
|
}
|
|
661
767
|
}
|
|
662
768
|
};
|
|
769
|
+
|
|
663
770
|
const clickOutOfItem = e => {
|
|
664
771
|
var _popupRef$current, _popupRef$current$sty;
|
|
772
|
+
|
|
665
773
|
if (!attachedRef || !attachedRef.current) {
|
|
666
774
|
document.removeEventListener('keydown', onKeyDown);
|
|
667
775
|
document.removeEventListener('click', clickOutOfItem);
|
|
668
776
|
return;
|
|
669
777
|
}
|
|
778
|
+
|
|
670
779
|
if (!(attachedRef.current.contains(e.target) && attachedRef.current !== e.target) && !attachmentHandleIconRef.current.contains(e.target) && !isDeleteAll.current && (((_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 ? void 0 : (_popupRef$current$sty = _popupRef$current.style) === null || _popupRef$current$sty === void 0 ? void 0 : _popupRef$current$sty.display) !== 'flex' || popupRef.current.querySelector('button.filled.info').contains(e.target))) {
|
|
671
780
|
removeAllChosenItems();
|
|
672
781
|
removeActiveChosenItem();
|
|
673
782
|
}
|
|
674
783
|
};
|
|
784
|
+
|
|
675
785
|
const removeAllChosenItems = () => {
|
|
676
786
|
chosenItems.length = 0;
|
|
677
787
|
existClickOutOfItem.current = false;
|
|
@@ -679,6 +789,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
679
789
|
document.removeEventListener('keydown', onKeyDown);
|
|
680
790
|
document.removeEventListener('click', clickOutOfItem);
|
|
681
791
|
};
|
|
792
|
+
|
|
682
793
|
const parseStringify = fileInfo => JSON.stringify({
|
|
683
794
|
lastModified: fileInfo.lastModified,
|
|
684
795
|
lastModifiedDate: fileInfo.lastModifiedDate,
|
|
@@ -687,36 +798,45 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
687
798
|
type: fileInfo.type,
|
|
688
799
|
webkitRelativePath: fileInfo.webkitRelativePath
|
|
689
800
|
});
|
|
801
|
+
|
|
690
802
|
const mountDomain = item => {
|
|
691
803
|
if (!item) return item;
|
|
692
804
|
const cloneItem = JSON.parse(JSON.stringify(item));
|
|
805
|
+
|
|
693
806
|
if (domain) {
|
|
694
807
|
if (!/\/$/.test(domain)) {
|
|
695
808
|
domain = domain + '/';
|
|
696
809
|
}
|
|
810
|
+
|
|
697
811
|
if (cloneItem !== null && cloneItem !== void 0 && cloneItem.URL) {
|
|
698
812
|
cloneItem.URL = cloneItem.URL.indexOf('http') < 0 ? domain + cloneItem.URL : cloneItem.URL;
|
|
699
813
|
}
|
|
700
814
|
}
|
|
815
|
+
|
|
701
816
|
return cloneItem;
|
|
702
817
|
};
|
|
818
|
+
|
|
703
819
|
const stripDomain = () => {
|
|
704
820
|
if (isStripDomain && domain) {
|
|
705
821
|
const re = new RegExp(domain + '/?');
|
|
706
822
|
attached.forEach(item => {
|
|
707
823
|
var _item$URL;
|
|
824
|
+
|
|
708
825
|
item.URL = (item === null || item === void 0 ? void 0 : (_item$URL = item.URL) === null || _item$URL === void 0 ? void 0 : _item$URL.replace(re, '')) || '';
|
|
709
826
|
});
|
|
710
827
|
oldAttached.forEach(item => {
|
|
711
828
|
var _item$URL2;
|
|
829
|
+
|
|
712
830
|
item.URL = (item === null || item === void 0 ? void 0 : (_item$URL2 = item.URL) === null || _item$URL2 === void 0 ? void 0 : _item$URL2.replace(re, '')) || '';
|
|
713
831
|
});
|
|
714
832
|
}
|
|
715
833
|
};
|
|
834
|
+
|
|
716
835
|
useEffect(() => {
|
|
717
836
|
if (attached.length) {
|
|
718
837
|
attached.length = 0;
|
|
719
838
|
}
|
|
839
|
+
|
|
720
840
|
return () => {
|
|
721
841
|
existClickOutOfItem.current = false;
|
|
722
842
|
};
|
|
@@ -734,21 +854,27 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
734
854
|
maxSize.current = getBit(numberSize, unitMaxSize);
|
|
735
855
|
}
|
|
736
856
|
}
|
|
857
|
+
|
|
737
858
|
attachmentInputRef.current.multiple = multiple;
|
|
859
|
+
|
|
738
860
|
if (accept && typeof accept === 'string') {
|
|
739
861
|
attachmentInputRef.current.accept = `${accept}/*`.replace('/*/*', '/*');
|
|
740
862
|
}
|
|
863
|
+
|
|
741
864
|
return () => {
|
|
742
865
|
maxSize.current = Infinity;
|
|
743
866
|
};
|
|
744
867
|
}, [maxFile, maxSizeProp, multiple, accept]);
|
|
745
868
|
useEffect(() => {
|
|
746
869
|
var _newAttachedRef$curre;
|
|
870
|
+
|
|
747
871
|
oldAttached.length = 0;
|
|
748
872
|
afterChangeFile(((data === null || data === void 0 ? void 0 : data.length) || 0) + (((_newAttachedRef$curre = newAttachedRef.current) === null || _newAttachedRef$curre === void 0 ? void 0 : _newAttachedRef$curre.length) || 0));
|
|
873
|
+
|
|
749
874
|
if (data) {
|
|
750
875
|
// Load files data was uploaded
|
|
751
876
|
const length = data.length;
|
|
877
|
+
|
|
752
878
|
for (let i = 0; i < length; i++) {
|
|
753
879
|
if (Object.prototype.toString.call(data[i]) === '[object File]') {
|
|
754
880
|
allNewAttached.append('files', data[i]);
|
|
@@ -761,6 +887,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
761
887
|
}
|
|
762
888
|
}
|
|
763
889
|
}
|
|
890
|
+
|
|
764
891
|
return () => {
|
|
765
892
|
// if (attachedRef.current) {
|
|
766
893
|
// attachedRef.current.innerHTML = null;
|
|
@@ -770,6 +897,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
770
897
|
attached.length = 0;
|
|
771
898
|
chosenItems.length = 0;
|
|
772
899
|
allNewAttached.delete('files');
|
|
900
|
+
|
|
773
901
|
if (attachmentInputRef.current) {
|
|
774
902
|
attachmentInputRef.current.value = '';
|
|
775
903
|
}
|
|
@@ -797,16 +925,19 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
797
925
|
};
|
|
798
926
|
}
|
|
799
927
|
}, [inputProps]);
|
|
928
|
+
|
|
800
929
|
const triggerClickInput = () => {
|
|
801
930
|
attachmentInputRef.current.click();
|
|
802
931
|
};
|
|
932
|
+
|
|
803
933
|
const onDragFileStart = () => {
|
|
804
934
|
attachmentInputRef.current.parentNode.style.display = 'block';
|
|
805
935
|
};
|
|
936
|
+
|
|
806
937
|
const onDropInput = () => {
|
|
807
938
|
attachmentInputRef.current.parentNode.style.display = null;
|
|
808
|
-
};
|
|
809
|
-
|
|
939
|
+
}; // End handler
|
|
940
|
+
|
|
810
941
|
|
|
811
942
|
useImperativeHandle(reference, () => {
|
|
812
943
|
stripDomain();
|
|
@@ -819,17 +950,20 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
819
950
|
clear: confirmPopup => clearAllAttached(confirmPopup),
|
|
820
951
|
openFileDialog: triggerClickInput
|
|
821
952
|
}; // methods
|
|
953
|
+
|
|
822
954
|
_instance.__proto__ = {}; // hidden methods
|
|
955
|
+
|
|
823
956
|
currentRef.instance = _instance;
|
|
824
957
|
currentRef.oldAttached = oldAttached;
|
|
825
958
|
currentRef.allNewAttached = allNewAttached;
|
|
826
959
|
currentRef.attached = attached;
|
|
960
|
+
|
|
827
961
|
currentRef.clear = confirmPopup => clearAllAttached(confirmPopup);
|
|
962
|
+
|
|
828
963
|
currentRef.openFileDialog = triggerClickInput;
|
|
829
964
|
return currentRef;
|
|
830
|
-
});
|
|
965
|
+
}); // Start view
|
|
831
966
|
|
|
832
|
-
// Start view
|
|
833
967
|
const AttachHeaderView = useMemo(() => {
|
|
834
968
|
return jsx("div", {
|
|
835
969
|
css: AttachmentHeaderCSS,
|
|
@@ -932,6 +1066,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
932
1066
|
...inputProps
|
|
933
1067
|
}));
|
|
934
1068
|
}, [accept, disabled, domain, inputProps, isStripDomain, maxFile, multiple, onChange, readOnly, uploadErrorInfo, newDataState]);
|
|
1069
|
+
|
|
935
1070
|
const renderAttachmentItem = (item, idx, isNew = false) => {
|
|
936
1071
|
const isViewTypeIcon = viewTypeState === 'icon';
|
|
937
1072
|
const date = isNew ? new Date() : new Date(item.CreateDate);
|
|
@@ -985,6 +1120,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
985
1120
|
percent: 0
|
|
986
1121
|
})) : null)));
|
|
987
1122
|
};
|
|
1123
|
+
|
|
988
1124
|
const AttachedView = useMemo(() => {
|
|
989
1125
|
const isViewTypeIcon = viewTypeState === 'icon';
|
|
990
1126
|
return jsx(ScrollBar, {
|
|
@@ -1015,8 +1151,8 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1015
1151
|
const ModalView = useMemo(() => {
|
|
1016
1152
|
if (!chosenItems.length) return setShowModal(false);
|
|
1017
1153
|
const index = chosenItems[0];
|
|
1018
|
-
const data = mountDomain(attached[index]);
|
|
1019
|
-
|
|
1154
|
+
const data = mountDomain(attached[index]); // let data = oldAttached[index] || allNewAttached.getAll('files')[index-oldAttached.length];
|
|
1155
|
+
|
|
1020
1156
|
return jsx(ModalSample, {
|
|
1021
1157
|
open: showModal,
|
|
1022
1158
|
title: data.FileName,
|
|
@@ -1024,8 +1160,7 @@ const Attachment = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
1024
1160
|
}, jsx(Slider, null, jsx(SliderItem, {
|
|
1025
1161
|
url: data.URL
|
|
1026
1162
|
})));
|
|
1027
|
-
}, [domain, showModal]);
|
|
1028
|
-
// End view
|
|
1163
|
+
}, [domain, showModal]); // End view
|
|
1029
1164
|
|
|
1030
1165
|
return jsx("div", {
|
|
1031
1166
|
ref: ref,
|
|
@@ -1244,6 +1379,7 @@ const AttachmentListCSS = css`
|
|
|
1244
1379
|
${pd([0, 1.75, 0])};
|
|
1245
1380
|
overflow-y: overlay;
|
|
1246
1381
|
`;
|
|
1382
|
+
|
|
1247
1383
|
const AttachmentRootCSS = (isEmpty, isEnable) => css`
|
|
1248
1384
|
${displayFlex};
|
|
1249
1385
|
${flexCol};
|
|
@@ -1285,6 +1421,7 @@ const AttachmentRootCSS = (isEmpty, isEnable) => css`
|
|
|
1285
1421
|
}
|
|
1286
1422
|
}
|
|
1287
1423
|
`;
|
|
1424
|
+
|
|
1288
1425
|
Attachment.defaultProps = {
|
|
1289
1426
|
allowSort: true,
|
|
1290
1427
|
className: '',
|
|
@@ -1306,73 +1443,97 @@ Attachment.defaultProps = {
|
|
|
1306
1443
|
Attachment.propTypes = {
|
|
1307
1444
|
/** File types that can be accepted. */
|
|
1308
1445
|
accept: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
1446
|
+
|
|
1309
1447
|
/** If `true`, allow sort. */
|
|
1310
1448
|
allowSort: PropTypes.bool,
|
|
1449
|
+
|
|
1311
1450
|
/** Class for component. */
|
|
1312
1451
|
className: PropTypes.string,
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
*
|
|
1316
|
-
* "
|
|
1317
|
-
* "
|
|
1318
|
-
* "
|
|
1319
|
-
* "
|
|
1320
|
-
* "
|
|
1321
|
-
* "
|
|
1322
|
-
* "
|
|
1323
|
-
*
|
|
1452
|
+
|
|
1453
|
+
/** List attachment:<br />
|
|
1454
|
+
* [{<br />
|
|
1455
|
+
* "AttachmentID": "ATT2U8O7YPTF1KSNCW3X",<br />
|
|
1456
|
+
* "URL": "https://apricot.diginet.com.vn/cdn-dev/file/8a07bee1eeff17a14eee.jpg?path=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlUGF0aCI6Ii8yMDIwLzA4LzQ0YjNhYjQ4LTMwNGQtNDQ3NC05ZDk0LWNkNGVlMDQwOGNlMy5qcGciLCJmaWxlTmFtZSI6IjhhMDdiZWUxZWVmZjE3YTE0ZWVlLmpwZyIsImZpbGVTaXplIjoyNDg4MzcsImZpbGVUeXBlIjoiaW1hZ2UvanBlZyIsImlhdCI6MTU5ODI0NDMwMiwiZXhwIjo4Nzk5ODI0NDMwMn0.fow6O5fp2z3vieA9gom5RRwQ7xxwBx9_7X2Fe8T2YI0",<br />
|
|
1457
|
+
* "FileName": "8a07bee1eeff17a14eee.jpg",<br />
|
|
1458
|
+
* "FileSize": 248837,<br />
|
|
1459
|
+
* "KeyID": "W39OAD3YGLCWAQKV1D6PGEKNW4RLGVTZTUWLYEVFQ2QG8AOCXW",<br />
|
|
1460
|
+
* "CreateUserID": "LEMONADMIN",<br />
|
|
1461
|
+
* "CreateDate": "2020-08-24T11:54:04.307Z",<br />
|
|
1462
|
+
* "UserName": "Quản trị hệ thống"<br />
|
|
1463
|
+
* }, ...]
|
|
1324
1464
|
*/
|
|
1325
1465
|
data: PropTypes.array,
|
|
1466
|
+
|
|
1326
1467
|
/** The message to display when deleting files. */
|
|
1327
1468
|
deleteNotifyText: PropTypes.string,
|
|
1469
|
+
|
|
1328
1470
|
/** If `true`, the component is disabled. */
|
|
1329
1471
|
disabled: PropTypes.bool,
|
|
1472
|
+
|
|
1330
1473
|
/** Domain of attachments. */
|
|
1331
1474
|
domain: PropTypes.string,
|
|
1475
|
+
|
|
1332
1476
|
/** Error of attachment. */
|
|
1333
1477
|
error: PropTypes.string,
|
|
1478
|
+
|
|
1334
1479
|
/** Suggested passage attached. */
|
|
1335
1480
|
hintText: PropTypes.string,
|
|
1481
|
+
|
|
1336
1482
|
/** [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attributes) applied to the input element. */
|
|
1337
1483
|
inputProps: PropTypes.object,
|
|
1484
|
+
|
|
1338
1485
|
/** If `true`, strip domain of attachments. */
|
|
1339
1486
|
isStripDomain: PropTypes.bool,
|
|
1487
|
+
|
|
1340
1488
|
/** Label of the component. */
|
|
1341
1489
|
label: PropTypes.string,
|
|
1490
|
+
|
|
1342
1491
|
/** Limit the number of uploaded files. */
|
|
1343
1492
|
maxFile: PropTypes.number,
|
|
1493
|
+
|
|
1344
1494
|
/** Limit the size of uploaded files. */
|
|
1345
1495
|
maxSize: PropTypes.string,
|
|
1496
|
+
|
|
1346
1497
|
/** Allows to attach multiple files. */
|
|
1347
1498
|
multiple: PropTypes.bool,
|
|
1499
|
+
|
|
1348
1500
|
/** Callback fired when the files attached is changed. */
|
|
1349
1501
|
onChange: PropTypes.func,
|
|
1502
|
+
|
|
1350
1503
|
/** Download attached event, if not it will use default. */
|
|
1351
1504
|
onDownload: PropTypes.func,
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
*
|
|
1361
|
-
*
|
|
1505
|
+
|
|
1506
|
+
/**
|
|
1507
|
+
* event when removed file(s)
|
|
1508
|
+
*
|
|
1509
|
+
* return data: {<br/>
|
|
1510
|
+
* attached: [Files] (insist old and all new files )<br/>
|
|
1511
|
+
* allNewAttached: [Files]<br/>
|
|
1512
|
+
* oldAttached: [Files]<br/>
|
|
1513
|
+
* removedAttached: [Files]<br/>
|
|
1514
|
+
* element: [NodeList (just removed)]<br/>
|
|
1515
|
+
* }
|
|
1362
1516
|
*/
|
|
1363
1517
|
onRemove: PropTypes.func,
|
|
1518
|
+
|
|
1364
1519
|
/** View attached event, if not it will use default. */
|
|
1365
1520
|
onView: PropTypes.func,
|
|
1521
|
+
|
|
1366
1522
|
/** Name of the person who attached the file when uploading the file. */
|
|
1367
1523
|
ownerName: PropTypes.string,
|
|
1524
|
+
|
|
1368
1525
|
/** At least one attachment is required. */
|
|
1369
1526
|
required: PropTypes.bool,
|
|
1527
|
+
|
|
1370
1528
|
/** Style inline of component. */
|
|
1371
1529
|
style: PropTypes.object,
|
|
1530
|
+
|
|
1372
1531
|
/** Unit size name, default auto-detect. */
|
|
1373
1532
|
unitSize: PropTypes.string,
|
|
1533
|
+
|
|
1374
1534
|
/** Errors show up when the file upload is corrupted. */
|
|
1375
1535
|
uploadErrorInfo: PropTypes.object,
|
|
1536
|
+
|
|
1376
1537
|
/** The view type of files. */
|
|
1377
1538
|
viewType: PropTypes.oneOf(['detail', 'icon'])
|
|
1378
1539
|
};
|