vynil-ui 0.0.2 → 0.1.0-beta.1

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 (185) hide show
  1. package/README.md +24 -27
  2. package/ng-package.json +8 -0
  3. package/package.json +6 -50
  4. package/src/lib/components/basic/button/button.component.html +10 -0
  5. package/src/lib/components/basic/button/button.component.scss +28 -0
  6. package/src/lib/components/basic/button/button.component.ts +29 -0
  7. package/src/lib/components/basic/text/text.component.html +11 -0
  8. package/src/lib/components/basic/text/text.component.scss +41 -0
  9. package/src/lib/components/basic/text/text.component.ts +25 -0
  10. package/src/lib/components/images/icon/icon.component.html +5 -0
  11. package/src/lib/components/images/icon/icon.component.scss +43 -0
  12. package/src/lib/components/images/icon/icon.component.ts +41 -0
  13. package/src/lib/components/images/image/image.component.html +19 -0
  14. package/src/lib/components/images/image/image.component.scss +18 -0
  15. package/src/lib/components/images/image/image.component.ts +58 -0
  16. package/src/lib/components/inputs/color-input/color-input.component.html +11 -0
  17. package/src/lib/components/inputs/color-input/color-input.component.scss +30 -0
  18. package/src/lib/components/inputs/color-input/color-input.component.ts +64 -0
  19. package/src/lib/components/inputs/icon-input/icon-input.component.html +13 -0
  20. package/src/lib/components/inputs/icon-input/icon-input.component.scss +19 -0
  21. package/src/lib/components/inputs/icon-input/icon-input.component.ts +54 -0
  22. package/src/lib/components/inputs/image-array-input/image-array-input.component.html +33 -0
  23. package/src/lib/components/inputs/image-array-input/image-array-input.component.scss +54 -0
  24. package/src/lib/components/inputs/image-array-input/image-array-input.component.ts +69 -0
  25. package/src/lib/components/inputs/image-url-input/image-url-input.component.html +13 -0
  26. package/src/lib/components/inputs/image-url-input/image-url-input.component.scss +25 -0
  27. package/src/lib/components/inputs/image-url-input/image-url-input.component.ts +75 -0
  28. package/src/lib/components/inputs/input/input.component.html +7 -0
  29. package/src/lib/components/inputs/input/input.component.scss +60 -0
  30. package/src/lib/components/inputs/input/input.component.ts +100 -0
  31. package/src/lib/components/inputs/select-input/select-input.component.html +48 -0
  32. package/src/lib/components/inputs/select-input/select-input.component.scss +139 -0
  33. package/src/lib/components/inputs/select-input/select-input.component.ts +89 -0
  34. package/src/lib/components/inputs/toggle-input/toggle-input.component.html +3 -0
  35. package/src/lib/components/inputs/toggle-input/toggle-input.component.scss +41 -0
  36. package/src/lib/components/inputs/toggle-input/toggle-input.component.ts +73 -0
  37. package/src/lib/components/layout/card/card.component.html +10 -0
  38. package/src/lib/components/layout/card/card.component.scss +35 -0
  39. package/src/lib/components/layout/card/card.component.ts +21 -0
  40. package/src/lib/components/layout/circle/circle.component.html +8 -0
  41. package/src/lib/components/layout/circle/circle.component.scss +6 -0
  42. package/src/lib/components/layout/circle/circle.component.ts +17 -0
  43. package/src/lib/components/layout/header/header.component.html +9 -0
  44. package/src/lib/components/layout/header/header.component.scss +3 -0
  45. package/src/lib/components/layout/header/header.component.ts +15 -0
  46. package/src/lib/components/layout/page/page.component.html +8 -0
  47. package/src/lib/components/layout/page/page.component.scss +14 -0
  48. package/src/lib/components/layout/page/page.component.ts +25 -0
  49. package/src/lib/components/layout/page-view/page-view.component.html +19 -0
  50. package/src/lib/components/layout/page-view/page-view.component.scss +13 -0
  51. package/src/lib/components/layout/page-view/page-view.component.ts +36 -0
  52. package/src/lib/components/layout/sidebar/sidebar.component.html +9 -0
  53. package/src/lib/components/layout/sidebar/sidebar.component.scss +0 -0
  54. package/src/lib/components/layout/sidebar/sidebar.component.ts +24 -0
  55. package/src/lib/components/layout/view/view.component.html +9 -0
  56. package/src/lib/components/layout/view/view.component.scss +25 -0
  57. package/src/lib/components/layout/view/view.component.ts +77 -0
  58. package/src/lib/components/modals/dialog/dialog.component.html +11 -0
  59. package/src/lib/components/modals/dialog/dialog.component.scss +6 -0
  60. package/src/lib/components/modals/dialog/dialog.component.ts +51 -0
  61. package/src/lib/components/modals/message/message.component.html +10 -0
  62. package/src/lib/components/modals/message/message.component.scss +5 -0
  63. package/src/lib/components/modals/message/message.component.ts +40 -0
  64. package/src/lib/components/modals/modal/modal.component.html +7 -0
  65. package/src/lib/components/modals/modal/modal.component.scss +12 -0
  66. package/src/lib/components/modals/modal/modal.component.ts +25 -0
  67. package/src/lib/components/modify-options/modify-options.component.html +13 -0
  68. package/src/lib/components/modify-options/modify-options.component.scss +0 -0
  69. package/src/lib/components/modify-options/modify-options.component.spec.ts +24 -0
  70. package/src/lib/components/modify-options/modify-options.component.ts +43 -0
  71. package/src/lib/components/navigation/link/link.component.html +3 -0
  72. package/src/lib/components/navigation/link/link.component.scss +7 -0
  73. package/src/lib/components/navigation/link/link.component.ts +22 -0
  74. package/src/lib/components/navigation/navigation-group/navigation-group.component.html +13 -0
  75. package/src/lib/components/navigation/navigation-group/navigation-group.component.scss +34 -0
  76. package/src/lib/components/navigation/navigation-group/navigation-group.component.ts +20 -0
  77. package/src/lib/components/navigation/navigation-link/navigation-link.component.html +14 -0
  78. package/src/lib/components/navigation/navigation-link/navigation-link.component.scss +8 -0
  79. package/src/lib/components/navigation/navigation-link/navigation-link.component.ts +14 -0
  80. package/src/lib/components/selectors/color-selector/color-selector.component.html +10 -0
  81. package/src/lib/components/selectors/color-selector/color-selector.component.scss +10 -0
  82. package/src/lib/components/selectors/color-selector/color-selector.component.ts +25 -0
  83. package/src/lib/components/selectors/size-selector/size-selector.component.html +10 -0
  84. package/src/lib/components/selectors/size-selector/size-selector.component.scss +36 -0
  85. package/src/lib/components/selectors/size-selector/size-selector.component.ts +26 -0
  86. package/src/lib/components/selectors/tab-selector/tab-selector.component.html +14 -0
  87. package/src/lib/components/selectors/tab-selector/tab-selector.component.scss +44 -0
  88. package/src/lib/components/selectors/tab-selector/tab-selector.component.ts +32 -0
  89. package/src/lib/models/form.model.ts +13 -0
  90. package/src/lib/pipes/initials.pipe.ts +23 -0
  91. package/src/lib/services/download.service.ts +13 -0
  92. package/src/lib/services/routing.service.ts +53 -0
  93. package/src/lib/services/theme.service.ts +144 -0
  94. package/src/lib/services/utility.service.ts +80 -0
  95. package/src/lib/vynil-ui.module.ts +84 -0
  96. package/src/public-api.ts +9 -0
  97. package/styles/variables.scss +9 -0
  98. package/tsconfig.lib.json +14 -0
  99. package/tsconfig.lib.prod.json +10 -0
  100. package/tsconfig.spec.json +14 -0
  101. package/LICENSE +0 -21
  102. package/bundles/vynil-ui.umd.js +0 -1606
  103. package/bundles/vynil-ui.umd.js.map +0 -1
  104. package/bundles/vynil-ui.umd.min.js +0 -2
  105. package/bundles/vynil-ui.umd.min.js.map +0 -1
  106. package/components.module.d.ts +0 -2
  107. package/directives/numeric.directive.d.ts +0 -8
  108. package/editors/ace-editor/ace-editor.component.d.ts +0 -11
  109. package/editors/monaco-editor/monaco-editor-ts.provider.d.ts +0 -5
  110. package/editors/monaco-editor/monaco-editor.component.d.ts +0 -12
  111. package/esm2015/components.module.js +0 -104
  112. package/esm2015/directives/numeric.directive.js +0 -62
  113. package/esm2015/editors/ace-editor/ace-editor.component.js +0 -52
  114. package/esm2015/editors/monaco-editor/monaco-editor-ts.provider.js +0 -27
  115. package/esm2015/editors/monaco-editor/monaco-editor.component.js +0 -58
  116. package/esm2015/inputs/button-input/button-input.component.js +0 -41
  117. package/esm2015/inputs/check-input/check-input.component.js +0 -41
  118. package/esm2015/inputs/color-input/color-input.component.js +0 -31
  119. package/esm2015/inputs/date-input/date-input.component.js +0 -41
  120. package/esm2015/inputs/input/input.component.js +0 -88
  121. package/esm2015/inputs/numeric-input/numeric-input.component.js +0 -44
  122. package/esm2015/inputs/password-input/password-input.component.js +0 -38
  123. package/esm2015/inputs/radio-input/radio-input.component.js +0 -67
  124. package/esm2015/inputs/select-input/select-input.component.js +0 -79
  125. package/esm2015/inputs/text-input/text-input.component.js +0 -38
  126. package/esm2015/inputs/time-input/time-input.component.js +0 -31
  127. package/esm2015/inputs/toggle-input/toggle-input.component.js +0 -48
  128. package/esm2015/inputs/vector-input/vector-input.component.js +0 -47
  129. package/esm2015/panels/side-mode-switch/side-mode-switch.component.js +0 -73
  130. package/esm2015/panels/tab-controller/tab/tab.component.js +0 -143
  131. package/esm2015/panels/tab-controller/tab-controller.component.js +0 -99
  132. package/esm2015/panels/toggler/toggler.component.js +0 -48
  133. package/esm2015/public_api.js +0 -7
  134. package/esm2015/views/tree-node/tree-node.component.js +0 -154
  135. package/esm2015/vynil-ui.js +0 -32
  136. package/esm5/components.module.js +0 -108
  137. package/esm5/directives/numeric.directive.js +0 -65
  138. package/esm5/editors/ace-editor/ace-editor.component.js +0 -65
  139. package/esm5/editors/monaco-editor/monaco-editor-ts.provider.js +0 -39
  140. package/esm5/editors/monaco-editor/monaco-editor.component.js +0 -71
  141. package/esm5/inputs/button-input/button-input.component.js +0 -47
  142. package/esm5/inputs/check-input/check-input.component.js +0 -51
  143. package/esm5/inputs/color-input/color-input.component.js +0 -41
  144. package/esm5/inputs/date-input/date-input.component.js +0 -51
  145. package/esm5/inputs/input/input.component.js +0 -116
  146. package/esm5/inputs/numeric-input/numeric-input.component.js +0 -54
  147. package/esm5/inputs/password-input/password-input.component.js +0 -48
  148. package/esm5/inputs/radio-input/radio-input.component.js +0 -85
  149. package/esm5/inputs/select-input/select-input.component.js +0 -101
  150. package/esm5/inputs/text-input/text-input.component.js +0 -48
  151. package/esm5/inputs/time-input/time-input.component.js +0 -41
  152. package/esm5/inputs/toggle-input/toggle-input.component.js +0 -62
  153. package/esm5/inputs/vector-input/vector-input.component.js +0 -57
  154. package/esm5/panels/side-mode-switch/side-mode-switch.component.js +0 -104
  155. package/esm5/panels/tab-controller/tab/tab.component.js +0 -180
  156. package/esm5/panels/tab-controller/tab-controller.component.js +0 -123
  157. package/esm5/panels/toggler/toggler.component.js +0 -57
  158. package/esm5/public_api.js +0 -7
  159. package/esm5/views/tree-node/tree-node.component.js +0 -210
  160. package/esm5/vynil-ui.js +0 -32
  161. package/fesm2015/vynil-ui.js +0 -1222
  162. package/fesm2015/vynil-ui.js.map +0 -1
  163. package/fesm5/vynil-ui.js +0 -1558
  164. package/fesm5/vynil-ui.js.map +0 -1
  165. package/inputs/button-input/button-input.component.d.ts +0 -8
  166. package/inputs/check-input/check-input.component.d.ts +0 -8
  167. package/inputs/color-input/color-input.component.d.ts +0 -6
  168. package/inputs/date-input/date-input.component.d.ts +0 -8
  169. package/inputs/input/input.component.d.ts +0 -16
  170. package/inputs/numeric-input/numeric-input.component.d.ts +0 -9
  171. package/inputs/password-input/password-input.component.d.ts +0 -7
  172. package/inputs/radio-input/radio-input.component.d.ts +0 -10
  173. package/inputs/select-input/select-input.component.d.ts +0 -11
  174. package/inputs/text-input/text-input.component.d.ts +0 -7
  175. package/inputs/time-input/time-input.component.d.ts +0 -6
  176. package/inputs/toggle-input/toggle-input.component.d.ts +0 -9
  177. package/inputs/vector-input/vector-input.component.d.ts +0 -10
  178. package/panels/side-mode-switch/side-mode-switch.component.d.ts +0 -14
  179. package/panels/tab-controller/tab/tab.component.d.ts +0 -21
  180. package/panels/tab-controller/tab-controller.component.d.ts +0 -14
  181. package/panels/toggler/toggler.component.d.ts +0 -9
  182. package/public_api.d.ts +0 -1
  183. package/views/tree-node/tree-node.component.d.ts +0 -25
  184. package/vynil-ui.d.ts +0 -26
  185. package/vynil-ui.metadata.json +0 -1
