@masterteam/components 0.0.265 → 0.0.267
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/common.css +2 -309
- package/fesm2022/masterteam-components-avatar-text.mjs +46 -0
- package/fesm2022/masterteam-components-avatar-text.mjs.map +1 -0
- package/fesm2022/masterteam-components-avatar.mjs +50 -0
- package/fesm2022/masterteam-components-avatar.mjs.map +1 -0
- package/fesm2022/masterteam-components-breadcrumb.mjs +27 -0
- package/fesm2022/masterteam-components-breadcrumb.mjs.map +1 -0
- package/fesm2022/masterteam-components-business-fields.mjs +1907 -0
- package/fesm2022/masterteam-components-business-fields.mjs.map +1 -0
- package/fesm2022/masterteam-components-button-group.mjs +20 -0
- package/fesm2022/masterteam-components-button-group.mjs.map +1 -0
- package/fesm2022/masterteam-components-button.mjs +82 -0
- package/fesm2022/masterteam-components-button.mjs.map +1 -0
- package/fesm2022/masterteam-components-card.mjs +28 -0
- package/fesm2022/masterteam-components-card.mjs.map +1 -0
- package/fesm2022/masterteam-components-checkbox-field.mjs +92 -0
- package/fesm2022/masterteam-components-checkbox-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-chip.mjs +39 -0
- package/fesm2022/masterteam-components-chip.mjs.map +1 -0
- package/fesm2022/masterteam-components-client-page-menu.mjs +153 -0
- package/fesm2022/masterteam-components-client-page-menu.mjs.map +1 -0
- package/fesm2022/masterteam-components-client-page.mjs +413 -0
- package/fesm2022/masterteam-components-client-page.mjs.map +1 -0
- package/fesm2022/masterteam-components-color-picker-field.mjs +106 -0
- package/fesm2022/masterteam-components-color-picker-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-confirmation.mjs +98 -0
- package/fesm2022/masterteam-components-confirmation.mjs.map +1 -0
- package/fesm2022/masterteam-components-date-field.mjs +158 -0
- package/fesm2022/masterteam-components-date-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-dialog.mjs +33 -0
- package/fesm2022/masterteam-components-dialog.mjs.map +1 -0
- package/fesm2022/masterteam-components-drawer.mjs +268 -0
- package/fesm2022/masterteam-components-drawer.mjs.map +1 -0
- package/fesm2022/masterteam-components-dynamic-drawer.mjs +608 -0
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +1 -0
- package/fesm2022/masterteam-components-editor-field.mjs +103 -0
- package/fesm2022/masterteam-components-editor-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-empty-state.mjs +53 -0
- package/fesm2022/masterteam-components-empty-state.mjs.map +1 -0
- package/fesm2022/masterteam-components-entities.mjs +2242 -0
- package/fesm2022/masterteam-components-entities.mjs.map +1 -0
- package/fesm2022/masterteam-components-field-validation.mjs +237 -0
- package/fesm2022/masterteam-components-field-validation.mjs.map +1 -0
- package/fesm2022/masterteam-components-formula.mjs +3848 -0
- package/fesm2022/masterteam-components-formula.mjs.map +1 -0
- package/fesm2022/masterteam-components-icon-field.mjs +158 -0
- package/fesm2022/masterteam-components-icon-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-list.mjs +31 -0
- package/fesm2022/masterteam-components-list.mjs.map +1 -0
- package/fesm2022/masterteam-components-location-field.mjs +607 -0
- package/fesm2022/masterteam-components-location-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-menu.mjs +135 -0
- package/fesm2022/masterteam-components-menu.mjs.map +1 -0
- package/fesm2022/masterteam-components-modal.mjs +108 -0
- package/fesm2022/masterteam-components-modal.mjs.map +1 -0
- package/fesm2022/masterteam-components-module-summary-card.mjs +34 -0
- package/fesm2022/masterteam-components-module-summary-card.mjs.map +1 -0
- package/fesm2022/masterteam-components-multi-select-field.mjs +321 -0
- package/fesm2022/masterteam-components-multi-select-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-number-field.mjs +102 -0
- package/fesm2022/masterteam-components-number-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-page-header.mjs +42 -0
- package/fesm2022/masterteam-components-page-header.mjs.map +1 -0
- package/fesm2022/masterteam-components-page.mjs +35 -0
- package/fesm2022/masterteam-components-page.mjs.map +1 -0
- package/fesm2022/masterteam-components-paginator.mjs +43 -0
- package/fesm2022/masterteam-components-paginator.mjs.map +1 -0
- package/fesm2022/masterteam-components-pick-list-field.mjs +210 -0
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-progress.mjs +63 -0
- package/fesm2022/masterteam-components-progress.mjs.map +1 -0
- package/fesm2022/masterteam-components-property-filter-builder.mjs +386 -0
- package/fesm2022/masterteam-components-property-filter-builder.mjs.map +1 -0
- package/fesm2022/masterteam-components-radio-button-field.mjs +85 -0
- package/fesm2022/masterteam-components-radio-button-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-radio-cards-field.mjs +131 -0
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-radio-cards.mjs +74 -0
- package/fesm2022/masterteam-components-radio-cards.mjs.map +1 -0
- package/fesm2022/masterteam-components-runtime-action.mjs +406 -0
- package/fesm2022/masterteam-components-runtime-action.mjs.map +1 -0
- package/fesm2022/masterteam-components-select-field.mjs +415 -0
- package/fesm2022/masterteam-components-select-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-sidebar.mjs +155 -0
- package/fesm2022/masterteam-components-sidebar.mjs.map +1 -0
- package/fesm2022/masterteam-components-slider-field.mjs +128 -0
- package/fesm2022/masterteam-components-slider-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-statistic-card.mjs +42 -0
- package/fesm2022/masterteam-components-statistic-card.mjs.map +1 -0
- package/fesm2022/masterteam-components-table.mjs +3372 -0
- package/fesm2022/masterteam-components-table.mjs.map +1 -0
- package/fesm2022/masterteam-components-tabs.mjs +289 -0
- package/fesm2022/masterteam-components-tabs.mjs.map +1 -0
- package/fesm2022/masterteam-components-text-field.mjs +202 -0
- package/fesm2022/masterteam-components-text-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-textarea-field.mjs +126 -0
- package/fesm2022/masterteam-components-textarea-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-toast.mjs +80 -0
- package/fesm2022/masterteam-components-toast.mjs.map +1 -0
- package/fesm2022/masterteam-components-toggle-field.mjs +116 -0
- package/fesm2022/masterteam-components-toggle-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-tooltip.mjs +147 -0
- package/fesm2022/masterteam-components-tooltip.mjs.map +1 -0
- package/fesm2022/masterteam-components-topbar.mjs +32 -0
- package/fesm2022/masterteam-components-topbar.mjs.map +1 -0
- package/fesm2022/masterteam-components-tree.mjs +260 -0
- package/fesm2022/masterteam-components-tree.mjs.map +1 -0
- package/fesm2022/masterteam-components-treeselect-field.mjs +265 -0
- package/fesm2022/masterteam-components-treeselect-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-upload-field.mjs +846 -0
- package/fesm2022/masterteam-components-upload-field.mjs.map +1 -0
- package/fesm2022/masterteam-components-uploader.mjs +425 -0
- package/fesm2022/masterteam-components-uploader.mjs.map +1 -0
- package/fesm2022/masterteam-components-user-search-field.mjs +374 -0
- package/fesm2022/masterteam-components-user-search-field.mjs.map +1 -0
- package/fesm2022/masterteam-components.mjs +2536 -0
- package/fesm2022/masterteam-components.mjs.map +1 -0
- package/package.json +278 -54
- package/types/masterteam-components-avatar-text.d.ts +23 -0
- package/types/masterteam-components-avatar.d.ts +23 -0
- package/types/masterteam-components-breadcrumb.d.ts +18 -0
- package/types/masterteam-components-business-fields.d.ts +675 -0
- package/types/masterteam-components-button-group.d.ts +8 -0
- package/types/masterteam-components-button.d.ts +62 -0
- package/types/masterteam-components-card.d.ts +14 -0
- package/types/masterteam-components-checkbox-field.d.ts +38 -0
- package/types/masterteam-components-chip.d.ts +21 -0
- package/types/masterteam-components-client-page-menu.d.ts +55 -0
- package/types/masterteam-components-client-page.d.ts +115 -0
- package/types/masterteam-components-color-picker-field.d.ts +39 -0
- package/types/masterteam-components-confirmation.d.ts +41 -0
- package/types/masterteam-components-date-field.d.ts +57 -0
- package/types/masterteam-components-dialog.d.ts +12 -0
- package/types/masterteam-components-drawer.d.ts +62 -0
- package/types/masterteam-components-dynamic-drawer.d.ts +159 -0
- package/types/masterteam-components-editor-field.d.ts +39 -0
- package/types/masterteam-components-empty-state.d.ts +47 -0
- package/types/masterteam-components-entities.d.ts +1116 -0
- package/types/masterteam-components-field-validation.d.ts +59 -0
- package/types/masterteam-components-formula.d.ts +759 -0
- package/types/masterteam-components-icon-field.d.ts +44 -0
- package/types/masterteam-components-list.d.ts +18 -0
- package/types/masterteam-components-location-field.d.ts +173 -0
- package/types/masterteam-components-menu.d.ts +55 -0
- package/types/masterteam-components-modal.d.ts +30 -0
- package/types/masterteam-components-module-summary-card.d.ts +18 -0
- package/types/masterteam-components-multi-select-field.d.ts +104 -0
- package/types/masterteam-components-number-field.d.ts +47 -0
- package/types/masterteam-components-page-header.d.ts +30 -0
- package/types/masterteam-components-page.d.ts +26 -0
- package/types/masterteam-components-paginator.d.ts +20 -0
- package/types/masterteam-components-pick-list-field.d.ts +65 -0
- package/types/masterteam-components-progress.d.ts +30 -0
- package/types/masterteam-components-property-filter-builder.d.ts +90 -0
- package/types/masterteam-components-radio-button-field.d.ts +41 -0
- package/types/masterteam-components-radio-cards-field.d.ts +39 -0
- package/types/masterteam-components-radio-cards.d.ts +33 -0
- package/types/masterteam-components-runtime-action.d.ts +105 -0
- package/types/masterteam-components-select-field.d.ts +136 -0
- package/types/masterteam-components-sidebar.d.ts +71 -0
- package/types/masterteam-components-slider-field.d.ts +41 -0
- package/types/masterteam-components-statistic-card.d.ts +28 -0
- package/types/masterteam-components-table.d.ts +937 -0
- package/types/masterteam-components-tabs.d.ts +80 -0
- package/types/masterteam-components-text-field.d.ts +60 -0
- package/types/masterteam-components-textarea-field.d.ts +45 -0
- package/types/masterteam-components-toast.d.ts +27 -0
- package/types/masterteam-components-toggle-field.d.ts +44 -0
- package/types/masterteam-components-tooltip.d.ts +26 -0
- package/types/masterteam-components-topbar.d.ts +20 -0
- package/types/masterteam-components-tree.d.ts +106 -0
- package/types/masterteam-components-treeselect-field.d.ts +79 -0
- package/types/masterteam-components-upload-field.d.ts +112 -0
- package/types/masterteam-components-uploader.d.ts +53 -0
- package/types/masterteam-components-user-search-field.d.ts +110 -0
- package/types/masterteam-components.d.ts +1261 -0
- package/.angular/cache/21.2.7/@masterteam/components/.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db +0 -0
- package/.angular/cache/21.2.7/@masterteam/components/angular-compiler.db-lock +0 -0
- package/.angular/cache/21.2.7/ng-packagr/045efd332b9db1d21b3a595a37ae03ebb11b457a5dc6e2d1cbc561b694e17f1a +0 -1
- package/.angular/cache/21.2.7/ng-packagr/0727b170af3d53236c0cafe16ea670d089e48d4c5c525b1dbcc1c684bb6e99c7 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/0873bc9048494ebc33fe0a7b856324c7c4ca681b0dcaa87338e3290186906d49 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/1010cd8fc996d0c2df519ed60085f4b1f38ccfc873900055bc75fc20a3c26bab +0 -1
- package/.angular/cache/21.2.7/ng-packagr/12379a8ab7254ad3df2635823a358cfce32e6d0f390be68596cc97e02307e6c4 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/1239e7a937657b62f858d17d47738ed30facbdaa91032511e29ed148b748400b +0 -1
- package/.angular/cache/21.2.7/ng-packagr/133b9ecf47ba424244902da90d77cd3f135b85f95c01b16de7b2247f57518f01 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/175d45dc6da51834e7fe937c09d23dbf28d2a823f838ef5271fd3e148776d6ec +0 -1
- package/.angular/cache/21.2.7/ng-packagr/19d99ad4d927324b03cdbef34331ba2c58bd580f1f0ca591cb5f8dbf436c913c +0 -1
- package/.angular/cache/21.2.7/ng-packagr/1a86918763f95c1c2b9fa781bda1ceedf15aead87f0e11ea1324318af43a897a +0 -1
- package/.angular/cache/21.2.7/ng-packagr/1f08100dbc280be7da64c809315376eb7d0cfd074916a6042f609f03f4276a8e +0 -1
- package/.angular/cache/21.2.7/ng-packagr/2224877a7e762b86541428e4c40d61f54f505867c305769ae42e67e4aa81bd93 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/24957fb7ec060692ebcf1471e1bdce39f40aed938959e580048ade58015762d2 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/295fcdc1c4462e7feae96a24255369508a559faaecc4676267749a7ce23e4b6d +0 -1
- package/.angular/cache/21.2.7/ng-packagr/2b37e2f2d6564d10bad1fd0ecc16453962fd855cd1e36ad7aa24baf3e4f2e8b3 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/2c20f0929771e857b570ba2beffe91f598f299ce26d4825fe4315bfe5a3dd40a +0 -1
- package/.angular/cache/21.2.7/ng-packagr/37dea2e5798cad4a21d66292eeed5be26d04500d9a1534332ad42ce664a058c2 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/3b6239b640fcb5ea7067a2655a2901d32f55372812b586aa008e77c59e8f2090 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/3beb1b4dfe75d1e6749cf91f05d51ba4eece939f5c15f6f33ed587bfd198f0a3 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/3f161e6c2ead4519d0663dd79199dafceb2cc22da7ce92a72b809b93bfce0bb0 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/43551862d17cd02626e18b30243390081a6247784485660048b060a3d4ab7fa7 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/47aedf032519b41d96866fcf8fbd4f1dfd29f9e9a534b39dee0e44d402227d2d +0 -1
- package/.angular/cache/21.2.7/ng-packagr/4a1768888c60921955bfdfba8b31c8d853bd7b2a7d3a7b83934de049e1e6e6a2 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/4a783e339117597607bff17eeca0ad24d84b8cbc1e28927e7e453ccfa6223180 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/4d9331b2050326f586cd8f6593a9e04e1c7944b2f9e98023649023c099597a5d +0 -1
- package/.angular/cache/21.2.7/ng-packagr/4e379f506919d47af7008658c75242aa05f0056c1caec4061d7fa5746f776049 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/55009bb7d44552dd816ce32fa2b0f7985f3f08fefd6409c2b4f6b9ffe35dad83 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/58ae3f1f9664f7b16844d2e4a279dd4ca9371de014cf5687320c2d5cb259a74f +0 -1
- package/.angular/cache/21.2.7/ng-packagr/5c08e906bd3fe1aa6c1d62f2bbb2b3f276e1c17fe45ef081e76bd1b865ac3dfa +0 -1
- package/.angular/cache/21.2.7/ng-packagr/5ce333a40ad635188347fa9bc601d5fd14be6baacbae7d096259d725ac9757af +0 -1
- package/.angular/cache/21.2.7/ng-packagr/5f32cceaee6a6ea19cc6cbff5ea089b752f13a0fdcd32597d4c99d5e1e031bb5 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/691ad4ccdc0a8ede36e1f4e5e97638c20c2d3142916ffac3a1b172178c139205 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/6b57160e0d2da3f31693831e84a3f4209c1f33a04abd636e34af03956e7329d8 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/70bc711a1d7b631845885c26adc2d6b1bff47d11332b2625cedfa11e9d5ac79a +0 -1
- package/.angular/cache/21.2.7/ng-packagr/7427c266237012afaef486c2af94ee08a491e8d7b6fc7e5ee887980830bbd333 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/7e8fa7c61cf9a932ba3a0e65eb73c7412e81666b7a8f923dac7b75acfbb94b1d +0 -1
- package/.angular/cache/21.2.7/ng-packagr/81aab7fdab43cbdfa869db759d6113ae01ec6f5e0e9061d7fc089c260886e4d1 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/83a81758045ff710a34ea3cf6f54435a1f5dea9839d8c0adda0bbce7c3fb6e8b +0 -1
- package/.angular/cache/21.2.7/ng-packagr/883eae810a4c09f06617bdc2e4bc30a69f09726401b2a051840969f635d076f1 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/8a6b9be66de40c57054dca5fde376c3cec1bec1ae191a16f1ae6a83306d9ebfe +0 -1
- package/.angular/cache/21.2.7/ng-packagr/8d42c8144f6929de46984094bf390a0c4168404ab13a5194839f6ba5e42bc3ce +0 -1
- package/.angular/cache/21.2.7/ng-packagr/91093656c61a5404f0d576f872247eeb480dd938e6999d481a97893c72b5f3d0 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/91e881172037c63d819e30d30e390e0d7dc0dee9808b3902275ccc8b1887d864 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/9ef28cf3a676e7bd0d37762c4868b4810efca2f241ed0dae75ebca41988e2c00 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/a07cbea405c1831b3f686a8e57c4b500d89cbab2b95e110487890269945feeaa +0 -1
- package/.angular/cache/21.2.7/ng-packagr/a463deba940880d9461612c9cd00d90062bf97aa31b1c4556b8b47a967cb6882 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/ab03ed1e4a371113b41b663d526d2b06565ceb062e6f033f726f1e455fc5d1d6 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/ad0e84be4f2211aff6187b4bec9adbe15f0e8b36851e9c6c63b38303c2daad37 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/aece79242dae70eb748605e37483e75e122e4ce414fa8be875499e8af26ee5d6 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/aff32db91ce03de30d2bbc84f266fe3fb2c6629d5eeb39a364204d9499484368 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/b0671e73a162927d28ef1742ec008e514264bc2ce29f2255bedaea553492fe5d +0 -1
- package/.angular/cache/21.2.7/ng-packagr/bb50d71f3cdeebbb85fd983be8103f9c216060464f8e7e534271197391e6dcf7 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/c64241290ab30d8761b2f5493a039427f5cda1a48b5be88ce62ee5c714c0f690 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/c794d2e79b26ab378c0dbf8afa7b8ac1337ba9afb288941d44a086cb1bd4bad2 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/d942edf8fd8e8e884138ffcdb1a07ad14a0b5e211f8ccea1dc9ea0b48f50cfc9 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/dbe0b9b9f18ba7b96d9c84f4fd16cde158c9701c202d00113e6f88ba93407bce +0 -1
- package/.angular/cache/21.2.7/ng-packagr/f564395a410a2723aac48e582f5fe416bfeaa48677cea47b10c5152d4f2b6672 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/fc9b0d27f081ca7b2a4cbefa75136d7bd7a8c341dbaa0587855071a6003906b8 +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar-text.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-breadcrumb.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-business-fields.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button-group.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-card.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-checkbox-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-chip.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page-menu.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-color-picker-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-confirmation.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-date-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dialog.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-drawer.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dynamic-drawer.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-editor-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-empty-state.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-entities.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-field-validation.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-formula.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-icon-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-list.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-location-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-menu.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-modal.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-module-summary-card.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-multi-select-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-number-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page-header.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-paginator.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-pick-list-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-progress.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-property-filter-builder.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-button-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-runtime-action.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-select-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-sidebar.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-slider-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-statistic-card.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-table.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tabs.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-text-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-textarea-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toast.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toggle-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tooltip.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-topbar.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tree.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-treeselect-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-upload-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-uploader.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-user-search-field.tsbuildinfo +0 -1
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components.tsbuildinfo +0 -1
- package/angular.json +0 -32
- package/api/api.ts +0 -1
- package/api/public-api.ts +0 -5
- package/avatar/avatar.html +0 -32
- package/avatar/avatar.scss +0 -0
- package/avatar/avatar.ts +0 -54
- package/avatar/ng-package.json +0 -6
- package/avatar/public-api.ts +0 -1
- package/avatar-text/avatar-text.html +0 -26
- package/avatar-text/avatar-text.scss +0 -0
- package/avatar-text/avatar-text.ts +0 -52
- package/avatar-text/ng-package.json +0 -6
- package/avatar-text/public-api.ts +0 -1
- package/breadcrumb/breadcrumb.html +0 -53
- package/breadcrumb/breadcrumb.scss +0 -0
- package/breadcrumb/breadcrumb.ts +0 -26
- package/breadcrumb/ng-package.json +0 -6
- package/breadcrumb/public-api.ts +0 -1
- package/business-fields/entity-list-field/entity-list-add-token.ts +0 -25
- package/business-fields/entity-list-field/entity-list-field.html +0 -70
- package/business-fields/entity-list-field/entity-list-field.scss +0 -3
- package/business-fields/entity-list-field/entity-list-field.ts +0 -1067
- package/business-fields/lookup-matrix-field/lookup-matrix-field.html +0 -38
- package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +0 -183
- package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +0 -239
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +0 -95
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +0 -336
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +0 -42
- package/business-fields/ng-package.json +0 -6
- package/business-fields/public-api.ts +0 -8
- package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +0 -32
- package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +0 -272
- package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +0 -89
- package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +0 -441
- package/business-fields/schema-connection-field/schema-connection-field.html +0 -58
- package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
- package/business-fields/schema-connection-field/schema-connection-field.ts +0 -456
- package/button/button.html +0 -44
- package/button/button.scss +0 -0
- package/button/button.ts +0 -120
- package/button/ng-package.json +0 -6
- package/button/public-api.ts +0 -1
- package/button-group/button-group.html +0 -3
- package/button-group/button-group.scss +0 -20
- package/button-group/button-group.ts +0 -12
- package/button-group/ng-package.json +0 -6
- package/button-group/public-api.ts +0 -1
- package/card/card.html +0 -26
- package/card/card.scss +0 -0
- package/card/card.ts +0 -29
- package/card/ng-package.json +0 -6
- package/card/public-api.ts +0 -1
- package/checkbox-field/checkbox-field.html +0 -31
- package/checkbox-field/checkbox-field.scss +0 -0
- package/checkbox-field/checkbox-field.spec.ts +0 -21
- package/checkbox-field/checkbox-field.ts +0 -123
- package/checkbox-field/ng-package.json +0 -6
- package/checkbox-field/public-api.ts +0 -1
- package/chip/chip.html +0 -16
- package/chip/chip.scss +0 -19
- package/chip/chip.ts +0 -45
- package/chip/ng-package.json +0 -6
- package/chip/public-api.ts +0 -1
- package/client-page/client-page.html +0 -232
- package/client-page/client-page.ts +0 -588
- package/client-page/index.ts +0 -2
- package/client-page/ng-package.json +0 -6
- package/client-page/public-api.ts +0 -1
- package/client-page-menu/client-page-menu.html +0 -142
- package/client-page-menu/client-page-menu.ts +0 -199
- package/client-page-menu/index.ts +0 -2
- package/client-page-menu/ng-package.json +0 -6
- package/client-page-menu/public-api.ts +0 -1
- package/color-picker-field/color-picker-field.html +0 -45
- package/color-picker-field/color-picker-field.scss +0 -52
- package/color-picker-field/color-picker-field.ts +0 -131
- package/color-picker-field/ng-package.json +0 -6
- package/color-picker-field/public-api.ts +0 -1
- package/confirmation/confirmation-dialog.html +0 -83
- package/confirmation/confirmation-dialog.scss +0 -0
- package/confirmation/confirmation-dialog.ts +0 -15
- package/confirmation/confirmation.spec.ts +0 -43
- package/confirmation/confirmation.ts +0 -103
- package/confirmation/ng-package.json +0 -6
- package/confirmation/public-api.ts +0 -2
- package/date-field/date-field.html +0 -65
- package/date-field/date-field.scss +0 -0
- package/date-field/date-field.spec.ts +0 -118
- package/date-field/date-field.ts +0 -196
- package/date-field/ng-package.json +0 -6
- package/date-field/public-api.ts +0 -1
- package/dialog/dialog.ts +0 -29
- package/dialog/ng-package.json +0 -6
- package/dialog/public-api.ts +0 -1
- package/drawer/drawer.html +0 -67
- package/drawer/drawer.scss +0 -1
- package/drawer/drawer.ts +0 -348
- package/drawer/ng-package.json +0 -5
- package/drawer/public-api.ts +0 -1
- package/dynamic-drawer/dynamic-drawer-host.ts +0 -476
- package/dynamic-drawer/dynamic-drawer.spec.ts +0 -204
- package/dynamic-drawer/dynamic-drawer.ts +0 -235
- package/dynamic-drawer/ng-package.json +0 -6
- package/dynamic-drawer/public-api.ts +0 -2
- package/editor-field/editor-field.html +0 -38
- package/editor-field/editor-field.scss +0 -219
- package/editor-field/editor-field.ts +0 -126
- package/editor-field/ng-package.json +0 -6
- package/editor-field/public-api.ts +0 -1
- package/empty-state/empty-state.html +0 -236
- package/empty-state/empty-state.ts +0 -85
- package/empty-state/ng-package.json +0 -6
- package/empty-state/public-api.ts +0 -1
- package/entities/comparison/comparison-entity-list/comparison-entity-list.html +0 -87
- package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +0 -93
- package/entities/comparison/comparison-value/comparison-value.html +0 -31
- package/entities/comparison/comparison-value/comparison-value.ts +0 -53
- package/entities/currency-display.utils.spec.ts +0 -94
- package/entities/currency-display.utils.ts +0 -92
- package/entities/entities-manage/entities-manage.html +0 -74
- package/entities/entities-manage/entities-manage.scss +0 -72
- package/entities/entities-manage/entities-manage.ts +0 -121
- package/entities/entities-manage/entities-resize-base.ts +0 -153
- package/entities/entities-preview/entities-preview.css +0 -77
- package/entities/entities-preview/entities-preview.html +0 -56
- package/entities/entities-preview/entities-preview.ts +0 -281
- package/entities/entity-attachment/entity-attachment.html +0 -49
- package/entities/entity-attachment/entity-attachment.ts +0 -462
- package/entities/entity-checkbox/entity-checkbox.html +0 -28
- package/entities/entity-checkbox/entity-checkbox.ts +0 -65
- package/entities/entity-comparison.model.ts +0 -39
- package/entities/entity-connection/entity-connection.html +0 -12
- package/entities/entity-connection/entity-connection.ts +0 -75
- package/entities/entity-currency/entity-currency.html +0 -12
- package/entities/entity-currency/entity-currency.ts +0 -59
- package/entities/entity-date/entity-date.html +0 -16
- package/entities/entity-date/entity-date.ts +0 -50
- package/entities/entity-display.utils.ts +0 -94
- package/entities/entity-field/entity-field.ts +0 -94
- package/entities/entity-leaf-details/entity-leaf-details.html +0 -35
- package/entities/entity-leaf-details/entity-leaf-details.ts +0 -56
- package/entities/entity-location/entity-location.html +0 -34
- package/entities/entity-location/entity-location.ts +0 -98
- package/entities/entity-long-text/entity-long-text.html +0 -9
- package/entities/entity-long-text/entity-long-text.ts +0 -45
- package/entities/entity-lookup/entity-lookup.html +0 -25
- package/entities/entity-lookup/entity-lookup.ts +0 -68
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +0 -39
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +0 -148
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +0 -152
- package/entities/entity-percentage/entity-percentage.html +0 -22
- package/entities/entity-percentage/entity-percentage.ts +0 -163
- package/entities/entity-phase-gate/entity-phase-gate.html +0 -20
- package/entities/entity-phase-gate/entity-phase-gate.ts +0 -129
- package/entities/entity-preview/entity-preview-body.html +0 -8
- package/entities/entity-preview/entity-preview-body.ts +0 -19
- package/entities/entity-preview/entity-preview.html +0 -14
- package/entities/entity-preview/entity-preview.ts +0 -33
- package/entities/entity-preview/entity-value-preview.html +0 -62
- package/entities/entity-preview/entity-value-preview.spec.ts +0 -191
- package/entities/entity-preview/entity-value-preview.ts +0 -69
- package/entities/entity-schedule-item/entity-schedule-item.html +0 -19
- package/entities/entity-schedule-item/entity-schedule-item.ts +0 -41
- package/entities/entity-sections.util.ts +0 -103
- package/entities/entity-status/entity-status.html +0 -20
- package/entities/entity-status/entity-status.ts +0 -60
- package/entities/entity-text/entity-text.html +0 -20
- package/entities/entity-text/entity-text.ts +0 -35
- package/entities/entity-user/entity-user.html +0 -181
- package/entities/entity-user/entity-user.ts +0 -179
- package/entities/entity.model.ts +0 -407
- package/entities/leaf-details-display.utils.ts +0 -269
- package/entities/ng-package.json +0 -6
- package/entities/percentage-color.utils.spec.ts +0 -94
- package/entities/percentage-color.utils.ts +0 -80
- package/entities/public-api.ts +0 -30
- package/field-validation/character-limit.validator.ts +0 -22
- package/field-validation/error-message.pipe.spec.ts +0 -184
- package/field-validation/error-message.pipe.ts +0 -80
- package/field-validation/field-validation.ts +0 -168
- package/field-validation/ng-package.json +0 -6
- package/field-validation/public-api.ts +0 -2
- package/formula/formula-editor/formula-editor.html +0 -89
- package/formula/formula-editor/formula-editor.scss +0 -25
- package/formula/formula-editor/formula-editor.ts +0 -467
- package/formula/formula-editor/index.ts +0 -1
- package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +0 -58
- package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +0 -64
- package/formula/formula-editor-code/formula-completion-range.util.spec.ts +0 -62
- package/formula/formula-editor-code/formula-completion-range.util.ts +0 -71
- package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +0 -23
- package/formula/formula-editor-code/formula-completion-suggestion.util.ts +0 -18
- package/formula/formula-editor-code/formula-editor-code.html +0 -15
- package/formula/formula-editor-code/formula-editor-code.scss +0 -90
- package/formula/formula-editor-code/formula-editor-code.ts +0 -1095
- package/formula/formula-editor-code/index.ts +0 -1
- package/formula/formula-status-bar/formula-status-bar.html +0 -119
- package/formula/formula-status-bar/formula-status-bar.ts +0 -66
- package/formula/formula-status-bar/index.ts +0 -1
- package/formula/formula-toolbar/formula-toolbar.html +0 -361
- package/formula/formula-toolbar/formula-toolbar.ts +0 -532
- package/formula/formula-toolbar/index.ts +0 -2
- package/formula/formula-toolbar/operators.ts +0 -122
- package/formula/models/formula-block.model.ts +0 -61
- package/formula/models/formula-token.model.spec.ts +0 -57
- package/formula/models/formula-token.model.ts +0 -852
- package/formula/models/index.ts +0 -5
- package/formula/models/smart-block.model.ts +0 -132
- package/formula/models/validation-result.model.ts +0 -80
- package/formula/ng-package.json +0 -6
- package/formula/public-api.ts +0 -8
- package/formula/runtime/formula-runtime-catalogs.ts +0 -554
- package/formula/runtime/formula-runtime-engine.spec.ts +0 -328
- package/formula/runtime/formula-runtime-engine.ts +0 -794
- package/formula/runtime/formula-runtime.model.ts +0 -53
- package/formula/runtime/index.ts +0 -3
- package/formula/toolbar-item/index.ts +0 -1
- package/formula/toolbar-item/toolbar-item.html +0 -143
- package/formula/toolbar-item/toolbar-item.scss +0 -14
- package/formula/toolbar-item/toolbar-item.ts +0 -223
- package/icon-field/icon-field.html +0 -58
- package/icon-field/icon-field.scss +0 -24
- package/icon-field/icon-field.spec.ts +0 -77
- package/icon-field/icon-field.ts +0 -205
- package/icon-field/ng-package.json +0 -6
- package/icon-field/public-api.ts +0 -1
- package/list/list.html +0 -22
- package/list/list.ts +0 -36
- package/list/ng-package.json +0 -6
- package/list/public-api.ts +0 -1
- package/location-field/location-field.html +0 -86
- package/location-field/location-field.spec.ts +0 -295
- package/location-field/location-field.ts +0 -662
- package/location-field/location-manual-dialog.html +0 -43
- package/location-field/location-manual-dialog.ts +0 -104
- package/location-field/location-value.ts +0 -67
- package/location-field/ng-package.json +0 -6
- package/location-field/public-api.ts +0 -3
- package/menu/menu.html +0 -71
- package/menu/menu.scss +0 -3
- package/menu/menu.ts +0 -186
- package/menu/ng-package.json +0 -6
- package/menu/public-api.ts +0 -1
- package/modal/modal.ts +0 -127
- package/modal/ng-package.json +0 -6
- package/modal/public-api.ts +0 -1
- package/module-summary-card/module-summary-card.html +0 -43
- package/module-summary-card/module-summary-card.scss +0 -0
- package/module-summary-card/module-summary-card.ts +0 -40
- package/module-summary-card/ng-package.json +0 -6
- package/module-summary-card/public-api.ts +0 -1
- package/multi-select-field/multi-select-field.html +0 -140
- package/multi-select-field/multi-select-field.scss +0 -0
- package/multi-select-field/multi-select-field.spec.ts +0 -21
- package/multi-select-field/multi-select-field.ts +0 -397
- package/multi-select-field/ng-package.json +0 -6
- package/multi-select-field/public-api.ts +0 -1
- package/ng-package.json +0 -9
- package/number-field/ng-package.json +0 -6
- package/number-field/number-field.html +0 -39
- package/number-field/number-field.scss +0 -8
- package/number-field/number-field.spec.ts +0 -21
- package/number-field/number-field.ts +0 -124
- package/number-field/public-api.ts +0 -1
- package/page/index.ts +0 -1
- package/page/ng-package.json +0 -6
- package/page/page.html +0 -37
- package/page/page.ts +0 -43
- package/page/public-api.ts +0 -1
- package/page-header/index.ts +0 -2
- package/page-header/ng-package.json +0 -6
- package/page-header/page-header.html +0 -60
- package/page-header/page-header.ts +0 -54
- package/page-header/public-api.ts +0 -1
- package/paginator/ng-package.json +0 -6
- package/paginator/paginator.html +0 -50
- package/paginator/paginator.scss +0 -0
- package/paginator/paginator.ts +0 -53
- package/paginator/public-api.ts +0 -1
- package/pick-list-field/ng-package.json +0 -6
- package/pick-list-field/pick-list-field.html +0 -39
- package/pick-list-field/pick-list-field.scss +0 -26
- package/pick-list-field/pick-list-field.ts +0 -259
- package/pick-list-field/public-api.ts +0 -1
- package/progress/ng-package.json +0 -6
- package/progress/progress.html +0 -36
- package/progress/progress.ts +0 -61
- package/progress/public-api.ts +0 -1
- package/property-filter-builder/ng-package.json +0 -6
- package/property-filter-builder/property-filter-builder.html +0 -192
- package/property-filter-builder/property-filter-builder.ts +0 -548
- package/property-filter-builder/public-api.ts +0 -1
- package/radio-button-field/ng-package.json +0 -6
- package/radio-button-field/public-api.ts +0 -1
- package/radio-button-field/radio-button-field.html +0 -44
- package/radio-button-field/radio-button-field.scss +0 -0
- package/radio-button-field/radio-button-field.ts +0 -114
- package/radio-cards/ng-package.json +0 -6
- package/radio-cards/public-api.ts +0 -1
- package/radio-cards/radio-cards.css +0 -3
- package/radio-cards/radio-cards.html +0 -54
- package/radio-cards/radio-cards.spec.ts +0 -22
- package/radio-cards/radio-cards.ts +0 -92
- package/radio-cards-field/ng-package.json +0 -6
- package/radio-cards-field/public-api.ts +0 -1
- package/radio-cards-field/radio-cards-field.css +0 -0
- package/radio-cards-field/radio-cards-field.html +0 -38
- package/radio-cards-field/radio-cards-field.spec.ts +0 -22
- package/radio-cards-field/radio-cards-field.ts +0 -182
- package/runtime-action/ng-package.json +0 -6
- package/runtime-action/payload-builder.ts +0 -246
- package/runtime-action/public-api.ts +0 -4
- package/runtime-action/runtime-action-context.store.ts +0 -26
- package/runtime-action/runtime-action.runner.ts +0 -302
- package/runtime-action/runtime-action.types.ts +0 -82
- package/select-field/current-user.util.ts +0 -54
- package/select-field/ng-package.json +0 -6
- package/select-field/public-api.ts +0 -1
- package/select-field/select-field.html +0 -142
- package/select-field/select-field.scss +0 -0
- package/select-field/select-field.spec.ts +0 -21
- package/select-field/select-field.ts +0 -471
- package/sidebar/ng-package.json +0 -6
- package/sidebar/public-api.ts +0 -1
- package/sidebar/sidebar.html +0 -368
- package/sidebar/sidebar.ts +0 -303
- package/slider-field/ng-package.json +0 -7
- package/slider-field/public-api.ts +0 -1
- package/slider-field/slider-field.html +0 -33
- package/slider-field/slider-field.scss +0 -11
- package/slider-field/slider-field.spec.ts +0 -44
- package/slider-field/slider-field.ts +0 -166
- package/src/lib/base/base.facade.ts +0 -159
- package/src/lib/base/crud-base.state.ts +0 -248
- package/src/lib/config/date-format.config.ts +0 -55
- package/src/lib/config/ds-identity.preset.ts +0 -538
- package/src/lib/config/ds-identity.tokens.ts +0 -209
- package/src/lib/config/dynamic-form.model.ts +0 -1162
- package/src/lib/config/povide-messages.ts +0 -5
- package/src/lib/config/provide-confirmation.ts +0 -5
- package/src/lib/config/providemt.ts +0 -506
- package/src/lib/config/public-api.ts +0 -0
- package/src/lib/pipes/mt-date-format.pipe.spec.ts +0 -60
- package/src/lib/pipes/mt-date-format.pipe.ts +0 -81
- package/src/lib/utils/api-request.helper.ts +0 -59
- package/src/lib/utils/clock-time.util.ts +0 -58
- package/src/lib/utils/color.utils.ts +0 -187
- package/src/lib/utils/entity-adapter.ts +0 -50
- package/src/lib/utils/field-id.ts +0 -42
- package/src/lib/utils/http-context.ts +0 -35
- package/src/lib/utils/inputs.ts +0 -6
- package/src/lib/utils/state-helpers.ts +0 -49
- package/src/lib/utils/theme.ts +0 -281
- package/src/public-api.ts +0 -30
- package/statistic-card/ng-package.json +0 -6
- package/statistic-card/public-api.ts +0 -1
- package/statistic-card/statistic-card.html +0 -31
- package/statistic-card/statistic-card.scss +0 -0
- package/statistic-card/statistic-card.ts +0 -59
- package/table/ng-package.json +0 -7
- package/table/public-api.ts +0 -10
- package/table/table-actions-menu/public-api.ts +0 -1
- package/table/table-actions-menu/table-actions-menu.html +0 -75
- package/table/table-actions-menu/table-actions-menu.ts +0 -171
- package/table/table-caption/public-api.ts +0 -1
- package/table/table-caption/table-caption.html +0 -118
- package/table/table-caption/table-caption.ts +0 -221
- package/table/table-column-filter/public-api.ts +0 -1
- package/table/table-column-filter/table-column-filter.html +0 -44
- package/table/table-column-filter/table-column-filter.ts +0 -106
- package/table/table-export/html-to-text.util.ts +0 -67
- package/table/table-export/public-api.ts +0 -1
- package/table/table-export/table-export.service.spec.ts +0 -186
- package/table/table-export/table-export.service.ts +0 -325
- package/table/table-filter/public-api.ts +0 -1
- package/table/table-filter/table-filter.css +0 -9
- package/table/table-filter/table-filter.html +0 -63
- package/table/table-filter/table-filter.ts +0 -126
- package/table/table-filter-field/public-api.ts +0 -1
- package/table/table-filter-field/table-filter-field.html +0 -182
- package/table/table-filter-field/table-filter-field.ts +0 -208
- package/table/table-grouping/public-api.ts +0 -1
- package/table/table-grouping/table-grouping.spec.ts +0 -218
- package/table/table-grouping/table-grouping.ts +0 -237
- package/table/table-types.ts +0 -242
- package/table/table-value.utils.spec.ts +0 -63
- package/table/table-value.utils.ts +0 -1014
- package/table/table.css +0 -145
- package/table/table.html +0 -572
- package/table/table.ts +0 -2042
- package/tabs/ng-package.json +0 -6
- package/tabs/public-api.ts +0 -1
- package/tabs/tabs.html +0 -417
- package/tabs/tabs.scss +0 -3
- package/tabs/tabs.spec.ts +0 -79
- package/tabs/tabs.ts +0 -397
- package/text-field/ng-package.json +0 -6
- package/text-field/public-api.ts +0 -1
- package/text-field/text-field.html +0 -75
- package/text-field/text-field.scss +0 -56
- package/text-field/text-field.ts +0 -251
- package/textarea-field/ng-package.json +0 -6
- package/textarea-field/public-api.ts +0 -1
- package/textarea-field/textarea-field.html +0 -37
- package/textarea-field/textarea-field.scss +0 -0
- package/textarea-field/textarea-field.spec.ts +0 -21
- package/textarea-field/textarea-field.ts +0 -169
- package/toast/ng-package.json +0 -6
- package/toast/public-api.ts +0 -2
- package/toast/toast.html +0 -18
- package/toast/toast.service.ts +0 -67
- package/toast/toast.ts +0 -21
- package/toggle-field/ng-package.json +0 -6
- package/toggle-field/public-api.ts +0 -1
- package/toggle-field/toggle-field.html +0 -78
- package/toggle-field/toggle-field.scss +0 -24
- package/toggle-field/toggle-field.ts +0 -150
- package/tooltip/ng-package.json +0 -6
- package/tooltip/public-api.ts +0 -2
- package/tooltip/tooltip.ts +0 -30
- package/tooltip/truncate-tooltip.ts +0 -124
- package/topbar/ng-package.json +0 -6
- package/topbar/public-api.ts +0 -1
- package/topbar/topbar.html +0 -52
- package/topbar/topbar.ts +0 -27
- package/tree/ng-package.json +0 -6
- package/tree/public-api.ts +0 -2
- package/tree/tree-types.ts +0 -55
- package/tree/tree.html +0 -126
- package/tree/tree.scss +0 -1
- package/tree/tree.ts +0 -303
- package/treeselect-field/ng-package.json +0 -6
- package/treeselect-field/public-api.ts +0 -1
- package/treeselect-field/treeselect-field.html +0 -71
- package/treeselect-field/treeselect-field.ts +0 -348
- package/tsconfig.check.json +0 -20
- package/tsconfig.json +0 -16
- package/tsconfig.spec.json +0 -24
- package/upload-field/ng-package.json +0 -6
- package/upload-field/public-api.ts +0 -2
- package/upload-field/secure-image.pipe.ts +0 -258
- package/upload-field/upload-field.html +0 -274
- package/upload-field/upload-field.scss +0 -0
- package/upload-field/upload-field.spec.ts +0 -169
- package/upload-field/upload-field.ts +0 -764
- package/upload-field/upload-file-preview/upload-file-preview.html +0 -41
- package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
- package/upload-field/upload-file-preview/upload-file-preview.ts +0 -57
- package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
- package/upload-field/upload-user-preview/upload-user-preview.html +0 -73
- package/upload-field/upload-user-preview/upload-user-preview.ts +0 -54
- package/uploader/ng-package.json +0 -6
- package/uploader/public-api.ts +0 -1
- package/uploader/uploader.service.spec.ts +0 -271
- package/uploader/uploader.service.ts +0 -733
- package/user-search-field/ng-package.json +0 -6
- package/user-search-field/public-api.ts +0 -1
- package/user-search-field/user-search-field.html +0 -88
- package/user-search-field/user-search-field.scss +0 -4
- package/user-search-field/user-search-field.spec.ts +0 -176
- package/user-search-field/user-search-field.ts +0 -483
package/table/table.ts
DELETED
|
@@ -1,2042 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
booleanAttribute,
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
contentChild,
|
|
7
|
-
effect,
|
|
8
|
-
inject,
|
|
9
|
-
input,
|
|
10
|
-
model,
|
|
11
|
-
output,
|
|
12
|
-
signal,
|
|
13
|
-
TemplateRef,
|
|
14
|
-
} from '@angular/core';
|
|
15
|
-
import { NgTemplateOutlet } from '@angular/common';
|
|
16
|
-
import {
|
|
17
|
-
ColumnDef,
|
|
18
|
-
TableAction,
|
|
19
|
-
TableActionShape,
|
|
20
|
-
CellChangeEvent,
|
|
21
|
-
ColumnTypeForActionCell,
|
|
22
|
-
TableFilters,
|
|
23
|
-
FilterValue,
|
|
24
|
-
TableFilterMode,
|
|
25
|
-
TablePersistStateKey,
|
|
26
|
-
} from './table-types';
|
|
27
|
-
import { Card } from '@masterteam/components/card';
|
|
28
|
-
import { TableCaption } from './table-caption/table-caption';
|
|
29
|
-
import { TableColumnFilter } from './table-column-filter/table-column-filter';
|
|
30
|
-
import { TableExportService } from './table-export/table-export.service';
|
|
31
|
-
import { TableGroupingController } from './table-grouping/table-grouping';
|
|
32
|
-
import { ToggleField } from '@masterteam/components/toggle-field';
|
|
33
|
-
import { FormsModule } from '@angular/forms';
|
|
34
|
-
import { Button } from '@masterteam/components/button';
|
|
35
|
-
import { Paginator } from '@masterteam/components/paginator';
|
|
36
|
-
import { CheckboxField } from '@masterteam/components/checkbox-field';
|
|
37
|
-
import { TableModule, TablePageEvent } from 'primeng/table';
|
|
38
|
-
import { SkeletonModule } from 'primeng/skeleton';
|
|
39
|
-
import { ProgressBarModule } from 'primeng/progressbar';
|
|
40
|
-
import {
|
|
41
|
-
MTDateFormatPipe,
|
|
42
|
-
type MTDateFormatType,
|
|
43
|
-
} from '@masterteam/components';
|
|
44
|
-
import { ConfirmationService } from '@masterteam/components/confirmation';
|
|
45
|
-
import { TranslocoModule, TranslocoService } from '@jsverse/transloco';
|
|
46
|
-
import {
|
|
47
|
-
EntityData,
|
|
48
|
-
EntityPreview,
|
|
49
|
-
EntityStatusValue,
|
|
50
|
-
} from '@masterteam/components/entities';
|
|
51
|
-
import { PopoverModule } from 'primeng/popover';
|
|
52
|
-
import { Icon, MTIcon } from '@masterteam/icons';
|
|
53
|
-
import { EmptyState } from '@masterteam/components/empty-state';
|
|
54
|
-
import { TableValueResolver } from './table-value.utils';
|
|
55
|
-
|
|
56
|
-
interface PersistedTableState {
|
|
57
|
-
pageSize?: number;
|
|
58
|
-
first?: number;
|
|
59
|
-
currentPage?: number;
|
|
60
|
-
sortField?: string | null;
|
|
61
|
-
sortDirection?: 'asc' | 'desc' | null;
|
|
62
|
-
selectedRowKeys?: string[];
|
|
63
|
-
groupBy?: string | null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const DEFAULT_PERSIST_STATE_EXCLUDE: TablePersistStateKey[] = ['pagePosition'];
|
|
67
|
-
|
|
68
|
-
@Component({
|
|
69
|
-
selector: 'mt-table',
|
|
70
|
-
templateUrl: './table.html',
|
|
71
|
-
styleUrls: ['./table.css'],
|
|
72
|
-
standalone: true,
|
|
73
|
-
providers: [MTDateFormatPipe],
|
|
74
|
-
imports: [
|
|
75
|
-
TableModule,
|
|
76
|
-
NgTemplateOutlet,
|
|
77
|
-
ToggleField,
|
|
78
|
-
FormsModule,
|
|
79
|
-
Button,
|
|
80
|
-
Paginator,
|
|
81
|
-
CheckboxField,
|
|
82
|
-
SkeletonModule,
|
|
83
|
-
ProgressBarModule,
|
|
84
|
-
TranslocoModule,
|
|
85
|
-
TableCaption,
|
|
86
|
-
TableColumnFilter,
|
|
87
|
-
EntityPreview,
|
|
88
|
-
PopoverModule,
|
|
89
|
-
Icon,
|
|
90
|
-
Card,
|
|
91
|
-
MTDateFormatPipe,
|
|
92
|
-
EmptyState,
|
|
93
|
-
],
|
|
94
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
95
|
-
})
|
|
96
|
-
export class Table {
|
|
97
|
-
private static readonly LOADING_COLUMN_COUNT = 5;
|
|
98
|
-
|
|
99
|
-
selectionChange = output<any[]>();
|
|
100
|
-
cellChange = output<CellChangeEvent>();
|
|
101
|
-
lazyLoad = output<any>();
|
|
102
|
-
columnReorder = output<any>();
|
|
103
|
-
rowReorder = output<any>();
|
|
104
|
-
rowClick = output<any>();
|
|
105
|
-
/** Fired when the empty state's action button is pressed. */
|
|
106
|
-
emptyAction = output<void>();
|
|
107
|
-
/**
|
|
108
|
-
* Fires when the per-row actions popover is opened (3-dots click) so the
|
|
109
|
-
* parent can lazy-load row-specific actions instead of fetching for every
|
|
110
|
-
* visible row up front. Only emitted when `actionShape` is `popover`.
|
|
111
|
-
*/
|
|
112
|
-
rowActionsRequested = output<any>();
|
|
113
|
-
|
|
114
|
-
filters = model<TableFilters>({});
|
|
115
|
-
|
|
116
|
-
data = input.required<any[]>();
|
|
117
|
-
columns = input.required<ColumnDef[]>();
|
|
118
|
-
rowActions = input<TableAction[]>([]);
|
|
119
|
-
size = input<'small' | 'large' | undefined>(undefined);
|
|
120
|
-
showGridlines = input<boolean, unknown>(false, {
|
|
121
|
-
transform: booleanAttribute,
|
|
122
|
-
});
|
|
123
|
-
stripedRows = input<boolean, unknown>(false, {
|
|
124
|
-
transform: booleanAttribute,
|
|
125
|
-
});
|
|
126
|
-
selectableRows = input<boolean, unknown>(false, {
|
|
127
|
-
transform: booleanAttribute,
|
|
128
|
-
});
|
|
129
|
-
clickableRows = input<boolean, unknown>(false, {
|
|
130
|
-
transform: booleanAttribute,
|
|
131
|
-
});
|
|
132
|
-
generalSearch = input<boolean, unknown>(false, {
|
|
133
|
-
transform: booleanAttribute,
|
|
134
|
-
});
|
|
135
|
-
lazyLocalSearch = input<boolean, unknown>(false, {
|
|
136
|
-
transform: booleanAttribute,
|
|
137
|
-
});
|
|
138
|
-
showFilters = input<boolean, unknown>(false, {
|
|
139
|
-
transform: booleanAttribute,
|
|
140
|
-
});
|
|
141
|
-
filterMode = input<TableFilterMode>('popover');
|
|
142
|
-
loading = input<boolean, unknown>(false, {
|
|
143
|
-
transform: booleanAttribute,
|
|
144
|
-
});
|
|
145
|
-
updating = input<boolean, unknown>(false, {
|
|
146
|
-
transform: booleanAttribute,
|
|
147
|
-
});
|
|
148
|
-
lazy = input<boolean, unknown>(false, {
|
|
149
|
-
transform: booleanAttribute,
|
|
150
|
-
});
|
|
151
|
-
lazyLocalSort = input<boolean, unknown>(false, {
|
|
152
|
-
transform: booleanAttribute,
|
|
153
|
-
});
|
|
154
|
-
lazyTotalRecords = input<number>();
|
|
155
|
-
reorderableColumns = input<boolean, unknown>(false, {
|
|
156
|
-
transform: booleanAttribute,
|
|
157
|
-
});
|
|
158
|
-
reorderableRows = input<boolean, unknown>(false, {
|
|
159
|
-
transform: booleanAttribute,
|
|
160
|
-
});
|
|
161
|
-
dataKey = input<string>();
|
|
162
|
-
storageKey = input<string | null>(null);
|
|
163
|
-
storageMode = input<'local' | 'session'>('local');
|
|
164
|
-
persistStateExclude = input<TablePersistStateKey[]>(
|
|
165
|
-
DEFAULT_PERSIST_STATE_EXCLUDE,
|
|
166
|
-
);
|
|
167
|
-
exportable = input<boolean, unknown>(false, {
|
|
168
|
-
transform: booleanAttribute,
|
|
169
|
-
});
|
|
170
|
-
printable = input<boolean, unknown>(false, {
|
|
171
|
-
transform: booleanAttribute,
|
|
172
|
-
});
|
|
173
|
-
groupable = input<boolean, unknown>(false, {
|
|
174
|
-
transform: booleanAttribute,
|
|
175
|
-
});
|
|
176
|
-
/**
|
|
177
|
-
* Optional external group-count map keyed by the group display label
|
|
178
|
-
* (e.g. `"Approved" → 42`). When provided, the group header shows these
|
|
179
|
-
* totals instead of the local page row count. Use this in lazy tables where
|
|
180
|
-
* the backend provides total-count-per-group via KPI/stats data.
|
|
181
|
-
*/
|
|
182
|
-
groupCountMap = input<Map<string, number> | null>(null);
|
|
183
|
-
cellClickFilter = input<boolean, unknown>(false, {
|
|
184
|
-
transform: booleanAttribute,
|
|
185
|
-
});
|
|
186
|
-
/**
|
|
187
|
-
* When true and `rowActions` is non-empty, the trailing actions column is
|
|
188
|
-
* pinned to the right via PrimeNG's frozen-column support. The table also
|
|
189
|
-
* switches to scrollable mode so horizontal scrolling reveals the rest of
|
|
190
|
-
* the columns while the actions stay visible. Off by default to preserve
|
|
191
|
-
* existing layout for tables that don't opt in.
|
|
192
|
-
*/
|
|
193
|
-
freezeActions = input<boolean, unknown>(false, {
|
|
194
|
-
transform: booleanAttribute,
|
|
195
|
-
});
|
|
196
|
-
virtualScroll = input<boolean, unknown>(false, {
|
|
197
|
-
transform: booleanAttribute,
|
|
198
|
-
});
|
|
199
|
-
virtualScrollItemSize = input<number>(52);
|
|
200
|
-
scrollHeight = input<string>('520px');
|
|
201
|
-
printTitle = input<string>('');
|
|
202
|
-
exportFilename = input<string>('download');
|
|
203
|
-
actionShape = input<TableActionShape>('flat');
|
|
204
|
-
/**
|
|
205
|
-
* Optional per-row predicate. When it returns true for a given row, the
|
|
206
|
-
* row-actions popover renders a small skeleton block instead of the action
|
|
207
|
-
* list — used while a parent is fetching that row's actions on demand.
|
|
208
|
-
*/
|
|
209
|
-
rowActionsLoadingFn = input<((row: any) => boolean) | null>(null);
|
|
210
|
-
tableLayout = input<'fixed' | 'auto'>('fixed');
|
|
211
|
-
|
|
212
|
-
noCard = input<boolean, unknown>(false, { transform: booleanAttribute });
|
|
213
|
-
|
|
214
|
-
private readonly dateFormat = inject(MTDateFormatPipe);
|
|
215
|
-
|
|
216
|
-
// Tabs inputs and outputs
|
|
217
|
-
tabs = input<any[]>();
|
|
218
|
-
tabsOptionLabel = input<string>('label');
|
|
219
|
-
tabsOptionValue = input<string>('value');
|
|
220
|
-
activeTab = model<any>();
|
|
221
|
-
onTabChange = output<any>();
|
|
222
|
-
|
|
223
|
-
// Table actions inputs and outputs
|
|
224
|
-
actions = input<TableAction[]>([]);
|
|
225
|
-
|
|
226
|
-
// Content TemplateRefs
|
|
227
|
-
captionStartContent = contentChild<TemplateRef<any>>('captionStart');
|
|
228
|
-
captionEndContent = contentChild<TemplateRef<any>>('captionEnd');
|
|
229
|
-
emptyContent = contentChild<TemplateRef<any>>('empty');
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* Copy for the empty state. Left unset, the table falls back to the generic
|
|
233
|
-
* "Nothing here yet" / "No results match your filters" pair — but a list that
|
|
234
|
-
* knows what it holds should say so, which is the whole point of finding
|
|
235
|
-
* H-12: `emptyDescription="Deliverables you own appear here."`
|
|
236
|
-
*/
|
|
237
|
-
emptyTitle = input<string>();
|
|
238
|
-
emptyDescription = input<string>();
|
|
239
|
-
/**
|
|
240
|
-
* Call to action on the empty state. Supplying a label takes ownership of the
|
|
241
|
-
* behaviour: `emptyAction` fires and the table does nothing else. Without
|
|
242
|
-
* one, a filtered-empty table offers "Clear filters" and handles it itself.
|
|
243
|
-
*/
|
|
244
|
-
emptyActionLabel = input<string>();
|
|
245
|
-
emptyActionIcon = input<MTIcon>();
|
|
246
|
-
|
|
247
|
-
paginatorPosition = input<'end' | 'start' | 'center'>('end');
|
|
248
|
-
/**
|
|
249
|
-
* Pagination for a single page of rows is noise that implies more data
|
|
250
|
-
* exists, so it is off by default now (finding M-05). Set it when the row
|
|
251
|
-
* count is genuinely unknown to the user and the "1 of 1" is reassuring.
|
|
252
|
-
*/
|
|
253
|
-
alwaysShowPaginator = input<boolean, unknown>(false, {
|
|
254
|
-
transform: booleanAttribute,
|
|
255
|
-
});
|
|
256
|
-
rowsPerPageOptions = input<number[]>([5, 10, 20, 50, 100]);
|
|
257
|
-
pageSize = model<number>(10);
|
|
258
|
-
currentPage = model<number>(0);
|
|
259
|
-
first = model<number>(0);
|
|
260
|
-
filterTerm = model<string>('');
|
|
261
|
-
groupBy = model<string | null>(null);
|
|
262
|
-
/**
|
|
263
|
-
* Sort state is a `model` so a lazy host that owns sort itself (URL / store)
|
|
264
|
-
* can push its value in instead of letting the table drift out of sync with
|
|
265
|
-
* the query it actually sent.
|
|
266
|
-
*/
|
|
267
|
-
sortField = model<string | null>(null);
|
|
268
|
-
sortDirection = model<'asc' | 'desc' | null>(null);
|
|
269
|
-
confirmationService = inject(ConfirmationService);
|
|
270
|
-
private readonly exportService = inject(TableExportService);
|
|
271
|
-
private readonly transloco = inject(TranslocoService);
|
|
272
|
-
protected readonly grouping: TableGroupingController;
|
|
273
|
-
|
|
274
|
-
protected selectedRowKeys = signal<Set<string>>(new Set());
|
|
275
|
-
protected transientSelectedRows = signal<Set<any>>(new Set());
|
|
276
|
-
private readonly hydratedStorageKey = signal<string | null>(null);
|
|
277
|
-
private readonly storageHydrated = signal(false);
|
|
278
|
-
|
|
279
|
-
protected readonly isColumnFilterMode = computed(
|
|
280
|
-
() => this.showFilters() && this.filterMode() === 'column',
|
|
281
|
-
);
|
|
282
|
-
|
|
283
|
-
protected filterableColumnMap = computed<Map<string, ColumnDef>>(() => {
|
|
284
|
-
if (!this.isColumnFilterMode()) {
|
|
285
|
-
return new Map();
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const data = this.data();
|
|
289
|
-
const map = new Map<string, ColumnDef>();
|
|
290
|
-
|
|
291
|
-
this.columns().forEach((col) => {
|
|
292
|
-
if (TableValueResolver.getColumnFilterType(col, data[0]) === null) {
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
map.set(col.key, TableValueResolver.buildFilterableColumn(col, data));
|
|
296
|
-
});
|
|
297
|
-
|
|
298
|
-
return map;
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
protected getFilterableColumn(key: string): ColumnDef | undefined {
|
|
302
|
-
return this.filterableColumnMap().get(key);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
onColumnFilterChange(key: string, value: any): void {
|
|
306
|
-
const next = { ...this.filters() };
|
|
307
|
-
if (value === null || value === undefined) {
|
|
308
|
-
delete next[key];
|
|
309
|
-
} else {
|
|
310
|
-
next[key] = value;
|
|
311
|
-
}
|
|
312
|
-
this.onFilterApplied(next);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
protected activeFilterCount = computed(() => {
|
|
316
|
-
const filters = this.filters();
|
|
317
|
-
return Object.values(filters).filter(
|
|
318
|
-
(value) => value !== null && value !== undefined && value !== '',
|
|
319
|
-
).length;
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Whether the user narrowed the list themselves. Drives which empty state the
|
|
324
|
-
* table shows: "nothing matched what you asked for, clear it" reads very
|
|
325
|
-
* differently from "this list has nothing in it yet" (finding H-12).
|
|
326
|
-
*/
|
|
327
|
-
protected hasActiveFilters = computed(
|
|
328
|
-
() => this.activeFilterCount() > 0 || this.filterTerm().trim().length > 0,
|
|
329
|
-
);
|
|
330
|
-
|
|
331
|
-
/** Action offered on the empty state. Defaults to clearing an active filter. */
|
|
332
|
-
protected resolvedEmptyActionLabel = computed(() => {
|
|
333
|
-
const configured = this.emptyActionLabel()?.trim();
|
|
334
|
-
if (configured) {
|
|
335
|
-
return configured;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
return this.hasActiveFilters()
|
|
339
|
-
? this.transloco.translate('components.emptyState.clearFilters')
|
|
340
|
-
: undefined;
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
protected resolvedEmptyActionIcon = computed<MTIcon | undefined>(() => {
|
|
344
|
-
if (this.emptyActionLabel()?.trim()) {
|
|
345
|
-
return this.emptyActionIcon();
|
|
346
|
-
}
|
|
347
|
-
return this.hasActiveFilters() ? 'general.x-close' : undefined;
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* The empty-state action. A caller that supplied its own label owns the
|
|
352
|
-
* behaviour and just gets the event; otherwise the default action is the one
|
|
353
|
-
* the default label promises — clear the filters and the search term.
|
|
354
|
-
*/
|
|
355
|
-
protected onEmptyAction(): void {
|
|
356
|
-
if (this.emptyActionLabel()?.trim()) {
|
|
357
|
-
this.emptyAction.emit();
|
|
358
|
-
return;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
this.filterTerm.set('');
|
|
362
|
-
this.onFilterApplied({});
|
|
363
|
-
this.emptyAction.emit();
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
protected filteredData = computed(() => {
|
|
367
|
-
const data = this.data();
|
|
368
|
-
const applyLocalSearch = !this.lazy() || this.lazyLocalSearch();
|
|
369
|
-
const applyLocalSort = !this.lazy() || this.lazyLocalSort();
|
|
370
|
-
const searchTerm = applyLocalSearch
|
|
371
|
-
? this.filterTerm().trim().toLowerCase()
|
|
372
|
-
: '';
|
|
373
|
-
const filters = this.filters();
|
|
374
|
-
const filterKeys = this.lazy() ? [] : Object.keys(filters);
|
|
375
|
-
let result = data;
|
|
376
|
-
|
|
377
|
-
// Apply search term — recurse into nested objects/arrays so column keys
|
|
378
|
-
// that point at a nested display (e.g. `name.display` on a lookup row)
|
|
379
|
-
// are still searched. Top-level-only matching used to drop multi-word
|
|
380
|
-
// queries on tables whose display string lives one level deep.
|
|
381
|
-
if (searchTerm !== '') {
|
|
382
|
-
result = result.filter((item) =>
|
|
383
|
-
TableValueResolver.matchesSearchTerm(item, searchTerm),
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
// Apply column filters
|
|
388
|
-
if (filterKeys.length > 0) {
|
|
389
|
-
result = result.filter((item) =>
|
|
390
|
-
filterKeys.every((key) => this.matchesFilter(item, key, filters[key])),
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
return applyLocalSort ? this.sortData(result) : result;
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
protected renderedColumns = computed<ColumnDef[]>(() => {
|
|
398
|
-
const visible = this.columns().filter((column) => !column.filterOnly);
|
|
399
|
-
|
|
400
|
-
// The grouped column's value is already the group header — repeating it in
|
|
401
|
-
// every row is noise. Never hide the last one, or the table would render
|
|
402
|
-
// with no columns at all. Export/print still read the full `columns()`.
|
|
403
|
-
const groupedKey = this.groupBy();
|
|
404
|
-
const withoutGrouped = groupedKey
|
|
405
|
-
? visible.filter((column) => column.key !== groupedKey)
|
|
406
|
-
: visible;
|
|
407
|
-
const columns = withoutGrouped.length ? withoutGrouped : visible;
|
|
408
|
-
|
|
409
|
-
if (columns.length > 0 || !this.loading()) {
|
|
410
|
-
return columns;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
return Array.from(
|
|
414
|
-
{ length: Table.LOADING_COLUMN_COUNT },
|
|
415
|
-
(_, index): ColumnDef => ({
|
|
416
|
-
key: `__loading-${index}`,
|
|
417
|
-
label: '',
|
|
418
|
-
type: 'text',
|
|
419
|
-
}),
|
|
420
|
-
);
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Synthetic field name added to each row so PrimeNG's `groupRowsBy`
|
|
425
|
-
* compares a stable primitive string instead of a complex entity object.
|
|
426
|
-
*/
|
|
427
|
-
static readonly GROUP_KEY_FIELD = '__mt_group__';
|
|
428
|
-
protected readonly groupKeyField = Table.GROUP_KEY_FIELD;
|
|
429
|
-
|
|
430
|
-
protected displayData = computed(() => {
|
|
431
|
-
if (this.loading()) {
|
|
432
|
-
return Array.from({ length: this.pageSize() }, () => ({}));
|
|
433
|
-
}
|
|
434
|
-
return this.filteredData();
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Display data enriched with a stable group key field so PrimeNG groups
|
|
439
|
-
* rows correctly. Without this, PrimeNG JSON-stringifies the full entity
|
|
440
|
-
* object (spread of column + backend value), which may differ between rows
|
|
441
|
-
* even when they share the same status display.
|
|
442
|
-
*/
|
|
443
|
-
protected groupKeyedData = computed<any[]>(() => {
|
|
444
|
-
const data = this.displayData();
|
|
445
|
-
if (!this.grouping.groupingActive()) return data;
|
|
446
|
-
return data.map((row) => ({
|
|
447
|
-
...(row as object),
|
|
448
|
-
[Table.GROUP_KEY_FIELD]: this.grouping.getGroupSortKey(row),
|
|
449
|
-
}));
|
|
450
|
-
});
|
|
451
|
-
|
|
452
|
-
protected totalRecords = computed(() => {
|
|
453
|
-
if (this.lazy() && this.lazyTotalRecords() !== undefined) {
|
|
454
|
-
return this.lazyTotalRecords() as number;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
return this.filteredData().length;
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
protected usesVirtualScroll = computed(() => {
|
|
461
|
-
if (!this.virtualScroll()) {
|
|
462
|
-
return false;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
const rowCount = this.displayData().length;
|
|
466
|
-
if (rowCount === 0) {
|
|
467
|
-
return false;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
const itemSize = this.virtualScrollItemSize();
|
|
471
|
-
if (!Number.isFinite(itemSize) || itemSize <= 0) {
|
|
472
|
-
return false;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
const scrollHeightPx = this.resolveScrollHeightPixels(this.scrollHeight());
|
|
476
|
-
if (scrollHeightPx === null) {
|
|
477
|
-
return rowCount > this.pageSize();
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
return rowCount * itemSize > scrollHeightPx;
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
protected showPaginator = computed(() => {
|
|
484
|
-
if (this.virtualScroll()) {
|
|
485
|
-
return false;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
if (this.alwaysShowPaginator()) {
|
|
489
|
-
return true;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
const pageSize = this.pageSize();
|
|
493
|
-
return pageSize > 0 && this.totalRecords() > pageSize;
|
|
494
|
-
});
|
|
495
|
-
|
|
496
|
-
// TODO: remove after updating the toggle and checkbox logic
|
|
497
|
-
protected paginatedData = computed(() => {
|
|
498
|
-
const data = this.filteredData();
|
|
499
|
-
const first = this.first();
|
|
500
|
-
const pageSize = this.pageSize();
|
|
501
|
-
if (this.lazy() || this.virtualScroll()) {
|
|
502
|
-
return data;
|
|
503
|
-
}
|
|
504
|
-
return data.slice(first, first + pageSize);
|
|
505
|
-
});
|
|
506
|
-
|
|
507
|
-
protected allSelectedOnPage = computed(() => {
|
|
508
|
-
const pageData = this.paginatedData();
|
|
509
|
-
if (pageData.length === 0) return false;
|
|
510
|
-
return pageData.every((row) => this.isRowSelected(row));
|
|
511
|
-
});
|
|
512
|
-
|
|
513
|
-
protected totalColumnSpan = computed(
|
|
514
|
-
() =>
|
|
515
|
-
this.renderedColumns().length +
|
|
516
|
-
(this.reorderableRows() ? 1 : 0) +
|
|
517
|
-
(this.selectableRows() ? 1 : 0) +
|
|
518
|
-
(this.rowActions().length > 0 ? 1 : 0),
|
|
519
|
-
);
|
|
520
|
-
|
|
521
|
-
constructor() {
|
|
522
|
-
this.grouping = new TableGroupingController(
|
|
523
|
-
this.columns,
|
|
524
|
-
this.filteredData,
|
|
525
|
-
this.groupBy,
|
|
526
|
-
this.sortField,
|
|
527
|
-
this.sortDirection,
|
|
528
|
-
this.transloco,
|
|
529
|
-
);
|
|
530
|
-
|
|
531
|
-
effect(() => {
|
|
532
|
-
const storageKey = this.getNormalizedStorageKey();
|
|
533
|
-
const storage = this.getStorage();
|
|
534
|
-
const previousStorageKey = this.hydratedStorageKey();
|
|
535
|
-
|
|
536
|
-
this.storageHydrated.set(false);
|
|
537
|
-
|
|
538
|
-
if (!storageKey || !storage) {
|
|
539
|
-
this.hydratedStorageKey.set(storageKey);
|
|
540
|
-
this.storageHydrated.set(true);
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
if (previousStorageKey === storageKey) {
|
|
545
|
-
this.storageHydrated.set(true);
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
const persistedState = this.getRestorablePersistedState(
|
|
550
|
-
this.readPersistedState(storage, storageKey),
|
|
551
|
-
);
|
|
552
|
-
this.applyPersistedState(persistedState);
|
|
553
|
-
this.hydratedStorageKey.set(storageKey);
|
|
554
|
-
this.storageHydrated.set(true);
|
|
555
|
-
|
|
556
|
-
if (this.lazy() && this.shouldEmitLazyLoadAfterRestore(persistedState)) {
|
|
557
|
-
queueMicrotask(() => this.emitLazyLoad({}));
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
effect(() => {
|
|
562
|
-
const storageKey = this.getNormalizedStorageKey();
|
|
563
|
-
const storage = this.getStorage();
|
|
564
|
-
|
|
565
|
-
if (
|
|
566
|
-
!storageKey ||
|
|
567
|
-
!storage ||
|
|
568
|
-
!this.storageHydrated() ||
|
|
569
|
-
this.hydratedStorageKey() !== storageKey
|
|
570
|
-
) {
|
|
571
|
-
return;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
this.writePersistedState(storage, storageKey, this.buildPersistedState());
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
// Drop filters / groupBy whose column no longer exists. Dynamic tables
|
|
578
|
-
// (e.g. runtime schemas) can drop columns between fetches, which would
|
|
579
|
-
// otherwise strand a filter the user can't clear from the UI.
|
|
580
|
-
effect(() => {
|
|
581
|
-
const columns = this.columns();
|
|
582
|
-
if (columns.length === 0 || this.loading()) {
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
const validKeys = new Set(columns.map((c) => c.key));
|
|
587
|
-
|
|
588
|
-
const currentFilters = this.filters();
|
|
589
|
-
const staleFilterKeys = Object.keys(currentFilters).filter(
|
|
590
|
-
(key) => key !== 'generalSearch' && !validKeys.has(key),
|
|
591
|
-
);
|
|
592
|
-
if (staleFilterKeys.length > 0) {
|
|
593
|
-
const next = { ...currentFilters };
|
|
594
|
-
staleFilterKeys.forEach((key) => delete next[key]);
|
|
595
|
-
this.filters.set(next);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
const currentGroup = this.groupBy();
|
|
599
|
-
if (currentGroup && !validKeys.has(currentGroup)) {
|
|
600
|
-
this.groupBy.set(null);
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
effect(() => {
|
|
605
|
-
if (this.lazy()) {
|
|
606
|
-
return;
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
const totalRecords = this.totalRecords();
|
|
610
|
-
const pageSize = this.pageSize();
|
|
611
|
-
const currentFirst = this.first();
|
|
612
|
-
|
|
613
|
-
if (pageSize <= 0) {
|
|
614
|
-
return;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
const maxFirst =
|
|
618
|
-
totalRecords > 0
|
|
619
|
-
? Math.floor((totalRecords - 1) / pageSize) * pageSize
|
|
620
|
-
: 0;
|
|
621
|
-
const normalizedFirst = Math.min(currentFirst, maxFirst);
|
|
622
|
-
const normalizedPage = Math.floor(normalizedFirst / pageSize);
|
|
623
|
-
|
|
624
|
-
if (normalizedFirst !== currentFirst) {
|
|
625
|
-
this.first.set(normalizedFirst);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
if (this.currentPage() !== normalizedPage) {
|
|
629
|
-
this.currentPage.set(normalizedPage);
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Returns the count for a group row — uses `groupCountMap` when provided
|
|
636
|
-
* (e.g. backend KPI totals) so lazy tables show the real total instead of
|
|
637
|
-
* the current-page row count.
|
|
638
|
-
*/
|
|
639
|
-
getDisplayGroupCount(row: unknown): number {
|
|
640
|
-
const map = this.groupCountMap();
|
|
641
|
-
if (map) {
|
|
642
|
-
const label = this.grouping.getGroupLabel(row);
|
|
643
|
-
const count = map.get(label);
|
|
644
|
-
if (count !== undefined) return count;
|
|
645
|
-
}
|
|
646
|
-
return this.grouping.getGroupCount(row);
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Called when the user picks a group column from the caption's actions menu.
|
|
651
|
-
* Syncs PrimeNG grouping sort state and asks lazy tables to reload grouped
|
|
652
|
-
* rows consecutively from the backend.
|
|
653
|
-
*/
|
|
654
|
-
onGroupByChange(key: string | null): void {
|
|
655
|
-
this.groupBy.set(key);
|
|
656
|
-
|
|
657
|
-
if (key) {
|
|
658
|
-
this.sortField.set(key);
|
|
659
|
-
if (this.sortDirection() === null) {
|
|
660
|
-
this.sortDirection.set('asc');
|
|
661
|
-
}
|
|
662
|
-
} else {
|
|
663
|
-
this.sortField.set(null);
|
|
664
|
-
this.sortDirection.set(null);
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
// Grouping re-orders the whole result set, so the current offset points at
|
|
668
|
-
// unrelated rows — restart at page 1 like a filter change does.
|
|
669
|
-
this.first.set(0);
|
|
670
|
-
this.currentPage.set(0);
|
|
671
|
-
|
|
672
|
-
if (this.lazy()) {
|
|
673
|
-
queueMicrotask(() => this.emitLazyLoad({}));
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
onFilterApplied(filters: TableFilters): void {
|
|
678
|
-
this.filters.set(this.withoutGeneralSearch(filters));
|
|
679
|
-
this.first.set(0);
|
|
680
|
-
this.currentPage.set(0);
|
|
681
|
-
|
|
682
|
-
if (this.lazy()) {
|
|
683
|
-
this.emitLazyLoad({});
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
onFilterReset(): void {
|
|
688
|
-
this.filters.set({});
|
|
689
|
-
this.first.set(0);
|
|
690
|
-
this.currentPage.set(0);
|
|
691
|
-
|
|
692
|
-
if (this.lazy()) {
|
|
693
|
-
this.emitLazyLoad({});
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
protected matchesFilter(
|
|
698
|
-
item: any,
|
|
699
|
-
key: string,
|
|
700
|
-
filterValue: FilterValue | any,
|
|
701
|
-
): boolean {
|
|
702
|
-
const column = this.columns().find((col) => col.key === key);
|
|
703
|
-
return TableValueResolver.matchesFilter(item, key, filterValue, column);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
toggleRow(row: any): void {
|
|
707
|
-
const rowKey = this.getRowSelectionKey(row);
|
|
708
|
-
|
|
709
|
-
if (rowKey !== null) {
|
|
710
|
-
const nextSelection = new Set(this.selectedRowKeys());
|
|
711
|
-
if (nextSelection.has(rowKey)) {
|
|
712
|
-
nextSelection.delete(rowKey);
|
|
713
|
-
} else {
|
|
714
|
-
nextSelection.add(rowKey);
|
|
715
|
-
}
|
|
716
|
-
this.selectedRowKeys.set(nextSelection);
|
|
717
|
-
} else {
|
|
718
|
-
const nextSelection = new Set(this.transientSelectedRows());
|
|
719
|
-
if (nextSelection.has(row)) {
|
|
720
|
-
nextSelection.delete(row);
|
|
721
|
-
} else {
|
|
722
|
-
nextSelection.add(row);
|
|
723
|
-
}
|
|
724
|
-
this.transientSelectedRows.set(nextSelection);
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
this.emitSelectionChange();
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
toggleAllRowsOnPage(): void {
|
|
731
|
-
const pageData = this.paginatedData();
|
|
732
|
-
const allSelected = this.allSelectedOnPage();
|
|
733
|
-
const nextSelectedRowKeys = new Set(this.selectedRowKeys());
|
|
734
|
-
const nextTransientSelection = new Set(this.transientSelectedRows());
|
|
735
|
-
|
|
736
|
-
pageData.forEach((row) => {
|
|
737
|
-
const rowKey = this.getRowSelectionKey(row);
|
|
738
|
-
if (rowKey !== null) {
|
|
739
|
-
if (allSelected) {
|
|
740
|
-
nextSelectedRowKeys.delete(rowKey);
|
|
741
|
-
} else {
|
|
742
|
-
nextSelectedRowKeys.add(rowKey);
|
|
743
|
-
}
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
if (allSelected) {
|
|
748
|
-
nextTransientSelection.delete(row);
|
|
749
|
-
} else {
|
|
750
|
-
nextTransientSelection.add(row);
|
|
751
|
-
}
|
|
752
|
-
});
|
|
753
|
-
|
|
754
|
-
this.selectedRowKeys.set(nextSelectedRowKeys);
|
|
755
|
-
this.transientSelectedRows.set(nextTransientSelection);
|
|
756
|
-
this.emitSelectionChange();
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
getProperty(obj: any, key: string): any {
|
|
760
|
-
return TableValueResolver.getProperty(obj, key);
|
|
761
|
-
}
|
|
762
|
-
|
|
763
|
-
protected getDateProperty(
|
|
764
|
-
obj: any,
|
|
765
|
-
key: string,
|
|
766
|
-
): string | number | Date | null {
|
|
767
|
-
return TableValueResolver.resolveDateValue(this.getProperty(obj, key));
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
getEntityPreviewData(row: any, col: ColumnDef): EntityData | null {
|
|
771
|
-
const cellValue = this.getProperty(row, col.key);
|
|
772
|
-
|
|
773
|
-
if (col.type === 'user') {
|
|
774
|
-
return this.buildUserEntityData(cellValue, col.label);
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
if (col.type === 'status') {
|
|
778
|
-
return this.buildStatusEntityData(cellValue, col);
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
return null;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* Entity data resolver that abstracts over the `user` / `status` vs `entity`
|
|
786
|
-
* distinction — used by the shared filterable-cell template so the three
|
|
787
|
-
* cases don't duplicate markup.
|
|
788
|
-
*/
|
|
789
|
-
resolveCellEntityData(row: any, col: ColumnDef): EntityData | null {
|
|
790
|
-
if (col.type === 'entity') {
|
|
791
|
-
return this.getEntityColumnData(row, col);
|
|
792
|
-
}
|
|
793
|
-
if (col.type === 'user' || col.type === 'status') {
|
|
794
|
-
return this.getEntityPreviewData(row, col);
|
|
795
|
-
}
|
|
796
|
-
return null;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
tabChanged(tab: any): void {
|
|
800
|
-
this.filterTerm.set('');
|
|
801
|
-
this.first.set(0);
|
|
802
|
-
this.currentPage.set(0);
|
|
803
|
-
this.onTabChange.emit(tab);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
onTablePage(event: TablePageEvent): void {
|
|
807
|
-
if (this.lazy()) {
|
|
808
|
-
this.handleLazyLoad(event);
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
this.updatePagingFromEvent(event);
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
handleLazyLoad(event: any): void {
|
|
816
|
-
this.updatePagingFromEvent(event);
|
|
817
|
-
this.emitLazyLoad(event);
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
onPaginatorPage(event: any): void {
|
|
821
|
-
if (this.lazy()) {
|
|
822
|
-
this.handleLazyLoad(event);
|
|
823
|
-
return;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
this.updatePagingFromEvent(event);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
onSearchChange(searchTerm: string) {
|
|
830
|
-
this.filterTerm.set(searchTerm);
|
|
831
|
-
this.first.set(0);
|
|
832
|
-
this.currentPage.set(0);
|
|
833
|
-
if (this.lazy() && !this.lazyLocalSearch()) {
|
|
834
|
-
this.emitLazyLoad({});
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
toggleSort(column: ColumnDef): void {
|
|
839
|
-
if (!this.isColumnSortable(column)) {
|
|
840
|
-
return;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
if (this.sortField() !== column.key) {
|
|
844
|
-
this.sortField.set(column.key);
|
|
845
|
-
this.sortDirection.set('asc');
|
|
846
|
-
return;
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
const direction = this.sortDirection();
|
|
850
|
-
if (direction === 'asc') {
|
|
851
|
-
this.sortDirection.set('desc');
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
if (direction === 'desc') {
|
|
856
|
-
// Tri-state reset. PrimeNG subheader grouping breaks without a matching
|
|
857
|
-
// sort, so when this column is the active group we wrap to 'asc' instead.
|
|
858
|
-
if (this.grouping.isGroupLockedSort(column.key)) {
|
|
859
|
-
this.sortDirection.set('asc');
|
|
860
|
-
} else {
|
|
861
|
-
this.sortField.set(null);
|
|
862
|
-
this.sortDirection.set(null);
|
|
863
|
-
}
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
this.sortDirection.set('asc');
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
isColumnSortable(column: ColumnDef): boolean {
|
|
871
|
-
return column.sortable === true && (!this.lazy() || this.lazyLocalSort());
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
getSortIcon(column: ColumnDef): MTIcon {
|
|
875
|
-
if (this.sortField() !== column.key || !this.sortDirection()) {
|
|
876
|
-
return 'arrow.chevron-selector-vertical';
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
return this.sortDirection() === 'asc'
|
|
880
|
-
? 'arrow.arrow-up'
|
|
881
|
-
: 'arrow.arrow-down';
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
onCellChange(
|
|
885
|
-
row: any,
|
|
886
|
-
columnKey: string,
|
|
887
|
-
newValue: any,
|
|
888
|
-
type?: ColumnTypeForActionCell,
|
|
889
|
-
): void {
|
|
890
|
-
this.setProperty(row, columnKey, newValue);
|
|
891
|
-
|
|
892
|
-
this.cellChange.emit({
|
|
893
|
-
row,
|
|
894
|
-
column: columnKey,
|
|
895
|
-
value: newValue,
|
|
896
|
-
type: type!,
|
|
897
|
-
});
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
resolveActionLoading(action: TableAction, row: any): boolean | undefined {
|
|
901
|
-
if (typeof action.loading === 'function') {
|
|
902
|
-
return action.loading(row);
|
|
903
|
-
}
|
|
904
|
-
return action.loading;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
getVisibleRowActions(row: any): TableAction[] {
|
|
908
|
-
return this.rowActions().filter((action) => !action.hidden?.(row));
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
getInlineRowActions(row: any): TableAction[] {
|
|
912
|
-
return this.getVisibleRowActions(row).filter(
|
|
913
|
-
(action) => action.placement === 'inline',
|
|
914
|
-
);
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* Menu actions with the destructive ones moved to the bottom.
|
|
919
|
-
*
|
|
920
|
-
* The Risks row menu read Preview, Update Risk, **Delete Risk**, Close Risk,
|
|
921
|
-
* Transfer to Issue, Escalate — the irreversible action third of six, between
|
|
922
|
-
* the two most common ones, separated from them by nothing but its colour
|
|
923
|
-
* (finding M-07). Colour alone is not separation, and it is no separation at
|
|
924
|
-
* all for a user with a colour-vision deficiency. Order within each group is
|
|
925
|
-
* preserved, so a caller's deliberate sequence still holds.
|
|
926
|
-
*/
|
|
927
|
-
getMenuRowActions(row: any): TableAction[] {
|
|
928
|
-
const menu = this.getVisibleRowActions(row).filter(
|
|
929
|
-
(action) => action.placement !== 'inline',
|
|
930
|
-
);
|
|
931
|
-
|
|
932
|
-
return [
|
|
933
|
-
...menu.filter((action) => !Table.isDestructiveAction(action)),
|
|
934
|
-
...menu.filter((action) => Table.isDestructiveAction(action)),
|
|
935
|
-
];
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
/**
|
|
939
|
-
* True for the first destructive item, which is where the divider goes. The
|
|
940
|
-
* divider is rendered above it rather than below the last routine item so a
|
|
941
|
-
* menu that is *only* destructive does not open with a stray rule.
|
|
942
|
-
*/
|
|
943
|
-
protected isFirstDestructiveAction(row: any, index: number): boolean {
|
|
944
|
-
const menu = this.getMenuRowActions(row);
|
|
945
|
-
const action = menu[index];
|
|
946
|
-
return (
|
|
947
|
-
index > 0 &&
|
|
948
|
-
!!action &&
|
|
949
|
-
Table.isDestructiveAction(action) &&
|
|
950
|
-
!Table.isDestructiveAction(menu[index - 1])
|
|
951
|
-
);
|
|
952
|
-
}
|
|
953
|
-
|
|
954
|
-
/** Deleting, or anything the caller flagged `danger`. */
|
|
955
|
-
private static isDestructiveAction(action: TableAction | undefined): boolean {
|
|
956
|
-
if (!action) {
|
|
957
|
-
return false;
|
|
958
|
-
}
|
|
959
|
-
return (
|
|
960
|
-
action.color === 'danger' ||
|
|
961
|
-
action.confirmation?.confirmationType === 'delete'
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
shouldShowRowActionsPopover(row: any): boolean {
|
|
966
|
-
return (
|
|
967
|
-
this.isRowActionsLoading(row) || this.getMenuRowActions(row).length > 0
|
|
968
|
-
);
|
|
969
|
-
}
|
|
970
|
-
|
|
971
|
-
isRowActionsLoading(row: any): boolean {
|
|
972
|
-
return this.rowActionsLoadingFn()?.(row) ?? false;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
|
-
onRowActionsToggle(
|
|
976
|
-
event: Event,
|
|
977
|
-
popover: { toggle: (e: Event) => void },
|
|
978
|
-
row: any,
|
|
979
|
-
): void {
|
|
980
|
-
this.rowActionsRequested.emit(row);
|
|
981
|
-
popover.toggle(event);
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
onColumnReorder(event: any): void {
|
|
985
|
-
this.columnReorder.emit(event);
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
onRowReorder(event: any): void {
|
|
989
|
-
this.rowReorder.emit({
|
|
990
|
-
...event,
|
|
991
|
-
value: event.value ?? this.data(),
|
|
992
|
-
});
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
onRowClick(event: MouseEvent, row: any): void {
|
|
996
|
-
if (!this.clickableRows() || this.loading()) {
|
|
997
|
-
return;
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
const target = event.target as HTMLElement | null;
|
|
1001
|
-
if (
|
|
1002
|
-
target?.closest(
|
|
1003
|
-
'button, a, input, textarea, select, label, [role="button"], [data-row-click-ignore="true"]',
|
|
1004
|
-
)
|
|
1005
|
-
) {
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
this.rowClick.emit(row);
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
protected updatePagingFromEvent(event: any): void {
|
|
1013
|
-
const first = event?.first ?? this.first();
|
|
1014
|
-
const rows = event?.rows ?? this.pageSize();
|
|
1015
|
-
|
|
1016
|
-
this.first.set(first);
|
|
1017
|
-
this.pageSize.set(rows);
|
|
1018
|
-
|
|
1019
|
-
const page =
|
|
1020
|
-
typeof event?.page === 'number'
|
|
1021
|
-
? event.page
|
|
1022
|
-
: Math.floor((first ?? 0) / (rows || 1));
|
|
1023
|
-
|
|
1024
|
-
this.currentPage.set(page);
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
protected emitLazyLoad(event: any): void {
|
|
1028
|
-
const sortField = this.sortField();
|
|
1029
|
-
|
|
1030
|
-
this.lazyLoad.emit({
|
|
1031
|
-
...event,
|
|
1032
|
-
// Sort is always reported, and `null` explicitly means "no sort". Without
|
|
1033
|
-
// that, a host can't tell "sort unchanged" from "sort cleared" and keeps
|
|
1034
|
-
// sending a stale backend sort after the user clears it.
|
|
1035
|
-
sortField,
|
|
1036
|
-
sortOrder: sortField ? (this.sortDirection() === 'desc' ? -1 : 1) : 0,
|
|
1037
|
-
pageSize: this.pageSize(),
|
|
1038
|
-
currentPage: this.currentPage() + 1,
|
|
1039
|
-
first: this.first(),
|
|
1040
|
-
filters: this.lazyLoadFilters(),
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
private lazyLoadFilters(): TableFilters {
|
|
1045
|
-
const filters = this.withoutGeneralSearch(this.filters());
|
|
1046
|
-
const searchTerm = this.filterTerm().trim();
|
|
1047
|
-
|
|
1048
|
-
if (!searchTerm || this.lazyLocalSearch()) {
|
|
1049
|
-
return filters;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
return {
|
|
1053
|
-
...filters,
|
|
1054
|
-
generalSearch: searchTerm,
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
private withoutGeneralSearch(filters: TableFilters): TableFilters {
|
|
1059
|
-
if (!Object.prototype.hasOwnProperty.call(filters, 'generalSearch')) {
|
|
1060
|
-
return filters;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
const next = { ...filters };
|
|
1064
|
-
delete next['generalSearch'];
|
|
1065
|
-
return next;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
exportExcel(): void {
|
|
1069
|
-
if (this.loading()) {
|
|
1070
|
-
return;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
this.exportService.exportToExcel({
|
|
1074
|
-
rows: this.filteredData(),
|
|
1075
|
-
columns: this.columns(),
|
|
1076
|
-
filename: this.exportFilename(),
|
|
1077
|
-
resolveValue: (row, column) =>
|
|
1078
|
-
this.getColumnExportValue(row as any, column),
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
printPdf(): void {
|
|
1083
|
-
if (this.loading()) {
|
|
1084
|
-
return;
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
this.exportService.printPdf({
|
|
1088
|
-
rows: this.filteredData(),
|
|
1089
|
-
columns: this.columns(),
|
|
1090
|
-
filename: this.exportFilename(),
|
|
1091
|
-
title: this.printTitle() || undefined,
|
|
1092
|
-
resolveValue: (row, column) =>
|
|
1093
|
-
this.getColumnExportValue(row as any, column),
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
onCellFilterClick(event: Event, row: any, column: ColumnDef): void {
|
|
1098
|
-
if (!this.cellClickFilter()) return;
|
|
1099
|
-
|
|
1100
|
-
const next = TableValueResolver.buildClickFilterValue(row, column);
|
|
1101
|
-
if (next === null || next === undefined) return;
|
|
1102
|
-
|
|
1103
|
-
event.stopPropagation();
|
|
1104
|
-
|
|
1105
|
-
const current = this.filters();
|
|
1106
|
-
const patched: TableFilters = { ...current };
|
|
1107
|
-
if (TableValueResolver.isFilterValueEqual(current[column.key], next)) {
|
|
1108
|
-
delete patched[column.key];
|
|
1109
|
-
} else {
|
|
1110
|
-
patched[column.key] = next;
|
|
1111
|
-
}
|
|
1112
|
-
this.onFilterApplied(patched);
|
|
1113
|
-
}
|
|
1114
|
-
|
|
1115
|
-
isCellFilterActive(row: any, column: ColumnDef): boolean {
|
|
1116
|
-
if (!this.cellClickFilter()) return false;
|
|
1117
|
-
const current = this.filters()[column.key];
|
|
1118
|
-
if (current === null || current === undefined) return false;
|
|
1119
|
-
const next = TableValueResolver.buildClickFilterValue(row, column);
|
|
1120
|
-
if (next === null || next === undefined) return false;
|
|
1121
|
-
return TableValueResolver.isFilterValueEqual(current, next);
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
isCellClickFilterable(column: ColumnDef, row: unknown): boolean {
|
|
1125
|
-
if (!this.cellClickFilter()) return false;
|
|
1126
|
-
if (column.type === 'boolean') {
|
|
1127
|
-
// Editable booleans keep the toggle interaction; only readonly ones filter.
|
|
1128
|
-
return column.readonly === true;
|
|
1129
|
-
}
|
|
1130
|
-
if (column.type === 'status' || column.type === 'user') return true;
|
|
1131
|
-
if (column.type === 'entity') {
|
|
1132
|
-
const filterType = TableValueResolver.getColumnFilterType(
|
|
1133
|
-
column,
|
|
1134
|
-
row as Record<string, unknown>,
|
|
1135
|
-
);
|
|
1136
|
-
return (
|
|
1137
|
-
filterType === 'select' ||
|
|
1138
|
-
filterType === 'user' ||
|
|
1139
|
-
filterType === 'boolean'
|
|
1140
|
-
);
|
|
1141
|
-
}
|
|
1142
|
-
return false;
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
rowAction(event: Event, action: TableAction, row: any): void {
|
|
1146
|
-
if (!action.confirmation) {
|
|
1147
|
-
action.action(row);
|
|
1148
|
-
} else if (action.confirmation?.confirmationType === 'delete') {
|
|
1149
|
-
this.confirmationService.confirmDelete({
|
|
1150
|
-
event: event,
|
|
1151
|
-
...action.confirmation,
|
|
1152
|
-
accept: () => {
|
|
1153
|
-
action.action(row);
|
|
1154
|
-
},
|
|
1155
|
-
reject: () => {},
|
|
1156
|
-
});
|
|
1157
|
-
} else {
|
|
1158
|
-
this.confirmationService.confirm({
|
|
1159
|
-
event: event,
|
|
1160
|
-
...action.confirmation,
|
|
1161
|
-
accept: () => {
|
|
1162
|
-
action.action(row);
|
|
1163
|
-
},
|
|
1164
|
-
reject: () => {},
|
|
1165
|
-
});
|
|
1166
|
-
}
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
private buildUserEntityData(
|
|
1170
|
-
value: unknown,
|
|
1171
|
-
columnLabel: string,
|
|
1172
|
-
): EntityData | null {
|
|
1173
|
-
if (!value) return null;
|
|
1174
|
-
|
|
1175
|
-
// Some APIs return `image` instead of the `photoUrl` expected by EntityUserValue.
|
|
1176
|
-
// Normalize here so the entity-user component always receives `photoUrl`.
|
|
1177
|
-
const normalizedValue =
|
|
1178
|
-
typeof value === 'object' && !('photoUrl' in value) && 'image' in value
|
|
1179
|
-
? {
|
|
1180
|
-
...(value as Record<string, unknown>),
|
|
1181
|
-
photoUrl: (value as Record<string, unknown>)['image'],
|
|
1182
|
-
}
|
|
1183
|
-
: value;
|
|
1184
|
-
|
|
1185
|
-
return {
|
|
1186
|
-
name: columnLabel,
|
|
1187
|
-
viewType: 'User',
|
|
1188
|
-
value: normalizedValue,
|
|
1189
|
-
configuration: {
|
|
1190
|
-
hideLabel: true,
|
|
1191
|
-
showDisplayName: true,
|
|
1192
|
-
showPhoneNumber: false,
|
|
1193
|
-
showEmail: false,
|
|
1194
|
-
},
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
private buildStatusEntityData(value: unknown, column: ColumnDef): EntityData {
|
|
1199
|
-
const statusValue = this.resolveStatusValue(value, column);
|
|
1200
|
-
|
|
1201
|
-
return {
|
|
1202
|
-
name: column.label,
|
|
1203
|
-
viewType: 'Status',
|
|
1204
|
-
value: statusValue ?? '',
|
|
1205
|
-
configuration: {
|
|
1206
|
-
hideName: true,
|
|
1207
|
-
},
|
|
1208
|
-
};
|
|
1209
|
-
}
|
|
1210
|
-
|
|
1211
|
-
private resolveStatusValue(
|
|
1212
|
-
value: unknown,
|
|
1213
|
-
column?: ColumnDef,
|
|
1214
|
-
): EntityStatusValue | null {
|
|
1215
|
-
const unwrappedValue = this.unwrapStatusValue(value, column);
|
|
1216
|
-
if (
|
|
1217
|
-
unwrappedValue === null ||
|
|
1218
|
-
unwrappedValue === undefined ||
|
|
1219
|
-
unwrappedValue === ''
|
|
1220
|
-
) {
|
|
1221
|
-
return null;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
if (typeof unwrappedValue === 'object') {
|
|
1225
|
-
const objectValue = unwrappedValue as Record<string, unknown>;
|
|
1226
|
-
const statusKey =
|
|
1227
|
-
this.readStringProperty(objectValue, 'key') ??
|
|
1228
|
-
this.readStringProperty(objectValue, 'code') ??
|
|
1229
|
-
this.readStringProperty(objectValue, 'value') ??
|
|
1230
|
-
this.readStringProperty(objectValue, 'id') ??
|
|
1231
|
-
this.readStringProperty(objectValue, 'display') ??
|
|
1232
|
-
this.readStringProperty(objectValue, 'displayValue') ??
|
|
1233
|
-
this.readStringProperty(objectValue, 'displayName') ??
|
|
1234
|
-
this.readStringProperty(objectValue, 'label') ??
|
|
1235
|
-
this.readStringProperty(objectValue, 'name');
|
|
1236
|
-
const mappedStatus = this.resolveStatusMapValue(column, statusKey);
|
|
1237
|
-
const display =
|
|
1238
|
-
this.readStringProperty(objectValue, 'display') ??
|
|
1239
|
-
this.readStringProperty(objectValue, 'displayValue') ??
|
|
1240
|
-
this.readStringProperty(objectValue, 'displayName') ??
|
|
1241
|
-
this.readStringProperty(objectValue, 'label') ??
|
|
1242
|
-
this.readStringProperty(objectValue, 'name') ??
|
|
1243
|
-
mappedStatus?.display ??
|
|
1244
|
-
statusKey;
|
|
1245
|
-
|
|
1246
|
-
if (!display) {
|
|
1247
|
-
return null;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
return {
|
|
1251
|
-
key: statusKey ?? display,
|
|
1252
|
-
display,
|
|
1253
|
-
color:
|
|
1254
|
-
this.readStringProperty(objectValue, 'color') ??
|
|
1255
|
-
mappedStatus?.color ??
|
|
1256
|
-
this.resolveDefaultStatusColor(statusKey ?? display),
|
|
1257
|
-
description:
|
|
1258
|
-
this.readStringProperty(objectValue, 'description') ??
|
|
1259
|
-
mappedStatus?.description,
|
|
1260
|
-
};
|
|
1261
|
-
}
|
|
1262
|
-
|
|
1263
|
-
const normalizedValue =
|
|
1264
|
-
TableValueResolver.resolveDisplayValue(unwrappedValue);
|
|
1265
|
-
if (normalizedValue === null || normalizedValue === undefined) {
|
|
1266
|
-
return null;
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
const statusKey = String(normalizedValue);
|
|
1270
|
-
const mappedStatus = this.resolveStatusMapValue(column, statusKey);
|
|
1271
|
-
|
|
1272
|
-
return {
|
|
1273
|
-
key: statusKey,
|
|
1274
|
-
display: mappedStatus?.display ?? statusKey,
|
|
1275
|
-
color: mappedStatus?.color ?? this.resolveDefaultStatusColor(statusKey),
|
|
1276
|
-
description: mappedStatus?.description,
|
|
1277
|
-
};
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
private unwrapStatusValue(value: unknown, column?: ColumnDef): unknown {
|
|
1281
|
-
if (!value || typeof value !== 'object') {
|
|
1282
|
-
return value;
|
|
1283
|
-
}
|
|
1284
|
-
|
|
1285
|
-
const entityValue = value as Partial<EntityData>;
|
|
1286
|
-
if (!('value' in (value as Record<string, unknown>))) {
|
|
1287
|
-
return value;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
if (
|
|
1291
|
-
entityValue.viewType === 'Status' ||
|
|
1292
|
-
this.isEntityStatusCompatibilityColumn(column)
|
|
1293
|
-
) {
|
|
1294
|
-
return entityValue.value;
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1297
|
-
return value;
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
private isEntityStatusCompatibilityColumn(
|
|
1301
|
-
column: ColumnDef | undefined,
|
|
1302
|
-
): boolean {
|
|
1303
|
-
return column?.type === 'entity' && this.isStatusColumnKey(column.key);
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
private isStatusColumnKey(key: string | null | undefined): boolean {
|
|
1307
|
-
return typeof key === 'string' && key.trim().toLowerCase() === 'status';
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
private resolveStatusMapValue(
|
|
1311
|
-
column: ColumnDef | undefined,
|
|
1312
|
-
key: string | null | undefined,
|
|
1313
|
-
) {
|
|
1314
|
-
if (!column?.statusMap || !key) {
|
|
1315
|
-
return undefined;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
const directMatch = column.statusMap[key];
|
|
1319
|
-
if (directMatch) {
|
|
1320
|
-
return directMatch;
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
const normalizedKey = this.normalizeStatusToken(key);
|
|
1324
|
-
return Object.entries(column.statusMap).find(
|
|
1325
|
-
([entryKey]) => this.normalizeStatusToken(entryKey) === normalizedKey,
|
|
1326
|
-
)?.[1];
|
|
1327
|
-
}
|
|
1328
|
-
|
|
1329
|
-
private resolveDefaultStatusColor(value: string): string {
|
|
1330
|
-
const normalizedValue = this.normalizeStatusToken(value);
|
|
1331
|
-
|
|
1332
|
-
if (
|
|
1333
|
-
[
|
|
1334
|
-
'active',
|
|
1335
|
-
'approved',
|
|
1336
|
-
'completed',
|
|
1337
|
-
'create',
|
|
1338
|
-
'created',
|
|
1339
|
-
'done',
|
|
1340
|
-
'enabled',
|
|
1341
|
-
'healthy',
|
|
1342
|
-
'low',
|
|
1343
|
-
'open',
|
|
1344
|
-
'published',
|
|
1345
|
-
'runtime',
|
|
1346
|
-
'success',
|
|
1347
|
-
'succeeded',
|
|
1348
|
-
].includes(normalizedValue)
|
|
1349
|
-
) {
|
|
1350
|
-
return '#047857';
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
if (
|
|
1354
|
-
[
|
|
1355
|
-
'change',
|
|
1356
|
-
'current',
|
|
1357
|
-
'draft',
|
|
1358
|
-
'inprogress',
|
|
1359
|
-
'info',
|
|
1360
|
-
'medium',
|
|
1361
|
-
'process',
|
|
1362
|
-
'progress',
|
|
1363
|
-
'running',
|
|
1364
|
-
'update',
|
|
1365
|
-
'updated',
|
|
1366
|
-
].includes(normalizedValue)
|
|
1367
|
-
) {
|
|
1368
|
-
return '#0369a1';
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
if (
|
|
1372
|
-
[
|
|
1373
|
-
'bulkupdate',
|
|
1374
|
-
'comment',
|
|
1375
|
-
'configure',
|
|
1376
|
-
'configured',
|
|
1377
|
-
'controlpanel',
|
|
1378
|
-
'discussion',
|
|
1379
|
-
].includes(normalizedValue)
|
|
1380
|
-
) {
|
|
1381
|
-
return '#4338ca';
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
if (
|
|
1385
|
-
[
|
|
1386
|
-
'awaiting',
|
|
1387
|
-
'escalation',
|
|
1388
|
-
'high',
|
|
1389
|
-
'hold',
|
|
1390
|
-
'move',
|
|
1391
|
-
'moved',
|
|
1392
|
-
'pending',
|
|
1393
|
-
'phasegate',
|
|
1394
|
-
'queued',
|
|
1395
|
-
'warning',
|
|
1396
|
-
].includes(normalizedValue)
|
|
1397
|
-
) {
|
|
1398
|
-
return '#b45309';
|
|
1399
|
-
}
|
|
1400
|
-
|
|
1401
|
-
if (
|
|
1402
|
-
[
|
|
1403
|
-
'blocked',
|
|
1404
|
-
'cancelled',
|
|
1405
|
-
'canceled',
|
|
1406
|
-
'close',
|
|
1407
|
-
'closed',
|
|
1408
|
-
'critical',
|
|
1409
|
-
'delete',
|
|
1410
|
-
'deleted',
|
|
1411
|
-
'error',
|
|
1412
|
-
'failed',
|
|
1413
|
-
'governance',
|
|
1414
|
-
'inactive',
|
|
1415
|
-
'rejected',
|
|
1416
|
-
].includes(normalizedValue)
|
|
1417
|
-
) {
|
|
1418
|
-
return '#be123c';
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
return '#475569';
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
private normalizeStatusToken(value: string): string {
|
|
1425
|
-
return value
|
|
1426
|
-
.trim()
|
|
1427
|
-
.toLocaleLowerCase()
|
|
1428
|
-
.replace(/[\s_-]+/g, '');
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
private readStringProperty(
|
|
1432
|
-
value: Record<string, unknown>,
|
|
1433
|
-
key: string,
|
|
1434
|
-
): string | null {
|
|
1435
|
-
const propertyValue = value[key];
|
|
1436
|
-
return typeof propertyValue === 'string' && propertyValue.trim().length > 0
|
|
1437
|
-
? propertyValue.trim()
|
|
1438
|
-
: null;
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
/**
|
|
1442
|
-
* Gets the entity data for an 'entity' type column.
|
|
1443
|
-
* The row data is expected to already be in EntityData format.
|
|
1444
|
-
* Automatically hides entity name and configures User entities
|
|
1445
|
-
* to show only avatar + displayName.
|
|
1446
|
-
*/
|
|
1447
|
-
getEntityColumnData(row: any, col: ColumnDef): EntityData | null {
|
|
1448
|
-
const cellValue = this.getProperty(row, col.key);
|
|
1449
|
-
if (!cellValue || typeof cellValue !== 'object') return null;
|
|
1450
|
-
|
|
1451
|
-
const entityData = cellValue as EntityData;
|
|
1452
|
-
|
|
1453
|
-
if (this.isEntityStatusCompatibilityColumn(col)) {
|
|
1454
|
-
return this.buildStatusEntityData(cellValue, col);
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
// For User entities: show avatar + displayName only
|
|
1458
|
-
if (entityData.viewType === 'User') {
|
|
1459
|
-
return {
|
|
1460
|
-
...entityData,
|
|
1461
|
-
configuration: {
|
|
1462
|
-
...entityData.configuration,
|
|
1463
|
-
hideName: true,
|
|
1464
|
-
showDisplayName: true,
|
|
1465
|
-
showPhoneNumber: false,
|
|
1466
|
-
showEmail: false,
|
|
1467
|
-
},
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
// For all other entities: hide the name label
|
|
1472
|
-
return {
|
|
1473
|
-
...entityData,
|
|
1474
|
-
configuration: {
|
|
1475
|
-
...entityData.configuration,
|
|
1476
|
-
hideName: true,
|
|
1477
|
-
},
|
|
1478
|
-
};
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
protected getStatusEntityAccentColor(
|
|
1482
|
-
row: Record<string, unknown>,
|
|
1483
|
-
): string | null {
|
|
1484
|
-
const statusColumn = this.columns().find((column) =>
|
|
1485
|
-
this.isStatusColumnKey(column.key),
|
|
1486
|
-
);
|
|
1487
|
-
if (!statusColumn) {
|
|
1488
|
-
return null;
|
|
1489
|
-
}
|
|
1490
|
-
|
|
1491
|
-
return this.resolveStatusEntityAccentColor(
|
|
1492
|
-
this.getProperty(row, statusColumn.key),
|
|
1493
|
-
statusColumn,
|
|
1494
|
-
);
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
private resolveStatusEntityAccentColor(
|
|
1498
|
-
value: unknown,
|
|
1499
|
-
column?: ColumnDef,
|
|
1500
|
-
): string | null {
|
|
1501
|
-
return this.resolveStatusValue(value, column)?.color ?? null;
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
protected getBooleanProperty(obj: any, key: string): boolean {
|
|
1505
|
-
const value = this.getProperty(obj, key);
|
|
1506
|
-
|
|
1507
|
-
if (typeof value === 'boolean') {
|
|
1508
|
-
return value;
|
|
1509
|
-
}
|
|
1510
|
-
|
|
1511
|
-
return TableValueResolver.resolveBooleanValue(value) ?? false;
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
private setProperty(obj: any, key: string, value: any): void {
|
|
1515
|
-
const path = key.split('.');
|
|
1516
|
-
const lastKey = path.pop();
|
|
1517
|
-
|
|
1518
|
-
if (!lastKey) {
|
|
1519
|
-
return;
|
|
1520
|
-
}
|
|
1521
|
-
|
|
1522
|
-
const target = path.reduce((current, segment) => {
|
|
1523
|
-
if (!current?.[segment] || typeof current[segment] !== 'object') {
|
|
1524
|
-
current[segment] = {};
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
return current[segment];
|
|
1528
|
-
}, obj);
|
|
1529
|
-
|
|
1530
|
-
if (target && typeof target === 'object') {
|
|
1531
|
-
target[lastKey] = value;
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
|
|
1535
|
-
private sortData(data: any[]): any[] {
|
|
1536
|
-
const field = this.sortField();
|
|
1537
|
-
const direction = this.sortDirection();
|
|
1538
|
-
|
|
1539
|
-
if (!field || !direction) {
|
|
1540
|
-
return data;
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
const column = this.columns().find((item) => item.key === field);
|
|
1544
|
-
if (!column || !this.isColumnSortable(column)) {
|
|
1545
|
-
return data;
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
return [...data].sort((leftRow, rightRow) => {
|
|
1549
|
-
const leftValue = this.getSortValue(leftRow, column);
|
|
1550
|
-
const rightValue = this.getSortValue(rightRow, column);
|
|
1551
|
-
|
|
1552
|
-
if (leftValue === rightValue) return 0;
|
|
1553
|
-
if (leftValue === null || leftValue === undefined || leftValue === '') {
|
|
1554
|
-
return 1;
|
|
1555
|
-
}
|
|
1556
|
-
if (
|
|
1557
|
-
rightValue === null ||
|
|
1558
|
-
rightValue === undefined ||
|
|
1559
|
-
rightValue === ''
|
|
1560
|
-
) {
|
|
1561
|
-
return -1;
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
const comparison = leftValue < rightValue ? -1 : 1;
|
|
1565
|
-
return direction === 'asc' ? comparison : -comparison;
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
private getSortValue(
|
|
1570
|
-
row: Record<string, unknown>,
|
|
1571
|
-
column: ColumnDef,
|
|
1572
|
-
): string | number | null {
|
|
1573
|
-
const cellValue = this.getProperty(row, column.key);
|
|
1574
|
-
const resolvedValue = this.getColumnResolvedValue(row, column);
|
|
1575
|
-
|
|
1576
|
-
if (
|
|
1577
|
-
resolvedValue === null ||
|
|
1578
|
-
resolvedValue === undefined ||
|
|
1579
|
-
resolvedValue === ''
|
|
1580
|
-
) {
|
|
1581
|
-
return null;
|
|
1582
|
-
}
|
|
1583
|
-
|
|
1584
|
-
if (column.type === 'date' || column.type === 'dateTime') {
|
|
1585
|
-
return TableValueResolver.normalizeDateSortValue(cellValue);
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
if (typeof resolvedValue === 'number') {
|
|
1589
|
-
return resolvedValue;
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
if (typeof resolvedValue === 'boolean') {
|
|
1593
|
-
return resolvedValue ? 1 : 0;
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
if (cellValue instanceof Date) {
|
|
1597
|
-
return cellValue.getTime();
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
return TableValueResolver.normalizeTextSortValue(resolvedValue);
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
/**
|
|
1604
|
-
* Export/print value resolver — same pipeline as `getColumnResolvedValue`
|
|
1605
|
-
* except date / dateTime columns (and their entity counterparts) are
|
|
1606
|
-
* formatted via the MT date pipe so Excel and PDF show locale-aware dates
|
|
1607
|
-
* instead of raw ISO strings. Sort path keeps the ISO form for ordering.
|
|
1608
|
-
*/
|
|
1609
|
-
private getColumnExportValue(
|
|
1610
|
-
row: Record<string, unknown>,
|
|
1611
|
-
column: ColumnDef,
|
|
1612
|
-
): string | number | boolean | null {
|
|
1613
|
-
const cellValue = this.getProperty(row, column.key);
|
|
1614
|
-
if (cellValue === null || cellValue === undefined) return null;
|
|
1615
|
-
|
|
1616
|
-
const dateType = this.resolveDateColumnType(column, row);
|
|
1617
|
-
if (dateType) {
|
|
1618
|
-
const dateValue = TableValueResolver.resolveDateValue(
|
|
1619
|
-
column.type === 'entity'
|
|
1620
|
-
? TableValueResolver.getEntityValueByType(cellValue, 'sort')
|
|
1621
|
-
: cellValue,
|
|
1622
|
-
);
|
|
1623
|
-
if (dateValue === null) return null;
|
|
1624
|
-
const formatted = this.dateFormat.transform(dateValue, dateType);
|
|
1625
|
-
return formatted || null;
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
return this.getColumnResolvedValue(row, column);
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
/**
|
|
1632
|
-
* Detects whether a column should be treated as a date for export purposes:
|
|
1633
|
-
* native `date` / `dateTime` types, or entity columns whose viewType is
|
|
1634
|
-
* `Date` / `DateTime` / `Time`.
|
|
1635
|
-
*/
|
|
1636
|
-
private resolveDateColumnType(
|
|
1637
|
-
column: ColumnDef,
|
|
1638
|
-
row: Record<string, unknown>,
|
|
1639
|
-
): MTDateFormatType | null {
|
|
1640
|
-
if (column.type === 'date') return 'date';
|
|
1641
|
-
if (column.type === 'dateTime') return 'dateTime';
|
|
1642
|
-
if (column.type === 'entity') {
|
|
1643
|
-
// `Time` is resolved ahead of the filter gate below: it is deliberately
|
|
1644
|
-
// not filterable, but it still has to export as a formatted clock time
|
|
1645
|
-
// rather than the raw stored value.
|
|
1646
|
-
if (TableValueResolver.getEntityViewType(column, row) === 'Time') {
|
|
1647
|
-
return 'time';
|
|
1648
|
-
}
|
|
1649
|
-
const filterType = TableValueResolver.getColumnFilterType(column, row);
|
|
1650
|
-
if (filterType !== 'date') return null;
|
|
1651
|
-
const viewType = (column as { viewType?: unknown }).viewType;
|
|
1652
|
-
if (
|
|
1653
|
-
typeof viewType === 'string' &&
|
|
1654
|
-
viewType.toLowerCase() === 'datetime'
|
|
1655
|
-
) {
|
|
1656
|
-
return 'dateTime';
|
|
1657
|
-
}
|
|
1658
|
-
const cellValue = this.getProperty(row, column.key);
|
|
1659
|
-
if (
|
|
1660
|
-
cellValue &&
|
|
1661
|
-
typeof cellValue === 'object' &&
|
|
1662
|
-
(cellValue as { viewType?: string }).viewType === 'DateTime'
|
|
1663
|
-
) {
|
|
1664
|
-
return 'dateTime';
|
|
1665
|
-
}
|
|
1666
|
-
return 'date';
|
|
1667
|
-
}
|
|
1668
|
-
return null;
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
private getColumnResolvedValue(
|
|
1672
|
-
row: Record<string, unknown>,
|
|
1673
|
-
column: ColumnDef,
|
|
1674
|
-
): string | number | boolean | null {
|
|
1675
|
-
const cellValue = this.getProperty(row, column.key);
|
|
1676
|
-
|
|
1677
|
-
if (cellValue === null || cellValue === undefined) {
|
|
1678
|
-
return null;
|
|
1679
|
-
}
|
|
1680
|
-
|
|
1681
|
-
if (column.type === 'entity') {
|
|
1682
|
-
return TableValueResolver.getEntityValueByType(cellValue, 'export');
|
|
1683
|
-
}
|
|
1684
|
-
|
|
1685
|
-
if (column.type === 'boolean') {
|
|
1686
|
-
return this.getBooleanProperty(row, column.key);
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
if (column.type === 'date' || column.type === 'dateTime') {
|
|
1690
|
-
const dateValue = TableValueResolver.resolveDateValue(cellValue);
|
|
1691
|
-
return dateValue instanceof Date ? dateValue.toISOString() : dateValue;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
if (typeof cellValue === 'number' || typeof cellValue === 'boolean') {
|
|
1695
|
-
return cellValue;
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
if (cellValue instanceof Date) {
|
|
1699
|
-
return cellValue.toISOString();
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
return TableValueResolver.resolveDisplayValue(cellValue);
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
protected isRowSelected(row: Record<string, unknown>): boolean {
|
|
1706
|
-
const rowKey = this.getRowSelectionKey(row);
|
|
1707
|
-
|
|
1708
|
-
if (rowKey !== null) {
|
|
1709
|
-
return this.selectedRowKeys().has(rowKey);
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
return this.transientSelectedRows().has(row);
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
/**
|
|
1716
|
-
* Types whose rendered width is bounded by their own shape — a date, a
|
|
1717
|
-
* yes/no, an avatar, a status chip. They get sized to content so the columns
|
|
1718
|
-
* that hold real text absorb the leftover width instead (finding M-05).
|
|
1719
|
-
*/
|
|
1720
|
-
private static readonly SHRINK_TO_CONTENT_TYPES: ReadonlySet<string> =
|
|
1721
|
-
new Set(['date', 'dateTime', 'boolean', 'number', 'user', 'status']);
|
|
1722
|
-
|
|
1723
|
-
/**
|
|
1724
|
-
* Alignment class for a column's header and cells. Numbers align to the end
|
|
1725
|
-
* with tabular figures so the digits line up down the column; everything else
|
|
1726
|
-
* keeps the reading direction.
|
|
1727
|
-
*/
|
|
1728
|
-
protected getColumnAlignClass(column: ColumnDef): string {
|
|
1729
|
-
const align = column.align ?? (column.type === 'number' ? 'end' : 'start');
|
|
1730
|
-
if (align === 'end') {
|
|
1731
|
-
return 'text-end tabular-nums';
|
|
1732
|
-
}
|
|
1733
|
-
return align === 'center' ? 'text-center' : 'text-start';
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
/**
|
|
1737
|
-
* `width: 1%` is the shrink-to-content idiom for an auto-layout table: the
|
|
1738
|
-
* browser treats it as a floor, gives the column exactly what its content
|
|
1739
|
-
* needs, and hands the remainder to the columns that asked for nothing. An
|
|
1740
|
-
* explicit `width` on the column always wins.
|
|
1741
|
-
*/
|
|
1742
|
-
protected getColumnWidth(column: ColumnDef): string | null {
|
|
1743
|
-
if (column.width) {
|
|
1744
|
-
return column.width;
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
const shrink =
|
|
1748
|
-
column.shrink ?? Table.SHRINK_TO_CONTENT_TYPES.has(column.type ?? 'text');
|
|
1749
|
-
return shrink ? '1%' : null;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
protected getColumnMinWidth(column: ColumnDef): string | null {
|
|
1753
|
-
const width = column.width?.trim();
|
|
1754
|
-
if (!width || width.endsWith('%')) {
|
|
1755
|
-
return null;
|
|
1756
|
-
}
|
|
1757
|
-
|
|
1758
|
-
return width;
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
|
-
private emitSelectionChange(): void {
|
|
1762
|
-
this.selectionChange.emit(this.getSelectedRows());
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
private getSelectedRows(): any[] {
|
|
1766
|
-
const dataKey = this.dataKey();
|
|
1767
|
-
if (!dataKey) {
|
|
1768
|
-
return Array.from(this.transientSelectedRows());
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
const selectedRowKeys = this.selectedRowKeys();
|
|
1772
|
-
return this.data().filter((row) => {
|
|
1773
|
-
const rowKey = this.getRowSelectionKey(row);
|
|
1774
|
-
return rowKey !== null && selectedRowKeys.has(rowKey);
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
private getRowSelectionKey(row: Record<string, unknown>): string | null {
|
|
1779
|
-
const dataKey = this.dataKey();
|
|
1780
|
-
if (!dataKey) {
|
|
1781
|
-
return null;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
1784
|
-
const value = this.getProperty(row, dataKey);
|
|
1785
|
-
if (value === null || value === undefined || value === '') {
|
|
1786
|
-
return null;
|
|
1787
|
-
}
|
|
1788
|
-
|
|
1789
|
-
return String(value);
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
private getNormalizedStorageKey(): string | null {
|
|
1793
|
-
const storageKey = this.storageKey()?.trim();
|
|
1794
|
-
return storageKey ? storageKey : null;
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
private getStorage(): Storage | null {
|
|
1798
|
-
if (typeof window === 'undefined') {
|
|
1799
|
-
return null;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
return this.storageMode() === 'session'
|
|
1803
|
-
? window.sessionStorage
|
|
1804
|
-
: window.localStorage;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
private buildPersistedState(): PersistedTableState {
|
|
1808
|
-
const state: PersistedTableState = {};
|
|
1809
|
-
|
|
1810
|
-
if (this.shouldPersistStateKey('pageSize')) {
|
|
1811
|
-
state.pageSize = this.pageSize();
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
if (this.shouldPersistStateKey('pagePosition')) {
|
|
1815
|
-
state.first = this.first();
|
|
1816
|
-
state.currentPage = this.currentPage();
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
if (this.shouldPersistStateKey('sort')) {
|
|
1820
|
-
state.sortField = this.sortField();
|
|
1821
|
-
state.sortDirection = this.sortDirection();
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
if (this.shouldPersistStateKey('selection')) {
|
|
1825
|
-
state.selectedRowKeys = this.dataKey()
|
|
1826
|
-
? Array.from(this.selectedRowKeys())
|
|
1827
|
-
: [];
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
if (this.shouldPersistStateKey('groupBy')) {
|
|
1831
|
-
state.groupBy = this.groupBy();
|
|
1832
|
-
}
|
|
1833
|
-
|
|
1834
|
-
return state;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
private applyPersistedState(
|
|
1838
|
-
persistedState: PersistedTableState | null,
|
|
1839
|
-
): void {
|
|
1840
|
-
this.transientSelectedRows.set(new Set());
|
|
1841
|
-
|
|
1842
|
-
if (!persistedState) {
|
|
1843
|
-
this.selectedRowKeys.set(new Set());
|
|
1844
|
-
return;
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
const pageSize = this.shouldPersistStateKey('pageSize')
|
|
1848
|
-
? this.normalizePersistedPageSize(
|
|
1849
|
-
this.toPositiveInteger(persistedState.pageSize),
|
|
1850
|
-
)
|
|
1851
|
-
: null;
|
|
1852
|
-
if (pageSize !== null) {
|
|
1853
|
-
this.pageSize.set(pageSize);
|
|
1854
|
-
}
|
|
1855
|
-
|
|
1856
|
-
if (this.shouldPersistStateKey('pagePosition')) {
|
|
1857
|
-
const first = this.toNonNegativeInteger(persistedState.first);
|
|
1858
|
-
if (first !== null) {
|
|
1859
|
-
this.first.set(first);
|
|
1860
|
-
}
|
|
1861
|
-
|
|
1862
|
-
const currentPage = this.toNonNegativeInteger(persistedState.currentPage);
|
|
1863
|
-
if (currentPage !== null) {
|
|
1864
|
-
this.currentPage.set(currentPage);
|
|
1865
|
-
} else if (first !== null && pageSize !== null) {
|
|
1866
|
-
this.currentPage.set(Math.floor(first / pageSize));
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
|
|
1870
|
-
if (this.shouldPersistStateKey('sort')) {
|
|
1871
|
-
this.sortField.set(
|
|
1872
|
-
typeof persistedState.sortField === 'string'
|
|
1873
|
-
? persistedState.sortField
|
|
1874
|
-
: null,
|
|
1875
|
-
);
|
|
1876
|
-
|
|
1877
|
-
this.sortDirection.set(
|
|
1878
|
-
persistedState.sortDirection === 'asc' ||
|
|
1879
|
-
persistedState.sortDirection === 'desc'
|
|
1880
|
-
? persistedState.sortDirection
|
|
1881
|
-
: null,
|
|
1882
|
-
);
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
if (this.shouldPersistStateKey('selection')) {
|
|
1886
|
-
this.selectedRowKeys.set(
|
|
1887
|
-
new Set(
|
|
1888
|
-
Array.isArray(persistedState.selectedRowKeys)
|
|
1889
|
-
? persistedState.selectedRowKeys
|
|
1890
|
-
: [],
|
|
1891
|
-
),
|
|
1892
|
-
);
|
|
1893
|
-
}
|
|
1894
|
-
|
|
1895
|
-
if (this.shouldPersistStateKey('groupBy')) {
|
|
1896
|
-
this.groupBy.set(
|
|
1897
|
-
typeof persistedState.groupBy === 'string' && persistedState.groupBy
|
|
1898
|
-
? persistedState.groupBy
|
|
1899
|
-
: null,
|
|
1900
|
-
);
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
|
|
1904
|
-
private shouldEmitLazyLoadAfterRestore(
|
|
1905
|
-
persistedState: PersistedTableState | null,
|
|
1906
|
-
): boolean {
|
|
1907
|
-
if (!persistedState) {
|
|
1908
|
-
return false;
|
|
1909
|
-
}
|
|
1910
|
-
|
|
1911
|
-
return (
|
|
1912
|
-
(this.shouldPersistStateKey('pageSize') &&
|
|
1913
|
-
persistedState.pageSize !== undefined) ||
|
|
1914
|
-
(this.shouldPersistStateKey('pagePosition') &&
|
|
1915
|
-
(persistedState.first !== undefined ||
|
|
1916
|
-
persistedState.currentPage !== undefined))
|
|
1917
|
-
);
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
private shouldPersistStateKey(key: TablePersistStateKey): boolean {
|
|
1921
|
-
const excluded = this.persistStateExclude();
|
|
1922
|
-
return !(
|
|
1923
|
-
Array.isArray(excluded) ? excluded : DEFAULT_PERSIST_STATE_EXCLUDE
|
|
1924
|
-
).includes(key);
|
|
1925
|
-
}
|
|
1926
|
-
|
|
1927
|
-
private readPersistedState(
|
|
1928
|
-
storage: Storage,
|
|
1929
|
-
storageKey: string,
|
|
1930
|
-
): PersistedTableState | null {
|
|
1931
|
-
try {
|
|
1932
|
-
const raw = storage.getItem(storageKey);
|
|
1933
|
-
if (!raw) {
|
|
1934
|
-
return null;
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
const parsed = JSON.parse(raw) as PersistedTableState;
|
|
1938
|
-
return parsed && typeof parsed === 'object' ? parsed : null;
|
|
1939
|
-
} catch {
|
|
1940
|
-
return null;
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
private getRestorablePersistedState(
|
|
1945
|
-
persistedState: PersistedTableState | null,
|
|
1946
|
-
): PersistedTableState | null {
|
|
1947
|
-
if (!persistedState) {
|
|
1948
|
-
return null;
|
|
1949
|
-
}
|
|
1950
|
-
|
|
1951
|
-
const restorableState: PersistedTableState = {};
|
|
1952
|
-
|
|
1953
|
-
if (this.shouldPersistStateKey('pageSize')) {
|
|
1954
|
-
restorableState.pageSize = persistedState.pageSize;
|
|
1955
|
-
}
|
|
1956
|
-
|
|
1957
|
-
if (this.shouldPersistStateKey('pagePosition')) {
|
|
1958
|
-
restorableState.first = persistedState.first;
|
|
1959
|
-
restorableState.currentPage = persistedState.currentPage;
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
if (this.shouldPersistStateKey('sort')) {
|
|
1963
|
-
restorableState.sortField = persistedState.sortField;
|
|
1964
|
-
restorableState.sortDirection = persistedState.sortDirection;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
if (this.shouldPersistStateKey('selection')) {
|
|
1968
|
-
restorableState.selectedRowKeys = persistedState.selectedRowKeys;
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
if (this.shouldPersistStateKey('groupBy')) {
|
|
1972
|
-
restorableState.groupBy = persistedState.groupBy;
|
|
1973
|
-
}
|
|
1974
|
-
|
|
1975
|
-
return Object.keys(restorableState).some(
|
|
1976
|
-
(key) => restorableState[key as keyof PersistedTableState] !== undefined,
|
|
1977
|
-
)
|
|
1978
|
-
? restorableState
|
|
1979
|
-
: null;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
private writePersistedState(
|
|
1983
|
-
storage: Storage,
|
|
1984
|
-
storageKey: string,
|
|
1985
|
-
state: PersistedTableState,
|
|
1986
|
-
): void {
|
|
1987
|
-
try {
|
|
1988
|
-
storage.setItem(storageKey, JSON.stringify(state));
|
|
1989
|
-
} catch {
|
|
1990
|
-
// Ignore storage write failures.
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
private toPositiveInteger(value: unknown): number | null {
|
|
1995
|
-
const normalized = Number(value);
|
|
1996
|
-
if (!Number.isFinite(normalized) || normalized <= 0) {
|
|
1997
|
-
return null;
|
|
1998
|
-
}
|
|
1999
|
-
|
|
2000
|
-
return Math.trunc(normalized);
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
private normalizePersistedPageSize(value: number | null): number | null {
|
|
2004
|
-
if (value === null) {
|
|
2005
|
-
return null;
|
|
2006
|
-
}
|
|
2007
|
-
|
|
2008
|
-
const allowedOptions = this.rowsPerPageOptions().filter(
|
|
2009
|
-
(option) => Number.isFinite(option) && option > 0,
|
|
2010
|
-
);
|
|
2011
|
-
|
|
2012
|
-
if (!allowedOptions.length) {
|
|
2013
|
-
return value;
|
|
2014
|
-
}
|
|
2015
|
-
|
|
2016
|
-
return allowedOptions.includes(value) ? value : allowedOptions[0]!;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
private resolveScrollHeightPixels(value: string): number | null {
|
|
2020
|
-
const normalized = value.trim().toLowerCase();
|
|
2021
|
-
const match = normalized.match(/^(\d+(?:\.\d+)?)(px|rem)$/);
|
|
2022
|
-
if (!match) {
|
|
2023
|
-
return null;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
const amount = Number(match[1]);
|
|
2027
|
-
if (!Number.isFinite(amount) || amount <= 0) {
|
|
2028
|
-
return null;
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
return match[2] === 'rem' ? amount * 16 : amount;
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
private toNonNegativeInteger(value: unknown): number | null {
|
|
2035
|
-
const normalized = Number(value);
|
|
2036
|
-
if (!Number.isFinite(normalized) || normalized < 0) {
|
|
2037
|
-
return null;
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
return Math.trunc(normalized);
|
|
2041
|
-
}
|
|
2042
|
-
}
|