@operato/popup 9.0.0-beta.52 → 9.0.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 +8 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/stories/open-popup.stories.d.ts +0 -47
- package/dist/stories/open-popup.stories.js +0 -75
- package/dist/stories/open-popup.stories.js.map +0 -1
- package/dist/stories/ox-popup-list-image-2.stories.d.ts +0 -23
- package/dist/stories/ox-popup-list-image-2.stories.js +0 -133
- package/dist/stories/ox-popup-list-image-2.stories.js.map +0 -1
- package/dist/stories/ox-popup-list-image.stories.d.ts +0 -23
- package/dist/stories/ox-popup-list-image.stories.js +0 -208
- package/dist/stories/ox-popup-list-image.stories.js.map +0 -1
- package/dist/stories/ox-popup-list-sortable.stories.d.ts +0 -24
- package/dist/stories/ox-popup-list-sortable.stories.js +0 -196
- package/dist/stories/ox-popup-list-sortable.stories.js.map +0 -1
- package/dist/stories/ox-popup-list.stories.d.ts +0 -23
- package/dist/stories/ox-popup-list.stories.js +0 -104
- package/dist/stories/ox-popup-list.stories.js.map +0 -1
- package/dist/stories/ox-popup-menu.stories.d.ts +0 -19
- package/dist/stories/ox-popup-menu.stories.js +0 -175
- package/dist/stories/ox-popup-menu.stories.js.map +0 -1
- package/dist/stories/ox-popup.stories.d.ts +0 -16
- package/dist/stories/ox-popup.stories.js +0 -66
- package/dist/stories/ox-popup.stories.js.map +0 -1
- package/dist/stories/ox-prompt-icon.stories.d.ts +0 -26
- package/dist/stories/ox-prompt-icon.stories.js +0 -68
- package/dist/stories/ox-prompt-icon.stories.js.map +0 -1
- package/dist/stories/ox-prompt-normal.stories.d.ts +0 -21
- package/dist/stories/ox-prompt-normal.stories.js +0 -65
- package/dist/stories/ox-prompt-normal.stories.js.map +0 -1
- package/dist/stories/ox-prompt.stories.d.ts +0 -20
- package/dist/stories/ox-prompt.stories.js +0 -66
- package/dist/stories/ox-prompt.stories.js.map +0 -1
@@ -1,196 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js';
|
2
|
-
import '@material/web/button/outlined-button.js';
|
3
|
-
import '@operato/input/ox-checkbox.js';
|
4
|
-
import '../src/ox-popup-list.js';
|
5
|
-
import { html } from 'lit';
|
6
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
7
|
-
export default {
|
8
|
-
title: 'sortable OxPopupList',
|
9
|
-
component: 'ox-popup-list',
|
10
|
-
argTypes: {
|
11
|
-
preventCloseOnBlur: { control: 'boolean' }
|
12
|
-
}
|
13
|
-
};
|
14
|
-
function popup(e) {
|
15
|
-
const popupList = document.querySelector('#popup-list');
|
16
|
-
popupList?.open({
|
17
|
-
top: e.offsetY,
|
18
|
-
left: e.offsetX
|
19
|
-
});
|
20
|
-
}
|
21
|
-
const columns = [
|
22
|
-
{
|
23
|
-
name: 'AAAAAA',
|
24
|
-
hidden: false
|
25
|
-
},
|
26
|
-
{
|
27
|
-
name: 'BBBBBB',
|
28
|
-
hidden: true
|
29
|
-
},
|
30
|
-
{
|
31
|
-
name: 'CCCCCC',
|
32
|
-
hidden: false
|
33
|
-
},
|
34
|
-
{
|
35
|
-
name: 'DDDDDD',
|
36
|
-
hidden: false
|
37
|
-
},
|
38
|
-
{
|
39
|
-
name: 'EEEEEE',
|
40
|
-
hidden: false
|
41
|
-
},
|
42
|
-
{
|
43
|
-
name: 'FFFFFF',
|
44
|
-
hidden: false
|
45
|
-
},
|
46
|
-
{
|
47
|
-
name: 'GGGGGG',
|
48
|
-
hidden: false
|
49
|
-
},
|
50
|
-
{
|
51
|
-
name: 'HHHHHH',
|
52
|
-
hidden: false
|
53
|
-
},
|
54
|
-
{
|
55
|
-
name: 'IIIIII',
|
56
|
-
hidden: false
|
57
|
-
},
|
58
|
-
{
|
59
|
-
name: 'JJJJJJ',
|
60
|
-
hidden: false
|
61
|
-
},
|
62
|
-
{
|
63
|
-
name: 'KKKKKK',
|
64
|
-
hidden: false
|
65
|
-
},
|
66
|
-
{
|
67
|
-
name: 'LLLLLL',
|
68
|
-
hidden: false
|
69
|
-
},
|
70
|
-
{
|
71
|
-
name: 'MMMMMM',
|
72
|
-
hidden: false
|
73
|
-
}
|
74
|
-
];
|
75
|
-
const Template = ({ preventCloseOnBlur }) => html `
|
76
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
77
|
-
|
78
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
79
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
80
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
81
|
-
|
82
|
-
<link
|
83
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
84
|
-
rel="stylesheet"
|
85
|
-
/>
|
86
|
-
<link
|
87
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
88
|
-
rel="stylesheet"
|
89
|
-
/>
|
90
|
-
<link
|
91
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
92
|
-
rel="stylesheet"
|
93
|
-
/>
|
94
|
-
|
95
|
-
<style>
|
96
|
-
${MDTypeScaleStyles.cssText}
|
97
|
-
</style>
|
98
|
-
|
99
|
-
<style>
|
100
|
-
#place {
|
101
|
-
position: relative;
|
102
|
-
width: 100%;
|
103
|
-
height: 100px;
|
104
|
-
background: lightgreen;
|
105
|
-
text-align: center;
|
106
|
-
line-height: 100px;
|
107
|
-
padding: 20px;
|
108
|
-
margin: 20px;
|
109
|
-
|
110
|
-
background-color: var(--md-sys-color-primary-container);
|
111
|
-
color: var(--md-sys-color-on-primary-container);
|
112
|
-
}
|
113
|
-
|
114
|
-
#place-child {
|
115
|
-
position: relative;
|
116
|
-
display: block;
|
117
|
-
width: 100%;
|
118
|
-
height: 100%;
|
119
|
-
background-color: var(--md-sys-color-primary);
|
120
|
-
color: var(--md-sys-color-on-primary);
|
121
|
-
}
|
122
|
-
|
123
|
-
ox-popup-list {
|
124
|
-
width: 240px;
|
125
|
-
max-height: 240px;
|
126
|
-
overflow: hidden;
|
127
|
-
}
|
128
|
-
|
129
|
-
[titler] {
|
130
|
-
--md-icon-size: 1.2em;
|
131
|
-
--md-outlined-button-container-height: 24px;
|
132
|
-
--md-outlined-button-container-shape: 4px;
|
133
|
-
--md-outlined-button-leading-space: 4px;
|
134
|
-
--md-outlined-button-trailing-space: 4px;
|
135
|
-
|
136
|
-
display: flex;
|
137
|
-
flex-direction: row;
|
138
|
-
align-items: center;
|
139
|
-
text-transform: capitalize;
|
140
|
-
}
|
141
|
-
|
142
|
-
md-outlined-button {
|
143
|
-
margin-left: auto;
|
144
|
-
}
|
145
|
-
|
146
|
-
[option] {
|
147
|
-
position: relative; /* 상대 위치 설정 */
|
148
|
-
cursor: move; /* 커서를 이동 가능 표시로 변경 */
|
149
|
-
user-select: none;
|
150
|
-
}
|
151
|
-
|
152
|
-
[option]::after {
|
153
|
-
content: '☰'; /* 드래그 핸들 아이콘 (혹은 기호) */
|
154
|
-
position: absolute; /* 절대 위치 설정 */
|
155
|
-
top: 0; /* 위에서부터 10px */
|
156
|
-
right: 10px; /* 오른쪽에서부터 10px */
|
157
|
-
font-size: 20px; /* 폰트 크기 설정 */
|
158
|
-
color: #888; /* 폰트 색상 설정 */
|
159
|
-
}
|
160
|
-
|
161
|
-
div[overlay] {
|
162
|
-
display: block;
|
163
|
-
width: 300px;
|
164
|
-
height: 300px;
|
165
|
-
left: 100px;
|
166
|
-
top: 100px;
|
167
|
-
z-index: 10000;
|
168
|
-
background-color: var(--md-sys-color-surface);
|
169
|
-
}
|
170
|
-
</style>
|
171
|
-
|
172
|
-
<div id="place">
|
173
|
-
<div id="place-child" @click=${(e) => popup(e)}>
|
174
|
-
Click this to popup list
|
175
|
-
<ox-popup-list
|
176
|
-
id="popup-list"
|
177
|
-
@select=${(e) => console.log('select', e.target)}
|
178
|
-
@sorted=${(e) => {
|
179
|
-
console.log('sorted\n', e.detail.map((element) => element.value).join('\n'));
|
180
|
-
}}
|
181
|
-
multiple
|
182
|
-
sortable
|
183
|
-
?prevent-close-on-blur=${preventCloseOnBlur}
|
184
|
-
>
|
185
|
-
<div slot="header" titler>Plain Text <md-outlined-button>save</md-outlined-button></div>
|
186
|
-
${columns.map(column => html `
|
187
|
-
<ox-checkbox label="checkbox" ?checked=${!column.hidden} value=${column.name} option />${column.name}</ox-checkbox>
|
188
|
-
`)}
|
189
|
-
</ox-popup-list>
|
190
|
-
</div>
|
191
|
-
</div>
|
192
|
-
<div overlay>OVERLAYED</div>
|
193
|
-
`;
|
194
|
-
export const Regular = Template.bind({});
|
195
|
-
Regular.args = {};
|
196
|
-
//# sourceMappingURL=ox-popup-list-sortable.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-popup-list-sortable.stories.js","sourceRoot":"","sources":["../../stories/ox-popup-list-sortable.stories.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,yCAAyC,CAAA;AAChD,OAAO,+BAA+B,CAAA;AACtC,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAG1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,kBAAkB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KAC3C;CACF,CAAA;AAYD,SAAS,KAAK,CAAC,CAAa;IAC1B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAgB,CAAA;IACtE,SAAS,EAAE,IAAI,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,OAAO;QACd,IAAI,EAAE,CAAC,CAAC,OAAO;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,IAAI;KACb;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;KACd;CACF,CAAA;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAE,kBAAkB,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBtE,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA6EI,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;;;;kBAI5C,CAAC,CAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;kBAC7C,CAAC,CAAQ,EAAE,EAAE;IACrB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAG,CAAiB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;AACpG,CAAC;;;iCAGwB,kBAAkB;;;UAGzC,OAAO,CAAC,GAAG,CACX,MAAM,CAAC,EAAE,CAAC,IAAI,CAAA;iDACyB,CAAC,MAAM,CAAC,MAAM,UAAU,MAAM,CAAC,IAAI,aAAa,MAAM,CAAC,IAAI;OACrG,CACE;;;;;CAKR,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@material/web/button/outlined-button.js'\nimport '@operato/input/ox-checkbox.js'\nimport '../src/ox-popup-list.js'\n\nimport { html, TemplateResult } from 'lit'\n\nimport { OxPopupList } from '../src/ox-popup-list.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nexport default {\n title: 'sortable OxPopupList',\n component: 'ox-popup-list',\n argTypes: {\n preventCloseOnBlur: { control: 'boolean' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n preventCloseOnBlur: boolean\n}\n\nfunction popup(e: MouseEvent) {\n const popupList = document.querySelector('#popup-list') as OxPopupList\n popupList?.open({\n top: e.offsetY,\n left: e.offsetX\n })\n}\n\nconst columns = [\n {\n name: 'AAAAAA',\n hidden: false\n },\n {\n name: 'BBBBBB',\n hidden: true\n },\n {\n name: 'CCCCCC',\n hidden: false\n },\n {\n name: 'DDDDDD',\n hidden: false\n },\n {\n name: 'EEEEEE',\n hidden: false\n },\n {\n name: 'FFFFFF',\n hidden: false\n },\n {\n name: 'GGGGGG',\n hidden: false\n },\n {\n name: 'HHHHHH',\n hidden: false\n },\n {\n name: 'IIIIII',\n hidden: false\n },\n {\n name: 'JJJJJJ',\n hidden: false\n },\n {\n name: 'KKKKKK',\n hidden: false\n },\n {\n name: 'LLLLLL',\n hidden: false\n },\n {\n name: 'MMMMMM',\n hidden: false\n }\n]\n\nconst Template: Story<ArgTypes> = ({ preventCloseOnBlur }: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n #place {\n position: relative;\n width: 100%;\n height: 100px;\n background: lightgreen;\n text-align: center;\n line-height: 100px;\n padding: 20px;\n margin: 20px;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n\n #place-child {\n position: relative;\n display: block;\n width: 100%;\n height: 100%;\n background-color: var(--md-sys-color-primary);\n color: var(--md-sys-color-on-primary);\n }\n\n ox-popup-list {\n width: 240px;\n max-height: 240px;\n overflow: hidden;\n }\n\n [titler] {\n --md-icon-size: 1.2em;\n --md-outlined-button-container-height: 24px;\n --md-outlined-button-container-shape: 4px;\n --md-outlined-button-leading-space: 4px;\n --md-outlined-button-trailing-space: 4px;\n\n display: flex;\n flex-direction: row;\n align-items: center;\n text-transform: capitalize;\n }\n\n md-outlined-button {\n margin-left: auto;\n }\n\n [option] {\n position: relative; /* 상대 위치 설정 */\n cursor: move; /* 커서를 이동 가능 표시로 변경 */\n user-select: none;\n }\n\n [option]::after {\n content: '☰'; /* 드래그 핸들 아이콘 (혹은 기호) */\n position: absolute; /* 절대 위치 설정 */\n top: 0; /* 위에서부터 10px */\n right: 10px; /* 오른쪽에서부터 10px */\n font-size: 20px; /* 폰트 크기 설정 */\n color: #888; /* 폰트 색상 설정 */\n }\n\n div[overlay] {\n display: block;\n width: 300px;\n height: 300px;\n left: 100px;\n top: 100px;\n z-index: 10000;\n background-color: var(--md-sys-color-surface);\n }\n </style>\n\n <div id=\"place\">\n <div id=\"place-child\" @click=${(e: MouseEvent) => popup(e)}>\n Click this to popup list\n <ox-popup-list\n id=\"popup-list\"\n @select=${(e: Event) => console.log('select', e.target)}\n @sorted=${(e: Event) => {\n console.log('sorted\\n', (e as CustomEvent).detail.map((element: any) => element.value).join('\\n'))\n }}\n multiple\n sortable\n ?prevent-close-on-blur=${preventCloseOnBlur}\n >\n <div slot=\"header\" titler>Plain Text <md-outlined-button>save</md-outlined-button></div>\n ${columns.map(\n column => html`\n <ox-checkbox label=\"checkbox\" ?checked=${!column.hidden} value=${column.name} option />${column.name}</ox-checkbox>\n `\n )}\n </ox-popup-list>\n </div>\n </div>\n <div overlay>OVERLAYED</div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import '@operato/input/ox-checkbox.js';
|
3
|
-
import '../src/ox-popup-list.js';
|
4
|
-
import { TemplateResult } from 'lit';
|
5
|
-
declare const _default: {
|
6
|
-
title: string;
|
7
|
-
component: string;
|
8
|
-
argTypes: {
|
9
|
-
preventCloseOnBlur: {
|
10
|
-
control: string;
|
11
|
-
};
|
12
|
-
};
|
13
|
-
};
|
14
|
-
export default _default;
|
15
|
-
interface Story<T> {
|
16
|
-
(args: T): TemplateResult;
|
17
|
-
args?: Partial<T>;
|
18
|
-
argTypes?: Record<string, unknown>;
|
19
|
-
}
|
20
|
-
interface ArgTypes {
|
21
|
-
preventCloseOnBlur: boolean;
|
22
|
-
}
|
23
|
-
export declare const Regular: Story<ArgTypes>;
|
@@ -1,104 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import '@operato/input/ox-checkbox.js';
|
3
|
-
import '../src/ox-popup-list.js';
|
4
|
-
import { html } from 'lit';
|
5
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
6
|
-
export default {
|
7
|
-
title: 'OxPopupList',
|
8
|
-
component: 'ox-popup-list',
|
9
|
-
argTypes: {
|
10
|
-
preventCloseOnBlur: { control: 'boolean' }
|
11
|
-
}
|
12
|
-
};
|
13
|
-
function popup(e, preventCloseOnBlur) {
|
14
|
-
const popupList = document.querySelector('#popup-list');
|
15
|
-
popupList.preventCloseOnBlur = preventCloseOnBlur;
|
16
|
-
popupList?.open({
|
17
|
-
top: e.offsetY,
|
18
|
-
left: e.offsetX
|
19
|
-
});
|
20
|
-
}
|
21
|
-
const Template = ({ preventCloseOnBlur }) => html `
|
22
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
23
|
-
|
24
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
25
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
26
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
27
|
-
|
28
|
-
<link
|
29
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
30
|
-
rel="stylesheet"
|
31
|
-
/>
|
32
|
-
<link
|
33
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
34
|
-
rel="stylesheet"
|
35
|
-
/>
|
36
|
-
<link
|
37
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
38
|
-
rel="stylesheet"
|
39
|
-
/>
|
40
|
-
|
41
|
-
<style>
|
42
|
-
${MDTypeScaleStyles.cssText}
|
43
|
-
</style>
|
44
|
-
|
45
|
-
<style>
|
46
|
-
#container {
|
47
|
-
display: flex;
|
48
|
-
}
|
49
|
-
|
50
|
-
#noise {
|
51
|
-
width: 100px;
|
52
|
-
height: 100px;
|
53
|
-
}
|
54
|
-
|
55
|
-
#place {
|
56
|
-
position: fixed;
|
57
|
-
top: 50%;
|
58
|
-
left: 50%;
|
59
|
-
transform: translate(-50%, -50%);
|
60
|
-
|
61
|
-
width: 50%;
|
62
|
-
height: 50%;
|
63
|
-
text-align: center;
|
64
|
-
|
65
|
-
background-color: var(--md-sys-color-primary-container);
|
66
|
-
color: var(--md-sys-color-on-primary-container);
|
67
|
-
border: 2px solid var(--md-sys-color-primary);
|
68
|
-
}
|
69
|
-
</style>
|
70
|
-
|
71
|
-
<div id="container">
|
72
|
-
<div id="noise"></div>
|
73
|
-
<div id="place" @click=${(e) => popup(e, preventCloseOnBlur)} class="md-typescale-display-medium">
|
74
|
-
Click this to popup list
|
75
|
-
<ox-popup-list
|
76
|
-
id="popup-list"
|
77
|
-
@select=${(e) => console.log('select', e.target)}
|
78
|
-
multiple
|
79
|
-
?prevent-close-on-blur=${preventCloseOnBlur}
|
80
|
-
>
|
81
|
-
<div option>Plain Text</div>
|
82
|
-
|
83
|
-
<div option>
|
84
|
-
<ox-checkbox label="checkbox" slot="icon" checked>checkbox</ox-checkbox>
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div option>
|
88
|
-
<input id="checkbox-01" type="checkbox" />
|
89
|
-
<label for="checkbox-01">custom option</label>
|
90
|
-
</div>
|
91
|
-
|
92
|
-
<div option>
|
93
|
-
<label for="text-01">value</label>
|
94
|
-
<input id="text-01" type="text" value="Plain text input" />
|
95
|
-
</div>
|
96
|
-
</ox-popup-list>
|
97
|
-
</div>
|
98
|
-
</div>
|
99
|
-
`;
|
100
|
-
export const Regular = Template.bind({});
|
101
|
-
Regular.args = {
|
102
|
-
preventCloseOnBlur: true
|
103
|
-
};
|
104
|
-
//# sourceMappingURL=ox-popup-list.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-popup-list.stories.js","sourceRoot":"","sources":["../../stories/ox-popup-list.stories.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,+BAA+B,CAAA;AACtC,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAI7F,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,kBAAkB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KAC3C;CACF,CAAA;AAYD,SAAS,KAAK,CAAC,CAAa,EAAE,kBAA2B;IACvD,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAgB,CAAA;IACtE,SAAS,CAAC,kBAAkB,GAAG,kBAAkB,CAAA;IAEjD,SAAS,EAAE,IAAI,CAAC;QACd,GAAG,EAAE,CAAC,CAAC,OAAO;QACd,IAAI,EAAE,CAAC,CAAC,OAAO;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAE,kBAAkB,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBtE,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA+BF,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC;;;;kBAI1D,CAAC,CAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;;iCAE9B,kBAAkB;;;;;;;;;;;;;;;;;;;;CAoBlD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,kBAAkB,EAAE,IAAI;CACzB,CAAA","sourcesContent":["import '@material/web/all.js'\nimport '@operato/input/ox-checkbox.js'\nimport '../src/ox-popup-list.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nimport { OxPopupList } from '../src/ox-popup-list.js'\n\nexport default {\n title: 'OxPopupList',\n component: 'ox-popup-list',\n argTypes: {\n preventCloseOnBlur: { control: 'boolean' }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n preventCloseOnBlur: boolean\n}\n\nfunction popup(e: MouseEvent, preventCloseOnBlur: boolean) {\n const popupList = document.querySelector('#popup-list') as OxPopupList\n popupList.preventCloseOnBlur = preventCloseOnBlur\n\n popupList?.open({\n top: e.offsetY,\n left: e.offsetX\n })\n}\n\nconst Template: Story<ArgTypes> = ({ preventCloseOnBlur }: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n #container {\n display: flex;\n }\n\n #noise {\n width: 100px;\n height: 100px;\n }\n\n #place {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n width: 50%;\n height: 50%;\n text-align: center;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n border: 2px solid var(--md-sys-color-primary);\n }\n </style>\n\n <div id=\"container\">\n <div id=\"noise\"></div>\n <div id=\"place\" @click=${(e: MouseEvent) => popup(e, preventCloseOnBlur)} class=\"md-typescale-display-medium\">\n Click this to popup list\n <ox-popup-list\n id=\"popup-list\"\n @select=${(e: Event) => console.log('select', e.target)}\n multiple\n ?prevent-close-on-blur=${preventCloseOnBlur}\n >\n <div option>Plain Text</div>\n\n <div option>\n <ox-checkbox label=\"checkbox\" slot=\"icon\" checked>checkbox</ox-checkbox>\n </div>\n\n <div option>\n <input id=\"checkbox-01\" type=\"checkbox\" />\n <label for=\"checkbox-01\">custom option</label>\n </div>\n\n <div option>\n <label for=\"text-01\">value</label>\n <input id=\"text-01\" type=\"text\" value=\"Plain text input\" />\n </div>\n </ox-popup-list>\n </div>\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n preventCloseOnBlur: true\n}\n"]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import '@operato/input/ox-checkbox.js';
|
3
|
-
import '../src/ox-popup-menu.js';
|
4
|
-
import '../src/ox-popup-menuitem.js';
|
5
|
-
import { TemplateResult } from 'lit';
|
6
|
-
declare const _default: {
|
7
|
-
title: string;
|
8
|
-
component: string;
|
9
|
-
argTypes: {};
|
10
|
-
};
|
11
|
-
export default _default;
|
12
|
-
interface Story<T> {
|
13
|
-
(args: T): TemplateResult;
|
14
|
-
args?: Partial<T>;
|
15
|
-
argTypes?: Record<string, unknown>;
|
16
|
-
}
|
17
|
-
interface ArgTypes {
|
18
|
-
}
|
19
|
-
export declare const Regular: Story<ArgTypes>;
|
@@ -1,175 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import '@operato/input/ox-checkbox.js';
|
3
|
-
import '../src/ox-popup-menu.js';
|
4
|
-
import '../src/ox-popup-menuitem.js';
|
5
|
-
import { html } from 'lit';
|
6
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
7
|
-
import { OxPopupMenu } from '../src/ox-popup-menu.js';
|
8
|
-
export default {
|
9
|
-
title: 'OxPopuMenu',
|
10
|
-
component: 'ox-popup-menu',
|
11
|
-
argTypes: {}
|
12
|
-
};
|
13
|
-
function popup(e) {
|
14
|
-
OxPopupMenu.open({
|
15
|
-
template: html `
|
16
|
-
<ox-popup-menuitem
|
17
|
-
label="article - click me"
|
18
|
-
@selected=${function (e) {
|
19
|
-
console.log('first level article selected');
|
20
|
-
}}
|
21
|
-
>
|
22
|
-
<md-icon slot="icon">article</md-icon>
|
23
|
-
</ox-popup-menuitem>
|
24
|
-
|
25
|
-
<ox-popup-menuitem label="home">
|
26
|
-
<md-icon slot="icon">home</md-icon>
|
27
|
-
</ox-popup-menuitem>
|
28
|
-
|
29
|
-
<ox-popup-menuitem label="empty"> </ox-popup-menuitem>
|
30
|
-
|
31
|
-
<ox-popup-menuitem
|
32
|
-
label="click me to toggle"
|
33
|
-
@selected=${function (e) {
|
34
|
-
const icon = e.target.querySelector('md-icon');
|
35
|
-
icon && (icon.innerHTML = icon.innerHTML == 'check' ? '' : 'check');
|
36
|
-
}}
|
37
|
-
alive-on-select
|
38
|
-
>
|
39
|
-
<md-icon slot="icon" style="width: 20px;height: 20px;"></md-icon>
|
40
|
-
</ox-popup-menuitem>
|
41
|
-
|
42
|
-
<ox-popup-menuitem label="verified" @selected=${(e) => console.log('selected verified')}>
|
43
|
-
<md-icon slot="icon">verified</md-icon>
|
44
|
-
<ox-popup-menu>
|
45
|
-
<ox-popup-menuitem
|
46
|
-
label="article"
|
47
|
-
@selected=${function (e) {
|
48
|
-
console.log('article selected');
|
49
|
-
}}
|
50
|
-
alive-on-select
|
51
|
-
>
|
52
|
-
<md-icon slot="icon">article</md-icon>
|
53
|
-
</ox-popup-menuitem>
|
54
|
-
|
55
|
-
<ox-popup-menuitem label="home">
|
56
|
-
<md-icon slot="icon">home</md-icon>
|
57
|
-
</ox-popup-menuitem>
|
58
|
-
|
59
|
-
<ox-popup-menuitem label="verified">
|
60
|
-
<md-icon slot="icon">verified</md-icon>
|
61
|
-
<ox-popup-menu>
|
62
|
-
<ox-popup-menuitem label="article">
|
63
|
-
<md-icon slot="icon">article</md-icon>
|
64
|
-
</ox-popup-menuitem>
|
65
|
-
|
66
|
-
<ox-popup-menuitem label="home">
|
67
|
-
<md-icon slot="icon">home</md-icon>
|
68
|
-
</ox-popup-menuitem>
|
69
|
-
|
70
|
-
<ox-popup-menuitem label="verified">
|
71
|
-
<md-icon slot="icon">verified</md-icon>
|
72
|
-
</ox-popup-menuitem>
|
73
|
-
|
74
|
-
<ox-popup-menuitem label="checkbox">
|
75
|
-
<input type="checkbox" slot="icon" />
|
76
|
-
</ox-popup-menuitem>
|
77
|
-
|
78
|
-
</ox-popup-menu>
|
79
|
-
</ox-popup-menuitem>
|
80
|
-
|
81
|
-
<div separator></div>
|
82
|
-
|
83
|
-
<ox-popup-menuitem label="checkbox">
|
84
|
-
<input type="checkbox" slot="icon" />
|
85
|
-
</ox-popup-menuitem>
|
86
|
-
</ox-popup-menu>
|
87
|
-
</ox-popup-menuitem>
|
88
|
-
|
89
|
-
<ox-popup-menuitem label="checkbox in icon area" alive-on-select>
|
90
|
-
<input type="checkbox" slot="icon" />
|
91
|
-
</ox-popup-menuitem>
|
92
|
-
|
93
|
-
<div separator></div>
|
94
|
-
|
95
|
-
<div menu>Plain Text</div>
|
96
|
-
|
97
|
-
<div menu alive-on-select>
|
98
|
-
<ox-checkbox label="checkbox" slot="icon" checked />checkbox</ox-checkbox>
|
99
|
-
</div>
|
100
|
-
|
101
|
-
<div menu alive-on-select>
|
102
|
-
<input id="checkbox-01" type="checkbox" />
|
103
|
-
<label for="checkbox-01">custom menu</label>
|
104
|
-
</div>
|
105
|
-
<div menu alive-on-select>
|
106
|
-
<label for="text-01">value</label>
|
107
|
-
<input id="text-01" type="text" value="Plain text input" />
|
108
|
-
</div>
|
109
|
-
`,
|
110
|
-
top: e.offsetY,
|
111
|
-
left: e.offsetX,
|
112
|
-
parent: e.target
|
113
|
-
});
|
114
|
-
}
|
115
|
-
const Template = ({}) => html `
|
116
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
117
|
-
|
118
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
119
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
120
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
121
|
-
|
122
|
-
<link
|
123
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
124
|
-
rel="stylesheet"
|
125
|
-
/>
|
126
|
-
<link
|
127
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
128
|
-
rel="stylesheet"
|
129
|
-
/>
|
130
|
-
<link
|
131
|
-
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
132
|
-
rel="stylesheet"
|
133
|
-
/>
|
134
|
-
|
135
|
-
<style>
|
136
|
-
${MDTypeScaleStyles.cssText}
|
137
|
-
</style>
|
138
|
-
|
139
|
-
<style>
|
140
|
-
#container {
|
141
|
-
display: flex;
|
142
|
-
flex-direction: row;
|
143
|
-
height: 600px;
|
144
|
-
}
|
145
|
-
|
146
|
-
#padding {
|
147
|
-
width: 100px;
|
148
|
-
height: 100px;
|
149
|
-
}
|
150
|
-
|
151
|
-
#place {
|
152
|
-
position: fixed;
|
153
|
-
top: 50%;
|
154
|
-
left: 50%;
|
155
|
-
transform: translate(-50%, -50%);
|
156
|
-
|
157
|
-
width: 50%;
|
158
|
-
height: 50%;
|
159
|
-
text-align: center;
|
160
|
-
|
161
|
-
background-color: var(--md-sys-color-primary-container);
|
162
|
-
color: var(--md-sys-color-on-primary-container);
|
163
|
-
}
|
164
|
-
</style>
|
165
|
-
|
166
|
-
<div id="container">
|
167
|
-
<div id="padding"></div>
|
168
|
-
<div id="place" @click=${(e) => popup(e)} class="md-typescale-display-medium">
|
169
|
-
Click this to popup menu
|
170
|
-
</div>
|
171
|
-
</div>
|
172
|
-
`;
|
173
|
-
export const Regular = Template.bind({});
|
174
|
-
Regular.args = {};
|
175
|
-
//# sourceMappingURL=ox-popup-menu.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-popup-menu.stories.js","sourceRoot":"","sources":["../../stories/ox-popup-menu.stories.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,+BAA+B,CAAA;AACtC,OAAO,yBAAyB,CAAA;AAChC,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,SAAS,KAAK,CAAC,CAAa;IAC1B,WAAW,CAAC,IAAI,CAAC;QACf,QAAQ,EAAE,IAAI,CAAA;;;oBAGE,UAAU,CAAQ;YAC5B,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC7C,CAAC;;;;;;;;;;;;;oBAaW,UAAU,CAAQ;YAC5B,MAAM,IAAI,GAAI,CAAC,CAAC,MAAsB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAA;YAC/D,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QACrE,CAAC;;;;;;sDAM6C,CAAC,CAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;;;;;wBAK5E,UAAU,CAAQ;YAC5B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;QACjC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4DR;QACD,GAAG,EAAE,CAAC,CAAC,OAAO;QACd,IAAI,EAAE,CAAC,CAAC,OAAO;QACf,MAAM,EAAE,CAAC,CAAC,MAAqB;KAChC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBlD,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAgCF,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;;;;CAIvD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@material/web/all.js'\nimport '@operato/input/ox-checkbox.js'\nimport '../src/ox-popup-menu.js'\nimport '../src/ox-popup-menuitem.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nimport { OxPopupMenu } from '../src/ox-popup-menu.js'\n\nexport default {\n title: 'OxPopuMenu',\n component: 'ox-popup-menu',\n argTypes: {}\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {}\n\nfunction popup(e: MouseEvent) {\n OxPopupMenu.open({\n template: html`\n <ox-popup-menuitem\n label=\"article - click me\"\n @selected=${function (e: Event) {\n console.log('first level article selected')\n }}\n >\n <md-icon slot=\"icon\">article</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"home\">\n <md-icon slot=\"icon\">home</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"empty\"> </ox-popup-menuitem>\n\n <ox-popup-menuitem\n label=\"click me to toggle\"\n @selected=${function (e: Event) {\n const icon = (e.target as HTMLElement).querySelector('md-icon')\n icon && (icon.innerHTML = icon.innerHTML == 'check' ? '' : 'check')\n }}\n alive-on-select\n >\n <md-icon slot=\"icon\" style=\"width: 20px;height: 20px;\"></md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"verified\" @selected=${(e: Event) => console.log('selected verified')}>\n <md-icon slot=\"icon\">verified</md-icon>\n <ox-popup-menu>\n <ox-popup-menuitem\n label=\"article\"\n @selected=${function (e: Event) {\n console.log('article selected')\n }}\n alive-on-select\n >\n <md-icon slot=\"icon\">article</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"home\">\n <md-icon slot=\"icon\">home</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"verified\">\n <md-icon slot=\"icon\">verified</md-icon>\n <ox-popup-menu>\n <ox-popup-menuitem label=\"article\">\n <md-icon slot=\"icon\">article</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"home\">\n <md-icon slot=\"icon\">home</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"verified\">\n <md-icon slot=\"icon\">verified</md-icon>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"checkbox\">\n <input type=\"checkbox\" slot=\"icon\" />\n </ox-popup-menuitem>\n\n </ox-popup-menu>\n </ox-popup-menuitem>\n\n <div separator></div>\n\n <ox-popup-menuitem label=\"checkbox\">\n <input type=\"checkbox\" slot=\"icon\" />\n </ox-popup-menuitem>\n </ox-popup-menu>\n </ox-popup-menuitem>\n\n <ox-popup-menuitem label=\"checkbox in icon area\" alive-on-select>\n <input type=\"checkbox\" slot=\"icon\" />\n </ox-popup-menuitem>\n\n <div separator></div>\n\n <div menu>Plain Text</div>\n\n <div menu alive-on-select>\n <ox-checkbox label=\"checkbox\" slot=\"icon\" checked />checkbox</ox-checkbox>\n </div>\n\n <div menu alive-on-select>\n <input id=\"checkbox-01\" type=\"checkbox\" />\n <label for=\"checkbox-01\">custom menu</label>\n </div>\n <div menu alive-on-select>\n <label for=\"text-01\">value</label>\n <input id=\"text-01\" type=\"text\" value=\"Plain text input\" />\n </div>\n `,\n top: e.offsetY,\n left: e.offsetX,\n parent: e.target as HTMLElement\n })\n}\n\nconst Template: Story<ArgTypes> = ({}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n #container {\n display: flex;\n flex-direction: row;\n height: 600px;\n }\n\n #padding {\n width: 100px;\n height: 100px;\n }\n\n #place {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n width: 50%;\n height: 50%;\n text-align: center;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n </style>\n\n <div id=\"container\">\n <div id=\"padding\"></div>\n <div id=\"place\" @click=${(e: MouseEvent) => popup(e)} class=\"md-typescale-display-medium\">\n Click this to popup menu\n </div>\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import { TemplateResult } from 'lit';
|
3
|
-
declare const _default: {
|
4
|
-
title: string;
|
5
|
-
component: string;
|
6
|
-
argTypes: {};
|
7
|
-
};
|
8
|
-
export default _default;
|
9
|
-
interface Story<T> {
|
10
|
-
(args: T): TemplateResult;
|
11
|
-
args?: Partial<T>;
|
12
|
-
argTypes?: Record<string, unknown>;
|
13
|
-
}
|
14
|
-
interface ArgTypes {
|
15
|
-
}
|
16
|
-
export declare const Regular: Story<ArgTypes>;
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import '@material/web/all.js';
|
2
|
-
import { html } from 'lit';
|
3
|
-
import { OxPopup } from '../src/ox-popup.js';
|
4
|
-
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
5
|
-
export default {
|
6
|
-
title: 'Simple Popup',
|
7
|
-
component: 'ox-popup',
|
8
|
-
argTypes: {}
|
9
|
-
};
|
10
|
-
function popup(e) {
|
11
|
-
const noImage = new URL('/assets/images/no-image.png', import.meta.url).href;
|
12
|
-
OxPopup.open({
|
13
|
-
template: html `<img src=${noImage} />`,
|
14
|
-
top: e.offsetY,
|
15
|
-
left: e.offsetX,
|
16
|
-
backdrop: true,
|
17
|
-
parent: e.target
|
18
|
-
});
|
19
|
-
}
|
20
|
-
const Template = ({}) => html `
|
21
|
-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
22
|
-
|
23
|
-
<link href="/themes/light.css" rel="stylesheet" />
|
24
|
-
<link href="/themes/dark.css" rel="stylesheet" />
|
25
|
-
<link href="/themes/spacing.css" rel="stylesheet" />
|
26
|
-
|
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
|
-
|
40
|
-
<style>
|
41
|
-
${MDTypeScaleStyles.cssText}
|
42
|
-
</style>
|
43
|
-
|
44
|
-
<style>
|
45
|
-
#place {
|
46
|
-
position: fixed;
|
47
|
-
top: 50%;
|
48
|
-
left: 50%;
|
49
|
-
transform: translate(-50%, -50%);
|
50
|
-
|
51
|
-
width: 50%;
|
52
|
-
height: 50%;
|
53
|
-
text-align: center;
|
54
|
-
|
55
|
-
background-color: var(--md-sys-color-primary-container);
|
56
|
-
color: var(--md-sys-color-on-primary-container);
|
57
|
-
}
|
58
|
-
</style>
|
59
|
-
|
60
|
-
<div id="place" @click=${(e) => popup(e)} class="md-typescale-display-medium">
|
61
|
-
Click this to popup image
|
62
|
-
</div>
|
63
|
-
`;
|
64
|
-
export const Regular = Template.bind({});
|
65
|
-
Regular.args = {};
|
66
|
-
//# sourceMappingURL=ox-popup.stories.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ox-popup.stories.js","sourceRoot":"","sources":["../../stories/ox-popup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AAE7F,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,EAAE;CACb,CAAA;AAUD,SAAS,KAAK,CAAC,CAAa;IAC1B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,6BAA6B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;IAE5E,OAAO,CAAC,IAAI,CAAC;QACX,QAAQ,EAAE,IAAI,CAAA,YAAY,OAAO,KAAK;QACtC,GAAG,EAAE,CAAC,CAAC,OAAO;QACd,IAAI,EAAE,CAAC,CAAC,OAAO;QACf,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,CAAC,CAAC,MAAqB;KAChC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBlD,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;;;;;2BAmBJ,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;;;CAGrD,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG,EAAE,CAAA","sourcesContent":["import '@material/web/all.js'\nimport { html, TemplateResult } from 'lit'\n\nimport { OxPopup } from '../src/ox-popup.js'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles.js'\n\nexport default {\n title: 'Simple Popup',\n component: 'ox-popup',\n argTypes: {}\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {}\n\nfunction popup(e: MouseEvent) {\n const noImage = new URL('/assets/images/no-image.png', import.meta.url).href\n\n OxPopup.open({\n template: html`<img src=${noImage} />`,\n top: e.offsetY,\n left: e.offsetX,\n backdrop: true,\n parent: e.target as HTMLElement\n })\n}\n\nconst Template: Story<ArgTypes> = ({}: ArgTypes) => html`\n <link href=\"https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap\" rel=\"stylesheet\" />\n\n <link href=\"/themes/light.css\" rel=\"stylesheet\" />\n <link href=\"/themes/dark.css\" rel=\"stylesheet\" />\n <link href=\"/themes/spacing.css\" rel=\"stylesheet\" />\n\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n <link\n href=\"https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1\"\n rel=\"stylesheet\"\n />\n\n <style>\n ${MDTypeScaleStyles.cssText}\n </style>\n\n <style>\n #place {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n\n width: 50%;\n height: 50%;\n text-align: center;\n\n background-color: var(--md-sys-color-primary-container);\n color: var(--md-sys-color-on-primary-container);\n }\n </style>\n\n <div id=\"place\" @click=${(e: MouseEvent) => popup(e)} class=\"md-typescale-display-medium\">\n Click this to popup image\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|