├── .eslintignore ├── .eslintrc.json ├── .gitignore ├── .npmrc ├── .nx └── cache │ ├── 18.3.3-nx.darwin-arm64.node │ └── d │ └── daemon.log ├── LICENSE ├── README.md ├── apps ├── demo │ ├── .eslintrc.json │ ├── project.json │ ├── src │ │ ├── app │ │ │ ├── app.component.html │ │ │ └── app.component.ts │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ └── styles.scss │ ├── tsconfig.app.json │ ├── tsconfig.editor.json │ ├── tsconfig.json │ └── tsconfig.spec.json └── git-page │ ├── .eslintrc.json │ ├── project.json │ ├── src │ ├── app │ │ ├── app-routes-path.ts │ │ ├── app.component.html │ │ ├── app.component.scss │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── app.routes.ts │ │ ├── components │ │ │ ├── api-checkbox-will-change │ │ │ │ ├── api-checkbox-will-change.component.html │ │ │ │ └── api-checkbox-will-change.component.ts │ │ │ ├── api-checkbox │ │ │ │ ├── api-checkbox.component.html │ │ │ │ └── api-checkbox.component.ts │ │ │ ├── api-enums │ │ │ │ ├── api-enums.component.html │ │ │ │ └── api-enums.component.ts │ │ │ ├── api-hover-will-change │ │ │ │ ├── api-hover-will-change.component.html │ │ │ │ └── api-hover-will-change.component.ts │ │ │ ├── api-hover │ │ │ │ ├── api-hover.component.html │ │ │ │ └── api-hover.component.ts │ │ │ ├── api-icon │ │ │ │ ├── api-icon.component.html │ │ │ │ └── api-icon.component.ts │ │ │ ├── api-image │ │ │ │ ├── api-image.component.html │ │ │ │ └── api-image.component.ts │ │ │ ├── api-indeterminate-will-change │ │ │ │ ├── api-indeterminate-will-change.component.html │ │ │ │ └── api-indeterminate-will-change.component.ts │ │ │ ├── api-indeterminate │ │ │ │ ├── api-indeterminate.component.html │ │ │ │ └── api-indeterminate.component.ts │ │ │ ├── api-interfaces │ │ │ │ ├── api-interfaces.component.html │ │ │ │ └── api-interfaces.component.ts │ │ │ ├── api-radio-group │ │ │ │ ├── api-radio-group.component.html │ │ │ │ └── api-radio-group.component.ts │ │ │ ├── api-radio-will-change │ │ │ │ ├── api-radio-will-change.component.html │ │ │ │ └── api-radio-will-change.component.ts │ │ │ ├── api-radio │ │ │ │ ├── api-radio.component.html │ │ │ │ └── api-radio.component.ts │ │ │ ├── api-svg │ │ │ │ ├── api-svg.component.html │ │ │ │ └── api-svg.component.ts │ │ │ ├── api-toggle-will-change │ │ │ │ ├── api-toggle-will-change.component.html │ │ │ │ └── api-toggle-will-change.component.ts │ │ │ ├── api-toggle │ │ │ │ ├── api-toggle.component.html │ │ │ │ └── api-toggle.component.ts │ │ │ ├── card │ │ │ │ ├── card.component.html │ │ │ │ └── card.component.ts │ │ │ ├── code │ │ │ │ ├── code.component.html │ │ │ │ └── code.component.ts │ │ │ ├── content-set-indeterminate │ │ │ │ ├── content-set-indeterminate.component.html │ │ │ │ └── content-set-indeterminate.component.ts │ │ │ ├── demo-checkbox-all │ │ │ │ ├── demo-checkbox-all.component.html │ │ │ │ └── demo-checkbox-all.component.ts │ │ │ ├── demo-checkbox-animation-jelly │ │ │ │ ├── demo-checkbox-animation-jelly.component.html │ │ │ │ └── demo-checkbox-animation-jelly.component.ts │ │ │ ├── demo-checkbox-animation-pulse │ │ │ │ ├── demo-checkbox-animation-pulse.component.html │ │ │ │ └── demo-checkbox-animation-pulse.component.ts │ │ │ ├── demo-checkbox-animation-rotate │ │ │ │ ├── demo-checkbox-animation-rotate.component.html │ │ │ │ └── demo-checkbox-animation-rotate.component.ts │ │ │ ├── demo-checkbox-animation-smooth │ │ │ │ ├── demo-checkbox-animation-smooth.component.html │ │ │ │ └── demo-checkbox-animation-smooth.component.ts │ │ │ ├── demo-checkbox-animation-tada │ │ │ │ ├── demo-checkbox-animation-tada.component.html │ │ │ │ └── demo-checkbox-animation-tada.component.ts │ │ │ ├── demo-checkbox-animation │ │ │ │ ├── demo-checkbox-animation.component.html │ │ │ │ └── demo-checkbox-animation.component.ts │ │ │ ├── demo-checkbox-basic │ │ │ │ ├── demo-checkbox-basic.component.html │ │ │ │ └── demo-checkbox-basic.component.ts │ │ │ ├── demo-checkbox-color │ │ │ │ ├── demo-checkbox-color.component.html │ │ │ │ └── demo-checkbox-color.component.ts │ │ │ ├── demo-checkbox-disable │ │ │ │ ├── demo-checkbox-disable.component.html │ │ │ │ └── demo-checkbox-disable.component.ts │ │ │ ├── demo-checkbox-font-icon │ │ │ │ ├── demo-checkbox-font-icon.component.html │ │ │ │ └── demo-checkbox-font-icon.component.ts │ │ │ ├── demo-checkbox-image │ │ │ │ ├── demo-checkbox-image.component.html │ │ │ │ └── demo-checkbox-image.component.ts │ │ │ ├── demo-checkbox-lock │ │ │ │ ├── demo-checkbox-lock.component.html │ │ │ │ └── demo-checkbox-lock.component.ts │ │ │ ├── demo-checkbox-mixed-color │ │ │ │ ├── demo-checkbox-mixed-color.component.html │ │ │ │ └── demo-checkbox-mixed-color.component.ts │ │ │ ├── demo-checkbox-mixed-curve-fill │ │ │ │ ├── demo-checkbox-mixed-curve-fill.component.html │ │ │ │ └── demo-checkbox-mixed-curve-fill.component.ts │ │ │ ├── demo-checkbox-mixed-curve-outline │ │ │ │ ├── demo-checkbox-mixed-curve-outline.component.html │ │ │ │ └── demo-checkbox-mixed-curve-outline.component.ts │ │ │ ├── demo-checkbox-mixed-curve-thick │ │ │ │ ├── demo-checkbox-mixed-curve-thick.component.html │ │ │ │ └── demo-checkbox-mixed-curve-thick.component.ts │ │ │ ├── demo-checkbox-mixed-curve │ │ │ │ ├── demo-checkbox-mixed-curve.component.html │ │ │ │ └── demo-checkbox-mixed-curve.component.ts │ │ │ ├── demo-checkbox-mixed-outline │ │ │ │ ├── demo-checkbox-mixed-outline.component.html │ │ │ │ └── demo-checkbox-mixed-outline.component.ts │ │ │ ├── demo-checkbox-mixed-round-fill │ │ │ │ ├── demo-checkbox-mixed-round-fill.component.html │ │ │ │ └── demo-checkbox-mixed-round-fill.component.ts │ │ │ ├── demo-checkbox-mixed-round-thick │ │ │ │ ├── demo-checkbox-mixed-round-thick.component.html │ │ │ │ └── demo-checkbox-mixed-round-thick.component.ts │ │ │ ├── demo-checkbox-mixed-round │ │ │ │ ├── demo-checkbox-mixed-round.component.html │ │ │ │ └── demo-checkbox-mixed-round.component.ts │ │ │ ├── demo-checkbox-mixed-square-fill-outline │ │ │ │ ├── demo-checkbox-mixed-square-fill-outline.component.html │ │ │ │ └── demo-checkbox-mixed-square-fill-outline.component.ts │ │ │ ├── demo-checkbox-mixed-square-fill │ │ │ │ ├── demo-checkbox-mixed-square-fill.component.html │ │ │ │ └── demo-checkbox-mixed-square-fill.component.ts │ │ │ ├── demo-checkbox-mixed-square-thick-outline │ │ │ │ ├── demo-checkbox-mixed-square-thick-outline.component.html │ │ │ │ └── demo-checkbox-mixed-square-thick-outline.component.ts │ │ │ ├── demo-checkbox-mixed-square-thick │ │ │ │ ├── demo-checkbox-mixed-square-thick.component.html │ │ │ │ └── demo-checkbox-mixed-square-thick.component.ts │ │ │ ├── demo-checkbox-mixed-switch │ │ │ │ ├── demo-checkbox-mixed-switch.component.html │ │ │ │ └── demo-checkbox-mixed-switch.component.ts │ │ │ ├── demo-checkbox-plain │ │ │ │ ├── demo-checkbox-plain.component.html │ │ │ │ └── demo-checkbox-plain.component.ts │ │ │ ├── demo-checkbox-scalability │ │ │ │ ├── demo-checkbox-scalability.component.html │ │ │ │ └── demo-checkbox-scalability.component.ts │ │ │ ├── demo-checkbox-size │ │ │ │ ├── demo-checkbox-size.component.html │ │ │ │ └── demo-checkbox-size.component.ts │ │ │ ├── demo-checkbox-states │ │ │ │ ├── demo-checkbox-states.component.html │ │ │ │ └── demo-checkbox-states.component.ts │ │ │ ├── demo-checkbox-svg │ │ │ │ ├── demo-checkbox-svg.component.html │ │ │ │ └── demo-checkbox-svg.component.ts │ │ │ ├── demo-checkbox-switch │ │ │ │ ├── demo-checkbox-switch.component.html │ │ │ │ └── demo-checkbox-switch.component.ts │ │ │ ├── demo-checkbox-toggle │ │ │ │ ├── demo-checkbox-toggle.component.html │ │ │ │ └── demo-checkbox-toggle.component.ts │ │ │ ├── demo-radio-button-all │ │ │ │ ├── demo-radio-button-all.component.html │ │ │ │ └── demo-radio-button-all.component.ts │ │ │ ├── demo-radio-button-animation │ │ │ │ ├── demo-radio-button-animation.component.html │ │ │ │ └── demo-radio-button-animation.component.ts │ │ │ ├── demo-radio-button-color-icon │ │ │ │ ├── demo-radio-button-color-icon.component.html │ │ │ │ └── demo-radio-button-color-icon.component.ts │ │ │ ├── demo-radio-button-color-outline-icon │ │ │ │ ├── demo-radio-button-color-outline-icon.component.html │ │ │ │ └── demo-radio-button-color-outline-icon.component.ts │ │ │ ├── demo-radio-button-color │ │ │ │ ├── demo-radio-button-color.component.html │ │ │ │ └── demo-radio-button-color.component.ts │ │ │ ├── demo-radio-button-plain │ │ │ │ ├── demo-radio-button-plain.component.html │ │ │ │ └── demo-radio-button-plain.component.ts │ │ │ ├── demo-radio-button-switch │ │ │ │ ├── demo-radio-button-switch.component.html │ │ │ │ └── demo-radio-button-switch.component.ts │ │ │ ├── demo-radio-button │ │ │ │ ├── demo-radio-button.component.html │ │ │ │ └── demo-radio-button.component.ts │ │ │ ├── demos-checkbox │ │ │ │ ├── demos-checkbox.component.html │ │ │ │ └── demos-checkbox.component.ts │ │ │ ├── demos-radio-button │ │ │ │ ├── demos-radio-button.component.html │ │ │ │ └── demos-radio-button.component.ts │ │ │ ├── home │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── install-lib │ │ │ │ ├── install-lib.component.html │ │ │ │ └── install-lib.component.ts │ │ │ └── install-scss-customize │ │ │ │ ├── install-scss-customize.component.html │ │ │ │ └── install-scss-customize.component.ts │ │ ├── enums.ts │ │ └── navigation.service.ts │ ├── assets │ │ ├── .gitkeep │ │ ├── logo.gif │ │ └── preview.gif │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.scss │ ├── tsconfig.app.json │ ├── tsconfig.editor.json │ ├── tsconfig.json │ └── tsconfig.spec.json ├── libs └── ngx-pretty-checkbox │ ├── .eslintrc.json │ ├── jest.config.ts │ ├── ng-package.json │ ├── package.json │ ├── project.json │ ├── src │ ├── index.ts │ └── lib │ │ ├── components │ │ ├── ngx-pretty-Indeterminate-will-change.component.ts │ │ ├── ngx-pretty-Indeterminate.component.ts │ │ ├── ngx-pretty-checkbox-will-change.component.ts │ │ ├── ngx-pretty-checkbox.component.ts │ │ ├── ngx-pretty-hover-will-change.component.ts │ │ ├── ngx-pretty-hover.component.ts │ │ ├── ngx-pretty-radio-will-change.component.ts │ │ ├── ngx-pretty-radio.component.ts │ │ ├── ngx-pretty-toggle-will-change.component.ts │ │ └── ngx-pretty-toggle.component.ts │ │ ├── directives │ │ ├── ngx-pretty-icon.directive.ts │ │ ├── ngx-pretty-image.directive.ts │ │ ├── ngx-pretty-radio-group.directive.ts │ │ └── ngx-pretty-svg.directive.ts │ │ ├── model.ts │ │ ├── ngx-pretty-checkbox.module.ts │ │ └── utils.ts │ ├── tsconfig.json │ ├── tsconfig.lib.json │ └── tsconfig.lib.prod.json ├── logo.gif ├── migrations.json ├── nx.json ├── package.json ├── preview.gif ├── tools └── publish │ ├── main.ts │ ├── package.json │ ├── print-process.model.ts │ ├── print-process.ts │ ├── print.ts │ ├── semantic-version.ts │ ├── terminal-exec.ts │ ├── terminal-interaction.ts │ └── tsconfig.json └── tsconfig.base.json /.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": [ 4 | "**/*" 5 | ], 6 | "plugins": [ 7 | "@nx" 8 | ], 9 | "overrides": [ 10 | { 11 | "files": [ 12 | "*.ts", 13 | "*.tsx", 14 | "*.js", 15 | "*.jsx" 16 | ], 17 | "rules": { 18 | "@nx/enforce-module-boundaries": [ 19 | "error", 20 | { 21 | "enforceBuildableLibDependency": true, 22 | "allow": [], 23 | "depConstraints": [ 24 | { 25 | "sourceTag": "*", 26 | "onlyDependOnLibsWithTags": [ 27 | "*" 28 | ] 29 | } 30 | ] 31 | } 32 | ] 33 | } 34 | }, 35 | { 36 | "files": [ 37 | "*.ts", 38 | "*.tsx" 39 | ], 40 | "extends": [ 41 | "plugin:@nx/typescript" 42 | ], 43 | "rules": { 44 | "@typescript-eslint/no-extra-semi": "error", 45 | "no-extra-semi": "off" 46 | } 47 | }, 48 | { 49 | "files": [ 50 | "*.js", 51 | "*.jsx" 52 | ], 53 | "extends": [ 54 | "plugin:@nx/javascript" 55 | ], 56 | "rules": { 57 | "@typescript-eslint/no-extra-semi": "error", 58 | "no-extra-semi": "off" 59 | } 60 | }, 61 | { 62 | "files": [ 63 | "*.spec.ts", 64 | "*.spec.tsx", 65 | "*.spec.js", 66 | "*.spec.jsx" 67 | ], 68 | "env": { 69 | "jest": true 70 | }, 71 | "rules": {} 72 | } 73 | ] 74 | } 75 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | 6 | # dependencies 7 | node_modules 8 | 9 | # IDEs and editors 10 | /.idea 11 | .project 12 | .classpath 13 | .c9/ 14 | *.launch 15 | .settings/ 16 | *.sublime-workspace 17 | 18 | # IDE - VSCode 19 | .vscode/* 20 | !.vscode/settings.json 21 | !.vscode/tasks.json 22 | !.vscode/launch.json 23 | !.vscode/extensions.json 24 | 25 | # misc 26 | /.sass-cache 27 | /connect.lock 28 | /coverage 29 | /libpeerconnection.log 30 | npm-debug.log 31 | yarn-error.log 32 | testem.log 33 | /typings 34 | 35 | # System Files 36 | .DS_Store 37 | Thumbs.db 38 | 39 | .angular 40 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | legacy-peer-deps=true -------------------------------------------------------------------------------- /.nx/cache/18.3.3-nx.darwin-arm64.node: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/.nx/cache/18.3.3-nx.darwin-arm64.node -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Milad Faghihi (miladfm@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /apps/demo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../.eslintrc.json" 4 | ], 5 | "ignorePatterns": [ 6 | "!**/*" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "*.ts" 12 | ], 13 | "rules": { 14 | "@angular-eslint/directive-selector": [ 15 | "error", 16 | { 17 | "type": "attribute", 18 | "prefix": "app", 19 | "style": "camelCase" 20 | } 21 | ], 22 | "@angular-eslint/component-selector": [ 23 | "error", 24 | { 25 | "type": "element", 26 | "prefix": "app", 27 | "style": "kebab-case" 28 | } 29 | ] 30 | }, 31 | "extends": [ 32 | "plugin:@nx/angular", 33 | "plugin:@angular-eslint/template/process-inline-templates" 34 | ] 35 | }, 36 | { 37 | "files": [ 38 | "*.html" 39 | ], 40 | "extends": [ 41 | "plugin:@nx/angular-template" 42 | ], 43 | "rules": {} 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /apps/demo/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox Demo