package/README.md CHANGED
@@ -1,27 +1,24 @@
1
- # VynilUi
2
-
3
- This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.0.3.
4
-
5
- ## Development server
6
-
7
- Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8
-
9
- ## Code scaffolding
10
-
11
- Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12
-
13
- ## Build
14
-
15
- Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16
-
17
- ## Running unit tests
18
-
19
- Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20
-
21
- ## Running end-to-end tests
22
-
23
- Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24
-
25
- ## Further help
26
-
27
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
1
+ # VynilUi
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project vynil-ui` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project vynil-ui`.
8
+ > Note: Don't forget to add `--project vynil-ui` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build vynil-ui` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build vynil-ui`, go to the dist folder `cd dist/vynil-ui` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test vynil-ui` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
+ "dest": "../../dist/vynil-ui",
4
+ "assets": ["./styles/variables.scss"],
5
+ "lib": {
6
+ "entryFile": "src/public-api.ts"
7
+ }
8
+ }
package/package.json CHANGED
@@ -1,56 +1,12 @@
1
1
  {
2
2
  "name": "vynil-ui",
3
- "version": "0.0.2",
3
+ "version": "0.1.0-beta.1",
4
4
  "peerDependencies": {
5
- "@angular/animations": "^6.0.2",
6
- "@angular/cdk": "^6.0.2",
7
- "@angular/common": "^6.0.2",
8
- "@angular/compiler": "^6.0.2",
9
- "@angular/core": "^6.0.2",
10
- "@angular/forms": "^6.0.2",
11
- "@angular/http": "^6.0.2",
12
- "@angular/material": "^6.0.2",
13
- "@angular/platform-browser": "^6.0.2",
14
- "@angular/platform-browser-dynamic": "^6.0.2",
15
- "@angular/router": "^6.0.2",
16
- "@ng-bootstrap/ng-bootstrap": "^2.0.0",
17
- "ace-builds": "^1.3.3",
18
- "angular-font-awesome": "^3.1.2",
19
- "core-js": "^2.5.4",
20
- "font-awesome": "^4.7.0",
21
- "monaco-editor": "^0.13.1",
22
- "ng2-ace-editor": "^0.3.7",
23
- "ngx-monaco": "^0.8.0",
24
- "rxjs": "^6.0.0",
25
- "zone.js": "^0.8.26"
5
+ "@angular/common": "^21.1.4",
6
+ "@angular/core": "^21.1.4"
26
7
  },
27
- "devDependencies": {
28
- "@angular-devkit/build-angular": "~0.6.3",
29
- "@angular/cli": "~6.0.3",
30
- "@angular/compiler-cli": "^6.0.2",
31
- "@angular/language-service": "^6.0.2",
32
- "@types/node": "~8.9.4",
33
- "codelyzer": "~4.2.1",
34
- "ng-packagr": "^4.4.5",
35
- "node-sass": "^4.9.0",
36
- "protractor": "~5.3.0",
37
- "raw-loader": "^0.5.1",
38
- "sass-loader": "^7.0.1",
39
- "ts-node": "~5.0.1",
40
- "tslint": "~5.9.1",
41
- "typescript": "~2.7.2"
42
- },
43
- "main": "bundles/vynil-ui.umd.js",
44
- "module": "fesm5/vynil-ui.js",
45
- "es2015": "fesm2015/vynil-ui.js",
46
- "esm5": "esm5/vynil-ui.js",
47
- "esm2015": "esm2015/vynil-ui.js",
48
- "fesm5": "fesm5/vynil-ui.js",
49
- "fesm2015": "fesm2015/vynil-ui.js",
50
- "typings": "vynil-ui.d.ts",
51
- "metadata": "vynil-ui.metadata.json",
52
- "sideEffects": false,
53
8
  "dependencies": {
54
- "tslib": "^1.9.0"
55
- }
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "sideEffects": false
56
12
  }
