@wavemaker-ai/app-ng-runtime 12.0.2-rc.647771 → 12.1.0-rc.647821
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/build-task/bundles/index.umd.js +2489 -2963
- package/build-task/fesm2022/index.mjs +2307 -2786
- package/build-task/fesm2022/index.mjs.map +1 -1
- package/build-task/types/index.d.ts +401 -844
- package/components/advanced/carousel/bundles/index.umd.js +387 -344
- package/components/advanced/carousel/fesm2022/index.mjs +363 -325
- package/components/advanced/carousel/fesm2022/index.mjs.map +1 -1
- package/components/advanced/carousel/types/index.d.ts +85 -86
- package/components/advanced/custom/bundles/index.umd.js +298 -249
- package/components/advanced/custom/fesm2022/index.mjs +280 -236
- package/components/advanced/custom/fesm2022/index.mjs.map +1 -1
- package/components/advanced/custom/types/index.d.ts +49 -49
- package/components/advanced/login/bundles/index.umd.js +177 -127
- package/components/advanced/login/fesm2022/index.mjs +162 -117
- package/components/advanced/login/fesm2022/index.mjs.map +1 -1
- package/components/advanced/login/types/index.d.ts +33 -34
- package/components/advanced/marquee/bundles/index.umd.js +93 -63
- package/components/advanced/marquee/fesm2022/index.mjs +73 -48
- package/components/advanced/marquee/fesm2022/index.mjs.map +1 -1
- package/components/advanced/marquee/types/index.d.ts +11 -12
- package/components/base/bundles/index.umd.js +5515 -6359
- package/components/base/fesm2022/index.mjs +5169 -6027
- package/components/base/fesm2022/index.mjs.map +1 -1
- package/components/base/types/index.d.ts +1198 -1154
- package/components/basic/anchor/bundles/index.umd.js +273 -195
- package/components/basic/anchor/fesm2022/index.mjs +251 -178
- package/components/basic/anchor/fesm2022/index.mjs.map +1 -1
- package/components/basic/anchor/types/index.d.ts +40 -41
- package/components/basic/audio/bundles/index.umd.js +124 -75
- package/components/basic/audio/fesm2022/index.mjs +104 -60
- package/components/basic/audio/fesm2022/index.mjs.map +1 -1
- package/components/basic/audio/types/index.d.ts +22 -23
- package/components/basic/html/bundles/index.umd.js +144 -113
- package/components/basic/html/fesm2022/index.mjs +125 -99
- package/components/basic/html/fesm2022/index.mjs.map +1 -1
- package/components/basic/html/types/index.d.ts +20 -17
- package/components/basic/icon/bundles/index.umd.js +144 -72
- package/components/basic/icon/fesm2022/index.mjs +124 -57
- package/components/basic/icon/fesm2022/index.mjs.map +1 -1
- package/components/basic/icon/types/index.d.ts +18 -19
- package/components/basic/iframe/bundles/index.umd.js +143 -93
- package/components/basic/iframe/fesm2022/index.mjs +124 -79
- package/components/basic/iframe/fesm2022/index.mjs.map +1 -1
- package/components/basic/iframe/types/index.d.ts +28 -29
- package/components/basic/label/bundles/index.umd.js +136 -120
- package/components/basic/label/fesm2022/index.mjs +118 -107
- package/components/basic/label/fesm2022/index.mjs.map +1 -1
- package/components/basic/label/types/index.d.ts +14 -15
- package/components/basic/picture/bundles/index.umd.js +171 -130
- package/components/basic/picture/fesm2022/index.mjs +152 -116
- package/components/basic/picture/fesm2022/index.mjs.map +1 -1
- package/components/basic/picture/types/index.d.ts +21 -22
- package/components/basic/progress/progress-bar/bundles/index.umd.js +211 -160
- package/components/basic/progress/progress-bar/fesm2022/index.mjs +193 -147
- package/components/basic/progress/progress-bar/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-bar/types/index.d.ts +45 -41
- package/components/basic/progress/progress-circle/bundles/index.umd.js +294 -165
- package/components/basic/progress/progress-circle/fesm2022/index.mjs +274 -150
- package/components/basic/progress/progress-circle/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-circle/types/index.d.ts +41 -42
- package/components/basic/progress/progress-utils/bundles/index.umd.js +27 -29
- package/components/basic/progress/progress-utils/fesm2022/index.mjs +18 -25
- package/components/basic/progress/progress-utils/fesm2022/index.mjs.map +1 -1
- package/components/basic/progress/progress-utils/types/index.d.ts +3 -5
- package/components/basic/rich-text-editor/bundles/index.umd.js +294 -228
- package/components/basic/rich-text-editor/fesm2022/index.mjs +275 -214
- package/components/basic/rich-text-editor/fesm2022/index.mjs.map +1 -1
- package/components/basic/rich-text-editor/types/index.d.ts +55 -56
- package/components/basic/search/bundles/index.umd.js +1129 -1090
- package/components/basic/search/fesm2022/index.mjs +1117 -1083
- package/components/basic/search/fesm2022/index.mjs.map +1 -1
- package/components/basic/search/types/index.d.ts +132 -130
- package/components/basic/spinner/bundles/index.umd.js +216 -120
- package/components/basic/spinner/fesm2022/index.mjs +201 -110
- package/components/basic/spinner/fesm2022/index.mjs.map +1 -1
- package/components/basic/spinner/types/index.d.ts +30 -31
- package/components/basic/tree/bundles/index.umd.js +756 -756
- package/components/basic/tree/fesm2022/index.mjs +740 -745
- package/components/basic/tree/fesm2022/index.mjs.map +1 -1
- package/components/basic/tree/types/index.d.ts +106 -97
- package/components/basic/video/bundles/index.umd.js +164 -108
- package/components/basic/video/fesm2022/index.mjs +145 -94
- package/components/basic/video/fesm2022/index.mjs.map +1 -1
- package/components/basic/video/types/index.d.ts +29 -30
- package/components/chart/bundles/index.umd.js +1768 -1737
- package/components/chart/fesm2022/index.mjs +1713 -1728
- package/components/chart/fesm2022/index.mjs.map +1 -1
- package/components/chart/types/index.d.ts +102 -104
- package/components/containers/accordion/bundles/index.umd.js +522 -494
- package/components/containers/accordion/fesm2022/index.mjs +502 -479
- package/components/containers/accordion/fesm2022/index.mjs.map +1 -1
- package/components/containers/accordion/types/index.d.ts +116 -116
- package/components/containers/layout-grid/bundles/index.umd.js +260 -164
- package/components/containers/layout-grid/fesm2022/index.mjs +231 -140
- package/components/containers/layout-grid/fesm2022/index.mjs.map +1 -1
- package/components/containers/layout-grid/types/index.d.ts +30 -27
- package/components/containers/linear-layout/bundles/index.umd.js +220 -178
- package/components/containers/linear-layout/fesm2022/index.mjs +193 -156
- package/components/containers/linear-layout/fesm2022/index.mjs.map +1 -1
- package/components/containers/linear-layout/types/index.d.ts +26 -26
- package/components/containers/panel/bundles/index.umd.js +343 -215
- package/components/containers/panel/fesm2022/index.mjs +330 -207
- package/components/containers/panel/fesm2022/index.mjs.map +1 -1
- package/components/containers/panel/types/index.d.ts +48 -49
- package/components/containers/tabs/bundles/index.umd.js +832 -779
- package/components/containers/tabs/fesm2022/index.mjs +811 -763
- package/components/containers/tabs/fesm2022/index.mjs.map +1 -1
- package/components/containers/tabs/types/index.d.ts +134 -126
- package/components/containers/tile/bundles/index.umd.js +93 -60
- package/components/containers/tile/fesm2022/index.mjs +75 -47
- package/components/containers/tile/fesm2022/index.mjs.map +1 -1
- package/components/containers/tile/types/index.d.ts +11 -12
- package/components/containers/wizard/bundles/index.umd.js +1096 -1078
- package/components/containers/wizard/fesm2022/index.mjs +1069 -1056
- package/components/containers/wizard/fesm2022/index.mjs.map +1 -1
- package/components/containers/wizard/types/index.d.ts +258 -252
- package/components/data/card/bundles/index.umd.js +439 -229
- package/components/data/card/fesm2022/index.mjs +408 -203
- package/components/data/card/fesm2022/index.mjs.map +1 -1
- package/components/data/card/types/index.d.ts +50 -48
- package/components/data/form/bundles/index.umd.js +3392 -3339
- package/components/data/form/fesm2022/index.mjs +3350 -3304
- package/components/data/form/fesm2022/index.mjs.map +1 -1
- package/components/data/form/types/index.d.ts +561 -482
- package/components/data/list/bundles/index.umd.js +1523 -1601
- package/components/data/list/fesm2022/index.mjs +1507 -1590
- package/components/data/list/fesm2022/index.mjs.map +1 -1
- package/components/data/list/types/index.d.ts +300 -283
- package/components/data/live-table/bundles/index.umd.js +299 -280
- package/components/data/live-table/fesm2022/index.mjs +284 -270
- package/components/data/live-table/fesm2022/index.mjs.map +1 -1
- package/components/data/live-table/types/index.d.ts +42 -39
- package/components/data/pagination/bundles/index.umd.js +848 -881
- package/components/data/pagination/fesm2022/index.mjs +835 -879
- package/components/data/pagination/fesm2022/index.mjs.map +1 -1
- package/components/data/pagination/types/index.d.ts +110 -106
- package/components/data/table/bundles/index.umd.js +4977 -5042
- package/components/data/table/fesm2022/index.mjs +4937 -5007
- package/components/data/table/fesm2022/index.mjs.map +1 -1
- package/components/data/table/types/index.d.ts +770 -736
- package/components/dialogs/alert-dialog/bundles/index.umd.js +259 -118
- package/components/dialogs/alert-dialog/fesm2022/index.mjs +243 -109
- package/components/dialogs/alert-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/alert-dialog/types/index.d.ts +31 -26
- package/components/dialogs/confirm-dialog/bundles/index.umd.js +250 -121
- package/components/dialogs/confirm-dialog/fesm2022/index.mjs +236 -114
- package/components/dialogs/confirm-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/confirm-dialog/types/index.d.ts +34 -29
- package/components/dialogs/default/bundles/index.umd.js +509 -373
- package/components/dialogs/default/fesm2022/index.mjs +485 -354
- package/components/dialogs/default/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/default/types/index.d.ts +129 -86
- package/components/dialogs/design-dialog/bundles/index.umd.js +320 -142
- package/components/dialogs/design-dialog/fesm2022/index.mjs +305 -132
- package/components/dialogs/design-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/design-dialog/types/index.d.ts +31 -20
- package/components/dialogs/iframe-dialog/bundles/index.umd.js +258 -111
- package/components/dialogs/iframe-dialog/fesm2022/index.mjs +245 -105
- package/components/dialogs/iframe-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/iframe-dialog/types/index.d.ts +27 -22
- package/components/dialogs/login-dialog/bundles/index.umd.js +139 -106
- package/components/dialogs/login-dialog/fesm2022/index.mjs +125 -97
- package/components/dialogs/login-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/login-dialog/types/index.d.ts +27 -26
- package/components/dialogs/partial-dialog/bundles/index.umd.js +302 -149
- package/components/dialogs/partial-dialog/fesm2022/index.mjs +289 -143
- package/components/dialogs/partial-dialog/fesm2022/index.mjs.map +1 -1
- package/components/dialogs/partial-dialog/types/index.d.ts +37 -32
- package/components/input/base-form/bundles/index.umd.js +143 -139
- package/components/input/base-form/fesm2022/index.mjs +129 -130
- package/components/input/base-form/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form/types/index.d.ts +28 -29
- package/components/input/base-form-custom/bundles/index.umd.js +107 -121
- package/components/input/base-form-custom/fesm2022/index.mjs +88 -107
- package/components/input/base-form-custom/fesm2022/index.mjs.map +1 -1
- package/components/input/base-form-custom/types/index.d.ts +23 -26
- package/components/input/button/bundles/index.umd.js +177 -89
- package/components/input/button/fesm2022/index.mjs +158 -75
- package/components/input/button/fesm2022/index.mjs.map +1 -1
- package/components/input/button/types/index.d.ts +24 -25
- package/components/input/button-group/bundles/index.umd.js +110 -72
- package/components/input/button-group/fesm2022/index.mjs +90 -57
- package/components/input/button-group/fesm2022/index.mjs.map +1 -1
- package/components/input/button-group/types/index.d.ts +13 -14
- package/components/input/calendar/bundles/index.umd.js +615 -647
- package/components/input/calendar/fesm2022/index.mjs +596 -649
- package/components/input/calendar/fesm2022/index.mjs.map +1 -1
- package/components/input/calendar/types/index.d.ts +130 -131
- package/components/input/caption-position/bundles/index.umd.js +175 -188
- package/components/input/caption-position/fesm2022/index.mjs +159 -177
- package/components/input/caption-position/fesm2022/index.mjs.map +1 -1
- package/components/input/caption-position/types/index.d.ts +31 -34
- package/components/input/checkbox/bundles/index.umd.js +339 -200
- package/components/input/checkbox/fesm2022/index.mjs +319 -185
- package/components/input/checkbox/fesm2022/index.mjs.map +1 -1
- package/components/input/checkbox/types/index.d.ts +46 -41
- package/components/input/checkboxset/bundles/index.umd.js +256 -170
- package/components/input/checkboxset/fesm2022/index.mjs +242 -161
- package/components/input/checkboxset/fesm2022/index.mjs.map +1 -1
- package/components/input/checkboxset/types/index.d.ts +26 -27
- package/components/input/chips/bundles/index.umd.js +721 -733
- package/components/input/chips/fesm2022/index.mjs +706 -723
- package/components/input/chips/fesm2022/index.mjs.map +1 -1
- package/components/input/chips/types/index.d.ts +101 -90
- package/components/input/color-picker/bundles/index.umd.js +312 -137
- package/components/input/color-picker/fesm2022/index.mjs +296 -126
- package/components/input/color-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/color-picker/types/index.d.ts +35 -36
- package/components/input/composite/bundles/index.umd.js +127 -112
- package/components/input/composite/fesm2022/index.mjs +106 -96
- package/components/input/composite/fesm2022/index.mjs.map +1 -1
- package/components/input/composite/types/index.d.ts +26 -27
- package/components/input/currency/bundles/index.umd.js +237 -104
- package/components/input/currency/fesm2022/index.mjs +219 -91
- package/components/input/currency/fesm2022/index.mjs.map +1 -1
- package/components/input/currency/types/index.d.ts +30 -31
- package/components/input/dataset-aware-form/bundles/index.umd.js +298 -346
- package/components/input/dataset-aware-form/fesm2022/index.mjs +286 -339
- package/components/input/dataset-aware-form/fesm2022/index.mjs.map +1 -1
- package/components/input/dataset-aware-form/types/index.d.ts +80 -80
- package/components/input/epoch/base-date-time/bundles/index.umd.js +809 -1081
- package/components/input/epoch/base-date-time/fesm2022/index.mjs +796 -1073
- package/components/input/epoch/base-date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/base-date-time/types/index.d.ts +244 -247
- package/components/input/epoch/date/bundles/index.umd.js +619 -513
- package/components/input/epoch/date/fesm2022/index.mjs +604 -503
- package/components/input/epoch/date/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date/types/index.d.ts +63 -64
- package/components/input/epoch/date-time/bundles/index.umd.js +682 -511
- package/components/input/epoch/date-time/fesm2022/index.mjs +672 -506
- package/components/input/epoch/date-time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time/types/index.d.ts +111 -112
- package/components/input/epoch/date-time-picker/bundles/index.umd.js +417 -321
- package/components/input/epoch/date-time-picker/fesm2022/index.mjs +405 -314
- package/components/input/epoch/date-time-picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/date-time-picker/types/index.d.ts +135 -80
- package/components/input/epoch/picker/bundles/index.umd.js +201 -148
- package/components/input/epoch/picker/fesm2022/index.mjs +183 -135
- package/components/input/epoch/picker/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/picker/types/index.d.ts +46 -38
- package/components/input/epoch/time/bundles/index.umd.js +534 -392
- package/components/input/epoch/time/fesm2022/index.mjs +523 -386
- package/components/input/epoch/time/fesm2022/index.mjs.map +1 -1
- package/components/input/epoch/time/types/index.d.ts +107 -108
- package/components/input/file-upload/bundles/index.umd.js +500 -477
- package/components/input/file-upload/fesm2022/index.mjs +484 -466
- package/components/input/file-upload/fesm2022/index.mjs.map +1 -1
- package/components/input/file-upload/types/index.d.ts +110 -109
- package/components/input/number/bundles/index.umd.js +241 -101
- package/components/input/number/fesm2022/index.mjs +224 -89
- package/components/input/number/fesm2022/index.mjs.map +1 -1
- package/components/input/number/types/index.d.ts +28 -29
- package/components/input/radioset/bundles/index.umd.js +240 -156
- package/components/input/radioset/fesm2022/index.mjs +226 -147
- package/components/input/radioset/fesm2022/index.mjs.map +1 -1
- package/components/input/radioset/types/index.d.ts +25 -26
- package/components/input/rating/bundles/index.umd.js +353 -266
- package/components/input/rating/fesm2022/index.mjs +337 -255
- package/components/input/rating/fesm2022/index.mjs.map +1 -1
- package/components/input/rating/types/index.d.ts +52 -53
- package/components/input/select/bundles/index.umd.js +295 -217
- package/components/input/select/fesm2022/index.mjs +280 -207
- package/components/input/select/fesm2022/index.mjs.map +1 -1
- package/components/input/select/types/index.d.ts +38 -39
- package/components/input/slider/bundles/index.umd.js +316 -197
- package/components/input/slider/fesm2022/index.mjs +297 -183
- package/components/input/slider/fesm2022/index.mjs.map +1 -1
- package/components/input/slider/types/index.d.ts +43 -44
- package/components/input/switch/bundles/index.umd.js +257 -219
- package/components/input/switch/fesm2022/index.mjs +243 -210
- package/components/input/switch/fesm2022/index.mjs.map +1 -1
- package/components/input/switch/types/index.d.ts +34 -35
- package/components/input/text/bundles/index.umd.js +1585 -1120
- package/components/input/text/fesm2022/index.mjs +1542 -1082
- package/components/input/text/fesm2022/index.mjs.map +1 -1
- package/components/input/text/types/index.d.ts +313 -310
- package/components/input/textarea/bundles/index.umd.js +224 -100
- package/components/input/textarea/fesm2022/index.mjs +207 -88
- package/components/input/textarea/fesm2022/index.mjs.map +1 -1
- package/components/input/textarea/types/index.d.ts +32 -33
- package/components/navigation/breadcrumb/bundles/index.umd.js +205 -131
- package/components/navigation/breadcrumb/fesm2022/index.mjs +188 -118
- package/components/navigation/breadcrumb/fesm2022/index.mjs.map +1 -1
- package/components/navigation/breadcrumb/types/index.d.ts +29 -28
- package/components/navigation/menu/bundles/index.umd.js +1461 -950
- package/components/navigation/menu/fesm2022/index.mjs +1416 -910
- package/components/navigation/menu/fesm2022/index.mjs.map +1 -1
- package/components/navigation/menu/types/index.d.ts +220 -193
- package/components/navigation/navbar/bundles/index.umd.js +172 -79
- package/components/navigation/navbar/fesm2022/index.mjs +155 -67
- package/components/navigation/navbar/fesm2022/index.mjs.map +1 -1
- package/components/navigation/navbar/types/index.d.ts +19 -20
- package/components/navigation/popover/bundles/index.umd.js +543 -519
- package/components/navigation/popover/fesm2022/index.mjs +524 -505
- package/components/navigation/popover/fesm2022/index.mjs.map +1 -1
- package/components/navigation/popover/types/index.d.ts +86 -86
- package/components/page/default/bundles/index.umd.js +634 -451
- package/components/page/default/fesm2022/index.mjs +600 -422
- package/components/page/default/fesm2022/index.mjs.map +1 -1
- package/components/page/default/types/index.d.ts +123 -119
- package/components/page/footer/bundles/index.umd.js +91 -63
- package/components/page/footer/fesm2022/index.mjs +71 -48
- package/components/page/footer/fesm2022/index.mjs.map +1 -1
- package/components/page/footer/types/index.d.ts +11 -12
- package/components/page/header/bundles/index.umd.js +96 -59
- package/components/page/header/fesm2022/index.mjs +76 -44
- package/components/page/header/fesm2022/index.mjs.map +1 -1
- package/components/page/header/types/index.d.ts +12 -13
- package/components/page/left-panel/bundles/index.umd.js +405 -407
- package/components/page/left-panel/fesm2022/index.mjs +386 -393
- package/components/page/left-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/left-panel/types/index.d.ts +47 -40
- package/components/page/right-panel/bundles/index.umd.js +115 -78
- package/components/page/right-panel/fesm2022/index.mjs +96 -64
- package/components/page/right-panel/fesm2022/index.mjs.map +1 -1
- package/components/page/right-panel/types/index.d.ts +14 -13
- package/components/page/top-nav/bundles/index.umd.js +91 -60
- package/components/page/top-nav/fesm2022/index.mjs +73 -47
- package/components/page/top-nav/fesm2022/index.mjs.map +1 -1
- package/components/page/top-nav/types/index.d.ts +11 -12
- package/components/prefab/bundles/index.umd.js +253 -173
- package/components/prefab/fesm2022/index.mjs +233 -158
- package/components/prefab/fesm2022/index.mjs.map +1 -1
- package/components/prefab/types/index.d.ts +35 -33
- package/core/bundles/index.umd.js +4466 -5642
- package/core/fesm2022/index.mjs +3997 -5202
- package/core/fesm2022/index.mjs.map +1 -1
- package/core/types/index.d.ts +1785 -1808
- package/http/bundles/index.umd.js +339 -413
- package/http/fesm2022/index.mjs +323 -402
- package/http/fesm2022/index.mjs.map +1 -1
- package/http/types/index.d.ts +107 -112
- package/locales/moment/am-et.js +73 -0
- package/locales/moment/bm.js +2 -0
- package/locales/moment/ca.js +1 -1
- package/locales/moment/de-at.js +29 -1
- package/locales/moment/de-ch.js +29 -1
- package/locales/moment/de.js +29 -1
- package/locales/moment/hu.js +3 -3
- package/locales/moment/id.js +12 -1
- package/locales/moment/ka.js +1 -1
- package/locales/moment/mk.js +0 -1
- package/locales/moment/nl-be.js +1 -1
- package/locales/moment/pl.js +1 -1
- package/locales/moment/ps.js +188 -0
- package/locales/moment/pt-br.js +14 -6
- package/locales/moment/sv.js +1 -1
- package/locales/moment/sw.js +56 -14
- package/locales/moment/uk.js +5 -4
- package/locales/moment/uz-latn.js +1 -1
- package/locales/moment/uz.js +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oAuth/bundles/index.umd.js +326 -483
- package/oAuth/fesm2022/index.mjs +267 -429
- package/oAuth/fesm2022/index.mjs.map +1 -1
- package/oAuth/types/index.d.ts +22 -26
- package/package-lock.json +2 -2
- package/package.json +1 -1
- package/runtime/base/bundles/index.umd.js +6380 -6093
- package/runtime/base/fesm2022/index.mjs +6368 -6107
- package/runtime/base/fesm2022/index.mjs.map +1 -1
- package/runtime/base/types/index.d.ts +1336 -1359
- package/runtime/dynamic/bundles/index.umd.js +1215 -851
- package/runtime/dynamic/fesm2022/index.mjs +1253 -898
- package/runtime/dynamic/fesm2022/index.mjs.map +1 -1
- package/runtime/dynamic/types/index.d.ts +140 -128
- package/scripts/datatable/datatable.js +20 -30
- package/security/bundles/index.umd.js +297 -438
- package/security/fesm2022/index.mjs +282 -443
- package/security/fesm2022/index.mjs.map +1 -1
- package/security/types/index.d.ts +127 -130
- package/swipey/bundles/index.umd.js +57 -48
- package/swipey/fesm2022/index.mjs +55 -50
- package/swipey/fesm2022/index.mjs.map +1 -1
- package/swipey/types/index.d.ts +19 -21
- package/transpiler/bundles/index.umd.js +1174 -811
- package/transpiler/fesm2022/index.mjs +1109 -757
- package/transpiler/fesm2022/index.mjs.map +1 -1
- package/transpiler/types/index.d.ts +32 -36
- package/variables/bundles/index.umd.js +2226 -3245
- package/variables/fesm2022/index.mjs +2117 -3237
- package/variables/fesm2022/index.mjs.map +1 -1
- package/variables/types/index.d.ts +410 -393
- package/build-task/.npmignore +0 -2
- package/components/advanced/carousel/.npmignore +0 -2
- package/components/advanced/custom/.npmignore +0 -2
- package/components/advanced/login/.npmignore +0 -2
- package/components/advanced/marquee/.npmignore +0 -2
- package/components/base/.npmignore +0 -2
- package/components/basic/anchor/.npmignore +0 -2
- package/components/basic/audio/.npmignore +0 -2
- package/components/basic/html/.npmignore +0 -2
- package/components/basic/icon/.npmignore +0 -2
- package/components/basic/iframe/.npmignore +0 -2
- package/components/basic/label/.npmignore +0 -2
- package/components/basic/picture/.npmignore +0 -2
- package/components/basic/progress/progress-bar/.npmignore +0 -2
- package/components/basic/progress/progress-circle/.npmignore +0 -2
- package/components/basic/progress/progress-utils/.npmignore +0 -2
- package/components/basic/rich-text-editor/.npmignore +0 -2
- package/components/basic/search/.npmignore +0 -2
- package/components/basic/spinner/.npmignore +0 -2
- package/components/basic/tree/.npmignore +0 -2
- package/components/basic/video/.npmignore +0 -2
- package/components/chart/.npmignore +0 -2
- package/components/containers/accordion/.npmignore +0 -2
- package/components/containers/layout-grid/.npmignore +0 -2
- package/components/containers/linear-layout/.npmignore +0 -2
- package/components/containers/panel/.npmignore +0 -2
- package/components/containers/tabs/.npmignore +0 -2
- package/components/containers/tile/.npmignore +0 -2
- package/components/containers/wizard/.npmignore +0 -2
- package/components/data/card/.npmignore +0 -2
- package/components/data/form/.npmignore +0 -2
- package/components/data/list/.npmignore +0 -2
- package/components/data/live-table/.npmignore +0 -2
- package/components/data/pagination/.npmignore +0 -2
- package/components/data/table/.npmignore +0 -2
- package/components/dialogs/alert-dialog/.npmignore +0 -2
- package/components/dialogs/confirm-dialog/.npmignore +0 -2
- package/components/dialogs/default/.npmignore +0 -2
- package/components/dialogs/design-dialog/.npmignore +0 -2
- package/components/dialogs/iframe-dialog/.npmignore +0 -2
- package/components/dialogs/login-dialog/.npmignore +0 -2
- package/components/dialogs/partial-dialog/.npmignore +0 -2
- package/components/input/base-form/.npmignore +0 -2
- package/components/input/base-form-custom/.npmignore +0 -2
- package/components/input/button/.npmignore +0 -2
- package/components/input/button-group/.npmignore +0 -2
- package/components/input/calendar/.npmignore +0 -2
- package/components/input/caption-position/.npmignore +0 -2
- package/components/input/checkbox/.npmignore +0 -2
- package/components/input/checkboxset/.npmignore +0 -2
- package/components/input/chips/.npmignore +0 -2
- package/components/input/color-picker/.npmignore +0 -2
- package/components/input/composite/.npmignore +0 -2
- package/components/input/currency/.npmignore +0 -2
- package/components/input/dataset-aware-form/.npmignore +0 -2
- package/components/input/epoch/base-date-time/.npmignore +0 -2
- package/components/input/epoch/date/.npmignore +0 -2
- package/components/input/epoch/date-time/.npmignore +0 -2
- package/components/input/epoch/date-time-picker/.npmignore +0 -2
- package/components/input/epoch/picker/.npmignore +0 -2
- package/components/input/epoch/time/.npmignore +0 -2
- package/components/input/file-upload/.npmignore +0 -2
- package/components/input/number/.npmignore +0 -2
- package/components/input/radioset/.npmignore +0 -2
- package/components/input/rating/.npmignore +0 -2
- package/components/input/select/.npmignore +0 -2
- package/components/input/slider/.npmignore +0 -2
- package/components/input/switch/.npmignore +0 -2
- package/components/input/text/.npmignore +0 -2
- package/components/input/textarea/.npmignore +0 -2
- package/components/navigation/breadcrumb/.npmignore +0 -2
- package/components/navigation/menu/.npmignore +0 -2
- package/components/navigation/navbar/.npmignore +0 -2
- package/components/navigation/popover/.npmignore +0 -2
- package/components/page/default/.npmignore +0 -2
- package/components/page/footer/.npmignore +0 -2
- package/components/page/header/.npmignore +0 -2
- package/components/page/left-panel/.npmignore +0 -2
- package/components/page/right-panel/.npmignore +0 -2
- package/components/page/top-nav/.npmignore +0 -2
- package/components/prefab/.npmignore +0 -2
- package/core/.npmignore +0 -2
- package/http/.npmignore +0 -2
- package/oAuth/.npmignore +0 -2
- package/runtime/base/.npmignore +0 -2
- package/runtime/dynamic/.npmignore +0 -2
- package/security/.npmignore +0 -2
- package/swipey/.npmignore +0 -2
- package/transpiler/.npmignore +0 -2
- package/variables/.npmignore +0 -2
|
@@ -1,485 +1,508 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('rxjs'), require('@wm/core'), require('@wm/components/base'), require('lodash-es')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/core', 'rxjs', '@wm/core', '@wm/components/base', 'lodash-es'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.input = global.wm.components.input || {}, global.wm.components.input.fileupload = {}), global.ng.common, global.ng.core, global.rxjs, global.wm.core, global.wm.components.base, global._));
|
|
5
5
|
})(this, (function (exports, i2, i0, rxjs, i1, base, lodashEs) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
|
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
|
|
26
|
+
var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
28
|
+
const registerProps = () => {
|
|
29
|
+
base.register("wm-fileupload", /* @__PURE__ */ new Map([
|
|
30
|
+
["caption", base.PROP_STRING],
|
|
31
|
+
["name", base.PROP_STRING],
|
|
32
|
+
["hint", base.PROP_STRING],
|
|
33
|
+
["arialabel", base.PROP_STRING],
|
|
34
|
+
["tabindex", base.PROP_NUMBER],
|
|
35
|
+
["multiple", base.PROP_BOOLEAN],
|
|
36
|
+
["fileuploadmessage", base.PROP_STRING],
|
|
37
|
+
["show", {
|
|
38
|
+
value: true,
|
|
39
|
+
...base.PROP_BOOLEAN
|
|
40
|
+
}],
|
|
41
|
+
["disabled", base.PROP_BOOLEAN],
|
|
42
|
+
["contenttype", base.PROP_STRING],
|
|
43
|
+
["maxfilesize", base.PROP_NUMBER],
|
|
44
|
+
["iconclass", {
|
|
45
|
+
value: "wi wi-file-upload",
|
|
46
|
+
...base.PROP_STRING
|
|
47
|
+
}],
|
|
48
|
+
["iconurl", base.PROP_STRING],
|
|
49
|
+
["cleariconclass", {
|
|
50
|
+
value: "",
|
|
51
|
+
...base.PROP_STRING
|
|
52
|
+
}],
|
|
53
|
+
["cleariconurl", base.PROP_STRING],
|
|
54
|
+
["cleariconhint", {
|
|
55
|
+
value: "Clear",
|
|
56
|
+
...base.PROP_STRING
|
|
57
|
+
}],
|
|
58
|
+
["class", base.PROP_STRING],
|
|
59
|
+
["uploadpath", { ...base.PROP_STRING }],
|
|
60
|
+
["datasource", base.PROP_STRING],
|
|
61
|
+
["selectedFiles", base.PROP_STRING],
|
|
62
|
+
["destination", base.PROP_STRING],
|
|
63
|
+
["filelistheight", base.PROP_NUMBER],
|
|
64
|
+
["width", {
|
|
65
|
+
value: "auto",
|
|
66
|
+
...base.PROP_STRING
|
|
67
|
+
}],
|
|
68
|
+
["showprogressbar", base.PROP_BOOLEAN],
|
|
69
|
+
["showprogressbarpercentage", base.PROP_BOOLEAN],
|
|
70
|
+
["deleteiconhint", {
|
|
71
|
+
value: "Delete",
|
|
72
|
+
...base.PROP_STRING
|
|
73
|
+
}]
|
|
74
|
+
]));
|
|
75
|
+
base.registerFormWidget(i1.FormWidgetType.UPLOAD, /* @__PURE__ */ new Map([
|
|
76
|
+
["disabled", base.PROP_BOOLEAN],
|
|
77
|
+
["extensions", base.PROP_STRING],
|
|
78
|
+
["filetype", base.PROP_STRING],
|
|
79
|
+
["multiple", base.PROP_BOOLEAN],
|
|
80
|
+
["readonly", base.PROP_BOOLEAN],
|
|
81
|
+
["required", base.PROP_BOOLEAN]
|
|
82
|
+
]));
|
|
83
|
+
};
|
|
84
|
+
const WIDGET_CONFIG = {
|
|
85
|
+
widgetType: "wm-fileupload",
|
|
86
|
+
hostClass: "app-fileupload"
|
|
87
|
+
};
|
|
88
|
+
var FileUploadComponent = class FileUploadComponent extends base.StylableComponent {
|
|
89
|
+
static {
|
|
90
|
+
this.initializeProps = registerProps();
|
|
91
|
+
}
|
|
92
|
+
isValidFile(filename, contenttype, extensionName, isMobileType) {
|
|
93
|
+
let isValid, contentTypes;
|
|
94
|
+
if (!contenttype) return true;
|
|
95
|
+
contentTypes = lodashEs.toLower(contenttype).split(",");
|
|
96
|
+
if (lodashEs.includes(contentTypes, "image/*") || lodashEs.includes(contentTypes, "image") && isMobileType) {
|
|
97
|
+
isValid = i1.isImageFile(filename);
|
|
98
|
+
if (isValid) return isValid;
|
|
99
|
+
}
|
|
100
|
+
if (lodashEs.includes(contentTypes, "audio/*") || lodashEs.includes(contentTypes, "audio") && isMobileType) {
|
|
101
|
+
isValid = i1.isAudioFile(filename);
|
|
102
|
+
if (isValid) return isValid;
|
|
103
|
+
}
|
|
104
|
+
if (lodashEs.includes(contentTypes, "video/*") || lodashEs.includes(contentTypes, "video") && isMobileType) {
|
|
105
|
+
isValid = i1.isVideoFile(filename);
|
|
106
|
+
if (isValid) return isValid;
|
|
107
|
+
}
|
|
108
|
+
if (lodashEs.includes(contentTypes, "." + lodashEs.toLower(extensionName))) isValid = true;
|
|
109
|
+
return isValid;
|
|
110
|
+
}
|
|
111
|
+
getValidFiles($files) {
|
|
112
|
+
const validFiles = [];
|
|
113
|
+
const errorFiles = [];
|
|
114
|
+
const MAXFILEUPLOAD_SIZE = parseFloat(this.maxfilesize) * this.FILESIZE_MB || this.FILESIZE_MB;
|
|
115
|
+
const MAX_FILE_UPLOAD_FORMATTED_SIZE = (this.maxfilesize || "1") + "MB";
|
|
116
|
+
if (this.chooseFilter === this.DEVICE_CONTENTTYPES.FILES) this.chooseFilter = "";
|
|
117
|
+
lodashEs.forEach($files, (file) => {
|
|
118
|
+
if (!this.isValidFile(file.name, this.chooseFilter, this.getFileExtension(file.name), this._isMobileType)) {
|
|
119
|
+
const msg = `${this.appLocale.LABEL_FILE_EXTENTION_VALIDATION_MESSAGE} ${this.chooseFilter}`;
|
|
120
|
+
this.handleErrorFiles("INVALID_FILE_EXTENSION", msg, file, errorFiles);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (file.size > MAXFILEUPLOAD_SIZE) {
|
|
124
|
+
const msg = `${this.appLocale.LABEL_FILE_EXCEED_VALIDATION_MESSAGE} ${MAX_FILE_UPLOAD_FORMATTED_SIZE}`;
|
|
125
|
+
this.handleErrorFiles("INVALID_FILE_SIZE", msg, file, errorFiles);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
validFiles.push(file);
|
|
129
|
+
});
|
|
130
|
+
return {
|
|
131
|
+
validFiles,
|
|
132
|
+
errorFiles
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
handleErrorFiles(key, msg, file, errorFiles) {
|
|
136
|
+
if (!this.hasEventCallback("error")) this.app.notifyApp(msg, "Error");
|
|
137
|
+
file.error = {
|
|
138
|
+
key,
|
|
139
|
+
message: msg
|
|
140
|
+
};
|
|
141
|
+
errorFiles.push(file);
|
|
142
|
+
}
|
|
143
|
+
getCaption(caption, isMultiple, isMobileType) {
|
|
144
|
+
if (lodashEs.includes(this.DEFAULT_CAPTIONS, caption)) return isMultiple && !isMobileType ? this.DEFAULT_CAPTIONS.MULTIPLE_SELECT : this.DEFAULT_CAPTIONS.SELECT;
|
|
145
|
+
return caption;
|
|
146
|
+
}
|
|
147
|
+
changeServerUploadPath(path) {
|
|
148
|
+
this.selectedUploadTypePath = path;
|
|
149
|
+
}
|
|
150
|
+
getFileExtension(fileName) {
|
|
151
|
+
if (fileName && lodashEs.includes(fileName, ".")) return fileName.substring(fileName.lastIndexOf(".") + 1);
|
|
152
|
+
return "file";
|
|
153
|
+
}
|
|
154
|
+
onSelectEventCall($event, $files) {
|
|
155
|
+
$files.forEach((file) => {
|
|
156
|
+
file.uniqueId = this.idGenerator.nextUid();
|
|
157
|
+
});
|
|
158
|
+
this.selectedFiles = $files;
|
|
159
|
+
this.uploadedFiles = this.multiple ? [...this.uploadedFiles, ...$files] : $files;
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
this.invokeEventCallback("select", {
|
|
162
|
+
$event: $.extend($event.$files || {}, $files),
|
|
163
|
+
selectedFiles: $files
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
onFileElemClick($event) {
|
|
168
|
+
this.highlightDropArea = true;
|
|
169
|
+
this.$element.find(".file-input")[0].value = null;
|
|
170
|
+
$event.stopPropagation();
|
|
171
|
+
window.addEventListener("focus", this.boundDisableDropZone);
|
|
172
|
+
}
|
|
173
|
+
disableDropZone() {
|
|
174
|
+
this.highlightDropArea = false;
|
|
175
|
+
window.removeEventListener("focus", this.boundDisableDropZone);
|
|
176
|
+
}
|
|
177
|
+
clear(fileObj) {
|
|
178
|
+
this.selectedFiles = fileObj ? this.clearFile(this.selectedFiles, fileObj) : [];
|
|
179
|
+
this.uploadedFiles = fileObj ? this.clearFile(this.uploadedFiles, fileObj) : [];
|
|
180
|
+
}
|
|
181
|
+
clearFile(files, fileObj) {
|
|
182
|
+
return files.filter((file) => file?._response?.fileName !== fileObj?._response?.fileName || file?.name !== fileObj?.name || file !== fileObj);
|
|
183
|
+
}
|
|
184
|
+
setClearIconClass(classValue) {
|
|
185
|
+
this.cleariconclass = classValue;
|
|
186
|
+
}
|
|
187
|
+
setClearIconHint(hint) {
|
|
188
|
+
this.cleariconhint = hint;
|
|
189
|
+
}
|
|
190
|
+
onFileSelect($event, $files) {
|
|
191
|
+
let beforeSelectVal;
|
|
192
|
+
const files = this.getValidFiles($files);
|
|
193
|
+
$files = files.validFiles;
|
|
194
|
+
if ($event.type === "change") this.selectedFolders = [];
|
|
195
|
+
if (!lodashEs.isEmpty(files.errorFiles)) this.invokeEventCallback("error", {
|
|
196
|
+
$event,
|
|
197
|
+
files: files.errorFiles
|
|
198
|
+
});
|
|
199
|
+
if ($files.length) {
|
|
200
|
+
beforeSelectVal = this.invokeEventCallback("beforeselect", {
|
|
201
|
+
$event: $.extend($event.$files || {}, $files),
|
|
202
|
+
files: $files
|
|
203
|
+
});
|
|
204
|
+
if (this.datasource) {
|
|
205
|
+
if (!this.uploadProgressSubscription) {
|
|
206
|
+
this.progressObservable = new rxjs.Subject();
|
|
207
|
+
this.datasource._progressObservable = this.progressObservable;
|
|
208
|
+
this.uploadProgressSubscription = this.datasource._progressObservable.asObservable().subscribe((progressObj) => {
|
|
209
|
+
lodashEs.forEach(this.uploadedFiles, (file) => {
|
|
210
|
+
if (file.name === progressObj.fileName && file.uniqueId === progressObj.uniqueId) {
|
|
211
|
+
file.progress = progressObj.progress;
|
|
212
|
+
if (file.progress === 100) file.status = "success";
|
|
213
|
+
else {
|
|
214
|
+
file.status = progressObj.status;
|
|
215
|
+
if (progressObj.errMsg) {
|
|
216
|
+
file.errMsg = progressObj.errMsg;
|
|
217
|
+
this.invokeEventCallback("error", {
|
|
218
|
+
$event,
|
|
219
|
+
files: file
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
} else this.selectedFiles = $files;
|
|
228
|
+
if (beforeSelectVal !== false) this.onSelectEventCall($event, $files);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
onFileDelete($event, file) {
|
|
232
|
+
if (!file) return;
|
|
233
|
+
if (this.invokeEventCallback("beforedelete", { $event: file }) !== false) this.dialogService.showAppConfirmDialog({
|
|
234
|
+
title: "Delete file",
|
|
235
|
+
message: "Are you sure you want to delete this file?",
|
|
236
|
+
oktext: "Ok",
|
|
237
|
+
canceltext: "Cancel",
|
|
238
|
+
onOk: () => {
|
|
239
|
+
if (this.deletedatasource) {
|
|
240
|
+
this.deletedatasource.setInput("file", file._response.fileName || file.name);
|
|
241
|
+
if (!this.deleteProgressSubscription) {
|
|
242
|
+
this.deleteFileObservable = new rxjs.Subject();
|
|
243
|
+
this.deletedatasource._deleteFileObservable = this.deleteFileObservable;
|
|
244
|
+
this.deletedatasource._deleteFileObservable.asObservable().subscribe((response) => {
|
|
245
|
+
if (response.status === "success") {
|
|
246
|
+
this.selectedFiles = this.selectedFiles.filter((fileObj) => file !== fileObj);
|
|
247
|
+
this.uploadedFiles = this.uploadedFiles.filter((fileObj) => file !== fileObj);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
this.invokeEventCallback("delete", { $event: file });
|
|
253
|
+
this.dialogService.closeAppConfirmDialog();
|
|
254
|
+
},
|
|
255
|
+
onCancel: () => {
|
|
256
|
+
this.dialogService.closeAppConfirmDialog();
|
|
257
|
+
},
|
|
258
|
+
onOpen: () => {
|
|
259
|
+
$(".cancel-action").focus();
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
dragOverHandler($event) {
|
|
264
|
+
$event.preventDefault();
|
|
265
|
+
$event.stopPropagation();
|
|
266
|
+
}
|
|
267
|
+
onFileDrop($event) {
|
|
268
|
+
$event.preventDefault();
|
|
269
|
+
let listOfFiles = [];
|
|
270
|
+
this.selectedFolders = [];
|
|
271
|
+
const filesData = $event.dataTransfer.items;
|
|
272
|
+
if (filesData.length > 0) {
|
|
273
|
+
for (let i = 0; i < filesData.length; i++) if (filesData[i].webkitGetAsEntry().isFile) listOfFiles.push(filesData[i].getAsFile());
|
|
274
|
+
else if (filesData[i].webkitGetAsEntry().isDirectory) this.selectedFolders.push(filesData[i].getAsFile());
|
|
275
|
+
this.onFileSelect($event, listOfFiles);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
dragOverCb(e) {
|
|
279
|
+
e.preventDefault();
|
|
280
|
+
$(this.nativeElement).find("#dropzone").addClass("highlight-drop-box");
|
|
281
|
+
}
|
|
282
|
+
dropCb() {
|
|
283
|
+
$(this.nativeElement).find("#dropzone").removeClass("highlight-drop-box");
|
|
284
|
+
}
|
|
285
|
+
triggerFileSelect() {
|
|
286
|
+
this.$element.find(".file-input").trigger("click");
|
|
287
|
+
}
|
|
288
|
+
abortFileUpload($file) {
|
|
289
|
+
this.datasource.execute(i1.DataSource.Operation.CANCEL, $file);
|
|
290
|
+
}
|
|
291
|
+
isMimeType(file) {
|
|
292
|
+
return this.defaultAllowedExtensions.includes("image/*") && i1.isImageFile(file) || this.defaultAllowedExtensions.includes("audio/*") && i1.isAudioFile(file) || this.defaultAllowedExtensions.includes("video/*") && i1.isVideoFile(file);
|
|
293
|
+
}
|
|
294
|
+
onPropertyChange(key, nv, ov) {
|
|
295
|
+
switch (key) {
|
|
296
|
+
case "uploadpath":
|
|
297
|
+
this.changeServerUploadPath(nv);
|
|
298
|
+
break;
|
|
299
|
+
case "contenttype":
|
|
300
|
+
if (this.defaultAllowedExtensions.includes("*/*")) this.chooseFilter = nv.split(" ").join(",");
|
|
301
|
+
else {
|
|
302
|
+
this.chooseFilter = nv.split(" ").filter((item) => this.defaultAllowedExtensions.includes(item) || this.isMimeType(item)).join(",");
|
|
303
|
+
if (lodashEs.isEmpty(this.chooseFilter)) this.chooseFilter = this.defaultAllowedExtensions;
|
|
304
|
+
}
|
|
305
|
+
break;
|
|
306
|
+
case "multiple":
|
|
307
|
+
this.formName = this.name + (this.multiple ? "-multiple-fileupload" : "-single-fileupload");
|
|
308
|
+
this.caption = this.getCaption(this.caption, this.multiple, this._isMobileType);
|
|
309
|
+
break;
|
|
310
|
+
case "fileuploadmessage": this.fileUploadMessage = nv;
|
|
311
|
+
}
|
|
312
|
+
super.onPropertyChange(key, nv, ov);
|
|
313
|
+
}
|
|
314
|
+
constructor(inj, app, onSelectEvt, dialogService, explicitContext) {
|
|
315
|
+
super(inj, WIDGET_CONFIG, explicitContext);
|
|
316
|
+
this.app = app;
|
|
317
|
+
this.onSelectEvt = onSelectEvt;
|
|
318
|
+
this.dialogService = dialogService;
|
|
319
|
+
this.selectedFiles = [];
|
|
320
|
+
this.uploadedFiles = [];
|
|
321
|
+
this.selectedFolders = [];
|
|
322
|
+
this.fileTransfers = {};
|
|
323
|
+
this.caption = "Upload";
|
|
324
|
+
this.formName = "";
|
|
325
|
+
this.DEFAULT_CAPTIONS = {
|
|
326
|
+
MULTIPLE_SELECT: "Drop your files here.",
|
|
327
|
+
SELECT: "Select"
|
|
328
|
+
};
|
|
329
|
+
this.DEVICE_CONTENTTYPES = {
|
|
330
|
+
IMAGE: "image",
|
|
331
|
+
VIDEO: "video",
|
|
332
|
+
AUDIO: "audio",
|
|
333
|
+
FILES: "files"
|
|
334
|
+
};
|
|
335
|
+
this.FILESIZE_MB = 1048576;
|
|
336
|
+
this.CONSTANT_FILE_SERVICE = "FileService";
|
|
337
|
+
this.uploadData = {
|
|
338
|
+
file: void 0,
|
|
339
|
+
uploadPath: void 0
|
|
340
|
+
};
|
|
341
|
+
this.allowedFileUploadExtensions = i1.getWmProjectProperties().allowedFileUploadExtensions;
|
|
342
|
+
this.defaultAllowedExtensions = this.allowedFileUploadExtensions.split(",").map((item) => item.trim()).map((item) => item.endsWith("/*") ? item : `.${item}`);
|
|
343
|
+
this.chooseFilter = this.defaultAllowedExtensions.includes("*/*") ? "" : this.defaultAllowedExtensions;
|
|
344
|
+
this.fileUploadMessage = "Drop your files here or click here to browse";
|
|
345
|
+
this.idGenerator = new i1.IDGenerator("file-");
|
|
346
|
+
this.uploadUrl = "services";
|
|
347
|
+
}
|
|
348
|
+
ngOnInit() {
|
|
349
|
+
super.ngOnInit();
|
|
350
|
+
this.boundDragOverCb = this.dragOverCb.bind(this);
|
|
351
|
+
this.boundDropCb = this.dropCb.bind(this);
|
|
352
|
+
this.boundDisableDropZone = this.disableDropZone.bind(this);
|
|
353
|
+
document.addEventListener("dragover", this.boundDragOverCb);
|
|
354
|
+
document.addEventListener("drop", this.boundDropCb);
|
|
355
|
+
document.addEventListener("mouseleave", this.boundDropCb);
|
|
356
|
+
}
|
|
357
|
+
ngAfterViewInit() {
|
|
358
|
+
base.styler(this.nativeElement.querySelector(".app-button, .drop-box"), this);
|
|
359
|
+
}
|
|
360
|
+
ngOnDestroy() {
|
|
361
|
+
if (this.boundDragOverCb) {
|
|
362
|
+
document.removeEventListener("dragover", this.boundDragOverCb);
|
|
363
|
+
this.boundDragOverCb = null;
|
|
364
|
+
}
|
|
365
|
+
if (this.boundDropCb) {
|
|
366
|
+
document.removeEventListener("drop", this.boundDropCb);
|
|
367
|
+
document.removeEventListener("mouseleave", this.boundDropCb);
|
|
368
|
+
this.boundDropCb = null;
|
|
369
|
+
}
|
|
370
|
+
if (this.boundDisableDropZone) {
|
|
371
|
+
window.removeEventListener("focus", this.boundDisableDropZone);
|
|
372
|
+
this.boundDisableDropZone = null;
|
|
373
|
+
}
|
|
374
|
+
super.ngOnDestroy();
|
|
375
|
+
[this.uploadProgressSubscription, this.deleteProgressSubscription].forEach((subscription) => {
|
|
376
|
+
if (subscription) subscription.unsubscribe();
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
static {
|
|
380
|
+
this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
|
|
381
|
+
minVersion: "12.0.0",
|
|
382
|
+
version: "22.2.1",
|
|
383
|
+
ngImport: i0__namespace,
|
|
384
|
+
type: FileUploadComponent,
|
|
385
|
+
deps: [
|
|
386
|
+
{ token: i0__namespace.Injector },
|
|
387
|
+
{ token: i1__namespace.App },
|
|
388
|
+
{
|
|
389
|
+
token: "select.event",
|
|
390
|
+
attribute: true
|
|
391
|
+
},
|
|
392
|
+
{ token: i1__namespace.AbstractDialogService },
|
|
393
|
+
{
|
|
394
|
+
token: "EXPLICIT_CONTEXT",
|
|
395
|
+
optional: true
|
|
396
|
+
}
|
|
397
|
+
],
|
|
398
|
+
target: i0__namespace.ɵɵFactoryTarget.Component
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
static {
|
|
402
|
+
this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({
|
|
403
|
+
minVersion: "17.0.0",
|
|
404
|
+
version: "22.2.1",
|
|
405
|
+
type: FileUploadComponent,
|
|
406
|
+
isStandalone: true,
|
|
407
|
+
selector: "[wmFileUpload]",
|
|
408
|
+
providers: [base.provideAsWidgetRef(FileUploadComponent)],
|
|
409
|
+
usesInheritance: true,
|
|
410
|
+
ngImport: i0__namespace,
|
|
411
|
+
template: "<div class=\"app-fileupload\" init-widget>\n <!-- drag and drop files UI in web -->\n @if (!_isMobileType && multiple) {\n <div class=\"app-multi-file-upload\">\n <div id=\"dropzone\" class=\"drop-box\" (click)=\"triggerFileSelect()\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\" (dragover)=\"dragOverHandler($event);\" (drop)=\"onFileDrop($event);\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <div class=\"message\">\n <label [innerHtml]=\"caption\" class=\"upload-label\"></label>\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n @if (multiple) {\n <input class=\"file-input\" [attr.aria-label]=\"hint || 'File selection field'\" type=\"file\" name=\"files\" [disabled]=\"disabled\" [accept]=\"chooseFilter\" (click)=\"onFileElemClick($event)\" (change)=\"onFileSelect($event, $event.target.files)\" multiple >\n }\n <a class=\"app-anchor upload-label\" href=\"javascript:void(0);\">{{ fileUploadMessage }}</a>\n </form>\n @if (chooseFilter) {\n <label [innerHtml]=\"chooseFilter + ' only '\" class=\"upload-extensions\"></label>\n }\n @if (chooseFilter && maxfilesize) {\n <span class=\"upload-extensions\"> . </span>\n }\n @if (maxfilesize) {\n <label [innerHtml]=\"maxfilesize + 'MB max'\" class=\"upload-extensions\"></label>\n }\n </div>\n </div>\n </div>\n }\n <!-- single file upload in web and single , multiple file upload UI in mobile runmode -->\n @if ((!multiple || _isMobileType)) {\n <div class=\"app-single-file-upload\">\n <div class=\"app-button-wrapper\">\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n <!-- support for file upload in Mobileapp in its runmode (Web) -->\n @if (multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n multiple name=\"files\" type=\"file\">\n }\n @if (!multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n name=\"files\" type=\"file\">\n }\n <button id=\"dropzone\" focus-target class=\"app-button btn btn-default\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <span class=\"caption\" [innerHTML]=\"caption\"></span>\n </button>\n </form>\n </div>\n <div class=\"app-files-upload-status single\"></div>\n </div>\n }\n <!-- list of selectedfiles UI -->\n @if (uploadedFiles.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\"\n tabindex=\"0\">\n @for (ft of uploadedFiles; track ft) {\n @if (ft.status !== 'abort') {\n <li class=\"list-group-item file-upload-status\" tabindex=\"0\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon {{getFileExtension(ft.name) | fileIconClass}}\" title=\"{{getFileExtension(ft.name)}}\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails col-md-3\">\n <span class=\"upload-title\">{{ ft.storageName || ft.name }}</span>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"></span>\n }\n <br/>\n @if (ft.fileLength !== 0) {\n <span class=\"filesize\">{{ft.size | filesize:0}}</span>\n }\n @if (ft.status === 'error') {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"\n title=\"{{ft.errMsg || appLocale.MESSAGE_FILE_UPLOAD_FAILED}}\"></span>\n }\n @if (ft.status === 'error') {\n <span class=\"error-message\">Upload Failed</span>\n }\n </p>\n @if (ft.status === 'onProgress' || showprogressbar) {\n <div\n class=\"progress col-md-7 upload-progress\">\n <div [ngClass]=\"ft.status === 'error' ? 'progress-bar-danger' : 'progress-bar-info'\"\n [ngStyle]=\"{width: (ft.progress +'%')}\"\n class=\"progress-bar progress-bar-striped\"></div>\n </div>\n }\n @if ((ft.status === 'onProgress' || showprogressbar && showprogressbarpercentage) && ft.progress ) {\n <div\n class=\"col-md-1 upload-progress-percentage\">{{ ft.progress + '%' }}\n </div>\n }\n </div>\n @if (ft.status === 'onProgress' || ft.status === 'queued') {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" class=\"btn btn-transparent file-upload-stop\" type=\"button\"\n (click)=\"abortFileUpload(ft)\">\n <i class=\"wi wi-close\"></i>\n </a>\n </div>\n }\n <div class=\"media-right media-middle\">\n @if ((cleariconclass !== '' || cleariconurl) && ft.status !== 'onProgress') {\n <a href=\"javascript:void(0)\" (click)=\"clear(ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{cleariconhint}}\" type=\"button\">\n <wm-app-icon [iconclass]=\"cleariconclass\" [iconurl]=\"cleariconurl\" alt=\"Clear\"></wm-app-icon>\n </a>\n }\n </div>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" (click)=\"onFileDelete($event, ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{deleteiconhint}}\" type=\"button\">\n <i class=\"wi wi-delete\"></i>\n </a>\n </div>\n }\n </div>\n </li>\n }\n }\n </ul>\n }\n <!-- list of selectedfolders UI to show the error in title -->\n @if (selectedFolders.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\" title=\"{{appLocale.MESSAGE_FOLDER_UPLOADS_NOT_ALLOWED}}\" >\n @for (ft of selectedFolders; track ft) {\n <li class=\"list-group-item file-upload-status\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon fa fa-folder-o\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails\">\n <label class=\"upload-title\">{{ft.name}}</label><br/>\n </p>\n </div>\n <div class=\"media-right media-middle\" >\n <span class=\"status-icon wi wi-cancel text-danger\"></span>\n </div>\n </div>\n </li>\n }\n </ul>\n }\n</div>\n",
|
|
412
|
+
dependencies: [
|
|
413
|
+
{
|
|
414
|
+
kind: "ngmodule",
|
|
415
|
+
type: i2.CommonModule
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
kind: "directive",
|
|
419
|
+
type: i2__namespace.NgClass,
|
|
420
|
+
selector: "[ngClass]",
|
|
421
|
+
inputs: ["class", "ngClass"]
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
kind: "directive",
|
|
425
|
+
type: i2__namespace.NgStyle,
|
|
426
|
+
selector: "[ngStyle]",
|
|
427
|
+
inputs: ["ngStyle"]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
kind: "component",
|
|
431
|
+
type: base.WmAppIconComponent,
|
|
432
|
+
selector: "wm-app-icon",
|
|
433
|
+
inputs: [
|
|
434
|
+
"icon",
|
|
435
|
+
"iconclass",
|
|
436
|
+
"iconurl",
|
|
437
|
+
"defaultIconClass",
|
|
438
|
+
"defaultClasses",
|
|
439
|
+
"iconStyle",
|
|
440
|
+
"alt"
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
kind: "pipe",
|
|
445
|
+
type: base.FileIconClassPipe,
|
|
446
|
+
name: "fileIconClass"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
kind: "pipe",
|
|
450
|
+
type: base.StateClassPipe,
|
|
451
|
+
name: "stateClass"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
kind: "pipe",
|
|
455
|
+
type: base.FileSizePipe,
|
|
456
|
+
name: "filesize"
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
changeDetection: i0__namespace.ChangeDetectionStrategy.Eager
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
i0__namespace.ɵɵngDeclareClassMetadata({
|
|
464
|
+
minVersion: "12.0.0",
|
|
465
|
+
version: "22.2.1",
|
|
466
|
+
ngImport: i0__namespace,
|
|
467
|
+
type: FileUploadComponent,
|
|
468
|
+
decorators: [{
|
|
469
|
+
type: i0.Component,
|
|
470
|
+
args: [{
|
|
471
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager,
|
|
472
|
+
standalone: true,
|
|
473
|
+
imports: [
|
|
474
|
+
i2.CommonModule,
|
|
475
|
+
base.FileIconClassPipe,
|
|
476
|
+
base.StateClassPipe,
|
|
477
|
+
base.FileSizePipe,
|
|
478
|
+
base.WmAppIconComponent
|
|
479
|
+
],
|
|
480
|
+
selector: "[wmFileUpload]",
|
|
481
|
+
providers: [base.provideAsWidgetRef(FileUploadComponent)],
|
|
482
|
+
template: "<div class=\"app-fileupload\" init-widget>\n <!-- drag and drop files UI in web -->\n @if (!_isMobileType && multiple) {\n <div class=\"app-multi-file-upload\">\n <div id=\"dropzone\" class=\"drop-box\" (click)=\"triggerFileSelect()\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\" (dragover)=\"dragOverHandler($event);\" (drop)=\"onFileDrop($event);\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <div class=\"message\">\n <label [innerHtml]=\"caption\" class=\"upload-label\"></label>\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n @if (multiple) {\n <input class=\"file-input\" [attr.aria-label]=\"hint || 'File selection field'\" type=\"file\" name=\"files\" [disabled]=\"disabled\" [accept]=\"chooseFilter\" (click)=\"onFileElemClick($event)\" (change)=\"onFileSelect($event, $event.target.files)\" multiple >\n }\n <a class=\"app-anchor upload-label\" href=\"javascript:void(0);\">{{ fileUploadMessage }}</a>\n </form>\n @if (chooseFilter) {\n <label [innerHtml]=\"chooseFilter + ' only '\" class=\"upload-extensions\"></label>\n }\n @if (chooseFilter && maxfilesize) {\n <span class=\"upload-extensions\"> . </span>\n }\n @if (maxfilesize) {\n <label [innerHtml]=\"maxfilesize + 'MB max'\" class=\"upload-extensions\"></label>\n }\n </div>\n </div>\n </div>\n }\n <!-- single file upload in web and single , multiple file upload UI in mobile runmode -->\n @if ((!multiple || _isMobileType)) {\n <div class=\"app-single-file-upload\">\n <div class=\"app-button-wrapper\">\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n <!-- support for file upload in Mobileapp in its runmode (Web) -->\n @if (multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n multiple name=\"files\" type=\"file\">\n }\n @if (!multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n name=\"files\" type=\"file\">\n }\n <button id=\"dropzone\" focus-target class=\"app-button btn btn-default\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <span class=\"caption\" [innerHTML]=\"caption\"></span>\n </button>\n </form>\n </div>\n <div class=\"app-files-upload-status single\"></div>\n </div>\n }\n <!-- list of selectedfiles UI -->\n @if (uploadedFiles.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\"\n tabindex=\"0\">\n @for (ft of uploadedFiles; track ft) {\n @if (ft.status !== 'abort') {\n <li class=\"list-group-item file-upload-status\" tabindex=\"0\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon {{getFileExtension(ft.name) | fileIconClass}}\" title=\"{{getFileExtension(ft.name)}}\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails col-md-3\">\n <span class=\"upload-title\">{{ ft.storageName || ft.name }}</span>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"></span>\n }\n <br/>\n @if (ft.fileLength !== 0) {\n <span class=\"filesize\">{{ft.size | filesize:0}}</span>\n }\n @if (ft.status === 'error') {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"\n title=\"{{ft.errMsg || appLocale.MESSAGE_FILE_UPLOAD_FAILED}}\"></span>\n }\n @if (ft.status === 'error') {\n <span class=\"error-message\">Upload Failed</span>\n }\n </p>\n @if (ft.status === 'onProgress' || showprogressbar) {\n <div\n class=\"progress col-md-7 upload-progress\">\n <div [ngClass]=\"ft.status === 'error' ? 'progress-bar-danger' : 'progress-bar-info'\"\n [ngStyle]=\"{width: (ft.progress +'%')}\"\n class=\"progress-bar progress-bar-striped\"></div>\n </div>\n }\n @if ((ft.status === 'onProgress' || showprogressbar && showprogressbarpercentage) && ft.progress ) {\n <div\n class=\"col-md-1 upload-progress-percentage\">{{ ft.progress + '%' }}\n </div>\n }\n </div>\n @if (ft.status === 'onProgress' || ft.status === 'queued') {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" class=\"btn btn-transparent file-upload-stop\" type=\"button\"\n (click)=\"abortFileUpload(ft)\">\n <i class=\"wi wi-close\"></i>\n </a>\n </div>\n }\n <div class=\"media-right media-middle\">\n @if ((cleariconclass !== '' || cleariconurl) && ft.status !== 'onProgress') {\n <a href=\"javascript:void(0)\" (click)=\"clear(ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{cleariconhint}}\" type=\"button\">\n <wm-app-icon [iconclass]=\"cleariconclass\" [iconurl]=\"cleariconurl\" alt=\"Clear\"></wm-app-icon>\n </a>\n }\n </div>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" (click)=\"onFileDelete($event, ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{deleteiconhint}}\" type=\"button\">\n <i class=\"wi wi-delete\"></i>\n </a>\n </div>\n }\n </div>\n </li>\n }\n }\n </ul>\n }\n <!-- list of selectedfolders UI to show the error in title -->\n @if (selectedFolders.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\" title=\"{{appLocale.MESSAGE_FOLDER_UPLOADS_NOT_ALLOWED}}\" >\n @for (ft of selectedFolders; track ft) {\n <li class=\"list-group-item file-upload-status\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon fa fa-folder-o\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails\">\n <label class=\"upload-title\">{{ft.name}}</label><br/>\n </p>\n </div>\n <div class=\"media-right media-middle\" >\n <span class=\"status-icon wi wi-cancel text-danger\"></span>\n </div>\n </div>\n </li>\n }\n </ul>\n }\n</div>\n"
|
|
483
|
+
}]
|
|
484
|
+
}],
|
|
485
|
+
ctorParameters: () => [
|
|
486
|
+
{ type: i0__namespace.Injector },
|
|
487
|
+
{ type: i1__namespace.App },
|
|
488
|
+
{
|
|
489
|
+
type: void 0,
|
|
490
|
+
decorators: [{
|
|
491
|
+
type: i0.Attribute,
|
|
492
|
+
args: ["select.event"]
|
|
493
|
+
}]
|
|
494
|
+
},
|
|
495
|
+
{ type: i1__namespace.AbstractDialogService },
|
|
496
|
+
{
|
|
497
|
+
type: void 0,
|
|
498
|
+
decorators: [{
|
|
499
|
+
type: i0.Inject,
|
|
500
|
+
args: ["EXPLICIT_CONTEXT"]
|
|
501
|
+
}, { type: i0.Optional }]
|
|
502
|
+
}
|
|
503
|
+
]
|
|
504
|
+
});
|
|
66
505
|
|
|
67
|
-
|
|
68
|
-
const WIDGET_CONFIG = {
|
|
69
|
-
widgetType: 'wm-fileupload',
|
|
70
|
-
hostClass: DEFAULT_CLS
|
|
71
|
-
};
|
|
72
|
-
class FileUploadComponent extends base.StylableComponent {
|
|
73
|
-
static { this.initializeProps = registerProps(); }
|
|
74
|
-
/*_hasOnSuccessEvt = WM.isDefined(attrs.onSuccess);
|
|
75
|
-
_hasOnErrorEvt = WM.isDefined(attrs.onError);*/
|
|
76
|
-
// Checking if the selected file is valid for the choosen filter type
|
|
77
|
-
isValidFile(filename, contenttype, extensionName, isMobileType) {
|
|
78
|
-
let isValid, contentTypes;
|
|
79
|
-
if (!contenttype) {
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
contentTypes = lodashEs.toLower(contenttype).split(',');
|
|
83
|
-
if (lodashEs.includes(contentTypes, 'image/*') || (lodashEs.includes(contentTypes, 'image') && isMobileType)) {
|
|
84
|
-
isValid = i1.isImageFile(filename);
|
|
85
|
-
// If one of the content type chosen is image and user uploads image it is valid file
|
|
86
|
-
if (isValid) {
|
|
87
|
-
return isValid;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (lodashEs.includes(contentTypes, 'audio/*') || (lodashEs.includes(contentTypes, 'audio') && isMobileType)) {
|
|
91
|
-
isValid = i1.isAudioFile(filename);
|
|
92
|
-
// If one of the content type chosen is audio/* and user uploads audio it is valid file
|
|
93
|
-
if (isValid) {
|
|
94
|
-
return isValid;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (lodashEs.includes(contentTypes, 'video/*') || (lodashEs.includes(contentTypes, 'video') && isMobileType)) {
|
|
98
|
-
isValid = i1.isVideoFile(filename);
|
|
99
|
-
// If one of the content type chosen is video/* and user uploads video it is valid file
|
|
100
|
-
if (isValid) {
|
|
101
|
-
return isValid;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
/*content type and the uploaded file extension should be same*/
|
|
105
|
-
if (lodashEs.includes(contentTypes, '.' + lodashEs.toLower(extensionName))) {
|
|
106
|
-
isValid = true;
|
|
107
|
-
}
|
|
108
|
-
return isValid;
|
|
109
|
-
}
|
|
110
|
-
/* this return the array of files which are having the file size not more than maxfilesize and filters based on contenttype */
|
|
111
|
-
getValidFiles($files) {
|
|
112
|
-
const validFiles = [];
|
|
113
|
-
const errorFiles = [];
|
|
114
|
-
const MAXFILEUPLOAD_SIZE = parseFloat(this.maxfilesize) * this.FILESIZE_MB || this.FILESIZE_MB;
|
|
115
|
-
const MAX_FILE_UPLOAD_FORMATTED_SIZE = (this.maxfilesize || '1') + 'MB';
|
|
116
|
-
// if contenttype is files for mobile projects.
|
|
117
|
-
if (this.chooseFilter === this.DEVICE_CONTENTTYPES.FILES) {
|
|
118
|
-
this.chooseFilter = '';
|
|
119
|
-
}
|
|
120
|
-
lodashEs.forEach($files, (file) => {
|
|
121
|
-
/* check for the file content type before uploading */
|
|
122
|
-
if (!this.isValidFile(file.name, this.chooseFilter, this.getFileExtension(file.name), this._isMobileType)) {
|
|
123
|
-
const msg = `${this.appLocale.LABEL_FILE_EXTENTION_VALIDATION_MESSAGE} ${this.chooseFilter}`;
|
|
124
|
-
this.handleErrorFiles('INVALID_FILE_EXTENSION', msg, file, errorFiles);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (file.size > MAXFILEUPLOAD_SIZE) {
|
|
128
|
-
const msg = `${this.appLocale.LABEL_FILE_EXCEED_VALIDATION_MESSAGE} ${MAX_FILE_UPLOAD_FORMATTED_SIZE}`;
|
|
129
|
-
this.handleErrorFiles('INVALID_FILE_SIZE', msg, file, errorFiles);
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
validFiles.push(file);
|
|
133
|
-
});
|
|
134
|
-
return {
|
|
135
|
-
validFiles: validFiles,
|
|
136
|
-
errorFiles: errorFiles
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
handleErrorFiles(key, msg, file, errorFiles) {
|
|
140
|
-
// Check whether the error callback exist or not. If it exists then dont show taoster message
|
|
141
|
-
if (!this.hasEventCallback('error')) {
|
|
142
|
-
this.app.notifyApp(msg, 'Error');
|
|
143
|
-
}
|
|
144
|
-
const error = {
|
|
145
|
-
key: key,
|
|
146
|
-
message: msg
|
|
147
|
-
};
|
|
148
|
-
file.error = error;
|
|
149
|
-
errorFiles.push(file);
|
|
150
|
-
}
|
|
151
|
-
/*Overwrite the caption only if they are default*/
|
|
152
|
-
getCaption(caption, isMultiple, isMobileType) {
|
|
153
|
-
if (lodashEs.includes(this.DEFAULT_CAPTIONS, caption)) {
|
|
154
|
-
return isMultiple && !isMobileType ? this.DEFAULT_CAPTIONS.MULTIPLE_SELECT : this.DEFAULT_CAPTIONS.SELECT;
|
|
155
|
-
}
|
|
156
|
-
return caption;
|
|
157
|
-
}
|
|
158
|
-
/* change server path based on user option */
|
|
159
|
-
changeServerUploadPath(path) {
|
|
160
|
-
this.selectedUploadTypePath = path;
|
|
161
|
-
}
|
|
162
|
-
/* this function returns the fileextension */
|
|
163
|
-
getFileExtension(fileName) {
|
|
164
|
-
if (fileName && lodashEs.includes(fileName, '.')) {
|
|
165
|
-
return fileName.substring(fileName.lastIndexOf('.') + 1);
|
|
166
|
-
}
|
|
167
|
-
return 'file';
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Calls select Event
|
|
171
|
-
* @param $event
|
|
172
|
-
* @param $files
|
|
173
|
-
*/
|
|
174
|
-
onSelectEventCall($event, $files) {
|
|
175
|
-
$files.forEach(file => {
|
|
176
|
-
file.uniqueId = this.idGenerator.nextUid();
|
|
177
|
-
});
|
|
178
|
-
this.selectedFiles = $files;
|
|
179
|
-
this.uploadedFiles = this.multiple ? [...this.uploadedFiles, ...$files] : $files;
|
|
180
|
-
setTimeout(() => {
|
|
181
|
-
this.invokeEventCallback('select', {
|
|
182
|
-
$event: $.extend($event.$files || {}, $files),
|
|
183
|
-
selectedFiles: $files
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
onFileElemClick($event) {
|
|
188
|
-
this.highlightDropArea = true;
|
|
189
|
-
//The file upload widget value should be set to null to reupload the same file.
|
|
190
|
-
this.$element.find('.file-input')[0].value = null;
|
|
191
|
-
$event.stopPropagation();
|
|
192
|
-
// MEMORY LEAK FIX: Use stored bound function reference
|
|
193
|
-
// when the filepicker is not there on the window, remove the dropzone highlight
|
|
194
|
-
window.addEventListener('focus', this.boundDisableDropZone);
|
|
195
|
-
}
|
|
196
|
-
disableDropZone() {
|
|
197
|
-
this.highlightDropArea = false;
|
|
198
|
-
// MEMORY LEAK FIX: Remove using stored bound function reference
|
|
199
|
-
window.removeEventListener('focus', this.boundDisableDropZone);
|
|
200
|
-
}
|
|
201
|
-
/*this function to clear the specified file. if argument is not provided, it clears the complete list */
|
|
202
|
-
clear(fileObj) {
|
|
203
|
-
this.selectedFiles = (fileObj) ? this.clearFile(this.selectedFiles, fileObj) : [];
|
|
204
|
-
this.uploadedFiles = (fileObj) ? this.clearFile(this.uploadedFiles, fileObj) : [];
|
|
205
|
-
}
|
|
206
|
-
clearFile(files, fileObj) {
|
|
207
|
-
return files.filter((file) => file?._response?.fileName !== fileObj?._response?.fileName || file?.name !== fileObj?.name || file !== fileObj);
|
|
208
|
-
}
|
|
209
|
-
/*this function to set the class names for clear icon */
|
|
210
|
-
setClearIconClass(classValue) {
|
|
211
|
-
this.cleariconclass = classValue;
|
|
212
|
-
}
|
|
213
|
-
/*this function to set the hint for clear icon */
|
|
214
|
-
setClearIconHint(hint) {
|
|
215
|
-
this.cleariconhint = hint;
|
|
216
|
-
}
|
|
217
|
-
/*this function to append upload status dom elements to widget */
|
|
218
|
-
onFileSelect($event, $files) {
|
|
219
|
-
let beforeSelectVal;
|
|
220
|
-
const files = this.getValidFiles($files);
|
|
221
|
-
$files = files.validFiles;
|
|
222
|
-
// If the user has previously tried uploading folders using drop, and then uploading using click method we clear the folders dom
|
|
223
|
-
if ($event.type === "change") {
|
|
224
|
-
this.selectedFolders = [];
|
|
225
|
-
}
|
|
226
|
-
// Trigger error callback event if any invalid file found.
|
|
227
|
-
if (!lodashEs.isEmpty(files.errorFiles)) {
|
|
228
|
-
this.invokeEventCallback('error', {
|
|
229
|
-
$event,
|
|
230
|
-
files: files.errorFiles
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
// Make call if there are valid files else no call is made
|
|
234
|
-
if ($files.length) {
|
|
235
|
-
// EVENT: ON_BEFORE_SELECT
|
|
236
|
-
beforeSelectVal = this.invokeEventCallback('beforeselect', {
|
|
237
|
-
$event: $.extend($event.$files || {}, $files),
|
|
238
|
-
files: $files
|
|
239
|
-
});
|
|
240
|
-
if (this.datasource) {
|
|
241
|
-
if (!this.uploadProgressSubscription) {
|
|
242
|
-
this.progressObservable = new rxjs.Subject();
|
|
243
|
-
this.datasource._progressObservable = this.progressObservable;
|
|
244
|
-
this.uploadProgressSubscription = this.datasource._progressObservable.asObservable().subscribe((progressObj) => {
|
|
245
|
-
lodashEs.forEach(this.uploadedFiles, (file) => {
|
|
246
|
-
if (file.name === progressObj.fileName && file.uniqueId === progressObj.uniqueId) {
|
|
247
|
-
file.progress = progressObj.progress;
|
|
248
|
-
if (file.progress === 100) {
|
|
249
|
-
file.status = 'success';
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
file.status = progressObj.status;
|
|
253
|
-
if (progressObj.errMsg) {
|
|
254
|
-
file.errMsg = progressObj.errMsg;
|
|
255
|
-
this.invokeEventCallback('error', {
|
|
256
|
-
$event,
|
|
257
|
-
files: file
|
|
258
|
-
});
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
this.selectedFiles = $files;
|
|
268
|
-
}
|
|
269
|
-
if (beforeSelectVal !== false) {
|
|
270
|
-
// EVENT: ON_SELECT
|
|
271
|
-
this.onSelectEventCall($event, $files);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
onFileDelete($event, file) {
|
|
276
|
-
if (!file) {
|
|
277
|
-
return;
|
|
278
|
-
}
|
|
279
|
-
const beforeDeleteVal = this.invokeEventCallback('beforedelete', { $event: file });
|
|
280
|
-
if (beforeDeleteVal !== false) {
|
|
281
|
-
this.dialogService.showAppConfirmDialog({
|
|
282
|
-
title: "Delete file",
|
|
283
|
-
message: "Are you sure you want to delete this file?",
|
|
284
|
-
oktext: "Ok",
|
|
285
|
-
canceltext: "Cancel",
|
|
286
|
-
onOk: () => {
|
|
287
|
-
if (this.deletedatasource) {
|
|
288
|
-
this.deletedatasource.setInput('file', file._response.fileName || file.name);
|
|
289
|
-
if (!this.deleteProgressSubscription) {
|
|
290
|
-
this.deleteFileObservable = new rxjs.Subject();
|
|
291
|
-
this.deletedatasource._deleteFileObservable = this.deleteFileObservable;
|
|
292
|
-
this.deletedatasource._deleteFileObservable.asObservable().subscribe((response) => {
|
|
293
|
-
if (response.status === "success") {
|
|
294
|
-
this.selectedFiles = this.selectedFiles.filter((fileObj) => file !== fileObj) || [];
|
|
295
|
-
this.uploadedFiles = this.uploadedFiles.filter((fileObj) => file !== fileObj) || [];
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
this.invokeEventCallback('delete', { $event: file });
|
|
301
|
-
this.dialogService.closeAppConfirmDialog();
|
|
302
|
-
},
|
|
303
|
-
onCancel: () => {
|
|
304
|
-
this.dialogService.closeAppConfirmDialog();
|
|
305
|
-
},
|
|
306
|
-
onOpen: () => {
|
|
307
|
-
$('.cancel-action').focus();
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
// Prevent default behavior (Prevent file from being opened)
|
|
313
|
-
dragOverHandler($event) {
|
|
314
|
-
$event.preventDefault();
|
|
315
|
-
$event.stopPropagation();
|
|
316
|
-
}
|
|
317
|
-
// Get the file data if it exists and call the onFileSelect function
|
|
318
|
-
onFileDrop($event) {
|
|
319
|
-
$event.preventDefault();
|
|
320
|
-
let listOfFiles = [];
|
|
321
|
-
this.selectedFolders = [];
|
|
322
|
-
const filesData = $event.dataTransfer.items;
|
|
323
|
-
if (filesData.length > 0) {
|
|
324
|
-
// Use DataTransferItemList interface to access the file(s)
|
|
325
|
-
for (let i = 0; i < filesData.length; i++) {
|
|
326
|
-
// Get all the files and push them into an array
|
|
327
|
-
if (filesData[i].webkitGetAsEntry().isFile) {
|
|
328
|
-
listOfFiles.push(filesData[i].getAsFile());
|
|
329
|
-
}
|
|
330
|
-
// If a selected item is directory push the folder element into an array and display error message by adding to dom
|
|
331
|
-
else if (filesData[i].webkitGetAsEntry().isDirectory) {
|
|
332
|
-
this.selectedFolders.push(filesData[i].getAsFile());
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
this.onFileSelect($event, listOfFiles);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
dragOverCb(e) {
|
|
339
|
-
e.preventDefault();
|
|
340
|
-
$(this.nativeElement).find('#dropzone').addClass('highlight-drop-box');
|
|
341
|
-
}
|
|
342
|
-
dropCb() {
|
|
343
|
-
$(this.nativeElement).find('#dropzone').removeClass('highlight-drop-box');
|
|
344
|
-
}
|
|
345
|
-
// this function triggers file select window, when clicked anywhere on the file upload widget in case of multi select
|
|
346
|
-
triggerFileSelect() {
|
|
347
|
-
this.$element.find('.file-input').trigger('click');
|
|
348
|
-
}
|
|
349
|
-
/**
|
|
350
|
-
* Aborts a file upload request
|
|
351
|
-
* @param $file, the file for which the request is to be aborted
|
|
352
|
-
*/
|
|
353
|
-
abortFileUpload($file) {
|
|
354
|
-
this.datasource.execute(i1.DataSource.Operation.CANCEL, $file);
|
|
355
|
-
}
|
|
356
|
-
isMimeType(file) {
|
|
357
|
-
return (this.defaultAllowedExtensions.includes('image/*') && i1.isImageFile(file))
|
|
358
|
-
|| (this.defaultAllowedExtensions.includes('audio/*') && i1.isAudioFile(file))
|
|
359
|
-
|| (this.defaultAllowedExtensions.includes('video/*') && i1.isVideoFile(file));
|
|
360
|
-
}
|
|
361
|
-
/* Define the property change handler. This function will be triggered when there is a change in the widget property */
|
|
362
|
-
onPropertyChange(key, nv, ov) {
|
|
363
|
-
/*Monitoring changes for styles or properties and accordingly handling respective changes.*/
|
|
364
|
-
switch (key) {
|
|
365
|
-
case 'uploadpath':
|
|
366
|
-
// TODO Srinivas: why do we need uploadpath
|
|
367
|
-
this.changeServerUploadPath(nv);
|
|
368
|
-
break;
|
|
369
|
-
case 'contenttype':
|
|
370
|
-
if (this.defaultAllowedExtensions.includes('*/*')) {
|
|
371
|
-
this.chooseFilter = nv.split(' ').join(',');
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
this.chooseFilter = nv.split(' ').filter(item => this.defaultAllowedExtensions.includes(item) || this.isMimeType(item)).join(',');
|
|
375
|
-
if (lodashEs.isEmpty(this.chooseFilter)) {
|
|
376
|
-
this.chooseFilter = this.defaultAllowedExtensions;
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
break;
|
|
380
|
-
case 'multiple':
|
|
381
|
-
this.formName = this.name + (this.multiple ? '-multiple-fileupload' : '-single-fileupload');
|
|
382
|
-
this.caption = this.getCaption(this.caption, this.multiple, this._isMobileType);
|
|
383
|
-
break;
|
|
384
|
-
case 'fileuploadmessage':
|
|
385
|
-
this.fileUploadMessage = nv;
|
|
386
|
-
}
|
|
387
|
-
super.onPropertyChange(key, nv, ov);
|
|
388
|
-
}
|
|
389
|
-
constructor(inj, app, onSelectEvt, dialogService, explicitContext) {
|
|
390
|
-
super(inj, WIDGET_CONFIG, explicitContext);
|
|
391
|
-
this.app = app;
|
|
392
|
-
this.onSelectEvt = onSelectEvt;
|
|
393
|
-
this.dialogService = dialogService;
|
|
394
|
-
this.selectedFiles = [];
|
|
395
|
-
this.uploadedFiles = [];
|
|
396
|
-
this.selectedFolders = [];
|
|
397
|
-
this.fileTransfers = {};
|
|
398
|
-
this.caption = 'Upload';
|
|
399
|
-
this.formName = '';
|
|
400
|
-
this.DEFAULT_CAPTIONS = {
|
|
401
|
-
MULTIPLE_SELECT: 'Drop your files here.',
|
|
402
|
-
SELECT: 'Select'
|
|
403
|
-
};
|
|
404
|
-
this.DEVICE_CONTENTTYPES = {
|
|
405
|
-
IMAGE: 'image',
|
|
406
|
-
VIDEO: 'video',
|
|
407
|
-
AUDIO: 'audio',
|
|
408
|
-
FILES: 'files'
|
|
409
|
-
};
|
|
410
|
-
this.FILESIZE_MB = 1048576;
|
|
411
|
-
// parentPrefabScope = element.closest('.app-prefab').isolateScope(),
|
|
412
|
-
this.CONSTANT_FILE_SERVICE = 'FileService';
|
|
413
|
-
this.uploadData = {
|
|
414
|
-
file: undefined,
|
|
415
|
-
uploadPath: undefined
|
|
416
|
-
};
|
|
417
|
-
this.allowedFileUploadExtensions = i1.getWmProjectProperties().allowedFileUploadExtensions;
|
|
418
|
-
this.defaultAllowedExtensions = this.allowedFileUploadExtensions.split(',').map(item => item.trim()).map(item => item.endsWith('/*') ? item : `.${item}`);
|
|
419
|
-
this.chooseFilter = this.defaultAllowedExtensions.includes('*/*') ? '' : this.defaultAllowedExtensions;
|
|
420
|
-
this.fileUploadMessage = 'Drop your files here or click here to browse';
|
|
421
|
-
this.idGenerator = new i1.IDGenerator('file-');
|
|
422
|
-
this.uploadUrl = 'services';
|
|
423
|
-
// styler(this.nativeElement, this);
|
|
424
|
-
}
|
|
425
|
-
ngOnInit() {
|
|
426
|
-
super.ngOnInit();
|
|
427
|
-
// MEMORY LEAK FIX: Store bound function references for proper removal
|
|
428
|
-
this.boundDragOverCb = this.dragOverCb.bind(this);
|
|
429
|
-
this.boundDropCb = this.dropCb.bind(this);
|
|
430
|
-
this.boundDisableDropZone = this.disableDropZone.bind(this);
|
|
431
|
-
// adding, dragover and drop on the document as when file is dragged on to the page highlight the dropzones and remove highlight on file drop
|
|
432
|
-
document.addEventListener('dragover', this.boundDragOverCb);
|
|
433
|
-
document.addEventListener('drop', this.boundDropCb);
|
|
434
|
-
// adding mouseleave evnt to remove highlight when file is dropped outside the window
|
|
435
|
-
document.addEventListener('mouseleave', this.boundDropCb);
|
|
436
|
-
}
|
|
437
|
-
ngAfterViewInit() {
|
|
438
|
-
base.styler(this.nativeElement.querySelector('.app-button, .drop-box'), this);
|
|
439
|
-
}
|
|
440
|
-
ngOnDestroy() {
|
|
441
|
-
// MEMORY LEAK FIX: Remove using stored bound function references
|
|
442
|
-
if (this.boundDragOverCb) {
|
|
443
|
-
document.removeEventListener('dragover', this.boundDragOverCb);
|
|
444
|
-
this.boundDragOverCb = null;
|
|
445
|
-
}
|
|
446
|
-
if (this.boundDropCb) {
|
|
447
|
-
document.removeEventListener('drop', this.boundDropCb);
|
|
448
|
-
document.removeEventListener('mouseleave', this.boundDropCb);
|
|
449
|
-
this.boundDropCb = null;
|
|
450
|
-
}
|
|
451
|
-
if (this.boundDisableDropZone) {
|
|
452
|
-
window.removeEventListener('focus', this.boundDisableDropZone);
|
|
453
|
-
this.boundDisableDropZone = null;
|
|
454
|
-
}
|
|
455
|
-
super.ngOnDestroy();
|
|
456
|
-
const subscriptions = [this.uploadProgressSubscription, this.deleteProgressSubscription];
|
|
457
|
-
subscriptions.forEach(subscription => {
|
|
458
|
-
if (subscription) {
|
|
459
|
-
subscription.unsubscribe();
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
static { this.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: FileUploadComponent, deps: [{ token: i0__namespace.Injector }, { token: i1__namespace.App }, { token: 'select.event', attribute: true }, { token: i1__namespace.AbstractDialogService }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component }); }
|
|
464
|
-
static { this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: FileUploadComponent, isStandalone: true, selector: "[wmFileUpload]", providers: [
|
|
465
|
-
base.provideAsWidgetRef(FileUploadComponent)
|
|
466
|
-
], usesInheritance: true, ngImport: i0__namespace, template: "<div class=\"app-fileupload\" init-widget>\n <!-- drag and drop files UI in web -->\n @if (!_isMobileType && multiple) {\n <div class=\"app-multi-file-upload\">\n <div id=\"dropzone\" class=\"drop-box\" (click)=\"triggerFileSelect()\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\" (dragover)=\"dragOverHandler($event);\" (drop)=\"onFileDrop($event);\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <div class=\"message\">\n <label [innerHtml]=\"caption\" class=\"upload-label\"></label>\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n @if (multiple) {\n <input class=\"file-input\" [attr.aria-label]=\"hint || 'File selection field'\" type=\"file\" name=\"files\" [disabled]=\"disabled\" [accept]=\"chooseFilter\" (click)=\"onFileElemClick($event)\" (change)=\"onFileSelect($event, $event.target.files)\" multiple >\n }\n <a class=\"app-anchor upload-label\" href=\"javascript:void(0);\">{{ fileUploadMessage }}</a>\n </form>\n @if (chooseFilter) {\n <label [innerHtml]=\"chooseFilter + ' only '\" class=\"upload-extensions\"></label>\n }\n @if (chooseFilter && maxfilesize) {\n <span class=\"upload-extensions\"> . </span>\n }\n @if (maxfilesize) {\n <label [innerHtml]=\"maxfilesize + 'MB max'\" class=\"upload-extensions\"></label>\n }\n </div>\n </div>\n </div>\n }\n <!-- single file upload in web and single , multiple file upload UI in mobile runmode -->\n @if ((!multiple || _isMobileType)) {\n <div class=\"app-single-file-upload\">\n <div class=\"app-button-wrapper\">\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n <!-- support for file upload in Mobileapp in its runmode (Web) -->\n @if (multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n multiple name=\"files\" type=\"file\">\n }\n @if (!multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n name=\"files\" type=\"file\">\n }\n <button id=\"dropzone\" focus-target class=\"app-button btn btn-default\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <span class=\"caption\" [innerHTML]=\"caption\"></span>\n </button>\n </form>\n </div>\n <div class=\"app-files-upload-status single\"></div>\n </div>\n }\n <!-- list of selectedfiles UI -->\n @if (uploadedFiles.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\"\n tabindex=\"0\">\n @for (ft of uploadedFiles; track ft) {\n @if (ft.status !== 'abort') {\n <li class=\"list-group-item file-upload-status\" tabindex=\"0\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon {{getFileExtension(ft.name) | fileIconClass}}\" title=\"{{getFileExtension(ft.name)}}\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails col-md-3\">\n <span class=\"upload-title\">{{ ft.storageName || ft.name }}</span>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"></span>\n }\n <br/>\n @if (ft.fileLength !== 0) {\n <span class=\"filesize\">{{ft.size | filesize:0}}</span>\n }\n @if (ft.status === 'error') {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"\n title=\"{{ft.errMsg || appLocale.MESSAGE_FILE_UPLOAD_FAILED}}\"></span>\n }\n @if (ft.status === 'error') {\n <span class=\"error-message\">Upload Failed</span>\n }\n </p>\n @if (ft.status === 'onProgress' || showprogressbar) {\n <div\n class=\"progress col-md-7 upload-progress\">\n <div [ngClass]=\"ft.status === 'error' ? 'progress-bar-danger' : 'progress-bar-info'\"\n [ngStyle]=\"{width: (ft.progress +'%')}\"\n class=\"progress-bar progress-bar-striped\"></div>\n </div>\n }\n @if ((ft.status === 'onProgress' || showprogressbar && showprogressbarpercentage) && ft.progress ) {\n <div\n class=\"col-md-1 upload-progress-percentage\">{{ ft.progress + '%' }}\n </div>\n }\n </div>\n @if (ft.status === 'onProgress' || ft.status === 'queued') {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" class=\"btn btn-transparent file-upload-stop\" type=\"button\"\n (click)=\"abortFileUpload(ft)\">\n <i class=\"wi wi-close\"></i>\n </a>\n </div>\n }\n <div class=\"media-right media-middle\">\n @if ((cleariconclass !== '' || cleariconurl) && ft.status !== 'onProgress') {\n <a href=\"javascript:void(0)\" (click)=\"clear(ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{cleariconhint}}\" type=\"button\">\n <wm-app-icon [iconclass]=\"cleariconclass\" [iconurl]=\"cleariconurl\" alt=\"Clear\"></wm-app-icon>\n </a>\n }\n </div>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" (click)=\"onFileDelete($event, ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{deleteiconhint}}\" type=\"button\">\n <i class=\"wi wi-delete\"></i>\n </a>\n </div>\n }\n </div>\n </li>\n }\n }\n </ul>\n }\n <!-- list of selectedfolders UI to show the error in title -->\n @if (selectedFolders.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\" title=\"{{appLocale.MESSAGE_FOLDER_UPLOADS_NOT_ALLOWED}}\" >\n @for (ft of selectedFolders; track ft) {\n <li class=\"list-group-item file-upload-status\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon fa fa-folder-o\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails\">\n <label class=\"upload-title\">{{ft.name}}</label><br/>\n </p>\n </div>\n <div class=\"media-right media-middle\" >\n <span class=\"status-icon wi wi-cancel text-danger\"></span>\n </div>\n </div>\n </li>\n }\n </ul>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: i2.CommonModule }, { kind: "directive", type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: base.WmAppIconComponent, selector: "wm-app-icon", inputs: ["icon", "iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }, { kind: "pipe", type: base.FileIconClassPipe, name: "fileIconClass" }, { kind: "pipe", type: base.StateClassPipe, name: "stateClass" }, { kind: "pipe", type: base.FileSizePipe, name: "filesize" }] }); }
|
|
467
|
-
}
|
|
468
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: FileUploadComponent, decorators: [{
|
|
469
|
-
type: i0.Component,
|
|
470
|
-
args: [{ standalone: true, imports: [i2.CommonModule, base.FileIconClassPipe, base.StateClassPipe, base.FileSizePipe, base.WmAppIconComponent], selector: '[wmFileUpload]', providers: [
|
|
471
|
-
base.provideAsWidgetRef(FileUploadComponent)
|
|
472
|
-
], template: "<div class=\"app-fileupload\" init-widget>\n <!-- drag and drop files UI in web -->\n @if (!_isMobileType && multiple) {\n <div class=\"app-multi-file-upload\">\n <div id=\"dropzone\" class=\"drop-box\" (click)=\"triggerFileSelect()\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\" (dragover)=\"dragOverHandler($event);\" (drop)=\"onFileDrop($event);\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <div class=\"message\">\n <label [innerHtml]=\"caption\" class=\"upload-label\"></label>\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n @if (multiple) {\n <input class=\"file-input\" [attr.aria-label]=\"hint || 'File selection field'\" type=\"file\" name=\"files\" [disabled]=\"disabled\" [accept]=\"chooseFilter\" (click)=\"onFileElemClick($event)\" (change)=\"onFileSelect($event, $event.target.files)\" multiple >\n }\n <a class=\"app-anchor upload-label\" href=\"javascript:void(0);\">{{ fileUploadMessage }}</a>\n </form>\n @if (chooseFilter) {\n <label [innerHtml]=\"chooseFilter + ' only '\" class=\"upload-extensions\"></label>\n }\n @if (chooseFilter && maxfilesize) {\n <span class=\"upload-extensions\"> . </span>\n }\n @if (maxfilesize) {\n <label [innerHtml]=\"maxfilesize + 'MB max'\" class=\"upload-extensions\"></label>\n }\n </div>\n </div>\n </div>\n }\n <!-- single file upload in web and single , multiple file upload UI in mobile runmode -->\n @if ((!multiple || _isMobileType)) {\n <div class=\"app-single-file-upload\">\n <div class=\"app-button-wrapper\">\n <form class=\"form-horizontal\" name=\"{{formName}}\">\n <!-- support for file upload in Mobileapp in its runmode (Web) -->\n @if (multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n multiple name=\"files\" type=\"file\">\n }\n @if (!multiple) {\n <input (change)=\"onFileSelect($event, $event.target.files)\" (click)=\"onFileElemClick($event)\"\n [accept]=\"chooseFilter\" [attr.aria-label]=\"arialabel || 'File selection field'\" [disabled]=\"disabled\" class=\"file-input\"\n name=\"files\" type=\"file\">\n }\n <button id=\"dropzone\" focus-target class=\"app-button btn btn-default\" [ngClass]=\"{'highlight-drop-box' : highlightDropArea}\">\n <wm-app-icon [iconclass]=\"iconclass\" [iconurl]=\"iconurl\" alt=\"Upload\"></wm-app-icon>\n <span class=\"caption\" [innerHTML]=\"caption\"></span>\n </button>\n </form>\n </div>\n <div class=\"app-files-upload-status single\"></div>\n </div>\n }\n <!-- list of selectedfiles UI -->\n @if (uploadedFiles.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\"\n tabindex=\"0\">\n @for (ft of uploadedFiles; track ft) {\n @if (ft.status !== 'abort') {\n <li class=\"list-group-item file-upload-status\" tabindex=\"0\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon {{getFileExtension(ft.name) | fileIconClass}}\" title=\"{{getFileExtension(ft.name)}}\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails col-md-3\">\n <span class=\"upload-title\">{{ ft.storageName || ft.name }}</span>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"></span>\n }\n <br/>\n @if (ft.fileLength !== 0) {\n <span class=\"filesize\">{{ft.size | filesize:0}}</span>\n }\n @if (ft.status === 'error') {\n <span\n class=\"status-icon {{ft.status | stateClass }}\"\n title=\"{{ft.errMsg || appLocale.MESSAGE_FILE_UPLOAD_FAILED}}\"></span>\n }\n @if (ft.status === 'error') {\n <span class=\"error-message\">Upload Failed</span>\n }\n </p>\n @if (ft.status === 'onProgress' || showprogressbar) {\n <div\n class=\"progress col-md-7 upload-progress\">\n <div [ngClass]=\"ft.status === 'error' ? 'progress-bar-danger' : 'progress-bar-info'\"\n [ngStyle]=\"{width: (ft.progress +'%')}\"\n class=\"progress-bar progress-bar-striped\"></div>\n </div>\n }\n @if ((ft.status === 'onProgress' || showprogressbar && showprogressbarpercentage) && ft.progress ) {\n <div\n class=\"col-md-1 upload-progress-percentage\">{{ ft.progress + '%' }}\n </div>\n }\n </div>\n @if (ft.status === 'onProgress' || ft.status === 'queued') {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" class=\"btn btn-transparent file-upload-stop\" type=\"button\"\n (click)=\"abortFileUpload(ft)\">\n <i class=\"wi wi-close\"></i>\n </a>\n </div>\n }\n <div class=\"media-right media-middle\">\n @if ((cleariconclass !== '' || cleariconurl) && ft.status !== 'onProgress') {\n <a href=\"javascript:void(0)\" (click)=\"clear(ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{cleariconhint}}\" type=\"button\">\n <wm-app-icon [iconclass]=\"cleariconclass\" [iconurl]=\"cleariconurl\" alt=\"Clear\"></wm-app-icon>\n </a>\n }\n </div>\n @if (ft.status === 'success' && (!datasource || (datasource && ft._response?.success))) {\n <div class=\"media-right media-middle\">\n <a href=\"javascript:void(0)\" (click)=\"onFileDelete($event, ft)\"\n class=\"btn btn-transparent btn-default status-icon\" title=\"{{deleteiconhint}}\" type=\"button\">\n <i class=\"wi wi-delete\"></i>\n </a>\n </div>\n }\n </div>\n </li>\n }\n }\n </ul>\n }\n <!-- list of selectedfolders UI to show the error in title -->\n @if (selectedFolders.length > 0) {\n <ul class=\"list-group file-upload\" [ngStyle]=\"{height: filelistheight, overflow: overflow}\" title=\"{{appLocale.MESSAGE_FOLDER_UPLOADS_NOT_ALLOWED}}\" >\n @for (ft of selectedFolders; track ft) {\n <li class=\"list-group-item file-upload-status\">\n <div class=\"media upload-file-list\">\n <div class=\"media-left media-middle file-icon fa fa-folder-o\"></div>\n <div class=\"media-body media-middle file-details\">\n <p class=\"uploaddetails\">\n <label class=\"upload-title\">{{ft.name}}</label><br/>\n </p>\n </div>\n <div class=\"media-right media-middle\" >\n <span class=\"status-icon wi wi-cancel text-danger\"></span>\n </div>\n </div>\n </li>\n }\n </ul>\n }\n</div>\n" }]
|
|
473
|
-
}], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: i1__namespace.App }, { type: undefined, decorators: [{
|
|
474
|
-
type: i0.Attribute,
|
|
475
|
-
args: ['select.event']
|
|
476
|
-
}] }, { type: i1__namespace.AbstractDialogService }, { type: undefined, decorators: [{
|
|
477
|
-
type: i0.Inject,
|
|
478
|
-
args: ['EXPLICIT_CONTEXT']
|
|
479
|
-
}, {
|
|
480
|
-
type: i0.Optional
|
|
481
|
-
}] }] });
|
|
482
|
-
|
|
483
|
-
exports.FileUploadComponent = FileUploadComponent;
|
|
506
|
+
exports.FileUploadComponent = FileUploadComponent;
|
|
484
507
|
|
|
485
508
|
}));
|