@masterteam/components 0.0.263 → 0.0.265
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/.angular/cache/21.2.7/@masterteam/components/.tsbuildinfo +1 -0
- 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 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/0727b170af3d53236c0cafe16ea670d089e48d4c5c525b1dbcc1c684bb6e99c7 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/0873bc9048494ebc33fe0a7b856324c7c4ca681b0dcaa87338e3290186906d49 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/1010cd8fc996d0c2df519ed60085f4b1f38ccfc873900055bc75fc20a3c26bab +1 -0
- package/.angular/cache/21.2.7/ng-packagr/12379a8ab7254ad3df2635823a358cfce32e6d0f390be68596cc97e02307e6c4 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/1239e7a937657b62f858d17d47738ed30facbdaa91032511e29ed148b748400b +1 -0
- package/.angular/cache/21.2.7/ng-packagr/133b9ecf47ba424244902da90d77cd3f135b85f95c01b16de7b2247f57518f01 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/175d45dc6da51834e7fe937c09d23dbf28d2a823f838ef5271fd3e148776d6ec +1 -0
- package/.angular/cache/21.2.7/ng-packagr/19d99ad4d927324b03cdbef34331ba2c58bd580f1f0ca591cb5f8dbf436c913c +1 -0
- package/.angular/cache/21.2.7/ng-packagr/1a86918763f95c1c2b9fa781bda1ceedf15aead87f0e11ea1324318af43a897a +1 -0
- package/.angular/cache/21.2.7/ng-packagr/1f08100dbc280be7da64c809315376eb7d0cfd074916a6042f609f03f4276a8e +1 -0
- package/.angular/cache/21.2.7/ng-packagr/2224877a7e762b86541428e4c40d61f54f505867c305769ae42e67e4aa81bd93 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/24957fb7ec060692ebcf1471e1bdce39f40aed938959e580048ade58015762d2 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/295fcdc1c4462e7feae96a24255369508a559faaecc4676267749a7ce23e4b6d +1 -0
- package/.angular/cache/21.2.7/ng-packagr/2b37e2f2d6564d10bad1fd0ecc16453962fd855cd1e36ad7aa24baf3e4f2e8b3 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/2c20f0929771e857b570ba2beffe91f598f299ce26d4825fe4315bfe5a3dd40a +1 -0
- package/.angular/cache/21.2.7/ng-packagr/37dea2e5798cad4a21d66292eeed5be26d04500d9a1534332ad42ce664a058c2 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/3b6239b640fcb5ea7067a2655a2901d32f55372812b586aa008e77c59e8f2090 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/3beb1b4dfe75d1e6749cf91f05d51ba4eece939f5c15f6f33ed587bfd198f0a3 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/3f161e6c2ead4519d0663dd79199dafceb2cc22da7ce92a72b809b93bfce0bb0 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/43551862d17cd02626e18b30243390081a6247784485660048b060a3d4ab7fa7 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/47aedf032519b41d96866fcf8fbd4f1dfd29f9e9a534b39dee0e44d402227d2d +1 -0
- package/.angular/cache/21.2.7/ng-packagr/4a1768888c60921955bfdfba8b31c8d853bd7b2a7d3a7b83934de049e1e6e6a2 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/4a783e339117597607bff17eeca0ad24d84b8cbc1e28927e7e453ccfa6223180 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/4d9331b2050326f586cd8f6593a9e04e1c7944b2f9e98023649023c099597a5d +1 -0
- package/.angular/cache/21.2.7/ng-packagr/4e379f506919d47af7008658c75242aa05f0056c1caec4061d7fa5746f776049 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/55009bb7d44552dd816ce32fa2b0f7985f3f08fefd6409c2b4f6b9ffe35dad83 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/58ae3f1f9664f7b16844d2e4a279dd4ca9371de014cf5687320c2d5cb259a74f +1 -0
- package/.angular/cache/21.2.7/ng-packagr/5c08e906bd3fe1aa6c1d62f2bbb2b3f276e1c17fe45ef081e76bd1b865ac3dfa +1 -0
- package/.angular/cache/21.2.7/ng-packagr/5ce333a40ad635188347fa9bc601d5fd14be6baacbae7d096259d725ac9757af +1 -0
- package/.angular/cache/21.2.7/ng-packagr/5f32cceaee6a6ea19cc6cbff5ea089b752f13a0fdcd32597d4c99d5e1e031bb5 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/691ad4ccdc0a8ede36e1f4e5e97638c20c2d3142916ffac3a1b172178c139205 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/6b57160e0d2da3f31693831e84a3f4209c1f33a04abd636e34af03956e7329d8 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/70bc711a1d7b631845885c26adc2d6b1bff47d11332b2625cedfa11e9d5ac79a +1 -0
- package/.angular/cache/21.2.7/ng-packagr/7427c266237012afaef486c2af94ee08a491e8d7b6fc7e5ee887980830bbd333 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/7e8fa7c61cf9a932ba3a0e65eb73c7412e81666b7a8f923dac7b75acfbb94b1d +1 -0
- package/.angular/cache/21.2.7/ng-packagr/81aab7fdab43cbdfa869db759d6113ae01ec6f5e0e9061d7fc089c260886e4d1 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/83a81758045ff710a34ea3cf6f54435a1f5dea9839d8c0adda0bbce7c3fb6e8b +1 -0
- package/.angular/cache/21.2.7/ng-packagr/883eae810a4c09f06617bdc2e4bc30a69f09726401b2a051840969f635d076f1 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/8a6b9be66de40c57054dca5fde376c3cec1bec1ae191a16f1ae6a83306d9ebfe +1 -0
- package/.angular/cache/21.2.7/ng-packagr/8d42c8144f6929de46984094bf390a0c4168404ab13a5194839f6ba5e42bc3ce +1 -0
- package/.angular/cache/21.2.7/ng-packagr/91093656c61a5404f0d576f872247eeb480dd938e6999d481a97893c72b5f3d0 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/91e881172037c63d819e30d30e390e0d7dc0dee9808b3902275ccc8b1887d864 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/9ef28cf3a676e7bd0d37762c4868b4810efca2f241ed0dae75ebca41988e2c00 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/a07cbea405c1831b3f686a8e57c4b500d89cbab2b95e110487890269945feeaa +1 -0
- package/.angular/cache/21.2.7/ng-packagr/a463deba940880d9461612c9cd00d90062bf97aa31b1c4556b8b47a967cb6882 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/ab03ed1e4a371113b41b663d526d2b06565ceb062e6f033f726f1e455fc5d1d6 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/ad0e84be4f2211aff6187b4bec9adbe15f0e8b36851e9c6c63b38303c2daad37 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/aece79242dae70eb748605e37483e75e122e4ce414fa8be875499e8af26ee5d6 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/aff32db91ce03de30d2bbc84f266fe3fb2c6629d5eeb39a364204d9499484368 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/b0671e73a162927d28ef1742ec008e514264bc2ce29f2255bedaea553492fe5d +1 -0
- package/.angular/cache/21.2.7/ng-packagr/bb50d71f3cdeebbb85fd983be8103f9c216060464f8e7e534271197391e6dcf7 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/c64241290ab30d8761b2f5493a039427f5cda1a48b5be88ce62ee5c714c0f690 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/c794d2e79b26ab378c0dbf8afa7b8ac1337ba9afb288941d44a086cb1bd4bad2 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/d942edf8fd8e8e884138ffcdb1a07ad14a0b5e211f8ccea1dc9ea0b48f50cfc9 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/dbe0b9b9f18ba7b96d9c84f4fd16cde158c9701c202d00113e6f88ba93407bce +1 -0
- package/.angular/cache/21.2.7/ng-packagr/f564395a410a2723aac48e582f5fe416bfeaa48677cea47b10c5152d4f2b6672 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/fc9b0d27f081ca7b2a4cbefa75136d7bd7a8c341dbaa0587855071a6003906b8 +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar-text.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-avatar.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-breadcrumb.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-business-fields.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button-group.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-button.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-card.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-checkbox-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-chip.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page-menu.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-client-page.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-color-picker-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-confirmation.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-date-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dialog.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-drawer.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-dynamic-drawer.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-editor-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-empty-state.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-entities.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-field-validation.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-formula.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-icon-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-list.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-location-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-menu.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-modal.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-module-summary-card.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-multi-select-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-number-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page-header.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-page.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-paginator.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-pick-list-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-progress.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-property-filter-builder.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-button-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-radio-cards.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-runtime-action.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-select-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-sidebar.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-slider-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-statistic-card.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-table.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tabs.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-text-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-textarea-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toast.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-toggle-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tooltip.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-topbar.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-tree.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-treeselect-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-upload-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-uploader.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components-user-search-field.tsbuildinfo +1 -0
- package/.angular/cache/21.2.7/ng-packagr/tsbuildinfo/masterteam-components.tsbuildinfo +1 -0
- package/angular.json +32 -0
- package/api/api.ts +1 -0
- package/api/public-api.ts +5 -0
- package/assets/common.css +309 -2
- package/assets/i18n/ar.json +10 -2
- package/assets/i18n/en.json +10 -2
- package/avatar/avatar.html +32 -0
- package/avatar/avatar.scss +0 -0
- package/avatar/avatar.ts +54 -0
- package/avatar/ng-package.json +6 -0
- package/avatar/public-api.ts +1 -0
- package/avatar-text/avatar-text.html +26 -0
- package/avatar-text/avatar-text.scss +0 -0
- package/avatar-text/avatar-text.ts +52 -0
- package/avatar-text/ng-package.json +6 -0
- package/avatar-text/public-api.ts +1 -0
- package/breadcrumb/breadcrumb.html +53 -0
- package/breadcrumb/breadcrumb.scss +0 -0
- package/breadcrumb/breadcrumb.ts +26 -0
- package/breadcrumb/ng-package.json +6 -0
- package/breadcrumb/public-api.ts +1 -0
- package/business-fields/entity-list-field/entity-list-add-token.ts +25 -0
- package/business-fields/entity-list-field/entity-list-field.html +70 -0
- package/business-fields/entity-list-field/entity-list-field.scss +3 -0
- package/business-fields/entity-list-field/entity-list-field.ts +1067 -0
- package/business-fields/lookup-matrix-field/lookup-matrix-field.html +38 -0
- package/business-fields/lookup-matrix-field/lookup-matrix-field.spec.ts +183 -0
- package/business-fields/lookup-matrix-field/lookup-matrix-field.ts +239 -0
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.html +95 -0
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-field.ts +336 -0
- package/business-fields/lookup-module-check-list-field/lookup-module-check-list-form-token.ts +42 -0
- package/business-fields/ng-package.json +6 -0
- package/business-fields/public-api.ts +8 -0
- package/business-fields/schedule-item-selector-field/schedule-item-selector-field.html +32 -0
- package/business-fields/schedule-item-selector-field/schedule-item-selector-field.ts +272 -0
- package/business-fields/schedule-predecessor-field/schedule-predecessor-field.html +89 -0
- package/business-fields/schedule-predecessor-field/schedule-predecessor-field.ts +441 -0
- package/business-fields/schema-connection-field/schema-connection-field.html +58 -0
- package/business-fields/schema-connection-field/schema-connection-field.scss +0 -0
- package/business-fields/schema-connection-field/schema-connection-field.ts +456 -0
- package/button/button.html +44 -0
- package/button/button.scss +0 -0
- package/button/button.ts +120 -0
- package/button/ng-package.json +6 -0
- package/button/public-api.ts +1 -0
- package/button-group/button-group.html +3 -0
- package/button-group/button-group.scss +20 -0
- package/button-group/button-group.ts +12 -0
- package/button-group/ng-package.json +6 -0
- package/button-group/public-api.ts +1 -0
- package/card/card.html +26 -0
- package/card/card.scss +0 -0
- package/card/card.ts +29 -0
- package/card/ng-package.json +6 -0
- package/card/public-api.ts +1 -0
- package/checkbox-field/checkbox-field.html +31 -0
- package/checkbox-field/checkbox-field.scss +0 -0
- package/checkbox-field/checkbox-field.spec.ts +21 -0
- package/checkbox-field/checkbox-field.ts +123 -0
- package/checkbox-field/ng-package.json +6 -0
- package/checkbox-field/public-api.ts +1 -0
- package/chip/chip.html +16 -0
- package/chip/chip.scss +19 -0
- package/chip/chip.ts +45 -0
- package/chip/ng-package.json +6 -0
- package/chip/public-api.ts +1 -0
- package/client-page/client-page.html +232 -0
- package/client-page/client-page.ts +588 -0
- package/client-page/index.ts +2 -0
- package/client-page/ng-package.json +6 -0
- package/client-page/public-api.ts +1 -0
- package/client-page-menu/client-page-menu.html +142 -0
- package/client-page-menu/client-page-menu.ts +199 -0
- package/client-page-menu/index.ts +2 -0
- package/client-page-menu/ng-package.json +6 -0
- package/client-page-menu/public-api.ts +1 -0
- package/color-picker-field/color-picker-field.html +45 -0
- package/color-picker-field/color-picker-field.scss +52 -0
- package/color-picker-field/color-picker-field.ts +131 -0
- package/color-picker-field/ng-package.json +6 -0
- package/color-picker-field/public-api.ts +1 -0
- package/confirmation/confirmation-dialog.html +83 -0
- package/confirmation/confirmation-dialog.scss +0 -0
- package/confirmation/confirmation-dialog.ts +15 -0
- package/confirmation/confirmation.spec.ts +43 -0
- package/confirmation/confirmation.ts +103 -0
- package/confirmation/ng-package.json +6 -0
- package/confirmation/public-api.ts +2 -0
- package/date-field/date-field.html +65 -0
- package/date-field/date-field.scss +0 -0
- package/date-field/date-field.spec.ts +118 -0
- package/date-field/date-field.ts +196 -0
- package/date-field/ng-package.json +6 -0
- package/date-field/public-api.ts +1 -0
- package/dialog/dialog.ts +29 -0
- package/dialog/ng-package.json +6 -0
- package/dialog/public-api.ts +1 -0
- package/drawer/drawer.html +67 -0
- package/drawer/drawer.scss +1 -0
- package/drawer/drawer.ts +348 -0
- package/drawer/ng-package.json +5 -0
- package/drawer/public-api.ts +1 -0
- package/dynamic-drawer/dynamic-drawer-host.ts +476 -0
- package/dynamic-drawer/dynamic-drawer.spec.ts +204 -0
- package/dynamic-drawer/dynamic-drawer.ts +235 -0
- package/dynamic-drawer/ng-package.json +6 -0
- package/dynamic-drawer/public-api.ts +2 -0
- package/editor-field/editor-field.html +38 -0
- package/editor-field/editor-field.scss +219 -0
- package/editor-field/editor-field.ts +126 -0
- package/editor-field/ng-package.json +6 -0
- package/editor-field/public-api.ts +1 -0
- package/empty-state/empty-state.html +236 -0
- package/empty-state/empty-state.ts +85 -0
- package/empty-state/ng-package.json +6 -0
- package/empty-state/public-api.ts +1 -0
- package/entities/comparison/comparison-entity-list/comparison-entity-list.html +87 -0
- package/entities/comparison/comparison-entity-list/comparison-entity-list.ts +93 -0
- package/entities/comparison/comparison-value/comparison-value.html +31 -0
- package/entities/comparison/comparison-value/comparison-value.ts +53 -0
- package/entities/currency-display.utils.spec.ts +94 -0
- package/entities/currency-display.utils.ts +92 -0
- package/entities/entities-manage/entities-manage.html +74 -0
- package/entities/entities-manage/entities-manage.scss +72 -0
- package/entities/entities-manage/entities-manage.ts +121 -0
- package/entities/entities-manage/entities-resize-base.ts +153 -0
- package/entities/entities-preview/entities-preview.css +77 -0
- package/entities/entities-preview/entities-preview.html +56 -0
- package/entities/entities-preview/entities-preview.ts +281 -0
- package/entities/entity-attachment/entity-attachment.html +49 -0
- package/entities/entity-attachment/entity-attachment.ts +462 -0
- package/entities/entity-checkbox/entity-checkbox.html +28 -0
- package/entities/entity-checkbox/entity-checkbox.ts +65 -0
- package/entities/entity-comparison.model.ts +39 -0
- package/entities/entity-connection/entity-connection.html +12 -0
- package/entities/entity-connection/entity-connection.ts +75 -0
- package/entities/entity-currency/entity-currency.html +12 -0
- package/entities/entity-currency/entity-currency.ts +59 -0
- package/entities/entity-date/entity-date.html +16 -0
- package/entities/entity-date/entity-date.ts +50 -0
- package/entities/entity-display.utils.ts +94 -0
- package/entities/entity-field/entity-field.ts +94 -0
- package/entities/entity-leaf-details/entity-leaf-details.html +35 -0
- package/entities/entity-leaf-details/entity-leaf-details.ts +56 -0
- package/entities/entity-location/entity-location.html +34 -0
- package/entities/entity-location/entity-location.ts +98 -0
- package/entities/entity-long-text/entity-long-text.html +9 -0
- package/entities/entity-long-text/entity-long-text.ts +45 -0
- package/entities/entity-lookup/entity-lookup.html +25 -0
- package/entities/entity-lookup/entity-lookup.ts +68 -0
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.html +39 -0
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.spec.ts +148 -0
- package/entities/entity-lookup-module-check-list/entity-lookup-module-check-list.ts +152 -0
- package/entities/entity-percentage/entity-percentage.html +22 -0
- package/entities/entity-percentage/entity-percentage.ts +163 -0
- package/entities/entity-phase-gate/entity-phase-gate.html +20 -0
- package/entities/entity-phase-gate/entity-phase-gate.ts +129 -0
- package/entities/entity-preview/entity-preview-body.html +8 -0
- package/entities/entity-preview/entity-preview-body.ts +19 -0
- package/entities/entity-preview/entity-preview.html +14 -0
- package/entities/entity-preview/entity-preview.ts +33 -0
- package/entities/entity-preview/entity-value-preview.html +62 -0
- package/entities/entity-preview/entity-value-preview.spec.ts +191 -0
- package/entities/entity-preview/entity-value-preview.ts +69 -0
- package/entities/entity-schedule-item/entity-schedule-item.html +19 -0
- package/entities/entity-schedule-item/entity-schedule-item.ts +41 -0
- package/entities/entity-sections.util.ts +103 -0
- package/entities/entity-status/entity-status.html +20 -0
- package/entities/entity-status/entity-status.ts +60 -0
- package/entities/entity-text/entity-text.html +20 -0
- package/entities/entity-text/entity-text.ts +35 -0
- package/entities/entity-user/entity-user.html +181 -0
- package/entities/entity-user/entity-user.ts +179 -0
- package/entities/entity.model.ts +407 -0
- package/entities/leaf-details-display.utils.ts +269 -0
- package/entities/ng-package.json +6 -0
- package/entities/percentage-color.utils.spec.ts +94 -0
- package/entities/percentage-color.utils.ts +80 -0
- package/entities/public-api.ts +30 -0
- package/field-validation/character-limit.validator.ts +22 -0
- package/field-validation/error-message.pipe.spec.ts +184 -0
- package/field-validation/error-message.pipe.ts +80 -0
- package/field-validation/field-validation.ts +168 -0
- package/field-validation/ng-package.json +6 -0
- package/field-validation/public-api.ts +2 -0
- package/formula/formula-editor/formula-editor.html +89 -0
- package/formula/formula-editor/formula-editor.scss +25 -0
- package/formula/formula-editor/formula-editor.ts +467 -0
- package/formula/formula-editor/index.ts +1 -0
- package/formula/formula-editor-code/formula-autocomplete-normalization.util.spec.ts +58 -0
- package/formula/formula-editor-code/formula-autocomplete-normalization.util.ts +64 -0
- package/formula/formula-editor-code/formula-completion-range.util.spec.ts +62 -0
- package/formula/formula-editor-code/formula-completion-range.util.ts +71 -0
- package/formula/formula-editor-code/formula-completion-suggestion.util.spec.ts +23 -0
- package/formula/formula-editor-code/formula-completion-suggestion.util.ts +18 -0
- package/formula/formula-editor-code/formula-editor-code.html +15 -0
- package/formula/formula-editor-code/formula-editor-code.scss +90 -0
- package/formula/formula-editor-code/formula-editor-code.ts +1095 -0
- package/formula/formula-editor-code/index.ts +1 -0
- package/formula/formula-status-bar/formula-status-bar.html +119 -0
- package/formula/formula-status-bar/formula-status-bar.ts +66 -0
- package/formula/formula-status-bar/index.ts +1 -0
- package/formula/formula-toolbar/formula-toolbar.html +361 -0
- package/formula/formula-toolbar/formula-toolbar.ts +532 -0
- package/formula/formula-toolbar/index.ts +2 -0
- package/formula/formula-toolbar/operators.ts +122 -0
- package/formula/models/formula-block.model.ts +61 -0
- package/formula/models/formula-token.model.spec.ts +57 -0
- package/formula/models/formula-token.model.ts +852 -0
- package/formula/models/index.ts +5 -0
- package/formula/models/smart-block.model.ts +132 -0
- package/formula/models/validation-result.model.ts +80 -0
- package/formula/ng-package.json +6 -0
- package/formula/public-api.ts +8 -0
- package/formula/runtime/formula-runtime-catalogs.ts +554 -0
- package/formula/runtime/formula-runtime-engine.spec.ts +328 -0
- package/formula/runtime/formula-runtime-engine.ts +794 -0
- package/formula/runtime/formula-runtime.model.ts +53 -0
- package/formula/runtime/index.ts +3 -0
- package/formula/toolbar-item/index.ts +1 -0
- package/formula/toolbar-item/toolbar-item.html +143 -0
- package/formula/toolbar-item/toolbar-item.scss +14 -0
- package/formula/toolbar-item/toolbar-item.ts +223 -0
- package/icon-field/icon-field.html +58 -0
- package/icon-field/icon-field.scss +24 -0
- package/icon-field/icon-field.spec.ts +77 -0
- package/icon-field/icon-field.ts +205 -0
- package/icon-field/ng-package.json +6 -0
- package/icon-field/public-api.ts +1 -0
- package/list/list.html +22 -0
- package/list/list.ts +36 -0
- package/list/ng-package.json +6 -0
- package/list/public-api.ts +1 -0
- package/location-field/location-field.html +86 -0
- package/location-field/location-field.spec.ts +295 -0
- package/location-field/location-field.ts +662 -0
- package/location-field/location-manual-dialog.html +43 -0
- package/location-field/location-manual-dialog.ts +104 -0
- package/location-field/location-value.ts +67 -0
- package/location-field/ng-package.json +6 -0
- package/location-field/public-api.ts +3 -0
- package/menu/menu.html +71 -0
- package/menu/menu.scss +3 -0
- package/menu/menu.ts +186 -0
- package/menu/ng-package.json +6 -0
- package/menu/public-api.ts +1 -0
- package/modal/modal.ts +127 -0
- package/modal/ng-package.json +6 -0
- package/modal/public-api.ts +1 -0
- package/module-summary-card/module-summary-card.html +43 -0
- package/module-summary-card/module-summary-card.scss +0 -0
- package/module-summary-card/module-summary-card.ts +40 -0
- package/module-summary-card/ng-package.json +6 -0
- package/module-summary-card/public-api.ts +1 -0
- package/multi-select-field/multi-select-field.html +140 -0
- package/multi-select-field/multi-select-field.scss +0 -0
- package/multi-select-field/multi-select-field.spec.ts +21 -0
- package/multi-select-field/multi-select-field.ts +397 -0
- package/multi-select-field/ng-package.json +6 -0
- package/multi-select-field/public-api.ts +1 -0
- package/ng-package.json +9 -0
- package/number-field/ng-package.json +6 -0
- package/number-field/number-field.html +39 -0
- package/number-field/number-field.scss +8 -0
- package/number-field/number-field.spec.ts +21 -0
- package/number-field/number-field.ts +124 -0
- package/number-field/public-api.ts +1 -0
- package/package.json +54 -274
- package/page/index.ts +1 -0
- package/page/ng-package.json +6 -0
- package/page/page.html +37 -0
- package/page/page.ts +43 -0
- package/page/public-api.ts +1 -0
- package/page-header/index.ts +2 -0
- package/page-header/ng-package.json +6 -0
- package/page-header/page-header.html +60 -0
- package/page-header/page-header.ts +54 -0
- package/page-header/public-api.ts +1 -0
- package/paginator/ng-package.json +6 -0
- package/paginator/paginator.html +50 -0
- package/paginator/paginator.scss +0 -0
- package/paginator/paginator.ts +53 -0
- package/paginator/public-api.ts +1 -0
- package/pick-list-field/ng-package.json +6 -0
- package/pick-list-field/pick-list-field.html +39 -0
- package/pick-list-field/pick-list-field.scss +26 -0
- package/pick-list-field/pick-list-field.ts +259 -0
- package/pick-list-field/public-api.ts +1 -0
- package/progress/ng-package.json +6 -0
- package/progress/progress.html +36 -0
- package/progress/progress.ts +61 -0
- package/progress/public-api.ts +1 -0
- package/property-filter-builder/ng-package.json +6 -0
- package/property-filter-builder/property-filter-builder.html +192 -0
- package/property-filter-builder/property-filter-builder.ts +548 -0
- package/property-filter-builder/public-api.ts +1 -0
- package/radio-button-field/ng-package.json +6 -0
- package/radio-button-field/public-api.ts +1 -0
- package/radio-button-field/radio-button-field.html +44 -0
- package/radio-button-field/radio-button-field.scss +0 -0
- package/radio-button-field/radio-button-field.ts +114 -0
- package/radio-cards/ng-package.json +6 -0
- package/radio-cards/public-api.ts +1 -0
- package/radio-cards/radio-cards.css +3 -0
- package/radio-cards/radio-cards.html +54 -0
- package/radio-cards/radio-cards.spec.ts +22 -0
- package/radio-cards/radio-cards.ts +92 -0
- package/radio-cards-field/ng-package.json +6 -0
- package/radio-cards-field/public-api.ts +1 -0
- package/radio-cards-field/radio-cards-field.css +0 -0
- package/radio-cards-field/radio-cards-field.html +38 -0
- package/radio-cards-field/radio-cards-field.spec.ts +22 -0
- package/radio-cards-field/radio-cards-field.ts +182 -0
- package/runtime-action/ng-package.json +6 -0
- package/runtime-action/payload-builder.ts +246 -0
- package/runtime-action/public-api.ts +4 -0
- package/runtime-action/runtime-action-context.store.ts +26 -0
- package/runtime-action/runtime-action.runner.ts +302 -0
- package/runtime-action/runtime-action.types.ts +82 -0
- package/select-field/current-user.util.ts +54 -0
- package/select-field/ng-package.json +6 -0
- package/select-field/public-api.ts +1 -0
- package/select-field/select-field.html +142 -0
- package/select-field/select-field.scss +0 -0
- package/select-field/select-field.spec.ts +21 -0
- package/select-field/select-field.ts +471 -0
- package/sidebar/ng-package.json +6 -0
- package/sidebar/public-api.ts +1 -0
- package/sidebar/sidebar.html +368 -0
- package/sidebar/sidebar.ts +303 -0
- package/slider-field/ng-package.json +7 -0
- package/slider-field/public-api.ts +1 -0
- package/slider-field/slider-field.html +33 -0
- package/slider-field/slider-field.scss +11 -0
- package/slider-field/slider-field.spec.ts +44 -0
- package/slider-field/slider-field.ts +166 -0
- package/src/lib/base/base.facade.ts +159 -0
- package/src/lib/base/crud-base.state.ts +248 -0
- package/src/lib/config/date-format.config.ts +55 -0
- package/src/lib/config/ds-identity.preset.ts +538 -0
- package/src/lib/config/ds-identity.tokens.ts +209 -0
- package/src/lib/config/dynamic-form.model.ts +1162 -0
- package/src/lib/config/povide-messages.ts +5 -0
- package/src/lib/config/provide-confirmation.ts +5 -0
- package/src/lib/config/providemt.ts +506 -0
- package/src/lib/config/public-api.ts +0 -0
- package/src/lib/pipes/mt-date-format.pipe.spec.ts +60 -0
- package/src/lib/pipes/mt-date-format.pipe.ts +81 -0
- package/src/lib/utils/api-request.helper.ts +59 -0
- package/src/lib/utils/clock-time.util.ts +58 -0
- package/src/lib/utils/color.utils.ts +187 -0
- package/src/lib/utils/entity-adapter.ts +50 -0
- package/src/lib/utils/field-id.ts +42 -0
- package/src/lib/utils/http-context.ts +35 -0
- package/src/lib/utils/inputs.ts +6 -0
- package/src/lib/utils/state-helpers.ts +49 -0
- package/src/lib/utils/theme.ts +281 -0
- package/src/public-api.ts +30 -0
- package/statistic-card/ng-package.json +6 -0
- package/statistic-card/public-api.ts +1 -0
- package/statistic-card/statistic-card.html +31 -0
- package/statistic-card/statistic-card.scss +0 -0
- package/statistic-card/statistic-card.ts +59 -0
- package/table/ng-package.json +7 -0
- package/table/public-api.ts +10 -0
- package/table/table-actions-menu/public-api.ts +1 -0
- package/table/table-actions-menu/table-actions-menu.html +75 -0
- package/table/table-actions-menu/table-actions-menu.ts +171 -0
- package/table/table-caption/public-api.ts +1 -0
- package/table/table-caption/table-caption.html +118 -0
- package/table/table-caption/table-caption.ts +221 -0
- package/table/table-column-filter/public-api.ts +1 -0
- package/table/table-column-filter/table-column-filter.html +44 -0
- package/table/table-column-filter/table-column-filter.ts +106 -0
- package/table/table-export/html-to-text.util.ts +67 -0
- package/table/table-export/public-api.ts +1 -0
- package/table/table-export/table-export.service.spec.ts +186 -0
- package/table/table-export/table-export.service.ts +325 -0
- package/table/table-filter/public-api.ts +1 -0
- package/table/table-filter/table-filter.css +9 -0
- package/table/table-filter/table-filter.html +63 -0
- package/table/table-filter/table-filter.ts +126 -0
- package/table/table-filter-field/public-api.ts +1 -0
- package/table/table-filter-field/table-filter-field.html +182 -0
- package/table/table-filter-field/table-filter-field.ts +208 -0
- package/table/table-grouping/public-api.ts +1 -0
- package/table/table-grouping/table-grouping.spec.ts +218 -0
- package/table/table-grouping/table-grouping.ts +237 -0
- package/table/table-types.ts +242 -0
- package/table/table-value.utils.spec.ts +63 -0
- package/table/table-value.utils.ts +1014 -0
- package/table/table.css +145 -0
- package/table/table.html +572 -0
- package/table/table.ts +2042 -0
- package/tabs/ng-package.json +6 -0
- package/tabs/public-api.ts +1 -0
- package/tabs/tabs.html +417 -0
- package/tabs/tabs.scss +3 -0
- package/tabs/tabs.spec.ts +79 -0
- package/tabs/tabs.ts +397 -0
- package/text-field/ng-package.json +6 -0
- package/text-field/public-api.ts +1 -0
- package/text-field/text-field.html +75 -0
- package/text-field/text-field.scss +56 -0
- package/text-field/text-field.ts +251 -0
- package/textarea-field/ng-package.json +6 -0
- package/textarea-field/public-api.ts +1 -0
- package/textarea-field/textarea-field.html +37 -0
- package/textarea-field/textarea-field.scss +0 -0
- package/textarea-field/textarea-field.spec.ts +21 -0
- package/textarea-field/textarea-field.ts +169 -0
- package/toast/ng-package.json +6 -0
- package/toast/public-api.ts +2 -0
- package/toast/toast.html +18 -0
- package/toast/toast.service.ts +67 -0
- package/toast/toast.ts +21 -0
- package/toggle-field/ng-package.json +6 -0
- package/toggle-field/public-api.ts +1 -0
- package/toggle-field/toggle-field.html +78 -0
- package/toggle-field/toggle-field.scss +24 -0
- package/toggle-field/toggle-field.ts +150 -0
- package/tooltip/ng-package.json +6 -0
- package/tooltip/public-api.ts +2 -0
- package/tooltip/tooltip.ts +30 -0
- package/tooltip/truncate-tooltip.ts +124 -0
- package/topbar/ng-package.json +6 -0
- package/topbar/public-api.ts +1 -0
- package/topbar/topbar.html +52 -0
- package/topbar/topbar.ts +27 -0
- package/tree/ng-package.json +6 -0
- package/tree/public-api.ts +2 -0
- package/tree/tree-types.ts +55 -0
- package/tree/tree.html +126 -0
- package/tree/tree.scss +1 -0
- package/tree/tree.ts +303 -0
- package/treeselect-field/ng-package.json +6 -0
- package/treeselect-field/public-api.ts +1 -0
- package/treeselect-field/treeselect-field.html +71 -0
- package/treeselect-field/treeselect-field.ts +348 -0
- package/tsconfig.check.json +20 -0
- package/tsconfig.json +16 -0
- package/tsconfig.spec.json +24 -0
- package/upload-field/ng-package.json +6 -0
- package/upload-field/public-api.ts +2 -0
- package/upload-field/secure-image.pipe.ts +258 -0
- package/upload-field/upload-field.html +274 -0
- package/upload-field/upload-field.scss +0 -0
- package/upload-field/upload-field.spec.ts +169 -0
- package/upload-field/upload-field.ts +764 -0
- package/upload-field/upload-file-preview/upload-file-preview.html +41 -0
- package/upload-field/upload-file-preview/upload-file-preview.scss +0 -0
- package/upload-field/upload-file-preview/upload-file-preview.ts +57 -0
- package/upload-field/upload-user-preview/upload-user-preview.css +0 -0
- package/upload-field/upload-user-preview/upload-user-preview.html +73 -0
- package/upload-field/upload-user-preview/upload-user-preview.ts +54 -0
- package/uploader/ng-package.json +6 -0
- package/uploader/public-api.ts +1 -0
- package/uploader/uploader.service.spec.ts +271 -0
- package/uploader/uploader.service.ts +733 -0
- package/user-search-field/ng-package.json +6 -0
- package/user-search-field/public-api.ts +1 -0
- package/user-search-field/user-search-field.html +88 -0
- package/user-search-field/user-search-field.scss +4 -0
- package/user-search-field/user-search-field.spec.ts +176 -0
- package/user-search-field/user-search-field.ts +483 -0
- package/fesm2022/masterteam-components-avatar-text.mjs +0 -46
- package/fesm2022/masterteam-components-avatar-text.mjs.map +0 -1
- package/fesm2022/masterteam-components-avatar.mjs +0 -50
- package/fesm2022/masterteam-components-avatar.mjs.map +0 -1
- package/fesm2022/masterteam-components-breadcrumb.mjs +0 -27
- package/fesm2022/masterteam-components-breadcrumb.mjs.map +0 -1
- package/fesm2022/masterteam-components-business-fields.mjs +0 -1902
- package/fesm2022/masterteam-components-business-fields.mjs.map +0 -1
- package/fesm2022/masterteam-components-button-group.mjs +0 -20
- package/fesm2022/masterteam-components-button-group.mjs.map +0 -1
- package/fesm2022/masterteam-components-button.mjs +0 -52
- package/fesm2022/masterteam-components-button.mjs.map +0 -1
- package/fesm2022/masterteam-components-card.mjs +0 -28
- package/fesm2022/masterteam-components-card.mjs.map +0 -1
- package/fesm2022/masterteam-components-checkbox-field.mjs +0 -88
- package/fesm2022/masterteam-components-checkbox-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-chip.mjs +0 -39
- package/fesm2022/masterteam-components-chip.mjs.map +0 -1
- package/fesm2022/masterteam-components-client-page-menu.mjs +0 -152
- package/fesm2022/masterteam-components-client-page-menu.mjs.map +0 -1
- package/fesm2022/masterteam-components-client-page.mjs +0 -371
- package/fesm2022/masterteam-components-client-page.mjs.map +0 -1
- package/fesm2022/masterteam-components-color-picker-field.mjs +0 -102
- package/fesm2022/masterteam-components-color-picker-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-confirmation.mjs +0 -98
- package/fesm2022/masterteam-components-confirmation.mjs.map +0 -1
- package/fesm2022/masterteam-components-date-field.mjs +0 -154
- package/fesm2022/masterteam-components-date-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-dialog.mjs +0 -33
- package/fesm2022/masterteam-components-dialog.mjs.map +0 -1
- package/fesm2022/masterteam-components-drawer.mjs +0 -268
- package/fesm2022/masterteam-components-drawer.mjs.map +0 -1
- package/fesm2022/masterteam-components-dynamic-drawer.mjs +0 -608
- package/fesm2022/masterteam-components-dynamic-drawer.mjs.map +0 -1
- package/fesm2022/masterteam-components-editor-field.mjs +0 -99
- package/fesm2022/masterteam-components-editor-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-entities.mjs +0 -2033
- package/fesm2022/masterteam-components-entities.mjs.map +0 -1
- package/fesm2022/masterteam-components-field-validation.mjs +0 -158
- package/fesm2022/masterteam-components-field-validation.mjs.map +0 -1
- package/fesm2022/masterteam-components-formula.mjs +0 -3848
- package/fesm2022/masterteam-components-formula.mjs.map +0 -1
- package/fesm2022/masterteam-components-icon-field.mjs +0 -161
- package/fesm2022/masterteam-components-icon-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-list.mjs +0 -31
- package/fesm2022/masterteam-components-list.mjs.map +0 -1
- package/fesm2022/masterteam-components-location-field.mjs +0 -603
- package/fesm2022/masterteam-components-location-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-menu.mjs +0 -135
- package/fesm2022/masterteam-components-menu.mjs.map +0 -1
- package/fesm2022/masterteam-components-modal.mjs +0 -108
- package/fesm2022/masterteam-components-modal.mjs.map +0 -1
- package/fesm2022/masterteam-components-module-summary-card.mjs +0 -34
- package/fesm2022/masterteam-components-module-summary-card.mjs.map +0 -1
- package/fesm2022/masterteam-components-multi-select-field.mjs +0 -317
- package/fesm2022/masterteam-components-multi-select-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-number-field.mjs +0 -98
- package/fesm2022/masterteam-components-number-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-page-header.mjs +0 -42
- package/fesm2022/masterteam-components-page-header.mjs.map +0 -1
- package/fesm2022/masterteam-components-page.mjs +0 -35
- package/fesm2022/masterteam-components-page.mjs.map +0 -1
- package/fesm2022/masterteam-components-paginator.mjs +0 -43
- package/fesm2022/masterteam-components-paginator.mjs.map +0 -1
- package/fesm2022/masterteam-components-pick-list-field.mjs +0 -206
- package/fesm2022/masterteam-components-pick-list-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-progress.mjs +0 -63
- package/fesm2022/masterteam-components-progress.mjs.map +0 -1
- package/fesm2022/masterteam-components-property-filter-builder.mjs +0 -386
- package/fesm2022/masterteam-components-property-filter-builder.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-button-field.mjs +0 -85
- package/fesm2022/masterteam-components-radio-button-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-cards-field.mjs +0 -126
- package/fesm2022/masterteam-components-radio-cards-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-radio-cards.mjs +0 -74
- package/fesm2022/masterteam-components-radio-cards.mjs.map +0 -1
- package/fesm2022/masterteam-components-runtime-action.mjs +0 -406
- package/fesm2022/masterteam-components-runtime-action.mjs.map +0 -1
- package/fesm2022/masterteam-components-select-field.mjs +0 -411
- package/fesm2022/masterteam-components-select-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-sidebar.mjs +0 -155
- package/fesm2022/masterteam-components-sidebar.mjs.map +0 -1
- package/fesm2022/masterteam-components-slider-field.mjs +0 -128
- package/fesm2022/masterteam-components-slider-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-statistic-card.mjs +0 -42
- package/fesm2022/masterteam-components-statistic-card.mjs.map +0 -1
- package/fesm2022/masterteam-components-table.mjs +0 -3197
- package/fesm2022/masterteam-components-table.mjs.map +0 -1
- package/fesm2022/masterteam-components-tabs.mjs +0 -289
- package/fesm2022/masterteam-components-tabs.mjs.map +0 -1
- package/fesm2022/masterteam-components-text-field.mjs +0 -198
- package/fesm2022/masterteam-components-text-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-textarea-field.mjs +0 -122
- package/fesm2022/masterteam-components-textarea-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-toast.mjs +0 -80
- package/fesm2022/masterteam-components-toast.mjs.map +0 -1
- package/fesm2022/masterteam-components-toggle-field.mjs +0 -116
- package/fesm2022/masterteam-components-toggle-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-tooltip.mjs +0 -147
- package/fesm2022/masterteam-components-tooltip.mjs.map +0 -1
- package/fesm2022/masterteam-components-topbar.mjs +0 -32
- package/fesm2022/masterteam-components-topbar.mjs.map +0 -1
- package/fesm2022/masterteam-components-tree.mjs +0 -260
- package/fesm2022/masterteam-components-tree.mjs.map +0 -1
- package/fesm2022/masterteam-components-treeselect-field.mjs +0 -265
- package/fesm2022/masterteam-components-treeselect-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-upload-field.mjs +0 -841
- package/fesm2022/masterteam-components-upload-field.mjs.map +0 -1
- package/fesm2022/masterteam-components-uploader.mjs +0 -425
- package/fesm2022/masterteam-components-uploader.mjs.map +0 -1
- package/fesm2022/masterteam-components-user-search-field.mjs +0 -370
- package/fesm2022/masterteam-components-user-search-field.mjs.map +0 -1
- package/fesm2022/masterteam-components.mjs +0 -2334
- package/fesm2022/masterteam-components.mjs.map +0 -1
- package/types/masterteam-components-avatar-text.d.ts +0 -23
- package/types/masterteam-components-avatar.d.ts +0 -23
- package/types/masterteam-components-breadcrumb.d.ts +0 -18
- package/types/masterteam-components-business-fields.d.ts +0 -671
- package/types/masterteam-components-button-group.d.ts +0 -8
- package/types/masterteam-components-button.d.ts +0 -36
- package/types/masterteam-components-card.d.ts +0 -14
- package/types/masterteam-components-checkbox-field.d.ts +0 -34
- package/types/masterteam-components-chip.d.ts +0 -21
- package/types/masterteam-components-client-page-menu.d.ts +0 -55
- package/types/masterteam-components-client-page.d.ts +0 -109
- package/types/masterteam-components-color-picker-field.d.ts +0 -35
- package/types/masterteam-components-confirmation.d.ts +0 -41
- package/types/masterteam-components-date-field.d.ts +0 -53
- package/types/masterteam-components-dialog.d.ts +0 -12
- package/types/masterteam-components-drawer.d.ts +0 -62
- package/types/masterteam-components-dynamic-drawer.d.ts +0 -159
- package/types/masterteam-components-editor-field.d.ts +0 -35
- package/types/masterteam-components-entities.d.ts +0 -1030
- package/types/masterteam-components-field-validation.d.ts +0 -23
- package/types/masterteam-components-formula.d.ts +0 -759
- package/types/masterteam-components-icon-field.d.ts +0 -40
- package/types/masterteam-components-list.d.ts +0 -18
- package/types/masterteam-components-location-field.d.ts +0 -169
- package/types/masterteam-components-menu.d.ts +0 -55
- package/types/masterteam-components-modal.d.ts +0 -30
- package/types/masterteam-components-module-summary-card.d.ts +0 -18
- package/types/masterteam-components-multi-select-field.d.ts +0 -100
- package/types/masterteam-components-number-field.d.ts +0 -43
- package/types/masterteam-components-page-header.d.ts +0 -30
- package/types/masterteam-components-page.d.ts +0 -26
- package/types/masterteam-components-paginator.d.ts +0 -20
- package/types/masterteam-components-pick-list-field.d.ts +0 -61
- package/types/masterteam-components-progress.d.ts +0 -30
- package/types/masterteam-components-property-filter-builder.d.ts +0 -90
- package/types/masterteam-components-radio-button-field.d.ts +0 -41
- package/types/masterteam-components-radio-cards-field.d.ts +0 -35
- package/types/masterteam-components-radio-cards.d.ts +0 -33
- package/types/masterteam-components-runtime-action.d.ts +0 -105
- package/types/masterteam-components-select-field.d.ts +0 -132
- package/types/masterteam-components-sidebar.d.ts +0 -71
- package/types/masterteam-components-slider-field.d.ts +0 -41
- package/types/masterteam-components-statistic-card.d.ts +0 -28
- package/types/masterteam-components-table.d.ts +0 -827
- package/types/masterteam-components-tabs.d.ts +0 -80
- package/types/masterteam-components-text-field.d.ts +0 -56
- package/types/masterteam-components-textarea-field.d.ts +0 -41
- package/types/masterteam-components-toast.d.ts +0 -27
- package/types/masterteam-components-toggle-field.d.ts +0 -44
- package/types/masterteam-components-tooltip.d.ts +0 -26
- package/types/masterteam-components-topbar.d.ts +0 -20
- package/types/masterteam-components-tree.d.ts +0 -106
- package/types/masterteam-components-treeselect-field.d.ts +0 -79
- package/types/masterteam-components-upload-field.d.ts +0 -108
- package/types/masterteam-components-uploader.d.ts +0 -53
- package/types/masterteam-components-user-search-field.d.ts +0 -106
- package/types/masterteam-components.d.ts +0 -1181
|
@@ -0,0 +1,1067 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
DestroyRef,
|
|
5
|
+
computed,
|
|
6
|
+
effect,
|
|
7
|
+
inject,
|
|
8
|
+
input,
|
|
9
|
+
signal,
|
|
10
|
+
untracked,
|
|
11
|
+
} from '@angular/core';
|
|
12
|
+
import { ControlValueAccessor, NgControl, Validators } from '@angular/forms';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import { HttpClient, HttpContext } from '@angular/common/http';
|
|
15
|
+
import { TranslocoPipe, TranslocoService } from '@jsverse/transloco';
|
|
16
|
+
import { Skeleton } from 'primeng/skeleton';
|
|
17
|
+
import { Message } from 'primeng/message';
|
|
18
|
+
import { catchError, finalize, of, take } from 'rxjs';
|
|
19
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
20
|
+
|
|
21
|
+
import { Button } from '@masterteam/components/button';
|
|
22
|
+
import { FieldValidation } from '@masterteam/components/field-validation';
|
|
23
|
+
import { ModalService } from '@masterteam/components/modal';
|
|
24
|
+
import {
|
|
25
|
+
Table,
|
|
26
|
+
type ColumnDef,
|
|
27
|
+
type TableAction,
|
|
28
|
+
} from '@masterteam/components/table';
|
|
29
|
+
import type {
|
|
30
|
+
EntityData,
|
|
31
|
+
EntityViewType,
|
|
32
|
+
PropertyValueComparison,
|
|
33
|
+
} from '@masterteam/components/entities';
|
|
34
|
+
import type { EntityListFieldRuntimeContext } from '@masterteam/components';
|
|
35
|
+
|
|
36
|
+
import { ENTITY_LIST_ADD_DIALOG_COMPONENT } from './entity-list-add-token';
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// Types — minimal subset of fetch/query Table response (mirrors
|
|
40
|
+
// ClientListFetchQueryResponse from @masterteam/client-components).
|
|
41
|
+
// ============================================================================
|
|
42
|
+
|
|
43
|
+
interface FetchPropertyMeta {
|
|
44
|
+
id: number;
|
|
45
|
+
key: string;
|
|
46
|
+
normalizedKey: string;
|
|
47
|
+
label: string;
|
|
48
|
+
viewType: string;
|
|
49
|
+
configuration: EntityData['propertyConfiguration'];
|
|
50
|
+
source?: string;
|
|
51
|
+
order: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface FetchValueCell {
|
|
55
|
+
raw?: unknown;
|
|
56
|
+
value?: unknown;
|
|
57
|
+
display?: string | null;
|
|
58
|
+
comparison?: PropertyValueComparison;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface FetchRecord {
|
|
62
|
+
id: number;
|
|
63
|
+
values: Record<string, FetchValueCell>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface FetchTableColumn {
|
|
67
|
+
key: string;
|
|
68
|
+
label: string;
|
|
69
|
+
viewType: string;
|
|
70
|
+
order: number;
|
|
71
|
+
visible: boolean;
|
|
72
|
+
configuration: Record<string, unknown> | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
interface FetchQueryResponse {
|
|
76
|
+
catalog?: { properties?: FetchPropertyMeta[] };
|
|
77
|
+
records?: FetchRecord[];
|
|
78
|
+
projectionMeta?: { columns?: FetchTableColumn[] };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
interface EntityListColumnDef extends ColumnDef {
|
|
82
|
+
key: string;
|
|
83
|
+
label: string;
|
|
84
|
+
type: 'entity';
|
|
85
|
+
viewType?: string;
|
|
86
|
+
order?: number;
|
|
87
|
+
visible?: boolean;
|
|
88
|
+
configuration?: Record<string, unknown> | null;
|
|
89
|
+
/** Underlying catalog property key (e.g. "task_name") used to look up
|
|
90
|
+
* form values keyed by property key when a new row is added locally. */
|
|
91
|
+
propertyKey?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type EntityListRow = Record<string, unknown | EntityData>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Configured access mode. Mirrors the backend `EntityList` access matrix:
|
|
98
|
+
* `Auto` and `ReadWrite` allow both, `Read` reads only, `Write` writes only,
|
|
99
|
+
* `None` neither.
|
|
100
|
+
*/
|
|
101
|
+
type EntityListAccess = 'Auto' | 'Read' | 'Write' | 'ReadWrite' | 'None';
|
|
102
|
+
|
|
103
|
+
/** One submitted row value (`values[]` entry of the stored EntityList JSON). */
|
|
104
|
+
interface EntityListSubmitValue {
|
|
105
|
+
propertyKey: string;
|
|
106
|
+
rawValue: string | null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* A pending create/update row in the stored EntityList payload.
|
|
111
|
+
* `entityId > 0` updates that target record; `0` creates a new one.
|
|
112
|
+
*/
|
|
113
|
+
interface EntityListSubmitRow {
|
|
114
|
+
rowId: string;
|
|
115
|
+
entityId: number;
|
|
116
|
+
values: EntityListSubmitValue[];
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Stored EntityList property value (round-tripped through the form). */
|
|
120
|
+
interface EntityListStoredValue {
|
|
121
|
+
entityIds?: number[];
|
|
122
|
+
createdIds?: number[];
|
|
123
|
+
updatedIds?: number[];
|
|
124
|
+
deletedIds?: number[];
|
|
125
|
+
snapshot?: unknown;
|
|
126
|
+
rows?: EntityListSubmitRow[];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/** Non-persisted view state kept per pending row so dialogs and table cells
|
|
130
|
+
* can use the original (non-stringified) form values and option labels. */
|
|
131
|
+
interface EntityListRowDraft {
|
|
132
|
+
values: Record<string, unknown>;
|
|
133
|
+
display: Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const UNSORTABLE_ENTITY_VIEW_TYPES = new Set<EntityViewType>([
|
|
137
|
+
'Attachment',
|
|
138
|
+
'Checkbox',
|
|
139
|
+
]);
|
|
140
|
+
|
|
141
|
+
const ACCESS_ALIASES: Record<string, EntityListAccess> = {
|
|
142
|
+
'0': 'Auto',
|
|
143
|
+
'1': 'Read',
|
|
144
|
+
'2': 'Write',
|
|
145
|
+
'3': 'ReadWrite',
|
|
146
|
+
'4': 'None',
|
|
147
|
+
auto: 'Auto',
|
|
148
|
+
read: 'Read',
|
|
149
|
+
write: 'Write',
|
|
150
|
+
readwrite: 'ReadWrite',
|
|
151
|
+
none: 'None',
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** Internal row keys — not rendered, used to correlate rows with entities. */
|
|
155
|
+
const ROW_ID_KEY = '__rowId';
|
|
156
|
+
const ROW_ENTITY_ID_KEY = '__entityId';
|
|
157
|
+
const ROW_VALUES_KEY = '__values';
|
|
158
|
+
|
|
159
|
+
@Component({
|
|
160
|
+
selector: 'mt-entity-list-field',
|
|
161
|
+
standalone: true,
|
|
162
|
+
imports: [
|
|
163
|
+
CommonModule,
|
|
164
|
+
FieldValidation,
|
|
165
|
+
Skeleton,
|
|
166
|
+
Message,
|
|
167
|
+
Table,
|
|
168
|
+
Button,
|
|
169
|
+
TranslocoPipe,
|
|
170
|
+
],
|
|
171
|
+
templateUrl: './entity-list-field.html',
|
|
172
|
+
styleUrls: ['./entity-list-field.scss'],
|
|
173
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
174
|
+
host: { class: 'grid gap-1' },
|
|
175
|
+
})
|
|
176
|
+
export class EntityListField implements ControlValueAccessor {
|
|
177
|
+
// Inputs
|
|
178
|
+
readonly label = input<string>('');
|
|
179
|
+
readonly readonly = input<boolean>(false);
|
|
180
|
+
readonly required = input<boolean>(false);
|
|
181
|
+
/** EntityList property id (kept for back-compat; unused by fetch/query). */
|
|
182
|
+
readonly propertyId = input<number | null>(null);
|
|
183
|
+
/** Property configuration (sourceType, moduleId, access, readFields, etc). */
|
|
184
|
+
readonly configuration = input<Record<string, unknown> | null>(null);
|
|
185
|
+
/** Runtime ids needed to call the read endpoint. */
|
|
186
|
+
readonly runtimeContext = input<EntityListFieldRuntimeContext | null>(null);
|
|
187
|
+
/** Optional HttpContext (kept for back-compat). */
|
|
188
|
+
readonly context = input<HttpContext | undefined>(undefined);
|
|
189
|
+
|
|
190
|
+
// CVA state — pass-through value (EntityList stored JSON shape).
|
|
191
|
+
private readonly storedValue = signal<EntityListStoredValue | null>(null);
|
|
192
|
+
|
|
193
|
+
// Loaded table state.
|
|
194
|
+
protected readonly columns = signal<EntityListColumnDef[]>([]);
|
|
195
|
+
/** Rows loaded from the backend (existing target records). */
|
|
196
|
+
protected readonly rows = signal<EntityListRow[]>([]);
|
|
197
|
+
protected readonly loading = signal<boolean>(false);
|
|
198
|
+
protected readonly errorMessage = signal<string | null>(null);
|
|
199
|
+
|
|
200
|
+
protected readonly disabled = signal<boolean>(false);
|
|
201
|
+
protected requiredValidator = Validators.required;
|
|
202
|
+
public ngControl: NgControl | null = null;
|
|
203
|
+
|
|
204
|
+
protected readonly levelId = computed<number | string | null>(() => {
|
|
205
|
+
const raw = this.runtimeContext()?.levelId ?? null;
|
|
206
|
+
return raw == null || raw === '' ? null : raw;
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
protected readonly levelDataId = computed<number | string | null>(() => {
|
|
210
|
+
const raw = this.runtimeContext()?.levelDataId ?? null;
|
|
211
|
+
return raw == null || raw === '' ? null : raw;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
protected readonly moduleId = computed<number | string | null>(() => {
|
|
215
|
+
const raw = (this.configuration() as { moduleId?: unknown } | null)
|
|
216
|
+
?.moduleId;
|
|
217
|
+
return raw == null || raw === '' ? null : (raw as number | string);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
protected readonly readFields = computed<string[]>(() => {
|
|
221
|
+
const raw = (this.configuration() as { readFields?: unknown } | null)
|
|
222
|
+
?.readFields;
|
|
223
|
+
if (!Array.isArray(raw)) return [];
|
|
224
|
+
return raw.filter(
|
|
225
|
+
(f): f is string => typeof f === 'string' && f.length > 0,
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
/** Normalized `access` from the property configuration. */
|
|
230
|
+
protected readonly accessMode = computed<EntityListAccess>(() => {
|
|
231
|
+
const raw = (this.configuration() as { access?: unknown } | null)?.access;
|
|
232
|
+
if (raw == null || raw === '') return 'Auto';
|
|
233
|
+
return ACCESS_ALIASES[String(raw).trim().toLowerCase()] ?? 'Auto';
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
protected readonly canRead = computed<boolean>(() => {
|
|
237
|
+
const access = this.accessMode();
|
|
238
|
+
return access === 'Auto' || access === 'Read' || access === 'ReadWrite';
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
/** Access allows module-backed create/update/delete. */
|
|
242
|
+
private readonly writeAllowed = computed<boolean>(() => {
|
|
243
|
+
const access = this.accessMode();
|
|
244
|
+
return access === 'Auto' || access === 'Write' || access === 'ReadWrite';
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
/** Write UI is rendered only when access allows it and the field is editable. */
|
|
248
|
+
protected readonly canWrite = computed<boolean>(
|
|
249
|
+
() => this.writeAllowed() && !this.readonly(),
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
protected readonly writeFields = computed<string[]>(() => {
|
|
253
|
+
const raw = (this.configuration() as { writeFields?: unknown } | null)
|
|
254
|
+
?.writeFields;
|
|
255
|
+
if (!Array.isArray(raw)) return [];
|
|
256
|
+
return raw.filter(
|
|
257
|
+
(f): f is string => typeof f === 'string' && f.length > 0,
|
|
258
|
+
);
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Pending create/update rows, in the exact shape persisted by the backend
|
|
263
|
+
* (`rows[]` of the stored EntityList JSON). Rows with `entityId > 0` are
|
|
264
|
+
* partial updates of existing records; `entityId = 0` rows are creates.
|
|
265
|
+
*/
|
|
266
|
+
private readonly pendingRows = signal<EntityListSubmitRow[]>([]);
|
|
267
|
+
/** Existing entity ids the user removed (submitted as `deletedIds`). */
|
|
268
|
+
private readonly deletedIds = signal<number[]>([]);
|
|
269
|
+
/** rowId → original form values / option labels (view state only). */
|
|
270
|
+
private readonly rowDrafts = signal<Record<string, EntityListRowDraft>>({});
|
|
271
|
+
private localRowSeq = 0;
|
|
272
|
+
/** Serialized copy of the last value we emitted, to ignore CVA echoes. */
|
|
273
|
+
private lastEmittedJson: string | null = null;
|
|
274
|
+
|
|
275
|
+
/** Server rows indexed by entity id, for merging pending updates. */
|
|
276
|
+
private readonly rowsByEntityId = computed<Map<number, EntityListRow>>(() => {
|
|
277
|
+
const map = new Map<number, EntityListRow>();
|
|
278
|
+
for (const row of this.rows()) {
|
|
279
|
+
const entityId = Number(row[ROW_ENTITY_ID_KEY]);
|
|
280
|
+
if (entityId > 0) map.set(entityId, row);
|
|
281
|
+
}
|
|
282
|
+
return map;
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
/** Locally created rows (not yet persisted). */
|
|
286
|
+
private readonly createdRows = computed<EntityListRow[]>(() => {
|
|
287
|
+
const drafts = this.rowDrafts();
|
|
288
|
+
return this.pendingRows()
|
|
289
|
+
.filter((row) => !(row.entityId > 0))
|
|
290
|
+
.map((row) => {
|
|
291
|
+
const draft = drafts[row.rowId];
|
|
292
|
+
return this.buildRow(
|
|
293
|
+
row.rowId,
|
|
294
|
+
row.rowId,
|
|
295
|
+
0,
|
|
296
|
+
draft?.values ?? this.toValueMap(row.values),
|
|
297
|
+
draft?.display ?? {},
|
|
298
|
+
);
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
/** Pending edits of existing rows, keyed by entity id. */
|
|
303
|
+
private readonly editedRowsByEntityId = computed<Map<number, EntityListRow>>(
|
|
304
|
+
() => {
|
|
305
|
+
const drafts = this.rowDrafts();
|
|
306
|
+
const serverRows = this.rowsByEntityId();
|
|
307
|
+
const map = new Map<number, EntityListRow>();
|
|
308
|
+
for (const row of this.pendingRows()) {
|
|
309
|
+
if (!(row.entityId > 0)) continue;
|
|
310
|
+
const base = serverRows.get(row.entityId);
|
|
311
|
+
const draft = drafts[row.rowId];
|
|
312
|
+
// A pending update only carries the keys the user changed.
|
|
313
|
+
const changed = draft?.values ?? this.toValueMap(row.values);
|
|
314
|
+
const display = draft?.display ?? {};
|
|
315
|
+
|
|
316
|
+
if (!base) {
|
|
317
|
+
map.set(
|
|
318
|
+
row.entityId,
|
|
319
|
+
this.buildRow(
|
|
320
|
+
row.entityId,
|
|
321
|
+
row.rowId,
|
|
322
|
+
row.entityId,
|
|
323
|
+
changed,
|
|
324
|
+
display,
|
|
325
|
+
),
|
|
326
|
+
);
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Keep the backend-rendered cells for untouched columns so resolved
|
|
331
|
+
// labels (users, lookups, statuses) are not replaced by raw ids.
|
|
332
|
+
const baseValues =
|
|
333
|
+
(base[ROW_VALUES_KEY] as Record<string, unknown> | undefined) ?? {};
|
|
334
|
+
const next: EntityListRow = {
|
|
335
|
+
...base,
|
|
336
|
+
[ROW_ID_KEY]: row.rowId,
|
|
337
|
+
[ROW_VALUES_KEY]: { ...baseValues, ...changed },
|
|
338
|
+
};
|
|
339
|
+
for (const column of this.columns()) {
|
|
340
|
+
const key = column.propertyKey ?? column.key;
|
|
341
|
+
if (!(key in changed)) continue;
|
|
342
|
+
next[column.key] = this.buildCell(column, changed[key], display[key]);
|
|
343
|
+
}
|
|
344
|
+
map.set(row.entityId, next);
|
|
345
|
+
}
|
|
346
|
+
return map;
|
|
347
|
+
},
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Rows rendered in the table. In write mode existing rows are merged with
|
|
352
|
+
* pending edits, removed rows are hidden, and locally created rows are
|
|
353
|
+
* appended.
|
|
354
|
+
*/
|
|
355
|
+
protected readonly displayRows = computed<EntityListRow[]>(() => {
|
|
356
|
+
if (!this.canWrite()) return this.rows();
|
|
357
|
+
const deleted = new Set(this.deletedIds());
|
|
358
|
+
const edited = this.editedRowsByEntityId();
|
|
359
|
+
const existing = this.rows()
|
|
360
|
+
.filter((row) => !deleted.has(Number(row[ROW_ENTITY_ID_KEY])))
|
|
361
|
+
.map((row) => edited.get(Number(row[ROW_ENTITY_ID_KEY])) ?? row);
|
|
362
|
+
return [...existing, ...this.createdRows()];
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
protected readonly hasRows = computed<boolean>(
|
|
366
|
+
() => this.displayRows().length > 0,
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
protected readonly hasRequiredContext = computed<boolean>(
|
|
370
|
+
() =>
|
|
371
|
+
this.levelId() != null &&
|
|
372
|
+
this.levelDataId() != null &&
|
|
373
|
+
this.moduleId() != null &&
|
|
374
|
+
this.readFields().length > 0,
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
protected onTouched: () => void = () => {};
|
|
378
|
+
protected onModelChange: (value: EntityListStoredValue | null) => void =
|
|
379
|
+
() => {};
|
|
380
|
+
|
|
381
|
+
private readonly http = inject(HttpClient);
|
|
382
|
+
private readonly destroyRef = inject(DestroyRef);
|
|
383
|
+
private readonly modal = inject(ModalService);
|
|
384
|
+
private readonly transloco = inject(TranslocoService);
|
|
385
|
+
/**
|
|
386
|
+
* Optional rich add-row dialog (provided by `@masterteam/forms` via
|
|
387
|
+
* `provideEntityListAddForm()`). When available, used instead of the local
|
|
388
|
+
* minimal dialog so the popup renders `mt-client-form` filtered by
|
|
389
|
+
* `writeFields`.
|
|
390
|
+
*/
|
|
391
|
+
private readonly addDialogComponent = inject(
|
|
392
|
+
ENTITY_LIST_ADD_DIALOG_COMPONENT,
|
|
393
|
+
{ optional: true },
|
|
394
|
+
);
|
|
395
|
+
|
|
396
|
+
constructor() {
|
|
397
|
+
this.ngControl = inject(NgControl, { self: true, optional: true });
|
|
398
|
+
if (this.ngControl) {
|
|
399
|
+
this.ngControl.valueAccessor = this;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// Trigger fetch when context inputs change. Columns always come from
|
|
403
|
+
// /api/fetch/query; records are kept whenever access allows reading.
|
|
404
|
+
effect(() => {
|
|
405
|
+
const allowedRead = this.canRead();
|
|
406
|
+
const allowedWrite = this.writeAllowed();
|
|
407
|
+
const ready = this.hasRequiredContext();
|
|
408
|
+
const levelId = this.levelId();
|
|
409
|
+
const levelDataId = this.levelDataId();
|
|
410
|
+
const moduleId = this.moduleId();
|
|
411
|
+
const readFields = this.readFields();
|
|
412
|
+
|
|
413
|
+
untracked(() => {
|
|
414
|
+
if (
|
|
415
|
+
(!allowedRead && !allowedWrite) ||
|
|
416
|
+
!ready ||
|
|
417
|
+
levelId == null ||
|
|
418
|
+
levelDataId == null ||
|
|
419
|
+
moduleId == null
|
|
420
|
+
) {
|
|
421
|
+
this.columns.set([]);
|
|
422
|
+
this.rows.set([]);
|
|
423
|
+
this.errorMessage.set(null);
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
this.fetchRows(levelId, levelDataId, moduleId, readFields);
|
|
427
|
+
});
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// ============================================================================
|
|
432
|
+
// CVA
|
|
433
|
+
// ============================================================================
|
|
434
|
+
|
|
435
|
+
writeValue(value: EntityListStoredValue | string | null): void {
|
|
436
|
+
const incoming = this.coerceStoredValue(value);
|
|
437
|
+
// Ignore the echo of our own emission (DynamicForm re-writes the model on
|
|
438
|
+
// every value change) so pending edits/deletions are not reset.
|
|
439
|
+
if (this.isEchoOfLastEmit(incoming)) return;
|
|
440
|
+
this.lastEmittedJson = null;
|
|
441
|
+
this.storedValue.set(incoming);
|
|
442
|
+
// Restore rows the backend left unprocessed. `deletedIds` on a loaded
|
|
443
|
+
// value are historical operation markers, not pending intent.
|
|
444
|
+
const rows = Array.isArray(incoming?.rows) ? incoming.rows : [];
|
|
445
|
+
this.pendingRows.set(
|
|
446
|
+
rows.filter((row) => !!row && typeof row === 'object'),
|
|
447
|
+
);
|
|
448
|
+
this.deletedIds.set([]);
|
|
449
|
+
this.rowDrafts.set({});
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* True when the written value still carries exactly the rows and deletions
|
|
454
|
+
* we last emitted — i.e. the form is echoing our own value back rather than
|
|
455
|
+
* loading a new one.
|
|
456
|
+
*/
|
|
457
|
+
private isEchoOfLastEmit(incoming: EntityListStoredValue | null): boolean {
|
|
458
|
+
if (this.lastEmittedJson === null) return false;
|
|
459
|
+
return (
|
|
460
|
+
JSON.stringify({
|
|
461
|
+
rows: incoming?.rows ?? [],
|
|
462
|
+
deletedIds: incoming?.deletedIds ?? [],
|
|
463
|
+
}) === this.lastEmittedJson
|
|
464
|
+
);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* The stored value is persisted as JSON, so a host may write either the
|
|
469
|
+
* parsed object or its raw string form.
|
|
470
|
+
*/
|
|
471
|
+
private coerceStoredValue(value: unknown): EntityListStoredValue | null {
|
|
472
|
+
if (value == null || value === '') return null;
|
|
473
|
+
if (typeof value === 'string') {
|
|
474
|
+
try {
|
|
475
|
+
return this.coerceStoredValue(JSON.parse(value));
|
|
476
|
+
} catch {
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return typeof value === 'object' && !Array.isArray(value)
|
|
481
|
+
? (value as EntityListStoredValue)
|
|
482
|
+
: null;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
registerOnChange(fn: (value: EntityListStoredValue | null) => void): void {
|
|
486
|
+
this.onModelChange = fn;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
registerOnTouched(fn: () => void): void {
|
|
490
|
+
this.onTouched = fn;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
setDisabledState(isDisabled: boolean): void {
|
|
494
|
+
this.disabled.set(isDisabled);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// ============================================================================
|
|
498
|
+
// Write mode — add / edit / delete
|
|
499
|
+
// ============================================================================
|
|
500
|
+
|
|
501
|
+
/** Row actions shown in write mode — edit and delete. */
|
|
502
|
+
protected readonly writeRowActions = computed<TableAction[]>(() => {
|
|
503
|
+
if (this.disabled()) return [];
|
|
504
|
+
return [
|
|
505
|
+
{
|
|
506
|
+
icon: 'custom.pencil' as const,
|
|
507
|
+
tooltip: this.transloco.translate('components.entityListField.edit'),
|
|
508
|
+
action: (row: EntityListRow) => this.openEditDialog(row),
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
icon: 'general.trash-01' as const,
|
|
512
|
+
tooltip: this.transloco.translate('components.entityListField.delete'),
|
|
513
|
+
color: 'danger' as const,
|
|
514
|
+
confirmation: {
|
|
515
|
+
type: 'popup' as const,
|
|
516
|
+
confirmationType: 'delete' as const,
|
|
517
|
+
},
|
|
518
|
+
action: (row: EntityListRow) => this.deleteRow(row),
|
|
519
|
+
},
|
|
520
|
+
];
|
|
521
|
+
});
|
|
522
|
+
|
|
523
|
+
protected openAddDialog(): void {
|
|
524
|
+
if (this.disabled()) return;
|
|
525
|
+
const component = this.addDialogComponent;
|
|
526
|
+
if (!component) return;
|
|
527
|
+
|
|
528
|
+
const ref = this.modal.openModal(component, 'dialog', {
|
|
529
|
+
header: this.transloco.translate('components.entityListField.add'),
|
|
530
|
+
styleClass: '!w-[48rem] max-w-[96vw]',
|
|
531
|
+
dismissableMask: true,
|
|
532
|
+
inputValues: {
|
|
533
|
+
moduleId: this.moduleId(),
|
|
534
|
+
levelId: this.levelId(),
|
|
535
|
+
levelDataId: this.levelDataId(),
|
|
536
|
+
writeFields: this.writeFields(),
|
|
537
|
+
},
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
ref.onClose.pipe(take(1)).subscribe((result: unknown) => {
|
|
541
|
+
const parsed = this.parseDialogResult(result);
|
|
542
|
+
if (!parsed) return;
|
|
543
|
+
// A create row carries every value the user filled in; empty fields are
|
|
544
|
+
// dropped so the target module keeps its own defaults.
|
|
545
|
+
const values = this.dropEmptyValues(parsed.values);
|
|
546
|
+
const rowId = this.nextRowId();
|
|
547
|
+
this.setRowDraft(rowId, values, parsed.display);
|
|
548
|
+
this.pendingRows.set([
|
|
549
|
+
...this.pendingRows(),
|
|
550
|
+
{ rowId, entityId: 0, values: this.toSubmitValues(values) },
|
|
551
|
+
]);
|
|
552
|
+
this.emitValue();
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
protected openEditDialog(row: EntityListRow): void {
|
|
557
|
+
if (this.disabled()) return;
|
|
558
|
+
const component = this.addDialogComponent;
|
|
559
|
+
if (!component) return;
|
|
560
|
+
|
|
561
|
+
const entityId = Number(row[ROW_ENTITY_ID_KEY]) || 0;
|
|
562
|
+
const rowId = String(row[ROW_ID_KEY] ?? '');
|
|
563
|
+
const initialValues =
|
|
564
|
+
(row[ROW_VALUES_KEY] as Record<string, unknown> | undefined) ?? {};
|
|
565
|
+
|
|
566
|
+
const ref = this.modal.openModal(component, 'dialog', {
|
|
567
|
+
header: this.transloco.translate('components.entityListField.edit'),
|
|
568
|
+
styleClass: '!w-[48rem] max-w-[96vw]',
|
|
569
|
+
dismissableMask: true,
|
|
570
|
+
inputValues: {
|
|
571
|
+
moduleId: this.moduleId(),
|
|
572
|
+
levelId: this.levelId(),
|
|
573
|
+
levelDataId: this.levelDataId(),
|
|
574
|
+
writeFields: this.writeFields(),
|
|
575
|
+
initialValues,
|
|
576
|
+
isEdit: true,
|
|
577
|
+
},
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
ref.onClose.pipe(take(1)).subscribe((result: unknown) => {
|
|
581
|
+
const parsed = this.parseDialogResult(result);
|
|
582
|
+
if (!parsed) return;
|
|
583
|
+
if (entityId > 0) {
|
|
584
|
+
this.applyExistingRowEdit(entityId, rowId, initialValues, parsed);
|
|
585
|
+
} else {
|
|
586
|
+
this.applyCreatedRowEdit(rowId, parsed);
|
|
587
|
+
}
|
|
588
|
+
this.emitValue();
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Existing target records are updated partially: only values the user
|
|
594
|
+
* actually changed are submitted, so fields the dialog could not pre-fill
|
|
595
|
+
* (keys outside `readFields`) are left untouched by the backend.
|
|
596
|
+
*/
|
|
597
|
+
private applyExistingRowEdit(
|
|
598
|
+
entityId: number,
|
|
599
|
+
fallbackRowId: string,
|
|
600
|
+
initialValues: Record<string, unknown>,
|
|
601
|
+
parsed: {
|
|
602
|
+
values: Record<string, unknown>;
|
|
603
|
+
display: Record<string, unknown>;
|
|
604
|
+
},
|
|
605
|
+
): void {
|
|
606
|
+
const changed = this.diffValues(initialValues, parsed.values);
|
|
607
|
+
const current = this.pendingRows();
|
|
608
|
+
const existing = current.find((row) => row.entityId === entityId);
|
|
609
|
+
const rowId =
|
|
610
|
+
existing?.rowId || (fallbackRowId ? fallbackRowId : `entity-${entityId}`);
|
|
611
|
+
const merged = {
|
|
612
|
+
...(this.rowDrafts()[rowId]?.values ?? {}),
|
|
613
|
+
...changed,
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
if (Object.keys(merged).length === 0) {
|
|
617
|
+
// Nothing left to submit for this record — drop the pending update.
|
|
618
|
+
this.clearRowDraft(rowId);
|
|
619
|
+
this.pendingRows.set(current.filter((row) => row.entityId !== entityId));
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
this.setRowDraft(rowId, merged, parsed.display);
|
|
624
|
+
const next: EntityListSubmitRow = {
|
|
625
|
+
rowId,
|
|
626
|
+
entityId,
|
|
627
|
+
values: this.toSubmitValues(merged),
|
|
628
|
+
};
|
|
629
|
+
this.pendingRows.set(
|
|
630
|
+
existing
|
|
631
|
+
? current.map((row) => (row.entityId === entityId ? next : row))
|
|
632
|
+
: [...current, next],
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/** A locally created row is replaced wholesale by the dialog result. */
|
|
637
|
+
private applyCreatedRowEdit(
|
|
638
|
+
rowId: string,
|
|
639
|
+
parsed: {
|
|
640
|
+
values: Record<string, unknown>;
|
|
641
|
+
display: Record<string, unknown>;
|
|
642
|
+
},
|
|
643
|
+
): void {
|
|
644
|
+
const values = this.dropEmptyValues(parsed.values);
|
|
645
|
+
this.setRowDraft(rowId, values, parsed.display);
|
|
646
|
+
this.pendingRows.set(
|
|
647
|
+
this.pendingRows().map((row) =>
|
|
648
|
+
row.rowId === rowId
|
|
649
|
+
? { ...row, values: this.toSubmitValues(values) }
|
|
650
|
+
: row,
|
|
651
|
+
),
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Remove a row. Locally created rows are dropped from the pending payload;
|
|
657
|
+
* existing records are queued in `deletedIds` for the backend to delete.
|
|
658
|
+
*/
|
|
659
|
+
protected deleteRow(row: EntityListRow): void {
|
|
660
|
+
if (this.disabled()) return;
|
|
661
|
+
const entityId = Number(row[ROW_ENTITY_ID_KEY]) || 0;
|
|
662
|
+
const rowId = String(row[ROW_ID_KEY] ?? '');
|
|
663
|
+
|
|
664
|
+
if (entityId > 0) {
|
|
665
|
+
if (!this.deletedIds().includes(entityId)) {
|
|
666
|
+
this.deletedIds.set([...this.deletedIds(), entityId]);
|
|
667
|
+
}
|
|
668
|
+
// A queued update for a deleted record is pointless — drop it.
|
|
669
|
+
this.pendingRows.set(
|
|
670
|
+
this.pendingRows().filter((pending) => pending.entityId !== entityId),
|
|
671
|
+
);
|
|
672
|
+
} else {
|
|
673
|
+
this.pendingRows.set(
|
|
674
|
+
this.pendingRows().filter((pending) => pending.rowId !== rowId),
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
this.clearRowDraft(rowId);
|
|
679
|
+
this.emitValue();
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Normalize the add/edit dialog close payload. The rich dialog returns
|
|
684
|
+
* `{ values, display }`; a custom add-dialog may still return the raw values
|
|
685
|
+
* object directly (no display map), which we treat as `display = {}`.
|
|
686
|
+
*/
|
|
687
|
+
private parseDialogResult(result: unknown): {
|
|
688
|
+
values: Record<string, unknown>;
|
|
689
|
+
display: Record<string, unknown>;
|
|
690
|
+
} | null {
|
|
691
|
+
if (!result || typeof result !== 'object') return null;
|
|
692
|
+
const payload = result as Record<string, unknown>;
|
|
693
|
+
const values = payload['values'];
|
|
694
|
+
if (values && typeof values === 'object') {
|
|
695
|
+
return {
|
|
696
|
+
values: values as Record<string, unknown>,
|
|
697
|
+
display:
|
|
698
|
+
(payload['display'] as Record<string, unknown> | undefined) ?? {},
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
return { values: payload, display: {} };
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
private nextRowId(): string {
|
|
705
|
+
const used = new Set(this.pendingRows().map((row) => row.rowId));
|
|
706
|
+
let candidate = '';
|
|
707
|
+
do {
|
|
708
|
+
this.localRowSeq += 1;
|
|
709
|
+
candidate = `client-${this.localRowSeq}`;
|
|
710
|
+
} while (used.has(candidate));
|
|
711
|
+
return candidate;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
private setRowDraft(
|
|
715
|
+
rowId: string,
|
|
716
|
+
values: Record<string, unknown>,
|
|
717
|
+
display: Record<string, unknown>,
|
|
718
|
+
): void {
|
|
719
|
+
this.rowDrafts.set({ ...this.rowDrafts(), [rowId]: { values, display } });
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
private clearRowDraft(rowId: string): void {
|
|
723
|
+
if (!rowId || !(rowId in this.rowDrafts())) return;
|
|
724
|
+
const next = { ...this.rowDrafts() };
|
|
725
|
+
delete next[rowId];
|
|
726
|
+
this.rowDrafts.set(next);
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
private buildRow(
|
|
730
|
+
id: string | number,
|
|
731
|
+
rowId: string,
|
|
732
|
+
entityId: number,
|
|
733
|
+
values: Record<string, unknown>,
|
|
734
|
+
display: Record<string, unknown> = {},
|
|
735
|
+
): EntityListRow {
|
|
736
|
+
const row: EntityListRow = {
|
|
737
|
+
Id: id,
|
|
738
|
+
[ROW_ID_KEY]: rowId,
|
|
739
|
+
[ROW_ENTITY_ID_KEY]: entityId,
|
|
740
|
+
[ROW_VALUES_KEY]: values,
|
|
741
|
+
};
|
|
742
|
+
for (const column of this.columns()) {
|
|
743
|
+
// Form values are keyed by catalog property key (e.g. "task_name"),
|
|
744
|
+
// but column.key is the normalizedKey (e.g. "Name"). Use propertyKey
|
|
745
|
+
// for the lookup so the value is found.
|
|
746
|
+
const key = column.propertyKey ?? column.key;
|
|
747
|
+
row[column.key] = this.buildCell(column, values[key], display[key]);
|
|
748
|
+
}
|
|
749
|
+
return row;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/** Render one table cell from a raw form value and its resolved label. */
|
|
753
|
+
private buildCell(
|
|
754
|
+
column: EntityListColumnDef,
|
|
755
|
+
raw: unknown,
|
|
756
|
+
label: unknown,
|
|
757
|
+
): EntityData {
|
|
758
|
+
return {
|
|
759
|
+
name: column.label ?? column.key,
|
|
760
|
+
key: column.key,
|
|
761
|
+
viewType: column.viewType ?? 'Text',
|
|
762
|
+
value: this.toLocalEntityValue(column.viewType, raw, label),
|
|
763
|
+
rawValue: raw ?? null,
|
|
764
|
+
} as unknown as EntityData;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Shape a raw form value into the value an entity renderer expects for the
|
|
769
|
+
* given view type. Locally-added rows carry raw form values, but renderers
|
|
770
|
+
* like `mt-entity-user` need a display object (`{ displayName }`) — a
|
|
771
|
+
* team-member `User` field is a select whose control value is a bare user id.
|
|
772
|
+
* `label` is the resolved option display (present for select-based fields).
|
|
773
|
+
*/
|
|
774
|
+
private toLocalEntityValue(
|
|
775
|
+
viewType: string | undefined,
|
|
776
|
+
raw: unknown,
|
|
777
|
+
label: unknown,
|
|
778
|
+
): unknown {
|
|
779
|
+
if (viewType === 'User') {
|
|
780
|
+
if (Array.isArray(raw)) {
|
|
781
|
+
const names = raw
|
|
782
|
+
.map((entry) =>
|
|
783
|
+
entry && typeof entry === 'object'
|
|
784
|
+
? ((entry as Record<string, unknown>)['displayName'] ?? '')
|
|
785
|
+
: entry,
|
|
786
|
+
)
|
|
787
|
+
.filter((name) => name != null && name !== '');
|
|
788
|
+
return names.length ? { displayName: names.join(', ') } : '';
|
|
789
|
+
}
|
|
790
|
+
if (raw && typeof raw === 'object') {
|
|
791
|
+
const user = raw as Record<string, unknown>;
|
|
792
|
+
return {
|
|
793
|
+
...user,
|
|
794
|
+
displayName: user['displayName'] ?? label ?? '',
|
|
795
|
+
photoUrl: user['photoUrl'] ?? user['photo'] ?? '',
|
|
796
|
+
};
|
|
797
|
+
}
|
|
798
|
+
if (raw != null && raw !== '') {
|
|
799
|
+
const name = label == null ? String(raw) : String(label);
|
|
800
|
+
return { id: String(raw), displayName: name, userName: name };
|
|
801
|
+
}
|
|
802
|
+
return '';
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
if (viewType === 'Status' || viewType === 'Lookup') {
|
|
806
|
+
if (raw && typeof raw === 'object') return raw;
|
|
807
|
+
if (raw != null && raw !== '' && label != null) {
|
|
808
|
+
return { key: String(raw), display: String(label), color: '' };
|
|
809
|
+
}
|
|
810
|
+
return raw ?? '';
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
// Plain / scalar view types: prefer a resolved option label when present,
|
|
814
|
+
// else the raw value (unchanged for text / number / date / percentage).
|
|
815
|
+
if (label != null && (raw == null || typeof raw !== 'object')) {
|
|
816
|
+
return Array.isArray(label) ? label.join(', ') : label;
|
|
817
|
+
}
|
|
818
|
+
return raw ?? '';
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// ============================================================================
|
|
822
|
+
// Submit payload (see EntityList.md — "Stored Value Shape")
|
|
823
|
+
// ============================================================================
|
|
824
|
+
|
|
825
|
+
private emitValue(): void {
|
|
826
|
+
const current = this.storedValue();
|
|
827
|
+
// `entityIds` / `createdIds` / `updatedIds` / `snapshot` are backend-owned
|
|
828
|
+
// and passed through untouched; the frontend only contributes pending rows
|
|
829
|
+
// and delete intents.
|
|
830
|
+
const next: EntityListStoredValue = {
|
|
831
|
+
...(current ?? {}),
|
|
832
|
+
rows: this.pendingRows(),
|
|
833
|
+
deletedIds: this.deletedIds(),
|
|
834
|
+
};
|
|
835
|
+
this.storedValue.set(next);
|
|
836
|
+
this.lastEmittedJson = JSON.stringify({
|
|
837
|
+
rows: next.rows,
|
|
838
|
+
deletedIds: next.deletedIds,
|
|
839
|
+
});
|
|
840
|
+
this.onModelChange(next);
|
|
841
|
+
this.onTouched();
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/** `values[]` entries, restricted to `writeFields` when configured. */
|
|
845
|
+
private toSubmitValues(
|
|
846
|
+
values: Record<string, unknown>,
|
|
847
|
+
): EntityListSubmitValue[] {
|
|
848
|
+
const allowed = new Set(this.writeFields());
|
|
849
|
+
return Object.entries(values)
|
|
850
|
+
.filter(([propertyKey]) => allowed.size === 0 || allowed.has(propertyKey))
|
|
851
|
+
.map(([propertyKey, value]) => ({
|
|
852
|
+
propertyKey,
|
|
853
|
+
rawValue: this.toRawValue(value),
|
|
854
|
+
}));
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/** Backend `rawValue` is a serialized scalar; objects/arrays go as JSON. */
|
|
858
|
+
private toRawValue(value: unknown): string | null {
|
|
859
|
+
if (value == null || value === '') return null;
|
|
860
|
+
if (value instanceof Date) return value.toISOString();
|
|
861
|
+
if (typeof value === 'object') return JSON.stringify(value);
|
|
862
|
+
return String(value);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
private toValueMap(
|
|
866
|
+
values: EntityListSubmitValue[] | undefined,
|
|
867
|
+
): Record<string, unknown> {
|
|
868
|
+
const map: Record<string, unknown> = {};
|
|
869
|
+
for (const value of values ?? []) {
|
|
870
|
+
if (!value?.propertyKey) continue;
|
|
871
|
+
map[value.propertyKey] = value.rawValue;
|
|
872
|
+
}
|
|
873
|
+
return map;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
private dropEmptyValues(
|
|
877
|
+
values: Record<string, unknown>,
|
|
878
|
+
): Record<string, unknown> {
|
|
879
|
+
const next: Record<string, unknown> = {};
|
|
880
|
+
for (const [key, value] of Object.entries(values)) {
|
|
881
|
+
if (this.isEmptyValue(value)) continue;
|
|
882
|
+
next[key] = value;
|
|
883
|
+
}
|
|
884
|
+
return next;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Keys the user actually changed. A key that was empty before and is still
|
|
889
|
+
* empty is skipped (the dialog simply could not pre-fill it); a key that had
|
|
890
|
+
* a value and is now empty is kept so the backend clears it.
|
|
891
|
+
*/
|
|
892
|
+
private diffValues(
|
|
893
|
+
initial: Record<string, unknown>,
|
|
894
|
+
next: Record<string, unknown>,
|
|
895
|
+
): Record<string, unknown> {
|
|
896
|
+
const changed: Record<string, unknown> = {};
|
|
897
|
+
for (const [key, value] of Object.entries(next)) {
|
|
898
|
+
const before = initial[key];
|
|
899
|
+
if (this.isEmptyValue(value) && this.isEmptyValue(before)) continue;
|
|
900
|
+
if (this.isSameValue(before, value)) continue;
|
|
901
|
+
changed[key] = value;
|
|
902
|
+
}
|
|
903
|
+
return changed;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
private isEmptyValue(value: unknown): boolean {
|
|
907
|
+
if (value == null || value === '') return true;
|
|
908
|
+
if (Array.isArray(value)) return value.length === 0;
|
|
909
|
+
return false;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
private isSameValue(a: unknown, b: unknown): boolean {
|
|
913
|
+
if (a === b) return true;
|
|
914
|
+
// Values arriving from the read endpoint are serialized; compare the
|
|
915
|
+
// submit-shaped representation so "5" and 5 are not treated as a change.
|
|
916
|
+
return this.toRawValue(a) === this.toRawValue(b);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
// ============================================================================
|
|
920
|
+
// Read endpoint — POST /api/fetch/query (Table projection)
|
|
921
|
+
// ============================================================================
|
|
922
|
+
|
|
923
|
+
private fetchRows(
|
|
924
|
+
levelId: number | string,
|
|
925
|
+
levelDataId: number | string,
|
|
926
|
+
moduleId: number | string,
|
|
927
|
+
propertyKeys: string[],
|
|
928
|
+
): void {
|
|
929
|
+
this.loading.set(true);
|
|
930
|
+
this.errorMessage.set(null);
|
|
931
|
+
|
|
932
|
+
const ctx = this.context();
|
|
933
|
+
const body = {
|
|
934
|
+
contextKey: `level:${levelId}/module:${moduleId}`,
|
|
935
|
+
projection: 'Table' as const,
|
|
936
|
+
surfaceKey: 'table',
|
|
937
|
+
propertyKeys,
|
|
938
|
+
filters: [
|
|
939
|
+
{
|
|
940
|
+
key: 'levelDataId',
|
|
941
|
+
operator: 'Equals',
|
|
942
|
+
value: String(levelDataId),
|
|
943
|
+
},
|
|
944
|
+
],
|
|
945
|
+
page: 1,
|
|
946
|
+
pageSize: 3000,
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
this.http
|
|
950
|
+
.post<FetchQueryResponse | { data?: FetchQueryResponse }>(
|
|
951
|
+
'fetch/query',
|
|
952
|
+
body,
|
|
953
|
+
ctx ? { context: ctx } : {},
|
|
954
|
+
)
|
|
955
|
+
.pipe(
|
|
956
|
+
takeUntilDestroyed(this.destroyRef),
|
|
957
|
+
finalize(() => this.loading.set(false)),
|
|
958
|
+
catchError((err) => {
|
|
959
|
+
console.error('EntityList fetch/query failed', err);
|
|
960
|
+
this.errorMessage.set(
|
|
961
|
+
this.transloco.translate('components.entityListField.loadFailed'),
|
|
962
|
+
);
|
|
963
|
+
return of<FetchQueryResponse>({});
|
|
964
|
+
}),
|
|
965
|
+
)
|
|
966
|
+
.subscribe((response) => {
|
|
967
|
+
const payload =
|
|
968
|
+
response && typeof response === 'object' && 'data' in response
|
|
969
|
+
? ((response.data as FetchQueryResponse | undefined) ?? response)
|
|
970
|
+
: response;
|
|
971
|
+
this.applyResponse(payload as FetchQueryResponse);
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
private applyResponse(response: FetchQueryResponse): void {
|
|
976
|
+
// Build property maps first so column defs can include the propertyKey
|
|
977
|
+
// mapping (normalizedKey → catalog key) needed for row value lookup.
|
|
978
|
+
const propertyByKey = new Map<string, FetchPropertyMeta>();
|
|
979
|
+
const propertyByNormalizedKey = new Map<string, FetchPropertyMeta>();
|
|
980
|
+
for (const property of response.catalog?.properties ?? []) {
|
|
981
|
+
propertyByKey.set(property.key, property);
|
|
982
|
+
propertyByNormalizedKey.set(property.normalizedKey, property);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
const columns: EntityListColumnDef[] = (
|
|
986
|
+
response.projectionMeta?.columns ?? []
|
|
987
|
+
)
|
|
988
|
+
.filter((column) => column.visible)
|
|
989
|
+
.sort((a, b) => a.order - b.order)
|
|
990
|
+
.map((column) => ({
|
|
991
|
+
key: column.key,
|
|
992
|
+
label: column.label,
|
|
993
|
+
type: 'entity' as const,
|
|
994
|
+
sortable: !UNSORTABLE_ENTITY_VIEW_TYPES.has(
|
|
995
|
+
column.viewType as EntityViewType,
|
|
996
|
+
),
|
|
997
|
+
viewType: column.viewType,
|
|
998
|
+
order: column.order,
|
|
999
|
+
visible: column.visible,
|
|
1000
|
+
configuration: column.configuration ?? null,
|
|
1001
|
+
// Store the catalog property key so buildRow can look up form values
|
|
1002
|
+
// keyed by property key (e.g. "task_name") rather than the
|
|
1003
|
+
// normalizedKey used as the column display key (e.g. "Name").
|
|
1004
|
+
propertyKey: propertyByNormalizedKey.get(column.key)?.key ?? column.key,
|
|
1005
|
+
}));
|
|
1006
|
+
|
|
1007
|
+
this.columns.set(columns);
|
|
1008
|
+
|
|
1009
|
+
// Reading blocked (access = Write / None): keep the columns, drop records.
|
|
1010
|
+
if (!this.canRead()) {
|
|
1011
|
+
this.rows.set([]);
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
const rows: EntityListRow[] = (response.records ?? []).map((record) => {
|
|
1016
|
+
const values: Record<string, unknown> = {};
|
|
1017
|
+
const row: EntityListRow = {
|
|
1018
|
+
Id: record.id,
|
|
1019
|
+
[ROW_ID_KEY]: `entity-${record.id}`,
|
|
1020
|
+
[ROW_ENTITY_ID_KEY]: record.id,
|
|
1021
|
+
};
|
|
1022
|
+
for (const column of columns) {
|
|
1023
|
+
const property =
|
|
1024
|
+
propertyByKey.get(column.key) ??
|
|
1025
|
+
propertyByNormalizedKey.get(column.key);
|
|
1026
|
+
const propertyKey = property?.key ?? column.key;
|
|
1027
|
+
const cell = record.values?.[propertyKey];
|
|
1028
|
+
row[column.key] = this.toEntityData(column, cell, property, record.id);
|
|
1029
|
+
// Keep the machine-readable value so the edit dialog can pre-fill and
|
|
1030
|
+
// partial updates can be diffed against it.
|
|
1031
|
+
values[propertyKey] = cell?.raw ?? cell?.value ?? null;
|
|
1032
|
+
}
|
|
1033
|
+
row[ROW_VALUES_KEY] = values;
|
|
1034
|
+
return row;
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
this.rows.set(rows);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
private toEntityData(
|
|
1041
|
+
column: EntityListColumnDef,
|
|
1042
|
+
cell: FetchValueCell | undefined,
|
|
1043
|
+
property: FetchPropertyMeta | undefined,
|
|
1044
|
+
recordId: number,
|
|
1045
|
+
): EntityData {
|
|
1046
|
+
return {
|
|
1047
|
+
id: recordId,
|
|
1048
|
+
propertyId: property?.id,
|
|
1049
|
+
key: property?.key ?? column.key,
|
|
1050
|
+
normalizedKey: property?.normalizedKey ?? column.key,
|
|
1051
|
+
name: column.label ?? property?.label ?? column.key,
|
|
1052
|
+
rawValue:
|
|
1053
|
+
cell?.raw === null || cell?.raw === undefined
|
|
1054
|
+
? undefined
|
|
1055
|
+
: String(cell.raw),
|
|
1056
|
+
value: (cell?.value ?? '') as EntityData['value'],
|
|
1057
|
+
viewType: (column.viewType ?? 'Text') as EntityData['viewType'],
|
|
1058
|
+
type: property?.source,
|
|
1059
|
+
order: column.order ?? property?.order,
|
|
1060
|
+
configuration: column.configuration as
|
|
1061
|
+
| EntityData['configuration']
|
|
1062
|
+
| undefined,
|
|
1063
|
+
propertyConfiguration: property?.configuration ?? undefined,
|
|
1064
|
+
comparison: cell?.comparison,
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
}
|