@acorex/components 7.0.7 → 7.0.10

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 (231) hide show
  1. package/action-sheet/public-api.d.ts +1 -1
  2. package/action-sheet/src/action-sheet.component.d.ts +19 -13
  3. package/action-sheet/src/action-sheet.interface.d.ts +20 -0
  4. package/action-sheet/src/action-sheet.module.d.ts +8 -4
  5. package/action-sheet/src/action-sheet.service.d.ts +13 -0
  6. package/alert/src/alert.component.d.ts +2 -2
  7. package/badge/src/badge.component.d.ts +2 -2
  8. package/breadcrumbs/src/breadcrumbs-item.component.d.ts +6 -6
  9. package/button/src/button-group.component.d.ts +6 -6
  10. package/button/src/button-item.component.d.ts +6 -6
  11. package/color-picker/src/color-picker.component.d.ts +16 -16
  12. package/common/public-api.d.ts +12 -12
  13. package/common/src/{components.class.d.ts → classes/components.class.d.ts} +21 -1
  14. package/common/src/{drawing.class.d.ts → classes/drawing.class.d.ts} +0 -0
  15. package/common/src/{events.class.d.ts → classes/events.class.d.ts} +0 -0
  16. package/common/src/{styles.class.d.ts → classes/styles.class.d.ts} +0 -0
  17. package/common/src/common.module.d.ts +5 -5
  18. package/common/src/{auto-focus.directive.d.ts → directives/auto-focus.directive.d.ts} +1 -1
  19. package/common/src/{debounce-time.directive.d.ts → directives/debounce-time.directive.d.ts} +0 -0
  20. package/common/src/{hotkey.directive.d.ts → directives/hotkey.directive.d.ts} +2 -2
  21. package/common/src/{infinite-scroll.directive.d.ts → directives/infinite-scroll.directive.d.ts} +0 -0
  22. package/common/src/{responsive.directive.d.ts → directives/responsive.directive.d.ts} +0 -0
  23. package/common/src/{custom-cdk-overlay.service.d.ts → services/custom-cdk-overlay.service.d.ts} +0 -0
  24. package/common/src/{hotkey.service.d.ts → services/hotkey.service.d.ts} +0 -0
  25. package/common/src/{overlay.service.d.ts → services/overlay.service.d.ts} +4 -3
  26. package/context-menu/src/context-menu.component.d.ts +1 -1
  27. package/date-picker/src/datepicker.component.d.ts +14 -14
  28. package/dialog/src/dialog.class.d.ts +2 -1
  29. package/esm2020/action-sheet/public-api.mjs +2 -2
  30. package/esm2020/action-sheet/src/action-sheet.component.mjs +49 -74
  31. package/esm2020/action-sheet/src/action-sheet.interface.mjs +3 -0
  32. package/esm2020/action-sheet/src/action-sheet.module.mjs +12 -7
  33. package/esm2020/action-sheet/src/action-sheet.service.mjs +85 -0
  34. package/esm2020/button/src/button.component.mjs +2 -2
  35. package/esm2020/common/public-api.mjs +13 -13
  36. package/esm2020/common/src/classes/components.class.mjs +71 -0
  37. package/esm2020/common/src/classes/drawing.class.mjs +2 -0
  38. package/esm2020/common/src/classes/events.class.mjs +58 -0
  39. package/esm2020/common/src/classes/styles.class.mjs +22 -0
  40. package/esm2020/common/src/common.module.mjs +6 -6
  41. package/esm2020/common/src/directives/auto-focus.directive.mjs +55 -0
  42. package/esm2020/common/src/directives/debounce-time.directive.mjs +47 -0
  43. package/esm2020/common/src/directives/hotkey.directive.mjs +79 -0
  44. package/esm2020/common/src/directives/infinite-scroll.directive.mjs +63 -0
  45. package/esm2020/common/src/directives/responsive.directive.mjs +34 -0
  46. package/esm2020/common/src/services/custom-cdk-overlay.service.mjs +48 -0
  47. package/esm2020/common/src/services/hotkey.service.mjs +38 -0
  48. package/esm2020/common/src/services/overlay.service.mjs +96 -0
  49. package/esm2020/context-menu/src/context-menu.component.mjs +4 -4
  50. package/esm2020/decorators/src/close-button.component.mjs +4 -4
  51. package/esm2020/dialog/src/dialog.class.mjs +1 -1
  52. package/esm2020/dialog/src/dialog.component.mjs +3 -3
  53. package/esm2020/dialog/src/dialog.service.mjs +2 -1
  54. package/esm2020/menu/src/menu.component.mjs +16 -16
  55. package/esm2020/mixin/src/base-menu-mixin.class.mjs +3 -3
  56. package/esm2020/page/src/base-page.class.mjs +1 -27
  57. package/esm2020/popup/src/popup.component.mjs +4 -5
  58. package/esm2020/popup/src/popup.service.mjs +3 -3
  59. package/esm2020/range-slider/src/range-slider.component.mjs +2 -2
  60. package/esm2020/tabs/src/tab-content.directive.mjs +1 -1
  61. package/esm2020/tabs/src/tabs.component.mjs +1 -1
  62. package/esm2020/toast/src/toast.class.mjs +1 -1
  63. package/esm2020/toast/src/toast.component.mjs +29 -21
  64. package/esm2020/toast/src/toast.module.mjs +3 -6
  65. package/fesm2015/acorex-components-action-sheet.mjs +140 -124
  66. package/fesm2015/acorex-components-action-sheet.mjs.map +1 -1
  67. package/fesm2015/acorex-components-alert.mjs +0 -1
  68. package/fesm2015/acorex-components-avatar.mjs +0 -1
  69. package/fesm2015/acorex-components-badge.mjs +0 -1
  70. package/fesm2015/acorex-components-breadcrumbs.mjs +0 -1
  71. package/fesm2015/acorex-components-button.mjs +2 -2
  72. package/fesm2015/acorex-components-button.mjs.map +1 -1
  73. package/fesm2015/acorex-components-calendar.mjs +0 -1
  74. package/fesm2015/acorex-components-checkbox.mjs +0 -1
  75. package/fesm2015/acorex-components-chips.mjs +0 -1
  76. package/fesm2015/acorex-components-collapse.mjs +0 -1
  77. package/fesm2015/acorex-components-color-palette.mjs +0 -1
  78. package/fesm2015/acorex-components-color-picker.mjs +0 -1
  79. package/fesm2015/acorex-components-common.mjs +149 -120
  80. package/fesm2015/acorex-components-common.mjs.map +1 -1
  81. package/fesm2015/acorex-components-context-menu.mjs +3 -4
  82. package/fesm2015/acorex-components-context-menu.mjs.map +1 -1
  83. package/fesm2015/acorex-components-data-pager.mjs +0 -1
  84. package/fesm2015/acorex-components-data-table.mjs +0 -1
  85. package/fesm2015/acorex-components-date-picker.mjs +0 -1
  86. package/fesm2015/acorex-components-decorators.mjs +3 -4
  87. package/fesm2015/acorex-components-decorators.mjs.map +1 -1
  88. package/fesm2015/acorex-components-dialog.mjs +3 -3
  89. package/fesm2015/acorex-components-dialog.mjs.map +1 -1
  90. package/fesm2015/acorex-components-drawer.mjs +0 -1
  91. package/fesm2015/acorex-components-dropdown.mjs +0 -1
  92. package/fesm2015/acorex-components-form.mjs +0 -1
  93. package/fesm2015/acorex-components-image.mjs +0 -1
  94. package/fesm2015/acorex-components-label.mjs +0 -1
  95. package/fesm2015/acorex-components-loading.mjs +0 -1
  96. package/fesm2015/acorex-components-menu.mjs +15 -16
  97. package/fesm2015/acorex-components-menu.mjs.map +1 -1
  98. package/fesm2015/acorex-components-mixin.mjs +2 -3
  99. package/fesm2015/acorex-components-mixin.mjs.map +1 -1
  100. package/fesm2015/acorex-components-number-box.mjs +0 -1
  101. package/fesm2015/acorex-components-page.mjs +1 -28
  102. package/fesm2015/acorex-components-page.mjs.map +1 -1
  103. package/fesm2015/acorex-components-password-box.mjs +0 -1
  104. package/fesm2015/acorex-components-popover.mjs +0 -1
  105. package/fesm2015/acorex-components-popup.mjs +4 -6
  106. package/fesm2015/acorex-components-popup.mjs.map +1 -1
  107. package/fesm2015/acorex-components-progress-bar.mjs +0 -1
  108. package/fesm2015/acorex-components-radio.mjs +0 -1
  109. package/fesm2015/acorex-components-range-slider.mjs +2 -3
  110. package/fesm2015/acorex-components-range-slider.mjs.map +1 -1
  111. package/fesm2015/acorex-components-rating.mjs +0 -1
  112. package/fesm2015/acorex-components-result.mjs +0 -1
  113. package/fesm2015/acorex-components-search-box.mjs +0 -1
  114. package/fesm2015/acorex-components-select-box.mjs +0 -1
  115. package/fesm2015/acorex-components-selection-list.mjs +0 -1
  116. package/fesm2015/acorex-components-switch.mjs +0 -1
  117. package/fesm2015/acorex-components-tabs.mjs +0 -1
  118. package/fesm2015/acorex-components-tabs.mjs.map +1 -1
  119. package/fesm2015/acorex-components-tag.mjs +0 -1
  120. package/fesm2015/acorex-components-textarea.mjs +0 -1
  121. package/fesm2015/acorex-components-textbox.mjs +0 -1
  122. package/fesm2015/acorex-components-time-box.mjs +0 -1
  123. package/fesm2015/acorex-components-toast.mjs +30 -26
  124. package/fesm2015/acorex-components-toast.mjs.map +1 -1
  125. package/fesm2015/acorex-components-tooltip.mjs +0 -1
  126. package/fesm2015/acorex-components-tree-view.mjs +0 -1
  127. package/fesm2015/acorex-components-uploader.mjs +0 -1
  128. package/fesm2015/acorex-components.mjs +0 -1
  129. package/fesm2020/acorex-components-action-sheet.mjs +139 -124
  130. package/fesm2020/acorex-components-action-sheet.mjs.map +1 -1
  131. package/fesm2020/acorex-components-alert.mjs +0 -1
  132. package/fesm2020/acorex-components-avatar.mjs +0 -1
  133. package/fesm2020/acorex-components-badge.mjs +0 -1
  134. package/fesm2020/acorex-components-breadcrumbs.mjs +0 -1
  135. package/fesm2020/acorex-components-button.mjs +2 -2
  136. package/fesm2020/acorex-components-button.mjs.map +1 -1
  137. package/fesm2020/acorex-components-calendar.mjs +0 -1
  138. package/fesm2020/acorex-components-checkbox.mjs +0 -1
  139. package/fesm2020/acorex-components-chips.mjs +0 -1
  140. package/fesm2020/acorex-components-collapse.mjs +0 -1
  141. package/fesm2020/acorex-components-color-palette.mjs +0 -1
  142. package/fesm2020/acorex-components-color-picker.mjs +0 -1
  143. package/fesm2020/acorex-components-common.mjs +149 -120
  144. package/fesm2020/acorex-components-common.mjs.map +1 -1
  145. package/fesm2020/acorex-components-context-menu.mjs +3 -4
  146. package/fesm2020/acorex-components-context-menu.mjs.map +1 -1
  147. package/fesm2020/acorex-components-data-pager.mjs +0 -1
  148. package/fesm2020/acorex-components-data-table.mjs +0 -1
  149. package/fesm2020/acorex-components-date-picker.mjs +0 -1
  150. package/fesm2020/acorex-components-decorators.mjs +3 -4
  151. package/fesm2020/acorex-components-decorators.mjs.map +1 -1
  152. package/fesm2020/acorex-components-dialog.mjs +3 -3
  153. package/fesm2020/acorex-components-dialog.mjs.map +1 -1
  154. package/fesm2020/acorex-components-drawer.mjs +0 -1
  155. package/fesm2020/acorex-components-dropdown.mjs +0 -1
  156. package/fesm2020/acorex-components-form.mjs +0 -1
  157. package/fesm2020/acorex-components-image.mjs +0 -1
  158. package/fesm2020/acorex-components-label.mjs +0 -1
  159. package/fesm2020/acorex-components-loading.mjs +0 -1
  160. package/fesm2020/acorex-components-menu.mjs +15 -16
  161. package/fesm2020/acorex-components-menu.mjs.map +1 -1
  162. package/fesm2020/acorex-components-mixin.mjs +2 -3
  163. package/fesm2020/acorex-components-mixin.mjs.map +1 -1
  164. package/fesm2020/acorex-components-number-box.mjs +0 -1
  165. package/fesm2020/acorex-components-page.mjs +1 -28
  166. package/fesm2020/acorex-components-page.mjs.map +1 -1
  167. package/fesm2020/acorex-components-password-box.mjs +0 -1
  168. package/fesm2020/acorex-components-popover.mjs +0 -1
  169. package/fesm2020/acorex-components-popup.mjs +4 -6
  170. package/fesm2020/acorex-components-popup.mjs.map +1 -1
  171. package/fesm2020/acorex-components-progress-bar.mjs +0 -1
  172. package/fesm2020/acorex-components-radio.mjs +0 -1
  173. package/fesm2020/acorex-components-range-slider.mjs +2 -3
  174. package/fesm2020/acorex-components-range-slider.mjs.map +1 -1
  175. package/fesm2020/acorex-components-rating.mjs +0 -1
  176. package/fesm2020/acorex-components-result.mjs +0 -1
  177. package/fesm2020/acorex-components-search-box.mjs +0 -1
  178. package/fesm2020/acorex-components-select-box.mjs +0 -1
  179. package/fesm2020/acorex-components-selection-list.mjs +0 -1
  180. package/fesm2020/acorex-components-switch.mjs +0 -1
  181. package/fesm2020/acorex-components-tabs.mjs +0 -1
  182. package/fesm2020/acorex-components-tabs.mjs.map +1 -1
  183. package/fesm2020/acorex-components-tag.mjs +0 -1
  184. package/fesm2020/acorex-components-textarea.mjs +0 -1
  185. package/fesm2020/acorex-components-textbox.mjs +0 -1
  186. package/fesm2020/acorex-components-time-box.mjs +0 -1
  187. package/fesm2020/acorex-components-toast.mjs +30 -26
  188. package/fesm2020/acorex-components-toast.mjs.map +1 -1
  189. package/fesm2020/acorex-components-tooltip.mjs +0 -1
  190. package/fesm2020/acorex-components-tree-view.mjs +0 -1
  191. package/fesm2020/acorex-components-uploader.mjs +0 -1
  192. package/fesm2020/acorex-components.mjs +0 -1
  193. package/menu/src/menu.component.d.ts +1 -1
  194. package/mixin/src/base-components.class.d.ts +2 -2
  195. package/mixin/src/base-menu-mixin.class.d.ts +6 -6
  196. package/mixin/src/button-mixin.class.d.ts +2 -2
  197. package/mixin/src/clickable-mixin.class.d.ts +2 -2
  198. package/mixin/src/color-look-mixing.class.d.ts +2 -2
  199. package/mixin/src/datalist-component.class.d.ts +10 -10
  200. package/mixin/src/dropdown-mixin.class.d.ts +2 -2
  201. package/mixin/src/interactive-mixin.class.d.ts +4 -4
  202. package/mixin/src/loading-mixin.class.d.ts +2 -2
  203. package/mixin/src/mixin.class.d.ts +62 -62
  204. package/mixin/src/page-component.class.d.ts +2 -2
  205. package/mixin/src/selection-component.class.d.ts +2 -2
  206. package/mixin/src/sizable-mixin.class.d.ts +2 -2
  207. package/mixin/src/textbox-mixin.class.d.ts +2 -2
  208. package/mixin/src/value-mixin.class.d.ts +8 -8
  209. package/package.json +1 -1
  210. package/page/src/base-page.class.d.ts +3 -23
  211. package/popup/src/popup.component.d.ts +2 -2
  212. package/popup/src/popup.service.d.ts +3 -4
  213. package/tabs/src/tab-content.directive.d.ts +2 -2
  214. package/tabs/src/tab-item.component.d.ts +2 -2
  215. package/toast/src/toast.class.d.ts +1 -0
  216. package/toast/src/toast.component.d.ts +1 -0
  217. package/toast/src/toast.module.d.ts +1 -4
  218. package/action-sheet/src/action-sheet-item.component.d.ts +0 -16
  219. package/esm2020/action-sheet/src/action-sheet-item.component.mjs +0 -47
  220. package/esm2020/common/src/auto-focus.directive.mjs +0 -55
  221. package/esm2020/common/src/components.class.mjs +0 -45
  222. package/esm2020/common/src/custom-cdk-overlay.service.mjs +0 -48
  223. package/esm2020/common/src/debounce-time.directive.mjs +0 -47
  224. package/esm2020/common/src/drawing.class.mjs +0 -2
  225. package/esm2020/common/src/events.class.mjs +0 -58
  226. package/esm2020/common/src/hotkey.directive.mjs +0 -79
  227. package/esm2020/common/src/hotkey.service.mjs +0 -38
  228. package/esm2020/common/src/infinite-scroll.directive.mjs +0 -63
  229. package/esm2020/common/src/overlay.service.mjs +0 -91
  230. package/esm2020/common/src/responsive.directive.mjs +0 -34
  231. package/esm2020/common/src/styles.class.mjs +0 -22
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../projects/acorex/components/toast/src/toast.component.ts","../../../../projects/acorex/components/toast/src/toast.component.html","../../../../projects/acorex/components/toast/src/toast.module.ts","../../../../projects/acorex/components/toast/src/toast.service.ts","../../../../projects/acorex/components/toast/acorex-components-toast.ts"],"sourcesContent":["import { AXClosbaleComponent } from '@acorex/components/common';\r\nimport { AXButtonItem } from '@acorex/components/button';\r\nimport {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n} from '@angular/core';\r\nimport { AXToastOptions } from './toast.class';\r\nimport { AXBaseComponentMixin } from '@acorex/components/mixin';\r\n\r\n/**\r\n * The Button is a component which detects user interaction and triggers a corresponding event\r\n *\r\n * @category Components\r\n */\r\n@Component({\r\n selector: 'ax-toast',\r\n templateUrl: './toast.component.html',\r\n styleUrls: ['./toast.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\r\n})\r\nexport class AXToastComponent extends AXBaseComponentMixin {\r\n\r\n options: AXToastOptions;\r\n\r\n _toastWidth: number = 100;\r\n\r\n _icon: string;\r\n \r\n close: () => void;\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n onInit() {\r\n if (this.options.timeOut) {\r\n setTimeout(() => {\r\n this.close();\r\n }, this.options.timeOut);\r\n }\r\n switch (this.options.color) {\r\n case 'success':\r\n this._icon = 'ax-icon ax-icon-check-filled';\r\n break;\r\n case 'warning':\r\n this._icon = 'ax-icon ax-icon-warning-filled';\r\n break;\r\n case 'danger':\r\n this._icon = 'ax-icon ax-icon-error-filled';\r\n break;\r\n default:\r\n this._icon = '';\r\n break;\r\n }\r\n }\r\n\r\n _handleButtonClick(button: AXButtonItem) {\r\n if (button.onClick) {\r\n button.onClick(this);\r\n }\r\n }\r\n}\r\n","<ax-alert [color]=\"options.color\" [timeOut]=\"options.timeOut\">\r\n <ax-icon *ngIf=\"_icon\" [icon]=\"_icon\"></ax-icon>\r\n <ax-title [text]=\"options.title\"></ax-title>\r\n <ax-close-button *ngIf=\"options.closeable\"></ax-close-button>\r\n <ax-content *ngIf=\"options.content\">\r\n <div [innerHTML]=\"options.content\"></div>\r\n </ax-content>\r\n <ax-footer *ngIf=\"options?.buttons?.length\">\r\n <ax-button *ngFor=\"let button of options.buttons\" [text]=\"button.text\" class=\"ax-sm\"\r\n (onClick)=\"_handleButtonClick(button)\" [color]=\"options.color\" [look]=\"'default'\"></ax-button>\r\n </ax-footer>\r\n</ax-alert>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { AXToastComponent } from './toast.component';\r\nimport { AXAlertModule } from '@acorex/components/alert';\r\nimport { AXButtonModule } from '@acorex/components/button';\r\nimport { AXDecoratorModule } from '@acorex/components/decorators';\r\n\r\nconst COMPONENT = [AXToastComponent];\r\nconst MODULES = [CommonModule, AXButtonModule, AXDecoratorModule, AXAlertModule];\r\n\r\n@NgModule({\r\n declarations: [...COMPONENT],\r\n imports: [...MODULES],\r\n exports: [...COMPONENT],\r\n providers: [],\r\n})\r\nexport class AXToastModule {\r\n \r\n}\r\n","import { AXConfig } from '@acorex/core/config';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { Injectable, Injector } from '@angular/core';\r\nimport { AXToastOptions, AXToastRef } from './toast.class';\r\nimport { AXToastComponent } from './toast.component';\r\n\r\n\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AXToastService {\r\n\r\n\r\n private readonly _defaults = {\r\n gap: 5,\r\n timeOut: 2500,\r\n location: 'bottom-center',\r\n }\r\n\r\n constructor(private overlayService: Overlay, private parentInjector: Injector) {\r\n\r\n }\r\n\r\n private _activeList: AXToastComponent[] = [];\r\n\r\n primary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'primary',\r\n content: content\r\n });\r\n }\r\n secondary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'secondary',\r\n content: content\r\n });\r\n }\r\n success(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'success',\r\n content: content\r\n });\r\n }\r\n\r\n warning(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'warning',\r\n content: content\r\n });\r\n }\r\n danger(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'danger',\r\n content: content\r\n });\r\n }\r\n show(options: AXToastOptions): AXToastRef {\r\n const opt = Object.assign(\r\n {\r\n closeable: true,\r\n location: AXConfig.get('toast.location') || this._defaults.location\r\n },\r\n options\r\n );\r\n const gap = AXConfig.get('toast.gap') || this._defaults.gap;\r\n\r\n let positionStrategy = this.overlayService.position().global();\r\n const pos = this.getPosition(opt.location) + gap + 'px';\r\n switch (opt.location) {\r\n case 'bottom-center':\r\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally()\r\n break;\r\n case 'bottom-end':\r\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\r\n break;\r\n case 'bottom-start':\r\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\r\n break;\r\n case 'top-center':\r\n positionStrategy = positionStrategy.top(pos).centerHorizontally()\r\n break;\r\n case 'top-end':\r\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\r\n break;\r\n case 'top-start':\r\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\r\n break;\r\n case 'center-start':\r\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\r\n break;\r\n case 'center-end':\r\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\r\n break;\r\n default:\r\n break;\r\n }\r\n const overlayRef = this.overlayService.create(\r\n {\r\n positionStrategy,\r\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\r\n });\r\n const toastPortal = new ComponentPortal(AXToastComponent, null, this.parentInjector);\r\n\r\n const host = overlayRef.attach(toastPortal);\r\n (host.instance as any).visibleIndex = this._activeList.length;\r\n this._activeList.push(host.instance);\r\n if (host.instance) {\r\n Object.assign(host.instance, {\r\n options: opt,\r\n close: () => {\r\n this._activeList = this._activeList.filter(c => c != host.instance);\r\n overlayRef.dispose()\r\n }\r\n });\r\n setTimeout(() => {\r\n host.changeDetectorRef.detectChanges();\r\n }, 0);\r\n }\r\n\r\n return {\r\n close: () => {\r\n host.instance.close();\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n public hideAll() {\r\n this._activeList.forEach(c => c.close());\r\n }\r\n\r\n private getPosition(location: string) {\r\n const list = this._activeList.filter(c => c.options.location == location);\r\n if (list.length == 0) return 0;\r\n if (location.split('-')[0] == 'bottom') {\r\n return window.innerHeight - list[list.length - 1]._getHostElement().offsetTop;\r\n }\r\n else {\r\n return list[list.length - 1]._getHostElement().offsetTop + list[list.length - 1]._getHostElement().offsetHeight;\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;AAYA;;;;AAIG;AASG,MAAO,gBAAiB,SAAQ,oBAAoB,CAAA;AASxD;;AAEG;IACH,WAAY,CAAA,UAAsB,EAAE,GAAsB,EAAA;AACxD,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;AATzB,QAAA,IAAW,CAAA,WAAA,GAAW,GAAG,CAAC;KAUzB;IAED,MAAM,GAAA;AACJ,QAAA,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YACxB,UAAU,CAAC,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AG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC;AAC1E,QAAA,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC;AAAE,YAAA,OAAO,CAAC,CAAC;QAC/B,IAAI,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,QAAQ,EAAE;AACpC,YAAA,OAAO,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC;AACjF,SAAA;AACI,aAAA;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,YAAY,CAAC;AACnH,SAAA;KACJ;;2GAxIQ,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAd,cAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA,CAAA;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACTlC;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-components-toast.mjs","sources":["../../../../projects/acorex/components/toast/src/toast.component.ts","../../../../projects/acorex/components/toast/src/toast.component.html","../../../../projects/acorex/components/toast/src/toast.module.ts","../../../../projects/acorex/components/toast/src/toast.service.ts","../../../../projects/acorex/components/toast/acorex-components-toast.ts"],"sourcesContent":["import { AXClosbaleComponent } from '@acorex/components/common';\r\nimport { AXButtonItem } from '@acorex/components/button';\r\nimport {\r\n Component,\r\n ViewEncapsulation,\r\n ChangeDetectionStrategy,\r\n ElementRef,\r\n ChangeDetectorRef,\r\n HostBinding,\r\n} from '@angular/core';\r\nimport { AXToastOptions } from './toast.class';\r\nimport { AXBaseComponentMixin } from '@acorex/components/mixin';\r\n\r\n/**\r\n * The Button is a component which detects user interaction and triggers a corresponding event\r\n *\r\n * @category Components\r\n */\r\n@Component({\r\n selector: 'ax-toast',\r\n templateUrl: './toast.component.html',\r\n styleUrls: ['./toast.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n providers: [{ provide: AXClosbaleComponent, useExisting: AXToastComponent }],\r\n})\r\nexport class AXToastComponent extends AXBaseComponentMixin {\r\n\r\n options: AXToastOptions;\r\n\r\n _toastWidth: number = 100;\r\n\r\n _icon: string;\r\n\r\n close: () => void;\r\n /**\r\n * @ignore\r\n */\r\n constructor(elementRef: ElementRef, cdr: ChangeDetectorRef) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n onInit() {\r\n if (this.options.timeOut) {\r\n setTimeout(() => {\r\n this.close();\r\n }, this.options.timeOut);\r\n }\r\n if (!this.options.icon) {\r\n switch (this.options.color) {\r\n case 'success':\r\n this._icon = 'ax-icon ax-icon-check-circle-fill';\r\n break;\r\n case 'warning':\r\n this._icon = 'ax-icon ax-icon-warning-fill';\r\n break;\r\n case 'danger':\r\n this._icon = 'ax-icon ax-icon-error-fill';\r\n break;\r\n default:\r\n this._icon = this.options.icon || 'ax-icon ax-icon-check-circle-fill';\r\n break;\r\n }\r\n } else {\r\n this._icon = this.options.icon;\r\n }\r\n }\r\n\r\n _handleButtonClick(button: AXButtonItem) {\r\n if (button.onClick) {\r\n button.onClick(this);\r\n }\r\n }\r\n\r\n @HostBinding('class')\r\n private get __hostClass(): string {\r\n return `ax-${this.options.color}`\r\n }\r\n\r\n\r\n}\r\n","<!-- <ax-alert [color]=\"options.color\" [timeOut]=\"options.timeOut\">\r\n <ax-icon *ngIf=\"_icon\" [icon]=\"_icon\"></ax-icon>\r\n <ax-title [text]=\"options.title\"></ax-title>\r\n <ax-close-button *ngIf=\"options.closeable\"></ax-close-button>\r\n <ax-content *ngIf=\"options.content\">\r\n <div [innerHTML]=\"options.content\"></div>\r\n </ax-content>\r\n <ax-footer *ngIf=\"options?.buttons?.length\">\r\n <ax-button *ngFor=\"let button of options.buttons\" [text]=\"button.text\" class=\"ax-sm\"\r\n (onClick)=\"_handleButtonClick(button)\" [color]=\"options.color\" [look]=\"'default'\"></ax-button>\r\n </ax-footer>\r\n</ax-alert> -->\r\n<span [class]=\"'ax-toast-icon '+ _icon \"></span>\r\n<div class=\"ax-toast-content\">\r\n <div class=\"ax-toast-title\">{{options.title}}</div>\r\n <div [innerHTML]=\"options.content\"></div>\r\n <div class=\"ax-toast-buttons\" *ngIf=\"options?.buttons?.length\">\r\n <button *ngFor=\"let button of options.buttons\" (click)=\"_handleButtonClick(button)\">\r\n {{button.text}}\r\n </button>\r\n </div>\r\n</div>\r\n<span class=\"ax-icon ax-icon-close\" (click)=\"close()\"></span>\r\n<div class=\"ax-toast-progress\" [style.animation-duration.ms]=\"options.timeOut\" *ngIf=\"options.timeOut\"></div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { AXToastComponent } from './toast.component';\r\n\r\nconst COMPONENT = [AXToastComponent];\r\nconst MODULES = [CommonModule];\r\n\r\n@NgModule({\r\n declarations: [...COMPONENT],\r\n imports: [...MODULES],\r\n exports: [...COMPONENT],\r\n providers: [],\r\n})\r\nexport class AXToastModule {\r\n \r\n}\r\n","import { AXConfig } from '@acorex/core/config';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\nimport { ComponentPortal } from '@angular/cdk/portal';\r\nimport { Injectable, Injector } from '@angular/core';\r\nimport { AXToastOptions, AXToastRef } from './toast.class';\r\nimport { AXToastComponent } from './toast.component';\r\n\r\n\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AXToastService {\r\n\r\n\r\n private readonly _defaults = {\r\n gap: 5,\r\n timeOut: 2500,\r\n location: 'bottom-center',\r\n }\r\n\r\n constructor(private overlayService: Overlay, private parentInjector: Injector) {\r\n\r\n }\r\n\r\n private _activeList: AXToastComponent[] = [];\r\n\r\n primary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'primary',\r\n content: content\r\n });\r\n }\r\n secondary(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'secondary',\r\n content: content\r\n });\r\n }\r\n success(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'success',\r\n content: content\r\n });\r\n }\r\n\r\n warning(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'warning',\r\n content: content\r\n });\r\n }\r\n danger(content: string) {\r\n this.show({\r\n timeOut: AXConfig.get('toast.timeOut') || this._defaults.timeOut,\r\n color: 'danger',\r\n content: content\r\n });\r\n }\r\n show(options: AXToastOptions): AXToastRef {\r\n const opt = Object.assign(\r\n {\r\n closeable: true,\r\n location: AXConfig.get('toast.location') || this._defaults.location\r\n },\r\n options\r\n );\r\n const gap = AXConfig.get('toast.gap') || this._defaults.gap;\r\n\r\n let positionStrategy = this.overlayService.position().global();\r\n const pos = this.getPosition(opt.location) + gap + 'px';\r\n switch (opt.location) {\r\n case 'bottom-center':\r\n positionStrategy = positionStrategy.bottom(pos).centerHorizontally()\r\n break;\r\n case 'bottom-end':\r\n positionStrategy = positionStrategy.bottom(pos).right(gap + 'px');\r\n break;\r\n case 'bottom-start':\r\n positionStrategy = positionStrategy.bottom(pos).left(gap + 'px');\r\n break;\r\n case 'top-center':\r\n positionStrategy = positionStrategy.top(pos).centerHorizontally()\r\n break;\r\n case 'top-end':\r\n positionStrategy = positionStrategy.top(pos).right(gap + 'px');\r\n break;\r\n case 'top-start':\r\n positionStrategy = positionStrategy.top(pos).left(gap + 'px');\r\n break;\r\n case 'center-start':\r\n positionStrategy = positionStrategy.centerVertically().left(gap + 'px');\r\n break;\r\n case 'center-end':\r\n positionStrategy = positionStrategy.centerVertically().right(gap + 'px');\r\n break;\r\n default:\r\n break;\r\n }\r\n const overlayRef = this.overlayService.create(\r\n {\r\n positionStrategy,\r\n panelClass: ['ax-animate-animated', 'ax-animate-fadeIn', 'ax-animate-faster'],\r\n });\r\n const toastPortal = new ComponentPortal(AXToastComponent, null, this.parentInjector);\r\n\r\n const host = overlayRef.attach(toastPortal);\r\n (host.instance as any).visibleIndex = this._activeList.length;\r\n this._activeList.push(host.instance);\r\n if (host.instance) {\r\n Object.assign(host.instance, {\r\n options: opt,\r\n close: () => {\r\n this._activeList = this._activeList.filter(c => c != host.instance);\r\n overlayRef.dispose()\r\n }\r\n });\r\n setTimeout(() => {\r\n host.changeDetectorRef.detectChanges();\r\n }, 0);\r\n }\r\n\r\n return {\r\n close: () => {\r\n host.instance.close();\r\n }\r\n }\r\n }\r\n\r\n\r\n\r\n public hideAll() {\r\n this._activeList.forEach(c => c.close());\r\n }\r\n\r\n private getPosition(location: string) {\r\n const list = this._activeList.filter(c => c.options.location == location);\r\n if (list.length == 0) return 0;\r\n if (location.split('-')[0] == 'bottom') {\r\n return window.innerHeight - list[list.length - 1]._getHostElement().offsetTop;\r\n }\r\n else {\r\n return list[list.length - 1]._getHostElement().offsetTop + list[list.length - 1]._getHostElement().offsetHeight;\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAaA;;;;AAIG;AASG,MAAO,gBAAiB,SAA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SAAS,CAAC;AACjF,SAAA;AACI,aAAA;YACD,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,YAAY,CAAC;AACnH,SAAA;KACJ;;2GAxIQ,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAd,cAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA,CAAA;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACTlC;;AAEG;;;;"}
@@ -145,4 +145,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
145
145
 
