@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,453 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div @mousemove="hoverMouseOver"
|
|
3
|
-
@mouseout="hoverMouseOut">
|
|
4
|
-
<div ref="item"
|
|
5
|
-
:class="itemClass"
|
|
6
|
-
@mousedown="mouseDown">
|
|
7
|
-
|
|
8
|
-
<button type="button" class="p-1 w-[18px]"
|
|
9
|
-
v-if="Array.isArray((item ?? {}).items) && item.items.length > 0"
|
|
10
|
-
@click="childCollapsed = !childCollapsed">
|
|
11
|
-
<svg v-if="!childCollapsed" width="14" height="14" class="fill-text-300 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg>
|
|
12
|
-
<svg v-else width="14" height="14" class="fill-text-300 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 512"><path d="M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z"/></svg>
|
|
13
|
-
</button>
|
|
14
|
-
|
|
15
|
-
<slot name="item" :item="item" :parent="parent" :depth="depth">
|
|
16
|
-
<div class="flex-1 flex px-3">
|
|
17
|
-
<slot :item="item" :parent="parent"></slot>
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
<div class="flex flex-row items-center">
|
|
21
|
-
<button v-if="item && Array.isArray(item.items)"
|
|
22
|
-
type="button"
|
|
23
|
-
class="p-1"
|
|
24
|
-
@click="add">
|
|
25
|
-
<svg width="16" height="16" class="fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M376 232H216V72c0-4.42-3.58-8-8-8h-32c-4.42 0-8 3.58-8 8v160H8c-4.42 0-8 3.58-8 8v32c0 4.42 3.58 8 8 8h160v160c0 4.42 3.58 8 8 8h32c4.42 0 8-3.58 8-8V280h160c4.42 0 8-3.58 8-8v-32c0-4.42-3.58-8-8-8z"/></svg>
|
|
26
|
-
</button>
|
|
27
|
-
|
|
28
|
-
<button type="button" class="p-1" @click="duplicate">
|
|
29
|
-
<svg class="fill-text-300 hover:fill-primary" width="13" height="13" 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="M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"/></svg>
|
|
30
|
-
</button>
|
|
31
|
-
|
|
32
|
-
<button type="button"
|
|
33
|
-
class="p-1"
|
|
34
|
-
@click="$emit('remove')">
|
|
35
|
-
<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>
|
|
36
|
-
</button>
|
|
37
|
-
</div>
|
|
38
|
-
</slot>
|
|
39
|
-
|
|
40
|
-
</div>
|
|
41
|
-
<div ref="container"
|
|
42
|
-
v-show="item && Array.isArray(item.items) && !childCollapsed" class="ml-6"
|
|
43
|
-
@mousemove.stop=""
|
|
44
|
-
@mouseout.stop="">
|
|
45
|
-
<TreeViewItem v-for="(subItem, index) in item.items"
|
|
46
|
-
:item="subItem"
|
|
47
|
-
:parent="item.items"
|
|
48
|
-
:depth="depth + 1"
|
|
49
|
-
:selected-item="selectedItem"
|
|
50
|
-
@moveup="moveUp(subItem)"
|
|
51
|
-
@movedown="moveDown(subItem)"
|
|
52
|
-
@remove="item.items.splice(index, 1); $emit('change')"
|
|
53
|
-
@add="(items) => $emit('add', items)"
|
|
54
|
-
@duplicate="(parent, item) => $emit('duplicate', parent, item)"
|
|
55
|
-
@change="$emit('change')">
|
|
56
|
-
<template #default="{ item, parent, depth }">
|
|
57
|
-
<slot :item="item" :parent="parent" :depth="depth"></slot>
|
|
58
|
-
</template>
|
|
59
|
-
|
|
60
|
-
<template #item="{ item, parent, depth }">
|
|
61
|
-
<slot name="item" :item="item" :parent="parent" :depth="depth"></slot>
|
|
62
|
-
</template>
|
|
63
|
-
</TreeViewItem>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
|
|
68
|
-
<script>
|
|
69
|
-
|
|
70
|
-
let dragged = null
|
|
71
|
-
let guide1 = null
|
|
72
|
-
|
|
73
|
-
export default{
|
|
74
|
-
|
|
75
|
-
name: 'TreeViewItem',
|
|
76
|
-
|
|
77
|
-
emits: [ 'add', 'change', 'duplicate', 'moveup', 'movedown', 'remove' ],
|
|
78
|
-
|
|
79
|
-
inject: [ 'toast', 'store' ],
|
|
80
|
-
|
|
81
|
-
props: {
|
|
82
|
-
item: Object,
|
|
83
|
-
|
|
84
|
-
parent: Array,
|
|
85
|
-
|
|
86
|
-
selectedItem: Object,
|
|
87
|
-
|
|
88
|
-
state: {
|
|
89
|
-
type: [ Number, String ],
|
|
90
|
-
default: 1
|
|
91
|
-
},
|
|
92
|
-
|
|
93
|
-
depth: Number
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
methods: {
|
|
97
|
-
|
|
98
|
-
moveDown(item){
|
|
99
|
-
const idx = this.item.items.indexOf(item)
|
|
100
|
-
if(idx < this.item.items.length - 1){
|
|
101
|
-
this.item.items.splice(idx + 1, 0, this.item.items.splice(idx, 1)[0])
|
|
102
|
-
this.$emit('change')
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
moveUp(item){
|
|
107
|
-
const idx = this.item.items.indexOf(item)
|
|
108
|
-
if(idx - 1 >= 0){
|
|
109
|
-
this.item.items.splice(idx - 1, 0, this.item.items.splice(idx, 1)[0])
|
|
110
|
-
this.$emit('change')
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
add(){
|
|
115
|
-
this.$emit('add', this.item.items)
|
|
116
|
-
this.childCollapsed = false
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
duplicate(){
|
|
120
|
-
this.$emit('duplicate', this.parent, this.item)
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
mouseDown(e){
|
|
124
|
-
if(!this.$el || this.$el.nodeType !== 1) return
|
|
125
|
-
|
|
126
|
-
e.preventDefault()
|
|
127
|
-
|
|
128
|
-
const startX = e.clientX
|
|
129
|
-
const startY = e.clientY
|
|
130
|
-
const rect = this.$el.getBoundingClientRect()
|
|
131
|
-
|
|
132
|
-
dragged = {
|
|
133
|
-
item: this.item,
|
|
134
|
-
parent: this.parent,
|
|
135
|
-
startY: e.clientY
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const mouseMove = (e) => {
|
|
139
|
-
const distanceX = e.clientX - startX
|
|
140
|
-
const distanceY = e.clientY - startY
|
|
141
|
-
|
|
142
|
-
if(!dragged.cloned && Math.abs(distanceY) > 10){
|
|
143
|
-
const cloned = this.$el.cloneNode(true)
|
|
144
|
-
cloned.style.position = 'absolute'
|
|
145
|
-
cloned.style.left = rect.x + "px"
|
|
146
|
-
cloned.style.top = (e.clientY - 10) + "px"
|
|
147
|
-
cloned.style.width = this.$el.clientWidth + "px"
|
|
148
|
-
cloned.style.pointerEvents = 'none'
|
|
149
|
-
cloned.style.opacity = '0.5'
|
|
150
|
-
document.body.appendChild(cloned)
|
|
151
|
-
|
|
152
|
-
dragged.cloned = cloned
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
if(dragged.cloned){
|
|
156
|
-
dragged.cloned.style.left = (rect.x + distanceX) + "px"
|
|
157
|
-
dragged.cloned.style.top = (e.clientY - 10) + "px"
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
dragged.clientY = e.clientY
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
const mouseUp = (e) => {
|
|
164
|
-
if(dragged.cloned){
|
|
165
|
-
document.body.removeChild(dragged.cloned)
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
window.removeEventListener('mousemove', mouseMove)
|
|
169
|
-
window.removeEventListener('mouseup', mouseUp)
|
|
170
|
-
|
|
171
|
-
if(dragged && dragged.parent && dragged.targetParent){
|
|
172
|
-
|
|
173
|
-
const targetIdx = dragged.targetParent.indexOf(dragged.target)
|
|
174
|
-
const moveDirection = e.clientY < dragged.startY ? -1 : 1
|
|
175
|
-
const sameParent = dragged.parent === dragged.targetParent
|
|
176
|
-
|
|
177
|
-
let destIdx = undefined
|
|
178
|
-
|
|
179
|
-
if(dragged.dragArea === 1){
|
|
180
|
-
if(sameParent){
|
|
181
|
-
if(moveDirection === -1){
|
|
182
|
-
destIdx = targetIdx
|
|
183
|
-
}
|
|
184
|
-
else{
|
|
185
|
-
destIdx = targetIdx - 1
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
else{
|
|
189
|
-
destIdx = targetIdx
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
else if(dragged.dragArea === 2){
|
|
193
|
-
if(sameParent){
|
|
194
|
-
if(moveDirection === -1){
|
|
195
|
-
destIdx = targetIdx + 1
|
|
196
|
-
}
|
|
197
|
-
else{
|
|
198
|
-
destIdx = targetIdx
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
else{
|
|
202
|
-
if(moveDirection === -1){
|
|
203
|
-
destIdx = targetIdx + 1
|
|
204
|
-
}
|
|
205
|
-
else{
|
|
206
|
-
destIdx = targetIdx + 1
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if(destIdx !== undefined){
|
|
212
|
-
dragged.targetParent.splice(destIdx, 0,
|
|
213
|
-
dragged.parent.splice(dragged.parent.indexOf(dragged.item), 1)[0])
|
|
214
|
-
this.$emit('change')
|
|
215
|
-
}
|
|
216
|
-
else if(dragged.dragArea === 3){
|
|
217
|
-
dragged.targetParent.push(dragged.parent.splice(dragged.parent.indexOf(dragged.item), 1)[0])
|
|
218
|
-
this.$emit('change')
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
if(guide1 && guide1.parentNode){
|
|
223
|
-
guide1.parentNode.removeChild(guide1)
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
document.querySelectorAll(`.${this.$style.dragInto}`).forEach((el) => {
|
|
227
|
-
el.classList.remove(this.$style.dragInto)
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
dragged = null
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
window.addEventListener('mousemove', mouseMove)
|
|
234
|
-
window.addEventListener('mouseup', mouseUp)
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
hoverMouseOver(e){
|
|
238
|
-
if(!dragged) return
|
|
239
|
-
if(this.item === dragged.item) return
|
|
240
|
-
|
|
241
|
-
// Drag to own child is not allowed
|
|
242
|
-
if(dragged.item.items && dragged.item.items.indexOf(this.item) > -1){
|
|
243
|
-
return
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if(!guide1){
|
|
247
|
-
guide1 = this.createGuide()
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
if(dragged.target !== this.item){
|
|
251
|
-
const rect = this.$refs.item.getBoundingClientRect()
|
|
252
|
-
const hasChildItems = Array.isArray(this.item.items)
|
|
253
|
-
|
|
254
|
-
dragged.targetArea = hasChildItems ? [
|
|
255
|
-
Math.round(rect.y + (rect.height * (2 / 3))),
|
|
256
|
-
Math.round(rect.y + (rect.height * (1 / 3))),
|
|
257
|
-
0
|
|
258
|
-
] : [
|
|
259
|
-
Math.round(rect.y + (rect.height * (1/2))),
|
|
260
|
-
0
|
|
261
|
-
]
|
|
262
|
-
//dragged.centerY = rect.y + (rect.height / 2)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
dragged.target = this.item
|
|
266
|
-
dragged.targetParent = this.parent
|
|
267
|
-
|
|
268
|
-
for(let i in dragged.targetArea){
|
|
269
|
-
if(e.clientY > dragged.targetArea[i]){
|
|
270
|
-
dragged.dragArea = dragged.targetArea.length - i
|
|
271
|
-
break
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if(dragged.targetArea.length === 3){
|
|
275
|
-
dragged.dragArea = dragged.dragArea === 2 ? 3 :
|
|
276
|
-
(dragged.dragArea === 3 ? 2 : 1)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
this.$refs.item.classList.remove(this.$style.dragInto)
|
|
280
|
-
if(dragged.dragArea === 1){
|
|
281
|
-
this.$el.insertBefore(guide1, this.$el.firstElementChild)
|
|
282
|
-
}
|
|
283
|
-
else if(dragged.dragArea === 2){
|
|
284
|
-
this.$el.insertBefore(guide1, null)
|
|
285
|
-
}
|
|
286
|
-
else if(dragged.dragArea === 3){
|
|
287
|
-
|
|
288
|
-
// Drag to own parent is not allowed
|
|
289
|
-
if(this.item.items && this.item.items.indexOf(dragged.item) > -1){
|
|
290
|
-
return
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
if(guide1.parentNode)
|
|
294
|
-
guide1.parentNode.removeChild(guide1)
|
|
295
|
-
this.$refs.item.classList.add(this.$style.dragInto)
|
|
296
|
-
dragged.targetParent = this.item.items
|
|
297
|
-
dragged.refItem = this.$refs.item
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
},
|
|
301
|
-
|
|
302
|
-
hoverMouseOut(e){
|
|
303
|
-
if(!dragged) return
|
|
304
|
-
|
|
305
|
-
delete dragged.target
|
|
306
|
-
delete dragged.targetParent
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
createGuide(){
|
|
310
|
-
const el = document.createElement('div')
|
|
311
|
-
el.classList.add(this.$style.guide)
|
|
312
|
-
return el
|
|
313
|
-
},
|
|
314
|
-
|
|
315
|
-
},
|
|
316
|
-
|
|
317
|
-
computed: {
|
|
318
|
-
|
|
319
|
-
componentStore(){
|
|
320
|
-
if(!this.store) return this.store
|
|
321
|
-
|
|
322
|
-
if(!this.store.components)
|
|
323
|
-
this.store.components = {}
|
|
324
|
-
|
|
325
|
-
if(!this.store.components.treeviewitem)
|
|
326
|
-
this.store.components.treeviewitem = {}
|
|
327
|
-
|
|
328
|
-
return this.store.components.treeviewitem
|
|
329
|
-
},
|
|
330
|
-
|
|
331
|
-
isSelected(){
|
|
332
|
-
return this.selectedItem === this.item
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
itemClass(){
|
|
336
|
-
return [
|
|
337
|
-
this.$style.item,
|
|
338
|
-
this.isSelected ? this.$style.active : '',
|
|
339
|
-
this.state === 3 ? this.$style.active : '',
|
|
340
|
-
]
|
|
341
|
-
.filter(_=>_)
|
|
342
|
-
.join(' ')
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
data(){
|
|
348
|
-
return {
|
|
349
|
-
childCollapsed: true,
|
|
350
|
-
hvm: null
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
mounted() {
|
|
355
|
-
if(this.componentStore){
|
|
356
|
-
this.childCollapsed = this.componentStore[this.item.uid] ?? this.childCollapsed
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
|
|
360
|
-
watch: {
|
|
361
|
-
|
|
362
|
-
item: {
|
|
363
|
-
handler(){
|
|
364
|
-
if(this.componentStore){
|
|
365
|
-
this.childCollapsed = this.componentStore[this.item.uid] ?? this.childCollapsed
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
deep: true
|
|
369
|
-
},
|
|
370
|
-
|
|
371
|
-
childCollapsed(to){
|
|
372
|
-
if(this.item.uid && this.componentStore){
|
|
373
|
-
this.componentStore[this.item.uid] = to
|
|
374
|
-
|
|
375
|
-
const keys = Object.keys(this.componentStore)
|
|
376
|
-
if(keys.length > 100){
|
|
377
|
-
const removedKeys = keys.slice(0, keys.length - 100)
|
|
378
|
-
for(let i in removedKeys){
|
|
379
|
-
delete this.componentStore[removedKeys[i]]
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
else{
|
|
384
|
-
console.warn('[TreeviewItem] not saving collapsed state', {
|
|
385
|
-
uid: this.item.uid,
|
|
386
|
-
componentStore: this.componentStore,
|
|
387
|
-
})
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
|
|
391
|
-
isSelected(to){
|
|
392
|
-
if(to){
|
|
393
|
-
|
|
394
|
-
// Expand all parents
|
|
395
|
-
let parent = this.$parent
|
|
396
|
-
while('childCollapsed' in parent){
|
|
397
|
-
parent.childCollapsed = false
|
|
398
|
-
parent = parent.$parent
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
// Scroll into view
|
|
402
|
-
this.$nextTick(() => {
|
|
403
|
-
let parentContainer = this.$el.parentNode
|
|
404
|
-
do{
|
|
405
|
-
if([ 'auto' ].includes(window.getComputedStyle(parentContainer).overflowY)){
|
|
406
|
-
break
|
|
407
|
-
}
|
|
408
|
-
parentContainer = parentContainer.parentNode
|
|
409
|
-
}
|
|
410
|
-
while(parentContainer && parentContainer.tagName !== 'BODY')
|
|
411
|
-
|
|
412
|
-
let isInViewPort = this.$el.offsetTop > parentContainer.scrollTop &&
|
|
413
|
-
this.$el.offsetTop < (parentContainer.scrollTop + parentContainer.clientHeight)
|
|
414
|
-
|
|
415
|
-
if(!isInViewPort){
|
|
416
|
-
this.$el.scrollIntoView({
|
|
417
|
-
behavior: 'smooth',
|
|
418
|
-
})
|
|
419
|
-
}
|
|
420
|
-
})
|
|
421
|
-
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
</script>
|
|
430
|
-
|
|
431
|
-
<style module>
|
|
432
|
-
|
|
433
|
-
.item{
|
|
434
|
-
@apply bg-base-300 hover:bg-text-50 flex flex-row py-1 items-center rounded-lg mb-1;
|
|
435
|
-
@apply border-[1px] border-transparent cursor-pointer;
|
|
436
|
-
}
|
|
437
|
-
.item.active{
|
|
438
|
-
@apply border-primary;
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
.itemMouseOver{
|
|
442
|
-
@apply !bg-primary;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
.guide{
|
|
446
|
-
@apply h-[1px] bg-primary rounded-lg;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.item.dragInto{
|
|
450
|
-
@apply border-[1px] border-primary;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
</style>
|