@coolon/angular-ui-powerups 1.9.0 → 1.11.0
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/CHANGELOG.md +19 -0
- package/assets/styles.scss +7 -67
- package/bundles/coolon-angular-ui-powerups.umd.js +2623 -1581
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +57 -44
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +55 -42
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/card-container/card-container.component.js +1 -1
- package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.js +37 -6
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input-activity.js +47 -0
- package/esm2015/lib/components/forms/abstract-input-activity.js.map +1 -0
- package/esm2015/lib/components/forms/abstract-input-activity.metadata.json +1 -0
- package/esm2015/lib/components/forms/abstract-input-activity.ngfactory.js.map +1 -0
- package/esm2015/lib/components/forms/abstract-input.component.js +6 -1
- package/esm2015/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm2015/lib/components/forms/password-input/password-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/string-input/string-input-activity.js +22 -0
- package/esm2015/lib/components/forms/string-input/string-input-activity.js.map +1 -0
- package/esm2015/lib/components/forms/string-input/string-input-activity.metadata.json +1 -0
- package/esm2015/lib/components/forms/string-input/string-input-activity.ngfactory.js.map +1 -0
- package/esm2015/lib/components/forms/string-input/string-input.component.js +1 -1
- package/esm2015/lib/components/forms/string-input/string-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
- package/esm2015/lib/components/index.js +13 -0
- package/esm2015/lib/components/index.js.map +1 -1
- package/esm2015/lib/components/index.metadata.json +1 -1
- package/esm2015/lib/components/table/cell-editor.component.js +1 -0
- package/esm2015/lib/components/table/cell-editor.component.js.map +1 -0
- package/esm2015/lib/components/table/cell-editor.component.metadata.json +1 -0
- package/esm2015/lib/components/table/cell-renderer.js +1 -0
- package/esm2015/lib/components/table/cell-renderer.js.map +1 -0
- package/esm2015/lib/components/table/cell-renderer.metadata.json +1 -0
- package/esm2015/lib/components/table/column-model.js +160 -0
- package/esm2015/lib/components/table/column-model.js.map +1 -0
- package/esm2015/lib/components/table/column-model.metadata.json +1 -0
- package/esm2015/lib/components/table/column-template/column-template.directive.js +24 -0
- package/esm2015/lib/components/table/column-template/column-template.directive.js.map +1 -0
- package/esm2015/lib/components/table/column-template/column-template.directive.metadata.json +1 -0
- package/esm2015/lib/components/table/column-template/column-template.directive.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/column-text-properties.js +1 -0
- package/esm2015/lib/components/table/column-text-properties.js.map +1 -0
- package/esm2015/lib/components/table/column-text-properties.metadata.json +1 -0
- package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js +27 -0
- package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/default-cell-renderer/default-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +21 -0
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js +50 -0
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -0
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.metadata.json +1 -0
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/edit-row-controls/edit-row-controls.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +40 -0
- package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +32 -0
- package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +64 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/table-def.js +1 -0
- package/esm2015/lib/components/table/table-def.js.map +1 -0
- package/esm2015/lib/components/table/table-def.metadata.json +1 -0
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +32 -0
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -0
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/components/table/table-model.js +197 -0
- package/esm2015/lib/components/table/table-model.js.map +1 -0
- package/esm2015/lib/components/table/table-model.metadata.json +1 -0
- package/esm2015/lib/components/table/table.component.js +60 -0
- package/esm2015/lib/components/table/table.component.js.map +1 -0
- package/esm2015/lib/components/table/table.component.metadata.json +1 -0
- package/esm2015/lib/components/table/table.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/table/table.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/activity.js +7 -1
- package/esm2015/lib/interaction/activity.js.map +1 -1
- package/esm2015/lib/interaction/activity.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +2 -2
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +22 -9
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +87 -0
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -0
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.metadata.json +1 -0
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ngfactory.js.map +1 -0
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js +86 -0
- package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js.map +1 -0
- package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.metadata.json +1 -0
- package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.ngfactory.js.map +1 -0
- package/esm2015/lib/interaction/index.js +2 -0
- package/esm2015/lib/interaction/index.js.map +1 -1
- package/esm2015/lib/interaction/index.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.js +16 -4
- package/esm2015/lib/interaction/interaction.module.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm5/coolon-angular-ui-powerups.js +55 -42
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/card-container/card-container.component.js +1 -1
- package/esm5/lib/components/components.module.js +37 -6
- package/esm5/lib/components/components.module.js.map +1 -1
- package/esm5/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/abstract-input-activity.js +50 -0
- package/esm5/lib/components/forms/abstract-input-activity.js.map +1 -0
- package/esm5/lib/components/forms/abstract-input-activity.ngfactory.js.map +1 -0
- package/esm5/lib/components/forms/abstract-input.component.js +6 -1
- package/esm5/lib/components/forms/abstract-input.component.js.map +1 -1
- package/esm5/lib/components/forms/number-input/number-input.component.js +1 -1
- package/esm5/lib/components/forms/password-input/password-input.component.js +1 -1
- package/esm5/lib/components/forms/string-input/string-input-activity.js +18 -0
- package/esm5/lib/components/forms/string-input/string-input-activity.js.map +1 -0
- package/esm5/lib/components/forms/string-input/string-input-activity.ngfactory.js.map +1 -0
- package/esm5/lib/components/forms/string-input/string-input.component.js +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm5/lib/components/index.js +13 -0
- package/esm5/lib/components/index.js.map +1 -1
- package/esm5/lib/components/table/cell-editor.component.js +1 -0
- package/esm5/lib/components/table/cell-editor.component.js.map +1 -0
- package/esm5/lib/components/table/cell-renderer.js +1 -0
- package/esm5/lib/components/table/cell-renderer.js.map +1 -0
- package/esm5/lib/components/table/column-model.js +196 -0
- package/esm5/lib/components/table/column-model.js.map +1 -0
- package/esm5/lib/components/table/column-template/column-template.directive.js +25 -0
- package/esm5/lib/components/table/column-template/column-template.directive.js.map +1 -0
- package/esm5/lib/components/table/column-template/column-template.directive.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/column-text-properties.js +1 -0
- package/esm5/lib/components/table/column-text-properties.js.map +1 -0
- package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.js +32 -0
- package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/default-cell-renderer/default-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js +22 -0
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js +57 -0
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.js.map +1 -0
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/edit-row-controls/edit-row-controls.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +47 -0
- package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/select-cell-renderer/select-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +35 -0
- package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js +66 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/table-cell-renderer/table-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/table-def.js +1 -0
- package/esm5/lib/components/table/table-def.js.map +1 -0
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +33 -0
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js.map +1 -0
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/components/table/table-model.js +213 -0
- package/esm5/lib/components/table/table-model.js.map +1 -0
- package/esm5/lib/components/table/table.component.js +62 -0
- package/esm5/lib/components/table/table.component.js.map +1 -0
- package/esm5/lib/components/table/table.component.ngfactory.js.map +1 -0
- package/esm5/lib/components/table/table.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/interaction/activity.js +7 -2
- package/esm5/lib/interaction/activity.js.map +1 -1
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js +2 -2
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +23 -9
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +95 -0
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -0
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ngfactory.js.map +1 -0
- package/esm5/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.js +90 -0
- package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.js.map +1 -0
- package/esm5/lib/interaction/directives/interaction-context-trigger-for.directive.ngfactory.js.map +1 -0
- package/esm5/lib/interaction/index.js +2 -0
- package/esm5/lib/interaction/index.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.js +16 -4
- package/esm5/lib/interaction/interaction.module.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +2291 -1368
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +2536 -1526
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-input-activity.d.ts +18 -0
- package/lib/components/forms/abstract-input.component.d.ts +1 -0
- package/lib/components/forms/string-input/string-input-activity.d.ts +3 -0
- package/lib/components/index.d.ts +17 -0
- package/lib/components/table/cell-editor.component.d.ts +5 -0
- package/lib/components/table/cell-renderer.d.ts +3 -0
- package/lib/components/table/column-model.d.ts +84 -0
- package/lib/components/table/column-template/column-template.directive.d.ts +7 -0
- package/lib/components/table/column-text-properties.d.ts +3 -0
- package/lib/components/table/default-cell-renderer/default-cell-renderer.component.d.ts +6 -0
- package/lib/components/table/default-header-cell-renderer/default-header-cell-renderer.component.d.ts +5 -0
- package/lib/components/table/edit-row-controls/edit-row-controls.component.d.ts +14 -0
- package/lib/components/table/select-cell-renderer/select-cell-renderer.component.d.ts +11 -0
- package/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts +9 -0
- package/lib/components/table/table-cell-renderer/table-cell-renderer.component.d.ts +18 -0
- package/lib/components/table/table-def.d.ts +7 -0
- package/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.d.ts +8 -0
- package/lib/components/table/table-model.d.ts +114 -0
- package/lib/components/table/table.component.d.ts +40 -0
- package/lib/interaction/activity.d.ts +1 -0
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -1
- package/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.d.ts +21 -0
- package/lib/interaction/directives/interaction-context-trigger-for.directive.d.ts +17 -0
- package/lib/interaction/index.d.ts +2 -0
- package/package.json +5 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"SelectHeaderCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":10,"character":60},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"aup-select-header-cell-renderer","template":"<mat-checkbox [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n","styles":[""]}]}],"members":{"selectionModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"isSelected":[{"__symbolic":"method"}],"isIntermediate":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-header-cell-renderer.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-header-cell-renderer.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Component, HostBinding, Input } from '@angular/core';
|
|
3
|
+
import { Command } from '@coolon/pectin';
|
|
4
|
+
import { ColumnModel } from '../column-model';
|
|
5
|
+
import { TableModel } from '../table-model';
|
|
6
|
+
let TableCellRendererComponent = class TableCellRendererComponent {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.defaultClassNames = "aup-header-cell-renderer";
|
|
9
|
+
this.editRowCommand = Command.create(() => {
|
|
10
|
+
this.tableModel.startEditSession(this.row);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
initialiseRenderer(instance) {
|
|
14
|
+
if (this.renderer !== instance) {
|
|
15
|
+
this.renderer = instance;
|
|
16
|
+
this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
initialiseEditor(instance) {
|
|
20
|
+
if (this.editor !== instance) {
|
|
21
|
+
this.editor = instance;
|
|
22
|
+
this.column.initialiseEditor(this.editor, this.editSession);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
ngOnChanges(changes) {
|
|
26
|
+
if (this.renderer) {
|
|
27
|
+
this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);
|
|
28
|
+
this.renderer.editSession = this.editSession;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
hasActiveEditor() {
|
|
32
|
+
return this.editSession && this.column.hasEditor();
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
Input(),
|
|
37
|
+
__metadata("design:type", Object)
|
|
38
|
+
], TableCellRendererComponent.prototype, "row", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
Input(),
|
|
41
|
+
__metadata("design:type", ColumnModel)
|
|
42
|
+
], TableCellRendererComponent.prototype, "column", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Input(),
|
|
45
|
+
__metadata("design:type", TableModel.EditSession)
|
|
46
|
+
], TableCellRendererComponent.prototype, "editSession", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Input(),
|
|
49
|
+
__metadata("design:type", TableModel)
|
|
50
|
+
], TableCellRendererComponent.prototype, "tableModel", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
HostBinding('class'),
|
|
53
|
+
__metadata("design:type", Object)
|
|
54
|
+
], TableCellRendererComponent.prototype, "defaultClassNames", void 0);
|
|
55
|
+
TableCellRendererComponent = __decorate([
|
|
56
|
+
Component({
|
|
57
|
+
selector: 'aup-table-cell-renderer',
|
|
58
|
+
template: "<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellRendererPortal\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellEditorPortal\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n",
|
|
59
|
+
styles: [":host{display:flex;flex-direction:column;align-items:stretch}"]
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:paramtypes", [])
|
|
62
|
+
], TableCellRendererComponent);
|
|
63
|
+
export { TableCellRendererComponent };
|
|
64
|
+
//# sourceMappingURL=table-cell-renderer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell-renderer.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-cell-renderer/table-cell-renderer.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAA+C,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAO5C,IAAa,0BAA0B,GAAvC,MAAa,0BAA0B;IAsBrC;QAFA,sBAAiB,GAAG,0BAA0B,CAAA;QAG5C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;YACxC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,kBAAkB,CAAC,QAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ,EAAE;YAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SAChG;IACH,CAAC;IAED,gBAAgB,CAAC,QAAa;QAC5B,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE;YAC5B,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;SAC7D;IACH,CAAC;IAED,WAAW,CAAC,OAAsB;QAChC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;YAC/F,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;SAC9C;IACH,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IACrD,CAAC;CACF,CAAA;AAjDC;IADC,KAAK,EAAE;;uDACC;AAGT;IADC,KAAK,EAAE;8BACA,WAAW;0DAAM;AAGzB;IADC,KAAK,EAAE;8BACK,UAAU,CAAC,WAAW;+DAAM;AAGzC;IADC,KAAK,EAAE;8BACI,UAAU;8DAAM;AAQ5B;IADC,WAAW,CAAC,OAAO,CAAC;;qEACyB;AApBnC,0BAA0B;IALtC,SAAS,CAAC;QACT,QAAQ,EAAE,yBAAyB;QACnC,qUAAmD;;KAEpD,CAAC;;GACW,0BAA0B,CAoDtC;SApDY,0BAA0B","sourcesContent":["import { Component, HostBinding, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';\nimport { Command } from '@coolon/pectin';\nimport { ColumnModel } from '../column-model';\nimport { TableModel } from '../table-model';\n\n@Component({\n selector: 'aup-table-cell-renderer',\n templateUrl: './table-cell-renderer.component.html',\n styleUrls: ['./table-cell-renderer.component.scss']\n})\nexport class TableCellRendererComponent<Row> implements OnChanges {\n\n @Input()\n row: Row;\n\n @Input()\n column: ColumnModel<Row>;\n\n @Input()\n editSession: TableModel.EditSession<Row>;\n\n @Input()\n tableModel: TableModel<Row>;\n\n private renderer: any;\n private editor: any;\n\n private editRowCommand: Command<void>;\n\n @HostBinding('class')\n defaultClassNames = \"aup-header-cell-renderer\"\n\n constructor() {\n this.editRowCommand = Command.create(() => {\n this.tableModel.startEditSession(this.row);\n });\n }\n\n initialiseRenderer(instance: any) {\n if (this.renderer !== instance) {\n this.renderer = instance;\n this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);\n }\n }\n\n initialiseEditor(instance: any) {\n if (this.editor !== instance) {\n this.editor = instance;\n this.column.initialiseEditor(this.editor, this.editSession);\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.renderer) {\n this.column.updateCellRenderer(this.renderer, this.row, this.editRowCommand, this.editSession);\n this.renderer.editSession = this.editSession;\n }\n }\n\n hasActiveEditor() {\n return this.editSession && this.column.hasEditor();\n }\n}\n"]}
|
package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableCellRendererComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"aup-table-cell-renderer","template":"<ng-container *ngIf=\"!hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellRendererPortal\" (attached)=\"initialiseRenderer($event.instance)\"></ng-container>\n<ng-container *ngIf=\"hasActiveEditor()\" [cdkPortalOutlet]=\"column.cellEditorPortal\" (attached)=\"initialiseEditor($event.instance)\"></ng-container>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}"]}]}],"members":{"row":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"column":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":15,"character":3}}]}],"editSession":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}}]}],"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"defaultClassNames":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":29,"character":3},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseRenderer":[{"__symbolic":"method"}],"initialiseEditor":[{"__symbolic":"method"}],"ngOnChanges":[{"__symbolic":"method"}],"hasActiveEditor":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell-renderer.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-cell-renderer/table-cell-renderer.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-cell-renderer.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-cell-renderer/table-cell-renderer.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=table-def.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-def.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-def.ts"],"names":[],"mappings":"","sourcesContent":["import { Form } from '@coolon/pectin';\n\nexport interface TableDef<T> {\n // createRowForm?(item: T): Form<T>; // Optional, if not specified the columns can be used to inject validators\n // save(form: Form<T>)\n}\n\n// RowEditorFactory?\nexport interface EditableTableDef<T> extends TableDef<T> {\n createRowForm?(item: T): Form<T>; // Optional, if not specified the columns can be used to inject validators\n save(form: Form<T>)\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableDef":{"__symbolic":"interface"},"EditableTableDef":{"__symbolic":"interface"}}}]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Component, HostBinding, Input } from '@angular/core';
|
|
3
|
+
import { ColumnModel } from '../column-model';
|
|
4
|
+
let TableHeaderCellRendererComponent = class TableHeaderCellRendererComponent {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.defaultClassNames = "aup-header-cell-renderer";
|
|
7
|
+
}
|
|
8
|
+
initialiseHeader(instance) {
|
|
9
|
+
if (this.renderer !== instance) {
|
|
10
|
+
this.renderer = instance;
|
|
11
|
+
this.column.initialiseHeader(this.renderer);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
__decorate([
|
|
16
|
+
Input(),
|
|
17
|
+
__metadata("design:type", ColumnModel)
|
|
18
|
+
], TableHeaderCellRendererComponent.prototype, "column", void 0);
|
|
19
|
+
__decorate([
|
|
20
|
+
HostBinding('class'),
|
|
21
|
+
__metadata("design:type", Object)
|
|
22
|
+
], TableHeaderCellRendererComponent.prototype, "defaultClassNames", void 0);
|
|
23
|
+
TableHeaderCellRendererComponent = __decorate([
|
|
24
|
+
Component({
|
|
25
|
+
selector: 'aup-table-header-cell-renderer',
|
|
26
|
+
template: "<ng-container [cdkPortalOutlet]=\"column.columnHeaderCellRendererPortal\" (attached)=\"initialiseHeader($event.instance)\"></ng-container>\n",
|
|
27
|
+
styles: [":host{display:flex;flex-direction:column;align-items:stretch}"]
|
|
28
|
+
}),
|
|
29
|
+
__metadata("design:paramtypes", [])
|
|
30
|
+
], TableHeaderCellRendererComponent);
|
|
31
|
+
export { TableHeaderCellRendererComponent };
|
|
32
|
+
//# sourceMappingURL=table-header-cell-renderer.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-header-cell-renderer.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAA+C,MAAM,eAAe,CAAC;AAE3G,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAQ9C,IAAa,gCAAgC,GAA7C,MAAa,gCAAgC;IAU3C;QAFA,sBAAiB,GAAG,0BAA0B,CAAA;IAG9C,CAAC;IAED,gBAAgB,CAAC,QAAa;QAC5B,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ,EAAE;YAC9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YACzB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC7C;IACH,CAAC;CACF,CAAA;AAhBC;IADC,KAAK,EAAE;8BACA,WAAW;gEAAM;AAKzB;IADC,WAAW,CAAC,OAAO,CAAC;;2EACyB;AARnC,gCAAgC;IAL5C,SAAS,CAAC;QACT,QAAQ,EAAE,gCAAgC;QAC1C,wJAA0D;;KAE3D,CAAC;;GACW,gCAAgC,CAmB5C;SAnBY,gCAAgC","sourcesContent":["import { Component, HostBinding, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';\nimport { Command } from '@coolon/pectin';\nimport { ColumnModel } from '../column-model';\nimport { TableModel } from '../table-model';\n\n@Component({\n selector: 'aup-table-header-cell-renderer',\n templateUrl: './table-header-cell-renderer.component.html',\n styleUrls: ['./table-header-cell-renderer.component.scss']\n})\nexport class TableHeaderCellRendererComponent<Row> {\n\n @Input()\n column: ColumnModel<Row>;\n\n private renderer: any;\n\n @HostBinding('class')\n defaultClassNames = \"aup-header-cell-renderer\"\n\n constructor() {\n }\n\n initialiseHeader(instance: any) {\n if (this.renderer !== instance) {\n this.renderer = instance;\n this.column.initialiseHeader(this.renderer);\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableHeaderCellRendererComponent":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"aup-table-header-cell-renderer","template":"<ng-container [cdkPortalOutlet]=\"column.columnHeaderCellRendererPortal\" (attached)=\"initialiseHeader($event.instance)\"></ng-container>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}"]}]}],"members":{"column":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}}]}],"defaultClassNames":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":3},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseHeader":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-header-cell-renderer.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-header-cell-renderer.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
var TableModel_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import { BooleanValueModelChain, CanIdentify, Dsl, Form, GarbageCollector, lang, ListModel, ListModelChain, MapModelChain, MutableListModel, MutableValueModel, SelectionModel, TrackExternal, Types, UnaryCommand } from '@coolon/pectin';
|
|
4
|
+
import produce from 'immer';
|
|
5
|
+
import { CustomValueColumnModel, EditorControlColumnModel, PropertyColumnModel, SelectionColumnModel } from './column-model';
|
|
6
|
+
// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
|
|
7
|
+
// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
|
|
8
|
+
/**
|
|
9
|
+
* Example:
|
|
10
|
+
* @example
|
|
11
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
12
|
+
* table.pluck("firstName");
|
|
13
|
+
* table.pluck("lastName");
|
|
14
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* Editable tables
|
|
18
|
+
* @example
|
|
19
|
+
* const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
|
|
20
|
+
* if (form.validate()) {
|
|
21
|
+
* // normal form save stuff
|
|
22
|
+
* return true; // finish editing
|
|
23
|
+
* }
|
|
24
|
+
* return false; // continue editiing
|
|
25
|
+
* }
|
|
26
|
+
* const colorsNames: ListModel<string> = ...;
|
|
27
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
28
|
+
* table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
29
|
+
* table.pluck("lastName").cellEditor(StringInputComponent, {
|
|
30
|
+
* validators: [Validator.present("We need a last name")]
|
|
31
|
+
* });
|
|
32
|
+
* table.pluck("age").cellEditor(NumberInputComponent);
|
|
33
|
+
* table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
|
|
34
|
+
* initialiseComponent(component: SelectInputComponent) {
|
|
35
|
+
* selectInput.optionsModel = colorsNames; // <- initialise our component
|
|
36
|
+
* }
|
|
37
|
+
* });
|
|
38
|
+
* table.addEditControls(saveCommand); // <- required to enable editing
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* Selection models
|
|
42
|
+
* @example
|
|
43
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
44
|
+
* table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
|
|
45
|
+
* table.pluck("firstName");
|
|
46
|
+
* table.pluck("lastName");
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* Custom cell renderers and editors
|
|
50
|
+
* @example
|
|
51
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
52
|
+
* table.pluck("favoriteColor")
|
|
53
|
+
* .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
|
|
54
|
+
* // configure your component with what ever you need.
|
|
55
|
+
* });
|
|
56
|
+
* .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
|
|
57
|
+
* .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }
|
|
58
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* I18n
|
|
62
|
+
* @example
|
|
63
|
+
* [table.yml]
|
|
64
|
+
* table:
|
|
65
|
+
* columns(ColumnTextProperties[]):
|
|
66
|
+
* firstName:
|
|
67
|
+
* headerText: "First Name"
|
|
68
|
+
* fullName:
|
|
69
|
+
* headerText: "Full Name"
|
|
70
|
+
*
|
|
71
|
+
* const model = TableModel.fromList(heroList, table => {
|
|
72
|
+
* table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
|
|
73
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
74
|
+
*
|
|
75
|
+
* table.columnTextProperties(I18n.table.columns); // <- configures all columns
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
let TableModel = TableModel_1 = class TableModel {
|
|
79
|
+
constructor(sourceOfTruth) {
|
|
80
|
+
this.sourceOfTruth = sourceOfTruth;
|
|
81
|
+
this._garbage = new GarbageCollector();
|
|
82
|
+
this._columns = new MutableListModel();
|
|
83
|
+
this._editorSessions = new MutableListModel();
|
|
84
|
+
this.identityOf = sourceOfTruth.identityOf;
|
|
85
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this._garbage);
|
|
86
|
+
this._columnsById = chain(this._columns).indexBy('columnId');
|
|
87
|
+
this._rowsBeingEdited = new MutableListModel([], {
|
|
88
|
+
identifiedWith: this.identityOf
|
|
89
|
+
});
|
|
90
|
+
this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');
|
|
91
|
+
this.editing = chain(this._editorSessions).count().isGreaterThan(0);
|
|
92
|
+
this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);
|
|
93
|
+
}
|
|
94
|
+
static fromList(sourceOfTruth, builder) {
|
|
95
|
+
const model = new TableModel_1(sourceOfTruth);
|
|
96
|
+
builder(model);
|
|
97
|
+
return model;
|
|
98
|
+
}
|
|
99
|
+
get rowsBeingEdited() {
|
|
100
|
+
return this._rowsBeingEdited.readonly;
|
|
101
|
+
}
|
|
102
|
+
getTrackByFunction() {
|
|
103
|
+
return (index, item) => {
|
|
104
|
+
return this.identityOf ? this.identityOf(item) : index;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
get columns() {
|
|
108
|
+
return this._columns.readonly;
|
|
109
|
+
}
|
|
110
|
+
pluck(property) {
|
|
111
|
+
return this.addColumn(new PropertyColumnModel(property, this));
|
|
112
|
+
}
|
|
113
|
+
addSelectionColumn(selectionModel) {
|
|
114
|
+
return this.addColumn(new SelectionColumnModel('selection', this, selectionModel));
|
|
115
|
+
}
|
|
116
|
+
addEditControls(saveCommand) {
|
|
117
|
+
this.saveCommand = saveCommand;
|
|
118
|
+
return this.addColumn(new EditorControlColumnModel('editControls', saveCommand, this));
|
|
119
|
+
}
|
|
120
|
+
addCustomColumn(columnId, dataAccessor) {
|
|
121
|
+
return this.addColumn(new CustomValueColumnModel(columnId, this, dataAccessor));
|
|
122
|
+
}
|
|
123
|
+
addColumn(column) {
|
|
124
|
+
if (this._columnsById.get(column.columnId)) {
|
|
125
|
+
lang.illegalState(`Column with id=${column.columnId} already exists`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this._columns.push(column);
|
|
129
|
+
}
|
|
130
|
+
return column;
|
|
131
|
+
}
|
|
132
|
+
columnTextProperties(columnTextProperties) {
|
|
133
|
+
this._columnTextPropertiesLookup = columnTextProperties;
|
|
134
|
+
}
|
|
135
|
+
getColumnTextProperties(column) {
|
|
136
|
+
const factory = this._columnTextPropertiesLookup[column.columnId];
|
|
137
|
+
return factory ? factory() : undefined;
|
|
138
|
+
}
|
|
139
|
+
startEditSession(row) {
|
|
140
|
+
const rowId = this.identityOf(row);
|
|
141
|
+
if (this._rowsBeingEdited.query().indexOf(row) > -1) {
|
|
142
|
+
return lang.illegalState(`Row with id=${rowId} already being edited`);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const editSession = new TableModel_1.EditSession(rowId, row, this.saveCommand);
|
|
146
|
+
const { when } = Dsl.disposeWith(editSession);
|
|
147
|
+
when.valueOf(editSession.rowValueModel).changes((editedValue) => {
|
|
148
|
+
this._rowsBeingEdited.replaceOrPush(editedValue);
|
|
149
|
+
}, { initialValue: 'triggerChangeUnlessNil' });
|
|
150
|
+
this._editorSessions.push(editSession);
|
|
151
|
+
editSession.onDispose(() => {
|
|
152
|
+
this._rowsBeingEdited.remove(editSession.rowValueModel.value);
|
|
153
|
+
this._editorSessions.remove(editSession);
|
|
154
|
+
});
|
|
155
|
+
return editSession;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
getEditSessionFor(row) {
|
|
159
|
+
return this._editorSessionByRowId.get(this.identityOf(row));
|
|
160
|
+
}
|
|
161
|
+
cancelAllEditorSessions() {
|
|
162
|
+
this._editorSessions.runInTransaction((draft) => {
|
|
163
|
+
this._rowsBeingEdited.runInTransaction(() => {
|
|
164
|
+
draft.value.forEach(session => session.dispose());
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
TableModel.ctorParameters = () => [
|
|
170
|
+
{ type: ListModel }
|
|
171
|
+
];
|
|
172
|
+
TableModel = TableModel_1 = __decorate([
|
|
173
|
+
TrackExternal.Strategy(new TrackExternal.OneTimeBinding()),
|
|
174
|
+
__metadata("design:paramtypes", [ListModel])
|
|
175
|
+
], TableModel);
|
|
176
|
+
export { TableModel };
|
|
177
|
+
(function (TableModel) {
|
|
178
|
+
class EditSession extends GarbageCollector {
|
|
179
|
+
constructor(rowId, row, saveCommand) {
|
|
180
|
+
super();
|
|
181
|
+
this.rowId = rowId;
|
|
182
|
+
this.saveCommand = saveCommand;
|
|
183
|
+
this._editorValue = new MutableValueModel();
|
|
184
|
+
this.rowValueModel = this._editorValue.readonly;
|
|
185
|
+
this.form = new Form();
|
|
186
|
+
this.form.load(row);
|
|
187
|
+
this._editorValue.value = row;
|
|
188
|
+
this.form.onEdit(() => {
|
|
189
|
+
this._editorValue.value = produce(this._editorValue.value, draft => {
|
|
190
|
+
this.form.writeDirtyStateTo(draft);
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
TableModel.EditSession = EditSession;
|
|
196
|
+
})(TableModel || (TableModel = {}));
|
|
197
|
+
//# sourceMappingURL=table-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-model.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table-model.ts"],"names":[],"mappings":"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","sourcesContent":["import {\n BooleanValueModelChain,\n CanIdentify,\n Dsl,\n Form,\n GarbageCollector,\n lang,\n ListModel,\n ListModelChain,\n MapModelChain,\n MutableListModel,\n MutableValueModel,\n SelectionModel,\n TrackExternal,\n Types,\n UnaryCommand\n} from '@coolon/pectin';\nimport { PickMutable } from '@coolon/typescript-utilities';\nimport produce from 'immer';\nimport {\n ColumnModel,\n CustomValueColumnModel,\n EditorControlColumnModel,\n PropertyColumnModel,\n SelectionColumnModel\n} from './column-model';\nimport { ColumnTextProperties } from './column-text-properties';\n\n// export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];\n// export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];\n\n\n/**\n * Example:\n * @example\n * const model = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Editable tables\n * @example\n * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {\n * if (form.validate()) {\n * // normal form save stuff\n * return true; // finish editing\n * }\n * return false; // continue editiing\n * }\n * const colorsNames: ListModel<string> = ...;\n * const model = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }\n * table.pluck(\"lastName\").cellEditor(StringInputComponent, {\n * validators: [Validator.present(\"We need a last name\")]\n * });\n * table.pluck(\"age\").cellEditor(NumberInputComponent);\n * table.pluck(\"favoriteColor\").cellEditor(SelectInputComponent, {\n * initialiseComponent(component: SelectInputComponent) {\n * selectInput.optionsModel = colorsNames; // <- initialise our component\n * }\n * });\n * table.addEditControls(saveCommand); // <- required to enable editing\n * });\n *\n * Selection models\n * @example\n * const model = TableModel.fromList(heroList, table => {\n * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * });\n *\n * Custom cell renderers and editors\n * @example\n * const model = TableModel.fromList(heroList, table => {\n * table.pluck(\"favoriteColor\")\n * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {\n * // configure your component with what ever you need.\n * });\n * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }\n * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: FormValueModel<string> | ValueModel<string>; }\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * I18n\n * @example\n * [table.yml]\n * table:\n * columns(ColumnTextProperties[]):\n * firstName:\n * headerText: \"First Name\"\n * fullName:\n * headerText: \"Full Name\"\n *\n * const model = TableModel.fromList(heroList, table => {\n * table.pluck(\"favoriteColor\").cellRenderer(...).cellEditor(...);\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n *\n * table.columnTextProperties(I18n.table.columns); // <- configures all columns\n * });\n */\n@TrackExternal.Strategy(new TrackExternal.OneTimeBinding())\nexport class TableModel<Row> {\n\n private readonly _garbage = new GarbageCollector();\n\n private readonly _columns = new MutableListModel<ColumnModel<Row>>();\n private _columnsById: MapModelChain<string, ColumnModel<Row>>;\n private _editorSessions = new MutableListModel<TableModel.EditSession<Row>>();\n private readonly _rowsBeingEdited: MutableListModel<Row>;\n\n private _columnTextPropertiesLookup: { [columnName: string]: () => ColumnTextProperties };\n\n readonly identityOf: CanIdentify<Row>['identityOf'];\n private saveCommand: UnaryCommand<Form<Row>, boolean>;\n private _editorSessionByRowId: MapModelChain<any, TableModel.EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\n readonly dataSource: ListModelChain<Row>;\n\n static fromList<Row>(sourceOfTruth: ListModel<Row>, builder?: (tableModel: TableModel<Row>) => void): TableModel<Row> {\n const model = new TableModel<Row>(sourceOfTruth);\n builder(model);\n return model;\n }\n\n protected constructor(private sourceOfTruth: ListModel<Row>) {\n this.identityOf = sourceOfTruth.identityOf;\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this._garbage);\n this._columnsById = chain(this._columns).indexBy('columnId');\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: this.identityOf\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this.sourceOfTruth).replaceAll(this.rowsBeingEdited);\n }\n\n get rowsBeingEdited(): ListModel<Row> {\n return this._rowsBeingEdited.readonly;\n }\n\n getTrackByFunction() {\n return (index: number, item: Row) => {\n return this.identityOf ? this.identityOf(item) : index;\n };\n }\n\n get columns(): ListModel<ColumnModel<Row>> {\n return this._columns.readonly;\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P): PropertyColumnModel<Row, P> {\n return this.addColumn(new PropertyColumnModel<Row, P>(property, this));\n }\n\n addSelectionColumn(selectionModel: SelectionModel<Row>): SelectionColumnModel<Row> {\n return this.addColumn(new SelectionColumnModel<Row>('selection', this, selectionModel));\n }\n\n addEditControls(saveCommand: UnaryCommand<Form<Row>, boolean>):EditorControlColumnModel<Row> {\n this.saveCommand = saveCommand;\n return this.addColumn(new EditorControlColumnModel<Row>('editControls', saveCommand, this));\n }\n\n addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V> {\n return this.addColumn(new CustomValueColumnModel<Row, V>(columnId, this, dataAccessor));\n }\n\n protected addColumn<C extends ColumnModel<Row>>(column: C): C {\n if (this._columnsById.get(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n } else {\n this._columns.push(column);\n }\n return column;\n }\n\n columnTextProperties(columnTextProperties: { [columnName: string]: () => ColumnTextProperties }) {\n this._columnTextPropertiesLookup = columnTextProperties;\n }\n\n getColumnTextProperties(column: ColumnModel<Row>): ColumnTextProperties {\n const factory = this._columnTextPropertiesLookup[column.columnId];\n return factory ? factory() : undefined;\n }\n\n startEditSession(row: Row): TableModel.EditSession<Row> {\n const rowId = this.identityOf(row);\n if (this._rowsBeingEdited.query().indexOf(row) > -1) {\n return lang.illegalState(`Row with id=${rowId} already being edited`);\n } else {\n const editSession = new TableModel.EditSession<Row>(rowId, row, this.saveCommand);\n const { when } = Dsl.disposeWith(editSession);\n when.valueOf(editSession.rowValueModel).changes((editedValue) => {\n this._rowsBeingEdited.replaceOrPush(editedValue);\n }, { initialValue: 'triggerChangeUnlessNil' });\n\n this._editorSessions.push(editSession);\n editSession.onDispose(() => {\n this._rowsBeingEdited.remove(editSession.rowValueModel.value);\n this._editorSessions.remove(editSession);\n });\n return editSession;\n }\n }\n\n getEditSessionFor(row: Row): TableModel.EditSession<Row> {\n return this._editorSessionByRowId.get(this.identityOf(row));\n }\n\n cancelAllEditorSessions() {\n this._editorSessions.runInTransaction((draft) => {\n this._rowsBeingEdited.runInTransaction(() => {\n draft.value.forEach(session => session.dispose());\n });\n });\n }\n}\n\nexport namespace TableModel {\n\n\n export class EditSession<Row> extends GarbageCollector {\n readonly form: Form<Row>;\n private _editorValue = new MutableValueModel<Row>();\n readonly rowValueModel = this._editorValue.readonly;\n\n constructor(readonly rowId: any, row: Row, readonly saveCommand: UnaryCommand<Form<Row>, boolean>) {\n super();\n this.form = new Form<Row>();\n this.form.load(row);\n this._editorValue.value = row;\n this.form.onEdit(() => {\n this._editorValue.value = produce(this._editorValue.value, draft => {\n this.form.writeDirtyStateTo(draft as PickMutable<Row>);\n });\n });\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableModel":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":102,"character":1},"member":"Strategy"},"arguments":[{"__symbolic":"new","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":102,"character":28},"member":"OneTimeBinding"}}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":127,"character":47,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":127,"character":57,"context":{"typeName":"Row"}}]}]}],"getTrackByFunction":[{"__symbolic":"method"}],"pluck":[{"__symbolic":"method"}],"addSelectionColumn":[{"__symbolic":"method"}],"addEditControls":[{"__symbolic":"method"}],"addCustomColumn":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"columnTextProperties":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method"}],"startEditSession":[{"__symbolic":"method"}],"getEditSessionFor":[{"__symbolic":"method"}],"cancelAllEditorSessions":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import { Dsl, TrackExternal } from '@coolon/pectin';
|
|
4
|
+
import { DisposableComponent } from '../disposable-component';
|
|
5
|
+
import { TableModel } from './table-model';
|
|
6
|
+
/**
|
|
7
|
+
* Create your model:
|
|
8
|
+
* @example
|
|
9
|
+
* this.heroTableModel = TableModel.fromList(heroList, table => {
|
|
10
|
+
* table.pluck("firstName");
|
|
11
|
+
* table.pluck("lastName");
|
|
12
|
+
* table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* Create your table
|
|
16
|
+
* @example
|
|
17
|
+
* <aup-table [tableModel]="heroTableModel"></aup-table>
|
|
18
|
+
*
|
|
19
|
+
* Styling
|
|
20
|
+
* @example
|
|
21
|
+
* aup-table {
|
|
22
|
+
* --column-gap: 10px; // defaults to 24px
|
|
23
|
+
* aup-table-cell-renderer {
|
|
24
|
+
* &:first-column {
|
|
25
|
+
* // do stuff
|
|
26
|
+
* }
|
|
27
|
+
* &:last-column {
|
|
28
|
+
* // do stuff
|
|
29
|
+
* }
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
*/
|
|
33
|
+
let TableComponent = class TableComponent extends DisposableComponent {
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
ngOnInit() {
|
|
38
|
+
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
39
|
+
this.columns = chain(this.tableModel.columns);
|
|
40
|
+
this.columnIds = chain(this.columns).pluck('columnId');
|
|
41
|
+
}
|
|
42
|
+
isEditing(row) {
|
|
43
|
+
return !!this.tableModel.getEditSessionFor(row);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
__decorate([
|
|
47
|
+
Input(),
|
|
48
|
+
TrackExternal(),
|
|
49
|
+
__metadata("design:type", TableModel)
|
|
50
|
+
], TableComponent.prototype, "tableModel", void 0);
|
|
51
|
+
TableComponent = __decorate([
|
|
52
|
+
Component({
|
|
53
|
+
selector: 'aup-table',
|
|
54
|
+
template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\"></tr>\n\n</table>\n",
|
|
55
|
+
styles: [":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]
|
|
56
|
+
}),
|
|
57
|
+
__metadata("design:paramtypes", [])
|
|
58
|
+
], TableComponent);
|
|
59
|
+
export { TableComponent };
|
|
60
|
+
//# sourceMappingURL=table.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,GAAG,EAAkB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,IAAa,cAAc,GAA3B,MAAa,cAAkB,SAAQ,mBAAmB;IASxD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzF,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;IAED,SAAS,CAAC,GAAM;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;CACF,CAAA;AAlBC;IAFC,KAAK,EAAE;IACP,aAAa,EAAE;8BACJ,UAAU;kDAAI;AAJf,cAAc;IAL1B,SAAS,CAAC;QACT,QAAQ,EAAE,WAAW;QACrB,iyCAAqC;;KAEtC,CAAC;;GACW,cAAc,CAsB1B;SAtBY,cAAc","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport { Dsl, ListModelChain, TrackExternal } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\nimport { ColumnModel } from './column-model';\nimport { TableModel } from './table-model';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * });\n *\n * Create your table\n * @example\n * <aup-table [tableModel]=\"heroTableModel\"></aup-table>\n *\n * Styling\n * @example\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * aup-table-cell-renderer {\n * &:first-column {\n * // do stuff\n * }\n * &:last-column {\n * // do stuff\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-table',\n templateUrl: './table.component.html',\n styleUrls: ['./table.component.scss']\n})\nexport class TableComponent<T> extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n tableModel: TableModel<T>;\n\n columns: ListModelChain<ColumnModel<T>>;\n columnIds: ListModelChain<string>;\n\n constructor() {\n super();\n }\n\n ngOnInit(): void {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.columns = chain(this.tableModel.columns);\n this.columnIds = chain(this.columns).pluck('columnId');\n }\n\n isEditing(row: T): boolean {\n return !!this.tableModel.getEditSessionFor(row);\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":38,"character":39},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":33,"character":1},"arguments":[{"selector":"aup-table","template":"<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.getTrackByFunction()\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value;\"></tr>\n\n</table>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{flex:1}"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":41,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isEditing":[{"__symbolic":"method"}]}}}}]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/table/table.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { HostBinding, InjectionToken } from '@angular/core';
|
|
2
3
|
import { DelegatingValueModel } from '@coolon/pectin';
|
|
3
4
|
import { assert } from '@coolon/typescript-utilities';
|
|
4
5
|
import { DisposableComponent } from '../components/disposable-component';
|
|
@@ -7,6 +8,7 @@ export class Activity extends DisposableComponent {
|
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
9
10
|
this._busyModel = new DelegatingValueModel().withDefault(false);
|
|
11
|
+
this.class = 'aup-activity';
|
|
10
12
|
}
|
|
11
13
|
initialise(nestedInteractionContext, activityContext) {
|
|
12
14
|
assert.isNil(this._activityContext);
|
|
@@ -39,4 +41,8 @@ export class Activity extends DisposableComponent {
|
|
|
39
41
|
return !!this._activityContext;
|
|
40
42
|
}
|
|
41
43
|
}
|
|
44
|
+
__decorate([
|
|
45
|
+
HostBinding('class'),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], Activity.prototype, "class", void 0);
|
|
42
48
|
//# sourceMappingURL=activity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/activity.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAuC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAGzE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,cAAc,CAAM,yBAAyB,CAAC,CAAC;AAEhF,MAAM,OAAgB,QAAwB,SAAQ,mBAAmB;IAAzE;;QAEmB,eAAU,GAAG,IAAI,oBAAoB,EAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAM/D,UAAK,GAAG,cAAc,CAAC;IAyC/C,CAAC;IAvCC,UAAU,CAAC,wBAA4C,EAAE,eAAyC;QAChG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpC,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,mBAAmB,GAAG,wBAAwB,CAAC;IACtD,CAAC;IAED,IAAI,kBAAkB;QACpB,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,IAAI,CAAC,MAAU;QACb,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,KAAS;QACd,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,WAAW;IACX,eAAe;IACf,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IAED,SAAS,CAAC,SAA8B;QACtC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;IAC/B,CAAC;IAED,aAAa;QACX,OAAO,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;CACF;AAzCuB;IAArB,WAAW,CAAC,OAAO,CAAC;;uCAAwB","sourcesContent":["import { HostBinding, InjectionToken } from '@angular/core';\nimport { DelegatingValueModel, GarbageCollector, Trace, ValueModel } from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from './interaction-context';\n\nexport const ACTIVITY_DATA = new InjectionToken<any>('InteractionActivityData');\n\nexport abstract class Activity<D, R, E = any> extends DisposableComponent {\n\n private readonly _busyModel = new DelegatingValueModel<boolean>().withDefault(false);\n private _activityContext: Activity.Callbacks<R, E>;\n\n // @Trace()\n private _interactionContext: InteractionContext;\n\n @HostBinding('class') class = 'aup-activity';\n\n initialise(nestedInteractionContext: InteractionContext, activityContext: Activity.Callbacks<R, E>): void {\n assert.isNil(this._activityContext);\n this._activityContext = activityContext;\n this._interactionContext = nestedInteractionContext;\n }\n\n get interactionContext() {\n assert.isTruthy(this.isInitialised());\n return this._interactionContext;\n }\n\n done(result?: R): void {\n return this._activityContext.onDone(result);\n }\n\n cancel(error?: E): void {\n this._activityContext.onCancel(error);\n }\n\n // @Trace()\n onActivityReady() {\n }\n\n\n get busy(): ValueModel<boolean> {\n return this._busyModel.readonly;\n }\n\n busyWhile(busyModel: ValueModel<boolean>) {\n this._busyModel.setDelegate(busyModel);\n }\n\n isBusy() {\n return this._busyModel.value;\n }\n\n isInitialised() {\n return !!this._activityContext;\n }\n}\n\nexport namespace Activity {\n\n export interface Callbacks<R, E> {\n onDone: (result: R) => void,\n onCancel: (error: E) => void,\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ACTIVITY_DATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":33},"arguments":["InteractionActivityData"]},"Activity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":8,"character":54},"arity":3,"members":{"initialise":[{"__symbolic":"method"}],"done":[{"__symbolic":"method"}],"cancel":[{"__symbolic":"method"}],"onActivityReady":[{"__symbolic":"method"}],"busyWhile":[{"__symbolic":"method"}],"isBusy":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ACTIVITY_DATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":6,"character":33},"arguments":["InteractionActivityData"]},"Activity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":8,"character":54},"arity":3,"members":{"class":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":16,"character":3},"arguments":["class"]}]}],"initialise":[{"__symbolic":"method"}],"done":[{"__symbolic":"method"}],"cancel":[{"__symbolic":"method"}],"onActivityReady":[{"__symbolic":"method"}],"busyWhile":[{"__symbolic":"method"}],"isBusy":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}]}}}}]
|
|
@@ -43,8 +43,8 @@ __decorate([
|
|
|
43
43
|
ActivityActionsComponent = __decorate([
|
|
44
44
|
Component({
|
|
45
45
|
selector: 'aup-activity-actions',
|
|
46
|
-
template: "<button mat-icon-button [pectinCommand]=\"cancelCommand\"
|
|
47
|
-
styles: [":host{display:
|
|
46
|
+
template: "<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n",
|
|
47
|
+
styles: [":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]
|
|
48
48
|
})
|
|
49
49
|
], ActivityActionsComponent);
|
|
50
50
|
export { ActivityActionsComponent };
|
package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-actions.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-actions/activity-actions.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAO1D,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,mBAAmB;IAAjE;;QAcE,UAAK,GAAoB,OAAO,CAAC;IAcnC,CAAC;IAXC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;IAC9B,CAAC;IAED,QAAQ;IACR,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CAEF,CAAA;AAxBC;IAFC,KAAK,EAAE;IACP,aAAa,EAAE;8BACA,OAAO;gEAAM;AAG7B;IADC,KAAK,EAAE;;6DACY;AAIpB;IAFC,KAAK,EAAE;IACP,aAAa,EAAE;8BACD,OAAO;+DAAM;AAG5B;IADC,KAAK,EAAE;;uDACyB;AAGjC;IADC,WAAW,CAAC,iBAAiB,CAAC;;;wDAG9B;AAnBU,wBAAwB;IALpC,SAAS,CAAC;QACT,QAAQ,EAAE,sBAAsB;QAChC,
|
|
1
|
+
{"version":3,"file":"activity-actions.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-actions/activity-actions.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAO1D,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,mBAAmB;IAAjE;;QAcE,UAAK,GAAoB,OAAO,CAAC;IAcnC,CAAC;IAXC,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;IAC9B,CAAC;IAED,QAAQ;IACR,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;CAEF,CAAA;AAxBC;IAFC,KAAK,EAAE;IACP,aAAa,EAAE;8BACA,OAAO;gEAAM;AAG7B;IADC,KAAK,EAAE;;6DACY;AAIpB;IAFC,KAAK,EAAE;IACP,aAAa,EAAE;8BACD,OAAO;+DAAM;AAG5B;IADC,KAAK,EAAE;;uDACyB;AAGjC;IADC,WAAW,CAAC,iBAAiB,CAAC;;;wDAG9B;AAnBU,wBAAwB;IALpC,SAAS,CAAC;QACT,QAAQ,EAAE,sBAAsB;QAChC,gdAAgD;;KAEjD,CAAC;GACW,wBAAwB,CA4BpC;SA5BY,wBAAwB","sourcesContent":["import { Component, HostBinding, Input, OnInit } from '@angular/core';\nimport { Command, TrackExternal } from '@coolon/pectin';\nimport _ from 'lodash';\nimport { DisposableComponent } from '../../../components';\n\n@Component({\n selector: 'aup-activity-actions',\n templateUrl: './activity-actions.component.html',\n styleUrls: ['./activity-actions.component.scss']\n})\nexport class ActivityActionsComponent extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n confirmCommand: Command<any>;\n\n @Input()\n confirmText: string;\n\n @Input()\n @TrackExternal()\n cancelCommand: Command<any>;\n\n @Input()\n align: 'start' | 'end' = 'start';\n\n @HostBinding('class.align-end')\n get alignEnd(): boolean {\n return this.align === 'end';\n }\n\n ngOnInit() {\n }\n\n hasConfirmText() {\n return !_.isEmpty(this.confirmText);\n }\n\n}\n"]}
|
package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"ActivityActionsComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components","name":"DisposableComponent","line":10,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"aup-activity-actions","template":"<button mat-icon-button [pectinCommand]=\"cancelCommand\"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ActivityActionsComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components","name":"DisposableComponent","line":10,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"aup-activity-actions","template":"<button class=\"cancel\" mat-icon-button [pectinCommand]=\"cancelCommand\">\n <mat-icon>clear</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"!hasConfirmText()\" mat-icon-button [pectinCommand]=\"confirmCommand\">\n <mat-icon>done</mat-icon>\n</button>\n<button class=\"confirm\" *ngIf=\"hasConfirmText()\" mat-button [pectinCommand]=\"confirmCommand\">{{confirmText}}</button>\n<div class=\"content\">\n <ng-content></ng-content>\n</div>\n","styles":[":host{display:-ms-grid;display:grid;grid-template-areas:\"cancel confirm content\";-ms-grid-columns:auto auto 1fr;grid-template-columns:auto auto 1fr;-ms-grid-rows:auto;grid-template-rows:auto;align-items:center;justify-content:end}:host.align-end{grid-template-areas:\"content cancel confirm\";-ms-grid-columns:1fr auto auto;grid-template-columns:1fr auto auto}.cancel{-ms-grid-row:1;-ms-grid-column:1;grid-area:cancel}:host.align-end>.cancel{-ms-grid-row:1;-ms-grid-column:2}.confirm{-ms-grid-row:1;-ms-grid-column:2;grid-area:confirm}:host.align-end>.confirm{-ms-grid-row:1;-ms-grid-column:3}.content{-ms-grid-row:1;-ms-grid-column:3;grid-area:content;text-align:left}:host.align-end>.content{-ms-grid-row:1;-ms-grid-column:1}"]}]}],"members":{"confirmCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":12,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":13,"character":3}}]}],"confirmText":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}}]}],"cancelCommand":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":19,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":20,"character":3}}]}],"align":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":23,"character":3}}]}],"alignEnd":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":26,"character":3},"arguments":["class.align-end"]}]}],"ngOnInit":[{"__symbolic":"method"}],"hasConfirmText":[{"__symbolic":"method"}]}}}}]
|