@ng-atomic/components 17.9.0 → 17.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/esm2022/atoms/icon/icon.atom.mjs +2 -2
  2. package/esm2022/components.module.mjs +3 -2
  3. package/esm2022/frames/app/app.frame.mjs +192 -16
  4. package/esm2022/frames/auto-layout/auto-layout.frame.mjs +2 -2
  5. package/esm2022/frames/columns/columns.frame.mjs +4 -4
  6. package/esm2022/frames/divider/divider.frame.mjs +2 -2
  7. package/esm2022/frames/drawer/drawer.frame.mjs +2 -2
  8. package/esm2022/frames/entrance/entrance.frame.mjs +2 -2
  9. package/esm2022/frames/fab/fab.frame.mjs +2 -2
  10. package/esm2022/frames/frames.module.mjs +2 -1
  11. package/esm2022/frames/line-up/line-up.frame.mjs +2 -2
  12. package/esm2022/frames/loading/loading.frame.mjs +2 -2
  13. package/esm2022/frames/router-outlet/router-outlet.frame.mjs +11 -4
  14. package/esm2022/frames/scroll/scroll.frame.mjs +2 -2
  15. package/esm2022/frames/scroll-v2/scroll.frame.mjs +2 -2
  16. package/esm2022/frames/side-nav/side-nav.frame.mjs +34 -28
  17. package/esm2022/frames/smart-menu/smart-menu.frame.mjs +2 -2
  18. package/esm2022/frames/vertical-hide/vertical-hide.frame.mjs +2 -2
  19. package/esm2022/molecules/checkbox-column/checkbox-column.molecule.mjs +48 -11
  20. package/esm2022/molecules/date-input-field/date-input-field.molecule.mjs +2 -2
  21. package/esm2022/molecules/date-range-input-field/date-range-input-field.molecule.mjs +2 -2
  22. package/esm2022/molecules/grid-item/grid-item.molecule.mjs +2 -2
  23. package/esm2022/molecules/loading-box/loading-box.molecule.mjs +2 -2
  24. package/esm2022/molecules/navigation-list-item/navigation-list-item.molecule.mjs +11 -8
  25. package/esm2022/molecules/select-input-field/select-input-field.molecule.mjs +2 -2
  26. package/esm2022/organisms/action-buttons-section/action-buttons-section.organism.mjs +2 -2
  27. package/esm2022/organisms/action-input-section/action-input-section.organism.mjs +2 -2
  28. package/esm2022/organisms/card-input-section/card-input-section.organism.mjs +2 -2
  29. package/esm2022/organisms/cvc-and-exp-input-section/cvc-and-exp-input-section.organism.mjs +2 -2
  30. package/esm2022/organisms/date-input-section/date-input-section.organism.mjs +2 -2
  31. package/esm2022/organisms/date-range-input-section/date-range-input-section.organism.mjs +2 -2
  32. package/esm2022/organisms/definition-list/definition-list.organism.mjs +2 -2
  33. package/esm2022/organisms/file-input-section/file-input-section.organism.mjs +2 -2
  34. package/esm2022/organisms/grid-cards-section/grid-cards-section.organism.mjs +2 -2
  35. package/esm2022/organisms/heading/heading.organism.mjs +2 -2
  36. package/esm2022/organisms/menu-footer/menu-footer.organism.mjs +2 -2
  37. package/esm2022/organisms/menu-header/menu-header.organism.mjs +4 -5
  38. package/esm2022/organisms/messages-section/messages-section.organism.mjs +2 -2
  39. package/esm2022/organisms/navigation-list/navigation-list.organism.mjs +51 -20
  40. package/esm2022/organisms/navigator/navigator.organism.mjs +3 -3
  41. package/esm2022/organisms/number-input-section/number-input-section.organism.mjs +2 -2
  42. package/esm2022/organisms/paginator/paginator.organism.mjs +2 -2
  43. package/esm2022/organisms/password-input-section/password-input-section.organism.mjs +2 -2
  44. package/esm2022/organisms/select-input-section/select-input-section.organism.mjs +2 -2
  45. package/esm2022/organisms/slider-input-section/slider-input-section.organism.mjs +4 -4
  46. package/esm2022/organisms/smart-list/smart-list.organism.mjs +11 -3
  47. package/esm2022/organisms/social-login-section/social-login-section.organism.mjs +2 -2
  48. package/esm2022/organisms/table/index.helpers.mjs +3 -1
  49. package/esm2022/organisms/table/table.organism.mjs +205 -101
  50. package/esm2022/organisms/text-input-section/text-input-section.organism.mjs +2 -2
  51. package/esm2022/organisms/textarea-section/textarea-section.organism.mjs +2 -2
  52. package/esm2022/organisms/thread-messages-section/thread-messages-section.organism.mjs +2 -2
  53. package/esm2022/pages/_index/index.page.mjs +242 -50
  54. package/esm2022/pages/form/form.page.mjs +71 -46
  55. package/esm2022/pages/pages.module.mjs +3 -4
  56. package/esm2022/templates/_index/index.template.mjs +66 -28
  57. package/esm2022/templates/background/background.template.mjs +2 -2
  58. package/esm2022/templates/entrance/entrance.template.mjs +2 -2
  59. package/esm2022/templates/form/form.builder.mjs +12 -2
  60. package/esm2022/templates/form/form.template.mjs +2 -2
  61. package/esm2022/templates/icon-button-menu/icon-button-menu.template.mjs +2 -2
  62. package/esm2022/templates/menu/menu.template.mjs +3 -3
  63. package/esm2022/templates/selection/selection.template.mjs +2 -2
  64. package/esm2022/templates/settings/settings.template.mjs +2 -2
  65. package/fesm2022/ng-atomic-components-atoms-icon.mjs +2 -2
  66. package/fesm2022/ng-atomic-components-frames-app.mjs +191 -15
  67. package/fesm2022/ng-atomic-components-frames-app.mjs.map +1 -1
  68. package/fesm2022/ng-atomic-components-frames-auto-layout.mjs +2 -2
  69. package/fesm2022/ng-atomic-components-frames-columns.mjs +3 -3
  70. package/fesm2022/ng-atomic-components-frames-columns.mjs.map +1 -1
  71. package/fesm2022/ng-atomic-components-frames-divider.mjs +2 -2
  72. package/fesm2022/ng-atomic-components-frames-drawer.mjs +2 -2
  73. package/fesm2022/ng-atomic-components-frames-entrance.mjs +2 -2
  74. package/fesm2022/ng-atomic-components-frames-fab.mjs +2 -2
  75. package/fesm2022/ng-atomic-components-frames-line-up.mjs +2 -2
  76. package/fesm2022/ng-atomic-components-frames-loading.mjs +2 -2
  77. package/fesm2022/ng-atomic-components-frames-router-outlet.mjs +10 -3
  78. package/fesm2022/ng-atomic-components-frames-router-outlet.mjs.map +1 -1
  79. package/fesm2022/ng-atomic-components-frames-scroll-v2.mjs +2 -2
  80. package/fesm2022/ng-atomic-components-frames-scroll.mjs +2 -2
  81. package/fesm2022/ng-atomic-components-frames-side-nav.mjs +33 -27
  82. package/fesm2022/ng-atomic-components-frames-side-nav.mjs.map +1 -1
  83. package/fesm2022/ng-atomic-components-frames-smart-menu.mjs +2 -2
  84. package/fesm2022/ng-atomic-components-frames-vertical-hide.mjs +2 -2
  85. package/fesm2022/ng-atomic-components-frames.mjs +1 -0
  86. package/fesm2022/ng-atomic-components-frames.mjs.map +1 -1
  87. package/fesm2022/ng-atomic-components-molecules-checkbox-column.mjs +47 -10
  88. package/fesm2022/ng-atomic-components-molecules-checkbox-column.mjs.map +1 -1
  89. package/fesm2022/ng-atomic-components-molecules-date-input-field.mjs +2 -2
  90. package/fesm2022/ng-atomic-components-molecules-date-range-input-field.mjs +2 -2
  91. package/fesm2022/ng-atomic-components-molecules-grid-item.mjs +2 -2
  92. package/fesm2022/ng-atomic-components-molecules-loading-box.mjs +2 -2
  93. package/fesm2022/ng-atomic-components-molecules-navigation-list-item.mjs +10 -7
  94. package/fesm2022/ng-atomic-components-molecules-navigation-list-item.mjs.map +1 -1
  95. package/fesm2022/ng-atomic-components-molecules-select-input-field.mjs +2 -2
  96. package/fesm2022/ng-atomic-components-organisms-action-buttons-section.mjs +2 -2
  97. package/fesm2022/ng-atomic-components-organisms-action-input-section.mjs +2 -2
  98. package/fesm2022/ng-atomic-components-organisms-card-input-section.mjs +2 -2
  99. package/fesm2022/ng-atomic-components-organisms-cvc-and-exp-input-section.mjs +2 -2
  100. package/fesm2022/ng-atomic-components-organisms-date-input-section.mjs +2 -2
  101. package/fesm2022/ng-atomic-components-organisms-date-range-input-section.mjs +2 -2
  102. package/fesm2022/ng-atomic-components-organisms-definition-list.mjs +2 -2
  103. package/fesm2022/ng-atomic-components-organisms-file-input-section.mjs +2 -2
  104. package/fesm2022/ng-atomic-components-organisms-grid-cards-section.mjs +2 -2
  105. package/fesm2022/ng-atomic-components-organisms-heading.mjs +2 -2
  106. package/fesm2022/ng-atomic-components-organisms-menu-footer.mjs +2 -2
  107. package/fesm2022/ng-atomic-components-organisms-menu-header.mjs +3 -4
  108. package/fesm2022/ng-atomic-components-organisms-menu-header.mjs.map +1 -1
  109. package/fesm2022/ng-atomic-components-organisms-messages-section.mjs +2 -2
  110. package/fesm2022/ng-atomic-components-organisms-navigation-list.mjs +50 -19
  111. package/fesm2022/ng-atomic-components-organisms-navigation-list.mjs.map +1 -1
  112. package/fesm2022/ng-atomic-components-organisms-navigator.mjs +2 -2
  113. package/fesm2022/ng-atomic-components-organisms-navigator.mjs.map +1 -1
  114. package/fesm2022/ng-atomic-components-organisms-number-input-section.mjs +2 -2
  115. package/fesm2022/ng-atomic-components-organisms-paginator.mjs +2 -2
  116. package/fesm2022/ng-atomic-components-organisms-password-input-section.mjs +2 -2
  117. package/fesm2022/ng-atomic-components-organisms-select-input-section.mjs +2 -2
  118. package/fesm2022/ng-atomic-components-organisms-slider-input-section.mjs +3 -3
  119. package/fesm2022/ng-atomic-components-organisms-slider-input-section.mjs.map +1 -1
  120. package/fesm2022/ng-atomic-components-organisms-smart-list.mjs +10 -2
  121. package/fesm2022/ng-atomic-components-organisms-smart-list.mjs.map +1 -1
  122. package/fesm2022/ng-atomic-components-organisms-social-login-section.mjs +2 -2
  123. package/fesm2022/ng-atomic-components-organisms-table.mjs +206 -100
  124. package/fesm2022/ng-atomic-components-organisms-table.mjs.map +1 -1
  125. package/fesm2022/ng-atomic-components-organisms-text-input-section.mjs +2 -2
  126. package/fesm2022/ng-atomic-components-organisms-textarea-section.mjs +2 -2
  127. package/fesm2022/ng-atomic-components-organisms-thread-messages-section.mjs +2 -2
  128. package/fesm2022/ng-atomic-components-pages-_index.mjs +242 -50
  129. package/fesm2022/ng-atomic-components-pages-_index.mjs.map +1 -1
  130. package/fesm2022/ng-atomic-components-pages-form.mjs +71 -46
  131. package/fesm2022/ng-atomic-components-pages-form.mjs.map +1 -1
  132. package/fesm2022/ng-atomic-components-pages.mjs +2 -3
  133. package/fesm2022/ng-atomic-components-pages.mjs.map +1 -1
  134. package/fesm2022/ng-atomic-components-templates-_index.mjs +65 -27
  135. package/fesm2022/ng-atomic-components-templates-_index.mjs.map +1 -1
  136. package/fesm2022/ng-atomic-components-templates-background.mjs +2 -2
  137. package/fesm2022/ng-atomic-components-templates-entrance.mjs +2 -2
  138. package/fesm2022/ng-atomic-components-templates-form.mjs +13 -3
  139. package/fesm2022/ng-atomic-components-templates-form.mjs.map +1 -1
  140. package/fesm2022/ng-atomic-components-templates-icon-button-menu.mjs +2 -2
  141. package/fesm2022/ng-atomic-components-templates-menu.mjs +2 -2
  142. package/fesm2022/ng-atomic-components-templates-menu.mjs.map +1 -1
  143. package/fesm2022/ng-atomic-components-templates-selection.mjs +2 -2
  144. package/fesm2022/ng-atomic-components-templates-settings.mjs +2 -2
  145. package/fesm2022/ng-atomic-components.mjs +2 -1
  146. package/fesm2022/ng-atomic-components.mjs.map +1 -1
  147. package/frames/app/app.frame.d.ts +69 -52
  148. package/frames/columns/columns.frame.d.ts +3 -3
  149. package/frames/fab/fab.frame.d.ts +3 -3
  150. package/frames/router-outlet/router-outlet.frame.d.ts +4 -3
  151. package/frames/side-nav/side-nav.frame.d.ts +16 -12
  152. package/molecules/actions-column/actions-column.molecule.d.ts +3 -3
  153. package/molecules/checkbox-column/checkbox-column.molecule.d.ts +8 -2
  154. package/molecules/chips-input-field/chips-input-field.molecule.d.ts +3 -3
  155. package/molecules/loading-box/loading-box.molecule.d.ts +3 -3
  156. package/molecules/navigation-list-item/navigation-list-item.molecule.d.ts +3 -2
  157. package/organisms/menu-header/menu-header.organism.d.ts +10 -4
  158. package/organisms/navigation-list/navigation-list.organism.d.ts +2 -1
  159. package/organisms/navigator/navigator.organism.d.ts +3 -3
  160. package/organisms/slider-input-section/slider-input-section.organism.d.ts +3 -3
  161. package/organisms/smart-list/smart-list.organism.d.ts +14 -13
  162. package/organisms/stripe-input-section/stripe-input-section.organism.d.ts +3 -3
  163. package/organisms/table/index.helpers.d.ts +1 -0
  164. package/organisms/table/table.organism.d.ts +39 -9
  165. package/package.json +3 -3
  166. package/pages/_index/index.page.d.ts +123 -82
  167. package/pages/form/form.page.d.ts +69 -56
  168. package/pages/terms/terms.page.d.ts +3 -3
  169. package/templates/_index/index.template.d.ts +27 -15
  170. package/templates/form/form.template.d.ts +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ng-atomic-components-organisms-smart-list.mjs","sources":["../../../../../packages/@ng-atomic/components/src/lib/organisms/smart-list/smart-list.organism.ts","../../../../../packages/@ng-atomic/components/src/lib/organisms/smart-list/ng-atomic-components-organisms-smart-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, inject, input } from '@angular/core';\nimport { DATA_ACCESSOR, defaultDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatListModule } from '@angular/material/list';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatRippleModule } from '@angular/material/core';\nimport { DataAccessorPipe } from '@ng-atomic/common/pipes/data-accessor';\nimport { _computed, Actions, InjectableComponent, NgAtomicComponent, TokenizedType } from '@ng-atomic/core';\nimport { KeysPipe } from '@ng-atomic/common/pipes/keys';\nimport { GroupedByPipe } from '@ng-atomic/common/pipes/grouped-by';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ActionsPipe } from '@ng-atomic/common/pipes/actions';\nimport { SmartMenuButtonAtom } from '@ng-atomic/components/atoms/smart-menu-button';\nimport { makeConfig } from '@ng-atomic/common/services/ui';\n\nexport enum ActionId {\n CLICK_ITEM = '[@ng-atomic/components/organisms/smart-list] Click Item',\n ITEM_BUTTON_CLICK = '[@ng-atomic/components/organisms/smart-list] Item Button Click',\n}\n\n@TokenizedType()\n@Directive({standalone: true})\nexport class SmartListOrganismStore<T> extends InjectableComponent {\n static readonly ActionId = ActionId;\n static readonly Config = makeConfig(() => {\n return (_, context) => ({\n items: [],\n itemActions: [],\n groupedBy: '',\n groupKeys: [],\n itemActionsType: (context.breakpoint === 'xSmall' ? 'dispatch' : 'menu') as 'menu' | 'dispatch'\n });\n }, ['components', 'organisms', 'smart-list']);\n\n readonly config = SmartListOrganismStore.Config.inject();\n readonly items = input<T[]>([]);\n readonly itemActions = input<Actions>([]);\n readonly groupedBy = input<string>();\n readonly groupKeys = input<string[]>();\n readonly itemActionsType = input(_computed(() => this.config().itemActionsType));\n}\n\n@Component({\n selector: 'organisms-smart-list',\n standalone: true,\n imports: [\n NgTemplateOutlet,\n MatListModule,\n MatIconModule,\n MatButtonModule,\n MatTooltipModule,\n MatRippleModule,\n DataAccessorPipe,\n ActionsPipe,\n GroupedByPipe,\n KeysPipe,\n SmartMenuButtonAtom\n ],\n template: `\n @if (store.groupedBy()) {\n <mat-list>\n @for (key of store.groupKeys() ?? (store.items() | groupedBy:store.groupedBy() | keys); track key) {\n <div mat-subheader>{{ key }}</div>\n @for (item of ((store.items() ?? [] | groupedBy:store.groupedBy())?.[key] ?? []); track item.id) { \n <ng-container *ngTemplateOutlet=\"listItem; context: {$implicit: item}\" />\n <mat-divider />\n }\n }\n </mat-list>\n } @else {\n <mat-list>\n @for (item of store.items(); track item.id) {\n <ng-container *ngTemplateOutlet=\"listItem; context: {$implicit: item}\" />\n <mat-divider />\n }\n </mat-list>\n }\n <ng-template #listItem let-item>\n <mat-list-item lines=\"2\" matRipple (click)=\"onItemClick(item)\">\n <span\n matListItemTitle\n [matTooltip]=\"item | dataAccessor:'title'\"\n >\n {{ item | dataAccessor:'title' }}\n </span>\n <span matListItemLine>\n {{ item | dataAccessor:'description' }}\n </span>\n @if ((store.itemActions() | resolveActions:item); as actions) {\n <ng-container matListItemMeta>\n @if (actions.length) {\n @switch (store.itemActionsType()) {\n @case ('dispatch') {\n <button\n mat-icon-button\n (click)=\"onItemActionsClick(item, $event)\"\n >\n <mat-icon>menu</mat-icon>\n </button>\n }\n @case ('menu') {\n <atoms-smart-menu-button\n [actions]=\"actions\"\n (action)=\"dispatch($event)\"\n />\n }\n }\n }\n </ng-container>\n }\n </mat-list-item>\n </ng-template>\n `,\n styleUrls: ['./smart-list.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: SmartListOrganismStore,\n inputs: ['items', 'itemActions', 'groupedBy', 'groupKeys', 'itemActionsType'],\n },\n ],\n})\nexport class SmartListOrganism<T> extends NgAtomicComponent {\n static readonly ActionId = ActionId;\n protected readonly store = inject(SmartListOrganismStore);\n protected readonly dataAccessor = inject(DATA_ACCESSOR, {optional: true}) ?? defaultDataAccessor;\n protected readonly trackById = (_: number, item: T) => this.dataAccessor(item, 'id');\n\n protected onItemClick(item: T) {\n this.dispatch({id: ActionId.CLICK_ITEM, payload: item});\n }\n\n protected onItemActionsClick(item: T, $event: Event) {\n $event.stopPropagation();\n $event.preventDefault();\n this.dispatch({id: ActionId.ITEM_BUTTON_CLICK, payload: item});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAgBY,SAGX;AAHD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,YAAA,CAAA,GAAA,yDAAsE,CAAA;AACtE,IAAA,QAAA,CAAA,mBAAA,CAAA,GAAA,gEAAoF,CAAA;AACtF,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA,CAAA;AAIM,IAAM,sBAAsB,GAA5B,MAAM,sBAA0B,SAAQ,mBAAmB,CAAA;AAA3D,IAAA,WAAA,GAAA;;AAYI,QAAA,IAAA,CAAA,MAAM,GAAG,wBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAM,EAAE,CAAC,CAAC;AACvB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,EAAE,CAAC,CAAC;QACjC,IAAS,CAAA,SAAA,GAAG,KAAK,EAAU,CAAC;QAC5B,IAAS,CAAA,SAAA,GAAG,KAAK,EAAY,CAAC;AAC9B,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAClF,KAAA;;a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A,CAAA,WAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,gBAAgB,gDAChB,WAAW,EAAA,IAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EACX,aAAa,EACb,IAAA,EAAA,WAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,QAAQ,6CACR,mBAAmB,EAAA,QAAA,EAAA,yBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA,EAAA;;2FAkEV,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAhF7B,SAAS;+BACE,sBAAsB,EAAA,UAAA,EACpB,IAAI,EACP,OAAA,EAAA;wBACP,gBAAgB;wBAChB,aAAa;wBACb,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,eAAe;wBACf,gBAAgB;wBAChB,WAAW;wBACX,aAAa;wBACb,QAAQ;wBACR,mBAAmB;qBACpB,EACS,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDT,EAEgB,eAAA,EAAA,uBAAuB,CAAC,MAAM,EAC/B,cAAA,EAAA;AACd,wBAAA;AACE,4BAAA,SAAS,EAAE,sBAAsB;4BACjC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,CAAC;AAC9E,yBAAA;AACF,qBAAA,EAAA,MAAA,EAAA,CAAA,8OAAA,CAAA,EAAA,CAAA;;;ACzHH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-atomic-components-organisms-smart-list.mjs","sources":["../../../../../packages/@ng-atomic/components/src/lib/organisms/smart-list/smart-list.organism.ts","../../../../../packages/@ng-atomic/components/src/lib/organisms/smart-list/ng-atomic-components-organisms-smart-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Directive, inject, input } from '@angular/core';\nimport { DATA_ACCESSOR, defaultDataAccessor } from '@ng-atomic/common/pipes/data-accessor';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { MatListModule } from '@angular/material/list';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatRippleModule } from '@angular/material/core';\nimport { DataAccessorPipe } from '@ng-atomic/common/pipes/data-accessor';\nimport { _computed, Actions, InjectableComponent, NgAtomicComponent, TokenizedType } from '@ng-atomic/core';\nimport { KeysPipe } from '@ng-atomic/common/pipes/keys';\nimport { GroupedByPipe } from '@ng-atomic/common/pipes/grouped-by';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ActionsPipe } from '@ng-atomic/common/pipes/actions';\nimport { SmartMenuButtonAtom } from '@ng-atomic/components/atoms/smart-menu-button';\nimport { makeConfig } from '@ng-atomic/common/services/ui';\n\nexport enum ActionId {\n CLICK_ITEM = '[@ng-atomic/components/organisms/smart-list] Click Item',\n ITEM_BUTTON_CLICK = '[@ng-atomic/components/organisms/smart-list] Item Button Click',\n}\n\n@TokenizedType()\n@Directive({standalone: true})\nexport class SmartListOrganismStore<T> extends InjectableComponent {\n static readonly ActionId = ActionId;\n static readonly Config = makeConfig(() => {\n return () => ({\n items: <any[]>[],\n itemActions: <Actions>[],\n groupedBy: '',\n groupKeys: <string[]>[],\n itemActionsType: <'menu' | 'dispatch'>'menu'\n });\n }, ['components', 'organisms', 'smart-list']);\n\n static provideItemActionsTypeConfig() {\n return SmartListOrganismStore.Config.provide(() => {\n return (config, context) => ({\n ...config,\n itemActionsType: (context.breakpoint === 'xSmall' ? 'dispatch' : 'menu')\n });\n });\n }\n\n readonly config = SmartListOrganismStore.Config.inject();\n readonly items = input<T[]>([]);\n readonly itemActions = input<Actions>([]);\n readonly groupedBy = input<string>();\n readonly groupKeys = input<string[]>();\n readonly itemActionsType = input(_computed(() => this.config().itemActionsType));\n}\n\n@Component({\n selector: 'organisms-smart-list',\n standalone: true,\n imports: [\n NgTemplateOutlet,\n MatListModule,\n MatIconModule,\n MatButtonModule,\n MatTooltipModule,\n MatRippleModule,\n DataAccessorPipe,\n ActionsPipe,\n GroupedByPipe,\n KeysPipe,\n SmartMenuButtonAtom\n ],\n template: `\n @if (store.groupedBy()) {\n <mat-list>\n @for (key of store.groupKeys() ?? (store.items() | groupedBy:store.groupedBy() | keys); track key) {\n <div mat-subheader>{{ key }}</div>\n @for (item of ((store.items() ?? [] | groupedBy:store.groupedBy())?.[key] ?? []); track item.id) { \n <ng-container *ngTemplateOutlet=\"listItem; context: {$implicit: item}\" />\n <mat-divider />\n }\n }\n </mat-list>\n } @else {\n <mat-list>\n @for (item of store.items(); track item.id) {\n <ng-container *ngTemplateOutlet=\"listItem; context: {$implicit: item}\" />\n <mat-divider />\n }\n </mat-list>\n }\n <ng-template #listItem let-item>\n <mat-list-item lines=\"2\" matRipple (click)=\"onItemClick(item)\">\n <span\n matListItemTitle\n [matTooltip]=\"item | dataAccessor:'title'\"\n >\n {{ item | dataAccessor:'title' }}\n </span>\n <span matListItemLine>\n {{ item | dataAccessor:'description' }}\n </span>\n @if ((store.itemActions() | resolveActions:item); as actions) {\n <ng-container matListItemMeta>\n @if (actions.length) {\n @switch (store.itemActionsType()) {\n @case ('dispatch') {\n <button\n mat-icon-button\n (click)=\"onItemActionsClick(item, $event)\"\n >\n <mat-icon>menu</mat-icon>\n </button>\n }\n @case ('menu') {\n <atoms-smart-menu-button\n [actions]=\"actions\"\n (action)=\"dispatch($event)\"\n />\n }\n }\n }\n </ng-container>\n }\n </mat-list-item>\n </ng-template>\n `,\n styleUrls: ['./smart-list.organism.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [\n {\n directive: SmartListOrganismStore,\n inputs: ['items', 'itemActions', 'groupedBy', 'groupKeys', 'itemActionsType'],\n },\n ],\n})\nexport class SmartListOrganism<T> extends NgAtomicComponent {\n static readonly ActionId = ActionId;\n protected readonly store = inject(SmartListOrganismStore);\n protected readonly dataAccessor = inject(DATA_ACCESSOR, {optional: true}) ?? defaultDataAccessor;\n protected readonly trackById = (_: number, item: T) => this.dataAccessor(item, 'id');\n\n protected onItemClick(item: T) {\n this.dispatch({id: ActionId.CLICK_ITEM, payload: item});\n }\n\n protected onItemActionsClick(item: T, $event: Event) {\n $event.stopPropagation();\n $event.preventDefault();\n this.dispatch({id: ActionId.ITEM_BUTTON_CLICK, payload: item});\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;IAgBY,SAGX;AAHD,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,YAAA,CAAA,GAAA,yDAAsE,CAAA;AACtE,IAAA,QAAA,CAAA,mBAAA,CAAA,GAAA,gEAAoF,CAAA;AACtF,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAGnB,EAAA,CAAA,CAAA,CAAA;AAIM,IAAM,sBAAsB,GAA5B,MAAM,sBAA0B,SAAQ,mBAAmB,CAAA;AAA3D,IAAA,WAAA,GAAA;;AAqBI,QAAA,IAAA,CAAA,MAAM,GAAG,wBAAsB,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAM,EAAE,CAAC,CAAC;AACvB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAU,EAAE,CAAC,CAAC;QACjC,IAAS,CAAA,SAAA,GAAG,KAAK,EAAU,CAAC;QAC5B,IAAS,CAAA,SAAA,GAAG,KAAK,EAAY,CAAC;AAC9B,QAAA,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;AAClF,KAAA;;aA1BiB,IAAQ,CAAA,QAAA,GAAG,QAAH,CAAY,EAAA;AACpB,IAAA,SAAA,IAAA,CAAA,MAAM,GAAG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oogleButtonClick = new EventEmitter();
10
10
  }
11
11
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SocialLoginSectionOrganism, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: SocialLoginSectionOrganism, isStandalone: true, selector: "organisms-social-login-section", outputs: { signInWithGoogleButtonClick: "signInWithGoogleButtonClick" }, ngImport: i0, template: "<button \n mat-raised-button \n color=\"primary\" \n (click)=\"signInWithGoogleButtonClick.emit()\"\n>Google\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3</button>", styles: [":host{--horizontal-padding: 16px;--horizontal-padding-SCOPED-IN-heading-BVVK: var(--horizontal-padding)}:host{display:block;width:100%;padding:0 var(--horizontal-padding-SCOPED-IN-heading-BVVK);box-sizing:border-box}:host button{width:100%;height:56px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
12
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.2", type: SocialLoginSectionOrganism, isStandalone: true, selector: "organisms-social-login-section", outputs: { signInWithGoogleButtonClick: "signInWithGoogleButtonClick" }, ngImport: i0, template: "<button \n mat-raised-button \n color=\"primary\" \n (click)=\"signInWithGoogleButtonClick.emit()\"\n>Google\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3</button>", styles: [":host{--horizontal-padding: 16px;--horizontal-padding-SCOPED-IN-heading-xHgp: var(--horizontal-padding)}:host{display:block;width:100%;padding:0 var(--horizontal-padding-SCOPED-IN-heading-xHgp);box-sizing:border-box}:host button{width:100%;height:56px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13
13
  }
14
14
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: SocialLoginSectionOrganism, decorators: [{
15
15
  type: Component,
16
16
  args: [{ selector: 'organisms-social-login-section', standalone: true, imports: [
17
17
  CommonModule,
18
18
  MatButtonModule,
19
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n mat-raised-button \n color=\"primary\" \n (click)=\"signInWithGoogleButtonClick.emit()\"\n>Google\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3</button>", styles: [":host{--horizontal-padding: 16px;--horizontal-padding-SCOPED-IN-heading-BVVK: var(--horizontal-padding)}:host{display:block;width:100%;padding:0 var(--horizontal-padding-SCOPED-IN-heading-BVVK);box-sizing:border-box}:host button{width:100%;height:56px}\n"] }]
19
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button \n mat-raised-button \n color=\"primary\" \n (click)=\"signInWithGoogleButtonClick.emit()\"\n>Google\u30A2\u30AB\u30A6\u30F3\u30C8\u3067\u30ED\u30B0\u30A4\u30F3</button>", styles: [":host{--horizontal-padding: 16px;--horizontal-padding-SCOPED-IN-heading-xHgp: var(--horizontal-padding)}:host{display:block;width:100%;padding:0 var(--horizontal-padding-SCOPED-IN-heading-xHgp);box-sizing:border-box}:host button{width:100%;height:56px}\n"] }]
20
20
  }], propDecorators: { signInWithGoogleButtonClick: [{
21
21
  type: Output
22
22
  }] } });
