Skip to content

Commit

Permalink
Merge pull request #78 from js-smart/development
Browse files Browse the repository at this point in the history
feat(buttons): adds button type to manage-button.component
  • Loading branch information
pavankjadda authored Oct 21, 2023
2 parents e03d6ff + 0f504e6 commit 40fd5dc
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 95 deletions.
39 changes: 19 additions & 20 deletions apps/ngxsmart-demo/src/app/buttons-demo/buttons-demo.component.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
<div class="m-5">
<primary-button (click)="setLoading()" [loading]="loading" class="m-3" label="Primary Button"></primary-button>
<save-primary-button (click)="setLoading()" [loading]="loading" class="m-3"
label="Save Primary Button"></save-primary-button>
<view-primary-button class="m-3"></view-primary-button>
<view-button></view-button>
<hr />
<edit-button class="m-3" label="Edit Button"></edit-button>
<edit-svg-icon-button class="m-3" label="Edit Svg Icon Button"></edit-svg-icon-button>
<edit-bs-button class="m-3" label="Edit Bootstrap Button"></edit-bs-button>
<bs-link-button class="m-3" label="Bootstrap Link Button"></bs-link-button>
<primary-button (click)="setLoading()" [loading]="loading" class="m-3" label="Primary Button"></primary-button>
<save-primary-button (click)="setLoading()" [loading]="loading" class="m-3" label="Save Primary Button"></save-primary-button>
<view-primary-button class="m-3"></view-primary-button>
<view-button></view-button>
<hr />
<edit-button class="m-3" label="Edit Button"></edit-button>
<edit-svg-icon-button class="m-3" label="Edit Svg Icon Button"></edit-svg-icon-button>
<edit-bs-button class="m-3" label="Edit Bootstrap Button"></edit-bs-button>
<bs-link-button class="m-3" label="Bootstrap Link Button"></bs-link-button>

<hr />
<success-button (click)="setLoading()" [loading]="loading" class="m-3"
label="Success Button"></success-button>
<delete-button (click)="setLoading()" [loading]="loading" class="m-3"
label="Delete Button"></delete-button>
<hr />
<success-button (click)="setLoading()" [loading]="loading" class="m-3" label="Success Button"></success-button>
<delete-button (click)="setLoading()" [loading]="loading" class="m-3" label="Delete Button"></delete-button>

<hr />
<manage-button class="m-3"></manage-button>
<search-button class="m-3"></search-button>
<pdf-export-button class="m-3"></pdf-export-button>
<excel-export-button class="m-3"></excel-export-button>
<hr />
<manage-button class="m-3"></manage-button>
<search-button class="m-3"></search-button>
<pdf-export-button class="m-3"></pdf-export-button>
<excel-export-button class="m-3"></excel-export-button>
</div>

