profile-pane 3.2.1 → 3.2.2-test.0
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/README.md +50 -0
- package/lib/303.profile-pane.js +1362 -0
- package/lib/303.profile-pane.js.map +1 -0
- package/lib/303.profile-pane.min.js +2 -0
- package/lib/303.profile-pane.min.js.map +1 -0
- package/lib/ProfileView.css +1090 -0
- package/lib/ProfileView.d.ts +2 -1
- package/lib/ProfileView.d.ts.map +1 -1
- package/lib/ProfileView.js +64 -36
- package/lib/buttonsHelper.d.ts +1 -1
- package/lib/buttonsHelper.d.ts.map +1 -1
- package/lib/buttonsHelper.js +2 -1
- package/lib/editProfilePane/EditCVCard.js +1 -1
- package/lib/editProfilePane/EditCommunitiesCard.js +1 -1
- package/lib/editProfilePane/EditFriendsCard.js +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts +1 -1
- package/lib/editProfilePane/EditProfileView.d.ts.map +1 -1
- package/lib/editProfilePane/EditProfileView.js +4 -5
- package/lib/editProfilePane/editProfilePresenter.d.ts.map +1 -1
- package/lib/editProfilePane/editProfilePresenter.js +5 -4
- package/lib/icons-svg/profileIcons.d.ts +1 -1
- package/lib/icons-svg/profileIcons.d.ts.map +1 -1
- package/lib/icons-svg/profileIcons.js +9 -17
- package/lib/index.d.ts +1 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +74 -40
- package/lib/ontology/otherPreferencesForm.ttl +32 -0
- package/lib/ontology/resumeForm.ttl +349 -0
- package/lib/ontology/socialMedia.ttl +433 -0
- package/lib/profile-pane.js +32266 -13247
- package/lib/profile-pane.js.map +1 -1
- package/lib/profile-pane.min.js +2315 -935
- package/lib/profile-pane.min.js.map +1 -1
- package/lib/rdfFormsHelper.d.ts +13 -1
- package/lib/rdfFormsHelper.d.ts.map +1 -1
- package/lib/rdfFormsHelper.js +13 -1
- package/lib/sections/bio/BioEditDialog.d.ts.map +1 -1
- package/lib/sections/bio/BioEditDialog.js +7 -7
- package/lib/sections/bio/BioSection.css +300 -0
- package/lib/sections/bio/BioSection.d.ts +3 -2
- package/lib/sections/bio/BioSection.d.ts.map +1 -1
- package/lib/sections/bio/BioSection.js +26 -19
- package/lib/sections/bio/mutations.d.ts.map +1 -1
- package/lib/sections/bio/mutations.js +14 -3
- package/lib/sections/contactInfo/ContactInfoEditDialog.css +354 -0
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts +3 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoEditDialog.js +183 -98
- package/lib/sections/contactInfo/ContactInfoSection.css +125 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts +2 -0
- package/lib/sections/contactInfo/ContactInfoSection.d.ts.map +1 -1
- package/lib/sections/contactInfo/ContactInfoSection.js +64 -41
- package/lib/sections/contactInfo/mutations.d.ts.map +1 -1
- package/lib/sections/contactInfo/mutations.js +51 -16
- package/lib/sections/education/EducationEditDialog.d.ts +3 -1
- package/lib/sections/education/EducationEditDialog.d.ts.map +1 -1
- package/lib/sections/education/EducationEditDialog.js +170 -92
- package/lib/sections/education/EducationSection.css +133 -0
- package/lib/sections/education/EducationSection.d.ts +3 -2
- package/lib/sections/education/EducationSection.d.ts.map +1 -1
- package/lib/sections/education/EducationSection.js +32 -25
- package/lib/sections/education/mutations.d.ts.map +1 -1
- package/lib/sections/education/mutations.js +14 -3
- package/lib/sections/heading/HeadingEditDialog.d.ts +4 -1
- package/lib/sections/heading/HeadingEditDialog.d.ts.map +1 -1
- package/lib/sections/heading/HeadingEditDialog.js +287 -162
- package/lib/sections/heading/HeadingSection.css +862 -0
- package/lib/sections/heading/HeadingSection.d.ts +3 -2
- package/lib/sections/heading/HeadingSection.d.ts.map +1 -1
- package/lib/sections/heading/HeadingSection.js +63 -32
- package/lib/sections/heading/imageHelpers.d.ts +1 -0
- package/lib/sections/heading/imageHelpers.d.ts.map +1 -1
- package/lib/sections/heading/imageHelpers.js +40 -1
- package/lib/sections/heading/mutations.d.ts.map +1 -1
- package/lib/sections/heading/mutations.js +86 -23
- package/lib/sections/heading/selectors.d.ts.map +1 -1
- package/lib/sections/heading/selectors.js +14 -3
- package/lib/sections/heading/types.d.ts +1 -2
- package/lib/sections/heading/types.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts +3 -1
- package/lib/sections/languages/LanguageEditDialog.d.ts.map +1 -1
- package/lib/sections/languages/LanguageEditDialog.js +202 -119
- package/lib/sections/languages/LanguageSection.css +53 -0
- package/lib/sections/languages/LanguageSection.d.ts +2 -0
- package/lib/sections/languages/LanguageSection.d.ts.map +1 -1
- package/lib/sections/languages/LanguageSection.js +42 -31
- package/lib/sections/languages/mutations.d.ts.map +1 -1
- package/lib/sections/languages/mutations.js +60 -161
- package/lib/sections/languages/selectors.d.ts.map +1 -1
- package/lib/sections/languages/selectors.js +1 -2
- package/lib/sections/projects/ProjectEditDialog.d.ts +2 -1
- package/lib/sections/projects/ProjectEditDialog.d.ts.map +1 -1
- package/lib/sections/projects/ProjectEditDialog.js +13 -24
- package/lib/sections/projects/ProjectSection.css +368 -0
- package/lib/sections/projects/ProjectSection.d.ts +2 -1
- package/lib/sections/projects/ProjectSection.d.ts.map +1 -1
- package/lib/sections/projects/ProjectSection.js +116 -34
- package/lib/sections/projects/mutations.d.ts.map +1 -1
- package/lib/sections/projects/mutations.js +109 -132
- package/lib/sections/projects/selectors.d.ts.map +1 -1
- package/lib/sections/projects/selectors.js +4 -45
- package/lib/{QRCodeCard.d.ts → sections/qrcode/QRCodeCard.d.ts} +2 -1
- package/lib/sections/qrcode/QRCodeCard.d.ts.map +1 -0
- package/lib/{QRCodeCard.js → sections/qrcode/QRCodeCard.js} +59 -11
- package/lib/sections/qrcode/QRCodeSection.css +108 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts +4 -0
- package/lib/sections/qrcode/QRCodeSection.d.ts.map +1 -0
- package/lib/sections/qrcode/QRCodeSection.js +17 -0
- package/lib/sections/resume/ResumeEditDialog.d.ts +10 -1
- package/lib/sections/resume/ResumeEditDialog.d.ts.map +1 -1
- package/lib/sections/resume/ResumeEditDialog.js +531 -149
- package/lib/sections/resume/ResumeSection.css +350 -0
- package/lib/sections/resume/ResumeSection.d.ts +3 -2
- package/lib/sections/resume/ResumeSection.d.ts.map +1 -1
- package/lib/sections/resume/ResumeSection.js +78 -49
- package/lib/sections/resume/mutations.d.ts.map +1 -1
- package/lib/sections/resume/mutations.js +17 -3
- package/lib/sections/resume/selectors.d.ts.map +1 -1
- package/lib/sections/resume/selectors.js +1 -0
- package/lib/sections/resume/types.d.ts +1 -0
- package/lib/sections/resume/types.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.d.ts.map +1 -1
- package/lib/sections/shared/collapsibleSection.js +1 -0
- package/lib/sections/shared/phoneCountries.d.ts +1 -1
- package/lib/sections/shared/phoneCountries.d.ts.map +1 -1
- package/lib/sections/shared/phoneCountries.js +2 -2
- package/lib/sections/shared/projectCommunityNodes.d.ts +6 -0
- package/lib/sections/shared/projectCommunityNodes.d.ts.map +1 -0
- package/lib/sections/shared/projectCommunityNodes.js +56 -0
- package/lib/sections/shared/rdfMutationHelpers.d.ts +35 -2
- package/lib/sections/shared/rdfMutationHelpers.d.ts.map +1 -1
- package/lib/sections/shared/rdfMutationHelpers.js +290 -14
- package/lib/sections/shared/sectionCardHelpers.d.ts.map +1 -1
- package/lib/sections/shared/sectionCardHelpers.js +80 -11
- package/lib/sections/shared/types.d.ts +24 -0
- package/lib/sections/shared/types.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts +3 -1
- package/lib/sections/skills/SkillsEditDialog.d.ts.map +1 -1
- package/lib/sections/skills/SkillsEditDialog.js +136 -115
- package/lib/sections/skills/SkillsSection.css +173 -0
- package/lib/sections/skills/SkillsSection.d.ts +2 -0
- package/lib/sections/skills/SkillsSection.d.ts.map +1 -1
- package/lib/sections/skills/SkillsSection.js +107 -47
- package/lib/sections/skills/mutations.d.ts.map +1 -1
- package/lib/sections/skills/mutations.js +25 -21
- package/lib/sections/skills/selectors.d.ts.map +1 -1
- package/lib/sections/skills/selectors.js +5 -3
- package/lib/sections/social/SocialEditDialog.d.ts +3 -1
- package/lib/sections/social/SocialEditDialog.d.ts.map +1 -1
- package/lib/sections/social/SocialEditDialog.js +170 -62
- package/lib/sections/social/SocialSection.css +194 -0
- package/lib/sections/social/SocialSection.d.ts +4 -3
- package/lib/sections/social/SocialSection.d.ts.map +1 -1
- package/lib/sections/social/SocialSection.js +59 -43
- package/lib/sections/social/mutations.d.ts.map +1 -1
- package/lib/sections/social/mutations.js +23 -132
- package/lib/specialButtons/AddMeToYourFriends.css +54 -0
- package/lib/specialButtons/addContact/AddMeToYourContacts.css +1118 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts +10 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.d.ts.map +1 -0
- package/lib/specialButtons/addContact/ContactCreationDialog.js +1123 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts +16 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.d.ts.map +1 -0
- package/lib/specialButtons/addContact/addMeToYourContacts.js +136 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts +8 -0
- package/lib/specialButtons/addContact/contactsErrors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsErrors.js +106 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts +43 -0
- package/lib/specialButtons/addContact/contactsTypes.d.ts.map +1 -0
- package/lib/specialButtons/addContact/contactsTypes.js +5 -0
- package/lib/specialButtons/addContact/helpers.d.ts +7 -0
- package/lib/specialButtons/addContact/helpers.d.ts.map +1 -0
- package/lib/specialButtons/addContact/helpers.js +103 -0
- package/lib/specialButtons/addContact/mutations.d.ts +16 -0
- package/lib/specialButtons/addContact/mutations.d.ts.map +1 -0
- package/lib/specialButtons/addContact/mutations.js +300 -0
- package/lib/specialButtons/addContact/selectors.d.ts +10 -0
- package/lib/specialButtons/addContact/selectors.d.ts.map +1 -0
- package/lib/specialButtons/addContact/selectors.js +163 -0
- package/lib/{addMeToYourFriends.d.ts → specialButtons/addMeToYourFriends.d.ts} +6 -4
- package/lib/specialButtons/addMeToYourFriends.d.ts.map +1 -0
- package/lib/{addMeToYourFriends.js → specialButtons/addMeToYourFriends.js} +46 -11
- package/lib/styles/CollapsibleSection.css +519 -0
- package/lib/styles/EditDialogs.css +506 -686
- package/lib/styles/EditDialogs.responsive.css +989 -0
- package/lib/texts/buttonTexts.d.ts +9 -0
- package/lib/texts/buttonTexts.d.ts.map +1 -0
- package/lib/texts/buttonTexts.js +14 -0
- package/lib/texts/dialogTexts.d.ts +14 -0
- package/lib/texts/dialogTexts.d.ts.map +1 -0
- package/lib/texts/dialogTexts.js +19 -0
- package/lib/texts/messageTexts.d.ts +42 -0
- package/lib/texts/messageTexts.d.ts.map +1 -0
- package/lib/texts/messageTexts.js +47 -0
- package/lib/texts/profileTexts.d.ts +14 -0
- package/lib/texts/profileTexts.d.ts.map +1 -0
- package/lib/texts/profileTexts.js +19 -0
- package/lib/texts/qrCodeTexts.d.ts +2 -0
- package/lib/texts/qrCodeTexts.d.ts.map +1 -0
- package/lib/texts/qrCodeTexts.js +7 -0
- package/lib/texts.d.ts +5 -60
- package/lib/texts.d.ts.map +1 -1
- package/lib/texts.js +55 -70
- package/lib/ui/dialog.css +233 -0
- package/lib/ui/dialog.d.ts +15 -1
- package/lib/ui/dialog.d.ts.map +1 -1
- package/lib/ui/dialog.js +245 -45
- package/lib/ui/dialog.responsive.css +195 -0
- package/lib/ui/errors.d.ts.map +1 -1
- package/lib/ui/errors.js +2 -1
- package/lib/ui/spinner.d.ts +3 -0
- package/lib/ui/spinner.d.ts.map +1 -0
- package/lib/ui/spinner.js +13 -0
- package/lib/utils/debug.d.ts +5 -0
- package/lib/utils/debug.d.ts.map +1 -0
- package/lib/utils/debug.js +23 -0
- package/lib/utils/errorDisplay.d.ts +2 -0
- package/lib/utils/errorDisplay.d.ts.map +1 -0
- package/lib/utils/errorDisplay.js +19 -0
- package/package.json +32 -25
- package/lib/ChatWithMe.d.ts +0 -7
- package/lib/ChatWithMe.d.ts.map +0 -1
- package/lib/ChatWithMe.js +0 -90
- package/lib/QRCodeCard.d.ts.map +0 -1
- package/lib/addMeToYourFriends.d.ts.map +0 -1
- package/lib/sections/heading/camera.d.ts +0 -19
- package/lib/sections/heading/camera.d.ts.map +0 -1
- package/lib/sections/heading/camera.js +0 -199
- package/lib/styles/BioSection.css +0 -77
- package/lib/styles/CVCard.css +0 -142
- package/lib/styles/ChatWithMe.css +0 -6
- package/lib/styles/ContactInfoEditDialog.css +0 -153
- package/lib/styles/EducationCard.css +0 -103
- package/lib/styles/HeadingSection.css +0 -309
- package/lib/styles/ProfileCard.css +0 -66
- package/lib/styles/ProfileView.css +0 -65
- package/lib/styles/ProjectsCard.css +0 -206
- package/lib/styles/QRCodeCard.css +0 -43
- package/lib/styles/SocialCard.css +0 -89
- package/lib/styles/dialog.css +0 -209
- package/lib/styles/utilities.css +0 -740
|
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createContactInfoEditDialog = createContactInfoEditDialog;
|
|
7
7
|
var _dialog = require("../../ui/dialog");
|
|
8
8
|
var _litHtml = require("lit-html");
|
|
9
|
+
require("solid-ui/components/actions/button");
|
|
10
|
+
require("solid-ui/components/forms/select");
|
|
9
11
|
require("../../styles/EditDialogs.css");
|
|
10
|
-
require("
|
|
12
|
+
require("./ContactInfoEditDialog.css");
|
|
11
13
|
var _mutations = require("./mutations");
|
|
12
14
|
var _phoneCountries = require("../shared/phoneCountries");
|
|
13
15
|
var _contactTypeUtils = require("../shared/contactTypeUtils");
|
|
@@ -24,6 +26,58 @@ var _contactIcons = require("../../icons-svg/contactIcons");
|
|
|
24
26
|
the phone numbers?
|
|
25
27
|
3. can you write functions to sanitize the input values for emails, phones, and addresses? */
|
|
26
28
|
|
|
29
|
+
const PHONE_TYPE_OPTIONS = [{
|
|
30
|
+
label: 'Mobile',
|
|
31
|
+
value: 'Cell'
|
|
32
|
+
}, {
|
|
33
|
+
label: 'Home',
|
|
34
|
+
value: 'Home'
|
|
35
|
+
}, {
|
|
36
|
+
label: 'Work',
|
|
37
|
+
value: 'Work'
|
|
38
|
+
}];
|
|
39
|
+
const EMAIL_TYPE_OPTIONS = [{
|
|
40
|
+
label: 'Personal',
|
|
41
|
+
value: 'Home'
|
|
42
|
+
}, {
|
|
43
|
+
label: 'Office',
|
|
44
|
+
value: 'Office'
|
|
45
|
+
}];
|
|
46
|
+
function normalizeContactTypeValue(value, options) {
|
|
47
|
+
return options.some(option => option.value === value) ? value : options[0]?.value || '';
|
|
48
|
+
}
|
|
49
|
+
function readContactTypeChange(event) {
|
|
50
|
+
const customEvent = event;
|
|
51
|
+
if (typeof customEvent.detail?.value === 'string') {
|
|
52
|
+
return customEvent.detail.value;
|
|
53
|
+
}
|
|
54
|
+
const target = event.target;
|
|
55
|
+
return typeof target?.value === 'string' ? target.value : '';
|
|
56
|
+
}
|
|
57
|
+
function getContactTypeOptions(kind) {
|
|
58
|
+
return kind === 'phone' ? PHONE_TYPE_OPTIONS : EMAIL_TYPE_OPTIONS;
|
|
59
|
+
}
|
|
60
|
+
function getContactTypeValue(kind, formState, rowIndex) {
|
|
61
|
+
const row = kind === 'phone' ? formState.phones[rowIndex] : formState.emails[rowIndex];
|
|
62
|
+
return normalizeContactTypeValue(row?.type || '', getContactTypeOptions(kind));
|
|
63
|
+
}
|
|
64
|
+
function withDefaultContactType(row, kind) {
|
|
65
|
+
return {
|
|
66
|
+
...row,
|
|
67
|
+
type: normalizeContactTypeValue(row.type || '', getContactTypeOptions(kind))
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function initializeContactTypeSelects(form, formState) {
|
|
71
|
+
const selectElements = form.querySelectorAll('solid-ui-select[data-contact-type-kind]');
|
|
72
|
+
selectElements.forEach(selectElement => {
|
|
73
|
+
const kind = selectElement.dataset.contactTypeKind;
|
|
74
|
+
const rowIndex = Number(selectElement.dataset.rowIndex);
|
|
75
|
+
if (!kind || Number.isNaN(rowIndex)) return;
|
|
76
|
+
selectElement.options = getContactTypeOptions(kind);
|
|
77
|
+
selectElement.value = getContactTypeValue(kind, formState, rowIndex);
|
|
78
|
+
selectElement.label = '';
|
|
79
|
+
});
|
|
80
|
+
}
|
|
27
81
|
function isContactPointRow(row) {
|
|
28
82
|
return 'value' in row;
|
|
29
83
|
}
|
|
@@ -36,13 +90,13 @@ function rowHasContent(row) {
|
|
|
36
90
|
function toFormState(contactInfo) {
|
|
37
91
|
const emails = (contactInfo.emails || []).map(email => ({
|
|
38
92
|
value: (0, _sanitizeUtils.sanitizeEmailValue)((0, _textUtils.toText)(email.valueNode).replace(/^mailto:/i, '')),
|
|
39
|
-
type: (0, _contactTypeUtils.normalizeEmailTypeForContactInfoEdit)(email.type),
|
|
93
|
+
type: normalizeContactTypeValue((0, _contactTypeUtils.normalizeEmailTypeForContactInfoEdit)(email.type), EMAIL_TYPE_OPTIONS),
|
|
40
94
|
entryNode: (0, _textUtils.toText)(email.entryNode),
|
|
41
95
|
status: (0, _textUtils.toText)(email.entryNode) ? 'existing' : 'new'
|
|
42
96
|
})).filter(email => Boolean(email.value || email.entryNode || email.type));
|
|
43
97
|
const phones = (contactInfo.phones || []).map(phone => ({
|
|
44
98
|
value: (0, _textUtils.sanitizeTextValue)((0, _textUtils.toText)(phone.valueNode).replace(/^tel:/i, '')),
|
|
45
|
-
type: (0, _contactTypeUtils.normalizePhoneTypeForContactInfoEdit)(phone.type),
|
|
99
|
+
type: normalizeContactTypeValue((0, _contactTypeUtils.normalizePhoneTypeForContactInfoEdit)(phone.type), PHONE_TYPE_OPTIONS),
|
|
46
100
|
entryNode: (0, _textUtils.toText)(phone.entryNode),
|
|
47
101
|
status: 'existing'
|
|
48
102
|
})).filter(phone => Boolean(phone.value));
|
|
@@ -59,13 +113,13 @@ function toFormState(contactInfo) {
|
|
|
59
113
|
return {
|
|
60
114
|
emails: emails.length ? emails : [{
|
|
61
115
|
value: '',
|
|
62
|
-
type:
|
|
116
|
+
type: EMAIL_TYPE_OPTIONS[0].value,
|
|
63
117
|
entryNode: '',
|
|
64
118
|
status: 'new'
|
|
65
119
|
}],
|
|
66
120
|
phones: phones.length ? phones : [{
|
|
67
121
|
value: '',
|
|
68
|
-
type:
|
|
122
|
+
type: PHONE_TYPE_OPTIONS[0].value,
|
|
69
123
|
entryNode: '',
|
|
70
124
|
status: 'new'
|
|
71
125
|
}],
|
|
@@ -81,26 +135,6 @@ function toFormState(contactInfo) {
|
|
|
81
135
|
}]
|
|
82
136
|
};
|
|
83
137
|
}
|
|
84
|
-
/* not needed for now
|
|
85
|
-
function renderCountryPrefixSelect(
|
|
86
|
-
name: string,
|
|
87
|
-
value: string,
|
|
88
|
-
label: string,
|
|
89
|
-
onChange: (event: Event) => void
|
|
90
|
-
) {
|
|
91
|
-
return html`
|
|
92
|
-
<label class="label profile-edit-dialog__phone-prefix-field" aria-label=${label}>
|
|
93
|
-
<select class="phonePrefixSelect" name=${name} .value=${value} @change=${onChange}>
|
|
94
|
-
${COUNTRY_PREFIX_OPTIONS.map((option) => html`
|
|
95
|
-
<option value=${option.dialCode}>
|
|
96
|
-
${countryCodeToFlag(option.iso2)} ${option.dialCode}
|
|
97
|
-
</option>
|
|
98
|
-
`)}
|
|
99
|
-
</select>
|
|
100
|
-
</label>
|
|
101
|
-
`
|
|
102
|
-
} */
|
|
103
|
-
|
|
104
138
|
function renderContactPhoneInputRow({
|
|
105
139
|
phones,
|
|
106
140
|
index,
|
|
@@ -109,11 +143,8 @@ function renderContactPhoneInputRow({
|
|
|
109
143
|
}) {
|
|
110
144
|
const phoneRow = phones[index];
|
|
111
145
|
const label = `Phone Number ${displayIndex + 1}`;
|
|
112
|
-
// const countryCodeLabel = `Country Calling Code ${displayIndex + 1}`
|
|
113
146
|
const typeLabel = `Phone Type ${displayIndex + 1}`;
|
|
114
|
-
// const prefixInputName = `phone-prefix-${index}`
|
|
115
147
|
const inputName = `phone-value-${index}`;
|
|
116
|
-
const typeInputName = `phone-type-${index}`;
|
|
117
148
|
const splitValue = (0, _phoneCountries.splitPhoneValue)(phoneRow?.value || '');
|
|
118
149
|
let selectedDialCode = splitValue.dialCode;
|
|
119
150
|
const handleValueInput = e => {
|
|
@@ -123,20 +154,8 @@ function renderContactPhoneInputRow({
|
|
|
123
154
|
(0, _rowState.applyRowFieldChange)(phones[index], 'value', (0, _phoneCountries.combinePhoneValue)(selectedDialCode, nextValue), rowHasContent);
|
|
124
155
|
}
|
|
125
156
|
};
|
|
126
|
-
/* Not needed for now
|
|
127
|
-
const handleCountryCodeInput = (e: Event) => {
|
|
128
|
-
const target = e.target as HTMLSelectElement
|
|
129
|
-
selectedDialCode = target.value
|
|
130
|
-
|
|
131
|
-
if (phones[index]) {
|
|
132
|
-
const localNumber = splitPhoneValue(phones[index].value).localNumber
|
|
133
|
-
applyRowFieldChange(phones[index], 'value', combinePhoneValue(selectedDialCode, localNumber), rowHasContent)
|
|
134
|
-
}
|
|
135
|
-
} */
|
|
136
|
-
|
|
137
157
|
const handleTypeInput = e => {
|
|
138
|
-
const
|
|
139
|
-
const nextType = target.value;
|
|
158
|
+
const nextType = readContactTypeChange(e);
|
|
140
159
|
if (phones[index]) {
|
|
141
160
|
(0, _rowState.applyRowSelectChange)(phones[index], 'type', nextType);
|
|
142
161
|
}
|
|
@@ -158,7 +177,7 @@ function renderContactPhoneInputRow({
|
|
|
158
177
|
data-contact-field="value"
|
|
159
178
|
data-entry-node=${phoneRow?.entryNode || ''}
|
|
160
179
|
data-row-status=${phoneRow?.status || 'n/a'}
|
|
161
|
-
placeholder
|
|
180
|
+
placeholder=${label}
|
|
162
181
|
autocomplete="tel-national"
|
|
163
182
|
inputmode="tel"
|
|
164
183
|
@input=${handleValueInput}
|
|
@@ -166,22 +185,30 @@ function renderContactPhoneInputRow({
|
|
|
166
185
|
</label>
|
|
167
186
|
</div>
|
|
168
187
|
<label aria-label=${typeLabel} class="label profile-edit-dialog__field-type profile-edit-dialog__phone-type-row">
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
188
|
+
<solid-ui-select
|
|
189
|
+
class="profile-edit-dialog__type-select"
|
|
190
|
+
id=${`phone-type-select-${inputName}`}
|
|
191
|
+
data-contact-type-kind="phone"
|
|
192
|
+
data-row-index=${String(index)}
|
|
193
|
+
aria-label=${typeLabel}
|
|
194
|
+
.label=${''}
|
|
195
|
+
.options=${PHONE_TYPE_OPTIONS}
|
|
196
|
+
.value=${normalizeContactTypeValue(phoneRow?.type || '', PHONE_TYPE_OPTIONS)}
|
|
197
|
+
@change=${handleTypeInput}
|
|
198
|
+
></solid-ui-select>
|
|
174
199
|
</label>
|
|
175
200
|
<div class="profile-edit-dialog__actions">
|
|
176
|
-
<button
|
|
201
|
+
<solid-ui-button
|
|
177
202
|
type="button"
|
|
203
|
+
variant="icon"
|
|
204
|
+
size="md"
|
|
178
205
|
class="profile-edit-dialog__delete-button"
|
|
179
206
|
aria-label=${`Delete phone number ${displayIndex + 1}`}
|
|
180
207
|
title=${_texts.deleteEntryButtonTitleText}
|
|
181
208
|
@click=${handleDelete}
|
|
182
209
|
>
|
|
183
|
-
<span class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
184
|
-
</button>
|
|
210
|
+
<span slot="icon" class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
211
|
+
</solid-ui-button>
|
|
185
212
|
</div>
|
|
186
213
|
</div>
|
|
187
214
|
`;
|
|
@@ -191,7 +218,7 @@ function renderContactInfoPhoneSection(phones, onAddRow) {
|
|
|
191
218
|
event.preventDefault();
|
|
192
219
|
phones.unshift({
|
|
193
220
|
value: '',
|
|
194
|
-
type:
|
|
221
|
+
type: PHONE_TYPE_OPTIONS[0].value,
|
|
195
222
|
entryNode: '',
|
|
196
223
|
status: 'new'
|
|
197
224
|
});
|
|
@@ -209,22 +236,24 @@ function renderContactInfoPhoneSection(phones, onAddRow) {
|
|
|
209
236
|
<section
|
|
210
237
|
aria-labelledby="phone-numbers-heading"
|
|
211
238
|
class="profile-edit-dialog__section">
|
|
212
|
-
<header class="profile__section-header">
|
|
239
|
+
<header class="profile__section-header profile-edit-dialog__contact-section-header">
|
|
213
240
|
<h3 id="phone-numbers-heading" class="profile-edit-dialog__section-heading">
|
|
214
|
-
<span class="
|
|
241
|
+
<span class="profile-edit-dialog__section-title-icon" aria-hidden="true">${_contactIcons.phoneIcon}</span>
|
|
215
242
|
Phone Numbers
|
|
216
243
|
</h3>
|
|
217
|
-
<button
|
|
244
|
+
<solid-ui-button
|
|
218
245
|
type="button"
|
|
219
|
-
|
|
246
|
+
variant="secondary"
|
|
247
|
+
size="sm"
|
|
248
|
+
class="profile__action-button profile-action-text profile-edit-dialog__add-button"
|
|
220
249
|
aria-label="Add another phone number"
|
|
221
250
|
@click=${createNewRow}
|
|
222
251
|
>
|
|
223
|
-
<span class="profile__add-more-content
|
|
224
|
-
<span class="profile__add-more-icon
|
|
225
|
-
Add More
|
|
252
|
+
<span class="profile__add-more-content">
|
|
253
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
254
|
+
<span>Add More</span>
|
|
226
255
|
</span>
|
|
227
|
-
</button>
|
|
256
|
+
</solid-ui-button>
|
|
228
257
|
</header>
|
|
229
258
|
<fieldset>
|
|
230
259
|
<legend class="sr-only">Phone number entries</legend>
|
|
@@ -253,7 +282,6 @@ function renderContactEmailInputRow({
|
|
|
253
282
|
const label = `Email Address ${displayIndex + 1}`;
|
|
254
283
|
const typeLabel = `Email Type ${displayIndex + 1}`;
|
|
255
284
|
const inputName = `email-value-${index}`;
|
|
256
|
-
const typeInputName = `email-type-${index}`;
|
|
257
285
|
const handleValueInput = e => {
|
|
258
286
|
const target = e.target;
|
|
259
287
|
const nextValue = (0, _sanitizeUtils.sanitizeEmailValue)(target.value);
|
|
@@ -262,8 +290,7 @@ function renderContactEmailInputRow({
|
|
|
262
290
|
}
|
|
263
291
|
};
|
|
264
292
|
const handleTypeInput = e => {
|
|
265
|
-
const
|
|
266
|
-
const nextType = target.value;
|
|
293
|
+
const nextType = readContactTypeChange(e);
|
|
267
294
|
if (emails[index]) {
|
|
268
295
|
(0, _rowState.applyRowSelectChange)(emails[index], 'type', nextType);
|
|
269
296
|
}
|
|
@@ -291,21 +318,30 @@ function renderContactEmailInputRow({
|
|
|
291
318
|
/>
|
|
292
319
|
</label>
|
|
293
320
|
<label aria-label=${typeLabel} class="label profile-edit-dialog__field-type emailTypeRow">
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
321
|
+
<solid-ui-select
|
|
322
|
+
class="profile-edit-dialog__type-select"
|
|
323
|
+
id=${`email-type-select-${inputName}`}
|
|
324
|
+
data-contact-type-kind="email"
|
|
325
|
+
data-row-index=${String(index)}
|
|
326
|
+
aria-label=${typeLabel}
|
|
327
|
+
.label=${''}
|
|
328
|
+
.options=${EMAIL_TYPE_OPTIONS}
|
|
329
|
+
.value=${normalizeContactTypeValue(emailRow?.type || '', EMAIL_TYPE_OPTIONS)}
|
|
330
|
+
@change=${handleTypeInput}
|
|
331
|
+
></solid-ui-select>
|
|
298
332
|
</label>
|
|
299
333
|
<div class="profile-edit-dialog__actions">
|
|
300
|
-
<button
|
|
334
|
+
<solid-ui-button
|
|
301
335
|
type="button"
|
|
336
|
+
variant="icon"
|
|
337
|
+
size="md"
|
|
302
338
|
class="profile-edit-dialog__delete-button"
|
|
303
339
|
aria-label=${`Delete email address ${displayIndex + 1}`}
|
|
304
340
|
title=${_texts.deleteEntryButtonTitleText}
|
|
305
341
|
@click=${handleDelete}
|
|
306
342
|
>
|
|
307
|
-
<span class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
308
|
-
</button>
|
|
343
|
+
<span slot="icon" class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
344
|
+
</solid-ui-button>
|
|
309
345
|
</div>
|
|
310
346
|
</div>
|
|
311
347
|
`;
|
|
@@ -315,7 +351,7 @@ function renderContactInfoEmailSection(emails, onAddRow) {
|
|
|
315
351
|
event.preventDefault();
|
|
316
352
|
emails.unshift({
|
|
317
353
|
value: '',
|
|
318
|
-
type:
|
|
354
|
+
type: EMAIL_TYPE_OPTIONS[0].value,
|
|
319
355
|
entryNode: '',
|
|
320
356
|
status: 'new'
|
|
321
357
|
});
|
|
@@ -333,22 +369,24 @@ function renderContactInfoEmailSection(emails, onAddRow) {
|
|
|
333
369
|
<section
|
|
334
370
|
aria-labelledby="email-addresses-heading"
|
|
335
371
|
class="profile-edit-dialog__section">
|
|
336
|
-
<header class="profile__section-header">
|
|
372
|
+
<header class="profile__section-header profile-edit-dialog__contact-section-header">
|
|
337
373
|
<h3 id="email-addresses-heading" class="profile-edit-dialog__section-heading">
|
|
338
|
-
<span class="
|
|
374
|
+
<span class="profile-edit-dialog__section-title-icon" aria-hidden="true">${_contactIcons.emailIcon}</span>
|
|
339
375
|
Email Addresses
|
|
340
376
|
</h3>
|
|
341
|
-
<button
|
|
377
|
+
<solid-ui-button
|
|
342
378
|
type="button"
|
|
343
|
-
|
|
379
|
+
variant="secondary"
|
|
380
|
+
size="sm"
|
|
381
|
+
class="profile__action-button profile-action-text profile-edit-dialog__add-button"
|
|
344
382
|
aria-label="Add another email address"
|
|
345
383
|
@click=${createNewRow}
|
|
346
384
|
>
|
|
347
|
-
<span class="profile__add-more-content
|
|
348
|
-
<span class="profile__add-more-icon
|
|
349
|
-
Add More
|
|
385
|
+
<span class="profile__add-more-content">
|
|
386
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
387
|
+
<span>Add More</span>
|
|
350
388
|
</span>
|
|
351
|
-
</button>
|
|
389
|
+
</solid-ui-button>
|
|
352
390
|
</header>
|
|
353
391
|
<fieldset>
|
|
354
392
|
<legend class="sr-only">Email address entries</legend>
|
|
@@ -412,15 +450,17 @@ function renderContactAddressInputRow({
|
|
|
412
450
|
</select>
|
|
413
451
|
</label>
|
|
414
452
|
<div class="profile-edit-dialog__actions profile-edit-dialog__actions--edge">
|
|
415
|
-
<button
|
|
453
|
+
<solid-ui-button
|
|
416
454
|
type="button"
|
|
455
|
+
variant="icon"
|
|
456
|
+
size="md"
|
|
417
457
|
class="profile-edit-dialog__delete-button"
|
|
418
458
|
aria-label=${`Delete address ${displayIndex + 1}`}
|
|
419
459
|
title=${_texts.deleteEntryButtonTitleText}
|
|
420
460
|
@click=${handleDelete}
|
|
421
461
|
>
|
|
422
|
-
<span class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
423
|
-
</button>
|
|
462
|
+
<span slot="icon" class="profile-edit-dialog__delete-icon" aria-hidden="true">${_profileIcons.trashIcon}</span>
|
|
463
|
+
</solid-ui-button>
|
|
424
464
|
</div>
|
|
425
465
|
</div>
|
|
426
466
|
<div class="profile-edit-dialog__row profile-edit-dialog__row--full">
|
|
@@ -540,22 +580,24 @@ function renderContactInfoAddressSection(addresses, onAddRow) {
|
|
|
540
580
|
<section
|
|
541
581
|
aria-labelledby="address-heading"
|
|
542
582
|
class="profile-edit-dialog__section">
|
|
543
|
-
<header class="profile__section-header">
|
|
583
|
+
<header class="profile__section-header profile-edit-dialog__contact-section-header">
|
|
544
584
|
<h3 id="address-heading" class="profile-edit-dialog__section-heading">
|
|
545
|
-
<span class="
|
|
585
|
+
<span class="profile-edit-dialog__section-title-icon" aria-hidden="true">${_profileIcons.locationIcon}</span>
|
|
546
586
|
Addresses
|
|
547
587
|
</h3>
|
|
548
|
-
<button
|
|
588
|
+
<solid-ui-button
|
|
549
589
|
type="button"
|
|
550
|
-
|
|
590
|
+
variant="secondary"
|
|
591
|
+
size="sm"
|
|
592
|
+
class="profile__action-button profile-action-text profile-edit-dialog__add-button"
|
|
551
593
|
aria-label="Add another address"
|
|
552
594
|
@click=${createNewRow}
|
|
553
595
|
>
|
|
554
|
-
<span class="profile__add-more-content
|
|
555
|
-
<span class="profile__add-more-icon
|
|
556
|
-
Add More
|
|
596
|
+
<span class="profile__add-more-content">
|
|
597
|
+
<span class="profile__add-more-icon" aria-hidden="true">${_profileIcons.addIcon}</span>
|
|
598
|
+
<span>Add More</span>
|
|
557
599
|
</span>
|
|
558
|
-
</button>
|
|
600
|
+
</solid-ui-button>
|
|
559
601
|
</header>
|
|
560
602
|
<fieldset>
|
|
561
603
|
<legend class="sr-only">Address entries</legend>
|
|
@@ -577,6 +619,15 @@ function renderContactInfoAddressSection(addresses, onAddRow) {
|
|
|
577
619
|
function focusContactInfoField(form, selector) {
|
|
578
620
|
const nextField = form.querySelector(selector);
|
|
579
621
|
if (!nextField || typeof nextField.focus !== 'function') return;
|
|
622
|
+
const view = form.ownerDocument.defaultView;
|
|
623
|
+
const shouldAvoidFocus = Boolean(view?.matchMedia && (view.matchMedia('(pointer: coarse)').matches || view.matchMedia('(max-width: 640px)').matches));
|
|
624
|
+
if (shouldAvoidFocus) {
|
|
625
|
+
nextField.scrollIntoView({
|
|
626
|
+
block: 'nearest',
|
|
627
|
+
behavior: 'auto'
|
|
628
|
+
});
|
|
629
|
+
return;
|
|
630
|
+
}
|
|
580
631
|
nextField.scrollIntoView({
|
|
581
632
|
block: 'nearest',
|
|
582
633
|
behavior: 'auto'
|
|
@@ -594,6 +645,7 @@ function renderContactInfoEditTemplate(form, formState, viewerMode, options = {}
|
|
|
594
645
|
${renderContactInfoAddressSection(formState.addresses, rerender)}
|
|
595
646
|
${viewerMode !== 'owner' ? (0, _litHtml.html)`<p class="profile-edit-dialog__login-message">${_texts.ownerLoginRequiredDialogMessageText}</p>` : null}
|
|
596
647
|
`, form);
|
|
648
|
+
initializeContactTypeSelects(form, formState);
|
|
597
649
|
if (options.focusSelector) {
|
|
598
650
|
focusContactInfoField(form, options.focusSelector);
|
|
599
651
|
}
|
|
@@ -609,12 +661,30 @@ function createContactInfoEditForm(contactInfo, viewerMode) {
|
|
|
609
661
|
formState
|
|
610
662
|
};
|
|
611
663
|
}
|
|
664
|
+
function isValidEmailAddress(value) {
|
|
665
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
666
|
+
}
|
|
667
|
+
function isValidPhoneNumber(value) {
|
|
668
|
+
return /^\d+$/.test(value);
|
|
669
|
+
}
|
|
612
670
|
function validateContactInfoBeforeSave(formState) {
|
|
613
|
-
const
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
671
|
+
const visiblePhones = formState.phones.filter(phone => phone.status !== 'deleted');
|
|
672
|
+
for (const [index, phone] of visiblePhones.entries()) {
|
|
673
|
+
if (!rowHasContent(phone)) continue;
|
|
674
|
+
const {
|
|
675
|
+
localNumber
|
|
676
|
+
} = (0, _phoneCountries.splitPhoneValue)(phone.value || '');
|
|
677
|
+
if (!isValidPhoneNumber(localNumber)) {
|
|
678
|
+
return `Phone Number ${index + 1} should contain only numbers.`;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
const visibleEmails = formState.emails.filter(email => email.status !== 'deleted');
|
|
682
|
+
for (const [index, email] of visibleEmails.entries()) {
|
|
683
|
+
if (!rowHasContent(email)) continue;
|
|
684
|
+
if (!isValidEmailAddress(email.value || '')) {
|
|
685
|
+
return `Email address ${index + 1} must be a valid email address.`;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
618
688
|
return null;
|
|
619
689
|
}
|
|
620
690
|
async function createContactInfoEditDialog(event, store, subject, contactInfo, viewerMode, onSaved) {
|
|
@@ -632,6 +702,12 @@ async function createContactInfoEditDialog(event, store, subject, contactInfo, v
|
|
|
632
702
|
},
|
|
633
703
|
submitLabel: _texts.dialogSubmitLabelText,
|
|
634
704
|
cancelLabel: _texts.dialogCancelLabelText,
|
|
705
|
+
shouldCloseWithoutSave: () => {
|
|
706
|
+
const phoneOps = (0, _rowState.summarizeRowOps)(formState.phones, rowHasContent);
|
|
707
|
+
const emailOps = (0, _rowState.summarizeRowOps)(formState.emails, rowHasContent);
|
|
708
|
+
const addressOps = (0, _rowState.summarizeRowOps)(formState.addresses, rowHasContent);
|
|
709
|
+
return phoneOps.create.length === 0 && phoneOps.update.length === 0 && phoneOps.remove.length === 0 && emailOps.create.length === 0 && emailOps.update.length === 0 && emailOps.remove.length === 0 && addressOps.create.length === 0 && addressOps.update.length === 0 && addressOps.remove.length === 0;
|
|
710
|
+
},
|
|
635
711
|
validate: () => {
|
|
636
712
|
if (viewerMode !== 'owner') {
|
|
637
713
|
return _texts.ownerLoginRequiredDialogMessageText;
|
|
@@ -639,16 +715,25 @@ async function createContactInfoEditDialog(event, store, subject, contactInfo, v
|
|
|
639
715
|
return validateContactInfoBeforeSave(formState);
|
|
640
716
|
},
|
|
641
717
|
onSave: async () => {
|
|
718
|
+
const phoneOps = (0, _rowState.summarizeRowOps)(formState.phones, rowHasContent);
|
|
719
|
+
const emailOps = (0, _rowState.summarizeRowOps)(formState.emails, rowHasContent);
|
|
642
720
|
const plan = {
|
|
643
|
-
phoneOps:
|
|
644
|
-
|
|
721
|
+
phoneOps: {
|
|
722
|
+
create: phoneOps.create.map(row => withDefaultContactType(row, 'phone')),
|
|
723
|
+
update: phoneOps.update.map(row => withDefaultContactType(row, 'phone')),
|
|
724
|
+
remove: phoneOps.remove
|
|
725
|
+
},
|
|
726
|
+
emailOps: {
|
|
727
|
+
create: emailOps.create.map(row => withDefaultContactType(row, 'email')),
|
|
728
|
+
update: emailOps.update.map(row => withDefaultContactType(row, 'email')),
|
|
729
|
+
remove: emailOps.remove
|
|
730
|
+
},
|
|
645
731
|
addressOps: (0, _rowState.summarizeRowOps)(formState.addresses, rowHasContent)
|
|
646
732
|
};
|
|
647
733
|
await (0, _mutations.processContactInfoMutations)(store, subject, plan);
|
|
648
734
|
},
|
|
649
735
|
formatSaveError: error => {
|
|
650
|
-
|
|
651
|
-
return `${_texts.saveContactUpdatesFailedPrefixText} ${message}`;
|
|
736
|
+
return error instanceof Error ? error.message : _texts.saveContactUpdatesFailedMessageText;
|
|
652
737
|
}
|
|
653
738
|
});
|
|
654
739
|
if (!result) return;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.profile__section[data-profile-section='contact-info'],
|
|
2
|
+
.profile__section--empty[data-profile-section='contact-info'] {
|
|
3
|
+
--contact-info-icon-padding-inline: 0.575rem;
|
|
4
|
+
--contact-info-icon-size: var(--icon-xxs, 1rem);
|
|
5
|
+
--contact-info-contact-point-value-size: var(--font-size-sm, 0.875rem);
|
|
6
|
+
--contact-info-contact-point-type-size: var(--font-size-xxs, 0.75rem);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* Contact rows */
|
|
10
|
+
.contact-info__icon-wrapper {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: 2.25rem;
|
|
15
|
+
height: 2.25rem;
|
|
16
|
+
padding: 0 var(--contact-info-icon-padding-inline, 0.575rem);
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.contact-info__item {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
gap: var(--spacing-2xs, 0.625rem);
|
|
24
|
+
margin-inline-start: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.contact-info__item-body {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.contact-info__icon {
|
|
33
|
+
width: var(--contact-info-icon-size, var(--icon-xxs, 1rem));
|
|
34
|
+
height: var(--contact-info-icon-size, var(--icon-xxs, 1rem));
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
stroke-width: 1.333px;
|
|
37
|
+
stroke: var(--color-icon-muted, var(--slate-400, #90A1B9));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.contact-info__contact-point-value,
|
|
41
|
+
.contact-info__address {
|
|
42
|
+
color: var(--color-text-strong-secondary, var(--slate-800, #1D293D));
|
|
43
|
+
font-size: var(--contact-info-contact-point-value-size, var(--font-size-sm, 0.875rem));
|
|
44
|
+
font-weight: var(--font-weight-bold, 600);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.contact-info__contact-point-value {
|
|
48
|
+
white-space: normal !important;
|
|
49
|
+
overflow-wrap: anywhere;
|
|
50
|
+
word-break: break-word;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.contact-info__contact-point-type {
|
|
54
|
+
color: var(--color-text-detail, var(--slate-500, #62748E));
|
|
55
|
+
font-size: var(--contact-info-contact-point-type-size, var(--font-size-xxs, 0.75rem));
|
|
56
|
+
font-weight: var(--font-weight-md, 500);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* Lists */
|
|
60
|
+
.contact-info__list {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
width: 100%;
|
|
64
|
+
max-width: 100%;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
list-style: none;
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0 0 var(--spacing-2xs, 0.625rem) 0;
|
|
70
|
+
gap: var(--spacing-2xs, 0.625rem);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.contact-info__list:last-of-type {
|
|
74
|
+
padding-bottom: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.contact-info__list + .contact-info__list {
|
|
78
|
+
margin-top: var(--spacing-2xs, 0.625rem);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Empty state */
|
|
82
|
+
.contact-info__empty-icon {
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.contact-info__empty-icon svg {
|
|
89
|
+
width: var(--icon-md, 2.5rem);
|
|
90
|
+
height: var(--icon-md, 2.5rem);
|
|
91
|
+
display: block;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.contact-info__empty-icon svg path {
|
|
95
|
+
stroke-width: 0.25rem;
|
|
96
|
+
stroke: var(--color-border, #E5E7EB);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.contact-info__empty-message {
|
|
100
|
+
text-align: center;
|
|
101
|
+
font-size: var(--font-size-xs, 0.813rem);
|
|
102
|
+
font-weight: var(--font-weight-normal, 400);
|
|
103
|
+
line-height: var(--line-height-tight, 1.4);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.contact-info__empty-icon-wrapper {
|
|
107
|
+
width: 3rem;
|
|
108
|
+
flex: 1 0 0;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (max-width: 576px) {
|
|
112
|
+
.profile__section[data-profile-section='contact-info'],
|
|
113
|
+
.profile__section--empty[data-profile-section='contact-info'] {
|
|
114
|
+
--contact-info-icon-padding-inline: 0;
|
|
115
|
+
--contact-info-icon-size: 0.8295rem;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@container profile-pane (max-width: 576px) {
|
|
120
|
+
.profile__section[data-profile-section='contact-info'],
|
|
121
|
+
.profile__section--empty[data-profile-section='contact-info'] {
|
|
122
|
+
--contact-info-icon-padding-inline: 0;
|
|
123
|
+
--contact-info-icon-size: 0.8295rem;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import 'solid-ui/components/actions/button';
|
|
1
2
|
import { ViewerMode } from '../../types';
|
|
2
3
|
import { LiveStore, NamedNode } from 'rdflib';
|
|
4
|
+
import './ContactInfoSection.css';
|
|
3
5
|
import { ContactInfo } from './types';
|
|
4
6
|
export declare function renderContactInfoSection(store: LiveStore, subject: NamedNode, contactInfo: ContactInfo, viewerMode: ViewerMode, onSaved?: () => Promise<void> | void): import("lit-html").TemplateResult<1> | "";
|
|
5
7
|
//# sourceMappingURL=ContactInfoSection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactInfoSection.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/ContactInfoSection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"ContactInfoSection.d.ts","sourceRoot":"","sources":["../../../src/sections/contactInfo/ContactInfoSection.ts"],"names":[],"mappings":"AACA,OAAO,oCAAoC,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,0BAA0B,CAAA;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAkSrC,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,SAAS,EAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,6CAoBrC"}
|