@@ -0,0 +1,10 @@
1
+ <div
2
+ class="button"
3
+ [ngClass]="{
4
+ 'lean': lean,
5
+ 'disabled': disabled,
6
+ 'centered': centered
7
+ }"
8
+ (click)="onClick()">
9
+ <ng-content></ng-content>
10
+ </div>
@@ -0,0 +1,28 @@
1
+ .button {
2
+ cursor: pointer;
3
+ filter: brightness(90%);
4
+ display: flex;
5
+ align-items: center;
6
+ color: var(--vui-color-text);
7
+ font-size: var(--vui-variable-font-size-m);
8
+ background-color: var(--vui-color-primary);
9
+ border-radius: var(--vui-variable-radius-s);
10
+ padding: var(--vui-variable-padding-s) var(--vui-variable-padding);
11
+
12
+
13
+ &.lean {
14
+ padding: var(--vui-variable-padding-xs) var(--vui-variable-padding-s);
15
+ }
16
+
17
+ &.disabled {
18
+ opacity: 0.5;
19
+ }
20
+
21
+ &.centered {
22
+ justify-content: center;
23
+ }
24
+
25
+ &:not(.disabled):hover {
26
+ filter: brightness(105%);
27
+ }
28
+ }
@@ -0,0 +1,29 @@
1
+ import {
2
+ Input,
3
+ Output,
4
+ Component,
5
+ EventEmitter,
6
+ } from '@angular/core';
7
+
8
+ @Component({
9
+ selector: 'vui-button',
10
+ templateUrl: './button.component.html',
11
+ styleUrls: ['./button.component.scss'],
12
+ standalone: false
13
+ })
14
+ export class ButtonComponent {
15
+ @Input() lean?: boolean;
16
+ @Input() centered?: boolean;
17
+ @Input() disabled?: boolean;
18
+ @Output() clicked: EventEmitter<void>;
19
+
20
+ public constructor() {
21
+ this.clicked = new EventEmitter<void>();
22
+ }
23
+
24
+ public onClick(): void {
25
+ if (!this.disabled) {
26
+ this.clicked.emit();
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,11 @@
1
+ <div
2
+ class="text"
3
+ [ngClass]="size || ''"
4
+ [ngStyle]="{
5
+ 'color': color || 'auto',
6
+ 'padding': padding || '0',
7
+ 'text-align': align || 'left',
8
+ 'font-weight': weight || '400'
9
+ }">
10
+ <ng-content></ng-content>
11
+ </div>
@@ -0,0 +1,41 @@
1
+ .text {
2
+ width: auto;
3
+ color: var(--vui-color-text);
4
+ font-size: var(--vui-variable-font-size-m);
5
+ line-height: var(--vui-variable-font-size-m);
6
+
7
+ &.xsmall, &.xs {
8
+ font-size: var(--vui-variable-font-size-xs);
9
+ line-height: var(--vui-variable-font-size-xs);
10
+ }
11
+
12
+ &.small, &.s {
13
+ font-size: var(--vui-variable-font-size-s);
14
+ line-height: var(--vui-variable-font-size-s);
15
+ }
16
+
17
+ &.large, &.l {
18
+ font-size: var(--vui-variable-font-size-l);
19
+ line-height: var(--vui-variable-font-size-l);
20
+ }
21
+
22
+ &.xlarge, &.xl {
23
+ font-size: var(--vui-variable-font-size-xl);
24
+ line-height: var(--vui-variable-font-size-xl);
25
+ }
26
+
27
+ &.header3, &.h3, &.header, &.h {
28
+ font-size: var(--vui-variable-font-size-h3);
29
+ line-height: var(--vui-variable-font-size-h3);
30
+ }
31
+
32
+ &.header2, &.h2 {
33
+ font-size: var(--vui-variable-font-size-h2);
34
+ line-height: var(--vui-variable-font-size-h2);
35
+ }
36
+
37
+ &.header1, &.h1 {
38
+ font-size: var(--vui-variable-font-size-h1);
39
+ line-height: var(--vui-variable-font-size-h1);
40
+ }
41
+ }
@@ -0,0 +1,25 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ export enum VynilUITextSize {
4
+ ExtraSmall = 'xsmall',
5
+ Small = 'small',
6
+ Medium = 'medium',
7
+ Large = 'large',
8
+ Header3 = 'header3',
9
+ Header2 = 'header2',
10
+ Header1 = 'header1',
11
+ }
12
+
13
+ @Component({
14
+ selector: 'vui-text',
15
+ templateUrl: './text.component.html',
16
+ styleUrls: ['./text.component.scss'],
17
+ standalone: false
18
+ })
19
+ export class TextComponent {
20
+ @Input() size?: string;
21
+ @Input() color?: string;
22
+ @Input() align?: string;
23
+ @Input() weight?: string;
24
+ @Input() padding?: string;
25
+ }
@@ -0,0 +1,5 @@
1
+ <div
2
+ class="icon"
3
+ [ngClass]="size + ' ' + (actionable ? 'actionable' : '') + ' ' + (disabled ? 'disabled' : '')"
4
+ [ngStyle]="styleObject">
5
+ </div>
@@ -0,0 +1,43 @@
1
+ :host {
2
+ display: flex;
3
+ align-items: center;
4
+ }
5
+
6
+ .icon {
7
+ background-color: var(--vui-color-text);
8
+ width: var(--vui-variable-icon-size-m);
9
+ height: var(--vui-variable-icon-size-m);
10
+
11
+ &.small, &.s {
12
+ width: var(--vui-variable-icon-size-s);
13
+ height: var(--vui-variable-icon-size-s);
14
+ }
15
+
16
+ &.button, &.b {
17
+ width: var(--vui-variable-icon-size-button);
18
+ height: var(--vui-variable-icon-size-button);
19
+ }
20
+
21
+ &.large, &.l {
22
+ width: var(--vui-variable-icon-size-l);
23
+ height: var(--vui-variable-icon-size-l);
24
+ }
25
+
26
+ &.extra-large, &.xl {
27
+ width: var(--vui-variable-icon-size-xl);
28
+ height: var(--vui-variable-icon-size-xl);
29
+ }
30
+
31
+ &.actionable {
32
+ opacity: 0.85;
33
+ cursor: pointer;
34
+
35
+ &:hover:not(.disabled) {
36
+ opacity: 1;
37
+ }
38
+ }
39
+
40
+ &.disabled {
41
+ opacity: 0.3;
42
+ }
43
+ }
@@ -0,0 +1,41 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ export enum VynilUIIconSize {
4
+ Small = 'small',
5
+ Button = 'button',
6
+ Medium = 'medium',
7
+ Large = 'large',
8
+ }
9
+
10
+ @Component({
11
+ selector: 'vui-icon',
12
+ templateUrl: './icon.component.html',
13
+ styleUrls: ['./icon.component.scss'],
14
+ standalone: false
15
+ })
16
+ export class IconComponent {
17
+ @Input() size: string;
18
+ @Input() icon?: string;
19
+ @Input() color?: string;
20
+ @Input() rotation?: number;
21
+ @Input() disabled?: boolean;
22
+ @Input() actionable?: boolean;
23
+ public IconSizeEnum = VynilUIIconSize;
24
+
25
+ constructor() {
26
+ this.size = VynilUIIconSize.Medium;
27
+ }
28
+
29
+ public get styleObject(): { [key: string]: string } {
30
+ let styleObject: { [key: string]: string } = {};
31
+ if (this.color) {
32
+ styleObject['backgroundColor'] = this.color;
33
+ }
34
+ if (this.rotation) {
35
+ styleObject['transform'] = 'rotate(' + this.rotation + 'deg)';
36
+ }
37
+ styleObject['mask'] = 'url(./assets/icons/' + (this.icon || 'cog') + '.svg) no-repeat center',
38
+ styleObject['-webkit-mask'] = styleObject['mask'];
39
+ return styleObject;
40
+ }
41
+ }
@@ -0,0 +1,19 @@
1
+ <div
2
+ *ngIf="useBackgroundImage"
3
+ class="image-wrapper"
4
+ [ngClass]="{'circle': circle}"
5
+ [ngStyle]="styles">
6
+ </div>
7
+ <img
8
+ *ngIf="url && !useBackgroundImage"
9
+ [src]="sanitizedUrl"
10
+ class="image-wrapper"
11
+ [ngClass]="{'circle': circle}"
12
+ [ngStyle]="styles"
13
+ >
14
+ <div
15
+ *ngIf="!url && !useBackgroundImage"
16
+ class="image-wrapper"
17
+ [ngClass]="{'circle': circle}"
18
+ [ngStyle]="styles"
19
+ >
@@ -0,0 +1,18 @@
1
+ ::host {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+
6
+ .image-wrapper {
7
+ margin: 0;
8
+ padding: 0;
9
+ display: block;
10
+ overflow: hidden;
11
+ background-position: center;
12
+ background-repeat: no-repeat;
13
+ background-color: var(--vui-color-background-darker);
14
+
15
+ &.circle {
16
+ border-radius: 50%;
17
+ }
18
+ }
@@ -0,0 +1,58 @@
1
+ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
2
+ import { Component, Input, SecurityContext } from '@angular/core';
3
+
4
+ const DEFAULT_DIMENSION = 'auto';
5
+
6
+ interface IStyleObject {
7
+ [key: string]: string | null
8
+ }
9
+
10
+ @Component({
11
+ selector: 'vui-image',
12
+ templateUrl: './image.component.html',
13
+ styleUrls: ['./image.component.scss'],
14
+ standalone: false
15
+ })
16
+ export class ImageComponent {
17
+ @Input() url?: string;
18
+ @Input() width?: string;
19
+ @Input() height?: string;
20
+ @Input() circle?: boolean;
21
+ @Input() border?: string;
22
+ @Input() borderRadius?: string;
23
+ @Input() backgroundSize?: string;
24
+ @Input() useBackgroundImage?: boolean;
25
+
26
+ public get sanitizedUrl(): SafeUrl | undefined {
27
+ return this.url
28
+ && this.domSanitizer.bypassSecurityTrustUrl(this.url)
29
+ || undefined;
30
+ }
31
+
32
+ public get styles(): IStyleObject {
33
+ let styles: IStyleObject = {
34
+ 'width': this.width || DEFAULT_DIMENSION,
35
+ 'height': this.height || DEFAULT_DIMENSION,
36
+ 'min-width': this.width || DEFAULT_DIMENSION,
37
+ 'min-height': this.height || DEFAULT_DIMENSION,
38
+ };
39
+ if (this.useBackgroundImage && this.url) {
40
+ styles = {
41
+ ...styles,
42
+ 'background-image': this.domSanitizer.sanitize(SecurityContext.STYLE, 'url(' + this.url + ')'),
43
+ 'background-size': this.backgroundSize || 'cover'
44
+ }
45
+ }
46
+ if (this.border !== undefined) {
47
+ styles['border'] = this.border;
48
+ }
49
+ if (this.borderRadius !== undefined) {
50
+ styles['border-radius'] = this.borderRadius;
51
+ }
52
+ return styles;
53
+ }
54
+
55
+ public constructor(
56
+ private domSanitizer: DomSanitizer,
57
+ ) {}
58
+ }
@@ -0,0 +1,11 @@
1
+ <vui-view [relative]="true">
2
+ <div (click)="toggleSelectorVisible(true)" [ngClass]="{'small': small}" [ngStyle]="{'backgroundColor': colorValue}" class="color"></div>
3
+ <vui-modal [visible]="colorSelectorVisible">
4
+ <div class="selector-wrapper">
5
+ <vui-color-selector
6
+ [selectedColor]="colorValue"
7
+ (selected)="onColorSelect($event)">
8
+ </vui-color-selector>
9
+ </div>
10
+ </vui-modal>
11
+ </vui-view>
@@ -0,0 +1,30 @@
1
+ :host {
2
+ ::ng-deep {
3
+ .view {
4
+ overflow: visible !important;
5
+ }
6
+ }
7
+ }
8
+
9
+ .color {
10
+ cursor: pointer;
11
+ min-width: 30px;
12
+ min-height: 30px;
13
+ border-radius: 50%;
14
+ border: var(--vui-variable-border) solid var(--vui-color-background-lighter);
15
+
16
+ &.small {
17
+ min-width: 18px;
18
+ min-height: 18px;
19
+ }
20
+
21
+ &:hover {
22
+ border: var(--vui-variable-border) solid var(--vui-color-primary);
23
+ }
24
+ }
25
+
26
+ .selector-wrapper {
27
+ border-radius: 50px;
28
+ background-color: var(--vui-color-background);
29
+ padding: var(--vui-variable-padding-small);
30
+ }
@@ -0,0 +1,64 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ import { Component, Input } from '@angular/core';
3
+ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
4
+
5
+ const DEFAULT_VALUE = '#0096FF';
6
+
7
+ @Component({
8
+ selector: 'vui-color-input',
9
+ templateUrl: './color-input.component.html',
10
+ styleUrls: ['./color-input.component.scss'],
11
+ providers: [
12
+ {
13
+ provide: NG_VALUE_ACCESSOR,
14
+ useExisting: ColorInputComponent,
15
+ multi: true,
16
+ },
17
+ ],
18
+ standalone: false
19
+ })
20
+ export class ColorInputComponent implements ControlValueAccessor {
21
+ @Input() small?: boolean;
22
+
23
+ public colorValue: string;
24
+ public colorSelectorVisible: boolean;
25
+
26
+ public onTouch: (value: string) => void;
27
+ public onChange: (value: string) => void;
28
+
29
+ public set value(value: string){
30
+ if (value !== this.colorValue) {
31
+ this.colorValue = value;
32
+ }
33
+ this.onTouch(value);
34
+ this.onChange(value);
35
+ }
36
+
37
+ public constructor() {
38
+ this.colorValue = DEFAULT_VALUE;
39
+ this.colorSelectorVisible = false;
40
+ this.onTouch = () => {};
41
+ this.onChange = () => {};
42
+ }
43
+
44
+ public onColorSelect(value: string): void {
45
+ this.writeValue(value);
46
+ this.toggleSelectorVisible(false);
47
+ }
48
+
49
+ public writeValue(value: string): void {
50
+ this.value = value;
51
+ }
52
+
53
+ public registerOnChange(onChange: (value: string) => void): void {
54
+ this.onChange = onChange;
55
+ }
56
+
57
+ public registerOnTouched(onTouched: (value: string) => void): void {
58
+ this.onTouch = onTouched;
59
+ }
60
+
61
+ public toggleSelectorVisible(value: boolean): void {
62
+ this.colorSelectorVisible = value;
63
+ }
64
+ }
@@ -0,0 +1,13 @@
1
+ <vui-view
2
+ class="icon-input"
3
+ flexDirection="row"
4
+ width="100%"
5
+ [relative]="true"
6
+ justifyContent="stretch">
7
+ @if (icon) {
8
+ <vui-view class="icon" alignItems="center" justifyContent="center" height="2rem" width="2rem" padding="0.1rem 0 0 0">
9
+ <vui-icon size="button" [icon]="icon"></vui-icon>
10
+ </vui-view>
11
+ }
12
+ <vui-input class="input" padding="0.5rem 0.5rem 0.5rem 1.75rem" [formControl]="control" type="text"></vui-input>
13
+ </vui-view>
@@ -0,0 +1,19 @@
1
+ :host {
2
+ flex: 1;
3
+ }
4
+
5
+ .icon-input {
6
+ .icon {
7
+ top: 0;
8
+ left: 0;
9
+ position: absolute;
10
+ }
11
+
12
+ .input {
13
+ flex: 1;
14
+
15
+ ::ng-deep input {
16
+ flex: 1;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,54 @@
1
+ /* eslint-disable @typescript-eslint/no-empty-function */
2
+ import { Component, Input } from '@angular/core';
3
+ import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';
4
+
5
+ @Component({
6
+ selector: 'vui-icon-input',
7
+ templateUrl: './icon-input.component.html',
8
+ styleUrls: ['./icon-input.component.scss'],
9
+ providers: [
10
+ {
11
+ provide: NG_VALUE_ACCESSOR,
12
+ useExisting: IconInputComponent,
13
+ multi: true,
14
+ },
15
+ ],
16
+ standalone: false
17
+ })
18
+ export class IconInputComponent implements ControlValueAccessor {
19
+ @Input() icon?: string;
20
+
21
+ public control: FormControl<string>;
22
+
23
+ public onTouch: (value: string) => void;
24
+ public onChange: (value: string) => void;
25
+
26
+ set value(value: string){
27
+ if (value !== this.control.value) {
28
+ this.control.setValue(value);
29
+ }
30
+ this.onChange(value);
31
+ this.onTouch(value);
32
+ }
33
+
34
+ public constructor() {
35
+ this.control = new FormControl<string>('', { nonNullable: true });
36
+ this.control.valueChanges.subscribe((value) => {
37
+ this.writeValue(value);
38
+ });
39
+ this.onTouch = () => {};
40
+ this.onChange = () => {};
41
+ }
42
+
43
+ public writeValue(value: string): void {
44
+ this.value = value;
45
+ }
46
+
47
+ public registerOnChange(onChange: (value: string) => void): void {
48
+ this.onChange = onChange;
49
+ }
50
+
51
+ public registerOnTouched(onTouched: (value: string) => void): void {
52
+ this.onTouch = onTouched;
53
+ }
54
+ }