@mixd-id/web-scaffold 0.2.240705 → 0.2.250801009
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/docs/components/Dashboard.md +56 -0
- package/log.txt +7 -0
- package/package.json +27 -19
- package/src/components/404.vue +61 -0
- package/src/components/AccountIcon.vue +19 -0
- package/src/components/Ahref.vue +1 -1
- package/src/components/Alert.vue +4 -13
- package/src/components/ArrayList.vue +49 -0
- package/src/components/Article.vue +24 -30
- package/src/components/Button.vue +79 -167
- package/src/components/Card.vue +235 -0
- package/src/components/Carousel.vue +61 -60
- package/src/components/Cart.vue +192 -0
- package/src/components/CartIcon.vue +89 -0
- package/src/components/ChartBar.vue +2 -3
- package/src/components/Checkbox.vue +20 -11
- package/src/components/Checkout.vue +373 -0
- package/src/components/CheckoutDelivery.vue +267 -0
- package/src/components/CodeEditor.vue +5 -16
- package/src/components/CollapsiblePanel.vue +70 -0
- package/src/components/ColorPicker.vue +8 -3
- package/src/components/ColorPicker2.vue +41 -19
- package/src/components/ColorPicker3.vue +100 -0
- package/src/components/Confirm.vue +9 -7
- package/src/components/ContextMenu.vue +122 -206
- package/src/components/ContextMenuItem.vue +53 -0
- package/src/components/Dashboard.vue +243 -0
- package/src/components/Dashboard2.vue +118 -0
- package/src/components/DashboardComponentSelector.vue +96 -0
- package/src/components/DashboardConfigs.vue +202 -0
- package/src/components/Datepicker.vue +102 -41
- package/src/components/DayTimeRange.vue +3 -2
- package/src/components/Dropdown.vue +7 -4
- package/src/components/Flex.vue +14 -40
- package/src/components/GHeatMaps.vue +2 -2
- package/src/components/Grid.vue +6 -6
- package/src/components/HTMLEditor.vue +27 -14
- package/src/components/Image.vue +62 -108
- package/src/components/ImagePreview.vue +14 -4
- package/src/components/ImageUploader.vue +114 -0
- package/src/components/ImportModal.vue +3 -3
- package/src/components/Link.vue +62 -6
- package/src/components/List.vue +524 -402
- package/src/components/ListContextMenu.vue +88 -0
- package/src/components/ListItem.vue +5 -3
- package/src/components/ListPage1.vue +14 -15
- package/src/components/ListView.vue +5 -6
- package/src/components/ListViewSettings.vue +2 -2
- package/src/components/LogViewerItem.vue +1 -1
- package/src/components/MarkdownEdit.vue +128 -0
- package/src/components/MarkdownPreview.vue +102 -0
- package/src/components/MenuItem1.vue +36 -0
- package/src/components/Modal.vue +95 -43
- package/src/components/MultiDropdown.vue +124 -0
- package/src/components/MultilineText.vue +1 -4
- package/src/components/OTPField.vue +11 -17
- package/src/components/ObjectTree.vue +1 -1
- package/src/components/PageBuilder.vue +3 -3
- package/src/components/Paragraph.vue +1 -2
- package/src/components/PresetSelectorFilterItem.vue +107 -95
- package/src/components/Radio.vue +1 -1
- package/src/components/SearchModal.vue +153 -0
- package/src/components/Slider.vue +1 -1
- package/src/components/Svg.vue +1 -1
- package/src/components/SvgEditor.vue +173 -0
- package/src/components/Switch.vue +4 -5
- package/src/components/Table.vue +2 -2
- package/src/components/TableView.vue +2 -3
- package/src/components/TableViewHead.vue +2 -2
- package/src/components/Tabs.vue +1 -1
- package/src/components/Testimonial.vue +2 -2
- package/src/components/Text.vue +7 -22
- package/src/components/TextEditor.vue +3 -3
- package/src/components/TextWithTag.vue +61 -30
- package/src/components/Textarea.vue +11 -16
- package/src/components/Textbox.vue +9 -19
- package/src/components/Timepicker.vue +25 -15
- package/src/components/Toast.vue +5 -3
- package/src/components/TreeMenu.vue +122 -0
- package/src/components/TreeView.vue +15 -10
- package/src/components/TreeView2.vue +38 -0
- package/src/components/TreeViewItem.vue +58 -29
- package/src/components/TreeViewItem2.vue +55 -0
- package/src/components/Uploader.vue +45 -0
- package/src/components/Video.vue +119 -0
- package/src/components/VirtualGrid.vue +24 -7
- package/src/components/VirtualTable.vue +363 -128
- package/src/configs/dashboard/data-table.js +9 -0
- package/src/configs/web-page-builder.js +118 -0
- package/src/directives/intersect.js +26 -0
- package/src/hooks/device.js +14 -0
- package/src/index.js +62 -107
- package/src/mixin/component.js +147 -67
- package/src/themes/default/index.js +83 -155
- package/src/utils/dashboard.js +22 -962
- package/src/utils/helpers.cjs +635 -0
- package/src/utils/helpers.js +91 -60
- package/src/utils/helpers.mjs +245 -12
- package/src/utils/importer.js +22 -3
- package/src/utils/list.mjs +1509 -0
- package/src/utils/preset-selector.cjs +1455 -0
- package/src/utils/preset-selector.js +489 -95
- package/src/utils/preset-selector.mjs +59 -20
- package/src/utils/queue.js +63 -0
- package/src/utils/web.mjs +120 -0
- package/src/utils/wss.js +37 -29
- package/src/utils/wss.mjs +24 -19
- package/src/widgets/AhrefSetting.vue +16 -13
- package/src/widgets/ArticleSetting.vue +15 -27
- package/src/widgets/BackgroundColorSetting.vue +153 -0
- package/src/widgets/BorderColorSetting.vue +57 -0
- package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
- package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
- package/src/widgets/BotEditor.vue +35 -15
- package/src/widgets/ButtonSetting.vue +12 -13
- package/src/widgets/CarouselSetting.vue +33 -45
- package/src/widgets/CartSetting.vue +46 -0
- package/src/widgets/CheckoutSetting.vue +46 -0
- package/src/widgets/CollapsiblePanelSetting.vue +46 -0
- package/src/widgets/ColumnSelector.vue +29 -5
- package/src/widgets/ComponentSetting.vue +1 -1
- package/src/widgets/ComponentSetting2.vue +112 -234
- package/src/widgets/ComponentSetting3.vue +1 -1
- package/src/widgets/ContactForm.vue +3 -3
- package/src/widgets/ContactFormSetting.vue +41 -30
- package/src/widgets/Dashboard/BarChart.vue +47 -11
- package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
- package/src/widgets/Dashboard/DataTable.vue +125 -0
- package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
- package/src/widgets/Dashboard/Doughnut.vue +49 -7
- package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
- package/src/widgets/Dashboard/Metric.vue +78 -19
- package/src/widgets/Dashboard/MetricSetting.vue +81 -28
- package/src/widgets/Dashboard/Pie.vue +55 -6
- package/src/widgets/Dashboard/PieSetting.vue +1 -1
- package/src/widgets/Dashboard/PolarArea.vue +49 -7
- package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
- package/src/widgets/Dashboard/SharingModal.vue +4 -5
- package/src/widgets/Dashboard/ViewSelector.vue +2 -2
- package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
- package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
- package/src/widgets/EmbeddedVideoSetting.vue +7 -5
- package/src/widgets/FAQ.vue +16 -3
- package/src/widgets/FAQSetting.vue +53 -47
- package/src/widgets/FeatureList.vue +3 -0
- package/src/widgets/FeatureListSetting.vue +112 -102
- package/src/widgets/FlexSetting.vue +83 -106
- package/src/widgets/GridSetting.vue +71 -196
- package/src/widgets/Header2.vue +34 -71
- package/src/widgets/Header2Setting.vue +95 -179
- package/src/widgets/HeaderSetting.vue +16 -18
- package/src/widgets/IconListSetting.vue +69 -65
- package/src/widgets/ImageSetting.vue +33 -60
- package/src/widgets/LinkSetting.vue +60 -37
- package/src/widgets/LinkSettingModal.vue +173 -0
- package/src/widgets/LogViewer.vue +1 -1
- package/src/widgets/MarginSetting.vue +2 -2
- package/src/widgets/MenuEditor.vue +1 -1
- package/src/widgets/MenuItem1Setting.vue +78 -0
- package/src/widgets/ModalSetting.vue +42 -44
- package/src/widgets/MultiValueSetting.vue +2 -2
- package/src/widgets/MultiValueSetting2.vue +78 -45
- package/src/widgets/OGSettingModal.vue +103 -0
- package/src/widgets/PaddingSetting.vue +2 -2
- package/src/widgets/ParagraphSetting.vue +16 -13
- package/src/widgets/PositionSetting.vue +209 -0
- package/src/widgets/PresetBar.vue +359 -210
- package/src/widgets/PresetBarPivot.vue +31 -19
- package/src/widgets/PresetSelector.vue +29 -17
- package/src/widgets/SearchModalSetting.vue +70 -0
- package/src/widgets/Share.vue +1 -2
- package/src/widgets/ShareSetting.vue +67 -60
- package/src/widgets/StyleSetting.vue +227 -116
- package/src/widgets/TestimonialSetting.vue +97 -88
- package/src/widgets/TextBlockSetting.vue +16 -13
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
- package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
- package/src/widgets/UserActionBuilder.vue +4 -16
- package/src/widgets/WebComponentSelector.vue +15 -11
- package/src/widgets/WebLayoutSelector.vue +41 -270
- package/src/widgets/WebPageBuilder.vue +693 -704
- package/src/widgets/WebPageBuilder2.vue +7 -7
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
- package/src/widgets/WebPageBuilder4.vue +289 -575
- package/src/widgets/WebPageSelector.vue +1 -1
- package/src/widgets/YoutubeVideoSetting.vue +16 -13
- package/tailwind.config.js +3 -35
- package/docs/schema/user-action.json +0 -266
- package/src/App.vue +0 -25
- package/src/components/SearchButton.vue +0 -57
- package/src/entry-client.js +0 -27
- package/src/entry-server.js +0 -73
- package/src/events/event.js +0 -2
- package/src/main.js +0 -29
- package/src/mixin/website.js +0 -121
- package/src/router.js +0 -57
- package/src/widgets/MobileMenu.vue +0 -182
- package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
- package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
- package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
- package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
- package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
- package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
- package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
- package/test.json +0 -22
- /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
- /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to=".Y29u">
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<Transition :name="transition" @after-enter="onAppear" @after-leave="onLeave">
|
|
4
|
+
<div v-show="!!(computedState)" :class="computedClass" :style="computedStyle" ref="contextMenu">
|
|
5
|
+
<div :class="bodyClass">
|
|
6
|
+
<slot name="default" :context="context"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</Transition>
|
|
8
10
|
</Teleport>
|
|
9
11
|
</template>
|
|
10
12
|
|
|
11
13
|
<script>
|
|
12
14
|
|
|
15
|
+
import {parseBoolean} from "../utils/helpers.mjs";
|
|
16
|
+
|
|
13
17
|
export default {
|
|
14
18
|
|
|
15
19
|
props:{
|
|
@@ -33,11 +37,9 @@ export default {
|
|
|
33
37
|
bodyClass: String,
|
|
34
38
|
|
|
35
39
|
dismiss: {
|
|
36
|
-
type: Boolean,
|
|
40
|
+
type: [ String, Boolean ],
|
|
37
41
|
default: true
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
width: String,
|
|
42
|
+
}
|
|
41
43
|
|
|
42
44
|
},
|
|
43
45
|
|
|
@@ -68,7 +70,8 @@ export default {
|
|
|
68
70
|
isOpen: false,
|
|
69
71
|
context: null,
|
|
70
72
|
closing: false,
|
|
71
|
-
currentCaller: null
|
|
73
|
+
currentCaller: null,
|
|
74
|
+
transition: 'slidedown'
|
|
72
75
|
}
|
|
73
76
|
},
|
|
74
77
|
|
|
@@ -78,45 +81,28 @@ export default {
|
|
|
78
81
|
if(to){
|
|
79
82
|
this.open()
|
|
80
83
|
}
|
|
81
|
-
else{
|
|
82
|
-
window.removeEventListener('click', this.onDismiss)
|
|
83
|
-
window.removeEventListener('scroll', this.onDismiss)
|
|
84
|
-
}
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
},
|
|
88
87
|
|
|
89
88
|
methods: {
|
|
90
89
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
window.addEventListener('click', this.onDismiss)
|
|
96
|
-
window.addEventListener('scroll', this.onDismiss)
|
|
97
|
-
if(this.$refs.contextMenu)
|
|
98
|
-
this.$refs.contextMenu.removeEventListener('transitionend', transitionEnd)
|
|
99
|
-
this.$emit('open')
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
this.$refs.contextMenu.removeEventListener('transitionend', transitionEnd)
|
|
103
|
-
this.$refs.contextMenu.addEventListener('transitionend', transitionEnd)
|
|
104
|
-
this.$nextTick(() => {
|
|
105
|
-
this.$refs.contextMenu.classList.add(this.$style.active)
|
|
106
|
-
})
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
onDismiss(e){
|
|
110
|
-
if(typeof window === 'undefined') return
|
|
111
|
-
if(!this.$refs.contextMenu) return
|
|
90
|
+
onClick(){
|
|
91
|
+
if(parseBoolean(this.dismiss) && this.isOpen)
|
|
92
|
+
this.close()
|
|
93
|
+
},
|
|
112
94
|
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
onAppear(){
|
|
96
|
+
window.addEventListener('click', this.onClick)
|
|
97
|
+
this.$emit('open')
|
|
98
|
+
},
|
|
115
99
|
|
|
116
|
-
|
|
117
|
-
|
|
100
|
+
onLeave(){
|
|
101
|
+
window.removeEventListener('click', this.onClick)
|
|
102
|
+
},
|
|
118
103
|
|
|
119
104
|
open(caller, context){
|
|
105
|
+
caller = caller ?? this.caller
|
|
120
106
|
|
|
121
107
|
const originalCaller = caller
|
|
122
108
|
if(this.isOpen && this.currentCaller !== caller){
|
|
@@ -127,12 +113,6 @@ export default {
|
|
|
127
113
|
})
|
|
128
114
|
}
|
|
129
115
|
|
|
130
|
-
if(caller){
|
|
131
|
-
this.isOpen = true
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
caller = caller ?? this.caller
|
|
135
|
-
|
|
136
116
|
if(caller){
|
|
137
117
|
|
|
138
118
|
caller = caller.$el ? caller.$el :
|
|
@@ -141,129 +121,88 @@ export default {
|
|
|
141
121
|
this.context = context
|
|
142
122
|
|
|
143
123
|
if(caller){
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if(top){
|
|
231
|
-
if(top + this.$refs.contextMenu.clientHeight >= (window.innerHeight - 16)){
|
|
232
|
-
top = window.innerHeight - (this.$refs.contextMenu.clientHeight + 16)
|
|
233
|
-
|
|
234
|
-
if(transformOrigin === 'top left'){
|
|
235
|
-
transformOrigin = 'bottom left'
|
|
236
|
-
}
|
|
237
|
-
else if(transformOrigin === 'top right'){
|
|
238
|
-
transformOrigin = 'bottom right'
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if(top < 0){
|
|
243
|
-
top = 0
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
maxHeight = this.$refs.contextMenu.clientHeight > window.innerHeight * .8 ?
|
|
248
|
-
Math.round(window.innerHeight * .8) : this.$refs.contextMenu.clientHeight + 24
|
|
249
|
-
|
|
250
|
-
this.computedStyle = {
|
|
251
|
-
left: left ? left + 'px' : left,
|
|
252
|
-
right: right ? right + 'px' : right,
|
|
253
|
-
top: top ? top + 'px' : top,
|
|
254
|
-
bottom: bottom ? bottom + 'px' : bottom,
|
|
255
|
-
maxHeight: maxHeight ? maxHeight + 'px' : maxHeight,
|
|
256
|
-
transformOrigin: transformOrigin
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
if(this.width === 'parent'){
|
|
260
|
-
this.computedStyle.width = parseInt(rect.width) + 'px'
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
this.onOpen()
|
|
264
|
-
})
|
|
265
|
-
}
|
|
266
|
-
|
|
124
|
+
if(this.$device.mediaIndex === 0){
|
|
125
|
+
this.computedStyle = {
|
|
126
|
+
left: 0,
|
|
127
|
+
right: 0,
|
|
128
|
+
top: '60px',
|
|
129
|
+
minWidth: `${caller.clientWidth}px`,
|
|
130
|
+
transformOrigin: 'top'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else{
|
|
134
|
+
let maxHeight, transformOrigin
|
|
135
|
+
let top, right, bottom, left
|
|
136
|
+
const rect = caller.getBoundingClientRect()
|
|
137
|
+
|
|
138
|
+
switch(this.position){
|
|
139
|
+
|
|
140
|
+
case 'bottom-right':
|
|
141
|
+
right = window.innerWidth - (Math.round(rect.x) + rect.width)
|
|
142
|
+
top = Math.round(rect.y + rect.height + 8)
|
|
143
|
+
maxHeight = window.innerHeight - Math.round(rect.y + rect.height + 16)
|
|
144
|
+
transformOrigin = 'top right'
|
|
145
|
+
break
|
|
146
|
+
|
|
147
|
+
case 'top-left':
|
|
148
|
+
maxHeight = Math.round(rect.top - 16)
|
|
149
|
+
bottom = window.innerHeight - rect.top + 8
|
|
150
|
+
left = Math.round(rect.x)
|
|
151
|
+
transformOrigin = 'bottom left'
|
|
152
|
+
this.transition = 'slideup'
|
|
153
|
+
break
|
|
154
|
+
|
|
155
|
+
case 'top-right':
|
|
156
|
+
maxHeight = Math.round(rect.top - 16)
|
|
157
|
+
bottom = window.innerHeight - rect.top + 8
|
|
158
|
+
right = window.innerWidth - (Math.round(rect.x) + rect.width)
|
|
159
|
+
transformOrigin = 'bottom right'
|
|
160
|
+
this.transition = 'slideup'
|
|
161
|
+
break
|
|
162
|
+
|
|
163
|
+
case 'right':
|
|
164
|
+
left = Math.round(rect.x + rect.width)
|
|
165
|
+
top = Math.round(rect.y - 2)
|
|
166
|
+
transformOrigin = 'top left'
|
|
167
|
+
break
|
|
168
|
+
|
|
169
|
+
case 'bottom':
|
|
170
|
+
left = Math.round(rect.x)
|
|
171
|
+
top = null
|
|
172
|
+
bottom = 0
|
|
173
|
+
transformOrigin = 'bottom'
|
|
174
|
+
maxHeight = window.innerHeight
|
|
175
|
+
this.transition = 'slideup'
|
|
176
|
+
break
|
|
177
|
+
|
|
178
|
+
default:
|
|
179
|
+
left = Math.round(rect.x)
|
|
180
|
+
top = Math.round(rect.y + rect.height)
|
|
181
|
+
transformOrigin = 'top left'
|
|
182
|
+
maxHeight = window.innerHeight - top - 16
|
|
183
|
+
this.transition = 'slidedown'
|
|
184
|
+
|
|
185
|
+
if(top > window.innerHeight * .8){
|
|
186
|
+
top = null
|
|
187
|
+
bottom = window.innerHeight - rect.top + 8
|
|
188
|
+
transformOrigin = 'bottom'
|
|
189
|
+
maxHeight = Math.round(rect.top - 16)
|
|
190
|
+
this.transition = 'slideup'
|
|
191
|
+
}
|
|
192
|
+
break
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
this.computedStyle = {
|
|
196
|
+
left: left ? left + 'px' : '',
|
|
197
|
+
right: right ? right + 'px' : '',
|
|
198
|
+
top: top ? top + 'px' : '',
|
|
199
|
+
bottom: bottom !== null ? bottom + 'px' : '',
|
|
200
|
+
maxHeight: maxHeight ? maxHeight + 'px' : '',
|
|
201
|
+
transformOrigin: transformOrigin
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
this.isOpen = true
|
|
267
206
|
this.currentCaller = originalCaller
|
|
268
207
|
}
|
|
269
208
|
else{
|
|
@@ -275,28 +214,12 @@ export default {
|
|
|
275
214
|
}
|
|
276
215
|
},
|
|
277
216
|
|
|
278
|
-
close(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const transitionEnd = () => {
|
|
282
|
-
window.removeEventListener('click', this.onDismiss)
|
|
283
|
-
window.removeEventListener('scroll', this.onDismiss)
|
|
284
|
-
if(this.$refs.contextMenu){
|
|
285
|
-
this.$refs.contextMenu.removeEventListener('transitionend', transitionEnd)
|
|
286
|
-
this.computedStyle = {}
|
|
287
|
-
}
|
|
288
|
-
this.computedStyle = null
|
|
289
|
-
this.isOpen = false
|
|
290
|
-
this.$emit('dismiss')
|
|
291
|
-
if(typeof fn === 'function') fn()
|
|
292
|
-
}
|
|
293
|
-
this.$refs.contextMenu.removeEventListener('transitionend', transitionEnd)
|
|
294
|
-
this.$refs.contextMenu.addEventListener('transitionend', transitionEnd)
|
|
295
|
-
this.$refs.contextMenu.classList.remove(this.$style.active)
|
|
217
|
+
close(){
|
|
218
|
+
this.isOpen = false
|
|
219
|
+
this.$emit('dismiss')
|
|
296
220
|
},
|
|
297
221
|
|
|
298
222
|
toggle(caller, context){
|
|
299
|
-
|
|
300
223
|
if(this.isOpen){
|
|
301
224
|
this.close()
|
|
302
225
|
}
|
|
@@ -318,31 +241,24 @@ export default {
|
|
|
318
241
|
<style module>
|
|
319
242
|
|
|
320
243
|
.contextMenu{
|
|
321
|
-
@apply fixed
|
|
322
|
-
@apply border-[
|
|
323
|
-
|
|
324
|
-
opacity: 0;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.active{
|
|
328
|
-
opacity: 1;
|
|
329
|
-
transform: translate3d(0, 0, 0);
|
|
244
|
+
@apply fixed bg-base-400 backdrop-blur-xl min-w-[150px] overflow-y-auto rounded-lg;
|
|
245
|
+
@apply whitespace-nowrap shadow-2xl border-[1px] border-border-50 mt-[1px];
|
|
246
|
+
z-index: 180;
|
|
330
247
|
}
|
|
331
248
|
|
|
332
|
-
@media screen(
|
|
249
|
+
@media screen and (min-width: 640px){
|
|
333
250
|
|
|
334
251
|
.contextMenu{
|
|
335
|
-
@apply fixed
|
|
336
|
-
@apply border-[1px] border-text-50 shadow-2xl whitespace-nowrap;
|
|
337
|
-
transition: all 150ms cubic-bezier(0.25, 1, 0.5, 1);
|
|
338
|
-
opacity: 0;
|
|
339
|
-
transform: scale(.1);
|
|
252
|
+
@apply fixed min-w-[150px] overflow-y-auto;
|
|
340
253
|
}
|
|
341
254
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
@media screen and (max-width: 640px){
|
|
258
|
+
|
|
259
|
+
.contextMenu{
|
|
260
|
+
@apply w-full;
|
|
261
|
+
}
|
|
346
262
|
|
|
347
263
|
}
|
|
348
264
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.item">
|
|
3
|
+
<div class="py-1">
|
|
4
|
+
<div :class="`${$style.indicator}${value.status === 2 ? ` ${$style.read}` : ''}`"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="flex-1 flex flex-col">
|
|
7
|
+
<div class="flex flex-row gap-6">
|
|
8
|
+
<strong class="flex-1 text-ellipsis-nowrap">{{ value.title }}</strong>
|
|
9
|
+
<small class="text-text-400">{{ dayjs(value.createdAt).format('D MMM HH:mm') }}</small>
|
|
10
|
+
</div>
|
|
11
|
+
<div>
|
|
12
|
+
<p class="whitespace-pre-wrap line-clamp-2">Biscuit bonbon gummi bears biscuit jelly-o cupcake danish tart carrot cake. Icing muffin gummi bears</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
|
|
20
|
+
import dayjs from "dayjs";
|
|
21
|
+
|
|
22
|
+
export default{
|
|
23
|
+
methods: {dayjs},
|
|
24
|
+
|
|
25
|
+
props: {
|
|
26
|
+
|
|
27
|
+
value: Object
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style module>
|
|
36
|
+
|
|
37
|
+
.item {
|
|
38
|
+
@apply flex flex-row gap-3 p-3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.item:hover{
|
|
42
|
+
@apply bg-primary-50;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.indicator{
|
|
46
|
+
@apply w-[14px] h-[14px] rounded-full bg-primary-600;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.indicator.read{
|
|
50
|
+
@apply bg-text-300;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
</style>
|