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.
- package/README.md +24 -27
- package/ng-package.json +8 -0
- package/package.json +6 -50
- package/src/lib/components/basic/button/button.component.html +10 -0
- package/src/lib/components/basic/button/button.component.scss +28 -0
- package/src/lib/components/basic/button/button.component.ts +29 -0
- package/src/lib/components/basic/text/text.component.html +11 -0
- package/src/lib/components/basic/text/text.component.scss +41 -0
- package/src/lib/components/basic/text/text.component.ts +25 -0
- package/src/lib/components/images/icon/icon.component.html +5 -0
- package/src/lib/components/images/icon/icon.component.scss +43 -0
- package/src/lib/components/images/icon/icon.component.ts +41 -0
- package/src/lib/components/images/image/image.component.html +19 -0
- package/src/lib/components/images/image/image.component.scss +18 -0
- package/src/lib/components/images/image/image.component.ts +58 -0
- package/src/lib/components/inputs/color-input/color-input.component.html +11 -0
- package/src/lib/components/inputs/color-input/color-input.component.scss +30 -0
- package/src/lib/components/inputs/color-input/color-input.component.ts +64 -0
- package/src/lib/components/inputs/icon-input/icon-input.component.html +13 -0
- package/src/lib/components/inputs/icon-input/icon-input.component.scss +19 -0
- package/src/lib/components/inputs/icon-input/icon-input.component.ts +54 -0
- package/src/lib/components/inputs/image-array-input/image-array-input.component.html +33 -0
- package/src/lib/components/inputs/image-array-input/image-array-input.component.scss +54 -0
- package/src/lib/components/inputs/image-array-input/image-array-input.component.ts +69 -0
- package/src/lib/components/inputs/image-url-input/image-url-input.component.html +13 -0
- package/src/lib/components/inputs/image-url-input/image-url-input.component.scss +25 -0
- package/src/lib/components/inputs/image-url-input/image-url-input.component.ts +75 -0
- package/src/lib/components/inputs/input/input.component.html +7 -0
- package/src/lib/components/inputs/input/input.component.scss +60 -0
- package/src/lib/components/inputs/input/input.component.ts +100 -0
- package/src/lib/components/inputs/select-input/select-input.component.html +48 -0
- package/src/lib/components/inputs/select-input/select-input.component.scss +139 -0
- package/src/lib/components/inputs/select-input/select-input.component.ts +89 -0
- package/src/lib/components/inputs/toggle-input/toggle-input.component.html +3 -0
- package/src/lib/components/inputs/toggle-input/toggle-input.component.scss +41 -0
- package/src/lib/components/inputs/toggle-input/toggle-input.component.ts +73 -0
- package/src/lib/components/layout/card/card.component.html +10 -0
- package/src/lib/components/layout/card/card.component.scss +35 -0
- package/src/lib/components/layout/card/card.component.ts +21 -0
- package/src/lib/components/layout/circle/circle.component.html +8 -0
- package/src/lib/components/layout/circle/circle.component.scss +6 -0
- package/src/lib/components/layout/circle/circle.component.ts +17 -0
- package/src/lib/components/layout/header/header.component.html +9 -0
- package/src/lib/components/layout/header/header.component.scss +3 -0
- package/src/lib/components/layout/header/header.component.ts +15 -0
- package/src/lib/components/layout/page/page.component.html +8 -0
- package/src/lib/components/layout/page/page.component.scss +14 -0
- package/src/lib/components/layout/page/page.component.ts +25 -0
- package/src/lib/components/layout/page-view/page-view.component.html +19 -0
- package/src/lib/components/layout/page-view/page-view.component.scss +13 -0
- package/src/lib/components/layout/page-view/page-view.component.ts +36 -0
- package/src/lib/components/layout/sidebar/sidebar.component.html +9 -0
- package/src/lib/components/layout/sidebar/sidebar.component.scss +0 -0
- package/src/lib/components/layout/sidebar/sidebar.component.ts +24 -0
- package/src/lib/components/layout/view/view.component.html +9 -0
- package/src/lib/components/layout/view/view.component.scss +25 -0
- package/src/lib/components/layout/view/view.component.ts +77 -0
- package/src/lib/components/modals/dialog/dialog.component.html +11 -0
- package/src/lib/components/modals/dialog/dialog.component.scss +6 -0
- package/src/lib/components/modals/dialog/dialog.component.ts +51 -0
- package/src/lib/components/modals/message/message.component.html +10 -0
- package/src/lib/components/modals/message/message.component.scss +5 -0
- package/src/lib/components/modals/message/message.component.ts +40 -0
- package/src/lib/components/modals/modal/modal.component.html +7 -0
- package/src/lib/components/modals/modal/modal.component.scss +12 -0
- package/src/lib/components/modals/modal/modal.component.ts +25 -0
- package/src/lib/components/modify-options/modify-options.component.html +13 -0
- package/src/lib/components/modify-options/modify-options.component.scss +0 -0
- package/src/lib/components/modify-options/modify-options.component.spec.ts +24 -0
- package/src/lib/components/modify-options/modify-options.component.ts +43 -0
- package/src/lib/components/navigation/link/link.component.html +3 -0
- package/src/lib/components/navigation/link/link.component.scss +7 -0
- package/src/lib/components/navigation/link/link.component.ts +22 -0
- package/src/lib/components/navigation/navigation-group/navigation-group.component.html +13 -0
- package/src/lib/components/navigation/navigation-group/navigation-group.component.scss +34 -0
- package/src/lib/components/navigation/navigation-group/navigation-group.component.ts +20 -0
- package/src/lib/components/navigation/navigation-link/navigation-link.component.html +14 -0
- package/src/lib/components/navigation/navigation-link/navigation-link.component.scss +8 -0
- package/src/lib/components/navigation/navigation-link/navigation-link.component.ts +14 -0
- package/src/lib/components/selectors/color-selector/color-selector.component.html +10 -0
- package/src/lib/components/selectors/color-selector/color-selector.component.scss +10 -0
- package/src/lib/components/selectors/color-selector/color-selector.component.ts +25 -0
- package/src/lib/components/selectors/size-selector/size-selector.component.html +10 -0
- package/src/lib/components/selectors/size-selector/size-selector.component.scss +36 -0
- package/src/lib/components/selectors/size-selector/size-selector.component.ts +26 -0
- package/src/lib/components/selectors/tab-selector/tab-selector.component.html +14 -0
- package/src/lib/components/selectors/tab-selector/tab-selector.component.scss +44 -0
- package/src/lib/components/selectors/tab-selector/tab-selector.component.ts +32 -0
- package/src/lib/models/form.model.ts +13 -0
- package/src/lib/pipes/initials.pipe.ts +23 -0
- package/src/lib/services/download.service.ts +13 -0
- package/src/lib/services/routing.service.ts +53 -0
- package/src/lib/services/theme.service.ts +144 -0
- package/src/lib/services/utility.service.ts +80 -0
- package/src/lib/vynil-ui.module.ts +84 -0
- package/src/public-api.ts +9 -0
- package/styles/variables.scss +9 -0
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/LICENSE +0 -21
- package/bundles/vynil-ui.umd.js +0 -1606
- package/bundles/vynil-ui.umd.js.map +0 -1
- package/bundles/vynil-ui.umd.min.js +0 -2
- package/bundles/vynil-ui.umd.min.js.map +0 -1
- package/components.module.d.ts +0 -2
- package/directives/numeric.directive.d.ts +0 -8
- package/editors/ace-editor/ace-editor.component.d.ts +0 -11
- package/editors/monaco-editor/monaco-editor-ts.provider.d.ts +0 -5
- package/editors/monaco-editor/monaco-editor.component.d.ts +0 -12
- package/esm2015/components.module.js +0 -104
- package/esm2015/directives/numeric.directive.js +0 -62
- package/esm2015/editors/ace-editor/ace-editor.component.js +0 -52
- package/esm2015/editors/monaco-editor/monaco-editor-ts.provider.js +0 -27
- package/esm2015/editors/monaco-editor/monaco-editor.component.js +0 -58
- package/esm2015/inputs/button-input/button-input.component.js +0 -41
- package/esm2015/inputs/check-input/check-input.component.js +0 -41
- package/esm2015/inputs/color-input/color-input.component.js +0 -31
- package/esm2015/inputs/date-input/date-input.component.js +0 -41
- package/esm2015/inputs/input/input.component.js +0 -88
- package/esm2015/inputs/numeric-input/numeric-input.component.js +0 -44
- package/esm2015/inputs/password-input/password-input.component.js +0 -38
- package/esm2015/inputs/radio-input/radio-input.component.js +0 -67
- package/esm2015/inputs/select-input/select-input.component.js +0 -79
- package/esm2015/inputs/text-input/text-input.component.js +0 -38
- package/esm2015/inputs/time-input/time-input.component.js +0 -31
- package/esm2015/inputs/toggle-input/toggle-input.component.js +0 -48
- package/esm2015/inputs/vector-input/vector-input.component.js +0 -47
- package/esm2015/panels/side-mode-switch/side-mode-switch.component.js +0 -73
- package/esm2015/panels/tab-controller/tab/tab.component.js +0 -143
- package/esm2015/panels/tab-controller/tab-controller.component.js +0 -99
- package/esm2015/panels/toggler/toggler.component.js +0 -48
- package/esm2015/public_api.js +0 -7
- package/esm2015/views/tree-node/tree-node.component.js +0 -154
- package/esm2015/vynil-ui.js +0 -32
- package/esm5/components.module.js +0 -108
- package/esm5/directives/numeric.directive.js +0 -65
- package/esm5/editors/ace-editor/ace-editor.component.js +0 -65
- package/esm5/editors/monaco-editor/monaco-editor-ts.provider.js +0 -39
- package/esm5/editors/monaco-editor/monaco-editor.component.js +0 -71
- package/esm5/inputs/button-input/button-input.component.js +0 -47
- package/esm5/inputs/check-input/check-input.component.js +0 -51
- package/esm5/inputs/color-input/color-input.component.js +0 -41
- package/esm5/inputs/date-input/date-input.component.js +0 -51
- package/esm5/inputs/input/input.component.js +0 -116
- package/esm5/inputs/numeric-input/numeric-input.component.js +0 -54
- package/esm5/inputs/password-input/password-input.component.js +0 -48
- package/esm5/inputs/radio-input/radio-input.component.js +0 -85
- package/esm5/inputs/select-input/select-input.component.js +0 -101
- package/esm5/inputs/text-input/text-input.component.js +0 -48
- package/esm5/inputs/time-input/time-input.component.js +0 -41
- package/esm5/inputs/toggle-input/toggle-input.component.js +0 -62
- package/esm5/inputs/vector-input/vector-input.component.js +0 -57
- package/esm5/panels/side-mode-switch/side-mode-switch.component.js +0 -104
- package/esm5/panels/tab-controller/tab/tab.component.js +0 -180
- package/esm5/panels/tab-controller/tab-controller.component.js +0 -123
- package/esm5/panels/toggler/toggler.component.js +0 -57
- package/esm5/public_api.js +0 -7
- package/esm5/views/tree-node/tree-node.component.js +0 -210
- package/esm5/vynil-ui.js +0 -32
- package/fesm2015/vynil-ui.js +0 -1222
- package/fesm2015/vynil-ui.js.map +0 -1
- package/fesm5/vynil-ui.js +0 -1558
- package/fesm5/vynil-ui.js.map +0 -1
- package/inputs/button-input/button-input.component.d.ts +0 -8
- package/inputs/check-input/check-input.component.d.ts +0 -8
- package/inputs/color-input/color-input.component.d.ts +0 -6
- package/inputs/date-input/date-input.component.d.ts +0 -8
- package/inputs/input/input.component.d.ts +0 -16
- package/inputs/numeric-input/numeric-input.component.d.ts +0 -9
- package/inputs/password-input/password-input.component.d.ts +0 -7
- package/inputs/radio-input/radio-input.component.d.ts +0 -10
- package/inputs/select-input/select-input.component.d.ts +0 -11
- package/inputs/text-input/text-input.component.d.ts +0 -7
- package/inputs/time-input/time-input.component.d.ts +0 -6
- package/inputs/toggle-input/toggle-input.component.d.ts +0 -9
- package/inputs/vector-input/vector-input.component.d.ts +0 -10
- package/panels/side-mode-switch/side-mode-switch.component.d.ts +0 -14
- package/panels/tab-controller/tab/tab.component.d.ts +0 -21
- package/panels/tab-controller/tab-controller.component.d.ts +0 -14
- package/panels/toggler/toggler.component.d.ts +0 -9
- package/public_api.d.ts +0 -1
- package/views/tree-node/tree-node.component.d.ts +0 -25
- package/vynil-ui.d.ts +0 -26
- package/vynil-ui.metadata.json +0 -1
package/README.md
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
# VynilUi
|
|
2
|
-
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Run `ng
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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.
|
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,56 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vynil-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/
|
|
6
|
-
"@angular/
|
|
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": "^
|
|
55
|
-
}
|
|
9
|
+
"tslib": "^2.3.0"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false
|
|
56
12
|
}
|
|
@@ -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,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,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,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
|
+
}
|