@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
|
@@ -548,7 +548,7 @@ class ValueChangeService {
|
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
updateSelectPlaceholder() {
|
|
551
|
-
if (!this.value) {
|
|
551
|
+
if (!this.value && typeof this.value !== 'number') {
|
|
552
552
|
this.selectedOptionContent = null;
|
|
553
553
|
return;
|
|
554
554
|
}
|
|
@@ -771,6 +771,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
771
771
|
args: ['keydown', ['$event']]
|
|
772
772
|
}] } });
|
|
773
773
|
|
|
774
|
+
class TwoDigitDecimalNumberDirective {
|
|
775
|
+
constructor(el) {
|
|
776
|
+
this.el = el;
|
|
777
|
+
this.regex = new RegExp(/^\d+[.,]?\d{0,2}$/g); // user can put . or , char.
|
|
778
|
+
// input also cannot start from , or .
|
|
779
|
+
this.specialKeys = ['Backspace', 'Tab', 'End', 'Home', '-', 'ArrowLeft', 'ArrowRight', 'Del', 'Delete'];
|
|
780
|
+
}
|
|
781
|
+
onKeyDown(event) {
|
|
782
|
+
if (this.specialKeys.includes(event.key)) {
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
const current = this.el.nativeElement.value;
|
|
786
|
+
const position = this.el.nativeElement.selectionStart;
|
|
787
|
+
const next = [current.slice(0, position), event.key == 'Decimal' ? '.' : event.key, current.slice(position)].join('');
|
|
788
|
+
if (next && !String(next).match(this.regex)) {
|
|
789
|
+
event.preventDefault();
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
TwoDigitDecimalNumberDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TwoDigitDecimalNumberDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
794
|
+
TwoDigitDecimalNumberDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: TwoDigitDecimalNumberDirective, selector: "[wacTwoDigitDecimalNumber]", host: { listeners: { "keydown": "onKeyDown($event)" } }, ngImport: i0 });
|
|
795
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: TwoDigitDecimalNumberDirective, decorators: [{
|
|
796
|
+
type: Directive,
|
|
797
|
+
args: [{
|
|
798
|
+
selector: '[wacTwoDigitDecimalNumber]',
|
|
799
|
+
}]
|
|
800
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onKeyDown: [{
|
|
801
|
+
type: HostListener,
|
|
802
|
+
args: ['keydown', ['$event']]
|
|
803
|
+
}] } });
|
|
804
|
+
|
|
774
805
|
const directives$2 = [
|
|
775
806
|
DebounceKeyupDirective,
|
|
776
807
|
AbstractDebounceDirective,
|
|
@@ -780,7 +811,8 @@ const directives$2 = [
|
|
|
780
811
|
KeypressEnterDirective,
|
|
781
812
|
SelectOptionDirective,
|
|
782
813
|
SelectDirective,
|
|
783
|
-
OnlyNumberDirective
|
|
814
|
+
OnlyNumberDirective,
|
|
815
|
+
TwoDigitDecimalNumberDirective
|
|
784
816
|
];
|
|
785
817
|
class SharedDirectives {
|
|
786
818
|
}
|
|
@@ -793,7 +825,8 @@ SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
793
825
|
KeypressEnterDirective,
|
|
794
826
|
SelectOptionDirective,
|
|
795
827
|
SelectDirective,
|
|
796
|
-
OnlyNumberDirective
|
|
828
|
+
OnlyNumberDirective,
|
|
829
|
+
TwoDigitDecimalNumberDirective], imports: [CommonModule, FormsModule], exports: [DebounceKeyupDirective,
|
|
797
830
|
AbstractDebounceDirective,
|
|
798
831
|
AutoHideDirective,
|
|
799
832
|
ZindexToggleDirective,
|
|
@@ -801,7 +834,8 @@ SharedDirectives.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", versio
|
|
|
801
834
|
KeypressEnterDirective,
|
|
802
835
|
SelectOptionDirective,
|
|
803
836
|
SelectDirective,
|
|
804
|
-
OnlyNumberDirective
|
|
837
|
+
OnlyNumberDirective,
|
|
838
|
+
TwoDigitDecimalNumberDirective] });
|
|
805
839
|
SharedDirectives.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, imports: [CommonModule, FormsModule] });
|
|
806
840
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SharedDirectives, decorators: [{
|
|
807
841
|
type: NgModule,
|
|
@@ -3822,82 +3856,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
3822
3856
|
type: Output
|
|
3823
3857
|
}] } });
|
|
3824
3858
|
|
|
3825
|
-
class
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
if (!options) {
|
|
3829
|
-
return isFieldArray ? [] : '';
|
|
3830
|
-
}
|
|
3831
|
-
const optionSelected = options.find((item) => item.active);
|
|
3832
|
-
if (!optionSelected) {
|
|
3833
|
-
return isFieldArray ? [] : '';
|
|
3834
|
-
}
|
|
3835
|
-
if (isFieldArray) {
|
|
3836
|
-
return field.reduce((acc, curr) => {
|
|
3837
|
-
return acc[curr];
|
|
3838
|
-
}, optionSelected);
|
|
3839
|
-
}
|
|
3840
|
-
return optionSelected[field];
|
|
3859
|
+
class LabelComponent {
|
|
3860
|
+
constructor() { }
|
|
3861
|
+
ngOnInit() {
|
|
3841
3862
|
}
|
|
3842
3863
|
}
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type:
|
|
3846
|
-
type:
|
|
3847
|
-
args: [{
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
}] });
|
|
3864
|
+
LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3865
|
+
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>" });
|
|
3866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
|
|
3867
|
+
type: Component,
|
|
3868
|
+
args: [{ selector: 'wac-label', host: {
|
|
3869
|
+
'class': 'wac-label'
|
|
3870
|
+
}, template: "<ng-content></ng-content>" }]
|
|
3871
|
+
}], ctorParameters: function () { return []; } });
|
|
3851
3872
|
|
|
3852
3873
|
class InputWithSelectComponent {
|
|
3853
|
-
constructor() {
|
|
3854
|
-
this.showSelect = false;
|
|
3855
|
-
this.inputValueChange = new EventEmitter();
|
|
3856
|
-
this.selectValueChange = new EventEmitter();
|
|
3857
|
-
}
|
|
3858
|
-
onClickItem(index) {
|
|
3859
|
-
this.unActiveAll();
|
|
3860
|
-
const optionSelected = this.options[index];
|
|
3861
|
-
optionSelected.active = true;
|
|
3862
|
-
this.showSelect = false;
|
|
3863
|
-
this.selectValueChange.emit(index);
|
|
3864
|
-
}
|
|
3865
|
-
onToggleSelect() {
|
|
3866
|
-
this.showSelect = !this.showSelect;
|
|
3867
|
-
}
|
|
3868
|
-
onCloseSelect() {
|
|
3869
|
-
this.showSelect = false;
|
|
3870
|
-
}
|
|
3871
|
-
onChangeInputValue(e) {
|
|
3872
|
-
this.inputValueChange.emit(e.target.value);
|
|
3873
|
-
}
|
|
3874
|
-
unActiveAll() {
|
|
3875
|
-
this.options.forEach((item) => {
|
|
3876
|
-
item.active = false;
|
|
3877
|
-
});
|
|
3878
|
-
}
|
|
3879
3874
|
}
|
|
3880
3875
|
InputWithSelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3881
|
-
InputWithSelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: InputWithSelectComponent, selector: "wac-input-with-select",
|
|
3876
|
+
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 });
|
|
3882
3877
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: InputWithSelectComponent, decorators: [{
|
|
3883
3878
|
type: Component,
|
|
3884
|
-
args: [{ selector: 'wac-input-with-select', template: "<
|
|
3885
|
-
}],
|
|
3886
|
-
type:
|
|
3887
|
-
|
|
3888
|
-
type: Input
|
|
3889
|
-
}], options: [{
|
|
3890
|
-
type: Input
|
|
3891
|
-
}], placeholder: [{
|
|
3892
|
-
type: Input
|
|
3893
|
-
}], id: [{
|
|
3894
|
-
type: Input
|
|
3895
|
-
}], value: [{
|
|
3896
|
-
type: Input
|
|
3897
|
-
}], inputValueChange: [{
|
|
3898
|
-
type: Output
|
|
3899
|
-
}], selectValueChange: [{
|
|
3900
|
-
type: Output
|
|
3879
|
+
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" }]
|
|
3880
|
+
}], propDecorators: { label: [{
|
|
3881
|
+
type: ContentChild,
|
|
3882
|
+
args: [LabelComponent]
|
|
3901
3883
|
}] } });
|
|
3902
3884
|
|
|
3903
3885
|
class PopinComponent {
|
|
@@ -4658,6 +4640,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4658
4640
|
}]
|
|
4659
4641
|
}] });
|
|
4660
4642
|
|
|
4643
|
+
class FindOptionSelectedPipe {
|
|
4644
|
+
transform(options, field) {
|
|
4645
|
+
const isFieldArray = Array.isArray(field);
|
|
4646
|
+
if (!options) {
|
|
4647
|
+
return isFieldArray ? [] : '';
|
|
4648
|
+
}
|
|
4649
|
+
const optionSelected = options.find((item) => item.active);
|
|
4650
|
+
if (!optionSelected) {
|
|
4651
|
+
return isFieldArray ? [] : '';
|
|
4652
|
+
}
|
|
4653
|
+
if (isFieldArray) {
|
|
4654
|
+
return field.reduce((acc, curr) => {
|
|
4655
|
+
return acc[curr];
|
|
4656
|
+
}, optionSelected);
|
|
4657
|
+
}
|
|
4658
|
+
return optionSelected[field];
|
|
4659
|
+
}
|
|
4660
|
+
}
|
|
4661
|
+
FindOptionSelectedPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
4662
|
+
FindOptionSelectedPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, name: "wacFindOptionSelectedField" });
|
|
4663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: FindOptionSelectedPipe, decorators: [{
|
|
4664
|
+
type: Pipe,
|
|
4665
|
+
args: [{
|
|
4666
|
+
name: 'wacFindOptionSelectedField'
|
|
4667
|
+
}]
|
|
4668
|
+
}] });
|
|
4669
|
+
|
|
4661
4670
|
const exportedPipes = [
|
|
4662
4671
|
FormatObjectToRecursifTreePipe,
|
|
4663
4672
|
FormatObjectToSimpleTreePipe,
|
|
@@ -4747,20 +4756,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4747
4756
|
args: ['searchInput']
|
|
4748
4757
|
}] } });
|
|
4749
4758
|
|
|
4750
|
-
class LabelComponent {
|
|
4751
|
-
constructor() { }
|
|
4752
|
-
ngOnInit() {
|
|
4753
|
-
}
|
|
4754
|
-
}
|
|
4755
|
-
LabelComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4756
|
-
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>" });
|
|
4757
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: LabelComponent, decorators: [{
|
|
4758
|
-
type: Component,
|
|
4759
|
-
args: [{ selector: 'wac-label', host: {
|
|
4760
|
-
'class': 'wac-label'
|
|
4761
|
-
}, template: "<ng-content></ng-content>" }]
|
|
4762
|
-
}], ctorParameters: function () { return []; } });
|
|
4763
|
-
|
|
4764
4759
|
class SelectTestComponent extends SelectDirective {
|
|
4765
4760
|
constructor(valueChangeService) {
|
|
4766
4761
|
super(valueChangeService);
|
|
@@ -6210,5 +6205,5 @@ class TableFiltersGroup extends NwbFilterGroup {
|
|
|
6210
6205
|
* Generated bundle index. Do not edit.
|
|
6211
6206
|
*/
|
|
6212
6207
|
|
|
6213
|
-
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 };
|
|
6208
|
+
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 };
|
|
6214
6209
|
//# sourceMappingURL=wizishop-angular-components.mjs.map
|