146
146
  export { AXTooltipComponent, AXTooltipDirective, AXTooltipModule };
147
147
  //# sourceMappingURL=acorex-components-tooltip.mjs.map
148
- //# sourceMappingURL=acorex-components-tooltip.mjs.map
@@ -130,4 +130,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
130
130
 
131
131
  export { AXTreeViewComponent, AXTreeViewModule };
132
132
  //# sourceMappingURL=acorex-components-tree-view.mjs.map
133
- //# sourceMappingURL=acorex-components-tree-view.mjs.map
@@ -126,4 +126,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
126
126
 
127
127
  export { AXUploaderComponent, AXUploaderModule };
128
128
  //# sourceMappingURL=acorex-components-uploader.mjs.map
129
- //# sourceMappingURL=acorex-components-uploader.mjs.map
@@ -9,4 +9,3 @@ const ACOREX_COMPONENTS = "@acorex/components";
9
9
 
10
10
  export { ACOREX_COMPONENTS };
11
11
  //# sourceMappingURL=acorex-components.mjs.map
12
- //# sourceMappingURL=acorex-components.mjs.map
@@ -1,156 +1,171 @@
1
+ import * as i2$1 from '@acorex/components/common';
2
+ import { TAB_META_KEY, AXCommonModule, AXComponentClosedPromise } from '@acorex/components/common';
1
3
  import { AXBaseComponent } from '@acorex/components/mixin';
