@progress/kendo-angular-buttons 6.4.0 → 7.0.0-next.202111120840

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 (265) hide show
  1. package/bundles/kendo-angular-buttons.umd.js +5 -0
  2. package/{dist/es2015/button → button}/button.directive.d.ts +29 -21
  3. package/{dist/es2015/button → button}/button.module.d.ts +5 -0
  4. package/{dist/es2015/button → button}/button.service.d.ts +3 -0
  5. package/{dist/es2015/button → button}/selection-settings.d.ts +0 -0
  6. package/{dist/es2015/button-look.d.ts → button-look.d.ts} +0 -0
  7. package/{dist/es2015/buttongroup → buttongroup}/buttongroup.component.d.ts +16 -12
  8. package/buttongroup/buttongroup.module.d.ts +21 -0
  9. package/{dist/es2015/buttons.module.d.ts → buttons.module.d.ts} +10 -0
  10. package/{dist/es2015/chip → chip}/chip-content-click-event-args.interface.d.ts +0 -0
  11. package/{dist/es2015/chip → chip}/chip-list-remove-event-args.interface.d.ts +0 -0
  12. package/{dist/es2015/chip → chip}/chip-list.component.d.ts +5 -2
  13. package/{dist/es2015/chip → chip}/chip-remove-event-args.interface.d.ts +0 -0
  14. package/{dist/es2015/chip → chip}/chip.component.d.ts +15 -14
  15. package/{dist/es2015/chip → chip}/chip.module.d.ts +7 -0
  16. package/{dist/es2015/buttongroup/buttongroup.module.d.ts → chip/models/chip-look.d.ts} +10 -6
  17. package/{dist/es2015/chip → chip}/models/selection.d.ts +0 -0
  18. package/{dist/es2015/chip → chip}/models/type.d.ts +0 -0
  19. package/{dist/es2015/common → common}/models/shape.d.ts +0 -0
  20. package/{dist/es2015/common → common}/models/size.d.ts +0 -0
  21. package/{dist/es2015/common → common}/models/theme-color.d.ts +0 -0
  22. package/{dist/es2015/direction.d.ts → direction.d.ts} +0 -0
  23. package/{dist/es2015/dropdownbutton → dropdownbutton}/dropdownbutton.component.d.ts +24 -17
  24. package/dropdownbutton/dropdownbutton.module.d.ts +23 -0
  25. package/{dist/es2015 → esm2015}/button/button.directive.js +97 -151
  26. package/{dist/es → esm2015}/button/button.module.js +13 -13
  27. package/{dist/es2015 → esm2015}/button/button.service.js +8 -10
  28. package/{dist/es → esm2015}/button/selection-settings.js +1 -0
  29. package/{dist/es2015 → esm2015}/button-look.js +1 -0
  30. package/{dist/es2015 → esm2015}/buttongroup/buttongroup.component.js +93 -125
  31. package/esm2015/buttongroup/buttongroup.module.js +30 -0
  32. package/{dist/es → esm2015}/buttons.module.js +12 -12
  33. package/{dist/es2015 → esm2015}/chip/chip-content-click-event-args.interface.js +1 -0
  34. package/{dist/es2015 → esm2015}/chip/chip-list-remove-event-args.interface.js +1 -0
  35. package/{dist/es2015 → esm2015}/chip/chip-list.component.js +56 -63
  36. package/{dist/es → esm2015}/chip/chip-remove-event-args.interface.js +1 -0
  37. package/{dist/es2015 → esm2015}/chip/chip.component.js +121 -128
  38. package/{dist/es2015 → esm2015}/chip/chip.module.js +16 -11
  39. package/{dist/es → esm2015}/chip/models/chip-look.js +1 -0
  40. package/{dist/es → esm2015}/chip/models/selection.js +1 -0
  41. package/{dist/es → esm2015}/chip/models/type.js +1 -0
  42. package/{dist/es → esm2015}/common/models/shape.js +1 -0
  43. package/{dist/es → esm2015}/common/models/size.js +1 -0
  44. package/{dist/es → esm2015}/common/models/theme-color.js +1 -0
  45. package/{dist/es → esm2015}/direction.js +1 -0
  46. package/{dist/es2015 → esm2015}/dropdownbutton/dropdownbutton.component.js +162 -180
  47. package/esm2015/dropdownbutton/dropdownbutton.module.js +32 -0
  48. package/{dist/es2015 → esm2015}/floatingactionbutton/animations/animations.js +0 -0
  49. package/esm2015/floatingactionbutton/dial-item.component.js +126 -0
  50. package/esm2015/floatingactionbutton/dial-list.component.js +89 -0
  51. package/{dist/es2015 → esm2015}/floatingactionbutton/floatingactionbutton.component.js +150 -150
  52. package/{dist/es2015 → esm2015}/floatingactionbutton/floatingactionbutton.module.js +19 -11
  53. package/{dist/es → esm2015}/floatingactionbutton/models/align.js +1 -0
  54. package/{dist/es → esm2015}/floatingactionbutton/models/item-animation.interface.js +1 -0
  55. package/{dist/es → esm2015}/floatingactionbutton/models/item-click.event.js +1 -0
  56. package/{dist/es → esm2015}/floatingactionbutton/models/item.interface.js +1 -0
  57. package/{dist/es → esm2015}/floatingactionbutton/models/offset.js +1 -0
  58. package/{dist/es → esm2015}/floatingactionbutton/models/position-mode.js +1 -0
  59. package/esm2015/floatingactionbutton/templates/dial-item-template.directive.js +27 -0
  60. package/esm2015/floatingactionbutton/templates/fab-template.directive.js +27 -0
  61. package/{dist/es2015 → esm2015}/floatingactionbutton/utils.js +0 -0
  62. package/{dist/es2015 → esm2015}/focusable/focus.service.js +8 -10
  63. package/{dist/es2015 → esm2015}/focusable/focusable.directive.js +15 -16
  64. package/{dist/es2015/listbutton/list.module.d.ts → esm2015/kendo-angular-buttons.js} +2 -3
  65. package/{dist/es2015 → esm2015}/listbutton/button-item-template.directive.js +13 -12
  66. package/{dist/es2015 → esm2015}/listbutton/list-button.js +15 -2
  67. package/{dist/es → esm2015}/listbutton/list-item-model.js +1 -0
  68. package/esm2015/listbutton/list.component.js +120 -0
  69. package/esm2015/listbutton/list.module.js +39 -0
  70. package/{dist/es → esm2015}/listbutton/popup-settings.js +1 -0
  71. package/esm2015/listbutton/template-context.directive.js +33 -0
  72. package/{dist/es2015 → esm2015}/main.js +5 -1
  73. package/{dist/es → esm2015}/navigation/key-events.js +0 -0
  74. package/{dist/es → esm2015}/navigation/navigation-action.js +0 -0
  75. package/{dist/es2015 → esm2015}/navigation/navigation-config.js +0 -0
  76. package/{dist/es2015 → esm2015}/navigation/navigation.service.js +11 -9
  77. package/{dist/es2015 → esm2015}/package-metadata.js +1 -1
  78. package/{dist/es2015 → esm2015}/preventable-event.js +0 -0
  79. package/{dist/es2015 → esm2015}/splitbutton/splitbutton.component.js +186 -192
  80. package/esm2015/splitbutton/splitbutton.module.js +32 -0
  81. package/{dist/es2015 → esm2015}/util.js +2 -6
  82. package/{dist/fesm2015/index.js → fesm2015/kendo-angular-buttons.js} +1613 -1723
  83. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/animations/animations.d.ts +0 -0
  84. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/dial-item.component.d.ts +8 -5
  85. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/dial-list.component.d.ts +5 -2
  86. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/floatingactionbutton.component.d.ts +28 -19
  87. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/floatingactionbutton.module.d.ts +13 -0
  88. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/align.d.ts +0 -0
  89. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item-animation.interface.d.ts +0 -0
  90. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item-click.event.d.ts +0 -0
  91. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/item.interface.d.ts +0 -0
  92. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/offset.d.ts +0 -0
  93. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/models/position-mode.d.ts +0 -0
  94. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/templates/dial-item-template.directive.d.ts +3 -0
  95. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/templates/fab-template.directive.d.ts +3 -0
  96. package/{dist/es2015/floatingactionbutton → floatingactionbutton}/utils.d.ts +0 -0
  97. package/{dist/es2015/focusable → focusable}/focus.service.d.ts +5 -1
  98. package/{dist/es2015/focusable → focusable}/focusable.directive.d.ts +3 -0
  99. package/kendo-angular-buttons.d.ts +9 -0
  100. package/{dist/es2015/listbutton → listbutton}/button-item-template.directive.d.ts +3 -0
  101. package/{dist/es2015/listbutton → listbutton}/list-button.d.ts +6 -2
  102. package/{dist/es2015/listbutton → listbutton}/list-item-model.d.ts +0 -0
  103. package/{dist/es2015/listbutton → listbutton}/list.component.d.ts +3 -0
  104. package/listbutton/list.module.d.ts +18 -0
  105. package/{dist/es2015/listbutton → listbutton}/popup-settings.d.ts +0 -0
  106. package/{dist/es2015/listbutton → listbutton}/template-context.directive.d.ts +4 -1
  107. package/{dist/es2015/main.d.ts → main.d.ts} +5 -1
  108. package/{dist/es2015/navigation → navigation}/key-events.d.ts +0 -0
  109. package/{dist/es2015/navigation → navigation}/navigation-action.d.ts +0 -0
  110. package/{dist/es2015/navigation → navigation}/navigation-config.d.ts +0 -0
  111. package/{dist/es2015/navigation → navigation}/navigation.service.d.ts +3 -0
  112. package/{dist/es2015/package-metadata.d.ts → package-metadata.d.ts} +0 -0
  113. package/package.json +34 -105
  114. package/{dist/es2015/preventable-event.d.ts → preventable-event.d.ts} +0 -0
  115. package/schematics/ngAdd/index.js +5 -2
  116. package/schematics/ngAdd/index.js.map +1 -1
  117. package/{dist/es2015/splitbutton → splitbutton}/splitbutton.component.d.ts +26 -19
  118. package/splitbutton/splitbutton.module.d.ts +23 -0
  119. package/{dist/es2015/util.d.ts → util.d.ts} +0 -4
  120. package/dist/cdn/js/kendo-angular-buttons.js +0 -20
  121. package/dist/cdn/main.js +0 -5
  122. package/dist/es/button/button.directive.js +0 -630
  123. package/dist/es/button/button.service.js +0 -28
  124. package/dist/es/button-look.js +0 -4
  125. package/dist/es/buttongroup/buttongroup.component.js +0 -402
  126. package/dist/es/buttongroup/buttongroup.module.js +0 -30
  127. package/dist/es/chip/chip-content-click-event-args.interface.js +0 -4
  128. package/dist/es/chip/chip-list-remove-event-args.interface.js +0 -4
  129. package/dist/es/chip/chip-list.component.js +0 -164
  130. package/dist/es/chip/chip.component.js +0 -360
  131. package/dist/es/chip/chip.module.js +0 -55
  132. package/dist/es/dropdownbutton/dropdownbutton.component.js +0 -652
  133. package/dist/es/dropdownbutton/dropdownbutton.module.js +0 -32
  134. package/dist/es/floatingactionbutton/animations/animations.js +0 -33
  135. package/dist/es/floatingactionbutton/dial-item.component.js +0 -143
  136. package/dist/es/floatingactionbutton/dial-list.component.js +0 -76
  137. package/dist/es/floatingactionbutton/floatingactionbutton.component.js +0 -878
  138. package/dist/es/floatingactionbutton/floatingactionbutton.module.js +0 -65
  139. package/dist/es/floatingactionbutton/templates/dial-item-template.directive.js +0 -26
  140. package/dist/es/floatingactionbutton/templates/fab-template.directive.js +0 -26
  141. package/dist/es/floatingactionbutton/utils.js +0 -38
  142. package/dist/es/focusable/focus.service.js +0 -43
  143. package/dist/es/focusable/focusable.directive.js +0 -68
  144. package/dist/es/index.js +0 -22
  145. package/dist/es/listbutton/button-item-template.directive.js +0 -68
  146. package/dist/es/listbutton/list-button.js +0 -240
  147. package/dist/es/listbutton/list.component.js +0 -66
  148. package/dist/es/listbutton/list.module.js +0 -33
  149. package/dist/es/listbutton/template-context.directive.js +0 -40
  150. package/dist/es/main.js +0 -22
  151. package/dist/es/navigation/navigation-config.js +0 -9
  152. package/dist/es/navigation/navigation.service.js +0 -114
  153. package/dist/es/package-metadata.js +0 -15
  154. package/dist/es/preventable-event.js +0 -29
  155. package/dist/es/splitbutton/localization/custom-messages.component.js +0 -44
  156. package/dist/es/splitbutton/localization/localized-messages.directive.js +0 -35
  157. package/dist/es/splitbutton/localization/messages.js +0 -22
  158. package/dist/es/splitbutton/splitbutton.component.js +0 -761
  159. package/dist/es/splitbutton/splitbutton.module.js +0 -34
  160. package/dist/es/util.js +0 -45
  161. package/dist/es2015/button/button.module.js +0 -47
  162. package/dist/es2015/button/selection-settings.js +0 -4
  163. package/dist/es2015/buttongroup/buttongroup.module.js +0 -27
  164. package/dist/es2015/buttons.module.js +0 -51
  165. package/dist/es2015/chip/chip-remove-event-args.interface.js +0 -4
  166. package/dist/es2015/chip/models/chip-look.d.ts +0 -20
  167. package/dist/es2015/chip/models/chip-look.js +0 -4
  168. package/dist/es2015/chip/models/selection.js +0 -4
  169. package/dist/es2015/chip/models/type.js +0 -4
  170. package/dist/es2015/common/models/shape.js +0 -4
  171. package/dist/es2015/common/models/size.js +0 -4
  172. package/dist/es2015/common/models/theme-color.js +0 -4
  173. package/dist/es2015/direction.js +0 -4
  174. package/dist/es2015/dropdownbutton/dropdownbutton.module.d.ts +0 -14
  175. package/dist/es2015/dropdownbutton/dropdownbutton.module.js +0 -29
  176. package/dist/es2015/floatingactionbutton/dial-item.component.js +0 -133
  177. package/dist/es2015/floatingactionbutton/dial-list.component.js +0 -81
  178. package/dist/es2015/floatingactionbutton/models/align.js +0 -4
  179. package/dist/es2015/floatingactionbutton/models/item-animation.interface.js +0 -4
  180. package/dist/es2015/floatingactionbutton/models/item-click.event.js +0 -4
  181. package/dist/es2015/floatingactionbutton/models/item.interface.js +0 -4
  182. package/dist/es2015/floatingactionbutton/models/offset.js +0 -4
  183. package/dist/es2015/floatingactionbutton/models/position-mode.js +0 -4
  184. package/dist/es2015/floatingactionbutton/templates/dial-item-template.directive.js +0 -25
  185. package/dist/es2015/floatingactionbutton/templates/fab-template.directive.js +0 -25
  186. package/dist/es2015/index.d.ts +0 -22
  187. package/dist/es2015/index.js +0 -22
  188. package/dist/es2015/index.metadata.json +0 -1
  189. package/dist/es2015/listbutton/list-item-model.js +0 -4
  190. package/dist/es2015/listbutton/list.component.js +0 -96
  191. package/dist/es2015/listbutton/list.module.js +0 -30
  192. package/dist/es2015/listbutton/popup-settings.js +0 -4
  193. package/dist/es2015/listbutton/template-context.directive.js +0 -35
  194. package/dist/es2015/navigation/key-events.js +0 -13
  195. package/dist/es2015/navigation/navigation-action.js +0 -19
  196. package/dist/es2015/splitbutton/localization/custom-messages.component.d.ts +0 -15
  197. package/dist/es2015/splitbutton/localization/custom-messages.component.js +0 -36
  198. package/dist/es2015/splitbutton/localization/localized-messages.directive.d.ts +0 -13
  199. package/dist/es2015/splitbutton/localization/localized-messages.directive.js +0 -31
  200. package/dist/es2015/splitbutton/localization/messages.d.ts +0 -32
  201. package/dist/es2015/splitbutton/localization/messages.js +0 -16
  202. package/dist/es2015/splitbutton/splitbutton.module.d.ts +0 -14
  203. package/dist/es2015/splitbutton/splitbutton.module.js +0 -31
  204. package/dist/fesm5/index.js +0 -5123
  205. package/dist/npm/button/button.directive.js +0 -632
  206. package/dist/npm/button/button.module.js +0 -52
  207. package/dist/npm/button/button.service.js +0 -30
  208. package/dist/npm/button/selection-settings.js +0 -6
  209. package/dist/npm/button-look.js +0 -6
  210. package/dist/npm/buttongroup/buttongroup.component.js +0 -404
  211. package/dist/npm/buttongroup/buttongroup.module.js +0 -32
  212. package/dist/npm/buttons.module.js +0 -56
  213. package/dist/npm/chip/chip-content-click-event-args.interface.js +0 -6
  214. package/dist/npm/chip/chip-list-remove-event-args.interface.js +0 -6
  215. package/dist/npm/chip/chip-list.component.js +0 -166
  216. package/dist/npm/chip/chip-remove-event-args.interface.js +0 -6
  217. package/dist/npm/chip/chip.component.js +0 -362
  218. package/dist/npm/chip/chip.module.js +0 -57
  219. package/dist/npm/chip/models/chip-look.js +0 -6
  220. package/dist/npm/chip/models/selection.js +0 -6
  221. package/dist/npm/chip/models/type.js +0 -6
  222. package/dist/npm/common/models/shape.js +0 -6
  223. package/dist/npm/common/models/size.js +0 -6
  224. package/dist/npm/common/models/theme-color.js +0 -6
  225. package/dist/npm/direction.js +0 -6
  226. package/dist/npm/dropdownbutton/dropdownbutton.component.js +0 -654
  227. package/dist/npm/dropdownbutton/dropdownbutton.module.js +0 -34
  228. package/dist/npm/floatingactionbutton/animations/animations.js +0 -37
  229. package/dist/npm/floatingactionbutton/dial-item.component.js +0 -145
  230. package/dist/npm/floatingactionbutton/dial-list.component.js +0 -78
  231. package/dist/npm/floatingactionbutton/floatingactionbutton.component.js +0 -880
  232. package/dist/npm/floatingactionbutton/floatingactionbutton.module.js +0 -67
  233. package/dist/npm/floatingactionbutton/models/align.js +0 -6
  234. package/dist/npm/floatingactionbutton/models/item-animation.interface.js +0 -6
  235. package/dist/npm/floatingactionbutton/models/item-click.event.js +0 -6
  236. package/dist/npm/floatingactionbutton/models/item.interface.js +0 -6
  237. package/dist/npm/floatingactionbutton/models/offset.js +0 -6
  238. package/dist/npm/floatingactionbutton/models/position-mode.js +0 -6
  239. package/dist/npm/floatingactionbutton/templates/dial-item-template.directive.js +0 -28
  240. package/dist/npm/floatingactionbutton/templates/fab-template.directive.js +0 -28
  241. package/dist/npm/floatingactionbutton/utils.js +0 -42
  242. package/dist/npm/focusable/focus.service.js +0 -45
  243. package/dist/npm/focusable/focusable.directive.js +0 -70
  244. package/dist/npm/index.js +0 -39
  245. package/dist/npm/listbutton/button-item-template.directive.js +0 -70
  246. package/dist/npm/listbutton/list-button.js +0 -242
  247. package/dist/npm/listbutton/list-item-model.js +0 -6
  248. package/dist/npm/listbutton/list.component.js +0 -68
  249. package/dist/npm/listbutton/list.module.js +0 -35
  250. package/dist/npm/listbutton/popup-settings.js +0 -6
  251. package/dist/npm/listbutton/template-context.directive.js +0 -42
  252. package/dist/npm/main.js +0 -45
  253. package/dist/npm/navigation/key-events.js +0 -15
  254. package/dist/npm/navigation/navigation-action.js +0 -21
  255. package/dist/npm/navigation/navigation-config.js +0 -11
  256. package/dist/npm/navigation/navigation.service.js +0 -116
  257. package/dist/npm/package-metadata.js +0 -17
  258. package/dist/npm/preventable-event.js +0 -31
  259. package/dist/npm/splitbutton/localization/custom-messages.component.js +0 -46
  260. package/dist/npm/splitbutton/localization/localized-messages.directive.js +0 -37
  261. package/dist/npm/splitbutton/localization/messages.js +0 -24
  262. package/dist/npm/splitbutton/splitbutton.component.js +0 -763
  263. package/dist/npm/splitbutton/splitbutton.module.js +0 -36
  264. package/dist/npm/util.js +0 -48
  265. package/dist/systemjs/kendo-angular-buttons.js +0 -5
