@aaamb/ngx-design-system 1.3.1 → 1.3.3

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.
@@ -1978,6 +1978,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
1978
1978
  }] } });
1979
1979
 
1980
1980
  class SingleSelectorComponent {
1981
+ booleanFalseToken = '__ads_boolean_false__';
1982
+ booleanTrueToken = '__ads_boolean_true__';
1981
1983
  label = input('', ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
1982
1984
  placeholder = input('Select an option', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
1983
1985
  disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
@@ -2039,8 +2041,12 @@ class SingleSelectorComponent {
2039
2041
  }
2040
2042
  writeValue(value) {
2041
2043
  this.cvaMode = true;
2044
+ if (value === undefined) {
2045
+ return;
2046
+ }
2042
2047
  if (typeof value === 'string' ||
2043
2048
  typeof value === 'number' ||
2049
+ typeof value === 'boolean' ||
2044
2050
  value === null) {
2045
2051
  this.currentValue.set(value);
2046
2052
  return;
@@ -2111,6 +2117,15 @@ class SingleSelectorComponent {
2111
2117
  onLabelClicked() {
2112
2118
  this.onLabelButtonClick.emit();
2113
2119
  }
2120
+ encodeValue(value) {
2121
+ if (value === true) {
2122
+ return this.booleanTrueToken;
2123
+ }
2124
+ if (value === false) {
2125
+ return this.booleanFalseToken;
2126
+ }
2127
+ return value;
2128
+ }
2114
2129
  isOptionGroup(item) {
2115
2130
  return 'children' in item;
2116
2131
  }
@@ -2121,17 +2136,23 @@ class SingleSelectorComponent {
2121
2136
  useExisting: forwardRef(() => SingleSelectorComponent),
2122
2137
  multi: true,
2123
2138
  },
2124
- ], ngImport: i0, template: "<div class=\"flex w-full flex-col\">\n <ads-label\n [text]=\"label()\"\n [iconName]=\"labelIconName()\"\n (iconClicked)=\"onLabelClicked()\"\n ></ads-label>\n\n <nz-select\n class=\"w-full\"\n [ngModel]=\"currentValue()\"\n [nzPlaceHolder]=\"placeholder()\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"allowClear()\"\n [nzDisabled]=\"isDisabled()\"\n [nzLoading]=\"isLoading()\"\n [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onSelectionChange($event)\"\n (nzBlur)=\"onBlur()\"\n [nzStatus]=\"errorMessage() ? 'error' : ''\"\n >\n @for (option of resolvedOptions(); track $index) {\n @if (isOptionGroup(option)) {\n <nz-option-group [nzLabel]=\"option.label\">\n @for (item of option.children; track item.value) {\n <nz-option\n [nzValue]=\"item.value\"\n [nzLabel]=\"item.label\"\n [nzDisabled]=\"item.disabled\"\n ></nz-option>\n }\n </nz-option-group>\n } @else {\n <nz-option\n [nzValue]=\"option.value\"\n [nzLabel]=\"option.label\"\n [nzDisabled]=\"option.disabled\"\n ></nz-option>\n }\n }\n </nz-select>\n\n <ads-error-message\n [hasError]=\"!!errorMessage()\"\n [errorMessage]=\"errorMessage()\"\n ></ads-error-message>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i2$1.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i2$1.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzPrefix", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "component", type: i2$1.NzOptionGroupComponent, selector: "nz-option-group", inputs: ["nzLabel"], exportAs: ["nzOptionGroup"] }, { kind: "component", type: LabelComponent, selector: "ads-label", inputs: ["text", "iconName", "iconSize"], outputs: ["iconClicked"] }, { kind: "component", type: ErrorMessageComponent, selector: "ads-error-message", inputs: ["hasError", "errorMessage"] }] });
2139
+ ], ngImport: i0, template: "<div class=\"flex w-full flex-col\">\n <ads-label\n [text]=\"label()\"\n [iconName]=\"labelIconName()\"\n (iconClicked)=\"onLabelClicked()\"\n ></ads-label>\n\n <nz-select\n class=\"w-full\"\n [ngModel]=\"encodeValue(currentValue())\"\n [nzPlaceHolder]=\"placeholder()\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"allowClear()\"\n [nzDisabled]=\"isDisabled()\"\n [nzLoading]=\"isLoading()\"\n [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onSelectionChange($event)\"\n (nzBlur)=\"onBlur()\"\n [nzStatus]=\"errorMessage() ? 'error' : ''\"\n >\n @for (option of resolvedOptions(); track $index) {\n @if (isOptionGroup(option)) {\n <nz-option-group [nzLabel]=\"option.label\">\n @for (item of option.children; track item.value) {\n <nz-option\n [nzValue]=\"encodeValue(item.value)\"\n [nzLabel]=\"item.label\"\n [nzDisabled]=\"item.disabled\"\n ></nz-option>\n }\n </nz-option-group>\n } @else {\n <nz-option\n [nzValue]=\"encodeValue(option.value)\"\n [nzLabel]=\"option.label\"\n [nzDisabled]=\"option.disabled\"\n ></nz-option>\n }\n }\n </nz-select>\n\n <ads-error-message\n [hasError]=\"!!errorMessage()\"\n [errorMessage]=\"errorMessage()\"\n ></ads-error-message>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i2$1.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i2$1.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzVariant", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzPrefix", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus", "nzOnClear"], exportAs: ["nzSelect"] }, { kind: "component", type: i2$1.NzOptionGroupComponent, selector: "nz-option-group", inputs: ["nzLabel"], exportAs: ["nzOptionGroup"] }, { kind: "component", type: LabelComponent, selector: "ads-label", inputs: ["text", "iconName", "iconSize"], outputs: ["iconClicked"] }, { kind: "component", type: ErrorMessageComponent, selector: "ads-error-message", inputs: ["hasError", "errorMessage"] }] });
2125
2140
  }
