imm-element-ui
v2.6.6
Published
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 18.2.0.
Downloads
2,863
Readme
ImmElementUi
This library was generated with Angular CLI version 18.2.0.
Code scaffolding
Run ng generate component component-name --project imm-element-ui to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project imm-element-ui.
Note: Don't forget to add
--project imm-element-uior else it will be added to the default project in yourangular.jsonfile.
Build
Run ng build imm-element-ui to build the project. The build artifacts will be stored in the dist/ directory.
Publishing
After building your library with ng build imm-element-ui, go to the dist folder cd dist/imm-element-ui and run npm publish.
Running unit tests
Run ng test imm-element-ui to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.
PageForm slots
PageFormComponent supports custom tab slots via ng-template[pageFormSlot].
Recommended usage
- Use
gridList[].slotKeyto mark tabs that should render through a custom slot. - Register one
ng-template[pageFormSlot]per slot key, and setslotKeyon the directive itself. subDataKeyremains a compatibility fallback whengrid.slotKeyis not provided.
Example
<app-page-form
[gridList]="gridList"
[form]="formOptions"
[getPrmInput]="getPrm">
<ng-template
pageFormSlot
slotKey="gantt"
let-slotKey="slotKey"
let-grid="grid"
let-data="data"
let-model="model"
let-upsert="upsert"
let-pageForm="pageForm"
let-index="index"
let-active="active">
<app-gantt-data
[grid]="grid"
[data]="data"
[model]="model"
[upsert]="upsert"
[pageForm]="pageForm"
[active]="active">
</app-gantt-data>
</ng-template>
</app-page-form>Slot context
The slot template receives:
slotKey: resolved fromgrid.slotKey || grid.subDataKeygrid: current tab configindex: current tab indexpageForm:PageFormComponentinstancedata: page-level model datamodel: current tab modelupsert: page save contextactive: whether the current tab is active
PageFormService
Provide PageFormService at the page container level so PageFormComponent and custom slot components share the same instance.
Custom slot components can:
- subscribe to
pageFormService.gridAction$and filter bysubDataKey - update page data with
pageFormService.updateData(partialData) - update a single sub-table with
pageFormService.updateDataByKey(key, value)
PageFormComponent dispatches add/remove actions with the current subDataKey, and shallow-merges incoming page data while keeping sub-form models in sync.