2
- import { trigger, state, style, transition, animate } from '@angular/animations';
4
+ import * as i2 from '@angular/cdk/portal';
5
+ import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
3
6
  import * as i0 from '@angular/core';
4
- import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, EventEmitter, Output, NgModule } from '@angular/core';
7
+ import { EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, HostListener, NgModule, Injectable } from '@angular/core';
5
8
  import * as i1 from '@angular/common';
6
9
  import { CommonModule } from '@angular/common';
7
- import * as i1$1 from '@acorex/components/button';
10
+ import { A11yModule } from '@angular/cdk/a11y';
11
+ import { DragDropModule } from '@angular/cdk/drag-drop';
8
12
  import { AXButtonModule } from '@acorex/components/button';
13
+ import { AXDecoratorModule } from '@acorex/components/decorators';
14
+ import { AXTranslator } from '@acorex/core/translation';
15
+ import * as i1$1 from '@angular/cdk/overlay';
9
16
 
10
17
  class AXActionSheetComponent extends AXBaseComponent {
11
- /**
12
- * @ignore
13
- */
14
- constructor(_elementRef, _cdr) {
15
- super(_elementRef, _cdr);
16
- this.caption = '';
17
- this.closeOnBackdrop = true;
18
- this.isOpen = false;
19
- }
20
- _handleBackdropClick() {
21
- if (!this.closeOnBackdrop)
22
- return;
23
- this.close();
24
- }
25
- open() {
26
- this.isOpen = true;
18
+ constructor(elementRef, cdr, _viewContainerRef) {
19
+ super(elementRef, cdr);
20
+ this._viewContainerRef = _viewContainerRef;
21
+ this.items = [];
22
+ this.showCloseButton = true;
23
+ this.showHeader = true;
24
+ this.data = {};
25
+ this.onClosed = new EventEmitter();
27
26
  }
28
27
  close() {
29
- this.isOpen = false;
28
+ this.onClosed.emit({
29
+ component: this[TAB_META_KEY].component,
30
+ htmlElement: this._getHostElement(),
31
+ });
32
+ this._cdr.detectChanges();
30
33
  }
31
- toggle() {
32
- this.isOpen = !this.isOpen;
34
+ onInit() {
35
+ if (this.content) {
36
+ this._selectedPortal = new ComponentPortal(this.content);
37
+ this._cdr.markForCheck();
38
+ }
33
39
  }
34
- }
35
- AXActionSheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
36
- AXActionSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXActionSheetComponent, selector: "ax-action-sheet", inputs: { caption: "caption", closeOnBackdrop: "closeOnBackdrop" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-action-sheet-backdrop\" [@backdrop]=\"isOpen ? 'show' : 'hide'\" (click)=\"_handleBackdropClick()\"></div>\r\n<div class=\"ax-action-sheet-container\" [@openClose]=\"isOpen ? 'open' : 'closed'\">\r\n <div class=\"ax-action-sheet-card\">\r\n <div class=\"ax-action-sheet-caption\" *ngIf=\"caption\">\r\n {{caption}}\r\n </div>\r\n <ng-content select=\"ax-content\"></ng-content>\r\n <div class=\"ax-action-sheet-items\">\r\n <ng-content select=\"ax-action-sheet-item\"></ng-content>\r\n </div>\r\n </div>\r\n</div>", styles: ["ax-action-sheet .ax-action-sheet-container{position:fixed;bottom:0;left:50%;transform:translate(-50%);z-index:9999;width:33.333333%;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);overflow:hidden}@media (max-width: 599px){ax-action-sheet .ax-action-sheet-container{width:100%}}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-caption{font-size:.875rem;padding:1rem}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-card{background-color:rgb(var(--ax-color-surface));height:100%}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-items{@apply ax-flex ax-flex-col ax-pb-3 ax-overflow-x-hidden ax-overflow-y-auto;display:flex;flex-direction:column;padding-bottom:.75rem;overflow-x:hidden;overflow-y:auto}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-items ax-button{border-radius:0!important;width:100%;text-align:start;justify-items:flex-start}ax-action-sheet .ax-action-sheet-backdrop{background-color:#0000004d;inset:0;position:fixed;z-index:9998}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], animations: [
37
- trigger('backdrop', [
38
- state('show', style({
39
- opacity: 1,
40
- visibility: 'visible',
41
- })),
42
- state('hide', style({
43
- visibility: 'hidden',
44
- opacity: 0,
45
- })),
46
- transition('show <=> hide', [animate('0.2s')]),
47
- ]),
48
- trigger('openClose', [
49
- state('open', style({
50
- bottom: '0',
51
- opacity: 1,
52
- })),
53
- state('closed', style({
54
- bottom: '-100%',
55
- opacity: 0.5,
56
- })),
57
- transition('open <=> closed', [animate('0.2s')]),
58
- ]),
59
- ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetComponent, decorators: [{
61
- type: Component,
62
- args: [{ selector: 'ax-action-sheet', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, animations: [
63
- trigger('backdrop', [
64
- state('show', style({
65
- opacity: 1,
66
- visibility: 'visible',
67
- })),
68
- state('hide', style({
69
- visibility: 'hidden',
70
- opacity: 0,
71
- })),
72
- transition('show <=> hide', [animate('0.2s')]),
73
- ]),
74
- trigger('openClose', [
75
- state('open', style({
76
- bottom: '0',
77
- opacity: 1,
78
- })),
79
- state('closed', style({
80
- bottom: '-100%',
81
- opacity: 0.5,
82
- })),
83
- transition('open <=> closed', [animate('0.2s')]),
84
- ]),
85
- ], template: "<div class=\"ax-action-sheet-backdrop\" [@backdrop]=\"isOpen ? 'show' : 'hide'\" (click)=\"_handleBackdropClick()\"></div>\r\n<div class=\"ax-action-sheet-container\" [@openClose]=\"isOpen ? 'open' : 'closed'\">\r\n <div class=\"ax-action-sheet-card\">\r\n <div class=\"ax-action-sheet-caption\" *ngIf=\"caption\">\r\n {{caption}}\r\n </div>\r\n <ng-content select=\"ax-content\"></ng-content>\r\n <div class=\"ax-action-sheet-items\">\r\n <ng-content select=\"ax-action-sheet-item\"></ng-content>\r\n </div>\r\n </div>\r\n</div>", styles: ["ax-action-sheet .ax-action-sheet-container{position:fixed;bottom:0;left:50%;transform:translate(-50%);z-index:9999;width:33.333333%;border-top-left-radius:var(--ax-rounded-border-default);border-top-right-radius:var(--ax-rounded-border-default);overflow:hidden}@media (max-width: 599px){ax-action-sheet .ax-action-sheet-container{width:100%}}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-caption{font-size:.875rem;padding:1rem}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-card{background-color:rgb(var(--ax-color-surface));height:100%}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-items{@apply ax-flex ax-flex-col ax-pb-3 ax-overflow-x-hidden ax-overflow-y-auto;display:flex;flex-direction:column;padding-bottom:.75rem;overflow-x:hidden;overflow-y:auto}ax-action-sheet .ax-action-sheet-container .ax-action-sheet-items ax-button{border-radius:0!important;width:100%;text-align:start;justify-items:flex-start}ax-action-sheet .ax-action-sheet-backdrop{background-color:#0000004d;inset:0;position:fixed;z-index:9998}\n"] }]
86
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { caption: [{
87
- type: Input
88
- }], closeOnBackdrop: [{
89
- type: Input
90
- }] } });
91
-
92
- class AXActionSheetItemComponent extends AXBaseComponent {
93
- /**
94
- * @ignore
95
- */
96
- constructor(_elementRef, _cdr) {
97
- super(_elementRef, _cdr);
98
- this.color = 'primary';
99
- this.onClick = new EventEmitter();
40
+ onKeydownHandler(event) {
41
+ let focusedOrHasFocused = this._getHostElement().matches(':focus-within');
42
+ if (this.showCloseButton && focusedOrHasFocused) {
43
+ this.close();
44
+ }
100
45
  }
101
- _handleOnClick(e) {
102
- this.onClick.emit(e);
46
+ _handleAttched(ref) {
47
+ ref = ref;
48
+ if (ref.instance) {
49
+ this[TAB_META_KEY].component = ref.instance;
50
+ Object.assign(this[TAB_META_KEY].component, this.data);
51
+ if (ref.instance.onClosed) {
52
+ ref.instance.onClosed.subscribe((e) => {
53
+ this.onClosed.emit(e);
54
+ });
55
+ }
56
+ }
57
+ }
58
+ _handleCloseClick() {
59
+ this.close();
103
60
  }
104
61
  }
105
- AXActionSheetItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
106
- AXActionSheetItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXActionSheetItemComponent, selector: "ax-action-sheet-item", inputs: { text: "text", color: "color" }, outputs: { onClick: "onClick" }, usesInheritance: true, ngImport: i0, template: `
107
- <ax-button
108
- [color]="color"
109
- look="blank"
110
- [text]="text"
111
- (onClick)="_handleOnClick($event)"
112
- ></ax-button>
113
- `, isInline: true, dependencies: [{ kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange"] }] });
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetItemComponent, decorators: [{
62
+ AXActionSheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
63
+ AXActionSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: AXActionSheetComponent, selector: "ax-action-sheet", host: { listeners: { "keydown.escape": "onKeydownHandler($event)" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-action-sheet-header\">\r\n <span class=\"ax-action-sheet-title\">{{title}}</span>\r\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleCloseClick()\" tabindex=\"1\"></span>\r\n</div>\r\n<ng-template *ngIf=\"_selectedPortal\">\r\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\r\n</ng-template>\r\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" ></ng-template>\r\n<div class=\"ax-action-sheet-items\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <div class=\"ax-action-sheet-item ax-{{item.color}}\" [class.ax-state-disabled]=\"item.disabled\" (click)=\"item.onClick()\">\r\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\r\n <span class=\"item-text\">{{item.text}}</span>\r\n </div>\r\n </ng-container>\r\n</div>", styles: ["@media (max-width: 599px){ax-action-sheet{width:100vw}}@media (min-width: 600px){ax-action-sheet{width:75vw}}@media (min-width: 1200px){ax-action-sheet{width:30vw}}@media (min-width: 1800px){ax-action-sheet{width:25vw}}ax-action-sheet .ax-action-sheet-header{padding:1rem;display:flex;justify-content:space-between;border-bottom:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-action-sheet .ax-action-sheet-header .ax-action-sheet-title{font-weight:500;font-size:1rem}ax-action-sheet .ax-action-sheet-header .ax-icon-close{font-size:1.5rem;cursor:pointer}ax-action-sheet .ax-action-sheet-header .ax-icon-close:hover{opacity:.5}ax-action-sheet .ax-action-sheet-items{padding:.5rem 0}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item{-webkit-user-select:none;user-select:none;cursor:pointer;padding:.75rem 1rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item:hover{background-color:rgba(var(--ax-color-ghost),.03)}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item .item-icon{font-size:1.5rem;margin-inline-end:.75rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-primary{color:rgb(var(--ax-color-primary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-secondary{color:rgb(var(--ax-color-secondary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-success{color:rgb(var(--ax-color-success-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-warning{color:rgb(var(--ax-color-warning-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-danger{color:rgb(var(--ax-color-danger-500))}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
64
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetComponent, decorators: [{
115
65
  type: Component,
116
- args: [{
117
- selector: 'ax-action-sheet-item',
118
- template: `
119
- <ax-button
120
- [color]="color"
121
- look="blank"
122
- [text]="text"
123
- (onClick)="_handleOnClick($event)"
124
- ></ax-button>
125
- `,
126
- }]
127
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { text: [{
128
- type: Input
129
- }], color: [{
130
- type: Input
131
- }], onClick: [{
132
- type: Output
66
+ args: [{ selector: 'ax-action-sheet', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-action-sheet-header\">\r\n <span class=\"ax-action-sheet-title\">{{title}}</span>\r\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleCloseClick()\" tabindex=\"1\"></span>\r\n</div>\r\n<ng-template *ngIf=\"_selectedPortal\">\r\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\r\n</ng-template>\r\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" ></ng-template>\r\n<div class=\"ax-action-sheet-items\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <div class=\"ax-action-sheet-item ax-{{item.color}}\" [class.ax-state-disabled]=\"item.disabled\" (click)=\"item.onClick()\">\r\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\r\n <span class=\"item-text\">{{item.text}}</span>\r\n </div>\r\n </ng-container>\r\n</div>", styles: ["@media (max-width: 599px){ax-action-sheet{width:100vw}}@media (min-width: 600px){ax-action-sheet{width:75vw}}@media (min-width: 1200px){ax-action-sheet{width:30vw}}@media (min-width: 1800px){ax-action-sheet{width:25vw}}ax-action-sheet .ax-action-sheet-header{padding:1rem;display:flex;justify-content:space-between;border-bottom:1px solid;border-color:rgb(var(--ax-color-border-default))}ax-action-sheet .ax-action-sheet-header .ax-action-sheet-title{font-weight:500;font-size:1rem}ax-action-sheet .ax-action-sheet-header .ax-icon-close{font-size:1.5rem;cursor:pointer}ax-action-sheet .ax-action-sheet-header .ax-icon-close:hover{opacity:.5}ax-action-sheet .ax-action-sheet-items{padding:.5rem 0}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item{-webkit-user-select:none;user-select:none;cursor:pointer;padding:.75rem 1rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item:hover{background-color:rgba(var(--ax-color-ghost),.03)}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item .item-icon{font-size:1.5rem;margin-inline-end:.75rem}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-primary{color:rgb(var(--ax-color-primary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-secondary{color:rgb(var(--ax-color-secondary-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-success{color:rgb(var(--ax-color-success-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-warning{color:rgb(var(--ax-color-warning-500))}ax-action-sheet .ax-action-sheet-items .ax-action-sheet-item.ax-danger{color:rgb(var(--ax-color-danger-500))}\n"] }]
67
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.ViewContainerRef }]; }, propDecorators: { onKeydownHandler: [{
68
+ type: HostListener,
69
+ args: ['keydown.escape', ['$event']]
133
70
  }] } });
134
71
 
72
+ const MODULES = [CommonModule, AXCommonModule, DragDropModule, A11yModule, AXButtonModule, PortalModule, AXDecoratorModule];
135
73
  class AXActionSheetModule {
136
74
  }
137
75
  AXActionSheetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
138
- AXActionSheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, declarations: [AXActionSheetComponent, AXActionSheetItemComponent], imports: [CommonModule, AXButtonModule], exports: [AXActionSheetComponent, AXActionSheetItemComponent] });
139
- AXActionSheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, imports: [CommonModule, AXButtonModule] });
76
+ AXActionSheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, declarations: [AXActionSheetComponent], imports: [CommonModule, AXCommonModule, DragDropModule, A11yModule, AXButtonModule, PortalModule, AXDecoratorModule], exports: [AXActionSheetComponent] });
77
+ AXActionSheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, imports: [MODULES] });
140
78
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetModule, decorators: [{
141
79
  type: NgModule,
142
80
  args: [{
143
- declarations: [AXActionSheetComponent, AXActionSheetItemComponent],
144
- imports: [CommonModule, AXButtonModule],
145
- exports: [AXActionSheetComponent, AXActionSheetItemComponent],
81
+ declarations: [AXActionSheetComponent],
82
+ imports: [...MODULES],
83
+ exports: [AXActionSheetComponent],
146
84
  providers: [],
147
85
  }]
148
86
  }] });
149
87
 
88
+ class AXActionSheetService {
89
+ // _overlayRef: OverlayRef;
90
+ // _templatePortal!: ComponentPortal<any>;
91
+ constructor(_overlay, overlayService) {
92
+ this._overlay = _overlay;
93
+ this.overlayService = overlayService;
94
+ }
95
+ //open(items: AXActionSheetItem[],options?:AXActionSheetOptions);
96
+ //open(content:AXActionSheetContentType, options?: AXActionSheetOptions);
97
+ open(options) {
98
+ const opt = {
99
+ title: AXTranslator.get('action-sheet.title'),
100
+ showCloseButton: true,
101
+ closeOnBackdrop: true,
102
+ showHeader: true
103
+ };
104
+ Object.assign(opt, options);
105
+ const lastActiveElement = document.activeElement;
106
+ const com = this.overlayService.show(AXActionSheetComponent, opt, {
107
+ hasBackdrop: true,
108
+ closeOnClickOutside: opt.closeOnBackdrop,
109
+ transparentBackdrop: false,
110
+ panelClass: ['ax-actionsheet-panel'],
111
+ position: this._overlay.position().global().bottom().centerHorizontally(),
112
+ });
113
+ const actionSheet = com.instance;
114
+ actionSheet[TAB_META_KEY] = {};
115
+ actionSheet.onClosed.subscribe(c => {
116
+ this.closePopup(actionSheet, com, c, lastActiveElement);
117
+ });
118
+ const promise = new AXComponentClosedPromise((resolve) => {
119
+ actionSheet[TAB_META_KEY].close = (e) => {
120
+ if (resolve) {
121
+ resolve(e);
122
+ }
123
+ };
124
+ });
125
+ promise['closeMethod'] = () => { actionSheet.close(); };
126
+ return promise;
127
+ }
128
+ closePopup(popup, com, result, lastActiveElement) {
129
+ const closeFunc = (e) => {
130
+ com.dispose();
131
+ delete e.cancel;
132
+ popup[TAB_META_KEY].close(e);
133
+ if (lastActiveElement?.focus) {
134
+ lastActiveElement.focus();
135
+ }
136
+ };
137
+ const e = { cancel: false };
138
+ const closingFunc = popup[TAB_META_KEY].component?.onClosing;
139
+ if (closingFunc) {
140
+ const res = closingFunc(e);
141
+ if (res instanceof Promise) {
142
+ res.then(() => {
143
+ if (e == null || e.cancel !== true) {
144
+ closeFunc(result);
145
+ }
146
+ });
147
+ }
148
+ else {
149
+ if (e == null || e.cancel !== true) {
150
+ closeFunc(result);
151
+ }
152
+ }
153
+ }
154
+ else {
155
+ closeFunc(result);
156
+ }
157
+ }
158
+ }
159
+ AXActionSheetService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetService, deps: [{ token: i1$1.Overlay }, { token: i2$1.AXOverlayService }], target: i0.ɵɵFactoryTarget.Injectable });
160
+ AXActionSheetService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetService, providedIn: 'root' });
161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AXActionSheetService, decorators: [{
162
+ type: Injectable,
163
+ args: [{ providedIn: 'root' }]
164
+ }], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i2$1.AXOverlayService }]; } });
165
+
150
166
  /**
151
167
  * Generated bundle index. Do not edit.
152
168
  */
