@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,889 +1,856 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/forms'), require('@angular/core'), require('@wm/core'), require('@wm/components/base'), require('lodash-es'), require('ngx-bootstrap/pagination'), require('ngx-bootstrap/dropdown')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/forms', '@angular/core', '@wm/core', '@wm/components/base', 'lodash-es', 'ngx-bootstrap/pagination', 'ngx-bootstrap/dropdown'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.data = global.wm.components.data || {}, global.wm.components.data.pagination = {}), global.ng.common, global.ng.forms, global.ng.core, global.wm.core, global.wm.components.base, global._, global.ngxBootstrap.pagination, global.ngxBootstrap.dropdown));
|
|
5
5
|
})(this, (function (exports, i1, i2, i0, core, base, lodashEs, i3, i4) { '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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
|
|
25
|
+
var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
|
|
26
|
+
var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
|
|
27
|
+
var i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
|
|
28
|
+
var i4__namespace = /*#__PURE__*/_interopNamespaceDefault(i4);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
const registerProps = () => {
|
|
31
|
+
base.register("wm-pagination", /* @__PURE__ */ new Map([
|
|
32
|
+
["boundarylinks", {
|
|
33
|
+
value: false,
|
|
34
|
+
...base.PROP_BOOLEAN
|
|
35
|
+
}],
|
|
36
|
+
["class", base.PROP_STRING],
|
|
37
|
+
["dataset", base.PROP_ANY],
|
|
38
|
+
["directionlinks", {
|
|
39
|
+
value: true,
|
|
40
|
+
...base.PROP_BOOLEAN
|
|
41
|
+
}],
|
|
42
|
+
["forceellipses", {
|
|
43
|
+
value: true,
|
|
44
|
+
...base.PROP_BOOLEAN
|
|
45
|
+
}],
|
|
46
|
+
["allowpagesizechange", {
|
|
47
|
+
value: false,
|
|
48
|
+
...base.PROP_BOOLEAN
|
|
49
|
+
}],
|
|
50
|
+
["allowpagesizechange", {
|
|
51
|
+
value: false,
|
|
52
|
+
...base.PROP_BOOLEAN
|
|
53
|
+
}],
|
|
54
|
+
["pagesizeoptions", {
|
|
55
|
+
value: "",
|
|
56
|
+
...base.PROP_STRING
|
|
57
|
+
}],
|
|
58
|
+
["maxResults", base.PROP_NUMBER],
|
|
59
|
+
["maxsize", {
|
|
60
|
+
value: 5,
|
|
61
|
+
...base.PROP_NUMBER
|
|
62
|
+
}],
|
|
63
|
+
["name", base.PROP_STRING],
|
|
64
|
+
["navigation", {
|
|
65
|
+
value: "Basic",
|
|
66
|
+
...base.PROP_STRING
|
|
67
|
+
}],
|
|
68
|
+
["navigationalign", {
|
|
69
|
+
value: "left",
|
|
70
|
+
...base.PROP_STRING
|
|
71
|
+
}],
|
|
72
|
+
["navigationsize", base.PROP_STRING],
|
|
73
|
+
["show", {
|
|
74
|
+
value: true,
|
|
75
|
+
...base.PROP_BOOLEAN
|
|
76
|
+
}],
|
|
77
|
+
["showrecordcount", base.PROP_BOOLEAN],
|
|
78
|
+
["tabindex", {
|
|
79
|
+
value: 0,
|
|
80
|
+
...base.PROP_NUMBER
|
|
81
|
+
}]
|
|
82
|
+
]));
|
|
83
|
+
};
|
|
84
|
+
const WIDGET_CONFIG = {
|
|
85
|
+
widgetType: "wm-pagination",
|
|
86
|
+
hostClass: "app-datanavigator clearfix"
|
|
87
|
+
};
|
|
88
|
+
const sizeClasses = {
|
|
89
|
+
"Pager": {
|
|
90
|
+
"small": "pager-sm",
|
|
91
|
+
"large": "pager-lg"
|
|
92
|
+
},
|
|
93
|
+
"Basic": {
|
|
94
|
+
"small": "pagination-sm",
|
|
95
|
+
"large": "pagination-lg"
|
|
96
|
+
},
|
|
97
|
+
"Classic": {
|
|
98
|
+
"small": "pagination-sm",
|
|
99
|
+
"large": "pagination-lg"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var PaginationComponent = class PaginationComponent extends base.StylableComponent {
|
|
103
|
+
static {
|
|
104
|
+
this.initializeProps = registerProps();
|
|
105
|
+
}
|
|
106
|
+
_setAriaForBasicNavigation() {
|
|
107
|
+
lodashEs.forEach(this.nativeElement.getElementsByTagName("a"), (item) => {
|
|
108
|
+
item.setAttribute("href", "javascript:void(0);");
|
|
109
|
+
const childNode = item.querySelector("span");
|
|
110
|
+
if (childNode?.dataset.isacitvepage === "true") item.setAttribute("aria-current", "true");
|
|
111
|
+
if (childNode?.dataset.isdisabled === "true") item.setAttribute("aria-disabled", "true");
|
|
112
|
+
else item.removeAttribute("aria-disabled");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
constructor(inj, parent, explicitContext) {
|
|
116
|
+
super(inj, WIDGET_CONFIG, explicitContext);
|
|
117
|
+
this.parent = parent;
|
|
118
|
+
this.resultEmitter = new i0.EventEmitter();
|
|
119
|
+
this.maxResultsEmitter = new i0.EventEmitter();
|
|
120
|
+
this.defaultPageSizeOptions = [];
|
|
121
|
+
this.focusedIndex = 0;
|
|
122
|
+
this.dn = { currentPage: 1 };
|
|
123
|
+
this.pageCount = 0;
|
|
124
|
+
this.isDisableNext = true;
|
|
125
|
+
this.isDisablePrevious = true;
|
|
126
|
+
this.isDisableFirst = true;
|
|
127
|
+
this.isDisableLast = true;
|
|
128
|
+
this._debouncedApplyDataset = core.debounce(() => this.widget.dataset = this.dataset, base.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
|
|
129
|
+
this._debouncedPageChanged = core.debounce((event) => {
|
|
130
|
+
const currentPage = event?.page;
|
|
131
|
+
const maxResults = event && (event.pagesize || event.itemsPerPage) || this.maxResults;
|
|
132
|
+
if (currentPage !== this.dn.currentPage || this.maxResults !== maxResults) {
|
|
133
|
+
const inst = this.parent || this;
|
|
134
|
+
this.dn.currentPage = currentPage;
|
|
135
|
+
this.maxResults = maxResults;
|
|
136
|
+
this.maxResultsEmitter.emit(this.maxResults);
|
|
137
|
+
inst.invokeEventCallback("paginationchange", {
|
|
138
|
+
$event: void 0,
|
|
139
|
+
$index: this.dn.currentPage
|
|
140
|
+
});
|
|
141
|
+
this.goToPage();
|
|
142
|
+
if (this.navigation === "Basic") this._setAriaForBasicNavigation();
|
|
143
|
+
}
|
|
144
|
+
}, base.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
|
|
145
|
+
base.styler(this.nativeElement, this);
|
|
146
|
+
this._initTimeoutId = setTimeout(() => {
|
|
147
|
+
if (this.isDestroyed || !this.parent) return;
|
|
148
|
+
this.allowpagesizechange = this.parent.allowpagesizechange;
|
|
149
|
+
if (this.allowpagesizechange) this.defaultPageSizeOptions = this.normalizeToNumberArray(this.parent?.pagesizeoptions);
|
|
150
|
+
}, 0);
|
|
151
|
+
}
|
|
152
|
+
normalizeToNumberArray(input) {
|
|
153
|
+
if (!input) return [];
|
|
154
|
+
let arr;
|
|
155
|
+
if (Array.isArray(input)) arr = input;
|
|
156
|
+
else if (typeof input === "string") {
|
|
157
|
+
const trimmed = input.trim();
|
|
158
|
+
if (trimmed.startsWith("[") && trimmed.endsWith("]")) try {
|
|
159
|
+
arr = JSON.parse(trimmed);
|
|
160
|
+
} catch {
|
|
161
|
+
arr = [];
|
|
162
|
+
}
|
|
163
|
+
else arr = trimmed.split(",");
|
|
164
|
+
} else return [];
|
|
165
|
+
return arr.map((v) => Number(v)).filter((v) => !isNaN(v)).sort((a, b) => a - b);
|
|
166
|
+
}
|
|
167
|
+
setResult(result) {
|
|
168
|
+
this.result = result;
|
|
169
|
+
this.resultEmitter.emit(this.result);
|
|
170
|
+
}
|
|
171
|
+
updateNavSize() {
|
|
172
|
+
const sizeCls = sizeClasses[this.navcontrols];
|
|
173
|
+
if (sizeCls && this.navigationsize) this.navigationClass = sizeCls[this.navigationsize];
|
|
174
|
+
else this.navigationClass = "";
|
|
175
|
+
}
|
|
176
|
+
resetPageNavigation() {
|
|
177
|
+
this.pageCount = 0;
|
|
178
|
+
this.dn.currentPage = 1;
|
|
179
|
+
this.dataSize = 0;
|
|
180
|
+
}
|
|
181
|
+
calculatePagingValues() {
|
|
182
|
+
this.pageCount = this.dataSize > this.maxResults ? Math.ceil(this.dataSize / this.maxResults) : this.dataSize < 0 ? 0 : 1;
|
|
183
|
+
this.dn.currentPage = this.dn.currentPage || 1;
|
|
184
|
+
}
|
|
185
|
+
setDefaultPagingValues(dataSize, maxResults, currentPage) {
|
|
186
|
+
if (!dataSize && !maxResults) {
|
|
187
|
+
this.pageCount = 1;
|
|
188
|
+
this.dn.currentPage = 1;
|
|
189
|
+
this.maxResults = dataSize;
|
|
190
|
+
this.dataSize = dataSize;
|
|
191
|
+
} else {
|
|
192
|
+
this.maxResults = maxResults || this.maxResults;
|
|
193
|
+
this.dataSize = core.isDefined(dataSize) ? dataSize : this.dataSize;
|
|
194
|
+
this.dn.currentPage = currentPage || this.dn.currentPage;
|
|
195
|
+
this.calculatePagingValues();
|
|
196
|
+
}
|
|
197
|
+
this.maxResultsEmitter.emit(this.maxResults);
|
|
198
|
+
}
|
|
199
|
+
checkDataSize(dataSize, numberOfElements, size) {
|
|
200
|
+
if (dataSize === -1 || dataSize === core.AppConstants.INT_MAX_VALUE) {
|
|
201
|
+
this.prevshowrecordcount = this.showrecordcount;
|
|
202
|
+
this.isDisableLast = true;
|
|
203
|
+
this.isDisableCount = true;
|
|
204
|
+
this.showrecordcount = false;
|
|
205
|
+
if (numberOfElements < size) this.isDisableNext = true;
|
|
206
|
+
} else {
|
|
207
|
+
this.isDisableCount = false;
|
|
208
|
+
this.showrecordcount = this.prevshowrecordcount || this.showrecordcount;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
disableNavigation() {
|
|
212
|
+
const isCurrentPageFirst = this.dn.currentPage === 1, isCurrentPageLast = this.dn.currentPage === this.pageCount;
|
|
213
|
+
if (!this.pagination?.next) {
|
|
214
|
+
this.isDisableFirst = this.isDisablePrevious = isCurrentPageFirst;
|
|
215
|
+
this.isDisableNext = this.isDisableLast = isCurrentPageLast;
|
|
216
|
+
} else {
|
|
217
|
+
this.isDisableFirst = this.isDisablePrevious = !this.pagination.prev;
|
|
218
|
+
this.isDisableNext = this.isDisableLast = !this.pagination.next;
|
|
219
|
+
}
|
|
220
|
+
this.isDisableCurrent = isCurrentPageFirst && isCurrentPageLast;
|
|
221
|
+
if (this.dataset?.length && this.isDisableNext && this.parent.onDemandLoad && this.parent.widgetType === "wm-table") this.parent.callDataGridMethod("hideLoadingIndicator", this.isDisableNext, this.parent.infScroll);
|
|
222
|
+
}
|
|
223
|
+
isDataSourceHasPaging() {
|
|
224
|
+
return this.datasource?.execute(core.DataSource.Operation.IS_PAGEABLE);
|
|
225
|
+
}
|
|
226
|
+
getPaginationStartIndex() {
|
|
227
|
+
const startIndex = this.datasource?._paginationConfig?.paginationStartIndex;
|
|
228
|
+
return core.isDefined(startIndex) && this.datasource?._paginationConfig?.type === "page" ? Number(startIndex) : 1;
|
|
229
|
+
}
|
|
230
|
+
getPageDetails(startIndex, endIndex, totalRecords) {
|
|
231
|
+
this.rowSummary = core.isDefined(startIndex) && core.isDefined(endIndex) && core.isDefined(totalRecords) ? {
|
|
232
|
+
startIndex,
|
|
233
|
+
endIndex,
|
|
234
|
+
totalRecords
|
|
235
|
+
} : {};
|
|
236
|
+
}
|
|
237
|
+
setNonPageableData(newVal) {
|
|
238
|
+
let dataSize, maxResults, currentPage, startIndex;
|
|
239
|
+
dataSize = lodashEs.isArray(newVal) ? newVal.length : lodashEs.isEmpty(newVal) ? 0 : 1;
|
|
240
|
+
maxResults = this.options?.maxResults || dataSize;
|
|
241
|
+
if (this.allowpagesizechange) maxResults = this.maxResults;
|
|
242
|
+
if (this.datasource && (this.datasource.execute(core.DataSource.Operation.IS_API_AWARE) || this.parent.widgetType === "wm-table" && this.parent.gridOptions.isNavTypeScrollOrOndemand() && (lodashEs.get(this.parent, "gridOptions.lastActionPerformed") === this.parent.gridOptions.ACTIONS.DATASET_UPDATE || !lodashEs.get(this.parent, "gridOptions.isNextPageData")))) currentPage = 1;
|
|
243
|
+
else currentPage = this.dn.currentPage || 1;
|
|
244
|
+
this.setDefaultPagingValues(dataSize, maxResults, currentPage);
|
|
245
|
+
this.disableNavigation();
|
|
246
|
+
startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
247
|
+
this.getPageDetails(startIndex + 1, Math.min(startIndex + this.maxResults, newVal?.length), newVal?.length);
|
|
248
|
+
this.setResult(lodashEs.isArray(newVal) ? newVal.slice(startIndex, startIndex + this.maxResults) : newVal);
|
|
249
|
+
}
|
|
250
|
+
setPagingValues(newVal) {
|
|
251
|
+
let dataSize, maxResults, currentPage, startIndex, dataSource;
|
|
252
|
+
let variableOptions = {};
|
|
253
|
+
this.__fullData = newVal;
|
|
254
|
+
if (this.binddataset) {
|
|
255
|
+
dataSource = this.datasource || {};
|
|
256
|
+
variableOptions = dataSource._options || {};
|
|
257
|
+
if (newVal) {
|
|
258
|
+
if (this.isDataSourceHasPaging()) {
|
|
259
|
+
this.pagination = this.datasource.execute(core.DataSource.Operation.GET_PAGING_OPTIONS) || {};
|
|
260
|
+
this.filterFields = variableOptions.filterFields || {};
|
|
261
|
+
this.logicalOp = variableOptions.logicalOp || "";
|
|
262
|
+
this.sortOptions = variableOptions.orderBy || (lodashEs.isArray(this.pagination.sort) ? base.getOrderByExpr(this.pagination.sort) : "");
|
|
263
|
+
dataSize = this.pagination.totalElements;
|
|
264
|
+
maxResults = this.pagination.size = Number(this.pagination.size) ? this.pagination.size : lodashEs.get(this.datasource.dataSet, this.pagination.size);
|
|
265
|
+
this.pagination.numberOfElements = Number(this.pagination.numberOfElements) ? this.pagination.numberOfElements : lodashEs.get(this.datasource.dataSet, this.pagination.numberOfElements);
|
|
266
|
+
if (this.pagination.numberOfElements > 0) {
|
|
267
|
+
if (core.isDefined(this.pagination.number) && this.getPaginationStartIndex() === 1) this.dn.currentPage = this.pagination.number + 1;
|
|
268
|
+
currentPage = this.dn.currentPage || 1;
|
|
269
|
+
} else currentPage = 1;
|
|
270
|
+
this.setDefaultPagingValues(dataSize, maxResults, currentPage);
|
|
271
|
+
this.disableNavigation();
|
|
272
|
+
this.checkDataSize(dataSize, this.pagination.numberOfElements, this.pagination.size);
|
|
273
|
+
startIndex = (currentPage - 1) * this.maxResults;
|
|
274
|
+
this.getPageDetails(startIndex + 1, Math.min(startIndex + Number(this.pagination.numberOfElements), dataSize), dataSize);
|
|
275
|
+
this.setResult(newVal);
|
|
276
|
+
} else if (!lodashEs.isString(newVal)) this.setNonPageableData(newVal);
|
|
277
|
+
} else {
|
|
278
|
+
this.setResult(newVal);
|
|
279
|
+
this.resetPageNavigation();
|
|
280
|
+
}
|
|
281
|
+
if (this.navigation === "Basic") this._setAriaForBasicNavigation();
|
|
282
|
+
} else if (newVal && !lodashEs.isString(newVal)) this.setNonPageableData(newVal);
|
|
283
|
+
}
|
|
284
|
+
isFirstPage() {
|
|
285
|
+
return this.dn.currentPage === 1 || !this.dn.currentPage;
|
|
286
|
+
}
|
|
287
|
+
isLastPage() {
|
|
288
|
+
return this.dn.currentPage === this.pageCount;
|
|
289
|
+
}
|
|
290
|
+
goToLastPage(isRefresh, event, callback) {
|
|
291
|
+
if (!this.isLastPage()) {
|
|
292
|
+
this.dn.currentPage = this.pageCount;
|
|
293
|
+
this.goToPage(event, callback);
|
|
294
|
+
} else if (isRefresh) this.goToPage(event, callback);
|
|
295
|
+
}
|
|
296
|
+
goToFirstPage(isRefresh, event, callback) {
|
|
297
|
+
if (!this.isFirstPage()) {
|
|
298
|
+
this.dn.currentPage = 1;
|
|
299
|
+
this.goToPage(event, callback);
|
|
300
|
+
} else if (isRefresh) this.goToPage(event, callback);
|
|
301
|
+
}
|
|
302
|
+
goToPage(event, callback) {
|
|
303
|
+
this.firstRow = (this.dn.currentPage - 1) * this.maxResults;
|
|
304
|
+
const mode = this.parent.statePersistence.computeMode(this.statehandler), allowpagesizechange = this.parent.allowpagesizechange;
|
|
305
|
+
if (mode && mode.toLowerCase() !== "none" && (this.parent.widgetType === "wm-table" || this.parent.widgetType === "wm-list")) {
|
|
306
|
+
this.parent._selectedItemsExist = true;
|
|
307
|
+
if (this.isFirstPage() && !allowpagesizechange) this.parent.statePersistence.removeWidgetState(this.parent, "pagination");
|
|
308
|
+
else if (base.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation) < 0) {
|
|
309
|
+
const state = { pagination: this.dn.currentPage };
|
|
310
|
+
if (allowpagesizechange) state.pagesize = this.maxResults;
|
|
311
|
+
this.parent.statePersistence.setWidgetState(this.parent, state);
|
|
312
|
+
} else console.warn("Retain State handling on Widget " + this.parent.name + " is not supported for current pagination type.");
|
|
313
|
+
this.parent.currentpage = this.dn.currentPage;
|
|
314
|
+
this.parent.nativeElement?.setAttribute("currentpage", this.dn.currentPage);
|
|
315
|
+
}
|
|
316
|
+
this.getPageData(event, callback);
|
|
317
|
+
}
|
|
318
|
+
onPageDataReady(event, data, callback) {
|
|
319
|
+
this.disableNavigation();
|
|
320
|
+
this.invokeSetRecord(event, data);
|
|
321
|
+
core.triggerFn(callback);
|
|
322
|
+
}
|
|
323
|
+
getPageData(event, callback) {
|
|
324
|
+
let data, startIndex;
|
|
325
|
+
if (this.isDataSourceHasPaging()) {
|
|
326
|
+
let pageIndex = this.dn.currentPage;
|
|
327
|
+
if (this.isEditNotInCurrentPage() && this.parent.gridOptions.lastActionPerformed !== "delete") pageIndex = this.parent.actionRowPage;
|
|
328
|
+
this.datasource.execute(core.DataSource.Operation.LIST_RECORDS, {
|
|
329
|
+
"page": pageIndex - 1 + this.getPaginationStartIndex(),
|
|
330
|
+
"size": this.maxResults,
|
|
331
|
+
"filterFields": this.filterFields,
|
|
332
|
+
"orderBy": this.sortOptions,
|
|
333
|
+
"logicalOp": this.logicalOp,
|
|
334
|
+
"matchMode": "anywhereignorecase"
|
|
335
|
+
}).then((response) => {
|
|
336
|
+
this.onPageDataReady(event, response?.data, callback);
|
|
337
|
+
startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
338
|
+
this.getPageDetails(startIndex + 1, Math.min(startIndex + Number(this.pagination?.numberOfElements), this.pagination?.totalElements), this.pagination?.totalElements);
|
|
339
|
+
core.$appDigest();
|
|
340
|
+
}, (error) => {
|
|
341
|
+
});
|
|
342
|
+
} else {
|
|
343
|
+
if (this.isEditNotInCurrentPage()) startIndex = (this.parent.actionRowPage - 1) * this.maxResults;
|
|
344
|
+
else startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
345
|
+
data = lodashEs.isArray(this.__fullData) ? this.__fullData.slice(startIndex, startIndex + this.maxResults) : this.__fullData;
|
|
346
|
+
this.getPageDetails(startIndex + 1, Math.min(startIndex + this.maxResults, this.__fullData?.length), this.__fullData?.length);
|
|
347
|
+
this.setResult(data);
|
|
348
|
+
this.onPageDataReady(event, data, callback);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
isEditNotInCurrentPage() {
|
|
352
|
+
const pageIndex = this.dn.currentPage;
|
|
353
|
+
return this.parent.widgetType === "wm-table" && pageIndex === this.parent.currentPage && this.parent.actionRowPage && this.parent.actionRowPage < pageIndex;
|
|
354
|
+
}
|
|
355
|
+
invokeSetRecord(event, data) {
|
|
356
|
+
const pageInfo = {
|
|
357
|
+
currentPage: this.dn.currentPage,
|
|
358
|
+
size: this.maxResults,
|
|
359
|
+
totalElements: this.dataSize,
|
|
360
|
+
totalPages: this.pageCount
|
|
361
|
+
};
|
|
362
|
+
if (this.parent) this.parent.invokeEventCallback("setrecord", {
|
|
363
|
+
$event: event,
|
|
364
|
+
$data: data,
|
|
365
|
+
$index: this.dn.currentPage,
|
|
366
|
+
pageInfo,
|
|
367
|
+
data
|
|
368
|
+
});
|
|
369
|
+
else this.invokeEventCallback("setrecord", {
|
|
370
|
+
$event: event,
|
|
371
|
+
$data: data,
|
|
372
|
+
$index: this.dn.currentPage,
|
|
373
|
+
pageInfo,
|
|
374
|
+
data
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
validateCurrentPage(event, callback) {
|
|
378
|
+
if (event && (isNaN(this.dn.currentPage) || this.dn.currentPage <= 0 || this.pageCount && (this.dn.currentPage > this.pageCount || lodashEs.isNull(this.dn.currentPage)))) {
|
|
379
|
+
if (this.dn.currentPage <= 0) {
|
|
380
|
+
this.dn.currentPage = 1;
|
|
381
|
+
this.goToPage(event);
|
|
382
|
+
} else if (this.dn.currentPage > this.pageCount) {
|
|
383
|
+
this.dn.currentPage = this.pageCount;
|
|
384
|
+
this.goToPage(event);
|
|
385
|
+
}
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
return true;
|
|
389
|
+
}
|
|
390
|
+
onModelChange(event) {
|
|
391
|
+
if (!this.validateCurrentPage(event)) return;
|
|
392
|
+
this.goToPage(event);
|
|
393
|
+
}
|
|
394
|
+
onKeyDown(event) {
|
|
395
|
+
const targetEle = $(event.target).closest("a");
|
|
396
|
+
if (event.code === "KeyE") {
|
|
397
|
+
targetEle.addClass("ng-invalid");
|
|
398
|
+
return false;
|
|
399
|
+
}
|
|
400
|
+
targetEle.removeClass("ng-invalid");
|
|
401
|
+
return true;
|
|
402
|
+
}
|
|
403
|
+
pageChanged(event) {
|
|
404
|
+
this._debouncedPageChanged(event);
|
|
405
|
+
}
|
|
406
|
+
navigatePage(index, event, isRefresh, callback) {
|
|
407
|
+
if (core.isDefined(this.parent.isDataLoading) && !this.isDisableNext) {
|
|
408
|
+
this.parent.isDataLoading = true;
|
|
409
|
+
if (this.parent.infScroll) {
|
|
410
|
+
this.parent.variableInflight = true;
|
|
411
|
+
this.parent.callDataGridMethod("showLoadingIndicator", this.parent.loadingdatamsg, true);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
if (this.parent.widgetType === "wm-table" && this.parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
415
|
+
this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT);
|
|
416
|
+
this.parent.gridOptions.setIsDatasetUpdated(false);
|
|
417
|
+
}
|
|
418
|
+
this.invokeEventCallback("paginationchange", {
|
|
419
|
+
$event: void 0,
|
|
420
|
+
$index: this.dn.currentPage
|
|
421
|
+
});
|
|
422
|
+
this.dn.currentPage = +this.dn.currentPage;
|
|
423
|
+
switch (index) {
|
|
424
|
+
case "first":
|
|
425
|
+
if (this.pagination?.next && this.datasource?.pagination) {
|
|
426
|
+
this.datasource.pagination.isNext = false;
|
|
427
|
+
this.datasource.pagination.isPrev = false;
|
|
428
|
+
}
|
|
429
|
+
this.goToFirstPage(isRefresh, event, callback);
|
|
430
|
+
return;
|
|
431
|
+
case "prev":
|
|
432
|
+
if (!this.pagination?.next && (this.isFirstPage() || !this.validateCurrentPage(event, callback))) return;
|
|
433
|
+
else if (this.pagination?.next) {
|
|
434
|
+
this.datasource.pagination.isNext = false;
|
|
435
|
+
this.datasource.pagination.isPrev = true;
|
|
436
|
+
}
|
|
437
|
+
this.dn.currentPage -= 1;
|
|
438
|
+
break;
|
|
439
|
+
case "next":
|
|
440
|
+
if (!this.pagination?.next && (this.isLastPage() || !this.validateCurrentPage(event, callback))) return;
|
|
441
|
+
else if (this.pagination?.next) {
|
|
442
|
+
this.datasource.pagination.isNext = true;
|
|
443
|
+
this.datasource.pagination.isPrev = false;
|
|
444
|
+
}
|
|
445
|
+
this.dn.currentPage += 1;
|
|
446
|
+
break;
|
|
447
|
+
case "last":
|
|
448
|
+
this.goToLastPage(isRefresh, event, callback);
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
this.goToPage(event, callback);
|
|
452
|
+
}
|
|
453
|
+
setBindDataSet(binddataset, parent, dataSource, dataset, binddatasource, datasetBoundExpr, statehandler) {
|
|
454
|
+
const parts = binddataset.split(".");
|
|
455
|
+
let bindPagingOptions;
|
|
456
|
+
this.statehandler = statehandler;
|
|
457
|
+
if (parts[0] === "Variables" || parts[0] === "Widgets") bindPagingOptions = `${parts[0]}.${parts[1]}.pagination`;
|
|
458
|
+
else if (parts[0] === "App" && parts[1] === "activePage" && parts[2]?.includes("Variables") && parts[3]) bindPagingOptions = `App.activePage.${parts[2]}.${parts[3]}.pagination`;
|
|
459
|
+
if (!binddatasource && dataset && !datasetBoundExpr) {
|
|
460
|
+
this.dataset = dataset;
|
|
461
|
+
if (!binddataset.includes("pageParams")) {
|
|
462
|
+
if (this._debouncedApplyDataset) this._debouncedApplyDataset();
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
this.binddataset = binddataset;
|
|
467
|
+
setTimeout(() => {
|
|
468
|
+
this.registerDestroyListener(core.$watch(binddataset, parent, datasetBoundExpr ? dataSource : {}, (nv) => {
|
|
469
|
+
if (nv) {
|
|
470
|
+
this.dataset = nv;
|
|
471
|
+
if (this._debouncedApplyDataset) this._debouncedApplyDataset();
|
|
472
|
+
} else this.widget.dataset = nv;
|
|
473
|
+
}));
|
|
474
|
+
if (!bindPagingOptions) return;
|
|
475
|
+
this.registerDestroyListener(core.$watch(bindPagingOptions, parent, {}, () => {
|
|
476
|
+
if (this._debouncedApplyDataset) this._debouncedApplyDataset();
|
|
477
|
+
}));
|
|
478
|
+
});
|
|
479
|
+
if (!datasetBoundExpr) this.datasource = dataSource;
|
|
480
|
+
}
|
|
481
|
+
setDataSource(dataSource) {
|
|
482
|
+
this.datasource = dataSource;
|
|
483
|
+
}
|
|
484
|
+
onPropertyChange(key, nv, ov) {
|
|
485
|
+
let pageSize;
|
|
486
|
+
if (key === "dataset") {
|
|
487
|
+
let data;
|
|
488
|
+
if (this.parent?.onDataNavigatorDataSetChange) data = this.parent.onDataNavigatorDataSetChange(nv);
|
|
489
|
+
else data = nv;
|
|
490
|
+
if (this.parent.widgetType === "wm-table") this.parent._triggeredByUser = false;
|
|
491
|
+
if (data?.length) {
|
|
492
|
+
if (this.isDataSourceHasPaging()) {
|
|
493
|
+
const currentPageSize = lodashEs.get(data, "pagination.size") || lodashEs.get(this.datasource, "pagination.size"), totalElements = lodashEs.get(data, "pagination.totalElements") || lodashEs.get(this.datasource, "pagination.totalElements"), widgetState = this.parent.statePersistence.getWidgetState(this.parent);
|
|
494
|
+
this.actualPageSize = widgetState?.actualpagesize || currentPageSize;
|
|
495
|
+
this.actualPageSize = Number(this.actualPageSize) ? this.actualPageSize : lodashEs.get(this.datasource.dataSet, this.actualPageSize);
|
|
496
|
+
if (this.defaultPageSizeOptions.length > 0) this.pageSizeOptions = [...this.defaultPageSizeOptions];
|
|
497
|
+
else this.pageSizeOptions = lodashEs.range(this.actualPageSize, Math.max(this.actualPageSize + 1, this.actualPageSize + totalElements), this.actualPageSize);
|
|
498
|
+
if (widgetState?.selectedItem && widgetState.actualpagesize !== widgetState.pagesize) {
|
|
499
|
+
if (!this.prevPageSize) this.prevPageSize = this.actualPageSize || data?.length;
|
|
500
|
+
const updatedItems = this.handleStateParamsforNewPageSize(widgetState.selectedItem, this.prevPageSize, data?.length);
|
|
501
|
+
if (updatedItems) {
|
|
502
|
+
this.parent.statePersistence.setWidgetState(this.parent, {
|
|
503
|
+
pagination: 1,
|
|
504
|
+
pagesize: this.maxResults,
|
|
505
|
+
actualpagesize: this.actualPageSize || this.maxResults,
|
|
506
|
+
selectedItem: updatedItems
|
|
507
|
+
});
|
|
508
|
+
this.prevPageSize = void 0;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
} else {
|
|
512
|
+
pageSize = this.parent.getActualPageSize();
|
|
513
|
+
if (this.defaultPageSizeOptions.length > 0) this.pageSizeOptions = [...this.defaultPageSizeOptions];
|
|
514
|
+
else this.pageSizeOptions = lodashEs.range(pageSize, data.length + pageSize, pageSize);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (this.isEditNotInCurrentPage()) this.setResult(data);
|
|
518
|
+
else this.setPagingValues(data);
|
|
519
|
+
} else if (key === "navigation") {
|
|
520
|
+
if (nv === "Advanced") this.navigation = "Classic";
|
|
521
|
+
this.updateNavSize();
|
|
522
|
+
this.navcontrols = nv;
|
|
523
|
+
} else if (key === "navigationsize") this.updateNavSize();
|
|
524
|
+
else if (key === "navigationalign") core.switchClass(this.nativeElement, `text-${nv}`, `text-${ov}`);
|
|
525
|
+
else if (key === "maxResults") this.setPagingValues(this.dataset);
|
|
526
|
+
else super.onPropertyChange(key, nv, ov);
|
|
527
|
+
}
|
|
528
|
+
handleStateParamsforNewPageSize(selectedItem, oldPageSize, newPageSize) {
|
|
529
|
+
return selectedItem.map(({ page, index }) => {
|
|
530
|
+
const absoluteIndex = (page - 1) * oldPageSize + index;
|
|
531
|
+
return {
|
|
532
|
+
page: Math.floor(absoluteIndex / newPageSize) + 1,
|
|
533
|
+
index: absoluteIndex % newPageSize
|
|
534
|
+
};
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
onDropdownKeydown(event, index) {
|
|
538
|
+
const $items = $("ul#dropdown-basic a.dropdown-item");
|
|
539
|
+
const maxIndex = this.pageSizeOptions.length - 1;
|
|
540
|
+
let selectedOption;
|
|
541
|
+
switch (event.key) {
|
|
542
|
+
case "ArrowDown":
|
|
543
|
+
case "Tab":
|
|
544
|
+
event.preventDefault();
|
|
545
|
+
if (event.key === "Tab" && event.shiftKey) this.focusedIndex = index - 1 < 0 ? maxIndex : index - 1;
|
|
546
|
+
else this.focusedIndex = index + 1 > maxIndex ? 0 : index + 1;
|
|
547
|
+
break;
|
|
548
|
+
case "ArrowUp":
|
|
549
|
+
event.preventDefault();
|
|
550
|
+
this.focusedIndex = index - 1 < 0 ? maxIndex : index - 1;
|
|
551
|
+
break;
|
|
552
|
+
case "Enter":
|
|
553
|
+
event.preventDefault();
|
|
554
|
+
selectedOption = this.pageSizeOptions[this.focusedIndex];
|
|
555
|
+
this.onPageSizeChange(event, selectedOption);
|
|
556
|
+
this.closeDropdown();
|
|
557
|
+
return;
|
|
558
|
+
case "Escape":
|
|
559
|
+
event.preventDefault();
|
|
560
|
+
this.closeDropdown();
|
|
561
|
+
return;
|
|
562
|
+
default: return;
|
|
563
|
+
}
|
|
564
|
+
setTimeout(() => {
|
|
565
|
+
$items.eq(this.focusedIndex)?.focus();
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
closeDropdown() {
|
|
569
|
+
this.bsDropdown.hide();
|
|
570
|
+
$("button[aria-controls=\"dropdown-basic\"]").focus();
|
|
571
|
+
}
|
|
572
|
+
onOpenChange(isOpen) {
|
|
573
|
+
if (isOpen) {
|
|
574
|
+
const selectedIndex = this.pageSizeOptions?.findIndex((option) => option == this.maxResults);
|
|
575
|
+
this.focusedIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
576
|
+
setTimeout(() => {
|
|
577
|
+
$("ul#dropdown-basic a.dropdown-item").eq(this.focusedIndex)?.focus();
|
|
578
|
+
}, 0);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
onPageSizeChange($event, newPageSize) {
|
|
582
|
+
const widgetState = this.parent.statePersistence.getWidgetState(this.parent);
|
|
583
|
+
let updatedItems;
|
|
584
|
+
if (widgetState?.selectedItem) updatedItems = this.handleStateParamsforNewPageSize(widgetState.selectedItem, this.maxResults, +newPageSize);
|
|
585
|
+
this.actualPageSize = this.actualPageSize || this.maxResults;
|
|
586
|
+
this.maxResults = +newPageSize;
|
|
587
|
+
this.maxResultsEmitter.emit(this.maxResults);
|
|
588
|
+
if (this.isDataSourceHasPaging() && this.datasource) this.datasource.maxResults = this.maxResults;
|
|
589
|
+
if (updatedItems) this.parent.statePersistence.setWidgetState(this.parent, {
|
|
590
|
+
pagination: 1,
|
|
591
|
+
pagesize: this.maxResults,
|
|
592
|
+
actualpagesize: this.actualPageSize || this.maxResults,
|
|
593
|
+
selectedItem: updatedItems
|
|
594
|
+
});
|
|
595
|
+
else this.parent.statePersistence.setWidgetState(this.parent, {
|
|
596
|
+
pagination: 1,
|
|
597
|
+
pagesize: this.maxResults,
|
|
598
|
+
actualpagesize: this.actualPageSize || this.maxResults
|
|
599
|
+
});
|
|
600
|
+
this.navigatePage("first", $event, true);
|
|
601
|
+
this.calculatePagingValues();
|
|
602
|
+
if (this.nativeElement.closest("popover-container, .popover")) {
|
|
603
|
+
$event.stopPropagation();
|
|
604
|
+
this.bsDropdown.hide();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
onDropDownShown($event) {
|
|
608
|
+
const container = $event?._element?.nativeElement;
|
|
609
|
+
if (!container) return;
|
|
610
|
+
core.adjustVerticalPosition($(container), this.nativeElement?.querySelector(".items-per-page div"), this.bsDropdown._dropdown, $(container?.querySelector("ul[id=\"dropdown-basic\"]")));
|
|
611
|
+
this.dropdownScrollHandler = () => {
|
|
612
|
+
this.onDropdownScroll();
|
|
613
|
+
};
|
|
614
|
+
window.addEventListener("scroll", this.dropdownScrollHandler, true);
|
|
615
|
+
}
|
|
616
|
+
onDropdownScroll() {}
|
|
617
|
+
onDropdownHidden() {
|
|
618
|
+
if (this.dropdownScrollHandler) window.removeEventListener("scroll", this.dropdownScrollHandler, true);
|
|
619
|
+
this.dropdownScrollHandler = void 0;
|
|
620
|
+
}
|
|
621
|
+
ngAfterViewInit() {
|
|
622
|
+
const paginationElem = this.nativeElement;
|
|
623
|
+
paginationElem.onclick = (event) => {
|
|
624
|
+
event.stopPropagation();
|
|
625
|
+
};
|
|
626
|
+
}
|
|
627
|
+
ngOnDestroy() {
|
|
628
|
+
if (this.dropdownScrollHandler) window.removeEventListener("scroll", this.dropdownScrollHandler, true);
|
|
629
|
+
if (this._initTimeoutId) {
|
|
630
|
+
clearTimeout(this._initTimeoutId);
|
|
631
|
+
this._initTimeoutId = null;
|
|
632
|
+
}
|
|
633
|
+
if (this.resultEmitter) this.resultEmitter.complete();
|
|
634
|
+
if (this.maxResultsEmitter) this.maxResultsEmitter.complete();
|
|
635
|
+
this._debouncedApplyDataset = null;
|
|
636
|
+
this._debouncedPageChanged = null;
|
|
637
|
+
this.dataset = null;
|
|
638
|
+
this.__fullData = null;
|
|
639
|
+
this.result = null;
|
|
640
|
+
this.filterFields = null;
|
|
641
|
+
this.sortOptions = null;
|
|
642
|
+
this.options = null;
|
|
643
|
+
if (this.pageSizeOptions) this.pageSizeOptions = [];
|
|
644
|
+
if (this.defaultPageSizeOptions) this.defaultPageSizeOptions = [];
|
|
645
|
+
this.datasource = null;
|
|
646
|
+
this.parent = null;
|
|
647
|
+
super.ngOnDestroy();
|
|
648
|
+
}
|
|
649
|
+
static {
|
|
650
|
+
this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
|
|
651
|
+
minVersion: "12.0.0",
|
|
652
|
+
version: "22.2.1",
|
|
653
|
+
ngImport: i0__namespace,
|
|
654
|
+
type: PaginationComponent,
|
|
655
|
+
deps: [
|
|
656
|
+
{ token: i0__namespace.Injector },
|
|
657
|
+
{
|
|
658
|
+
token: base.WidgetRef,
|
|
659
|
+
skipSelf: true
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
token: "EXPLICIT_CONTEXT",
|
|
663
|
+
optional: true
|
|
664
|
+
}
|
|
665
|
+
],
|
|
666
|
+
target: i0__namespace.ɵɵFactoryTarget.Component
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
static {
|
|
670
|
+
this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({
|
|
671
|
+
minVersion: "17.0.0",
|
|
672
|
+
version: "22.2.1",
|
|
673
|
+
type: PaginationComponent,
|
|
674
|
+
isStandalone: true,
|
|
675
|
+
selector: "[wmPagination]",
|
|
676
|
+
outputs: {
|
|
677
|
+
resultEmitter: "resultEmitter",
|
|
678
|
+
maxResultsEmitter: "maxResultsEmitter"
|
|
679
|
+
},
|
|
680
|
+
providers: [base.provideAsWidgetRef(PaginationComponent)],
|
|
681
|
+
viewQueries: [{
|
|
682
|
+
propertyName: "bsDropdown",
|
|
683
|
+
first: true,
|
|
684
|
+
predicate: i4.BsDropdownDirective,
|
|
685
|
+
descendants: true
|
|
686
|
+
}],
|
|
687
|
+
usesInheritance: true,
|
|
688
|
+
ngImport: i0__namespace,
|
|
689
|
+
template: "\n@if (navcontrols === 'Classic') {\n<ul class=\"pagination advanced {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableFirst}\">\n <a [title]=\"appLocale.LABEL_FIRST\" name=\"first\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableFirst\"\n (click)=\"navigatePage('first', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-first-page\"></i></span>\n <span class=\"sr-only\">Go to first page {{ isDisableFirst ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a [title]=\"appLocale.LABEL_PREVIOUS\" name=\"prev\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisablePrevious\"\n (click)=\"navigatePage('prev', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n <span class=\"sr-only\">Go to previous page {{ isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"pagecount disabled\">\n <a href=\"javascript:void(0);\" aria-label=\"Change Page Number\">\n <input [(ngModel)]=\"dn.currentPage\" [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount\" [disabled]=\"isDisableCurrent\"\n [ngModelOptions]=\"{standalone: true}\"\n type=\"number\"\n (keydown)=\"onKeyDown($event)\" (change)=\"onModelChange($event)\" class=\"form-control\"/>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"disabled\">\n <a [hidden]=\"isDisableCount\"> / {{pageCount}}</a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableNext}\">\n <a [title]=\"appLocale.LABEL_NEXT\" name=\"next\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableNext\"\n (click)=\"navigatePage('next', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n <span class=\"sr-only\">Go to next page {{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableLast}\">\n <a [title]=\"appLocale.LABEL_LAST\" name=\"last\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableLast\"\n (click)=\"navigatePage('last', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-last-page\"></i></span>\n <span class=\"sr-only\">Go to last page {{ isDisableLast ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (showrecordcount) {\n <li class=\"totalcount disabled\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n }\n</ul>\n}\n@if (navcontrols === 'Pager') {\n <ul class=\"pager {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n@if (!(dataSize<=maxResults)) {\n <li class=\"previous\" [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"isDisablePrevious\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class=\"sr-only\">{{ isDisablePrevious ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n <li class=\"next\" [ngClass]=\"{'disabled':isDisableNext}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('next', $event)\"\n [attr.aria-disabled]=\"isDisableNext\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class=\"sr-only\">{{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n </ul>\n}\n\n@if (navcontrols === 'Basic') {\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <div class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE }} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </div>\n @if (rowSummary?.totalRecords) {\n <div class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </div>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <pagination class=\"pagination basic\" [ngClass]=\"navigationClass\" role=\"navigation\"\n [itemsPerPage]=\"maxResults\" [totalItems]=\"dataSize\"\n (pageChanged)=\"pageChanged($event)\" [ngModelOptions]=\"{standalone:true}\" [ngModel]=\"dn.currentPage\"\n [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount + ' pages'\"\n [boundaryLinks]=\"boundarylinks\" [maxSize]=\"maxsize\"\n [directionLinks]=\"directionlinks\"\n firstText=\"Firtst\" lastText=\"Last\"\n [customPreviousTemplate]=\"prevTemplate\"\n [customNextTemplate]=\"nextTemplate\"\n [customPageTemplate]=\"pageTemplate\"></pagination>\n }\n}\n\n@if (navcontrols === 'Basic' && showrecordcount) {\n <ul class=\"pagination\">\n <li class=\"totalcount disabled basiccount\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n </ul>\n}\n\n<ng-template #pageTemplate let-page>\n <span class=\"sr-only\" [attr.data-isacitvepage]=\"page.active\">{{'Page '}}</span>\n {{page.number}}\n @if (page.active) {\n <span class=\"sr-only\"> {{', Showing page ' + page.number + ' of ' + pageCount}}</span>\n }\n</ng-template>\n<ng-template #prevTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Previous page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Next page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n",
|
|
690
|
+
dependencies: [
|
|
691
|
+
{
|
|
692
|
+
kind: "ngmodule",
|
|
693
|
+
type: i1.CommonModule
|
|
694
|
+
},
|
|
695
|
+
{
|
|
696
|
+
kind: "directive",
|
|
697
|
+
type: i1__namespace.NgClass,
|
|
698
|
+
selector: "[ngClass]",
|
|
699
|
+
inputs: ["class", "ngClass"]
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
kind: "ngmodule",
|
|
703
|
+
type: i2.FormsModule
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
kind: "directive",
|
|
707
|
+
type: i2__namespace.DefaultValueAccessor,
|
|
708
|
+
selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
kind: "directive",
|
|
712
|
+
type: i2__namespace.NumberValueAccessor,
|
|
713
|
+
selector: "input[type=number]:not([ngNoCva])[formControlName],input[type=number]:not([ngNoCva])[formControl],input[type=number]:not([ngNoCva])[ngModel]"
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
kind: "directive",
|
|
717
|
+
type: i2__namespace.NgControlStatus,
|
|
718
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
kind: "directive",
|
|
722
|
+
type: i2__namespace.NgModel,
|
|
723
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
724
|
+
inputs: [
|
|
725
|
+
"name",
|
|
726
|
+
"disabled",
|
|
727
|
+
"ngModel",
|
|
728
|
+
"ngModelOptions"
|
|
729
|
+
],
|
|
730
|
+
outputs: ["ngModelChange"],
|
|
731
|
+
exportAs: ["ngModel"]
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
kind: "ngmodule",
|
|
735
|
+
type: i3.PaginationModule
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
kind: "component",
|
|
739
|
+
type: i3__namespace.PaginationComponent,
|
|
740
|
+
selector: "pagination",
|
|
741
|
+
inputs: [
|
|
742
|
+
"align",
|
|
743
|
+
"maxSize",
|
|
744
|
+
"boundaryLinks",
|
|
745
|
+
"directionLinks",
|
|
746
|
+
"firstText",
|
|
747
|
+
"previousText",
|
|
748
|
+
"nextText",
|
|
749
|
+
"lastText",
|
|
750
|
+
"rotate",
|
|
751
|
+
"pageBtnClass",
|
|
752
|
+
"disabled",
|
|
753
|
+
"customPageTemplate",
|
|
754
|
+
"customNextTemplate",
|
|
755
|
+
"customPreviousTemplate",
|
|
756
|
+
"customFirstTemplate",
|
|
757
|
+
"customLastTemplate",
|
|
758
|
+
"itemsPerPage",
|
|
759
|
+
"totalItems"
|
|
760
|
+
],
|
|
761
|
+
outputs: ["numPages", "pageChanged"]
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
kind: "ngmodule",
|
|
765
|
+
type: i4.BsDropdownModule
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
kind: "directive",
|
|
769
|
+
type: i4__namespace.BsDropdownMenuDirective,
|
|
770
|
+
selector: "[bsDropdownMenu],[dropdownMenu]",
|
|
771
|
+
exportAs: ["bs-dropdown-menu"]
|
|
772
|
+
},
|
|
773
|
+
{
|
|
774
|
+
kind: "directive",
|
|
775
|
+
type: i4__namespace.BsDropdownToggleDirective,
|
|
776
|
+
selector: "[bsDropdownToggle],[dropdownToggle]",
|
|
777
|
+
exportAs: ["bs-dropdown-toggle"]
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
kind: "directive",
|
|
781
|
+
type: i4__namespace.BsDropdownDirective,
|
|
782
|
+
selector: "[bsDropdown], [dropdown]",
|
|
783
|
+
inputs: [
|
|
784
|
+
"placement",
|
|
785
|
+
"triggers",
|
|
786
|
+
"container",
|
|
787
|
+
"dropup",
|
|
788
|
+
"autoClose",
|
|
789
|
+
"isAnimated",
|
|
790
|
+
"insideClick",
|
|
791
|
+
"isDisabled",
|
|
792
|
+
"isOpen"
|
|
793
|
+
],
|
|
794
|
+
outputs: [
|
|
795
|
+
"isOpenChange",
|
|
796
|
+
"onShown",
|
|
797
|
+
"onHidden"
|
|
798
|
+
],
|
|
799
|
+
exportAs: ["bs-dropdown"]
|
|
800
|
+
}
|
|
801
|
+
],
|
|
802
|
+
changeDetection: i0__namespace.ChangeDetectionStrategy.Eager
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
i0__namespace.ɵɵngDeclareClassMetadata({
|
|
807
|
+
minVersion: "12.0.0",
|
|
808
|
+
version: "22.2.1",
|
|
809
|
+
ngImport: i0__namespace,
|
|
810
|
+
type: PaginationComponent,
|
|
811
|
+
decorators: [{
|
|
812
|
+
type: i0.Component,
|
|
813
|
+
args: [{
|
|
814
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager,
|
|
815
|
+
standalone: true,
|
|
816
|
+
imports: [
|
|
817
|
+
i1.CommonModule,
|
|
818
|
+
i2.FormsModule,
|
|
819
|
+
i3.PaginationModule,
|
|
820
|
+
i4.BsDropdownModule
|
|
821
|
+
],
|
|
822
|
+
selector: "[wmPagination]",
|
|
823
|
+
providers: [base.provideAsWidgetRef(PaginationComponent)],
|
|
824
|
+
template: "\n@if (navcontrols === 'Classic') {\n<ul class=\"pagination advanced {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableFirst}\">\n <a [title]=\"appLocale.LABEL_FIRST\" name=\"first\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableFirst\"\n (click)=\"navigatePage('first', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-first-page\"></i></span>\n <span class=\"sr-only\">Go to first page {{ isDisableFirst ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a [title]=\"appLocale.LABEL_PREVIOUS\" name=\"prev\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisablePrevious\"\n (click)=\"navigatePage('prev', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n <span class=\"sr-only\">Go to previous page {{ isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"pagecount disabled\">\n <a href=\"javascript:void(0);\" aria-label=\"Change Page Number\">\n <input [(ngModel)]=\"dn.currentPage\" [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount\" [disabled]=\"isDisableCurrent\"\n [ngModelOptions]=\"{standalone: true}\"\n type=\"number\"\n (keydown)=\"onKeyDown($event)\" (change)=\"onModelChange($event)\" class=\"form-control\"/>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"disabled\">\n <a [hidden]=\"isDisableCount\"> / {{pageCount}}</a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableNext}\">\n <a [title]=\"appLocale.LABEL_NEXT\" name=\"next\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableNext\"\n (click)=\"navigatePage('next', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n <span class=\"sr-only\">Go to next page {{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableLast}\">\n <a [title]=\"appLocale.LABEL_LAST\" name=\"last\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableLast\"\n (click)=\"navigatePage('last', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-last-page\"></i></span>\n <span class=\"sr-only\">Go to last page {{ isDisableLast ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (showrecordcount) {\n <li class=\"totalcount disabled\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n }\n</ul>\n}\n@if (navcontrols === 'Pager') {\n <ul class=\"pager {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n@if (!(dataSize<=maxResults)) {\n <li class=\"previous\" [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"isDisablePrevious\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class=\"sr-only\">{{ isDisablePrevious ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n <li class=\"next\" [ngClass]=\"{'disabled':isDisableNext}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('next', $event)\"\n [attr.aria-disabled]=\"isDisableNext\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class=\"sr-only\">{{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n </ul>\n}\n\n@if (navcontrols === 'Basic') {\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <div class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE }} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </div>\n @if (rowSummary?.totalRecords) {\n <div class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </div>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <pagination class=\"pagination basic\" [ngClass]=\"navigationClass\" role=\"navigation\"\n [itemsPerPage]=\"maxResults\" [totalItems]=\"dataSize\"\n (pageChanged)=\"pageChanged($event)\" [ngModelOptions]=\"{standalone:true}\" [ngModel]=\"dn.currentPage\"\n [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount + ' pages'\"\n [boundaryLinks]=\"boundarylinks\" [maxSize]=\"maxsize\"\n [directionLinks]=\"directionlinks\"\n firstText=\"Firtst\" lastText=\"Last\"\n [customPreviousTemplate]=\"prevTemplate\"\n [customNextTemplate]=\"nextTemplate\"\n [customPageTemplate]=\"pageTemplate\"></pagination>\n }\n}\n\n@if (navcontrols === 'Basic' && showrecordcount) {\n <ul class=\"pagination\">\n <li class=\"totalcount disabled basiccount\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n </ul>\n}\n\n<ng-template #pageTemplate let-page>\n <span class=\"sr-only\" [attr.data-isacitvepage]=\"page.active\">{{'Page '}}</span>\n {{page.number}}\n @if (page.active) {\n <span class=\"sr-only\"> {{', Showing page ' + page.number + ' of ' + pageCount}}</span>\n }\n</ng-template>\n<ng-template #prevTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Previous page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Next page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n"
|
|
825
|
+
}]
|
|
826
|
+
}],
|
|
827
|
+
ctorParameters: () => [
|
|
828
|
+
{ type: i0__namespace.Injector },
|
|
829
|
+
{
|
|
830
|
+
type: void 0,
|
|
831
|
+
decorators: [{ type: i0.SkipSelf }, {
|
|
832
|
+
type: i0.Inject,
|
|
833
|
+
args: [base.WidgetRef]
|
|
834
|
+
}]
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
type: void 0,
|
|
838
|
+
decorators: [{
|
|
839
|
+
type: i0.Inject,
|
|
840
|
+
args: ["EXPLICIT_CONTEXT"]
|
|
841
|
+
}, { type: i0.Optional }]
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
propDecorators: {
|
|
845
|
+
resultEmitter: [{ type: i0.Output }],
|
|
846
|
+
maxResultsEmitter: [{ type: i0.Output }],
|
|
847
|
+
bsDropdown: [{
|
|
848
|
+
type: i0.ViewChild,
|
|
849
|
+
args: [i4.BsDropdownDirective]
|
|
850
|
+
}]
|
|
851
|
+
}
|
|
852
|
+
});
|
|
51
853
|
|
|
52
|
-
|
|
53
|
-
const WIDGET_CONFIG = { widgetType: 'wm-pagination', hostClass: DEFAULT_CLS };
|
|
54
|
-
const sizeClasses = {
|
|
55
|
-
'Pager': {
|
|
56
|
-
'small': 'pager-sm',
|
|
57
|
-
'large': 'pager-lg'
|
|
58
|
-
},
|
|
59
|
-
'Basic': {
|
|
60
|
-
'small': 'pagination-sm',
|
|
61
|
-
'large': 'pagination-lg'
|
|
62
|
-
},
|
|
63
|
-
'Classic': {
|
|
64
|
-
'small': 'pagination-sm',
|
|
65
|
-
'large': 'pagination-lg'
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
class PaginationComponent extends base.StylableComponent {
|
|
69
|
-
static { this.initializeProps = registerProps(); }
|
|
70
|
-
_setAriaForBasicNavigation() {
|
|
71
|
-
lodashEs.forEach(this.nativeElement.getElementsByTagName('a'), (item) => {
|
|
72
|
-
item.setAttribute('href', 'javascript:void(0);');
|
|
73
|
-
const childNode = item.querySelector('span');
|
|
74
|
-
if (childNode?.dataset.isacitvepage === "true") {
|
|
75
|
-
item.setAttribute('aria-current', 'true');
|
|
76
|
-
}
|
|
77
|
-
if (childNode?.dataset.isdisabled === "true") {
|
|
78
|
-
item.setAttribute('aria-disabled', 'true');
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
item.removeAttribute('aria-disabled');
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
constructor(inj, parent, explicitContext) {
|
|
86
|
-
super(inj, WIDGET_CONFIG, explicitContext);
|
|
87
|
-
this.parent = parent;
|
|
88
|
-
this.resultEmitter = new i0.EventEmitter();
|
|
89
|
-
this.maxResultsEmitter = new i0.EventEmitter();
|
|
90
|
-
this.defaultPageSizeOptions = [];
|
|
91
|
-
this.focusedIndex = 0;
|
|
92
|
-
this.dn = {
|
|
93
|
-
currentPage: 1
|
|
94
|
-
};
|
|
95
|
-
this.pageCount = 0;
|
|
96
|
-
this.isDisableNext = true;
|
|
97
|
-
this.isDisablePrevious = true;
|
|
98
|
-
this.isDisableFirst = true;
|
|
99
|
-
this.isDisableLast = true;
|
|
100
|
-
this._debouncedApplyDataset = core.debounce(() => this.widget.dataset = this.dataset, base.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
|
|
101
|
-
this._debouncedPageChanged = core.debounce(event => {
|
|
102
|
-
const currentPage = event?.page;
|
|
103
|
-
const maxResults = event && (event.pagesize || event.itemsPerPage) || this.maxResults;
|
|
104
|
-
// Do not call goToPage if page has not changed
|
|
105
|
-
if (currentPage !== this.dn.currentPage || this.maxResults !== maxResults) {
|
|
106
|
-
const inst = this.parent || this;
|
|
107
|
-
this.dn.currentPage = currentPage;
|
|
108
|
-
this.maxResults = maxResults;
|
|
109
|
-
this.maxResultsEmitter.emit(this.maxResults);
|
|
110
|
-
inst.invokeEventCallback('paginationchange', { $event: undefined, $index: this.dn.currentPage });
|
|
111
|
-
this.goToPage();
|
|
112
|
-
if (this.navigation === 'Basic') {
|
|
113
|
-
this._setAriaForBasicNavigation();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}, base.DEBOUNCE_TIMES.PAGINATION_DEBOUNCE_TIME);
|
|
117
|
-
base.styler(this.nativeElement, this);
|
|
118
|
-
this._initTimeoutId = setTimeout(() => {
|
|
119
|
-
// Guard against component destruction or parent being null
|
|
120
|
-
if (this.isDestroyed || !this.parent) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
this.allowpagesizechange = this.parent.allowpagesizechange;
|
|
124
|
-
if (this.allowpagesizechange)
|
|
125
|
-
this.defaultPageSizeOptions = this.normalizeToNumberArray(this.parent?.pagesizeoptions);
|
|
126
|
-
}, 0);
|
|
127
|
-
}
|
|
128
|
-
normalizeToNumberArray(input) {
|
|
129
|
-
if (!input)
|
|
130
|
-
return [];
|
|
131
|
-
let arr;
|
|
132
|
-
if (Array.isArray(input)) {
|
|
133
|
-
arr = input;
|
|
134
|
-
}
|
|
135
|
-
else if (typeof input === "string") {
|
|
136
|
-
const trimmed = input.trim();
|
|
137
|
-
// handle "[1,2,3]"
|
|
138
|
-
if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
139
|
-
try {
|
|
140
|
-
arr = JSON.parse(trimmed);
|
|
141
|
-
}
|
|
142
|
-
catch {
|
|
143
|
-
arr = [];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
// handle "1,2,3"
|
|
148
|
-
arr = trimmed.split(",");
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
return [];
|
|
153
|
-
}
|
|
154
|
-
return arr
|
|
155
|
-
.map(v => Number(v))
|
|
156
|
-
.filter(v => !isNaN(v))
|
|
157
|
-
.sort((a, b) => a - b);
|
|
158
|
-
}
|
|
159
|
-
setResult(result) {
|
|
160
|
-
// TODO: Emit event only if result is changed
|
|
161
|
-
this.result = result;
|
|
162
|
-
this.resultEmitter.emit(this.result);
|
|
163
|
-
}
|
|
164
|
-
// Update navigationClass based on navigation and navigationSize props
|
|
165
|
-
updateNavSize() {
|
|
166
|
-
const sizeCls = sizeClasses[this.navcontrols];
|
|
167
|
-
if (sizeCls && this.navigationsize) {
|
|
168
|
-
this.navigationClass = sizeCls[this.navigationsize];
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
this.navigationClass = '';
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// Function to reset the paging values to default.
|
|
175
|
-
resetPageNavigation() {
|
|
176
|
-
this.pageCount = 0;
|
|
177
|
-
this.dn.currentPage = 1;
|
|
178
|
-
this.dataSize = 0;
|
|
179
|
-
}
|
|
180
|
-
/*Function to calculate the paging values.*/
|
|
181
|
-
calculatePagingValues() {
|
|
182
|
-
this.pageCount = (this.dataSize > this.maxResults) ? (Math.ceil(this.dataSize / this.maxResults)) : (this.dataSize < 0 ? 0 : 1);
|
|
183
|
-
this.dn.currentPage = this.dn.currentPage || 1;
|
|
184
|
-
}
|
|
185
|
-
/*Function to set default values to the paging parameters*/
|
|
186
|
-
setDefaultPagingValues(dataSize, maxResults, currentPage) {
|
|
187
|
-
/*If neither 'dataSize' nor 'maxResults' is set, then set default values to the paging parameters.*/
|
|
188
|
-
if (!dataSize && !maxResults) {
|
|
189
|
-
this.pageCount = 1;
|
|
190
|
-
this.dn.currentPage = 1;
|
|
191
|
-
this.maxResults = dataSize;
|
|
192
|
-
this.dataSize = dataSize;
|
|
193
|
-
}
|
|
194
|
-
else { /*Else, set the specified values and recalculate paging parameters.*/
|
|
195
|
-
this.maxResults = maxResults || this.maxResults;
|
|
196
|
-
this.dataSize = core.isDefined(dataSize) ? dataSize : this.dataSize;
|
|
197
|
-
this.dn.currentPage = currentPage || this.dn.currentPage;
|
|
198
|
-
this.calculatePagingValues();
|
|
199
|
-
}
|
|
200
|
-
this.maxResultsEmitter.emit(this.maxResults);
|
|
201
|
-
}
|
|
202
|
-
/*Function to check the dataSize and manipulate the navigator accordingly.*/
|
|
203
|
-
checkDataSize(dataSize, numberOfElements, size) {
|
|
204
|
-
/*If the dataSize is -1 or Integer.MAX_VALUE( which is 2147483647), then the total number of records is not known.
|
|
205
|
-
* Hence,
|
|
206
|
-
* 1. Hide the 'Total Record Count'.
|
|
207
|
-
* 2. Disable the 'GoToLastPage' link as the page number of the last page is not known.*/
|
|
208
|
-
if (dataSize === -1 || dataSize === core.AppConstants.INT_MAX_VALUE) {
|
|
209
|
-
this.prevshowrecordcount = this.showrecordcount;
|
|
210
|
-
this.isDisableLast = true;
|
|
211
|
-
this.isDisableCount = true;
|
|
212
|
-
this.showrecordcount = false;
|
|
213
|
-
// If number of records in current page is less than the max records size, this is the last page. So disable next button.
|
|
214
|
-
if (numberOfElements < size) {
|
|
215
|
-
this.isDisableNext = true;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
this.isDisableCount = false;
|
|
220
|
-
this.showrecordcount = this.prevshowrecordcount || this.showrecordcount;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
/*Function to disable navigation based on the current and total pages.*/
|
|
224
|
-
disableNavigation() {
|
|
225
|
-
const isCurrentPageFirst = (this.dn.currentPage === 1), isCurrentPageLast = (this.dn.currentPage === this.pageCount);
|
|
226
|
-
if (!this.pagination?.next) {
|
|
227
|
-
this.isDisableFirst = this.isDisablePrevious = isCurrentPageFirst;
|
|
228
|
-
this.isDisableNext = this.isDisableLast = isCurrentPageLast;
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
// WMS-18867: In case of server side pagination, for pager type pagination depend on prev and next flags which are set by developer
|
|
232
|
-
this.isDisableFirst = this.isDisablePrevious = !this.pagination.prev;
|
|
233
|
-
this.isDisableNext = this.isDisableLast = !this.pagination.next;
|
|
234
|
-
}
|
|
235
|
-
this.isDisableCurrent = isCurrentPageFirst && isCurrentPageLast;
|
|
236
|
-
// In case of client side pagination, when load more reaches last page hide the on-demand grid ele
|
|
237
|
-
if (this.dataset?.length && this.isDisableNext && this.parent.onDemandLoad && this.parent.widgetType === 'wm-table') {
|
|
238
|
-
this.parent.callDataGridMethod('hideLoadingIndicator', this.isDisableNext, this.parent.infScroll);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/*Function to check if the variable bound to the data-navigator has paging.*/
|
|
242
|
-
isDataSourceHasPaging() {
|
|
243
|
-
return this.datasource?.execute(core.DataSource.Operation.IS_PAGEABLE);
|
|
244
|
-
}
|
|
245
|
-
getPaginationStartIndex() {
|
|
246
|
-
const startIndex = this.datasource?._paginationConfig?.paginationStartIndex;
|
|
247
|
-
return core.isDefined(startIndex) && this.datasource?._paginationConfig?.type === 'page' ? Number(startIndex) : 1;
|
|
248
|
-
}
|
|
249
|
-
// this function returns an object which gives summary of the current page data (ex: In UI it is shown as 1 to 10 out of 50 records)
|
|
250
|
-
getPageDetails(startIndex, endIndex, totalRecords) {
|
|
251
|
-
this.rowSummary = (core.isDefined(startIndex) && core.isDefined(endIndex) && core.isDefined(totalRecords)) ? {
|
|
252
|
-
startIndex: startIndex,
|
|
253
|
-
endIndex: endIndex,
|
|
254
|
-
totalRecords: totalRecords
|
|
255
|
-
} : {};
|
|
256
|
-
}
|
|
257
|
-
// Set the result for client side pagination
|
|
258
|
-
setNonPageableData(newVal) {
|
|
259
|
-
let dataSize, maxResults, currentPage, startIndex;
|
|
260
|
-
dataSize = lodashEs.isArray(newVal) ? newVal.length : (lodashEs.isEmpty(newVal) ? 0 : 1);
|
|
261
|
-
maxResults = (this.options?.maxResults) || dataSize;
|
|
262
|
-
if (this.allowpagesizechange) { // when default page size is not given then use maxResults instead of options.maxResults
|
|
263
|
-
maxResults = this.maxResults;
|
|
264
|
-
}
|
|
265
|
-
// For static variable, keep the current page. For other variables without pagination reset the page to 1
|
|
266
|
-
// Fix for [WMS-23263]: gridOptions.isNextPageData flag is false when dataset is changed from script, so setting current page to 1
|
|
267
|
-
if (this.datasource && (this.datasource.execute(core.DataSource.Operation.IS_API_AWARE) || (this.parent.widgetType === 'wm-table' && (this.parent.gridOptions.isNavTypeScrollOrOndemand() && (lodashEs.get(this.parent, 'gridOptions.lastActionPerformed') === this.parent.gridOptions.ACTIONS.DATASET_UPDATE || !lodashEs.get(this.parent, 'gridOptions.isNextPageData')))))) {
|
|
268
|
-
currentPage = 1;
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
currentPage = this.dn.currentPage || 1;
|
|
272
|
-
}
|
|
273
|
-
this.setDefaultPagingValues(dataSize, maxResults, currentPage);
|
|
274
|
-
this.disableNavigation();
|
|
275
|
-
startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
276
|
-
this.getPageDetails(startIndex + 1, Math.min(startIndex + this.maxResults, newVal?.length), newVal?.length);
|
|
277
|
-
this.setResult(lodashEs.isArray(newVal) ? newVal.slice(startIndex, startIndex + this.maxResults) : newVal);
|
|
278
|
-
}
|
|
279
|
-
/*Function to set the values needed for pagination*/
|
|
280
|
-
setPagingValues(newVal) {
|
|
281
|
-
let dataSize, maxResults, currentPage, startIndex, dataSource;
|
|
282
|
-
let variableOptions = {};
|
|
283
|
-
// Store the data in __fullData. This is used for client side searching witvah out modifying the actual dataset.
|
|
284
|
-
this.__fullData = newVal;
|
|
285
|
-
/*Check for sanity*/
|
|
286
|
-
if (this.binddataset) {
|
|
287
|
-
dataSource = this.datasource || {};
|
|
288
|
-
variableOptions = dataSource._options || {};
|
|
289
|
-
/*Check for number of elements in the data set*/
|
|
290
|
-
if (newVal) {
|
|
291
|
-
if (this.isDataSourceHasPaging()) {
|
|
292
|
-
this.pagination = this.datasource.execute(core.DataSource.Operation.GET_PAGING_OPTIONS) || {};
|
|
293
|
-
// If "filterFields" and "sortOptions" have been set, then set them so that the filters can be retained while fetching data upon page navigation.
|
|
294
|
-
this.filterFields = variableOptions.filterFields || {};
|
|
295
|
-
this.logicalOp = variableOptions.logicalOp || '';
|
|
296
|
-
this.sortOptions = variableOptions.orderBy ||
|
|
297
|
-
(lodashEs.isArray(this.pagination.sort) ? base.getOrderByExpr(this.pagination.sort) : '');
|
|
298
|
-
dataSize = this.pagination.totalElements;
|
|
299
|
-
maxResults = this.pagination.size = Number(this.pagination.size) ? this.pagination.size : lodashEs.get(this.datasource.dataSet, this.pagination.size);
|
|
300
|
-
this.pagination.numberOfElements = Number(this.pagination.numberOfElements) ? this.pagination.numberOfElements : lodashEs.get(this.datasource.dataSet, this.pagination.numberOfElements);
|
|
301
|
-
if (this.pagination.numberOfElements > 0) {
|
|
302
|
-
if (core.isDefined(this.pagination.number) && this.getPaginationStartIndex() === 1) { // number is page number received from backend
|
|
303
|
-
this.dn.currentPage = this.pagination.number + 1;
|
|
304
|
-
}
|
|
305
|
-
currentPage = this.dn.currentPage || 1;
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
currentPage = 1;
|
|
309
|
-
}
|
|
310
|
-
/* Sending pageCount undefined to calculate it again for query.*/
|
|
311
|
-
this.setDefaultPagingValues(dataSize, maxResults, currentPage);
|
|
312
|
-
this.disableNavigation();
|
|
313
|
-
this.checkDataSize(dataSize, this.pagination.numberOfElements, this.pagination.size);
|
|
314
|
-
startIndex = (currentPage - 1) * this.maxResults;
|
|
315
|
-
this.getPageDetails(startIndex + 1, Math.min(startIndex + Number(this.pagination.numberOfElements), dataSize), dataSize);
|
|
316
|
-
this.setResult(newVal);
|
|
317
|
-
}
|
|
318
|
-
else if (!lodashEs.isString(newVal)) {
|
|
319
|
-
this.setNonPageableData(newVal);
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
this.setResult(newVal);
|
|
324
|
-
this.resetPageNavigation();
|
|
325
|
-
}
|
|
326
|
-
if (this.navigation === 'Basic') {
|
|
327
|
-
this._setAriaForBasicNavigation();
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
else if (newVal && !lodashEs.isString(newVal)) {
|
|
331
|
-
this.setNonPageableData(newVal);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/*Function to check if the current page is the first page*/
|
|
335
|
-
isFirstPage() {
|
|
336
|
-
return (this.dn.currentPage === 1 || !this.dn.currentPage);
|
|
337
|
-
}
|
|
338
|
-
/*Function to check if the current page is the last page*/
|
|
339
|
-
isLastPage() {
|
|
340
|
-
return (this.dn.currentPage === this.pageCount);
|
|
341
|
-
}
|
|
342
|
-
/*Function to navigate to the last page*/
|
|
343
|
-
goToLastPage(isRefresh, event, callback) {
|
|
344
|
-
if (!this.isLastPage()) {
|
|
345
|
-
this.dn.currentPage = this.pageCount;
|
|
346
|
-
this.goToPage(event, callback);
|
|
347
|
-
}
|
|
348
|
-
else if (isRefresh) {
|
|
349
|
-
this.goToPage(event, callback);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
/*Function to navigate to the first page*/
|
|
353
|
-
goToFirstPage(isRefresh, event, callback) {
|
|
354
|
-
if (!this.isFirstPage()) {
|
|
355
|
-
this.dn.currentPage = 1;
|
|
356
|
-
this.goToPage(event, callback);
|
|
357
|
-
}
|
|
358
|
-
else if (isRefresh) {
|
|
359
|
-
this.goToPage(event, callback);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
/*Function to navigate to the current page*/
|
|
363
|
-
goToPage(event, callback) {
|
|
364
|
-
this.firstRow = (this.dn.currentPage - 1) * this.maxResults;
|
|
365
|
-
const mode = this.parent.statePersistence.computeMode(this.statehandler), allowpagesizechange = this.parent.allowpagesizechange;
|
|
366
|
-
if (mode && mode.toLowerCase() !== 'none' && (this.parent.widgetType === 'wm-table' || this.parent.widgetType === 'wm-list')) {
|
|
367
|
-
this.parent._selectedItemsExist = true;
|
|
368
|
-
if (this.isFirstPage() && !allowpagesizechange) {
|
|
369
|
-
this.parent.statePersistence.removeWidgetState(this.parent, 'pagination');
|
|
370
|
-
}
|
|
371
|
-
else if (base.unsupportedStatePersistenceTypes.indexOf(this.parent.navigation) < 0) {
|
|
372
|
-
const state = { pagination: this.dn.currentPage };
|
|
373
|
-
if (allowpagesizechange) {
|
|
374
|
-
state.pagesize = this.maxResults;
|
|
375
|
-
}
|
|
376
|
-
this.parent.statePersistence.setWidgetState(this.parent, state);
|
|
377
|
-
}
|
|
378
|
-
else if (this.parent.widgetType === 'wm-list' || this.parent.widgetType === 'wm-table') {
|
|
379
|
-
console.warn('Retain State handling on Widget ' + this.parent.name + ' is not supported for current pagination type.');
|
|
380
|
-
}
|
|
381
|
-
this.parent.currentpage = this.dn.currentPage;
|
|
382
|
-
this.parent.nativeElement?.setAttribute('currentpage', this.dn.currentPage);
|
|
383
|
-
}
|
|
384
|
-
// call getPageData after checking state config so that Static Variables can use it
|
|
385
|
-
this.getPageData(event, callback);
|
|
386
|
-
}
|
|
387
|
-
/*Function to be invoked after the data of the page has been fetched.*/
|
|
388
|
-
onPageDataReady(event, data, callback) {
|
|
389
|
-
this.disableNavigation();
|
|
390
|
-
this.invokeSetRecord(event, data);
|
|
391
|
-
core.triggerFn(callback);
|
|
392
|
-
}
|
|
393
|
-
/*Function to get data for the current page*/
|
|
394
|
-
getPageData(event, callback) {
|
|
395
|
-
let data, startIndex;
|
|
396
|
-
if (this.isDataSourceHasPaging()) {
|
|
397
|
-
/**
|
|
398
|
-
* In table component, in case of on demand and scroll pagination
|
|
399
|
-
* When there is a change in data item which is not in current page
|
|
400
|
-
* Fetch the items of the page where the change is made
|
|
401
|
-
* */
|
|
402
|
-
let pageIndex = this.dn.currentPage;
|
|
403
|
-
if (this.isEditNotInCurrentPage() && this.parent.gridOptions.lastActionPerformed !== 'delete') {
|
|
404
|
-
pageIndex = this.parent.actionRowPage;
|
|
405
|
-
}
|
|
406
|
-
this.datasource.execute(core.DataSource.Operation.LIST_RECORDS, {
|
|
407
|
-
'page': (pageIndex - 1) + this.getPaginationStartIndex(),
|
|
408
|
-
'size': this.maxResults,
|
|
409
|
-
'filterFields': this.filterFields,
|
|
410
|
-
'orderBy': this.sortOptions,
|
|
411
|
-
'logicalOp': this.logicalOp,
|
|
412
|
-
'matchMode': 'anywhereignorecase'
|
|
413
|
-
}).then(response => {
|
|
414
|
-
this.onPageDataReady(event, response?.data, callback);
|
|
415
|
-
startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
416
|
-
this.getPageDetails(startIndex + 1, Math.min(startIndex + Number(this.pagination?.numberOfElements), this.pagination?.totalElements), this.pagination?.totalElements);
|
|
417
|
-
core.$appDigest();
|
|
418
|
-
}, error => {
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
else {
|
|
422
|
-
if (this.isEditNotInCurrentPage()) {
|
|
423
|
-
startIndex = (this.parent.actionRowPage - 1) * this.maxResults;
|
|
424
|
-
}
|
|
425
|
-
else {
|
|
426
|
-
startIndex = (this.dn.currentPage - 1) * this.maxResults;
|
|
427
|
-
}
|
|
428
|
-
data = lodashEs.isArray(this.__fullData) ? this.__fullData.slice(startIndex, startIndex + this.maxResults) : this.__fullData;
|
|
429
|
-
this.getPageDetails(startIndex + 1, Math.min(startIndex + this.maxResults, this.__fullData?.length), this.__fullData?.length);
|
|
430
|
-
this.setResult(data);
|
|
431
|
-
this.onPageDataReady(event, data, callback);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
/*
|
|
435
|
-
Function to check if the edit action is performed on the previous page data of the table
|
|
436
|
-
*/
|
|
437
|
-
isEditNotInCurrentPage() {
|
|
438
|
-
const pageIndex = this.dn.currentPage;
|
|
439
|
-
return this.parent.widgetType === 'wm-table' && pageIndex === this.parent.currentPage &&
|
|
440
|
-
this.parent.actionRowPage && this.parent.actionRowPage < pageIndex;
|
|
441
|
-
}
|
|
442
|
-
invokeSetRecord(event, data) {
|
|
443
|
-
// Trigger the event handler if exists.
|
|
444
|
-
const pageInfo = {
|
|
445
|
-
currentPage: this.dn.currentPage,
|
|
446
|
-
size: this.maxResults,
|
|
447
|
-
totalElements: this.dataSize,
|
|
448
|
-
totalPages: this.pageCount
|
|
449
|
-
};
|
|
450
|
-
if (this.parent) {
|
|
451
|
-
this.parent.invokeEventCallback('setrecord', { $event: event, $data: data, $index: this.dn.currentPage, pageInfo, data });
|
|
452
|
-
}
|
|
453
|
-
else {
|
|
454
|
-
this.invokeEventCallback('setrecord', { $event: event, $data: data, $index: this.dn.currentPage, pageInfo, data });
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
/*Function to validate the page input.
|
|
458
|
-
In case of invalid input, navigate to the appropriate page; also return false.
|
|
459
|
-
In case of valid input, return true.*/
|
|
460
|
-
validateCurrentPage(event, callback) {
|
|
461
|
-
/*If the value entered is greater than the last page number or invalid value, then highlighting the field showing error.*/
|
|
462
|
-
if (event && (isNaN(this.dn.currentPage) || this.dn.currentPage <= 0 || (this.pageCount && (this.dn.currentPage > this.pageCount || lodashEs.isNull(this.dn.currentPage))))) {
|
|
463
|
-
if (this.dn.currentPage <= 0) {
|
|
464
|
-
this.dn.currentPage = 1;
|
|
465
|
-
this.goToPage(event);
|
|
466
|
-
}
|
|
467
|
-
else if (this.dn.currentPage > this.pageCount) {
|
|
468
|
-
this.dn.currentPage = this.pageCount;
|
|
469
|
-
this.goToPage(event);
|
|
470
|
-
}
|
|
471
|
-
return false;
|
|
472
|
-
}
|
|
473
|
-
return true;
|
|
474
|
-
}
|
|
475
|
-
onModelChange(event) {
|
|
476
|
-
if (!this.validateCurrentPage(event)) {
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
this.goToPage(event);
|
|
480
|
-
}
|
|
481
|
-
onKeyDown(event) {
|
|
482
|
-
const targetEle = $(event.target).closest('a');
|
|
483
|
-
if (event.code === 'KeyE') {
|
|
484
|
-
targetEle.addClass('ng-invalid');
|
|
485
|
-
return false;
|
|
486
|
-
}
|
|
487
|
-
targetEle.removeClass('ng-invalid');
|
|
488
|
-
return true;
|
|
489
|
-
}
|
|
490
|
-
pageChanged(event) {
|
|
491
|
-
this._debouncedPageChanged(event);
|
|
492
|
-
}
|
|
493
|
-
/*Function to navigate to the respective pages.*/
|
|
494
|
-
navigatePage(index, event, isRefresh, callback) {
|
|
495
|
-
// when navigated to next page turn on the isDataLoading flag to show the loading indicator
|
|
496
|
-
if (core.isDefined(this.parent.isDataLoading) && !this.isDisableNext) {
|
|
497
|
-
this.parent.isDataLoading = true;
|
|
498
|
-
// In case of infinite scroll calling the showLoadingIndicator method to update the loading message immediately when navigated to next page
|
|
499
|
-
if (this.parent.infScroll) {
|
|
500
|
-
this.parent.variableInflight = true;
|
|
501
|
-
this.parent.callDataGridMethod('showLoadingIndicator', this.parent.loadingdatamsg, true);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
// reset the last action performed to "scroll" and isDatasetUpdated to false
|
|
505
|
-
if (this.parent.widgetType === 'wm-table' && this.parent.gridOptions.isNavTypeScrollOrOndemand()) {
|
|
506
|
-
this.parent.gridOptions.setLastActionPerformed(this.parent.gridOptions.ACTIONS.DEFAULT);
|
|
507
|
-
this.parent.gridOptions.setIsDatasetUpdated(false);
|
|
508
|
-
}
|
|
509
|
-
this.invokeEventCallback('paginationchange', { $event: undefined, $index: this.dn.currentPage });
|
|
510
|
-
// Convert the current page to a valid page number.
|
|
511
|
-
this.dn.currentPage = +this.dn.currentPage;
|
|
512
|
-
switch (index) {
|
|
513
|
-
case 'first':
|
|
514
|
-
if (this.pagination?.next && this.datasource?.pagination) {
|
|
515
|
-
this.datasource.pagination.isNext = false;
|
|
516
|
-
this.datasource.pagination.isPrev = false;
|
|
517
|
-
}
|
|
518
|
-
this.goToFirstPage(isRefresh, event, callback);
|
|
519
|
-
return;
|
|
520
|
-
case 'prev':
|
|
521
|
-
/*Return if already on the first page.*/
|
|
522
|
-
if (!this.pagination?.next && (this.isFirstPage() || !this.validateCurrentPage(event, callback))) {
|
|
523
|
-
return;
|
|
524
|
-
}
|
|
525
|
-
else if (this.pagination?.next) { // WMS-18867: For server side pagination, skipping the regular flow and enabling isNext flag in pagination metadata
|
|
526
|
-
this.datasource.pagination.isNext = false;
|
|
527
|
-
this.datasource.pagination.isPrev = true;
|
|
528
|
-
}
|
|
529
|
-
/*Decrement the current page by 1.*/
|
|
530
|
-
this.dn.currentPage -= 1;
|
|
531
|
-
break;
|
|
532
|
-
case 'next':
|
|
533
|
-
/*Return if already on the last page.*/
|
|
534
|
-
if (!this.pagination?.next && (this.isLastPage() || !this.validateCurrentPage(event, callback))) {
|
|
535
|
-
return;
|
|
536
|
-
}
|
|
537
|
-
else if (this.pagination?.next) { // WMS-18867: For server side pagination, skipping the regular flow and enabling isPrev flag in pagination metadata
|
|
538
|
-
this.datasource.pagination.isNext = true;
|
|
539
|
-
this.datasource.pagination.isPrev = false;
|
|
540
|
-
}
|
|
541
|
-
/*Increment the current page by 1.*/
|
|
542
|
-
this.dn.currentPage += 1;
|
|
543
|
-
break;
|
|
544
|
-
case 'last':
|
|
545
|
-
this.goToLastPage(isRefresh, event, callback);
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
/*Navigate to the current page.*/
|
|
549
|
-
this.goToPage(event, callback);
|
|
550
|
-
}
|
|
551
|
-
setBindDataSet(binddataset, parent, dataSource, dataset, binddatasource, datasetBoundExpr, statehandler) {
|
|
552
|
-
const parts = binddataset.split('.');
|
|
553
|
-
let bindPagingOptions;
|
|
554
|
-
this.statehandler = statehandler;
|
|
555
|
-
if (parts[0] === 'Variables' || parts[0] === 'Widgets') {
|
|
556
|
-
bindPagingOptions = `${parts[0]}.${parts[1]}.pagination`;
|
|
557
|
-
}
|
|
558
|
-
else if (parts[0] === 'App' && parts[1] === 'activePage' && parts[2]?.includes('Variables') && parts[3]) {
|
|
559
|
-
bindPagingOptions = `App.activePage.${parts[2]}.${parts[3]}.pagination`;
|
|
560
|
-
}
|
|
561
|
-
if (!binddatasource && dataset && !datasetBoundExpr) {
|
|
562
|
-
this.dataset = dataset;
|
|
563
|
-
if (!binddataset.includes('pageParams')) {
|
|
564
|
-
if (this._debouncedApplyDataset) {
|
|
565
|
-
this._debouncedApplyDataset();
|
|
566
|
-
}
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
this.binddataset = binddataset;
|
|
571
|
-
setTimeout(() => {
|
|
572
|
-
// watching for dataset changes even when dataset is bound to "item." (i.e. by checking for datasetBoundExpr)
|
|
573
|
-
// item context is passed as dataSource here
|
|
574
|
-
// [Todo-CSP]: check if same expr fn is generated by parent widget (list, table)
|
|
575
|
-
this.registerDestroyListener(core.$watch(binddataset, parent, datasetBoundExpr ? dataSource : {}, nv => {
|
|
576
|
-
if (nv) {
|
|
577
|
-
this.dataset = nv;
|
|
578
|
-
if (this._debouncedApplyDataset) {
|
|
579
|
-
this._debouncedApplyDataset();
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
// WMS-19285: Setting dataset on proxy only to handle propertychange handler call for undefined cases
|
|
584
|
-
this.widget.dataset = nv;
|
|
585
|
-
}
|
|
586
|
-
}));
|
|
587
|
-
// Register a watch on paging options. Call dataset property change handler even if paging options changes to reflect pagination state
|
|
588
|
-
if (!bindPagingOptions) {
|
|
589
|
-
return;
|
|
590
|
-
}
|
|
591
|
-
//[Todo-CSP]: either generate watch expr fn or register an event from the datasource itself
|
|
592
|
-
this.registerDestroyListener(core.$watch(bindPagingOptions, parent, {}, () => {
|
|
593
|
-
if (this._debouncedApplyDataset) {
|
|
594
|
-
this._debouncedApplyDataset();
|
|
595
|
-
}
|
|
596
|
-
}));
|
|
597
|
-
});
|
|
598
|
-
// apply datasource only when dataset is not bound to "item.FIELD"
|
|
599
|
-
if (!datasetBoundExpr) {
|
|
600
|
-
this.datasource = dataSource;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
// Set the datasource of pagination from the parent widget
|
|
604
|
-
setDataSource(dataSource) {
|
|
605
|
-
this.datasource = dataSource;
|
|
606
|
-
}
|
|
607
|
-
onPropertyChange(key, nv, ov) {
|
|
608
|
-
let pageSize;
|
|
609
|
-
if (key === 'dataset') {
|
|
610
|
-
let data;
|
|
611
|
-
if (this.parent?.onDataNavigatorDataSetChange) {
|
|
612
|
-
data = this.parent.onDataNavigatorDataSetChange(nv);
|
|
613
|
-
}
|
|
614
|
-
else {
|
|
615
|
-
data = nv;
|
|
616
|
-
}
|
|
617
|
-
// Set last action performed to "dataset_update" whenever dataset is changed in table component
|
|
618
|
-
if (this.parent.widgetType === 'wm-table') {
|
|
619
|
-
this.parent._triggeredByUser = false;
|
|
620
|
-
}
|
|
621
|
-
if (data?.length) { // calculate Pagesize options based on actual page size
|
|
622
|
-
if (this.isDataSourceHasPaging()) { // for Live variables
|
|
623
|
-
const currentPageSize = lodashEs.get(data, 'pagination.size') || lodashEs.get(this.datasource, 'pagination.size'), totalElements = lodashEs.get(data, 'pagination.totalElements') || lodashEs.get(this.datasource, 'pagination.totalElements'), widgetState = this.parent.statePersistence.getWidgetState(this.parent);
|
|
624
|
-
this.actualPageSize = widgetState?.actualpagesize || currentPageSize;
|
|
625
|
-
this.actualPageSize = Number(this.actualPageSize) ? this.actualPageSize : lodashEs.get(this.datasource.dataSet, this.actualPageSize);
|
|
626
|
-
if (this.defaultPageSizeOptions.length > 0) {
|
|
627
|
-
this.pageSizeOptions = [...this.defaultPageSizeOptions];
|
|
628
|
-
}
|
|
629
|
-
else {
|
|
630
|
-
this.pageSizeOptions = lodashEs.range(this.actualPageSize, Math.max(this.actualPageSize + 1, this.actualPageSize + totalElements), this.actualPageSize); // here data has only that page data and pagesize has totalNoof Elements
|
|
631
|
-
}
|
|
632
|
-
if (widgetState?.selectedItem && widgetState.actualpagesize !== widgetState.pagesize) {
|
|
633
|
-
if (!this.prevPageSize) {
|
|
634
|
-
this.prevPageSize = this.actualPageSize || data?.length;
|
|
635
|
-
}
|
|
636
|
-
const updatedItems = this.handleStateParamsforNewPageSize(widgetState.selectedItem, this.prevPageSize, data?.length);
|
|
637
|
-
if (updatedItems) {
|
|
638
|
-
this.parent.statePersistence.setWidgetState(this.parent, {
|
|
639
|
-
pagination: 1,
|
|
640
|
-
pagesize: this.maxResults,
|
|
641
|
-
actualpagesize: this.actualPageSize || this.maxResults,
|
|
642
|
-
selectedItem: updatedItems
|
|
643
|
-
});
|
|
644
|
-
this.prevPageSize = undefined;
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
else {
|
|
649
|
-
pageSize = this.parent.getActualPageSize();
|
|
650
|
-
if (this.defaultPageSizeOptions.length > 0) {
|
|
651
|
-
this.pageSizeOptions = [...this.defaultPageSizeOptions];
|
|
652
|
-
}
|
|
653
|
-
else {
|
|
654
|
-
this.pageSizeOptions = lodashEs.range(pageSize, data.length + pageSize, pageSize);
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
// When the dataset is not in current page, but in previous ones directly set the result without setting page values
|
|
659
|
-
if (this.isEditNotInCurrentPage()) {
|
|
660
|
-
this.setResult(data);
|
|
661
|
-
}
|
|
662
|
-
else {
|
|
663
|
-
this.setPagingValues(data);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
else if (key === 'navigation') {
|
|
667
|
-
if (nv === 'Advanced') { // Support for older projects where navigation type was advanced instead of clasic
|
|
668
|
-
this.navigation = 'Classic';
|
|
669
|
-
}
|
|
670
|
-
this.updateNavSize();
|
|
671
|
-
this.navcontrols = nv;
|
|
672
|
-
}
|
|
673
|
-
else if (key === 'navigationsize') {
|
|
674
|
-
this.updateNavSize();
|
|
675
|
-
}
|
|
676
|
-
else if (key === 'navigationalign') {
|
|
677
|
-
core.switchClass(this.nativeElement, `text-${nv}`, `text-${ov}`);
|
|
678
|
-
}
|
|
679
|
-
else if (key === 'maxResults') {
|
|
680
|
-
this.setPagingValues(this.dataset);
|
|
681
|
-
}
|
|
682
|
-
else {
|
|
683
|
-
super.onPropertyChange(key, nv, ov);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
// change the selectedItems page number and index in the stateparams when pagesize is changed
|
|
687
|
-
handleStateParamsforNewPageSize(selectedItem, oldPageSize, newPageSize) {
|
|
688
|
-
return selectedItem.map(({ page, index }) => {
|
|
689
|
-
const absoluteIndex = (page - 1) * oldPageSize + index;
|
|
690
|
-
const newPage = Math.floor(absoluteIndex / newPageSize) + 1; // back to 1-based
|
|
691
|
-
const newIndex = absoluteIndex % newPageSize;
|
|
692
|
-
return {
|
|
693
|
-
page: newPage,
|
|
694
|
-
index: newIndex
|
|
695
|
-
};
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
onDropdownKeydown(event, index) {
|
|
699
|
-
const $items = $('ul#dropdown-basic a.dropdown-item');
|
|
700
|
-
const maxIndex = this.pageSizeOptions.length - 1;
|
|
701
|
-
let selectedOption;
|
|
702
|
-
switch (event.key) {
|
|
703
|
-
case 'ArrowDown':
|
|
704
|
-
case 'Tab':
|
|
705
|
-
event.preventDefault();
|
|
706
|
-
if (event.key === 'Tab' && event.shiftKey) {
|
|
707
|
-
// Treat Shift+Tab as ArrowUp
|
|
708
|
-
this.focusedIndex = (index - 1) < 0 ? maxIndex : index - 1;
|
|
709
|
-
}
|
|
710
|
-
else {
|
|
711
|
-
// Treat Tab or ArrowDown as ArrowDown
|
|
712
|
-
this.focusedIndex = (index + 1) > maxIndex ? 0 : index + 1;
|
|
713
|
-
}
|
|
714
|
-
break;
|
|
715
|
-
case 'ArrowUp':
|
|
716
|
-
event.preventDefault();
|
|
717
|
-
this.focusedIndex = (index - 1) < 0 ? maxIndex : index - 1;
|
|
718
|
-
break;
|
|
719
|
-
case 'Enter':
|
|
720
|
-
event.preventDefault();
|
|
721
|
-
selectedOption = this.pageSizeOptions[this.focusedIndex];
|
|
722
|
-
this.onPageSizeChange(event, selectedOption);
|
|
723
|
-
this.closeDropdown();
|
|
724
|
-
return;
|
|
725
|
-
case 'Escape':
|
|
726
|
-
event.preventDefault();
|
|
727
|
-
this.closeDropdown();
|
|
728
|
-
return;
|
|
729
|
-
default:
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
// Move focus after index is updated
|
|
733
|
-
setTimeout(() => {
|
|
734
|
-
$items.eq(this.focusedIndex)?.focus();
|
|
735
|
-
});
|
|
736
|
-
}
|
|
737
|
-
closeDropdown() {
|
|
738
|
-
// Close dropdown
|
|
739
|
-
this.bsDropdown.hide();
|
|
740
|
-
const $toggleButton = $('button[aria-controls="dropdown-basic"]');
|
|
741
|
-
$toggleButton.focus(); // Return focus to button
|
|
742
|
-
}
|
|
743
|
-
// Function gets called on dropdown open & close
|
|
744
|
-
onOpenChange(isOpen) {
|
|
745
|
-
if (isOpen) {
|
|
746
|
-
// Focus the currently selected page size option (not always the first one),
|
|
747
|
-
// since the ':focus' state is what visually highlights the item in the dropdown
|
|
748
|
-
const selectedIndex = this.pageSizeOptions?.findIndex(option => option == this.maxResults);
|
|
749
|
-
this.focusedIndex = selectedIndex >= 0 ? selectedIndex : 0;
|
|
750
|
-
setTimeout(() => {
|
|
751
|
-
// manually focus the dropdown as dropdown has container="body"
|
|
752
|
-
const $items = $('ul#dropdown-basic a.dropdown-item');
|
|
753
|
-
const $selectedItem = $items.eq(this.focusedIndex);
|
|
754
|
-
$selectedItem?.focus();
|
|
755
|
-
}, 0);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
onPageSizeChange($event, newPageSize) {
|
|
759
|
-
const widgetState = this.parent.statePersistence.getWidgetState(this.parent);
|
|
760
|
-
let updatedItems;
|
|
761
|
-
if (widgetState?.selectedItem) {
|
|
762
|
-
updatedItems = this.handleStateParamsforNewPageSize(widgetState.selectedItem, this.maxResults, +newPageSize);
|
|
763
|
-
}
|
|
764
|
-
this.actualPageSize = this.actualPageSize || this.maxResults;
|
|
765
|
-
this.maxResults = +newPageSize;
|
|
766
|
-
this.maxResultsEmitter.emit(this.maxResults);
|
|
767
|
-
if (this.isDataSourceHasPaging() && this.datasource) {
|
|
768
|
-
this.datasource.maxResults = this.maxResults;
|
|
769
|
-
}
|
|
770
|
-
if (updatedItems) {
|
|
771
|
-
this.parent.statePersistence.setWidgetState(this.parent, {
|
|
772
|
-
pagination: 1,
|
|
773
|
-
pagesize: this.maxResults,
|
|
774
|
-
actualpagesize: this.actualPageSize || this.maxResults,
|
|
775
|
-
selectedItem: updatedItems
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
this.parent.statePersistence.setWidgetState(this.parent, {
|
|
780
|
-
pagination: 1,
|
|
781
|
-
pagesize: this.maxResults,
|
|
782
|
-
actualpagesize: this.actualPageSize || this.maxResults
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
this.navigatePage('first', $event, true);
|
|
786
|
-
this.calculatePagingValues();
|
|
787
|
-
if (this.nativeElement.closest('popover-container, .popover')) {
|
|
788
|
-
$event.stopPropagation();
|
|
789
|
-
this.bsDropdown.hide();
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
onDropDownShown($event) {
|
|
793
|
-
const container = $event?._element?.nativeElement;
|
|
794
|
-
if (!container)
|
|
795
|
-
return;
|
|
796
|
-
core.adjustVerticalPosition($(container), this.nativeElement?.querySelector('.items-per-page div'), this.bsDropdown._dropdown, $(container?.querySelector('ul[id="dropdown-basic"]')));
|
|
797
|
-
this.dropdownScrollHandler = () => {
|
|
798
|
-
this.onDropdownScroll();
|
|
799
|
-
};
|
|
800
|
-
window.addEventListener('scroll', this.dropdownScrollHandler, true);
|
|
801
|
-
}
|
|
802
|
-
onDropdownScroll() {
|
|
803
|
-
// on scroll boostrap is applying 3d translation to prevent from that added this dummy function
|
|
804
|
-
return;
|
|
805
|
-
}
|
|
806
|
-
onDropdownHidden() {
|
|
807
|
-
if (this.dropdownScrollHandler) {
|
|
808
|
-
window.removeEventListener('scroll', this.dropdownScrollHandler, true);
|
|
809
|
-
}
|
|
810
|
-
this.dropdownScrollHandler = undefined;
|
|
811
|
-
}
|
|
812
|
-
ngAfterViewInit() {
|
|
813
|
-
const paginationElem = this.nativeElement;
|
|
814
|
-
paginationElem.onclick = (event) => {
|
|
815
|
-
event.stopPropagation();
|
|
816
|
-
};
|
|
817
|
-
}
|
|
818
|
-
ngOnDestroy() {
|
|
819
|
-
if (this.dropdownScrollHandler) {
|
|
820
|
-
window.removeEventListener('scroll', this.dropdownScrollHandler, true);
|
|
821
|
-
}
|
|
822
|
-
// MEMORY LEAK FIX: Clear initialization timeout if still pending
|
|
823
|
-
if (this._initTimeoutId) {
|
|
824
|
-
clearTimeout(this._initTimeoutId);
|
|
825
|
-
this._initTimeoutId = null;
|
|
826
|
-
}
|
|
827
|
-
// MEMORY LEAK FIX: Complete EventEmitters
|
|
828
|
-
if (this.resultEmitter) {
|
|
829
|
-
this.resultEmitter.complete();
|
|
830
|
-
}
|
|
831
|
-
if (this.maxResultsEmitter) {
|
|
832
|
-
this.maxResultsEmitter.complete();
|
|
833
|
-
}
|
|
834
|
-
// MEMORY LEAK FIX: Nullify debounced function closures
|
|
835
|
-
this._debouncedApplyDataset = null;
|
|
836
|
-
this._debouncedPageChanged = null;
|
|
837
|
-
// MEMORY LEAK FIX: Clear data arrays and objects
|
|
838
|
-
this.dataset = null;
|
|
839
|
-
this.__fullData = null;
|
|
840
|
-
this.result = null;
|
|
841
|
-
this.filterFields = null;
|
|
842
|
-
this.sortOptions = null;
|
|
843
|
-
this.options = null;
|
|
844
|
-
// MEMORY LEAK FIX: Clear page size options array
|
|
845
|
-
if (this.pageSizeOptions) {
|
|
846
|
-
this.pageSizeOptions = [];
|
|
847
|
-
}
|
|
848
|
-
if (this.defaultPageSizeOptions) {
|
|
849
|
-
this.defaultPageSizeOptions = [];
|
|
850
|
-
}
|
|
851
|
-
// MEMORY LEAK FIX: Clear datasource reference
|
|
852
|
-
this.datasource = null;
|
|
853
|
-
// MEMORY LEAK FIX: Clear parent reference
|
|
854
|
-
this.parent = null;
|
|
855
|
-
// Call parent ngOnDestroy (sets isDestroyed = true)
|
|
856
|
-
super.ngOnDestroy();
|
|
857
|
-
}
|
|
858
|
-
static { this.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: PaginationComponent, deps: [{ token: i0__namespace.Injector }, { token: base.WidgetRef, skipSelf: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component }); }
|
|
859
|
-
static { this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: PaginationComponent, isStandalone: true, selector: "[wmPagination]", outputs: { resultEmitter: "resultEmitter", maxResultsEmitter: "maxResultsEmitter" }, providers: [
|
|
860
|
-
base.provideAsWidgetRef(PaginationComponent)
|
|
861
|
-
], viewQueries: [{ propertyName: "bsDropdown", first: true, predicate: i4.BsDropdownDirective, descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "\n@if (navcontrols === 'Classic') {\n<ul class=\"pagination advanced {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableFirst}\">\n <a [title]=\"appLocale.LABEL_FIRST\" name=\"first\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableFirst\"\n (click)=\"navigatePage('first', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-first-page\"></i></span>\n <span class=\"sr-only\">Go to first page {{ isDisableFirst ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a [title]=\"appLocale.LABEL_PREVIOUS\" name=\"prev\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisablePrevious\"\n (click)=\"navigatePage('prev', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n <span class=\"sr-only\">Go to previous page {{ isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"pagecount disabled\">\n <a href=\"javascript:void(0);\" aria-label=\"Change Page Number\">\n <input [(ngModel)]=\"dn.currentPage\" [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount\" [disabled]=\"isDisableCurrent\"\n [ngModelOptions]=\"{standalone: true}\"\n type=\"number\"\n (keydown)=\"onKeyDown($event)\" (change)=\"onModelChange($event)\" class=\"form-control\"/>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"disabled\">\n <a [hidden]=\"isDisableCount\"> / {{pageCount}}</a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableNext}\">\n <a [title]=\"appLocale.LABEL_NEXT\" name=\"next\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableNext\"\n (click)=\"navigatePage('next', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n <span class=\"sr-only\">Go to next page {{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableLast}\">\n <a [title]=\"appLocale.LABEL_LAST\" name=\"last\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableLast\"\n (click)=\"navigatePage('last', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-last-page\"></i></span>\n <span class=\"sr-only\">Go to last page {{ isDisableLast ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (showrecordcount) {\n <li class=\"totalcount disabled\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n }\n</ul>\n}\n@if (navcontrols === 'Pager') {\n <ul class=\"pager {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n@if (!(dataSize<=maxResults)) {\n <li class=\"previous\" [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"isDisablePrevious\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class=\"sr-only\">{{ isDisablePrevious ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n <li class=\"next\" [ngClass]=\"{'disabled':isDisableNext}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('next', $event)\"\n [attr.aria-disabled]=\"isDisableNext\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class=\"sr-only\">{{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n </ul>\n}\n\n@if (navcontrols === 'Basic') {\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <div class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE }} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </div>\n @if (rowSummary?.totalRecords) {\n <div class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </div>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <pagination class=\"pagination basic\" [ngClass]=\"navigationClass\" role=\"navigation\"\n [itemsPerPage]=\"maxResults\" [totalItems]=\"dataSize\"\n (pageChanged)=\"pageChanged($event)\" [ngModelOptions]=\"{standalone:true}\" [ngModel]=\"dn.currentPage\"\n [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount + ' pages'\"\n [boundaryLinks]=\"boundarylinks\" [maxSize]=\"maxsize\"\n [directionLinks]=\"directionlinks\"\n firstText=\"Firtst\" lastText=\"Last\"\n [customPreviousTemplate]=\"prevTemplate\"\n [customNextTemplate]=\"nextTemplate\"\n [customPageTemplate]=\"pageTemplate\"></pagination>\n }\n}\n\n@if (navcontrols === 'Basic' && showrecordcount) {\n <ul class=\"pagination\">\n <li class=\"totalcount disabled basiccount\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n </ul>\n}\n\n<ng-template #pageTemplate let-page>\n <span class=\"sr-only\" [attr.data-isacitvepage]=\"page.active\">{{'Page '}}</span>\n {{page.number}}\n @if (page.active) {\n <span class=\"sr-only\"> {{', Showing page ' + page.number + ' of ' + pageCount}}</span>\n }\n</ng-template>\n<ng-template #prevTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Previous page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Next page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: i1.CommonModule }, { kind: "directive", type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: i2.FormsModule }, { kind: "directive", type: i2__namespace.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2__namespace.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: i3.PaginationModule }, { kind: "component", type: i3__namespace.PaginationComponent, selector: "pagination", inputs: ["align", "maxSize", "boundaryLinks", "directionLinks", "firstText", "previousText", "nextText", "lastText", "rotate", "pageBtnClass", "disabled", "customPageTemplate", "customNextTemplate", "customPreviousTemplate", "customFirstTemplate", "customLastTemplate", "itemsPerPage", "totalItems"], outputs: ["numPages", "pageChanged"] }, { kind: "ngmodule", type: i4.BsDropdownModule }, { kind: "directive", type: i4__namespace.BsDropdownMenuDirective, selector: "[bsDropdownMenu],[dropdownMenu]", exportAs: ["bs-dropdown-menu"] }, { kind: "directive", type: i4__namespace.BsDropdownToggleDirective, selector: "[bsDropdownToggle],[dropdownToggle]", exportAs: ["bs-dropdown-toggle"] }, { kind: "directive", type: i4__namespace.BsDropdownDirective, selector: "[bsDropdown], [dropdown]", inputs: ["placement", "triggers", "container", "dropup", "autoClose", "isAnimated", "insideClick", "isDisabled", "isOpen"], outputs: ["isOpenChange", "onShown", "onHidden"], exportAs: ["bs-dropdown"] }] }); }
|
|
862
|
-
}
|
|
863
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: PaginationComponent, decorators: [{
|
|
864
|
-
type: i0.Component,
|
|
865
|
-
args: [{ standalone: true, imports: [i1.CommonModule, i2.FormsModule, i3.PaginationModule, i4.BsDropdownModule], selector: '[wmPagination]', providers: [
|
|
866
|
-
base.provideAsWidgetRef(PaginationComponent)
|
|
867
|
-
], template: "\n@if (navcontrols === 'Classic') {\n<ul class=\"pagination advanced {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableFirst}\">\n <a [title]=\"appLocale.LABEL_FIRST\" name=\"first\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableFirst\"\n (click)=\"navigatePage('first', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-first-page\"></i></span>\n <span class=\"sr-only\">Go to first page {{ isDisableFirst ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a [title]=\"appLocale.LABEL_PREVIOUS\" name=\"prev\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisablePrevious\"\n (click)=\"navigatePage('prev', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n <span class=\"sr-only\">Go to previous page {{ isDisablePrevious ? ', Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"pagecount disabled\">\n <a href=\"javascript:void(0);\" aria-label=\"Change Page Number\">\n <input [(ngModel)]=\"dn.currentPage\" [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount\" [disabled]=\"isDisableCurrent\"\n [ngModelOptions]=\"{standalone: true}\"\n type=\"number\"\n (keydown)=\"onKeyDown($event)\" (change)=\"onModelChange($event)\" class=\"form-control\"/>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li class=\"disabled\">\n <a [hidden]=\"isDisableCount\"> / {{pageCount}}</a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableNext}\">\n <a [title]=\"appLocale.LABEL_NEXT\" name=\"next\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableNext\"\n (click)=\"navigatePage('next', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n <span class=\"sr-only\">Go to next page {{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (!(dataSize<=maxResults)) {\n <li [ngClass]=\"{'disabled':isDisableLast}\">\n <a [title]=\"appLocale.LABEL_LAST\" name=\"last\" href=\"javascript:void(0);\"\n [attr.aria-disabled]=\"isDisableLast\"\n (click)=\"navigatePage('last', $event)\">\n <span aria-hidden=\"true\"><i class=\"wi wi-last-page\"></i></span>\n <span class=\"sr-only\">Go to last page {{ isDisableLast ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n @if (showrecordcount) {\n <li class=\"totalcount disabled\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n }\n</ul>\n}\n@if (navcontrols === 'Pager') {\n <ul class=\"pager {{navigationClass}}\">\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <li class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE}} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </li>\n @if (rowSummary?.totalRecords) {\n <li class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </li>\n }\n }\n@if (!(dataSize<=maxResults)) {\n <li class=\"previous\" [ngClass]=\"{'disabled':isDisablePrevious}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('prev', $event)\"\n [attr.aria-disabled]=\"isDisablePrevious\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-left\"></i></span>\n {{appLocale.LABEL_PREVIOUS}}\n <span class=\"sr-only\">{{ isDisablePrevious ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n <li class=\"next\" [ngClass]=\"{'disabled':isDisableNext}\">\n <a href=\"javascript:void(0);\" (click)=\"navigatePage('next', $event)\"\n [attr.aria-disabled]=\"isDisableNext\">\n <span aria-hidden=\"true\"><i class=\"wi wi-chevron-right\"></i></span>\n {{appLocale.LABEL_NEXT}}\n <span class=\"sr-only\">{{ isDisableNext ? ' , Disabled' : ''}}</span>\n </a>\n </li>\n }\n </ul>\n}\n\n@if (navcontrols === 'Basic') {\n @if (allowpagesizechange && pageSizeOptions?.[0]<rowSummary?.totalRecords) {\n <div class=\"items-per-page\">\n <label [title]=\"appLocale.LABEL_ITEMS_PER_PAGE\" class=\"app-label\">{{appLocale.LABEL_ITEMS_PER_PAGE }} :</label>\n\n <div class=\"btn-group\" dropdown container=\"body\" (onShown)=\"onDropDownShown($event)\" (onHidden)=\"onDropdownHidden()\" (isOpenChange)=\"onOpenChange($event)\">\n <button id=\"button-basic\" dropdownToggle type=\"button\" class=\"btn app-button dropdown-toggle\"\n aria-controls=\"dropdown-basic\">\n {{maxResults}} <span class=\"caret\"></span>\n </button>\n <ul id=\"dropdown-basic\" *dropdownMenu class=\"dropdown-menu pagesize-options\"\n role=\"menu\" aria-labelledby=\"button-basic\">\n @for (option of pageSizeOptions; track option; let i = $index) {\n <li role=\"menuitem\" [ngClass]=\"{ 'active': option == maxResults }\">\n <a class=\"dropdown-item\" (click)=\"onPageSizeChange($event, option)\" (keydown)=\"onDropdownKeydown($event, i)\"\n [attr.tabindex]=\"i === focusedIndex ? 0 : -1\">{{option}}</a>\n </li>\n }\n </ul>\n </div>\n </div>\n @if (rowSummary?.totalRecords) {\n <div class=\"item-range\">\n <div>\n <span>{{rowSummary.startIndex}} - {{rowSummary.endIndex}}</span>\n <span>of</span>\n <span>{{rowSummary.totalRecords}}</span>\n </div>\n </div>\n }\n }\n @if (!(dataSize<=maxResults)) {\n <pagination class=\"pagination basic\" [ngClass]=\"navigationClass\" role=\"navigation\"\n [itemsPerPage]=\"maxResults\" [totalItems]=\"dataSize\"\n (pageChanged)=\"pageChanged($event)\" [ngModelOptions]=\"{standalone:true}\" [ngModel]=\"dn.currentPage\"\n [attr.aria-label]=\"'Showing Page ' + dn.currentPage + ' of ' + pageCount + ' pages'\"\n [boundaryLinks]=\"boundarylinks\" [maxSize]=\"maxsize\"\n [directionLinks]=\"directionlinks\"\n firstText=\"Firtst\" lastText=\"Last\"\n [customPreviousTemplate]=\"prevTemplate\"\n [customNextTemplate]=\"nextTemplate\"\n [customPageTemplate]=\"pageTemplate\"></pagination>\n }\n}\n\n@if (navcontrols === 'Basic' && showrecordcount) {\n <ul class=\"pagination\">\n <li class=\"totalcount disabled basiccount\">\n <a href=\"javascript:void(0);\" tabindex=\"-1\" aria-disabled=\"true\">{{appLocale.LABEL_TOTAL_RECORDS}}: {{dataSize}}</a>\n </li>\n </ul>\n}\n\n<ng-template #pageTemplate let-page>\n <span class=\"sr-only\" [attr.data-isacitvepage]=\"page.active\">{{'Page '}}</span>\n {{page.number}}\n @if (page.active) {\n <span class=\"sr-only\"> {{', Showing page ' + page.number + ' of ' + pageCount}}</span>\n }\n</ng-template>\n<ng-template #prevTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Previous page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n<ng-template #nextTemplate let-disabled=\"disabled\">\n <span class=\"sr-only\" [attr.data-isdisabled]=\"disabled\">Go to Next page {{disabled ? ', Disabled' : ''}}</span>\n</ng-template>\n" }]
|
|
868
|
-
}], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: undefined, decorators: [{
|
|
869
|
-
type: i0.SkipSelf
|
|
870
|
-
}, {
|
|
871
|
-
type: i0.Inject,
|
|
872
|
-
args: [base.WidgetRef]
|
|
873
|
-
}] }, { type: undefined, decorators: [{
|
|
874
|
-
type: i0.Inject,
|
|
875
|
-
args: ['EXPLICIT_CONTEXT']
|
|
876
|
-
}, {
|
|
877
|
-
type: i0.Optional
|
|
878
|
-
}] }], propDecorators: { resultEmitter: [{
|
|
879
|
-
type: i0.Output
|
|
880
|
-
}], maxResultsEmitter: [{
|
|
881
|
-
type: i0.Output
|
|
882
|
-
}], bsDropdown: [{
|
|
883
|
-
type: i0.ViewChild,
|
|
884
|
-
args: [i4.BsDropdownDirective]
|
|
885
|
-
}] } });
|
|
886
|
-
|
|
887
|
-
exports.PaginationComponent = PaginationComponent;
|
|
854
|
+
exports.PaginationComponent = PaginationComponent;
|
|
888
855
|
|
|
889
856
|
}));
|