@mj-biz-apps/common-ng 5.46.1 → 5.46.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/dist/lib/components/address-editor/__tests__/address-format.test.d.ts +2 -0
- package/dist/lib/components/address-editor/__tests__/address-format.test.d.ts.map +1 -0
- package/dist/lib/components/address-editor/__tests__/address-format.test.js +34 -0
- package/dist/lib/components/address-editor/__tests__/address-format.test.js.map +1 -0
- package/dist/lib/components/address-editor/__tests__/address-references.test.d.ts +2 -0
- package/dist/lib/components/address-editor/__tests__/address-references.test.d.ts.map +1 -0
- package/dist/lib/components/address-editor/__tests__/address-references.test.js +41 -0
- package/dist/lib/components/address-editor/__tests__/address-references.test.js.map +1 -0
- package/dist/lib/components/address-editor/address-editor.component.d.ts +30 -5
- package/dist/lib/components/address-editor/address-editor.component.d.ts.map +1 -1
- package/dist/lib/components/address-editor/address-editor.component.js +263 -180
- package/dist/lib/components/address-editor/address-editor.component.js.map +1 -1
- package/dist/lib/components/address-editor/address-references.d.ts +29 -0
- package/dist/lib/components/address-editor/address-references.d.ts.map +1 -0
- package/dist/lib/components/address-editor/address-references.js +27 -0
- package/dist/lib/components/address-editor/address-references.js.map +1 -0
- package/package.json +2 -2
|
@@ -4,6 +4,7 @@ import { FormsModule } from '@angular/forms';
|
|
|
4
4
|
import { Metadata, RunView } from '@memberjunction/core';
|
|
5
5
|
import { GraphQLActionClient } from '@memberjunction/graphql-dataprovider';
|
|
6
6
|
import { ActionEngineBase } from '@memberjunction/actions-base';
|
|
7
|
+
import { otherAddressReferences } from './address-references';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
import * as i1 from "@angular/forms";
|
|
9
10
|
const _forTrack0 = ($index, $item) => $item.Link.ID;
|
|
@@ -26,52 +27,87 @@ function AddressEditorComponent_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
|
26
27
|
} if (rf & 2) {
|
|
27
28
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
28
29
|
i0.ɵɵadvance(3);
|
|
29
|
-
i0.ɵɵtextInterpolate1(" ", ctx_r0.
|
|
30
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.ActionError, " ");
|
|
30
31
|
} }
|
|
31
32
|
function AddressEditorComponent_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
32
33
|
i0.ɵɵelementStart(0, "div", 4)(1, "div", 7);
|
|
33
|
-
i0.ɵɵelement(2, "i",
|
|
34
|
+
i0.ɵɵelement(2, "i", 6);
|
|
35
|
+
i0.ɵɵtext(3);
|
|
36
|
+
i0.ɵɵelementEnd()();
|
|
37
|
+
} if (rf & 2) {
|
|
38
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
39
|
+
i0.ɵɵadvance(3);
|
|
40
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.LoadError, " ");
|
|
41
|
+
} }
|
|
42
|
+
function AddressEditorComponent_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
43
|
+
i0.ɵɵelementStart(0, "div", 4)(1, "div", 8);
|
|
44
|
+
i0.ɵɵelement(2, "i", 9);
|
|
34
45
|
i0.ɵɵtext(3, " Loading addresses... ");
|
|
35
46
|
i0.ɵɵelementEnd()();
|
|
36
47
|
} }
|
|
37
|
-
function
|
|
38
|
-
i0.ɵɵelementStart(0, "div",
|
|
48
|
+
function AddressEditorComponent_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
49
|
+
i0.ɵɵelementStart(0, "div", 10);
|
|
39
50
|
i0.ɵɵelement(1, "i", 2);
|
|
40
51
|
i0.ɵɵtext(2, " No addresses linked yet ");
|
|
41
52
|
i0.ɵɵelementEnd();
|
|
42
53
|
} }
|
|
43
|
-
function
|
|
54
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
55
|
+
i0.ɵɵelementStart(0, "div", 16);
|
|
56
|
+
i0.ɵɵtext(1);
|
|
57
|
+
i0.ɵɵelementEnd();
|
|
58
|
+
i0.ɵɵelementStart(2, "div", 21);
|
|
59
|
+
i0.ɵɵtext(3);
|
|
60
|
+
i0.ɵɵelementEnd();
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
const item_r2 = i0.ɵɵnextContext().$implicit;
|
|
63
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
64
|
+
i0.ɵɵadvance();
|
|
65
|
+
i0.ɵɵtextInterpolate(ctx);
|
|
66
|
+
i0.ɵɵadvance(2);
|
|
67
|
+
i0.ɵɵtextInterpolate(ctx_r0.formatAddressLine2(item_r2.Address));
|
|
68
|
+
} }
|
|
69
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
70
|
+
i0.ɵɵelementStart(0, "div", 16);
|
|
71
|
+
i0.ɵɵtext(1);
|
|
72
|
+
i0.ɵɵelementEnd();
|
|
73
|
+
} if (rf & 2) {
|
|
74
|
+
const item_r2 = i0.ɵɵnextContext().$implicit;
|
|
75
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
76
|
+
i0.ɵɵadvance();
|
|
77
|
+
i0.ɵɵtextInterpolate(ctx_r0.formatAddressLine2(item_r2.Address));
|
|
78
|
+
} }
|
|
79
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
44
80
|
i0.ɵɵelementStart(0, "span", 19);
|
|
45
|
-
i0.ɵɵelement(1, "i",
|
|
81
|
+
i0.ɵɵelement(1, "i", 22);
|
|
46
82
|
i0.ɵɵtext(2, " Primary");
|
|
47
83
|
i0.ɵɵelementEnd();
|
|
48
84
|
} }
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
i0.ɵɵelementStart(0, "button",
|
|
52
|
-
i0.ɵɵlistener("click", function
|
|
53
|
-
i0.ɵɵelement(1, "i",
|
|
85
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_10_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
86
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
87
|
+
i0.ɵɵelementStart(0, "button", 28);
|
|
88
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_For_3_Conditional_10_Conditional_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ɵ$index_45_r5 = i0.ɵɵnextContext(2).$index; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onSetPrimary(ɵ$index_45_r5)); });
|
|
89
|
+
i0.ɵɵelement(1, "i", 29);
|
|
54
90
|
i0.ɵɵelementEnd();
|
|
55
91
|
} }
|
|
56
|
-
function
|
|
57
|
-
const
|
|
92
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
93
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
58
94
|
i0.ɵɵelementStart(0, "div", 20);
|
|
59
|
-
i0.ɵɵconditionalCreate(1,
|
|
60
|
-
i0.ɵɵelementStart(2, "button",
|
|
61
|
-
i0.ɵɵlistener("click", function
|
|
62
|
-
i0.ɵɵelement(3, "i",
|
|
95
|
+
i0.ɵɵconditionalCreate(1, AddressEditorComponent_Conditional_8_For_3_Conditional_10_Conditional_1_Template, 2, 0, "button", 23);
|
|
96
|
+
i0.ɵɵelementStart(2, "button", 24);
|
|
97
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_For_3_Conditional_10_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r3); const ɵ$index_45_r5 = i0.ɵɵnextContext().$index; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onEdit(ɵ$index_45_r5)); });
|
|
98
|
+
i0.ɵɵelement(3, "i", 25);
|
|
63
99
|
i0.ɵɵelementEnd();
|
|
64
|
-
i0.ɵɵelementStart(4, "button",
|
|
65
|
-
i0.ɵɵlistener("click", function
|
|
66
|
-
i0.ɵɵelement(5, "i",
|
|
100
|
+
i0.ɵɵelementStart(4, "button", 26);
|
|
101
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_For_3_Conditional_10_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r3); const ɵ$index_45_r5 = i0.ɵɵnextContext().$index; const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onDelete(ɵ$index_45_r5)); });
|
|
102
|
+
i0.ɵɵelement(5, "i", 27);
|
|
67
103
|
i0.ɵɵelementEnd()();
|
|
68
104
|
} if (rf & 2) {
|
|
69
|
-
const
|
|
105
|
+
const item_r2 = i0.ɵɵnextContext().$implicit;
|
|
70
106
|
i0.ɵɵadvance();
|
|
71
|
-
i0.ɵɵconditional(!
|
|
107
|
+
i0.ɵɵconditional(!item_r2.Link.IsPrimary ? 1 : -1);
|
|
72
108
|
} }
|
|
73
|
-
function
|
|
74
|
-
i0.ɵɵelementStart(0, "option",
|
|
109
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
110
|
+
i0.ɵɵelementStart(0, "option", 33);
|
|
75
111
|
i0.ɵɵtext(1);
|
|
76
112
|
i0.ɵɵelementEnd();
|
|
77
113
|
} if (rf & 2) {
|
|
@@ -80,16 +116,16 @@ function AddressEditorComponent_Conditional_7_For_3_Conditional_13_For_7_Templat
|
|
|
80
116
|
i0.ɵɵadvance();
|
|
81
117
|
i0.ɵɵtextInterpolate(t_r7.Name);
|
|
82
118
|
} }
|
|
83
|
-
function
|
|
84
|
-
i0.ɵɵelement(0, "i",
|
|
119
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_20_Template(rf, ctx) { if (rf & 1) {
|
|
120
|
+
i0.ɵɵelement(0, "i", 38);
|
|
85
121
|
} }
|
|
86
|
-
function
|
|
87
|
-
i0.ɵɵelementStart(0, "span",
|
|
122
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
123
|
+
i0.ɵɵelementStart(0, "span", 39);
|
|
88
124
|
i0.ɵɵtext(1, "not found");
|
|
89
125
|
i0.ɵɵelementEnd();
|
|
90
126
|
} }
|
|
91
|
-
function
|
|
92
|
-
i0.ɵɵelementStart(0, "option",
|
|
127
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_For_36_Template(rf, ctx) { if (rf & 1) {
|
|
128
|
+
i0.ɵɵelementStart(0, "option", 33);
|
|
93
129
|
i0.ɵɵtext(1);
|
|
94
130
|
i0.ɵɵelementEnd();
|
|
95
131
|
} if (rf & 2) {
|
|
@@ -98,75 +134,75 @@ function AddressEditorComponent_Conditional_7_For_3_Conditional_13_For_36_Templa
|
|
|
98
134
|
i0.ɵɵadvance();
|
|
99
135
|
i0.ɵɵtextInterpolate2("", c_r8.Code, " - ", c_r8.Name);
|
|
100
136
|
} }
|
|
101
|
-
function
|
|
102
|
-
i0.ɵɵelement(0, "i",
|
|
137
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_43_Template(rf, ctx) { if (rf & 1) {
|
|
138
|
+
i0.ɵɵelement(0, "i", 51);
|
|
103
139
|
} }
|
|
104
|
-
function
|
|
140
|
+
function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
105
141
|
const _r6 = i0.ɵɵgetCurrentView();
|
|
106
|
-
i0.ɵɵelementStart(0, "div",
|
|
142
|
+
i0.ɵɵelementStart(0, "div", 11)(1, "div", 30)(2, "div", 31)(3, "label");
|
|
107
143
|
i0.ɵɵtext(4, "Type");
|
|
108
144
|
i0.ɵɵelementEnd();
|
|
109
|
-
i0.ɵɵelementStart(5, "select",
|
|
110
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
111
|
-
i0.ɵɵrepeaterCreate(6,
|
|
145
|
+
i0.ɵɵelementStart(5, "select", 32);
|
|
146
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_select_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.TypeID, $event) || (ctx_r0.EditForm.TypeID = $event); return i0.ɵɵresetView($event); });
|
|
147
|
+
i0.ɵɵrepeaterCreate(6, AddressEditorComponent_Conditional_8_For_3_Conditional_11_For_7_Template, 2, 2, "option", 33, _forTrack1);
|
|
112
148
|
i0.ɵɵelementEnd()();
|
|
113
|
-
i0.ɵɵelementStart(8, "div",
|
|
149
|
+
i0.ɵɵelementStart(8, "div", 34)(9, "label");
|
|
114
150
|
i0.ɵɵtext(10, "Line 1");
|
|
115
151
|
i0.ɵɵelementEnd();
|
|
116
|
-
i0.ɵɵelementStart(11, "input",
|
|
117
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
152
|
+
i0.ɵɵelementStart(11, "input", 35);
|
|
153
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_11_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Line1, $event) || (ctx_r0.EditForm.Line1 = $event); return i0.ɵɵresetView($event); });
|
|
118
154
|
i0.ɵɵelementEnd()();
|
|
119
|
-
i0.ɵɵelementStart(12, "div",
|
|
155
|
+
i0.ɵɵelementStart(12, "div", 36)(13, "label");
|
|
120
156
|
i0.ɵɵtext(14, "Line 2");
|
|
121
157
|
i0.ɵɵelementEnd();
|
|
122
|
-
i0.ɵɵelementStart(15, "input",
|
|
123
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
158
|
+
i0.ɵɵelementStart(15, "input", 37);
|
|
159
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_15_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Line2, $event) || (ctx_r0.EditForm.Line2 = $event); return i0.ɵɵresetView($event); });
|
|
124
160
|
i0.ɵɵelementEnd()()();
|
|
125
|
-
i0.ɵɵelementStart(16, "div",
|
|
161
|
+
i0.ɵɵelementStart(16, "div", 30)(17, "div", 34)(18, "label");
|
|
126
162
|
i0.ɵɵtext(19, " City ");
|
|
127
|
-
i0.ɵɵconditionalCreate(20,
|
|
128
|
-
i0.ɵɵconditionalCreate(21,
|
|
163
|
+
i0.ɵɵconditionalCreate(20, AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_20_Template, 1, 0, "i", 38);
|
|
164
|
+
i0.ɵɵconditionalCreate(21, AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_21_Template, 2, 0, "span", 39);
|
|
129
165
|
i0.ɵɵelementEnd();
|
|
130
|
-
i0.ɵɵelementStart(22, "input",
|
|
131
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
166
|
+
i0.ɵɵelementStart(22, "input", 40);
|
|
167
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_22_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.City, $event) || (ctx_r0.EditForm.City = $event); return i0.ɵɵresetView($event); });
|
|
132
168
|
i0.ɵɵelementEnd()();
|
|
133
|
-
i0.ɵɵelementStart(23, "div",
|
|
169
|
+
i0.ɵɵelementStart(23, "div", 41)(24, "label");
|
|
134
170
|
i0.ɵɵtext(25, "State");
|
|
135
171
|
i0.ɵɵelementEnd();
|
|
136
|
-
i0.ɵɵelementStart(26, "input",
|
|
137
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
172
|
+
i0.ɵɵelementStart(26, "input", 42);
|
|
173
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_26_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.StateProvince, $event) || (ctx_r0.EditForm.StateProvince = $event); return i0.ɵɵresetView($event); });
|
|
138
174
|
i0.ɵɵelementEnd()();
|
|
139
|
-
i0.ɵɵelementStart(27, "div",
|
|
175
|
+
i0.ɵɵelementStart(27, "div", 43)(28, "label");
|
|
140
176
|
i0.ɵɵtext(29, "Postal");
|
|
141
177
|
i0.ɵɵelementEnd();
|
|
142
|
-
i0.ɵɵelementStart(30, "input",
|
|
143
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
144
|
-
i0.ɵɵlistener("blur", function
|
|
178
|
+
i0.ɵɵelementStart(30, "input", 44);
|
|
179
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_30_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.PostalCode, $event) || (ctx_r0.EditForm.PostalCode = $event); return i0.ɵɵresetView($event); });
|
|
180
|
+
i0.ɵɵlistener("blur", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_blur_30_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onPostalCodeBlur()); });
|
|
145
181
|
i0.ɵɵelementEnd()();
|
|
146
|
-
i0.ɵɵelementStart(31, "div",
|
|
182
|
+
i0.ɵɵelementStart(31, "div", 45)(32, "label");
|
|
147
183
|
i0.ɵɵtext(33, "Country");
|
|
148
184
|
i0.ɵɵelementEnd();
|
|
149
|
-
i0.ɵɵelementStart(34, "select",
|
|
150
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
151
|
-
i0.ɵɵrepeaterCreate(35,
|
|
185
|
+
i0.ɵɵelementStart(34, "select", 32);
|
|
186
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_select_ngModelChange_34_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Country, $event) || (ctx_r0.EditForm.Country = $event); return i0.ɵɵresetView($event); });
|
|
187
|
+
i0.ɵɵrepeaterCreate(35, AddressEditorComponent_Conditional_8_For_3_Conditional_11_For_36_Template, 2, 3, "option", 33, _forTrack2);
|
|
152
188
|
i0.ɵɵelementEnd()();
|
|
153
|
-
i0.ɵɵelementStart(37, "div",
|
|
154
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
189
|
+
i0.ɵɵelementStart(37, "div", 46)(38, "input", 47);
|
|
190
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_input_ngModelChange_38_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.IsPrimary, $event) || (ctx_r0.EditForm.IsPrimary = $event); return i0.ɵɵresetView($event); });
|
|
155
191
|
i0.ɵɵelementEnd();
|
|
156
|
-
i0.ɵɵelementStart(39, "label",
|
|
192
|
+
i0.ɵɵelementStart(39, "label", 48);
|
|
157
193
|
i0.ɵɵtext(40, "Primary");
|
|
158
194
|
i0.ɵɵelementEnd()()();
|
|
159
|
-
i0.ɵɵelementStart(41, "div",
|
|
160
|
-
i0.ɵɵlistener("click", function
|
|
161
|
-
i0.ɵɵconditionalCreate(43,
|
|
195
|
+
i0.ɵɵelementStart(41, "div", 49)(42, "button", 50);
|
|
196
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_button_click_42_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onSave()); });
|
|
197
|
+
i0.ɵɵconditionalCreate(43, AddressEditorComponent_Conditional_8_For_3_Conditional_11_Conditional_43_Template, 1, 0, "i", 51);
|
|
162
198
|
i0.ɵɵtext(44, " Save ");
|
|
163
199
|
i0.ɵɵelementEnd();
|
|
164
|
-
i0.ɵɵelementStart(45, "button",
|
|
165
|
-
i0.ɵɵlistener("click", function
|
|
200
|
+
i0.ɵɵelementStart(45, "button", 52);
|
|
201
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template_button_click_45_listener() { i0.ɵɵrestoreView(_r6); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onCancelEdit()); });
|
|
166
202
|
i0.ɵɵtext(46, "Cancel");
|
|
167
203
|
i0.ɵɵelementEnd()()();
|
|
168
204
|
} if (rf & 2) {
|
|
169
|
-
const ɵ$
|
|
205
|
+
const ɵ$index_45_r5 = i0.ɵɵnextContext().$index;
|
|
170
206
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
171
207
|
i0.ɵɵadvance(5);
|
|
172
208
|
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.EditForm.TypeID);
|
|
@@ -191,55 +227,51 @@ function AddressEditorComponent_Conditional_7_For_3_Conditional_13_Template(rf,
|
|
|
191
227
|
i0.ɵɵadvance();
|
|
192
228
|
i0.ɵɵrepeater(ctx_r0.Countries);
|
|
193
229
|
i0.ɵɵadvance(3);
|
|
194
|
-
i0.ɵɵproperty("id", "primary-edit-" + ɵ$
|
|
230
|
+
i0.ɵɵproperty("id", "primary-edit-" + ɵ$index_45_r5);
|
|
195
231
|
i0.ɵɵtwoWayProperty("ngModel", ctx_r0.EditForm.IsPrimary);
|
|
196
232
|
i0.ɵɵadvance();
|
|
197
|
-
i0.ɵɵproperty("for", "primary-edit-" + ɵ$
|
|
233
|
+
i0.ɵɵproperty("for", "primary-edit-" + ɵ$index_45_r5);
|
|
198
234
|
i0.ɵɵadvance(3);
|
|
199
235
|
i0.ɵɵproperty("disabled", ctx_r0.Saving);
|
|
200
236
|
i0.ɵɵadvance();
|
|
201
237
|
i0.ɵɵconditional(ctx_r0.Saving ? 43 : -1);
|
|
202
238
|
} }
|
|
203
|
-
function
|
|
204
|
-
i0.ɵɵelementStart(0, "div",
|
|
239
|
+
function AddressEditorComponent_Conditional_8_For_3_Template(rf, ctx) { if (rf & 1) {
|
|
240
|
+
i0.ɵɵelementStart(0, "div", 13)(1, "div", 14);
|
|
205
241
|
i0.ɵɵelement(2, "i");
|
|
206
242
|
i0.ɵɵelementEnd();
|
|
207
|
-
i0.ɵɵelementStart(3, "div",
|
|
208
|
-
i0.ɵɵ
|
|
243
|
+
i0.ɵɵelementStart(3, "div", 15);
|
|
244
|
+
i0.ɵɵconditionalCreate(4, AddressEditorComponent_Conditional_8_For_3_Conditional_4_Template, 4, 2)(5, AddressEditorComponent_Conditional_8_For_3_Conditional_5_Template, 2, 1, "div", 16);
|
|
209
245
|
i0.ɵɵelementEnd();
|
|
210
|
-
i0.ɵɵelementStart(6, "div",
|
|
211
|
-
i0.ɵɵtext(
|
|
212
|
-
i0.ɵɵelementEnd()();
|
|
213
|
-
i0.ɵɵelementStart(8, "div", 17)(9, "span", 18);
|
|
214
|
-
i0.ɵɵtext(10);
|
|
246
|
+
i0.ɵɵelementStart(6, "div", 17)(7, "span", 18);
|
|
247
|
+
i0.ɵɵtext(8);
|
|
215
248
|
i0.ɵɵelementEnd();
|
|
216
|
-
i0.ɵɵconditionalCreate(
|
|
249
|
+
i0.ɵɵconditionalCreate(9, AddressEditorComponent_Conditional_8_For_3_Conditional_9_Template, 3, 0, "span", 19);
|
|
217
250
|
i0.ɵɵelementEnd();
|
|
218
|
-
i0.ɵɵconditionalCreate(
|
|
251
|
+
i0.ɵɵconditionalCreate(10, AddressEditorComponent_Conditional_8_For_3_Conditional_10_Template, 6, 1, "div", 20);
|
|
219
252
|
i0.ɵɵelementEnd();
|
|
220
|
-
i0.ɵɵconditionalCreate(
|
|
253
|
+
i0.ɵɵconditionalCreate(11, AddressEditorComponent_Conditional_8_For_3_Conditional_11_Template, 47, 14, "div", 11);
|
|
221
254
|
} if (rf & 2) {
|
|
222
|
-
|
|
223
|
-
const
|
|
255
|
+
let tmp_14_0;
|
|
256
|
+
const item_r2 = ctx.$implicit;
|
|
257
|
+
const ɵ$index_45_r5 = ctx.$index;
|
|
224
258
|
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
225
|
-
i0.ɵɵclassProp("primary",
|
|
259
|
+
i0.ɵɵclassProp("primary", item_r2.Link.IsPrimary);
|
|
226
260
|
i0.ɵɵadvance(2);
|
|
227
|
-
i0.ɵɵclassMap(ctx_r0.getAddressTypeIcon(
|
|
228
|
-
i0.ɵɵadvance(3);
|
|
229
|
-
i0.ɵɵtextInterpolate(ctx_r0.formatAddressLine1(item_r5.Address));
|
|
261
|
+
i0.ɵɵclassMap(ctx_r0.getAddressTypeIcon(item_r2.Link.AddressTypeID));
|
|
230
262
|
i0.ɵɵadvance(2);
|
|
231
|
-
i0.ɵɵ
|
|
232
|
-
i0.ɵɵadvance(
|
|
233
|
-
i0.ɵɵtextInterpolate(
|
|
263
|
+
i0.ɵɵconditional((tmp_14_0 = ctx_r0.formatAddressLine1(item_r2.Address)) ? 4 : 5, tmp_14_0);
|
|
264
|
+
i0.ɵɵadvance(4);
|
|
265
|
+
i0.ɵɵtextInterpolate(item_r2.Link.AddressType);
|
|
234
266
|
i0.ɵɵadvance();
|
|
235
|
-
i0.ɵɵconditional(
|
|
267
|
+
i0.ɵɵconditional(item_r2.Link.IsPrimary ? 9 : -1);
|
|
236
268
|
i0.ɵɵadvance();
|
|
237
|
-
i0.ɵɵconditional(ctx_r0.EditMode ?
|
|
269
|
+
i0.ɵɵconditional(ctx_r0.EditMode ? 10 : -1);
|
|
238
270
|
i0.ɵɵadvance();
|
|
239
|
-
i0.ɵɵconditional(ctx_r0.EditingIndex === ɵ$
|
|
271
|
+
i0.ɵɵconditional(ctx_r0.EditingIndex === ɵ$index_45_r5 ? 11 : -1);
|
|
240
272
|
} }
|
|
241
|
-
function
|
|
242
|
-
i0.ɵɵelementStart(0, "option",
|
|
273
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
274
|
+
i0.ɵɵelementStart(0, "option", 33);
|
|
243
275
|
i0.ɵɵtext(1);
|
|
244
276
|
i0.ɵɵelementEnd();
|
|
245
277
|
} if (rf & 2) {
|
|
@@ -248,16 +280,16 @@ function AddressEditorComponent_Conditional_7_Conditional_4_For_7_Template(rf, c
|
|
|
248
280
|
i0.ɵɵadvance();
|
|
249
281
|
i0.ɵɵtextInterpolate(t_r10.Name);
|
|
250
282
|
} }
|
|
251
|
-
function
|
|
252
|
-
i0.ɵɵelement(0, "i",
|
|
283
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_Conditional_20_Template(rf, ctx) { if (rf & 1) {
|
|
284
|
+
i0.ɵɵelement(0, "i", 38);
|
|
253
285
|
} }
|
|
254
|
-
function
|
|
255
|
-
i0.ɵɵelementStart(0, "span",
|
|
286
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
287
|
+
i0.ɵɵelementStart(0, "span", 39);
|
|
256
288
|
i0.ɵɵtext(1, "not found");
|
|
257
289
|
i0.ɵɵelementEnd();
|
|
258
290
|
} }
|
|
259
|
-
function
|
|
260
|
-
i0.ɵɵelementStart(0, "option",
|
|
291
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_For_36_Template(rf, ctx) { if (rf & 1) {
|
|
292
|
+
i0.ɵɵelementStart(0, "option", 33);
|
|
261
293
|
i0.ɵɵtext(1);
|
|
262
294
|
i0.ɵɵelementEnd();
|
|
263
295
|
} if (rf & 2) {
|
|
@@ -266,71 +298,71 @@ function AddressEditorComponent_Conditional_7_Conditional_4_For_36_Template(rf,
|
|
|
266
298
|
i0.ɵɵadvance();
|
|
267
299
|
i0.ɵɵtextInterpolate2("", c_r11.Code, " - ", c_r11.Name);
|
|
268
300
|
} }
|
|
269
|
-
function
|
|
270
|
-
i0.ɵɵelement(0, "i",
|
|
301
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_Conditional_43_Template(rf, ctx) { if (rf & 1) {
|
|
302
|
+
i0.ɵɵelement(0, "i", 51);
|
|
271
303
|
} }
|
|
272
|
-
function
|
|
304
|
+
function AddressEditorComponent_Conditional_8_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
273
305
|
const _r9 = i0.ɵɵgetCurrentView();
|
|
274
|
-
i0.ɵɵelementStart(0, "div",
|
|
306
|
+
i0.ɵɵelementStart(0, "div", 11)(1, "div", 30)(2, "div", 31)(3, "label");
|
|
275
307
|
i0.ɵɵtext(4, "Type");
|
|
276
308
|
i0.ɵɵelementEnd();
|
|
277
|
-
i0.ɵɵelementStart(5, "select",
|
|
278
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
279
|
-
i0.ɵɵrepeaterCreate(6,
|
|
309
|
+
i0.ɵɵelementStart(5, "select", 32);
|
|
310
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_select_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.TypeID, $event) || (ctx_r0.EditForm.TypeID = $event); return i0.ɵɵresetView($event); });
|
|
311
|
+
i0.ɵɵrepeaterCreate(6, AddressEditorComponent_Conditional_8_Conditional_4_For_7_Template, 2, 2, "option", 33, _forTrack1);
|
|
280
312
|
i0.ɵɵelementEnd()();
|
|
281
|
-
i0.ɵɵelementStart(8, "div",
|
|
313
|
+
i0.ɵɵelementStart(8, "div", 34)(9, "label");
|
|
282
314
|
i0.ɵɵtext(10, "Line 1");
|
|
283
315
|
i0.ɵɵelementEnd();
|
|
284
|
-
i0.ɵɵelementStart(11, "input",
|
|
285
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
316
|
+
i0.ɵɵelementStart(11, "input", 35);
|
|
317
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_11_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Line1, $event) || (ctx_r0.EditForm.Line1 = $event); return i0.ɵɵresetView($event); });
|
|
286
318
|
i0.ɵɵelementEnd()();
|
|
287
|
-
i0.ɵɵelementStart(12, "div",
|
|
319
|
+
i0.ɵɵelementStart(12, "div", 36)(13, "label");
|
|
288
320
|
i0.ɵɵtext(14, "Line 2");
|
|
289
321
|
i0.ɵɵelementEnd();
|
|
290
|
-
i0.ɵɵelementStart(15, "input",
|
|
291
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
322
|
+
i0.ɵɵelementStart(15, "input", 37);
|
|
323
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_15_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Line2, $event) || (ctx_r0.EditForm.Line2 = $event); return i0.ɵɵresetView($event); });
|
|
292
324
|
i0.ɵɵelementEnd()()();
|
|
293
|
-
i0.ɵɵelementStart(16, "div",
|
|
325
|
+
i0.ɵɵelementStart(16, "div", 30)(17, "div", 34)(18, "label");
|
|
294
326
|
i0.ɵɵtext(19, " City ");
|
|
295
|
-
i0.ɵɵconditionalCreate(20,
|
|
296
|
-
i0.ɵɵconditionalCreate(21,
|
|
327
|
+
i0.ɵɵconditionalCreate(20, AddressEditorComponent_Conditional_8_Conditional_4_Conditional_20_Template, 1, 0, "i", 38);
|
|
328
|
+
i0.ɵɵconditionalCreate(21, AddressEditorComponent_Conditional_8_Conditional_4_Conditional_21_Template, 2, 0, "span", 39);
|
|
297
329
|
i0.ɵɵelementEnd();
|
|
298
|
-
i0.ɵɵelementStart(22, "input",
|
|
299
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
330
|
+
i0.ɵɵelementStart(22, "input", 40);
|
|
331
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_22_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.City, $event) || (ctx_r0.EditForm.City = $event); return i0.ɵɵresetView($event); });
|
|
300
332
|
i0.ɵɵelementEnd()();
|
|
301
|
-
i0.ɵɵelementStart(23, "div",
|
|
333
|
+
i0.ɵɵelementStart(23, "div", 41)(24, "label");
|
|
302
334
|
i0.ɵɵtext(25, "State");
|
|
303
335
|
i0.ɵɵelementEnd();
|
|
304
|
-
i0.ɵɵelementStart(26, "input",
|
|
305
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
336
|
+
i0.ɵɵelementStart(26, "input", 42);
|
|
337
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_26_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.StateProvince, $event) || (ctx_r0.EditForm.StateProvince = $event); return i0.ɵɵresetView($event); });
|
|
306
338
|
i0.ɵɵelementEnd()();
|
|
307
|
-
i0.ɵɵelementStart(27, "div",
|
|
339
|
+
i0.ɵɵelementStart(27, "div", 43)(28, "label");
|
|
308
340
|
i0.ɵɵtext(29, "Postal");
|
|
309
341
|
i0.ɵɵelementEnd();
|
|
310
|
-
i0.ɵɵelementStart(30, "input",
|
|
311
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
312
|
-
i0.ɵɵlistener("blur", function
|
|
342
|
+
i0.ɵɵelementStart(30, "input", 44);
|
|
343
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_30_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.PostalCode, $event) || (ctx_r0.EditForm.PostalCode = $event); return i0.ɵɵresetView($event); });
|
|
344
|
+
i0.ɵɵlistener("blur", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_blur_30_listener() { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onPostalCodeBlur()); });
|
|
313
345
|
i0.ɵɵelementEnd()();
|
|
314
|
-
i0.ɵɵelementStart(31, "div",
|
|
346
|
+
i0.ɵɵelementStart(31, "div", 45)(32, "label");
|
|
315
347
|
i0.ɵɵtext(33, "Country");
|
|
316
348
|
i0.ɵɵelementEnd();
|
|
317
|
-
i0.ɵɵelementStart(34, "select",
|
|
318
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
319
|
-
i0.ɵɵrepeaterCreate(35,
|
|
349
|
+
i0.ɵɵelementStart(34, "select", 32);
|
|
350
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_select_ngModelChange_34_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.Country, $event) || (ctx_r0.EditForm.Country = $event); return i0.ɵɵresetView($event); });
|
|
351
|
+
i0.ɵɵrepeaterCreate(35, AddressEditorComponent_Conditional_8_Conditional_4_For_36_Template, 2, 3, "option", 33, _forTrack2);
|
|
320
352
|
i0.ɵɵelementEnd()();
|
|
321
|
-
i0.ɵɵelementStart(37, "div",
|
|
322
|
-
i0.ɵɵtwoWayListener("ngModelChange", function
|
|
353
|
+
i0.ɵɵelementStart(37, "div", 46)(38, "input", 53);
|
|
354
|
+
i0.ɵɵtwoWayListener("ngModelChange", function AddressEditorComponent_Conditional_8_Conditional_4_Template_input_ngModelChange_38_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r0.EditForm.IsPrimary, $event) || (ctx_r0.EditForm.IsPrimary = $event); return i0.ɵɵresetView($event); });
|
|
323
355
|
i0.ɵɵelementEnd();
|
|
324
|
-
i0.ɵɵelementStart(39, "label",
|
|
356
|
+
i0.ɵɵelementStart(39, "label", 54);
|
|
325
357
|
i0.ɵɵtext(40, "Primary");
|
|
326
358
|
i0.ɵɵelementEnd()()();
|
|
327
|
-
i0.ɵɵelementStart(41, "div",
|
|
328
|
-
i0.ɵɵlistener("click", function
|
|
329
|
-
i0.ɵɵconditionalCreate(43,
|
|
359
|
+
i0.ɵɵelementStart(41, "div", 49)(42, "button", 50);
|
|
360
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_Conditional_4_Template_button_click_42_listener() { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onSave()); });
|
|
361
|
+
i0.ɵɵconditionalCreate(43, AddressEditorComponent_Conditional_8_Conditional_4_Conditional_43_Template, 1, 0, "i", 51);
|
|
330
362
|
i0.ɵɵtext(44, " Save ");
|
|
331
363
|
i0.ɵɵelementEnd();
|
|
332
|
-
i0.ɵɵelementStart(45, "button",
|
|
333
|
-
i0.ɵɵlistener("click", function
|
|
364
|
+
i0.ɵɵelementStart(45, "button", 52);
|
|
365
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_Conditional_4_Template_button_click_45_listener() { i0.ɵɵrestoreView(_r9); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onCancelEdit()); });
|
|
334
366
|
i0.ɵɵtext(46, "Cancel");
|
|
335
367
|
i0.ɵɵelementEnd()()();
|
|
336
368
|
} if (rf & 2) {
|
|
@@ -364,20 +396,20 @@ function AddressEditorComponent_Conditional_7_Conditional_4_Template(rf, ctx) {
|
|
|
364
396
|
i0.ɵɵadvance();
|
|
365
397
|
i0.ɵɵconditional(ctx_r0.Saving ? 43 : -1);
|
|
366
398
|
} }
|
|
367
|
-
function
|
|
399
|
+
function AddressEditorComponent_Conditional_8_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
368
400
|
const _r12 = i0.ɵɵgetCurrentView();
|
|
369
|
-
i0.ɵɵelementStart(0, "div",
|
|
370
|
-
i0.ɵɵlistener("click", function
|
|
371
|
-
i0.ɵɵelement(2, "i",
|
|
401
|
+
i0.ɵɵelementStart(0, "div", 12)(1, "button", 55);
|
|
402
|
+
i0.ɵɵlistener("click", function AddressEditorComponent_Conditional_8_Conditional_5_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r12); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onAdd()); });
|
|
403
|
+
i0.ɵɵelement(2, "i", 56);
|
|
372
404
|
i0.ɵɵtext(3, " Add Address ");
|
|
373
405
|
i0.ɵɵelementEnd()();
|
|
374
406
|
} }
|
|
375
|
-
function
|
|
407
|
+
function AddressEditorComponent_Conditional_8_Template(rf, ctx) { if (rf & 1) {
|
|
376
408
|
i0.ɵɵelementStart(0, "div", 4);
|
|
377
|
-
i0.ɵɵconditionalCreate(1,
|
|
378
|
-
i0.ɵɵrepeaterCreate(2,
|
|
379
|
-
i0.ɵɵconditionalCreate(4,
|
|
380
|
-
i0.ɵɵconditionalCreate(5,
|
|
409
|
+
i0.ɵɵconditionalCreate(1, AddressEditorComponent_Conditional_8_Conditional_1_Template, 3, 0, "div", 10);
|
|
410
|
+
i0.ɵɵrepeaterCreate(2, AddressEditorComponent_Conditional_8_For_3_Template, 12, 9, null, null, _forTrack0);
|
|
411
|
+
i0.ɵɵconditionalCreate(4, AddressEditorComponent_Conditional_8_Conditional_4_Template, 47, 12, "div", 11);
|
|
412
|
+
i0.ɵɵconditionalCreate(5, AddressEditorComponent_Conditional_8_Conditional_5_Template, 4, 0, "div", 12);
|
|
381
413
|
i0.ɵɵelementEnd();
|
|
382
414
|
} if (rf & 2) {
|
|
383
415
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
@@ -536,6 +568,11 @@ export class AddressEditorComponent {
|
|
|
536
568
|
* so a misconfiguration surfaces as a visible message instead of a failed INSERT.
|
|
537
569
|
*/
|
|
538
570
|
LoadError = null;
|
|
571
|
+
/**
|
|
572
|
+
* Set when a delete is refused or fails. Rendered above the list, which stays visible,
|
|
573
|
+
* and cleared by the next delete attempt.
|
|
574
|
+
*/
|
|
575
|
+
ActionError = null;
|
|
539
576
|
/** Cached action ID for the Postal Code Lookup action. */
|
|
540
577
|
postalCodeLookupActionID = null;
|
|
541
578
|
/** Whether a postal code lookup is currently in progress. */
|
|
@@ -769,16 +806,14 @@ export class AddressEditorComponent {
|
|
|
769
806
|
/**
|
|
770
807
|
* Formats the first line of an address display string.
|
|
771
808
|
*
|
|
772
|
-
* Combines Line1 and Line2
|
|
809
|
+
* Combines whichever of Line1 and Line2 are present with a comma separator.
|
|
773
810
|
*
|
|
774
811
|
* @param address - The Address entity to format
|
|
775
|
-
* @returns A formatted string such as `'123 Main St, Suite 200'`
|
|
812
|
+
* @returns A formatted string such as `'123 Main St, Suite 200'`, or `''` for a
|
|
813
|
+
* location-only address with no street lines
|
|
776
814
|
*/
|
|
777
815
|
formatAddressLine1(address) {
|
|
778
|
-
|
|
779
|
-
if (address.Line2)
|
|
780
|
-
parts.push(address.Line2);
|
|
781
|
-
return parts.join(', ');
|
|
816
|
+
return [address.Line1, address.Line2].filter(Boolean).join(', ');
|
|
782
817
|
}
|
|
783
818
|
/**
|
|
784
819
|
* Formats the second line of an address display string.
|
|
@@ -790,17 +825,7 @@ export class AddressEditorComponent {
|
|
|
790
825
|
* @returns A formatted string such as `'San Francisco, CA, 94105, US'`
|
|
791
826
|
*/
|
|
792
827
|
formatAddressLine2(address) {
|
|
793
|
-
|
|
794
|
-
if (address.City)
|
|
795
|
-
parts.push(address.City);
|
|
796
|
-
if (address.StateProvince)
|
|
797
|
-
parts.push(address.StateProvince);
|
|
798
|
-
if (address.PostalCode)
|
|
799
|
-
parts.push(address.PostalCode);
|
|
800
|
-
let line = parts.join(', ');
|
|
801
|
-
if (address.Country)
|
|
802
|
-
line += ', ' + address.Country;
|
|
803
|
-
return line;
|
|
828
|
+
return [address.City, address.StateProvince, address.PostalCode, address.Country].filter(Boolean).join(', ');
|
|
804
829
|
}
|
|
805
830
|
/**
|
|
806
831
|
* Opens the inline add form for creating a new address.
|
|
@@ -990,51 +1015,109 @@ export class AddressEditorComponent {
|
|
|
990
1015
|
}
|
|
991
1016
|
}
|
|
992
1017
|
/**
|
|
993
|
-
*
|
|
994
|
-
* and the orphaned Address record.
|
|
1018
|
+
* Removes the address at the given index from this record.
|
|
995
1019
|
*
|
|
996
|
-
*
|
|
1020
|
+
* The AddressLink is always deleted. The Address row is deleted with it only when
|
|
1021
|
+
* nothing else references it — another party's link, or a direct reference from
|
|
1022
|
+
* another entity — and then both deletes run in one transaction so neither is left
|
|
1023
|
+
* behind alone. If the references cannot be checked, only the link is deleted.
|
|
1024
|
+
* A refused or failed delete is shown in {@link ActionError}.
|
|
997
1025
|
*
|
|
998
1026
|
* @param index - The zero-based index of the address item in {@link AddressItems}
|
|
999
1027
|
*/
|
|
1000
1028
|
async onDelete(index) {
|
|
1001
1029
|
const item = this.AddressItems[index];
|
|
1030
|
+
this.ActionError = null;
|
|
1002
1031
|
this.Saving = true;
|
|
1003
1032
|
this.cdr.detectChanges();
|
|
1033
|
+
let error = null;
|
|
1004
1034
|
try {
|
|
1005
|
-
|
|
1006
|
-
await item.Link.Delete();
|
|
1007
|
-
// Also delete the address record (it's orphaned now)
|
|
1008
|
-
await item.Address.Delete();
|
|
1009
|
-
await this.loadData();
|
|
1010
|
-
this.DataChanged.emit();
|
|
1035
|
+
error = await this.deleteItem(item);
|
|
1011
1036
|
}
|
|
1012
1037
|
catch (err) {
|
|
1013
1038
|
console.error('AddressEditor: Error deleting address', err);
|
|
1039
|
+
error = `Could not remove the address: ${err instanceof Error ? err.message : String(err)}`;
|
|
1040
|
+
}
|
|
1041
|
+
try {
|
|
1042
|
+
// Reload either way: on failure the entity objects still hold the failed transaction
|
|
1043
|
+
// group, and the list should show what the database actually has.
|
|
1044
|
+
await this.loadData();
|
|
1045
|
+
if (!error)
|
|
1046
|
+
this.DataChanged.emit();
|
|
1014
1047
|
}
|
|
1015
1048
|
finally {
|
|
1049
|
+
this.ActionError = error;
|
|
1016
1050
|
this.Saving = false;
|
|
1017
1051
|
this.cdr.detectChanges();
|
|
1018
1052
|
}
|
|
1019
1053
|
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Deletes the link, and the Address too when nothing else references it.
|
|
1056
|
+
* @returns `null` on success, otherwise the reason the delete was refused
|
|
1057
|
+
*/
|
|
1058
|
+
async deleteItem(item) {
|
|
1059
|
+
const md = new Metadata();
|
|
1060
|
+
if (!await this.isAddressUnreferenced(md, item)) {
|
|
1061
|
+
return await item.Link.Delete() ? null : this.deleteFailure(item.Link);
|
|
1062
|
+
}
|
|
1063
|
+
// The link must go first: FK_AddressLink_Address refuses the Address delete while it exists.
|
|
1064
|
+
const tg = await md.CreateTransactionGroup();
|
|
1065
|
+
item.Link.TransactionGroup = tg;
|
|
1066
|
+
item.Address.TransactionGroup = tg;
|
|
1067
|
+
if (!await item.Link.Delete())
|
|
1068
|
+
return this.deleteFailure(item.Link);
|
|
1069
|
+
if (!await item.Address.Delete())
|
|
1070
|
+
return this.deleteFailure(item.Address);
|
|
1071
|
+
if (!await tg.Submit()) {
|
|
1072
|
+
const failed = [item.Link, item.Address].find(e => e.LatestResult && !e.LatestResult.Success);
|
|
1073
|
+
return this.deleteFailure(failed ?? item.Link);
|
|
1074
|
+
}
|
|
1075
|
+
return null;
|
|
1076
|
+
}
|
|
1077
|
+
/**
|
|
1078
|
+
* Whether nothing but this item's link references its Address.
|
|
1079
|
+
*
|
|
1080
|
+
* Returns `false` when the check itself fails, so the caller keeps the Address row: an
|
|
1081
|
+
* unused row left behind is harmless, a deleted row something still points at is not.
|
|
1082
|
+
* The check fails on any host without a read-only database connection, because MJ's
|
|
1083
|
+
* GetRecordDependencies resolver uses only that connection.
|
|
1084
|
+
*/
|
|
1085
|
+
async isAddressUnreferenced(md, item) {
|
|
1086
|
+
try {
|
|
1087
|
+
const references = await md.GetRecordDependencies('MJ_BizApps_Common: Addresses', item.Address.PrimaryKey);
|
|
1088
|
+
return otherAddressReferences(references, item.Link.ID).length === 0;
|
|
1089
|
+
}
|
|
1090
|
+
catch (err) {
|
|
1091
|
+
console.warn('AddressEditor: Could not check what references the address; keeping the Address row', err);
|
|
1092
|
+
return false;
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
/** Builds the user-facing reason for a refused delete from the entity's latest result. */
|
|
1096
|
+
deleteFailure(entity) {
|
|
1097
|
+
const reason = entity.LatestResult?.CompleteMessage;
|
|
1098
|
+
return `Could not remove the address${reason ? `: ${reason}` : '.'}`;
|
|
1099
|
+
}
|
|
1020
1100
|
static ɵfac = function AddressEditorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AddressEditorComponent)(); };
|
|
1021
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddressEditorComponent, selectors: [["bizapps-address-editor"]], inputs: { EditMode: "EditMode", EntityName: "EntityName", RecordID: "RecordID" }, outputs: { DataChanged: "DataChanged" }, decls:
|
|
1101
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddressEditorComponent, selectors: [["bizapps-address-editor"]], inputs: { EditMode: "EditMode", EntityName: "EntityName", RecordID: "RecordID" }, outputs: { DataChanged: "DataChanged" }, decls: 9, vars: 3, consts: [[1, "section-header"], [1, "section-label"], [1, "fa-solid", "fa-map-marker-alt"], [1, "count"], [1, "addr-table"], [1, "load-error-row", "action-error-row"], [1, "fa-solid", "fa-triangle-exclamation"], [1, "load-error-row"], [1, "loading-row"], [1, "fa-solid", "fa-spinner"], [1, "empty-state"], [1, "addr-table-edit-panel"], [1, "addr-table-footer"], [1, "addr-table-row"], [1, "addr-table-icon"], [1, "addr-table-content"], [1, "addr-table-main"], [1, "addr-table-badges"], [1, "badge", "badge-type"], [1, "badge", "badge-primary"], [1, "addr-table-actions"], [1, "addr-table-sub"], [1, "fa-solid", "fa-star"], ["title", "Set as Primary", 1, "btn-ghost"], ["title", "Edit", 1, "btn-ghost", 3, "click"], [1, "fa-solid", "fa-pen"], ["title", "Remove", 1, "btn-ghost", "danger", 3, "click"], [1, "fa-solid", "fa-trash"], ["title", "Set as Primary", 1, "btn-ghost", 3, "click"], [1, "fa-regular", "fa-star"], [1, "form-row"], [1, "form-field", "type-field"], [3, "ngModelChange", "ngModel"], [3, "value"], [1, "form-field"], ["type", "text", "placeholder", "Street address", 3, "ngModelChange", "ngModel"], [1, "form-field", "line2-field"], ["type", "text", "placeholder", "Apt, suite", 3, "ngModelChange", "ngModel"], [1, "fa-solid", "fa-spinner", "fa-spin", "lookup-spinner"], [1, "lookup-not-found"], ["type", "text", "placeholder", "City", 3, "ngModelChange", "ngModel"], [1, "form-field", "state-field"], ["type", "text", "placeholder", "ST", 3, "ngModelChange", "ngModel"], [1, "form-field", "postal-field"], ["type", "text", "placeholder", "Zip", 3, "ngModelChange", "blur", "ngModel"], [1, "form-field", "country-field"], [1, "checkbox-field"], ["type", "checkbox", 3, "ngModelChange", "id", "ngModel"], [3, "for"], [1, "form-actions"], [1, "btn", "btn-primary", "btn-sm", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "btn", "btn-cancel", "btn-sm", 3, "click"], ["type", "checkbox", "id", "primary-add", 3, "ngModelChange", "ngModel"], ["for", "primary-add"], [1, "btn", "btn-outline", "full-width", 3, "click"], [1, "fa-solid", "fa-plus"]], template: function AddressEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1022
1102
|
i0.ɵɵelementStart(0, "div", 0)(1, "span", 1);
|
|
1023
1103
|
i0.ɵɵelement(2, "i", 2);
|
|
1024
1104
|
i0.ɵɵtext(3, " Addresses ");
|
|
1025
1105
|
i0.ɵɵconditionalCreate(4, AddressEditorComponent_Conditional_4_Template, 2, 1, "span", 3);
|
|
1026
1106
|
i0.ɵɵelementEnd()();
|
|
1027
|
-
i0.ɵɵconditionalCreate(5, AddressEditorComponent_Conditional_5_Template, 4, 1, "div", 4)
|
|
1107
|
+
i0.ɵɵconditionalCreate(5, AddressEditorComponent_Conditional_5_Template, 4, 1, "div", 4);
|
|
1108
|
+
i0.ɵɵconditionalCreate(6, AddressEditorComponent_Conditional_6_Template, 4, 1, "div", 4)(7, AddressEditorComponent_Conditional_7_Template, 4, 0, "div", 4)(8, AddressEditorComponent_Conditional_8_Template, 6, 3, "div", 4);
|
|
1028
1109
|
} if (rf & 2) {
|
|
1029
1110
|
i0.ɵɵadvance(4);
|
|
1030
1111
|
i0.ɵɵconditional(!ctx.Loading && ctx.AddressItems.length > 0 ? 4 : -1);
|
|
1031
1112
|
i0.ɵɵadvance();
|
|
1032
|
-
i0.ɵɵconditional(ctx.
|
|
1033
|
-
|
|
1113
|
+
i0.ɵɵconditional(ctx.ActionError ? 5 : -1);
|
|
1114
|
+
i0.ɵɵadvance();
|
|
1115
|
+
i0.ɵɵconditional(ctx.LoadError ? 6 : ctx.Loading ? 7 : 8);
|
|
1116
|
+
} }, dependencies: [CommonModule, FormsModule, i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i1.DefaultValueAccessor, i1.CheckboxControlValueAccessor, i1.SelectControlValueAccessor, i1.NgControlStatus, i1.NgModel], styles: ["\n\n\n\n\n\n[_nghost-%COMP%] {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n color: var(--mj-text-primary);\n}\n\n.section-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 16px;\n}\n\n.section-label[_ngcontent-%COMP%] {\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.section-label[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n}\n\n.count[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-muted);\n font-weight: 400;\n}\n\n\n\n.addr-table[_ngcontent-%COMP%] {\n width: 100%;\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n overflow: hidden;\n}\n\n\n\n.addr-table-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n gap: 12px;\n transition: background 0.1s ease;\n}\n\n.addr-table-row[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n}\n\n.addr-table-row[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-card);\n}\n\n.addr-table-row.primary[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n}\n\n\n\n.addr-table-icon[_ngcontent-%COMP%] {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n font-size: 14px;\n flex-shrink: 0;\n}\n\n\n\n.addr-table-content[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.addr-table-main[_ngcontent-%COMP%] {\n font-size: 14px;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.addr-table-sub[_ngcontent-%COMP%] {\n font-size: 12px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n}\n\n\n\n.addr-table-badges[_ngcontent-%COMP%] {\n display: flex;\n gap: 6px;\n flex-shrink: 0;\n}\n\n.badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 10px;\n border-radius: 12px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.badge-type[_ngcontent-%COMP%] {\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n}\n\n.badge-primary[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n\n\n.addr-table-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n.addr-table-row[_ngcontent-%COMP%]:hover .addr-table-actions[_ngcontent-%COMP%] {\n opacity: 1;\n}\n\n\n\n.btn-ghost[_ngcontent-%COMP%] {\n background: transparent;\n color: var(--mj-text-disabled);\n padding: 6px 8px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n transition: all 0.15s ease;\n}\n\n.btn-ghost[_ngcontent-%COMP%]:hover {\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n}\n\n.btn-ghost.danger[_ngcontent-%COMP%]:hover {\n color: var(--mj-status-error-text);\n background: var(--mj-status-error-bg);\n}\n\n\n\n.addr-table-edit-panel[_ngcontent-%COMP%] {\n padding: 16px;\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n border-bottom: 2px solid var(--mj-brand-primary);\n}\n\n\n\n.addr-table-footer[_ngcontent-%COMP%] {\n padding: 10px 16px;\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n}\n\n\n\n.btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.btn-primary[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n color: var(--mj-brand-on-primary);\n}\n\n.btn-primary[_ngcontent-%COMP%]:hover {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-outline[_ngcontent-%COMP%] {\n background: transparent;\n border: 1px dashed var(--mj-border-strong);\n color: var(--mj-text-secondary);\n}\n\n.btn-outline[_ngcontent-%COMP%]:hover {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.btn-outline.full-width[_ngcontent-%COMP%] {\n width: 100%;\n justify-content: center;\n}\n\n.btn-cancel[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-default);\n}\n\n.btn-cancel[_ngcontent-%COMP%]:hover {\n background: var(--mj-border-subtle);\n}\n\n.btn-sm[_ngcontent-%COMP%] {\n padding: 6px 14px;\n font-size: 12px;\n}\n\n\n\n.form-row[_ngcontent-%COMP%] {\n display: flex;\n gap: 12px;\n margin-bottom: 12px;\n}\n\n.form-field[_ngcontent-%COMP%] {\n flex: 1;\n}\n\n.form-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n display: block;\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n margin-bottom: 4px;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%], \n.form-field[_ngcontent-%COMP%] select[_ngcontent-%COMP%] {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 14px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n}\n\n.form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus, \n.form-field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-field.type-field[_ngcontent-%COMP%] {\n max-width: 150px;\n}\n\n.form-field.line2-field[_ngcontent-%COMP%] {\n max-width: 150px;\n}\n\n.form-field.state-field[_ngcontent-%COMP%] {\n max-width: 80px;\n}\n\n.form-field.postal-field[_ngcontent-%COMP%] {\n max-width: 130px;\n}\n\n.form-field.country-field[_ngcontent-%COMP%] {\n max-width: 180px;\n}\n\n.checkbox-field[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 22px;\n}\n\n.checkbox-field[_ngcontent-%COMP%] input[type=\"checkbox\"][_ngcontent-%COMP%] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n.checkbox-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%] {\n font-size: 13px;\n color: var(--mj-text-secondary);\n cursor: pointer;\n}\n\n.form-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n}\n\n\n\n.empty-state[_ngcontent-%COMP%] {\n text-align: center;\n padding: 32px 16px;\n color: var(--mj-text-muted);\n font-size: 14px;\n}\n\n.empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 24px;\n color: var(--mj-border-strong);\n margin-bottom: 8px;\n display: block;\n}\n\n\n\n.loading-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n color: var(--mj-text-muted);\n font-size: 13px;\n gap: 8px;\n}\n\n.loading-row[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n animation: _ngcontent-%COMP%_spin 1s linear infinite;\n}\n\n\n\n\n.load-error-row[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 24px;\n color: var(--mj-status-error-text);\n font-size: 13px;\n gap: 8px;\n}\n\n\n\n.action-error-row[_ngcontent-%COMP%] {\n padding: 8px 12px;\n}\n\n@keyframes _ngcontent-%COMP%_spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n.lookup-spinner[_ngcontent-%COMP%] {\n font-size: 10px;\n color: var(--mj-brand-primary);\n margin-left: 4px;\n}\n\n.lookup-not-found[_ngcontent-%COMP%] {\n font-size: 10px;\n color: var(--mj-status-warning-text);\n margin-left: 4px;\n font-weight: 600;\n}"] });
|
|
1034
1117
|
}
|
|
1035
1118
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AddressEditorComponent, [{
|
|
1036
1119
|
type: Component,
|
|
1037
|
-
args: [{ standalone: true, imports: [CommonModule, FormsModule], selector: 'bizapps-address-editor', template: "<!-- AddressEditor - Compact Table Design (Option B) -->\n\n<div class=\"section-header\">\n <span class=\"section-label\">\n <i class=\"fa-solid fa-map-marker-alt\"></i>\n Addresses\n @if (!Loading && AddressItems.length > 0) {\n <span class=\"count\">({{ AddressItems.length }})</span>\n }\n </span>\n</div>\n\n@if (LoadError) {\n <div class=\"addr-table\">\n <div class=\"load-error-row\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i> {{ LoadError }}\n </div>\n </div>\n} @else if (Loading) {\n <div class=\"addr-table\">\n <div class=\"loading-row\">\n <i class=\"fa-solid fa-spinner\"></i> Loading addresses...\n </div>\n </div>\n} @else {\n <div class=\"addr-table\">\n @if (AddressItems.length === 0 && EditingIndex !== -1) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-map-marker-alt\"></i>\n No addresses linked yet\n </div>\n }\n\n @for (item of AddressItems; track item.Link.ID; let i = $index) {\n <!-- Address Row -->\n <div class=\"addr-table-row\" [class.primary]=\"item.Link.IsPrimary\">\n <div class=\"addr-table-icon\">\n <i [class]=\"getAddressTypeIcon(item.Link.AddressTypeID)\"></i>\n </div>\n <div class=\"addr-table-content\">\n <div class=\"addr-table-main\">{{ formatAddressLine1(item.Address) }}</div>\n <div class=\"addr-table-sub\">{{ formatAddressLine2(item.Address) }}</div>\n </div>\n <div class=\"addr-table-badges\">\n <span class=\"badge badge-type\">{{ item.Link.AddressType }}</span>\n @if (item.Link.IsPrimary) {\n <span class=\"badge badge-primary\"><i class=\"fa-solid fa-star\"></i> Primary</span>\n }\n </div>\n @if (EditMode) {\n <div class=\"addr-table-actions\">\n @if (!item.Link.IsPrimary) {\n <button class=\"btn-ghost\" title=\"Set as Primary\" (click)=\"onSetPrimary(i)\">\n <i class=\"fa-regular fa-star\"></i>\n </button>\n }\n <button class=\"btn-ghost\" title=\"Edit\" (click)=\"onEdit(i)\">\n <i class=\"fa-solid fa-pen\"></i>\n </button>\n <button class=\"btn-ghost danger\" title=\"Remove\" (click)=\"onDelete(i)\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n\n <!-- Inline Edit Panel (shown when editing this row) -->\n @if (EditingIndex === i) {\n <div class=\"addr-table-edit-panel\">\n <div class=\"form-row\">\n <div class=\"form-field type-field\">\n <label>Type</label>\n <select [(ngModel)]=\"EditForm.TypeID\">\n @for (t of AddressTypes; track t.ID) {\n <option [value]=\"t.ID\">{{ t.Name }}</option>\n }\n </select>\n </div>\n <div class=\"form-field\">\n <label>Line 1</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line1\" placeholder=\"Street address\">\n </div>\n <div class=\"form-field line2-field\">\n <label>Line 2</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line2\" placeholder=\"Apt, suite\">\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-field\">\n <label>\n City\n @if (LookingUpPostalCode) { <i class=\"fa-solid fa-spinner fa-spin lookup-spinner\"></i> }\n @if (PostalCodeNotFound) { <span class=\"lookup-not-found\">not found</span> }\n </label>\n <input type=\"text\" [(ngModel)]=\"EditForm.City\" placeholder=\"City\">\n </div>\n <div class=\"form-field state-field\">\n <label>State</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.StateProvince\" placeholder=\"ST\">\n </div>\n <div class=\"form-field postal-field\">\n <label>Postal</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.PostalCode\" placeholder=\"Zip\" (blur)=\"onPostalCodeBlur()\">\n </div>\n <div class=\"form-field country-field\">\n <label>Country</label>\n <select [(ngModel)]=\"EditForm.Country\">\n @for (c of Countries; track c.Code) {\n <option [value]=\"c.Code\">{{ c.Code }} - {{ c.Name }}</option>\n }\n </select>\n </div>\n <div class=\"checkbox-field\">\n <input type=\"checkbox\" [id]=\"'primary-edit-' + i\" [(ngModel)]=\"EditForm.IsPrimary\">\n <label [for]=\"'primary-edit-' + i\">Primary</label>\n </div>\n </div>\n <div class=\"form-actions\">\n <button class=\"btn btn-primary btn-sm\" (click)=\"onSave()\" [disabled]=\"Saving\">\n @if (Saving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n Save\n </button>\n <button class=\"btn btn-cancel btn-sm\" (click)=\"onCancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n }\n\n <!-- Add New Panel (shown when EditingIndex === -1) -->\n @if (EditingIndex === -1) {\n <div class=\"addr-table-edit-panel\">\n <div class=\"form-row\">\n <div class=\"form-field type-field\">\n <label>Type</label>\n <select [(ngModel)]=\"EditForm.TypeID\">\n @for (t of AddressTypes; track t.ID) {\n <option [value]=\"t.ID\">{{ t.Name }}</option>\n }\n </select>\n </div>\n <div class=\"form-field\">\n <label>Line 1</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line1\" placeholder=\"Street address\">\n </div>\n <div class=\"form-field line2-field\">\n <label>Line 2</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line2\" placeholder=\"Apt, suite\">\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-field\">\n <label>\n City\n @if (LookingUpPostalCode) { <i class=\"fa-solid fa-spinner fa-spin lookup-spinner\"></i> }\n @if (PostalCodeNotFound) { <span class=\"lookup-not-found\">not found</span> }\n </label>\n <input type=\"text\" [(ngModel)]=\"EditForm.City\" placeholder=\"City\">\n </div>\n <div class=\"form-field state-field\">\n <label>State</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.StateProvince\" placeholder=\"ST\">\n </div>\n <div class=\"form-field postal-field\">\n <label>Postal</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.PostalCode\" placeholder=\"Zip\" (blur)=\"onPostalCodeBlur()\">\n </div>\n <div class=\"form-field country-field\">\n <label>Country</label>\n <select [(ngModel)]=\"EditForm.Country\">\n @for (c of Countries; track c.Code) {\n <option [value]=\"c.Code\">{{ c.Code }} - {{ c.Name }}</option>\n }\n </select>\n </div>\n <div class=\"checkbox-field\">\n <input type=\"checkbox\" id=\"primary-add\" [(ngModel)]=\"EditForm.IsPrimary\">\n <label for=\"primary-add\">Primary</label>\n </div>\n </div>\n <div class=\"form-actions\">\n <button class=\"btn btn-primary btn-sm\" (click)=\"onSave()\" [disabled]=\"Saving\">\n @if (Saving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n Save\n </button>\n <button class=\"btn btn-cancel btn-sm\" (click)=\"onCancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n\n <!-- Add Button Footer -->\n @if (EditingIndex === null && EditMode) {\n <div class=\"addr-table-footer\">\n <button class=\"btn btn-outline full-width\" (click)=\"onAdd()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Address\n </button>\n </div>\n }\n </div>\n}\n", styles: ["/* ============================================\n AddressEditor - Compact Table Design\n Pixel-perfect match to Option B mockup\n ============================================ */\n\n:host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n color: var(--mj-text-primary);\n}\n\n.section-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 16px;\n}\n\n.section-label {\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.section-label i {\n color: var(--mj-brand-primary);\n}\n\n.count {\n font-size: 12px;\n color: var(--mj-text-muted);\n font-weight: 400;\n}\n\n/* Table container */\n.addr-table {\n width: 100%;\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n overflow: hidden;\n}\n\n/* Table rows */\n.addr-table-row {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n gap: 12px;\n transition: background 0.1s ease;\n}\n\n.addr-table-row:last-child {\n border-bottom: none;\n}\n\n.addr-table-row:hover {\n background: var(--mj-bg-surface-card);\n}\n\n.addr-table-row.primary {\n background: var(--mj-status-success-bg);\n}\n\n/* Icon */\n.addr-table-icon {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n font-size: 14px;\n flex-shrink: 0;\n}\n\n/* Content */\n.addr-table-content {\n flex: 1;\n min-width: 0;\n}\n\n.addr-table-main {\n font-size: 14px;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.addr-table-sub {\n font-size: 12px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n}\n\n/* Badges */\n.addr-table-badges {\n display: flex;\n gap: 6px;\n flex-shrink: 0;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 10px;\n border-radius: 12px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.badge-type {\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n}\n\n.badge-primary {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n/* Actions */\n.addr-table-actions {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n.addr-table-row:hover .addr-table-actions {\n opacity: 1;\n}\n\n/* Ghost buttons */\n.btn-ghost {\n background: transparent;\n color: var(--mj-text-disabled);\n padding: 6px 8px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n transition: all 0.15s ease;\n}\n\n.btn-ghost:hover {\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n}\n\n.btn-ghost.danger:hover {\n color: var(--mj-status-error-text);\n background: var(--mj-status-error-bg);\n}\n\n/* Edit panel */\n.addr-table-edit-panel {\n padding: 16px;\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n border-bottom: 2px solid var(--mj-brand-primary);\n}\n\n/* Footer */\n.addr-table-footer {\n padding: 10px 16px;\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n}\n\n/* Buttons */\n.btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.btn-primary {\n background: var(--mj-brand-primary);\n color: var(--mj-brand-on-primary);\n}\n\n.btn-primary:hover {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-outline {\n background: transparent;\n border: 1px dashed var(--mj-border-strong);\n color: var(--mj-text-secondary);\n}\n\n.btn-outline:hover {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.btn-outline.full-width {\n width: 100%;\n justify-content: center;\n}\n\n.btn-cancel {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-default);\n}\n\n.btn-cancel:hover {\n background: var(--mj-border-subtle);\n}\n\n.btn-sm {\n padding: 6px 14px;\n font-size: 12px;\n}\n\n/* Form */\n.form-row {\n display: flex;\n gap: 12px;\n margin-bottom: 12px;\n}\n\n.form-field {\n flex: 1;\n}\n\n.form-field label {\n display: block;\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n margin-bottom: 4px;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.form-field input,\n.form-field select {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 14px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n}\n\n.form-field input:focus,\n.form-field select:focus {\n outline: none;\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-field.type-field {\n max-width: 150px;\n}\n\n.form-field.line2-field {\n max-width: 150px;\n}\n\n.form-field.state-field {\n max-width: 80px;\n}\n\n.form-field.postal-field {\n max-width: 130px;\n}\n\n.form-field.country-field {\n max-width: 180px;\n}\n\n.checkbox-field {\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 22px;\n}\n\n.checkbox-field input[type=\"checkbox\"] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n.checkbox-field label {\n font-size: 13px;\n color: var(--mj-text-secondary);\n cursor: pointer;\n}\n\n.form-actions {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n}\n\n/* Empty state */\n.empty-state {\n text-align: center;\n padding: 32px 16px;\n color: var(--mj-text-muted);\n font-size: 14px;\n}\n\n.empty-state i {\n font-size: 24px;\n color: var(--mj-border-strong);\n margin-bottom: 8px;\n display: block;\n}\n\n/* Loading */\n.loading-row {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n color: var(--mj-text-muted);\n font-size: 13px;\n gap: 8px;\n}\n\n.loading-row i {\n animation: spin 1s linear infinite;\n}\n\n/* Misconfiguration (e.g. an EntityName that is not in metadata). Styled like .loading-row\n so it sits in the same slot, but in the danger colour and left-aligned for readability. */\n.load-error-row {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 24px;\n color: var(--mj-status-error-text);\n font-size: 13px;\n gap: 8px;\n}\n\n@keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n.lookup-spinner {\n font-size: 10px;\n color: var(--mj-brand-primary);\n margin-left: 4px;\n}\n\n.lookup-not-found {\n font-size: 10px;\n color: var(--mj-status-warning-text);\n margin-left: 4px;\n font-weight: 600;\n}\n"] }]
|
|
1120
|
+
args: [{ standalone: true, imports: [CommonModule, FormsModule], selector: 'bizapps-address-editor', template: "<!-- AddressEditor - Compact Table Design (Option B) -->\n\n<div class=\"section-header\">\n <span class=\"section-label\">\n <i class=\"fa-solid fa-map-marker-alt\"></i>\n Addresses\n @if (!Loading && AddressItems.length > 0) {\n <span class=\"count\">({{ AddressItems.length }})</span>\n }\n </span>\n</div>\n\n@if (ActionError) {\n <div class=\"addr-table\">\n <div class=\"load-error-row action-error-row\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i> {{ ActionError }}\n </div>\n </div>\n}\n\n@if (LoadError) {\n <div class=\"addr-table\">\n <div class=\"load-error-row\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i> {{ LoadError }}\n </div>\n </div>\n} @else if (Loading) {\n <div class=\"addr-table\">\n <div class=\"loading-row\">\n <i class=\"fa-solid fa-spinner\"></i> Loading addresses...\n </div>\n </div>\n} @else {\n <div class=\"addr-table\">\n @if (AddressItems.length === 0 && EditingIndex !== -1) {\n <div class=\"empty-state\">\n <i class=\"fa-solid fa-map-marker-alt\"></i>\n No addresses linked yet\n </div>\n }\n\n @for (item of AddressItems; track item.Link.ID; let i = $index) {\n <!-- Address Row -->\n <div class=\"addr-table-row\" [class.primary]=\"item.Link.IsPrimary\">\n <div class=\"addr-table-icon\">\n <i [class]=\"getAddressTypeIcon(item.Link.AddressTypeID)\"></i>\n </div>\n <div class=\"addr-table-content\">\n @if (formatAddressLine1(item.Address); as street) {\n <div class=\"addr-table-main\">{{ street }}</div>\n <div class=\"addr-table-sub\">{{ formatAddressLine2(item.Address) }}</div>\n } @else {\n <!-- Location-only address: the locality line becomes the headline -->\n <div class=\"addr-table-main\">{{ formatAddressLine2(item.Address) }}</div>\n }\n </div>\n <div class=\"addr-table-badges\">\n <span class=\"badge badge-type\">{{ item.Link.AddressType }}</span>\n @if (item.Link.IsPrimary) {\n <span class=\"badge badge-primary\"><i class=\"fa-solid fa-star\"></i> Primary</span>\n }\n </div>\n @if (EditMode) {\n <div class=\"addr-table-actions\">\n @if (!item.Link.IsPrimary) {\n <button class=\"btn-ghost\" title=\"Set as Primary\" (click)=\"onSetPrimary(i)\">\n <i class=\"fa-regular fa-star\"></i>\n </button>\n }\n <button class=\"btn-ghost\" title=\"Edit\" (click)=\"onEdit(i)\">\n <i class=\"fa-solid fa-pen\"></i>\n </button>\n <button class=\"btn-ghost danger\" title=\"Remove\" (click)=\"onDelete(i)\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n </div>\n }\n </div>\n\n <!-- Inline Edit Panel (shown when editing this row) -->\n @if (EditingIndex === i) {\n <div class=\"addr-table-edit-panel\">\n <div class=\"form-row\">\n <div class=\"form-field type-field\">\n <label>Type</label>\n <select [(ngModel)]=\"EditForm.TypeID\">\n @for (t of AddressTypes; track t.ID) {\n <option [value]=\"t.ID\">{{ t.Name }}</option>\n }\n </select>\n </div>\n <div class=\"form-field\">\n <label>Line 1</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line1\" placeholder=\"Street address\">\n </div>\n <div class=\"form-field line2-field\">\n <label>Line 2</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line2\" placeholder=\"Apt, suite\">\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-field\">\n <label>\n City\n @if (LookingUpPostalCode) { <i class=\"fa-solid fa-spinner fa-spin lookup-spinner\"></i> }\n @if (PostalCodeNotFound) { <span class=\"lookup-not-found\">not found</span> }\n </label>\n <input type=\"text\" [(ngModel)]=\"EditForm.City\" placeholder=\"City\">\n </div>\n <div class=\"form-field state-field\">\n <label>State</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.StateProvince\" placeholder=\"ST\">\n </div>\n <div class=\"form-field postal-field\">\n <label>Postal</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.PostalCode\" placeholder=\"Zip\" (blur)=\"onPostalCodeBlur()\">\n </div>\n <div class=\"form-field country-field\">\n <label>Country</label>\n <select [(ngModel)]=\"EditForm.Country\">\n @for (c of Countries; track c.Code) {\n <option [value]=\"c.Code\">{{ c.Code }} - {{ c.Name }}</option>\n }\n </select>\n </div>\n <div class=\"checkbox-field\">\n <input type=\"checkbox\" [id]=\"'primary-edit-' + i\" [(ngModel)]=\"EditForm.IsPrimary\">\n <label [for]=\"'primary-edit-' + i\">Primary</label>\n </div>\n </div>\n <div class=\"form-actions\">\n <button class=\"btn btn-primary btn-sm\" (click)=\"onSave()\" [disabled]=\"Saving\">\n @if (Saving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n Save\n </button>\n <button class=\"btn btn-cancel btn-sm\" (click)=\"onCancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n }\n\n <!-- Add New Panel (shown when EditingIndex === -1) -->\n @if (EditingIndex === -1) {\n <div class=\"addr-table-edit-panel\">\n <div class=\"form-row\">\n <div class=\"form-field type-field\">\n <label>Type</label>\n <select [(ngModel)]=\"EditForm.TypeID\">\n @for (t of AddressTypes; track t.ID) {\n <option [value]=\"t.ID\">{{ t.Name }}</option>\n }\n </select>\n </div>\n <div class=\"form-field\">\n <label>Line 1</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line1\" placeholder=\"Street address\">\n </div>\n <div class=\"form-field line2-field\">\n <label>Line 2</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.Line2\" placeholder=\"Apt, suite\">\n </div>\n </div>\n <div class=\"form-row\">\n <div class=\"form-field\">\n <label>\n City\n @if (LookingUpPostalCode) { <i class=\"fa-solid fa-spinner fa-spin lookup-spinner\"></i> }\n @if (PostalCodeNotFound) { <span class=\"lookup-not-found\">not found</span> }\n </label>\n <input type=\"text\" [(ngModel)]=\"EditForm.City\" placeholder=\"City\">\n </div>\n <div class=\"form-field state-field\">\n <label>State</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.StateProvince\" placeholder=\"ST\">\n </div>\n <div class=\"form-field postal-field\">\n <label>Postal</label>\n <input type=\"text\" [(ngModel)]=\"EditForm.PostalCode\" placeholder=\"Zip\" (blur)=\"onPostalCodeBlur()\">\n </div>\n <div class=\"form-field country-field\">\n <label>Country</label>\n <select [(ngModel)]=\"EditForm.Country\">\n @for (c of Countries; track c.Code) {\n <option [value]=\"c.Code\">{{ c.Code }} - {{ c.Name }}</option>\n }\n </select>\n </div>\n <div class=\"checkbox-field\">\n <input type=\"checkbox\" id=\"primary-add\" [(ngModel)]=\"EditForm.IsPrimary\">\n <label for=\"primary-add\">Primary</label>\n </div>\n </div>\n <div class=\"form-actions\">\n <button class=\"btn btn-primary btn-sm\" (click)=\"onSave()\" [disabled]=\"Saving\">\n @if (Saving) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n }\n Save\n </button>\n <button class=\"btn btn-cancel btn-sm\" (click)=\"onCancelEdit()\">Cancel</button>\n </div>\n </div>\n }\n\n <!-- Add Button Footer -->\n @if (EditingIndex === null && EditMode) {\n <div class=\"addr-table-footer\">\n <button class=\"btn btn-outline full-width\" (click)=\"onAdd()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Address\n </button>\n </div>\n }\n </div>\n}\n", styles: ["/* ============================================\n AddressEditor - Compact Table Design\n Pixel-perfect match to Option B mockup\n ============================================ */\n\n:host {\n display: block;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;\n color: var(--mj-text-primary);\n}\n\n.section-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 16px;\n}\n\n.section-label {\n font-size: 15px;\n font-weight: 600;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.section-label i {\n color: var(--mj-brand-primary);\n}\n\n.count {\n font-size: 12px;\n color: var(--mj-text-muted);\n font-weight: 400;\n}\n\n/* Table container */\n.addr-table {\n width: 100%;\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n overflow: hidden;\n}\n\n/* Table rows */\n.addr-table-row {\n display: flex;\n align-items: center;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-bg-surface-sunken);\n gap: 12px;\n transition: background 0.1s ease;\n}\n\n.addr-table-row:last-child {\n border-bottom: none;\n}\n\n.addr-table-row:hover {\n background: var(--mj-bg-surface-card);\n}\n\n.addr-table-row.primary {\n background: var(--mj-status-success-bg);\n}\n\n/* Icon */\n.addr-table-icon {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 6px;\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n font-size: 14px;\n flex-shrink: 0;\n}\n\n/* Content */\n.addr-table-content {\n flex: 1;\n min-width: 0;\n}\n\n.addr-table-main {\n font-size: 14px;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.addr-table-sub {\n font-size: 12px;\n color: var(--mj-text-muted);\n margin-top: 2px;\n}\n\n/* Badges */\n.addr-table-badges {\n display: flex;\n gap: 6px;\n flex-shrink: 0;\n}\n\n.badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 10px;\n border-radius: 12px;\n font-size: 11px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.badge-type {\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface));\n color: var(--mj-brand-primary-hover);\n}\n\n.badge-primary {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n/* Actions */\n.addr-table-actions {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n.addr-table-row:hover .addr-table-actions {\n opacity: 1;\n}\n\n/* Ghost buttons */\n.btn-ghost {\n background: transparent;\n color: var(--mj-text-disabled);\n padding: 6px 8px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n transition: all 0.15s ease;\n}\n\n.btn-ghost:hover {\n color: var(--mj-text-primary);\n background: var(--mj-bg-surface-card);\n}\n\n.btn-ghost.danger:hover {\n color: var(--mj-status-error-text);\n background: var(--mj-status-error-bg);\n}\n\n/* Edit panel */\n.addr-table-edit-panel {\n padding: 16px;\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n border-bottom: 2px solid var(--mj-brand-primary);\n}\n\n/* Footer */\n.addr-table-footer {\n padding: 10px 16px;\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface-card);\n}\n\n/* Buttons */\n.btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.btn-primary {\n background: var(--mj-brand-primary);\n color: var(--mj-brand-on-primary);\n}\n\n.btn-primary:hover {\n background: var(--mj-brand-primary-hover);\n}\n\n.btn-outline {\n background: transparent;\n border: 1px dashed var(--mj-border-strong);\n color: var(--mj-text-secondary);\n}\n\n.btn-outline:hover {\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 6%, var(--mj-bg-surface));\n}\n\n.btn-outline.full-width {\n width: 100%;\n justify-content: center;\n}\n\n.btn-cancel {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n border: 1px solid var(--mj-border-default);\n}\n\n.btn-cancel:hover {\n background: var(--mj-border-subtle);\n}\n\n.btn-sm {\n padding: 6px 14px;\n font-size: 12px;\n}\n\n/* Form */\n.form-row {\n display: flex;\n gap: 12px;\n margin-bottom: 12px;\n}\n\n.form-field {\n flex: 1;\n}\n\n.form-field label {\n display: block;\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n margin-bottom: 4px;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.form-field input,\n.form-field select {\n width: 100%;\n padding: 8px 12px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n font-size: 14px;\n font-family: inherit;\n background: var(--mj-bg-surface);\n}\n\n.form-field input:focus,\n.form-field select:focus {\n outline: none;\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--mj-brand-primary) 10%, transparent);\n}\n\n.form-field.type-field {\n max-width: 150px;\n}\n\n.form-field.line2-field {\n max-width: 150px;\n}\n\n.form-field.state-field {\n max-width: 80px;\n}\n\n.form-field.postal-field {\n max-width: 130px;\n}\n\n.form-field.country-field {\n max-width: 180px;\n}\n\n.checkbox-field {\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 22px;\n}\n\n.checkbox-field input[type=\"checkbox\"] {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n.checkbox-field label {\n font-size: 13px;\n color: var(--mj-text-secondary);\n cursor: pointer;\n}\n\n.form-actions {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n}\n\n/* Empty state */\n.empty-state {\n text-align: center;\n padding: 32px 16px;\n color: var(--mj-text-muted);\n font-size: 14px;\n}\n\n.empty-state i {\n font-size: 24px;\n color: var(--mj-border-strong);\n margin-bottom: 8px;\n display: block;\n}\n\n/* Loading */\n.loading-row {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 24px;\n color: var(--mj-text-muted);\n font-size: 13px;\n gap: 8px;\n}\n\n.loading-row i {\n animation: spin 1s linear infinite;\n}\n\n/* Misconfiguration (e.g. an EntityName that is not in metadata). Styled like .loading-row\n so it sits in the same slot, but in the danger colour and left-aligned for readability. */\n.load-error-row {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 24px;\n color: var(--mj-status-error-text);\n font-size: 13px;\n gap: 8px;\n}\n\n/* A refused delete. Same colours as .load-error-row, but compact because the list stays below it. */\n.action-error-row {\n padding: 8px 12px;\n}\n\n@keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n.lookup-spinner {\n font-size: 10px;\n color: var(--mj-brand-primary);\n margin-left: 4px;\n}\n\n.lookup-not-found {\n font-size: 10px;\n color: var(--mj-status-warning-text);\n margin-left: 4px;\n font-weight: 600;\n}\n"] }]
|
|
1038
1121
|
}], () => [], { EditMode: [{
|
|
1039
1122
|
type: Input
|
|
1040
1123
|
}], DataChanged: [{
|
|
@@ -1044,5 +1127,5 @@ export class AddressEditorComponent {
|
|
|
1044
1127
|
}], RecordID: [{
|
|
1045
1128
|
type: Input
|
|
1046
1129
|
}] }); })();
|
|
1047
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddressEditorComponent, { className: "AddressEditorComponent", filePath: "lib/components/address-editor/address-editor.component.ts", lineNumber:
|
|
1130
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddressEditorComponent, { className: "AddressEditorComponent", filePath: "lib/components/address-editor/address-editor.component.ts", lineNumber: 90 }); })();
|
|
1048
1131
|
//# sourceMappingURL=address-editor.component.js.map
|