Coder Social home page Coder Social logo

michaeldoye / mat-progress-buttons Goto Github PK

View Code? Open in Web Editor NEW
110.0 10.0 54.0 2.13 MB

Very simple Angular6+ Material Design progress buttons

Home Page: https://mat-progress-buttons.firebaseapp.com/

License: MIT License

TypeScript 67.69% JavaScript 7.62% HTML 17.43% SCSS 7.27%
angular material-design progress-button angular-material2

mat-progress-buttons's Introduction

Anguar Material Design Progress Buttons

npm version Build Status dependency Status devDependency Status

Demo

View all the directives in action at https://mat-progress-buttons.firebaseapp.com

StackBlitz demo https://stackblitz.com/edit/mat-progress-buttons-demo

Dependencies

Installation

Install above dependencies via npm.

Now install mat-progress-buttons via:

npm install --save mat-progress-buttons

SystemJS

Note:If you are using SystemJS, you should adjust your configuration to point to the UMD bundle. In your systemjs config file, map needs to tell the System loader where to look for mat-progress-buttons:

map: {
  'mat-progress-buttons': 'node_modules/mat-progress-buttons/bundles/mat-progress-buttons.umd.js',
}

Once installed you need to import the main module:

import { MatProgressButtonsModule } from 'mat-progress-buttons';

The only remaining part is to list the imported module in your application module. The exact method will be slightly different for the root (top-level) module for which you should end up with the code similar to (notice MatProgressButtonsModule .forRoot()):

import { MatProgressButtonsModule } from 'mat-progress-buttons';

@NgModule({
  declarations: [AppComponent, ...],
  imports: [MatProgressButtonsModule.forRoot(), ...],  
  bootstrap: [AppComponent]
})
export class AppModule {
}

Other modules in your application can simply import MatProgressButtonsModule:

import { MatProgressButtonsModule } from 'mat-progress-buttons';

@NgModule({
  declarations: [OtherComponent, ...],
  imports: [MatProgressButtonsModule, ...], 
})
export class OtherModule {
}

Usage

Spinner Button

import { Component } from '@angular/core';
import { MatProgressButtonOptions } from 'mat-progress-buttons';

@Component({
  selector: 'app-home',
  template: '<mat-spinner-button (btnClick)="btnClick()" [options]="btnOpts"></mat-spinner-button>'
})
export class SomeComponent {

  // Button Options
  btnOpts: MatProgressButtonOptions = {
    active: false,
    text: 'Stroked Button',
    spinnerSize: 19,
    raised: false,
    stroked: true,
    flat: false,
    fab: false,
    buttonColor: 'accent',
    spinnerColor: 'accent',
    fullWidth: false,
    disabled: false,
    mode: 'indeterminate',
    customClass: 'some-class',
    // add an icon to the button
    buttonIcon: {
      fontSet: 'fa',
      fontIcon: 'fa-heart',
      inline: true
    }
  };

  // Click handler
  btnClick(): void {
    this.btnOpts.active = true;
    setTimeout(() => {
      this.btnOpts.active = false;
    }, 3350);
  }
};

Spinner button FAB

You can use the spinner button with a mat-fab with an icon. Both mat-icon and font awesome are supported.

To set up fontawesome to work with mat-icon you can see instructions here

Use the icon property on the options object

Note: Bar Button does not support the fab style, currently.

  btnOpts: MatProgressButtonOptions = {
    active: false,
    text: 'Stroked Button',
    spinnerSize: 19,
    raised: false,
    stroked: true,
    flat: false,
    fab: true, // set fab to true
    buttonColor: 'accent',
    spinnerColor: 'accent',
    fullWidth: false,
    disabled: false,
    mode: 'indeterminate',
    icon: {
      color: primary,
      fontSet: 'fa',
      fontIcon: 'fa-save',
      inline: true
    },
  };

Icon API

interface MatProgressButtonIcon {
  color?: ThemePalette; // icon color (primary or accent)
  fontIcon?: string;    // name of the icon (for fontawsome, use 'fa-[icon_name])'
  fontSet?: string;     // if using fontawesome, use 'fa' (omit for material icons)
  inline?: boolean;     // automatically size the icon
  svgIcon?: string;     // name of the icon in the SVG icon set.
}

