@operato/contact 1.1.77 → 1.2.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/CHANGELOG.md +16 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/src/OxContact copy.d.ts +0 -38
- package/dist/src/OxContact copy.js +0 -194
- package/dist/src/OxContact copy.js.map +0 -1
- package/dist/src/OxContact.d.ts +0 -38
- package/dist/src/OxContact.js +0 -67
- package/dist/src/OxContact.js.map +0 -1
- package/dist/src/OxContactEdit.d.ts +0 -18
- package/dist/src/OxContactEdit.js +0 -235
- package/dist/src/OxContactEdit.js.map +0 -1
- package/dist/src/OxContactView copy.d.ts +0 -35
- package/dist/src/OxContactView copy.js +0 -143
- package/dist/src/OxContactView copy.js.map +0 -1
- package/dist/src/OxContactView.d.ts +0 -7
- package/dist/src/OxContactView.js +0 -138
- package/dist/src/OxContactView.js.map +0 -1
- package/dist/src/ox-contact copy.d.ts +0 -38
- package/dist/src/ox-contact copy.js +0 -67
- package/dist/src/ox-contact copy.js.map +0 -1
- package/dist/src/ox-contact-edit copy.d.ts +0 -1
- package/dist/src/ox-contact-edit copy.js +0 -3
- package/dist/src/ox-contact-edit copy.js.map +0 -1
- package/dist/src/ox-pfp-editor copy.d.ts +0 -11
- package/dist/src/ox-pfp-editor copy.js +0 -71
- package/dist/src/ox-pfp-editor copy.js.map +0 -1
- package/dist/src/ox-pfp-editor.d.ts +0 -20
- package/dist/src/ox-pfp-editor.js +0 -165
- package/dist/src/ox-pfp-editor.js.map +0 -1
- package/dist/src/ox-pfp-viewer.d.ts +0 -14
- package/dist/src/ox-pfp-viewer.js +0 -63
- package/dist/src/ox-pfp-viewer.js.map +0 -1
- package/dist/stories/index.stories copy.d.ts +0 -24
- package/dist/stories/index.stories copy.js +0 -79
- package/dist/stories/index.stories copy.js.map +0 -1
- package/dist/stories/index.stories.d.ts +0 -24
- package/dist/stories/index.stories.js +0 -79
- package/dist/stories/index.stories.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
4
|
-
import './ox-contact-edit';
|
|
5
|
-
import './ox-contact-view';
|
|
6
|
-
export var ContactField;
|
|
7
|
-
(function (ContactField) {
|
|
8
|
-
ContactField["Name"] = "name";
|
|
9
|
-
ContactField["JobTitle"] = "job-title";
|
|
10
|
-
ContactField["Phone"] = "phone";
|
|
11
|
-
ContactField["Address"] = "address";
|
|
12
|
-
ContactField["Email"] = "email";
|
|
13
|
-
ContactField["Birthday"] = "birthday";
|
|
14
|
-
ContactField["Profile"] = "profile";
|
|
15
|
-
ContactField["Picture"] = "picture";
|
|
16
|
-
ContactField["Department"] = "department";
|
|
17
|
-
ContactField["Company"] = "company";
|
|
18
|
-
ContactField["Homepage"] = "homepage";
|
|
19
|
-
})(ContactField || (ContactField = {}));
|
|
20
|
-
export var ContactLabel;
|
|
21
|
-
(function (ContactLabel) {
|
|
22
|
-
ContactLabel["home"] = "home";
|
|
23
|
-
ContactLabel["work"] = "work";
|
|
24
|
-
ContactLabel["other"] = "other";
|
|
25
|
-
ContactLabel["mobile"] = "mobile";
|
|
26
|
-
})(ContactLabel || (ContactLabel = {}));
|
|
27
|
-
let OxContact = class OxContact extends LitElement {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(...arguments);
|
|
30
|
-
this.contact = {};
|
|
31
|
-
this.editMode = false;
|
|
32
|
-
}
|
|
33
|
-
render() {
|
|
34
|
-
return html `${this.editMode
|
|
35
|
-
? html `<ox-contact-edit
|
|
36
|
-
.contact=${this.contact}
|
|
37
|
-
@edit-cancel=${() => (this.editMode = false)}
|
|
38
|
-
@edit-done=${(e) => {
|
|
39
|
-
this.contact = e.detail;
|
|
40
|
-
this.editMode = false;
|
|
41
|
-
}}
|
|
42
|
-
></ox-contact-edit>`
|
|
43
|
-
: html ` <ox-contact-view .contact=${this.contact}></ox-contact-view>
|
|
44
|
-
<button value="Edit" @click=${() => (this.editMode = true)}>Edit</button>`} `;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
OxContact.styles = css `
|
|
48
|
-
:host {
|
|
49
|
-
display: block;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
button {
|
|
53
|
-
display: block;
|
|
54
|
-
margin-left: auto;
|
|
55
|
-
}
|
|
56
|
-
`;
|
|
57
|
-
__decorate([
|
|
58
|
-
property({ type: Object })
|
|
59
|
-
], OxContact.prototype, "contact", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
state()
|
|
62
|
-
], OxContact.prototype, "editMode", void 0);
|
|
63
|
-
OxContact = __decorate([
|
|
64
|
-
customElement('ox-contact')
|
|
65
|
-
], OxContact);
|
|
66
|
-
export { OxContact };
|
|
67
|
-
//# sourceMappingURL=ox-contact%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-contact copy.js","sourceRoot":"","sources":["../../src/ox-contact copy.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,mBAAmB,CAAA;AAC1B,OAAO,mBAAmB,CAAA;AAE1B,MAAM,CAAN,IAAY,YAYX;AAZD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,sCAAsB,CAAA;IACtB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,qCAAqB,CAAA;IACrB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,yCAAyB,CAAA;IACzB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;AACvB,CAAC,EAZW,YAAY,KAAZ,YAAY,QAYvB;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;AAeM,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,UAAU;IAAlC;;QAYuB,YAAO,GAAY,EAAE,CAAA;QAExC,aAAQ,GAAa,KAAK,CAAA;IAerC,CAAC;IAbC,MAAM;QACJ,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,QAAQ;YACzB,CAAC,CAAC,IAAI,CAAA;qBACS,IAAI,CAAC,OAAO;yBACR,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;uBAC/B,CAAC,CAAc,EAAE,EAAE;gBAC9B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,MAAM,CAAA;gBACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAA;YACvB,CAAC;4BACiB;YACtB,CAAC,CAAC,IAAI,CAAA,8BAA8B,IAAI,CAAC,OAAO;wCACd,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,GAAG,CAAA;IACrF,CAAC;;AA3BM,gBAAM,GAAG,GAAG,CAAA;;;;;;;;;GASlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAsB;AAExC;IAAR,KAAK,EAAE;2CAA2B;AAdxB,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA6BrB;SA7BY,SAAS","sourcesContent":["import { html, css, LitElement } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport './ox-contact-edit'\nimport './ox-contact-view'\n\nexport enum ContactField {\n Name = 'name',\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 Company = 'company',\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 items?: ContactItem[]\n note?: string\n}\n\n@customElement('ox-contact')\nexport class OxContact extends LitElement {\n static styles = css`\n :host {\n display: block;\n }\n\n button {\n display: block;\n margin-left: auto;\n }\n `\n\n @property({ type: Object }) contact: Contact = {}\n\n @state() editMode?: boolean = false\n\n render() {\n return html`${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 <button value=\"Edit\" @click=${() => (this.editMode = true)}>Edit</button>`} `\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-contact-edit copy.js","sourceRoot":"","sources":["../../src/ox-contact-edit copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import { OxContactEdit } from './OxContactEdit.js'\n\nwindow.customElements.define('ox-contact-edit', OxContactEdit)\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
export declare class OxPfpEditor extends LitElement {
|
|
3
|
-
static styles: import("lit").CSSResult;
|
|
4
|
-
picture?: string;
|
|
5
|
-
zoom: number;
|
|
6
|
-
left: number;
|
|
7
|
-
top: number;
|
|
8
|
-
container: HTMLDivElement;
|
|
9
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
-
updated(changes: PropertyValues<this>): void;
|
|
11
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
4
|
-
let OxPfpEditor = class OxPfpEditor extends LitElement {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.zoom = 1;
|
|
8
|
-
this.left = 0;
|
|
9
|
-
this.top = 0;
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
return html ` <div container style="background-image: url(${this.picture})"></div> `;
|
|
13
|
-
}
|
|
14
|
-
updated(changes) {
|
|
15
|
-
if (changes.has('picture')) {
|
|
16
|
-
const style = this.container.style;
|
|
17
|
-
style.backgroundImage = `url($this.picture})`;
|
|
18
|
-
style.backgroundPositionX = `${this.left}px`;
|
|
19
|
-
style.backgroundPositionY = `${this.top}px`;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
OxPfpEditor.styles = css `
|
|
24
|
-
:host {
|
|
25
|
-
display: block;
|
|
26
|
-
background-color: black;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[container] {
|
|
30
|
-
width: 200px;
|
|
31
|
-
height: 250px;
|
|
32
|
-
margin: 1em auto;
|
|
33
|
-
-webkit-filter: drop-shadow(0px -4px 4px black);
|
|
34
|
-
filter: drop-shadow(0px -4px 4px black);
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
position: relative;
|
|
37
|
-
background-repeat: no-repeat;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[container]:after {
|
|
41
|
-
position: absolute;
|
|
42
|
-
content: '';
|
|
43
|
-
width: 100px;
|
|
44
|
-
height: 100px;
|
|
45
|
-
box-shadow: 0 0 0 1000px #fff7;
|
|
46
|
-
border-radius: 50%;
|
|
47
|
-
left: 50px;
|
|
48
|
-
top: 35px;
|
|
49
|
-
opacity: 0.5;
|
|
50
|
-
}
|
|
51
|
-
`;
|
|
52
|
-
__decorate([
|
|
53
|
-
property({ type: String })
|
|
54
|
-
], OxPfpEditor.prototype, "picture", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
state()
|
|
57
|
-
], OxPfpEditor.prototype, "zoom", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
state()
|
|
60
|
-
], OxPfpEditor.prototype, "left", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
state()
|
|
63
|
-
], OxPfpEditor.prototype, "top", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
query('[container]')
|
|
66
|
-
], OxPfpEditor.prototype, "container", void 0);
|
|
67
|
-
OxPfpEditor = __decorate([
|
|
68
|
-
customElement('ox-pfp-edit')
|
|
69
|
-
], OxPfpEditor);
|
|
70
|
-
export { OxPfpEditor };
|
|
71
|
-
//# sourceMappingURL=ox-pfp-edit%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-pfp-edit copy.js","sourceRoot":"","sources":["../../src/ox-pfp-edit copy.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAiCI,SAAI,GAAW,CAAC,CAAA;QAChB,SAAI,GAAW,CAAC,CAAA;QAChB,QAAG,GAAW,CAAC,CAAA;IAgB1B,CAAC;IAZC,MAAM;QACJ,OAAO,IAAI,CAAA,gDAAgD,IAAI,CAAC,OAAO,YAAY,CAAA;IACrF,CAAC;IAED,OAAO,CAAC,OAA6B;QACnC,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;YAClC,KAAK,CAAC,eAAe,GAAG,qBAAqB,CAAA;YAC7C,KAAK,CAAC,mBAAmB,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,CAAA;YAC5C,KAAK,CAAC,mBAAmB,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;SAC5C;IACH,CAAC;;AAjDM,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAiB;AAEnC;IAAR,KAAK,EAAE;yCAAiB;AAChB;IAAR,KAAK,EAAE;yCAAiB;AAChB;IAAR,KAAK,EAAE;wCAAgB;AAEF;IAArB,KAAK,CAAC,aAAa,CAAC;8CAA2B;AArCrC,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAmDvB;SAnDY,WAAW","sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\n@customElement('ox-pfp-edit')\nexport class OxPfpEditor extends LitElement {\n static styles = css`\n :host {\n display: block;\n background-color: black;\n }\n\n [container] {\n width: 200px;\n height: 250px;\n margin: 1em auto;\n -webkit-filter: drop-shadow(0px -4px 4px black);\n filter: drop-shadow(0px -4px 4px black);\n overflow: hidden;\n position: relative;\n background-repeat: no-repeat;\n }\n\n [container]:after {\n position: absolute;\n content: '';\n width: 100px;\n height: 100px;\n box-shadow: 0 0 0 1000px #fff7;\n border-radius: 50%;\n left: 50px;\n top: 35px;\n opacity: 0.5;\n }\n `\n\n @property({ type: String }) picture?: string\n\n @state() zoom: number = 1\n @state() left: number = 0\n @state() top: number = 0\n\n @query('[container]') container!: HTMLDivElement\n\n render() {\n return html` <div container style=\"background-image: url(${this.picture})\"></div> `\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('picture')) {\n const style = this.container.style\n style.backgroundImage = `url($this.picture})`\n style.backgroundPositionX = `${this.left}px`\n style.backgroundPositionY = `${this.top}px`\n }\n }\n}\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
import { Profile } from './ox-pfp-viewer';
|
|
3
|
-
export declare class OxPfpEditor extends LitElement {
|
|
4
|
-
static styles: import("lit").CSSResult;
|
|
5
|
-
profile: Profile;
|
|
6
|
-
circle: HTMLDivElement;
|
|
7
|
-
private dragStart?;
|
|
8
|
-
private dragEndHandler;
|
|
9
|
-
private dragMoveHandler;
|
|
10
|
-
private dragStartHandler;
|
|
11
|
-
private wheelEventHandler;
|
|
12
|
-
connectedCallback(): void;
|
|
13
|
-
disconnectedCallback(): void;
|
|
14
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
-
onWheelEvent(e: Event): void;
|
|
16
|
-
onDragStart(e: Event): false | undefined;
|
|
17
|
-
onDragMove(e: Event): boolean;
|
|
18
|
-
onDragEnd(e: Event): void;
|
|
19
|
-
updated(changes: PropertyValues<this>): void;
|
|
20
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
|
-
function getPoint(e) {
|
|
5
|
-
var _a;
|
|
6
|
-
if (e.button == 0) {
|
|
7
|
-
return {
|
|
8
|
-
x: e.clientX,
|
|
9
|
-
y: e.clientY
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
else if (((_a = e.touches) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
13
|
-
const touch = e.touches[0];
|
|
14
|
-
return {
|
|
15
|
-
x: touch.clientX,
|
|
16
|
-
y: touch.clientY
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
let OxPfpEditor = class OxPfpEditor extends LitElement {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.profile = {};
|
|
27
|
-
this.dragEndHandler = this.onDragEnd.bind(this);
|
|
28
|
-
this.dragMoveHandler = this.onDragMove.bind(this);
|
|
29
|
-
this.dragStartHandler = this.onDragStart.bind(this);
|
|
30
|
-
this.wheelEventHandler = this.onWheelEvent.bind(this);
|
|
31
|
-
}
|
|
32
|
-
connectedCallback() {
|
|
33
|
-
super.connectedCallback();
|
|
34
|
-
this.addEventListener('mousewheel', this.wheelEventHandler, false);
|
|
35
|
-
this.addEventListener('mousedown', this.dragStartHandler);
|
|
36
|
-
this.addEventListener('touchstart', this.dragStartHandler);
|
|
37
|
-
document.addEventListener('mouseup', this.dragEndHandler);
|
|
38
|
-
document.addEventListener('touchend', this.dragEndHandler);
|
|
39
|
-
document.addEventListener('touchcancel', this.dragEndHandler);
|
|
40
|
-
document.addEventListener('mousemove', this.dragMoveHandler);
|
|
41
|
-
document.addEventListener('touchmove', this.dragMoveHandler);
|
|
42
|
-
}
|
|
43
|
-
disconnectedCallback() {
|
|
44
|
-
this.removeEventListener('mousewheel', this.wheelEventHandler, false);
|
|
45
|
-
this.removeEventListener('mousedown', this.dragStartHandler);
|
|
46
|
-
this.removeEventListener('touchstart', this.dragStartHandler);
|
|
47
|
-
document.removeEventListener('mouseup', this.dragEndHandler);
|
|
48
|
-
document.removeEventListener('touchend', this.dragEndHandler);
|
|
49
|
-
document.removeEventListener('touchcancel', this.dragEndHandler);
|
|
50
|
-
document.removeEventListener('mousemove', this.dragMoveHandler);
|
|
51
|
-
document.removeEventListener('touchmove', this.dragMoveHandler);
|
|
52
|
-
super.disconnectedCallback();
|
|
53
|
-
}
|
|
54
|
-
render() {
|
|
55
|
-
return html ` <div circle></div> `;
|
|
56
|
-
}
|
|
57
|
-
onWheelEvent(e) {
|
|
58
|
-
e.preventDefault();
|
|
59
|
-
var delta = Math.max(-1, Math.min(1, e.deltaY || -e.detail));
|
|
60
|
-
const { top = 0, left = 0, zoom = 1, picture } = this.profile;
|
|
61
|
-
this.profile = {
|
|
62
|
-
top,
|
|
63
|
-
left,
|
|
64
|
-
zoom: zoom * (1 - delta / 20),
|
|
65
|
-
picture
|
|
66
|
-
};
|
|
67
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
68
|
-
detail: this.profile
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
onDragStart(e) {
|
|
72
|
-
const point = getPoint(e);
|
|
73
|
-
if (point) {
|
|
74
|
-
this.dragStart = point;
|
|
75
|
-
e.stopPropagation();
|
|
76
|
-
return false;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
onDragMove(e) {
|
|
80
|
-
if (!this.dragStart) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
const point = getPoint(e);
|
|
84
|
-
if (!point) {
|
|
85
|
-
return false;
|
|
86
|
-
}
|
|
87
|
-
e.stopPropagation();
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
const dragStart = point;
|
|
90
|
-
var { x, y } = point;
|
|
91
|
-
x -= this.dragStart.x;
|
|
92
|
-
y -= this.dragStart.y;
|
|
93
|
-
this.dragStart = dragStart;
|
|
94
|
-
const { top = 0, left = 0, zoom = 1, picture } = this.profile;
|
|
95
|
-
const { offsetHeight, offsetWidth } = this;
|
|
96
|
-
this.profile = {
|
|
97
|
-
top: top + (y / offsetHeight) * 100,
|
|
98
|
-
left: left + (x / offsetWidth) * 100,
|
|
99
|
-
zoom,
|
|
100
|
-
picture
|
|
101
|
-
};
|
|
102
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
103
|
-
detail: this.profile
|
|
104
|
-
}));
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
onDragEnd(e) {
|
|
108
|
-
if (this.dragStart) {
|
|
109
|
-
e.stopPropagation();
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
delete this.dragStart;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
updated(changes) {
|
|
115
|
-
const { picture = 'linear-gradient(var(--primary-color, gray), var(--primary-color, gray)', zoom = 1, left = 0, top = 0 } = this.profile;
|
|
116
|
-
const style = this.style;
|
|
117
|
-
style.setProperty('--background-image', `url(${picture})`);
|
|
118
|
-
style.setProperty('--image-transform', ` translate(${left}%, ${top}%) scale(${zoom}, ${zoom})`);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
OxPfpEditor.styles = css `
|
|
122
|
-
:host {
|
|
123
|
-
display: inline-block;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
[circle] {
|
|
127
|
-
width: 100%;
|
|
128
|
-
height: 100%;
|
|
129
|
-
border-radius: 50%;
|
|
130
|
-
position: relative;
|
|
131
|
-
background-color: lightgray;
|
|
132
|
-
|
|
133
|
-
overflow: hidden;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
[circle]::before {
|
|
137
|
-
content: '';
|
|
138
|
-
display: block;
|
|
139
|
-
position: absolute;
|
|
140
|
-
text-align: left;
|
|
141
|
-
line-height: 24px;
|
|
142
|
-
top: 0;
|
|
143
|
-
right: 0;
|
|
144
|
-
width: 100%;
|
|
145
|
-
height: 100%;
|
|
146
|
-
background-repeat: no-repeat;
|
|
147
|
-
background-image: var(
|
|
148
|
-
--background-image,
|
|
149
|
-
linear-gradient(var(--primary-color, gray), var(--primary-color, gray))
|
|
150
|
-
);
|
|
151
|
-
transform: var(--image-transform, '');
|
|
152
|
-
background-size: 100% 100%;
|
|
153
|
-
}
|
|
154
|
-
`;
|
|
155
|
-
__decorate([
|
|
156
|
-
property({ type: Object })
|
|
157
|
-
], OxPfpEditor.prototype, "profile", void 0);
|
|
158
|
-
__decorate([
|
|
159
|
-
query('[circle]')
|
|
160
|
-
], OxPfpEditor.prototype, "circle", void 0);
|
|
161
|
-
OxPfpEditor = __decorate([
|
|
162
|
-
customElement('ox-pfp-edit')
|
|
163
|
-
], OxPfpEditor);
|
|
164
|
-
export { OxPfpEditor };
|
|
165
|
-
//# sour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KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,OAAO,OAAO,GAAG,CAAC,CAAA;QAC1D,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,cAAc,IAAI,MAAM,GAAG,YAAY,IAAI,KAAK,IAAI,GAAG,CAAC,CAAA;IACjG,CAAC;;AA1KM,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiClB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAsB;AAE9B;IAAlB,KAAK,CAAC,UAAU,CAAC;2CAAwB;AAtC/B,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA4KvB;SA5KY,WAAW","sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { Profile } from './ox-pfp-view'\n\nfunction getPoint(e: Event): { x: number; y: number } | undefined {\n if ((e as MouseEvent).button == 0) {\n return {\n x: (e as MouseEvent).clientX,\n y: (e as MouseEvent).clientY\n }\n } else if ((e as TouchEvent).touches?.length == 1) {\n const touch = (e as TouchEvent).touches[0]\n return {\n x: touch.clientX,\n y: touch.clientY\n }\n } else {\n return\n }\n}\n\n@customElement('ox-pfp-edit')\nexport class OxPfpEditor extends LitElement {\n static styles = css`\n :host {\n display: inline-block;\n }\n\n [circle] {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n position: relative;\n background-color: lightgray;\n\n overflow: hidden;\n }\n\n [circle]::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 background-repeat: no-repeat;\n background-image: var(\n --background-image,\n linear-gradient(var(--primary-color, gray), var(--primary-color, gray))\n );\n transform: var(--image-transform, '');\n background-size: 100% 100%;\n }\n `\n\n @property({ type: Object }) profile: Profile = {}\n\n @query('[circle]') circle!: HTMLDivElement\n\n private dragStart?: { x: number; y: number }\n private dragEndHandler = this.onDragEnd.bind(this) as EventListener\n private dragMoveHandler = this.onDragMove.bind(this) as EventListener\n private dragStartHandler = this.onDragStart.bind(this) as EventListener\n private wheelEventHandler = this.onWheelEvent.bind(this) as EventListener\n\n connectedCallback(): void {\n super.connectedCallback()\n\n this.addEventListener('mousewheel', this.wheelEventHandler, false)\n\n this.addEventListener('mousedown', this.dragStartHandler)\n this.addEventListener('touchstart', this.dragStartHandler)\n\n document.addEventListener('mouseup', this.dragEndHandler)\n document.addEventListener('touchend', this.dragEndHandler)\n document.addEventListener('touchcancel', this.dragEndHandler)\n document.addEventListener('mousemove', this.dragMoveHandler)\n document.addEventListener('touchmove', this.dragMoveHandler)\n }\n\n disconnectedCallback() {\n this.removeEventListener('mousewheel', this.wheelEventHandler, false)\n\n this.removeEventListener('mousedown', this.dragStartHandler!)\n this.removeEventListener('touchstart', this.dragStartHandler!)\n\n document.removeEventListener('mouseup', this.dragEndHandler!)\n document.removeEventListener('touchend', this.dragEndHandler!)\n document.removeEventListener('touchcancel', this.dragEndHandler!)\n document.removeEventListener('mousemove', this.dragMoveHandler!)\n document.removeEventListener('touchmove', this.dragMoveHandler!)\n\n super.disconnectedCallback()\n }\n\n render() {\n return html` <div circle></div> `\n }\n\n onWheelEvent(e: Event) {\n e.preventDefault()\n\n var delta = Math.max(-1, Math.min(1, (e as WheelEvent).deltaY || -(e as WheelEvent).detail))\n\n const { top = 0, left = 0, zoom = 1, picture } = this.profile\n this.profile = {\n top,\n left,\n zoom: zoom * (1 - delta / 20),\n picture\n }\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.profile\n })\n )\n }\n\n onDragStart(e: Event) {\n const point = getPoint(e)\n\n if (point) {\n this.dragStart = point\n e.stopPropagation()\n return false\n }\n }\n\n onDragMove(e: Event) {\n if (!this.dragStart) {\n return false\n }\n\n const point = getPoint(e)\n\n if (!point) {\n return false\n }\n\n e.stopPropagation()\n e.preventDefault()\n\n const dragStart = point\n var { x, y } = point\n\n x -= this.dragStart.x\n y -= this.dragStart.y\n\n this.dragStart = dragStart\n\n const { top = 0, left = 0, zoom = 1, picture } = this.profile\n const { offsetHeight, offsetWidth } = this\n\n this.profile = {\n top: top + (y / offsetHeight) * 100,\n left: left + (x / offsetWidth) * 100,\n zoom,\n picture\n }\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.profile\n })\n )\n\n return false\n }\n\n onDragEnd(e: Event) {\n if (this.dragStart) {\n e.stopPropagation()\n e.preventDefault()\n\n delete this.dragStart\n }\n }\n\n updated(changes: PropertyValues<this>) {\n const {\n picture = 'linear-gradient(var(--primary-color, gray), var(--primary-color, gray)',\n zoom = 1,\n left = 0,\n top = 0\n } = this.profile\n const style = this.style\n\n style.setProperty('--background-image', `url(${picture})`)\n style.setProperty('--image-transform', ` translate(${left}%, ${top}%) scale(${zoom}, ${zoom})`)\n }\n}\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
export type Profile = {
|
|
3
|
-
left?: number;
|
|
4
|
-
top?: number;
|
|
5
|
-
zoom?: number;
|
|
6
|
-
picture?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class OxPfpViewer extends LitElement {
|
|
9
|
-
static styles: import("lit").CSSResult;
|
|
10
|
-
profile: Profile;
|
|
11
|
-
circle: HTMLDivElement;
|
|
12
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
-
updated(changes: PropertyValues<this>): void;
|
|
14
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import { html, css, LitElement } from 'lit';
|
|
3
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
4
|
-
let OxPfpViewer = class OxPfpViewer extends LitElement {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.profile = {};
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return html ` <div circle></div> `;
|
|
11
|
-
}
|
|
12
|
-
updated(changes) {
|
|
13
|
-
const { picture = 'linear-gradient(var(--primary-color, gray), var(--primary-color, gray)', zoom = 1, left = 0, top = 0 } = this.profile;
|
|
14
|
-
const style = this.style;
|
|
15
|
-
style.setProperty('--background-image', `url(${picture})`);
|
|
16
|
-
style.setProperty('--image-transform', `translate(${left}%, ${top}%) scale(${zoom}, ${zoom})`);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
OxPfpViewer.styles = css `
|
|
20
|
-
:host {
|
|
21
|
-
display: inline-block;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
[circle] {
|
|
25
|
-
width: 100%;
|
|
26
|
-
height: 100%;
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
position: relative;
|
|
29
|
-
background-color: lightgray;
|
|
30
|
-
|
|
31
|
-
overflow: hidden;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
[circle]::before {
|
|
35
|
-
content: '';
|
|
36
|
-
display: block;
|
|
37
|
-
position: absolute;
|
|
38
|
-
text-align: left;
|
|
39
|
-
line-height: 24px;
|
|
40
|
-
top: 0;
|
|
41
|
-
right: 0;
|
|
42
|
-
width: 100%;
|
|
43
|
-
height: 100%;
|
|
44
|
-
background-repeat: no-repeat;
|
|
45
|
-
background-image: var(
|
|
46
|
-
--background-image,
|
|
47
|
-
linear-gradient(var(--primary-color, gray), var(--primary-color, gray))
|
|
48
|
-
);
|
|
49
|
-
transform: var(--image-transform, '');
|
|
50
|
-
background-size: 100% 100%;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
53
|
-
__decorate([
|
|
54
|
-
property({ type: Object })
|
|
55
|
-
], OxPfpViewer.prototype, "profile", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
query('[circle]')
|
|
58
|
-
], OxPfpViewer.prototype, "circle", void 0);
|
|
59
|
-
OxPfpViewer = __decorate([
|
|
60
|
-
customElement('ox-pfp-view')
|
|
61
|
-
], OxPfpViewer);
|
|
62
|
-
export { OxPfpViewer };
|
|
63
|
-
//# sourceMappingURL=ox-pfp-view.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-pfp-view.js","sourceRoot":"","sources":["../../src/ox-pfp-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AAUlE,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAoCuB,YAAO,GAAY,EAAE,CAAA;IAoBnD,CAAC;IAhBC,MAAM;QACJ,OAAO,IAAI,CAAA,sBAAsB,CAAA;IACnC,CAAC;IAED,OAAO,CAAC,OAA6B;QACnC,MAAM,EACJ,OAAO,GAAG,wEAAwE,EAClF,IAAI,GAAG,CAAC,EACR,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACR,GAAG,IAAI,CAAC,OAAO,CAAA;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,KAAK,CAAC,WAAW,CAAC,oBAAoB,EAAE,OAAO,OAAO,GAAG,CAAC,CAAA;QAC1D,KAAK,CAAC,WAAW,CAAC,mBAAmB,EAAE,aAAa,IAAI,MAAM,GAAG,YAAY,IAAI,KAAK,IAAI,GAAG,CAAC,CAAA;IAChG,CAAC;;AAtDM,kBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiClB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAsB;AAE9B;IAAlB,KAAK,CAAC,UAAU,CAAC;2CAAwB;AAtC/B,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CAwDvB;SAxDY,WAAW","sourcesContent":["import { html, css, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nexport type Profile = {\n left?: number\n top?: number\n zoom?: number\n picture?: string\n}\n\n@customElement('ox-pfp-view')\nexport class OxPfpViewer extends LitElement {\n static styles = css`\n :host {\n display: inline-block;\n }\n\n [circle] {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n position: relative;\n background-color: lightgray;\n\n overflow: hidden;\n }\n\n [circle]::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 background-repeat: no-repeat;\n background-image: var(\n --background-image,\n linear-gradient(var(--primary-color, gray), var(--primary-color, gray))\n );\n transform: var(--image-transform, '');\n background-size: 100% 100%;\n }\n `\n\n @property({ type: Object }) profile: Profile = {}\n\n @query('[circle]') circle!: HTMLDivElement\n\n render() {\n return html` <div circle></div> `\n }\n\n updated(changes: PropertyValues<this>) {\n const {\n picture = 'linear-gradient(var(--primary-color, gray), var(--primary-color, gray)',\n zoom = 1,\n left = 0,\n top = 0\n } = this.profile\n const style = this.style\n\n style.setProperty('--background-image', `url(${picture})`)\n style.setProperty('--image-transform', `translate(${left}%, ${top}%) scale(${zoom}, ${zoom})`)\n }\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import '@material/mwc-icon-button';
|
|
4
|
-
import '../src/ox-contact.js';
|
|
5
|
-
import { Contact } from '../src/ox-contact.js';
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: string;
|
|
9
|
-
argTypes: {
|
|
10
|
-
contact: {
|
|
11
|
-
control: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
16
|
-
interface Story<T> {
|
|
17
|
-
(args: T): TemplateResult;
|
|
18
|
-
args?: Partial<T>;
|
|
19
|
-
argTypes?: Record<string, unknown>;
|
|
20
|
-
}
|
|
21
|
-
interface ArgTypes {
|
|
22
|
-
contact?: Contact;
|
|
23
|
-
}
|
|
24
|
-
export declare const Regular: Story<ArgTypes>;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import '@material/mwc-icon-button';
|
|
4
|
-
import '../src/ox-contact.js';
|
|
5
|
-
import { ContactField } from '../src/ox-contact.js';
|
|
6
|
-
export default {
|
|
7
|
-
title: 'OxContact',
|
|
8
|
-
component: 'ox-contact',
|
|
9
|
-
argTypes: {
|
|
10
|
-
contact: { control: 'object' }
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
const Template = ({ contact }) => html `
|
|
14
|
-
<link href="/themes/app-theme.css" rel="stylesheet" />
|
|
15
|
-
<link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
|
|
16
|
-
<style>
|
|
17
|
-
body {
|
|
18
|
-
}
|
|
19
|
-
</style>
|
|
20
|
-
|
|
21
|
-
<ox-contact .contact=${contact}> </ox-contact>
|
|
22
|
-
`;
|
|
23
|
-
export const Regular = Template.bind({});
|
|
24
|
-
Regular.args = {
|
|
25
|
-
contact: {
|
|
26
|
-
note: 'abcdefg',
|
|
27
|
-
items: [
|
|
28
|
-
{
|
|
29
|
-
id: '1',
|
|
30
|
-
type: ContactField.Name,
|
|
31
|
-
label: 'name',
|
|
32
|
-
value: '남 상혁'
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: '2',
|
|
36
|
-
type: ContactField.Phone,
|
|
37
|
-
label: 'home',
|
|
38
|
-
value: '010-1223-3443'
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
id: '3',
|
|
42
|
-
type: ContactField.Phone,
|
|
43
|
-
label: 'mobile',
|
|
44
|
-
value: '010-1122-3344'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: '4',
|
|
48
|
-
type: ContactField.Email,
|
|
49
|
-
label: 'work',
|
|
50
|
-
value: 'heartyoh@hatiolab.com'
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
id: '5',
|
|
54
|
-
type: ContactField.Email,
|
|
55
|
-
label: 'home',
|
|
56
|
-
value: 'shnam2k@gmail.com'
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: '6',
|
|
60
|
-
type: ContactField.Address,
|
|
61
|
-
label: 'home',
|
|
62
|
-
value: '경기도 성남시 분당구 123'
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
id: '7',
|
|
66
|
-
type: ContactField.Address,
|
|
67
|
-
label: 'work',
|
|
68
|
-
value: '경기도 성남시 분당구 234'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
id: '8',
|
|
72
|
-
type: ContactField.Address,
|
|
73
|
-
label: 'work',
|
|
74
|
-
value: '서울특별시 종로구 123'
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=index.stories%20copy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.stories copy.js","sourceRoot":"","sources":["../../stories/index.stories copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,oBAAoB,CAAA;AAC3B,OAAO,2BAA2B,CAAA;AAClC,OAAO,sBAAsB,CAAA;AAE7B,OAAO,EAAW,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAE5D,eAAe;IACb,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,YAAY;IACvB,QAAQ,EAAE;QACR,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;KAC/B;CACF,CAAA;AAYD,MAAM,QAAQ,GAAoB,CAAC,EAAE,OAAO,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;yBAQxC,OAAO;CAC/B,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,IAAI;gBACvB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,MAAM;aACd;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,KAAK;gBACxB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,eAAe;aACvB;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,KAAK;gBACxB,KAAK,EAAE,QAAQ;gBACf,KAAK,EAAE,eAAe;aACvB;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,KAAK;gBACxB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,uBAAuB;aAC/B;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,KAAK;gBACxB,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,mBAAmB;aAC3B;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,OAAO;gBAC1B,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,iBAAiB;aACzB;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,OAAO;gBAC1B,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,iBAAiB;aACzB;YACD;gBACE,EAAE,EAAE,GAAG;gBACP,IAAI,EAAE,YAAY,CAAC,OAAO;gBAC1B,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,eAAe;aACvB;SACF;KACF;CACF,CAAA","sourcesContent":["import { html, TemplateResult } from 'lit'\nimport '@material/mwc-icon'\nimport '@material/mwc-icon-button'\nimport '../src/ox-contact.js'\n\nimport { Contact, ContactField } from '../src/ox-contact.js'\n\nexport default {\n title: 'OxContact',\n component: 'ox-contact',\n argTypes: {\n contact: { control: 'object' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n contact?: Contact\n}\n\nconst Template: Story<ArgTypes> = ({ contact }: ArgTypes) => html`\n <link href=\"/themes/app-theme.css\" rel=\"stylesheet\" />\n <link href=\"https://fonts.googleapis.com/css?family=Material+Icons&display=block\" rel=\"stylesheet\" />\n <style>\n body {\n }\n </style>\n\n <ox-contact .contact=${contact}> </ox-contact>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n contact: {\n note: 'abcdefg',\n items: [\n {\n id: '1',\n type: ContactField.Name,\n label: 'name',\n value: '남 상혁'\n },\n {\n id: '2',\n type: ContactField.Phone,\n label: 'home',\n value: '010-1223-3443'\n },\n {\n id: '3',\n type: ContactField.Phone,\n label: 'mobile',\n value: '010-1122-3344'\n },\n {\n id: '4',\n type: ContactField.Email,\n label: 'work',\n value: 'heartyoh@hatiolab.com'\n },\n {\n id: '5',\n type: ContactField.Email,\n label: 'home',\n value: 'shnam2k@gmail.com'\n },\n {\n id: '6',\n type: ContactField.Address,\n label: 'home',\n value: '경기도 성남시 분당구 123'\n },\n {\n id: '7',\n type: ContactField.Address,\n label: 'work',\n value: '경기도 성남시 분당구 234'\n },\n {\n id: '8',\n type: ContactField.Address,\n label: 'work',\n value: '서울특별시 종로구 123'\n }\n ]\n }\n}\n"]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
2
|
-
import '@material/mwc-icon';
|
|
3
|
-
import '@material/mwc-icon-button';
|
|
4
|
-
import '../src/ox-contact.js';
|
|
5
|
-
import { Contact } from '../src/ox-contact.js';
|
|
6
|
-
declare const _default: {
|
|
7
|
-
title: string;
|
|
8
|
-
component: string;
|
|
9
|
-
argTypes: {
|
|
10
|
-
contact: {
|
|
11
|
-
control: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export default _default;
|
|
16
|
-
interface Story<T> {
|
|
17
|
-
(args: T): TemplateResult;
|
|
18
|
-
args?: Partial<T>;
|
|
19
|
-
argTypes?: Record<string, unknown>;
|
|
20
|
-
}
|
|
21
|
-
interface ArgTypes {
|
|
22
|
-
contact?: Contact;
|
|
23
|
-
}
|
|
24
|
-
export declare const Regular: Story<ArgTypes>;
|