Remove ng2-currency-mask

This was a cool feature but my wife didn't like it and it's been a huge
headache every time I need to update my angular versions so it's time
for it to go
This commit is contained in:
William Brawner 2021-11-17 20:51:29 -07:00
parent 037ade50c5
commit 27b5e80a2b
6 changed files with 6 additions and 39 deletions

1
.gitignore vendored
View file

@ -42,3 +42,4 @@ Thumbs.db
# Firebase # Firebase
.firebase/ .firebase/
.angular/

21
package-lock.json generated
View file

@ -23,7 +23,6 @@
"core-js": "^2.6.12", "core-js": "^2.6.12",
"dexie": "^2.0.4", "dexie": "^2.0.4",
"ng2-charts": "^2.4.2", "ng2-charts": "^2.4.2",
"ng2-currency-mask": "^11.0.0",
"rxjs": "^6.6.3", "rxjs": "^6.6.3",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
@ -10904,18 +10903,6 @@
"rxjs": "^6.3.3" "rxjs": "^6.3.3"
} }
}, },
"node_modules/ng2-currency-mask": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/ng2-currency-mask/-/ng2-currency-mask-11.0.0.tgz",
"integrity": "sha512-+jSqTMP7eKISA+PUFEFYfi2zlpP/JuYcKrVxcD0gTIflBlbr8GoD3Iace/Z5/s0zZmSvPJk2eGQB0X05GAf1ug==",
"dependencies": {
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^11.2.8",
"@angular/core": "^11.2.8"
}
},
"node_modules/nice-try": { "node_modules/nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -26725,14 +26712,6 @@
"tslib": "^2.0.0" "tslib": "^2.0.0"
} }
}, },
"ng2-currency-mask": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/ng2-currency-mask/-/ng2-currency-mask-11.0.0.tgz",
"integrity": "sha512-+jSqTMP7eKISA+PUFEFYfi2zlpP/JuYcKrVxcD0gTIflBlbr8GoD3Iace/Z5/s0zZmSvPJk2eGQB0X05GAf1ug==",
"requires": {
"tslib": "^2.0.0"
}
},
"nice-try": { "nice-try": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",

View file

@ -29,7 +29,6 @@
"core-js": "^2.6.12", "core-js": "^2.6.12",
"dexie": "^2.0.4", "dexie": "^2.0.4",
"ng2-charts": "^2.4.2", "ng2-charts": "^2.4.2",
"ng2-currency-mask": "^11.0.0",
"rxjs": "^6.6.3", "rxjs": "^6.6.3",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"

View file

@ -38,7 +38,6 @@ import { NewBudgetComponent } from './budgets/new-budget/new-budget.component';
import { BudgetDetailsComponent } from './budgets/budget-details/budget-details.component'; import { BudgetDetailsComponent } from './budgets/budget-details/budget-details.component';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import { CurrencyMaskModule, CurrencyMaskConfig, CURRENCY_MASK_CONFIG } from 'ng2-currency-mask';
import { ServiceWorkerModule } from '@angular/service-worker'; import { ServiceWorkerModule } from '@angular/service-worker';
import { CategoryBreakdownComponent } from './categories/category-breakdown/category-breakdown.component'; import { CategoryBreakdownComponent } from './categories/category-breakdown/category-breakdown.component';
import { ChartsModule } from 'ng2-charts'; import { ChartsModule } from 'ng2-charts';
@ -50,16 +49,6 @@ import { TransactionListComponent } from './transactions/transaction-list/transa
import { EditCategoryComponent } from './categories/edit-category/edit-category.component'; import { EditCategoryComponent } from './categories/edit-category/edit-category.component';
import { EditBudgetComponent } from './budgets/edit-budget/edit-budget.component'; import { EditBudgetComponent } from './budgets/edit-budget/edit-budget.component';
export const CustomCurrencyMaskConfig: CurrencyMaskConfig = {
align: 'left',
precision: 2,
prefix: '',
thousands: ',',
decimal: '.',
suffix: '',
allowNegative: false,
};
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
@ -104,13 +93,11 @@ export const CustomCurrencyMaskConfig: CurrencyMaskConfig = {
FormsModule, FormsModule,
ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }), ServiceWorkerModule.register('ngsw-worker.js', { enabled: environment.production }),
HttpClientModule, HttpClientModule,
CurrencyMaskModule,
ChartsModule, ChartsModule,
MatCheckboxModule, MatCheckboxModule,
MatCardModule, MatCardModule,
], ],
providers: [ providers: [
{ provide: CURRENCY_MASK_CONFIG, useValue: CustomCurrencyMaskConfig },
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true },
{ provide: TWIGS_SERVICE, useClass: TwigsHttpService }, { provide: TWIGS_SERVICE, useClass: TwigsHttpService },
{ provide: Storage, useValue: window.localStorage }, { provide: Storage, useValue: window.localStorage },

View file

@ -9,7 +9,7 @@
<textarea matInput [(ngModel)]="currentCategory.description" placeholder="Description"></textarea> <textarea matInput [(ngModel)]="currentCategory.description" placeholder="Description"></textarea>
</mat-form-field> </mat-form-field>
<mat-form-field (keyup.enter)="doAction()"> <mat-form-field (keyup.enter)="doAction()">
<input matInput type="text" [(ngModel)]="currentCategory.amount" placeholder="Amount" required currencyMask> <input matInput type="text" [(ngModel)]="currentCategory.amount" placeholder="Amount" required>
</mat-form-field> </mat-form-field>
<mat-radio-group [(ngModel)]="currentCategory.expense"> <mat-radio-group [(ngModel)]="currentCategory.expense">
<mat-radio-button [value]="true">Expense</mat-radio-button> <mat-radio-button [value]="true">Expense</mat-radio-button>

View file

@ -9,10 +9,11 @@
<textarea matInput [(ngModel)]="currentTransaction.description" placeholder="Description"></textarea> <textarea matInput [(ngModel)]="currentTransaction.description" placeholder="Description"></textarea>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput type="text" [(ngModel)]="currentTransaction.amount" placeholder="Amount" required currencyMask> <input matInput type="text" [(ngModel)]="currentTransaction.amount" placeholder="Amount" required>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput type="date" [ngModel]="transactionDate | date:'yyyy-MM-dd'" (ngModelChange)="transactionDate = $event" placeholder="Date" required> <input matInput type="date" [ngModel]="transactionDate | date:'yyyy-MM-dd'"
(ngModelChange)="transactionDate = $event" placeholder="Date" required>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput type="time" [(ngModel)]="currentTime" placeholder="Time" required> <input matInput type="time" [(ngModel)]="currentTime" placeholder="Time" required>