@wizishop/angular-components 14.4.1 → 14.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -770,6 +770,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
770
770
  args: ['keydown', ['$event']]
771
771
  }] } });
772
772
 
773
+ class TwoDigitDecimalNumberDirective {
774
+ constructor(el) {
775
+ this.el = el;
776
+ this.regex = new RegExp(/^\d+[.,]?\d{0,2}$/g); // user can put . or , char.
777
+ // input also cannot start from , or .
778
+ this.specialKeys = ['Backspace', 'Tab', 'End', 'Home', '-', 'ArrowLeft', 'ArrowRight', 'Del', 'Delete'];
779
+ }
780
+ onKeyDown(event) {
781
+ if (this.specialKeys.includes(event.key)) {
782
+ return;
783
+ }
784
+ const current = this.el.nativeElement.value;
785
+ const position = this.el.nativeElement.selectionStart;
786
+ const next = [current.slice(0, position), event.key == 'Decimal' ? '.' : event.key, current.slice(position)].join('');
787
+ if (next && !String(next).match(this.regex)) {
788
+ event.preventDefault();
789
+ }
790
+ }
791
+ }
792
+ TwoDigitDecimalNumberDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TwoDigitDecimalNumberDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
793
+ TwoDigitDecimalNumberDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: TwoDigitDecimalNumberDirective, selector: "[wacTwoDigitDecimalNumber]", host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 });
794
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TwoDigitDecimalNumberDirective, decorators: [{
795
+ type: Directive,
796
+ args: [{
797
+ selector: '[wacTwoDigitDecimalNumber]',
798
+ }]
799
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onKeyDown: [{
800
+ type: HostListener,
801
+ args: ['keydown', ['$event']]
802
+ }] } });
803
+
773
804
  const directives$2 = [
774
805
  DebounceKeyupDirective,
775
806
  AbstractDebounceDirective,
@@ -779,7 +810,8 @@ const directives$2 = [
779
810
  KeypressEnterDirective,
780
811
  SelectOptionDirective,
781
812
  SelectDirective,
782
- OnlyNumberDirective
813
+ OnlyNumberDirective,
814
+ TwoDigitDecimalNumberDirective
783
815
  ];
784
816
  class SharedDirectives {
785
817
  }
@@ -792,7 +824,8 @@ SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
792
824
  KeypressEnterDirective,
793
825
  SelectOptionDirective,
794
826
  SelectDirective,
795
- OnlyNumberDirective], imports: [CommonModule, FormsModule], exports: [DebounceKeyupDirective,
827
+ OnlyNumberDirective,
828
+ TwoDigitDecimalNumberDirective], imports: [CommonModule, FormsModule], exports: [DebounceKeyupDirective,
796
829
  AbstractDebounceDirective,
797
830
  AutoHideDirective,
798
831
  ZindexToggleDirective,
@@ -800,7 +833,8 @@ SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
800
833
  KeypressEnterDirective,
801
834
  SelectOptionDirective,
802
835
  SelectDirective,
803
- OnlyNumberDirective] });
836
+ OnlyNumberDirective,
837
+ TwoDigitDecimalNumberDirective] });
804
838
  SharedDirectives.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, imports: [CommonModule, FormsModule] });
