@coolon/angular-ui-powerups 12.4.0 → 12.4.2

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.
Files changed (142) hide show
  1. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +14 -34
  2. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.js +111 -110
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  7. package/esm2015/cypress/component-builder.js +3 -3
  8. package/esm2015/cypress/component-builder.js.map +1 -1
  9. package/esm2015/cypress/component-builder.metadata.json +1 -1
  10. package/esm2015/cypress/components/aup-abstract-table.js +3 -3
  11. package/esm2015/cypress/components/aup-abstract-table.js.map +1 -1
  12. package/esm2015/cypress/components/aup-abstract-table.metadata.json +1 -1
  13. package/esm2015/cypress/components/aup-command.js +2 -2
  14. package/esm2015/cypress/components/aup-command.js.map +1 -1
  15. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  16. package/esm2015/cypress/components/aup-tree-table.js +1 -1
  17. package/esm2015/cypress/components/aup-tree-table.js.map +1 -1
  18. package/esm2015/cypress/components/aup-tree-table.metadata.json +1 -1
  19. package/esm2015/cypress/page-element.js +3 -3
  20. package/esm2015/cypress/page-element.js.map +1 -1
  21. package/esm2015/cypress/page-element.metadata.json +1 -1
  22. package/esm2015/cypress/page.js +3 -3
  23. package/esm2015/cypress/page.js.map +1 -1
  24. package/esm2015/cypress/page.metadata.json +1 -1
  25. package/esm2015/lib/components/busy-overlay/busy-overlay.component.js +1 -1
  26. package/esm2015/lib/components/busy-overlay/busy-overlay.component.metadata.json +1 -1
  27. package/esm2015/lib/components/cards/card-container/card-container.component.js +4 -4
  28. package/esm2015/lib/components/cards/card-container/card-container.component.js.map +1 -1
  29. package/esm2015/lib/components/cards/card-container/card-container.component.metadata.json +1 -1
  30. package/esm2015/lib/components/commands/command/command.component.js +2 -2
  31. package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
  32. package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
  33. package/esm2015/lib/components/commands/command-face.js +8 -8
  34. package/esm2015/lib/components/commands/command-face.js.map +1 -1
  35. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +3 -3
  36. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
  37. package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.metadata.json +1 -1
  38. package/esm2015/lib/components/tables/abstract-table-model.js +3 -3
  39. package/esm2015/lib/components/tables/abstract-table-model.js.map +1 -1
  40. package/esm2015/lib/components/tables/abstract-table-model.metadata.json +1 -1
  41. package/esm2015/lib/components/tables/column-list-model.js +2 -2
  42. package/esm2015/lib/components/tables/column-list-model.js.map +1 -1
  43. package/esm2015/lib/components/tables/column-list-model.metadata.json +1 -1
  44. package/esm2015/lib/components/tables/table/column-model.js +12 -12
  45. package/esm2015/lib/components/tables/table/column-model.js.map +1 -1
  46. package/esm2015/lib/components/tables/table/column-model.metadata.json +1 -1
  47. package/esm2015/lib/components/tables/table/default-cell-renderer/default-cell-renderer.component.js.map +1 -1
  48. package/esm2015/lib/components/tables/tree-table/decorated-tree-node.js +3 -3
  49. package/esm2015/lib/components/tables/tree-table/decorated-tree-node.js.map +1 -1
  50. package/esm2015/lib/components/tables/tree-table/tree-label-column-model.js +2 -2
  51. package/esm2015/lib/components/tables/tree-table/tree-label-column-model.js.map +1 -1
  52. package/esm2015/lib/components/tables/tree-table/tree-label-column-model.metadata.json +1 -1
  53. package/esm2015/lib/components/tables/tree-table/tree-table-model.js +2 -2
  54. package/esm2015/lib/components/tables/tree-table/tree-table-model.js.map +1 -1
  55. package/esm2015/lib/components/tables/tree-table/tree-table-model.metadata.json +1 -1
  56. package/esm2015/lib/components/text/markdown/markdown.component.js +3 -3
  57. package/esm2015/lib/components/text/markdown/markdown.component.js.map +1 -1
  58. package/esm2015/lib/components/text/markdown/markdown.component.metadata.json +1 -1
  59. package/esm2015/lib/directives/highlight.pipe.js +2 -2
  60. package/esm2015/lib/directives/highlight.pipe.js.map +1 -1
  61. package/esm2015/lib/directives/highlight.pipe.metadata.json +1 -1
  62. package/esm2015/lib/interaction/abstract-interaction-context.js.map +1 -1
  63. package/esm2015/lib/interaction/alert.js +3 -3
  64. package/esm2015/lib/interaction/alert.js.map +1 -1
  65. package/esm2015/lib/interaction/components/abstract-dialog.component.js +2 -2
  66. package/esm2015/lib/interaction/components/abstract-dialog.component.js.map +1 -1
  67. package/esm2015/lib/interaction/components/activity-body/activity-body.component.js.map +1 -1
  68. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +3 -3
  69. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
  70. package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
  71. package/esm2015/lib/interaction/components/activity-title/activity-title.component.js +2 -2
  72. package/esm2015/lib/interaction/components/activity-title/activity-title.component.js.map +1 -1
  73. package/esm2015/lib/interaction/components/activity-title/activity-title.component.metadata.json +1 -1
  74. package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.js +2 -2
  75. package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.js.map +1 -1
  76. package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.metadata.json +1 -1
  77. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js +1 -1
  78. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
  79. package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.metadata.json +1 -1
  80. package/esm2015/lib/interaction/components/input-activities/input-activity.js +2 -2
  81. package/esm2015/lib/interaction/components/input-activities/input-activity.js.map +1 -1
  82. package/esm2015/lib/interaction/components/input-activities/input-activity.metadata.json +1 -1
  83. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js +2 -2
  84. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.js.map +1 -1
  85. package/esm2015/lib/interaction/directives/interaction-context-trigger-for.directive.metadata.json +1 -1
  86. package/esm2015/lib/place/components/abstract-place-navigation.component.js +1 -1
  87. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  88. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  89. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +8 -5
  90. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  91. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  92. package/esm2015/lib/place/guards/consolidated-param-map.js +3 -3
  93. package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
  94. package/esm2015/lib/place/guards/consolidated-param-map.metadata.json +1 -1
  95. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +2 -2
  96. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  97. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
  98. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js +2 -2
  99. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
  100. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -1
  101. package/esm2015/lib/place/place-component.js +3 -3
  102. package/esm2015/lib/place/place-component.js.map +1 -1
  103. package/esm2015/lib/place/place-component.metadata.json +1 -1
  104. package/esm2015/lib/place/place-definition.js +5 -5
  105. package/esm2015/lib/place/place-definition.js.map +1 -1
  106. package/esm2015/lib/place/place-definition.metadata.json +1 -1
  107. package/esm2015/lib/place/place-history.js +8 -8
  108. package/esm2015/lib/place/place-history.js.map +1 -1
  109. package/esm2015/lib/place/place-history.metadata.json +1 -1
  110. package/esm2015/lib/place/place.decorator.js +2 -2
  111. package/esm2015/lib/place/place.decorator.js.map +1 -1
  112. package/esm2015/lib/place/place.decorator.metadata.json +1 -1
  113. package/esm2015/lib/place/route/formatter.js +3 -3
  114. package/esm2015/lib/place/route/formatter.js.map +1 -1
  115. package/esm2015/lib/place/route/parameter-definition.js +8 -8
  116. package/esm2015/lib/place/route/parameter-definition.js.map +1 -1
  117. package/esm2015/lib/place/route/parameter-definition.metadata.json +1 -1
  118. package/esm2015/lib/place/url-snapshot.js +3 -3
  119. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  120. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  121. package/esm2015/lib/place/visit.js +5 -5
  122. package/esm2015/lib/place/visit.js.map +1 -1
  123. package/esm2015/lib/place/visit.metadata.json +1 -1
  124. package/fesm2015/coolon-angular-ui-powerups-cypress.js +10 -10
  125. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  126. package/fesm2015/coolon-angular-ui-powerups.js +84 -82
  127. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  128. package/package.json +10 -9
  129. package/schematics/place-routes/place-class-scanner.js +5 -5
  130. package/schematics/place-routes/place-class-scanner.js.map +1 -1
  131. package/schematics/place-routes/place-def.js +5 -5
  132. package/schematics/place-routes/place-def.js.map +1 -1
  133. package/schematics/utils/import-def.js +4 -4
  134. package/schematics/utils/import-def.js.map +1 -1
  135. package/schematics/utils/method-scanner.js +6 -6
  136. package/schematics/utils/method-scanner.js.map +1 -1
  137. package/schematics/utils/path-helper.js +4 -4
  138. package/schematics/utils/path-helper.js.map +1 -1
  139. package/schematics/utils/source-file-scanner.js +5 -5
  140. package/schematics/utils/source-file-scanner.js.map +1 -1
  141. package/schematics/utils/source-file-utilities.js +2 -2
  142. package/schematics/utils/source-file-utilities.js.map +1 -1
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Component, ElementRef, HostBinding, Inject, Input, Optional } from '@angular/core';
3
3
  import { Command, Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';
4
- import _ from 'lodash';
4
+ import { isEmpty } from 'lodash-es';
5
5
  import { HorizontalAlignment } from '../../alignment';
6
6
  import { CommandFace } from '../command-face';
7
7
  import { PopupAwareComponent } from '../group/popup-aware.component';
@@ -26,7 +26,7 @@ export class CommandComponent extends PopupAwareComponent {
26
26
  this.color$ = chain(this.activeFace$).map(f => CommandFace.getColorOf(f));
27
27
  this.tooltip$ = chain(this.activeFace$).map(f => CommandFace.getTooltipOf(f));
28
28
  this.iconOnly$ = this.faces$.select(face => {
29
- return _.isEmpty(CommandFace.getTextOf(face)) && !_.isEmpty(CommandFace.getIconOf(face));
29
+ return isEmpty(CommandFace.getTextOf(face)) && !isEmpty(CommandFace.getIconOf(face));
30
30
  }).count().equals(this.faces$.count());
31
31
  }
32
32
  isActive(face) {
@@ -1 +1 @@
1
- {"version":3,"file":"command.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/command/command.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnH,OAAO,EAEL,OAAO,EACP,GAAG,EAEH,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAE3E;;GAEG;AAMH,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IA+BvD,YAAY,OAAmB,EAAuC,MAAuB;QAC3F,KAAK,CAAC,OAAO,EAAE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AAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACzC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3F,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CAAC,IAAiB;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ;IACR,CAAC;IAED,eAAe;QACb,0DAA0D;IAC5D,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;;;YAnEF,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;gBACvB,y/CAAuC;;aAExC;;;YA1BkC,UAAU;4CA0DT,MAAM,SAAC,eAAe,cAAG,QAAQ;;;sBA7BlE,KAAK;wBAGL,KAAK;mBAGL,KAAK;4BAGL,KAAK;uBAGL,KAAK;wBAKL,KAAK,YACL,WAAW,SAAC,OAAO;;AAjBpB;IADU,aAAa,EAAE;8BAChB,OAAO;iDAAU;AAG1B;IADU,aAAa,EAAE;8BACd,UAAU;mDAAc;AAGnC;IADU,iBAAiB,CAAC,WAAW,CAAC;;8CACtB;AAGlB;IADU,aAAa,EAAE;8BACV,UAAU;uDAAc;AAGvC;IADU,iBAAiB,CAAC,eAAe,CAAC;;kDACtB","sourcesContent":["import { AfterViewInit, Component, ElementRef, HostBinding, Inject, Input, OnInit, Optional } from '@angular/core';\n\nimport {\n BooleanValueModelChain,\n Command,\n Dsl,\n ListModelChain,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { Enum } from 'typescript-string-enums';\nimport { HorizontalAlignment } from '../../alignment';\nimport { CommandFace } from '../command-face';\nimport { PopupAwareComponent } from '../group/popup-aware.component';\nimport { POPUP_CONTAINER, PopupContainer } from '../group/popup-container';\n\n/**\n *\n */\n@Component({\n selector: 'aup-command',\n templateUrl: './command.component.html',\n styleUrls: ['./command.component.scss']\n})\nexport class CommandComponent extends PopupAwareComponent implements OnInit, AfterViewInit {\n\n @Input() @TrackExternal()\n command: Command<unknown>;\n\n @Input() @TrackExternal()\n faceModel: ValueModel<CommandFace>;\n\n @Input() @StoreInValueModel('faceModel')\n face: CommandFace;\n\n @Input() @TrackExternal()\n busyFaceModel: ValueModel<CommandFace>;\n\n @Input() @StoreInValueModel('busyFaceModel')\n busyFace: CommandFace;\n\n CommandFace = CommandFace;\n\n @Input()\n @HostBinding(\"class\")\n alignFace: HorizontalAlignment = HorizontalAlignment.CENTER;\n\n readonly faces$: ListModelChain<CommandFace>;\n readonly buttonStyle$: ValueModelChain<string>;\n readonly color$: ValueModelChain<'primary' | 'accent' | 'warn' | undefined>;\n private activeFace$: ValueModelChain<CommandFace>;\n\n readonly iconOnly$: BooleanValueModelChain;\n readonly tooltip$: ValueModelChain<string>;\n\n constructor(element: ElementRef, @Inject(POPUP_CONTAINER) @Optional() parent?: PopupContainer) {\n super(element, parent);\n const { chain, switchOn } = Dsl.disposeWith(this);\n this.faces$ = chain(this.command.busy).mapToList(busy => {\n return busy ?\n [this.busyFaceModel.value, this.faceModel.value] :\n [this.faceModel.value, this.busyFaceModel.value];\n }, { allowNil: true, dependsOn: [this.faceModel, this.busyFaceModel] })\n .rejectNil();\n this.activeFace$ = this.faces$.first();\n this.buttonStyle$ = chain(this.activeFace$).map(f => CommandFace.getStyleOf(f));\n this.color$ = chain(this.activeFace$).map(f => CommandFace.getColorOf(f));\n this.tooltip$ = chain(this.activeFace$).map(f => CommandFace.getTooltipOf(f));\n this.iconOnly$ = this.faces$.select(face => {\n return _.isEmpty(CommandFace.getTextOf(face)) && !_.isEmpty(CommandFace.getIconOf(face));\n }).count().equals(this.faces$.count());\n }\n\n isActive(face: CommandFace): boolean {\n return this.activeFace$.query().equals(face);\n }\n\n ngOnInit() {\n }\n\n ngAfterViewInit(): void {\n // console.log(this.element.nativeElement.previousSibling)\n }\n\n getFace(): CommandFace | undefined {\n return this.face;\n }\n\n\n}\n\n"]}
1
+ {"version":3,"file":"command.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/command/command.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEnH,OAAO,EAEL,OAAO,EACP,GAAG,EAEH,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAE3E;;GAEG;AAMH,MAAM,OAAO,gBAAiB,SAAQ,mBAAmB;IA+BvD,YAAY,OAAmB,EAAuC,MAAuB;QAC3F,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAfzB,gBAAW,GAAG,WAAW,CAAC;QAI1B,cAAS,GAAwB,mBAAmB,CAAC,MAAM,CAAC;QAY1D,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAA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C,KAAK,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,QAAQ,CAAC,IAAiB;QACxB,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED,QAAQ;IACR,CAAC;IAED,eAAe;QACb,0DAA0D;IAC5D,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;;;YAnEF,SAAS,SAAC;gBACT,QAAQ,EAAE,aAAa;gBACvB,y/CAAuC;;aAExC;;;YA3BkC,UAAU;4CA2DT,MAAM,SAAC,eAAe,cAAG,QAAQ;;;sBA7BlE,KAAK;wBAGL,KAAK;mBAGL,KAAK;4BAGL,KAAK;uBAGL,KAAK;wBAKL,KAAK,YACL,WAAW,SAAC,OAAO;;AAjBpB;IADU,aAAa,EAAE;8BAChB,OAAO;iDAAU;AAG1B;IADU,aAAa,EAAE;8BACd,UAAU;mDAAc;AAGnC;IADU,iBAAiB,CAAC,WAAW,CAAC;;8CACtB;AAGlB;IADU,aAAa,EAAE;8BACV,UAAU;uDAAc;AAGvC;IADU,iBAAiB,CAAC,eAAe,CAAC;;kDACtB","sourcesContent":["import { AfterViewInit, Component, ElementRef, HostBinding, Inject, Input, OnInit, Optional } from '@angular/core';\n\nimport {\n BooleanValueModelChain,\n Command,\n Dsl,\n ListModelChain,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\n\nimport { isEmpty } from 'lodash-es';\nimport { Enum } from 'typescript-string-enums';\nimport { HorizontalAlignment } from '../../alignment';\nimport { CommandFace } from '../command-face';\nimport { PopupAwareComponent } from '../group/popup-aware.component';\nimport { POPUP_CONTAINER, PopupContainer } from '../group/popup-container';\n\n/**\n *\n */\n@Component({\n selector: 'aup-command',\n templateUrl: './command.component.html',\n styleUrls: ['./command.component.scss']\n})\nexport class CommandComponent extends PopupAwareComponent implements OnInit, AfterViewInit {\n\n @Input() @TrackExternal()\n command: Command<unknown>;\n\n @Input() @TrackExternal()\n faceModel: ValueModel<CommandFace>;\n\n @Input() @StoreInValueModel('faceModel')\n face: CommandFace;\n\n @Input() @TrackExternal()\n busyFaceModel: ValueModel<CommandFace>;\n\n @Input() @StoreInValueModel('busyFaceModel')\n busyFace: CommandFace;\n\n CommandFace = CommandFace;\n\n @Input()\n @HostBinding(\"class\")\n alignFace: HorizontalAlignment = HorizontalAlignment.CENTER;\n\n readonly faces$: ListModelChain<CommandFace>;\n readonly buttonStyle$: ValueModelChain<string>;\n readonly color$: ValueModelChain<'primary' | 'accent' | 'warn' | undefined>;\n private activeFace$: ValueModelChain<CommandFace>;\n\n readonly iconOnly$: BooleanValueModelChain;\n readonly tooltip$: ValueModelChain<string>;\n\n constructor(element: ElementRef, @Inject(POPUP_CONTAINER) @Optional() parent?: PopupContainer) {\n super(element, parent);\n const { chain, switchOn } = Dsl.disposeWith(this);\n this.faces$ = chain(this.command.busy).mapToList(busy => {\n return busy ?\n [this.busyFaceModel.value, this.faceModel.value] :\n [this.faceModel.value, this.busyFaceModel.value];\n }, { allowNil: true, dependsOn: [this.faceModel, this.busyFaceModel] })\n .rejectNil();\n this.activeFace$ = this.faces$.first();\n this.buttonStyle$ = chain(this.activeFace$).map(f => CommandFace.getStyleOf(f));\n this.color$ = chain(this.activeFace$).map(f => CommandFace.getColorOf(f));\n this.tooltip$ = chain(this.activeFace$).map(f => CommandFace.getTooltipOf(f));\n this.iconOnly$ = this.faces$.select(face => {\n return isEmpty(CommandFace.getTextOf(face)) && !isEmpty(CommandFace.getIconOf(face));\n }).count().equals(this.faces$.count());\n }\n\n isActive(face: CommandFace): boolean {\n return this.activeFace$.query().equals(face);\n }\n\n ngOnInit() {\n }\n\n ngAfterViewInit(): void {\n // console.log(this.element.nativeElement.previousSibling)\n }\n\n getFace(): CommandFace | undefined {\n return this.face;\n }\n\n\n}\n\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"CommandComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../group/popup-aware.component","name":"PopupAwareComponent","line":27,"character":38},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":22,"character":1},"arguments":[{"selector":"aup-command","template":"<ng-container *ngIf=\"iconOnly$.value\">\n <button mat-icon-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n</ng-container>\n<ng-container *ngIf=\"!iconOnly$.value\">\n <ng-container [ngSwitch]=\"buttonStyle$.value\">\n <ng-container *ngSwitchCase=\"CommandFace.Style.STROKED\">\n <button mat-stroked-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"CommandFace.Style.RAISED\">\n <button mat-raised-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button mat-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n </ng-container>\n</ng-container>\n","styles":[":host{display:inline-flex;flex-direction:row;justify-content:stretch}:host.centered button{text-align:center}:host.start button{text-align:start}:host.end button{text-align:end}button{flex:1}\n"]}]}],"members":{"command":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":29,"character":12}}]}],"faceModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":32,"character":12}}]}],"face":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":35,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":35,"character":12},"arguments":["faceModel"]}]}],"busyFaceModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":38,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":38,"character":12}}]}],"busyFace":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":41,"character":12},"arguments":["busyFaceModel"]}]}],"alignFace":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":47,"character":3},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":58,"character":36},"arguments":[{"__symbolic":"reference","module":"../group/popup-container","name":"POPUP_CONTAINER","line":58,"character":43}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":58,"character":61}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":58,"character":23},{"__symbolic":"reference","module":"../group/popup-container","name":"PopupContainer","line":58,"character":81}]}],"isActive":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"getFace":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"CommandComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../group/popup-aware.component","name":"PopupAwareComponent","line":28,"character":38},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":23,"character":1},"arguments":[{"selector":"aup-command","template":"<ng-container *ngIf=\"iconOnly$.value\">\n <button mat-icon-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n</ng-container>\n<ng-container *ngIf=\"!iconOnly$.value\">\n <ng-container [ngSwitch]=\"buttonStyle$.value\">\n <ng-container *ngSwitchCase=\"CommandFace.Style.STROKED\">\n <button mat-stroked-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchCase=\"CommandFace.Style.RAISED\">\n <button mat-raised-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <button mat-button [pectinCommand]=\"command\" [color]=\"color$.value\" [class.busy]=\"command.busy.value\"\n [matTooltip]=\"tooltip$.value\">\n <aup-command-face [class]=\"alignFace\" [faces]=\"faces$.value\"></aup-command-face>\n </button>\n </ng-container>\n </ng-container>\n</ng-container>\n","styles":[":host{display:inline-flex;flex-direction:row;justify-content:stretch}:host.centered button{text-align:center}:host.start button{text-align:start}:host.end button{text-align:end}button{flex:1}\n"]}]}],"members":{"command":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":30,"character":12}}]}],"faceModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":33,"character":12}}]}],"face":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":36,"character":12},"arguments":["faceModel"]}]}],"busyFaceModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":39,"character":12}}]}],"busyFace":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":42,"character":12},"arguments":["busyFaceModel"]}]}],"alignFace":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":48,"character":3},"arguments":["class"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":59,"character":36},"arguments":[{"__symbolic":"reference","module":"../group/popup-container","name":"POPUP_CONTAINER","line":59,"character":43}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":59,"character":61}}]],"parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":59,"character":23},{"__symbolic":"reference","module":"../group/popup-container","name":"PopupContainer","line":59,"character":81}]}],"isActive":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"getFace":[{"__symbolic":"method"}]}}}}]
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
3
- import _ from 'lodash';
2
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator';
3
+ import { isFunction } from 'lodash-es';
4
4
  import { Enum } from 'typescript-string-enums';