More info in Angular Material Docs

Bar Button

import { Component } from '@angular/core';
import { MatProgressButtonOptions } from 'mat-progress-buttons';

@Component({
  selector: 'app-home',
  template: '<mat-bar-button (btnClick)="btnClick()" [options]="btnOpts"></mat-bar-button>'
})
export class SomeComponent {

  // Button Options
  btnOpts: MatProgressButtonOptions = {
    active: false,
    text: 'Stroked Button',
    buttonColor: 'accent',
    barColor: 'accent',
    raised: false,
    stroked: true,
    flat: false,
    mode: 'indeterminate',
    value: 0,
    disabled: false,
    customClass: 'some-class',
    // add an icon to the button
    buttonIcon: {
      fontSet: 'fa',
      fontIcon: 'fa-heart',
      inline: true
    }
  };

  // Click handler
  btnClick(): void {
    this.btnOpts = { ...this.btnOpts, active: true };
    setTimeout(() => {
      this.btnOpts = { ...this.btnOpts, active: false };
    }, 3350);
  }
};

Global Options

Optionally pass default MatProgressButtonOptions in forRoot in side your app.modlue.ts for each button as an array.

const button1: MatProgressButtonOptions = {
  id: 'button1', // Id should match the [buttonId] input
  ...
};

const button2: MatProgressButtonOptions = {
  id: 'button2', // Id should match the [buttonId] input
  ...
};

@NgModule({
  imports: [
    MatProgressButtonsModule.forRoot([button1, button2]),
  ],
  declarations: [HomeComponent],
})

NB: add the id above should match the id provided in the [buttonId] input.

<mat-bar-button
  (btnClick)="someFunc3()"
  [buttonId]="'button1'"
  [active]="buttonState"
></mat-bar-button>

[options] will override Global Options provided in forRoot

Overriding default CSS

To override CSS (color and background color of spinner buttons), you can write CSS for particular component and use ViewEncapsulation.None

Example:

CSS:

.class-name {
    background-color: red;
}

TS:

@Component({
  ...,
  encapsulation: ViewEncapsulation.None
})
class MyComponent {}
$ git clone https://github.com/michaeldoye/mat-progress-buttons.git
  • link the mat-progress-buttons package
$ ng build
$ npm link ./dist/mat-progress-buttons

or

$ ng build
$ npm link ./dist/mat-progress-buttons
$ ng build --watch
  • navigate to the demo app directory
$ cd demo
  • install the dependencies
$ npm i
  • run/start/serve the app
$ npm run start

or

$ ng serve --open
  • the app is now hosted by http://localhost:4200/
  1. clone this repo
  2. Install the dependencies by running npm i
  3. build the library ng buld
  4. test the library ng test
  5. Link the library npm link ./dist/mat-progress-buttons
  6. Navigate to the demo app's directory:
  • cd demo
  • npm i
  • npm start

License

Copyright (c) 2018 Michael Doye. Licensed under the MIT License (MIT)

mat-progress-buttons's People

Contributors

andreybespamyatnov avatar brycekmartin avatar lujakob avatar maxfriedmann avatar mdoye avatar michaeldoye avatar midgleyc avatar nexucis avatar niklasg8 avatar pedro-jump avatar prashantpimpale93 avatar rubentrf avatar rynop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mat-progress-buttons's Issues

How to disable button till the form is valid?

I have a button in my code to submit the form.

<mat-card-actions>
    <spinner-button id="spinner" [options]="spinnerButtonOptions" (click)="beautify()"></spinner-button>
    <button mat-raised-button color="primary" type="reset" color="warn">Reset</button>
</mat-card-actions>

And my options code is

  spinnerButtonOptions: ButtonOpts = {
    active: false,
    text: 'Submit',
    spinnerSize: 18,
    raised: true,
    buttonColor: 'primary',
    spinnerColor: 'accent',
    fullWidth: false,
    disabled: false
  }

