rd-outer-component 0.1.1 → 0.1.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.
- package/esm2020/lib/modules/rd-phone/rd-phone.component.mjs +9 -8
- package/fesm2015/rd-outer-component.mjs +8 -7
- package/fesm2015/rd-outer-component.mjs.map +1 -1
- package/fesm2020/rd-outer-component.mjs +8 -7
- package/fesm2020/rd-outer-component.mjs.map +1 -1
- package/lib/modules/rd-phone/rd-phone.component.d.ts +5 -4
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ import * as i1 from "@angular/forms";
|
|
|
6
6
|
import * as i2 from "../rd-select-value/rd-select-value.component";
|
|
7
7
|
import * as i3 from "../custom-input/custom-input.component";
|
|
8
8
|
export class RdPhoneComponent {
|
|
9
|
-
get
|
|
9
|
+
get filteredAreaCodeOptions() {
|
|
10
10
|
if (!this.excludeAreaCodes?.length)
|
|
11
|
-
return this.
|
|
12
|
-
return this.
|
|
11
|
+
return this.areaCodeOptions || [];
|
|
12
|
+
return (this.areaCodeOptions || []).filter((opt) => !this.excludeAreaCodes.includes(opt.value));
|
|
13
13
|
}
|
|
14
14
|
get hostThemeLight() {
|
|
15
15
|
return this.theme === 'light';
|
|
@@ -24,7 +24,8 @@ export class RdPhoneComponent {
|
|
|
24
24
|
this.required = false;
|
|
25
25
|
/** Area codes to exclude from the dropdown (e.g. ['+86']) */
|
|
26
26
|
this.excludeAreaCodes = [];
|
|
27
|
-
|
|
27
|
+
/** Full area-code list from the host (e.g. commonService.areaDictionary) */
|
|
28
|
+
this.areaCodeOptions = [];
|
|
28
29
|
this.destroy$ = new Subject();
|
|
29
30
|
}
|
|
30
31
|
ngOnInit() {
|
|
@@ -41,10 +42,10 @@ export class RdPhoneComponent {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
RdPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdPhoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
-
RdPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdPhoneComponent, selector: "app-rd-phone", inputs: { form: "form", areaCodeControlName: "areaCodeControlName", phoneControlName: "phoneControlName", label: "label", required: "required", theme: "theme", excludeAreaCodes: "excludeAreaCodes",
|
|
45
|
+
RdPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdPhoneComponent, selector: "app-rd-phone", inputs: { form: "form", areaCodeControlName: "areaCodeControlName", phoneControlName: "phoneControlName", label: "label", required: "required", theme: "theme", excludeAreaCodes: "excludeAreaCodes", areaCodeOptions: "areaCodeOptions" }, host: { properties: { "class.theme-light": "this.hostThemeLight", "class.theme-dark": "this.hostThemeDark" } }, ngImport: i0, template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"filteredAreaCodeOptions\"\n [isShowSearch]=\"true\"\n [theme]=\"theme\"\n ></app-rd-select-value>\n </div>\n <div class=\"rd-phone-number\">\n <app-rd-input\n [formControlName]=\"phoneControlName\"\n [label]=\"label\"\n [required]=\"required\"\n [maskType]=\"'number'\"\n [theme]=\"theme\"\n ></app-rd-input>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}:host .rd-phone-row{display:flex;gap:8px;align-items:flex-start}:host .rd-phone-area-code{width:93px;flex-shrink:0}:host .rd-phone-area-code ::ng-deep .rd-form-item-select .ant-select-selection-search-input{color:inherit;display:block;margin-top:-6px;padding:0 5px}:host .rd-phone-number{flex:1;min-width:0}:host .rd-phone-error{display:flex;align-items:center;gap:4px;margin-top:4px;font-size:12px;line-height:16px;color:var(--rd-copy-danger)}\n"], dependencies: [{ kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2.RdSelectValueComponent, selector: "app-rd-select-value", inputs: ["options", "isShowSearch", "isShowErrorTip", "placeholder", "label", "name", "theme"] }, { kind: "component", type: i3.CustomInputComponent, selector: "app-rd-input", inputs: ["label", "symbol", "name", "disabled", "maskNumber", "maskType", "type", "allowNegativeNumbers", "theme", "required", "placeholder", "min", "max", "minLength", "maxLength", "pattern", "customValidator", "size", "errorMessages"], outputs: ["valueChange", "focus", "blur"] }] });
|
|
45
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdPhoneComponent, decorators: [{
|
|
46
47
|
type: Component,
|
|
47
|
-
args: [{ selector: 'app-rd-phone', template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"
|
|
48
|
+
args: [{ selector: 'app-rd-phone', template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"filteredAreaCodeOptions\"\n [isShowSearch]=\"true\"\n [theme]=\"theme\"\n ></app-rd-select-value>\n </div>\n <div class=\"rd-phone-number\">\n <app-rd-input\n [formControlName]=\"phoneControlName\"\n [label]=\"label\"\n [required]=\"required\"\n [maskType]=\"'number'\"\n [theme]=\"theme\"\n ></app-rd-input>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}:host .rd-phone-row{display:flex;gap:8px;align-items:flex-start}:host .rd-phone-area-code{width:93px;flex-shrink:0}:host .rd-phone-area-code ::ng-deep .rd-form-item-select .ant-select-selection-search-input{color:inherit;display:block;margin-top:-6px;padding:0 5px}:host .rd-phone-number{flex:1;min-width:0}:host .rd-phone-error{display:flex;align-items:center;gap:4px;margin-top:4px;font-size:12px;line-height:16px;color:var(--rd-copy-danger)}\n"] }]
|
|
48
49
|
}], ctorParameters: function () { return []; }, propDecorators: { form: [{
|
|
49
50
|
type: Input
|
|
50
51
|
}], areaCodeControlName: [{
|
|
@@ -59,7 +60,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
59
60
|
type: Input
|
|
60
61
|
}], excludeAreaCodes: [{
|
|
61
62
|
type: Input
|
|
62
|
-
}],
|
|
63
|
+
}], areaCodeOptions: [{
|
|
63
64
|
type: Input
|
|
64
65
|
}], hostThemeLight: [{
|
|
65
66
|
type: HostBinding,
|
|
@@ -68,4 +69,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
68
69
|
type: HostBinding,
|
|
69
70
|
args: ['class.theme-dark']
|
|
70
71
|
}] } });
|
|
71
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmQtcGhvbmUuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2hhcmVkLWxpYi9zcmMvbGliL21vZHVsZXMvcmQtcGhvbmUvcmQtcGhvbmUuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvc2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XCJyZC1waG9uZS1maWVsZFwiIFtmb3JtR3JvdXBdPVwiZm9ybVwiPlxuICA8ZGl2IGNsYXNzPVwicmQtcGhvbmUtcm93XCI+XG4gICAgPGRpdiBjbGFzcz1cInJkLXBob25lLWFyZWEtY29kZVwiPlxuICAgICAgPGFwcC1yZC1zZWxlY3QtdmFsdWVcbiAgICAgICAgW2Zvcm1Db250cm9sTmFtZV09XCJhcmVhQ29kZUNvbnRyb2xOYW1lXCJcbiAgICAgICAgW29wdGlvbnNdPVwiZmlsdGVyZWRBcmVhQ29kZU9wdGlvbnNcIlxuICAgICAgICBbaXNTaG93U2VhcmNoXT1cInRydWVcIlxuICAgICAgICBbdGhlbWVdPVwidGhlbWVcIlxuICAgICAgPjwvYXBwLXJkLXNlbGVjdC12YWx1ZT5cbiAgICA8L2Rpdj5cbiAgICA8ZGl2IGNsYXNzPVwicmQtcGhvbmUtbnVtYmVyXCI+XG4gICAgICA8YXBwLXJkLWlucHV0XG4gICAgICAgIFtmb3JtQ29udHJvbE5hbWVdPVwicGhvbmVDb250cm9sTmFtZVwiXG4gICAgICAgIFtsYWJlbF09XCJsYWJlbFwiXG4gICAgICAgIFtyZXF1aXJlZF09XCJyZXF1aXJlZFwiXG4gICAgICAgIFttYXNrVHlwZV09XCInbnVtYmVyJ1wiXG4gICAgICAgIFt0aGVtZV09XCJ0aGVtZVwiXG4gICAgICA+PC9hcHAtcmQtaW5wdXQ+XG4gICAgPC9kaXY+XG4gIDwvZGl2PlxuPC9kaXY+XG4iXX0=
|
|
@@ -5673,11 +5673,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5673
5673
|
}] } });
|
|
5674
5674
|
|
|
5675
5675
|
class RdPhoneComponent {
|
|
5676
|
-
get
|
|
5676
|
+
get filteredAreaCodeOptions() {
|
|
5677
5677
|
var _a;
|
|
5678
5678
|
if (!((_a = this.excludeAreaCodes) === null || _a === void 0 ? void 0 : _a.length))
|
|
5679
|
-
return this.
|
|
5680
|
-
return this.
|
|
5679
|
+
return this.areaCodeOptions || [];
|
|
5680
|
+
return (this.areaCodeOptions || []).filter((opt) => !this.excludeAreaCodes.includes(opt.value));
|
|
5681
5681
|
}
|
|
5682
5682
|
get hostThemeLight() {
|
|
5683
5683
|
return this.theme === 'light';
|
|
@@ -5692,7 +5692,8 @@ class RdPhoneComponent {
|
|
|
5692
5692
|
this.required = false;
|
|
5693
5693
|
/** Area codes to exclude from the dropdown (e.g. ['+86']) */
|
|
5694
5694
|
this.excludeAreaCodes = [];
|
|
5695
|
-
|
|
5695
|
+
/** Full area-code list from the host (e.g. commonService.areaDictionary) */
|
|
5696
|
+
this.areaCodeOptions = [];
|
|
5696
5697
|
this.destroy$ = new Subject();
|
|
5697
5698
|
}
|
|
5698
5699
|
ngOnInit() {
|
|
@@ -5709,10 +5710,10 @@ class RdPhoneComponent {
|
|
|
5709
5710
|
}
|
|
5710
5711
|
}
|
|
5711
5712
|
RdPhoneComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdPhoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5712
|
-
RdPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdPhoneComponent, selector: "app-rd-phone", inputs: { form: "form", areaCodeControlName: "areaCodeControlName", phoneControlName: "phoneControlName", label: "label", required: "required", theme: "theme", excludeAreaCodes: "excludeAreaCodes",
|
|
5713
|
+
RdPhoneComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: RdPhoneComponent, selector: "app-rd-phone", inputs: { form: "form", areaCodeControlName: "areaCodeControlName", phoneControlName: "phoneControlName", label: "label", required: "required", theme: "theme", excludeAreaCodes: "excludeAreaCodes", areaCodeOptions: "areaCodeOptions" }, host: { properties: { "class.theme-light": "this.hostThemeLight", "class.theme-dark": "this.hostThemeDark" } }, ngImport: i0, template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"filteredAreaCodeOptions\"\n [isShowSearch]=\"true\"\n [theme]=\"theme\"\n ></app-rd-select-value>\n </div>\n <div class=\"rd-phone-number\">\n <app-rd-input\n [formControlName]=\"phoneControlName\"\n [label]=\"label\"\n [required]=\"required\"\n [maskType]=\"'number'\"\n [theme]=\"theme\"\n ></app-rd-input>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}:host .rd-phone-row{display:flex;gap:8px;align-items:flex-start}:host .rd-phone-area-code{width:93px;flex-shrink:0}:host .rd-phone-area-code ::ng-deep .rd-form-item-select .ant-select-selection-search-input{color:inherit;display:block;margin-top:-6px;padding:0 5px}:host .rd-phone-number{flex:1;min-width:0}:host .rd-phone-error{display:flex;align-items:center;gap:4px;margin-top:4px;font-size:12px;line-height:16px;color:var(--rd-copy-danger)}\n"], dependencies: [{ kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: RdSelectValueComponent, selector: "app-rd-select-value", inputs: ["options", "isShowSearch", "isShowErrorTip", "placeholder", "label", "name", "theme"] }, { kind: "component", type: CustomInputComponent, selector: "app-rd-input", inputs: ["label", "symbol", "name", "disabled", "maskNumber", "maskType", "type", "allowNegativeNumbers", "theme", "required", "placeholder", "min", "max", "minLength", "maxLength", "pattern", "customValidator", "size", "errorMessages"], outputs: ["valueChange", "focus", "blur"] }] });
|
|
5713
5714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: RdPhoneComponent, decorators: [{
|
|
5714
5715
|
type: Component,
|
|
5715
|
-
args: [{ selector: 'app-rd-phone', template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"
|
|
5716
|
+
args: [{ selector: 'app-rd-phone', template: "<div class=\"rd-phone-field\" [formGroup]=\"form\">\n <div class=\"rd-phone-row\">\n <div class=\"rd-phone-area-code\">\n <app-rd-select-value\n [formControlName]=\"areaCodeControlName\"\n [options]=\"filteredAreaCodeOptions\"\n [isShowSearch]=\"true\"\n [theme]=\"theme\"\n ></app-rd-select-value>\n </div>\n <div class=\"rd-phone-number\">\n <app-rd-input\n [formControlName]=\"phoneControlName\"\n [label]=\"label\"\n [required]=\"required\"\n [maskType]=\"'number'\"\n [theme]=\"theme\"\n ></app-rd-input>\n </div>\n </div>\n</div>\n", styles: [":host{display:block}:host .rd-phone-row{display:flex;gap:8px;align-items:flex-start}:host .rd-phone-area-code{width:93px;flex-shrink:0}:host .rd-phone-area-code ::ng-deep .rd-form-item-select .ant-select-selection-search-input{color:inherit;display:block;margin-top:-6px;padding:0 5px}:host .rd-phone-number{flex:1;min-width:0}:host .rd-phone-error{display:flex;align-items:center;gap:4px;margin-top:4px;font-size:12px;line-height:16px;color:var(--rd-copy-danger)}\n"] }]
|
|
5716
5717
|
}], ctorParameters: function () { return []; }, propDecorators: { form: [{
|
|
5717
5718
|
type: Input
|
|
5718
5719
|
}], areaCodeControlName: [{
|
|
@@ -5727,7 +5728,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
5727
5728
|
type: Input
|
|
5728
5729
|
}], excludeAreaCodes: [{
|
|
5729
5730
|
type: Input
|
|
5730
|
-
}],
|
|
5731
|
+
}], areaCodeOptions: [{
|
|
5731
5732
|
type: Input
|
|
5732
5733
|
}], hostThemeLight: [{
|
|
5733
5734
|
type: HostBinding,
|