Locale support for sa-currency-input and date-picker#44
Open
Dastaan2k wants to merge 17 commits intosimplifiedautomation:masterfrom
Open
Locale support for sa-currency-input and date-picker#44Dastaan2k wants to merge 17 commits intosimplifiedautomation:masterfrom
Dastaan2k wants to merge 17 commits intosimplifiedautomation:masterfrom
Conversation
Contributor
|
remove package.json |
Jeet-s
reviewed
Aug 17, 2021
| stateChanges = new Subject<void>(); | ||
| private _value: any; | ||
| private viewValue: string; | ||
| //private viewValue: string; |
|
|
||
| constructor(private _focusMonitor: FocusMonitor, private _elementRef: ElementRef<HTMLElement>, @Optional() @Self() public ngControl: NgControl, @Inject(LOCALE_ID) private locale: string,private currencyPipe: CurrencyPipe) { | ||
|
|
||
| this.decimalSeparator = '.'; |
Contributor
There was a problem hiding this comment.
get decimal separator based on locale
| @@ -1,7 +1,33 @@ | |||
| import { NgModule } from '@angular/core'; | |||
Contributor
There was a problem hiding this comment.
make a different PR for examples
- Both decimal and group selector values are now set based on the app's locale instead of hardcoded values. - Registered spanish locale data. - Removed the hardcoded locale from module.ts - Removed commented code.
…plified-ui into locale-support-new
- Fixed shouldLabelFloat based on current focused state and FormControl's value
Jeet-s
reviewed
Aug 20, 2021
| static nextId = 0; | ||
| private decimalSeparator: string; | ||
|
|
||
| private decimalSeparator; |
| private decimalSeparator: string; | ||
|
|
||
| private decimalSeparator; | ||
| private groupSeparator; |
|
|
||
| import localeEs from '@angular/common/locales/es'; | ||
|
|
||
| registerLocaleData(localeEs); |
Contributor
There was a problem hiding this comment.
we can register locale in the app only
| this.viewValue = num; | ||
| this.value = this.parse(num); | ||
| }); | ||
| this.currencyValue.valueChanges.pipe(debounceTime(200)).subscribe((num) => {}); |
Contributor
There was a problem hiding this comment.
we can remove this subscription
| set value(val: string | null) { | ||
| this._value = val; | ||
| if (this._value != null && this._value !== '') { | ||
| if (this._value != null && this._value !== '' && this._value >= 0) { |
| get shouldLabelFloat() { | ||
| return this.focused || !this.empty; | ||
| if (!this.focused) { | ||
| return this.currencyValue.value !== null; |
Contributor
There was a problem hiding this comment.
can we use this.empty instead of checking null?
| @ViewChild('input') inputRef: ElementRef; | ||
| @Input() allowNegative: boolean = true; | ||
|
|
||
| @Input()allowNegative: boolean = true; |
|
|
||
| if(this.currencyValue.value != null) { | ||
| if (origin) { | ||
| this.currencyValue.setValue(this.parse(this.currencyValue.value.replace(getLocaleCurrencySymbol(this.locale), ''))); |
Contributor
There was a problem hiding this comment.
we should add logic to replace currency symbol in parse method
| } | ||
| "defaultProject": "simplified-ui-library", | ||
| "cli": { | ||
| "analytics": "cb8df5c8-539c-4c04-bbee-3864e14c6b3a" |
Contributor
There was a problem hiding this comment.
why are we using this analytics property?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added locale support for currency input and date time picker