@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,1098 +1,1137 @@
|
|
|
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('rxjs'), require('rxjs/operators'), require('ngx-bootstrap/typeahead'), require('@wm/core'), require('@wm/components/base'), require('@wm/components/input/dataset-aware-form'), require('lodash-es')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', '@angular/common', '@angular/forms', '@angular/core', 'rxjs', 'rxjs/operators', 'ngx-bootstrap/typeahead', '@wm/core', '@wm/components/base', '@wm/components/input/dataset-aware-form', 'lodash-es'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.basic = global.wm.components.basic || {}, global.wm.components.basic.search = {}), global.ng.common, global.ng.forms, global.ng.core, global.rxjs, global.rxjs.operators, global.ngxBootstrap.typeahead, global.wm.core, global.wm.components.base, global.wm.components.input.datasetawareform, global._));
|
|
5
5
|
})(this, (function (exports, i2, i3, i0, rxjs, operators, i4, i1, base, datasetAwareForm, lodashEs) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
var n = Object.create(null);
|
|
9
|
+
if (e) {
|
|
10
|
+
Object.keys(e).forEach(function (k) {
|
|
11
|
+
if (k !== 'default') {
|
|
12
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function () { return e[k]; }
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
var i2__namespace = /*#__PURE__*/_interopNamespaceDefault(i2);
|
|
25
|
+
var i3__namespace = /*#__PURE__*/_interopNamespaceDefault(i3);
|
|
26
|
+
var i0__namespace = /*#__PURE__*/_interopNamespaceDefault(i0);
|
|
27
|
+
var i4__namespace = /*#__PURE__*/_interopNamespaceDefault(i4);
|
|
28
|
+
var i1__namespace = /*#__PURE__*/_interopNamespaceDefault(i1);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
30
|
+
var ScrollableDirective = class ScrollableDirective {
|
|
31
|
+
constructor(inj) {
|
|
32
|
+
this.searchRef = i0.inject(SearchComponent);
|
|
33
|
+
this.elementRef = inj.get(i0.ElementRef);
|
|
34
|
+
}
|
|
35
|
+
ngAfterContentInit() {
|
|
36
|
+
this.boundNotifyParent = this.notifyParent.bind(this);
|
|
37
|
+
this.elementRef.nativeElement.addEventListener("scroll", this.boundNotifyParent);
|
|
38
|
+
this.searchRef.dropdownEl = $(this.elementRef.nativeElement);
|
|
39
|
+
this.searchRef.onDropdownOpen();
|
|
40
|
+
}
|
|
41
|
+
ngAfterViewInit() {
|
|
42
|
+
if (!this.searchRef.isMobileAutoComplete()) {
|
|
43
|
+
const typeAheadInput = this.searchRef.$element.find("input").first();
|
|
44
|
+
this.searchRef.dropdownEl.width(typeAheadInput.outerWidth());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
notifyParent(evt) {
|
|
48
|
+
this.searchRef.onScroll(this.elementRef.nativeElement, evt);
|
|
49
|
+
}
|
|
50
|
+
ngOnDestroy() {
|
|
51
|
+
if (this.elementRef?.nativeElement && this.boundNotifyParent) {
|
|
52
|
+
this.elementRef.nativeElement.removeEventListener("scroll", this.boundNotifyParent);
|
|
53
|
+
this.boundNotifyParent = null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
|
|
58
|
+
minVersion: "12.0.0",
|
|
59
|
+
version: "22.2.1",
|
|
60
|
+
ngImport: i0__namespace,
|
|
61
|
+
type: ScrollableDirective,
|
|
62
|
+
deps: [{ token: i0__namespace.Injector }],
|
|
63
|
+
target: i0__namespace.ɵɵFactoryTarget.Directive
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
static {
|
|
67
|
+
this.ɵdir = i0__namespace.ɵɵngDeclareDirective({
|
|
68
|
+
minVersion: "14.0.0",
|
|
69
|
+
version: "22.2.1",
|
|
70
|
+
type: ScrollableDirective,
|
|
71
|
+
isStandalone: true,
|
|
72
|
+
selector: "[scrollableHandler]",
|
|
73
|
+
ngImport: i0__namespace
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
i0__namespace.ɵɵngDeclareClassMetadata({
|
|
78
|
+
minVersion: "12.0.0",
|
|
79
|
+
version: "22.2.1",
|
|
80
|
+
ngImport: i0__namespace,
|
|
81
|
+
type: ScrollableDirective,
|
|
82
|
+
decorators: [{
|
|
83
|
+
type: i0.Directive,
|
|
84
|
+
args: [{
|
|
85
|
+
standalone: true,
|
|
86
|
+
selector: "[scrollableHandler]"
|
|
87
|
+
}]
|
|
88
|
+
}],
|
|
89
|
+
ctorParameters: () => [{ type: i0__namespace.Injector }]
|
|
90
|
+
});
|
|
91
|
+
const searchProps = /* @__PURE__ */ new Map([
|
|
92
|
+
["casesensitive", {
|
|
93
|
+
value: false,
|
|
94
|
+
...base.PROP_BOOLEAN
|
|
95
|
+
}],
|
|
96
|
+
["class", base.PROP_STRING],
|
|
97
|
+
["datacompletemsg", {
|
|
98
|
+
value: "No more data to load",
|
|
99
|
+
...base.PROP_STRING
|
|
100
|
+
}],
|
|
101
|
+
["datafield", {
|
|
102
|
+
value: "All Fields",
|
|
103
|
+
...base.PROP_STRING
|
|
104
|
+
}],
|
|
105
|
+
["dataoptions", base.PROP_ANY],
|
|
106
|
+
["dataset", base.PROP_ANY],
|
|
107
|
+
["datasource", base.PROP_ANY],
|
|
108
|
+
["datavalue", base.PROP_STRING],
|
|
109
|
+
["datavaluesource", base.PROP_ANY],
|
|
110
|
+
["dateformat", base.PROP_STRING],
|
|
111
|
+
["disabled", base.PROP_BOOLEAN],
|
|
112
|
+
["displayimagesrc", base.PROP_STRING],
|
|
113
|
+
["displaylabel", base.PROP_STRING],
|
|
114
|
+
["displayexpression", base.PROP_STRING],
|
|
115
|
+
["dropup", base.PROP_BOOLEAN],
|
|
116
|
+
["groupby", base.PROP_STRING],
|
|
117
|
+
["hint", base.PROP_STRING],
|
|
118
|
+
["arialabel", base.PROP_STRING],
|
|
119
|
+
["imagewidth", {
|
|
120
|
+
value: "16px",
|
|
121
|
+
...base.PROP_STRING
|
|
122
|
+
}],
|
|
123
|
+
["limit", base.PROP_NUMBER],
|
|
124
|
+
["loadingdatamsg", {
|
|
125
|
+
value: "Loading items...",
|
|
126
|
+
...base.PROP_STRING
|
|
127
|
+
}],
|
|
128
|
+
["match", base.PROP_STRING],
|
|
129
|
+
["matchmode", base.PROP_STRING],
|
|
130
|
+
["minchars", base.PROP_NUMBER],
|
|
131
|
+
["name", base.PROP_STRING],
|
|
132
|
+
["navsearchbar", {
|
|
133
|
+
value: false,
|
|
134
|
+
...base.PROP_BOOLEAN
|
|
135
|
+
}],
|
|
136
|
+
["orderby", base.PROP_STRING],
|
|
137
|
+
["placeholder", {
|
|
138
|
+
value: "Search",
|
|
139
|
+
...base.PROP_STRING
|
|
140
|
+
}],
|
|
141
|
+
["position", base.PROP_STRING],
|
|
142
|
+
["query", base.PROP_STRING],
|
|
143
|
+
["readonly", base.PROP_BOOLEAN],
|
|
144
|
+
["required", base.PROP_BOOLEAN],
|
|
145
|
+
["searchkey", base.PROP_STRING],
|
|
146
|
+
["searchon", {
|
|
147
|
+
value: "typing",
|
|
148
|
+
...base.PROP_STRING
|
|
149
|
+
}],
|
|
150
|
+
["shortcutkey", base.PROP_STRING],
|
|
151
|
+
["show", {
|
|
152
|
+
value: true,
|
|
153
|
+
...base.PROP_BOOLEAN
|
|
154
|
+
}],
|
|
155
|
+
["showclear", {
|
|
156
|
+
value: false,
|
|
157
|
+
...base.PROP_BOOLEAN
|
|
158
|
+
}],
|
|
159
|
+
["showsearchicon", base.PROP_BOOLEAN],
|
|
160
|
+
["tabindex", {
|
|
161
|
+
value: 0,
|
|
162
|
+
...base.PROP_NUMBER
|
|
163
|
+
}],
|
|
164
|
+
["type", {
|
|
165
|
+
value: "search",
|
|
166
|
+
...base.PROP_STRING
|
|
167
|
+
}],
|
|
168
|
+
["debouncetime", {
|
|
169
|
+
value: 250,
|
|
170
|
+
...base.PROP_NUMBER
|
|
171
|
+
}],
|
|
172
|
+
["width", base.PROP_STRING],
|
|
173
|
+
["clearsearchiconclass", {
|
|
174
|
+
value: "wi wi-close",
|
|
175
|
+
...base.PROP_STRING
|
|
176
|
+
}],
|
|
177
|
+
["backsearchiconclass", {
|
|
178
|
+
value: "wi wi-arrow-left",
|
|
179
|
+
...base.PROP_STRING
|
|
180
|
+
}],
|
|
181
|
+
["searchiconclass", {
|
|
182
|
+
value: "wm-sl-l sl-search",
|
|
183
|
+
...base.PROP_STRING
|
|
184
|
+
}],
|
|
185
|
+
["clearsearchiconurl", base.PROP_STRING],
|
|
186
|
+
["backsearchiconurl", base.PROP_STRING],
|
|
187
|
+
["searchiconurl", base.PROP_STRING]
|
|
188
|
+
]);
|
|
189
|
+
const registerProps = () => {
|
|
190
|
+
base.register("wm-search", searchProps);
|
|
191
|
+
base.registerFormWidget(i1.FormWidgetType.AUTOCOMPLETE, new Map(searchProps));
|
|
192
|
+
base.registerFormWidget(i1.FormWidgetType.TYPEAHEAD, new Map(searchProps));
|
|
193
|
+
};
|
|
194
|
+
var LocalDataProvider = class {
|
|
195
|
+
applyFilter(entry, queryText, filtername) {
|
|
196
|
+
entry = lodashEs.isNumber(entry) ? entry.toString() : entry;
|
|
197
|
+
if (lodashEs.includes(filtername, "start")) return lodashEs.startsWith(entry, queryText);
|
|
198
|
+
else if (lodashEs.includes(filtername, "end")) return lodashEs.endsWith(entry, queryText);
|
|
199
|
+
else if (lodashEs.includes(filtername, "exact")) return lodashEs.isEqual(entry, queryText);
|
|
200
|
+
return lodashEs.includes(entry, queryText);
|
|
201
|
+
}
|
|
202
|
+
filter(config) {
|
|
203
|
+
const entries = config.dataset;
|
|
204
|
+
let casesensitive = config.casesensitive;
|
|
205
|
+
const matchMode = config.matchMode;
|
|
206
|
+
if (matchMode && !lodashEs.includes(matchMode, "ignorecase")) casesensitive = true;
|
|
207
|
+
let queryText = config.query, filteredData;
|
|
208
|
+
return new Promise((resolve, reject) => {
|
|
209
|
+
if (config.searchKey) {
|
|
210
|
+
const keys = lodashEs.split(config.searchKey, ",");
|
|
211
|
+
filteredData = lodashEs.filter(config.dataset, (item) => {
|
|
212
|
+
return keys.some((key) => {
|
|
213
|
+
let a = lodashEs.get(item, key), b = queryText;
|
|
214
|
+
if (!casesensitive) {
|
|
215
|
+
a = lodashEs.toLower(lodashEs.toString(a));
|
|
216
|
+
b = lodashEs.toLower(lodashEs.toString(b));
|
|
217
|
+
}
|
|
218
|
+
return this.applyFilter(a, b, matchMode);
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
} else if (lodashEs.isArray(entries) && lodashEs.isObject(entries[0])) filteredData = lodashEs.filter(entries, (entry) => {
|
|
222
|
+
let a = lodashEs.values(entry).join(" ");
|
|
223
|
+
if (!casesensitive) {
|
|
224
|
+
a = lodashEs.toLower(a);
|
|
225
|
+
queryText = lodashEs.toLower(queryText);
|
|
226
|
+
}
|
|
227
|
+
return this.applyFilter(a, queryText);
|
|
228
|
+
});
|
|
229
|
+
else filteredData = lodashEs.filter(entries, (entry) => {
|
|
230
|
+
if (!casesensitive) {
|
|
231
|
+
entry = lodashEs.toLower(entry);
|
|
232
|
+
queryText = lodashEs.toLower(queryText);
|
|
233
|
+
}
|
|
234
|
+
return this.applyFilter(entry, queryText, matchMode);
|
|
235
|
+
});
|
|
236
|
+
resolve({
|
|
237
|
+
data: filteredData,
|
|
238
|
+
hasMoreData: false,
|
|
239
|
+
isLastPage: true
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
var RemoteDataProvider = class {
|
|
245
|
+
filter(config) {
|
|
246
|
+
return this.filterData(config).then((response) => this.onFilterSuccess(config, response), () => this.onFilterFailure());
|
|
247
|
+
}
|
|
248
|
+
filterData(config) {
|
|
249
|
+
if (config.dataoptions) {
|
|
250
|
+
const dataoptions = config.dataoptions;
|
|
251
|
+
const requestParams = config.datasource.execute(i1.DataSource.Operation.GET_REQUEST_PARAMS, config);
|
|
252
|
+
if (dataoptions.relatedField) return new Promise((resolve, reject) => {
|
|
253
|
+
base.interpolateBindExpressions(config.viewParent, dataoptions.filterExpr, (filterexpressions) => {
|
|
254
|
+
requestParams.filterExpr = dataoptions.filterExpr = filterexpressions;
|
|
255
|
+
dataoptions.filterExpr = filterexpressions;
|
|
256
|
+
config.datasource.execute(i1.DataSource.Operation.GET_RELATED_TABLE_DATA, lodashEs.assign({ relatedField: dataoptions.relatedField }, requestParams)).then(resolve, reject);
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
if (dataoptions.distinctField) return config.datasource.execute(i1.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS, {
|
|
260
|
+
pagesize: config.limit || config.pagesize,
|
|
261
|
+
page: config.page,
|
|
262
|
+
fields: dataoptions.distinctField,
|
|
263
|
+
entityName: dataoptions.tableName,
|
|
264
|
+
filterFields: lodashEs.assign(dataoptions.filterFields, requestParams.filterFields),
|
|
265
|
+
filterExpr: i1.getClonedObject(dataoptions.filterExpr || {})
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
return config.datasource.execute(i1.DataSource.Operation.SEARCH_RECORDS, config);
|
|
269
|
+
}
|
|
270
|
+
isLast(page, dataSize, maxResults, currentResults) {
|
|
271
|
+
if (dataSize === i1.AppConstants.INT_MAX_VALUE) return currentResults !== 0 && currentResults < maxResults;
|
|
272
|
+
return page === (dataSize > maxResults ? Math.ceil(dataSize / maxResults) : dataSize < 0 ? 0 : 1);
|
|
273
|
+
}
|
|
274
|
+
getTransformedData(variable, data) {
|
|
275
|
+
const operationResult = variable.operation + "Result";
|
|
276
|
+
const tempResponse = data[operationResult];
|
|
277
|
+
if (tempResponse) {
|
|
278
|
+
const tempObj = {};
|
|
279
|
+
lodashEs.set(tempObj, operationResult, tempResponse);
|
|
280
|
+
data = [tempObj];
|
|
281
|
+
} else data = [data];
|
|
282
|
+
return data;
|
|
283
|
+
}
|
|
284
|
+
onFilterFailure() {
|
|
285
|
+
return [];
|
|
286
|
+
}
|
|
287
|
+
isLastPageForDistinctApi(data, page, totalElements, _isLastPage) {
|
|
288
|
+
return page > 1 && !_isLastPage && lodashEs.isEmpty(data) && totalElements === i1.AppConstants.INT_MAX_VALUE;
|
|
289
|
+
}
|
|
290
|
+
onFilterSuccess(config, response) {
|
|
291
|
+
let data = response.data;
|
|
292
|
+
let formattedData;
|
|
293
|
+
let _isLastPage;
|
|
294
|
+
let page;
|
|
295
|
+
let isPaginatedData;
|
|
296
|
+
const expressionArray = lodashEs.split(config.binddataset, ".");
|
|
297
|
+
const dataExpression = lodashEs.slice(expressionArray, lodashEs.indexOf(expressionArray, "dataSet") + 1).join(".");
|
|
298
|
+
const $I = "[$i]";
|
|
299
|
+
return new Promise((resolve, reject) => {
|
|
300
|
+
const pageOptions = response.pagination;
|
|
301
|
+
if (config.datasource.execute(i1.DataSource.Operation.IS_PAGEABLE)) {
|
|
302
|
+
page = pageOptions.number + 1;
|
|
303
|
+
_isLastPage = this.isLast(page, config.limit > 0 && config.limit || pageOptions.totalElements, pageOptions.size, pageOptions.numberOfElements);
|
|
304
|
+
isPaginatedData = true;
|
|
305
|
+
if (this.isLastPageForDistinctApi(data, page, pageOptions.totalElements, _isLastPage)) {
|
|
306
|
+
_isLastPage = true;
|
|
307
|
+
resolve({
|
|
308
|
+
data: [],
|
|
309
|
+
isLastPage: _isLastPage,
|
|
310
|
+
hasMoreData: page > 1,
|
|
311
|
+
isPaginatedData,
|
|
312
|
+
page
|
|
313
|
+
});
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (dataExpression) {
|
|
318
|
+
if (lodashEs.isArray(data)) {
|
|
319
|
+
const index = dataExpression.lastIndexOf($I);
|
|
320
|
+
if (index > -1) {
|
|
321
|
+
const restExpr = dataExpression.substr(index + 5);
|
|
322
|
+
formattedData = data.map((datum) => i1.findValueOf(datum, restExpr));
|
|
323
|
+
}
|
|
324
|
+
} else if (lodashEs.isObject(data)) formattedData = lodashEs.get(data, dataExpression);
|
|
325
|
+
data = formattedData || data;
|
|
326
|
+
}
|
|
327
|
+
if (!lodashEs.isArray(data)) data = this.getTransformedData(config.datasource, data);
|
|
328
|
+
if (!data.length) resolve({
|
|
329
|
+
data: [],
|
|
330
|
+
isLastPage: _isLastPage,
|
|
331
|
+
hasMoreData: page > 1,
|
|
332
|
+
isPaginatedData,
|
|
333
|
+
page
|
|
334
|
+
});
|
|
335
|
+
else resolve({
|
|
336
|
+
data,
|
|
337
|
+
isLastPage: _isLastPage,
|
|
338
|
+
hasMoreData: page > 1,
|
|
339
|
+
isPaginatedData,
|
|
340
|
+
page
|
|
341
|
+
});
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
var DataProvider = class DataProvider {
|
|
346
|
+
static {
|
|
347
|
+
this.remoteDataProvider = new RemoteDataProvider();
|
|
348
|
+
}
|
|
349
|
+
static {
|
|
350
|
+
this.localDataProvider = new LocalDataProvider();
|
|
351
|
+
}
|
|
352
|
+
filter(config) {
|
|
353
|
+
let promise;
|
|
354
|
+
const hasNoVariableDataset = config.datasource?.execute(i1.DataSource.Operation.IS_UPDATE_REQUIRED, config.hasData);
|
|
355
|
+
if (!config.isLocalFilter && (config.dataoptions || config.datasource?.execute(i1.DataSource.Operation.IS_API_AWARE) && config.searchKey && hasNoVariableDataset)) promise = DataProvider.remoteDataProvider.filter(config);
|
|
356
|
+
else promise = DataProvider.localDataProvider.filter(config);
|
|
357
|
+
return promise.then((response) => {
|
|
358
|
+
this.updateDataset = config.datasource && !config.datasource.execute(i1.DataSource.Operation.SUPPORTS_CRUD) && hasNoVariableDataset;
|
|
359
|
+
this.hasMoreData = response.hasMoreData;
|
|
360
|
+
this.isLastPage = response.isLastPage;
|
|
361
|
+
this.page = response.page;
|
|
362
|
+
this.isPaginatedData = response.isPaginatedData;
|
|
363
|
+
return response;
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
const WIDGET_CONFIG = {
|
|
368
|
+
widgetType: "wm-search",
|
|
369
|
+
hostClass: "input-group"
|
|
370
|
+
};
|
|
371
|
+
var SearchComponent = class SearchComponent extends datasetAwareForm.DatasetAwareFormComponent {
|
|
372
|
+
static {
|
|
373
|
+
this.initializeProps = registerProps();
|
|
374
|
+
}
|
|
375
|
+
get typeaheadOptionsLimit() {
|
|
376
|
+
return i1.isDefined(this.limit) ? this.limit : this._dynamicTypeaheadOptionsLimit;
|
|
377
|
+
}
|
|
378
|
+
get datasource() {
|
|
379
|
+
return this._datasource;
|
|
380
|
+
}
|
|
381
|
+
set datasource(nv) {
|
|
382
|
+
this._datasource = nv;
|
|
383
|
+
const data = this.datavalue || this.toBeProcessedDatavalue;
|
|
384
|
+
this.updateByDatavalue(data);
|
|
385
|
+
}
|
|
386
|
+
constructor(inj, app, binddatavalue, binddataset, explicitContext) {
|
|
387
|
+
super(inj, WIDGET_CONFIG, explicitContext);
|
|
388
|
+
this.binddatavalue = binddatavalue;
|
|
389
|
+
this.binddataset = binddataset;
|
|
390
|
+
this.query = "";
|
|
391
|
+
this.page = 1;
|
|
392
|
+
this.allowempty = false;
|
|
393
|
+
this.app = app;
|
|
394
|
+
i1.addClass(this.nativeElement, "app-search", true);
|
|
395
|
+
this.typeaheadDataSource = rxjs.Observable.create((observer) => {
|
|
396
|
+
if (this.listenQuery) {
|
|
397
|
+
this._defaultQueryInvoked = false;
|
|
398
|
+
this._loadingItems = true;
|
|
399
|
+
observer.next(this.query);
|
|
400
|
+
}
|
|
401
|
+
if (this.lastSelectedIndex) this.typeahead._container = void 0;
|
|
402
|
+
}).pipe(operators.filter(() => {
|
|
403
|
+
this._loadingItems = false;
|
|
404
|
+
return this.minchars === 0 || this.query && this.query.length >= this.minchars;
|
|
405
|
+
}), operators.mergeMap((token) => this.getDataSourceAsObservable(token)));
|
|
406
|
+
this.dataProvider = new DataProvider();
|
|
407
|
+
const datavalueSubscription = this.datavalue$.subscribe((val) => {
|
|
408
|
+
const query = lodashEs.isArray(val) ? val[0] : val;
|
|
409
|
+
if (query === null || query === "") {
|
|
410
|
+
this._modelByValue = "";
|
|
411
|
+
this.query = this.queryModel = "";
|
|
412
|
+
this._lastResult = void 0;
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
if (!this._unsubscribeDv) {
|
|
416
|
+
this._defaultQueryInvoked = false;
|
|
417
|
+
if (!lodashEs.isObject(val) && this.prevDatavalue !== val) {
|
|
418
|
+
this._modelByKey = void 0;
|
|
419
|
+
this.query = this.queryModel = "";
|
|
420
|
+
}
|
|
421
|
+
this.updateByDatavalue(val);
|
|
422
|
+
}
|
|
423
|
+
this.showClosebtn = this.query !== "";
|
|
424
|
+
});
|
|
425
|
+
this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
|
|
426
|
+
const datasetSubscription = this.dataset$.subscribe(() => {
|
|
427
|
+
this.startIndex = this.datasetItems.length;
|
|
428
|
+
this._lastResult = void 0;
|
|
429
|
+
const defaultValue = this.datavalue || this.toBeProcessedDatavalue;
|
|
430
|
+
if (i1.isDefined(defaultValue)) this.updateByDataset(defaultValue);
|
|
431
|
+
});
|
|
432
|
+
this.registerDestroyListener(() => datasetSubscription.unsubscribe());
|
|
433
|
+
}
|
|
434
|
+
clearSearch($event, loadOnClear) {
|
|
435
|
+
this.query = "";
|
|
436
|
+
this.onInputChange($event);
|
|
437
|
+
if (this.dataProvider) this.dataProvider.isLastPage = false;
|
|
438
|
+
this.listenQuery = false;
|
|
439
|
+
if (loadOnClear) {
|
|
440
|
+
this.listenQuery = true;
|
|
441
|
+
this._unsubscribeDv = false;
|
|
442
|
+
this.loadMoreData();
|
|
443
|
+
}
|
|
444
|
+
this.invokeEventCallback("clearsearch");
|
|
445
|
+
this._loadingItems = false;
|
|
446
|
+
if ($event) this.$element.find(".app-search-input").focus();
|
|
447
|
+
}
|
|
448
|
+
clearText() {
|
|
449
|
+
this.query = "";
|
|
450
|
+
this.showClosebtn = false;
|
|
451
|
+
}
|
|
452
|
+
closeSearch() {
|
|
453
|
+
this._loadingItems = false;
|
|
454
|
+
this.page = 1;
|
|
455
|
+
this.insertAtIndex(this.elIndex);
|
|
456
|
+
this.elIndex = void 0;
|
|
457
|
+
this.parentEl = void 0;
|
|
458
|
+
this.$element.removeClass("full-screen");
|
|
459
|
+
if (this._domUpdated) this._domUpdated = false;
|
|
460
|
+
this.listenQuery = false;
|
|
461
|
+
this._unsubscribeDv = true;
|
|
462
|
+
this.typeahead.hide();
|
|
463
|
+
}
|
|
464
|
+
renderMobileAutoComplete() {
|
|
465
|
+
if (!i1.isDefined(this.elIndex)) {
|
|
466
|
+
this.parentEl = this.$element.parent();
|
|
467
|
+
this.elIndex = this.parentEl.children().index(this.$element);
|
|
468
|
+
}
|
|
469
|
+
if (!this.$element.hasClass("full-screen")) {
|
|
470
|
+
this._domUpdated = true;
|
|
471
|
+
this.$element.addClass("full-screen");
|
|
472
|
+
if (this.position === "inline") this.$element.addClass(this.position);
|
|
473
|
+
}
|
|
474
|
+
if (this.$element.hasClass("full-screen")) this.$element.find(".app-search-input").focus();
|
|
475
|
+
}
|
|
476
|
+
getDataSourceAsObservable(query) {
|
|
477
|
+
if (this._lastQuery === query && !lodashEs.get(this.dataoptions, "filterFields") && i1.isDefined(this._lastResult)) {
|
|
478
|
+
this._loadingItems = false;
|
|
479
|
+
return rxjs.of(this._lastResult);
|
|
480
|
+
}
|
|
481
|
+
if (this.type === "autocomplete" && this.searchkey && this.query && this.datavalue) {
|
|
482
|
+
let bindDisplayLabelArray = [];
|
|
483
|
+
const searchKeyArray = lodashEs.split(this.searchkey, ",");
|
|
484
|
+
let displaylabel;
|
|
485
|
+
if (this.binddisplaylabel) {
|
|
486
|
+
bindDisplayLabelArray = lodashEs.split(this.binddisplaylabel, "+");
|
|
487
|
+
if (bindDisplayLabelArray.length === 1) {
|
|
488
|
+
if (!lodashEs.includes(bindDisplayLabelArray[0], "|")) displaylabel = /\[(.*?)\]/.exec(bindDisplayLabelArray[0])[1];
|
|
489
|
+
else displaylabel = true;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
if (bindDisplayLabelArray.length > 1 || displaylabel && !lodashEs.includes(searchKeyArray, displaylabel) || this.displayexpression && !lodashEs.includes(searchKeyArray, this.displayexpression)) {
|
|
493
|
+
this._loadingItems = false;
|
|
494
|
+
return rxjs.of([]);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
this._lastQuery = this.query;
|
|
498
|
+
return rxjs.from(this.getDataSource(query));
|
|
499
|
+
}
|
|
500
|
+
handleEvent(node, eventName, eventCallback, locals) {
|
|
501
|
+
if (!lodashEs.includes([
|
|
502
|
+
"blur",
|
|
503
|
+
"focus",
|
|
504
|
+
"select",
|
|
505
|
+
"submit",
|
|
506
|
+
"change"
|
|
507
|
+
], eventName)) super.handleEvent(node, eventName, eventCallback, locals);
|
|
508
|
+
}
|
|
509
|
+
highlight(match, query) {
|
|
510
|
+
if (this.typeaheadContainer) {
|
|
511
|
+
match.value = match.item.label.toString();
|
|
512
|
+
return this.typeaheadContainer.highlight(match, query);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
insertAtIndex(i) {
|
|
516
|
+
if (i === 0) this.parentEl.prepend(this.$element);
|
|
517
|
+
else if (this.parentEl.children().eq(i).length) this.$element.insertBefore(this.parentEl.children().eq(i));
|
|
518
|
+
else this.$element.insertAfter(this.parentEl.children().eq(i - 1));
|
|
519
|
+
}
|
|
520
|
+
isMobileAutoComplete() {
|
|
521
|
+
return this.type === "autocomplete" && i1.isMobile();
|
|
522
|
+
}
|
|
523
|
+
isQueryEntered() {
|
|
524
|
+
return this.showclear && this.showClosebtn;
|
|
525
|
+
}
|
|
526
|
+
loadMoreData(incrementPage) {
|
|
527
|
+
if (!this.dataProvider || this.dataProvider.isLastPage) return;
|
|
528
|
+
this.page = incrementPage ? this.page + 1 : this.page;
|
|
529
|
+
this.isScrolled = true;
|
|
530
|
+
this._loadingItems = true;
|
|
531
|
+
if (incrementPage) this._lastQuery = void 0;
|
|
532
|
+
this.typeahead.onInput({ target: { value: lodashEs.trim(this.query) || "0" } });
|
|
533
|
+
}
|
|
534
|
+
onFocusOut() {
|
|
535
|
+
this._unsubscribeDv = false;
|
|
536
|
+
this._loadingItems = false;
|
|
537
|
+
this.page = 1;
|
|
538
|
+
if (!this._domUpdated && this._isOpen) this.listenQuery = false;
|
|
539
|
+
this._isOpen = false;
|
|
540
|
+
if (this._domUpdated && this.typeahead && this.typeahead._container) this.typeahead._container.isFocused = true;
|
|
541
|
+
}
|
|
542
|
+
onInputChange($event) {
|
|
543
|
+
this.result = [];
|
|
544
|
+
this.page = 1;
|
|
545
|
+
this.listenQuery = this.isUpdateOnKeyPress();
|
|
546
|
+
this._modelByValue = void 0;
|
|
547
|
+
if (this.query === "") {
|
|
548
|
+
this.queryModel = "";
|
|
549
|
+
this._modelByValue = "";
|
|
550
|
+
this.updatePrevDatavalue(this._lastQuery);
|
|
551
|
+
this.invokeOnChange(this._modelByValue, {}, true);
|
|
552
|
+
this.invokeEventCallback("clear", { $event });
|
|
553
|
+
if ($event && $event.which !== 9) this.invokeEventCallback("submit", { $event });
|
|
554
|
+
} else this.invokeEventCallback("change", {
|
|
555
|
+
$event,
|
|
556
|
+
newVal: this._modelByValue || this.query,
|
|
557
|
+
oldVal: this.prevDatavalue
|
|
558
|
+
});
|
|
559
|
+
this.showClosebtn = this.query !== "";
|
|
560
|
+
}
|
|
561
|
+
handleEnterEvent($event) {
|
|
562
|
+
if (!lodashEs.get(this.typeahead, "matches.length")) this.onSearchSelect($event);
|
|
563
|
+
}
|
|
564
|
+
onSearchSelect($event) {
|
|
565
|
+
let item;
|
|
566
|
+
const isQueryMatch = this.typeaheadContainer?.active?.value === this.query;
|
|
567
|
+
if (this.typeaheadContainer?.active && isQueryMatch) item = this.typeaheadContainer.active.item;
|
|
568
|
+
$event = this.eventData($event, item || {});
|
|
569
|
+
if (!this.isUpdateOnKeyPress()) {
|
|
570
|
+
this.listenQuery = true;
|
|
571
|
+
this.typeahead.onInput({ target: { value: this.query } });
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
if (this.typeaheadContainer && this.liElements.length && isQueryMatch) this.typeaheadContainer.selectActiveMatch();
|
|
575
|
+
else {
|
|
576
|
+
this.queryModel = this.query;
|
|
577
|
+
this.invokeEventCallback("submit", { $event });
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
invokeOnBeforeServiceCall(inputData) {
|
|
581
|
+
this.invokeEventCallback("beforeservicecall", { inputData });
|
|
582
|
+
}
|
|
583
|
+
onDropdownOpen() {
|
|
584
|
+
if (this.clearData) this.typeahead.hide();
|
|
585
|
+
lodashEs.debounce(() => {
|
|
586
|
+
this._isOpen = true;
|
|
587
|
+
this.typeaheadContainer = this.typeahead._container || this.typeahead._typeahead.instance;
|
|
588
|
+
this.typeaheadContainer.liElements = this.liElements;
|
|
589
|
+
this.typeaheadContainer.ulElement = this.ulElement;
|
|
590
|
+
i1.adjustContainerPosition($("typeahead-container"), this.nativeElement, this.typeahead._typeahead, $("typeahead-container .dropdown-menu"));
|
|
591
|
+
})();
|
|
592
|
+
if (this.isMobileAutoComplete()) {
|
|
593
|
+
if (!this.$element.hasClass("full-screen")) this.renderMobileAutoComplete();
|
|
594
|
+
const dropdownEl = this.dropdownEl.closest("typeahead-container");
|
|
595
|
+
dropdownEl.insertAfter(this.$element.find("input").first());
|
|
596
|
+
const screenHeight = this.$element.closest(".app-content").height();
|
|
597
|
+
dropdownEl.css({
|
|
598
|
+
position: "relative",
|
|
599
|
+
top: 0,
|
|
600
|
+
height: screenHeight + "px"
|
|
601
|
+
});
|
|
602
|
+
this.showClosebtn = this.query && this.query !== "";
|
|
603
|
+
if (this.dataProvider && !lodashEs.isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) this.triggerSearch();
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
selectNext() {
|
|
607
|
+
const matches = this.typeaheadContainer.matches;
|
|
608
|
+
if (!matches) return;
|
|
609
|
+
const index = matches.indexOf(this.typeaheadContainer.active);
|
|
610
|
+
if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && index + 1 > matches.length - 1) {
|
|
611
|
+
this.lastSelectedIndex = index;
|
|
612
|
+
this.loadMoreData(true);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
setLastActiveMatchAsSelected() {
|
|
616
|
+
if (this.lastSelectedIndex) {
|
|
617
|
+
this.typeaheadContainer._active = this.typeaheadContainer.matches[this.lastSelectedIndex];
|
|
618
|
+
this.typeaheadContainer.nextActiveMatch();
|
|
619
|
+
this.lastSelectedIndex = void 0;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
triggerSearch() {
|
|
623
|
+
if (!this.dataProvider || this.dataProvider.isLastPage || !this.$element.hasClass("full-screen")) return;
|
|
624
|
+
const typeAheadDropDown = this.dropdownEl;
|
|
625
|
+
const $lastItem = typeAheadDropDown.find("li").last();
|
|
626
|
+
if ($lastItem.length && typeAheadDropDown.length && typeAheadDropDown.height() + typeAheadDropDown.position().top > $lastItem.height() + $lastItem.position().top) this.loadMoreData(true);
|
|
627
|
+
}
|
|
628
|
+
isUpdateOnKeyPress() {
|
|
629
|
+
return this.searchon === "typing";
|
|
630
|
+
}
|
|
631
|
+
debounceDefaultQuery(data) {
|
|
632
|
+
this._defaultQueryInvoked = true;
|
|
633
|
+
this.getDataSource(data, true).then((response) => {
|
|
634
|
+
if (response.length) {
|
|
635
|
+
this.queryModel = response;
|
|
636
|
+
this._lastQuery = this.query = this.queryModel[0].label || "";
|
|
637
|
+
this._modelByValue = this.queryModel[0].value;
|
|
638
|
+
this._modelByKey = this.queryModel[0].key;
|
|
639
|
+
this.showClosebtn = this.query !== "";
|
|
640
|
+
} else {
|
|
641
|
+
this._modelByValue = void 0;
|
|
642
|
+
this.queryModel = void 0;
|
|
643
|
+
this.query = "";
|
|
644
|
+
}
|
|
645
|
+
if (this.clearData) {
|
|
646
|
+
if (lodashEs.get(this.typeahead, "_typeahead.isShown")) this.typeahead.hide();
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
updateByDatavalue(data) {
|
|
651
|
+
this.updateByDataset(data);
|
|
652
|
+
this.updateByDataSource(data);
|
|
653
|
+
}
|
|
654
|
+
updateByDataSource(data) {
|
|
655
|
+
if (i1.isDefined(data) && !lodashEs.isObject(data) && this.datasource && !i1.isDefined(this._modelByKey) && this.datafield !== base.ALLFIELDS) {
|
|
656
|
+
if (i1.isDefined(this.queryModel) && !lodashEs.isEmpty(this.queryModel)) {
|
|
657
|
+
this.updateDatavalueFromQueryModel();
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
if (!this._defaultQueryInvoked && this.datasource.execute(i1.DataSource.Operation.SUPPORTS_CRUD)) this.debounceDefaultQuery(data);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
updateDatavalueFromQueryModel() {
|
|
664
|
+
if (i1.isDefined(this.queryModel)) {
|
|
665
|
+
this._modelByValue = lodashEs.isArray(this.queryModel) ? this.queryModel[0].value : this.queryModel;
|
|
666
|
+
this._modelByKey = lodashEs.isArray(this.queryModel) ? this.queryModel[0].key : this.queryModel;
|
|
667
|
+
this.toBeProcessedDatavalue = void 0;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
updateByDataset(data) {
|
|
671
|
+
if (this._defaultQueryInvoked && this.searchkey) return;
|
|
672
|
+
const selectedItem = lodashEs.find(this.datasetItems, (item) => {
|
|
673
|
+
return lodashEs.isObject(item.value) ? lodashEs.isEqual(item.value, data) : lodashEs.toString(item.value).toLowerCase() === lodashEs.toString(data).toLowerCase();
|
|
674
|
+
});
|
|
675
|
+
if (selectedItem) this.queryModel = [selectedItem];
|
|
676
|
+
else if (this.datafield === base.ALLFIELDS && lodashEs.isObject(data)) this.queryModel = this.getTransformedData(base.extractDataAsArray(data));
|
|
677
|
+
else if (this.prevDatavalue !== data) {
|
|
678
|
+
this.queryModel = void 0;
|
|
679
|
+
this.query = "";
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
this.updateDatavalueFromQueryModel();
|
|
683
|
+
this._lastQuery = this.query = i1.isDefined(this.queryModel) && this.queryModel.length ? lodashEs.get(this.queryModel[0], "label") : "";
|
|
684
|
+
this.showClosebtn = this.query !== "";
|
|
685
|
+
}
|
|
686
|
+
handleFocus($event) {
|
|
687
|
+
if (this.type === "search" && this.query === this._lastQuery && this._lastResult) this.typeahead.keyUpEventEmitter.emit(this.query);
|
|
688
|
+
}
|
|
689
|
+
notifySubscriber() {
|
|
690
|
+
const parentEl = $(this.nativeElement).closest(".app-composite-widget.caption-floating");
|
|
691
|
+
if (parentEl.length > 0) this.app.notify("captionPositionAnimate", {
|
|
692
|
+
displayVal: true,
|
|
693
|
+
nativeEl: parentEl
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
getDataSource(query, searchOnDataField, nextItemIndex) {
|
|
697
|
+
if (searchOnDataField && this.datafield === base.ALLFIELDS) {
|
|
698
|
+
this._loadingItems = false;
|
|
699
|
+
return Promise.resolve([]);
|
|
700
|
+
}
|
|
701
|
+
const dataConfig = {
|
|
702
|
+
dataset: this.dataset ? base.convertDataToObject(this.dataset) : void 0,
|
|
703
|
+
binddataset: this.binddataset,
|
|
704
|
+
datasource: this.datasource,
|
|
705
|
+
datafield: this.datafield,
|
|
706
|
+
hasData: this.dataset?.length,
|
|
707
|
+
query,
|
|
708
|
+
isLocalFilter: !this.searchkey,
|
|
709
|
+
searchKey: searchOnDataField ? this.datafield : this.searchkey,
|
|
710
|
+
matchMode: searchOnDataField ? "startignorecase" : this.matchmode,
|
|
711
|
+
casesensitive: this.casesensitive,
|
|
712
|
+
isformfield: this.isformfield,
|
|
713
|
+
orderby: this.orderby,
|
|
714
|
+
limit: this.limit,
|
|
715
|
+
pagesize: this.pagesize,
|
|
716
|
+
page: this.page,
|
|
717
|
+
onBeforeservicecall: this.invokeOnBeforeServiceCall.bind(this)
|
|
718
|
+
};
|
|
719
|
+
if (this.dataoptions) {
|
|
720
|
+
dataConfig.dataoptions = this.dataoptions;
|
|
721
|
+
dataConfig.viewParent = this.viewParent;
|
|
722
|
+
}
|
|
723
|
+
this._loadingItems = true;
|
|
724
|
+
return this.dataProvider.filter(dataConfig).then((response) => {
|
|
725
|
+
response = response.data || response;
|
|
726
|
+
if (this.dataProvider && (!i1.isDefined(this.dataset) || !this.dataset.length) && this.dataProvider.updateDataset) this.dataset = response;
|
|
727
|
+
if (this.dataProvider?.hasMoreData) this.formattedDataset = this.formattedDataset.concat(response);
|
|
728
|
+
else this.formattedDataset = response;
|
|
729
|
+
if (this.formattedDataset.length > 20 && !i1.isDefined(this.limit)) this._dynamicTypeaheadOptionsLimit = this.formattedDataset.length;
|
|
730
|
+
else this._dynamicTypeaheadOptionsLimit = void 0;
|
|
731
|
+
if (this.dataProvider && this._isOpen && this.isMobileAutoComplete() && !lodashEs.isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) this.triggerSearch();
|
|
732
|
+
const transformedData = this.getTransformedData(this.formattedDataset, nextItemIndex);
|
|
733
|
+
this.result = lodashEs.map(transformedData, "value");
|
|
734
|
+
return transformedData;
|
|
735
|
+
}, (error) => {
|
|
736
|
+
this._loadingItems = false;
|
|
737
|
+
return [];
|
|
738
|
+
}).then((result) => {
|
|
739
|
+
if (this.isScrolled) {
|
|
740
|
+
lodashEs.debounce(() => {
|
|
741
|
+
this.setLastActiveMatchAsSelected();
|
|
742
|
+
}, 30)();
|
|
743
|
+
this.isScrolled = false;
|
|
744
|
+
}
|
|
745
|
+
if (!result.length) {
|
|
746
|
+
this._modelByValue = void 0;
|
|
747
|
+
this.queryModel = query;
|
|
748
|
+
}
|
|
749
|
+
if (this._unsubscribeDv) result = [];
|
|
750
|
+
this._loadingItems = false;
|
|
751
|
+
this._lastResult = result;
|
|
752
|
+
return result;
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
getContext(context) {
|
|
756
|
+
if (context && lodashEs.get(context, "widget")) return this.getContext(context.viewParent);
|
|
757
|
+
return context;
|
|
758
|
+
}
|
|
759
|
+
getTransformedData(data, itemIndex, iscustom) {
|
|
760
|
+
if (i1.isDefined(itemIndex)) itemIndex++;
|
|
761
|
+
const transformedData = base.transformFormData(this.getContext(this.viewParent), data, this.datafield, {
|
|
762
|
+
displayField: this.displaylabel || this.displayfield,
|
|
763
|
+
displayExpr: iscustom ? "" : this.displayexpression,
|
|
764
|
+
bindDisplayExpr: iscustom ? "" : this.binddisplaylabel,
|
|
765
|
+
bindDisplayImgSrc: this.binddisplayimagesrc,
|
|
766
|
+
displayImgSrc: this.displayimagesrc
|
|
767
|
+
}, itemIndex, this);
|
|
768
|
+
return base.getUniqObjsByDataField(transformedData, this.datafield, this.displayfield || this.displaylabel, i1.toBoolean(this.allowempty));
|
|
769
|
+
}
|
|
770
|
+
onScroll($scrollEl, evt) {
|
|
771
|
+
const totalHeight = $scrollEl.scrollHeight, clientHeight = $scrollEl.clientHeight;
|
|
772
|
+
if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && $scrollEl.scrollTop + clientHeight >= totalHeight) this.loadMoreData(true);
|
|
773
|
+
}
|
|
774
|
+
ngOnInit() {
|
|
775
|
+
super.ngOnInit();
|
|
776
|
+
if (!i1.isDefined(this.minchars)) {
|
|
777
|
+
if (this.type === "autocomplete") this.minchars = 0;
|
|
778
|
+
else this.minchars = 1;
|
|
779
|
+
}
|
|
780
|
+
this.listenQuery = this.isUpdateOnKeyPress();
|
|
781
|
+
this.showsearchicon = i1.isDefined(this.showsearchicon) ? this.showsearchicon : this.type === "search";
|
|
782
|
+
}
|
|
783
|
+
ngAfterViewInit() {
|
|
784
|
+
super.ngAfterViewInit();
|
|
785
|
+
base.styler(this.nativeElement, this);
|
|
786
|
+
this.containerTarget = base.getContainerTargetClass(this.nativeElement);
|
|
787
|
+
}
|
|
788
|
+
ngAfterViewChecked() {
|
|
789
|
+
const searchInputEl = $(".app-search-input");
|
|
790
|
+
if (searchInputEl) searchInputEl.removeAttr("aria-expanded");
|
|
791
|
+
}
|
|
792
|
+
eventData($event, item) {
|
|
793
|
+
if ($event) $event["data"] = {
|
|
794
|
+
item: item.dataObject,
|
|
795
|
+
model: item.value,
|
|
796
|
+
label: item.label,
|
|
797
|
+
query: this.query
|
|
798
|
+
};
|
|
799
|
+
return $event;
|
|
800
|
+
}
|
|
801
|
+
typeaheadOnSelect(match, $event) {
|
|
802
|
+
const item = match.item;
|
|
803
|
+
this.queryModel = item;
|
|
804
|
+
item.selected = true;
|
|
805
|
+
this.query = item.label;
|
|
806
|
+
this.showClosebtn = this.query !== "";
|
|
807
|
+
$event = $event || this.$typeaheadEvent;
|
|
808
|
+
this._modelByKey = item.key;
|
|
809
|
+
this._modelByValue = item.value;
|
|
810
|
+
$event = this.eventData($event, item);
|
|
811
|
+
this.invokeOnTouched();
|
|
812
|
+
this.invokeOnChange(this.datavalue, $event || {});
|
|
813
|
+
if (this.datavalue !== this.prevDatavalue) this.updateBoundVariable(this.datavalue);
|
|
814
|
+
if (this.$element.hasClass("full-screen")) this.closeSearch();
|
|
815
|
+
this.invokeEventCallback("select", {
|
|
816
|
+
$event,
|
|
817
|
+
selectedValue: this.datavalue
|
|
818
|
+
});
|
|
819
|
+
this.invokeEventCallback("submit", { $event });
|
|
820
|
+
this.updatePrevDatavalue(this.datavalue);
|
|
821
|
+
}
|
|
822
|
+
onPropertyChange(key, nv, ov) {
|
|
823
|
+
if (key === "tabindex") return;
|
|
824
|
+
if (this.type === "autocomplete" && key === "displaylabel" && this.displaylabel && (!this.displayexpression || this.displayexpression && !this.datasource)) {
|
|
825
|
+
this.displayexpression = this.displaylabel;
|
|
826
|
+
this.displaylabel = void 0;
|
|
827
|
+
}
|
|
828
|
+
if (key === "displaylabel" && this.dataoptions && this.binddisplaylabel === null) this.query = lodashEs.get(this._modelByValue, nv) || this._modelByValue;
|
|
829
|
+
if (key === "disabled") {
|
|
830
|
+
if (nv === false) this.clearData = false;
|
|
831
|
+
else {
|
|
832
|
+
this.clearData = true;
|
|
833
|
+
if (lodashEs.get(this.typeahead, "_typeahead.isShown")) this.typeahead.hide();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
if (key === "minchars" && this.typeahead && i1.isDefined(nv)) this.typeahead._typeaheadMinLengthValue = nv;
|
|
837
|
+
super.onPropertyChange(key, nv, ov);
|
|
838
|
+
}
|
|
839
|
+
ngOnDestroy() {
|
|
840
|
+
this.liElements = null;
|
|
841
|
+
if (this.dataProvider) this.dataProvider = null;
|
|
842
|
+
if (this.typeahead) this.typeahead = null;
|
|
843
|
+
this.queryModel = null;
|
|
844
|
+
this.query = "";
|
|
845
|
+
super.ngOnDestroy();
|
|
846
|
+
}
|
|
847
|
+
static {
|
|
848
|
+
this.ɵfac = i0__namespace.ɵɵngDeclareFactory({
|
|
849
|
+
minVersion: "12.0.0",
|
|
850
|
+
version: "22.2.1",
|
|
851
|
+
ngImport: i0__namespace,
|
|
852
|
+
type: SearchComponent,
|
|
853
|
+
deps: [
|
|
854
|
+
{ token: i0__namespace.Injector },
|
|
855
|
+
{ token: i1__namespace.App },
|
|
856
|
+
{
|
|
857
|
+
token: "datavalue.bind",
|
|
858
|
+
attribute: true
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
token: "dataset.bind",
|
|
862
|
+
attribute: true
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
token: "EXPLICIT_CONTEXT",
|
|
866
|
+
optional: true
|
|
867
|
+
}
|
|
868
|
+
],
|
|
869
|
+
target: i0__namespace.ɵɵFactoryTarget.Component
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
static {
|
|
873
|
+
this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({
|
|
874
|
+
minVersion: "17.0.0",
|
|
875
|
+
version: "22.2.1",
|
|
876
|
+
type: SearchComponent,
|
|
877
|
+
isStandalone: true,
|
|
878
|
+
selector: "[wmSearch]",
|
|
879
|
+
providers: [
|
|
880
|
+
base.provideAs(SearchComponent, i3.NG_VALUE_ACCESSOR, true),
|
|
881
|
+
base.provideAs(SearchComponent, i3.NG_VALIDATORS, true),
|
|
882
|
+
base.provideAsWidgetRef(SearchComponent)
|
|
883
|
+
],
|
|
884
|
+
viewQueries: [
|
|
885
|
+
{
|
|
886
|
+
propertyName: "typeahead",
|
|
887
|
+
first: true,
|
|
888
|
+
predicate: i4.TypeaheadDirective,
|
|
889
|
+
descendants: true
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
propertyName: "ulElement",
|
|
893
|
+
first: true,
|
|
894
|
+
predicate: ["ulElement"],
|
|
895
|
+
descendants: true
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
propertyName: "liElements",
|
|
899
|
+
predicate: ["liElements"],
|
|
900
|
+
descendants: true
|
|
901
|
+
}
|
|
902
|
+
],
|
|
903
|
+
usesInheritance: true,
|
|
904
|
+
ngImport: i0__namespace,
|
|
905
|
+
template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" aria-label=\"Back\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input aria-label=\"Search value\" class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" aria-label=\"Clear\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n",
|
|
906
|
+
dependencies: [
|
|
907
|
+
{
|
|
908
|
+
kind: "ngmodule",
|
|
909
|
+
type: i2.CommonModule
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
kind: "directive",
|
|
913
|
+
type: i2__namespace.NgClass,
|
|
914
|
+
selector: "[ngClass]",
|
|
915
|
+
inputs: ["class", "ngClass"]
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
kind: "directive",
|
|
919
|
+
type: i2__namespace.NgTemplateOutlet,
|
|
920
|
+
selector: "[ngTemplateOutlet]",
|
|
921
|
+
inputs: [
|
|
922
|
+
"ngTemplateOutletContext",
|
|
923
|
+
"ngTemplateOutlet",
|
|
924
|
+
"ngTemplateOutletInjector"
|
|
925
|
+
]
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
kind: "ngmodule",
|
|
929
|
+
type: i3.FormsModule
|
|
930
|
+
},
|
|
931
|
+
{
|
|
932
|
+
kind: "directive",
|
|
933
|
+
type: i3__namespace.ɵNgNoValidate,
|
|
934
|
+
selector: "form:not([ngNoForm]):not([ngNativeValidate])"
|
|
935
|
+
},
|
|
936
|
+
{
|
|
937
|
+
kind: "directive",
|
|
938
|
+
type: i3__namespace.DefaultValueAccessor,
|
|
939
|
+
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]"
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
kind: "directive",
|
|
943
|
+
type: i3__namespace.NgControlStatus,
|
|
944
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
kind: "directive",
|
|
948
|
+
type: i3__namespace.NgControlStatusGroup,
|
|
949
|
+
selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
kind: "directive",
|
|
953
|
+
type: i3__namespace.NgModel,
|
|
954
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
955
|
+
inputs: [
|
|
956
|
+
"name",
|
|
957
|
+
"disabled",
|
|
958
|
+
"ngModel",
|
|
959
|
+
"ngModelOptions"
|
|
960
|
+
],
|
|
961
|
+
outputs: ["ngModelChange"],
|
|
962
|
+
exportAs: ["ngModel"]
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
kind: "directive",
|
|
966
|
+
type: i3__namespace.NgForm,
|
|
967
|
+
selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]",
|
|
968
|
+
inputs: ["ngFormOptions"],
|
|
969
|
+
outputs: ["ngSubmit"],
|
|
970
|
+
exportAs: ["ngForm"]
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
kind: "directive",
|
|
974
|
+
type: ScrollableDirective,
|
|
975
|
+
selector: "[scrollableHandler]"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
kind: "ngmodule",
|
|
979
|
+
type: i4.TypeaheadModule
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
kind: "directive",
|
|
983
|
+
type: i4__namespace.TypeaheadDirective,
|
|
984
|
+
selector: "[typeahead]",
|
|
985
|
+
inputs: [
|
|
986
|
+
"typeahead",
|
|
987
|
+
"typeaheadMinLength",
|
|
988
|
+
"adaptivePosition",
|
|
989
|
+
"isAnimated",
|
|
990
|
+
"typeaheadWaitMs",
|
|
991
|
+
"typeaheadOptionsLimit",
|
|
992
|
+
"typeaheadOptionField",
|
|
993
|
+
"typeaheadGroupField",
|
|
994
|
+
"typeaheadOrderBy",
|
|
995
|
+
"typeaheadAsync",
|
|
996
|
+
"typeaheadLatinize",
|
|
997
|
+
"typeaheadSingleWords",
|
|
998
|
+
"typeaheadWordDelimiters",
|
|
999
|
+
"typeaheadMultipleSearch",
|
|
1000
|
+
"typeaheadMultipleSearchDelimiters",
|
|
1001
|
+
"typeaheadPhraseDelimiters",
|
|
1002
|
+
"typeaheadItemTemplate",
|
|
1003
|
+
"optionsListTemplate",
|
|
1004
|
+
"typeaheadScrollable",
|
|
1005
|
+
"typeaheadOptionsInScrollableView",
|
|
1006
|
+
"typeaheadHideResultsOnBlur",
|
|
1007
|
+
"typeaheadSelectFirstItem",
|
|
1008
|
+
"typeaheadIsFirstItemActive",
|
|
1009
|
+
"container",
|
|
1010
|
+
"dropup"
|
|
1011
|
+
],
|
|
1012
|
+
outputs: [
|
|
1013
|
+
"typeaheadLoading",
|
|
1014
|
+
"typeaheadNoResults",
|
|
1015
|
+
"typeaheadOnSelect",
|
|
1016
|
+
"typeaheadOnPreview",
|
|
1017
|
+
"typeaheadOnBlur"
|
|
1018
|
+
],
|
|
1019
|
+
exportAs: ["bs-typeahead"]
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
kind: "directive",
|
|
1023
|
+
type: base.TextContentDirective,
|
|
1024
|
+
selector: "[textContent]",
|
|
1025
|
+
inputs: ["textContent"]
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
kind: "directive",
|
|
1029
|
+
type: base.ItemTemplateDirective,
|
|
1030
|
+
selector: "[wmItemTemplate]",
|
|
1031
|
+
inputs: ["userComponentParams", "wmItemTemplate"],
|
|
1032
|
+
exportAs: ["itemTemplateRef"]
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
kind: "directive",
|
|
1036
|
+
type: base.PartialParamHandlerDirective,
|
|
1037
|
+
selector: "[partialContainer]"
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
kind: "directive",
|
|
1041
|
+
type: base.PartialContainerDirective,
|
|
1042
|
+
selector: "[partialContainer]"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
kind: "component",
|
|
1046
|
+
type: base.WmAppIconComponent,
|
|
1047
|
+
selector: "wm-app-icon",
|
|
1048
|
+
inputs: [
|
|
1049
|
+
"icon",
|
|
1050
|
+
"iconclass",
|
|
1051
|
+
"iconurl",
|
|
1052
|
+
"defaultIconClass",
|
|
1053
|
+
"defaultClasses",
|
|
1054
|
+
"iconStyle",
|
|
1055
|
+
"alt"
|
|
1056
|
+
]
|
|
1057
|
+
}
|
|
1058
|
+
],
|
|
1059
|
+
changeDetection: i0__namespace.ChangeDetectionStrategy.Eager
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
};
|
|
1063
|
+
i0__namespace.ɵɵngDeclareClassMetadata({
|
|
1064
|
+
minVersion: "12.0.0",
|
|
1065
|
+
version: "22.2.1",
|
|
1066
|
+
ngImport: i0__namespace,
|
|
1067
|
+
type: SearchComponent,
|
|
1068
|
+
decorators: [{
|
|
1069
|
+
type: i0.Component,
|
|
1070
|
+
args: [{
|
|
1071
|
+
changeDetection: i0.ChangeDetectionStrategy.Eager,
|
|
1072
|
+
standalone: true,
|
|
1073
|
+
imports: [
|
|
1074
|
+
i2.CommonModule,
|
|
1075
|
+
i3.FormsModule,
|
|
1076
|
+
ScrollableDirective,
|
|
1077
|
+
i4.TypeaheadModule,
|
|
1078
|
+
base.TextContentDirective,
|
|
1079
|
+
base.ItemTemplateDirective,
|
|
1080
|
+
base.PartialParamHandlerDirective,
|
|
1081
|
+
base.PartialContainerDirective,
|
|
1082
|
+
base.WmAppIconComponent
|
|
1083
|
+
],
|
|
1084
|
+
selector: "[wmSearch]",
|
|
1085
|
+
providers: [
|
|
1086
|
+
base.provideAs(SearchComponent, i3.NG_VALUE_ACCESSOR, true),
|
|
1087
|
+
base.provideAs(SearchComponent, i3.NG_VALIDATORS, true),
|
|
1088
|
+
base.provideAsWidgetRef(SearchComponent)
|
|
1089
|
+
],
|
|
1090
|
+
template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" aria-label=\"Back\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input aria-label=\"Search value\" class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" aria-label=\"Clear\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n"
|
|
1091
|
+
}]
|
|
1092
|
+
}],
|
|
1093
|
+
ctorParameters: () => [
|
|
1094
|
+
{ type: i0__namespace.Injector },
|
|
1095
|
+
{ type: i1__namespace.App },
|
|
1096
|
+
{
|
|
1097
|
+
type: void 0,
|
|
1098
|
+
decorators: [{
|
|
1099
|
+
type: i0.Attribute,
|
|
1100
|
+
args: ["datavalue.bind"]
|
|
1101
|
+
}]
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
type: void 0,
|
|
1105
|
+
decorators: [{
|
|
1106
|
+
type: i0.Attribute,
|
|
1107
|
+
args: ["dataset.bind"]
|
|
1108
|
+
}]
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
type: void 0,
|
|
1112
|
+
decorators: [{
|
|
1113
|
+
type: i0.Inject,
|
|
1114
|
+
args: ["EXPLICIT_CONTEXT"]
|
|
1115
|
+
}, { type: i0.Optional }]
|
|
1116
|
+
}
|
|
1117
|
+
],
|
|
1118
|
+
propDecorators: {
|
|
1119
|
+
typeahead: [{
|
|
1120
|
+
type: i0.ViewChild,
|
|
1121
|
+
args: [i4.TypeaheadDirective]
|
|
1122
|
+
}],
|
|
1123
|
+
ulElement: [{
|
|
1124
|
+
type: i0.ViewChild,
|
|
1125
|
+
args: ["ulElement"]
|
|
1126
|
+
}],
|
|
1127
|
+
liElements: [{
|
|
1128
|
+
type: i0.ViewChildren,
|
|
1129
|
+
args: ["liElements"]
|
|
1130
|
+
}]
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
70
1133
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
['class', base.PROP_STRING],
|
|
74
|
-
['datacompletemsg', { value: 'No more data to load', ...base.PROP_STRING }],
|
|
75
|
-
['datafield', { value: 'All Fields', ...base.PROP_STRING }],
|
|
76
|
-
['dataoptions', base.PROP_ANY],
|
|
77
|
-
['dataset', base.PROP_ANY],
|
|
78
|
-
['datasource', base.PROP_ANY],
|
|
79
|
-
['datavalue', base.PROP_STRING],
|
|
80
|
-
['datavaluesource', base.PROP_ANY],
|
|
81
|
-
['dateformat', base.PROP_STRING],
|
|
82
|
-
['disabled', base.PROP_BOOLEAN],
|
|
83
|
-
['displayimagesrc', base.PROP_STRING],
|
|
84
|
-
['displaylabel', base.PROP_STRING],
|
|
85
|
-
['displayexpression', base.PROP_STRING],
|
|
86
|
-
['dropup', base.PROP_BOOLEAN],
|
|
87
|
-
['groupby', base.PROP_STRING],
|
|
88
|
-
['hint', base.PROP_STRING],
|
|
89
|
-
['arialabel', base.PROP_STRING],
|
|
90
|
-
['imagewidth', { value: '16px', ...base.PROP_STRING }],
|
|
91
|
-
['limit', base.PROP_NUMBER],
|
|
92
|
-
['loadingdatamsg', { value: 'Loading items...', ...base.PROP_STRING }],
|
|
93
|
-
['match', base.PROP_STRING],
|
|
94
|
-
['matchmode', base.PROP_STRING],
|
|
95
|
-
['minchars', base.PROP_NUMBER],
|
|
96
|
-
['name', base.PROP_STRING],
|
|
97
|
-
['navsearchbar', { value: false, ...base.PROP_BOOLEAN }],
|
|
98
|
-
['orderby', base.PROP_STRING],
|
|
99
|
-
['placeholder', { value: 'Search', ...base.PROP_STRING }],
|
|
100
|
-
['position', base.PROP_STRING],
|
|
101
|
-
['query', base.PROP_STRING],
|
|
102
|
-
['readonly', base.PROP_BOOLEAN],
|
|
103
|
-
['required', base.PROP_BOOLEAN],
|
|
104
|
-
['searchkey', base.PROP_STRING],
|
|
105
|
-
['searchon', { value: 'typing', ...base.PROP_STRING }],
|
|
106
|
-
['shortcutkey', base.PROP_STRING],
|
|
107
|
-
['show', { value: true, ...base.PROP_BOOLEAN }],
|
|
108
|
-
['showclear', { value: false, ...base.PROP_BOOLEAN }],
|
|
109
|
-
['showsearchicon', base.PROP_BOOLEAN],
|
|
110
|
-
['tabindex', { value: 0, ...base.PROP_NUMBER }],
|
|
111
|
-
['type', { value: 'search', ...base.PROP_STRING }],
|
|
112
|
-
['debouncetime', { value: 250, ...base.PROP_NUMBER }],
|
|
113
|
-
['width', base.PROP_STRING],
|
|
114
|
-
['clearsearchiconclass', { value: 'wi wi-close', ...base.PROP_STRING }],
|
|
115
|
-
['backsearchiconclass', { value: 'wi wi-arrow-left', ...base.PROP_STRING }],
|
|
116
|
-
['searchiconclass', { value: 'wm-sl-l sl-search', ...base.PROP_STRING }],
|
|
117
|
-
['clearsearchiconurl', base.PROP_STRING],
|
|
118
|
-
['backsearchiconurl', base.PROP_STRING],
|
|
119
|
-
['searchiconurl', base.PROP_STRING],
|
|
120
|
-
]);
|
|
121
|
-
const registerProps = () => {
|
|
122
|
-
base.register('wm-search', searchProps);
|
|
123
|
-
base.registerFormWidget(i1.FormWidgetType.AUTOCOMPLETE, new Map(searchProps));
|
|
124
|
-
base.registerFormWidget(i1.FormWidgetType.TYPEAHEAD, new Map(searchProps));
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
class LocalDataProvider {
|
|
128
|
-
applyFilter(entry, queryText, filtername) {
|
|
129
|
-
entry = lodashEs.isNumber(entry) ? entry.toString() : entry;
|
|
130
|
-
if (lodashEs.includes(filtername, 'start')) {
|
|
131
|
-
return lodashEs.startsWith(entry, queryText);
|
|
132
|
-
}
|
|
133
|
-
else if (lodashEs.includes(filtername, 'end')) {
|
|
134
|
-
return lodashEs.endsWith(entry, queryText);
|
|
135
|
-
}
|
|
136
|
-
else if (lodashEs.includes(filtername, 'exact')) {
|
|
137
|
-
return lodashEs.isEqual(entry, queryText);
|
|
138
|
-
}
|
|
139
|
-
return lodashEs.includes(entry, queryText);
|
|
140
|
-
}
|
|
141
|
-
// LocalData filtering is done based on the searchkey.
|
|
142
|
-
filter(config) {
|
|
143
|
-
const entries = config.dataset;
|
|
144
|
-
let casesensitive = config.casesensitive;
|
|
145
|
-
const matchMode = config.matchMode;
|
|
146
|
-
// for supporting existing projects
|
|
147
|
-
if (matchMode && !lodashEs.includes(matchMode, 'ignorecase')) {
|
|
148
|
-
casesensitive = true;
|
|
149
|
-
}
|
|
150
|
-
let queryText = config.query, filteredData;
|
|
151
|
-
return new Promise((resolve, reject) => {
|
|
152
|
-
/**
|
|
153
|
-
* If searchKey is defined, then check for match string against each item in the dataset with item's field name as the searchKey
|
|
154
|
-
* return the filtered data containing the matching string.
|
|
155
|
-
*/
|
|
156
|
-
if (config.searchKey) {
|
|
157
|
-
const keys = lodashEs.split(config.searchKey, ',');
|
|
158
|
-
filteredData = lodashEs.filter(config.dataset, (item) => {
|
|
159
|
-
return keys.some(key => {
|
|
160
|
-
let a = lodashEs.get(item, key), b = queryText;
|
|
161
|
-
if (!casesensitive) {
|
|
162
|
-
a = lodashEs.toLower(lodashEs.toString(a));
|
|
163
|
-
b = lodashEs.toLower(lodashEs.toString(b));
|
|
164
|
-
}
|
|
165
|
-
return this.applyFilter(a, b, matchMode);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
else
|
|
170
|
-
// local search on data with array of objects.
|
|
171
|
-
// Iterate over each item and return the filtered data containing the matching string.
|
|
172
|
-
if (lodashEs.isArray(entries) && lodashEs.isObject(entries[0])) {
|
|
173
|
-
filteredData = lodashEs.filter(entries, entry => {
|
|
174
|
-
let a = lodashEs.values(entry).join(' ');
|
|
175
|
-
if (!casesensitive) {
|
|
176
|
-
a = lodashEs.toLower(a);
|
|
177
|
-
// @ts-ignore
|
|
178
|
-
queryText = lodashEs.toLower(queryText);
|
|
179
|
-
}
|
|
180
|
-
return this.applyFilter(a, queryText);
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
filteredData = lodashEs.filter(entries, entry => {
|
|
185
|
-
if (!casesensitive) {
|
|
186
|
-
entry = lodashEs.toLower(entry);
|
|
187
|
-
// @ts-ignore
|
|
188
|
-
queryText = lodashEs.toLower(queryText);
|
|
189
|
-
}
|
|
190
|
-
return this.applyFilter(entry, queryText, matchMode);
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
resolve({
|
|
194
|
-
data: filteredData,
|
|
195
|
-
hasMoreData: false,
|
|
196
|
-
isLastPage: true
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
class RemoteDataProvider {
|
|
203
|
-
filter(config) {
|
|
204
|
-
return this.filterData(config).then(response => this.onFilterSuccess(config, response), () => this.onFilterFailure());
|
|
205
|
-
}
|
|
206
|
-
filterData(config) {
|
|
207
|
-
if (config.dataoptions) {
|
|
208
|
-
const dataoptions = config.dataoptions;
|
|
209
|
-
const requestParams = config.datasource.execute(i1.DataSource.Operation.GET_REQUEST_PARAMS, config);
|
|
210
|
-
// If options are specified, make specifics calls to fetch the results
|
|
211
|
-
// Fetch the related field data
|
|
212
|
-
if (dataoptions.relatedField) {
|
|
213
|
-
return new Promise((resolve, reject) => {
|
|
214
|
-
base.interpolateBindExpressions(config.viewParent, dataoptions.filterExpr, (filterexpressions) => {
|
|
215
|
-
requestParams.filterExpr = dataoptions.filterExpr = filterexpressions;
|
|
216
|
-
dataoptions.filterExpr = filterexpressions;
|
|
217
|
-
config.datasource.execute(i1.DataSource.Operation.GET_RELATED_TABLE_DATA, lodashEs.assign({ relatedField: dataoptions.relatedField }, requestParams)).then(resolve, reject);
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
// Fetch the distinct data
|
|
222
|
-
if (dataoptions.distinctField) {
|
|
223
|
-
return config.datasource.execute(i1.DataSource.Operation.GET_DISTINCT_DATA_BY_FIELDS, {
|
|
224
|
-
pagesize: config.limit || config.pagesize,
|
|
225
|
-
page: config.page,
|
|
226
|
-
fields: dataoptions.distinctField,
|
|
227
|
-
entityName: dataoptions.tableName,
|
|
228
|
-
filterFields: lodashEs.assign(dataoptions.filterFields, requestParams.filterFields),
|
|
229
|
-
filterExpr: i1.getClonedObject(dataoptions.filterExpr || {})
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
// search records using the searchkey
|
|
234
|
-
return config.datasource.execute(i1.DataSource.Operation.SEARCH_RECORDS, config);
|
|
235
|
-
}
|
|
236
|
-
// Check if the page retrieved currently is the last page. If last page, don't send any more request
|
|
237
|
-
isLast(page, dataSize, maxResults, currentResults) {
|
|
238
|
-
// if last page info is not returned by backend and current results is less than max results, this is the last page
|
|
239
|
-
if (dataSize === i1.AppConstants.INT_MAX_VALUE) {
|
|
240
|
-
return currentResults !== 0 && currentResults < maxResults;
|
|
241
|
-
}
|
|
242
|
-
const pageCount = ((dataSize > maxResults) ? (Math.ceil(dataSize / maxResults)) : (dataSize < 0 ? 0 : 1));
|
|
243
|
-
return page === pageCount;
|
|
244
|
-
}
|
|
245
|
-
// this function transform the response data in case it is not an array
|
|
246
|
-
getTransformedData(variable, data) {
|
|
247
|
-
const operationResult = variable.operation + 'Result'; // when output is only string it is available as oprationNameResult
|
|
248
|
-
const tempResponse = data[operationResult];
|
|
249
|
-
// in case data received is value as string then add that string value to object and convert object into array
|
|
250
|
-
if (tempResponse) {
|
|
251
|
-
const tempObj = {};
|
|
252
|
-
lodashEs.set(tempObj, operationResult, tempResponse);
|
|
253
|
-
data = [tempObj]; // convert data into an array having tempObj
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
// in case data received is already an object then convert it into an array
|
|
257
|
-
data = [data];
|
|
258
|
-
}
|
|
259
|
-
return data;
|
|
260
|
-
}
|
|
261
|
-
onFilterFailure() {
|
|
262
|
-
return [];
|
|
263
|
-
}
|
|
264
|
-
isLastPageForDistinctApi(data, page, totalElements, _isLastPage) {
|
|
265
|
-
return page > 1 && !_isLastPage && lodashEs.isEmpty(data) && totalElements === i1.AppConstants.INT_MAX_VALUE;
|
|
266
|
-
}
|
|
267
|
-
// this function processes the response depending on pageOptions, isPageable and prepares the formattedDataset.
|
|
268
|
-
onFilterSuccess(config, response) {
|
|
269
|
-
let data = response.data;
|
|
270
|
-
let formattedData;
|
|
271
|
-
let _isLastPage;
|
|
272
|
-
let page;
|
|
273
|
-
let isPaginatedData;
|
|
274
|
-
const expressionArray = lodashEs.split(config.binddataset, '.');
|
|
275
|
-
const dataExpression = lodashEs.slice(expressionArray, lodashEs.indexOf(expressionArray, 'dataSet') + 1).join('.');
|
|
276
|
-
const $I = '[$i]';
|
|
277
|
-
return new Promise((resolve, reject) => {
|
|
278
|
-
const pageOptions = response.pagination;
|
|
279
|
-
if (config.datasource.execute(i1.DataSource.Operation.IS_PAGEABLE)) {
|
|
280
|
-
page = pageOptions.number + 1;
|
|
281
|
-
_isLastPage = this.isLast(page, (config.limit > 0 && config.limit) || pageOptions.totalElements, pageOptions.size, pageOptions.numberOfElements);
|
|
282
|
-
isPaginatedData = true;
|
|
283
|
-
if (this.isLastPageForDistinctApi(data, page, pageOptions.totalElements, _isLastPage)) {
|
|
284
|
-
_isLastPage = true;
|
|
285
|
-
resolve({
|
|
286
|
-
data: [],
|
|
287
|
-
isLastPage: _isLastPage,
|
|
288
|
-
hasMoreData: page > 1,
|
|
289
|
-
isPaginatedData,
|
|
290
|
-
page
|
|
291
|
-
});
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
// if data expression exists, extract the data from the expression path
|
|
296
|
-
if (dataExpression) {
|
|
297
|
-
if (lodashEs.isArray(data)) {
|
|
298
|
-
const index = dataExpression.lastIndexOf($I);
|
|
299
|
-
if (index > -1) {
|
|
300
|
-
const restExpr = dataExpression.substr(index + 5);
|
|
301
|
-
formattedData = data.map(datum => i1.findValueOf(datum, restExpr));
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
else if (lodashEs.isObject(data)) {
|
|
305
|
-
formattedData = lodashEs.get(data, dataExpression);
|
|
306
|
-
}
|
|
307
|
-
data = formattedData || data;
|
|
308
|
-
}
|
|
309
|
-
if (!lodashEs.isArray(data)) {
|
|
310
|
-
data = this.getTransformedData(config.datasource, data);
|
|
311
|
-
}
|
|
312
|
-
// in case of no data received, resolve the promise with empty array
|
|
313
|
-
if (!data.length) {
|
|
314
|
-
resolve({ data: [], isLastPage: _isLastPage, hasMoreData: page > 1, isPaginatedData, page });
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
resolve({ data: data, isLastPage: _isLastPage, hasMoreData: page > 1, isPaginatedData, page });
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
class DataProvider {
|
|
324
|
-
static { this.remoteDataProvider = new RemoteDataProvider(); }
|
|
325
|
-
static { this.localDataProvider = new LocalDataProvider(); }
|
|
326
|
-
filter(config) {
|
|
327
|
-
let promise;
|
|
328
|
-
/**
|
|
329
|
-
* Make call to remoteDataProvider when searchkey is available and data is not from local / model variable.
|
|
330
|
-
* Otherwise use localDataProvider
|
|
331
|
-
* If datasource is a serviceVariable with no input params, then perform local search.
|
|
332
|
-
* when there is no dataset on the datasource when first time make a remote call to set the dataset for service variable.
|
|
333
|
-
*/
|
|
334
|
-
const hasNoVariableDataset = config.datasource?.execute(i1.DataSource.Operation.IS_UPDATE_REQUIRED, config.hasData);
|
|
335
|
-
if (!config.isLocalFilter && (config.dataoptions || ((config.datasource?.execute(i1.DataSource.Operation.IS_API_AWARE))
|
|
336
|
-
&& config.searchKey
|
|
337
|
-
&& hasNoVariableDataset))) {
|
|
338
|
-
promise = DataProvider.remoteDataProvider.filter(config);
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
promise = DataProvider.localDataProvider.filter(config);
|
|
342
|
-
}
|
|
343
|
-
return promise.then(response => {
|
|
344
|
-
this.updateDataset = config.datasource && !config.datasource.execute(i1.DataSource.Operation.SUPPORTS_CRUD) && hasNoVariableDataset;
|
|
345
|
-
this.hasMoreData = response.hasMoreData;
|
|
346
|
-
this.isLastPage = response.isLastPage;
|
|
347
|
-
this.page = response.page;
|
|
348
|
-
this.isPaginatedData = response.isPaginatedData;
|
|
349
|
-
return response;
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const WIDGET_CONFIG = { widgetType: 'wm-search', hostClass: 'input-group' };
|
|
355
|
-
class SearchComponent extends datasetAwareForm.DatasetAwareFormComponent {
|
|
356
|
-
static { this.initializeProps = registerProps(); }
|
|
357
|
-
get typeaheadOptionsLimit() {
|
|
358
|
-
return i1.isDefined(this.limit) ? this.limit : this._dynamicTypeaheadOptionsLimit;
|
|
359
|
-
}
|
|
360
|
-
// getter setter is added to pass the datasource to searchcomponent.
|
|
361
|
-
get datasource() {
|
|
362
|
-
return this._datasource;
|
|
363
|
-
}
|
|
364
|
-
set datasource(nv) {
|
|
365
|
-
this._datasource = nv;
|
|
366
|
-
const data = this.datavalue || this.toBeProcessedDatavalue;
|
|
367
|
-
this.updateByDatavalue(data);
|
|
368
|
-
}
|
|
369
|
-
constructor(inj, app, binddatavalue, binddataset, explicitContext) {
|
|
370
|
-
super(inj, WIDGET_CONFIG, explicitContext);
|
|
371
|
-
this.binddatavalue = binddatavalue;
|
|
372
|
-
this.binddataset = binddataset;
|
|
373
|
-
this.query = '';
|
|
374
|
-
this.page = 1;
|
|
375
|
-
// this flag will not allow the empty datafield values.
|
|
376
|
-
this.allowempty = false;
|
|
377
|
-
this.app = app;
|
|
378
|
-
i1.addClass(this.nativeElement, 'app-search', true);
|
|
379
|
-
/**
|
|
380
|
-
* Listens for the change in the ngModel on every search and retrieves the data as observable.
|
|
381
|
-
* This observable data is passed to the typeahead.
|
|
382
|
-
* @type {Observable<any>}
|
|
383
|
-
*/
|
|
384
|
-
this.typeaheadDataSource = rxjs.Observable
|
|
385
|
-
.create((observer) => {
|
|
386
|
-
// Runs on every search
|
|
387
|
-
if (this.listenQuery) {
|
|
388
|
-
this._defaultQueryInvoked = false;
|
|
389
|
-
this._loadingItems = true;
|
|
390
|
-
observer.next(this.query);
|
|
391
|
-
}
|
|
392
|
-
// on keydown, while scrolling the dropdown items, when last item is reached next call is triggered
|
|
393
|
-
// unless the call is resolved, we are able to scroll next to first item and soon
|
|
394
|
-
// This shows flickering from first item to next new items appended.
|
|
395
|
-
// By setting container to undefined, key events changes will be stopped while loading items
|
|
396
|
-
if (this.lastSelectedIndex) {
|
|
397
|
-
this.typeahead._container = undefined;
|
|
398
|
-
}
|
|
399
|
-
}).pipe(operators.filter(() => {
|
|
400
|
-
this._loadingItems = false;
|
|
401
|
-
return (this.minchars === 0 || (this.query && this.query.length >= this.minchars));
|
|
402
|
-
}), operators.mergeMap((token) => this.getDataSourceAsObservable(token)));
|
|
403
|
-
this.dataProvider = new DataProvider();
|
|
404
|
-
/**
|
|
405
|
-
* When default datavalue is not found within the dataset, a filter call is made to get the record using fetchDefaultModel.
|
|
406
|
-
* after getting the response, set the queryModel and query.
|
|
407
|
-
*/
|
|
408
|
-
const datavalueSubscription = this.datavalue$.subscribe((val) => {
|
|
409
|
-
const query = (lodashEs.isArray(val) ? val[0] : val);
|
|
410
|
-
if (query === null || query === '') {
|
|
411
|
-
this._modelByValue = '';
|
|
412
|
-
// reset the query.
|
|
413
|
-
this.query = this.queryModel = '';
|
|
414
|
-
// on clear or reset filter, empty the lastResults to fetch new records.
|
|
415
|
-
this._lastResult = undefined;
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
if (!this._unsubscribeDv) {
|
|
419
|
-
this._defaultQueryInvoked = false;
|
|
420
|
-
// if prev datavalue is not equal to current datavalue then clear the modelByKey and queryModel
|
|
421
|
-
if (!lodashEs.isObject(val) && this.prevDatavalue !== val) {
|
|
422
|
-
this._modelByKey = undefined;
|
|
423
|
-
this.query = this.queryModel = '';
|
|
424
|
-
}
|
|
425
|
-
// if the datafield is ALLFILEDS do not fetch the records
|
|
426
|
-
// update the query model with the values we have
|
|
427
|
-
this.updateByDatavalue(val);
|
|
428
|
-
}
|
|
429
|
-
// turn on showCloseBtn when a default value is given
|
|
430
|
-
this.showClosebtn = (this.query !== '');
|
|
431
|
-
});
|
|
432
|
-
this.registerDestroyListener(() => datavalueSubscription.unsubscribe());
|
|
433
|
-
const datasetSubscription = this.dataset$.subscribe(() => {
|
|
434
|
-
// set the next item index.
|
|
435
|
-
this.startIndex = this.datasetItems.length;
|
|
436
|
-
this._lastResult = undefined;
|
|
437
|
-
const defaultValue = this.datavalue || this.toBeProcessedDatavalue;
|
|
438
|
-
// invoking updateByDataset only when datavalue is present, as entered value i.e. query is setting back to ''
|
|
439
|
-
if (i1.isDefined(defaultValue)) {
|
|
440
|
-
this.updateByDataset(defaultValue);
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
this.registerDestroyListener(() => datasetSubscription.unsubscribe());
|
|
444
|
-
}
|
|
445
|
-
// on clear, trigger search with page size 1
|
|
446
|
-
clearSearch($event, loadOnClear) {
|
|
447
|
-
this.query = '';
|
|
448
|
-
this.onInputChange($event);
|
|
449
|
-
if (this.dataProvider) {
|
|
450
|
-
this.dataProvider.isLastPage = false;
|
|
451
|
-
}
|
|
452
|
-
this.listenQuery = false;
|
|
453
|
-
if (loadOnClear) {
|
|
454
|
-
this.listenQuery = true;
|
|
455
|
-
this._unsubscribeDv = false;
|
|
456
|
-
this.loadMoreData();
|
|
457
|
-
}
|
|
458
|
-
this.invokeEventCallback('clearsearch');
|
|
459
|
-
this._loadingItems = false;
|
|
460
|
-
// when search input is cleared, focus on the input field
|
|
461
|
-
if ($event) {
|
|
462
|
-
this.$element.find('.app-search-input').focus();
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
// function to clear the input value
|
|
466
|
-
clearText() {
|
|
467
|
-
this.query = '';
|
|
468
|
-
this.showClosebtn = false;
|
|
469
|
-
}
|
|
470
|
-
// Close the full screen mode in mobile view of auto complete
|
|
471
|
-
closeSearch() {
|
|
472
|
-
this._loadingItems = false;
|
|
473
|
-
this.page = 1;
|
|
474
|
-
// after closing the search, insert the element at its previous position (elIndex)
|
|
475
|
-
this.insertAtIndex(this.elIndex);
|
|
476
|
-
this.elIndex = undefined;
|
|
477
|
-
this.parentEl = undefined;
|
|
478
|
-
this.$element.removeClass('full-screen');
|
|
479
|
-
if (this._domUpdated) {
|
|
480
|
-
this._domUpdated = false;
|
|
481
|
-
}
|
|
482
|
-
this.listenQuery = false;
|
|
483
|
-
this._unsubscribeDv = true;
|
|
484
|
-
this.typeahead.hide();
|
|
485
|
-
}
|
|
486
|
-
renderMobileAutoComplete() {
|
|
487
|
-
// Get the parent element of the search element which can be next or prev element, if both are empty then get the parent of element.
|
|
488
|
-
if (!i1.isDefined(this.elIndex)) {
|
|
489
|
-
this.parentEl = this.$element.parent();
|
|
490
|
-
this.elIndex = this.parentEl.children().index(this.$element);
|
|
491
|
-
}
|
|
492
|
-
if (!this.$element.hasClass('full-screen')) {
|
|
493
|
-
// this flag is set to notify that the typeahead-container dom has changed its position
|
|
494
|
-
this._domUpdated = true;
|
|
495
|
-
// Add full screen class on focus of the input element.
|
|
496
|
-
this.$element.addClass('full-screen');
|
|
497
|
-
// Add position to set the height to auto
|
|
498
|
-
if (this.position === 'inline') {
|
|
499
|
-
this.$element.addClass(this.position);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
// focus is lost when element is changed to full-screen, keydown to select next items will not work
|
|
503
|
-
// Hence explicitly focusing the input
|
|
504
|
-
if (this.$element.hasClass('full-screen')) {
|
|
505
|
-
this.$element.find('.app-search-input').focus();
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
getDataSourceAsObservable(query) {
|
|
509
|
-
// show dropdown only when there is change in query. This should not apply when dataoptions with filterFields are updated.
|
|
510
|
-
// when lastResult is not available i.e. still the first call is pending and second query is invoked then do not return.
|
|
511
|
-
if (this._lastQuery === query && !lodashEs.get(this.dataoptions, 'filterFields') && i1.isDefined(this._lastResult)) {
|
|
512
|
-
this._loadingItems = false;
|
|
513
|
-
return rxjs.of(this._lastResult);
|
|
514
|
-
}
|
|
515
|
-
/*
|
|
516
|
-
WMS-19177: On focus of input field for autocomplete type, do not trigger api call when
|
|
517
|
-
a) searchkey and displayexpression are different
|
|
518
|
-
b) binddisplaylabel contains multiple values
|
|
519
|
-
c) binddisplaylabel contains single value which does not match with searchkey
|
|
520
|
-
*/
|
|
521
|
-
if (this.type === 'autocomplete' && this.searchkey && this.query && this.datavalue) {
|
|
522
|
-
let bindDisplayLabelArray = [];
|
|
523
|
-
const searchKeyArray = lodashEs.split(this.searchkey, ',');
|
|
524
|
-
let displaylabel;
|
|
525
|
-
if (this.binddisplaylabel) {
|
|
526
|
-
bindDisplayLabelArray = lodashEs.split(this.binddisplaylabel, '+');
|
|
527
|
-
if (bindDisplayLabelArray.length === 1) {
|
|
528
|
-
if (!lodashEs.includes(bindDisplayLabelArray[0], '|')) {
|
|
529
|
-
const regex = /\[(.*?)\]/;
|
|
530
|
-
displaylabel = regex.exec(bindDisplayLabelArray[0])[1];
|
|
531
|
-
}
|
|
532
|
-
else {
|
|
533
|
-
displaylabel = true;
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
if ((bindDisplayLabelArray.length > 1 || (displaylabel && !lodashEs.includes(searchKeyArray, displaylabel))
|
|
538
|
-
|| (this.displayexpression && !lodashEs.includes(searchKeyArray, this.displayexpression)))) {
|
|
539
|
-
this._loadingItems = false;
|
|
540
|
-
return rxjs.of([]);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
this._lastQuery = this.query;
|
|
544
|
-
return rxjs.from(this.getDataSource(query));
|
|
545
|
-
}
|
|
546
|
-
handleEvent(node, eventName, eventCallback, locals) {
|
|
547
|
-
if (!lodashEs.includes(['blur', 'focus', 'select', 'submit', 'change'], eventName)) {
|
|
548
|
-
super.handleEvent(node, eventName, eventCallback, locals);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
// highlight the characters in the dropdown matching the query.
|
|
552
|
-
highlight(match, query) {
|
|
553
|
-
if (this.typeaheadContainer) {
|
|
554
|
-
// highlight of chars will work only when label are strings.
|
|
555
|
-
match.value = match.item.label.toString();
|
|
556
|
-
return this.typeaheadContainer.highlight(match, query);
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
// inserts the element at the index position
|
|
560
|
-
insertAtIndex(i) {
|
|
561
|
-
if (i === 0) {
|
|
562
|
-
this.parentEl.prepend(this.$element);
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
const $elAtIndex = this.parentEl.children().eq(i);
|
|
566
|
-
if ($elAtIndex.length) {
|
|
567
|
-
this.$element.insertBefore(this.parentEl.children().eq(i));
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
this.$element.insertAfter(this.parentEl.children().eq(i - 1));
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
// Check if the widget is of type autocomplete in mobile view/ app
|
|
575
|
-
isMobileAutoComplete() {
|
|
576
|
-
return this.type === 'autocomplete' && i1.isMobile();
|
|
577
|
-
}
|
|
578
|
-
// Check if the query is entered in the input and the view is not mobile
|
|
579
|
-
isQueryEntered() {
|
|
580
|
-
return this.showclear && this.showClosebtn;
|
|
581
|
-
}
|
|
582
|
-
loadMoreData(incrementPage) {
|
|
583
|
-
if (!this.dataProvider || this.dataProvider.isLastPage) {
|
|
584
|
-
return;
|
|
585
|
-
}
|
|
586
|
-
// Increase the page number and trigger force query update
|
|
587
|
-
this.page = incrementPage ? this.page + 1 : this.page;
|
|
588
|
-
this.isScrolled = true;
|
|
589
|
-
this._loadingItems = true;
|
|
590
|
-
// when invoking new set of results, reset the lastQuery.
|
|
591
|
-
if (incrementPage) {
|
|
592
|
-
this._lastQuery = undefined;
|
|
593
|
-
}
|
|
594
|
-
// trigger the typeahead change manually to fetch the next set of results.
|
|
595
|
-
this.typeahead.onInput({
|
|
596
|
-
target: {
|
|
597
|
-
value: lodashEs.trim(this.query) || '0' // dummy data to notify the observables
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
}
|
|
601
|
-
// on focusout, subscribe to the datavalue changes again
|
|
602
|
-
onFocusOut() {
|
|
603
|
-
this._unsubscribeDv = false;
|
|
604
|
-
this._loadingItems = false;
|
|
605
|
-
// reset the page value on focusout.
|
|
606
|
-
this.page = 1;
|
|
607
|
-
// if domUpdated is true then do not hide the dropdown in the fullscreen
|
|
608
|
-
if (!this._domUpdated && this._isOpen) {
|
|
609
|
-
this.listenQuery = false;
|
|
610
|
-
}
|
|
611
|
-
this._isOpen = false;
|
|
612
|
-
// on outside click, typeahead is hidden. To avoid this, when fullscreen is set, overridding isFocused flag on the typeahead container
|
|
613
|
-
if (this._domUpdated && this.typeahead && this.typeahead._container) {
|
|
614
|
-
this.typeahead._container.isFocused = true;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
onInputChange($event) {
|
|
618
|
-
// reset all the previous page details in order to fetch new set of result.
|
|
619
|
-
this.result = [];
|
|
620
|
-
this.page = 1;
|
|
621
|
-
this.listenQuery = this.isUpdateOnKeyPress();
|
|
622
|
-
this._modelByValue = undefined;
|
|
623
|
-
// when input is cleared, reset the datavalue
|
|
624
|
-
if (this.query === '') {
|
|
625
|
-
this.queryModel = '';
|
|
626
|
-
this._modelByValue = '';
|
|
627
|
-
this.updatePrevDatavalue(this._lastQuery);
|
|
628
|
-
this.invokeOnChange(this._modelByValue, {}, true);
|
|
629
|
-
this.invokeEventCallback('clear', { $event });
|
|
630
|
-
// trigger onSubmit only when the search input is cleared off and do not trigger when tab is pressed.
|
|
631
|
-
if ($event && $event.which !== 9) {
|
|
632
|
-
this.invokeEventCallback('submit', { $event });
|
|
633
|
-
}
|
|
634
|
-
}
|
|
635
|
-
else {
|
|
636
|
-
// invoking change event on every input value change.
|
|
637
|
-
this.invokeEventCallback('change', {
|
|
638
|
-
$event: $event,
|
|
639
|
-
newVal: this._modelByValue || this.query,
|
|
640
|
-
oldVal: this.prevDatavalue
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
this.showClosebtn = (this.query !== '');
|
|
644
|
-
}
|
|
645
|
-
// Triggered for enter event
|
|
646
|
-
handleEnterEvent($event) {
|
|
647
|
-
// submit event triggered when there is no search results
|
|
648
|
-
if (!lodashEs.get(this.typeahead, 'matches.length')) {
|
|
649
|
-
this.onSearchSelect($event);
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
// Triggerred when typeahead option is selected.
|
|
653
|
-
onSearchSelect($event) {
|
|
654
|
-
let item;
|
|
655
|
-
// WMS-22533: Before adding active typeahead el, check if the entered query matches with the active el or not
|
|
656
|
-
const isQueryMatch = this.typeaheadContainer?.active?.value === this.query;
|
|
657
|
-
if (this.typeaheadContainer?.active && isQueryMatch) {
|
|
658
|
-
item = this.typeaheadContainer.active.item;
|
|
659
|
-
}
|
|
660
|
-
$event = this.eventData($event, item || {});
|
|
661
|
-
// searchOn is set as onBtnClick, then invoke the search api call manually.
|
|
662
|
-
if (!this.isUpdateOnKeyPress()) {
|
|
663
|
-
this.listenQuery = true;
|
|
664
|
-
// trigger the typeahead change manually to fetch the next set of results.
|
|
665
|
-
this.typeahead.onInput({
|
|
666
|
-
target: {
|
|
667
|
-
value: this.query // dummy data to notify the observables
|
|
668
|
-
}
|
|
669
|
-
});
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
// when matches are available.
|
|
673
|
-
if (this.typeaheadContainer && this.liElements.length && isQueryMatch) {
|
|
674
|
-
this.typeaheadContainer.selectActiveMatch();
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
this.queryModel = this.query;
|
|
678
|
-
this.invokeEventCallback('submit', { $event });
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
invokeOnBeforeServiceCall(inputData) {
|
|
682
|
-
this.invokeEventCallback('beforeservicecall', { inputData });
|
|
683
|
-
}
|
|
684
|
-
onDropdownOpen() {
|
|
685
|
-
if (this.clearData) {
|
|
686
|
-
this.typeahead.hide();
|
|
687
|
-
}
|
|
688
|
-
// setting the ulElements, liElement on typeaheadContainer.
|
|
689
|
-
// as we are using customOption template, liElements are not available on typeaheadContainer so append them explicitly.
|
|
690
|
-
const fn = lodashEs.debounce(() => {
|
|
691
|
-
this._isOpen = true;
|
|
692
|
-
this.typeaheadContainer = this.typeahead._container || this.typeahead._typeahead.instance;
|
|
693
|
-
this.typeaheadContainer.liElements = this.liElements;
|
|
694
|
-
this.typeaheadContainer.ulElement = this.ulElement;
|
|
695
|
-
i1.adjustContainerPosition($('typeahead-container'), this.nativeElement, this.typeahead._typeahead, $('typeahead-container .dropdown-menu'));
|
|
696
|
-
});
|
|
697
|
-
fn();
|
|
698
|
-
// open full-screen search view
|
|
699
|
-
if (this.isMobileAutoComplete()) {
|
|
700
|
-
if (!this.$element.hasClass('full-screen')) {
|
|
701
|
-
this.renderMobileAutoComplete();
|
|
702
|
-
}
|
|
703
|
-
const dropdownEl = this.dropdownEl.closest('typeahead-container');
|
|
704
|
-
dropdownEl.insertAfter(this.$element.find('input').first());
|
|
705
|
-
const screenHeight = this.$element.closest('.app-content').height();
|
|
706
|
-
dropdownEl.css({ position: 'relative', top: 0, height: screenHeight + 'px' });
|
|
707
|
-
this.showClosebtn = this.query && this.query !== '';
|
|
708
|
-
if (this.dataProvider && !lodashEs.isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) {
|
|
709
|
-
this.triggerSearch();
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
selectNext() {
|
|
714
|
-
const matches = this.typeaheadContainer.matches;
|
|
715
|
-
if (!matches) {
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
const index = matches.indexOf(this.typeaheadContainer.active);
|
|
719
|
-
// on keydown, if scroll is at the bottom and next page records are available, fetch next page items.
|
|
720
|
-
if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && index + 1 > matches.length - 1) {
|
|
721
|
-
// index is saved in order to select the lastSelected item in the dropdown after fetching next page items.
|
|
722
|
-
this.lastSelectedIndex = index;
|
|
723
|
-
this.loadMoreData(true);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
setLastActiveMatchAsSelected() {
|
|
727
|
-
if (this.lastSelectedIndex) {
|
|
728
|
-
this.typeaheadContainer._active = this.typeaheadContainer.matches[this.lastSelectedIndex];
|
|
729
|
-
this.typeaheadContainer.nextActiveMatch();
|
|
730
|
-
this.lastSelectedIndex = undefined;
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
triggerSearch() {
|
|
734
|
-
if (!this.dataProvider || this.dataProvider.isLastPage || !this.$element.hasClass('full-screen')) {
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
const typeAheadDropDown = this.dropdownEl;
|
|
738
|
-
const $lastItem = typeAheadDropDown.find('li').last();
|
|
739
|
-
// Check if last item is not below the full screen
|
|
740
|
-
if ($lastItem.length && typeAheadDropDown.length && (typeAheadDropDown.height() + typeAheadDropDown.position().top > $lastItem.height() + $lastItem.position().top)) {
|
|
741
|
-
this.loadMoreData(true);
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
isUpdateOnKeyPress() {
|
|
745
|
-
return this.searchon === 'typing';
|
|
746
|
-
}
|
|
747
|
-
debounceDefaultQuery(data) {
|
|
748
|
-
this._defaultQueryInvoked = true;
|
|
749
|
-
this.getDataSource(data, true).then((response) => {
|
|
750
|
-
if (response.length) {
|
|
751
|
-
this.queryModel = response;
|
|
752
|
-
this._lastQuery = this.query = this.queryModel[0].label || '';
|
|
753
|
-
this._modelByValue = this.queryModel[0].value;
|
|
754
|
-
this._modelByKey = this.queryModel[0].key;
|
|
755
|
-
this.showClosebtn = (this.query !== '');
|
|
756
|
-
}
|
|
757
|
-
else {
|
|
758
|
-
this._modelByValue = undefined;
|
|
759
|
-
this.queryModel = undefined;
|
|
760
|
-
this.query = '';
|
|
761
|
-
}
|
|
762
|
-
if (this.clearData) {
|
|
763
|
-
if (lodashEs.get(this.typeahead, '_typeahead.isShown')) {
|
|
764
|
-
this.typeahead.hide();
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
updateByDatavalue(data) {
|
|
770
|
-
this.updateByDataset(data);
|
|
771
|
-
this.updateByDataSource(data);
|
|
772
|
-
}
|
|
773
|
-
updateByDataSource(data) {
|
|
774
|
-
// value is present but the corresponding key is not found then fetch next set
|
|
775
|
-
// modelByKey will be set only when datavalue is available inside the localData otherwise make a N/w call.
|
|
776
|
-
if (i1.isDefined(data) && !lodashEs.isObject(data) && this.datasource && !i1.isDefined(this._modelByKey) && this.datafield !== base.ALLFIELDS) {
|
|
777
|
-
// Avoid making default query if queryModel already exists.
|
|
778
|
-
if (i1.isDefined(this.queryModel) && !lodashEs.isEmpty(this.queryModel)) {
|
|
779
|
-
this.updateDatavalueFromQueryModel();
|
|
780
|
-
return;
|
|
781
|
-
}
|
|
782
|
-
// Make default query call only when datasource supports CRUD (live variable).
|
|
783
|
-
if (!this._defaultQueryInvoked && this.datasource.execute(i1.DataSource.Operation.SUPPORTS_CRUD)) {
|
|
784
|
-
this.debounceDefaultQuery(data);
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
// updates the model value using queryModel
|
|
789
|
-
updateDatavalueFromQueryModel() {
|
|
790
|
-
if (i1.isDefined(this.queryModel)) {
|
|
791
|
-
this._modelByValue = lodashEs.isArray(this.queryModel) ? this.queryModel[0].value : this.queryModel;
|
|
792
|
-
this._modelByKey = lodashEs.isArray(this.queryModel) ? this.queryModel[0].key : this.queryModel;
|
|
793
|
-
this.toBeProcessedDatavalue = undefined;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
updateByDataset(data) {
|
|
797
|
-
// default query is already invoked then do not make other default query call.
|
|
798
|
-
// For local search i.e. searchkey is undefined, do not return, verify the datavalue against the datasetItems .
|
|
799
|
-
if (this._defaultQueryInvoked && this.searchkey) {
|
|
800
|
-
return;
|
|
801
|
-
}
|
|
802
|
-
const selectedItem = lodashEs.find(this.datasetItems, (item) => {
|
|
803
|
-
return (lodashEs.isObject(item.value) ? lodashEs.isEqual(item.value, data) : (lodashEs.toString(item.value)).toLowerCase() === (lodashEs.toString(data)).toLowerCase());
|
|
804
|
-
});
|
|
805
|
-
// set the default only when it is available in dataset.
|
|
806
|
-
if (selectedItem) {
|
|
807
|
-
this.queryModel = [selectedItem];
|
|
808
|
-
}
|
|
809
|
-
else if (this.datafield === base.ALLFIELDS && lodashEs.isObject(data)) {
|
|
810
|
-
this.queryModel = this.getTransformedData(base.extractDataAsArray(data));
|
|
811
|
-
}
|
|
812
|
-
else
|
|
813
|
-
// resetting the queryModel only when prevDatavalue is equal to data
|
|
814
|
-
if (this.prevDatavalue !== data) {
|
|
815
|
-
this.queryModel = undefined;
|
|
816
|
-
this.query = '';
|
|
817
|
-
return;
|
|
818
|
-
}
|
|
819
|
-
this.updateDatavalueFromQueryModel();
|
|
820
|
-
// Show the label value on input.
|
|
821
|
-
this._lastQuery = this.query = i1.isDefined(this.queryModel) && this.queryModel.length ? lodashEs.get(this.queryModel[0], 'label') : '';
|
|
822
|
-
this.showClosebtn = (this.query !== '');
|
|
823
|
-
}
|
|
824
|
-
// If we have last search results then open dropdown on focus
|
|
825
|
-
handleFocus($event) {
|
|
826
|
-
if (this.type === 'search' && this.query === this._lastQuery && this._lastResult) {
|
|
827
|
-
this.typeahead.keyUpEventEmitter.emit(this.query);
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
notifySubscriber() {
|
|
831
|
-
const parentEl = $(this.nativeElement).closest('.app-composite-widget.caption-floating');
|
|
832
|
-
if (parentEl.length > 0) {
|
|
833
|
-
this.app.notify('captionPositionAnimate', { displayVal: true, nativeEl: parentEl });
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
// This method returns a promise that provides the filtered data from the datasource.
|
|
837
|
-
getDataSource(query, searchOnDataField, nextItemIndex) {
|
|
838
|
-
// For default query, searchOnDataField is set to true, then do not make a n/w call when datafield is ALLFIELDS
|
|
839
|
-
if (searchOnDataField && this.datafield === base.ALLFIELDS) {
|
|
840
|
-
this._loadingItems = false;
|
|
841
|
-
return Promise.resolve([]);
|
|
842
|
-
}
|
|
843
|
-
// For default datavalue, search key as to be on datafield to get the default data from the filter call.
|
|
844
|
-
const dataConfig = {
|
|
845
|
-
dataset: this.dataset ? base.convertDataToObject(this.dataset) : undefined,
|
|
846
|
-
binddataset: this.binddataset,
|
|
847
|
-
datasource: this.datasource,
|
|
848
|
-
datafield: this.datafield,
|
|
849
|
-
hasData: this.dataset?.length,
|
|
850
|
-
query: query,
|
|
851
|
-
isLocalFilter: !this.searchkey,
|
|
852
|
-
searchKey: searchOnDataField ? this.datafield : this.searchkey,
|
|
853
|
-
// default search call match mode should be startignorecase
|
|
854
|
-
matchMode: searchOnDataField ? 'startignorecase' : this.matchmode,
|
|
855
|
-
casesensitive: this.casesensitive,
|
|
856
|
-
isformfield: this.isformfield,
|
|
857
|
-
orderby: this.orderby,
|
|
858
|
-
limit: this.limit,
|
|
859
|
-
pagesize: this.pagesize,
|
|
860
|
-
page: this.page,
|
|
861
|
-
onBeforeservicecall: this.invokeOnBeforeServiceCall.bind(this)
|
|
862
|
-
};
|
|
863
|
-
if (this.dataoptions) {
|
|
864
|
-
dataConfig.dataoptions = this.dataoptions;
|
|
865
|
-
dataConfig.viewParent = this.viewParent;
|
|
866
|
-
}
|
|
867
|
-
this._loadingItems = true;
|
|
868
|
-
return this.dataProvider.filter(dataConfig)
|
|
869
|
-
.then((response) => {
|
|
870
|
-
// response from dataProvider returns always data object.
|
|
871
|
-
response = response.data || response;
|
|
872
|
-
// for service variable, updating the dataset only if it is not defined or empty
|
|
873
|
-
if (this.dataProvider && (!i1.isDefined(this.dataset) || !this.dataset.length) && this.dataProvider.updateDataset) {
|
|
874
|
-
this.dataset = response;
|
|
875
|
-
}
|
|
876
|
-
if (this.dataProvider?.hasMoreData) {
|
|
877
|
-
this.formattedDataset = this.formattedDataset.concat(response);
|
|
878
|
-
}
|
|
879
|
-
else {
|
|
880
|
-
this.formattedDataset = response;
|
|
881
|
-
}
|
|
882
|
-
// ngx-bootstrap 21: typeaheadOptionsLimit is an InputSignal — update bound value instead of assigning on directive.
|
|
883
|
-
if (this.formattedDataset.length > 20 && !i1.isDefined(this.limit)) {
|
|
884
|
-
this._dynamicTypeaheadOptionsLimit = this.formattedDataset.length;
|
|
885
|
-
}
|
|
886
|
-
else {
|
|
887
|
-
this._dynamicTypeaheadOptionsLimit = undefined;
|
|
888
|
-
}
|
|
889
|
-
// In mobile, trigger the search by default until the results have height upto page height. Other results can be fetched by scrolling
|
|
890
|
-
if (this.dataProvider && this._isOpen && this.isMobileAutoComplete() && !lodashEs.isUndefined(this.dataProvider.isLastPage) && !this.dataProvider.isLastPage) {
|
|
891
|
-
this.triggerSearch();
|
|
892
|
-
}
|
|
893
|
-
const transformedData = this.getTransformedData(this.formattedDataset, nextItemIndex);
|
|
894
|
-
// result contains the datafield values.
|
|
895
|
-
this.result = lodashEs.map(transformedData, 'value');
|
|
896
|
-
return transformedData;
|
|
897
|
-
}, (error) => {
|
|
898
|
-
this._loadingItems = false;
|
|
899
|
-
return [];
|
|
900
|
-
}).then(result => {
|
|
901
|
-
if (this.isScrolled) {
|
|
902
|
-
(lodashEs.debounce(() => {
|
|
903
|
-
this.setLastActiveMatchAsSelected();
|
|
904
|
-
}, 30))();
|
|
905
|
-
this.isScrolled = false;
|
|
906
|
-
}
|
|
907
|
-
// When no result is found, set the datavalue to undefined.
|
|
908
|
-
if (!result.length) {
|
|
909
|
-
this._modelByValue = undefined;
|
|
910
|
-
this.queryModel = query;
|
|
911
|
-
}
|
|
912
|
-
// on focusout i.e. on other widget focus, if n/w is pending loading icon is shown, when data is available then dropdown is shown again.
|
|
913
|
-
// on unsubscribing do not show the results.
|
|
914
|
-
if (this._unsubscribeDv) {
|
|
915
|
-
result = [];
|
|
916
|
-
}
|
|
917
|
-
this._loadingItems = false;
|
|
918
|
-
this._lastResult = result;
|
|
919
|
-
return result;
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
// this method returns the parent context i.e. Page context and not parent component's context.
|
|
923
|
-
getContext(context) {
|
|
924
|
-
if (context && lodashEs.get(context, 'widget')) {
|
|
925
|
-
return this.getContext(context.viewParent);
|
|
926
|
-
}
|
|
927
|
-
return context;
|
|
928
|
-
}
|
|
929
|
-
getTransformedData(data, itemIndex, iscustom) {
|
|
930
|
-
if (i1.isDefined(itemIndex)) {
|
|
931
|
-
itemIndex++;
|
|
932
|
-
}
|
|
933
|
-
const transformedData = base.transformFormData(this.getContext(this.viewParent), data, this.datafield, {
|
|
934
|
-
displayField: this.displaylabel || this.displayfield,
|
|
935
|
-
displayExpr: iscustom ? '' : this.displayexpression,
|
|
936
|
-
bindDisplayExpr: iscustom ? '' : this.binddisplaylabel,
|
|
937
|
-
bindDisplayImgSrc: this.binddisplayimagesrc,
|
|
938
|
-
displayImgSrc: this.displayimagesrc
|
|
939
|
-
}, itemIndex, this);
|
|
940
|
-
return base.getUniqObjsByDataField(transformedData, this.datafield, this.displayfield || this.displaylabel, i1.toBoolean(this.allowempty));
|
|
941
|
-
}
|
|
942
|
-
// OptionsListTemplate listens to the scroll event and triggers this function.
|
|
943
|
-
onScroll($scrollEl, evt) {
|
|
944
|
-
const totalHeight = $scrollEl.scrollHeight, clientHeight = $scrollEl.clientHeight;
|
|
945
|
-
// If scroll is at the bottom and no request is in progress and next page records are available, fetch next page items.
|
|
946
|
-
if (!this._loadingItems && this.dataProvider && !this.dataProvider.isLastPage && ($scrollEl.scrollTop + clientHeight >= totalHeight)) {
|
|
947
|
-
this.loadMoreData(true);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
ngOnInit() {
|
|
951
|
-
super.ngOnInit();
|
|
952
|
-
if (!i1.isDefined(this.minchars)) {
|
|
953
|
-
// for autocomplete set the minchars to 0
|
|
954
|
-
if (this.type === 'autocomplete') {
|
|
955
|
-
this.minchars = 0;
|
|
956
|
-
}
|
|
957
|
-
else {
|
|
958
|
-
this.minchars = 1;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
this.listenQuery = this.isUpdateOnKeyPress();
|
|
962
|
-
// by default for autocomplete do not show the search icon
|
|
963
|
-
// by default show the searchicon for type = search
|
|
964
|
-
this.showsearchicon = i1.isDefined(this.showsearchicon) ? this.showsearchicon : (this.type === 'search');
|
|
965
|
-
}
|
|
966
|
-
ngAfterViewInit() {
|
|
967
|
-
super.ngAfterViewInit();
|
|
968
|
-
base.styler(this.nativeElement, this);
|
|
969
|
-
this.containerTarget = base.getContainerTargetClass(this.nativeElement);
|
|
970
|
-
}
|
|
971
|
-
ngAfterViewChecked() {
|
|
972
|
-
const searchInputEl = $('.app-search-input');
|
|
973
|
-
if (searchInputEl) {
|
|
974
|
-
searchInputEl.removeAttr('aria-expanded');
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
eventData($event, item) {
|
|
978
|
-
if ($event) {
|
|
979
|
-
$event['data'] = {
|
|
980
|
-
item: item.dataObject,
|
|
981
|
-
model: item.value,
|
|
982
|
-
label: item.label,
|
|
983
|
-
query: this.query
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
return $event;
|
|
987
|
-
}
|
|
988
|
-
// triggered on select on option from the list. Set the queryModel, query and modelByKey from the matched item.
|
|
989
|
-
typeaheadOnSelect(match, $event) {
|
|
990
|
-
const item = match.item;
|
|
991
|
-
this.queryModel = item;
|
|
992
|
-
item.selected = true;
|
|
993
|
-
this.query = item.label;
|
|
994
|
-
this.showClosebtn = (this.query !== '');
|
|
995
|
-
$event = $event || this.$typeaheadEvent;
|
|
996
|
-
// As item.key can vary from key in the datasetItems
|
|
997
|
-
this._modelByKey = item.key;
|
|
998
|
-
this._modelByValue = item.value;
|
|
999
|
-
$event = this.eventData($event, item);
|
|
1000
|
-
this.invokeOnTouched();
|
|
1001
|
-
this.invokeOnChange(this.datavalue, $event || {});
|
|
1002
|
-
// updating the variable bound to default value as invokeOnChange is not updating the variable.
|
|
1003
|
-
if (this.datavalue !== this.prevDatavalue) {
|
|
1004
|
-
this.updateBoundVariable(this.datavalue);
|
|
1005
|
-
}
|
|
1006
|
-
if (this.$element.hasClass('full-screen')) {
|
|
1007
|
-
this.closeSearch();
|
|
1008
|
-
}
|
|
1009
|
-
this.invokeEventCallback('select', { $event, selectedValue: this.datavalue });
|
|
1010
|
-
this.invokeEventCallback('submit', { $event });
|
|
1011
|
-
this.updatePrevDatavalue(this.datavalue);
|
|
1012
|
-
}
|
|
1013
|
-
onPropertyChange(key, nv, ov) {
|
|
1014
|
-
if (key === 'tabindex') {
|
|
1015
|
-
return;
|
|
1016
|
-
}
|
|
1017
|
-
// Backward compatability from 10.3.1 to 10.3.2
|
|
1018
|
-
// 10.3.1 we had displaylabel as modal value
|
|
1019
|
-
// From 10.3.2 onwords we will be having displayexpresion as modal value
|
|
1020
|
-
if (this.type === 'autocomplete' && key === 'displaylabel' && this.displaylabel && (!this.displayexpression || (this.displayexpression && !this.datasource))) {
|
|
1021
|
-
this.displayexpression = this.displaylabel;
|
|
1022
|
-
this.displaylabel = undefined;
|
|
1023
|
-
}
|
|
1024
|
-
// when dataoptions are provided and there is no displaylabel given then displaylabel is set as the relatedfield
|
|
1025
|
-
if (key === 'displaylabel' && this.dataoptions && this.binddisplaylabel === null) {
|
|
1026
|
-
this.query = lodashEs.get(this._modelByValue, nv) || this._modelByValue;
|
|
1027
|
-
}
|
|
1028
|
-
// when search is disabled, do not load any more data or just clear the data that is already in process or loaded.
|
|
1029
|
-
if (key === 'disabled') {
|
|
1030
|
-
if (nv === false) {
|
|
1031
|
-
this.clearData = false;
|
|
1032
|
-
}
|
|
1033
|
-
else {
|
|
1034
|
-
this.clearData = true;
|
|
1035
|
-
if (lodashEs.get(this.typeahead, '_typeahead.isShown')) {
|
|
1036
|
-
this.typeahead.hide();
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
super.onPropertyChange(key, nv, ov);
|
|
1041
|
-
}
|
|
1042
|
-
ngOnDestroy() {
|
|
1043
|
-
// MEMORY LEAK FIX: Clear QueryList reference
|
|
1044
|
-
this.liElements = null;
|
|
1045
|
-
// MEMORY LEAK FIX: Clear data provider
|
|
1046
|
-
if (this.dataProvider) {
|
|
1047
|
-
this.dataProvider = null;
|
|
1048
|
-
}
|
|
1049
|
-
// MEMORY LEAK FIX: Clear typeahead reference
|
|
1050
|
-
if (this.typeahead) {
|
|
1051
|
-
this.typeahead = null;
|
|
1052
|
-
}
|
|
1053
|
-
// MEMORY LEAK FIX: Clear query model
|
|
1054
|
-
this.queryModel = null;
|
|
1055
|
-
this.query = '';
|
|
1056
|
-
// Call parent ngOnDestroy (DatasetAwareFormComponent has cleanup)
|
|
1057
|
-
super.ngOnDestroy();
|
|
1058
|
-
}
|
|
1059
|
-
static { this.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: SearchComponent, deps: [{ token: i0__namespace.Injector }, { token: i1__namespace.App }, { token: 'datavalue.bind', attribute: true }, { token: 'dataset.bind', attribute: true }, { token: 'EXPLICIT_CONTEXT', optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component }); }
|
|
1060
|
-
static { this.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.21", type: SearchComponent, isStandalone: true, selector: "[wmSearch]", providers: [
|
|
1061
|
-
base.provideAs(SearchComponent, i3.NG_VALUE_ACCESSOR, true),
|
|
1062
|
-
base.provideAs(SearchComponent, i3.NG_VALIDATORS, true),
|
|
1063
|
-
base.provideAsWidgetRef(SearchComponent)
|
|
1064
|
-
], viewQueries: [{ propertyName: "typeahead", first: true, predicate: i4.TypeaheadDirective, descendants: true }, { propertyName: "ulElement", first: true, predicate: ["ulElement"], descendants: true }, { propertyName: "liElements", predicate: ["liElements"], descendants: true }], usesInheritance: true, ngImport: i0__namespace, template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n", dependencies: [{ kind: "ngmodule", type: i2.CommonModule }, { kind: "directive", type: i2__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: i3.FormsModule }, { kind: "directive", type: i3__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3__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: i3__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3__namespace.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: ScrollableDirective, selector: "[scrollableHandler]" }, { kind: "ngmodule", type: i4.TypeaheadModule }, { kind: "directive", type: i4__namespace.TypeaheadDirective, selector: "[typeahead]", inputs: ["typeahead", "typeaheadMinLength", "adaptivePosition", "isAnimated", "typeaheadWaitMs", "typeaheadOptionsLimit", "typeaheadOptionField", "typeaheadGroupField", "typeaheadOrderBy", "typeaheadAsync", "typeaheadLatinize", "typeaheadSingleWords", "typeaheadWordDelimiters", "typeaheadMultipleSearch", "typeaheadMultipleSearchDelimiters", "typeaheadPhraseDelimiters", "typeaheadItemTemplate", "optionsListTemplate", "typeaheadScrollable", "typeaheadOptionsInScrollableView", "typeaheadHideResultsOnBlur", "typeaheadSelectFirstItem", "typeaheadIsFirstItemActive", "container", "dropup"], outputs: ["typeaheadLoading", "typeaheadNoResults", "typeaheadOnSelect", "typeaheadOnPreview", "typeaheadOnBlur"], exportAs: ["bs-typeahead"] }, { kind: "directive", type: base.TextContentDirective, selector: "[textContent]", inputs: ["textContent"] }, { kind: "directive", type: base.ItemTemplateDirective, selector: "[wmItemTemplate]", inputs: ["userComponentParams", "wmItemTemplate"], exportAs: ["itemTemplateRef"] }, { kind: "directive", type: base.PartialParamHandlerDirective, selector: "[partialContainer]" }, { kind: "directive", type: base.PartialContainerDirective, selector: "[partialContainer]" }, { kind: "component", type: base.WmAppIconComponent, selector: "wm-app-icon", inputs: ["icon", "iconclass", "iconurl", "defaultIconClass", "defaultClasses", "iconStyle", "alt"] }] }); }
|
|
1065
|
-
}
|
|
1066
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.21", ngImport: i0__namespace, type: SearchComponent, decorators: [{
|
|
1067
|
-
type: i0.Component,
|
|
1068
|
-
args: [{ standalone: true, imports: [i2.CommonModule, i3.FormsModule, ScrollableDirective, i4.TypeaheadModule, base.TextContentDirective, base.ItemTemplateDirective, base.PartialParamHandlerDirective, base.PartialContainerDirective, base.WmAppIconComponent], selector: '[wmSearch]', providers: [
|
|
1069
|
-
base.provideAs(SearchComponent, i3.NG_VALUE_ACCESSOR, true),
|
|
1070
|
-
base.provideAs(SearchComponent, i3.NG_VALIDATORS, true),
|
|
1071
|
-
base.provideAsWidgetRef(SearchComponent)
|
|
1072
|
-
], template: "<ng-template #customItemTemplate let-model=\"item\" let-index=\"index\" let-query=\"query\" let-match=\"match\">\n <!-- Default item template -->\n @if (!content) {\n <a>\n @if (model.imgSrc) {\n <img [src]=\"model.imgSrc\" alt=\"Search\" [style.width]=\"imagewidth\">\n }\n <span [title]=\"model.label\" [innerHtml]=\"highlight(match, query) || model.label\"></span>\n </a>\n }\n <!-- Custom partial template -->\n @if (content) {\n <a [ngClass]=\"{customTemplate: content}\" partialContainer [wmItemTemplate]=\"content\" [userComponentParams]=\"match.item\">\n <div partial-container-target></div>\n </a>\n }\n</ng-template>\n\n<ng-template #customListTemplate let-matches=\"matches\" let-itemTemplate=\"itemTemplate\" let-query=\"query\">\n <ul #ulElement class=\"app-search dropdown-menu\" scrollableHandler>\n @for (match of matches; track match; let i = $index) {\n <li #liElements [ngClass]=\"{active: typeaheadContainer && typeaheadContainer.isActive(match), 'list-group-header': match && match.isHeader()}\"\n (mouseenter)=\"typeaheadContainer.selectActive(match);\"\n (click)=\"match && !match.isHeader() && typeaheadContainer.selectMatch(match, $event); $typeaheadEvent = $event; notifySubscriber();\">\n <!-- itemTemplate comes from the <input> -->\n @if (match.isHeader()) {\n <h4 class=\"group-title\">{{match.value}}</h4>\n }\n @if (!match.isHeader()) {\n <ng-container [ngTemplateOutlet]=\"itemTemplate\"\n [ngTemplateOutletContext]=\"{item: match.item, index: i, match: match, query: query}\">\n </ng-container>\n }\n </li>\n }\n <div class=\"status\" [hidden]=\"_loadingItems || !(datacompletemsg && dataProvider?.isLastPage)\">\n <span [textContent]=\"datacompletemsg\"></span>\n </div>\n <div class=\"status\" [hidden]=\"!_loadingItems\">\n <i class=\"fa fa-circle-o-notch fa-spin\"></i>\n <span [textContent]=\"loadingdatamsg\"></span>\n </div>\n </ul>\n</ng-template>\n\n<!--This template is for search inside mobile navbar.-->\n@if (navsearchbar) {\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n container=\"body\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event)\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event);\"\n (focusout)=\"onFocusOut()\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [dropup]=\"dropup\"\n [tabindex]=\"tabindex\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\"/>\n <i class=\"btn-close wi wi-cancel\" [hidden]=\"!showClosebtn\" (click)=\"clearSearch($event);\"></i>\n} @else {\n <button type=\"button\" class=\"btn btn-icon form-control-feedback back-btn\" aria-hidden=\"true\" (click)=\"closeSearch()\">\n <wm-app-icon [iconclass]=\"backsearchiconclass\" [iconurl]=\"backsearchiconurl\" alt=\"Back\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Back button</span>\n <input [title]=\"query || ''\" type=\"text\" class=\"app-textbox form-control list-of-objs app-search-input\" [placeholder]=\"placeholder || ''\"\n focus-target\n [container]=\"containerTarget || '.wm-app'\"\n [disabled]=\"disabled\"\n [attr.accesskey]=\"shortcutkey\"\n autocomplete=\"off\"\n [(ngModel)]=\"query\"\n [ngModelOptions]=\"{standalone: true}\"\n [readonly]=\"readonly\"\n [typeahead]=\"typeaheadDataSource\"\n [typeaheadWaitMs]=\"debouncetime\"\n [typeaheadItemTemplate]=\"customItemTemplate\"\n [optionsListTemplate]=\"customListTemplate\"\n (input)=\"onInputChange($event)\"\n (keydown)=\"listenQuery = true\"\n (keydown.enter)=\"$typeaheadEvent = $event;handleEnterEvent($event)\"\n (keydown.arrowdown)=\"selectNext($event)\"\n (blur)=\"invokeOnTouched($event); onFocusOut()\"\n (click)=\"handleFocus($event);\"\n (focus)=\"_unsubscribeDv = false; listenQuery = true; handleFocus($event); invokeOnFocus($event)\"\n [typeaheadMinLength]=\"minchars\"\n [typeaheadOptionsLimit]=\"typeaheadOptionsLimit\"\n (typeaheadLoading)=\"_loadingItems\"\n (typeaheadOnSelect)=\"typeaheadOnSelect($event)\"\n typeaheadOptionField=\"label\"\n [typeaheadGroupField]=\"groupby ? 'groupby' : null\"\n [typeaheadAsync]=\"true\"\n [typeaheadScrollable]=\"true\"\n [adaptivePosition]=\"true\"\n [typeaheadOptionsInScrollableView]=\"optionslimitinscrollableview\"\n [tabindex]=\"tabindex\"\n [dropup]=\"dropup\"\n [attr.name]=\"name\"\n [attr.aria-label]=\"arialabel || 'Search field'\">\n <input class=\"model-holder\" ng-model=\"proxyModel\" ng-required=\"required\" tabindex=\"-1\" aria-hidden=\"true\">\n @if (_loadingItems) {\n <span aria-hidden=\"true\" class=\"fa fa-circle-o-notch fa-spin form-control-feedback\"></span>\n }\n <button type=\"button\" class=\"btn btn-icon form-control-feedback clear-btn\" [ngClass]=\"{'show-btn': isQueryEntered()}\" (click)=\"clearSearch($event, true)\">\n <wm-app-icon [iconclass]=\"clearsearchiconclass\" [iconurl]=\"clearsearchiconurl\" alt=\"Clear\"></wm-app-icon>\n </button>\n <span class=\"sr-only\">Clear button</span>\n @if (showsearchicon) {\n <span [ngClass]=\"{'disabled': disabled}\" class=\"input-group-addon\">\n <form>\n <button title=\"Search\" [disabled]=\"disabled\" class=\"app-search-button btn btn-icon\" type=\"submit\"\n (click)=\"onSearchSelect($event)\">\n <wm-app-icon [iconclass]=\"searchiconclass\" [iconurl]=\"searchiconurl\" alt=\"Search\"></wm-app-icon>\n </button>\n </form>\n </span>\n }\n }\n <!--This template is for both web and fullscreen mode in mobile.-->\n" }]
|
|
1073
|
-
}], ctorParameters: () => [{ type: i0__namespace.Injector }, { type: i1__namespace.App }, { type: undefined, decorators: [{
|
|
1074
|
-
type: i0.Attribute,
|
|
1075
|
-
args: ['datavalue.bind']
|
|
1076
|
-
}] }, { type: undefined, decorators: [{
|
|
1077
|
-
type: i0.Attribute,
|
|
1078
|
-
args: ['dataset.bind']
|
|
1079
|
-
}] }, { type: undefined, decorators: [{
|
|
1080
|
-
type: i0.Inject,
|
|
1081
|
-
args: ['EXPLICIT_CONTEXT']
|
|
1082
|
-
}, {
|
|
1083
|
-
type: i0.Optional
|
|
1084
|
-
}] }], propDecorators: { typeahead: [{
|
|
1085
|
-
type: i0.ViewChild,
|
|
1086
|
-
args: [i4.TypeaheadDirective]
|
|
1087
|
-
}], ulElement: [{
|
|
1088
|
-
type: i0.ViewChild,
|
|
1089
|
-
args: ['ulElement']
|
|
1090
|
-
}], liElements: [{
|
|
1091
|
-
type: i0.ViewChildren,
|
|
1092
|
-
args: ['liElements']
|
|
1093
|
-
}] } });
|
|
1094
|
-
|
|
1095
|
-
exports.ScrollableDirective = ScrollableDirective;
|
|
1096
|
-
exports.SearchComponent = SearchComponent;
|
|
1134
|
+
exports.ScrollableDirective = ScrollableDirective;
|
|
1135
|
+
exports.SearchComponent = SearchComponent;
|
|
1097
1136
|
|
|
1098
1137
|
}));
|