153
169
 
154
- export { AXActionSheetComponent, AXActionSheetItemComponent, AXActionSheetModule };
155
- //# sourceMappingURL=acorex-components-action-sheet.mjs.map
170
+ export { AXActionSheetComponent, AXActionSheetModule, AXActionSheetService };
156
171
  //# sourceMappingURL=acorex-components-action-sheet.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-components-action-sheet.mjs","sources":["../../../../projects/acorex/components/action-sheet/src/action-sheet.component.ts","../../../../projects/acorex/components/action-sheet/src/action-sheet.component.html","../../../../projects/acorex/components/action-sheet/src/action-sheet-item.component.ts","../../../../projects/acorex/components/action-sheet/src/action-sheet.module.ts","../../../../projects/acorex/components/action-sheet/acorex-components-action-sheet.ts"],"sourcesContent":["import { AXBaseComponent } from '@acorex/components/mixin';\r\nimport {\r\n trigger,\r\n state,\r\n style,\r\n transition,\r\n animate,\r\n} from '@angular/animations';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, ViewEncapsulation } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'ax-action-sheet',\r\n templateUrl: './action-sheet.component.html',\r\n styleUrls: ['./action-sheet.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n animations: [\r\n trigger('backdrop', [\r\n state(\r\n 'show',\r\n style({\r\n opacity: 1,\r\n visibility: 'visible',\r\n })\r\n ),\r\n state(\r\n 'hide',\r\n style({\r\n visibility: 'hidden',\r\n opacity: 0,\r\n })\r\n ),\r\n transition('show <=> hide', [animate('0.2s')]),\r\n ]),\r\n\r\n trigger('openClose', [\r\n state(\r\n 'open',\r\n style({\r\n bottom: '0',\r\n opacity: 1,\r\n })\r\n ),\r\n state(\r\n 'closed',\r\n style({\r\n bottom: '-100%',\r\n opacity: 0.5,\r\n })\r\n ),\r\n transition('open <=> closed', [animate('0.2s')]),\r\n ]),\r\n ]\r\n})\r\nexport class AXActionSheetComponent extends AXBaseComponent {\r\n @Input() caption = '';\r\n @Input() closeOnBackdrop = true;\r\n isOpen = false;\r\n\r\n _backdrop: HTMLElement;\r\n /**\r\n * @ignore\r\n */\r\n constructor(_elementRef: ElementRef, _cdr: ChangeDetectorRef) {\r\n super(_elementRef, _cdr);\r\n }\r\n\r\n _handleBackdropClick() {\r\n if (!this.closeOnBackdrop) return;\r\n this.close();\r\n }\r\n\r\n open() {\r\n this.isOpen = true;\r\n }\r\n\r\n close() {\r\n this.isOpen = false;\r\n }\r\n\r\n toggle() {\r\n this.isOpen = !this.isOpen;\r\n }\r\n}\r\n","<div class=\"ax-action-sheet-backdrop\" [@backdrop]=\"isOpen ? 'show' : 'hide'\" (click)=\"_handleBackdropClick()\"></div>\r\n<div class=\"ax-action-sheet-container\" [@openClose]=\"isOpen ? 'open' : 'closed'\">\r\n <div class=\"ax-action-sheet-card\">\r\n <div class=\"ax-action-sheet-caption\" *ngIf=\"caption\">\r\n {{caption}}\r\n </div>\r\n <ng-content select=\"ax-content\"></ng-content>\r\n <div class=\"ax-action-sheet-items\">\r\n <ng-content select=\"ax-action-sheet-item\"></ng-content>\r\n </div>\r\n </div>\r\n</div>","import {\r\n ChangeDetectorRef,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\nimport {\r\n AXButtonClickEvent,\r\n AXStyleColorType,\r\n} from '@acorex/components/common';\r\nimport { AXBaseComponent } from '@acorex/components/mixin';\r\n\r\n@Component({\r\n selector: 'ax-action-sheet-item',\r\n template: `\r\n <ax-button\r\n [color]=\"color\"\r\n look=\"blank\"\r\n [text]=\"text\"\r\n (onClick)=\"_handleOnClick($event)\"\r\n ></ax-button>\r\n `,\r\n})\r\nexport class AXActionSheetItemComponent extends AXBaseComponent {\r\n @Input()\r\n text: string;\r\n\r\n @Input()\r\n color: AXStyleColorType = 'primary';\r\n\r\n @Output()\r\n onClick: EventEmitter<AXButtonClickEvent> = new EventEmitter<AXButtonClickEvent>();\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(_elementRef: ElementRef, _cdr: ChangeDetectorRef) {\r\n super(_elementRef, _cdr);\r\n }\r\n\r\n _handleOnClick(e: any) {\r\n this.onClick.emit(e);\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { AXButtonModule } from '@acorex/components/button';\r\nimport { AXActionSheetComponent } from './action-sheet.component';\r\nimport { AXActionSheetItemComponent } from './action-sheet-item.component';\r\n\r\n@NgModule({\r\n declarations: [AXActionSheetComponent, AXActionSheetItemComponent],\r\n imports: [CommonModule, AXButtonModule],\r\n exports: [AXActionSheetComponent, AXActionSheetItemComponent],\r\n providers: [],\r\n})\r\nexport class AXActionSheetModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;AAsDM,MAAO,sBAAuB,SAAQ,eAAe,CAAA;AAMzD;;AAEG;IACH,WAAY,CAAA,WAAuB,EAAE,IAAuB,EAAA;AAC1D,QAAA,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QATlB,IAAO,CAAA,OAAA,GAAG,EAAE,CAAC;QACb,IAAe,CAAA,eAAA,GAAG,IAAI,CAAC;QAChC,IAAM,CAAA,MAAA,GAAG,KAAK,CAAC;KAQd;IAED,oBAAoB,GAAA;QAClB,IAAI,CAAC,IAAI,CAAC,eAAe;YAAE,OAAO;QAClC,IAAI,CAAC,KAAK,EAAE,CAAC;KACd;IAED,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;KACpB;IAED,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACrB;IAED,MAAM,GAAA;AACJ,QAAA,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC;KAC5B;;mHA5BU,sBAAsB,EAAA,I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,EAAE,EAAE;AACd,iBAAA,CAAA;;;ACXD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-components-action-sheet.mjs","sources":["../../../../projects/acorex/components/action-sheet/src/action-sheet.component.ts","../../../../projects/acorex/components/action-sheet/src/action-sheet.component.html","../../../../projects/acorex/components/action-sheet/src/action-sheet.module.ts","../../../../projects/acorex/components/action-sheet/src/action-sheet.service.ts","../../../../projects/acorex/components/action-sheet/acorex-components-action-sheet.ts"],"sourcesContent":["import { AXComponentCloseEvent, TAB_META_KEY } from '@acorex/components/common';\r\nimport { AXBaseComponent } from '@acorex/components/mixin';\r\nimport { CdkPortalOutletAttachedRef, ComponentPortal, Portal, TemplatePortal } from '@angular/cdk/portal';\r\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentRef, ElementRef, EventEmitter, HostListener, Input, ViewContainerRef, ViewEncapsulation } from '@angular/core';\r\nimport { AXActionSheetItem } from './action-sheet.interface';\r\n\r\n@Component({\r\n selector: 'ax-action-sheet',\r\n templateUrl: './action-sheet.component.html',\r\n styleUrls: ['./action-sheet.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n})\r\n\r\nexport class AXActionSheetComponent extends AXBaseComponent {\r\n\r\n _selectedPortal: Portal<any>;\r\n title: string;\r\n items: AXActionSheetItem[] = [];\r\n content: any;\r\n showCloseButton: boolean = true;\r\n showHeader: boolean = true;\r\n data: any = {};\r\n\r\n onClosed: EventEmitter<AXComponentCloseEvent> = new EventEmitter<AXComponentCloseEvent>();\r\n\r\n constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, private _viewContainerRef: ViewContainerRef,) {\r\n super(elementRef, cdr);\r\n }\r\n\r\n close(): void {\r\n this.onClosed.emit({\r\n component: this[TAB_META_KEY].component,\r\n htmlElement: this._getHostElement(),\r\n });\r\n this._cdr.detectChanges();\r\n }\r\n\r\n onInit(): void {\r\n if (this.content) {\r\n this._selectedPortal = new ComponentPortal(this.content);\r\n this._cdr.markForCheck();\r\n }\r\n }\r\n\r\n @HostListener('keydown.escape', ['$event'])\r\n onKeydownHandler(event: KeyboardEvent) {\r\n let focusedOrHasFocused = this._getHostElement().matches(':focus-within');\r\n if (this.showCloseButton && focusedOrHasFocused) {\r\n this.close();\r\n }\r\n }\r\n\r\n _handleAttched(ref: CdkPortalOutletAttachedRef) {\r\n ref = ref as ComponentRef<any>;\r\n if (ref.instance) {\r\n this[TAB_META_KEY].component = ref.instance;\r\n Object.assign(this[TAB_META_KEY].component, this.data);\r\n if (ref.instance.onClosed) {\r\n ref.instance.onClosed.subscribe((e: AXComponentCloseEvent) => {\r\n this.onClosed.emit(e);\r\n });\r\n }\r\n }\r\n }\r\n\r\n _handleCloseClick() {\r\n this.close();\r\n }\r\n}\r\n","<div class=\"ax-action-sheet-header\">\r\n <span class=\"ax-action-sheet-title\">{{title}}</span>\r\n <span class=\"ax-icon ax-icon-close\" (click)=\"_handleCloseClick()\" tabindex=\"1\"></span>\r\n</div>\r\n<ng-template *ngIf=\"_selectedPortal\">\r\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\r\n</ng-template>\r\n<ng-template [cdkPortalOutlet]=\"_selectedPortal\" ></ng-template>\r\n<div class=\"ax-action-sheet-items\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <div class=\"ax-action-sheet-item ax-{{item.color}}\" [class.ax-state-disabled]=\"item.disabled\" (click)=\"item.onClick()\">\r\n <span class=\"item-icon\" *ngIf=\"item.icon\" [class]=\"item.icon\"></span>\r\n <span class=\"item-text\">{{item.text}}</span>\r\n </div>\r\n </ng-container>\r\n</div>","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { A11yModule } from '@angular/cdk/a11y';\r\nimport { DragDropModule } from '@angular/cdk/drag-drop';\r\nimport { PortalModule } from '@angular/cdk/portal';\r\nimport { AXButtonModule } from '@acorex/components/button';\r\n\r\nimport { AXDecoratorModule } from '@acorex/components/decorators';\r\nimport { AXCommonModule } from '@acorex/components/common';\r\nimport { AXActionSheetComponent } from './action-sheet.component';\r\n\r\n\r\nconst MODULES = [CommonModule,AXCommonModule, DragDropModule, A11yModule, AXButtonModule, PortalModule, AXDecoratorModule];\r\n\r\n\r\n@NgModule({\r\n declarations: [AXActionSheetComponent],\r\n imports: [...MODULES],\r\n exports: [AXActionSheetComponent],\r\n providers: [],\r\n})\r\nexport class AXActionSheetModule { }\r\n","import { AXComponentClosedPromise, AXComponentCloseEvent, AXOverlayService, AXOverlayViewRef, TAB_META_KEY } from '@acorex/components/common';\r\nimport { AXTranslator } from '@acorex/core/translation';\r\nimport { Overlay } from '@angular/cdk/overlay';\r\nimport { Injectable } from '@angular/core';\r\nimport { AXActionSheetComponent } from './action-sheet.component';\r\nimport { AXActionSheetOptions } from './action-sheet.interface';\r\n\r\n\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class AXActionSheetService {\r\n\r\n // _overlayRef: OverlayRef;\r\n // _templatePortal!: ComponentPortal<any>;\r\n\r\n constructor(private _overlay: Overlay, private overlayService: AXOverlayService) { }\r\n\r\n //open(items: AXActionSheetItem[],options?:AXActionSheetOptions);\r\n //open(content:AXActionSheetContentType, options?: AXActionSheetOptions);\r\n open(options: AXActionSheetOptions): AXComponentClosedPromise {\r\n const opt: any = {\r\n title: AXTranslator.get('action-sheet.title'),\r\n showCloseButton: true,\r\n closeOnBackdrop: true,\r\n showHeader: true\r\n };\r\n Object.assign(opt, options);\r\n const lastActiveElement = document.activeElement as HTMLElement;\r\n const com = this.overlayService.show(AXActionSheetComponent, opt,\r\n {\r\n hasBackdrop: true,\r\n closeOnClickOutside: opt.closeOnBackdrop,\r\n transparentBackdrop: false,\r\n panelClass: ['ax-actionsheet-panel'],\r\n position: this._overlay.position().global().bottom().centerHorizontally(),\r\n });\r\n const actionSheet = com.instance as AXActionSheetComponent;\r\n actionSheet[TAB_META_KEY] = {};\r\n actionSheet.onClosed.subscribe(c => {\r\n this.closePopup(actionSheet, com, c, lastActiveElement);\r\n });\r\n const promise = new AXComponentClosedPromise((resolve) => {\r\n actionSheet[TAB_META_KEY].close = (e) => {\r\n if (resolve) {\r\n resolve(e);\r\n }\r\n };\r\n });\r\n promise['closeMethod'] = () => { actionSheet.close(); };\r\n return promise;\r\n }\r\n\r\n private closePopup(popup: AXActionSheetComponent, com: AXOverlayViewRef, result: AXComponentCloseEvent, lastActiveElement?: HTMLElement) {\r\n const closeFunc = (e) => {\r\n com.dispose();\r\n delete e.cancel;\r\n popup[TAB_META_KEY].close(e);\r\n if (lastActiveElement?.focus) {\r\n lastActiveElement.focus()\r\n }\r\n };\r\n const e = { cancel: false };\r\n const closingFunc = popup[TAB_META_KEY].component?.onClosing;\r\n if (closingFunc) {\r\n const res = closingFunc(e);\r\n if (res instanceof Promise) {\r\n res.then(() => {\r\n if (e == null || e.cancel !== true) {\r\n closeFunc(result);\r\n }\r\n });\r\n }\r\n else {\r\n if (e == null || e.cancel !== true) {\r\n closeFunc(result);\r\n }\r\n }\r\n } else {\r\n closeFunc(result);\r\n }\r\n }\r\n\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAcM,MAAO,sBAAuB,SAAQ,eAAe,CAAA;AAYzD,IAAA,WAAA,CAAY,UAAsB,EAAE,GAAsB,EAAU,iBAAmC,EAAA;AACrG,QAAA,KAAK,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAD2C,IAAiB,CAAA,iBAAA,GAAjB,iBAAiB,CAAkB;QARvG,IAAK,CAAA,KAAA,GAAwB,EAAE,CAAC;QAEhC,IAAe,CAAA,eAAA,GAAY,IAAI,CAAC;QAChC,IAAU,CAAA,UAAA,GAAY,IAAI,CAAC;QAC3B,IAAI,CAAA,IAAA,GAAQ,EAAE,CAAC;AAEf,QAAA,IAAA,CAAA,QAAQ,GAAwC,IAAI,YAAY,EAAyB,CAAC;KAIzF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,qBAAA;AACH,iBAAC,CAAC,CAAC;AACJ,aAAA;AACI,iBAAA;gBACH,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,IAAI,EAAE;oBAClC,SAAS,CAAC,MAAM,CAAC,CAAC;AACnB,iBAAA;AACF,aAAA;AACF,SAAA;AAAM,aAAA;YACL,SAAS,CAAC,MAAM,CAAC,CAAC;AACnB,SAAA;KACF;;iHAtEQ,oBAAoB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAAA,IAAA,CAAA,OAAA,EAAA,EAAA,EAAA,KAAA,EAAAC,IAAA,CAAA,gBAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,oBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;;ACTlC;;AAEG;;;;"}