How to set disable: true if my form is valid?

BrowserModule error with lazy module in prod

ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.

As mentioned in one of comments in #7, I can confirm that this browser module error appears with lazy modules run time of prod build (--aot --prod) and I thought that deserves a separate issue so here it is.

I also can confirm that I don't see the error with default cli build (without --prod). And, another note is that even I copied exact same code of this package to my own private package built with angular cli library creation, I don't see the error with --prod. So I am thinking this issue may come from the rollup build, but just a guess.

Please add support for button to not be disabled after click

Is your feature request related to a problem? Please describe.
I've been going through the Material Design documents and they have an example where the button text is replaced with a spinner and the button does not become disabled (It's in the Integrating with actions section).

Describe the solution you'd like
I'd like a button option where I could set whether or not to disable the button when it's clicked. I'd also like it if the spinner class was not added if there is no text (since we don't need the margins). I do like the idea of the cursor: not-allowed on button click though.

NullInjectorError after upgrade to version 9.3.1 with Angular 12

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting

OS and Version?

Mac OS in Chrome

Versions

Package Version

@angular-devkit/architect 0.1201.4
@angular-devkit/build-angular 12.1.4
@angular-devkit/core 8.3.29
@angular-devkit/schematics 8.3.29
@angular/cdk 12.1.0
@angular/flex-layout 9.0.0-beta.31
@angular/material 12.1.0
@schematics/angular 8.3.29
rxjs 6.6.7
typescript 4.3.4

Repro steps

Install mat-progress-buttons 9.3.1 and load page that contains a spinner button

The log given by the failure

Desired functionality

Mention any other details that might be useful

Bildschirmfoto 2021-07-30 um 14 23 38

Moving to the Angular Lib project type

May I move this project to the angular lib project type? I see a lot of benefits from that.

I think we will have better support within the angular ecosystem and it would be way easier to contribute.
Like one of the issue is a bit hard to update the karma framework, etc.

So I just want to know would my work be accepted or not)

Thanks!

Progress Bar Button isn't disabled with ButtonOpts.disabled set to true, but only when running --prod.

Describe the bug
I'm using progress-bar-button (which is awesome, by the way!) When setting the provided ButtonOpts disabled attribute to true, the button properly appears disabled when running locally. However, when running with --prod, the button is not disabled, though the attribute is properly set.

To Reproduce
Steps to reproduce the behavior:

  1. Add a progress-bar-button.
  2. Associate a ButtonOpts object.
  3. Set ButtonOpts.disabled attribute to 'true'
  4. Run ng serve
  5. Button appears disabled.
  6. Run ng serve --prod
  7. Button does not appear disabled.

Expected behavior
Button should appear disabled with running with --prod.

Screenshots
Button appearance with --prod:
image

ButtonOpts values:
image

Desktop (please complete the following information):

  • OS: Win10
  • Browser: Chrome
  • Version 69.0.3497.92 (Official Build) (64-bit)

Disable button click while loading status is active

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

OS and Version?

Windows 10

Versions

8.0.3

Repro steps

  1. Create a mat-progress-button
  2. Build a back-end
  3. Use the mat-progress-button as a submit form in your angular front-end
  4. Rush-click your button
  5. Check you network tab. You will see one request for each click you have made, even if previous request were not completed.

Would be nice if buttons could be "disable" while in loading status.

Desired functionality

Disable button click while loading status is active.

Feature Request: Option position MatProgressButtonIcon

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions

Angular CLI: 9.1.6
Node: 12.18.3

Desired functionality

[options] of MatProgressButtonIcon can set icon position before and after text
image

Pre-commit hooks

Bug Report or Feature Request (mark with an x)

- [x] feature request
  • Prettier
  • Unit test

Desired functionality

add pre-commit hooks for prettier and unit tests

Feel free to suggest others

tsickle is still a dependency. Why?

See my comment here: #28 (comment)

Is tsickle and @angular-devkit/schematics really needed in the dependencies section?

