@operato/contact 1.13.9 → 2.0.0-alpha.100

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 CHANGED
@@ -3,7 +3,180 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ### [1.13.9](https://github.com/hatiolab/operato/compare/v1.13.8...v1.13.9) (2024-01-17)
6
+ ## [2.0.0-alpha.100](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.99...v2.0.0-alpha.100) (2024-04-21)
7
+
8
+ **Note:** Version bump only for package @operato/contact
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.0.0-alpha.99](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.98...v2.0.0-alpha.99) (2024-04-21)
15
+
16
+ **Note:** Version bump only for package @operato/contact
17
+
18
+
19
+
20
+
21
+
22
+ ## [2.0.0-alpha.98](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.97...v2.0.0-alpha.98) (2024-04-21)
23
+
24
+ **Note:** Version bump only for package @operato/contact
25
+
26
+
27
+
28
+
29
+
30
+ ## [2.0.0-alpha.94](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.93...v2.0.0-alpha.94) (2024-04-20)
31
+
32
+ **Note:** Version bump only for package @operato/contact
33
+
34
+
35
+
36
+
37
+
38
+ ## [2.0.0-alpha.92](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.91...v2.0.0-alpha.92) (2024-04-19)
39
+
40
+ **Note:** Version bump only for package @operato/contact
41
+
42
+
43
+
44
+
45
+
46
+ ## [2.0.0-alpha.90](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.89...v2.0.0-alpha.90) (2024-04-18)
47
+
48
+ **Note:** Version bump only for package @operato/contact
49
+
50
+
51
+
52
+
53
+
54
+ ## [2.0.0-alpha.89](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.88...v2.0.0-alpha.89) (2024-04-18)
55
+
56
+ **Note:** Version bump only for package @operato/contact
57
+
58
+
59
+
60
+
61
+
62
+ ## [2.0.0-alpha.87](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.86...v2.0.0-alpha.87) (2024-04-17)
63
+
64
+ **Note:** Version bump only for package @operato/contact
65
+
66
+
67
+
68
+
69
+
70
+ ## [2.0.0-alpha.85](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.84...v2.0.0-alpha.85) (2024-04-16)
71
+
72
+ **Note:** Version bump only for package @operato/contact
73
+
74
+
75
+
76
+
77
+
78
+ ## [2.0.0-alpha.82](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.81...v2.0.0-alpha.82) (2024-04-15)
79
+
80
+
81
+ ### :bug: Bug Fix
82
+
83
+ * correct import ([a3587dd](https://github.com/hatiolab/operato/commit/a3587dd65903a0acaa7b25aa4ef15b2d85aaf418))
84
+
85
+
86
+
87
+ ## [2.0.0-alpha.81](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.80...v2.0.0-alpha.81) (2024-04-15)
88
+
89
+
90
+ ### :bug: Bug Fix
91
+
92
+ * use button-container styles ([bd91be3](https://github.com/hatiolab/operato/commit/bd91be3eaf5337a0ffe8cfc3b37191b6427ce5f6))
93
+
94
+
95
+
96
+ ## [2.0.0-alpha.80](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.79...v2.0.0-alpha.80) (2024-04-15)
97
+
98
+ **Note:** Version bump only for package @operato/contact
99
+
100
+
101
+
102
+
103
+
104
+ ## [2.0.0-alpha.68](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.67...v2.0.0-alpha.68) (2024-04-13)
105
+
106
+
107
+ ### :bug: Bug Fix
108
+
109
+ * mwc=>md for context ([2bc13f2](https://github.com/hatiolab/operato/commit/2bc13f285f257782f73e5d7b5d1ddd197df85393))
110
+
111
+
112
+
113
+ ## [2.0.0-alpha.62](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.61...v2.0.0-alpha.62) (2024-04-12)
114
+
115
+ **Note:** Version bump only for package @operato/contact
116
+
117
+
118
+
119
+
120
+
121
+ ## [2.0.0-alpha.57](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.56...v2.0.0-alpha.57) (2024-04-07)
122
+
123
+ **Note:** Version bump only for package @operato/contact
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+ **Note:** Version bump only for package @operato/contact
132
+
133
+
134
+
135
+
136
+
137
+ ## [2.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.50...v2.0.0-alpha.51) (2024-03-29)
138
+
139
+
140
+ ### :bug: Bug Fix
141
+
142
+ * upgrade lit ([e661c33](https://github.com/hatiolab/operato/commit/e661c333d2bb97f784b5ac2c0e365714ee5e80ff))
143
+
144
+
145
+
146
+ ## [2.0.0-alpha.47](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.46...v2.0.0-alpha.47) (2024-03-27)
147
+
148
+ **Note:** Version bump only for package @operato/contact
149
+
150
+
151
+
152
+
153
+
154
+ ## [2.0.0-alpha.35](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.34...v2.0.0-alpha.35) (2024-03-13)
155
+
156
+ **Note:** Version bump only for package @operato/contact
157
+
158
+
159
+
160
+
161
+
162
+ ## [2.0.0-alpha.28](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.27...v2.0.0-alpha.28) (2024-02-20)
163
+
164
+
165
+ ### :bug: Bug Fix
166
+
167
+ * upgrade devDependencies for webcomponents ([1489b8b](https://github.com/hatiolab/operato/commit/1489b8b790d9bcee779a070a630697f25c01728f))
168
+
169
+
170
+
171
+ ## [2.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2024-01-20)
172
+
173
+ **Note:** Version bump only for package @operato/contact
174
+
175
+
176
+
177
+
178
+
179
+ ## [2.0.0-alpha.0](https://github.com/hatiolab/operato/compare/v1.13.1...v2.0.0-alpha.0) (2024-01-05)
7
180
 
8
181
  **Note:** Version bump only for package @operato/contact
9
182
 
package/demo/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -8,15 +8,25 @@
8
8
  }
9
9
  </style>
10
10
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
11
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
11
+ <link
12
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
13
+ rel="stylesheet"
14
+ />
15
+ <link
16
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
17
+ rel="stylesheet"
18
+ />
19
+ <link
20
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
21
+ rel="stylesheet"
22
+ />
12
23
  </head>
13
24
  <body>
14
25
  <div id="demo"></div>
15
26
 
16
27
  <script type="module">
17
28
  import { html, render } from 'lit'
18
- import '@material/mwc-icon'
19
- import '@material/mwc-icon-button'
29
+ import '@material/web/icon/icon.js'
20
30
 
21
31
  import '../dist/src/ox-contact.js'
22
32
 
package/demo/ox-pfp.html CHANGED
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -8,7 +8,18 @@
8
8
  }
9
9
  </style>
10
10
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
11
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
11
+ <link
12
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
13
+ rel="stylesheet"
14
+ />
15
+ <link
16
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
17
+ rel="stylesheet"
18
+ />
19
+ <link
20
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
21
+ rel="stylesheet"
22
+ />
12
23
  </head>
13
24
  <body>
14
25
  <div id="demo"></div>
@@ -21,8 +32,7 @@
21
32
 
22
33
  <script type="module">
23
34
  import { html, render } from 'lit'
24
- import '@material/mwc-icon'
25
- import '@material/mwc-icon-button'
35
+ import '@material/web/icon/icon.js'
26
36
 
27
37
  import '../dist/src/ox-pfp.js'
28
38
 
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -8,7 +8,18 @@
8
8
  }
9
9
  </style>
10
10
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
11
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
11
+ <link
12
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
13
+ rel="stylesheet"
14
+ />
15
+ <link
16
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
17
+ rel="stylesheet"
18
+ />
19
+ <link
20
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
21
+ rel="stylesheet"
22
+ />
12
23
  </head>
13
24
  <body>
14
25
  <div id="demo"></div>
@@ -26,8 +37,7 @@
26
37
 
27
38
  <script type="module">
28
39
  import { html, render } from 'lit'
29
- import '@material/mwc-icon'
30
- import '@material/mwc-icon-button'
40
+ import '@material/web/icon/icon.js'
31
41
 
32
42
  import '../dist/src/ox-pfp-edit.js'
33
43
  import '../dist/src/ox-pfp-view.js'
@@ -1,4 +1,4 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="en-GB">
3
3
  <head>
4
4
  <meta charset="utf-8" />
@@ -8,7 +8,18 @@
8
8
  }
9
9
  </style>
10
10
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
11
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
11
+ <link
12
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
13
+ rel="stylesheet"
14
+ />
15
+ <link
16
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
17
+ rel="stylesheet"
18
+ />
19
+ <link
20
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
21
+ rel="stylesheet"
22
+ />
12
23
  </head>
13
24
  <body>
14
25
  <div id="demo"></div>
@@ -22,8 +33,7 @@
22
33
 
23
34
  <script type="module">
24
35
  import { html, render } from 'lit'
25
- import '@material/mwc-icon'
26
- import '@material/mwc-icon-button'
36
+ import '@material/web/icon/icon.js'
27
37
 
28
38
  import '../dist/src/ox-pfp-view.js'
29
39
 
@@ -1,4 +1,4 @@
1
- import '@material/mwc-icon-button';
1
+ import '@material/web/icon/icon.js';
2
2
  import './ox-pfp.js';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import { Contact, ContactItem } from './ox-contact';
@@ -12,7 +12,7 @@ export declare class OxContactEdit extends LitElement {
12
12
  note: HTMLTextAreaElement;
13
13
  pfp: OxPfp;
14
14
  fields: NodeListOf<HTMLDivElement>;
15
- render(): import("lit").TemplateResult<1>;
15
+ render(): import("lit-html").TemplateResult<1>;
16
16
  updated(changes: PropertyValues<this>): void;
17
17
  buildItems(): ContactItem[];
18
18
  buildStageContact(): void;
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import '@material/mwc-icon-button';
2
+ import '@material/web/icon/icon.js';
3
3
  import './ox-pfp.js';
4
4
  import { html, css, LitElement } from 'lit';
5
5
  import { customElement, property, state, query, queryAll } from 'lit/decorators.js';
@@ -43,14 +43,14 @@ let OxContactEdit = class OxContactEdit extends LitElement {
43
43
  ${type}
44
44
  ${items.map(item => html `<div @change=${(e) => this.onChangeItem(e, item)} .item=${item} item-field>
45
45
  ${item.value
46
- ? html `<mwc-icon-button
47
- icon="cancel"
46
+ ? html `<md-icon
48
47
  @click=${() => {
49
48
  item.value = '';
50
49
  this.buildStageContact();
51
50
  }}
52
- ></mwc-icon-button>`
53
- : html `<mwc-icon-button></mwc-icon-button>`}
51
+ >cancel</md-icon
52
+ >`
53
+ : html `<md-icon></md-icon>`}
54
54
  <select .value=${item.label} data-item="label">
55
55
  ${['home', 'work', 'other', 'mobile'].map(option => html ` <option value=${option} ?selected=${option === item.label}>${option}</option>`)}
56
56
  </select>
@@ -123,8 +123,7 @@ OxContactEdit.styles = [
123
123
  display: block;
124
124
  padding: 25px;
125
125
 
126
- --mdc-icon-button-size: 16px;
127
- --mdc-icon-size: 16px;
126
+ --md-icon-size: 16px;
128
127
  }
129
128
 
130
129
  :host > div {
@@ -140,6 +139,7 @@ OxContactEdit.styles = [
140
139
  display: flex;
141
140
  flex-direction: row;
142
141
  gap: 10px;
142
+ align-items: center;
143
143
  }
144
144
 
145
145
  :host > div > div:hover {
@@ -1 +1 @@
1
- {"version":3,"file":"ox-contact-edit.js","sourceRoot":"","sources":["../../src/ox-contact-edit.ts"],"names":[],"mappings":";AAAA,OAAO,2BAA2B,CAAA;AAClC,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEnF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAI1C,IAAM,aAAa,GAAnB,MAAM,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EAAE,IAAI,CAAC,YAAY;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAExB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9D,CAAC;;AA7NM,oBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8EF;CACF,AAjFY,CAiFZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAsB;AAEhC;IAAhB,KAAK,EAAE;mDAAyE;AAEjE;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AACvB;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAA8B;AAChC;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AACzB;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAAY;AACF;IAAzB,QAAQ,CAAC,cAAc,CAAC;6CAAoC;AA5FlD,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA+NzB","sourcesContent":["import '@material/mwc-icon-button'\nimport './ox-pfp.js'\n\nimport { html, css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state, query, queryAll } from 'lit/decorators.js'\nimport { Contact, ContactField, ContactItem } from './ox-contact'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { OxPfp } from './ox-pfp.js'\n\n@customElement('ox-contact-edit')\nexport class OxContactEdit extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: block;\n padding: 25px;\n\n --mdc-icon-button-size: 16px;\n --mdc-icon-size: 16px;\n }\n\n :host > div {\n padding: 10px 0;\n display: block;\n border-bottom: 1px solid blue;\n }\n\n :host > div > div {\n padding: 4px 0;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n }\n\n :host > div > div:hover {\n position: relative;\n }\n\n [data-item='label'] {\n width: 100px;\n text-align: right;\n }\n\n [data-item='value'] {\n flex: 1;\n }\n\n :host > div[name] {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: bold;\n font-size: 1.4em;\n }\n\n :host ox-pfp {\n display: inline-block;\n width: 100px;\n height: 100px;\n }\n\n :host > div[name] > div[name-content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n\n div[field] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 10px;\n }\n\n div[field] > span {\n width: 100px;\n text-align: right;\n }\n\n div[field] > input {\n flex: 1;\n }\n\n textarea {\n width: 100%;\n height: 100px;\n }\n `\n ]\n\n @property({ type: Object }) contact: Contact = {}\n\n @state() private stageContact: Contact = JSON.parse(JSON.stringify(this.contact))\n\n @query('#name') name!: HTMLTextAreaElement\n @query('#company') company!: HTMLTextAreaElement\n @query('#note') note!: HTMLTextAreaElement\n @query('ox-pfp') pfp!: OxPfp\n @queryAll('[item-field]') fields!: NodeListOf<HTMLDivElement>\n\n render() {\n const { profile, items = [], name, company, note } = this.stageContact || {}\n var sorted: { [type: string]: ContactItem[] } = {}\n\n items.forEach(item => {\n if (!sorted[item.type as string]) {\n sorted[item.type] = [item]\n } else {\n sorted[item.type as string].push(item)\n }\n })\n\n return html`\n <div name>\n <ox-pfp .profile=${profile} .name=${name}></ox-pfp>\n\n <div name-content>\n <div @change=${(e: Event) => this.buildStageContact()}>\n <span>name</span>\n <input type=\"text\" id=\"name\" .value=${name ?? ''} />\n </div>\n <div @change=${(e: Event) => this.buildStageContact()}>\n <span>company</span>\n <input type=\"text\" id=\"company\" .value=${company ?? ''} />\n </div>\n </div>\n </div>\n ${['email', 'phone', 'address'].map(type => {\n var items = [...(sorted[type] || []), { type: type as ContactField, label: 'work', value: '' }]\n\n return html`\n <div data-type=${type}>\n ${type}\n ${items.map(\n item =>\n html`<div @change=${(e: Event) => this.onChangeItem(e, item)} .item=${item} item-field>\n ${item.value\n ? html`<mwc-icon-button\n icon=\"cancel\"\n @click=${() => {\n item.value = ''\n this.buildStageContact()\n }}\n ></mwc-icon-button>`\n : html`<mwc-icon-button></mwc-icon-button>`}\n <select .value=${item.label} data-item=\"label\">\n ${['home', 'work', 'other', 'mobile'].map(\n option => html` <option value=${option} ?selected=${option === item.label}>${option}</option>`\n )}\n </select>\n <input type=\"text\" .value=${item.value} data-item=\"value\" />\n </div>`\n )}\n </div>\n `\n })}\n <div note>\n note\n <textarea id=\"note\" .value=${note || ''} @change=${() => this.buildStageContact()}></textarea>\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('contact')) {\n this.stageContact = JSON.parse(JSON.stringify(this.contact))\n }\n }\n\n buildItems() {\n const items: ContactItem[] = []\n\n this.fields.forEach(fieldElement => {\n const item = (fieldElement as any).item\n if (item.value) {\n items.push(item)\n }\n })\n\n return items\n }\n\n buildStageContact() {\n this.stageContact = {\n ...this.stageContact,\n profile: this.pfp.profile,\n name: this.name.value,\n company: this.company.value,\n note: this.note.value,\n items: this.buildItems()\n }\n }\n\n onChangeItem(e: Event, item: ContactItem) {\n const target = e.currentTarget as HTMLElement\n const labelElement = target.querySelector('[data-item=\"label\"]') as HTMLSelectElement\n const valueElement = target.querySelector('[data-item=\"value\"]') as HTMLInputElement\n\n item.label = labelElement.value\n item.value = valueElement.value\n\n if (e.target === valueElement || item.value) {\n this.buildStageContact()\n }\n }\n\n save() {\n this.buildStageContact()\n\n this.dispatchEvent(\n new CustomEvent('edit-done', {\n detail: this.stageContact\n })\n )\n }\n\n cancel() {\n this.dispatchEvent(\n new CustomEvent('edit-cancel', {\n detail: this.stageContact\n })\n )\n }\n\n reset() {\n this.buildStageContact()\n\n this.stageContact = JSON.parse(JSON.stringify(this.contact))\n }\n}\n"]}
1
+ {"version":3,"file":"ox-contact-edit.js","sourceRoot":"","sources":["../../src/ox-contact-edit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AC5C,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAC1B,CAAC;IACH,CAAC;IAED,IAAI;QACF,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAExB,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,WAAW,EAAE;YAC3B,MAAM,EAAE,IAAI,CAAC,YAAY;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,aAAa,EAAE;YAC7B,MAAM,EAAE,IAAI,CAAC,YAAY;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAExB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9D,CAAC;;AA7NM,oBAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8EF;CACF,AAjFY,CAiFZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAsB;AAEhC;IAAhB,KAAK,EAAE;mDAAyE;AAEjE;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AACvB;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAA8B;AAChC;IAAf,KAAK,CAAC,OAAO,CAAC;2CAA2B;AACzB;IAAhB,KAAK,CAAC,QAAQ,CAAC;0CAAY;AACF;IAAzB,QAAQ,CAAC,cAAc,CAAC;6CAAoC;AA5FlD,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA+NzB","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-pfp.js'\n\nimport { html, css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, state, query, queryAll } from 'lit/decorators.js'\nimport { Contact, ContactField, ContactItem } from './ox-contact'\nimport { ScrollbarStyles } from '@operato/styles'\nimport { OxPfp } from './ox-pfp.js'\n\n@customElement('ox-contact-edit')\nexport class OxContactEdit extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: block;\n padding: 25px;\n\n --md-icon-size: 16px;\n }\n\n :host > div {\n padding: 10px 0;\n display: block;\n border-bottom: 1px solid blue;\n }\n\n :host > div > div {\n padding: 4px 0;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n align-items: center;\n }\n\n :host > div > div:hover {\n position: relative;\n }\n\n [data-item='label'] {\n width: 100px;\n text-align: right;\n }\n\n [data-item='value'] {\n flex: 1;\n }\n\n :host > div[name] {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: bold;\n font-size: 1.4em;\n }\n\n :host ox-pfp {\n display: inline-block;\n width: 100px;\n height: 100px;\n }\n\n :host > div[name] > div[name-content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n\n div[field] {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 10px;\n }\n\n div[field] > span {\n width: 100px;\n text-align: right;\n }\n\n div[field] > input {\n flex: 1;\n }\n\n textarea {\n width: 100%;\n height: 100px;\n }\n `\n ]\n\n @property({ type: Object }) contact: Contact = {}\n\n @state() private stageContact: Contact = JSON.parse(JSON.stringify(this.contact))\n\n @query('#name') name!: HTMLTextAreaElement\n @query('#company') company!: HTMLTextAreaElement\n @query('#note') note!: HTMLTextAreaElement\n @query('ox-pfp') pfp!: OxPfp\n @queryAll('[item-field]') fields!: NodeListOf<HTMLDivElement>\n\n render() {\n const { profile, items = [], name, company, note } = this.stageContact || {}\n var sorted: { [type: string]: ContactItem[] } = {}\n\n items.forEach(item => {\n if (!sorted[item.type as string]) {\n sorted[item.type] = [item]\n } else {\n sorted[item.type as string].push(item)\n }\n })\n\n return html`\n <div name>\n <ox-pfp .profile=${profile} .name=${name}></ox-pfp>\n\n <div name-content>\n <div @change=${(e: Event) => this.buildStageContact()}>\n <span>name</span>\n <input type=\"text\" id=\"name\" .value=${name ?? ''} />\n </div>\n <div @change=${(e: Event) => this.buildStageContact()}>\n <span>company</span>\n <input type=\"text\" id=\"company\" .value=${company ?? ''} />\n </div>\n </div>\n </div>\n ${['email', 'phone', 'address'].map(type => {\n var items = [...(sorted[type] || []), { type: type as ContactField, label: 'work', value: '' }]\n\n return html`\n <div data-type=${type}>\n ${type}\n ${items.map(\n item =>\n html`<div @change=${(e: Event) => this.onChangeItem(e, item)} .item=${item} item-field>\n ${item.value\n ? html`<md-icon\n @click=${() => {\n item.value = ''\n this.buildStageContact()\n }}\n >cancel</md-icon\n >`\n : html`<md-icon></md-icon>`}\n <select .value=${item.label} data-item=\"label\">\n ${['home', 'work', 'other', 'mobile'].map(\n option => html` <option value=${option} ?selected=${option === item.label}>${option}</option>`\n )}\n </select>\n <input type=\"text\" .value=${item.value} data-item=\"value\" />\n </div>`\n )}\n </div>\n `\n })}\n <div note>\n note\n <textarea id=\"note\" .value=${note || ''} @change=${() => this.buildStageContact()}></textarea>\n </div>\n `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('contact')) {\n this.stageContact = JSON.parse(JSON.stringify(this.contact))\n }\n }\n\n buildItems() {\n const items: ContactItem[] = []\n\n this.fields.forEach(fieldElement => {\n const item = (fieldElement as any).item\n if (item.value) {\n items.push(item)\n }\n })\n\n return items\n }\n\n buildStageContact() {\n this.stageContact = {\n ...this.stageContact,\n profile: this.pfp.profile,\n name: this.name.value,\n company: this.company.value,\n note: this.note.value,\n items: this.buildItems()\n }\n }\n\n onChangeItem(e: Event, item: ContactItem) {\n const target = e.currentTarget as HTMLElement\n const labelElement = target.querySelector('[data-item=\"label\"]') as HTMLSelectElement\n const valueElement = target.querySelector('[data-item=\"value\"]') as HTMLInputElement\n\n item.label = labelElement.value\n item.value = valueElement.value\n\n if (e.target === valueElement || item.value) {\n this.buildStageContact()\n }\n }\n\n save() {\n this.buildStageContact()\n\n this.dispatchEvent(\n new CustomEvent('edit-done', {\n detail: this.stageContact\n })\n )\n }\n\n cancel() {\n this.dispatchEvent(\n new CustomEvent('edit-cancel', {\n detail: this.stageContact\n })\n )\n }\n\n reset() {\n this.buildStageContact()\n\n this.stageContact = JSON.parse(JSON.stringify(this.contact))\n }\n}\n"]}
@@ -4,5 +4,5 @@ import { Contact } from './ox-contact';
4
4
  export declare class OxContactView extends LitElement {
5
5
  static styles: import("lit").CSSResult;
6
6
  contact: Contact;
7
- render(): import("lit").TemplateResult<1>;
7
+ render(): import("lit-html").TemplateResult<1>;
8
8
  }
@@ -36,15 +36,15 @@ let OxContactView = class OxContactView extends LitElement {
36
36
  .map(type => sorted[type])
37
37
  .filter(items => items && items.length > 0)
38
38
  .map(items => html `<div data-type=${items[0].type}>
39
- <mwc-icon></mwc-icon>
40
- ${items[0].type}
41
- ${items.map(item => html `<div>
42
- <label data-item="label"> ${item.label}</label>
43
- <span data-item="value">${item.value}</span>
44
- </div>`)}
45
- </div>`)}
39
+ <md-icon></md-icon>
40
+ ${items[0].type}
41
+ ${items.map(item => html `<div>
42
+ <label data-item="label"> ${item.label}</label>
43
+ <span data-item="value">${item.value}</span>
44
+ </div>`)}
45
+ </div>`)}
46
46
  <div note>
47
- <mwc-icon></mwc-icon>
47
+ <md-icon></md-icon>
48
48
  note
49
49
  <div>${note || ''}</div>
50
50
  </div>
@@ -54,7 +54,7 @@ let OxContactView = class OxContactView extends LitElement {
54
54
  OxContactView.styles = css `
55
55
  :host {
56
56
  display: block;
57
- --mdc-icon-size: 16px;
57
+ --md-icon-size: 16px;
58
58
  }
59
59
 
60
60
  :host > div {
@@ -123,28 +123,28 @@ OxContactView.styles = css `
123
123
  display: flex;
124
124
  flex-direction: column;
125
125
  }
126
- div[data-type='email'] mwc-icon::before {
126
+ div[data-type='email'] md-icon::before {
127
127
  content: 'mail_outline';
128
128
  }
129
- div[data-type='phone'] mwc-icon::before {
129
+ div[data-type='phone'] md-icon::before {
130
130
  content: 'phone';
131
131
  }
132
- div[data-type='address'] mwc-icon::before {
132
+ div[data-type='address'] md-icon::before {
133
133
  content: 'place';
134
134
  }
135
- div[data-type='company'] mwc-icon::before {
135
+ div[data-type='company'] md-icon::before {
136
136
  content: 'business';
137
137
  }
138
- div[data-type='etc'] mwc-icon::before {
138
+ div[data-type='etc'] md-icon::before {
139
139
  content: 'feed';
140
140
  }
141
- div[note] mwc-icon::before {
141
+ div[note] md-icon::before {
142
142
  content: 'subject';
143
143
  }
144
144
  :host > div > [name-content] {
145
145
  gap: 3px;
146
146
  }
147
- div mwc-icon {
147
+ div md-icon {
148
148
  position: relative;
149
149
  top: 3px;
150
150
  margin-right: 3px;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-contact-view.js","sourceRoot":"","sources":["../../src/ox-contact-view.ts"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAIpD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAgHuB,YAAO,GAAY,EAAE,CAAA;IAmDnD,CAAC;IAjDC,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAA;QACvE,IAAI,MAAM,GAAsC,EAAE,CAAA;QAElD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAc,CAAC,EAAE,CAAC;gBACjC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YAC5B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACxC,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;;gCAEiB,OAAO,UAAU,IAAI;;;;sCAIf,IAAI;;;sCAGJ,OAAO;;;;;QAKrC,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC;aAC9C,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aACzB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;aAC1C,GAAG,CACF,KAAK,CAAC,EAAE,CAAC,IAAI,CAAA,kBAAkB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;;cAExC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;cACb,KAAK,CAAC,GAAG,CACT,IAAI,CAAC,EAAE,CACL,IAAI,CAAA;8CAC0B,IAAI,CAAC,KAAK;4CACZ,IAAI,CAAC,KAAK;uBAC/B,CACV;iBACI,CACR;;;;eAIM,IAAI,IAAI,EAAE;;KAEpB,CAAA;IACH,CAAC;;AAjKM,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GlB,AA7GY,CA6GZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAsB;AAhHtC,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAmKzB","sourcesContent":["import './ox-pfp-view.js'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { Contact, ContactField, ContactItem } from './ox-contact'\n\n@customElement('ox-contact-view')\nexport class OxContactView extends LitElement {\n static styles = css`\n :host {\n display: block;\n --mdc-icon-size: 16px;\n }\n\n :host > div {\n padding: var(--padding-default, 10px);\n display: block;\n border-bottom: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.1));\n font-size: 0.9em;\n text-transform: capitalize;\n }\n\n :host > div > div {\n padding: 4px 0;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n }\n\n :host > div > div:hover {\n position: relative;\n }\n\n :host > div > div:hover::before {\n content: '';\n display: block;\n position: absolute;\n text-align: left;\n line-height: 24px;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n opacity: 0.15;\n background-image: linear-gradient(var(--primary-color, gray), var(--primary-color, gray));\n z-index: -1;\n }\n\n [data-item='label'] {\n width: 80px;\n text-align: right;\n color: var(--secondary-text-color, #017e7f);\n }\n\n [data-item='value'] {\n flex: 1;\n text-transform: none;\n }\n\n :host > div[name] {\n display: flex;\n align-items: center;\n gap: 15px;\n font-weight: bold;\n font-size: 1.4em;\n }\n\n :host ox-pfp-view {\n display: inline-block;\n height: 75px;\n }\n\n :host > div[name] > div[name-content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n div[data-type='email'] mwc-icon::before {\n content: 'mail_outline';\n }\n div[data-type='phone'] mwc-icon::before {\n content: 'phone';\n }\n div[data-type='address'] mwc-icon::before {\n content: 'place';\n }\n div[data-type='company'] mwc-icon::before {\n content: 'business';\n }\n div[data-type='etc'] mwc-icon::before {\n content: 'feed';\n }\n div[note] mwc-icon::before {\n content: 'subject';\n }\n :host > div > [name-content] {\n gap: 3px;\n }\n div mwc-icon {\n position: relative;\n top: 3px;\n margin-right: 3px;\n opacity: 0.5;\n color: var(--primary-text-color, #333);\n }\n [name-content] div {\n color: var(--primary-text-color, #333);\n font-size: 1.2em;\n }\n [name-content] [company] {\n color: var(--secondary-text-color, #666);\n font-weight: normal;\n font-size: 0.9em;\n }\n `\n\n @property({ type: Object }) contact: Contact = {}\n\n render() {\n const { profile, items = [], name, company, note } = this.contact || {}\n var sorted: { [type: string]: ContactItem[] } = {}\n\n items.forEach(item => {\n if (!sorted[item.type as string]) {\n sorted[item.type] = [item]\n } else {\n sorted[item.type as string].push(item)\n }\n })\n\n return html`\n <div name>\n <ox-pfp-view .profile=${profile} .name=${name}></ox-pfp-view>\n\n <div name-content>\n <div>\n <span data-item=\"value\">${name}</span>\n </div>\n <div company>\n <span data-item=\"value\">${company}</span>\n </div>\n </div>\n </div>\n\n ${['email', 'phone', 'address', 'company', 'etc']\n .map(type => sorted[type])\n .filter(items => items && items.length > 0)\n .map(\n items => html`<div data-type=${items[0].type}>\n <mwc-icon></mwc-icon>\n ${items[0].type}\n ${items.map(\n item =>\n html`<div>\n <label data-item=\"label\"> ${item.label}</label>\n <span data-item=\"value\">${item.value}</span>\n </div>`\n )}\n </div>`\n )}\n <div note>\n <mwc-icon></mwc-icon>\n note\n <div>${note || ''}</div>\n </div>\n `\n }\n}\n"]}
1
+ {"version":3,"file":"ox-contact-view.js","sourceRoot":"","sources":["../../src/ox-contact-view.ts"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAIpD,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAgHuB,YAAO,GAAY,EAAE,CAAA;IAoDnD,CAAC;IAlDC,MAAM;QACJ,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAA;QACvE,IAAI,MAAM,GAAsC,EAAE,CAAA;QAElD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAc,CAAC,EAAE,CAAC;gBAC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{ html, css, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { Contact, ContactField, ContactItem } from './ox-contact'\n\n@customElement('ox-contact-view')\nexport class OxContactView extends LitElement {\n static styles = css`\n :host {\n display: block;\n --md-icon-size: 16px;\n }\n\n :host > div {\n padding: var(--padding-default, 10px);\n display: block;\n border-bottom: var(--border-dark-color, 1px solid rgba(0, 0, 0, 0.1));\n font-size: 0.9em;\n text-transform: capitalize;\n }\n\n :host > div > div {\n padding: 4px 0;\n box-sizing: border-box;\n\n display: flex;\n flex-direction: row;\n gap: 10px;\n }\n\n :host > div > div:hover {\n position: relative;\n }\n\n :host > div > div:hover::before {\n content: '';\n display: block;\n position: absolute;\n text-align: left;\n line-height: 24px;\n top: 0;\n right: 0;\n width: 100%;\n height: 100%;\n opacity: 0.15;\n background-image: linear-gradient(var(--primary-color, gray), var(--primary-color, gray));\n z-index: -1;\n }\n\n [data-item='label'] {\n width: 80px;\n text-align: right;\n color: var(--secondary-text-color, #017e7f);\n }\n\n [data-item='value'] {\n flex: 1;\n text-transform: none;\n }\n\n :host > div[name] {\n display: flex;\n align-items: center;\n gap: 15px;\n font-weight: bold;\n font-size: 1.4em;\n }\n\n :host ox-pfp-view {\n display: inline-block;\n height: 75px;\n }\n\n :host > div[name] > div[name-content] {\n flex: 1;\n\n display: flex;\n flex-direction: column;\n }\n div[data-type='email'] md-icon::before {\n content: 'mail_outline';\n }\n div[data-type='phone'] md-icon::before {\n content: 'phone';\n }\n div[data-type='address'] md-icon::before {\n content: 'place';\n }\n div[data-type='company'] md-icon::before {\n content: 'business';\n }\n div[data-type='etc'] md-icon::before {\n content: 'feed';\n }\n div[note] md-icon::before {\n content: 'subject';\n }\n :host > div > [name-content] {\n gap: 3px;\n }\n div md-icon {\n position: relative;\n top: 3px;\n margin-right: 3px;\n opacity: 0.5;\n color: var(--primary-text-color, #333);\n }\n [name-content] div {\n color: var(--primary-text-color, #333);\n font-size: 1.2em;\n }\n [name-content] [company] {\n color: var(--secondary-text-color, #666);\n font-weight: normal;\n font-size: 0.9em;\n }\n `\n\n @property({ type: Object }) contact: Contact = {}\n\n render() {\n const { profile, items = [], name, company, note } = this.contact || {}\n var sorted: { [type: string]: ContactItem[] } = {}\n\n items.forEach(item => {\n if (!sorted[item.type as string]) {\n sorted[item.type] = [item]\n } else {\n sorted[item.type as string].push(item)\n }\n })\n\n return html`\n <div name>\n <ox-pfp-view .profile=${profile} .name=${name}></ox-pfp-view>\n\n <div name-content>\n <div>\n <span data-item=\"value\">${name}</span>\n </div>\n <div company>\n <span data-item=\"value\">${company}</span>\n </div>\n </div>\n </div>\n\n ${['email', 'phone', 'address', 'company', 'etc']\n .map(type => sorted[type])\n .filter(items => items && items.length > 0)\n .map(\n items =>\n html`<div data-type=${items[0].type}>\n <md-icon></md-icon>\n ${items[0].type}\n ${items.map(\n item =>\n html`<div>\n <label data-item=\"label\"> ${item.label}</label>\n <span data-item=\"value\">${item.value}</span>\n </div>`\n )}\n </div>`\n )}\n <div note>\n <md-icon></md-icon>\n note\n <div>${note || ''}</div>\n </div>\n `\n }\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import '@material/web/icon/icon.js';
1
2
  import './ox-contact-edit.js';
2
3
  import './ox-contact-view.js';
3
4
  import { LitElement } from 'lit';
@@ -39,5 +40,5 @@ export declare class OxContact extends LitElement {
39
40
  contact: Contact;
40
41
  editMode?: boolean;
41
42
  editor: OxContactEdit;
42
- render(): import("lit").TemplateResult<1>;
43
+ render(): import("lit-html").TemplateResult<1>;
43
44
  }
@@ -1,8 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
+ import '@material/web/icon/icon.js';
2
3
  import './ox-contact-edit.js';
3
4
  import './ox-contact-view.js';
4
5
  import { html, css, LitElement } from 'lit';
5
6
  import { customElement, property, query, state } from 'lit/decorators.js';
7
+ import { i18next } from '@operato/i18n';
6
8
  import { ButtonContainerStyles } from '@operato/styles';
7
9
  export var ContactField;
8
10
  (function (ContactField) {
@@ -44,14 +46,25 @@ let OxContact = class OxContact extends LitElement {
44
46
  : html ` <ox-contact-view .contact=${this.contact}></ox-contact-view> `}
45
47
  </div>
46
48
 
47
- <div class="button-container">
49
+ <div class="button-container" style="margin-left: unset;">
48
50
  ${this.editMode
49
51
  ? html `
50
- <button value="Done" @click=${() => this.editor.save()}>Done</button>
51
- <button value="Cancel" @click=${() => this.editor.cancel()}>Cancel</button>
52
- <button value="Reset" @click=${() => this.editor.reset()}>Reset</button>
52
+ <button @click=${() => this.editor.reset()}>
53
+ <md-icon>restart_alt</md-icon>${i18next.t('button.reset')}
54
+ </button>
55
+ <div filler></div>
56
+ <button @click=${() => this.editor.cancel()}>
57
+ <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
58
+ </button>
59
+ <button @click=${() => this.editor.save()}>
60
+ <md-icon>done</md-icon>${i18next.t('button.confirm')}
61
+ </button>
53
62
  `
54
- : html ` <button value="Edit" @click=${() => (this.editMode = true)}>Edit</button> `}
63
+ : html `
64
+ <button @click=${() => (this.editMode = true)}>
65
+ <md-icon>edit</md-icon>${i18next.t('button.edit')}
66
+ </button>
67
+ `}
55
68
  </div>
56
69
  </div>`;
57
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ox-contact.js","sourceRoot":"","sources":["../../src/ox-contact.ts"],"names":[],"mappings":";AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,mCAA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ACrB,GAAG,CAAA;;;;;;;;;;;;KAYF;CACF,AAfY,CAeZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAsB;AAExC;IAAR,KAAK,EAAE;2CAA2B;AAET;IAAzB,KAAK,CAAC,iBAAiB,CAAC;yCAAuB;AAtBrC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAsDrB","sourcesContent":["import './ox-contact-edit.js'\nimport './ox-contact-view.js'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { ButtonContainerStyles } from '@operato/styles'\n\nimport { OxContactEdit } from './ox-contact-edit.js'\nimport { Profile } from './ox-pfp-view.js'\n\nexport enum ContactField {\n JobTitle = 'job-title',\n Phone = 'phone',\n Address = 'address',\n Email = 'email',\n Birthday = 'birthday',\n Profile = 'profile',\n Picture = 'picture',\n Department = 'department',\n Homepage = 'homepage'\n}\n\nexport enum ContactLabel {\n home = 'home',\n work = 'work',\n other = 'other',\n mobile = 'mobile'\n}\n\nexport type ContactItem = {\n id?: string\n type: ContactField\n label: string\n value: string\n}\n\nexport type Contact = {\n id?: string\n profile?: Profile\n name?: string\n company?: string\n items?: ContactItem[]\n note?: string\n}\n\n@customElement('ox-contact')\nexport class OxContact extends LitElement {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n }\n\n ox-contact-view,\n ox-contact-edit {\n padding: var(--pading-default);\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) contact: Contact = {}\n\n @state() editMode?: boolean = false\n\n @query('ox-contact-edit') editor!: OxContactEdit\n\n render() {\n return html` \n <div container>\n ${\n this.editMode\n ? html`<ox-contact-edit\n .contact=${this.contact}\n @edit-cancel=${() => (this.editMode = false)}\n @edit-done=${(e: CustomEvent) => {\n this.contact = e.detail\n this.editMode = false\n }}\n ></ox-contact-edit>`\n : html` <ox-contact-view .contact=${this.contact}></ox-contact-view> `\n }\n </div>\n \n <div class=\"button-container\">\n ${\n this.editMode\n ? html`\n <button value=\"Done\" @click=${() => this.editor.save()}>Done</button>\n <button value=\"Cancel\" @click=${() => this.editor.cancel()}>Cancel</button>\n <button value=\"Reset\" @click=${() => this.editor.reset()}>Reset</button>\n `\n : html` <button value=\"Edit\" @click=${() => (this.editMode = true)}>Edit</button> `\n }\n </div>\n </div>`\n }\n}\n"]}
1
+ {"version":3,"file":"ox-contact.js","sourceRoot":"","sources":["../../src/ox-contact.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,sBAAsB,CAAA;AAC7B,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAKvD,MAAM,CAAN,IAAY,YAUX;AAVD,WAAY,YAAY;IACtB,sCAAsB,CAAA;IACtB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,qCAAqB,CAAA;AACvB,CAAC,EAVW,YAAY,KAAZ,YAAY,QAUvB;AAED,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,+BAAe,CAAA;IACf,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAmBM,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAkBuB,YAAO,GAAY,EAAE,CAAA;QA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;yCAAuB;AAtBrC,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAiErB","sourcesContent":["import '@material/web/icon/icon.js'\nimport './ox-contact-edit.js'\nimport './ox-contact-view.js'\n\nimport { html, css, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { ButtonContainerStyles } from '@operato/styles'\n\nimport { OxContactEdit } from './ox-contact-edit.js'\nimport { Profile } from './ox-pfp-view.js'\n\nexport enum ContactField {\n JobTitle = 'job-title',\n Phone = 'phone',\n Address = 'address',\n Email = 'email',\n Birthday = 'birthday',\n Profile = 'profile',\n Picture = 'picture',\n Department = 'department',\n Homepage = 'homepage'\n}\n\nexport enum ContactLabel {\n home = 'home',\n work = 'work',\n other = 'other',\n mobile = 'mobile'\n}\n\nexport type ContactItem = {\n id?: string\n type: ContactField\n label: string\n value: string\n}\n\nexport type Contact = {\n id?: string\n profile?: Profile\n name?: string\n company?: string\n items?: ContactItem[]\n note?: string\n}\n\n@customElement('ox-contact')\nexport class OxContact extends LitElement {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--main-section-background-color);\n }\n\n ox-contact-view,\n ox-contact-edit {\n padding: var(--pading-default);\n flex: 1;\n }\n `\n ]\n\n @property({ type: Object }) contact: Contact = {}\n\n @state() editMode?: boolean = false\n\n @query('ox-contact-edit') editor!: OxContactEdit\n\n render() {\n return html` \n <div container>\n ${\n this.editMode\n ? html`<ox-contact-edit\n .contact=${this.contact}\n @edit-cancel=${() => (this.editMode = false)}\n @edit-done=${(e: CustomEvent) => {\n this.contact = e.detail\n this.editMode = false\n }}\n ></ox-contact-edit>`\n : html` <ox-contact-view .contact=${this.contact}></ox-contact-view> `\n }\n </div>\n \n <div class=\"button-container\" style=\"margin-left: unset;\">\n ${\n this.editMode\n ? html`\n <button @click=${() => this.editor.reset()}>\n <md-icon>restart_alt</md-icon>${i18next.t('button.reset')}\n </button>\n <div filler></div>\n <button @click=${() => this.editor.cancel()}>\n <md-icon>cancel</md-icon>${i18next.t('button.cancel')}\n </button>\n <button @click=${() => this.editor.save()}>\n <md-icon>done</md-icon>${i18next.t('button.confirm')}\n </button>\n `\n : html`\n <button @click=${() => (this.editMode = true)}>\n <md-icon>edit</md-icon>${i18next.t('button.edit')}\n </button>\n `\n }\n </div>\n </div>`\n }\n}\n"]}
@@ -13,7 +13,7 @@ export declare class OxPfpEdit extends LitElement {
13
13
  private dropFileHandler;
14
14
  connectedCallback(): void;
15
15
  disconnectedCallback(): void;
16
- render(): import("lit").TemplateResult<1>;
16
+ render(): import("lit-html").TemplateResult<1>;
17
17
  updated(changes: PropertyValues<this>): void;
18
18
  get value(): Profile;
19
19
  set value(value: Profile);