@wizishop/angular-components 14.3.33 → 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.
- package/angular-components.scss +2 -73
- package/esm2020/lib/components/inputs/input-with-select/input-with-select.component.mjs +8 -50
- package/esm2020/lib/components/selects/select-test/value-change.service.mjs +2 -2
- package/esm2020/lib/directives/keyboard-events/two-digital-decimal-number.directive.mjs +33 -0
- package/esm2020/lib/directives/shared-directives.module.mjs +8 -4
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/wizishop-angular-components.mjs +82 -87
- package/fesm2015/wizishop-angular-components.mjs.map +1 -1
- package/fesm2020/wizishop-angular-components.mjs +82 -87
- package/fesm2020/wizishop-angular-components.mjs.map +1 -1
- package/lib/components/inputs/input-with-select/input-with-select.component.d.ts +3 -18
- package/lib/directives/keyboard-events/two-digital-decimal-number.directive.d.ts +11 -0
- package/lib/directives/shared-directives.module.d.ts +4 -3
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/wizishop-angular-components-14.4.2.tgz +0 -0
- package/wizishop-angular-components-14.3.33.tgz +0 -0
|
@@ -547,7 +547,7 @@ class ValueChangeService {
|
|
|
547
547
|
});
|
|
548
548
|
}
|
|
549
549
|
updateSelectPlaceholder() {
|
|
550
|
-
if (!this.value) {
|
|
550
|
+
if (!this.value && typeof this.value !== 'number') {
|
|
551
551
|
this.selectedOptionContent = null;
|
|
552
552
|
return;
|
|
553
553
|
}
|
|
@@ -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
|
|
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,
|
|
@@ -3809,82 +3843,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
3809
3843
|
type: Output
|
|
3810
3844
|
}] } });
|
|
3811
3845
|
|
|
3812
|
-
class
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
if (!options) {
|
|
3816
|
-
return isFieldArray ? [] : '';
|
|
3817
|
-
}
|
|
3818
|
-
const optionSelected = options.find((item) => item.active);
|
|
3819
|
-
if (!optionSelected) {
|
|
3820
|
-
return isFieldArray ? [] : '';
|
|
3821
|
-
}
|
|
3822
|
-
if (isFieldArray) {
|
|
3823
|
-
return field.reduce((acc, curr) => {
|
|
3824
|
-
return acc[curr];
|
|
3825
|
-
}, optionSelected);
|
|
3826
|
-
}
|
|
3827
|
-
return optionSelected[field];
|
|
3846
|
+
class LabelComponent {
|
|
3847
|
+
constructor() { }
|
|
3848
|
+
ngOnInit() {
|
|
3828
3849
|
}
|
|
3829
3850
|
}
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type:
|
|
3833
|
-
type:
|
|
3834
|
-
args: [{
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
}] });
|
|
3851
|
+
LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3852
|
+
LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: LabelComponent, selector: "wac-label", host: { classAttribute: "wac-label" }, ngImport: i0, template: "<ng-content></ng-content>" });
|
|
3853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
|
|
3854
|
+
type: Component,
|
|
3855
|
+
args: [{ selector: 'wac-label', host: {
|
|
3856
|
+
'class': 'wac-label'
|
|
3857
|
+
}, template: "<ng-content></ng-content>" }]
|
|
3858
|
+
}], ctorParameters: function () { return []; } });
|
|
3838
3859
|
|
|
3839
3860
|
class InputWithSelectComponent {
|
|
3840
|
-
constructor() {
|
|
3841
|
-
this.showSelect = false;
|
|
3842
|
-
this.inputValueChange = new EventEmitter();
|
|
3843
|
-
this.selectValueChange = new EventEmitter();
|
|
3844
|
-
}
|
|
3845
|
-
onClickItem(index) {
|
|
3846
|
-
this.unActiveAll();
|
|
3847
|
-
const optionSelected = this.options[index];
|
|
3848
|
-
optionSelected.active = true;
|
|
3849
|
-
this.showSelect = false;
|
|
3850
|
-
this.selectValueChange.emit(index);
|
|
3851
|
-
}
|
|
3852
|
-
onToggleSelect() {
|
|
3853
|
-
this.showSelect = !this.showSelect;
|
|
3854
|
-
}
|
|
3855
|
-
onCloseSelect() {
|
|
3856
|
-
this.showSelect = false;
|
|
3857
|
-
}
|
|
3858
|
-
onChangeInputValue(e) {
|
|
3859
|
-
this.inputValueChange.emit(e.target.value);
|
|
3860
|
-
}
|
|
3861
|
-
unActiveAll() {
|
|
3862
|
-
this.options.forEach((item) => {
|
|
3863
|
-
item.active = false;
|
|
3864
|
-
});
|
|
3865
|
-
}
|
|
3866
3861
|
}
|
|
3867
3862
|
InputWithSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3868
|
-
InputWithSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: InputWithSelectComponent, selector: "wac-input-with-select",
|
|
3863
|
+
InputWithSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: InputWithSelectComponent, selector: "wac-input-with-select", queries: [{ propertyName: "label", first: true, predicate: LabelComponent, descendants: true }], ngImport: i0, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n<div class=\"wac-input-with-select\">\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\">\n <ng-content select=\"input\"></ng-content>\n <ng-content select=\"wac-select-test\"></ng-content>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <ng-content select=\"[text]\"></ng-content>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
3869
3864
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, decorators: [{
|
|
3870
3865
|
type: Component,
|
|
3871
|
-
args: [{ selector: 'wac-input-with-select', template: "<
|
|
3872
|
-
}],
|
|
3873
|
-
type:
|
|
3874
|
-
|
|
3875
|
-
type: Input
|
|
3876
|
-
}], options: [{
|
|
3877
|
-
type: Input
|
|
3878
|
-
}], placeholder: [{
|
|
3879
|
-
type: Input
|
|
3880
|
-
}], id: [{
|
|
3881
|
-
type: Input
|
|
3882
|
-
}], value: [{
|
|
3883
|
-
type: Input
|
|
3884
|
-
}], inputValueChange: [{
|
|
3885
|
-
type: Output
|
|
3886
|
-
}], selectValueChange: [{
|
|
3887
|
-
type: Output
|
|
3866
|
+
args: [{ selector: 'wac-input-with-select', encapsulation: ViewEncapsulation.None, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n<div class=\"wac-input-with-select\">\n <div class=\"wac-input-with-select__wrapper\">\n <div class=\"wac-input-with-select__wrapper__left\">\n <ng-content select=\"input\"></ng-content>\n <ng-content select=\"wac-select-test\"></ng-content>\n </div>\n <div class=\"wac-input-with-select__wrapper__right\">\n <ng-content select=\"[text]\"></ng-content>\n </div>\n </div>\n</div>\n" }]
|
|
3867
|
+
}], propDecorators: { label: [{
|
|
3868
|
+
type: ContentChild,
|
|
3869
|
+
args: [LabelComponent]
|
|
3888
3870
|
}] } });
|
|
3889
3871
|
|
|
3890
3872
|
class PopinComponent {
|
|
@@ -4644,6 +4626,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4644
4626
|
}]
|
|
4645
4627
|
}] });
|
|
4646
4628
|
|
|
4629
|
+
class FindOptionSelectedPipe {
|
|
4630
|
+
transform(options, field) {
|
|
4631
|
+
const isFieldArray = Array.isArray(field);
|
|
4632
|
+
if (!options) {
|
|
4633
|
+
return isFieldArray ? [] : '';
|
|
4634
|
+
}
|
|
4635
|
+
const optionSelected = options.find((item) => item.active);
|
|
4636
|
+
if (!optionSelected) {
|
|
4637
|
+
return isFieldArray ? [] : '';
|
|
4638
|
+
}
|
|
4639
|
+
if (isFieldArray) {
|
|
4640
|
+
return field.reduce((acc, curr) => {
|
|
4641
|
+
return acc[curr];
|
|
4642
|
+
}, optionSelected);
|
|
4643
|
+
}
|
|
4644
|
+
return optionSelected[field];
|
|
4645
|
+
}
|
|
4646
|
+
}
|
|
4647
|
+
FindOptionSelectedPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4648
|
+
FindOptionSelectedPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, name: "wacFindOptionSelectedField" });
|
|
4649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, decorators: [{
|
|
4650
|
+
type: Pipe,
|
|
4651
|
+
args: [{
|
|
4652
|
+
name: 'wacFindOptionSelectedField'
|
|
4653
|
+
}]
|
|
4654
|
+
}] });
|
|
4655
|
+
|
|
4647
4656
|
const exportedPipes = [
|
|
4648
4657
|
FormatObjectToRecursifTreePipe,
|
|
4649
4658
|
FormatObjectToSimpleTreePipe,
|
|
@@ -4733,20 +4742,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4733
4742
|
args: ['searchInput']
|
|
4734
4743
|
}] } });
|
|
4735
4744
|
|
|
4736
|
-
class LabelComponent {
|
|
4737
|
-
constructor() { }
|
|
4738
|
-
ngOnInit() {
|
|
4739
|
-
}
|
|
4740
|
-
}
|
|
4741
|
-
LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4742
|
-
LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: LabelComponent, selector: "wac-label", host: { classAttribute: "wac-label" }, ngImport: i0, template: "<ng-content></ng-content>" });
|
|
4743
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
|
|
4744
|
-
type: Component,
|
|
4745
|
-
args: [{ selector: 'wac-label', host: {
|
|
4746
|
-
'class': 'wac-label'
|
|
4747
|
-
}, template: "<ng-content></ng-content>" }]
|
|
4748
|
-
}], ctorParameters: function () { return []; } });
|
|
4749
|
-
|
|
4750
4745
|
class SelectTestComponent extends SelectDirective {
|
|
4751
4746
|
constructor(valueChangeService) {
|
|
4752
4747
|
super(valueChangeService);
|
|
@@ -6192,5 +6187,5 @@ class TableFiltersGroup extends NwbFilterGroup {
|
|
|
6192
6187
|
* Generated bundle index. Do not edit.
|
|
6193
6188
|
*/
|
|
6194
6189
|
|
|
6195
|
-
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 };
|
|
6196
6191
|
//# sourceMappingURL=wizishop-angular-components.mjs.map
|