"dependencies": {
    "@angular-devkit/schematics": "^0.8.2",
    "@angular/cdk": "^7.2.0",
    "@angular/common": "7.1.4",
    "@angular/core": "7.1.4",
    "@angular/material": "^7.2.0",
    "tsickle": "^0.35.0"
  },

Custom class to mat-progress-buttons

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Desired functionality

Would be very nice to have the ability to add custom classes to the generated button, such as 'mat-elevate' and other custom classes. Will you add this? :)

Not compatible with Angular Material 9

Getting the error:
ERROR in Cannot resolve type entity ษตngcc4.MatButtonModule to symbol

when using Angular Material ^9.0.0-rc.4

It's an easy fix...
Components can no longer be imported through @angular/material.
Use the individual secondary entry-points, such as @angular/material/button.

mat-bar-button does not work in --prod

hi, i am having a problem with the buttons in prod environment, these doesn't work, please help me with that.

I see that you had recieved the same issue previously but in other order. #6

note: i assume that the problem is the bntClick because i use a mat-bar-button without btnclick in a form and work perfectly

MatProgressButtons module is not present in build with --prod flag

When I build my app in dev mode the buttons works perfectly, but when I used --prod flag the click events weren't executing and when I looked into it I found the entire module is not include in the final js build.

I have seen a similar issue but it is marked as fix.

I am using version 6.0.1

Thanks.

Full-Icon-Support for Fab-Buttons

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

OS and Version?

Windows 10

Versions

Angular CLI: 8.1.1
Node: 10.15.3
OS: win32 x64
Angular: 8.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.1
@angular-devkit/build-angular     0.801.1
@angular-devkit/build-optimizer   0.801.1
@angular-devkit/build-webpack     0.801.1
@angular-devkit/core              8.1.1
@angular-devkit/schematics        8.1.1
@angular/cdk                      8.0.2
@angular/material                 8.0.2
@ngtools/webpack                  8.1.1
@schematics/angular               8.1.1
@schematics/update                0.801.1
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.35.2

Desired functionality

At the moment we are only able to include a string to the icon property. This string must be a valid icon from material.io. The MatIconModule supports other icons as well. It would be nice to have the full icon support for Fab-Buttons.

I would suggest that the icon property can stay as it is for compatibility purposes and that you add all other properties to the options input. Like this maybe:

const options = {
    ...,
    icon: 'fa-save',
    fontSet: 'fa',
    svgIcon: undefined,
    isSvg: false,
    ...
};

Then in the template:

<mat-icon
    [fontSet]="fontSet"
    [fontIcon]="options.fontSet ? icon : null"
    [svgIcon]="options.isSvg ? icon : null"
>{{ !options.isSvg && !options.fontSet ? icon : '' }}</mat-icon>

Feature request: global MatProgressButtonOptions

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Versions

Angular CLI: 7.1.3
Node: 10.15.3

Desired functionality