5
5
  export var CommandFace;
6
6
  (function (CommandFace) {
@@ -15,27 +15,27 @@ export var CommandFace;
15
15
  RAISED: 'raised'
16
16
  });
17
17
  function getColorOf(face) {
18
- return _.isFunction(face === null || face === void 0 ? void 0 : face.color) ? face.color() : undefined;
18
+ return isFunction(face === null || face === void 0 ? void 0 : face.color) ? face.color() : undefined;
19
19
  }
20
20
  CommandFace.getColorOf = getColorOf;
21
21
  function getStyleOf(face) {
22
- return _.isFunction(face === null || face === void 0 ? void 0 : face.style) ? face.style() : undefined;
22
+ return isFunction(face === null || face === void 0 ? void 0 : face.style) ? face.style() : undefined;
23
23
  }
24
24
  CommandFace.getStyleOf = getStyleOf;
25
25
  function getIconOf(face) {
26
- return _.isFunction(face === null || face === void 0 ? void 0 : face.icon) ? face.icon() : undefined;
26
+ return isFunction(face === null || face === void 0 ? void 0 : face.icon) ? face.icon() : undefined;
27
27
  }
28
28
  CommandFace.getIconOf = getIconOf;
29
29
  function getIconPositionOf(face) {
30
- return _.isFunction(face === null || face === void 0 ? void 0 : face.iconPosition) ? face.iconPosition() : undefined;
30
+ return isFunction(face === null || face === void 0 ? void 0 : face.iconPosition) ? face.iconPosition() : undefined;
31
31
  }