@@ -3,7 +3,7 @@ import { inject, Injectable, input, computed, Directive, Component, ChangeDetect
3
3
  import { FormBuilder } from '@angular/forms';
4
4
  import { PaginationService } from '@ng-atomic/common/services/form/pagination';
5
5
  import { SortService } from '@ng-atomic/common/services/form/sort';
6
- import { wrapActions, InjectableComponent, TokenizedType, NgAtomicComponent, Effect } from '@ng-atomic/core';
6
+ import { wrapActions, InjectableComponent, _computed, TokenizedType, NgAtomicComponent, Effect } from '@ng-atomic/core';
7
7
  import { injectProps, DomainPipe } from '@ng-atomic/common/pipes/domain';
8
8
  import { omitBy } from 'lodash-es';
9
9
  import { __decorate, __metadata } from 'tslib';
@@ -25,8 +25,10 @@ import { ResolveColumnsPipe } from '@ng-atomic/common/pipes/resolve-columns';
25
25
  import { MapPipe } from '@ng-atomic/common/pipes/map';
26
26
  import { AutoColumnsPipe } from '@ng-atomic/common/pipes/auto-columns';
27
27
  import { SortPipe } from '@ng-atomic/common/pipes/sort';
28
- import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree';
29
28
  import { FlatTreeControl } from '@angular/cdk/tree';
29
+ import { CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
30
+ import { makeConfig } from '@ng-atomic/common/services/ui';
31
+ import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree';
30
32
 
31
33
  function buildColumns(columns) {
32
34
  return columns.map(column => {
@@ -51,6 +53,7 @@ function buildColumns(columns) {
51
53
  return {
52
54
  type: 'tree',
53
55
  name: column.split('__tree_')?.[1] ?? '__tree',
56
+ headerText: '',
54
57
  visible: true,
55
58
  width: 200,
56
59
  };
@@ -98,6 +101,7 @@ class IndexFormBuilder {
98
101
  return this.fb.group({
99
102
  type: this.fb.control({ value: 'tree', disabled: true }),
100
103
  name: this.fb.control({ value: column.name, disabled: true }),
104
+ headerText: this.fb.control(column.headerText),
101
105
  visible: this.fb.control(column.visible),
102
106
  width: this.fb.control(80),
103
107
  });
@@ -157,9 +161,19 @@ function buildTreeFlatDataSource(treeControl, data, key = 'children') {
157
161
  return new MatTreeFlatDataSource(treeControl, treeFlattener, data);
158
162
  }
159
163
 
164
+ var TableOrganismStore_1;
165
+ var ActionId;
166
+ (function (ActionId) {
167
+ ActionId["CHECKBOX_CLICK"] = "[@ng-atomic/components/organisms/checkbox-column] Checkbox Click";
168
+ ActionId["HEADER_CHECKBOX_CLICK"] = "[@ng-atomic/components/organisms/checkbox-column] Header Checkbox Click";
169
+ ActionId["HEADER_CLICK"] = "[@ng-atomic/components/organisms/table] Header Click";
170
+ ActionId["ROW_DROP"] = "[@ng-atomic/components/organisms/table] Row Drop";
171
+ })(ActionId || (ActionId = {}));
160
172
  let TableOrganismStore = class TableOrganismStore extends InjectableComponent {
161
173
  constructor() {
162
174
  super(...arguments);
175
+ this.config = TableOrganismStore_1.Config.inject();
176
+ this.draggable = input(_computed(() => this.config().draggable));
163
177
  this.domainPipe = inject(DomainPipe);
164
178
  this.form = input(inject(IndexFormBuilder).build());
165
179
  this.itemActions = input([]);
@@ -174,13 +188,20 @@ let TableOrganismStore = class TableOrganismStore extends InjectableComponent {
174
188
  }
175
189
  return new MatTableDataSource(this.items());
176
190
  });
177
- this.isHidden = computed(() => (item) => this.treeControl().getLevel(item) === 0);
191
+ this.isHidden = input(_computed(() => this.config().isHidden));
192
+ // () => {
193
+ // if (this.childrenKey()) {
194
+ // return (item: T) => this.treeControl().getLevel(item) === 0;
195
+ // } else {
196
+ // return (item: T) => false;
197
+ // }
198
+ // }
178
199
  this.formValue = computedRawValue(() => this.form());
179
200
  this.sort = computed(() => this.formValue()?.sort ?? { key: '', order: 'asc' }, {
180
201
  equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
181
202
  });
182
203
  this.columns = computed(() => {
183
- return new ColumnsPipe().transform((this.formValue()?.columns ?? [])).map(column => {
204
+ const columns = new ColumnsPipe().transform((this.formValue()?.columns ?? [])).map(column => {
184
205
  if (column.name.startsWith('__tree_')) {
185
206
  return {
186
207
  ...column,
@@ -188,6 +209,13 @@ let TableOrganismStore = class TableOrganismStore extends InjectableComponent {
188
209
  sort: this.sort().key === column.name ? this.sort().order : 'none',
189
210
  };
190
211
  }
212
+ else if (column.name.startsWith('checkbox')) {
213
+ return {
214
+ ...column,
215
+ type: 'checkbox',
216
+ headerText: 'check',
217
+ };
218
+ }
191
219
  else if (column.type === 'actions') {
192
220
  return {
193
221
  ...column,
@@ -199,20 +227,29 @@ let TableOrganismStore = class TableOrganismStore extends InjectableComponent {
199
227
  else {
200
228
  return {
201
229
  ...column,
202
- headerText: this.domainPipe.transform(column?.name),
230
+ headerText: this.domainPipe.transform(column?.headerText ?? column?.name),
203
231
  sort: this.sort().key === column.name ? this.sort().order : 'none',
204
232
  };
205
233
  }
206
234
  });
235
+ return columns;
207
236
  }, { equal: (a, b) => JSON.stringify(a) === JSON.stringify(b) });
208
237
  this.columnNames = computed(() => this.columns().map(column => column.name), {
209
238
  equal: (a, b) => JSON.stringify(a) === JSON.stringify(b),
210
239
  });
211
240
  }
241
+ static { TableOrganismStore_1 = this; }
242
+ static { this.ActionId = ActionId; }
243
+ static { this.Config = makeConfig(() => {
244
+ return () => ({
245
+ draggable: true,
246
+ isHidden: (item) => false,
247
+ });
248
+ }, ['components', 'organisms', 'table']); }
212
249
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: TableOrganismStore, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
213
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.2.2", type: TableOrganismStore, isStandalone: true, selector: "organisms-table", inputs: { form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, itemActions: { classPropertyName: "itemActions", publicName: "itemActions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, childrenKey: { classPropertyName: "childrenKey", publicName: "childrenKey", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, treeControl: { classPropertyName: "treeControl", publicName: "treeControl", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DomainPipe], usesInheritance: true, ngImport: i0 }); }
250
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "17.2.2", type: TableOrganismStore, isStandalone: true, selector: "organisms-table", inputs: { draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, itemActions: { classPropertyName: "itemActions", publicName: "itemActions", isSignal: true, isRequired: false, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, highlight: { classPropertyName: "highlight", publicName: "highlight", isSignal: true, isRequired: false, transformFunction: null }, childrenKey: { classPropertyName: "childrenKey", publicName: "childrenKey", isSignal: true, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, treeControl: { classPropertyName: "treeControl", publicName: "treeControl", isSignal: true, isRequired: false, transformFunction: null }, isHidden: { classPropertyName: "isHidden", publicName: "isHidden", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DomainPipe], usesInheritance: true, ngImport: i0 }); }
214
251
  };
215
- TableOrganismStore = __decorate([
252
+ TableOrganismStore = TableOrganismStore_1 = __decorate([
216
253
  TokenizedType()
217
254
  ], TableOrganismStore);
218
255
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: TableOrganismStore, decorators: [{
@@ -223,11 +260,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
223
260
  providers: [DomainPipe],
224
261
  }]
225
262
  }] });
226
- var ActionId;
227
- (function (ActionId) {
228
- ActionId["CHECKBOX_CLICK"] = "[@ng-atomic/components/organisms/checkbox-column] Checkbox Click";
229
- ActionId["HEADER_CLICK"] = "[@ng-atomic/components/organisms/table] Header Click";
230
- })(ActionId || (ActionId = {}));
231
263
  class TableOrganism extends NgAtomicComponent {
232
264
  constructor() {
233
265
  super(...arguments);
@@ -237,11 +269,31 @@ class TableOrganism extends NgAtomicComponent {
237
269
  onCheckboxClick(item) {
238
270
  this.dispatch({ id: ActionId.CHECKBOX_CLICK, payload: item });
239
271
  }
272
+ onHeaderCheckboxClick(item) {
273
+ this.dispatch({ id: ActionId.HEADER_CHECKBOX_CLICK });
274
+ }
240
275
  onHeaderClick(column) {
241
276
  this.dispatch({ id: ActionId.HEADER_CLICK, payload: column });
242
277
  }
278
+ onDrop(event) {
279
+ const control = this.store.treeControl();
280
+ const nodes = control.dataNodes.filter(node => node.level === 0);
281
+ const nodes_ = getDisplayedNodes(nodes, control);
282
+ const draggedNode = nodes_[event.previousIndex];
283
+ const droppedNode = nodes_[event.currentIndex];
284
+ const items = flatItems(this.store.items(), this.store.childrenKey());
285
+ this.dispatch({
286
+ id: ActionId.ROW_DROP,
287
+ payload: {
288
+ previousIndex: nodes_.findIndex(node => node === event.item.data),
289
+ currentIndex: event.currentIndex,
290
+ dragged: items.find(item => item.id === draggedNode.id),
291
+ dropped: items.find(item => item.id === droppedNode.id),
292
+ }
293
+ });
294
+ }
243
295
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: TableOrganism, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
244
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.2", type: TableOrganism, isStandalone: true, selector: "organisms-table", host: { classAttribute: "organism" }, usesInheritance: true, hostDirectives: [{ directive: TableOrganismStore, inputs: ["form", "form", "itemActions", "itemActions", "selection", "selection", "items", "items", "childrenKey", "childrenKey", "highlight", "highlight"] }], ngImport: i0, template: `
296
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.2.2", type: TableOrganism, isStandalone: true, selector: "organisms-table", host: { classAttribute: "organism" }, usesInheritance: true, hostDirectives: [{ directive: TableOrganismStore, inputs: ["draggable", "draggable", "form", "form", "itemActions", "itemActions", "selection", "selection", "items", "items", "childrenKey", "childrenKey", "highlight", "highlight", "treeControl", "treeControl", "isHidden", "isHidden"] }], ngImport: i0, template: `
245
297
  <table
246
298
  mat-table
247
299
  recycleRows
@@ -249,52 +301,60 @@ class TableOrganism extends NgAtomicComponent {
249
301
  matSortDisableClear
250
302
  matSortDirection="desc"
251
303
  [dataSource]="store.dataSource()"
304
+ cdkDropList
305
+ (cdkDropListDropped)="onDrop($event)"
306
+ [cdkDropListDisabled]="!store.draggable()"
252
307
  >
253
- @for (column of store.columns(); track column.name; let i = $index) {
254
- @switch (column.type) {
255
- @case ('checkbox') {
256
- <molecules-checkbox-column
257
- [name]="column.name"
258
- [selection]="store.selection()"
259
- [isHidden]="store.isHidden()"
260
- (action)="dispatch($event)"
261
- />
262
- }
263
- @case ('actions') {
264
- <molecules-actions-column
265
- [name]="column.name"
266
- [itemActions]="column.actions"
267
- (action)="dispatch($event)"
268
- />
269
- }
270
- @case('tree') {
271
- <molecules-tree-column
272
- [name]="column.name"
273
- [headerText]="column.headerText"
274
- [treeControl]="store.treeControl()"
275
- [sort]="column.sort"
276
- (headerClick)="onHeaderClick(column.name)"
277
- />
278
- }
279
- @default {
280
- <molecules-smart-column
281
- [name]="column.name"
282
- [headerText]="column.headerText"
283
- [sort]="column.sort"
284
- (headerClick)="onHeaderClick(column.name)"
285
- />
308
+ <tbody
309
+ >
310
+ @for (column of store.columns(); track column.name; let i = $index) {
311
+ @switch (column.type) {
312
+ @case ('checkbox') {
313
+ <molecules-checkbox-column
314
+ [name]="column.name"
315
+ [selection]="store.selection()"
316
+ [isHidden]="store.isHidden()"
317
+ (action)="dispatch($event)"
318
+ />
319
+ }
320
+ @case ('actions') {
321
+ <molecules-actions-column
322
+ [name]="column.name"
323
+ [itemActions]="column.actions"
324
+ (action)="dispatch($event)"
325
+ />
326
+ }
327
+ @case('tree') {
328
+ <molecules-tree-column
329
+ [name]="column.name"
330
+ [headerText]="column.headerText"
331
+ [treeControl]="store.treeControl()"
332
+ [sort]="column.sort"
333
+ (headerClick)="onHeaderClick(column.name)"
334
+ />
335
+ }
336
+ @default {
337
+ <molecules-smart-column
338
+ [name]="column.name"
339
+ [headerText]="column.headerText"
340
+ [sort]="column.sort"
341
+ (headerClick)="onHeaderClick(column.name)"
342
+ />
343
+ }
286
344
  }
287
345
  }
288
- }
289
- <tr mat-header-row *matHeaderRowDef="store.columnNames(); sticky: true"></tr>
290
- <tr
291
- mat-row
292
- *matRowDef="let item; columns: store.columnNames();"
293
- [ngClass]="{ highlight: store.highlight().isSelected(item.id) }"
294
- ></tr>
295
- <div class="mat-row" *matNoDataRow>No Data</div>
346
+ <tr mat-header-row *matHeaderRowDef="store.columnNames(); sticky: true"></tr>
347
+ <tr
348
+ mat-row
349
+ *matRowDef="let item; columns: store.columnNames();"
350
+ [ngClass]="{ highlight: store.highlight().isSelected(item.id) }"
351
+ [cdkDrag]
352
+ [cdkDragDisabled]="!store.draggable()"
353
+ ></tr>
354
+ <div class="mat-row" *matNoDataRow>No Data</div>
355
+ </tbody>
296
356
  </table>
297
- `, isInline: true, styles: [":host{--width: 100%;--width-SCOPED-IN-smart-table-ZJ54: var(--width);--column-vertical-padding: 4px;--column-vertical-padding-SCOPED-IN-smart-table-ZJ54: var(--column-vertical-padding);--surface-color: #f0f0f0;--surface-color-SCOPED-IN-smart-table-ZJ54: var(--surface-color);--on-surface-color: #000;--on-surface-color-SCOPED-IN-smart-table-ZJ54: var(--on-surface-color);--background-color: #f0f0f0;--background-color-SCOPED-IN-smart-table-ZJ54: var(--background-color);--on-background-color: #000;--on-background-color-SCOPED-IN-smart-table-ZJ54: var(--on-background-color);--vertical-padding: 16px;--vertical-padding-SCOPED-IN-smart-table-ZJ54: var(--vertical-padding)}:host{position:relative;display:block;width:100%;height:100%;overflow:scroll}:host::-webkit-scrollbar{display:none}:host table{width:100%;max-height:100%;background-color:var(--background-color-SCOPED-IN-smart-table-ZJ54);color:var(--on-background-color-SCOPED-IN-smart-table-ZJ54)}:host table .nowrap{width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host table ::ng-deep th,:host table ::ng-deep td{padding:0 var(--column-vertical-padding-SCOPED-IN-smart-table-ZJ54);box-sizing:border-box}:host table ::ng-deep th:first-child,:host table ::ng-deep td:first-child{padding-left:var(--vertical-padding-SCOPED-IN-smart-table-ZJ54)}:host table ::ng-deep th:last-child,:host table ::ng-deep td:last-child{padding-right:var(--vertical-padding-SCOPED-IN-smart-table-ZJ54)}:host table ::ng-deep tr.highlight{background-color:#f0f0f0;transition:background-color .5s}:host .no-data-message{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px);height:3em;padding:0 16px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1.MatRecycleRows, selector: "mat-table[recycleRows], table[mat-table][recycleRows]" }, { kind: "directive", type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: ActionsColumnMolecule, selector: "molecules-actions-column" }, { kind: "component", type: CheckboxColumnMolecule, selector: "molecules-checkbox-column", inputs: ["name", "selection", "isHidden"] }, { kind: "component", type: SmartColumnMolecule, selector: "molecules-smart-column", inputs: ["headerText", "name"], outputs: ["headerClick"] }, { kind: "component", type: TreeColumnMolecule, selector: "molecules-tree-column", outputs: ["headerClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
357
+ `, isInline: true, styles: [":host{--width: 100%;--width-SCOPED-IN-smart-table-of5W: var(--width);--column-vertical-padding: 4px;--column-vertical-padding-SCOPED-IN-smart-table-of5W: var(--column-vertical-padding);--surface-color: #f0f0f0;--surface-color-SCOPED-IN-smart-table-of5W: var(--surface-color);--on-surface-color: #000;--on-surface-color-SCOPED-IN-smart-table-of5W: var(--on-surface-color);--background-color: #f0f0f0;--background-color-SCOPED-IN-smart-table-of5W: var(--background-color);--on-background-color: #000;--on-background-color-SCOPED-IN-smart-table-of5W: var(--on-background-color);--vertical-padding: 16px;--vertical-padding-SCOPED-IN-smart-table-of5W: var(--vertical-padding)}.cdk-drag-preview{display:table;background-color:#fff}.cdk-drag-placeholder{opacity:0}:host{position:relative;display:block;width:100%;height:100%;overflow:scroll}:host::-webkit-scrollbar{display:none}:host table{width:100%;max-height:100%;background-color:var(--background-color-SCOPED-IN-smart-table-of5W);color:var(--on-background-color-SCOPED-IN-smart-table-of5W)}:host table .nowrap{width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host table ::ng-deep th,:host table ::ng-deep td{padding:0 var(--column-vertical-padding-SCOPED-IN-smart-table-of5W);box-sizing:border-box}:host table ::ng-deep th:first-child,:host table ::ng-deep td:first-child{padding-left:var(--vertical-padding-SCOPED-IN-smart-table-of5W)}:host table ::ng-deep th:last-child,:host table ::ng-deep td:last-child{padding-right:var(--vertical-padding-SCOPED-IN-smart-table-of5W)}:host table ::ng-deep tr.highlight{background-color:#f0f0f0;transition:background-color .5s}:host .no-data-message{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px);height:3em;padding:0 16px}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: MatTableModule }, { kind: "component", type: i1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i1.MatRecycleRows, selector: "mat-table[recycleRows], table[mat-table][recycleRows]" }, { kind: "directive", type: i1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "component", type: i1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i1.MatNoDataRow, selector: "ng-template[matNoDataRow]" }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "ngmodule", type: MatMenuModule }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: ActionsColumnMolecule, selector: "molecules-actions-column" }, { kind: "component", type: CheckboxColumnMolecule, selector: "molecules-checkbox-column", inputs: ["name", "selection", "isHidden"] }, { kind: "component", type: SmartColumnMolecule, selector: "molecules-smart-column", inputs: ["headerText", "name"], outputs: ["headerClick"] }, { kind: "component", type: TreeColumnMolecule, selector: "molecules-tree-column", outputs: ["headerClick"] }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
298
358
  }
299
359
  __decorate([
300
360
  Effect(CheckboxColumnMolecule.ActionId.CHECKBOX_CLICK),
@@ -302,6 +362,12 @@ __decorate([
302
362
  __metadata("design:paramtypes", [Object]),
303
363
  __metadata("design:returntype", void 0)
304
364
  ], TableOrganism.prototype, "onCheckboxClick", null);
365
+ __decorate([
366
+ Effect(CheckboxColumnMolecule.ActionId.HEADER_CHECKBOX_CLICK),
367
+ __metadata("design:type", Function),
368
+ __metadata("design:paramtypes", [Object]),
369
+ __metadata("design:returntype", void 0)
370
+ ], TableOrganism.prototype, "onHeaderCheckboxClick", null);
305
371
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImport: i0, type: TableOrganism, decorators: [{
306
372
  type: Component,
307
373
  args: [{ selector: 'organisms-table', standalone: true, imports: [
@@ -321,6 +387,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
321
387
  AutoColumnsPipe,
322
388
  SortPipe,
323
389
  ColumnsPipe,
390
+ CdkDropList,
391
+ CdkDrag,
324
392
  ], template: `
325
393
  <table
326
394
  mat-table
@@ -329,62 +397,100 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.2", ngImpor
329
397
  matSortDisableClear
330
398
  matSortDirection="desc"
331
399
  [dataSource]="store.dataSource()"
400
+ cdkDropList
401
+ (cdkDropListDropped)="onDrop($event)"
402
+ [cdkDropListDisabled]="!store.draggable()"
332
403
  >
333
- @for (column of store.columns(); track column.name; let i = $index) {
334
- @switch (column.type) {
335
- @case ('checkbox') {
336
- <molecules-checkbox-column
337
- [name]="column.name"
338
- [selection]="store.selection()"
339
- [isHidden]="store.isHidden()"
340
- (action)="dispatch($event)"
341
- />
342
- }
343
- @case ('actions') {
344
- <molecules-actions-column
345
- [name]="column.name"
346
- [itemActions]="column.actions"
347
- (action)="dispatch($event)"
348
- />
349
- }
350
- @case('tree') {
351
- <molecules-tree-column
352
- [name]="column.name"
353
- [headerText]="column.headerText"
354
- [treeControl]="store.treeControl()"
355
- [sort]="column.sort"
356
- (headerClick)="onHeaderClick(column.name)"
357
- />
358
- }
359
- @default {
360
- <molecules-smart-column
361
- [name]="column.name"
362
- [headerText]="column.headerText"
363
- [sort]="column.sort"
364
- (headerClick)="onHeaderClick(column.name)"
365
- />
404
+ <tbody
405
+ >
406
+ @for (column of store.columns(); track column.name; let i = $index) {
407
+ @switch (column.type) {
408
+ @case ('checkbox') {
409
+ <molecules-checkbox-column
410
+ [name]="column.name"
411
+ [selection]="store.selection()"
412
+ [isHidden]="store.isHidden()"
413
+ (action)="dispatch($event)"
414
+ />
415
+ }
416
+ @case ('actions') {
417
+ <molecules-actions-column
418
+ [name]="column.name"
419
+ [itemActions]="column.actions"
420
+ (action)="dispatch($event)"
421
+ />
422
+ }
423
+ @case('tree') {
424
+ <molecules-tree-column
425
+ [name]="column.name"
426
+ [headerText]="column.headerText"
427
+ [treeControl]="store.treeControl()"
428
+ [sort]="column.sort"
429
+ (headerClick)="onHeaderClick(column.name)"
430
+ />
431
+ }
432
+ @default {
433
+ <molecules-smart-column
434
+ [name]="column.name"
435
+ [headerText]="column.headerText"
436
+ [sort]="column.sort"
437
+ (headerClick)="onHeaderClick(column.name)"
438
+ />
439
+ }
366
440
  }
367
441
  }
368
- }
369
- <tr mat-header-row *matHeaderRowDef="store.columnNames(); sticky: true"></tr>
370
- <tr
371
- mat-row
372
- *matRowDef="let item; columns: store.columnNames();"
373
- [ngClass]="{ highlight: store.highlight().isSelected(item.id) }"
374
- ></tr>
375
- <div class="mat-row" *matNoDataRow>No Data</div>
442
+ <tr mat-header-row *matHeaderRowDef="store.columnNames(); sticky: true"></tr>
443
+ <tr
444
+ mat-row
445
+ *matRowDef="let item; columns: store.columnNames();"
446
+ [ngClass]="{ highlight: store.highlight().isSelected(item.id) }"
447
+ [cdkDrag]
448
+ [cdkDragDisabled]="!store.draggable()"
449
+ ></tr>
450
+ <div class="mat-row" *matNoDataRow>No Data</div>
451
+ </tbody>
376
452
  </table>
377
453
  `, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [
378
454
  {
379
455
  directive: TableOrganismStore,
380
- inputs: ['form', 'itemActions', 'selection', 'items', 'childrenKey', 'highlight'],
456
+ inputs: [
457
+ 'draggable',
458
+ 'form',
459
+ 'itemActions',
460
+ 'selection',
461
+ 'items',
462
+ 'childrenKey',
463
+ 'highlight',
464
+ 'treeControl',
465
+ 'isHidden',
466
+ ],
381
467
  },
382
- ], host: { class: 'organism' }, styles: [":host{--width: 100%;--width-SCOPED-IN-smart-table-ZJ54: var(--width);--column-vertical-padding: 4px;--column-vertical-padding-SCOPED-IN-smart-table-ZJ54: var(--column-vertical-padding);--surface-color: #f0f0f0;--surface-color-SCOPED-IN-smart-table-ZJ54: var(--surface-color);--on-surface-color: #000;--on-surface-color-SCOPED-IN-smart-table-ZJ54: var(--on-surface-color);--background-color: #f0f0f0;--background-color-SCOPED-IN-smart-table-ZJ54: var(--background-color);--on-background-color: #000;--on-background-color-SCOPED-IN-smart-table-ZJ54: var(--on-background-color);--vertical-padding: 16px;--vertical-padding-SCOPED-IN-smart-table-ZJ54: var(--vertical-padding)}:host{position:relative;display:block;width:100%;height:100%;overflow:scroll}:host::-webkit-scrollbar{display:none}:host table{width:100%;max-height:100%;background-color:var(--background-color-SCOPED-IN-smart-table-ZJ54);color:var(--on-background-color-SCOPED-IN-smart-table-ZJ54)}:host table .nowrap{width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host table ::ng-deep th,:host table ::ng-deep td{padding:0 var(--column-vertical-padding-SCOPED-IN-smart-table-ZJ54);box-sizing:border-box}:host table ::ng-deep th:first-child,:host table ::ng-deep td:first-child{padding-left:var(--vertical-padding-SCOPED-IN-smart-table-ZJ54)}:host table ::ng-deep th:last-child,:host table ::ng-deep td:last-child{padding-right:var(--vertical-padding-SCOPED-IN-smart-table-ZJ54)}:host table ::ng-deep tr.highlight{background-color:#f0f0f0;transition:background-color .5s}:host .no-data-message{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px);height:3em;padding:0 16px}\n"] }]
383
- }], propDecorators: { onCheckboxClick: [] } });
468
+ ], host: { class: 'organism' }, styles: [":host{--width: 100%;--width-SCOPED-IN-smart-table-of5W: var(--width);--column-vertical-padding: 4px;--column-vertical-padding-SCOPED-IN-smart-table-of5W: var(--column-vertical-padding);--surface-color: #f0f0f0;--surface-color-SCOPED-IN-smart-table-of5W: var(--surface-color);--on-surface-color: #000;--on-surface-color-SCOPED-IN-smart-table-of5W: var(--on-surface-color);--background-color: #f0f0f0;--background-color-SCOPED-IN-smart-table-of5W: var(--background-color);--on-background-color: #000;--on-background-color-SCOPED-IN-smart-table-of5W: var(--on-background-color);--vertical-padding: 16px;--vertical-padding-SCOPED-IN-smart-table-of5W: var(--vertical-padding)}.cdk-drag-preview{display:table;background-color:#fff}.cdk-drag-placeholder{opacity:0}:host{position:relative;display:block;width:100%;height:100%;overflow:scroll}:host::-webkit-scrollbar{display:none}:host table{width:100%;max-height:100%;background-color:var(--background-color-SCOPED-IN-smart-table-of5W);color:var(--on-background-color-SCOPED-IN-smart-table-of5W)}:host table .nowrap{width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host table ::ng-deep th,:host table ::ng-deep td{padding:0 var(--column-vertical-padding-SCOPED-IN-smart-table-of5W);box-sizing:border-box}:host table ::ng-deep th:first-child,:host table ::ng-deep td:first-child{padding-left:var(--vertical-padding-SCOPED-IN-smart-table-of5W)}:host table ::ng-deep th:last-child,:host table ::ng-deep td:last-child{padding-right:var(--vertical-padding-SCOPED-IN-smart-table-of5W)}:host table ::ng-deep tr.highlight{background-color:#f0f0f0;transition:background-color .5s}:host .no-data-message{display:flex;justify-content:flex-start;align-items:center;width:calc(100% - 32px);height:3em;padding:0 16px}\n"] }]
469
+ }], propDecorators: { onCheckboxClick: [], onHeaderCheckboxClick: [] } });
470
+ function getDisplayedNodes(nodes, control) {
471
+ const result = [];
472
+ for (const node of nodes) {
473
+ result.push(node);
474
+ if (control.isExpanded(node)) {
475
+ result.push(...getDisplayedNodes(node.children, control));
476
+ }
477
+ }
478
+ return result;
479
+ }
480
+ function flatItems(items, key = 'children') {
481
+ const result = [];
482
+ for (const item of items) {
483
+ result.push(item);
484
+ if (item[key]) {
485
+ result.push(...flatItems(item[key], key));
486
+ }
487
+ }
488
+ return result;
489
+ }
384
490
 
385
491
  /**
386
492
  * Generated bundle index. Do not edit.
387
493
  */
388
494
 
389
- export { IndexFormBuilder, IndexFormBuilder as IndexTemplateFormBuilder, TableOrganism, TableOrganismStore, buildColumns, injectIndexForm, injectIndexFormBuilder, injectIndexForm as injectIndexTemplateForm, injectIndexFormBuilder as injectIndexTemplateFormBuilder };
495
+ export { IndexFormBuilder, IndexFormBuilder as IndexTemplateFormBuilder, TableOrganism, TableOrganismStore, buildColumns, flatItems, injectIndexForm, injectIndexFormBuilder, injectIndexForm as injectIndexTemplateForm, injectIndexFormBuilder as injectIndexTemplateFormBuilder };
390
496
  //# sourceMappingURL=ng-atomic-components-organisms-table.mjs.map