@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
package/src/components/Modal.vue
CHANGED
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
appear
|
|
5
5
|
@after-leave="onAfterLeave(); $emit('hide')"
|
|
6
6
|
@after-enter="$emit('show')">
|
|
7
|
-
<div v-if="currentState"
|
|
7
|
+
<div v-if="mounted && currentState"
|
|
8
8
|
ref="modal"
|
|
9
9
|
:class="computedClass"
|
|
10
10
|
:style="computedStyle"
|
|
11
11
|
:data-state="computedState ? 1 : 0">
|
|
12
|
+
|
|
12
13
|
<component v-if="Array.isArray(items) && items.length > 0"
|
|
13
14
|
v-for="(item, idx) in items"
|
|
14
15
|
:is="item.type"
|
|
@@ -38,6 +39,12 @@
|
|
|
38
39
|
</div>
|
|
39
40
|
<div v-if="isDisabled" :class="$style.overlay"></div>
|
|
40
41
|
</div>
|
|
42
|
+
|
|
43
|
+
<div :class="$style.dropzone">
|
|
44
|
+
<div class="p-5 bg-text-50 border-border-200 border-[1px] rounded-lg">
|
|
45
|
+
<svg width="48" height="48" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M448 416v-64c0-17.67-14.33-32-32-32s-32 14.33-32 32v64c0 17.67-14.33 32-32 32H96c-17.67 0-32-14.33-32-32v-64c0-17.67-14.33-32-32-32s-32 14.33-32 32v64c0 53.02 42.98 96 96 96h256C405 512 448 469 448 416zM246.6 342.6l128-128c12.51-12.51 12.49-32.76 0-45.25c-12.5-12.5-32.75-12.5-45.25 0L256 242.8V32c0-17.69-14.31-32-32-32S192 14.31 192 32v210.8L118.6 169.4c-12.5-12.5-32.75-12.5-45.25 0s-12.5 32.75 0 45.25l128 128C213.9 355.1 234.1 355.1 246.6 342.6z"/></svg>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
41
48
|
</div>
|
|
42
49
|
</Transition>
|
|
43
50
|
</Teleport>
|
|
@@ -70,7 +77,7 @@ export default{
|
|
|
70
77
|
|
|
71
78
|
mixins: [ componentMixin ],
|
|
72
79
|
|
|
73
|
-
emits: [ 'submit', 'apply', 'dismiss', 'show', 'hide' ],
|
|
80
|
+
emits: [ 'drop', 'submit', 'apply', 'dismiss', 'show', 'hide' ],
|
|
74
81
|
|
|
75
82
|
props:{
|
|
76
83
|
class:{ type: String, default: '' },
|
|
@@ -79,7 +86,11 @@ export default{
|
|
|
79
86
|
|
|
80
87
|
hash: String,
|
|
81
88
|
|
|
82
|
-
|
|
89
|
+
query: String,
|
|
90
|
+
|
|
91
|
+
height: {
|
|
92
|
+
type: [ String, Number ],
|
|
93
|
+
},
|
|
83
94
|
|
|
84
95
|
dock: String,
|
|
85
96
|
|
|
@@ -88,7 +99,10 @@ export default{
|
|
|
88
99
|
default: 'bottom'
|
|
89
100
|
},
|
|
90
101
|
|
|
91
|
-
state:
|
|
102
|
+
state: {
|
|
103
|
+
type: [ Number, Boolean, String ],
|
|
104
|
+
default: undefined
|
|
105
|
+
},
|
|
92
106
|
|
|
93
107
|
transition: String,
|
|
94
108
|
|
|
@@ -118,6 +132,15 @@ export default{
|
|
|
118
132
|
hash: this.$route.hash.replace(hash, '') + hash
|
|
119
133
|
})
|
|
120
134
|
}
|
|
135
|
+
else if(this.query){
|
|
136
|
+
this.$router.push({
|
|
137
|
+
...this.$route,
|
|
138
|
+
query: {
|
|
139
|
+
...this.$route.query,
|
|
140
|
+
[this.query]: context.query ?? ''
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
}
|
|
121
144
|
else{
|
|
122
145
|
this._state = true
|
|
123
146
|
}
|
|
@@ -125,17 +148,27 @@ export default{
|
|
|
125
148
|
|
|
126
149
|
close(){
|
|
127
150
|
if(this.hash){
|
|
128
|
-
|
|
129
|
-
const hash = this.$route.hash
|
|
151
|
+
let hash = this.$route.hash
|
|
130
152
|
.split('#')
|
|
131
153
|
.filter(_ => _.length > 0 && !_.startsWith(this.hash.substring(1)))
|
|
132
154
|
.join('#')
|
|
133
155
|
|
|
156
|
+
if(hash.length > 0 && hash.substring(0, 1) !== '#')
|
|
157
|
+
hash = '#' + hash
|
|
158
|
+
|
|
134
159
|
this.$router.replace({
|
|
135
160
|
...this.$route,
|
|
136
161
|
hash
|
|
137
162
|
})
|
|
138
163
|
}
|
|
164
|
+
else if(this.query){
|
|
165
|
+
const query = Object.assign({}, this.$route.query)
|
|
166
|
+
delete query[this.query]
|
|
167
|
+
this.$router.replace({
|
|
168
|
+
...this.$route,
|
|
169
|
+
query
|
|
170
|
+
})
|
|
171
|
+
}
|
|
139
172
|
else{
|
|
140
173
|
this._state = false
|
|
141
174
|
}
|
|
@@ -143,7 +176,6 @@ export default{
|
|
|
143
176
|
|
|
144
177
|
dismiss(){
|
|
145
178
|
if(this.isDisabled) return
|
|
146
|
-
this.close()
|
|
147
179
|
this.$emit('dismiss')
|
|
148
180
|
},
|
|
149
181
|
|
|
@@ -168,6 +200,11 @@ export default{
|
|
|
168
200
|
}
|
|
169
201
|
},
|
|
170
202
|
|
|
203
|
+
onDrop(e){
|
|
204
|
+
this.dragging = false
|
|
205
|
+
this.$emit('drop', e)
|
|
206
|
+
},
|
|
207
|
+
|
|
171
208
|
onKeyDown(e){
|
|
172
209
|
if(this.dismissable && this.$refs.modal && e.keyCode === 27){
|
|
173
210
|
this.dismiss()
|
|
@@ -207,9 +244,10 @@ export default{
|
|
|
207
244
|
return [
|
|
208
245
|
this.$style.modal,
|
|
209
246
|
this.$style['modal-' + (this.dock ?? this.position)],
|
|
210
|
-
this.class,
|
|
247
|
+
this.class ?? 'w-full',
|
|
211
248
|
this.mode === 'v-show' ? this.$style['v-show'] : '',
|
|
212
|
-
this.computedState ? this.$style.open : ''
|
|
249
|
+
this.computedState ? this.$style.open : '',
|
|
250
|
+
this.dragging ? this.$style['dragging'] : ''
|
|
213
251
|
]
|
|
214
252
|
.join(' ')
|
|
215
253
|
.trim()
|
|
@@ -217,34 +255,41 @@ export default{
|
|
|
217
255
|
|
|
218
256
|
computedStyle(){
|
|
219
257
|
return {
|
|
220
|
-
width: parseInt(
|
|
221
|
-
height: parseInt(
|
|
258
|
+
width: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.width),
|
|
259
|
+
height: (res => /^\d+$/.test(res) ? parseInt(res) + 'px' : res)(this.height),
|
|
222
260
|
}
|
|
223
261
|
},
|
|
224
262
|
|
|
225
263
|
computedTransition(){
|
|
264
|
+
let res
|
|
226
265
|
if(this.transition){
|
|
227
|
-
|
|
266
|
+
res = this.transition
|
|
228
267
|
}
|
|
229
268
|
else{
|
|
230
269
|
switch(this.dock ?? this.position){
|
|
231
270
|
case 'top':
|
|
232
|
-
|
|
271
|
+
res = 'slidedown'
|
|
272
|
+
break
|
|
233
273
|
case 'bottom':
|
|
234
|
-
|
|
274
|
+
res = 'slideup'
|
|
275
|
+
break
|
|
235
276
|
case 'left':
|
|
236
|
-
|
|
277
|
+
res = 'slideright'
|
|
278
|
+
break
|
|
237
279
|
case 'right':
|
|
238
|
-
|
|
280
|
+
res = 'slideleft'
|
|
281
|
+
break
|
|
239
282
|
case 'center':
|
|
240
|
-
|
|
283
|
+
res = 'slideout'
|
|
284
|
+
break
|
|
241
285
|
}
|
|
242
286
|
}
|
|
287
|
+
return res
|
|
243
288
|
},
|
|
244
289
|
|
|
245
290
|
computedState(){
|
|
246
|
-
return (this.debugState && this.editMode) ? Boolean(this.debugState) :
|
|
247
|
-
(this.state ? Boolean(this.state) : this._state)
|
|
291
|
+
return (this.debugState && this.editMode === 1) ? Boolean(this.debugState) :
|
|
292
|
+
(this.state !== undefined ? Boolean(this.state) : this._state)
|
|
248
293
|
},
|
|
249
294
|
|
|
250
295
|
currentState(){
|
|
@@ -258,7 +303,9 @@ export default{
|
|
|
258
303
|
return {
|
|
259
304
|
isDisabled: 0,
|
|
260
305
|
_state: false,
|
|
261
|
-
context: null
|
|
306
|
+
context: null,
|
|
307
|
+
dragging: false,
|
|
308
|
+
mounted: false,
|
|
262
309
|
}
|
|
263
310
|
},
|
|
264
311
|
|
|
@@ -269,7 +316,7 @@ export default{
|
|
|
269
316
|
watch:{
|
|
270
317
|
|
|
271
318
|
computedState: {
|
|
272
|
-
handler(to
|
|
319
|
+
handler(to){
|
|
273
320
|
this.setState(to)
|
|
274
321
|
}
|
|
275
322
|
},
|
|
@@ -279,26 +326,28 @@ export default{
|
|
|
279
326
|
if(typeof this.hash === 'string'){
|
|
280
327
|
this._state = (to ?? '').indexOf(this.hash) >= 0
|
|
281
328
|
}
|
|
282
|
-
}
|
|
329
|
+
},
|
|
330
|
+
immediate: true
|
|
331
|
+
},
|
|
332
|
+
|
|
333
|
+
'$route.query': {
|
|
334
|
+
handler(to){
|
|
335
|
+
if(typeof this.query === 'string'){
|
|
336
|
+
this._state = this.query in to
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
immediate: true
|
|
283
340
|
}
|
|
284
341
|
|
|
285
342
|
},
|
|
286
343
|
|
|
287
344
|
mounted() {
|
|
345
|
+
this.mounted = true
|
|
346
|
+
|
|
288
347
|
if(document.querySelector('.bW9k')){
|
|
289
348
|
document.querySelector('.bW9k').addEventListener('click', this.onDismiss)
|
|
290
349
|
}
|
|
291
350
|
window.addEventListener('keydown', this.onKeyDown)
|
|
292
|
-
|
|
293
|
-
this.$nextTick(() => {
|
|
294
|
-
if(this.computedState){
|
|
295
|
-
this.setState(this.computedState)
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if(this.hash !== null){
|
|
299
|
-
this._state = (this.$route.hash ?? '').indexOf(this.hash) >= 0
|
|
300
|
-
}
|
|
301
|
-
})
|
|
302
351
|
},
|
|
303
352
|
|
|
304
353
|
}
|
|
@@ -315,6 +364,7 @@ export default{
|
|
|
315
364
|
left: 0;
|
|
316
365
|
bottom: 0;
|
|
317
366
|
right: 0;
|
|
367
|
+
z-index: 100;
|
|
318
368
|
}
|
|
319
369
|
[data-theme="dark"] .bW9k{
|
|
320
370
|
@apply bg-black/50;
|
|
@@ -329,11 +379,20 @@ export default{
|
|
|
329
379
|
|
|
330
380
|
.modal{
|
|
331
381
|
@apply fixed;
|
|
332
|
-
@apply
|
|
333
|
-
@apply border-[1px] border-
|
|
382
|
+
@apply bg-base-400 dark:bg-base-300;
|
|
383
|
+
@apply border-[1px] border-border-50 flex max-h-[90vh] max-w-full;
|
|
334
384
|
@apply rounded-xl overflow-hidden transition-all;
|
|
385
|
+
z-index: 101;
|
|
335
386
|
}
|
|
336
|
-
|
|
387
|
+
|
|
388
|
+
.dropzone{
|
|
389
|
+
@apply hidden;
|
|
390
|
+
@apply absolute left-0 top-0 right-0 bottom-0;
|
|
391
|
+
@apply bg-black/50;
|
|
392
|
+
@apply items-center justify-center;
|
|
393
|
+
}
|
|
394
|
+
.modal.dragging .dropzone{
|
|
395
|
+
@apply flex;
|
|
337
396
|
}
|
|
338
397
|
|
|
339
398
|
.modal.v-show{
|
|
@@ -367,8 +426,8 @@ html[data-theme='dark'] .overlay{
|
|
|
367
426
|
@media screen and (max-width: 640px){
|
|
368
427
|
|
|
369
428
|
.modal {
|
|
429
|
+
width: 100% !important;
|
|
370
430
|
max-height: 90vh;
|
|
371
|
-
width: 100vw !important;
|
|
372
431
|
}
|
|
373
432
|
|
|
374
433
|
.modal-left{
|
|
@@ -393,12 +452,5 @@ html[data-theme='dark'] .overlay{
|
|
|
393
452
|
|
|
394
453
|
}
|
|
395
454
|
|
|
396
|
-
@media screen and (min-width: 640px) {
|
|
397
|
-
|
|
398
|
-
.modal {
|
|
399
|
-
max-width: 90vw;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
}
|
|
403
455
|
|
|
404
456
|
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.dropdown">
|
|
3
|
+
<div ref="btn" class="flex-1 flex flex-row items-center w-[150px]"
|
|
4
|
+
:class="containerClass"
|
|
5
|
+
@click="open()">
|
|
6
|
+
<div class="flex-1 p-2 text-ellipsis-nowrap">
|
|
7
|
+
{{ selectedText }}
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
<button type="button" class="px-2">
|
|
11
|
+
<svg width="14" height="14" class="fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<ContextMenu ref="contextMenu" class="mt-2">
|
|
16
|
+
<div class="flex flex-col min-w-[200px]">
|
|
17
|
+
<div class="p-2" v-if="viewedItems.length > 10">
|
|
18
|
+
<Textbox v-model="search" :clearable="true" @clear="search = ''">
|
|
19
|
+
<template #start>
|
|
20
|
+
<div class="pl-2">
|
|
21
|
+
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
</Textbox>
|
|
25
|
+
</div>
|
|
26
|
+
<div v-for="item in viewedItems" class="p-2" @click.stop>
|
|
27
|
+
<Checkbox :value="item[valueKey]" v-model="selectedItems">
|
|
28
|
+
{{ item[textKey] }}
|
|
29
|
+
</Checkbox>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</ContextMenu>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
|
|
38
|
+
export default{
|
|
39
|
+
|
|
40
|
+
props: {
|
|
41
|
+
containerClass: String,
|
|
42
|
+
|
|
43
|
+
modelValue: {
|
|
44
|
+
type: Array,
|
|
45
|
+
validator(value){
|
|
46
|
+
return Array.isArray(value)
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
items: Array,
|
|
51
|
+
|
|
52
|
+
textKey: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'text'
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
valueKey: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: 'value'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
computed: {
|
|
64
|
+
|
|
65
|
+
selectedText(){
|
|
66
|
+
if((this.modelValue ?? []).length > 0)
|
|
67
|
+
return this.modelValue.map(_ => _[this.textKey] ?? _[this.valueKey]).join(', ')
|
|
68
|
+
return this.$t('(Not Selected)')
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
viewedItems(){
|
|
72
|
+
if(this.search !== '')
|
|
73
|
+
return (this.items ?? []).filter(_ => `${_[this.textKey]}`.toLowerCase().indexOf(this.search.toLowerCase()) >= 0)
|
|
74
|
+
return this.items ?? []
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
data(){
|
|
80
|
+
return {
|
|
81
|
+
selectedItems: [],
|
|
82
|
+
search: '',
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
methods: {
|
|
87
|
+
|
|
88
|
+
open(){
|
|
89
|
+
this.selectedItems = (this.modelValue ?? []).map(_ => _[this.valueKey])
|
|
90
|
+
this.$refs.contextMenu.open(this.$refs.btn)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
watch: {
|
|
96
|
+
|
|
97
|
+
selectedItems: {
|
|
98
|
+
deep: true,
|
|
99
|
+
handler(_items){
|
|
100
|
+
this.$emit('update:modelValue', (this.items ?? []).filter(_ => _items.includes(_[this.valueKey]))
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style module>
|
|
112
|
+
|
|
113
|
+
.dropdown{
|
|
114
|
+
@apply flex items-center rounded-lg overflow-hidden cursor-pointer relative;
|
|
115
|
+
@apply border-[1px] border-border-200 bg-base-300;
|
|
116
|
+
}
|
|
117
|
+
.dropdown:not(.readonly){
|
|
118
|
+
@apply hover:border-border-300;
|
|
119
|
+
}
|
|
120
|
+
.dropdown.readonly{
|
|
121
|
+
@apply bg-text-50;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
</style>
|
|
@@ -137,7 +137,7 @@ export default{
|
|
|
137
137
|
<style module>
|
|
138
138
|
|
|
139
139
|
.textarea{
|
|
140
|
-
@apply flex items-start border-[1px] border-
|
|
140
|
+
@apply flex items-start border-[1px] border-border-200 bg-base-400 rounded-lg overflow-hidden;
|
|
141
141
|
}
|
|
142
142
|
.textarea textarea{
|
|
143
143
|
@apply flex-1 outline-none p-2 bg-transparent resize-none;
|
|
@@ -148,9 +148,6 @@ export default{
|
|
|
148
148
|
.textarea>textarea::-webkit-scrollbar{
|
|
149
149
|
display: none;
|
|
150
150
|
}
|
|
151
|
-
.textarea>textarea::placeholder{
|
|
152
|
-
@apply text-text-200;
|
|
153
|
-
}
|
|
154
151
|
.textarea.readonly{
|
|
155
152
|
@apply bg-text-50;
|
|
156
153
|
}
|
|
@@ -26,7 +26,7 @@ export default{
|
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
computed: {
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
computedClass(){
|
|
31
31
|
return [
|
|
32
32
|
this.$style.inner,
|
|
@@ -94,15 +94,21 @@ export default{
|
|
|
94
94
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
.input{
|
|
98
|
+
@apply outline-none text-center bg-base-300 text-lg;
|
|
99
|
+
@apply border-[1px] border-border-200 rounded-lg;
|
|
100
|
+
}
|
|
101
|
+
.input:focus{
|
|
102
|
+
@apply border-primary;
|
|
103
|
+
}
|
|
104
|
+
|
|
97
105
|
.inner{
|
|
98
|
-
@apply
|
|
106
|
+
@apply overflow-hidden;
|
|
99
107
|
@apply grid gap-4;
|
|
100
108
|
}
|
|
101
109
|
|
|
102
|
-
.size-sm{ @apply h-[var(--h-cp-sm)]; }
|
|
103
110
|
.size-sm input{ @apply text-sm; }
|
|
104
111
|
|
|
105
|
-
.size-lg{ @apply h-[var(--h-cp-lg)]; }
|
|
106
112
|
.size-lg input{ @apply text-lg; }
|
|
107
113
|
|
|
108
114
|
.length-3{ @apply grid-cols-3; }
|
|
@@ -110,16 +116,4 @@ export default{
|
|
|
110
116
|
.length-5{ @apply grid-cols-5; }
|
|
111
117
|
.length-6{ @apply grid-cols-6; }
|
|
112
118
|
|
|
113
|
-
|
|
114
|
-
@apply outline-none text-center bg-base-50 text-lg;
|
|
115
|
-
@apply border-[1px] border-text-200 rounded-lg;
|
|
116
|
-
}
|
|
117
|
-
.input:focus{
|
|
118
|
-
@apply border-primary;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.errorText{
|
|
122
|
-
@apply mt-2;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
</style>
|
|
119
|
+
</style>
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
</template>
|
|
64
|
-
<div v-if="tabIndex === 1" class="flex-1 flex flex-col divide-y divide-
|
|
64
|
+
<div v-if="tabIndex === 1" class="flex-1 flex flex-col divide-y divide-border-50">
|
|
65
65
|
<div v-for="widget in widgets" class="flex flex-row gap-4 p-4 px-6 hover:bg-primary-50">
|
|
66
|
-
<div class="w-[96px] h-[48px] border-[1px] border-
|
|
66
|
+
<div class="w-[96px] h-[48px] border-[1px] border-border-50 bg-base-300"></div>
|
|
67
67
|
<div class="flex-1">
|
|
68
68
|
<strong>{{ widget.type ?? widget.title }}</strong>
|
|
69
69
|
</div>
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
</div>
|
|
77
77
|
</div>
|
|
78
78
|
<div v-else class="flex-1 flex">
|
|
79
|
-
<ListItem :items="config.widgets" @reorder="reorderWidget" class="flex-1" bodyClass="divide-y divide-
|
|
79
|
+
<ListItem :items="config.widgets" @reorder="reorderWidget" class="flex-1" bodyClass="divide-y divide-border-50">
|
|
80
80
|
<template v-slot="{ item }">
|
|
81
81
|
<div class="flex flex-row items-center gap-2 px-3" :key="item">
|
|
82
82
|
<div class="p-2 cursor-move" data-reorder>
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
<script>
|
|
6
6
|
|
|
7
7
|
import {componentMixin} from "../mixin/component";
|
|
8
|
-
import {applyDatasourceReplacer} from "../utils/helpers.mjs";
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
export default{
|
|
@@ -19,7 +18,7 @@ export default{
|
|
|
19
18
|
computed: {
|
|
20
19
|
|
|
21
20
|
computedHtml(){
|
|
22
|
-
return
|
|
21
|
+
return this.html
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
},
|