32
32
  CommandFace.getIconPositionOf = getIconPositionOf;
33
33
  function getTooltipOf(face) {
34
- return _.isFunction(face === null || face === void 0 ? void 0 : face.tooltip) ? face.tooltip() : undefined;
34
+ return isFunction(face === null || face === void 0 ? void 0 : face.tooltip) ? face.tooltip() : undefined;
35
35
  }
36
36
  CommandFace.getTooltipOf = getTooltipOf;
37
37
  function getTextOf(face) {
38
- return _.isFunction(face === null || face === void 0 ? void 0 : face.text) ? face.text() : undefined;
38
+ return isFunction(face === null || face === void 0 ? void 0 : face.text) ? face.text() : undefined;
39
39
  }
40
40
  CommandFace.getTextOf = getTextOf;
41
41
  class Adapter {
@@ -1 +1 @@
1
- {"version":3,"file":"command-face.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/command-face.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAiB/C,MAAM,KAAW,WAAW,CAmF3B;AAnFD,WAAiB,WAAW;IAE1B,IAAY,QAGX;IAHD,WAAY,QAAQ;QAClB,2BAAe,CAAA;QACf,uBAAW,CAAA;IACb,CAAC,EAHW,QAAQ,GAAR,oBAAQ,KAAR,oBAAQ,QAGnB;IAEY,iBAAK,GAAG,IAAI,CAAC;QACxB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,QAAQ;KACjB,CAAC,CAAC;IAGH,SAAgB,UAAU,CAAC,IAAiB;QAC1C,OAAO,CAAC,CAAC,UAAU,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EAAkB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,CAAC;IAFe,sBAAU,aAEzB,CAAA;IAED,SAAgB,UAAU,CAAC,IAAiB;QAC1C,OAA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CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAGD,IAAI,IAAI;YACN,OAAO,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,CAAC;QAGD,IAAI,YAAY;YACd,OAAO,WAAW,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,CAAC;QAGD,IAAI,OAAO;YACT,OAAO,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QAGD,IAAI,iBAAiB;YACnB,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;QAC1D,CAAC;QAGD,IAAI,eAAe;YACjB,OAAO,IAAI,CAAC,YAAY,KAAK,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QACxD,CAAC;QAGD,IAAI,KAAK;YACP,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAGD,IAAI,KAAK;YACP,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;KAEF;IAvCC;QADC,OAAO,EAAE;;;uCAGT;IAGD;QADC,OAAO,EAAE;;;uCAGT;IAGD;QADC,OAAO,EAAE;;;+CAGT;IAGD;QADC,OAAO,EAAE;;;0CAGT;IAGD;QADC,OAAO,EAAE;;;oDAGT;IAGD;QADC,OAAO,EAAE;;;kDAGT;IAGD;QADC,OAAO,EAAE;;;wCAGT;IAGD;QADC,OAAO,EAAE;;;wCAGT;IA1CU,mBAAO,UA4CnB,CAAA;AACH,CAAC,EAnFgB,WAAW,KAAX,WAAW,QAmF3B","sourcesContent":["import { ThemePalette } from '@angular/material/core';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport _ from 'lodash';\nimport { Enum } from 'typescript-string-enums';\nimport { assert } from '@coolon/pectin';\n\nexport interface CommandFace {\n text?(): string;\n\n icon?(): string;\n\n iconPosition?(): string;\n\n tooltip?(): string;\n\n color?(): string; // ThemePalette\n\n style?(): string; // CommandFace.Style;\n}\n\nexport namespace CommandFace {\n\n export enum Position {\n START = 'start',\n END = 'end'\n }\n\n export const Style = Enum({\n FLAT: 'flat',\n STROKED: 'stroked',\n RAISED: 'raised'\n });\n export type Style = Enum<typeof Style>;\n\n export function getColorOf(face: CommandFace): ThemePalette {\n return _.isFunction(face?.color) ? face.color() as ThemePalette : undefined;\n }\n\n export function getStyleOf(face: CommandFace): Style {\n return _.isFunction(face?.style) ? face.style() as Style : undefined;\n }\n\n export function getIconOf(face: CommandFace) {\n return _.isFunction(face?.icon) ? face.icon() : undefined;\n }\n\n export function getIconPositionOf(face: CommandFace) {\n return _.isFunction(face?.iconPosition) ? face.iconPosition() : undefined;\n }\n\n export function getTooltipOf(face: CommandFace) {\n return _.isFunction(face?.tooltip) ? face.tooltip() : undefined;\n }\n\n export function getTextOf(face: CommandFace) {\n return _.isFunction(face?.text) ? face.text() : undefined;\n }\n\n export class Adapter {\n constructor(readonly face: CommandFace) {\n }\n\n @Memoize()\n get text() {\n return CommandFace.getTextOf(this.face);\n }\n\n @Memoize()\n get icon() {\n return CommandFace.getIconOf(this.face);\n }\n\n @Memoize()\n get iconPosition() {\n return CommandFace.getIconPositionOf(this.face);\n }\n\n @Memoize()\n get tooltip() {\n return CommandFace.getTooltipOf(this.face);\n }\n\n @Memoize()\n get iconPositionStart(): boolean {\n return this.iconPosition === CommandFace.Position.START;\n }\n\n @Memoize()\n get iconPositionEnd(): boolean {\n return this.iconPosition === CommandFace.Position.END;\n }\n\n @Memoize()\n get color(): ThemePalette {\n return CommandFace.getColorOf(this.face);\n }\n\n @Memoize()\n get style(): Style {\n return CommandFace.getStyleOf(this.face);\n }\n\n }\n}\n"]}
1
+ {"version":3,"file":"command-face.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/commands/command-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AAC;QACxD,CAAC;QAGD,IAAI,KAAK;YACP,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAGD,IAAI,KAAK;YACP,OAAO,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;KAEF;IAvCC;QADC,OAAO,EAAE;;;uCAGT;IAGD;QADC,OAAO,EAAE;;;uCAGT;IAGD;QADC,OAAO,EAAE;;;+CAGT;IAGD;QADC,OAAO,EAAE;;;0CAGT;IAGD;QADC,OAAO,EAAE;;;oDAGT;IAGD;QADC,OAAO,EAAE;;;kDAGT;IAGD;QADC,OAAO,EAAE;;;wCAGT;IAGD;QADC,OAAO,EAAE;;;wCAGT;IA1CU,mBAAO,UA4CnB,CAAA;AACH,CAAC,EAnFgB,WAAW,KAAX,WAAW,QAmF3B","sourcesContent":["import { ThemePalette } from '@angular/material/core';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\n\nimport { isFunction } from 'lodash-es';\nimport { Enum } from 'typescript-string-enums';\nimport { assert } from '@coolon/pectin';\n\nexport interface CommandFace {\n text?(): string;\n\n icon?(): string;\n\n iconPosition?(): string;\n\n tooltip?(): string;\n\n color?(): string; // ThemePalette\n\n style?(): string; // CommandFace.Style;\n}\n\nexport namespace CommandFace {\n\n export enum Position {\n START = 'start',\n END = 'end'\n }\n\n export const Style = Enum({\n FLAT: 'flat',\n STROKED: 'stroked',\n RAISED: 'raised'\n });\n export type Style = Enum<typeof Style>;\n\n export function getColorOf(face: CommandFace): ThemePalette {\n return isFunction(face?.color) ? face.color() as ThemePalette : undefined;\n }\n\n export function getStyleOf(face: CommandFace): Style {\n return isFunction(face?.style) ? face.style() as Style : undefined;\n }\n\n export function getIconOf(face: CommandFace) {\n return isFunction(face?.icon) ? face.icon() : undefined;\n }\n\n export function getIconPositionOf(face: CommandFace) {\n return isFunction(face?.iconPosition) ? face.iconPosition() : undefined;\n }\n\n export function getTooltipOf(face: CommandFace) {\n return isFunction(face?.tooltip) ? face.tooltip() : undefined;\n }\n\n export function getTextOf(face: CommandFace) {\n return isFunction(face?.text) ? face.text() : undefined;\n }\n\n export class Adapter {\n constructor(readonly face: CommandFace) {\n }\n\n @Memoize()\n get text() {\n return CommandFace.getTextOf(this.face);\n }\n\n @Memoize()\n get icon() {\n return CommandFace.getIconOf(this.face);\n }\n\n @Memoize()\n get iconPosition() {\n return CommandFace.getIconPositionOf(this.face);\n }\n\n @Memoize()\n get tooltip() {\n return CommandFace.getTooltipOf(this.face);\n }\n\n @Memoize()\n get iconPositionStart(): boolean {\n return this.iconPosition === CommandFace.Position.START;\n }\n\n @Memoize()\n get iconPositionEnd(): boolean {\n return this.iconPosition === CommandFace.Position.END;\n }\n\n @Memoize()\n get color(): ThemePalette {\n return CommandFace.getColorOf(this.face);\n }\n\n @Memoize()\n get style(): Style {\n return CommandFace.getStyleOf(this.face);\n }\n\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
3
3
  import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal } from '@coolon/pectin';
4
- import _ from 'lodash';
4
+ import { isEmpty, isString } from 'lodash-es';
5
5
  import { AbstractValueInputComponent } from '../abstract-value-input.component';
6
6
  /**
7
7
  * Using templates (not only supported for nil values:
@@ -16,10 +16,10 @@ export class AutocompleteInputComponent extends AbstractValueInputComponent {
16
16
  this.optionLabelFormat = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;
17
17
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
18
18
  const lowerCaseFilterValue = chain(this.filterValue)
19
- .map(v => _.isString(v) ? v.toLowerCase() : '');
19
+ .map(v => isString(v) ? v.toLowerCase() : '');
20
20
  this.filteredOptions = chain(this.optionsModel)
21
21
  .select(option => {
22
- return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
22
+ return isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
23
23
  }, { dependsOn: lowerCaseFilterValue });
24
24
  }
25
25
  ngOnInit() {
@@ -1 +1 @@
1
- {"version":3,"file":"autocomplete-input.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;GAKG;AAMH,MAAM,OAAO,0BAAoC,SAAQ,2BAA8B;IAuBrF;QACE,KAAK,EAAE,CAAC;QAPF,gBAAW,GAAG,IAAI,iBAAiB,EAAU,CAAC;QAItD,sBAAiB,GAAuB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAInH,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,MAAO,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC;aAClD,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAElD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC;aAC5C,MAAM,CAAC,MAAM,CAAC,EAAE;YACf,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC3I,CAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ;IACR,CAAC;IAED,YAAY,CAAC,MAAS;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC;IAClC,CAAC;IAED,QAAQ,CAAC,MAAoC;QAC3C,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,CAAC;;;YArDF,SAAS,SAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,+zCAAkD;;aAEnD;;;;2BAGE,KAAK;sBAGL,KAAK;0BAGL,KAAK;uBAGL,KAAK;mCAGL,YAAY,SAAC,mBAAmB;gCAMhC,KAAK;;AAjBN;IADU,aAAa,EAAE;8BACX,SAAS;gEAAI;AAG3B;IADU,gBAAgB,CAAC,cAAc,CAAC;;2DAC7B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => _.isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
1
+ {"version":3,"file":"autocomplete-input.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAA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,EAAE,oBAAoB,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,QAAQ;IACR,CAAC;IAED,YAAY,CAAC,MAAS;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,YAAY,CAAC,MAAc;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC;IAClC,CAAC;IAED,QAAQ,CAAC,MAAoC;QAC3C,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,CAAC;;;YArDF,SAAS,SAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,+zCAAkD;;aAEnD;;;;2BAGE,KAAK;sBAGL,KAAK;0BAGL,KAAK;uBAGL,KAAK;mCAGL,YAAY,SAAC,mBAAmB;gCAMhC,KAAK;;AAjBN;IADU,aAAa,EAAE;8BACX,SAAS;gEAAI;AAG3B;IADU,gBAAgB,CAAC,cAAc,CAAC;;2DAC7B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\n\nimport { isEmpty, isString } from 'lodash-es';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"AutocompleteInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-value-input.component","name":"AbstractValueInputComponent","line":25,"character":57},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":20,"character":1},"arguments":[{"selector":"aup-autocomplete-input","template":"<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div>{{placeholder}}</div>\n <div class=\"item\" *ngFor=\"let item of options\">{{optionLabelFormat(item)}}</div>\n</div>\n","styles":[":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}\n"]}]}],"members":{"optionsModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":27,"character":12}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":30,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":30,"character":12},"arguments":["optionsModel"]}]}],"optionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":33,"character":3}}]}],"allowNil":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}}]}],"nilOptionTemplateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":39,"character":3},"arguments":["nilOptionTemplate"]}]}],"optionLabelFormat":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":45,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"formatOption":[{"__symbolic":"method"}],"updateFilter":[{"__symbolic":"method"}],"onSelect":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"AutocompleteInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-value-input.component","name":"AbstractValueInputComponent","line":26,"character":57},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":21,"character":1},"arguments":[{"selector":"aup-autocomplete-input","template":"<mat-form-field appearance=\"standard\" [floatLabel]=\"floatLabel\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <input type=\"string\"\n matInput\n [matAutocomplete]=\"autocomplete\"\n placeholder=\"{{placeholder}}\"\n [ngModel]=\"componentValueModel.value\"\n (ngModelChange)=\"updateFilter($event)\"\n [disabled]=\"!enabled.value\"\n (keydown.enter)=\"notifyEnterKey()\"\n (keydown.escape)=\"notifyEscapeKey()\"\n [pectinFocusBinding]=\"focusContext\"\n [errorStateMatcher]=\"errorStateMatcher\"\n >\n <mat-autocomplete #autocomplete [displayWith]=\"optionLabelFormat\" [autoActiveFirstOption]=\"true\" (optionSelected)=\"onSelect($event)\">\n <mat-option *ngFor=\"let option of filteredOptions.value; let i = index\"\n [value]=\"option\"\n >{{formatOption(option)}}</mat-option>\n <mat-option *ngIf=\"allowNil\">{{placeholder}}</mat-option>\n </mat-autocomplete>\n\n <mat-hint *ngIf=\"showHint\">{{hint}}</mat-hint>\n <mat-error *ngIf=\"hasErrors\">{{firstError}}</mat-error>\n</mat-form-field>\n<div class=\"width-strut\">\n <mat-label *ngIf=\"label\">{{label}}</mat-label>\n <div>{{placeholder}}</div>\n <div class=\"item\" *ngFor=\"let item of options\">{{optionLabelFormat(item)}}</div>\n</div>\n","styles":[":host{display:inline-block}mat-form-field{width:100%}.width-strut{display:block;height:0;max-height:0;width:auto;visibility:hidden;overflow:hidden;padding-right:35px}.width-strut mat-label{font-size:75%}.width-strut>.item{font-size:16px;padding-left:0}\n"]}]}],"members":{"optionsModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":28,"character":12}}]}],"options":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":31,"character":12},"arguments":["optionsModel"]}]}],"optionLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":34,"character":3}}]}],"allowNil":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":37,"character":3}}]}],"nilOptionTemplateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":40,"character":3},"arguments":["nilOptionTemplate"]}]}],"optionLabelFormat":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"formatOption":[{"__symbolic":"method"}],"updateFilter":[{"__symbolic":"method"}],"onSelect":[{"__symbolic":"method"}]}}}}]
@@ -1,5 +1,5 @@
1
1
  import { assert, DelegatingListModel, DirtyTrackingForm, Dsl, EventListenerList, GarbageCollector, lang, MutableListModel, TrackExternal, ValueModel } from '@coolon/pectin';
2
- import * as _ from 'lodash';
2
+ import { isFunction, isNil } from 'lodash-es';
3
3
  import { ColumnListModel } from './column-list-model';
4
4
  import { EditSession } from './edit-session';
5
5
  import { CustomTemplateColumnModel, CustomValueColumnModel, EditorControlColumnModel, ListPropertyColumnModel, PropertyColumnModel, SelectionColumnModel } from './table/column-model';
@@ -70,14 +70,14 @@ export class AbstractTableModel extends GarbageCollector {
70
70
  this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
71
71
  this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));
72
72
  const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
73
- if (!_.isNil(visible)) {
73
+ if (!isNil(visible)) {
74
74
  selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));
75
75
  }
76
76
  return selectionColumnModel;
77
77
  }
78
78
  addEditControls(saveCommandFactory, formFactory) {
79
79
  this.saveCommandFactory = saveCommandFactory;
80
- if (_.isFunction(formFactory)) {
80
+ if (isFunction(formFactory)) {
81
81
  this._createForm = formFactory;
82
82
  }
83
83
  const columnId = 'editControls';
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-table-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAGN,mBAAmB,EACnB,iBAAiB,EAEjB,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EAIJ,gBAAgB,EAEhB,aAAa,EAEb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAGL,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAEvB,mBAAmB,EACnB,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AC;IAED,SAAS,CAAC,GAAQ;;QAChB,MAAA,IAAI,CAAC,oBAAoB,0CAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,YAAY,CAAC,QAA4B;QACvC,OAAO,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC;IAED,kBAAkB,CAAC,WAA6B,EAAE,GAAQ;QACxD,IAAI,IAAI,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE;YAC9C,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SACrB;QACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AAGD,aAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport {\n assert,\n BooleanValueModelChain, Command,\n CommandFactory,\n DelegatingListModel,\n DirtyTrackingForm,\n Disposable,\n Dsl,\n EventListenerList,\n GarbageCollector,\n lang,\n ListModel,\n ListModelChain,\n MapModelChain,\n MutableListModel,\n SelectionModel,\n TrackExternal,\n Types,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnListModel } from './column-list-model';\nimport { EditSession } from './edit-session';\nimport { CellRenderer } from './table/cell-renderer';\nimport {\n CellRendererOptions,\n ColumnModel,\n CustomTemplateColumnModel,\n CustomValueColumnModel,\n EditorControlColumnModel,\n ListPropertyColumnModel,\n OnComponentInit,\n PropertyColumnModel,\n SelectionColumnModel\n} from './table/column-model';\nimport { ColumnTextProperties } from './table/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\nclass RowClass<Row> {\n constructor(readonly className: string,\n readonly matches: (row: Row) => boolean) {\n }\n}\n\n\nexport class AbstractTableModel<Row> extends GarbageCollector {\n\n private readonly _dataSource = this.registerDisposable(new DelegatingListModel<Row>());\n readonly dataSource: ListModelChain<Row>;\n\n private readonly _columnList = this.registerDisposable(new ColumnListModel<Row>());\n\n private _editorSessions = new MutableListModel<EditSession<Row>>();\n private readonly _rowsBeingEdited: MutableListModel<Row>;\n private readonly rowClassNamePredicates: RowClass<Row>[] = [];\n\n private _columnTextPropertiesLookup: { [columnName: string]: ColumnTextProperties };\n\n private saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean | Promise<boolean>>;\n private _editorSessionByRowId: MapModelChain<any, EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\n readonly firstEditableColumn: ValueModelChain<ColumnModel<Row>>;\n private selectionColumnModel: SelectionColumnModel<Row>;\n private rowSelectionDisabledOnAllColumns: BooleanValueModelChain;\n private readonly rowClickListeners = new EventListenerList<(row: Row) => void>();\n readonly firstVisibleColumn: ValueModel<ColumnModel<Row>>;\n readonly lastVisibleColumn: ValueModel<ColumnModel<Row>>;\n\n private _createForm: (row: Row) => DirtyTrackingForm<Row> = (row) => new DirtyTrackingForm<Row>();\n\n public constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: row => this.identityOf(row)\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this._dataSource).replaceAll(this.rowsBeingEdited);\n\n this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();\n this.firstVisibleColumn = chain(this._columnList).first();\n this.lastVisibleColumn = chain(this._columnList).last();\n\n this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);\n }\n\n findMatchingColumns(row: Row, regex: RegExp): ColumnModel<Row>[] {\n return this.columns.value.filter(c => c.isTextMatch(row, regex));\n }\n\n hasMatchingColumn(row: Row, regex: RegExp): boolean {\n return !!this.columns.value.find(c => c.isTextMatch(row, regex));\n }\n\n protected setDataSource(sourceOfTruth: ListModel<Row>) {\n this._dataSource.setDelegate(sourceOfTruth);\n }\n\n identityOf(row: Row): any {\n return this._dataSource.identityOf(row);\n }\n\n get rowsBeingEdited(): ListModel<Row> {\n return this._rowsBeingEdited.readonly;\n }\n\n readonly trackBy = (index: number, item: Row) => {\n return this.identityOf ? this.identityOf(item) : index;\n };\n\n get columns(): ListModel<ColumnModel<Row>> {\n return this._columnList.allColumns;\n }\n\n get visibleColumns(): ListModel<ColumnModel<Row>> {\n return this._columnList.readonly;\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: { columnId: string }): PropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new PropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: { columnId: string }): ListPropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new ListPropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n protected _addSelectionColumn(selectionModel?: SelectionModel<Row>, visible?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n assert.isNil(this.selectionColumnModel);\n const columnId = 'selection-column';\n this.selectionColumnModel = new SelectionColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), selectionModel);\n this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));\n const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);\n if (!_.isNil(visible)) {\n selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));\n }\n return selectionColumnModel;\n }\n\n addEditControls(saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean|Promise<boolean>>, formFactory?: (row: Row) => DirtyTrackingForm<Row>): EditorControlColumnModel<Row> {\n this.saveCommandFactory = saveCommandFactory;\n if (_.isFunction(formFactory)) {\n this._createForm = formFactory;\n }\n const columnId = 'editControls';\n return this.addColumn(new EditorControlColumnModel<Row>(columnId, saveCommandFactory, () => this.getColumnTextProperties(columnId)));\n }\n\n addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V> {\n return this.addColumn(new CustomValueColumnModel<Row, V>(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));\n }\n\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, onComponentInitOrOptions?: OnComponentInit<C> | CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row> {\n return this.addColumn(new CustomValueColumnModel<Row, Row>(columnId, () => this.getColumnTextProperties(columnId), row => row)).cellRenderer(component, onComponentInitOrOptions);\n }\n\n addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row> {\n return this.addColumn(new CustomTemplateColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId)));\n }\n\n addRowClass(className: string, predicate: (row: Row) => boolean) {\n this.rowClassNamePredicates.push(new RowClass<Row>(className, predicate));\n }\n\n getRowClasses(row: Row): string[] {\n const classNames: string[] = [];\n this.rowClassNamePredicates.forEach(i => {\n if (i.matches(row)) {\n classNames.push(i.className);\n }\n });\n return classNames;\n }\n\n useFormFactory(factory: (row: Row) => DirtyTrackingForm<Row>): this {\n this._createForm = factory;\n return this;\n }\n\n protected addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n return this._columnList.addColumn(column, index);\n }\n\n // removeColumn(column: ColumnModel<Row>) {\n //\n // }\n\n columnTextProperties(columnTextProperties: { [columnName: string]: ColumnTextProperties }) {\n this._columnTextPropertiesLookup = columnTextProperties;\n }\n\n getColumnTextProperties(columnId: string): ColumnTextProperties {\n return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;\n }\n\n startEditSession(row: Row): 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 }\n\n // todo: pass the factories to the edit session so we can make the whole lot pluggable?\n const form = this._createForm(row);\n const saveCommand = this.saveCommandFactory.create(form);\n const editSession = new EditSession<Row>(rowId, row, form, saveCommand);\n const { when } = Dsl.disposeWith(editSession);\n when(editSession.liveRowValue).changes((editedValue) => {\n this._rowsBeingEdited.replaceOrPush(editedValue);\n }, { initialValue: 'triggerChangeUnlessNil' });\n\n this._editorSessions.push(editSession);\n editSession.onDispose(() => {\n this._rowsBeingEdited.remove(editSession.liveRowValue.value);\n this._editorSessions.remove(editSession);\n });\n return editSession;\n }\n\n getEditSessionFor(row: Row): 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 isRowSelectionEnabledFor(column: ColumnModel<Row>): boolean {\n return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();\n }\n\n isRowSelectionEnabled() {\n return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns.value;\n }\n\n hasUserSelectionModel() {\n return !!this.selectionColumnModel?.selectionModel.getDelegate();\n }\n\n getSelectionModel(): SelectionModel<Row> | undefined {\n return this.selectionColumnModel?.selectionModel;\n }\n\n isHoverEnabled(): boolean {\n return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;\n }\n\n isCursorEnabled(column: ColumnModel<Row>) {\n return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;\n }\n\n selectRow(row: Row) {\n this.selectionColumnModel?.selectRow(row);\n }\n\n onRowClicked(callback: (row: Row) => void): Disposable {\n return this.rowClickListeners.add(callback);\n }\n\n _notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n if (this.isRowSelectionEnabledFor(columnModel)) {\n this.selectRow(row);\n }\n this.rowClickListeners.fire(l => l(row));\n }\n}\n\n\nTrackExternal.oneTimeBinding(AbstractTableModel);\n"]}
1
+ {"version":3,"file":"abstract-table-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/abstract-table-model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EAGN,mBAAmB,EACnB,iBAAiB,EAEjB,GAAG,EACH,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EAIJ,gBAAgB,EAEhB,aAAa,EAEb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAGL,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EAEvB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAG9B,oGAAoG;AACpG,oGAAoG;AAEpG,MAAM,QAAQ;IACZ,YAAqB,SAAiB,EACjB,OAA8B;QAD9B,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAuB;IACnD,CAAC;CACF;AAGD,MAAM,OAAO,kBAAwB,SAAQ,gBAAgB;IA0B3D;QACE,KAAK,EAAE,CAAC;QAzBO,gBAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,mBAAmB,EAAO,CAAC,CAAC;QAGtE,gBAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,e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,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AAGD,aAAa,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport {\n assert,\n BooleanValueModelChain, Command,\n CommandFactory,\n DelegatingListModel,\n DirtyTrackingForm,\n Disposable,\n Dsl,\n EventListenerList,\n GarbageCollector,\n lang,\n ListModel,\n ListModelChain,\n MapModelChain,\n MutableListModel,\n SelectionModel,\n TrackExternal,\n Types,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\n\nimport { isFunction, isNil } from 'lodash-es';\nimport { ColumnListModel } from './column-list-model';\nimport { EditSession } from './edit-session';\nimport { CellRenderer } from './table/cell-renderer';\nimport {\n CellRendererOptions,\n ColumnModel,\n CustomTemplateColumnModel,\n CustomValueColumnModel,\n EditorControlColumnModel,\n ListPropertyColumnModel,\n OnComponentInit,\n PropertyColumnModel,\n SelectionColumnModel\n} from './table/column-model';\nimport { ColumnTextProperties } from './table/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\nclass RowClass<Row> {\n constructor(readonly className: string,\n readonly matches: (row: Row) => boolean) {\n }\n}\n\n\nexport class AbstractTableModel<Row> extends GarbageCollector {\n\n private readonly _dataSource = this.registerDisposable(new DelegatingListModel<Row>());\n readonly dataSource: ListModelChain<Row>;\n\n private readonly _columnList = this.registerDisposable(new ColumnListModel<Row>());\n\n private _editorSessions = new MutableListModel<EditSession<Row>>();\n private readonly _rowsBeingEdited: MutableListModel<Row>;\n private readonly rowClassNamePredicates: RowClass<Row>[] = [];\n\n private _columnTextPropertiesLookup: { [columnName: string]: ColumnTextProperties };\n\n private saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean | Promise<boolean>>;\n private _editorSessionByRowId: MapModelChain<any, EditSession<Row>>;\n\n readonly editing: BooleanValueModelChain;\n readonly firstEditableColumn: ValueModelChain<ColumnModel<Row>>;\n private selectionColumnModel: SelectionColumnModel<Row>;\n private rowSelectionDisabledOnAllColumns: BooleanValueModelChain;\n private readonly rowClickListeners = new EventListenerList<(row: Row) => void>();\n readonly firstVisibleColumn: ValueModel<ColumnModel<Row>>;\n readonly lastVisibleColumn: ValueModel<ColumnModel<Row>>;\n\n private _createForm: (row: Row) => DirtyTrackingForm<Row> = (row) => new DirtyTrackingForm<Row>();\n\n public constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this._rowsBeingEdited = new MutableListModel<Row>([], {\n identifiedWith: row => this.identityOf(row)\n });\n this._editorSessionByRowId = chain(this._editorSessions).indexBy('rowId');\n this.editing = chain(this._editorSessions).count().isGreaterThan(0);\n this.dataSource = chain(this._dataSource).replaceAll(this.rowsBeingEdited);\n\n this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();\n this.firstVisibleColumn = chain(this._columnList).first();\n this.lastVisibleColumn = chain(this._columnList).last();\n\n this.rowSelectionDisabledOnAllColumns = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);\n }\n\n findMatchingColumns(row: Row, regex: RegExp): ColumnModel<Row>[] {\n return this.columns.value.filter(c => c.isTextMatch(row, regex));\n }\n\n hasMatchingColumn(row: Row, regex: RegExp): boolean {\n return !!this.columns.value.find(c => c.isTextMatch(row, regex));\n }\n\n protected setDataSource(sourceOfTruth: ListModel<Row>) {\n this._dataSource.setDelegate(sourceOfTruth);\n }\n\n identityOf(row: Row): any {\n return this._dataSource.identityOf(row);\n }\n\n get rowsBeingEdited(): ListModel<Row> {\n return this._rowsBeingEdited.readonly;\n }\n\n readonly trackBy = (index: number, item: Row) => {\n return this.identityOf ? this.identityOf(item) : index;\n };\n\n get columns(): ListModel<ColumnModel<Row>> {\n return this._columnList.allColumns;\n }\n\n get visibleColumns(): ListModel<ColumnModel<Row>> {\n return this._columnList.readonly;\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P, options?: { columnId: string }): PropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new PropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n pluckList<P extends Types.ArrayPropertiesOf<Row>>(property: P, options?: { columnId: string }): ListPropertyColumnModel<Row, P> {\n const columnId = options?.columnId || property.toString();\n return this.addColumn(new ListPropertyColumnModel<Row, P>(columnId, property, () => this.getColumnTextProperties(columnId)));\n }\n\n protected _addSelectionColumn(selectionModel?: SelectionModel<Row>, visible?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n assert.isNil(this.selectionColumnModel);\n const columnId = 'selection-column';\n this.selectionColumnModel = new SelectionColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), selectionModel);\n this.addRowClass('aup-row-selected', row => this.selectionColumnModel.isSelected(row));\n const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);\n if (!isNil(visible)) {\n selectionColumnModel.visibleWhile(visible instanceof ValueModel ? visible : ValueModel.constant(visible));\n }\n return selectionColumnModel;\n }\n\n addEditControls(saveCommandFactory: Command.Factory<DirtyTrackingForm<Row>, boolean|Promise<boolean>>, formFactory?: (row: Row) => DirtyTrackingForm<Row>): EditorControlColumnModel<Row> {\n this.saveCommandFactory = saveCommandFactory;\n if (isFunction(formFactory)) {\n this._createForm = formFactory;\n }\n const columnId = 'editControls';\n return this.addColumn(new EditorControlColumnModel<Row>(columnId, saveCommandFactory, () => this.getColumnTextProperties(columnId)));\n }\n\n addCustomColumn<V>(columnId: string, dataAccessor: (row: Row) => V): CustomValueColumnModel<Row, V> {\n return this.addColumn(new CustomValueColumnModel<Row, V>(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));\n }\n\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, onInit?: OnComponentInit<C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, options?: CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row>\n addComponentColumn<C extends CellRenderer<Partial<Row>>>(columnId: string, component: ComponentType<C>, onComponentInitOrOptions?: OnComponentInit<C> | CellRendererOptions<Row, C>): CustomValueColumnModel<Row, Row> {\n return this.addColumn(new CustomValueColumnModel<Row, Row>(columnId, () => this.getColumnTextProperties(columnId), row => row)).cellRenderer(component, onComponentInitOrOptions);\n }\n\n addTemplateColumn<V>(columnId: string): CustomTemplateColumnModel<Row> {\n return this.addColumn(new CustomTemplateColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId)));\n }\n\n addRowClass(className: string, predicate: (row: Row) => boolean) {\n this.rowClassNamePredicates.push(new RowClass<Row>(className, predicate));\n }\n\n getRowClasses(row: Row): string[] {\n const classNames: string[] = [];\n this.rowClassNamePredicates.forEach(i => {\n if (i.matches(row)) {\n classNames.push(i.className);\n }\n });\n return classNames;\n }\n\n useFormFactory(factory: (row: Row) => DirtyTrackingForm<Row>): this {\n this._createForm = factory;\n return this;\n }\n\n protected addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n return this._columnList.addColumn(column, index);\n }\n\n // removeColumn(column: ColumnModel<Row>) {\n //\n // }\n\n columnTextProperties(columnTextProperties: { [columnName: string]: ColumnTextProperties }) {\n this._columnTextPropertiesLookup = columnTextProperties;\n }\n\n getColumnTextProperties(columnId: string): ColumnTextProperties {\n return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;\n }\n\n startEditSession(row: Row): 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 }\n\n // todo: pass the factories to the edit session so we can make the whole lot pluggable?\n const form = this._createForm(row);\n const saveCommand = this.saveCommandFactory.create(form);\n const editSession = new EditSession<Row>(rowId, row, form, saveCommand);\n const { when } = Dsl.disposeWith(editSession);\n when(editSession.liveRowValue).changes((editedValue) => {\n this._rowsBeingEdited.replaceOrPush(editedValue);\n }, { initialValue: 'triggerChangeUnlessNil' });\n\n this._editorSessions.push(editSession);\n editSession.onDispose(() => {\n this._rowsBeingEdited.remove(editSession.liveRowValue.value);\n this._editorSessions.remove(editSession);\n });\n return editSession;\n }\n\n getEditSessionFor(row: Row): 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 isRowSelectionEnabledFor(column: ColumnModel<Row>): boolean {\n return this.isRowSelectionEnabled() && column.isRowSelectionEnabled();\n }\n\n isRowSelectionEnabled() {\n return this.hasUserSelectionModel() && !this.rowSelectionDisabledOnAllColumns.value;\n }\n\n hasUserSelectionModel() {\n return !!this.selectionColumnModel?.selectionModel.getDelegate();\n }\n\n getSelectionModel(): SelectionModel<Row> | undefined {\n return this.selectionColumnModel?.selectionModel;\n }\n\n isHoverEnabled(): boolean {\n return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;\n }\n\n isCursorEnabled(column: ColumnModel<Row>) {\n return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;\n }\n\n selectRow(row: Row) {\n this.selectionColumnModel?.selectRow(row);\n }\n\n onRowClicked(callback: (row: Row) => void): Disposable {\n return this.rowClickListeners.add(callback);\n }\n\n _notifyCellClicked(columnModel: ColumnModel<Row>, row: Row) {\n if (this.isRowSelectionEnabledFor(columnModel)) {\n this.selectRow(row);\n }\n this.rowClickListeners.fire(l => l(row));\n }\n}\n\n\nTrackExternal.oneTimeBinding(AbstractTableModel);\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"AbstractTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":49,"character":45},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor"}],"findMatchingColumns":[{"__symbolic":"method"}],"hasMatchingColumn":[{"__symbolic":"method"}],"setDataSource":[{"__symbolic":"method"}],"identityOf":[{"__symbolic":"method"}],"pluck":[{"__symbolic":"method"}],"pluckList":[{"__symbolic":"method"}],"_addSelectionColumn":[{"__symbolic":"method"}],"addEditControls":[{"__symbolic":"method"}],"addCustomColumn":[{"__symbolic":"method"}],"addComponentColumn":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addTemplateColumn":[{"__symbolic":"method"}],"addRowClass":[{"__symbolic":"method"}],"getRowClasses":[{"__symbolic":"method"}],"useFormFactory":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"columnTextProperties":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method"}],"startEditSession":[{"__symbolic":"method"}],"getEditSessionFor":[{"__symbolic":"method"}],"cancelAllEditorSessions":[{"__symbolic":"method"}],"isRowSelectionEnabledFor":[{"__symbolic":"method"}],"isRowSelectionEnabled":[{"__symbolic":"method"}],"hasUserSelectionModel":[{"__symbolic":"method"}],"getSelectionModel":[{"__symbolic":"method"}],"isHoverEnabled":[{"__symbolic":"method"}],"isCursorEnabled":[{"__symbolic":"method"}],"selectRow":[{"__symbolic":"method"}],"onRowClicked":[{"__symbolic":"method"}],"_notifyCellClicked":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"AbstractTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":50,"character":45},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor"}],"findMatchingColumns":[{"__symbolic":"method"}],"hasMatchingColumn":[{"__symbolic":"method"}],"setDataSource":[{"__symbolic":"method"}],"identityOf":[{"__symbolic":"method"}],"pluck":[{"__symbolic":"method"}],"pluckList":[{"__symbolic":"method"}],"_addSelectionColumn":[{"__symbolic":"method"}],"addEditControls":[{"__symbolic":"method"}],"addCustomColumn":[{"__symbolic":"method"}],"addComponentColumn":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"addTemplateColumn":[{"__symbolic":"method"}],"addRowClass":[{"__symbolic":"method"}],"getRowClasses":[{"__symbolic":"method"}],"useFormFactory":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"columnTextProperties":[{"__symbolic":"method"}],"getColumnTextProperties":[{"__symbolic":"method"}],"startEditSession":[{"__symbolic":"method"}],"getEditSessionFor":[{"__symbolic":"method"}],"cancelAllEditorSessions":[{"__symbolic":"method"}],"isRowSelectionEnabledFor":[{"__symbolic":"method"}],"isRowSelectionEnabled":[{"__symbolic":"method"}],"hasUserSelectionModel":[{"__symbolic":"method"}],"getSelectionModel":[{"__symbolic":"method"}],"isHoverEnabled":[{"__symbolic":"method"}],"isCursorEnabled":[{"__symbolic":"method"}],"selectRow":[{"__symbolic":"method"}],"onRowClicked":[{"__symbolic":"method"}],"_notifyCellClicked":[{"__symbolic":"method"}]}}}}]
@@ -1,5 +1,5 @@
1
1
  import { AbstractComputedListModel, Dsl, lang, MutableListModel } from '@coolon/pectin';
2
- import * as _ from 'lodash';
2
+ import { isNil } from 'lodash-es';
3
3
  export class ColumnListModel extends AbstractComputedListModel {
4
4
  constructor() {
5
5
  super();
@@ -22,7 +22,7 @@ export class ColumnListModel extends AbstractComputedListModel {
22
22
  }
23
23
  this.registerDisposable(column);
24
24
  this.runInTransaction(() => {
25
- if (!_.isNil(index)) {
25
+ if (!isNil(index)) {
26
26
  this._allColumns.insert(index, column);
27
27
  }
28
28
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"column-list-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/column-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,IAAI,EAA4B,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClH,OAAO,KAAK,CAAC,MAAM,Q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ACH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { AbstractComputedListModel, Dsl, lang, ListModel, MapModelChain, MutableListModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { ColumnModel } from './table/column-model';\n\nexport class ColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n\n private readonly _allColumns = new MutableListModel<ColumnModel<Row>>();\n private readonly columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.columnsById = chain(this._allColumns).indexBy('columnId');\n }\n\n get allColumns(): ListModel<ColumnModel<Row>> {\n return this._allColumns.readonly;\n }\n\n getColumn(id: string): ColumnModel<Row> {\n return this.columnsById.get(id);\n }\n\n hasColumn(id: string): boolean {\n return !!this.columnsById.get(id);\n }\n\n addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n if (this.hasColumn(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n }\n this.registerDisposable(column);\n this.runInTransaction(() => {\n if (!_.isNil(index)) {\n this._allColumns.insert(index, column);\n } else {\n this._allColumns.push(column);\n }\n this.registerDisposable(this.trackSource(column.visible));\n });\n return column;\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this._allColumns.value.filter(c => c.visible.value);\n }\n}\n"]}
1
+ {"version":3,"file":"column-list-model.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/column-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,IAAI,EAA4B,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElH,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAGlC,MAA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AED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;CACF","sourcesContent":["import { AbstractComputedListModel, Dsl, lang, ListModel, MapModelChain, MutableListModel } from '@coolon/pectin';\n\nimport { isNil } from 'lodash-es';\nimport { ColumnModel } from './table/column-model';\n\nexport class ColumnListModel<Row> extends AbstractComputedListModel<ColumnModel<Row>, boolean> {\n\n private readonly _allColumns = new MutableListModel<ColumnModel<Row>>();\n private readonly columnsById: MapModelChain<string, ColumnModel<Row>>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.columnsById = chain(this._allColumns).indexBy('columnId');\n }\n\n get allColumns(): ListModel<ColumnModel<Row>> {\n return this._allColumns.readonly;\n }\n\n getColumn(id: string): ColumnModel<Row> {\n return this.columnsById.get(id);\n }\n\n hasColumn(id: string): boolean {\n return !!this.columnsById.get(id);\n }\n\n addColumn<C extends ColumnModel<Row>>(column: C, index?: number): C {\n if (this.hasColumn(column.columnId)) {\n lang.illegalState(`Column with id=${column.columnId} already exists`);\n }\n this.registerDisposable(column);\n this.runInTransaction(() => {\n if (!isNil(index)) {\n this._allColumns.insert(index, column);\n } else {\n this._allColumns.push(column);\n }\n this.registerDisposable(this.trackSource(column.visible));\n });\n return column;\n }\n\n doComputeValue(): ColumnModel<Row>[] {\n return this._allColumns.value.filter(c => c.visible.value);\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ColumnListModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"AbstractComputedListModel","line":4,"character":42},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor"}],"getColumn":[{"__symbolic":"method"}],"hasColumn":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"doComputeValue":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ColumnListModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"AbstractComputedListModel","line":5,"character":42},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor"}],"getColumn":[{"__symbolic":"method"}],"hasColumn":[{"__symbolic":"method"}],"addColumn":[{"__symbolic":"method"}],"doComputeValue":[{"__symbolic":"method"}]}}}}]
@@ -1,8 +1,8 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { DelegatingSelectionModel, DelegatingValueModel, GarbageCollector, MultipleSelectionModel, ValueModel } from '@coolon/pectin';
3
3
  import { assert, Stringy } from '@coolon/typescript-utilities';
4
- import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
5
- import _ from 'lodash';
4
+ import { Memoize } from '@typescript-plus/fast-memoize-decorator';
5
+ import { isFunction } from 'lodash-es';
6
6
  import { CellEditorPortalRef, CellHeaderPortalRef, ComponentCellRendererPortalRef, TemplateCellRendererPortalRef } from './cell-portal-ref';
7
7
  import { DefaultCellRendererComponent } from './default-cell-renderer/default-cell-renderer.component';
8
8
  import { DefaultHeaderCellRendererComponent } from './default-header-cell-renderer/default-header-cell-renderer.component';
@@ -115,7 +115,7 @@ export class ColumnModel extends GarbageCollector {
115
115
  }
116
116
  onRendererAttached(host, component) {
117
117
  this._cellRendererPortalRef.onPortalAttached(host, component);
118
- if (_.isFunction(component === null || component === void 0 ? void 0 : component.matches)) {
118
+ if (isFunction(component === null || component === void 0 ? void 0 : component.matches)) {
119
119
  this._cellRendererTextSearchPredicate = (row, text) => component.matches(row, text);
120
120
  }
121
121
  else {
@@ -162,11 +162,11 @@ export class PropertyColumnModel extends ColumnModel {
162
162
  cellRenderer(componentType, onComponentInitOrOptions) {
163
163
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
164
164
  if (firstTime) {
165
- if (_.isFunction(onComponentInitOrOptions)) {
165
+ if (isFunction(onComponentInitOrOptions)) {
166
166
  onComponentInitOrOptions(component);
167
167
  }
168
168
  else {
169
- if (_.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
169
+ if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
170
170
  onComponentInitOrOptions.onComponentInit(component);
171
171
  }
172
172
  }
@@ -190,7 +190,7 @@ export class PropertyColumnModel extends ColumnModel {
190
190
  component[CELL_RENDERER_COMPONENT_ROW_CACHE] = rowData.row;
191
191
  let disableEditCallback = false;
192
192
  if (firstTime) {
193
- if (_.isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
193
+ if (isFunction(options === null || options === void 0 ? void 0 : options.onComponentInit)) {
194
194
  options.onComponentInit(component);
195
195
  }
196
196
  // install our edit callback
@@ -205,7 +205,7 @@ export class PropertyColumnModel extends ColumnModel {
205
205
  disableEditCallback = true;
206
206
  component.value = rowData.row[this.property];
207
207
  disableEditCallback = false;
208
- if (!_.isFunction(options) && _.isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
208
+ if (!isFunction(options) && isFunction(options === null || options === void 0 ? void 0 : options.onRowUpdate)) {
209
209
  options.onRowUpdate(component, rowData.row);
210
210
  }
211
211
  }));
@@ -213,7 +213,7 @@ export class PropertyColumnModel extends ColumnModel {
213
213
  }
214
214
  cellEditor(editor, validatorsOrInitialiser, onComponentInit) {
215
215
  const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
216
- const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
216
+ const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : onComponentInit;
217
217
  this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
218
218
  const formValueModel = editSession.form.pluck(this.property);
219
219
  if (validators) {
@@ -253,7 +253,7 @@ export class ListPropertyColumnModel extends ColumnModel {
253
253
  }
254
254
  cellEditor(editor, validatorsOrInitialiser, initialiseComponent) {
255
255
  const validators = Array.isArray(validatorsOrInitialiser) ? validatorsOrInitialiser : undefined;
256
- const initialiser = _.isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
256
+ const initialiser = isFunction(validatorsOrInitialiser) ? validatorsOrInitialiser : initialiseComponent;
257
257
  this.configureCellEditor(new CellEditorPortalRef(editor, (component, editSession) => {
258
258
  const formListModel = editSession.form.pluckList(this.property);
259
259
  if (validators) {
@@ -284,17 +284,17 @@ export class CustomValueColumnModel extends ColumnModel {
284
284
  cellRenderer(componentType, onComponentInitOrOptions) {
285
285
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
286
286
  if (firstTime) {
287
- if (_.isFunction(onComponentInitOrOptions)) {
287
+ if (isFunction(onComponentInitOrOptions)) {
288
288
  onComponentInitOrOptions(component);
289
289
  }
290
290
  else {
291
- if (_.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
291
+ if (isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onComponentInit)) {
292
292
  onComponentInitOrOptions.onComponentInit(component);
293
293
  }
294
294
  }
295
295
  }
296
296
  component.value = this.getValue(rowData.row);
297
- if (!_.isFunction(onComponentInitOrOptions) && _.isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
297
+ if (!isFunction(onComponentInitOrOptions) && isFunction(onComponentInitOrOptions === null || onComponentInitOrOptions === void 0 ? void 0 : onComponentInitOrOptions.onRowUpdate)) {
298
298
  onComponentInitOrOptions.onRowUpdate(component, rowData.row);
299
299
  }
300
300
  }));