-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from js-smart/development
release version 17.4.0
- Loading branch information
Showing
17 changed files
with
353 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
{ | ||
"name": "@js-smart/ngxsmart", | ||
"version": "17.3.0", | ||
"peerDependencies": { | ||
"@angular/common": "^17.0.0", | ||
"@angular/core": "^17.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"sideEffects": false | ||
"name": "@js-smart/ngxsmart", | ||
"version": "17.4.0", | ||
"peerDependencies": { | ||
"@angular/common": "^17.0.0", | ||
"@angular/core": "^17.0.0" | ||
}, | ||
"dependencies": { | ||
"tslib": "^2.3.0" | ||
}, | ||
"sideEffects": false | ||
} |
Empty file.
76 changes: 76 additions & 0 deletions
76
projects/ngxsmart/src/lib/components/buttons/base-button/base-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { Component, input, output } from '@angular/core'; | ||
|
||
@Component({ | ||
standalone: true, | ||
template: ``, | ||
}) | ||
export class BaseButtonComponent { | ||
/** | ||
* Is search in progress and loading the data | ||
*/ | ||
loading = input<boolean>(false); | ||
|
||
/** | ||
* Is button disabled | ||
*/ | ||
disabled = input<boolean>(false); | ||
|
||
/** | ||
* Type of the button. Following values are supported. See BootStrap docs for more information | ||
* <pre> | ||
* 1. button | ||
* 2. submit | ||
* </pre> | ||
*/ | ||
type = input('button'); | ||
|
||
/** | ||
* If set, shows when action in Progress | ||
*/ | ||
loadingLabel = input('Saving...'); | ||
|
||
/** | ||
* If set, shows when Delete is not in progress | ||
*/ | ||
label = input('Save'); | ||
|
||
/** | ||
* If set, shows the icon. Otherwise, shows delete icon | ||
*/ | ||
icon = input('save'); | ||
|
||
/** | ||
* If set, shows material icon otherwise hides the icons | ||
*/ | ||
showIcon = input(true); | ||
|
||
/** | ||
* If set, sets the style of the button | ||
*/ | ||
style = input<{ [name: string]: any } | null | undefined>(); | ||
|
||
/** | ||
* If set, sets the class of the button | ||
*/ | ||
classes = input('btn'); | ||
|
||
/** | ||
* If set, sets the data-cy attribute for the button | ||
*/ | ||
dataCy = input('save-button'); | ||
|
||
/** | ||
* Output event when button is clicked | ||
*/ | ||
onClick = output<MouseEvent>(); | ||
|
||
/** | ||
* Output event when button is focused | ||
*/ | ||
onFocus = output<FocusEvent>(); | ||
|
||
/** | ||
* Output event when button is blurred | ||
*/ | ||
onBlur = output<FocusEvent>(); | ||
} |
39 changes: 24 additions & 15 deletions
39
projects/ngxsmart/src/lib/components/buttons/bs-link-button/bs-link-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,38 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { MatIcon } from '@angular/material/icon'; | ||
import { MatAnchor, MatButton } from '@angular/material/button'; | ||
import { EditSolidSvgComponent } from '../../../svg-icons/edit-solid-svg/edit-solid-svg.component'; | ||
import { BaseButtonComponent } from '../base-button/base-button.component'; | ||
import { NgStyle } from '@angular/common'; | ||
|
||
@Component({ | ||
selector: 'bs-link-button', | ||
standalone: true, | ||
imports: [CommonModule, MatButtonModule, MatIconModule], | ||
|
||
imports: [MatButton, MatIcon, EditSolidSvgComponent, MatAnchor, NgStyle], | ||
template: ` | ||
<a class="btn text-primary" data-cy="bs-link-button" mat-button> | ||
<a | ||
type="{{ type() }}" | ||
class="{{ classes() }}" | ||
(click)="onClick.emit($event)" | ||
(focus)="onFocus.emit($event)" | ||
(blur)="onBlur.emit($event)" | ||
[disabled]="disabled()" | ||
[type]="type()" | ||
[ngStyle]="style()" | ||
[attr.data-cy]="'edit-link-button'" | ||
mat-button> | ||
<mat-icon>{{ icon() }}</mat-icon> | ||
{{ label() }} | ||
</a> | ||
`, | ||
styleUrls: ['../../../../assets/app-buttons.css'], | ||
}) | ||
export class BsLinkButtonComponent { | ||
/** | ||
* Icon to display | ||
*/ | ||
icon = input('search'); | ||
export class BsLinkButtonComponent extends BaseButtonComponent { | ||
override label = input('Edit'); | ||
override icon = input('search'); | ||
override classes = input('btn text-primary'); | ||
|
||
/** | ||
* If set, shows the label | ||
*/ | ||
label = input('Edit'); | ||
constructor() { | ||
super(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 22 additions & 25 deletions
47
projects/ngxsmart/src/lib/components/buttons/edit-button/edit-button.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
import { Component, input } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { MatIconModule } from '@angular/material/icon'; | ||
import { MatButtonModule } from '@angular/material/button'; | ||
import { NgStyle } from '@angular/common'; | ||
import { MatIcon } from '@angular/material/icon'; | ||
import { MatButton } from '@angular/material/button'; | ||
import { BaseButtonComponent } from '../base-button/base-button.component'; | ||
|
||
@Component({ | ||
selector: 'edit-button', | ||
standalone: true, | ||
imports: [CommonModule, MatButtonModule, MatIconModule], | ||
|
||
imports: [MatButton, MatIcon, NgStyle], | ||
template: ` | ||
<button class="primary-button" mat-raised-button type="{{ type() }}" data-cy="edit-button"> | ||
<button | ||
class="{{ classes() }}" | ||
(click)="onClick.emit($event)" | ||
(focus)="onFocus.emit($event)" | ||
(blur)="onBlur.emit($event)" | ||
[disabled]="disabled()" | ||
[type]="type()" | ||
[ngStyle]="style()" | ||
[attr.data-cy]="'edit-button'" | ||
mat-raised-button> | ||
<mat-icon>{{ icon() }}</mat-icon> | ||
{{ label() }} | ||
</button> | ||
`, | ||
styleUrls: ['../../../../assets/app-buttons.css'], | ||
}) | ||
export class EditButtonComponent { | ||
/** | ||
* Type of the button. Following values are supported. See BootStrap docs for mor | ||
* e information | ||
* <pre> | ||
* 1. button | ||
* 2. submit | ||
* </pre> | ||
*/ | ||
type = input('button'); | ||
|
||
/** | ||
* If set, shows material icon | ||
*/ | ||
icon = input('edit'); | ||
export class EditButtonComponent extends BaseButtonComponent { | ||
override label = input('Edit'); | ||
override icon = input('edit'); | ||
override classes = input('primary-button'); | ||
|
||
/** | ||
* If set, shows the label | ||
*/ | ||
label = input('Edit'); | ||
constructor() { | ||
super(); | ||
} | ||
} |
Oops, something went wrong.