@@ -217,4 +217,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
217
217
 
218
218
  export { AXAlertButtonDirective, AXAlertComponent, AXAlertModule, AXBaseAlertMixin };
219
219
  //# sourceMappingURL=acorex-components-alert.mjs.map
220
- //# sourceMappingURL=acorex-components-alert.mjs.map
@@ -75,4 +75,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
75
75
 
76
76
  export { AXAvatarComponent, AXAvatarGroup, AXAvatarModule };
77
77
  //# sourceMappingURL=acorex-components-avatar.mjs.map
78
- //# sourceMappingURL=acorex-components-avatar.mjs.map
@@ -51,4 +51,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
51
51
 
52
52
  export { AXBadgeComponent, AXBadgeModule, AXBaseBadgeMixin };
53
53
  //# sourceMappingURL=acorex-components-badge.mjs.map
54
- //# sourceMappingURL=acorex-components-badge.mjs.map
@@ -84,4 +84,3 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
84
84
 
85
85
  export { AXBaseItemBreadCrumbMixin, AXBreadCrumbsComponent, AXBreadCrumbsItemComponent, AXBreadcrumbsModule };
86
86
  //# sourceMappingURL=acorex-components-breadcrumbs.mjs.map
87
- //# sourceMappingURL=acorex-components-breadcrumbs.mjs.map