@operato/contact 2.0.0-alpha.8 → 2.0.0-alpha.80
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/CHANGELOG.md +75 -0
- package/demo/index.html +14 -4
- package/demo/ox-pfp.html +14 -4
- package/demo/pfp-edit.html +14 -4
- package/demo/pfp-view.html +14 -4
- package/dist/src/ox-contact-edit.d.ts +2 -2
- package/dist/src/ox-contact-edit.js +7 -7
- package/dist/src/ox-contact-edit.js.map +1 -1
- package/dist/src/ox-contact-view.d.ts +1 -1
- package/dist/src/ox-contact-view.js +16 -16
- package/dist/src/ox-contact-view.js.map +1 -1
- package/dist/src/ox-contact.d.ts +1 -1
- package/dist/src/ox-pfp-edit.d.ts +1 -1
- package/dist/src/ox-pfp-edit.js +3 -3
- package/dist/src/ox-pfp-edit.js.map +1 -1
- package/dist/src/ox-pfp-view.d.ts +1 -1
- package/dist/src/ox-pfp.d.ts +2 -2
- package/dist/src/ox-pfp.js +14 -17
- package/dist/src/ox-pfp.js.map +1 -1
- package/dist/stories/ox-contact.stories.d.ts +1 -2
- package/dist/stories/ox-contact.stories.js +14 -3
- package/dist/stories/ox-contact.stories.js.map +1 -1
- package/dist/stories/ox-pfp.stories.d.ts +1 -2
- package/dist/stories/ox-pfp.stories.js +15 -3
- package/dist/stories/ox-pfp.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +16 -17
- package/src/ox-contact-edit.ts +7 -7
- package/src/ox-contact-view.ts +21 -20
- package/src/ox-pfp-edit.ts +3 -3
- package/src/ox-pfp.ts +15 -18
- package/stories/ox-contact.stories.ts +14 -3
- package/stories/ox-pfp.stories.ts +15 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/contact",
|
|
3
3
|
"description": "Webcomponent ox-contact following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "2.0.0-alpha.
|
|
5
|
+
"version": "2.0.0-alpha.80",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"license": "MIT",
|
|
@@ -55,28 +55,27 @@
|
|
|
55
55
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@material/
|
|
59
|
-
"@
|
|
60
|
-
"@operato/
|
|
61
|
-
"
|
|
62
|
-
"lit": "^2.5.0"
|
|
58
|
+
"@material/web": "^1.4.0",
|
|
59
|
+
"@operato/styles": "^2.0.0-alpha.80",
|
|
60
|
+
"@operato/utils": "^2.0.0-alpha.68",
|
|
61
|
+
"lit": "^3.1.2"
|
|
63
62
|
},
|
|
64
63
|
"devDependencies": {
|
|
65
|
-
"@custom-elements-manifest/analyzer": "^0.
|
|
64
|
+
"@custom-elements-manifest/analyzer": "^0.9.2",
|
|
66
65
|
"@hatiolab/prettier-config": "^1.0.0",
|
|
67
|
-
"@open-wc/eslint-config": "^
|
|
66
|
+
"@open-wc/eslint-config": "^12.0.3",
|
|
68
67
|
"@open-wc/testing": "^3.1.6",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
70
|
-
"@typescript-eslint/parser": "^
|
|
68
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
|
69
|
+
"@typescript-eslint/parser": "^7.0.1",
|
|
71
70
|
"@web/dev-server": "^0.3.0",
|
|
72
|
-
"@web/dev-server-storybook": "^0.
|
|
73
|
-
"@web/test-runner": "^0.
|
|
71
|
+
"@web/dev-server-storybook": "^2.0.1",
|
|
72
|
+
"@web/test-runner": "^0.18.0",
|
|
74
73
|
"concurrently": "^8.0.1",
|
|
75
74
|
"eslint": "^8.39.0",
|
|
76
|
-
"eslint-config-prettier": "^
|
|
77
|
-
"husky": "^
|
|
78
|
-
"lint-staged": "^
|
|
79
|
-
"prettier": "^2.
|
|
75
|
+
"eslint-config-prettier": "^9.1.0",
|
|
76
|
+
"husky": "^9.0.11",
|
|
77
|
+
"lint-staged": "^15.2.2",
|
|
78
|
+
"prettier": "^3.2.5",
|
|
80
79
|
"tslib": "^2.3.1",
|
|
81
80
|
"typescript": "^5.0.4"
|
|
82
81
|
},
|
|
@@ -93,5 +92,5 @@
|
|
|
93
92
|
"prettier --write"
|
|
94
93
|
]
|
|
95
94
|
},
|
|
96
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "9405ad5252a157db9c9680256a6cb65f764a890b"
|
|
97
96
|
}
|
package/src/ox-contact-edit.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
2
|
import './ox-pfp.js'
|
|
3
3
|
|
|
4
4
|
import { html, css, LitElement, PropertyValues } from 'lit'
|
|
@@ -16,8 +16,7 @@ export class OxContactEdit extends LitElement {
|
|
|
16
16
|
display: block;
|
|
17
17
|
padding: 25px;
|
|
18
18
|
|
|
19
|
-
--
|
|
20
|
-
--mdc-icon-size: 16px;
|
|
19
|
+
--md-icon-size: 16px;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
:host > div {
|
|
@@ -33,6 +32,7 @@ export class OxContactEdit extends LitElement {
|
|
|
33
32
|
display: flex;
|
|
34
33
|
flex-direction: row;
|
|
35
34
|
gap: 10px;
|
|
35
|
+
align-items: center;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
:host > div > div:hover {
|
|
@@ -139,14 +139,14 @@ export class OxContactEdit extends LitElement {
|
|
|
139
139
|
item =>
|
|
140
140
|
html`<div @change=${(e: Event) => this.onChangeItem(e, item)} .item=${item} item-field>
|
|
141
141
|
${item.value
|
|
142
|
-
? html`<
|
|
143
|
-
icon="cancel"
|
|
142
|
+
? html`<md-icon
|
|
144
143
|
@click=${() => {
|
|
145
144
|
item.value = ''
|
|
146
145
|
this.buildStageContact()
|
|
147
146
|
}}
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
>cancel</md-icon
|
|
148
|
+
>`
|
|
149
|
+
: html`<md-icon></md-icon>`}
|
|
150
150
|
<select .value=${item.label} data-item="label">
|
|
151
151
|
${['home', 'work', 'other', 'mobile'].map(
|
|
152
152
|
option => html` <option value=${option} ?selected=${option === item.label}>${option}</option>`
|
package/src/ox-contact-view.ts
CHANGED
|
@@ -9,7 +9,7 @@ export class OxContactView extends LitElement {
|
|
|
9
9
|
static styles = css`
|
|
10
10
|
:host {
|
|
11
11
|
display: block;
|
|
12
|
-
--
|
|
12
|
+
--md-icon-size: 16px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
:host > div {
|
|
@@ -78,28 +78,28 @@ export class OxContactView extends LitElement {
|
|
|
78
78
|
display: flex;
|
|
79
79
|
flex-direction: column;
|
|
80
80
|
}
|
|
81
|
-
div[data-type='email']
|
|
81
|
+
div[data-type='email'] md-icon::before {
|
|
82
82
|
content: 'mail_outline';
|
|
83
83
|
}
|
|
84
|
-
div[data-type='phone']
|
|
84
|
+
div[data-type='phone'] md-icon::before {
|
|
85
85
|
content: 'phone';
|
|
86
86
|
}
|
|
87
|
-
div[data-type='address']
|
|
87
|
+
div[data-type='address'] md-icon::before {
|
|
88
88
|
content: 'place';
|
|
89
89
|
}
|
|
90
|
-
div[data-type='company']
|
|
90
|
+
div[data-type='company'] md-icon::before {
|
|
91
91
|
content: 'business';
|
|
92
92
|
}
|
|
93
|
-
div[data-type='etc']
|
|
93
|
+
div[data-type='etc'] md-icon::before {
|
|
94
94
|
content: 'feed';
|
|
95
95
|
}
|
|
96
|
-
div[note]
|
|
96
|
+
div[note] md-icon::before {
|
|
97
97
|
content: 'subject';
|
|
98
98
|
}
|
|
99
99
|
:host > div > [name-content] {
|
|
100
100
|
gap: 3px;
|
|
101
101
|
}
|
|
102
|
-
div
|
|
102
|
+
div md-icon {
|
|
103
103
|
position: relative;
|
|
104
104
|
top: 3px;
|
|
105
105
|
margin-right: 3px;
|
|
@@ -149,20 +149,21 @@ export class OxContactView extends LitElement {
|
|
|
149
149
|
.map(type => sorted[type])
|
|
150
150
|
.filter(items => items && items.length > 0)
|
|
151
151
|
.map(
|
|
152
|
-
items =>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
152
|
+
items =>
|
|
153
|
+
html`<div data-type=${items[0].type}>
|
|
154
|
+
<md-icon></md-icon>
|
|
155
|
+
${items[0].type}
|
|
156
|
+
${items.map(
|
|
157
|
+
item =>
|
|
158
|
+
html`<div>
|
|
159
|
+
<label data-item="label"> ${item.label}</label>
|
|
160
|
+
<span data-item="value">${item.value}</span>
|
|
161
|
+
</div>`
|
|
162
|
+
)}
|
|
163
|
+
</div>`
|
|
163
164
|
)}
|
|
164
165
|
<div note>
|
|
165
|
-
<
|
|
166
|
+
<md-icon></md-icon>
|
|
166
167
|
note
|
|
167
168
|
<div>${note || ''}</div>
|
|
168
169
|
</div>
|
package/src/ox-pfp-edit.ts
CHANGED
|
@@ -118,11 +118,11 @@ export class OxPfpEdit extends LitElement {
|
|
|
118
118
|
align-content: center;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
md-icon {
|
|
122
122
|
align-self: center;
|
|
123
123
|
|
|
124
124
|
color: var(--file-uploader-icon-color, black);
|
|
125
|
-
--
|
|
125
|
+
--md-icon-size: var(--file-uploader-icon-size, 20px);
|
|
126
126
|
}
|
|
127
127
|
`
|
|
128
128
|
|
|
@@ -193,7 +193,7 @@ export class OxPfpEdit extends LitElement {
|
|
|
193
193
|
capture="environment"
|
|
194
194
|
@change=${(e: Event) => this.onChangeFile(e)}
|
|
195
195
|
/>
|
|
196
|
-
<
|
|
196
|
+
<md-icon title="select image">image_search</md-icon>
|
|
197
197
|
</label>
|
|
198
198
|
</div>
|
|
199
199
|
|
package/src/ox-pfp.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js'
|
|
2
|
+
|
|
1
3
|
import './ox-pfp-edit.js'
|
|
2
4
|
import './ox-pfp-view.js'
|
|
3
5
|
|
|
4
|
-
import '@material/mwc-icon-button'
|
|
5
|
-
|
|
6
6
|
import { html, css, LitElement } from 'lit'
|
|
7
7
|
import { customElement, property, query, state } from 'lit/decorators.js'
|
|
8
8
|
import { Profile } from './ox-pfp-view.js'
|
|
@@ -14,9 +14,6 @@ export class OxPfp extends LitElement {
|
|
|
14
14
|
:host {
|
|
15
15
|
display: block;
|
|
16
16
|
aspect-ratio: 1 / 1;
|
|
17
|
-
|
|
18
|
-
--mdc-icon-button-size: 20px;
|
|
19
|
-
--mdc-icon-size: 20px;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
ox-pfp-edit,
|
|
@@ -33,32 +30,31 @@ export class OxPfp extends LitElement {
|
|
|
33
30
|
display: flex;
|
|
34
31
|
}
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
md-icon {
|
|
37
34
|
position: absolute;
|
|
38
|
-
font-size: smaller;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
md-icon[icon='fit_screen'] {
|
|
42
38
|
bottom: 0;
|
|
43
39
|
left: 0;
|
|
44
40
|
}
|
|
45
41
|
|
|
46
|
-
|
|
42
|
+
md-icon[icon='save'] {
|
|
47
43
|
bottom: 0;
|
|
48
44
|
right: 0;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
md-icon[icon='edit'] {
|
|
52
48
|
bottom: 0;
|
|
53
49
|
right: 0;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
|
-
|
|
52
|
+
md-icon[icon='cancel'] {
|
|
57
53
|
top: 0;
|
|
58
54
|
right: 0;
|
|
59
55
|
}
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
md-icon[icon='clear'] {
|
|
62
58
|
top: 0;
|
|
63
59
|
right: 16px;
|
|
64
60
|
}
|
|
@@ -74,9 +70,9 @@ export class OxPfp extends LitElement {
|
|
|
74
70
|
render() {
|
|
75
71
|
return this.editMode
|
|
76
72
|
? html`<ox-pfp-edit .profile=${this.profile} name=${this.name || ''}>
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
<
|
|
73
|
+
<md-icon title="fit size" icon="fit_screen" @click=${() => this.edit.fit()}>fit_screen</md-icon>
|
|
74
|
+
<md-icon title="clear" icon="clear" @click=${() => this.edit.clear()}>clear</md-icon>
|
|
75
|
+
<md-icon
|
|
80
76
|
title="save"
|
|
81
77
|
icon="save"
|
|
82
78
|
@click=${() => {
|
|
@@ -88,12 +84,13 @@ export class OxPfp extends LitElement {
|
|
|
88
84
|
})
|
|
89
85
|
)
|
|
90
86
|
}}
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
>save</md-icon
|
|
88
|
+
>
|
|
89
|
+
<md-icon title="cancel" icon="cancel" @click=${() => (this.editMode = false)}>cancel</md-icon>
|
|
93
90
|
</ox-pfp-edit> `
|
|
94
91
|
: html`
|
|
95
92
|
<ox-pfp-view .profile=${this.profile} name=${this.name || ''}>
|
|
96
|
-
<
|
|
93
|
+
<md-icon title="edit" icon="edit" @click=${() => (this.editMode = true)}>edit</md-icon>
|
|
97
94
|
</ox-pfp-view>
|
|
98
95
|
`
|
|
99
96
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import '@material/
|
|
3
|
-
import '@material/mwc-icon-button'
|
|
2
|
+
import '@material/web/icon/icon.js'
|
|
4
3
|
import '../src/ox-contact.js'
|
|
5
4
|
|
|
6
5
|
import { Contact, ContactField } from '../src/ox-contact.js'
|
|
@@ -25,7 +24,19 @@ interface ArgTypes {
|
|
|
25
24
|
|
|
26
25
|
const Template: Story<ArgTypes> = ({ contact }: ArgTypes) => html`
|
|
27
26
|
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
28
|
-
<link
|
|
27
|
+
<link
|
|
28
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
29
|
+
rel="stylesheet"
|
|
30
|
+
/>
|
|
31
|
+
<link
|
|
32
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
33
|
+
rel="stylesheet"
|
|
34
|
+
/>
|
|
35
|
+
<link
|
|
36
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
37
|
+
rel="stylesheet"
|
|
38
|
+
/>
|
|
39
|
+
|
|
29
40
|
<style>
|
|
30
41
|
body {
|
|
31
42
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { html, TemplateResult } from 'lit'
|
|
2
|
-
import '@material/
|
|
3
|
-
import '@material/mwc-icon-button'
|
|
2
|
+
import '@material/web/icon/icon.js'
|
|
4
3
|
import '../src/ox-pfp.js'
|
|
5
4
|
|
|
6
5
|
import { Profile } from '../src/ox-pfp-view.js'
|
|
@@ -27,7 +26,20 @@ interface ArgTypes {
|
|
|
27
26
|
|
|
28
27
|
const Template: Story<ArgTypes> = ({ profile, name }: ArgTypes) => html`
|
|
29
28
|
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
<link
|
|
31
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
32
|
+
rel="stylesheet"
|
|
33
|
+
/>
|
|
34
|
+
<link
|
|
35
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
36
|
+
rel="stylesheet"
|
|
37
|
+
/>
|
|
38
|
+
<link
|
|
39
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
40
|
+
rel="stylesheet"
|
|
41
|
+
/>
|
|
42
|
+
|
|
31
43
|
<style>
|
|
32
44
|
body {
|
|
33
45
|
}
|