@@ -1,630 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Directive, ElementRef, EventEmitter, HostBinding, HostListener, Input, Renderer2 as Renderer, Output, Optional, NgZone } from '@angular/core';
7
- import { KendoButtonService } from './button.service';
8
- import { isDocumentAvailable, isChanged, hasObservers, Keys } from '@progress/kendo-angular-common';
9
- import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n';
10
- import { filter } from 'rxjs/operators';
11
- import { validatePackage } from '@progress/kendo-licensing';
12
- import { packageMetadata } from '../package-metadata';
13
- var SPAN_TAG_NAME = 'SPAN';
14
- /**
15
- * Represents the Kendo UI Button component for Angular.
16
- */
17
- var ButtonDirective = /** @class */ (function () {
18
- function ButtonDirective(element, renderer, service, localization, ngZone) {
19
- var _this = this;
20
- this.service = service;
21
- this.ngZone = ngZone;
22
- /**
23
- * Provides visual styling that indicates if the Button is active.
24
- * By default, `toggleable` is set to `false`.
25
- */
26
- this.toggleable = false;
27
- /**
28
- * Adds visual weight to the Button and makes it primary.
29
- */
30
- this.primary = false;
31
- /**
32
- * Changes the visual appearance by using alternative styling options
33
- * ([more information and examples]({% slug appearance_button %})).
34
- *
35
- * The available values are:
36
- * * [`ButtonLook`]({% slug api_buttons_buttonlook %}) = `flat` | `outline`
37
- * * `clear`
38
- */
39
- this.look = 'default';
40
- /**
41
- * @hidden
42
- */
43
- this.role = 'button';
44
- /**
45
- * Fires each time the selected state of a toggleable button is changed.
46
- *
47
- * The event argument is the new selected state (boolean).
48
- */
49
- this.selectedChange = new EventEmitter();
50
- /**
51
- * Fires each time the user clicks the button.
52
- */
53
- this.click = new EventEmitter();
54
- this.isDisabled = false;
55
- this.isIcon = false;
56
- this.isIconClass = false;
57
- this._focused = false;
58
- this.domEvents = [];
59
- validatePackage(packageMetadata);
60
- this.direction = localization.rtl ? 'rtl' : 'ltr';
61
- this.localizationChangeSubscription = localization.changes
62
- .subscribe(function (_a) {
63
- var rtl = _a.rtl;
64
- return _this.direction = rtl ? 'rtl' : 'ltr';
65
- });
66
- this.element = element.nativeElement;
67
- this.renderer = renderer;
68
- }
69
- Object.defineProperty(ButtonDirective.prototype, "togglable", {
70
- /**
71
- * Backwards-compatible alias
72
- *
73
- * @hidden
74
- */
75
- get: function () {
76
- return this.toggleable;
77
- },
78
- /**
79
- * @hidden
80
- */
81
- set: function (value) {
82
- this.toggleable = value;
83
- },
84
- enumerable: true,
85
- configurable: true
86
- });
87
- Object.defineProperty(ButtonDirective.prototype, "selected", {
88
- /**
89
- * Sets the selected state of the Button.
90
- */
91
- get: function () {
92
- return this._selected || false;
93
- },
94
- set: function (value) {
95
- this._selected = value;
96
- },
97
- enumerable: true,
98
- configurable: true
99
- });
100
- Object.defineProperty(ButtonDirective.prototype, "tabIndex", {
101
- get: function () {
102
- return this.element.tabIndex;
103
- },
104
- /**
105
- * @hidden
106
- */
107
- set: function (index) {
108
- this.element.tabIndex = index;
109
- },
110
- enumerable: true,
111
- configurable: true
112
- });
113
- Object.defineProperty(ButtonDirective.prototype, "icon", {
114
- /**
115
- * Defines the name for an existing icon in a Kendo UI theme.
116
- * The icon is rendered inside the Button by a `span.k-icon` element.
117
- */
118
- set: function (icon) {
119
- var _this = this;
120
- if (icon) {
121
- this.iconSetter(icon, function () {
122
- _this.isIcon = true;
123
- var classes = 'k-icon k-i-' + icon;
124
- _this.addIcon(classes);
125
- });
126
- }
127
- else {
128
- this.isIcon = false;
129
- this.updateIconNode();
130
- }
131
- },
132
- enumerable: true,
133
- configurable: true
134
- });
135
- Object.defineProperty(ButtonDirective.prototype, "iconClass", {
136
- /**
137
- * Defines a CSS class—or multiple classes separated by spaces—
138
- * which are applied to a `span` element inside the Button. Allows the usage of custom icons.
139
- */
140
- set: function (iconClassName) {
141
- var _this = this;
142
- if (iconClassName) {
143
- this.iconSetter(iconClassName, function () {
144
- _this.isIconClass = true;
145
- _this.addIcon(iconClassName);
146
- });
147
- }
148
- else {
149
- this.isIconClass = false;
150
- this.updateIconNode();
151
- }
152
- },
153
- enumerable: true,
154
- configurable: true
155
- });
156
- Object.defineProperty(ButtonDirective.prototype, "imageUrl", {
157
- /**
158
- * Defines a URL which is used for an `img` element inside the Button.
159
- * The URL can be relative or absolute. If relative, it is evaluated with relation to the web page URL.
160
- */
161
- set: function (imageUrl) {
162
- if (imageUrl) {
163
- this.iconSetter(imageUrl, this.addImgIcon.bind(this));
164
- }
165
- else {
166
- this.removeImageNode();
167
- }
168
- },
169
- enumerable: true,
170
- configurable: true
171
- });
172
- Object.defineProperty(ButtonDirective.prototype, "disabled", {
173
- get: function () {
174
- return this.isDisabled;
175
- },
176
- /**
177
- * If set to `true`, it disables the Button.
178
- */
179
- set: function (disabled) {
180
- this.isDisabled = disabled;
181
- this.renderer.setProperty(this.element, 'disabled', disabled);
182
- },
183
- enumerable: true,
184
- configurable: true
185
- });
186
- Object.defineProperty(ButtonDirective.prototype, "isFocused", {
187
- get: function () {
188
- return this._focused;
189
- },
190
- set: function (isFocused) {
191
- this.toggleClass('k-state-focused', isFocused);
192
- this._focused = isFocused;
193
- },
194
- enumerable: true,
195
- configurable: true
196
- });
197
- Object.defineProperty(ButtonDirective.prototype, "classButton", {
198
- get: function () {
199
- return true;
200
- },
201
- enumerable: true,
202
- configurable: true
203
- });
204
- Object.defineProperty(ButtonDirective.prototype, "classPrimary", {
205
- get: function () {
206
- return this.primary;
207
- },
208
- enumerable: true,
209
- configurable: true
210
- });
211
- Object.defineProperty(ButtonDirective.prototype, "isToggleable", {
212
- get: function () {
213
- return this.toggleable;
214
- },
215
- enumerable: true,
216
- configurable: true
217
- });
218
- Object.defineProperty(ButtonDirective.prototype, "isFlat", {
219
- get: function () {
220
- return this.look === 'flat';
221
- },
222
- enumerable: true,
223
- configurable: true
224
- });
225
- Object.defineProperty(ButtonDirective.prototype, "isBare", {
226
- get: function () {
227
- return this.look === 'bare';
228
- },
229
- enumerable: true,
230
- configurable: true
231
- });
232
- Object.defineProperty(ButtonDirective.prototype, "isOutline", {
233
- get: function () {
234
- return this.look === 'outline';
235
- },
236
- enumerable: true,
237
- configurable: true
238
- });
239
- Object.defineProperty(ButtonDirective.prototype, "isClear", {
240
- get: function () {
241
- return this.look === 'clear';
242
- },
243
- enumerable: true,
244
- configurable: true
245
- });
246
- Object.defineProperty(ButtonDirective.prototype, "roleSetter", {
247
- get: function () {
248
- return this.role;
249
- },
250
- enumerable: true,
251
- configurable: true
252
- });
253
- Object.defineProperty(ButtonDirective.prototype, "classDisabled", {
254
- get: function () {
255
- return this.isDisabled;
256
- },
257
- enumerable: true,
258
- configurable: true
259
- });
260
- Object.defineProperty(ButtonDirective.prototype, "classActive", {
261
- get: function () {
262
- return this.selected;
263
- },
264
- enumerable: true,
265
- configurable: true
266
- });
267
- Object.defineProperty(ButtonDirective.prototype, "getDirection", {
268
- get: function () {
269
- return this.direction;
270
- },
271
- enumerable: true,
272
- configurable: true
273
- });
274
- /**
275
- * @hidden
276
- */
277
- ButtonDirective.prototype.onFocus = function () {
278
- this.isFocused = true;
279
- };
280
- /**
281
- * @hidden
282
- */
283
- ButtonDirective.prototype.onBlur = function () {
284
- this.isFocused = false;
285
- };
286
- ButtonDirective.prototype.ngOnInit = function () {
287
- var _this = this;
288
- var isSpan = this.element.tagName === SPAN_TAG_NAME;
289
- if (this.service) {
290
- this.buttonLookChangeSubscription = this.service.buttonLookChange
291
- .pipe(filter(function (look) { return look !== 'default'; }))
292
- .subscribe(function (look) { return _this.look = look; });
293
- }
294
- if (!this.element.hasAttribute('role') && this.togglable) {
295
- this.toggleAriaPressed(this.toggleable);
296
- }
297
- if (this.role) {
298
- this.setAttribute('role', this.role);
299
- }
300
- this.ngZone.runOutsideAngular(function () {
301
- _this.domEvents.push(_this.renderer.listen(_this.element, 'click', _this._onButtonClick.bind(_this)));
302
- _this.domEvents.push(_this.renderer.listen(_this.element, 'keydown', function (event) {
303
- if (isSpan && (event.keyCode === Keys.Space || event.keyCode === Keys.Enter)) {
304
- _this.click.emit(event);
305
- _this._onButtonClick();
306
- }
307
- }));
308
- });
309
- };
310
- ButtonDirective.prototype.ngOnChanges = function (change) {
311
- if (isChanged('togglable', change) || isChanged('toggleable', change)) {
312
- this.toggleAriaPressed(this.toggleable);
313
- }
314
- };
315
- ButtonDirective.prototype.ngAfterViewChecked = function () {
316
- this.setIconTextClasses();
317
- };
318
- ButtonDirective.prototype.ngOnDestroy = function () {
319
- this.imageNode = null;
320
- this.iconNode = null;
321
- this.renderer = null;
322
- this.localizationChangeSubscription.unsubscribe();
323
- if (this.service && this.buttonLookChangeSubscription) {
324
- this.buttonLookChangeSubscription.unsubscribe();
325
- }
326
- clearTimeout(this.deferTimeout);
327
- this.domEvents.forEach(function (unbindHandler) { return unbindHandler(); });
328
- };
329
- /**
330
- * Focuses the Button component.
331
- */
332
- ButtonDirective.prototype.focus = function () {
333
- if (isDocumentAvailable()) {
334
- this.element.focus();
335
- this.isFocused = true;
336
- }
337
- };
338
- /**
339
- * Blurs the Button component.
340
- */
341
- ButtonDirective.prototype.blur = function () {
342
- if (isDocumentAvailable()) {
343
- this.element.blur();
344
- this.isFocused = false;
345
- }
346
- };
347
- /**
348
- * @hidden
349
- */
350
- ButtonDirective.prototype.setAttribute = function (attribute, value) {
351
- this.renderer.setAttribute(this.element, attribute, value);
352
- };
353
- /**
354
- * @hidden
355
- */
356
- ButtonDirective.prototype.removeAttribute = function (attribute) {
357
- this.renderer.removeAttribute(this.element, attribute);
358
- };
359
- /**
360
- * @hidden
361
- *
362
- * Internal setter that triggers selectedChange
363
- */
364
- ButtonDirective.prototype.setSelected = function (value) {
365
- var _this = this;
366
- var changed = this.selected !== value;
367
- this.selected = value;
368
- this.setAttribute('aria-pressed', this.selected.toString());
369
- this.toggleClass('k-state-selected', this.selected);
370
- if (changed && hasObservers(this.selectedChange)) {
371
- this.ngZone.run(function () {
372
- _this.selectedChange.emit(value);
373
- });
374
- }
375
- };
376
- ButtonDirective.prototype.toggleAriaPressed = function (shouldSet) {
377
- if (!isDocumentAvailable()) {
378
- return;
379
- }
380
- if (shouldSet) {
381
- this.setAttribute('aria-pressed', this.selected.toString());
382
- }
383
- else {
384
- this.removeAttribute('aria-pressed');
385
- }
386
- };
387
- ButtonDirective.prototype.hasText = function () {
388
- if (isDocumentAvailable()) {
389
- return String(this.element.textContent).trim().length > 0;
390
- }
391
- else {
392
- return false;
393
- }
394
- };
395
- ButtonDirective.prototype.addImgIcon = function (imageUrl) {
396
- var renderer = this.renderer;
397
- if (this.imageNode) {
398
- renderer.setProperty(this.imageNode, 'src', imageUrl);
399
- }
400
- else if (isDocumentAvailable()) {
401
- this.imageNode = renderer.createElement('img');
402
- renderer.setProperty(this.imageNode, 'src', imageUrl);
403
- renderer.setProperty(this.imageNode, 'className', 'k-image');
404
- renderer.setAttribute(this.imageNode, 'role', 'presentation');
405
- this.prependChild(this.imageNode);
406
- }
407
- };
408
- ButtonDirective.prototype.addIcon = function (classNames) {
409
- var renderer = this.renderer;
410
- if (this.iconNode) {
411
- renderer.setProperty(this.iconNode, 'className', classNames);
412
- }
413
- else if (isDocumentAvailable()) {
414
- this.iconNode = renderer.createElement('span');
415
- renderer.setProperty(this.iconNode, 'className', classNames);
416
- renderer.setAttribute(this.iconNode, 'role', 'presentation');
417
- this.prependChild(this.iconNode);
418
- }
419
- };
420
- ButtonDirective.prototype.prependChild = function (node) {
421
- var _this = this;
422
- this.defer(function () {
423
- if (_this.renderer && node !== _this.element.firstChild) {
424
- _this.renderer.insertBefore(_this.element, node, _this.element.firstChild);
425
- }
426
- });
427
- };
428
- ButtonDirective.prototype.defer = function (callback) {
429
- var _this = this;
430
- this.ngZone.runOutsideAngular(function () {
431
- _this.deferTimeout = setTimeout(callback, 0);
432
- });
433
- };
434
- ButtonDirective.prototype.iconSetter = function (icon, insertIcon) {
435
- if (icon) {
436
- insertIcon(icon);
437
- }
438
- this.setIconTextClasses();
439
- };
440
- ButtonDirective.prototype.removeImageNode = function () {
441
- if (this.imageNode && this.renderer.parentNode(this.imageNode)) {
442
- this.renderer.removeChild(this.element, this.imageNode);
443
- this.imageNode = null;
444
- }
445
- };
446
- ButtonDirective.prototype.removeIconNode = function () {
447
- if (this.iconNode && this.renderer.parentNode(this.iconNode)) {
448
- this.renderer.removeChild(this.element, this.iconNode);
449
- this.iconNode = null;
450
- }
451
- };
452
- ButtonDirective.prototype.updateIconNode = function () {
453
- if (!this.isIcon && !this.isIconClass) {
454
- this.removeIconNode();
455
- }
456
- };
457
- ButtonDirective.prototype.setIconTextClasses = function () {
458
- var hasIcon = this.isIcon || this.isIconClass || this.imageNode;
459
- var hasText = this.hasText();
460
- this.toggleClass('k-button-icon', hasIcon && !hasText);
461
- this.toggleClass('k-button-icontext', hasIcon && hasText);
462
- };
463
- ButtonDirective.prototype.toggleClass = function (className, add) {
464
- if (add) {
465
- this.renderer.addClass(this.element, className);
466
- }
467
- else {
468
- this.renderer.removeClass(this.element, className);
469
- }
470
- };
471
- ButtonDirective.prototype._onButtonClick = function () {
472
- var _this = this;
473
- if (!this.disabled && this.service) {
474
- this.ngZone.run(function () {
475
- _this.service.click(_this);
476
- });
477
- }
478
- if (this.togglable && !this.service) {
479
- this.setSelected(!this.selected);
480
- }
481
- };
482
- tslib_1.__decorate([
483
- Input(),
484
- tslib_1.__metadata("design:type", Boolean)
485
- ], ButtonDirective.prototype, "toggleable", void 0);
486
- tslib_1.__decorate([
487
- Input(),
488
- tslib_1.__metadata("design:type", Boolean),
489
- tslib_1.__metadata("design:paramtypes", [Boolean])
490
- ], ButtonDirective.prototype, "togglable", null);
491
- tslib_1.__decorate([
492
- Input(),
493
- tslib_1.__metadata("design:type", Boolean)
494
- ], ButtonDirective.prototype, "primary", void 0);
495
- tslib_1.__decorate([
496
- Input(),
497
- tslib_1.__metadata("design:type", String)
498
- ], ButtonDirective.prototype, "look", void 0);
499
- tslib_1.__decorate([
500
- Input(),
501
- tslib_1.__metadata("design:type", Boolean),
502
- tslib_1.__metadata("design:paramtypes", [Boolean])
503
- ], ButtonDirective.prototype, "selected", null);
504
- tslib_1.__decorate([
505
- Input(),
506
- tslib_1.__metadata("design:type", Number),
507
- tslib_1.__metadata("design:paramtypes", [Number])
508
- ], ButtonDirective.prototype, "tabIndex", null);
509
- tslib_1.__decorate([
510
- Input(),
511
- tslib_1.__metadata("design:type", String),
512
- tslib_1.__metadata("design:paramtypes", [String])
513
- ], ButtonDirective.prototype, "icon", null);
514
- tslib_1.__decorate([
515
- Input(),
516
- tslib_1.__metadata("design:type", String),
517
- tslib_1.__metadata("design:paramtypes", [String])
518
- ], ButtonDirective.prototype, "iconClass", null);
519
- tslib_1.__decorate([
520
- Input(),
521
- tslib_1.__metadata("design:type", String),
522
- tslib_1.__metadata("design:paramtypes", [String])
523
- ], ButtonDirective.prototype, "imageUrl", null);
524
- tslib_1.__decorate([
525
- Input(),
526
- tslib_1.__metadata("design:type", Boolean),
527
- tslib_1.__metadata("design:paramtypes", [Boolean])
528
- ], ButtonDirective.prototype, "disabled", null);
529
- tslib_1.__decorate([
530
- Input(),
531
- tslib_1.__metadata("design:type", String)
532
- ], ButtonDirective.prototype, "role", void 0);
533
- tslib_1.__decorate([
534
- Output(),
535
- tslib_1.__metadata("design:type", EventEmitter)
536
- ], ButtonDirective.prototype, "selectedChange", void 0);
537
- tslib_1.__decorate([
538
- Output(),
539
- tslib_1.__metadata("design:type", EventEmitter)
540
- ], ButtonDirective.prototype, "click", void 0);
541
- tslib_1.__decorate([
542
- HostBinding('class.k-button'),
543
- tslib_1.__metadata("design:type", Boolean),
544
- tslib_1.__metadata("design:paramtypes", [])
545
- ], ButtonDirective.prototype, "classButton", null);
546
- tslib_1.__decorate([
547
- HostBinding('class.k-primary'),
548
- tslib_1.__metadata("design:type", Boolean),
549
- tslib_1.__metadata("design:paramtypes", [])
550
- ], ButtonDirective.prototype, "classPrimary", null);
551
- tslib_1.__decorate([
552
- HostBinding('class.k-toggle-button'),
553
- tslib_1.__metadata("design:type", Boolean),
554
- tslib_1.__metadata("design:paramtypes", [])
555
- ], ButtonDirective.prototype, "isToggleable", null);
556
- tslib_1.__decorate([
557
- HostBinding('class.k-flat'),
558
- tslib_1.__metadata("design:type", Boolean),
559
- tslib_1.__metadata("design:paramtypes", [])
560
- ], ButtonDirective.prototype, "isFlat", null);
561
- tslib_1.__decorate([
562
- HostBinding('class.k-bare'),
563
- tslib_1.__metadata("design:type", Boolean),
564
- tslib_1.__metadata("design:paramtypes", [])
565
- ], ButtonDirective.prototype, "isBare", null);
566
- tslib_1.__decorate([
567
- HostBinding('class.k-outline'),
568
- tslib_1.__metadata("design:type", Boolean),
569
- tslib_1.__metadata("design:paramtypes", [])
570
- ], ButtonDirective.prototype, "isOutline", null);
571
- tslib_1.__decorate([
572
- HostBinding('class.k-button-clear'),
573
- tslib_1.__metadata("design:type", Boolean),
574
- tslib_1.__metadata("design:paramtypes", [])
575
- ], ButtonDirective.prototype, "isClear", null);
576
- tslib_1.__decorate([
577
- HostBinding('attr.role'),
578
- tslib_1.__metadata("design:type", String),
579
- tslib_1.__metadata("design:paramtypes", [])
580
- ], ButtonDirective.prototype, "roleSetter", null);
581
- tslib_1.__decorate([
582
- HostBinding('attr.aria-disabled'),
583
- HostBinding('class.k-state-disabled'),
584
- tslib_1.__metadata("design:type", Boolean),
585
- tslib_1.__metadata("design:paramtypes", [])
586
- ], ButtonDirective.prototype, "classDisabled", null);
587
- tslib_1.__decorate([
588
- HostBinding('class.k-state-selected'),
589
- tslib_1.__metadata("design:type", Boolean),
590
- tslib_1.__metadata("design:paramtypes", [])
591
- ], ButtonDirective.prototype, "classActive", null);
592
- tslib_1.__decorate([
593
- HostBinding('attr.dir'),
594
- tslib_1.__metadata("design:type", String),
595
- tslib_1.__metadata("design:paramtypes", [])
596
- ], ButtonDirective.prototype, "getDirection", null);
597
- tslib_1.__decorate([
598
- HostListener('focus'),
599
- tslib_1.__metadata("design:type", Function),
600
- tslib_1.__metadata("design:paramtypes", []),
601
- tslib_1.__metadata("design:returntype", void 0)
602
- ], ButtonDirective.prototype, "onFocus", null);
603
- tslib_1.__decorate([
604
- HostListener('blur'),
605
- tslib_1.__metadata("design:type", Function),
606
- tslib_1.__metadata("design:paramtypes", []),
607
- tslib_1.__metadata("design:returntype", void 0)
608
- ], ButtonDirective.prototype, "onBlur", null);
609
- ButtonDirective = tslib_1.__decorate([
610
- Directive({
611
- exportAs: 'kendoButton',
612
- providers: [
613
- LocalizationService,
614
- {
615
- provide: L10N_PREFIX,
616
- useValue: 'kendo.button'
617
- }
618
- ],
619
- selector: 'button[kendoButton], span[kendoButton]' // tslint:disable-line
620
- }),
621
- tslib_1.__param(2, Optional()),
622
- tslib_1.__metadata("design:paramtypes", [ElementRef,
623
- Renderer,
624
- KendoButtonService,
625
- LocalizationService,
626
- NgZone])
627
- ], ButtonDirective);
628
- return ButtonDirective;
629
- }());
630
- export { ButtonDirective };
@@ -1,28 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/
5
- import * as tslib_1 from "tslib";
6
- import { Injectable } from '@angular/core';
7
- import { BehaviorSubject, Subject } from 'rxjs';
8
- /**
9
- * @hidden
10
- */
11
- var KendoButtonService = /** @class */ (function () {
12
- function KendoButtonService() {
13
- this.buttonLookChange = new BehaviorSubject('default');
14
- this.buttonClicked = new Subject();
15
- this.buttonClicked$ = this.buttonClicked.asObservable();
16
- }
17
- KendoButtonService.prototype.click = function (button) {
18
- this.buttonClicked.next(button);
19
- };
20
- KendoButtonService.prototype.setButtonLook = function (look) {
21
- this.buttonLookChange.next(look);
22
- };
23
- KendoButtonService = tslib_1.__decorate([
24
- Injectable()
25
- ], KendoButtonService);
26
- return KendoButtonService;
27
- }());
28
- export { KendoButtonService };
@@ -1,4 +0,0 @@
1
- /**-----------------------------------------------------------------------------------------
2
- * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
- * Licensed under commercial license. See LICENSE.md in the project root for more information
4
- *-------------------------------------------------------------------------------------------*/