805
839
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, decorators: [{
806
840
  type: NgModule,
@@ -6153,5 +6187,5 @@ class TableFiltersGroup extends NwbFilterGroup {
6153
6187
  * Generated bundle index. Do not edit.
6154
6188
  */
6155
6189
 
6156
- export { ACCORDION_ITEM, AbstractDebounceDirective, AccordionComponent, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AreAllOptionsSelectedPipe, AutoHideDirective, BackComponent, BlockComponent, BlockSeparatorComponent, BlockTitleLegacyComponent, BlockWithCheckboxComponent, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CardPriceComponent, ChargingBarComponent, CheckBoxRow, CheckboxComponent, ConfirmDeleteComponent, ContentWithButtonsComponent, DebounceKeyupDirective, DeleteComponent, DraganddropListComponent, DropdownComponent, EXPANSION_PANEL_HEADER, ExpandedPanelComponent, ExpansionExport, ExpansionModule, ExpansionPanelBase, ExpansionPanelComponent, ExpansionPanelDirective, ExpansionPanelHeaderComponent, ExpansionPanelHeaderDirective, FilterOptionsPipe, FiltersComponent, FiltersTableService, FindOptionSelectedPipe, FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FreePopinComponent, GooglePreviewComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, KeypressEnterDirective, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MosaicComponent, MultipleSearchComponent, MultipleSearchPlusComponent, OnlyNumberDirective, OptionCallToActionComponent, OptionComponent, OptionalDisableContainerComponent, PaginationComponent, PlaceholderComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectDirective, SelectFiltersPipe, SelectInTextComponent, SelectOptionDirective, SelectSearchTriggerComponent, SelectTestComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SummaryComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableFiltersGroup, TableRow, TagComponent, TagLabelComponent, TextAreaComponent, TextComponent, TokenCheckComponent, TooltipComponent, TreeComponent, TreeModule, UploadComponent, ValueChangeService, VarDirective, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WrapperMultipleBlockComponent, WrapperSidebarComponent, WzEditInPlaceComponent, ZindexToggleDirective };
6190
+ export { ACCORDION_ITEM, AbstractDebounceDirective, AccordionComponent, AlertComponent, AlertPopupComponent, AlertPopupModule, AlertPopupService, AreAllOptionsSelectedPipe, AutoHideDirective, BackComponent, BlockComponent, BlockSeparatorComponent, BlockTitleLegacyComponent, BlockWithCheckboxComponent, BreadcrumbsComponent, ButtonComponent, CalendarComponent, CardPriceComponent, ChargingBarComponent, CheckBoxRow, CheckboxComponent, ConfirmDeleteComponent, ContentWithButtonsComponent, DebounceKeyupDirective, DeleteComponent, DraganddropListComponent, DropdownComponent, EXPANSION_PANEL_HEADER, ExpandedPanelComponent, ExpansionExport, ExpansionModule, ExpansionPanelBase, ExpansionPanelComponent, ExpansionPanelDirective, ExpansionPanelHeaderComponent, ExpansionPanelHeaderDirective, FilterOptionsPipe, FiltersComponent, FiltersTableService, FindOptionSelectedPipe, FormatObjectToRecursifTreePipe, FormatObjectToSimpleTreePipe, FreePopinComponent, GooglePreviewComponent, H1Component, H2Component, H3Component, H4Component, HeaderPageComponent, HtmlContainer, ImageComponent, InfoComponent, InputComponent, InputSearchComponent, InputWithSelectComponent, KeypressEnterDirective, LabelComponent, LinkComponent, LoaderComponent, LogoComponent, MosaicComponent, MultipleSearchComponent, MultipleSearchPlusComponent, OnlyNumberDirective, OptionCallToActionComponent, OptionComponent, OptionalDisableContainerComponent, PaginationComponent, PlaceholderComponent, PopinComponent, ProgressBarComponent, RadioComponent, SearchComponent, SelectComponent, SelectDirective, SelectFiltersPipe, SelectInTextComponent, SelectOptionDirective, SelectSearchTriggerComponent, SelectTestComponent, SelectedListComponent, SeparatorComponent, SettingsComponent, SharedComponentsModule, SharedDirectives, SharedPipes, SnackbarComponent, StateComponent, SummaryComponent, SwitchComponent, TabComponent, TableColumn, TableColumnHeader, TableComponent, TableFiltersGroup, TableRow, TagComponent, TagLabelComponent, TextAreaComponent, TextComponent, TokenCheckComponent, TooltipComponent, TreeComponent, TreeModule, TwoDigitDecimalNumberDirective, UploadComponent, ValueChangeService, VarDirective, WiziComponentsModule, WrapperBlocsComponent, WrapperComponent, WrapperMultipleBlockComponent, WrapperSidebarComponent, WzEditInPlaceComponent, ZindexToggleDirective };
6157
6191
  //# sourceMappingURL=wizishop-angular-components.mjs.map