2126
2141
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: SingleSelectorComponent, decorators: [{
2127
2142
  type: Component,
2128
- args: [{ selector: 'ads-single-selector', standalone: true, imports: [CommonModule, FormsModule, NzSelectModule, LabelComponent, ErrorMessageComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [
2143
+ args: [{ selector: 'ads-single-selector', standalone: true, imports: [
2144
+ CommonModule,
2145
+ FormsModule,
2146
+ NzSelectModule,
2147
+ LabelComponent,
2148
+ ErrorMessageComponent,
2149
+ ], schemas: [CUSTOM_ELEMENTS_SCHEMA], providers: [
2129
2150
  {
2130
2151
  provide: NG_VALUE_ACCESSOR,
2131
2152
  useExisting: forwardRef(() => SingleSelectorComponent),
2132
2153
  multi: true,
2133
2154
  },
2134
- ], template: "<div class=\"flex w-full flex-col\">\n <ads-label\n [text]=\"label()\"\n [iconName]=\"labelIconName()\"\n (iconClicked)=\"onLabelClicked()\"\n ></ads-label>\n\n <nz-select\n class=\"w-full\"\n [ngModel]=\"currentValue()\"\n [nzPlaceHolder]=\"placeholder()\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"allowClear()\"\n [nzDisabled]=\"isDisabled()\"\n [nzLoading]=\"isLoading()\"\n [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onSelectionChange($event)\"\n (nzBlur)=\"onBlur()\"\n [nzStatus]=\"errorMessage() ? 'error' : ''\"\n >\n @for (option of resolvedOptions(); track $index) {\n @if (isOptionGroup(option)) {\n <nz-option-group [nzLabel]=\"option.label\">\n @for (item of option.children; track item.value) {\n <nz-option\n [nzValue]=\"item.value\"\n [nzLabel]=\"item.label\"\n [nzDisabled]=\"item.disabled\"\n ></nz-option>\n }\n </nz-option-group>\n } @else {\n <nz-option\n [nzValue]=\"option.value\"\n [nzLabel]=\"option.label\"\n [nzDisabled]=\"option.disabled\"\n ></nz-option>\n }\n }\n </nz-select>\n\n <ads-error-message\n [hasError]=\"!!errorMessage()\"\n [errorMessage]=\"errorMessage()\"\n ></ads-error-message>\n</div>\n" }]
2155
+ ], template: "<div class=\"flex w-full flex-col\">\n <ads-label\n [text]=\"label()\"\n [iconName]=\"labelIconName()\"\n (iconClicked)=\"onLabelClicked()\"\n ></ads-label>\n\n <nz-select\n class=\"w-full\"\n [ngModel]=\"encodeValue(currentValue())\"\n [nzPlaceHolder]=\"placeholder()\"\n [nzShowSearch]=\"true\"\n [nzAllowClear]=\"allowClear()\"\n [nzDisabled]=\"isDisabled()\"\n [nzLoading]=\"isLoading()\"\n [nzFilterOption]=\"filterOption\"\n (ngModelChange)=\"onSelectionChange($event)\"\n (nzBlur)=\"onBlur()\"\n [nzStatus]=\"errorMessage() ? 'error' : ''\"\n >\n @for (option of resolvedOptions(); track $index) {\n @if (isOptionGroup(option)) {\n <nz-option-group [nzLabel]=\"option.label\">\n @for (item of option.children; track item.value) {\n <nz-option\n [nzValue]=\"encodeValue(item.value)\"\n [nzLabel]=\"item.label\"\n [nzDisabled]=\"item.disabled\"\n ></nz-option>\n }\n </nz-option-group>\n } @else {\n <nz-option\n [nzValue]=\"encodeValue(option.value)\"\n [nzLabel]=\"option.label\"\n [nzDisabled]=\"option.disabled\"\n ></nz-option>\n }\n }\n </nz-select>\n\n <ads-error-message\n [hasError]=\"!!errorMessage()\"\n [errorMessage]=\"errorMessage()\"\n ></ads-error-message>\n</div>\n" }]
2135
2156
  }], ctorParameters: () => [], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], allowClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowClear", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], asyncOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "asyncOptions", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], errorMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorMessage", required: false }] }], labelIconName: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelIconName", required: false }] }], onLabelButtonClick: [{ type: i0.Output, args: ["onLabelButtonClick"] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
2136
2157
 
2137
2158
  class FilterButtonComponent {