2 | 3 | 4 |

Stateless

5 |
6 | Default 7 | Default 8 |

CHECKED: {{statelessValue}}

9 | 10 |
11 | 12 | 13 |

Basic

14 |
15 | 16 | Default 17 | Fill 18 | Thick 19 | 20 |
21 | 22 | 23 | 24 |

Basic Runtime

25 |
26 | 27 | 33 | 34 | Label 35 | 36 |
37 | 38 | 39 | 40 |

Switch

41 |
42 | 43 | Default 44 | Fill 45 | Slim 46 | 47 |
48 | 49 | 50 | 51 |

Switch Runtime

52 |
53 | 54 |
55 | 56 | 57 |
58 | 59 | 64 | 65 | Label 66 | 67 |
68 | 69 | 70 | 71 |

Mixed (Color)

72 |
73 | 74 | Default 75 | Fill 76 | Slim 77 | 78 |
79 | -------------------------------------------------------------------------------- /apps/demo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {ChangeDetectorRef, Component, inject} from '@angular/core'; 2 | import { 3 | NgxPrettyCheckboxModule, 4 | NgxPrettyCheckboxComponent, 5 | NgxPrettyCheckboxWillChangeComponent, 6 | NgxPrettyHoverComponent, 7 | NgxPrettyHoverWillChangeComponent, 8 | NgxPrettyIconDirective, 9 | NgxPrettyImageDirective, 10 | NgxPrettyIndeterminateComponent, 11 | NgxPrettyIndeterminateWillChangeComponent, 12 | NgxPrettyRadioComponent, 13 | NgxPrettyRadioGroupDirective, 14 | NgxPrettyRadioWillChangeComponent, 15 | NgxPrettySvgDirective, 16 | NgxPrettyToggleComponent, 17 | NgxPrettyToggleWillChangeComponent, 18 | PrettyCheckboxStroke, PrettyCheckBoxChange 19 | } from '@lib/ngx-pretty-checkbox'; 20 | import {FormsModule} from "@angular/forms"; 21 | 22 | @Component({ 23 | standalone: true, 24 | imports: [ 25 | FormsModule, 26 | NgxPrettyCheckboxModule 27 | // NgxPrettyCheckboxComponent, 28 | // NgxPrettyCheckboxWillChangeComponent, 29 | // NgxPrettyHoverComponent, 30 | // NgxPrettyHoverWillChangeComponent, 31 | // NgxPrettyIndeterminateComponent, 32 | // NgxPrettyIndeterminateWillChangeComponent, 33 | // NgxPrettyRadioComponent, 34 | // NgxPrettyRadioWillChangeComponent, 35 | // NgxPrettyToggleComponent, 36 | // NgxPrettyToggleWillChangeComponent, 37 | // NgxPrettyIconDirective, 38 | // NgxPrettyImageDirective, 39 | // NgxPrettyRadioGroupDirective, 40 | // NgxPrettySvgDirective 41 | ], 42 | selector: 'app-root', 43 | templateUrl: './app.component.html', 44 | styles: [` 45 | .row { 46 | display: flex; 47 | align-items: center; 48 | flex-wrap: wrap; 49 | 50 | margin: 30px; 51 | padding-bottom: 30px; 52 | border-bottom: 1px solid #ccc; 53 | } 54 | 55 | .row--column { 56 | flex-direction: column; 57 | align-items: flex-start; 58 | } 59 | 60 | .row > * { 61 | margin-right: 30px; 62 | } 63 | `] 64 | }) 65 | export class AppComponent { 66 | stroke1_2: PrettyCheckboxStroke; 67 | 68 | stroke2_2: PrettyCheckboxStroke; 69 | isSwitch2_2 = true; 70 | 71 | statelessValue = true; 72 | 73 | 74 | private cd = inject(ChangeDetectorRef); 75 | 76 | 77 | onStatelessInputChange(change: PrettyCheckBoxChange) { 78 | console.log('STATELESS VALUE CHANGES', change); 79 | setTimeout(_ => { 80 | this.statelessValue = change.checked; 81 | this.cd.detectChanges(); 82 | }) 83 | console.log('statelessValue CHANGED', this.statelessValue); 84 | 85 | } 86 | } -------------------------------------------------------------------------------- /apps/demo/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/demo/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/demo/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/demo/src/favicon.ico -------------------------------------------------------------------------------- /apps/demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Demo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /apps/demo/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from '@angular/platform-browser';; 2 | import { AppComponent } from './app/app.component'; 3 | 4 | 5 | bootstrapApplication(AppComponent).catch((err) => console.error(err)); -------------------------------------------------------------------------------- /apps/demo/src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /apps/demo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts" 9 | ], 10 | "include": [ 11 | "src/**/*.d.ts" 12 | ], 13 | "exclude": [ 14 | "jest.config.ts", 15 | "src/**/*.test.ts", 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/demo/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": [ 4 | "src/**/*.ts" 5 | ], 6 | "compilerOptions": { 7 | "types": [ 8 | "jest", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apps/demo/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | }, 12 | { 13 | "path": "./tsconfig.editor.json" 14 | } 15 | ], 16 | "compilerOptions": { 17 | "target": "es2022", 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /apps/demo/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../.eslintrc.json" 4 | ], 5 | "ignorePatterns": [ 6 | "!**/*" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "*.ts" 12 | ], 13 | "rules": { 14 | "@angular-eslint/directive-selector": [ 15 | "error", 16 | { 17 | "type": "attribute", 18 | "prefix": "app", 19 | "style": "camelCase" 20 | } 21 | ], 22 | "@angular-eslint/component-selector": [ 23 | "error", 24 | { 25 | "type": "element", 26 | "prefix": "app", 27 | "style": "kebab-case" 28 | } 29 | ] 30 | }, 31 | "extends": [ 32 | "plugin:@nx/angular", 33 | "plugin:@angular-eslint/template/process-inline-templates" 34 | ] 35 | }, 36 | { 37 | "files": [ 38 | "*.html" 39 | ], 40 | "extends": [ 41 | "plugin:@nx/angular-template" 42 | ], 43 | "rules": {} 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /apps/git-page/src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | 2 | :host { 3 | width: 100%; 4 | height: 100%; 5 | display: flex; 6 | flex-direction: column; 7 | } 8 | 9 | .header { 10 | width: 100%; 11 | height: 50px; 12 | 13 | padding: 0px 24px; 14 | 15 | z-index: 1; 16 | 17 | display: flex; 18 | align-items: center; 19 | text-align: center; 20 | 21 | font-size: 1.4rem; 22 | font-weight: 500; 23 | 24 | background-color: #039BE5; 25 | color: #fafafa; 26 | box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1); 27 | } 28 | 29 | .github-button { 30 | width: 24px; 31 | height: 24px; 32 | fill: #fff; 33 | margin-left: auto; 34 | } 35 | 36 | .content { 37 | flex: 1; 38 | width: 100%; 39 | height: 1px; 40 | 41 | display: flex; 42 | } 43 | 44 | .side-nav { 45 | width: 200px; 46 | height: 100%; 47 | 48 | display: flex; 49 | flex-direction: column; 50 | 51 | background-color: #f7f7f7; 52 | box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2); 53 | } 54 | 55 | .side-nav__scroll { 56 | overflow: auto; 57 | padding-top: 30px; 58 | } 59 | 60 | .side-nav__header { 61 | display: flex; 62 | align-items: center; 63 | 64 | height: 50px; 65 | 66 | padding: 15px 0px 10px 15px; 67 | 68 | font-weight: 600; 69 | font-size: 0.95rem; 70 | } 71 | .side-nav__header--item { 72 | cursor: pointer; 73 | } 74 | .side-nav__header--item:hover { 75 | background-color: #e0e0e0; 76 | } 77 | 78 | .side-nav__header:not(:first-child) { 79 | border-top: 1px solid #ccc; 80 | } 81 | 82 | .side-nav__item, .side-nav__sub-item { 83 | display: flex; 84 | height: 50px; 85 | align-items: center; 86 | transition: background-color 0.3s; 87 | cursor: pointer; 88 | } 89 | .active-link { 90 | border-left: 5px solid rgba(3, 155, 299, 0.8); 91 | background-color: rgba(3, 155, 299, 0.15); 92 | } 93 | 94 | .side-nav__item:not(.active-link):hover, .side-nav__sub-item:not(.active-link):hover { 95 | background-color: #e0e0e0; 96 | } 97 | .side-nav__item { 98 | padding: 12px 12px 12px 30px; 99 | } 100 | .side-nav__sub-item { 101 | padding: 12px 12px 12px 60px; 102 | font-size: 0.9em; 103 | } 104 | 105 | .side-nav__accordion { 106 | /* height: 0px; */ 107 | /* max-height: 0px; */ 108 | overflow: hidden; 109 | transition: height 0.3s, maxHeight 0.3s; 110 | } 111 | 112 | .side-nav__accordion-icon { 113 | margin-left: auto; 114 | color: #777; 115 | } 116 | 117 | .container { 118 | flex: 1; 119 | overflow: auto; 120 | } 121 | 122 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-checkbox-will-change/api-checkbox-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-checkbox-will-change', 5 | templateUrl: './api-checkbox-will-change.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiCheckboxWillChangeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-checkbox/api-checkbox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-checkbox', 5 | templateUrl: './api-checkbox.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiCheckboxComponent { 9 | 10 | constructor() { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-enums/api-enums.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-enums', 5 | templateUrl: './api-enums.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiEnumsComponent { 9 | 10 | constructor() { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-hover-will-change/api-hover-will-change.component.html: -------------------------------------------------------------------------------- 1 |

API - Hover will-change

2 | 3 |
4 | 5 |
6 |
NgxPrettyHoverWillChangeComponent
7 | selector: ngx-p-hover[will-change], p-hover[will-change] 8 | 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | 51 | 52 | 53 | 54 |
NameDescription
22 |

@Input()

23 |

color: PrettyCheckboxColor

24 |
27 |

28 | 30 |

31 |
38 |

@Input()

39 |

outline: boolean

40 |
43 |

44 | 46 |

47 |

48 | Default value: false 49 |

50 |

55 | 56 | 57 |
58 |
59 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-hover-will-change/api-hover-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-hover-will-change', 5 | templateUrl: './api-hover-will-change.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiHoverWillChangeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-hover/api-hover.component.html: -------------------------------------------------------------------------------- 1 |

API - Hover

2 | 3 |
4 | 5 |
6 |
NgxPrettyHoverComponent
7 | selector: ngx-p-hover:not([will-change]), p-hover:not([will-change]) 8 | 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | 51 | 52 | 53 | 54 |
NameDescription
22 |

@Attribute('color')

23 |

private _color: PrettyCheckboxColor

24 |
27 |

28 | 30 |

31 |
38 |

@Attribute('outline')

39 |

private _outline: boolean

40 |
43 |

44 | 46 |

47 |

48 | Default value: false 49 |

50 |

55 | 56 | 57 |
58 |
59 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-hover/api-hover.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-hover', 5 | templateUrl: './api-hover.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiHoverComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-icon/api-icon.component.html: -------------------------------------------------------------------------------- 1 |

API - Icon

2 | 3 |
4 | 5 |
6 |
NgxPrettyIconDirective
7 | selector: [pIcon], [p-icon] 8 | 9 | 10 |
11 |
12 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-icon/api-icon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-icon', 5 | templateUrl: './api-icon.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiIconComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-image/api-image.component.html: -------------------------------------------------------------------------------- 1 |

API - Image

2 | 3 |
4 | 5 |
6 |
NgxPrettyImageDirective
7 | selector: [pImage], [p-image] 8 | 9 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-image/api-image.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-image', 5 | templateUrl: './api-image.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiImageComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-indeterminate-will-change/api-indeterminate-will-change.component.html: -------------------------------------------------------------------------------- 1 |

API - Indeterminate will-change

2 | 3 |
4 | 5 |
6 |
NgxPrettyIndeterminateWillChangeComponent
7 | selector: ngx-p-indeterminate[will-change], p-indeterminate[will-change] 8 | 9 | Properties 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 50 | 51 | 52 | 53 |
NameDescription
21 |

@Input()

22 |

color: PrettyCheckboxColor

23 |
26 |

27 | 29 |

30 |
37 |

@Input()

38 |

outline: boolean

39 |
42 |

43 | 45 |

46 |

47 | Default value: false 48 |

49 |

54 | 55 | 56 |
57 |
58 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-indeterminate-will-change/api-indeterminate-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-indeterminate-will-change', 5 | templateUrl: './api-indeterminate-will-change.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiIndeterminateWillChangeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-indeterminate/api-indeterminate.component.html: -------------------------------------------------------------------------------- 1 |

API - Indeterminate

2 | 3 |
4 | 5 |
6 |
NgxPrettyIndeterminateComponent
7 | selector: ngx-p-indeterminate:not([will-change]), p-indeterminate:not([will-change]) 8 | 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 50 | 51 | 52 | 53 |
NameDescription
21 |

@Attribute('color')

22 |

private _color: PrettyCheckboxColor

23 |
26 |

27 | 29 |

30 |
37 |

@Attribute('outline')

38 |

private _outline: boolean

39 |
42 |

43 | 45 |

46 |

47 | Default value: false 48 |

49 |

54 | 55 | 56 |
57 |
58 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-indeterminate/api-indeterminate.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-indeterminate', 5 | templateUrl: './api-indeterminate.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiIndeterminateComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-interfaces/api-interfaces.component.html: -------------------------------------------------------------------------------- 1 |

API - Interfaces

2 | 3 |
4 | 5 | 6 | 7 |
8 |
PrettyCheckBoxChange
9 | Description Description Description Description Description Description 10 | 11 | Properties 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 39 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 58 | 59 | 60 |
NameDescription
22 |

checked: boolean

23 |
26 |

27 | fill Description 28 |

29 |
36 |

value: string

37 |
40 |

41 | Thick Description 42 |

43 |
50 |

event

51 |
54 |

55 | Slim Description 56 |

57 |
61 | 62 |
63 | 64 | 65 | 66 | 67 | 68 |
69 |
PrettyRadioChange
70 | Description Description Description Description Description Description 71 | 72 | Properties 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 | 91 | 92 | 93 | 94 | 95 | 96 | 99 | 100 | 105 | 106 | 107 | 108 | 109 | 110 | 113 | 114 | 119 | 120 | 121 |
NameDescription
83 |

checked: boolean

84 |
87 |

88 | Curve Description 89 |

90 |
97 |

value: string

98 |
101 |

102 | Round Description 103 |

104 |
111 |

event: Event

112 |
115 |

116 | event Description 117 |

118 |
122 | 123 |
124 | 125 | 126 |
127 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-interfaces/api-interfaces.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-interfaces', 5 | templateUrl: './api-interfaces.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiInterfacesComponent { 9 | 10 | constructor() { } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-radio-group/api-radio-group.component.html: -------------------------------------------------------------------------------- 1 |

API - Radio group

2 | 3 |
4 | 5 |
6 |
NgxPrettyRadioGroupDirective
7 | selector: ngx-pretty-radio-group, p-radio-group 8 | exportAs: ngxRadioGroup 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 |
NameDescription
21 |

@Output()

22 |

change: EventEmitter<PrettyRadioChange>

23 |
26 |

27 | 29 |

30 |
37 | 38 |
39 |
40 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-radio-group/api-radio-group.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-radio-group', 5 | templateUrl: './api-radio-group.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiRadioGroupComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-radio-will-change/api-radio-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-radio-will-change', 5 | templateUrl: './api-radio-will-change.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class RadioWillChangeApiComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-radio/api-radio.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-radio', 5 | templateUrl: './api-radio.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiRadioComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-svg/api-svg.component.html: -------------------------------------------------------------------------------- 1 |

API - Svg

2 | 3 |
4 | 5 |
6 |
NgxPrettySvgDirective
7 | selector: [pSvg], [p-svg] 8 | 9 | 10 | 11 |
12 |
13 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-svg/api-svg.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-svg', 5 | templateUrl: './api-svg.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiSvgComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-toggle-will-change/api-toggle-will-change.component.html: -------------------------------------------------------------------------------- 1 |

API - Toggle will-change

2 | 3 |
4 | 5 |
6 |
NgxPrettyToggleWillChangeComponent
7 | selector: ngx-p-toggle[will-change], p-toggle[will-change] 8 | 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 67 | 68 | 69 | 70 |
NameDescription
22 |

@Input()

23 |

type: PrettyCheckBoxToggleType

24 |
27 |

28 | 30 |

31 |
38 |

@Input()

39 |

color: PrettyCheckboxColor

40 |
43 |

44 | 46 |

47 |
54 |

@Input()

55 |

outline: boolean

56 |
59 |

60 | 62 |

63 |

64 | Default value: false 65 |

66 |

71 | 72 | 73 |
74 |
75 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-toggle-will-change/api-toggle-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-toggle-will-change', 5 | templateUrl: './api-toggle-will-change.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiToggleWillChangeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-toggle/api-toggle.component.html: -------------------------------------------------------------------------------- 1 |

API - Toggle

2 | 3 |
4 | 5 |
6 |
NgxPrettyToggleComponent
7 | selector: ngx-p-toggle:not([will-change]), p-toggle:not([will-change]) 8 | 9 | 10 | Properties 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | 41 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 57 | 58 | 67 | 68 | 69 | 70 |
NameDescription
22 |

@Attribute('type')

23 |

private _type: PrettyCheckBoxToggleType

24 |
27 |

28 | 30 |

31 |
38 |

@Attribute('color')

39 |

private _color: PrettyCheckboxColor

40 |
43 |

44 | 46 |

47 |
54 |

@Attribute('outline')

55 |

private _outline: boolean

56 |
59 |

60 | 62 |

63 |

64 | Default value: false 65 |

66 |

71 | 72 | 73 |
74 |
75 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/api-toggle/api-toggle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-api-toggle', 5 | templateUrl: './api-toggle.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ApiToggleComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/card/card.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

{{title}}

5 |
6 | 7 |
8 | 9 |
10 | 11 |
-------------------------------------------------------------------------------- /apps/git-page/src/app/components/card/card.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy, Input } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-card', 5 | templateUrl: './card.component.html', 6 | styles: [` 7 | :host { 8 | margin: 25px; 9 | } 10 | .demo-card-wide.mdl-card { 11 | width: 250px; 12 | min-height: initial; 13 | height: auto; 14 | text-transform: none; 15 | text-align: left; 16 | padding: 16px; 17 | } 18 | 19 | .mdl-card__supporting-text { 20 | padding: 0px; 21 | } 22 | 23 | .mdl-card__title { 24 | padding: 0px; 25 | } 26 | 27 | .mdl-card__title-text { 28 | font-size: 20px; 29 | font-weight: 500; 30 | margin-bottom: 8px; 31 | } 32 | `], 33 | changeDetection: ChangeDetectionStrategy.OnPush 34 | }) 35 | export class CardComponent implements OnInit { 36 | 37 | @Input() title: string; 38 | 39 | constructor() { } 40 | 41 | ngOnInit() { 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/code/code.component.html: -------------------------------------------------------------------------------- 1 |
2 |   
3 |       
4 |   
-------------------------------------------------------------------------------- /apps/git-page/src/app/components/code/code.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, AfterViewInit, Input, ChangeDetectionStrategy, ViewChild, ElementRef } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-code', 5 | templateUrl: './code.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class CodeComponent implements AfterViewInit { 9 | 10 | @Input() type = 'html'; 11 | 12 | constructor() { } 13 | 14 | ngAfterViewInit() { 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/content-set-indeterminate/content-set-indeterminate.component.html: -------------------------------------------------------------------------------- 1 |
2 |
setIndeterminate
3 |
4 | In addition to the checked and unchecked states, 5 | there is a third state a checkbox can be in: 6 | indeterminate. 7 | This is a state in which it's impossible to say whether the item is toggled on or off. 8 | This is set using the HTMLInputElement object's indeterminate property via JavaScript (it cannot be set using an HTML attribute) 9 |
10 |
-------------------------------------------------------------------------------- /apps/git-page/src/app/components/content-set-indeterminate/content-set-indeterminate.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-content-set-indeterminate', 5 | templateUrl: './content-set-indeterminate.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class ContentSetIndeterminateComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-all/demo-checkbox-all.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : All Features

2 | 3 | 4 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-all/demo-checkbox-all.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-all', 5 | templateUrl: './demo-checkbox-all.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class DemoCheckboxAllComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-jelly/demo-checkbox-animation-jelly.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Animation (Jelly)

2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | done 12 | Interested 13 | 14 |
15 | 16 |
17 | 23 |
24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | done_all 34 | All 35 | 36 |
37 | 38 |
39 | 45 |
46 | 47 |
48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 | bug_report 56 | Bug 57 | 58 |
59 | 60 |
61 | 67 |
68 | 69 |
70 | 71 | 72 |
73 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-jelly/demo-checkbox-animation-jelly.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-animation-jelly', 5 | templateUrl: './demo-checkbox-animation-jelly.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxAnimationJellyComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-pulse/demo-checkbox-animation-pulse.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Animation (Pulse)

2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | done 12 | Allow 13 | 14 |
15 | 16 |
17 | 23 |
24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | Occasionally 34 | 35 |
36 | 37 |
38 | 43 |
44 | 45 |
46 | 47 | 48 |
49 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-pulse/demo-checkbox-animation-pulse.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-animation-pulse', 5 | templateUrl: './demo-checkbox-animation-pulse.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoAnimationCheckboxPulseComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-rotate/demo-checkbox-animation-rotate.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Animation (Rotate)

2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | done 12 | Good 13 | 14 |
15 | 16 |
17 | 23 |
24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | clear 34 | Cancel 35 | 36 |
37 | 38 |
39 | 45 |
46 | 47 |
48 | 49 | 50 | 51 |
52 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-rotate/demo-checkbox-animation-rotate.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-animation-rotate', 5 | templateUrl: './demo-checkbox-animation-rotate.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxAnimationRotateComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-smooth/demo-checkbox-animation-smooth.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Animation (Smooth)

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Monday 11 | 12 |
13 | 14 |
15 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | done 31 | Tuesday 32 | 33 |
34 | 35 |
36 | 42 |
43 | 44 |
45 | 46 | 47 | 48 |
49 | 50 |
51 | 52 | clear 53 | Wednesday 54 | 55 |
56 | 57 |
58 | 64 |
65 | 66 |
67 | 68 | 69 | 70 |
71 | 72 |
73 | 74 | Thursday 75 | 76 |
77 | 78 |
79 | 84 |
85 | 86 |
87 | 88 | 89 | 90 |
91 | 92 |
93 | 94 | Friday 95 | 96 |
97 | 98 |
99 | 104 |
105 | 106 |
107 | 108 |
109 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-smooth/demo-checkbox-animation-smooth.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-animation-smooth', 5 | templateUrl: './demo-checkbox-animation-smooth.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxAnimationSmoothComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-tada/demo-checkbox-animation-tada.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Animation (Tada)

2 | 3 |
4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | favorite 12 | Good 13 | 14 |
15 | 16 |
17 | 23 |
24 | 25 |
26 | 27 | 28 | 29 |
30 | 31 |
32 | 33 | attach_money 34 | Money 35 | 36 |
37 | 38 |
39 | 45 |
46 | 47 |
48 | 49 | 50 | 51 |
52 | 53 |
54 | 55 | https 56 | Lock 57 | 58 |
59 | 60 |
61 | 67 |
68 | 69 |
70 | 71 | 72 |
73 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation-tada/demo-checkbox-animation-tada.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-animation-tada', 5 | templateUrl: './demo-checkbox-animation-tada.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxAnimationTadaComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-animation/demo-checkbox-animation.component.ts: -------------------------------------------------------------------------------- 1 | import { OnInit, ChangeDetectionStrategy, Component } from '@angular/core'; 2 | import { PrettyCheckboxAnimation } from '@lib/ngx-pretty-checkbox'; 3 | 4 | @Component({ 5 | selector: 'app-demo-checkbox-animation', 6 | templateUrl: './demo-checkbox-animation.component.html', 7 | styles: [` 8 | :host { 9 | margin: 20px; 10 | display: block; 11 | } 12 | `], 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class DemoCheckboxAnimationComponent implements OnInit { 16 | 17 | animation: PrettyCheckboxAnimation; 18 | constructor() { } 19 | 20 | ngOnInit() { 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-basic/demo-checkbox-basic.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Basic

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Default 11 | 12 |
13 | 14 |
15 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | Fill 31 | 32 |
33 | 34 |
35 | 40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | Thick 51 | 52 |
53 | 54 |
55 | 60 |
61 | 62 |
63 | 64 | 65 |
66 | 67 | 68 | 69 |
Run-Time change
70 | 71 |
72 | 73 | 74 |
75 | 76 |
77 | 78 |
79 | Stroke: 80 | 86 |
87 | 88 | 89 | Run-time changeable 90 | 91 | 92 |
93 | 94 |
95 | 100 | 101 | 107 |
108 | 109 |
110 | 111 |
112 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-basic/demo-checkbox-basic.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { PrettyCheckboxStroke } from '@lib/ngx-pretty-checkbox'; 3 | 4 | @Component({ 5 | selector: 'app-demo-checkbox-basic', 6 | templateUrl: './demo-checkbox-basic.component.html', 7 | styles: [` 8 | :host { 9 | margin: 20px; 10 | display: block; 11 | } 12 | `], 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class DemoCheckboxBasicComponent implements OnInit { 16 | 17 | stroke: PrettyCheckboxStroke; 18 | 19 | constructor() { } 20 | 21 | ngOnInit() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-color/demo-checkbox-color.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { PrettyCheckboxColor } from '@lib/ngx-pretty-checkbox'; 3 | 4 | @Component({ 5 | selector: 'app-demo-checkbox-color', 6 | templateUrl: './demo-checkbox-color.component.html', 7 | styles: [` 8 | :host { 9 | margin: 20px; 10 | display: block; 11 | } 12 | `], 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class DemoCheckboxColorComponent implements OnInit { 16 | 17 | color: PrettyCheckboxColor; 18 | 19 | constructor() { } 20 | 21 | ngOnInit() { 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-disable/demo-checkbox-disable.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Disable

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | done 11 | Checked 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | Not Checked 33 | 34 |
35 | 36 |
37 | 42 |
43 | 44 |
45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-disable/demo-checkbox-disable.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-disable', 5 | templateUrl: './demo-checkbox-disable.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxDisableComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-font-icon/demo-checkbox-font-icon.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Font Icon

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | done 11 | Pay Bills 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | clear 33 | Fuel refill 34 | 35 |
36 | 37 |
38 | 44 |
45 | 46 |
47 | 48 | 49 | 50 |
51 | 52 |
53 | 54 | done_outline 55 | Buy groceries 56 | 57 |
58 | 59 |
60 | 66 |
67 | 68 |
69 | 70 | 71 |
72 | 73 | 74 | 117 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-font-icon/demo-checkbox-font-icon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-font-icon', 5 | templateUrl: './demo-checkbox-font-icon.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxFontIconComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-image/demo-checkbox-image.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Image

2 | 3 |
4 | 5 | 6 |
7 |
8 | 9 | 10 | Agree 11 | 12 |
13 | 14 |
15 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | 32 | Subscribe 33 | 34 |
35 | 36 |
37 | 43 |
44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 | Cancel 55 | 56 |
57 | 58 |
59 | 65 |
66 | 67 |
68 | 69 | 70 | 71 |
72 | 73 |
74 | 75 | 76 | Yes 77 | 78 |
79 | 80 |
81 | 87 |
88 | 89 |
90 | 91 | 92 |
93 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-image/demo-checkbox-image.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-image', 5 | templateUrl: './demo-checkbox-image.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxImageComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-lock/demo-checkbox-lock.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Lock

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | done 11 | Checked 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | Not Checked 33 | 34 |
35 | 36 |
37 | 42 |
43 | 44 |
45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-lock/demo-checkbox-lock.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-lock', 5 | templateUrl: './demo-checkbox-lock.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxLockComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-color/demo-checkbox-mixed-color.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Color)
2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Fill 11 | 12 |
13 | 14 |
15 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | Thick 31 | 32 |
33 | 34 |
35 | 40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | Curve 51 | 52 |
53 | 54 |
55 | 60 |
61 | 62 |
63 | 64 | 65 | 66 |
67 | 68 |
69 | 70 | Round 71 | 72 |
73 | 74 |
75 | 80 |
81 | 82 |
83 | 84 | 85 | 86 |
87 | 88 |
89 | 90 | Round and fill 91 | 92 |
93 | 94 |
95 | 100 |
101 | 102 |
103 | 104 | 105 |
106 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-color/demo-checkbox-mixed-color.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-color', 5 | templateUrl: './demo-checkbox-mixed-color.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxColorComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-fill/demo-checkbox-mixed-curve-fill.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Curve, Fill)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-fill/demo-checkbox-mixed-curve-fill.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-curve-fill', 5 | templateUrl: './demo-checkbox-mixed-curve-fill.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxCurveFillComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-outline/demo-checkbox-mixed-curve-outline.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Curve, Outline)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-outline/demo-checkbox-mixed-curve-outline.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-curve-outline', 5 | templateUrl: './demo-checkbox-mixed-curve-outline.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxCurveOutlineComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-thick/demo-checkbox-mixed-curve-thick.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Curve, Thick)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve-thick/demo-checkbox-mixed-curve-thick.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-curve-thick', 5 | templateUrl: './demo-checkbox-mixed-curve-thick.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxCurveThickComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve/demo-checkbox-mixed-curve.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Curve)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-curve/demo-checkbox-mixed-curve.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-curve', 5 | templateUrl: './demo-checkbox-mixed-curve.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxCurveComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-outline/demo-checkbox-mixed-outline.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Outline)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-outline/demo-checkbox-mixed-outline.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-outline', 5 | templateUrl: './demo-checkbox-mixed-outline.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxOutlineComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round-fill/demo-checkbox-mixed-round-fill.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Round, Fill)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round-fill/demo-checkbox-mixed-round-fill.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-round-fill', 5 | templateUrl: './demo-checkbox-mixed-round-fill.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxRoundFillComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round-thick/demo-checkbox-mixed-round-thick.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Round, Thick)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round-thick/demo-checkbox-mixed-round-thick.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-round-thick', 5 | templateUrl: './demo-checkbox-mixed-round-thick.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxRoundThickComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round/demo-checkbox-mixed-round.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Round)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-round/demo-checkbox-mixed-round.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-round', 5 | templateUrl: './demo-checkbox-mixed-round.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxRoundComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-fill-outline/demo-checkbox-mixed-square-fill-outline.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Square, Fill, Outline)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-fill-outline/demo-checkbox-mixed-square-fill-outline.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-square-fill-outline', 5 | templateUrl: './demo-checkbox-mixed-square-fill-outline.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxSquareFillOutlineComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | 17 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-fill/demo-checkbox-mixed-square-fill.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Square, Fill)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-fill/demo-checkbox-mixed-square-fill.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-square-fill', 5 | templateUrl: './demo-checkbox-mixed-square-fill.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxSquareFillComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-thick-outline/demo-checkbox-mixed-square-thick-outline.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Square, Thick, Outline)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-thick-outline/demo-checkbox-mixed-square-thick-outline.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-square-thick-outline', 5 | templateUrl: './demo-checkbox-mixed-square-thick-outline.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxSquareThickOutlineComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-thick/demo-checkbox-mixed-square-thick.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Square, Thick)
2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | Primary 12 | 13 |
14 | 15 |
16 | 21 |
22 | 23 |
24 | 25 | 26 | 27 |
28 | 29 |
30 | 31 | Success 32 | 33 |
34 | 35 |
36 | 41 |
42 | 43 |
44 | 45 | 46 | 47 |
48 | 49 |
50 | 51 | Info 52 | 53 |
54 | 55 |
56 | 61 |
62 | 63 |
64 | 65 | 66 | 67 |
68 | 69 |
70 | 71 | Warning 72 | 73 |
74 | 75 |
76 | 81 |
82 | 83 |
84 | 85 | 86 | 87 |
88 | 89 |
90 | 91 | Danger 92 | 93 |
94 | 95 |
96 | 101 |
102 | 103 |
104 | 105 | 106 |
107 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-square-thick/demo-checkbox-mixed-square-thick.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-square-thick', 5 | templateUrl: './demo-checkbox-mixed-square-thick.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxSquareThickComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-switch/demo-checkbox-mixed-switch.component.html: -------------------------------------------------------------------------------- 1 |
Checkbox : Mixed (Switch)
2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Default 11 | 12 |
13 | 14 |
15 | 20 |
21 | 22 |
23 | 24 | 25 | 26 |
27 | 28 |
29 | 30 | fill 31 | 32 |
33 | 34 |
35 | 40 |
41 | 42 |
43 | 44 | 45 | 46 |
47 | 48 |
49 | 50 | fill 51 | 52 |
53 | 54 |
55 | 60 |
61 | 62 |
63 | 64 | 65 | 66 |
67 | 68 |
69 | 70 | slim 71 | 72 |
73 | 74 |
75 | 80 |
81 | 82 |
83 | 84 | 85 | 86 |
87 | 88 |
89 | 90 | slim 91 | 92 |
93 | 94 |
95 | 100 |
101 | 102 |
103 | 104 |
105 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-mixed-switch/demo-checkbox-mixed-switch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-mixed-switch', 5 | templateUrl: './demo-checkbox-mixed-switch.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class MixedCheckboxSwitchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-plain/demo-checkbox-plain.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Plain

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | star_rate 11 | Favorite 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | Add 33 | 34 |
35 | 36 |
37 | 42 |
43 | 44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-plain/demo-checkbox-plain.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-plain', 5 | templateUrl: './demo-checkbox-plain.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxPlainComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-scalability/demo-checkbox-scalability.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Scalability

2 | 3 | 4 |
5 | 6 | 7 |
8 | 9 |
10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 | 29 |
30 | 31 |
32 | 33 |
34 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-scalability/demo-checkbox-scalability.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-scalability', 5 | templateUrl: './demo-checkbox-scalability.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | .content__body p-checkbox { 13 | margin-top: 10px; 14 | margin-bottom: 10px; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoCheckboxScalabilityComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-size/demo-checkbox-size.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Size

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | done 11 | Done 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | Clear 33 | 34 |
35 | 36 |
37 | 42 |
43 | 44 |
45 | 46 | 47 |
48 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-size/demo-checkbox-size.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-size', 5 | templateUrl: './demo-checkbox-size.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxSizeComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-states/demo-checkbox-states.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : State

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | After Hover 11 | Hover 12 | 13 |
14 | 15 |
16 | 22 |
23 | 24 |
25 | 26 | 27 | 28 |
29 | 30 |
31 | 32 | Focus 33 | 34 |
35 | 36 |
37 | 42 |
43 | 44 |
45 | 46 | 47 | 48 |
49 | 50 |
51 | 52 | done 53 | 54 | remove 55 | Changed 56 | 57 | Indeterminate 58 | 59 |
60 | 61 |
62 | 63 |
64 | 76 | 77 | 87 |
88 | 89 |
90 | 91 | 92 |
93 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-states/demo-checkbox-states.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { NgxPrettyCheckboxComponent } from '@lib/ngx-pretty-checkbox'; 3 | 4 | @Component({ 5 | selector: 'app-demo-checkbox-states', 6 | templateUrl: './demo-checkbox-states.component.html', 7 | styles: [` 8 | :host { 9 | margin: 20px; 10 | display: block; 11 | } 12 | `], 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class DemoCheckboxStatesComponent implements OnInit { 16 | 17 | constructor() { } 18 | 19 | ngOnInit() { 20 | } 21 | 22 | setIndeterminate( prettyCheckbox: NgxPrettyCheckboxComponent) { 23 | prettyCheckbox.setIndeterminate(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-svg/demo-checkbox-svg.component.html: -------------------------------------------------------------------------------- 1 |

Checkbox : Svg

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | Recurring 15 | 16 | 17 |
18 | 19 |
20 | 21 | 29 |
30 | 31 |
32 | 33 | 34 | 35 |
36 | 37 |
38 | 39 | 40 | 41 | Done 42 | 43 | 44 |
45 | 46 |
47 | 48 | 54 |
55 | 56 |
57 | 58 | 59 | 60 |
61 | 62 |
63 | 64 | 65 | Lock 66 | 67 |
68 | 69 |
70 | 76 |
77 | 78 |
79 | 80 | 81 |
82 | 83 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-svg/demo-checkbox-svg.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-svg', 5 | templateUrl: './demo-checkbox-svg.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxSvgComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-switch/demo-checkbox-switch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { PrettyCheckboxStroke } from '@lib/ngx-pretty-checkbox'; 3 | 4 | @Component({ 5 | selector: 'app-demo-checkbox-switch', 6 | templateUrl: './demo-checkbox-switch.component.html', 7 | styles: [` 8 | :host { 9 | margin: 20px; 10 | display: block; 11 | } 12 | `], 13 | changeDetection: ChangeDetectionStrategy.OnPush 14 | }) 15 | export class DemoCheckboxSwitchComponent implements OnInit { 16 | 17 | stroke: PrettyCheckboxStroke; 18 | isSwitch = true; 19 | 20 | constructor() { } 21 | 22 | ngOnInit() { 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-checkbox-toggle/demo-checkbox-toggle.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-checkbox-toggle', 5 | templateUrl: './demo-checkbox-toggle.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | `], 12 | changeDetection: ChangeDetectionStrategy.OnPush 13 | }) 14 | export class DemoCheckboxToggleComponent implements OnInit { 15 | 16 | constructor() { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-all/demo-radio-button-all.component.html: -------------------------------------------------------------------------------- 1 |

Radio : All Features

2 | 3 | 4 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-all/demo-radio-button-all.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-all', 5 | templateUrl: './demo-radio-button-all.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class DemoRadioButtonAllComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-animation/demo-radio-button-animation.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-animation', 5 | templateUrl: './demo-radio-button-animation.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonAnimationComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-color-icon/demo-radio-button-color-icon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-color-icon', 5 | templateUrl: './demo-radio-button-color-icon.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonColorIconComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-color-outline-icon/demo-radio-button-color-outline-icon.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-color-outline-icon', 5 | templateUrl: './demo-radio-button-color-outline-icon.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonColorOutlineIconComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-color/demo-radio-button-color.component.html: -------------------------------------------------------------------------------- 1 |

Radio : Colors

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Primary 11 | Success 12 | Info 13 | Warning 14 | Danger 15 |
16 | 17 |
18 | 31 |

32 | Or : 33 |

34 | 51 |
52 | 53 |
54 | 55 |
56 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-color/demo-radio-button-color.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-color', 5 | templateUrl: './demo-radio-button-color.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonColorComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-plain/demo-radio-button-plain.component.html: -------------------------------------------------------------------------------- 1 |

Radio : Plain

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | 11 | accessibility_new 12 | Single 13 | 14 | 15 | 16 | wc 17 | Married 18 | 19 | 20 | 21 | favorite 22 | In relationship 23 | 24 | 25 |
26 | 27 |
28 | 46 |

47 | Or : 48 |

49 | 71 |
72 | 73 |
74 | 75 |
76 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-plain/demo-radio-button-plain.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-plain', 5 | templateUrl: './demo-radio-button-plain.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonPlainComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-switch/demo-radio-button-switch.component.html: -------------------------------------------------------------------------------- 1 |

Radio : Switch

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Summer 11 | Winter 12 | Fall 13 | 14 |
15 | 16 |
17 | 26 |

27 | Or : 28 |

29 | 42 |
43 | 44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button-switch/demo-radio-button-switch.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button-switch', 5 | templateUrl: './demo-radio-button-switch.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin-top:20px; 15 | } 16 | `], 17 | changeDetection: ChangeDetectionStrategy.OnPush 18 | }) 19 | export class DemoRadioButtonSwitchComponent implements OnInit { 20 | 21 | constructor() { } 22 | 23 | ngOnInit() { 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button/demo-radio-button.component.html: -------------------------------------------------------------------------------- 1 |

Radio : Basic

2 | 3 |
4 | 5 | 6 |
7 | 8 |
9 | 10 | Male 11 | 12 | Female 13 | 14 | Special 15 | 16 |
17 | 18 |
19 | 28 |

29 | Or : 30 |

31 | 44 |
45 | 46 |
47 | 48 |
49 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demo-radio-button/demo-radio-button.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-demo-radio-button', 5 | templateUrl: './demo-radio-button.component.html', 6 | styles: [` 7 | :host { 8 | margin: 20px; 9 | display: block; 10 | } 11 | 12 | 13 | .content__demo p-radio{ 14 | margin: 10px 0; 15 | } 16 | 17 | `], 18 | changeDetection: ChangeDetectionStrategy.OnPush 19 | }) 20 | export class DemoRadioButtonComponent implements OnInit { 21 | 22 | constructor() { } 23 | 24 | ngOnInit() { 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demos-checkbox/demos-checkbox.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { PrettyCheckBoxChange } from '@lib/ngx-pretty-checkbox'; 3 | import { DemoCheckboxesRouteName } from '../../enums'; 4 | import { NavigationService } from '../../navigation.service'; 5 | 6 | @Component({ 7 | selector: 'app-demos-checkbox', 8 | templateUrl: './demos-checkbox.component.html', 9 | styles: [` 10 | :host { 11 | display: flex; 12 | flex-wrap: wrap; 13 | justify-content: center; 14 | align-items: center; 15 | } 16 | 17 | .color-preview { 18 | display: inline-block; 19 | width: 1em; 20 | height: 1em; 21 | background-color: #bdc3c7; 22 | border-radius: 100%; 23 | margin: 10px 2px 0px 2px; 24 | } 25 | 26 | .color-preview.primary { 27 | background-color: #428bca; 28 | } 29 | 30 | .color-preview.success { 31 | background-color: #5cb85c; 32 | } 33 | 34 | span.color-preview.warning { 35 | background-color: #f0ad4e; 36 | } 37 | 38 | span.color-preview.info { 39 | background-color: #5bc0de; 40 | } 41 | 42 | span.color-preview.danger { 43 | background-color: #d9534f; 44 | } 45 | 46 | `] 47 | }) 48 | export class DemosCheckboxComponent implements OnInit { 49 | 50 | public readonly DemoCheckboxesRouteName = DemoCheckboxesRouteName; 51 | 52 | constructor(private navigation: NavigationService) { } 53 | 54 | ngOnInit() { 55 | } 56 | 57 | onChange(event: PrettyCheckBoxChange) { 58 | } 59 | 60 | goToDemoCheckbox(page?: DemoCheckboxesRouteName) { 61 | this.navigation.goToDemoCheckbox(page); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demos-radio-button/demos-radio-button.component.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | All feature together and change it run time 4 | 5 | 6 | 7 | 8 | These are simple radio button with three shape 9 | 10 | 11 | 12 | 13 | IOS style 14 | 15 | 16 | 17 | 18 | There are five pure css animation 19 | 20 | 21 | 22 | 23 | There are five colors 24 |
25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 | Mixed radio config: color with icon and outline 35 | 36 | 37 | 38 | 39 | Mixed radio config: color with icon 40 | 41 | 42 | 43 | 44 | To remove the border (when checkbox is checked) 45 | 46 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/demos-radio-button/demos-radio-button.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | import { PrettyCheckBoxChange } from '@lib/ngx-pretty-checkbox'; 3 | import { DemoRadioRouteName } from '../../enums'; 4 | import { NavigationService } from '../../navigation.service'; 5 | 6 | @Component({ 7 | selector: 'app-demos-radio-button', 8 | templateUrl: './demos-radio-button.component.html', 9 | styles: [` 10 | :host { 11 | display: flex; 12 | flex-wrap: wrap; 13 | justify-content: center; 14 | align-items: center; 15 | } 16 | 17 | .color-preview { 18 | display: inline-block; 19 | width: 1em; 20 | height: 1em; 21 | background-color: #bdc3c7; 22 | border-radius: 100%; 23 | margin: 10px 2px 0px 2px; 24 | } 25 | 26 | .color-preview.primary { 27 | background-color: #428bca; 28 | } 29 | 30 | .color-preview.success { 31 | background-color: #5cb85c; 32 | } 33 | 34 | span.color-preview.warning { 35 | background-color: #f0ad4e; 36 | } 37 | 38 | span.color-preview.info { 39 | background-color: #5bc0de; 40 | } 41 | 42 | span.color-preview.danger { 43 | background-color: #d9534f; 44 | } 45 | 46 | `] 47 | }) 48 | export class DemosRadioButtonComponent implements OnInit { 49 | 50 | public readonly DemoRadioRouteName = DemoRadioRouteName; 51 | 52 | constructor(private navigation: NavigationService) { } 53 | 54 | ngOnInit() { 55 | } 56 | 57 | onChange(event: PrettyCheckBoxChange) { 58 | console.log('event', event); 59 | } 60 | 61 | goToDemoCheckbox(page?: DemoRadioRouteName) { 62 | this.navigation.goToDemoRadio(page); 63 | } 64 | 65 | } 66 | 67 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/home/home.component.html: -------------------------------------------------------------------------------- 1 |

2 |
3 | Pretty checkbox angular 4 |
5 |
6 | NgxPrettyCheckbox 7 |
8 |

9 | 10 |
11 |
12 |

13 | Quickly integrate pretty checkbox Components (checkbox, switch, radio button) with Angular 14 |

15 | 16 |
17 |
18 |
19 |
20 |
21 | Pretty checkbox preview 22 |
-------------------------------------------------------------------------------- /apps/git-page/src/app/components/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-home', 5 | templateUrl: './home.component.html' 6 | }) 7 | export class HomeComponent implements OnInit { 8 | 9 | constructor() { } 10 | 11 | ngOnInit(): void { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/install-lib/install-lib.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-install-lib', 5 | templateUrl: './install-lib.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class InstallLibComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/components/install-scss-customize/install-scss-customize.component.html: -------------------------------------------------------------------------------- 1 |

SCSS Customize

2 | 3 |
4 | Settings: 5 |
6 | 7 |
If you felt the name is not-so-pretty, you can always change!
8 | 11 | 12 |
Are you sure, you wanna change my handpicked awesome super duper colors?
13 | 14 | 23 | 24 |
UH, boring z-index stuff, who cares.
25 | 26 | 31 | 32 |
Nobody will change this.
33 | 34 | 38 |
39 | 40 | 41 |
42 | Import: 43 |
44 | 45 |
REQUIRED
46 | 50 | 51 |
OPTIONALS
52 | 81 |
-------------------------------------------------------------------------------- /apps/git-page/src/app/components/install-scss-customize/install-scss-customize.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-install-scss-customize', 5 | templateUrl: './install-scss-customize.component.html', 6 | changeDetection: ChangeDetectionStrategy.OnPush 7 | }) 8 | export class InstallScssCustomizeComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/git-page/src/app/enums.ts: -------------------------------------------------------------------------------- 1 | export enum MainRouteName { 2 | Home = 'home', 3 | DemoCheckbox = 'demo-checkbox', 4 | DemoRadio = 'demo-radio', 5 | API = 'api', 6 | Install = 'install' 7 | } 8 | 9 | export enum InstallRouteName { 10 | Lib = 'lib', 11 | ScssCustomize = 'scss-customize' 12 | } 13 | 14 | export enum DemoRadioRouteName { 15 | All = 'all', 16 | Basic = 'basic', 17 | Animations = 'animations', 18 | Color = 'color', 19 | ColorOutlineIcon = 'color-outline-icon', 20 | ColorIcon = 'color-icon', 21 | Plain = 'plain', 22 | Switch = 'switch', 23 | } 24 | 25 | export enum DemoCheckboxesRouteName { 26 | Basic = 'basic', 27 | Switch = 'switch', 28 | Colors = 'colors', 29 | 30 | MixedColor = 'mixed-color', 31 | MixedOutline = 'mixed-outline', 32 | MixedSquareFill = 'mixed-square-fill', 33 | MixedSquareThick = 'mixed-square-thick', 34 | MixedSquareThickOutline = 'mixed-square-thick-outline', 35 | MixedCurve = 'mixed-curve', 36 | MixedCurveOutline = 'mixed-curve-outline', 37 | MixedCurveFill = 'mixed-curve-fill', 38 | MixedCurveThick = 'mixed-curve-thick', 39 | MixedRound = 'mixed-round', 40 | MixedRoundFill = 'mixed-round-fill', 41 | MixedRoundThick = 'mixed-round-thick', 42 | MixedSwitch = 'mixed-switch', 43 | 44 | FontIcons = 'font-icons', 45 | Svg = 'svg', 46 | Image = 'image', 47 | 48 | Animations = 'animations', 49 | AnimationSmooth = 'animation-smooth', 50 | AnimationJelly = 'animation-jelly', 51 | AnimationTada = 'animation-tada', 52 | AnimationRotate = 'animation-rotate', 53 | AnimationPulse = 'animation-pulse', 54 | 55 | Toggle = 'toggle', 56 | Scalability = 'scalability', 57 | States = 'states', 58 | All = 'all', 59 | 60 | Plain = 'plain', 61 | Disable = 'disable', 62 | Lock = 'lock', 63 | Size = 'size', 64 | } 65 | 66 | export enum ApiRouteName { 67 | Checkbox = 'checkbox', 68 | CheckboxWillChange = 'checkbox-will-change', 69 | RadioGroup = 'radio-group', 70 | Radio = 'radio', 71 | RadioWillChange = 'radio-will-change', 72 | Interfaces = 'interfaces', 73 | Enums = 'enums', 74 | Toggle = 'toggle', 75 | 76 | ToggleWillChange = 'toggle-will-change', 77 | Hover = 'hover', 78 | HoverWillChange = 'hover-will-change', 79 | Indeterminate = 'indeterminate', 80 | IndeterminateWillChange = 'indeterminate-will-change', 81 | Icon = 'icon', 82 | Svg = 'svg', 83 | Image = 'image' 84 | } 85 | -------------------------------------------------------------------------------- /apps/git-page/src/app/navigation.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Router } from '@angular/router'; 3 | import { DemoCheckboxesRouteName, MainRouteName, ApiRouteName, InstallRouteName, DemoRadioRouteName } from './enums'; 4 | 5 | @Injectable({ 6 | providedIn: 'root' 7 | }) 8 | export class NavigationService { 9 | 10 | constructor(private route: Router) { } 11 | 12 | goToDemoCheckbox(page?: DemoCheckboxesRouteName) { 13 | if (page) { 14 | this.route.navigate([MainRouteName.DemoCheckbox, page]); 15 | 16 | } else { 17 | this.route.navigate([MainRouteName.DemoCheckbox]); 18 | } 19 | } 20 | 21 | goToDemoRadio(page?: DemoRadioRouteName) { 22 | if (page) { 23 | this.route.navigate([MainRouteName.DemoRadio, page]); 24 | 25 | } else { 26 | this.route.navigate([MainRouteName.DemoRadio]); 27 | } 28 | } 29 | 30 | goToApi(page?: ApiRouteName) { 31 | if (page) { 32 | this.route.navigate([MainRouteName.API, page]); 33 | 34 | } else { 35 | this.route.navigate([MainRouteName.API]); 36 | } 37 | } 38 | 39 | goToInstall(page?: InstallRouteName) { 40 | if (page) { 41 | this.route.navigate([MainRouteName.Install, page]); 42 | 43 | } else { 44 | this.route.navigate([MainRouteName.Install]); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /apps/git-page/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/git-page/src/assets/.gitkeep -------------------------------------------------------------------------------- /apps/git-page/src/assets/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/git-page/src/assets/logo.gif -------------------------------------------------------------------------------- /apps/git-page/src/assets/preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/git-page/src/assets/preview.gif -------------------------------------------------------------------------------- /apps/git-page/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/apps/git-page/src/favicon.ico -------------------------------------------------------------------------------- /apps/git-page/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | GitPage 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /apps/git-page/src/main.ts: -------------------------------------------------------------------------------- 1 | import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; 2 | import { AppModule } from './app/app.module'; 3 | 4 | platformBrowserDynamic().bootstrapModule(AppModule) 5 | .catch(err => console.error(err)); -------------------------------------------------------------------------------- /apps/git-page/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "src/main.ts" 9 | ], 10 | "include": [ 11 | "src/**/*.d.ts" 12 | ], 13 | "exclude": [ 14 | "jest.config.ts", 15 | "src/**/*.test.ts", 16 | "src/**/*.spec.ts" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /apps/git-page/tsconfig.editor.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "include": [ 4 | "src/**/*.ts" 5 | ], 6 | "compilerOptions": { 7 | "types": [ 8 | "jest", 9 | "node" 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /apps/git-page/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | }, 12 | { 13 | "path": "./tsconfig.editor.json" 14 | } 15 | ], 16 | "compilerOptions": { 17 | "target": "es2022", 18 | }, 19 | } 20 | -------------------------------------------------------------------------------- /apps/git-page/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "../../.eslintrc.json" 4 | ], 5 | "ignorePatterns": [ 6 | "!**/*" 7 | ], 8 | "overrides": [ 9 | { 10 | "files": [ 11 | "*.ts" 12 | ], 13 | "rules": { 14 | "@angular-eslint/directive-selector": [ 15 | "error", 16 | { 17 | "type": "attribute", 18 | "prefix": "app", 19 | "style": "camelCase" 20 | } 21 | ], 22 | "@angular-eslint/component-selector": [ 23 | "error", 24 | { 25 | "type": "element", 26 | "prefix": "app", 27 | "style": "kebab-case" 28 | } 29 | ] 30 | }, 31 | "extends": [ 32 | "plugin:@nx/angular", 33 | "plugin:@angular-eslint/template/process-inline-templates" 34 | ] 35 | }, 36 | { 37 | "files": [ 38 | "*.html" 39 | ], 40 | "extends": [ 41 | "plugin:@nx/angular-template" 42 | ], 43 | "rules": {} 44 | } 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | export default { 3 | displayName: 'libs-ngx-pretty-checkbox', 4 | preset: '../../jest.preset.js', 5 | setupFilesAfterEnv: ['/src/test-setup.ts'], 6 | coverageDirectory: '../../coverage/libs/ngx-pretty-checkbox', 7 | transform: { 8 | '^.+\\.(ts|mjs|js|html)$': [ 9 | 'jest-preset-angular', 10 | { 11 | tsconfig: '/tsconfig.spec.json', 12 | stringifyContentPathRegex: '\\.(html|svg)$', 13 | }, 14 | ], 15 | }, 16 | transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], 17 | snapshotSerializers: [ 18 | 'jest-preset-angular/build/serializers/no-ng-attributes', 19 | 'jest-preset-angular/build/serializers/ng-snapshot', 20 | 'jest-preset-angular/build/serializers/html-comment', 21 | ] 22 | }; 23 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/libs/ngx-pretty-checkbox", 4 | "lib": { 5 | "entryFile": "src/index.ts" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ngx-pretty-checkbox", 3 | "version": "18.0.0", 4 | "peerDependencies": { 5 | "@angular/common": "^18.0.0", 6 | "@angular/core": "^18.0.0", 7 | "pretty-checkbox": "^3.0.3" 8 | }, 9 | "dependencies": { 10 | "tslib": "^2.3.0" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/miladfm/ngx-pretty-checkbox/issues" 14 | }, 15 | "author": { 16 | "name": "Milad Faghihi" 17 | }, 18 | "description": "Quickly integrate pretty checkbox Components (checkbox, switch, radio button) with Angular", 19 | "homepage": "https://miladfm.github.io/ngx-pretty-checkbox", 20 | "keywords": [ 21 | "checkbox", 22 | "radio", 23 | "bootstrap", 24 | "fonticon", 25 | "icon", 26 | "svg", 27 | "switch", 28 | "toggle", 29 | "sass", 30 | "css3", 31 | "animation", 32 | "pretty", 33 | "check", 34 | "colors", 35 | "angular", 36 | "ivy" 37 | ], 38 | "license": "MIT", 39 | "repository": { 40 | "type": "git", 41 | "url": "git+https://github.com/miladfm/ngx-pretty-checkbox.git", 42 | "link": "https://github.com/miladfm/ngx-pretty-checkbox" 43 | }, 44 | "main": "bundles/ngx-pretty-checkbox.umd.js", 45 | "module": "fesm2015/ngx-pretty-checkbox.js", 46 | "es2015": "fesm2015/ngx-pretty-checkbox.js", 47 | "esm2015": "esm2015/ngx-pretty-checkbox.js", 48 | "fesm2015": "fesm2015/ngx-pretty-checkbox.js", 49 | "typings": "ngx-pretty-checkbox.d.ts", 50 | "metadata": "ngx-pretty-checkbox.metadata.json", 51 | "sideEffects": false 52 | } -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "libs-ngx-pretty-checkbox", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "projectType": "library", 5 | "sourceRoot": "libs/ngx-pretty-checkbox/src", 6 | "prefix": "app", 7 | "targets": { 8 | "build": { 9 | "executor": "@nx/angular:package", 10 | "outputs": [ 11 | "{workspaceRoot}/dist/{projectRoot}" 12 | ], 13 | "options": { 14 | "project": "libs/ngx-pretty-checkbox/ng-package.json" 15 | }, 16 | "configurations": { 17 | "production": { 18 | "tsConfig": "libs/ngx-pretty-checkbox/tsconfig.lib.prod.json" 19 | }, 20 | "development": { 21 | "tsConfig": "libs/ngx-pretty-checkbox/tsconfig.lib.json" 22 | } 23 | }, 24 | "defaultConfiguration": "production" 25 | }, 26 | "test": { 27 | "executor": "@nx/jest:jest", 28 | "outputs": [ 29 | "{workspaceRoot}/coverage/{projectRoot}" 30 | ], 31 | "options": { 32 | "jestConfig": "libs/ngx-pretty-checkbox/jest.config.ts", 33 | "passWithNoTests": true 34 | }, 35 | "configurations": { 36 | "ci": { 37 | "ci": true, 38 | "codeCoverage": true 39 | } 40 | } 41 | }, 42 | "lint": { 43 | "executor": "@nx/linter:eslint", 44 | "outputs": [ 45 | "{options.outputFile}" 46 | ], 47 | "options": { 48 | "lintFilePatterns": [ 49 | "libs/ngx-pretty-checkbox/**/*.ts", 50 | "libs/ngx-pretty-checkbox/**/*.html" 51 | ] 52 | } 53 | } 54 | }, 55 | "tags": [] 56 | } 57 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./lib/components/ngx-pretty-checkbox.component"; 2 | export * from "./lib/components/ngx-pretty-checkbox-will-change.component"; 3 | export * from "./lib/components/ngx-pretty-hover.component"; 4 | export * from "./lib/components/ngx-pretty-hover-will-change.component"; 5 | export * from "./lib/components/ngx-pretty-Indeterminate.component"; 6 | export * from "./lib/components/ngx-pretty-Indeterminate-will-change.component"; 7 | export * from "./lib/components/ngx-pretty-radio.component"; 8 | export * from "./lib/components/ngx-pretty-radio-will-change.component"; 9 | export * from "./lib/components/ngx-pretty-toggle.component"; 10 | export * from "./lib/components/ngx-pretty-toggle-will-change.component"; 11 | export * from "./lib/directives/ngx-pretty-icon.directive"; 12 | export * from "./lib/directives/ngx-pretty-image.directive"; 13 | export * from "./lib/directives/ngx-pretty-radio-group.directive"; 14 | export * from "./lib/directives/ngx-pretty-svg.directive"; 15 | export * from "./lib/model"; 16 | export * from "./lib/ngx-pretty-checkbox.module"; 17 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-Indeterminate-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Input, 4 | ElementRef, 5 | Renderer2, 6 | SimpleChanges, 7 | OnChanges, 8 | ChangeDetectionStrategy, 9 | ViewEncapsulation 10 | } from '@angular/core'; 11 | import { getColorClassName } from '../utils'; 12 | import { PrettyCheckboxColor } from '../model'; 13 | import {CommonModule} from "@angular/common"; 14 | 15 | @Component({ 16 | selector: 'ngx-p-indeterminate[will-change], p-indeterminate[will-change]', 17 | standalone: true, 18 | imports: [CommonModule], 19 | encapsulation: ViewEncapsulation.None, 20 | changeDetection: ChangeDetectionStrategy.OnPush, 21 | host: { 22 | class: `state p-is-indeterminate` 23 | }, 24 | template: ` 25 | 26 | 27 | `, 28 | styles: [] 29 | }) 30 | export class NgxPrettyIndeterminateWillChangeComponent implements OnChanges { 31 | 32 | @Input() color: PrettyCheckboxColor; 33 | @Input() outline = false; 34 | 35 | constructor(private el: ElementRef, private renderer: Renderer2) { } 36 | 37 | ngOnChanges(changes: SimpleChanges) { 38 | if (changes.color || changes.outline) { 39 | 40 | const oldClass = 41 | getColorClassName( 42 | changes.color ? changes.color.previousValue : this.color, 43 | changes.outline ? changes.outline.previousValue : null 44 | ); 45 | 46 | const newClass = 47 | getColorClassName( 48 | changes.color ? changes.color.currentValue : this.color, 49 | changes.outline ? changes.outline.currentValue : null 50 | ); 51 | 52 | this.renderer.removeClass(this.el.nativeElement, oldClass); 53 | this.renderer.addClass(this.el.nativeElement, newClass); 54 | } 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-Indeterminate.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Input, 4 | ElementRef, 5 | Renderer2, 6 | AfterViewInit, 7 | ChangeDetectionStrategy, 8 | Attribute, 9 | ViewEncapsulation 10 | } from '@angular/core'; 11 | import { PrettyCheckboxColor } from '../model'; 12 | import {CommonModule} from "@angular/common"; 13 | 14 | @Component({ 15 | selector: 'ngx-p-indeterminate:not([will-change]), p-indeterminate:not([will-change])', 16 | standalone: true, 17 | imports: [CommonModule], 18 | encapsulation: ViewEncapsulation.None, 19 | changeDetection: ChangeDetectionStrategy.OnPush, 20 | host: { 21 | class: `state p-is-indeterminate` 22 | }, 23 | template: ` 24 | 25 | 26 | `, 27 | styles: [] 28 | }) 29 | export class NgxPrettyIndeterminateComponent implements AfterViewInit { 30 | 31 | constructor( 32 | private el: ElementRef, 33 | private renderer: Renderer2, 34 | @Attribute('outline') private _outline = false, 35 | @Attribute('color') private _color: PrettyCheckboxColor, 36 | ) { } 37 | 38 | ngAfterViewInit() { 39 | if (this._color) { 40 | this.renderer.addClass(this.el.nativeElement, 41 | `p-${this._color}${this._outline ? '-o' : ''}` 42 | ); 43 | } 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-hover-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | Input, 4 | ElementRef, 5 | Renderer2, 6 | SimpleChanges, 7 | OnChanges, 8 | ChangeDetectionStrategy, 9 | ViewEncapsulation 10 | } from '@angular/core'; 11 | import { PrettyCheckboxColor } from '../model'; 12 | import { getColorClassName } from '../utils'; 13 | import {CommonModule} from "@angular/common"; 14 | 15 | 16 | @Component({ 17 | selector: 'ngx-p-hover[will-change], p-hover[will-change]', 18 | standalone: true, 19 | imports: [CommonModule], 20 | encapsulation: ViewEncapsulation.None, 21 | changeDetection: ChangeDetectionStrategy.OnPush, 22 | host: { 23 | class: `state p-is-hover` 24 | }, 25 | template: ` 26 | 27 | 28 | `, 29 | styles: [] 30 | }) 31 | export class NgxPrettyHoverWillChangeComponent implements OnChanges { 32 | 33 | @Input() color: PrettyCheckboxColor; 34 | @Input() outline = false; 35 | 36 | constructor( 37 | private el: ElementRef, 38 | private renderer: Renderer2 39 | ) { } 40 | 41 | ngOnChanges(changes: SimpleChanges) { 42 | if (changes.color || changes.outline) { 43 | 44 | const oldClass = 45 | getColorClassName( 46 | changes.color ? changes.color.previousValue : this.color, 47 | changes.outline ? changes.outline.previousValue : null 48 | ); 49 | 50 | const newClass = 51 | getColorClassName( 52 | changes.color ? changes.color.currentValue : this.color, 53 | changes.outline ? changes.outline.currentValue : null 54 | ); 55 | 56 | this.renderer.removeClass(this.el.nativeElement, oldClass); 57 | this.renderer.addClass(this.el.nativeElement, newClass); 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-hover.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ElementRef, 4 | Renderer2, 5 | AfterViewInit, 6 | ChangeDetectionStrategy, 7 | Attribute, 8 | ViewEncapsulation 9 | } from '@angular/core'; 10 | import { PrettyCheckboxColor } from '../model'; 11 | import {CommonModule} from "@angular/common"; 12 | 13 | @Component({ 14 | selector: 'ngx-p-hover:not([will-change]), p-hover:not([will-change])', 15 | standalone: true, 16 | imports: [CommonModule], 17 | encapsulation: ViewEncapsulation.None, 18 | changeDetection: ChangeDetectionStrategy.OnPush, 19 | host: { 20 | class: `state p-is-hover` 21 | }, 22 | template: ` 23 | 24 | 25 | `, 26 | styles: [] 27 | }) 28 | export class NgxPrettyHoverComponent implements AfterViewInit { 29 | 30 | constructor( 31 | private el: ElementRef, 32 | private renderer: Renderer2, 33 | @Attribute('outline') private _outline = false, 34 | @Attribute('color') private _color: PrettyCheckboxColor, 35 | ) { } 36 | 37 | ngAfterViewInit() { 38 | if (this._color) { 39 | this.renderer.addClass(this.el.nativeElement, 40 | `p-${this._color}${this._outline ? '-o' : ''}` 41 | ); 42 | } 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-toggle-will-change.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Input, 3 | ElementRef, 4 | Component, 5 | SimpleChanges, 6 | OnChanges, 7 | Renderer2, 8 | ChangeDetectionStrategy, 9 | ViewEncapsulation 10 | } from '@angular/core'; 11 | import { PrettyCheckboxColor, PrettyCheckBoxToggleType } from '../model'; 12 | import { getColorClassName } from '../utils'; 13 | import {CommonModule} from "@angular/common"; 14 | 15 | @Component({ 16 | selector: 'ngx-p-toggle[will-change], p-toggle[will-change]', 17 | standalone: true, 18 | imports: [CommonModule], 19 | encapsulation: ViewEncapsulation.None, 20 | changeDetection: ChangeDetectionStrategy.OnPush, 21 | host: { 22 | 'class': 'state', 23 | '[class.p-on]': 'isToggleOn', 24 | '[class.p-off]': 'isToggleOff', 25 | }, 26 | template: ` 27 | 28 | 29 | `, 30 | styles: [] 31 | }) 32 | export class NgxPrettyToggleWillChangeComponent implements OnChanges { 33 | 34 | @Input() type: PrettyCheckBoxToggleType; 35 | 36 | get isToggleOn() { return this.type === PrettyCheckBoxToggleType.On; } 37 | get isToggleOff() { return this.type === PrettyCheckBoxToggleType.Off; } 38 | 39 | @Input() color: PrettyCheckboxColor; 40 | @Input() outline = false; 41 | 42 | constructor(private el: ElementRef, private renderer: Renderer2) { } 43 | 44 | ngOnChanges(changes: SimpleChanges) { 45 | if (changes.color || changes.outline) { 46 | 47 | const oldClass = 48 | getColorClassName( 49 | changes.color ? changes.color.previousValue : this.color, 50 | changes.outline ? changes.outline.previousValue : null 51 | ); 52 | 53 | const newClass = 54 | getColorClassName( 55 | changes.color ? changes.color.currentValue : this.color, 56 | changes.outline ? changes.outline.currentValue : null 57 | ); 58 | 59 | this.renderer.removeClass(this.el.nativeElement, oldClass); 60 | this.renderer.addClass(this.el.nativeElement, newClass); 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/components/ngx-pretty-toggle.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ElementRef, 3 | Component, 4 | AfterViewInit, 5 | Renderer2, 6 | ChangeDetectionStrategy, 7 | Attribute, 8 | ViewEncapsulation 9 | } from '@angular/core'; 10 | import { PrettyCheckboxColor, PrettyCheckBoxToggleType } from '../model'; 11 | import {CommonModule} from "@angular/common"; 12 | 13 | @Component({ 14 | selector: 'ngx-p-toggle:not([will-change]), p-toggle:not([will-change])', 15 | standalone: true, 16 | imports: [CommonModule], 17 | encapsulation: ViewEncapsulation.None, 18 | changeDetection: ChangeDetectionStrategy.OnPush, 19 | host: { 20 | class: 'state' 21 | }, 22 | template: ` 23 | 24 | 25 | `, 26 | styles: [] 27 | }) 28 | export class NgxPrettyToggleComponent implements AfterViewInit { 29 | 30 | constructor( 31 | private el: ElementRef, 32 | private renderer: Renderer2, 33 | @Attribute('outline') private _outline = false, 34 | @Attribute('color') private _color: PrettyCheckboxColor, 35 | @Attribute('type') private _type: PrettyCheckBoxToggleType, 36 | ) { } 37 | 38 | ngAfterViewInit() { 39 | if (this._color) { 40 | this.renderer.addClass(this.el.nativeElement, 41 | `p-${this._color}${this._outline ? '-o' : ''}` 42 | ); 43 | } 44 | 45 | this.renderer.addClass(this.el.nativeElement, `p-${this._type}`); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/directives/ngx-pretty-icon.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[pIcon], [p-icon]', 5 | standalone: true 6 | }) 7 | export class NgxPrettyIconDirective { 8 | 9 | constructor(private elemRef: ElementRef) { 10 | this.elemRef.nativeElement.classList.add('icon'); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/directives/ngx-pretty-image.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, ElementRef } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[pImage], [p-image]', 5 | standalone: true 6 | }) 7 | export class NgxPrettyImageDirective { 8 | 9 | constructor(private elemRef: ElementRef) { 10 | this.elemRef.nativeElement.classList.add('image'); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/directives/ngx-pretty-radio-group.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, Output, EventEmitter } from '@angular/core'; 2 | import { PrettyRadioChange } from '../model'; 3 | 4 | let nextId = 1; 5 | 6 | @Directive({ 7 | selector: 'ngx-pretty-radio-group, p-radio-group', 8 | standalone: true, 9 | exportAs: 'ngxRadioGroup' 10 | }) 11 | export class NgxPrettyRadioGroupDirective { 12 | 13 | public name = 'p-radio' + nextId++; 14 | 15 | @Output() change = new EventEmitter(); 16 | 17 | constructor() {} 18 | 19 | public _emitChange(event: PrettyRadioChange) { 20 | this.change.emit(event); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/directives/ngx-pretty-svg.directive.ts: -------------------------------------------------------------------------------- 1 | import { Directive, AfterViewInit, ElementRef } from '@angular/core'; 2 | 3 | @Directive({ 4 | selector: '[pSvg], [p-svg]', 5 | standalone: true 6 | }) 7 | export class NgxPrettySvgDirective implements AfterViewInit { 8 | 9 | constructor(private elemRef: ElementRef) { } 10 | 11 | ngAfterViewInit(): void { 12 | this.elemRef.nativeElement.classList.add('svg'); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/model.ts: -------------------------------------------------------------------------------- 1 | export enum PrettyCheckBoxToggleType { 2 | On = 'on', 3 | Off = 'off' 4 | } 5 | export enum PrettyCheckboxStroke { 6 | // Accept Null 7 | Fill = 'fill', // Square and Switch 8 | Thick = 'thick', // Square 9 | Slim = 'slim' // Switch 10 | } 11 | 12 | export enum PrettyCheckboxShape { 13 | // Accept Null 14 | Curve = 'curve', 15 | Round = 'round', 16 | } 17 | 18 | 19 | export enum PrettyCheckboxColor { 20 | Primary = 'primary', 21 | Success = 'success', 22 | Info = 'info', 23 | Warning = 'warning', 24 | Danger = 'danger', 25 | } 26 | 27 | export enum PrettyCheckboxAnimation { 28 | Smooth = 'smooth', 29 | Jelly = 'jelly', 30 | Tada = 'tada', 31 | Rotate = 'rotate', 32 | Pulse = 'pulse', 33 | } 34 | 35 | export interface PrettyCheckBoxChange { 36 | checked: boolean; 37 | value: string; 38 | event: Event; 39 | } 40 | 41 | export interface PrettyRadioChange { 42 | checked: boolean; 43 | value: string; 44 | event: Event; 45 | } 46 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/ngx-pretty-checkbox.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { NgxPrettyIconDirective } from './directives/ngx-pretty-icon.directive'; 3 | import { NgxPrettyImageDirective } from './directives/ngx-pretty-image.directive'; 4 | import { NgxPrettyRadioGroupDirective } from './directives/ngx-pretty-radio-group.directive'; 5 | import { NgxPrettySvgDirective } from './directives/ngx-pretty-svg.directive'; 6 | import { NgxPrettyCheckboxComponent } from './components/ngx-pretty-checkbox.component'; 7 | import { NgxPrettyCheckboxWillChangeComponent } from './components/ngx-pretty-checkbox-will-change.component'; 8 | import { NgxPrettyToggleComponent } from './components/ngx-pretty-toggle.component'; 9 | import { NgxPrettyToggleWillChangeComponent } from './components/ngx-pretty-toggle-will-change.component'; 10 | import { NgxPrettyHoverComponent } from './components/ngx-pretty-hover.component'; 11 | import { NgxPrettyHoverWillChangeComponent } from './components/ngx-pretty-hover-will-change.component'; 12 | import { NgxPrettyIndeterminateComponent } from './components/ngx-pretty-Indeterminate.component'; 13 | import { NgxPrettyIndeterminateWillChangeComponent } from './components/ngx-pretty-Indeterminate-will-change.component'; 14 | import { NgxPrettyRadioComponent } from './components/ngx-pretty-radio.component'; 15 | import { NgxPrettyRadioWillChangeComponent } from './components/ngx-pretty-radio-will-change.component'; 16 | 17 | const DECLARATIONS = [ 18 | NgxPrettyCheckboxComponent, 19 | NgxPrettyCheckboxWillChangeComponent, 20 | 21 | NgxPrettyIconDirective, 22 | NgxPrettySvgDirective, 23 | NgxPrettyImageDirective, 24 | 25 | NgxPrettyToggleComponent, 26 | NgxPrettyToggleWillChangeComponent, 27 | 28 | NgxPrettyHoverComponent, 29 | NgxPrettyHoverWillChangeComponent, 30 | 31 | NgxPrettyIndeterminateComponent, 32 | NgxPrettyIndeterminateWillChangeComponent, 33 | 34 | NgxPrettyRadioGroupDirective, 35 | NgxPrettyRadioComponent, 36 | NgxPrettyRadioWillChangeComponent 37 | ]; 38 | 39 | 40 | @NgModule({ 41 | imports: [ DECLARATIONS ], 42 | exports: [ DECLARATIONS ] 43 | }) 44 | export class NgxPrettyCheckboxModule { } 45 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/src/lib/utils.ts: -------------------------------------------------------------------------------- 1 | import { PrettyCheckboxColor } from './model'; 2 | 3 | export function getColorClassName(color: PrettyCheckboxColor, outline?: boolean) { 4 | if (!color) { return null; } 5 | return 'p-' + color + (outline ? '-o' : ''); 6 | } 7 | 8 | export function strToBoolean(str: string | boolean = ''): boolean { 9 | if (typeof str === 'boolean') { 10 | return str; 11 | } 12 | 13 | const regex = /^\s*(true|1|on|enable)\s*$/i; 14 | return regex.test(str); 15 | } 16 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.lib.json" 8 | } 9 | ], 10 | "compilerOptions": { 11 | "target": "es2020" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "target": "ES2022", 6 | "declaration": true, 7 | "declarationMap": true, 8 | "inlineSources": true, 9 | "types": [], 10 | "lib": ["dom", "es2018"], 11 | "useDefineForClassFields": false 12 | }, 13 | "angularCompilerOptions": { 14 | "skipTemplateCodegen": true, 15 | "strictMetadataEmit": true, 16 | "enableResourceInlining": true 17 | }, 18 | "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], 19 | "include": ["src/**/*.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/ngx-pretty-checkbox/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.lib.json", 3 | "compilerOptions": { 4 | "declarationMap": false, 5 | "target": "ES2022", 6 | "useDefineForClassFields": false, 7 | "declaration": true, 8 | "sourceMap": true 9 | }, 10 | "angularCompilerOptions": { 11 | "compilationMode": "partial" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/logo.gif -------------------------------------------------------------------------------- /migrations.json: -------------------------------------------------------------------------------- 1 | { 2 | "migrations": [ 3 | { 4 | "cli": "nx", 5 | "version": "19.2.0-beta.2", 6 | "description": "Updates the default workspace data directory to .nx/workspace-data", 7 | "implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory", 8 | "package": "nx", 9 | "name": "19-2-0-move-graph-cache-directory" 10 | }, 11 | { 12 | "cli": "nx", 13 | "version": "19.2.2-beta.0", 14 | "description": "Updates the nx wrapper.", 15 | "implementation": "./src/migrations/update-17-3-0/update-nxw", 16 | "package": "nx", 17 | "name": "19-2-2-update-nx-wrapper" 18 | }, 19 | { 20 | "version": "19.2.4-beta.0", 21 | "description": "Set project name in nx.json explicitly", 22 | "implementation": "./src/migrations/update-19-2-4/set-project-name", 23 | "x-repair-skip": true, 24 | "package": "nx", 25 | "name": "19-2-4-set-project-name" 26 | }, 27 | { 28 | "cli": "nx", 29 | "version": "19.1.0-beta.6", 30 | "description": "Migrate no-extra-semi rules into user config, out of nx extendable configs", 31 | "implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi", 32 | "package": "@nx/eslint-plugin", 33 | "name": "update-19-1-0-rename-no-extra-semi" 34 | }, 35 | { 36 | "cli": "nx", 37 | "version": "19.1.0-beta.2", 38 | "requires": { 39 | "@angular/core": ">=18.0.0" 40 | }, 41 | "description": "Update the @angular/cli package version to ~18.0.0.", 42 | "factory": "./src/migrations/update-19-1-0/update-angular-cli", 43 | "package": "@nx/angular", 44 | "name": "update-angular-cli-version-18-0-0" 45 | }, 46 | { 47 | "cli": "nx", 48 | "version": "19.2.1-beta.0", 49 | "requires": { 50 | "@angular-eslint/eslint-plugin": ">=18.0.0" 51 | }, 52 | "description": "Installs the '@typescript-eslint/utils' package when having installed '@angular-eslint/eslint-plugin' or '@angular-eslint/eslint-plugin-template' with version >=18.0.0.", 53 | "factory": "./src/migrations/update-19-2-1/add-typescript-eslint-utils", 54 | "package": "@nx/angular", 55 | "name": "add-typescript-eslint-utils" 56 | }, 57 | { 58 | "version": "18.0.0", 59 | "description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.", 60 | "factory": "./migrations/invalid-two-way-bindings/bundle", 61 | "package": "@angular/core", 62 | "name": "invalid-two-way-bindings" 63 | }, 64 | { 65 | "version": "18.0.0", 66 | "description": "Replace deprecated HTTP related modules with provider functions", 67 | "factory": "./migrations/http-providers/bundle", 68 | "package": "@angular/core", 69 | "name": "migration-http-providers" 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasksRunnerOptions": { 3 | "default": { 4 | "runner": "nx-cloud", 5 | "options": { 6 | "cacheableOperations": [], 7 | "accessToken": "NzVlNGFjNDAtMjljMi00YjM1LTk5M2ItY2FkNTU2MzRmYjk0fHJlYWQtd3JpdGU=" 8 | } 9 | } 10 | }, 11 | "defaultBase": "master", 12 | "generators": { 13 | "@nx/angular:application": { 14 | "style": "scss", 15 | "linter": "eslint", 16 | "unitTestRunner": "jest", 17 | "e2eTestRunner": "cypress" 18 | }, 19 | "@nx/angular:library": { 20 | "linter": "eslint", 21 | "unitTestRunner": "jest" 22 | }, 23 | "@nx/angular:component": { 24 | "style": "scss" 25 | } 26 | }, 27 | "targetDefaults": { 28 | "lint": { 29 | "inputs": [ 30 | "default", 31 | "{workspaceRoot}/.eslintrc.json", 32 | "{workspaceRoot}/.eslintignore" 33 | ] 34 | }, 35 | "test": { 36 | "inputs": [ 37 | "default", 38 | "^default", 39 | "{workspaceRoot}/jest.preset.js", 40 | "{workspaceRoot}/jest.preset.js", 41 | "{workspaceRoot}/jest.preset.js" 42 | ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ngx-pretty-checkbox", 3 | "version": "0.0.0", 4 | "scripts": { 5 | "start:demo": "nx run demo:serve", 6 | "start:git-page": "nx run git-page:serve", 7 | "build:lib": "nx run libs-ngx-pretty-checkbox:build:production", 8 | "publish": "npx tsx tools/publish/main.ts" 9 | }, 10 | "private": true, 11 | "dependencies": { 12 | "@angular/animations": "18.0.4", 13 | "@angular/common": "18.0.4", 14 | "@angular/compiler": "18.0.4", 15 | "@angular/core": "18.0.4", 16 | "@angular/forms": "18.0.4", 17 | "@angular/platform-browser": "18.0.4", 18 | "@angular/platform-browser-dynamic": "18.0.4", 19 | "@angular/router": "18.0.4", 20 | "@nx/angular": "19.3.0", 21 | "cpx": "^1.5.0", 22 | "material-design-icons": "^3.0.1", 23 | "material-design-lite": "^1.3.0", 24 | "ngx-highlight-js": "^15.0.0", 25 | "pretty-checkbox": "^3.0.3", 26 | "rxjs": "~6.5.5", 27 | "tslib": "^2.3.0", 28 | "zone.js": "0.14.4" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "18.0.5", 32 | "@angular-devkit/core": "18.0.5", 33 | "@angular-devkit/schematics": "18.0.5", 34 | "@angular-eslint/eslint-plugin": "18.0.1", 35 | "@angular-eslint/eslint-plugin-template": "18.0.1", 36 | "@angular-eslint/template-parser": "18.0.1", 37 | "@angular/cli": "~18.0.0", 38 | "@angular/compiler-cli": "18.0.4", 39 | "@angular/language-service": "18.0.4", 40 | "@nx/cypress": "19.3.0", 41 | "@nx/eslint-plugin": "19.3.0", 42 | "@nx/jest": "19.3.0", 43 | "@nx/js": "19.3.0", 44 | "@nx/linter": "19.3.0", 45 | "@schematics/angular": "18.0.5", 46 | "@types/cpx": "^1.5.2", 47 | "@types/jasmine": "~3.6.0", 48 | "@types/jasminewd2": "~2.0.3", 49 | "@types/jest": "^29.4.0", 50 | "@types/node": "18.19.31", 51 | "@typescript-eslint/eslint-plugin": "7.7.1", 52 | "@typescript-eslint/parser": "7.7.1", 53 | "@typescript-eslint/utils": "^8.0.0-alpha.28", 54 | "codelyzer": "^6.0.0", 55 | "cypress": "12.17.4", 56 | "eslint": "8.57.0", 57 | "eslint-config-prettier": "9.1.0", 58 | "eslint-plugin-cypress": "2.14.0", 59 | "jasmine-spec-reporter": "~5.0.0", 60 | "jest": "^29.4.1", 61 | "jest-environment-jsdom": "^29.4.1", 62 | "jest-preset-angular": "14.1.1", 63 | "ng-packagr": "18.0.0", 64 | "nx": "19.3.0", 65 | "nx-cloud": "19.0.0", 66 | "postcss": "^8.4.5", 67 | "postcss-import": "~14.1.0", 68 | "postcss-preset-env": "~7.5.0", 69 | "postcss-url": "~10.1.3", 70 | "protractor": "~7.0.0", 71 | "ts-jest": "29.1.1", 72 | "ts-node": "10.9.1", 73 | "tslint": "~6.1.0", 74 | "typescript": "5.4.5" 75 | }, 76 | "nx": { 77 | "targets": {} 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/miladfm/ngx-pretty-checkbox/492c22f17d8b03e5717568515f85dcdf14514c37/preview.gif -------------------------------------------------------------------------------- /tools/publish/main.ts: -------------------------------------------------------------------------------- 1 | import { PrintProcess } from "./print-process"; 2 | import { PrintProcessStepState } from "./print-process.model"; 3 | import { execSync } from "./terminal-exec"; 4 | import * as cpx from "cpx"; 5 | import fs from 'fs'; 6 | import {terminalConfirm} from "./terminal-interaction"; 7 | 8 | const libPackageJson = JSON.parse(fs.readFileSync('libs/ngx-pretty-checkbox/package.json', 'utf-8')) 9 | 10 | enum PublishPackageStep { 11 | BuildLib, 12 | CopyAssetsFolder, 13 | PublishNpm, 14 | GitTag 15 | } 16 | 17 | let printProcess: PrintProcess; 18 | 19 | function onErrorExec(step: PublishPackageStep) { 20 | return () => { 21 | printProcess.updateState(step, PrintProcessStepState.Error); 22 | }; 23 | } 24 | 25 | 26 | async function run() { 27 | // const versionString = await getNewSemanticVersion(libPackageJson.version); 28 | const confirmedPublish = await terminalConfirm(`Are you sure to publish this version (${libPackageJson.version}?)`, false); 29 | 30 | if (!confirmedPublish) { 31 | return; 32 | } 33 | 34 | printProcess = new PrintProcess([ 35 | { id: PublishPackageStep.BuildLib, state: PrintProcessStepState.Default, text: 'Build release library' }, 36 | { id: PublishPackageStep.CopyAssetsFolder, state: PrintProcessStepState.Default, text: 'Copy assets file library dist folder' }, 37 | { id: PublishPackageStep.PublishNpm, state: PrintProcessStepState.Default, text: 'Publish to npm' }, 38 | 39 | { id: PublishPackageStep.GitTag, state: PrintProcessStepState.Default, text: 'Git tag' }, 40 | ], { 41 | header: `Publish new version of ngx-pretty-checkbox to npm (${libPackageJson.version})`, 42 | }); 43 | 44 | 45 | // 1- Build Lib 46 | printProcess.updateState(PublishPackageStep.BuildLib, PrintProcessStepState.Pending); 47 | execSync(`nx run libs-ngx-pretty-checkbox:build:production`, onErrorExec(PublishPackageStep.BuildLib)); 48 | printProcess.updateState(PublishPackageStep.BuildLib, PrintProcessStepState.Done); 49 | 50 | // 2- Copy assets file library dist folder 51 | printProcess.updateState(PublishPackageStep.CopyAssetsFolder, PrintProcessStepState.Pending); 52 | cpx.copySync('logo.gif', 'dist/libs/ngx-pretty-checkbox'); 53 | cpx.copySync('preview.gif', 'dist/libs/ngx-pretty-checkbox'); 54 | cpx.copySync('README.md', 'dist/libs/ngx-pretty-checkbox'); 55 | printProcess.updateState(PublishPackageStep.CopyAssetsFolder, PrintProcessStepState.Done); 56 | 57 | // 3- Publish to npm 58 | printProcess.updateState(PublishPackageStep.PublishNpm, PrintProcessStepState.Pending); 59 | execSync(`cd dist/libs/ngx-pretty-checkbox && npm publish`, onErrorExec(PublishPackageStep.PublishNpm)); 60 | printProcess.updateState(PublishPackageStep.PublishNpm, PrintProcessStepState.Done); 61 | 62 | // 4- Github Versioning 63 | printProcess.updateState(PublishPackageStep.GitTag, PrintProcessStepState.Pending); 64 | execSync(`git tag v${libPackageJson.version} -f`, onErrorExec(PublishPackageStep.GitTag)); 65 | execSync(`git push --tags`, onErrorExec(PublishPackageStep.GitTag)); 66 | printProcess.updateState(PublishPackageStep.GitTag, PrintProcessStepState.Done); 67 | } 68 | 69 | run(); -------------------------------------------------------------------------------- /tools/publish/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tools-publish", 3 | "type": "module", 4 | "version": "0.0.1", 5 | "sideEffects": false 6 | } 7 | -------------------------------------------------------------------------------- /tools/publish/print-process.model.ts: -------------------------------------------------------------------------------- 1 | export type PrintProcessStepId = string | number; 2 | 3 | export enum PrintProcessStepState { 4 | Default, 5 | Pending, 6 | Done, 7 | Error 8 | } 9 | 10 | export interface PrintProcessStep { 11 | id: PrintProcessStepId; 12 | state: PrintProcessStepState, 13 | text: string 14 | } 15 | 16 | export interface PrintProcessConfig { 17 | autoPrint: boolean; 18 | header?: string; 19 | dividerSize?: number; // Default is length of header. 20 | dividerPadding: number; 21 | } 22 | 23 | export const DEFAULT_CONFIG: PrintProcessConfig = { 24 | autoPrint: true, 25 | dividerPadding: 1 26 | } -------------------------------------------------------------------------------- /tools/publish/print.ts: -------------------------------------------------------------------------------- 1 | import chalk from 'chalk'; 2 | 3 | // Global 4 | export const print = console.log; 5 | 6 | // Header 7 | export const header = chalk.keyword('orange'); 8 | export const printHeader = (message: string) => print(header(message)); 9 | 10 | // Info 11 | export const info = chalk.keyword('green'); 12 | export const printInfo = (message: string) => print(info(message)); 13 | 14 | // Error 15 | export const error = chalk.keyword('red'); 16 | export const printError = (message: string) => print(error(message)); 17 | 18 | // Divider 19 | export const divider = (length: number) => "-".repeat(length); 20 | export const printDivider = (length: number) => print(divider(length)); 21 | 22 | 23 | // Remove Line 24 | export function removeLinesInTerminal(lineToRemove: number) { 25 | for (let index = 0; index < lineToRemove; index++) { 26 | process.stdout.moveCursor(0, -1) // up one line 27 | process.stdout.clearLine(1) // from cursor to end 28 | } 29 | } -------------------------------------------------------------------------------- /tools/publish/semantic-version.ts: -------------------------------------------------------------------------------- 1 | import { terminalConfirm, terminalInput, terminalListSelection } from "./terminal-interaction"; 2 | 3 | function stringVersionToNumber(version: string) { 4 | return version.split('.').map(v => parseInt(v)); 5 | } 6 | 7 | 8 | function validateStringVersion(versionString: string) { 9 | const version = stringVersionToNumber(versionString); 10 | return version.length === 3 && version.every(v => !isNaN(v)) 11 | } 12 | 13 | 14 | function getVersionFromSuggestions(currentStringVersion: string): Promise { 15 | 16 | const currentVersion = stringVersionToNumber(currentStringVersion); 17 | 18 | const newVersionSuggestions = { 19 | patch: `${currentVersion[0]}.${currentVersion[1]}.${currentVersion[2] + 1}`, 20 | minor: `${currentVersion[0]}.${currentVersion[1] + 1}.0`, 21 | major: `${currentVersion[0] + 1}.0.0`, 22 | } 23 | 24 | return terminalListSelection( 25 | `Select the new version (Current version is ${currentStringVersion})`, 26 | [ 27 | { value: newVersionSuggestions.patch, text: newVersionSuggestions.patch }, 28 | { value: newVersionSuggestions.minor, text: newVersionSuggestions.minor }, 29 | { value: newVersionSuggestions.major, text: newVersionSuggestions.major }, 30 | { value: 'Custom', text: 'Custom' }, 31 | ] 32 | ) 33 | } 34 | 35 | function getCustomVersion() { 36 | 37 | const validator = (newStringVersion: string) => { 38 | const isVersionValid = validateStringVersion(newStringVersion); 39 | return isVersionValid ? true : 'Version is invalid (Example: 1.2.4)' 40 | } 41 | 42 | return terminalInput(`Enter the new version`, validator); 43 | } 44 | 45 | function getConfirmation(newStringVersion: string) { 46 | return terminalConfirm(`Are you sure to publish version ${newStringVersion}?)`, false); 47 | } 48 | 49 | export async function getNewSemanticVersion(currentStringVersion: string): Promise { 50 | 51 | let versionString: string | 'Custom' = await getVersionFromSuggestions(currentStringVersion); 52 | 53 | if (versionString === 'Custom') { 54 | versionString = await getCustomVersion(); 55 | } 56 | 57 | return getConfirmation(versionString) 58 | .then(confirmation => { 59 | 60 | if (confirmation) { 61 | return versionString; 62 | } 63 | }); 64 | } -------------------------------------------------------------------------------- /tools/publish/terminal-exec.ts: -------------------------------------------------------------------------------- 1 | import { ExecSyncOptionsWithBufferEncoding } from "child_process"; 2 | import { execSync as nodeExecSync } from "child_process"; 3 | import { exit } from "process"; 4 | import { printError, print } from "./print"; 5 | 6 | 7 | export const OPTIONS: ExecSyncOptionsWithBufferEncoding = { 8 | stdio: 'pipe' 9 | } 10 | 11 | export function execSync(command: string, callbackOnFailed?: (e?: any) => void) { 12 | 13 | try { 14 | return nodeExecSync(command, OPTIONS).toString(); 15 | 16 | } catch (e) { 17 | 18 | if (callbackOnFailed) { 19 | callbackOnFailed(e); 20 | } 21 | 22 | print(''); 23 | printError(e.message); 24 | print(e.stdout.toString()); 25 | exit(1); 26 | } 27 | } -------------------------------------------------------------------------------- /tools/publish/terminal-interaction.ts: -------------------------------------------------------------------------------- 1 | import inquirer from 'inquirer'; 2 | 3 | // Confirmation 4 | export function terminalConfirm(message: string, defaultValue: boolean = true): Promise { 5 | 6 | return inquirer 7 | .prompt([ 8 | { 9 | type: 'confirm', 10 | name: 'confirm', 11 | message: message, 12 | default: defaultValue 13 | } 14 | ]) 15 | .then(result => result.confirm); 16 | } 17 | 18 | // List Selection 19 | 20 | interface TerminalListSelectionOption { 21 | text: string, 22 | value: T 23 | } 24 | 25 | export function terminalListSelection( 26 | message: string, 27 | options: TerminalListSelectionOption[] 28 | ): Promise { 29 | 30 | return inquirer 31 | .prompt([ 32 | { 33 | type: 'list', 34 | name: 'version', 35 | message: message, 36 | choices: options.map(e => e.text) 37 | } 38 | ]) 39 | .then(result => 40 | (options.find(option => option.text == result.version) as TerminalListSelectionOption).value 41 | ); 42 | } 43 | 44 | // Input 45 | export function terminalInput( 46 | message: string, 47 | validate: (terminalInput: string) => boolean | string 48 | ): Promise { 49 | 50 | return inquirer 51 | .prompt([ 52 | { 53 | type: 'input', 54 | name: 'version', 55 | message: message, 56 | validate: validate 57 | } 58 | ]) 59 | .then(result => result.version); 60 | } -------------------------------------------------------------------------------- /tools/publish/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": ["**/*.ts"], 5 | "compilerOptions": { 6 | "target": "es2020", 7 | "resolveJsonModule": true, 8 | "esModuleInterop": true, 9 | "allowSyntheticDefaultImports": true 10 | }, 11 | "ts-node": { 12 | "esm": true, 13 | "experimentalSpecifierResolution": "node", 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": false, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2020", 12 | "module": "esnext", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "esnext", 18 | "dom" 19 | ], 20 | "skipLibCheck": true, 21 | "skipDefaultLibCheck": true, 22 | "strictNullChecks": false, 23 | "strictPropertyInitialization": false, 24 | "resolveJsonModule": true, 25 | "allowSyntheticDefaultImports": true, 26 | "baseUrl": ".", 27 | "paths": { 28 | "@lib/ngx-pretty-checkbox": [ 29 | "libs/ngx-pretty-checkbox/src/index.ts" 30 | ] 31 | } 32 | }, 33 | "exclude": [ 34 | "node_modules", 35 | "tmp" 36 | ] 37 | } 38 | --------------------------------------------------------------------------------