@updevs/components 1.0.0-alpha.1 → 1.0.0-alpha.3

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 (310) hide show
  1. package/README.md +5 -22
  2. package/assets/styles/_bootstrap-components.scss +38 -0
  3. package/assets/styles/_bootstrap-config.scss +7 -0
  4. package/assets/styles/_bootstrap-override.scss +78 -0
  5. package/assets/styles/_config.scss +9 -0
  6. package/assets/styles/_core.scss +71 -0
  7. package/assets/styles/_mixins.scss +2 -0
  8. package/assets/styles/_updevs.scss +9 -0
  9. package/assets/styles/_utilities.scss +98 -0
  10. package/assets/styles/_variables-dark.scss +17 -0
  11. package/assets/styles/_variables.scss +934 -0
  12. package/assets/styles/fonts/_webfonts.scss +15 -0
  13. package/assets/styles/layout/_animations.scss +62 -0
  14. package/assets/styles/layout/_core.scss +61 -0
  15. package/assets/styles/layout/_dark.scss +72 -0
  16. package/assets/styles/layout/_footer.scss +12 -0
  17. package/assets/styles/layout/_navbar.scss +380 -0
  18. package/assets/styles/layout/_page.scss +169 -0
  19. package/assets/styles/layout/_root.scss +72 -0
  20. package/assets/styles/mixins/_functions.scss +43 -0
  21. package/assets/styles/mixins/_mixins.scss +68 -0
  22. package/assets/styles/ui/_accordion.scss +24 -0
  23. package/assets/styles/ui/_alerts.scss +59 -0
  24. package/assets/styles/ui/_avatars.scss +118 -0
  25. package/assets/styles/ui/_badges.scss +79 -0
  26. package/assets/styles/ui/_breadcrumbs.scss +50 -0
  27. package/assets/styles/ui/_button-group.scss +16 -0
  28. package/assets/styles/ui/_buttons.scss +265 -0
  29. package/assets/styles/ui/_calendars.scss +104 -0
  30. package/assets/styles/ui/_cards.scss +586 -0
  31. package/assets/styles/ui/_carousel.scss +68 -0
  32. package/assets/styles/ui/_charts.scss +61 -0
  33. package/assets/styles/ui/_chips.scss +0 -0
  34. package/assets/styles/ui/_close.scss +7 -0
  35. package/assets/styles/ui/_datagrid.scss +17 -0
  36. package/assets/styles/ui/_dropdowns.scss +117 -0
  37. package/assets/styles/ui/_empty.scss +65 -0
  38. package/assets/styles/ui/_flags.scss +31 -0
  39. package/assets/styles/ui/_forms.scss +224 -0
  40. package/assets/styles/ui/_grid.scss +115 -0
  41. package/assets/styles/ui/_icons.scss +72 -0
  42. package/assets/styles/ui/_images.scss +15 -0
  43. package/assets/styles/ui/_legend.scss +12 -0
  44. package/assets/styles/ui/_lists.scss +127 -0
  45. package/assets/styles/ui/_loaders.scss +72 -0
  46. package/assets/styles/ui/_login.scss +3 -0
  47. package/assets/styles/ui/_markdown.scss +42 -0
  48. package/assets/styles/ui/_modals.scss +67 -0
  49. package/assets/styles/ui/_nav.scss +92 -0
  50. package/assets/styles/ui/_offcanvas.scss +17 -0
  51. package/assets/styles/ui/_pagination.scss +56 -0
  52. package/assets/styles/ui/_payments.scss +28 -0
  53. package/assets/styles/ui/_placeholder.scss +9 -0
  54. package/assets/styles/ui/_popovers.scss +2 -0
  55. package/assets/styles/ui/_progress.scss +107 -0
  56. package/assets/styles/ui/_ribbons.scss +156 -0
  57. package/assets/styles/ui/_stars.scss +13 -0
  58. package/assets/styles/ui/_status.scss +163 -0
  59. package/assets/styles/ui/_steps.scss +152 -0
  60. package/assets/styles/ui/_switch-icon.scss +211 -0
  61. package/assets/styles/ui/_tables.scss +150 -0
  62. package/assets/styles/ui/_tags.scss +57 -0
  63. package/assets/styles/ui/_timeline.scss +61 -0
  64. package/assets/styles/ui/_toasts.scss +19 -0
  65. package/assets/styles/ui/_toolbar.scss +10 -0
  66. package/assets/styles/ui/_tracking.scss +29 -0
  67. package/assets/styles/ui/_type.scss +169 -0
  68. package/assets/styles/ui/forms/_form-check.scss +91 -0
  69. package/assets/styles/ui/forms/_form-colorinput.scss +54 -0
  70. package/assets/styles/ui/forms/_form-custom.scss +28 -0
  71. package/assets/styles/ui/forms/_form-icon.scss +35 -0
  72. package/assets/styles/ui/forms/_form-imagecheck.scss +104 -0
  73. package/assets/styles/ui/forms/_form-selectgroup.scss +153 -0
  74. package/assets/styles/ui/forms/_validation.scss +13 -0
  75. package/assets/styles/ui/typo/_hr.scss +74 -0
  76. package/assets/styles/utils/_background.scss +15 -0
  77. package/assets/styles/utils/_colors.scss +40 -0
  78. package/assets/styles/utils/_opacity.scss +7 -0
  79. package/assets/styles/utils/_scroll.scss +47 -0
  80. package/assets/styles/utils/_shadow.scss +17 -0
  81. package/assets/styles/utils/_sizing.scss +10 -0
  82. package/assets/styles/utils/_text.scss +15 -0
  83. package/button/ng-package.json +7 -0
  84. package/button/src/button.component.html +8 -0
  85. package/button/src/button.component.scss +5 -0
  86. package/button/src/button.component.spec.ts +23 -0
  87. package/button/src/button.component.ts +154 -0
  88. package/button/src/index.ts +1 -0
  89. package/button/src/public-api.ts +2 -0
  90. package/button/src/upd-button.module.ts +17 -0
  91. package/card/ng-package.json +7 -0
  92. package/card/src/card.component.html +105 -0
  93. package/card/src/card.component.scss +47 -0
  94. package/card/src/card.component.spec.ts +23 -0
  95. package/card/src/card.component.ts +112 -0
  96. package/card/src/directives/card-actions.directive.spec.ts +8 -0
  97. package/card/src/directives/card-actions.directive.ts +11 -0
  98. package/card/src/directives/card-footer.directive.spec.ts +8 -0
  99. package/card/src/directives/card-footer.directive.ts +11 -0
  100. package/card/src/directives/card-header.directive.spec.ts +8 -0
  101. package/card/src/directives/card-header.directive.ts +11 -0
  102. package/card/src/directives/card-image.directive.spec.ts +8 -0
  103. package/card/src/directives/card-image.directive.ts +11 -0
  104. package/card/src/directives/public-api.ts +4 -0
  105. package/card/src/index.ts +1 -0
  106. package/card/src/public-api.ts +3 -0
  107. package/card/src/types/card-state.type.ts +1 -0
  108. package/card/src/types/card-style.type.ts +1 -0
  109. package/card/src/types/hover-effect.type.ts +1 -0
  110. package/card/src/types/public-api.ts +5 -0
  111. package/card/src/types/ribbon-style.type.ts +1 -0
  112. package/card/src/types/status-position.type.ts +1 -0
  113. package/card/src/upd-card.module.ts +32 -0
  114. package/dropdown/ng-package.json +7 -0
  115. package/dropdown/src/dropdown.component.html +32 -0
  116. package/dropdown/src/dropdown.component.scss +19 -0
  117. package/dropdown/src/dropdown.component.spec.ts +23 -0
  118. package/dropdown/src/dropdown.component.ts +182 -0
  119. package/dropdown/src/index.ts +1 -0
  120. package/dropdown/src/models/dropdown-item.ts +22 -0
  121. package/dropdown/src/models/dropdown-item.type.ts +1 -0
  122. package/dropdown/src/models/public-api.ts +2 -0
  123. package/dropdown/src/public-api.ts +3 -0
  124. package/dropdown/src/upd-dropdown.module.ts +25 -0
  125. package/form/ng-package.json +7 -0
  126. package/form/src/form.module.ts +10 -0
  127. package/form/src/index.ts +1 -0
  128. package/form/src/public-api.ts +1 -0
  129. package/form-controls/checkbox/ng-package.json +7 -0
  130. package/form-controls/checkbox/src/checkbox.component.html +7 -0
  131. package/form-controls/checkbox/src/checkbox.component.scss +0 -0
  132. package/form-controls/checkbox/src/checkbox.component.spec.ts +23 -0
  133. package/form-controls/checkbox/src/checkbox.component.ts +48 -0
  134. package/form-controls/checkbox/src/index.ts +1 -0
  135. package/form-controls/checkbox/src/public-api.ts +3 -0
  136. package/form-controls/checkbox/src/upd-checkbox.module.ts +19 -0
  137. package/form-controls/input/ng-package.json +7 -0
  138. package/form-controls/input/src/directives/input-append.directive.spec.ts +8 -0
  139. package/form-controls/input/src/directives/input-append.directive.ts +11 -0
  140. package/form-controls/input/src/directives/input-prepend.directive.spec.ts +8 -0
  141. package/form-controls/input/src/directives/input-prepend.directive.ts +11 -0
  142. package/form-controls/input/src/directives/public-api.ts +2 -0
  143. package/form-controls/input/src/index.ts +1 -0
  144. package/form-controls/input/src/input.component.html +82 -0
  145. package/form-controls/input/src/input.component.scss +13 -0
  146. package/form-controls/input/src/input.component.spec.ts +23 -0
  147. package/form-controls/input/src/input.component.ts +124 -0
  148. package/form-controls/input/src/public-api.ts +4 -0
  149. package/form-controls/input/src/types/input.type.ts +1 -0
  150. package/form-controls/input/src/types/loader-position.type.ts +1 -0
  151. package/form-controls/input/src/types/public-api.ts +2 -0
  152. package/form-controls/input/src/upd-input.module.ts +29 -0
  153. package/form-controls/radio/ng-package.json +7 -0
  154. package/form-controls/radio/src/index.ts +1 -0
  155. package/form-controls/radio/src/public-api.ts +2 -0
  156. package/form-controls/radio/src/radio.component.html +7 -0
  157. package/form-controls/radio/src/radio.component.scss +0 -0
  158. package/form-controls/radio/src/radio.component.spec.ts +23 -0
  159. package/form-controls/radio/src/radio.component.ts +47 -0
  160. package/form-controls/radio/src/upd-radio.module.ts +17 -0
  161. package/form-controls/select/ng-package.json +7 -0
  162. package/form-controls/select/src/components/multiple/select-multiple.component.html +41 -0
  163. package/form-controls/select/src/components/multiple/select-multiple.component.scss +6 -0
  164. package/form-controls/select/src/components/multiple/select-multiple.component.spec.ts +21 -0
  165. package/form-controls/select/src/components/multiple/select-multiple.component.ts +69 -0
  166. package/form-controls/select/src/components/shared.scss +40 -0
  167. package/form-controls/select/src/components/single/select.component.html +53 -0
  168. package/form-controls/select/src/components/single/select.component.scss +3 -0
  169. package/form-controls/select/src/components/single/select.component.spec.ts +23 -0
  170. package/form-controls/select/src/components/single/select.component.ts +58 -0
  171. package/form-controls/select/src/index.ts +1 -0
  172. package/form-controls/select/src/models/abstractions/base-select.component.ts +259 -0
  173. package/form-controls/select/src/models/public-api.ts +1 -0
  174. package/form-controls/select/src/models/select-item.ts +26 -0
  175. package/form-controls/select/src/public-api.ts +4 -0
  176. package/form-controls/select/src/upd-select.module.ts +32 -0
  177. package/form-controls/textarea/ng-package.json +7 -0
  178. package/form-controls/textarea/src/index.ts +1 -0
  179. package/form-controls/textarea/src/public-api.ts +2 -0
  180. package/form-controls/textarea/src/textarea.component.html +8 -0
  181. package/form-controls/textarea/src/textarea.component.scss +0 -0
  182. package/form-controls/textarea/src/textarea.component.spec.ts +23 -0
  183. package/form-controls/textarea/src/textarea.component.ts +47 -0
  184. package/form-controls/textarea/src/upd-textarea.module.ts +17 -0
  185. package/form-controls/time-picker/ng-package.json +7 -0
  186. package/form-controls/time-picker/src/assets/i18n/en.json +5 -0
  187. package/form-controls/time-picker/src/assets/i18n/pt.json +5 -0
  188. package/form-controls/time-picker/src/index.ts +1 -0
  189. package/form-controls/time-picker/src/public-api.ts +3 -0
  190. package/form-controls/time-picker/src/time-picker.component.html +17 -0
  191. package/form-controls/time-picker/src/time-picker.component.scss +10 -0
  192. package/form-controls/time-picker/src/time-picker.component.spec.ts +21 -0
  193. package/form-controls/time-picker/src/time-picker.component.ts +110 -0
  194. package/form-controls/time-picker/src/time-selector/time-selector.component.html +44 -0
  195. package/form-controls/time-picker/src/time-selector/time-selector.component.scss +47 -0
  196. package/form-controls/time-picker/src/time-selector/time-selector.component.spec.ts +21 -0
  197. package/form-controls/time-picker/src/time-selector/time-selector.component.ts +107 -0
  198. package/form-controls/time-picker/src/upd-time-picker.module.ts +39 -0
  199. package/layout/ng-package.json +7 -0
  200. package/layout/src/abstractions/base-page.component.ts +21 -0
  201. package/layout/src/abstractions/public-api.ts +1 -0
  202. package/layout/src/assets/i18n/en.json +5 -0
  203. package/layout/src/assets/i18n/pt.json +5 -0
  204. package/layout/src/index.ts +1 -0
  205. package/layout/src/layouts/blank-layout/blank-layout.component.html +1 -0
  206. package/layout/src/layouts/blank-layout/blank-layout.component.scss +0 -0
  207. package/layout/src/layouts/blank-layout/blank-layout.component.spec.ts +23 -0
  208. package/layout/src/layouts/blank-layout/blank-layout.component.ts +10 -0
  209. package/layout/src/layouts/blank-layout/blank-layout.module.ts +17 -0
  210. package/layout/src/layouts/public-api.ts +4 -0
  211. package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.html +14 -0
  212. package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.scss +0 -0
  213. package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.spec.ts +23 -0
  214. package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.component.ts +31 -0
  215. package/layout/src/layouts/vertical-sidebar-layout/vertical-sidebar-layout.module.ts +52 -0
  216. package/layout/src/models/public-api.ts +1 -0
  217. package/layout/src/models/upd-layout-config.model.ts +71 -0
  218. package/layout/src/models/upd-layout.config.ts +37 -0
  219. package/layout/src/pages/auth-flow/auth-flow-routing.module.ts +21 -0
  220. package/layout/src/pages/auth-flow/auth-flow.module.ts +29 -0
  221. package/layout/src/pages/auth-flow/logged-out/logged-out.component.html +1 -0
  222. package/layout/src/pages/auth-flow/logged-out/logged-out.component.scss +0 -0
  223. package/layout/src/pages/auth-flow/logged-out/logged-out.component.spec.ts +23 -0
  224. package/layout/src/pages/auth-flow/logged-out/logged-out.component.ts +10 -0
  225. package/layout/src/pages/auth-flow/login/login.component.html +96 -0
  226. package/layout/src/pages/auth-flow/login/login.component.scss +0 -0
  227. package/layout/src/pages/auth-flow/login/login.component.spec.ts +23 -0
  228. package/layout/src/pages/auth-flow/login/login.component.ts +26 -0
  229. package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.html +1 -0
  230. package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.scss +0 -0
  231. package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.spec.ts +23 -0
  232. package/layout/src/pages/auth-flow/oauth-callback/oauth-callback.component.ts +10 -0
  233. package/layout/src/pages/auth-flow/public-api.ts +5 -0
  234. package/layout/src/pages/public-api.ts +1 -0
  235. package/layout/src/partials/footer/footer-copyright.directive.spec.ts +8 -0
  236. package/layout/src/partials/footer/footer-copyright.directive.ts +9 -0
  237. package/layout/src/partials/footer/footer.component.html +30 -0
  238. package/layout/src/partials/footer/footer.component.scss +0 -0
  239. package/{src/lib/components.component.spec.ts → layout/src/partials/footer/footer.component.spec.ts} +6 -6
  240. package/layout/src/partials/footer/footer.component.ts +73 -0
  241. package/layout/src/partials/footer/public-api.ts +2 -0
  242. package/layout/src/partials/header/header-style.type.ts +1 -0
  243. package/layout/src/partials/header/header.component.html +163 -0
  244. package/layout/src/partials/header/header.component.scss +0 -0
  245. package/layout/src/partials/header/header.component.spec.ts +23 -0
  246. package/layout/src/partials/header/header.component.ts +86 -0
  247. package/layout/src/partials/header/public-api.ts +2 -0
  248. package/layout/src/partials/page-header/page-header.component.html +19 -0
  249. package/layout/src/partials/page-header/page-header.component.scss +0 -0
  250. package/layout/src/partials/page-header/page-header.component.spec.ts +23 -0
  251. package/layout/src/partials/page-header/page-header.component.ts +11 -0
  252. package/layout/src/partials/page-header/public-api.ts +1 -0
  253. package/layout/src/partials/public-api.ts +4 -0
  254. package/layout/src/partials/sidebar/public-api.ts +1 -0
  255. package/layout/src/partials/sidebar/sidebar.component.html +62 -0
  256. package/layout/src/partials/sidebar/sidebar.component.scss +0 -0
  257. package/layout/src/partials/sidebar/sidebar.component.spec.ts +23 -0
  258. package/layout/src/partials/sidebar/sidebar.component.ts +161 -0
  259. package/layout/src/public-api.ts +7 -0
  260. package/layout/src/services/public-api.ts +1 -0
  261. package/{src/lib/components.service.spec.ts → layout/src/services/upd-layout-config.service.spec.ts} +4 -4
  262. package/layout/src/services/upd-layout-config.service.ts +20 -0
  263. package/layout/src/tools/layout.constants.ts +18 -0
  264. package/layout/src/upd-layout.module.ts +34 -0
  265. package/link/ng-package.json +7 -0
  266. package/link/src/index.ts +1 -0
  267. package/link/src/link.component.html +3 -0
  268. package/link/src/link.component.scss +3 -0
  269. package/link/src/link.component.spec.ts +23 -0
  270. package/link/src/link.component.ts +48 -0
  271. package/link/src/public-api.ts +3 -0
  272. package/link/src/target.type.ts +1 -0
  273. package/link/src/upd-link.module.ts +17 -0
  274. package/list/ng-package.json +7 -0
  275. package/list/src/assets/i18n/en.json +5 -0
  276. package/list/src/assets/i18n/pt.json +5 -0
  277. package/list/src/index.ts +1 -0
  278. package/list/src/list.component.html +58 -0
  279. package/list/src/list.component.scss +21 -0
  280. package/list/src/list.component.spec.ts +23 -0
  281. package/list/src/list.component.ts +147 -0
  282. package/list/src/models/badge-position.type.ts +1 -0
  283. package/list/src/models/list-item.model.ts +35 -0
  284. package/list/src/models/list-item.ts +21 -0
  285. package/list/src/models/public-api.ts +2 -0
  286. package/list/src/public-api.ts +3 -0
  287. package/list/src/upd-list.module.ts +30 -0
  288. package/ng-package.json +9 -6
  289. package/package.json +8 -5
  290. package/popover/ng-package.json +7 -0
  291. package/popover/src/index.ts +1 -0
  292. package/popover/src/popover.component.html +20 -0
  293. package/popover/src/popover.component.scss +8 -0
  294. package/popover/src/popover.component.spec.ts +23 -0
  295. package/popover/src/popover.component.ts +53 -0
  296. package/popover/src/popover.directive.spec.ts +8 -0
  297. package/popover/src/popover.directive.ts +128 -0
  298. package/popover/src/public-api.ts +3 -0
  299. package/popover/src/upd-popover.module.ts +20 -0
  300. package/src/lib/index.ts +1 -0
  301. package/src/lib/public-api.ts +2 -0
  302. package/src/lib/types/component-size.type.ts +1 -0
  303. package/src/lib/types/public-api.ts +2 -0
  304. package/src/lib/types/validation-status.type.ts +1 -0
  305. package/src/lib/upd-components.module.ts +6 -0
  306. package/src/public-api.ts +1 -7
  307. package/tsconfig.lib.json +11 -11
  308. package/src/lib/components.component.ts +0 -14
  309. package/src/lib/components.module.ts +0 -17
  310. package/src/lib/components.service.ts +0 -9
