@operato/popup 2.0.0-alpha.99 → 2.0.0-beta.12
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 +246 -0
- package/dist/src/ox-floating-overlay.js +17 -14
- package/dist/src/ox-floating-overlay.js.map +1 -1
- package/dist/src/ox-popup-list.d.ts +17 -3
- package/dist/src/ox-popup-list.js +109 -31
- package/dist/src/ox-popup-list.js.map +1 -1
- package/dist/src/ox-popup-menu.js +21 -16
- package/dist/src/ox-popup-menu.js.map +1 -1
- package/dist/src/ox-popup-menuitem.js +5 -5
- package/dist/src/ox-popup-menuitem.js.map +1 -1
- package/dist/src/ox-popup.d.ts +1 -0
- package/dist/src/ox-popup.js +19 -9
- package/dist/src/ox-popup.js.map +1 -1
- package/dist/src/ox-prompt.js +68 -28
- package/dist/src/ox-prompt.js.map +1 -1
- package/dist/stories/open-popup.stories.d.ts +6 -0
- package/dist/stories/open-popup.stories.js +26 -6
- package/dist/stories/open-popup.stories.js.map +1 -1
- package/dist/stories/ox-popup-list-sortable.stories.d.ts +24 -0
- package/dist/stories/ox-popup-list-sortable.stories.js +169 -0
- package/dist/stories/ox-popup-list-sortable.stories.js.map +1 -0
- package/dist/stories/ox-popup-list.stories.d.ts +8 -2
- package/dist/stories/ox-popup-list.stories.js +52 -32
- package/dist/stories/ox-popup-list.stories.js.map +1 -1
- package/dist/stories/ox-popup-menu.stories.d.ts +8 -2
- package/dist/stories/ox-popup-menu.stories.js +26 -7
- package/dist/stories/ox-popup-menu.stories.js.map +1 -1
- package/dist/stories/ox-popup.stories.d.ts +8 -1
- package/dist/stories/ox-popup.stories.js +47 -13
- package/dist/stories/ox-popup.stories.js.map +1 -1
- package/dist/stories/ox-prompt-icon.stories.d.ts +6 -0
- package/dist/stories/ox-prompt-icon.stories.js +24 -9
- package/dist/stories/ox-prompt-icon.stories.js.map +1 -1
- package/dist/stories/ox-prompt-normal.stories.d.ts +8 -1
- package/dist/stories/ox-prompt-normal.stories.js +25 -7
- package/dist/stories/ox-prompt-normal.stories.js.map +1 -1
- package/dist/stories/ox-prompt.stories.d.ts +7 -1
- package/dist/stories/ox-prompt.stories.js +26 -9
- package/dist/stories/ox-prompt.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -4
- package/src/ox-floating-overlay.ts +17 -14
- package/src/ox-popup-list.ts +133 -34
- package/src/ox-popup-menu.ts +21 -16
- package/src/ox-popup-menuitem.ts +5 -5
- package/src/ox-popup.ts +17 -9
- package/src/ox-prompt.ts +71 -28
- package/stories/open-popup.stories.ts +28 -6
- package/stories/ox-popup-list-sortable.stories.ts +188 -0
- package/stories/ox-popup-list.stories.ts +55 -34
- package/stories/ox-popup-menu.stories.ts +29 -8
- package/stories/ox-popup.stories.ts +51 -16
- package/stories/ox-prompt-icon.stories.ts +30 -9
- package/stories/ox-prompt-normal.stories.ts +28 -8
- package/stories/ox-prompt.stories.ts +30 -10
- package/themes/dark-hc.css +151 -0
- package/themes/dark-mc.css +151 -0
- package/themes/dark.css +151 -0
- package/themes/grist-theme.css +173 -0
- package/themes/light-hc.css +151 -0
- package/themes/light-mc.css +151 -0
- package/themes/light.css +151 -0
- package/themes/md-typescale-styles.css +100 -0
- package/themes/spacing.css +43 -0
- package/themes/state-color.css +6 -0
- package/themes/app-theme.css +0 -145
- package/themes/input-theme.css +0 -19
- package/themes/material-theme.css +0 -88
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-popup.stories.js","sourceRoot":"","sources":["../../stories/open-popup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,EAAE,SAAS,EAAgB,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"open-popup.stories.js","sourceRoot":"","sources":["../../stories/open-popup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAA;AAC7B,OAAO,EAAE,IA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,EACN,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBd,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;mCAeI,KAAK;;;;;aAK3B,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;;;CAKvG,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACxC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,QAAQ;IAClB,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE,EAAE;CACT,CAAA","sourcesContent":["import '@material/web/all.js'\nimport { html, TemplateResult } from 'lit'\n\nimport { openPopup, PopupOptions } from '../src/open-popup'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\n\nexport default {\n title: 'openPopup',\n component: 'ox-popup',\n argTypes: {\n title: { constol: 'string' },\n size: { control: 'select', options: ['large', 'medium', 'small'] },\n hovering: { control: 'select', options: ['center', 'next', 'edge'] },\n closable: { control: 'boolean' },\n escapable: { control: 'boolean' },\n backdrop: { control: 'boolean' },\n help: { constol: 'string' },\n theme: { control: 'select', options: ['light', 'dark'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n title: string\n size: 'large' | 'medium' | 'small'\n hovering: 'center' | 'next' | 'edge'\n closable: boolean\n escapable: boolean\n backdrop: boolean\n help: string\n theme?: 'light' | 'dark'\n}\n\nfunction popup(e: MouseEvent, options: PopupOptions) {\n const noImage = new URL('/assets/images/no-image.png', import.meta.url).href\n\n return openPopup(html`<img src=${noImage} />`, options)\n}\n\nconst Template: Story<ArgTypes> = ({\n title = '',\n size = 'medium',\n hovering = 'center',\n closable,\n escapable,\n backdrop,\n help,\n theme = 'light'\n}: 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 width: 100%;\n height: 500px;\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 <script>\n document.body.classList.add('${theme}')\n </script>\n\n <div\n id=\"place\"\n @click=${(e: MouseEvent) => popup(e, { title, size, hovering, closable, escapable, backdrop, help })}\n class=\"md-typescale-display-medium\"\n >\n Click this to popup image\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {\n title: 'Regular popup',\n size: 'medium',\n hovering: 'center',\n closable: true,\n escapable: true,\n backdrop: true,\n help: ''\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { TemplateResult } from 'lit';
|
|
6
|
+
declare const _default: {
|
|
7
|
+
title: string;
|
|
8
|
+
component: string;
|
|
9
|
+
argTypes: {
|
|
10
|
+
debug: {
|
|
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
|
+
debug: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const Regular: Story<ArgTypes>;
|
|
@@ -0,0 +1,169 @@
|
|
|
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
|
+
export default {
|
|
7
|
+
title: 'sortable OxPopupList',
|
|
8
|
+
component: 'ox-popup-list',
|
|
9
|
+
argTypes: {
|
|
10
|
+
debug: { control: 'boolean' }
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function popup(e) {
|
|
14
|
+
const popupList = document.querySelector('#popup-list');
|
|
15
|
+
popupList === null || popupList === void 0 ? void 0 : popupList.open({
|
|
16
|
+
top: e.pageY,
|
|
17
|
+
left: e.pageX
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const columns = [
|
|
21
|
+
{
|
|
22
|
+
name: 'AAAAAA',
|
|
23
|
+
hidden: false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'BBBBBB',
|
|
27
|
+
hidden: true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'CCCCCC',
|
|
31
|
+
hidden: false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'DDDDDD',
|
|
35
|
+
hidden: false
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'EEEEEE',
|
|
39
|
+
hidden: false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'FFFFFF',
|
|
43
|
+
hidden: false
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'GGGGGG',
|
|
47
|
+
hidden: false
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'HHHHHH',
|
|
51
|
+
hidden: false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'IIIIII',
|
|
55
|
+
hidden: false
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'JJJJJJ',
|
|
59
|
+
hidden: false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'KKKKKK',
|
|
63
|
+
hidden: false
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'LLLLLL',
|
|
67
|
+
hidden: false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'MMMMMM',
|
|
71
|
+
hidden: false
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
const Template = ({ debug }) => html `
|
|
75
|
+
<link
|
|
76
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
77
|
+
rel="stylesheet"
|
|
78
|
+
/>
|
|
79
|
+
<link
|
|
80
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
|
|
81
|
+
rel="stylesheet"
|
|
82
|
+
/>
|
|
83
|
+
<link
|
|
84
|
+
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
85
|
+
rel="stylesheet"
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
<style>
|
|
89
|
+
#place {
|
|
90
|
+
width: 100%;
|
|
91
|
+
height: 100px;
|
|
92
|
+
background: lightgreen;
|
|
93
|
+
text-align: center;
|
|
94
|
+
line-height: 100px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
ox-popup-list {
|
|
98
|
+
width: 240px;
|
|
99
|
+
max-height: 240px;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[titler] {
|
|
104
|
+
--md-icon-size: 1.2em;
|
|
105
|
+
--md-outlined-button-container-height: 24px;
|
|
106
|
+
--md-outlined-button-container-shape: 4px;
|
|
107
|
+
--md-outlined-button-leading-space: 4px;
|
|
108
|
+
--md-outlined-button-trailing-space: 4px;
|
|
109
|
+
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: row;
|
|
112
|
+
align-items: center;
|
|
113
|
+
text-transform: capitalize;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
md-outlined-button {
|
|
117
|
+
margin-left: auto;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
[option] {
|
|
121
|
+
position: relative; /* 상대 위치 설정 */
|
|
122
|
+
cursor: move; /* 커서를 이동 가능 표시로 변경 */
|
|
123
|
+
user-select: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
[option]::after {
|
|
127
|
+
content: '☰'; /* 드래그 핸들 아이콘 (혹은 기호) */
|
|
128
|
+
position: absolute; /* 절대 위치 설정 */
|
|
129
|
+
top: 0; /* 위에서부터 10px */
|
|
130
|
+
right: 10px; /* 오른쪽에서부터 10px */
|
|
131
|
+
font-size: 20px; /* 폰트 크기 설정 */
|
|
132
|
+
color: #888; /* 폰트 색상 설정 */
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
div[overlay] {
|
|
136
|
+
display: block;
|
|
137
|
+
width: 300px;
|
|
138
|
+
height: 300px;
|
|
139
|
+
left: 100px;
|
|
140
|
+
top: 100px;
|
|
141
|
+
z-index: 10;
|
|
142
|
+
background-color: var(--md-sys-color-surface);
|
|
143
|
+
}
|
|
144
|
+
</style>
|
|
145
|
+
|
|
146
|
+
<div id="place" @click=${(e) => popup(e)}>
|
|
147
|
+
Click this to popup list
|
|
148
|
+
<ox-popup-list
|
|
149
|
+
id="popup-list"
|
|
150
|
+
@select=${(e) => console.log('select', e.target)}
|
|
151
|
+
@sorted=${(e) => {
|
|
152
|
+
console.log('sorted\n', e.detail.map((element) => element.value).join('\n'));
|
|
153
|
+
}}
|
|
154
|
+
multiple
|
|
155
|
+
sortable
|
|
156
|
+
?debug=${debug}
|
|
157
|
+
>
|
|
158
|
+
<div slot="header" titler>Plain Text <md-outlined-button>save</md-outlined-button></div>
|
|
159
|
+
${columns.map(column => html `
|
|
160
|
+
<ox-checkbox label="checkbox" ?checked=${!column.hidden} value=${column.name} option />${column.name}</ox-checkbox>
|
|
161
|
+
`)}
|
|
162
|
+
</ox-popup-list>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div overlay>OVERLAYED</div>
|
|
166
|
+
`;
|
|
167
|
+
export const Regular = Template.bind({});
|
|
168
|
+
Regular.args = {};
|
|
169
|
+
//# sourceMappingURL=ox-popup-list-sortable.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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;AAI1C,eAAe;IACb,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KAC9B;CACF,CAAA;AAYD,SAAS,KAAK,CAAC,CAAa;IAC1B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAgB,CAAA;IACtE,SAAS,aAAT,SAAS,uBAAT,SAAS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C,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;;;eAGQ,KAAK;;;QAGZ,OAAO,CAAC,GAAG,CACX,MAAM,CAAC,EAAE,CAAC,IAAI,CAAA;iDAC2B,CAAC,MAAM,CAAC,MAAM,UAAU,MAAM,CAAC,IAAI,aAAa,MAAM,CAAC,IAAI;OACrG,CACA;;;;;CAKN,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'\n\nexport default {\n title: 'sortable OxPopupList',\n component: 'ox-popup-list',\n argTypes: {\n debug: { 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 debug: boolean\n}\n\nfunction popup(e: MouseEvent) {\n const popupList = document.querySelector('#popup-list') as OxPopupList\n popupList?.open({\n top: e.pageY,\n left: e.pageX\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> = ({ debug }: ArgTypes) => html`\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 #place {\n width: 100%;\n height: 100px;\n background: lightgreen;\n text-align: center;\n line-height: 100px;\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: 10;\n background-color: var(--md-sys-color-surface);\n }\n </style>\n\n <div id=\"place\" @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 ?debug=${debug}\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\n <div overlay>OVERLAYED</div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import '@material/web/
|
|
1
|
+
import '@material/web/all.js';
|
|
2
2
|
import '@operato/input/ox-checkbox.js';
|
|
3
3
|
import '../src/ox-popup-list.js';
|
|
4
4
|
import { TemplateResult } from 'lit';
|
|
5
5
|
declare const _default: {
|
|
6
6
|
title: string;
|
|
7
7
|
component: string;
|
|
8
|
-
argTypes: {
|
|
8
|
+
argTypes: {
|
|
9
|
+
theme: {
|
|
10
|
+
control: string;
|
|
11
|
+
options: string[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
9
14
|
};
|
|
10
15
|
export default _default;
|
|
11
16
|
interface Story<T> {
|
|
@@ -14,5 +19,6 @@ interface Story<T> {
|
|
|
14
19
|
argTypes?: Record<string, unknown>;
|
|
15
20
|
}
|
|
16
21
|
interface ArgTypes {
|
|
22
|
+
theme?: 'light' | 'dark';
|
|
17
23
|
}
|
|
18
24
|
export declare const Regular: Story<ArgTypes>;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import '@material/web/
|
|
1
|
+
import '@material/web/all.js';
|
|
2
2
|
import '@operato/input/ox-checkbox.js';
|
|
3
3
|
import '../src/ox-popup-list.js';
|
|
4
4
|
import { html } from 'lit';
|
|
5
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles';
|
|
5
6
|
export default {
|
|
6
7
|
title: 'OxPopupList',
|
|
7
8
|
component: 'ox-popup-list',
|
|
8
|
-
argTypes: {
|
|
9
|
+
argTypes: {
|
|
10
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
|
11
|
+
}
|
|
9
12
|
};
|
|
10
13
|
function popup(e) {
|
|
11
14
|
const popupList = document.querySelector('#popup-list');
|
|
@@ -14,7 +17,13 @@ function popup(e) {
|
|
|
14
17
|
left: e.pageX
|
|
15
18
|
});
|
|
16
19
|
}
|
|
17
|
-
const Template = ({}) => html `
|
|
20
|
+
const Template = ({ theme = 'light' }) => 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
|
+
|
|
18
27
|
<link
|
|
19
28
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
20
29
|
rel="stylesheet"
|
|
@@ -27,36 +36,47 @@ const Template = ({}) => html `
|
|
|
27
36
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
|
|
28
37
|
rel="stylesheet"
|
|
29
38
|
/>
|
|
30
|
-
|
|
39
|
+
|
|
31
40
|
<style>
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
</
|
|
58
|
-
</
|
|
59
|
-
|
|
41
|
+
${MDTypeScaleStyles.cssText}
|
|
42
|
+
</style>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
#place {
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 500px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
|
|
50
|
+
background-color: var(--md-sys-color-primary-container);
|
|
51
|
+
color: var(--md-sys-color-on-primary-container);
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
54
|
+
|
|
55
|
+
<script>
|
|
56
|
+
document.body.classList.add('${theme}')
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<div id="place" @click=${(e) => popup(e)} class="md-typescale-display-medium">
|
|
60
|
+
Click this to popup list
|
|
61
|
+
</div>
|
|
62
|
+
<ox-popup-list id="popup-list" @select=${(e) => console.log('select', e.target)} multiple>
|
|
63
|
+
<div option>Plain Text</div>
|
|
64
|
+
|
|
65
|
+
<div option>
|
|
66
|
+
<ox-checkbox label="checkbox" slot="icon" checked>checkbox</ox-checkbox>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div option>
|
|
70
|
+
<input id="checkbox-01" type="checkbox" />
|
|
71
|
+
<label for="checkbox-01">custom option</label>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div option>
|
|
75
|
+
<label for="text-01">value</label>
|
|
76
|
+
<input id="text-01" type="text" value="Plain text input" />
|
|
77
|
+
</div>
|
|
78
|
+
</ox-popup-list>
|
|
79
|
+
`;
|
|
60
80
|
export const Regular = Template.bind({});
|
|
61
81
|
Regular.args = {};
|
|
62
82
|
//# sourceMappingURL=ox-popup-list.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-list.stories.js","sourceRoot":"","sources":["../../stories/ox-popup-list.stories.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-popup-list.stories.js","sourceRoot":"","sources":["../../stories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ox-popup-list.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\n\nimport { OxPopupList } from '../src/ox-popup-list.js'\n\nexport default {\n title: 'OxPopupList',\n component: 'ox-popup-list',\n argTypes: {\n theme: { control: 'select', options: ['light', 'dark'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n theme?: 'light' | 'dark'\n}\n\nfunction popup(e: MouseEvent) {\n const popupList = document.querySelector('#popup-list') as OxPopupList\n popupList?.open({\n top: e.pageY,\n left: e.pageX\n })\n}\n\nconst Template: Story<ArgTypes> = ({ theme = 'light' }: 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 width: 100%;\n height: 500px;\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 <script>\n document.body.classList.add('${theme}')\n </script>\n\n <div id=\"place\" @click=${(e: MouseEvent) => popup(e)} class=\"md-typescale-display-medium\">\n Click this to popup list\n </div>\n <ox-popup-list id=\"popup-list\" @select=${(e: Event) => console.log('select', e.target)} multiple>\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`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import '@material/web/all.js';
|
|
1
2
|
import '../src/ox-popup-menu.js';
|
|
2
3
|
import '../src/ox-popup-menuitem.js';
|
|
3
|
-
import '@material/web/icon/icon.js';
|
|
4
4
|
import '@operato/input/ox-checkbox.js';
|
|
5
5
|
import { TemplateResult } from 'lit';
|
|
6
6
|
declare const _default: {
|
|
7
7
|
title: string;
|
|
8
8
|
component: string;
|
|
9
|
-
argTypes: {
|
|
9
|
+
argTypes: {
|
|
10
|
+
theme: {
|
|
11
|
+
control: string;
|
|
12
|
+
options: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
10
15
|
};
|
|
11
16
|
export default _default;
|
|
12
17
|
interface Story<T> {
|
|
@@ -15,5 +20,6 @@ interface Story<T> {
|
|
|
15
20
|
argTypes?: Record<string, unknown>;
|
|
16
21
|
}
|
|
17
22
|
interface ArgTypes {
|
|
23
|
+
theme?: 'light' | 'dark';
|
|
18
24
|
}
|
|
19
25
|
export declare const Regular: Story<ArgTypes>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import '@material/web/all.js';
|
|
1
2
|
import '../src/ox-popup-menu.js';
|
|
2
3
|
import '../src/ox-popup-menuitem.js';
|
|
3
|
-
import '@material/web/icon/icon.js';
|
|
4
4
|
import '@operato/input/ox-checkbox.js';
|
|
5
5
|
import { html } from 'lit';
|
|
6
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles';
|
|
6
7
|
import { OxPopupMenu } from '../src/ox-popup-menu.js';
|
|
7
8
|
export default {
|
|
8
9
|
title: 'OxPopuMenu',
|
|
9
10
|
component: 'ox-popup-menu',
|
|
10
|
-
argTypes: {
|
|
11
|
+
argTypes: {
|
|
12
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
|
13
|
+
}
|
|
11
14
|
};
|
|
12
15
|
function popup(e) {
|
|
13
16
|
OxPopupMenu.open({
|
|
@@ -74,7 +77,6 @@ function popup(e) {
|
|
|
74
77
|
<input type="checkbox" slot="icon" />
|
|
75
78
|
</ox-popup-menuitem>
|
|
76
79
|
|
|
77
|
-
<div separator></div>
|
|
78
80
|
</ox-popup-menu>
|
|
79
81
|
</ox-popup-menuitem>
|
|
80
82
|
|
|
@@ -112,7 +114,13 @@ function popup(e) {
|
|
|
112
114
|
parent: e.target
|
|
113
115
|
});
|
|
114
116
|
}
|
|
115
|
-
const Template = ({}) => html `
|
|
117
|
+
const Template = ({ theme = 'light' }) => html `
|
|
118
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
119
|
+
|
|
120
|
+
<link href="/themes/light.css" rel="stylesheet" />
|
|
121
|
+
<link href="/themes/dark.css" rel="stylesheet" />
|
|
122
|
+
<link href="/themes/spacing.css" rel="stylesheet" />
|
|
123
|
+
|
|
116
124
|
<link
|
|
117
125
|
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
|
|
118
126
|
rel="stylesheet"
|
|
@@ -126,17 +134,28 @@ const Template = ({}) => html `
|
|
|
126
134
|
rel="stylesheet"
|
|
127
135
|
/>
|
|
128
136
|
|
|
137
|
+
<style>
|
|
138
|
+
${MDTypeScaleStyles.cssText}
|
|
139
|
+
</style>
|
|
140
|
+
|
|
129
141
|
<style>
|
|
130
142
|
#place {
|
|
131
143
|
width: 100%;
|
|
132
144
|
height: 500px;
|
|
133
|
-
background: lightgreen;
|
|
134
145
|
text-align: center;
|
|
135
|
-
|
|
146
|
+
|
|
147
|
+
background-color: var(--md-sys-color-primary-container);
|
|
148
|
+
color: var(--md-sys-color-on-primary-container);
|
|
136
149
|
}
|
|
137
150
|
</style>
|
|
138
151
|
|
|
139
|
-
<
|
|
152
|
+
<script>
|
|
153
|
+
document.body.classList.add('${theme}')
|
|
154
|
+
</script>
|
|
155
|
+
|
|
156
|
+
<div id="place" @click=${(e) => popup(e)} class="md-typescale-display-medium">
|
|
157
|
+
Click this to popup menu
|
|
158
|
+
</div>
|
|
140
159
|
`;
|
|
141
160
|
export const Regular = Template.bind({});
|
|
142
161
|
Regular.args = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-menu.stories.js","sourceRoot":"","sources":["../../stories/ox-popup-menu.stories.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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,yBAAyB,CAAA;AAChC,OAAO,6BAA6B,CAAA;AACpC,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAC1C,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,eAAe;IACb,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;KACzD;CACF,CAAA;AAYD,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,KAAK;QACZ,IAAI,EAAE,CAAC,CAAC,KAAK;QACb,MAAM,EAAE,CAAC,CAAC,MAAqB;KAChC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,GAAG,OAAO,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBnE,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;mCAeI,KAAK;;;2BAGb,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 '../src/ox-popup-menu.js'\nimport '../src/ox-popup-menuitem.js'\nimport '@operato/input/ox-checkbox.js'\n\nimport { html, TemplateResult } from 'lit'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\n\nimport { OxPopupMenu } from '../src/ox-popup-menu.js'\n\nexport default {\n title: 'OxPopuMenu',\n component: 'ox-popup-menu',\n argTypes: {\n theme: { control: 'select', options: ['light', 'dark'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n theme?: 'light' | 'dark'\n}\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.pageY,\n left: e.pageX,\n parent: e.target as HTMLElement\n })\n}\n\nconst Template: Story<ArgTypes> = ({ theme = 'light' }: 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 width: 100%;\n height: 500px;\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 <script>\n document.body.classList.add('${theme}')\n </script>\n\n <div id=\"place\" @click=${(e: MouseEvent) => popup(e)} class=\"md-typescale-display-medium\">\n Click this to popup menu\n </div>\n`\n\nexport const Regular = Template.bind({})\nRegular.args = {}\n"]}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import '@material/web/all.js';
|
|
1
2
|
import { TemplateResult } from 'lit';
|
|
2
3
|
declare const _default: {
|
|
3
4
|
title: string;
|
|
4
5
|
component: string;
|
|
5
|
-
argTypes: {
|
|
6
|
+
argTypes: {
|
|
7
|
+
theme: {
|
|
8
|
+
control: string;
|
|
9
|
+
options: string[];
|
|
10
|
+
};
|
|
11
|
+
};
|
|
6
12
|
};
|
|
7
13
|
export default _default;
|
|
8
14
|
interface Story<T> {
|
|
@@ -11,5 +17,6 @@ interface Story<T> {
|
|
|
11
17
|
argTypes?: Record<string, unknown>;
|
|
12
18
|
}
|
|
13
19
|
interface ArgTypes {
|
|
20
|
+
theme?: 'light' | 'dark';
|
|
14
21
|
}
|
|
15
22
|
export declare const Regular: Story<ArgTypes>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import '@material/web/all.js';
|
|
1
2
|
import { html } from 'lit';
|
|
2
3
|
import { OxPopup } from '../src/ox-popup';
|
|
4
|
+
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles';
|
|
3
5
|
export default {
|
|
4
6
|
title: 'ContextMenu',
|
|
5
7
|
component: 'ox-popup',
|
|
6
|
-
argTypes: {
|
|
8
|
+
argTypes: {
|
|
9
|
+
theme: { control: 'select', options: ['light', 'dark'] }
|
|
10
|
+
}
|
|
7
11
|
};
|
|
8
12
|
function popup(e) {
|
|
9
13
|
const noImage = new URL('/assets/images/no-image.png', import.meta.url).href;
|
|
@@ -14,19 +18,49 @@ function popup(e) {
|
|
|
14
18
|
parent: e.target
|
|
15
19
|
});
|
|
16
20
|
}
|
|
17
|
-
const Template = ({}) => html `
|
|
18
|
-
|
|
19
|
-
#place {
|
|
20
|
-
width: 100%;
|
|
21
|
-
height: 500px;
|
|
22
|
-
background: lightgreen;
|
|
23
|
-
text-align: center;
|
|
24
|
-
line-height: 500px;
|
|
25
|
-
}
|
|
26
|
-
</style>
|
|
21
|
+
const Template = ({ theme = 'light' }) => html `
|
|
22
|
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
|
|
27
23
|
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
#place {
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 500px;
|
|
49
|
+
text-align: center;
|
|
50
|
+
|
|
51
|
+
background-color: var(--md-sys-color-primary-container);
|
|
52
|
+
color: var(--md-sys-color-on-primary-container);
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
|
|
56
|
+
<script>
|
|
57
|
+
document.body.classList.add('${theme}')
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<div id="place" @click=${(e) => popup(e)} class="md-typescale-display-medium">
|
|
61
|
+
Click this to popup image
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
30
64
|
export const Regular = Template.bind({});
|
|
31
65
|
Regular.args = {};
|
|
32
66
|
//# sourceMappingURL=ox-popup.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup.stories.js","sourceRoot":"","sources":["../../stories/ox-popup.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,KAAK,CAAA;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
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,iBAAiB,CAAA;AACzC,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,8CAA8C,CAAA;AAE1F,eAAe;IACb,KAAK,EAAE,aAAa;IACpB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE;QACR,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;KACzD;CACF,CAAA;AAYD,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,KAAK;QACZ,IAAI,EAAE,CAAC,CAAC,KAAK;QACb,MAAM,EAAE,CAAC,CAAC,MAAqB;KAChC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,QAAQ,GAAoB,CAAC,EAAE,KAAK,GAAG,OAAO,EAAY,EAAE,EAAE,CAAC,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;MAqBnE,iBAAiB,CAAC,OAAO;;;;;;;;;;;;;;;mCAeI,KAAK;;;2BAGb,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'\nimport { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'\n\nexport default {\n title: 'ContextMenu',\n component: 'ox-popup',\n argTypes: {\n theme: { control: 'select', options: ['light', 'dark'] }\n }\n}\n\ninterface Story<T> {\n (args: T): TemplateResult\n args?: Partial<T>\n argTypes?: Record<string, unknown>\n}\n\ninterface ArgTypes {\n theme?: 'light' | 'dark'\n}\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.pageY,\n left: e.pageX,\n parent: e.target as HTMLElement\n })\n}\n\nconst Template: Story<ArgTypes> = ({ theme = 'light' }: 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 width: 100%;\n height: 500px;\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 <script>\n document.body.classList.add('${theme}')\n </script>\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"]}
|