@operato/popup 7.0.5 → 7.0.20
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 +18 -0
- package/dist/src/ox-popup-list.d.ts +1 -0
- package/dist/src/ox-popup-list.js.map +1 -1
- package/dist/src/ox-popup-menu.d.ts +2 -1
- package/dist/src/ox-popup-menu.js +2 -2
- package/dist/src/ox-popup-menu.js.map +1 -1
- package/dist/src/ox-popup-menuitem.js +1 -1
- package/dist/src/ox-popup-menuitem.js.map +1 -1
- package/dist/src/ox-popup.d.ts +10 -2
- package/dist/src/ox-popup.js +25 -17
- package/dist/src/ox-popup.js.map +1 -1
- package/dist/stories/ox-popup-list-sortable.stories.js +5 -2
- package/dist/stories/ox-popup-list-sortable.stories.js.map +1 -1
- package/dist/stories/ox-popup-list.stories.js +36 -23
- package/dist/stories/ox-popup-list.stories.js.map +1 -1
- package/dist/stories/ox-popup-menu.stories.js +22 -6
- package/dist/stories/ox-popup-menu.stories.js.map +1 -1
- package/dist/stories/ox-popup.stories.js +7 -4
- package/dist/stories/ox-popup.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/ox-popup-list.ts +1 -0
- package/src/ox-popup-menu.ts +4 -2
- package/src/ox-popup-menuitem.ts +2 -1
- package/src/ox-popup.ts +40 -17
- package/stories/ox-popup-list-sortable.stories.ts +5 -2
- package/stories/ox-popup-list.stories.ts +39 -26
- package/stories/ox-popup-menu.stories.ts +22 -6
- package/stories/ox-popup.stories.ts +7 -4
|
@@ -28,8 +28,9 @@ interface ArgTypes {
|
|
|
28
28
|
function popup(e: MouseEvent, preventCloseOnBlur: boolean) {
|
|
29
29
|
const popupList = document.querySelector('#popup-list') as OxPopupList
|
|
30
30
|
popupList?.open({
|
|
31
|
-
top: e.
|
|
32
|
-
left: e.
|
|
31
|
+
top: e.offsetY,
|
|
32
|
+
left: e.offsetX,
|
|
33
|
+
absolutePosition: false
|
|
33
34
|
})
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -58,6 +59,15 @@ const Template: Story<ArgTypes> = ({ preventCloseOnBlur }: ArgTypes) => html`
|
|
|
58
59
|
</style>
|
|
59
60
|
|
|
60
61
|
<style>
|
|
62
|
+
#container {
|
|
63
|
+
display: flex;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
#noise {
|
|
67
|
+
width: 100px;
|
|
68
|
+
height: 100px;
|
|
69
|
+
}
|
|
70
|
+
|
|
61
71
|
#place {
|
|
62
72
|
width: 100%;
|
|
63
73
|
height: 500px;
|
|
@@ -68,31 +78,34 @@ const Template: Story<ArgTypes> = ({ preventCloseOnBlur }: ArgTypes) => html`
|
|
|
68
78
|
}
|
|
69
79
|
</style>
|
|
70
80
|
|
|
71
|
-
<div id="
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
81
|
+
<div id="container">
|
|
82
|
+
<div id="noise"></div>
|
|
83
|
+
<div id="place" @click=${(e: MouseEvent) => popup(e, preventCloseOnBlur)} class="md-typescale-display-medium">
|
|
84
|
+
Click this to popup list
|
|
85
|
+
<ox-popup-list
|
|
86
|
+
id="popup-list"
|
|
87
|
+
@select=${(e: Event) => console.log('select', e.target)}
|
|
88
|
+
multiple
|
|
89
|
+
?prevent-close-on-blur=${preventCloseOnBlur}
|
|
90
|
+
>
|
|
91
|
+
<div option>Plain Text</div>
|
|
92
|
+
|
|
93
|
+
<div option>
|
|
94
|
+
<ox-checkbox label="checkbox" slot="icon" checked>checkbox</ox-checkbox>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div option>
|
|
98
|
+
<input id="checkbox-01" type="checkbox" />
|
|
99
|
+
<label for="checkbox-01">custom option</label>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<div option>
|
|
103
|
+
<label for="text-01">value</label>
|
|
104
|
+
<input id="text-01" type="text" value="Plain text input" />
|
|
105
|
+
</div>
|
|
106
|
+
</ox-popup-list>
|
|
89
107
|
</div>
|
|
90
|
-
|
|
91
|
-
<div option>
|
|
92
|
-
<label for="text-01">value</label>
|
|
93
|
-
<input id="text-01" type="text" value="Plain text input" />
|
|
94
|
-
</div>
|
|
95
|
-
</ox-popup-list>
|
|
108
|
+
</div>
|
|
96
109
|
`
|
|
97
110
|
|
|
98
111
|
export const Regular = Template.bind({})
|
|
@@ -119,9 +119,10 @@ function popup(e: MouseEvent) {
|
|
|
119
119
|
<input id="text-01" type="text" value="Plain text input" />
|
|
120
120
|
</div>
|
|
121
121
|
`,
|
|
122
|
-
top: e.
|
|
123
|
-
left: e.
|
|
124
|
-
parent: e.target as HTMLElement
|
|
122
|
+
top: e.offsetY,
|
|
123
|
+
left: e.offsetX,
|
|
124
|
+
parent: e.target as HTMLElement,
|
|
125
|
+
absolutePosition: false
|
|
125
126
|
})
|
|
126
127
|
}
|
|
127
128
|
|
|
@@ -150,18 +151,33 @@ const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
|
|
|
150
151
|
</style>
|
|
151
152
|
|
|
152
153
|
<style>
|
|
154
|
+
#container {
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: row;
|
|
157
|
+
height: 600px;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#padding {
|
|
161
|
+
width: 100px;
|
|
162
|
+
height: 100px;
|
|
163
|
+
}
|
|
164
|
+
|
|
153
165
|
#place {
|
|
154
166
|
width: 100%;
|
|
155
|
-
height:
|
|
167
|
+
height: 400px;
|
|
156
168
|
text-align: center;
|
|
169
|
+
padding-left: 100px;
|
|
157
170
|
|
|
158
171
|
background-color: var(--md-sys-color-primary-container);
|
|
159
172
|
color: var(--md-sys-color-on-primary-container);
|
|
160
173
|
}
|
|
161
174
|
</style>
|
|
162
175
|
|
|
163
|
-
<div id="
|
|
164
|
-
|
|
176
|
+
<div id="container">
|
|
177
|
+
<div id="padding"></div>
|
|
178
|
+
<div id="place" @click=${(e: MouseEvent) => popup(e)} class="md-typescale-display-medium">
|
|
179
|
+
Click this to popup menu
|
|
180
|
+
</div>
|
|
165
181
|
</div>
|
|
166
182
|
`
|
|
167
183
|
|
|
@@ -5,7 +5,7 @@ import { OxPopup } from '../src/ox-popup'
|
|
|
5
5
|
import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
|
-
title: '
|
|
8
|
+
title: 'Simple Popup',
|
|
9
9
|
component: 'ox-popup',
|
|
10
10
|
argTypes: {}
|
|
11
11
|
}
|
|
@@ -23,9 +23,10 @@ function popup(e: MouseEvent) {
|
|
|
23
23
|
|
|
24
24
|
OxPopup.open({
|
|
25
25
|
template: html`<img src=${noImage} />`,
|
|
26
|
-
top: e.
|
|
27
|
-
left: e.
|
|
28
|
-
parent: e.target as HTMLElement
|
|
26
|
+
top: e.offsetY,
|
|
27
|
+
left: e.offsetX,
|
|
28
|
+
parent: e.target as HTMLElement,
|
|
29
|
+
absolutePosition: false
|
|
29
30
|
})
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -58,6 +59,8 @@ const Template: Story<ArgTypes> = ({}: ArgTypes) => html`
|
|
|
58
59
|
width: 100%;
|
|
59
60
|
height: 500px;
|
|
60
61
|
text-align: center;
|
|
62
|
+
padding: 20px;
|
|
63
|
+
margin: 20px;
|
|
61
64
|
|
|
62
65
|
background-color: var(--md-sys-color-primary-container);
|
|
63
66
|
color: var(--md-sys-color-on-primary-container);
|