Have [options] input be an optional partial of MatProgressButtonOptions and allow forRoot to accept an optional MatProgressButtonOptions which will be the default configuration for buttons (input overrides defaults set in forRoot.

Unit tests

add unit test coverage for lib components

Spinner not showing

Bug Report or Feature Request (mark with an x)

- [ X] bug report -> please search issues before submitting
- [ ] feature request

OS and Version? WIndows 7

Versions

Angular CLI: 7.3.6
Node: 8.9.1
OS: win32 x64
Angular: 7.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.13.6
@angular-devkit/build-angular 0.13.6
@angular-devkit/build-optimizer 0.13.6
@angular-devkit/build-webpack 0.13.6
@angular-devkit/core 7.3.9
@angular-devkit/schematics 0.8.2
@angular/cdk 7.3.5
@angular/cli 7.3.6
@angular/flex-layout 7.0.0-beta.24
@angular/material 7.3.5
@ngtools/webpack 7.3.6
@schematics/angular 7.3.6
@schematics/update 0.13.6
rxjs 6.4.0
typescript 3.2.4
webpack 4.29.0

Repro steps

Here is my MatProgressButton code....
validateSpinner: MatProgressButtonOptions = {
active: false,
text: 'Validate',
type: 'button',
spinnerSize: 18,
raised: true,
stroked: false,
buttonColor: 'accent',
spinnerColor: 'primary',
fullWidth: false,
disabled: false,
mode: 'indeterminate'
};

              <mat-spinner-button [options]="validateSpinner" (btnClick)="validateCustomer(searchForm.get('customerNumber').value)" ></mat-spinner-button>
          </mat-grid-tile>

Desired functionality

I have the button inside a mat-grid-tile, which is in a form. For some reason when I click the button the spinner does not show up. There is something that happens but I have not yet been able to figure out what CSS is wrong that it won't display the spinner. It exists in the DOM, but the button text never fades and the spinner never shows up.

Handle fxFlex.lt-md="100%"

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [x] feature request

OS and Version?

Linux

Versions

Angular CLI: 6.2.4
Node: 8.12.0
OS: linux x64
Angular: 6.1.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.4
@angular-devkit/build-angular 0.8.4
@angular-devkit/build-optimizer 0.8.4
@angular-devkit/build-webpack 0.8.4
@angular-devkit/core 0.8.4
@angular-devkit/schematics 0.8.4
@angular/cdk 6.4.7
@angular/cli 6.2.4
@angular/flex-layout 6.0.0-beta.18
@angular/material 6.4.7
@ngtools/webpack 6.2.4
@schematics/angular 0.8.4
@schematics/update 0.8.4
rxjs 6.2.2
typescript 2.9.2
webpack 4.20.2

Repro steps

Add fxFlex... to element
Resize browser to see if the flex work

The log given by the failure

No reason since this does not crash or fail

Desired functionality

Honor the flex settings given as arguments

Mention any other details that might be useful

Ripple effect is not working on raised and flat buttons

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

OS and Version?

macOS(El Capitan)

Versions

Node: 11.14.0
OS: darwin x64
Angular: 7.2.15
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cdk                      7.3.7
@angular/cli                      7.3.9
@angular/material                 7.3.7
@ngtools/webpack                  7.3.9
@schematics/angular               7.3.9
@schematics/update                0.13.9
rxjs                              6.5.2
typescript                        3.2.4
webpack                           4.29.0

Repro steps

Click raised button

Desired functionality

Ripple effect should also work on raised buttons

Mention any other details that might be useful

Ripple effect is not working on raised buttons

Spinner does not show if disable=true

Bug Report or Feature Request (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Windows 7

Versions

Angular 7

Repro steps

Use the stackblitz demo to test what would happen if I change someFunc to look like this...
someFunc(): void { this.spinnerButtonOptions.active = true; this.spinnerButtonOptions.disabled = true; setTimeout(() => { this.spinnerButtonOptions.active = false; this.spinnerButtonOptions.disabled = false; }, 3500) }

The log given by the failure

The spinner did not show up, the button simply went disabled.

Desired functionality

I would still want the spinner to show so that the user gets the feedback but want the button disabled so they can resubmit while the current request is processing. I tested with the progress button and it works this way, but I like the look of the spinner better.

Don't disable the button while bar has value

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ x] feature request

Desired functionality

It would be nice to have a option that when true doesn't disable the button when it has some value.

mat-flat-button support?

How do you render a mat-flat-button? I don't see it in the source, so this is probably a feature request.

build failed with error An accessor cannot be declared in an ambient context

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Windows10

Versions

 "dependencies": {
    "@angular-slider/ngx-slider": "^2.0.3",
    "@angular/animations": "^8.2.10",
    "@angular/cdk": "^8.2.3",
    "@angular/common": "^8.2.10",
    "@angular/compiler": "^8.2.10",
    "@angular/core": "^8.2.10",
    "@angular/flex-layout": "^8.0.0-beta.27",
    "@angular/forms": "^8.2.10",
    "@angular/http": "^7.2.15",
    "@angular/material": "^8.2.3",
    "@angular/platform-browser": "^8.2.10",
    "@angular/platform-browser-dynamic": "^8.2.10",
    "@angular/pwa": "^0.11.4",
    "@angular/router": "^8.2.10",
    "@angular/service-worker": "^8.2.10",
    "@angularclass/hmr-loader": "^3.0.4",
    "@compodoc/compodoc": "^1.1.7",
    "@mat-datetimepicker/core": "^2.0.1",
    "@ngrx/effects": "^8.4.0",
    "@ngrx/entity": "^8.4.0",
    "@ngrx/router-store": "^8.4.0",
    "@ngrx/store": "^8.4.0",
    "@ngrx/store-devtools": "^8.4.0",
    "@swimlane/ngx-charts": "^8.0.0",
    "@types/jwt-decode": "^2.2.1",
    "@types/socket.io-client": "^1.4.32",
    "mat-progress-buttons": "^9.1.1",
  },

Repro steps

npm install

returns error

The log given by the failure

ERROR in ../node_modules/mat-progress-buttons/lib/component/bar-button/bar-button.component.d.ts:13:9 - error TS1086: An accessor cannot be declared in an ambient context.
13     get configExists(): boolean;
           ~~~~~~~~~~~~
../node_modules/mat-progress-buttons/lib/component/bar-button/bar-button.component.d.ts:14:9 - error TS1086: An accessor cannot be declared in an ambient context.
14     get globalConfig(): MatProgressButtonOptions;
           ~~~~~~~~~~~~
../node_modules/mat-progress-buttons/lib/component/spinner-button/spinner-button.component.d.ts:13:9 - error TS1086: An accessor cannot be declared in an ambient context.
13     get configExists(): boolean;
           ~~~~~~~~~~~~
../node_modules/mat-progress-buttons/lib/component/spinner-button/spinner-button.component.d.ts:14:9 - error TS1086: An accessor cannot be declared in an ambient context.
14     get globalConfig(): MatProgressButtonOptions;

Support Angular10

Package "mat-progress-buttons" has an incompatible peer dependency to "@angular/cdk" (requires "^9.1.1", would install "10.0.0").

Thank you

mat-bar-button icon doesn't work

Hi.
to the
<mat-bar-button [options]="barButtonOptions" (btnClick)="someFunc2()"> </mat-bar-button>

I want to remove the text and just show an icon, something like this:
barButtonOptions: MatProgressButtonOptions = { active: false, text: ' ', buttonColor: 'accent', barColor: 'primary', raised: true, stroked: false, mode: 'indeterminate', value: 0, disabled: false, fullWidth: false, icon: 'favorite' }

But the button disappears , it just doesn't work.
Am I doing something wrong?

Thanks
Im Testing here

Update peer deps for Angular 12

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

In 9.3.1, both the root and the demo project have been updated to Angular 12, but the main package.json is still showing Angular 11.

[Angular 9] Compilation error after upgrading to v9

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [] feature request

OS and Version?

macOS Mojave 10.14.5

Versions

  • Angular: 9.0.0
  • CDK/Material: 9.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS Mojave 10.14.5
Angular CLI: 9.0.1
Node: 12.15.0
OS: darwin x64

Angular: 9.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.1
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@ngtools/webpack                  9.0.1
@schematics/angular               9.0.1
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Repro steps

Upgrade from v8 to v9.

The log given by the failure

@project/app: ERROR in Failed to compile entry-point mat-progress-buttons (es2015 as esm2015) due to compilation errors:
@project/app: ../../node_modules/mat-progress-buttons/esm2015/mat-progress-buttons.js:181:26 - error NG1010: Value at position 1 in the NgModule.imports of MatProgressButtonsModule is not a reference: [object Object]
@project/app: 181                 imports: [
@project/app:                              ~
@project/app: 182                     CommonModule,
@project/app:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@project/app: ...
@iproject/app: 187                     MatIconModule
@project/app:     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@project/app: 188                 ],
@project/app:     ~~~~~~~~~~~~~~~~~

Desired functionality

Starting the project should work without compiler errors.

Mention any other details that might be useful

mat-progress-buttons.es5.js is missing in final package

Hi, great library!

When I use this library in angular projects, everything works as expected. If I use it in a meteor project, the angular-meteor compiler stumbles and produces unusable builds due the fact that the final package.json states a module version but the file cannot be found.

Can you either remove the module entry in the final package.json or provide the file? Both solutions would work for me (and meteor).

my node_modules/mat-progress-buttons/package.json

{
  "_from": "mat-progress-buttons@^1.2.9",
  "_id": "[email protected]",
  "_inBundle": false,
  "_integrity": "sha1-JR6a/fhXU4x+54PqKj9oaX/YJfA=",
  "_location": "/mat-progress-buttons",
  "_phantomChildren": {},
  "_requested": {
    "type": "range",
    "registry": true,
    "raw": "mat-progress-buttons@^1.2.9",
    "name": "mat-progress-buttons",
    "escapedName": "mat-progress-buttons",
    "rawSpec": "^1.2.9",
    "saveSpec": null,
    "fetchSpec": "^1.2.9"
  },
  "_requiredBy": [
    "/"
  ],
  "_resolved": "https://registry.npmjs.org/mat-progress-buttons/-/mat-progress-buttons-1.2.9.tgz",
  "_shasum": "251e9afdf857538c7ee783ea2a3f68697fd825f0",
  "_spec": "mat-progress-buttons@^1.2.9",
  "_where": "C:\\ws\\projects\\project-sata-loyalty\\meteor",
  "author": {
    "name": "Michael Doye",
    "email": "[email protected]"
  },
  "bugs": {
    "url": "https://github.com/michaeldoye/mat-progress-buttons/issues"
  },
  "bundleDependencies": false,
  "deprecated": false,
  "description": "Very simple Angular4+ Material Design progress buttons",
  "es2015": "mat-progress-buttons.js",
  "homepage": "https://github.com/michaeldoye/mat-progress-buttons#readme",
  "license": "MIT",



  "module": "mat-progress-buttons.es5.js",  // <-- this is the faulty entry



  "name": "mat-progress-buttons",
  "peerDependencies": {
    "@angular/core": "^4.0.1",
    "rxjs": "^5.3.0",
    "zone.js": "^0.8.5"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/michaeldoye/mat-progress-buttons.git"
  },
  "typings": "mat-progress-buttons.d.ts",
  "version": "1.2.9"
}

Spinner Color

This is a simple feature request.

How would I go about using a color other than 'accent' or 'primary' as the spinner color?

Spinner doen't show when you set the active property in code.

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Windows 10.

Versions

Angular 12.2.9
mat-progress-buttons 9.3.1

Repro steps

Open this Stackblitz and click the button.

Changes I made to your demo stackblitz:

  1. Updated the mat-progress-buttons to version 9.3.1.
  2. Replaced the demo code with your example code found here.
  3. updated the app.module so it will call the forRoot().
  4. Click the button in the output. This is not spinning.

Desired functionality

The button spinning when setting the active property in code.

Mention any other details that might be useful

This broke in v9.3.1.

#90 might be related

Button type attribute

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [x] feature request

Desired functionality

I could not find a way to fill the type attribute of the generated button.
Might be nice to add it to the options, accepting values submit, reset or button.

fullWidth option is not working

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Versions

Repro steps

The log given by the failure

Desired functionality

Mention any other details that might be useful

Add mat-icon to the button

Hello,

I'd like to add mat-icon to the button while the button is not submitted. is it possible ?
Thanks

The spinner doesn't show When i set the disabled property of the button to this.form.invalid

Bug Report or Feature Request (mark with an x)

- [ x] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Ubuntu 20.0

Versions

Angular CLI: 12.2.4
Node: 14.15.5
Package Manager: npm 6.14.11
OS: linux x64

Angular: undefined
...

Package Version

@angular-devkit/architect 0.1202.4 (cli-only)
@angular-devkit/core 12.2.4 (cli-only)
@angular-devkit/schematics 12.2.4 (cli-only)
@schematics/angular 12.2.4 (cli-only)
typescript 3.2.2

Repro steps

whenever i set the disabled property of the mat-spinner-button to form.valid, the loading spinner doesn't show anymore.

<mat-spinner-button [options]="spinnerButtonOptions" [disabled]="form.invalid" > </mat-spinner-button>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.