@mixd-id/web-scaffold 0.2.250801010 → 0.2.250801012
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/AccountIcon.md +16 -0
- package/docs/components/Ahref.md +35 -0
- package/docs/components/Alert.md +72 -0
- package/docs/components/ArrayList.md +39 -0
- package/docs/components/Article.md +28 -0
- package/docs/components/BarChart.md +81 -0
- package/docs/components/Block.md +23 -0
- package/docs/components/Box.md +15 -0
- package/docs/components/Button.md +68 -0
- package/docs/components/Card.md +67 -0
- package/docs/components/Carousel.md +70 -0
- package/docs/components/Cart.md +20 -0
- package/docs/components/CartIcon.md +29 -0
- package/docs/components/Chart.md +53 -0
- package/docs/components/ChartBar.md +34 -0
- package/docs/components/ChatTyping.md +21 -0
- package/docs/components/Checkbox.md +63 -0
- package/docs/components/CodeEditor.md +25 -0
- package/docs/components/CollapsiblePanel.md +41 -0
- package/docs/components/ColorPicker.md +52 -0
- package/docs/components/Confirm.md +62 -0
- package/docs/components/ContextMenu.md +76 -0
- package/docs/components/ContextMenuItem.md +29 -0
- package/docs/components/CopyToClipboard.md +43 -0
- package/docs/components/Countdown.md +47 -0
- package/docs/components/Datepicker.md +61 -0
- package/docs/components/Datetimepicker.md +57 -0
- package/docs/components/DayTimeRange.md +20 -0
- package/docs/components/Dropdown.md +65 -0
- package/docs/components/ErrorText.md +15 -0
- package/docs/components/FBLogin.md +21 -0
- package/docs/components/Flex.md +44 -0
- package/docs/components/GHeatMaps.md +16 -0
- package/docs/components/GSignIn.md +21 -0
- package/docs/components/Gmaps.md +16 -0
- package/docs/components/GmapsDirection.md +20 -0
- package/docs/components/Grid.md +36 -0
- package/docs/components/HTMLEditor.md +26 -0
- package/docs/components/IconMenu.md +20 -0
- package/docs/components/Image.md +78 -0
- package/docs/components/Link.md +33 -0
- package/docs/components/MultiDropdown.md +46 -0
- package/docs/components/Radio.md +55 -0
- package/docs/components/Slider.md +47 -0
- package/docs/components/Switch.md +43 -0
- package/docs/components/Table.md +31 -0
- package/docs/components/Tabs.md +65 -0
- package/docs/components/Text.md +30 -0
- package/docs/components/Textarea.md +66 -0
- package/docs/components/Textbox.md +97 -0
- package/docs/components/Timepicker.md +62 -0
- package/docs/components/Toast.md +59 -0
- package/docs/components/Uploader.md +51 -0
- package/docs/components/Video.md +54 -0
- package/package.json +65 -2
- package/docs/components/Dashboard.md +0 -56
- package/docs/components/Header2.md +0 -16
- package/log.txt +0 -7
- package/public/assets/dashboard/bar.png +0 -0
- package/public/assets/dashboard/doughnut.png +0 -0
- package/public/assets/dashboard/metric.png +0 -0
- package/public/assets/dashboard/pie.png +0 -0
- package/public/assets/dashboard/polar-area.png +0 -0
- package/public/assets/dashboard/virtual-table.png +0 -0
- package/public/static/dashboard/bar.png +0 -0
- package/public/static/dashboard/doughnut.png +0 -0
- package/public/static/dashboard/metric.png +0 -0
- package/public/static/dashboard/pie.png +0 -0
- package/public/static/dashboard/polar-area.png +0 -0
- package/public/static/dashboard/virtual-table.png +0 -0
- package/src/components/404.vue +0 -61
- package/src/components/AccountIcon.vue +0 -19
- package/src/components/Ahref.vue +0 -200
- package/src/components/Alert.vue +0 -257
- package/src/components/ArrayList.vue +0 -49
- package/src/components/Article.vue +0 -387
- package/src/components/Block.vue +0 -31
- package/src/components/Box.vue +0 -34
- package/src/components/Button.vue +0 -258
- package/src/components/Card.vue +0 -257
- package/src/components/Carousel.vue +0 -364
- package/src/components/Cart.vue +0 -192
- package/src/components/CartIcon.vue +0 -89
- package/src/components/Chart.vue +0 -485
- package/src/components/ChartBar.vue +0 -192
- package/src/components/ChatTyping.vue +0 -69
- package/src/components/Checkbox.vue +0 -200
- package/src/components/Checkout.vue +0 -373
- package/src/components/CheckoutDelivery.vue +0 -267
- package/src/components/CodeEditor.vue +0 -50
- package/src/components/CollapsiblePanel.vue +0 -70
- package/src/components/ColorPicker.vue +0 -165
- package/src/components/ColorPicker2.vue +0 -186
- package/src/components/ColorPicker3.vue +0 -100
- package/src/components/Confirm.vue +0 -180
- package/src/components/ContextMenu.vue +0 -265
- package/src/components/ContextMenuItem.vue +0 -53
- package/src/components/ConversationBuilder.vue +0 -161
- package/src/components/CopyToClipboard.vue +0 -34
- package/src/components/Countdown.vue +0 -264
- package/src/components/DGrid.vue +0 -21
- package/src/components/DGridItem.vue +0 -263
- package/src/components/Dashboard.vue +0 -243
- package/src/components/Dashboard2.vue +0 -118
- package/src/components/DashboardComponentSelector.vue +0 -96
- package/src/components/DashboardConfigs.vue +0 -202
- package/src/components/DataList.vue +0 -92
- package/src/components/Datepicker.vue +0 -399
- package/src/components/DayTimeRange.vue +0 -126
- package/src/components/Dropdown.vue +0 -224
- package/src/components/ErrorText.vue +0 -57
- package/src/components/FBLogin.vue +0 -194
- package/src/components/Feed.vue +0 -118
- package/src/components/Flex.vue +0 -44
- package/src/components/GHeatMaps.vue +0 -317
- package/src/components/GSignIn.vue +0 -166
- package/src/components/Gmaps.vue +0 -251
- package/src/components/GmapsDirection.vue +0 -191
- package/src/components/Grid.vue +0 -35
- package/src/components/HTMLEditor.vue +0 -588
- package/src/components/IconMenu.vue +0 -95
- package/src/components/IconMenu2.vue +0 -89
- package/src/components/IconPlus.vue +0 -89
- package/src/components/Image.vue +0 -263
- package/src/components/Image360.vue +0 -140
- package/src/components/ImageFullScreen.vue +0 -101
- package/src/components/ImagePreview.vue +0 -93
- package/src/components/ImageUploader.vue +0 -114
- package/src/components/ImportModal.vue +0 -260
- package/src/components/Link.vue +0 -95
- package/src/components/List.vue +0 -1381
- package/src/components/ListContextMenu.vue +0 -88
- package/src/components/ListItem.vue +0 -160
- package/src/components/ListPage1.vue +0 -1401
- package/src/components/ListPage1Filter.vue +0 -170
- package/src/components/ListView.vue +0 -961
- package/src/components/ListViewBarSummary.vue +0 -81
- package/src/components/ListViewLineSummary.vue +0 -75
- package/src/components/ListViewLiveBarSummary.vue +0 -52
- package/src/components/ListViewMapSummary.vue +0 -56
- package/src/components/ListViewSettings.vue +0 -514
- package/src/components/ListViewTableSummary.vue +0 -77
- package/src/components/LogViewerItem.vue +0 -116
- package/src/components/MarkdownEdit.vue +0 -128
- package/src/components/MarkdownPreview.vue +0 -102
- package/src/components/MenuItem1.vue +0 -36
- package/src/components/Modal.vue +0 -456
- package/src/components/MultiDropdown.vue +0 -124
- package/src/components/MultilineText.vue +0 -174
- package/src/components/OTPField.vue +0 -139
- package/src/components/ObjectTree.vue +0 -105
- package/src/components/PageBuilder.vue +0 -449
- package/src/components/Paragraph.vue +0 -40
- package/src/components/PresetSelectorFilterItem.vue +0 -203
- package/src/components/Radio.vue +0 -109
- package/src/components/SearchModal.vue +0 -153
- package/src/components/Slider.vue +0 -317
- package/src/components/SplitPane.vue +0 -129
- package/src/components/Svg.vue +0 -33
- package/src/components/SvgEditor.vue +0 -173
- package/src/components/Switch.vue +0 -101
- package/src/components/TabView.vue +0 -105
- package/src/components/Table.vue +0 -56
- package/src/components/TableView.vue +0 -200
- package/src/components/TableViewHead.vue +0 -159
- package/src/components/Tabs.vue +0 -131
- package/src/components/Test.vue +0 -23
- package/src/components/Testimonial.vue +0 -86
- package/src/components/Text.vue +0 -34
- package/src/components/TextBlock.vue +0 -50
- package/src/components/TextEditor.vue +0 -85
- package/src/components/TextWithTag.vue +0 -298
- package/src/components/Textarea.vue +0 -184
- package/src/components/Textbox.vue +0 -216
- package/src/components/Thumbnail.vue +0 -27
- package/src/components/Timepicker.vue +0 -125
- package/src/components/Toast.vue +0 -117
- package/src/components/TreeMenu.vue +0 -122
- package/src/components/TreeView.vue +0 -106
- package/src/components/TreeView2.vue +0 -38
- package/src/components/TreeViewItem.vue +0 -453
- package/src/components/TreeViewItem1.vue +0 -282
- package/src/components/TreeViewItem2.vue +0 -55
- package/src/components/Uploader.vue +0 -45
- package/src/components/Video.vue +0 -119
- package/src/components/VirtualGrid.vue +0 -297
- package/src/components/VirtualScroll.vue +0 -282
- package/src/components/VirtualTable.vue +0 -956
- package/src/components/YoutubeVideo.vue +0 -196
- package/src/configs/dashboard/bar.js +0 -10
- package/src/configs/dashboard/collection-1.js +0 -5
- package/src/configs/dashboard/data-table.js +0 -9
- package/src/configs/dashboard/doughnut.js +0 -7
- package/src/configs/dashboard/gheatmaps.js +0 -9
- package/src/configs/dashboard/grid-2.js +0 -34
- package/src/configs/dashboard/grid-3.js +0 -34
- package/src/configs/dashboard/grid-4.js +0 -34
- package/src/configs/dashboard/grid.js +0 -15
- package/src/configs/dashboard/metric.js +0 -10
- package/src/configs/dashboard/pie.js +0 -7
- package/src/configs/dashboard/polar-area.js +0 -7
- package/src/configs/dashboard/virtual-table.js +0 -9
- package/src/configs/icons-fa.json +0 -12
- package/src/configs/web-page-builder.js +0 -118
- package/src/defs/dashboard-preset.js +0 -22
- package/src/directives/intersect.js +0 -26
- package/src/hooks/device.js +0 -14
- package/src/index.css +0 -3
- package/src/index.js +0 -648
- package/src/middleware/http/trim-string.js +0 -20
- package/src/mixin/component.js +0 -306
- package/src/mixin/ready-state.js +0 -37
- package/src/stores/components.js +0 -36
- package/src/stores/datasource.js +0 -11
- package/src/themes/default/index.js +0 -303
- package/src/utils/dashboard.js +0 -140
- package/src/utils/event-bus.js +0 -8
- package/src/utils/helpers.cjs +0 -635
- package/src/utils/helpers.js +0 -635
- package/src/utils/helpers.mjs +0 -722
- package/src/utils/importer.js +0 -209
- package/src/utils/list.mjs +0 -1509
- package/src/utils/listpage1.js +0 -1507
- package/src/utils/listview.js +0 -1287
- package/src/utils/preset-selector.cjs +0 -1455
- package/src/utils/preset-selector.js +0 -1452
- package/src/utils/preset-selector.mjs +0 -234
- package/src/utils/queue.js +0 -63
- package/src/utils/selection.js +0 -43
- package/src/utils/web.js +0 -50
- package/src/utils/web.mjs +0 -120
- package/src/utils/wss.js +0 -296
- package/src/utils/wss.mjs +0 -285
- package/src/widgets/AhrefSetting.vue +0 -97
- package/src/widgets/ArticleSetting.vue +0 -457
- package/src/widgets/BackgroundColorSetting.vue +0 -153
- package/src/widgets/BackgroundSetting.vue +0 -132
- package/src/widgets/BlockSetting.vue +0 -49
- package/src/widgets/BorderColorSetting.vue +0 -57
- package/src/widgets/BorderSetting.vue +0 -201
- package/src/widgets/BotEditor/BotEditorActions.vue +0 -163
- package/src/widgets/BotEditor/BotEditorSettings.vue +0 -21
- package/src/widgets/BotEditor.vue +0 -248
- package/src/widgets/BoxSetting.vue +0 -53
- package/src/widgets/ButtonSetting.vue +0 -113
- package/src/widgets/CarouselSetting.vue +0 -181
- package/src/widgets/CartSetting.vue +0 -46
- package/src/widgets/CheckoutSetting.vue +0 -46
- package/src/widgets/CollapsiblePanelSetting.vue +0 -46
- package/src/widgets/ColumnSelector.vue +0 -104
- package/src/widgets/ComponentPropertyLabel.vue +0 -35
- package/src/widgets/ComponentPropertySelector.vue +0 -115
- package/src/widgets/ComponentSetting.vue +0 -2220
- package/src/widgets/ComponentSetting2.vue +0 -927
- package/src/widgets/ComponentSetting3.vue +0 -231
- package/src/widgets/ContactForm.vue +0 -193
- package/src/widgets/ContactFormSetting.vue +0 -395
- package/src/widgets/CountdownSetting.vue +0 -76
- package/src/widgets/Dashboard/BarChart.vue +0 -366
- package/src/widgets/Dashboard/BarChartSetting.vue +0 -317
- package/src/widgets/Dashboard/DataTable.vue +0 -125
- package/src/widgets/Dashboard/DataTableSetting.vue +0 -243
- package/src/widgets/Dashboard/DatasourceFilterSharing.vue +0 -93
- package/src/widgets/Dashboard/DatasourcePreview.vue +0 -93
- package/src/widgets/Dashboard/DatasourceSelector.vue +0 -122
- package/src/widgets/Dashboard/Doughnut.vue +0 -199
- package/src/widgets/Dashboard/DoughnutSetting.vue +0 -196
- package/src/widgets/Dashboard/GHeatMapsSetting.vue +0 -108
- package/src/widgets/Dashboard/InteractionEdit.vue +0 -228
- package/src/widgets/Dashboard/Metric.vue +0 -135
- package/src/widgets/Dashboard/MetricSetting.vue +0 -227
- package/src/widgets/Dashboard/Pie.vue +0 -188
- package/src/widgets/Dashboard/PieSetting.vue +0 -247
- package/src/widgets/Dashboard/PolarArea.vue +0 -201
- package/src/widgets/Dashboard/PolarAreaSetting.vue +0 -195
- package/src/widgets/Dashboard/SharingModal.vue +0 -115
- package/src/widgets/Dashboard/ViewSelector.vue +0 -183
- package/src/widgets/Dashboard/VirtualColumnEdit.vue +0 -97
- package/src/widgets/Dashboard/VirtualTableSetting.vue +0 -171
- package/src/widgets/Dashboard0.vue +0 -1856
- package/src/widgets/DataListSetting.vue +0 -102
- package/src/widgets/EffectSetting.vue +0 -94
- package/src/widgets/EmbeddedVideo.vue +0 -60
- package/src/widgets/EmbeddedVideoSetting.vue +0 -50
- package/src/widgets/FAQ.vue +0 -98
- package/src/widgets/FAQSetting.vue +0 -94
- package/src/widgets/FeatureList.vue +0 -131
- package/src/widgets/FeatureListSetting.vue +0 -233
- package/src/widgets/FiltersSetting.vue +0 -88
- package/src/widgets/FlexSetting.vue +0 -174
- package/src/widgets/GridSetting.vue +0 -165
- package/src/widgets/Header.vue +0 -15
- package/src/widgets/Header0.vue +0 -41
- package/src/widgets/Header0Setting.vue +0 -75
- package/src/widgets/Header2.vue +0 -65
- package/src/widgets/Header2Setting.vue +0 -193
- package/src/widgets/HeaderSetting.vue +0 -102
- package/src/widgets/IconList.vue +0 -51
- package/src/widgets/IconListSetting.vue +0 -188
- package/src/widgets/ImageSetting.vue +0 -119
- package/src/widgets/LayoutSetting.vue +0 -251
- package/src/widgets/LinkSetting.vue +0 -209
- package/src/widgets/LinkSettingModal.vue +0 -173
- package/src/widgets/LogViewer.vue +0 -85
- package/src/widgets/MarginPaddingSetting.vue +0 -58
- package/src/widgets/MarginSetting.vue +0 -142
- package/src/widgets/MenuEditor.vue +0 -256
- package/src/widgets/MenuItem1Setting.vue +0 -78
- package/src/widgets/ModalSetting.vue +0 -94
- package/src/widgets/MultiValueSetting.vue +0 -121
- package/src/widgets/MultiValueSetting2.vue +0 -147
- package/src/widgets/OGSettingModal.vue +0 -103
- package/src/widgets/PaddingSetting.vue +0 -142
- package/src/widgets/ParagraphSetting.vue +0 -89
- package/src/widgets/PositionSetting.vue +0 -209
- package/src/widgets/PresetBar.vue +0 -990
- package/src/widgets/PresetBarPivot.vue +0 -198
- package/src/widgets/PresetBarPivotColumnEdit.vue +0 -197
- package/src/widgets/PresetSelector.vue +0 -685
- package/src/widgets/Review.vue +0 -131
- package/src/widgets/ReviewSetting.vue +0 -201
- package/src/widgets/SearchModalSetting.vue +0 -70
- package/src/widgets/Share.vue +0 -164
- package/src/widgets/ShareSetting.vue +0 -99
- package/src/widgets/SizingSetting.vue +0 -306
- package/src/widgets/SpacingSetting.vue +0 -77
- package/src/widgets/StyleSetting.vue +0 -543
- package/src/widgets/StyleSetting2.vue +0 -90
- package/src/widgets/SvgSetting.vue +0 -133
- package/src/widgets/TableSetting.vue +0 -172
- package/src/widgets/TestimonialSetting.vue +0 -161
- package/src/widgets/TextBlockSetting.vue +0 -81
- package/src/widgets/ThumbnailSetting.vue +0 -49
- package/src/widgets/TransitionSetting.vue +0 -64
- package/src/widgets/TypographySetting.vue +0 -334
- package/src/widgets/UserActionBuilder/UserActionCondition.vue +0 -99
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +0 -97
- package/src/widgets/UserActionBuilder/UserActionItem.vue +0 -273
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +0 -152
- package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +0 -27
- package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +0 -28
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +0 -112
- package/src/widgets/UserActionBuilder/UserActionProps.vue +0 -213
- package/src/widgets/UserActionBuilder.vue +0 -314
- package/src/widgets/WebComponentSelector.vue +0 -205
- package/src/widgets/WebDatasourceSelector.vue +0 -153
- package/src/widgets/WebLayoutSelector.vue +0 -147
- package/src/widgets/WebPageBuilder.vue +0 -2161
- package/src/widgets/WebPageBuilder2.vue +0 -1091
- package/src/widgets/WebPageBuilder3.vue +0 -411
- package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +0 -54
- package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BlurSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +0 -64
- package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -65
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +0 -178
- package/src/widgets/WebPageBuilder4/DisplaySetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +0 -74
- package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +0 -96
- package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/GapSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/GridSetting.vue +0 -216
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +0 -98
- package/src/widgets/WebPageBuilder4/ImageSetting.vue +0 -102
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +0 -82
- package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +0 -90
- package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +0 -101
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +0 -163
- package/src/widgets/WebPageBuilder4/OpacitySetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/OverflowSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +0 -57
- package/src/widgets/WebPageBuilder4/PositionSetting.vue +0 -191
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -176
- package/src/widgets/WebPageBuilder4/TextSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/TreeView.vue +0 -46
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -303
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +0 -141
- package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +0 -172
- package/src/widgets/WebPageBuilder4/WidthSetting.vue +0 -105
- package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4.vue +0 -798
- package/src/widgets/WebPagePreview.vue +0 -295
- package/src/widgets/WebPageSelector.vue +0 -173
- package/src/widgets/WebTemplateCreator.vue +0 -156
- package/src/widgets/YoutubeVideoSetting.vue +0 -68
- package/tailwind.config.js +0 -481
|
@@ -1,449 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
|
|
3
|
-
<div :class="$style.comp">
|
|
4
|
-
|
|
5
|
-
<div v-if="useHeader" class="flex flex-row justify-end gap-8">
|
|
6
|
-
<div class="flex flex-row">
|
|
7
|
-
<Button @click="$refs.widgetSelector.open()" class="px-3">
|
|
8
|
-
<svg width="16" height="16" class="fill-white mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"/></svg>
|
|
9
|
-
Widgets
|
|
10
|
-
</Button>
|
|
11
|
-
</div>
|
|
12
|
-
|
|
13
|
-
<Switch v-model="editMode" />
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div :class="`${$style.pageGrid} ${gridClass}`" :style="pageGrid" ref="pageGrid">
|
|
17
|
-
<div v-for="(widget, index) in config.widgets"
|
|
18
|
-
:class="$style.column"
|
|
19
|
-
:style="columnStyle(widget)"
|
|
20
|
-
@mouseover="onMoverMouseOver">
|
|
21
|
-
<div v-if="editMode" :class="$style.mover" @mousedown="(e) => onMoverStart(e, widget, index)"></div>
|
|
22
|
-
<div v-if="editMode" :class="$style.resizeLeft" @mousedown="(e) => onMouseDown(e, widget, 'right')"></div>
|
|
23
|
-
<div v-if="editMode" :class="$style.resizeRight" @mousedown="(e) => onMouseDown(e, widget, 'right')"></div>
|
|
24
|
-
<div v-if="editMode" :class="$style.resizeBottom" @mousedown="(e) => onMouseDown(e, widget, 'bottom')"></div>
|
|
25
|
-
<div v-if="editMode" :class="$style.resizeTop" @mousedown="(e) => onMouseDown(e, widget, 'bottom')"></div>
|
|
26
|
-
<component v-if="widget.type" :is="widget.type" :="widget.props">
|
|
27
|
-
<template v-for="(_, slot) in $slots" #[slot]="{ item }">
|
|
28
|
-
<slot :name="slot" :item="item"></slot>
|
|
29
|
-
</template>
|
|
30
|
-
</component>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<div class="hidden">
|
|
35
|
-
<div class="col-span-1"></div>
|
|
36
|
-
<div class="col-span-2"></div>
|
|
37
|
-
<div class="col-span-3"></div>
|
|
38
|
-
<div class="col-span-4"></div>
|
|
39
|
-
<div class="col-span-5"></div>
|
|
40
|
-
<div class="col-span-6"></div>
|
|
41
|
-
<div class="col-span-7"></div>
|
|
42
|
-
<div class="col-span-8"></div>
|
|
43
|
-
<div class="col-span-9"></div>
|
|
44
|
-
<div class="col-span-10"></div>
|
|
45
|
-
<div class="col-span-11"></div>
|
|
46
|
-
<div class="col-span-12"></div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="absolute">
|
|
50
|
-
<Modal ref="widgetSelector" width="420" height="560">
|
|
51
|
-
<template #head>
|
|
52
|
-
<div class="p-6 flex flex-col">
|
|
53
|
-
<div class="flex flex-row">
|
|
54
|
-
<h3 class="flex-1">Widgets</h3>
|
|
55
|
-
<button type="button" @click="$refs.widgetSelector.close()">
|
|
56
|
-
<svg width="19" height="19" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"/></svg>
|
|
57
|
-
</button>
|
|
58
|
-
</div>
|
|
59
|
-
<div class="flex justify-center mb-4">
|
|
60
|
-
<Tabs :items="tabItems" v-model="tabIndex" />
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</template>
|
|
64
|
-
<div v-if="tabIndex === 1" class="flex-1 flex flex-col divide-y divide-border-50">
|
|
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-border-50 bg-base-300"></div>
|
|
67
|
-
<div class="flex-1">
|
|
68
|
-
<strong>{{ widget.type ?? widget.title }}</strong>
|
|
69
|
-
</div>
|
|
70
|
-
<div class="grid grid-cols-2 gap-1">
|
|
71
|
-
<div @click="addWidget(widget, { col:3 })">3</div>
|
|
72
|
-
<div @click="addWidget(widget, { col:4 })">4</div>
|
|
73
|
-
<div @click="addWidget(widget, { col:6 })">6</div>
|
|
74
|
-
<div @click="addWidget(widget, { col:12 })">12</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
<div v-else class="flex-1 flex">
|
|
79
|
-
<ListItem :items="config.widgets" @reorder="reorderWidget" class="flex-1" bodyClass="divide-y divide-border-50">
|
|
80
|
-
<template v-slot="{ item }">
|
|
81
|
-
<div class="flex flex-row items-center gap-2 px-3" :key="item">
|
|
82
|
-
<div class="p-2 cursor-move" data-reorder>
|
|
83
|
-
<svg width="19" height="19" class="fill-text-300" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
84
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 16C4.25 15.5858 4.58579 15.25 5 15.25H19C19.4142 15.25 19.75 15.5858 19.75 16C19.75 16.4142 19.4142 16.75 19 16.75H5C4.58579 16.75 4.25 16.4142 4.25 16Z"/>
|
|
85
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.25 8C4.25 7.58579 4.58579 7.25 5 7.25H19C19.4142 7.25 19.75 7.58579 19.75 8C19.75 8.41421 19.4142 8.75 19 8.75H5C4.58579 8.75 4.25 8.41421 4.25 8Z"/>
|
|
86
|
-
</svg>
|
|
87
|
-
</div>
|
|
88
|
-
<div class="flex-1">
|
|
89
|
-
<strong>{{ item.title ?? item.type }}</strong>
|
|
90
|
-
</div>
|
|
91
|
-
<div>
|
|
92
|
-
<button type="button" @click="removeWidget(item)">
|
|
93
|
-
<svg width="16" height="16" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"/></svg>
|
|
94
|
-
</button>
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</template>
|
|
98
|
-
</ListItem>
|
|
99
|
-
</div>
|
|
100
|
-
</Modal>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
|
|
104
|
-
</template>
|
|
105
|
-
|
|
106
|
-
<script>
|
|
107
|
-
|
|
108
|
-
import throttle from "lodash/throttle";
|
|
109
|
-
import {parseBoolean} from "../utils/helpers.mjs";
|
|
110
|
-
|
|
111
|
-
export default{
|
|
112
|
-
|
|
113
|
-
props: {
|
|
114
|
-
config: Object,
|
|
115
|
-
configStore: String,
|
|
116
|
-
widgets: Array,
|
|
117
|
-
header: undefined,
|
|
118
|
-
gap: {
|
|
119
|
-
type: String,
|
|
120
|
-
default: '1rem'
|
|
121
|
-
},
|
|
122
|
-
grid: {
|
|
123
|
-
type: [ String, Number ],
|
|
124
|
-
default: 12
|
|
125
|
-
},
|
|
126
|
-
mode: {
|
|
127
|
-
type: String,
|
|
128
|
-
remark: 'page|screen, default:page'
|
|
129
|
-
},
|
|
130
|
-
gridClass: String
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
methods: {
|
|
134
|
-
|
|
135
|
-
columnStyle(widget){
|
|
136
|
-
let style = {
|
|
137
|
-
gridColumn: `span ${widget.col} / span ${widget.col}`,
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
switch(this.mode){
|
|
141
|
-
|
|
142
|
-
case 'screen':
|
|
143
|
-
Object.assign(style, {
|
|
144
|
-
gridRow: `span ${widget.row} / span ${widget.row}`,
|
|
145
|
-
})
|
|
146
|
-
break
|
|
147
|
-
|
|
148
|
-
case 'page':
|
|
149
|
-
default:
|
|
150
|
-
Object.assign(style, {
|
|
151
|
-
height:(widget.row * this.rowHeight) + 'px'
|
|
152
|
-
})
|
|
153
|
-
break
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
return style
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
addWidget(widget, props){
|
|
161
|
-
this.config.widgets.push({
|
|
162
|
-
...widget,
|
|
163
|
-
...(props ?? {})
|
|
164
|
-
})
|
|
165
|
-
this.$refs.widgetSelector.close()
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
reorderWidget(from, to){
|
|
169
|
-
this.config.widgets.splice(to, 0, this.config.widgets.splice(from, 1)[0])
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
removeWidget(widget){
|
|
173
|
-
const index = this.config.widgets.indexOf(widget)
|
|
174
|
-
if(index >= 0){
|
|
175
|
-
this.config.widgets.splice(index, 1)
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
toggleEditMode(state){
|
|
181
|
-
if(typeof state !== 'boolean')
|
|
182
|
-
this.editMode = state
|
|
183
|
-
else
|
|
184
|
-
this.editMode = !this.editMode
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
async loadConfig(){
|
|
189
|
-
if(!this.configStoreObj) return
|
|
190
|
-
|
|
191
|
-
switch(this.configStoreObj.type){
|
|
192
|
-
case 'socket':
|
|
193
|
-
return this.socketEmit2(this.configStoreObj.src,
|
|
194
|
-
{ key:this.configStoreObj.name ?? 'pageBuilder' })
|
|
195
|
-
.then((config) => {
|
|
196
|
-
Object.assign(this.config, config ?? {})
|
|
197
|
-
})
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
saveConfig: throttle(function() {
|
|
202
|
-
if(!this.configStoreObj) return
|
|
203
|
-
switch(this.configStoreObj.type){
|
|
204
|
-
case 'socket':
|
|
205
|
-
this.socketEmit2(this.configStoreObj.src,
|
|
206
|
-
{ key:this.configStoreObj.name ?? 'pageBuilder', config:this.config })
|
|
207
|
-
break
|
|
208
|
-
}
|
|
209
|
-
}, 1000, { leading:true }),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
onMouseDown(e, widget){
|
|
213
|
-
this.curResize = {
|
|
214
|
-
target: e.target.parentNode,
|
|
215
|
-
startX: e.clientX,
|
|
216
|
-
startY: e.clientY,
|
|
217
|
-
startSpan: widget.span,
|
|
218
|
-
startHeight: widget.height,
|
|
219
|
-
xSize: Math.round(window.innerWidth / 12),
|
|
220
|
-
ySize: Math.round(window.innerHeight / 12),
|
|
221
|
-
widget
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
window.addEventListener('mousemove', this.onMouseMove)
|
|
225
|
-
window.addEventListener('mouseup', this.onMouseOut)
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
onMouseMove(e){
|
|
229
|
-
if(!this.curResize) return
|
|
230
|
-
|
|
231
|
-
e.preventDefault()
|
|
232
|
-
|
|
233
|
-
const distanceX = e.clientX - this.curResize.startX
|
|
234
|
-
const distanceY = e.clientY - this.curResize.startY
|
|
235
|
-
|
|
236
|
-
const spanAdder = Math.round(distanceX / this.curResize.xSize)
|
|
237
|
-
const heightAdder = Math.round(distanceY / this.curResize.ySize) * this.curResize.ySize
|
|
238
|
-
|
|
239
|
-
let span = parseInt(this.curResize.startSpan) + spanAdder
|
|
240
|
-
let height = (parseInt(this.curResize.startHeight) + heightAdder) + 'px'
|
|
241
|
-
|
|
242
|
-
if(span < 1) span = 1
|
|
243
|
-
else if(span > 12) span = 12
|
|
244
|
-
|
|
245
|
-
if(height < this.curResize.ySize) height = this.curResize.ySize
|
|
246
|
-
else if(height > window.innerHeight) height = window.innerHeight
|
|
247
|
-
|
|
248
|
-
this.curResize.widget.span = span
|
|
249
|
-
this.curResize.widget.height = height
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
onMouseOut(){
|
|
253
|
-
window.removeEventListener('mousemove', this.onMouseMove)
|
|
254
|
-
window.removeEventListener('mouseup', this.onMouseOut)
|
|
255
|
-
this.curResize = null
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
onMoverStart(e, widget, index){
|
|
259
|
-
|
|
260
|
-
const columnEl = e.target.parentNode;
|
|
261
|
-
const rect = columnEl.getBoundingClientRect()
|
|
262
|
-
|
|
263
|
-
const cloned = columnEl.cloneNode(true)
|
|
264
|
-
cloned.classList.add(this.$style.dragged)
|
|
265
|
-
cloned.style.left = (Math.round(rect.x) + 16) + 'px'
|
|
266
|
-
cloned.style.top = (Math.round(rect.y) + 16) + 'px'
|
|
267
|
-
cloned.style.width = columnEl.clientWidth + 'px'
|
|
268
|
-
cloned.style.height = columnEl.clientHeight + 'px'
|
|
269
|
-
this.$el.appendChild(cloned)
|
|
270
|
-
|
|
271
|
-
this.curResize = {
|
|
272
|
-
widget,
|
|
273
|
-
index,
|
|
274
|
-
cloned,
|
|
275
|
-
startX: e.clientX,
|
|
276
|
-
startY: e.clientY
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
window.addEventListener('mousemove', this.onMoverMove)
|
|
280
|
-
window.addEventListener('mouseup', this.onMoverUp)
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
swapArray(arr, i, j){
|
|
284
|
-
const temp = arr[i];
|
|
285
|
-
arr[i] = arr[j];
|
|
286
|
-
arr[j] = temp;
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
onMoverMove(e){
|
|
290
|
-
if(!this.curResize) return
|
|
291
|
-
|
|
292
|
-
e.preventDefault()
|
|
293
|
-
|
|
294
|
-
const cloned = this.curResize.cloned
|
|
295
|
-
const distanceX = e.clientX - this.curResize.startX
|
|
296
|
-
const distanceY = e.clientY - this.curResize.startY
|
|
297
|
-
this.curResize.startX = e.clientX
|
|
298
|
-
this.curResize.startY = e.clientY
|
|
299
|
-
|
|
300
|
-
cloned.style.left = (parseInt(cloned.style.left) + distanceX) + 'px'
|
|
301
|
-
cloned.style.top = (parseInt(cloned.style.top) + distanceY) + 'px'
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
onMoverMouseOver(e){
|
|
305
|
-
if(!this.curResize || !this.curResize.cloned) return
|
|
306
|
-
|
|
307
|
-
e.preventDefault()
|
|
308
|
-
|
|
309
|
-
const column = e.target.closest('.' + this.$style.column)
|
|
310
|
-
|
|
311
|
-
const targetIdx = Array.prototype.indexOf.call(this.$refs.pageGrid.children, column)
|
|
312
|
-
|
|
313
|
-
this.$refs.pageGrid.querySelectorAll('.' + this.$style.highlight).forEach(el => el.classList.remove(this.$style.highlight))
|
|
314
|
-
|
|
315
|
-
if(targetIdx !== this.curResize.index){
|
|
316
|
-
this.curResize.targetIdx = targetIdx
|
|
317
|
-
e.target.classList.add(this.$style.highlight)
|
|
318
|
-
}
|
|
319
|
-
},
|
|
320
|
-
|
|
321
|
-
onMoverUp(){
|
|
322
|
-
this.swapArray(this.config.widgets, this.curResize.targetIdx, this.curResize.index)
|
|
323
|
-
|
|
324
|
-
window.removeEventListener('mousemove', this.onMoverMove)
|
|
325
|
-
window.removeEventListener('mouseup', this.onMoverUp)
|
|
326
|
-
this.$el.removeChild(this.curResize.cloned)
|
|
327
|
-
this.curResize = null
|
|
328
|
-
|
|
329
|
-
this.$refs.pageGrid.querySelectorAll('.' + this.$style.highlight).forEach(el => el.classList.remove(this.$style.highlight))
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
computed: {
|
|
336
|
-
|
|
337
|
-
configStoreObj(){
|
|
338
|
-
const splitted = ((this.configStore ?? '').toString()).split(':')
|
|
339
|
-
const splitted2 = (splitted[1] ?? '').split(',')
|
|
340
|
-
const obj = {
|
|
341
|
-
type: splitted[0],
|
|
342
|
-
src: splitted2[0],
|
|
343
|
-
name: splitted2[1]
|
|
344
|
-
}
|
|
345
|
-
return obj.type && obj.src ? obj : null
|
|
346
|
-
},
|
|
347
|
-
|
|
348
|
-
useHeader(){
|
|
349
|
-
return parseBoolean(this.header)
|
|
350
|
-
},
|
|
351
|
-
|
|
352
|
-
pageGrid(){
|
|
353
|
-
const style = {
|
|
354
|
-
display: 'grid',
|
|
355
|
-
gridTemplateColumns: `repeat(${this.grid}, 1fr)`,
|
|
356
|
-
gridGap: this.gap
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
if(this.mode === 'screen'){
|
|
360
|
-
Object.assign(style, {
|
|
361
|
-
gridTemplateRows: `repeat(${this.grid}, 1fr)`
|
|
362
|
-
})
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return style
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
data(){
|
|
371
|
-
return {
|
|
372
|
-
curResize: null,
|
|
373
|
-
editMode: false,
|
|
374
|
-
tabItems: [
|
|
375
|
-
{ text:"Add Widget", value:1 },
|
|
376
|
-
{ text:"Widgets", value:2 }
|
|
377
|
-
],
|
|
378
|
-
tabIndex: 1,
|
|
379
|
-
rowHeight: 0
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
|
|
383
|
-
inject: [ 'socketEmit2' ],
|
|
384
|
-
|
|
385
|
-
mounted() {
|
|
386
|
-
this.loadConfig()
|
|
387
|
-
|
|
388
|
-
this.rowHeight = Math.round(window.innerHeight / parseInt(this.grid))
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
watch: {
|
|
392
|
-
|
|
393
|
-
config: {
|
|
394
|
-
handler(){
|
|
395
|
-
this.saveConfig()
|
|
396
|
-
},
|
|
397
|
-
deep: true
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
</script>
|
|
405
|
-
|
|
406
|
-
<style module>
|
|
407
|
-
|
|
408
|
-
.comp{
|
|
409
|
-
@apply flex flex-col gap-4;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
.column{
|
|
413
|
-
@apply flex flex-col gap-2;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
.pageGrid{
|
|
417
|
-
@apply flex-1;
|
|
418
|
-
}
|
|
419
|
-
.pageGrid>*{
|
|
420
|
-
@apply relative flex;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.resizeLeft{
|
|
424
|
-
@apply absolute top-[-8px] left-[-8px] w-[4px] bottom-[-8px] bg-text-50 cursor-e-resize;
|
|
425
|
-
}
|
|
426
|
-
.resizeRight{
|
|
427
|
-
@apply absolute top-[-8px] right-[-8px] w-[4px] bottom-[-8px] bg-text-50 cursor-e-resize;
|
|
428
|
-
}
|
|
429
|
-
.resizeBottom{
|
|
430
|
-
@apply absolute bottom-[-8px] left-[-8px] right-[-8px] h-[4px] bg-text-50 cursor-s-resize;
|
|
431
|
-
}
|
|
432
|
-
.resizeTop{
|
|
433
|
-
@apply absolute top-[-8px] left-[-8px] right-[-8px] h-[4px] bg-text-50 cursor-s-resize;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.mover{
|
|
437
|
-
@apply absolute top-0 left-0 w-[24px] h-[24px] bg-text-50 cursor-move;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.dragged{
|
|
441
|
-
@apply absolute bg-base-300;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.highlight{
|
|
445
|
-
@apply opacity-50;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
</style>
|
|
449
|
-
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<p :class="$style.comp" v-html="computedHtml"></p>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
|
|
7
|
-
import {componentMixin} from "../mixin/component";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export default{
|
|
11
|
-
|
|
12
|
-
mixins: [ componentMixin ],
|
|
13
|
-
|
|
14
|
-
props: {
|
|
15
|
-
html: String
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
computed: {
|
|
19
|
-
|
|
20
|
-
computedHtml(){
|
|
21
|
-
return this.html
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
methods: {
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
</script>
|
|
33
|
-
|
|
34
|
-
<style module>
|
|
35
|
-
|
|
36
|
-
.comp{
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
</style>
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-col">
|
|
3
|
-
<div v-if="type === 'date'" class="flex-1 flex flex-row gap-2">
|
|
4
|
-
<div class="flex-1 flex flex-row gap-2">
|
|
5
|
-
<Dropdown v-model="value.operator"
|
|
6
|
-
:readonly="readonly"
|
|
7
|
-
:class="![ 'yesterday', 'today', 'thisWeek', 'thisMonth', 'lastMonth', 'thisYear', 'null' ].includes(value.operator) ? 'w-[100px]' : 'w-full'"
|
|
8
|
-
@change="apply">
|
|
9
|
-
<option value="=">=</option>
|
|
10
|
-
<option value=">">></option>
|
|
11
|
-
<option value=">=">>=</option>
|
|
12
|
-
<option value="<"><</option>
|
|
13
|
-
<option value="<="><=</option>
|
|
14
|
-
<option value="between">Between</option>
|
|
15
|
-
<option value="yesterday">Yesterday</option>
|
|
16
|
-
<option value="today">Today</option>
|
|
17
|
-
<option value="thisWeek">This Week</option>
|
|
18
|
-
<option value="thisMonth">This Month</option>
|
|
19
|
-
<option value="lastMonth">Last Month</option>
|
|
20
|
-
<option value="thisYear">This Year</option>
|
|
21
|
-
<option value="null">No Value</option>
|
|
22
|
-
</Dropdown>
|
|
23
|
-
<div v-if="![ 'yesterday', 'today', 'thisWeek', 'thisMonth', 'lastMonth', 'thisYear', 'null' ].includes(value.operator)"
|
|
24
|
-
class="flex-1 flex flex-row gap-2">
|
|
25
|
-
<Datepicker class="flex-1"
|
|
26
|
-
mode="popup"
|
|
27
|
-
:readonly="readonly"
|
|
28
|
-
v-model="value.value"
|
|
29
|
-
@change="apply" />
|
|
30
|
-
<Datepicker v-if="value.operator === 'between'"
|
|
31
|
-
class="flex-1"
|
|
32
|
-
:readonly="readonly"
|
|
33
|
-
mode="popup"
|
|
34
|
-
v-model="value.value2"
|
|
35
|
-
@change="apply" />
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<div v-else-if="type === 'number'" class="flex flex-row gap-2">
|
|
41
|
-
<Dropdown v-model="value.operator"
|
|
42
|
-
class="w-[100px]"
|
|
43
|
-
:readonly="readonly"
|
|
44
|
-
@change="apply">
|
|
45
|
-
<option value="=">=</option>
|
|
46
|
-
<option value=">">></option>
|
|
47
|
-
<option value=">=">>=</option>
|
|
48
|
-
<option value="<"><</option>
|
|
49
|
-
<option value="<="><=</option>
|
|
50
|
-
<option value="in">Multiple with comma</option>
|
|
51
|
-
<option value="notIn">Except with comma</option>
|
|
52
|
-
</Dropdown>
|
|
53
|
-
<Textbox v-model="value.value"
|
|
54
|
-
class="flex-1"
|
|
55
|
-
:readonly="readonly"
|
|
56
|
-
@keyup.enter="apply"
|
|
57
|
-
@blur="apply" />
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<div v-else-if="type === 'boolean'" class="flex flex-row gap-2">
|
|
61
|
-
<Radio :name="value.key"
|
|
62
|
-
:readonly="readonly" :value="true" v-model="value.value" @change="apply">True</Radio>
|
|
63
|
-
<Radio :name="value.key"
|
|
64
|
-
:readonly="readonly" :value="false" v-model="value.value" @change="apply">False</Radio>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div v-else-if="type === 'enum' && Array.isArray(cTypeParams) && cTypeParams.length > 0"
|
|
68
|
-
class="flex flex-col gap-1">
|
|
69
|
-
|
|
70
|
-
<Checkbox v-for="param in cTypeParams"
|
|
71
|
-
v-model="cValue.value"
|
|
72
|
-
class="flex-1"
|
|
73
|
-
:readonly="readonly"
|
|
74
|
-
:value="param.value"
|
|
75
|
-
@change="apply">
|
|
76
|
-
{{ param.text }}
|
|
77
|
-
</Checkbox>
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div v-else-if="type === 'component'">
|
|
82
|
-
<component :is="column.component"
|
|
83
|
-
:value="value"
|
|
84
|
-
:readonly="readonly"
|
|
85
|
-
@change="apply" />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div v-else class="flex flex-row gap-2">
|
|
89
|
-
<Dropdown v-model="value.operator"
|
|
90
|
-
:class="![ 'notEmpty' ].includes(value.operator) ? 'w-[100px]' : 'w-full'"
|
|
91
|
-
:readonly="readonly"
|
|
92
|
-
@change="apply">
|
|
93
|
-
<option value="eq">Equal</option>
|
|
94
|
-
<option value="not">Not Equal</option>
|
|
95
|
-
<option value="startsWith">Starts With</option>
|
|
96
|
-
<option value="endsWith">Ends With</option>
|
|
97
|
-
<option value="contains">Contains</option>
|
|
98
|
-
<option value="notContains">Not Contains</option>
|
|
99
|
-
<option value="in">Multiple with comma</option>
|
|
100
|
-
<option value="notIn">Except with comma</option>
|
|
101
|
-
<option value="regex">Regex</option>
|
|
102
|
-
<option value="notEmpty">Not Empty</option>
|
|
103
|
-
</Dropdown>
|
|
104
|
-
<Textbox v-if="![ 'notEmpty' ].includes(value.operator)"
|
|
105
|
-
v-model="value.value"
|
|
106
|
-
:readonly="readonly"
|
|
107
|
-
class="flex-1"
|
|
108
|
-
@keyup.enter="apply"
|
|
109
|
-
@blur="apply" />
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
</div>
|
|
113
|
-
|
|
114
|
-
</template>
|
|
115
|
-
|
|
116
|
-
<script>
|
|
117
|
-
|
|
118
|
-
export default{
|
|
119
|
-
|
|
120
|
-
emits: [ 'change' ],
|
|
121
|
-
|
|
122
|
-
props: {
|
|
123
|
-
|
|
124
|
-
column: {
|
|
125
|
-
type: Object,
|
|
126
|
-
default: {}
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
enabled: Boolean,
|
|
130
|
-
|
|
131
|
-
type: String,
|
|
132
|
-
|
|
133
|
-
typeParams: Array,
|
|
134
|
-
|
|
135
|
-
value: Object,
|
|
136
|
-
|
|
137
|
-
readonly: [ Boolean, Number ],
|
|
138
|
-
|
|
139
|
-
enumCache: Object,
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
computed:{
|
|
144
|
-
|
|
145
|
-
cTypeParams(){
|
|
146
|
-
if(this.enumCache && this.column && this.enumCache[this.column.key]){
|
|
147
|
-
return Object.values(this.enumCache[this.column.key])
|
|
148
|
-
}
|
|
149
|
-
return this.typeParams
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
valueRequired(){
|
|
153
|
-
return (!(['yesterday', 'today', 'thisWeek', 'thisMonth', 'lastMonth', 'thisYear'].includes(this.value.operator) ||
|
|
154
|
-
this.type === 'boolean'));
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
cValue(){
|
|
158
|
-
if(this.type === 'enum' && (!this.value.operator || !Array.isArray(this.value.value))){
|
|
159
|
-
Object.assign(this.value, {
|
|
160
|
-
operator: 'in',
|
|
161
|
-
value: []
|
|
162
|
-
})
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return this.value
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
methods: {
|
|
171
|
-
|
|
172
|
-
apply(){
|
|
173
|
-
if(this.enabled === false) return
|
|
174
|
-
|
|
175
|
-
switch(this.type){
|
|
176
|
-
|
|
177
|
-
case 'bool':
|
|
178
|
-
case 'boolean':
|
|
179
|
-
this.$emit('change')
|
|
180
|
-
break
|
|
181
|
-
|
|
182
|
-
default:
|
|
183
|
-
if((!this.valueRequired && this.value.operator) ||
|
|
184
|
-
(this.value.operator && this.value.operator !== 'between' && this.value.value) ||
|
|
185
|
-
(this.value.operator === 'between' && !!this.value.value && !!this.value.value2)){
|
|
186
|
-
this.$emit('change')
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
</script>
|
|
196
|
-
|
|
197
|
-
<style module>
|
|
198
|
-
|
|
199
|
-
.comp{
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
</style>
|