dev #14607 Море. Правки по сайту: remove datepicker and add date mask

This commit is contained in:
nikolay 2023-07-05 14:21:19 +04:00
parent 9fd031f423
commit c1219e1637
7 changed files with 191 additions and 139 deletions

View File

@ -1,129 +1,131 @@
{ {
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1, "version": 1,
"newProjectRoot": "projects", "newProjectRoot": "projects",
"projects": { "projects": {
"coffee-like-more": { "coffee-like-more": {
"projectType": "application", "projectType": "application",
"schematics": { "schematics": {
"@schematics/angular:component": { "@schematics/angular:component": {
"style": "scss" "style": "scss"
} },
}, "i18n": {
"sourceLocale": "ru-RU"
"root": "", }
"sourceRoot": "src", },
"prefix": "app", "root": "",
"architect": { "sourceRoot": "src",
"build": { "prefix": "app",
"builder": "@angular-devkit/build-angular:browser", "architect": {
"options": { "build": {
"outputPath": "/var/www/html/lk.crm4retail.ru/more", "builder": "@angular-devkit/build-angular:browser",
"baseHref": "/", "options": {
"index": "src/index.html", "outputPath": "/var/www/html/lk.crm4retail.ru/more",
"main": "src/main.ts", "baseHref": "/",
"polyfills": "src/polyfills.ts", "index": "src/index.html",
"tsConfig": "tsconfig.app.json", "main": "src/main.ts",
"inlineStyleLanguage": "scss", "polyfills": "src/polyfills.ts",
"assets": [ "tsConfig": "tsconfig.app.json",
"src/favicon.ico", "inlineStyleLanguage": "scss",
"src/assets", "assets": [
"src/manifest.webmanifest", "src/favicon.ico",
"src/firebase-messaging-sw.js", "src/assets",
"src/sw-master.js", "src/manifest.webmanifest",
"src/sw-custom.js" "src/firebase-messaging-sw.js",
], "src/sw-master.js",
"styles": [ "src/sw-custom.js"
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", ],
"node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css", "styles": [
"node_modules/primeicons/primeicons.css", "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"node_modules/primeng/resources/primeng.min.css", "node_modules/primeng/resources/themes/bootstrap4-light-blue/theme.css",
"node_modules/ngx-sharebuttons/themes/modern.scss", "node_modules/primeicons/primeicons.css",
"node_modules/ngx-sharebuttons/themes/material.scss", "node_modules/primeng/resources/primeng.min.css",
"src/styles.scss" "node_modules/ngx-sharebuttons/themes/modern.scss",
], "node_modules/ngx-sharebuttons/themes/material.scss",
"scripts": [], "src/styles.scss"
"serviceWorker": true, ],
"ngswConfigPath": "ngsw-config.json" "scripts": [],
}, "serviceWorker": true,
"configurations": { "ngswConfigPath": "ngsw-config.json"
"production": { },
"budgets": [ "configurations": {
{ "production": {
"type": "initial", "budgets": [
"maximumWarning": "4mb", {
"maximumError": "5mb" "type": "initial",
}, "maximumWarning": "4mb",
{ "maximumError": "5mb"
"type": "anyComponentStyle", },
"maximumWarning": "2kb", {
"maximumError": "4kb" "type": "anyComponentStyle",
} "maximumWarning": "2kb",
], "maximumError": "4kb"
"fileReplacements": [ }
{ ],
"replace": "src/environments/environment.ts", "fileReplacements": [
"with": "src/environments/environment.prod.ts" {
} "replace": "src/environments/environment.ts",
], "with": "src/environments/environment.prod.ts"
"outputHashing": "all" }
}, ],
"development": { "outputHashing": "all"
"buildOptimizer": false, },
"optimization": false, "development": {
"vendorChunk": true, "buildOptimizer": false,
"extractLicenses": false, "optimization": false,
"sourceMap": true, "vendorChunk": true,
"namedChunks": true "extractLicenses": false,
} "sourceMap": true,
}, "namedChunks": true
"defaultConfiguration": "production" }
}, },
"serve": { "defaultConfiguration": "production"
"builder": "@angular-devkit/build-angular:dev-server", },
"configurations": { "serve": {
"production": { "builder": "@angular-devkit/build-angular:dev-server",
"browserTarget": "coffee-like-more:build:production" "configurations": {
}, "production": {
"development": { "browserTarget": "coffee-like-more:build:production"
"browserTarget": "coffee-like-more:build:development", },
"proxyConfig": "proxy.confi.json" "development": {
} "browserTarget": "coffee-like-more:build:development",
}, "proxyConfig": "proxy.confi.json"
"defaultConfiguration": "development" }
}, },
"extract-i18n": { "defaultConfiguration": "development"
"builder": "@angular-devkit/build-angular:extract-i18n", },
"options": { "extract-i18n": {
"browserTarget": "coffee-like-more:build" "builder": "@angular-devkit/build-angular:extract-i18n",
} "options": {
}, "browserTarget": "coffee-like-more:build"
"test": { }
"builder": "@angular-devkit/build-angular:karma", },
"options": { "test": {
"main": "src/test.ts", "builder": "@angular-devkit/build-angular:karma",
"polyfills": "src/polyfills.ts", "options": {
"tsConfig": "tsconfig.spec.json", "main": "src/test.ts",
"karmaConfig": "karma.conf.js", "polyfills": "src/polyfills.ts",
"inlineStyleLanguage": "scss", "tsConfig": "tsconfig.spec.json",
"assets": [ "karmaConfig": "karma.conf.js",
"src/favicon.ico", "inlineStyleLanguage": "scss",
"src/firebase-messaging-sw.js", "assets": [
"src/assets", "src/favicon.ico",
"src/manifest.webmanifest" "src/firebase-messaging-sw.js",
], "src/assets",
"styles": [ "src/manifest.webmanifest"
"./node_modules/@angular/material/prebuilt-themes/purple-green.css", ],
"src/styles.scss" "styles": [
], "./node_modules/@angular/material/prebuilt-themes/purple-green.css",
"scripts": [] "src/styles.scss"
} ],
} "scripts": []
} }
}
}
}
},
"cli": {
"analytics": false
} }
},
"cli": {
"analytics": false
}
} }

View File

@ -16,6 +16,7 @@
"@angular/fire": "^7.5.0", "@angular/fire": "^7.5.0",
"@angular/forms": "^15.2.9", "@angular/forms": "^15.2.9",
"@angular/material": "^15.2.9", "@angular/material": "^15.2.9",
"@angular/material-moment-adapter": "^15.2.9",
"@angular/platform-browser": "^15.2.9", "@angular/platform-browser": "^15.2.9",
"@angular/platform-browser-dynamic": "^15.2.9", "@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9", "@angular/router": "^15.2.9",
@ -27,6 +28,7 @@
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@types/web": "^0.0.99", "@types/web": "^0.0.99",
"angular-moment-timezone": "^1.7.1", "angular-moment-timezone": "^1.7.1",
"angular2-text-mask": "^9.0.0",
"barcode-2-svg": "^0.3.3", "barcode-2-svg": "^0.3.3",
"firebase": "^9.9.3", "firebase": "^9.9.3",
"google-libphonenumber": "^3.2.30", "google-libphonenumber": "^3.2.30",
@ -864,6 +866,19 @@
"rxjs": "^6.5.3 || ^7.4.0" "rxjs": "^6.5.3 || ^7.4.0"
} }
}, },
"node_modules/@angular/material-moment-adapter": {
"version": "15.2.9",
"resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-15.2.9.tgz",
"integrity": "sha512-DHG8z8DG1/+oO/bRC/k+1nXwRGg0qDsCEYulUoEUtpYmQRHj8Tid/9V2JiibYqTh4s0DJeAnx64CAO9K/k9EZg==",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/core": "^15.0.0 || ^16.0.0",
"@angular/material": "15.2.9",
"moment": "^2.18.1"
}
},
"node_modules/@angular/platform-browser": { "node_modules/@angular/platform-browser": {
"version": "15.2.9", "version": "15.2.9",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-15.2.9.tgz", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-15.2.9.tgz",
@ -5813,6 +5828,14 @@
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.29.tgz", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.29.tgz",
"integrity": "sha512-mla2acNCMkWXBD+c+yeUrBUrzOxYMNFdQ6FGfigGGtEVBPJx07BQeJekjt9DmH1FtZek4E9rE1eRR9qQpxACOQ==" "integrity": "sha512-mla2acNCMkWXBD+c+yeUrBUrzOxYMNFdQ6FGfigGGtEVBPJx07BQeJekjt9DmH1FtZek4E9rE1eRR9qQpxACOQ=="
}, },
"node_modules/angular2-text-mask": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/angular2-text-mask/-/angular2-text-mask-9.0.0.tgz",
"integrity": "sha512-iALcnhJPS1zvX48d86rgUgDe/crX6XfhZrXC4Gdlo2/YwZW7u7KJZY6/b3ieSCIWVq/E6p+wDCzeo3E6leRjDA==",
"dependencies": {
"text-mask-core": "^5.0.0"
}
},
"node_modules/ansi-colors": { "node_modules/ansi-colors": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
@ -13564,6 +13587,11 @@
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
}, },
"node_modules/text-mask-core": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/text-mask-core/-/text-mask-core-5.1.2.tgz",
"integrity": "sha512-VfkCMdmRRZqXgQZFlDMiavm3hzsMzBM23CxHZsaeAYg66ZhXCNJWrFmnJwNy8KF9f74YvAUAuQenxsMCfuvhUw=="
},
"node_modules/text-table": { "node_modules/text-table": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@ -15118,6 +15146,14 @@
"tslib": "^2.3.0" "tslib": "^2.3.0"
} }
}, },
"@angular/material-moment-adapter": {
"version": "15.2.9",
"resolved": "https://registry.npmjs.org/@angular/material-moment-adapter/-/material-moment-adapter-15.2.9.tgz",
"integrity": "sha512-DHG8z8DG1/+oO/bRC/k+1nXwRGg0qDsCEYulUoEUtpYmQRHj8Tid/9V2JiibYqTh4s0DJeAnx64CAO9K/k9EZg==",
"requires": {
"tslib": "^2.3.0"
}
},
"@angular/platform-browser": { "@angular/platform-browser": {
"version": "15.2.9", "version": "15.2.9",
"resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-15.2.9.tgz", "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-15.2.9.tgz",
@ -18959,6 +18995,14 @@
} }
} }
}, },
"angular2-text-mask": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/angular2-text-mask/-/angular2-text-mask-9.0.0.tgz",
"integrity": "sha512-iALcnhJPS1zvX48d86rgUgDe/crX6XfhZrXC4Gdlo2/YwZW7u7KJZY6/b3ieSCIWVq/E6p+wDCzeo3E6leRjDA==",
"requires": {
"text-mask-core": "^5.0.0"
}
},
"ansi-colors": { "ansi-colors": {
"version": "4.1.3", "version": "4.1.3",
"resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz",
@ -24763,6 +24807,11 @@
"resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
"integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==" "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg=="
}, },
"text-mask-core": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/text-mask-core/-/text-mask-core-5.1.2.tgz",
"integrity": "sha512-VfkCMdmRRZqXgQZFlDMiavm3hzsMzBM23CxHZsaeAYg66ZhXCNJWrFmnJwNy8KF9f74YvAUAuQenxsMCfuvhUw=="
},
"text-table": { "text-table": {
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",

View File

@ -18,6 +18,7 @@
"@angular/fire": "^7.5.0", "@angular/fire": "^7.5.0",
"@angular/forms": "^15.2.9", "@angular/forms": "^15.2.9",
"@angular/material": "^15.2.9", "@angular/material": "^15.2.9",
"@angular/material-moment-adapter": "^15.2.9",
"@angular/platform-browser": "^15.2.9", "@angular/platform-browser": "^15.2.9",
"@angular/platform-browser-dynamic": "^15.2.9", "@angular/platform-browser-dynamic": "^15.2.9",
"@angular/router": "^15.2.9", "@angular/router": "^15.2.9",
@ -29,6 +30,7 @@
"@types/uuid": "^8.3.4", "@types/uuid": "^8.3.4",
"@types/web": "^0.0.99", "@types/web": "^0.0.99",
"angular-moment-timezone": "^1.7.1", "angular-moment-timezone": "^1.7.1",
"angular2-text-mask": "^9.0.0",
"barcode-2-svg": "^0.3.3", "barcode-2-svg": "^0.3.3",
"firebase": "^9.9.3", "firebase": "^9.9.3",
"google-libphonenumber": "^3.2.30", "google-libphonenumber": "^3.2.30",

View File

@ -50,7 +50,6 @@ import {
} from '@angular/material/bottom-sheet'; } from '@angular/material/bottom-sheet';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import { DirectivesModule } from './directives/directives.module'; import { DirectivesModule } from './directives/directives.module';
import { MAT_DATE_LOCALE } from '@angular/material/core';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -108,7 +107,7 @@ import { MAT_DATE_LOCALE } from '@angular/material/core';
MatSnackBarModule, MatSnackBarModule,
MatBottomSheetModule, MatBottomSheetModule,
MatProgressSpinnerModule, MatProgressSpinnerModule,
DirectivesModule DirectivesModule,
], ],
providers: [ providers: [
DialogService, DialogService,
@ -116,7 +115,6 @@ import { MAT_DATE_LOCALE } from '@angular/material/core';
MessagingService, MessagingService,
{ provide: MatBottomSheetRef, useValue: {} }, { provide: MatBottomSheetRef, useValue: {} },
{ provide: MAT_BOTTOM_SHEET_DATA, useValue: {} }, { provide: MAT_BOTTOM_SHEET_DATA, useValue: {} },
{ provide: MAT_DATE_LOCALE, useValue: 'ru-RU' }
], ],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })

View File

@ -7,9 +7,7 @@ import { SocialMediaButtonsComponent } from './components/social-media-buttons/s
import { NavbarComponent } from './components/navbar/navbar.component'; import { NavbarComponent } from './components/navbar/navbar.component';
import { MenuItemComponent } from './components/navbar/menu_item.component'; import { MenuItemComponent } from './components/navbar/menu_item.component';
import { MatIconModule } from '@angular/material/icon'; import { MatIconModule } from '@angular/material/icon';
import { MatDatepickerModule } from '@angular/material/datepicker';
import { MatSelectModule } from '@angular/material/select'; import { MatSelectModule } from '@angular/material/select';
import { MatNativeDateModule } from '@angular/material/core';
import { GuestCardComponent } from './pages/guest-card/guest-card.component'; import { GuestCardComponent } from './pages/guest-card/guest-card.component';
import { QrCodeModule } from 'ng-qrcode'; import { QrCodeModule } from 'ng-qrcode';
import { AccordionComponent } from './components/accordion/accordion.component'; import { AccordionComponent } from './components/accordion/accordion.component';
@ -26,7 +24,7 @@ import { LoyalityProgramComponent } from './pages/loyality-program/loyality-prog
import { MatButtonModule } from '@angular/material/button'; import { MatButtonModule } from '@angular/material/button';
import { ToastModule } from 'primeng/toast'; import { ToastModule } from 'primeng/toast';
import { CreateUserComponent } from './pages/create_user/create_user.component'; import { CreateUserComponent } from './pages/create_user/create_user.component';
import { TextMaskModule } from 'angular2-text-mask';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -44,6 +42,7 @@ import { CreateUserComponent } from './pages/create_user/create_user.component';
CreateUserComponent, CreateUserComponent,
], ],
imports: [ imports: [
TextMaskModule,
ToastModule, ToastModule,
CommonModule, CommonModule,
DefaultOptionRoutingModule, DefaultOptionRoutingModule,
@ -57,9 +56,7 @@ import { CreateUserComponent } from './pages/create_user/create_user.component';
MatInputModule, MatInputModule,
DirectivesModule, DirectivesModule,
MatButtonModule, MatButtonModule,
MatDatepickerModule, MatSelectModule,
MatSelectModule,
MatNativeDateModule,
], ],
bootstrap: [IndexComponent], bootstrap: [IndexComponent],
}) })

View File

@ -19,10 +19,8 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Дата рождения</mat-label> <mat-label>Дата рождения</mat-label>
<input formControlName="date" matInput [matDatepicker]="picker"> <input formControlName="date" matInput [textMask]="mask">
<mat-datepicker-toggle matIconSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field> </mat-form-field>
<button mat-raised-button color="primary">Зарегистрироваться</button> <button mat-raised-button color="primary">Зарегистрироваться</button>
</div> </div>

View File

@ -16,6 +16,12 @@ export class CreateUserComponent implements OnInit {
date: new FormControl('', [Validators.required]), date: new FormControl('', [Validators.required]),
}); });
public mask = {
guide: true,
showMask: false,
mask: [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/]
};
constructor( constructor(
public authService: AuthService, public authService: AuthService,
private messageService: MessageService, private messageService: MessageService,