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