<hr />
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Component, Input } from "@angular/core";
import { CommonModule } from "@angular/common";
import { MatButtonModule } from "@angular/material/button";
import { MatIconModule } from "@angular/material/icon";
import { Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';

@Component({
selector: "manage-button",
selector: 'manage-button',
standalone: true,
imports: [CommonModule, MatButtonModule, MatIconModule],
template: `
<button class="mr-3 btn btn-secondary secondary-button" mat-raised-button data-cy="manage-button">
<button type="{{ type }}" class="mr-3 btn btn-secondary secondary-button" mat-raised-button data-cy="manage-button">
<mat-icon>{{ icon }}</mat-icon>
{{ label }}
</button>
`,
styleUrls: ["../../../../assets/app-buttons.css"]
styleUrls: ['../../../../assets/app-buttons.css'],
})
export class ManageButtonComponent {
/**
Expand All @@ -25,4 +25,9 @@ export class ManageButtonComponent {
* If set, shows material icon
*/
@Input() icon = 'settings';

/**
* If set, shows button type. Defaults to 'button'. Other options are 'submit' and 'reset'
*/
@Input() type = 'button';
}
137 changes: 69 additions & 68 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
{
"name": "@js-smart/ngxsmart",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "nx",
"nx": "nx",
"start": "nx serve --watch --hmr --port=4300",
"build": "nx build",
"test": "nx test",
"e2e": "nx e2e ngxsmart-demo"
},
"private": true,
"dependencies": {
"@angular/animations": "16.2.5",
"@angular/cdk": "16.2.4",
"@angular/common": "16.2.5",
"@angular/compiler": "16.2.5",
"@angular/core": "16.2.5",
"@angular/forms": "16.2.5",
"@angular/material": "16.2.4",
"@angular/platform-browser": "16.2.5",
"@angular/platform-browser-dynamic": "16.2.5",
"@angular/router": "16.2.5",
"bootstrap": "^5.3.2",
"rxjs": "7.8.1",
"tslib": "^2.6.2",
"zone.js": "0.14.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "16.2.2",
"@angular-devkit/core": "16.2.2",
"@angular-devkit/schematics": "16.2.2",
"@angular-eslint/eslint-plugin": "16.2.0",
"@angular-eslint/eslint-plugin-template": "16.2.0",
"@angular-eslint/template-parser": "16.2.0",
"@angular/cli": "~16.2.2",
"@angular/compiler-cli": "16.2.5",
"@angular/language-service": "16.2.5",
"@nrwl/tao": "17.0.1",
"@ns3/nx-playwright": "^4.2.0",
"@nx/angular": "17.0.1",
"@nx/eslint-plugin": "17.0.1",
"@nx/jest": "17.0.1",
"@nx/playwright": "17.0.1",
"@nx/workspace": "17.0.1",
"@playwright/test": "latest",
"@schematics/angular": "16.2.0",
"@types/jest": "latest",
"@types/node": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-playwright": "^0.15.3",
"jest": "latest",
"jest-environment-jsdom": "latest",
"jest-preset-angular": "latest",
"ng-packagr": "16.2.0",
"nx": "17.0.1",
"postcss": "^8.4.21",
"postcss-import": "15.1.0",
"postcss-preset-env": "~8.0.1",
"postcss-url": "10.1.3",
"prettier": "latest",
"ts-jest": "latest",
"typescript": "5.1.6",
"@nx/eslint": "17.0.1"
}
"name": "@js-smart/ngxsmart",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "nx",
"nx": "nx",
"start": "nx serve --watch --hmr --port=4300",
"build": "nx build",
"test": "nx test",
"e2e": "nx e2e ngxsmart-demo"
},
"private": true,
"dependencies": {
"@angular/animations": "16.2.5",
"@angular/cdk": "16.2.4",
"@angular/common": "16.2.5",
"@angular/compiler": "16.2.5",
"@angular/core": "16.2.5",
"@angular/forms": "16.2.5",
"@angular/material": "16.2.4",
"@angular/platform-browser": "16.2.5",
"@angular/platform-browser-dynamic": "16.2.5",
"@angular/router": "16.2.5",
"bootstrap": "^5.3.2",
"rxjs": "7.8.1",
"tslib": "^2.6.2",
"zone.js": "0.14.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "16.2.2",
"@angular-devkit/core": "16.2.2",
"@angular-devkit/schematics": "16.2.2",
"@angular-eslint/eslint-plugin": "16.2.0",
"@angular-eslint/eslint-plugin-template": "16.2.0",
"@angular-eslint/template-parser": "16.2.0",
"@angular/cli": "~16.2.2",
"@angular/compiler-cli": "16.2.5",
"@angular/language-service": "16.2.5",
"@nrwl/tao": "17.0.1",
"@ns3/nx-playwright": "^4.2.0",
"@nx/angular": "17.0.1",
"@nx/eslint-plugin": "17.0.1",
"@nx/jest": "17.0.1",
"@nx/playwright": "17.0.1",
"@nx/workspace": "17.0.1",
"@playwright/test": "latest",
"@schematics/angular": "16.2.0",
"@types/jest": "latest",
"@types/node": "latest",
"@typescript-eslint/eslint-plugin": "latest",
"@typescript-eslint/parser": "latest",
"eslint": "latest",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-playwright": "^0.15.3",
"jest": "latest",
"jest-environment-jsdom": "latest",
"jest-preset-angular": "latest",
"ng-packagr": "16.2.0",
"nx": "17.0.1",
"postcss": "^8.4.21",
"postcss-import": "15.1.0",
"postcss-preset-env": "~8.0.1",
"postcss-url": "10.1.3",
"prettier": "latest",
"ts-jest": "latest",
"typescript": "5.1.6",
"@nx/eslint": "17.0.1"
}
}

0 comments on commit 40fd5dc

Please sign in to comment.