@@ -0,0 +1,154 @@
1
+ import {
2
+ Component,
3
+ Input,
4
+ ViewEncapsulation,
5
+ Output,
6
+ EventEmitter,
7
+ OnInit,
8
+ OnChanges,
9
+ SimpleChanges,
10
+ HostBinding,
11
+ HostListener
12
+ } from '@angular/core';
13
+ import { ColorStyleType, BrandType, ButtonModel } from '@updevs/sdk/layout';
14
+
15
+ @Component({
16
+ selector: 'upd-button',
17
+ templateUrl: './button.component.html',
18
+ styleUrls: ['./button.component.scss'],
19
+ encapsulation: ViewEncapsulation.None
20
+ })
21
+ export class ButtonComponent implements OnInit, OnChanges {
22
+ @HostBinding('class') classes: string[] = [];
23
+
24
+ @Input() text?: string;
25
+ @Input() model?: ButtonModel;
26
+ @Input() colorStyle?: ColorStyleType;
27
+ @Input() brandColorStyle?: BrandType;
28
+ @Input() customClasses?: string;
29
+ @Input() isActive = false;
30
+ @Input() isDisabled = false;
31
+ @Input() isOutline = false;
32
+ @Input() isGhost = false;
33
+ @Input() isSquare = false;
34
+ @Input() isPill = false;
35
+ @Input() isIcon = false;
36
+ @Input() isLoading = false;
37
+ /**
38
+ * Whether the button should act as a list (top-bottom alignment instead of left-right related to neighbors).
39
+ */
40
+ @Input() isList = false;
41
+ /**
42
+ * Whether the button should be floating in the bottom right corner.
43
+ */
44
+ @Input() isFloating = false;
45
+ @Input() isAction = false;
46
+ @Input() isNavigationLink = false;
47
+ @Input() shouldIgnoreBtnClass = false;
48
+
49
+ /**
50
+ * Emitted when the button is clicked.
51
+ * **NOTE:** The name of the event can not be 'click'. It would generate a conflict with the HTML event of same name.
52
+ * That would cause strange behaviors like preventing `isDisabled` from working correctly.
53
+ */
54
+ @Output() readonly clicked = new EventEmitter<any>();
55
+
56
+ ngOnInit(): void {
57
+ this.setupFromModel();
58
+ this.updateClasses();
59
+ }
60
+
61
+ ngOnChanges(changes: SimpleChanges): void {
62
+ if (!!changes['model']) {
63
+ this.setupFromModel();
64
+ }
65
+
66
+ this.updateClasses();
67
+ }
68
+
69
+ @HostListener('click', ['$event'])
70
+ onClick(event: MouseEvent): void {
71
+ if (!!this.model && !!this.model.clickFunction) {
72
+ this.model.clickFunction(event);
73
+ } else {
74
+ this.clicked.emit(undefined);
75
+ }
76
+
77
+ event.stopPropagation();
78
+ }
79
+
80
+ private updateClasses(): void {
81
+ const outlineCls = this.isOutline ? 'outline-' : '';
82
+ const ghostCls = this.isGhost ? 'ghost-' : '';
83
+ const lClasses: string[] = this.shouldIgnoreBtnClass ? [] : ['btn'];
84
+
85
+ if (!!outlineCls || !!ghostCls || !!this.colorStyle || !!this.brandColorStyle) {
86
+ lClasses.push(`btn-${outlineCls || ghostCls}${this.colorStyle || this.brandColorStyle}`);
87
+ }
88
+
89
+ if (this.isSquare) {
90
+ lClasses.push('btn-square');
91
+ }
92
+
93
+ if (this.isPill) {
94
+ lClasses.push('btn-pill');
95
+ }
96
+
97
+ if (this.isIcon) {
98
+ lClasses.push('btn-icon');
99
+ }
100
+
101
+ if (this.isLoading) {
102
+ lClasses.push('btn-loading');
103
+ }
104
+
105
+ if (this.isList) {
106
+ lClasses.push('btn-list');
107
+ }
108
+
109
+ if (this.isFloating) {
110
+ lClasses.push('btn-floating');
111
+ }
112
+
113
+ if (this.isAction) {
114
+ lClasses.push('btn-action');
115
+ }
116
+
117
+ if (this.isNavigationLink) {
118
+ lClasses.push('nav-link');
119
+ }
120
+
121
+ if (this.isActive) {
122
+ lClasses.push('active');
123
+ }
124
+
125
+ if (this.isDisabled) {
126
+ lClasses.push('disabled');
127
+ }
128
+
129
+ this.classes = [...lClasses, ...(this.customClasses?.split(' ') || [])];
130
+ }
131
+
132
+ private setupFromModel(): void {
133
+ if (!this.model) {
134
+ return;
135
+ }
136
+
137
+ this.text = this.model.text;
138
+ this.colorStyle = this.model.colorStyle;
139
+ this.brandColorStyle = this.model.brandColorStyle;
140
+ this.customClasses += this.model.customClasses || '';
141
+ this.isActive = this.model.isActive;
142
+ this.isDisabled = this.model.isDisabled;
143
+ this.isOutline = this.model.isOutline;
144
+ this.isGhost = this.model.isGhost;
145
+ this.isSquare = this.model.isSquare;
146
+ this.isPill = this.model.isPill;
147
+ this.isIcon = this.model.isIcon;
148
+ this.isLoading = this.model.isLoading;
149
+ this.isList = this.model.isList;
150
+ this.isFloating = this.model.isFloating;
151
+ this.isAction = this.model.isAction;
152
+ this.isNavigationLink = this.model.isNavigationLink;
153
+ }
154
+ }
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export * from './upd-button.module';
2
+ export * from './button.component';
@@ -0,0 +1,17 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+
4
+ import { ButtonComponent } from './button.component';
5
+
6
+ @NgModule({
7
+ imports: [
8
+ CommonModule
9
+ ],
10
+ declarations: [
11
+ ButtonComponent
12
+ ],
13
+ exports: [
14
+ ButtonComponent
15
+ ]
16
+ })
17
+ export class UpdButtonModule {}
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../../../node_modules/@updevs/components/card",
4
+ "lib": {
5
+ "entryFile": "src/index.ts"
6
+ }
7
+ }
@@ -0,0 +1,105 @@
1
+ <ng-template *ngIf="!hoverEffect; else linkTpl" [ngTemplateOutlet]="structureTpl"></ng-template>
2
+
3
+ <!-- Template for cards that are links -->
4
+ <ng-template #linkTpl>
5
+ <a href="#" class="card" [ngClass]="classes">
6
+ <ng-template [ngTemplateOutlet]="structureTpl"></ng-template>
7
+ </a>
8
+ </ng-template>
9
+
10
+ <ng-template #structureTpl>
11
+ <!-- Ribbon -->
12
+ <div *ngIf="!!ribbonBackground" class="ribbon {{ribbonStyle === 'default' ? '' : 'ribbon-' + ribbonStyle}} bg-{{ribbonBackground}}">
13
+ <span *ngIf="!!ribbonText; else ribbonIconTpl">{{ribbonText}}</span>
14
+ <ng-template #ribbonIconTpl>
15
+ <upd-icon [model]="ribbonIcon" wrapperClasses="icon" [removeDefaultClasses]="true"></upd-icon>
16
+ </ng-template>
17
+ </div>
18
+
19
+ <!-- Status -->
20
+ <div *ngIf="!!statusBackground" class="card-status-{{statusPosition}} bg-{{statusBackground}}"></div>
21
+
22
+ <!-- Stamp -->
23
+ <div *ngIf="!!stampIcon" class="card-stamp">
24
+ <div class="card-stamp-icon bg-{{stampBackground}}">
25
+ <upd-icon [model]="stampIcon" wrapperClasses="icon" [removeDefaultClasses]="true"></upd-icon>
26
+ </div>
27
+ </div>
28
+
29
+ <!-- Header section -->
30
+ <div *ngIf="showHeader && (!!title || !!headerTemplate?.templateRef)" class="card-header" [class.card-header-light]="useLightHeader">
31
+ <ng-container *ngIf="!headerTemplate?.templateRef; else customHeaderTpl">
32
+ <h3 class="card-title">{{title}} <span *ngIf="!!subtitle" class="card-subtitle">{{subtitle}}</span></h3>
33
+ </ng-container>
34
+ <ng-template #customHeaderTpl [ngTemplateOutlet]="headerTemplate?.templateRef || null"></ng-template>
35
+
36
+ <!-- Actions -->
37
+ <div *ngIf="!!actionsTemplate || actions.length > 0" class="card-actions">
38
+ <ng-container *ngIf="actions.length > 0; else customActionsTpl">
39
+ <upd-button *ngFor="let btn of actions" [model]="btn" customClasses="me-1"></upd-button>
40
+ </ng-container>
41
+ <ng-template #customActionsTpl [ngTemplateOutlet]="actionsTemplate?.templateRef || null"></ng-template>
42
+ </div>
43
+ </div>
44
+
45
+ <!-- Body -->
46
+ <ng-container *ngIf="!!imageTemplate; else bodyTpl">
47
+ <ng-template *ngIf="imagePosition === 'left' || imagePosition === 'right'; else bodyWithTopBottomImageTpl"
48
+ [ngTemplateOutlet]="bodyWithSideImageTpl"></ng-template>
49
+ </ng-container>
50
+
51
+ <!-- Footer -->
52
+ <div *ngIf="!!footerText || !!footerTemplate" class="card-footer" [class.card-footer-transparent]="isFooterTransparent">
53
+ <ng-container *ngIf="!footerTemplate?.templateRef; else customFooterTpl">
54
+ <span *ngIf="!!footerText">{{footerText}}</span>
55
+ </ng-container>
56
+ <ng-template #customFooterTpl [ngTemplateOutlet]="footerTemplate?.templateRef || null"></ng-template>
57
+ </div>
58
+
59
+ <!-- Progress bar -->
60
+ <div *ngIf="showProgressBar" class="progress progress-sm card-progress">
61
+ <div class="progress-bar" [style.width.%]="progress" role="progressbar" [attr.aria-valuenow]="progress" aria-valuemin="0"
62
+ aria-valuemax="100">
63
+ </div>
64
+ </div>
65
+ </ng-template>
66
+
67
+ <!-- Body with an image on either side -->
68
+ <ng-template #bodyWithSideImageTpl>
69
+ <div class="row row-0">
70
+ <div class="col-3" [class.order-md-last]="imagePosition === 'right'">
71
+ <div class="card-image-{{imagePosition}}">
72
+ <ng-template [ngTemplateOutlet]="imageTemplate!.templateRef"></ng-template>
73
+ </div>
74
+ </div>
75
+ <div class="col">
76
+ <ng-template [ngTemplateOutlet]="bodyTpl"></ng-template>
77
+ </div>
78
+ </div>
79
+ </ng-template>
80
+
81
+ <!-- Body with an image on top or bottom -->
82
+ <ng-template #bodyWithTopBottomImageTpl>
83
+ <div *ngIf="imagePosition === 'top'" class="img-responsive-21x9 card-img-top">
84
+ <div class="card-image-{{imagePosition}}">
85
+ <ng-template [ngTemplateOutlet]="imageTemplate!.templateRef"></ng-template>
86
+ </div>
87
+ </div>
88
+ <ng-template [ngTemplateOutlet]="bodyTpl"></ng-template>
89
+ <div *ngIf="imagePosition === 'bottom'" class="img-responsive-21x9 card-img-bottom">
90
+ <div class="card-image-{{imagePosition}}">
91
+ <ng-template [ngTemplateOutlet]="imageTemplate!.templateRef"></ng-template>
92
+ </div>
93
+ </div>
94
+ </ng-template>
95
+
96
+ <!-- Body -->
97
+ <ng-template #bodyTpl>
98
+ <div class="card-body">
99
+ <!-- If title was set, but the header section is hidden, we add the title to the body -->
100
+ <ng-container *ngIf="!showHeader && !!title">
101
+ <h3 class="card-title">{{title}} <span *ngIf="!!subtitle" class="card-subtitle">{{subtitle}}</span></h3>
102
+ </ng-container>
103
+ <ng-content></ng-content>
104
+ </div>
105
+ </ng-template>
@@ -0,0 +1,47 @@
1
+ .card-image-right {
2
+ @extend .w-100 !optional;
3
+ @extend .h-100 !optional;
4
+
5
+ > img {
6
+ @extend .w-100 !optional;
7
+ @extend .h-100 !optional;
8
+ @extend .object-cover !optional;
9
+ @extend .card-img-end !optional;
10
+ }
11
+ }
12
+
13
+ .card-image-left {
14
+ @extend .w-100 !optional;
15
+ @extend .h-100 !optional;
16
+
17
+ > img {
18
+ @extend .w-100 !optional;
19
+ @extend .h-100 !optional;
20
+ @extend .object-cover !optional;
21
+ @extend .card-img-start !optional;
22
+ }
23
+ }
24
+
25
+ .card-image-top {
26
+ @extend .w-100 !optional;
27
+ @extend .h-100 !optional;
28
+
29
+ > img {
30
+ @extend .w-100 !optional;
31
+ @extend .h-100 !optional;
32
+ @extend .object-cover !optional;
33
+ @extend .card-img-top !optional;
34
+ }
35
+ }
36
+
37
+ .card-image-bottom {
38
+ @extend .w-100 !optional;
39
+ @extend .h-100 !optional;
40
+
41
+ > img {
42
+ @extend .w-100 !optional;
43
+ @extend .h-100 !optional;
44
+ @extend .object-cover !optional;
45
+ @extend .card-img-bottom !optional;
46
+ }
47
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CardComponent } from './card.component';
4
+
5
+ describe('CardComponent', () => {
6
+ let component: CardComponent;
7
+ let fixture: ComponentFixture<CardComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ CardComponent ]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CardComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,112 @@
1
+ import {
2
+ Component,
3
+ Input,
4
+ ContentChild,
5
+ SimpleChanges,
6
+ OnInit,
7
+ OnChanges,
8
+ ViewEncapsulation, HostBinding
9
+ } from '@angular/core';
10
+ import { BgColorStyleType, ButtonModel } from '@updevs/sdk/layout';
11
+ import { TopBottomLeftRightType } from '@updevs/sdk/types';
12
+ import { IconModel } from '@updevs/icons';
13
+
14
+ import { CardFooterDirective } from './directives/card-footer.directive';
15
+ import { CardHeaderDirective } from './directives/card-header.directive';
16
+ import { HoverEffectType } from './types/hover-effect.type';
17
+ import { CardStateType } from './types/card-state.type';
18
+ import { StatusPositionType } from './types/status-position.type';
19
+ import { RibbonStyleType } from './types/ribbon-style.type';
20
+ import { CardStyleType } from './types/card-style.type';
21
+ import { CardImageDirective } from './directives/card-image.directive';
22
+ import { CardActionsDirective } from './directives/card-actions.directive';
23
+
24
+ @Component({
25
+ selector: 'upd-card',
26
+ templateUrl: './card.component.html',
27
+ styleUrls: ['./card.component.scss'],
28
+ encapsulation: ViewEncapsulation.None
29
+ })
30
+ export class CardComponent implements OnInit, OnChanges {
31
+ @HostBinding('class') @Input() wrapperClasses = '';
32
+ @ContentChild(CardHeaderDirective) headerTemplate?: CardHeaderDirective;
33
+ @ContentChild(CardFooterDirective) footerTemplate?: CardFooterDirective;
34
+ @ContentChild(CardImageDirective) imageTemplate?: CardImageDirective;
35
+ @ContentChild(CardActionsDirective) actionsTemplate?: CardActionsDirective;
36
+
37
+ @Input() title?: string;
38
+ @Input() subtitle?: string;
39
+ @Input() hoverEffect?: HoverEffectType;
40
+ @Input() state?: CardStateType;
41
+ @Input() type?: CardStyleType;
42
+ @Input() imagePosition?: TopBottomLeftRightType;
43
+ @Input() bgColor?: BgColorStyleType;
44
+ @Input() stampIcon?: IconModel;
45
+ @Input() stampBackground: BgColorStyleType = 'primary';
46
+ @Input() statusBackground?: BgColorStyleType;
47
+ @Input() statusPosition: StatusPositionType = 'top';
48
+ @Input() ribbonBackground?: BgColorStyleType;
49
+ @Input() ribbonStyle: RibbonStyleType = 'default';
50
+ @Input() ribbonIcon?: IconModel = { tablerIcon: 'star' };
51
+ @Input() ribbonText?: string;
52
+ @Input() rotate?: 'right' | 'left';
53
+ @Input() removeBorder = false;
54
+ @Input() useLightHeader = false;
55
+ /**
56
+ * Whether the header should be displayed.
57
+ */
58
+ @Input() showHeader = true;
59
+ @Input() isFooterTransparent = false;
60
+ @Input() footerText?: string;
61
+ @Input() showProgressBar = false;
62
+ @Input() progress?: number;
63
+ @Input() actions: ButtonModel[] = [];
64
+
65
+ classes: string[] = [];
66
+
67
+ ngOnInit(): void {
68
+ this.updateClasses();
69
+ }
70
+
71
+ ngOnChanges(changes: SimpleChanges): void {
72
+ this.updateClasses();
73
+ }
74
+
75
+ private updateClasses(): void {
76
+ const lClasses: string[] = [];
77
+
78
+ if (this.removeBorder) {
79
+ lClasses.push('card-borderless');
80
+ }
81
+
82
+ if (!!this.hoverEffect) {
83
+ lClasses.push('card-link');
84
+
85
+ if (this.hoverEffect !== 'default') {
86
+ lClasses.push(`card-link-${this.hoverEffect}`);
87
+ }
88
+ }
89
+
90
+ if (!!this.state) {
91
+ lClasses.push(`card-${this.state}`);
92
+ }
93
+
94
+ if (!!this.bgColor) {
95
+ lClasses.push(`bg-${this.bgColor}`);
96
+ }
97
+
98
+ if (!!this.rotate) {
99
+ lClasses.push(`card-rotate-${this.rotate}`);
100
+ }
101
+
102
+ if (!!this.type) {
103
+ lClasses.push(`card-${this.type}`);
104
+ }
105
+
106
+ if (!!this.hoverEffect) {
107
+ this.classes = [...lClasses];
108
+ } else {
109
+ this.wrapperClasses = 'card ' + lClasses.join(' ');
110
+ }
111
+ }
112
+ }
@@ -0,0 +1,8 @@
1
+ import { CardActionsDirective } from './card-actions.directive';
2
+
3
+ describe('CardActionsDirective', () => {
4
+ it('should create an instance', () => {
5
+ const directive = new CardActionsDirective();
6
+ expect(directive).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,11 @@
1
+ import { Directive, TemplateRef } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'ng-template[updCardActions]'
5
+ })
6
+ export class CardActionsDirective {
7
+ constructor(
8
+ public templateRef: TemplateRef<any>
9
+ ) {
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import { CardFooterDirective } from './card-footer.directive';
2
+
3
+ describe('CardFooterDirective', () => {
4
+ it('should create an instance', () => {
5
+ const directive = new CardFooterDirective(undefined);
6
+ expect(directive).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,11 @@
1
+ import { Directive, TemplateRef } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'ng-template[updCardFooter]'
5
+ })
6
+ export class CardFooterDirective {
7
+ constructor(
8
+ public templateRef: TemplateRef<any>
9
+ ) {
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import { CardHeaderDirective } from './card-header.directive';
2
+
3
+ describe('CardHeaderDirective', () => {
4
+ it('should create an instance', () => {
5
+ const directive = new CardHeaderDirective();
6
+ expect(directive).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,11 @@
1
+ import { Directive, TemplateRef } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'ng-template[updCardHeader]'
5
+ })
6
+ export class CardHeaderDirective {
7
+ constructor(
8
+ public templateRef: TemplateRef<any>
9
+ ) {
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import { CardImageDirective } from './card-image.directive';
2
+
3
+ describe('CardImageDirective', () => {
4
+ it('should create an instance', () => {
5
+ const directive = new CardImageDirective(undefined);
6
+ expect(directive).toBeTruthy();
7
+ });
8
+ });
@@ -0,0 +1,11 @@
1
+ import { Directive, TemplateRef } from '@angular/core';
2
+
3
+ @Directive({
4
+ selector: 'ng-template[updCardImage]'
5
+ })
6
+ export class CardImageDirective {
7
+ constructor(
8
+ public templateRef: TemplateRef<any>
9
+ ) {
10
+ }
11
+ }
@@ -0,0 +1,4 @@
1
+ export * from './card-actions.directive';
2
+ export * from './card-footer.directive';
3
+ export * from './card-header.directive';
4
+ export * from './card-image.directive';
@@ -0,0 +1 @@
1
+ export * from './public-api';
@@ -0,0 +1,3 @@
1
+ export * from './directives/public-api';
2
+ export * from './upd-card.module';
3
+ export * from './card.component';
@@ -0,0 +1 @@
1
+ export type CardStateType = 'active' | 'inactive';
@@ -0,0 +1 @@
1
+ export type CardStyleType = 'stacked';
@@ -0,0 +1 @@
1
+ export type HoverEffectType = 'default' | 'rotate' | 'pop';
@@ -0,0 +1,5 @@
1
+ export * from './card-state.type';
2
+ export * from './card-style.type';
3
+ export * from './hover-effect.type';
4
+ export * from './ribbon-style.type';
5
+ export * from './status-position.type';
@@ -0,0 +1 @@
1
+ export type RibbonStyleType = 'default' | 'top' | 'bottom' | 'bookmark' | 'start';
@@ -0,0 +1 @@
1
+ export type StatusPositionType = 'top' | 'bottom' | 'start';
@@ -0,0 +1,32 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { UpdIconsModule } from '@updevs/icons';
4
+ import { UpdButtonModule } from '@updevs/components/button';
5
+
6
+ import { CardComponent } from './card.component';
7
+ import { CardHeaderDirective } from './directives/card-header.directive';
8
+ import { CardFooterDirective } from './directives/card-footer.directive';
9
+ import { CardImageDirective } from './directives/card-image.directive';
10
+ import { CardActionsDirective } from './directives/card-actions.directive';
11
+
12
+ @NgModule({
13
+ imports: [
14
+ CommonModule,
15
+ UpdIconsModule,
16
+ UpdButtonModule
17
+ ],
18
+ declarations: [
19
+ CardComponent,
20
+ CardHeaderDirective,
21
+ CardFooterDirective,
22
+ CardImageDirective,
23
+ CardActionsDirective
24
+ ],
25
+ exports: [
26
+ CardComponent,
27
+ CardHeaderDirective,
28
+ CardFooterDirective,
29
+ CardImageDirective
30
+ ]
31
+ })
32
+ export class UpdCardModule {}
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "../../../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../../../node_modules/@updevs/components/dropdown",
4
+ "lib": {
5
+ "entryFile": "src/index.ts"
6
+ }
7
+ }