@mixd-id/web-scaffold 0.2.240706 → 0.2.250801010

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.
Files changed (220) hide show
  1. package/docs/components/Dashboard.md +56 -0
  2. package/log.txt +7 -0
  3. package/package.json +27 -19
  4. package/src/components/404.vue +61 -0
  5. package/src/components/AccountIcon.vue +19 -0
  6. package/src/components/Ahref.vue +1 -1
  7. package/src/components/Alert.vue +4 -13
  8. package/src/components/ArrayList.vue +49 -0
  9. package/src/components/Article.vue +24 -30
  10. package/src/components/Button.vue +83 -169
  11. package/src/components/Card.vue +257 -0
  12. package/src/components/Carousel.vue +61 -60
  13. package/src/components/Cart.vue +192 -0
  14. package/src/components/CartIcon.vue +89 -0
  15. package/src/components/ChartBar.vue +2 -3
  16. package/src/components/Checkbox.vue +20 -11
  17. package/src/components/Checkout.vue +373 -0
  18. package/src/components/CheckoutDelivery.vue +267 -0
  19. package/src/components/CodeEditor.vue +5 -16
  20. package/src/components/CollapsiblePanel.vue +70 -0
  21. package/src/components/ColorPicker.vue +12 -5
  22. package/src/components/ColorPicker2.vue +41 -19
  23. package/src/components/ColorPicker3.vue +100 -0
  24. package/src/components/Confirm.vue +9 -7
  25. package/src/components/ContextMenu.vue +122 -206
  26. package/src/components/ContextMenuItem.vue +53 -0
  27. package/src/components/Dashboard.vue +243 -0
  28. package/src/components/Dashboard2.vue +118 -0
  29. package/src/components/DashboardComponentSelector.vue +96 -0
  30. package/src/components/DashboardConfigs.vue +202 -0
  31. package/src/components/Datepicker.vue +102 -41
  32. package/src/components/DayTimeRange.vue +3 -2
  33. package/src/components/Dropdown.vue +7 -4
  34. package/src/components/Flex.vue +14 -40
  35. package/src/components/GHeatMaps.vue +2 -2
  36. package/src/components/Grid.vue +6 -6
  37. package/src/components/HTMLEditor.vue +27 -14
  38. package/src/components/Image.vue +62 -108
  39. package/src/components/ImagePreview.vue +14 -4
  40. package/src/components/ImageUploader.vue +114 -0
  41. package/src/components/ImportModal.vue +3 -3
  42. package/src/components/Link.vue +62 -6
  43. package/src/components/List.vue +528 -403
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +6 -4
  46. package/src/components/ListPage1.vue +14 -15
  47. package/src/components/ListView.vue +5 -6
  48. package/src/components/ListViewSettings.vue +2 -2
  49. package/src/components/LogViewerItem.vue +1 -1
  50. package/src/components/MarkdownEdit.vue +128 -0
  51. package/src/components/MarkdownPreview.vue +102 -0
  52. package/src/components/MenuItem1.vue +36 -0
  53. package/src/components/Modal.vue +95 -43
  54. package/src/components/MultiDropdown.vue +124 -0
  55. package/src/components/MultilineText.vue +1 -4
  56. package/src/components/OTPField.vue +40 -26
  57. package/src/components/ObjectTree.vue +1 -1
  58. package/src/components/PageBuilder.vue +3 -3
  59. package/src/components/Paragraph.vue +1 -2
  60. package/src/components/PresetSelectorFilterItem.vue +107 -95
  61. package/src/components/Radio.vue +1 -1
  62. package/src/components/SearchModal.vue +153 -0
  63. package/src/components/Slider.vue +1 -1
  64. package/src/components/Svg.vue +1 -1
  65. package/src/components/SvgEditor.vue +173 -0
  66. package/src/components/Switch.vue +4 -5
  67. package/src/components/Table.vue +2 -2
  68. package/src/components/TableView.vue +2 -3
  69. package/src/components/TableViewHead.vue +2 -2
  70. package/src/components/Tabs.vue +1 -1
  71. package/src/components/Testimonial.vue +2 -2
  72. package/src/components/Text.vue +7 -22
  73. package/src/components/TextEditor.vue +3 -3
  74. package/src/components/TextWithTag.vue +61 -30
  75. package/src/components/Textarea.vue +16 -22
  76. package/src/components/Textbox.vue +9 -19
  77. package/src/components/Timepicker.vue +25 -15
  78. package/src/components/Toast.vue +5 -3
  79. package/src/components/TreeMenu.vue +122 -0
  80. package/src/components/TreeView.vue +15 -10
  81. package/src/components/TreeView2.vue +38 -0
  82. package/src/components/TreeViewItem.vue +58 -29
  83. package/src/components/TreeViewItem2.vue +55 -0
  84. package/src/components/Uploader.vue +45 -0
  85. package/src/components/Video.vue +119 -0
  86. package/src/components/VirtualGrid.vue +24 -7
  87. package/src/components/VirtualTable.vue +363 -128
  88. package/src/configs/dashboard/data-table.js +9 -0
  89. package/src/configs/web-page-builder.js +118 -0
  90. package/src/directives/intersect.js +26 -0
  91. package/src/hooks/device.js +14 -0
  92. package/src/index.js +62 -107
  93. package/src/mixin/component.js +151 -67
  94. package/src/themes/default/index.js +118 -159
  95. package/src/utils/dashboard.js +22 -962
  96. package/src/utils/helpers.cjs +635 -0
  97. package/src/utils/helpers.js +91 -60
  98. package/src/utils/helpers.mjs +245 -12
  99. package/src/utils/importer.js +22 -3
  100. package/src/utils/list.mjs +1509 -0
  101. package/src/utils/preset-selector.cjs +1455 -0
  102. package/src/utils/preset-selector.js +489 -95
  103. package/src/utils/preset-selector.mjs +59 -20
  104. package/src/utils/queue.js +63 -0
  105. package/src/utils/web.mjs +120 -0
  106. package/src/utils/wss.js +38 -36
  107. package/src/utils/wss.mjs +24 -19
  108. package/src/widgets/AhrefSetting.vue +16 -13
  109. package/src/widgets/ArticleSetting.vue +15 -27
  110. package/src/widgets/BackgroundColorSetting.vue +153 -0
  111. package/src/widgets/BorderColorSetting.vue +57 -0
  112. package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
  113. package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
  114. package/src/widgets/BotEditor.vue +35 -15
  115. package/src/widgets/ButtonSetting.vue +12 -13
  116. package/src/widgets/CarouselSetting.vue +33 -45
  117. package/src/widgets/CartSetting.vue +46 -0
  118. package/src/widgets/CheckoutSetting.vue +46 -0
  119. package/src/widgets/CollapsiblePanelSetting.vue +46 -0
  120. package/src/widgets/ColumnSelector.vue +29 -5
  121. package/src/widgets/ComponentSetting.vue +1 -1
  122. package/src/widgets/ComponentSetting2.vue +145 -236
  123. package/src/widgets/ComponentSetting3.vue +1 -1
  124. package/src/widgets/ContactForm.vue +3 -3
  125. package/src/widgets/ContactFormSetting.vue +41 -30
  126. package/src/widgets/Dashboard/BarChart.vue +47 -11
  127. package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
  128. package/src/widgets/Dashboard/DataTable.vue +125 -0
  129. package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
  130. package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
  131. package/src/widgets/Dashboard/Doughnut.vue +49 -7
  132. package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
  133. package/src/widgets/Dashboard/Metric.vue +78 -19
  134. package/src/widgets/Dashboard/MetricSetting.vue +81 -28
  135. package/src/widgets/Dashboard/Pie.vue +55 -6
  136. package/src/widgets/Dashboard/PieSetting.vue +1 -1
  137. package/src/widgets/Dashboard/PolarArea.vue +49 -7
  138. package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
  139. package/src/widgets/Dashboard/SharingModal.vue +4 -5
  140. package/src/widgets/Dashboard/ViewSelector.vue +2 -2
  141. package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
  142. package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
  143. package/src/widgets/EmbeddedVideoSetting.vue +7 -5
  144. package/src/widgets/FAQ.vue +16 -3
  145. package/src/widgets/FAQSetting.vue +53 -47
  146. package/src/widgets/FeatureList.vue +3 -0
  147. package/src/widgets/FeatureListSetting.vue +112 -102
  148. package/src/widgets/FlexSetting.vue +83 -106
  149. package/src/widgets/GridSetting.vue +71 -196
  150. package/src/widgets/Header2.vue +34 -71
  151. package/src/widgets/Header2Setting.vue +95 -179
  152. package/src/widgets/HeaderSetting.vue +16 -18
  153. package/src/widgets/IconListSetting.vue +69 -65
  154. package/src/widgets/ImageSetting.vue +33 -60
  155. package/src/widgets/LinkSetting.vue +60 -37
  156. package/src/widgets/LinkSettingModal.vue +173 -0
  157. package/src/widgets/LogViewer.vue +1 -1
  158. package/src/widgets/MarginSetting.vue +2 -2
  159. package/src/widgets/MenuEditor.vue +1 -1
  160. package/src/widgets/MenuItem1Setting.vue +78 -0
  161. package/src/widgets/ModalSetting.vue +42 -44
  162. package/src/widgets/MultiValueSetting.vue +2 -2
  163. package/src/widgets/MultiValueSetting2.vue +78 -45
  164. package/src/widgets/OGSettingModal.vue +103 -0
  165. package/src/widgets/PaddingSetting.vue +2 -2
  166. package/src/widgets/ParagraphSetting.vue +16 -13
  167. package/src/widgets/PositionSetting.vue +209 -0
  168. package/src/widgets/PresetBar.vue +359 -210
  169. package/src/widgets/PresetBarPivot.vue +31 -19
  170. package/src/widgets/PresetSelector.vue +29 -17
  171. package/src/widgets/SearchModalSetting.vue +70 -0
  172. package/src/widgets/Share.vue +1 -2
  173. package/src/widgets/ShareSetting.vue +67 -60
  174. package/src/widgets/StyleSetting.vue +365 -150
  175. package/src/widgets/TestimonialSetting.vue +97 -88
  176. package/src/widgets/TextBlockSetting.vue +16 -13
  177. package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
  178. package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
  179. package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
  180. package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
  181. package/src/widgets/UserActionBuilder.vue +4 -16
  182. package/src/widgets/WebComponentSelector.vue +15 -11
  183. package/src/widgets/WebLayoutSelector.vue +41 -270
  184. package/src/widgets/WebPageBuilder.vue +1019 -707
  185. package/src/widgets/WebPageBuilder2.vue +7 -7
  186. package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
  187. package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
  188. package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
  189. package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
  190. package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
  191. package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
  192. package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
  193. package/src/widgets/WebPageBuilder4.vue +289 -575
  194. package/src/widgets/WebPageSelector.vue +1 -1
  195. package/src/widgets/YoutubeVideoSetting.vue +16 -13
  196. package/tailwind.config.js +3 -35
  197. package/docs/schema/user-action.json +0 -266
  198. package/src/App.vue +0 -25
  199. package/src/components/SearchButton.vue +0 -57
  200. package/src/entry-client.js +0 -27
  201. package/src/entry-server.js +0 -73
  202. package/src/events/event.js +0 -2
  203. package/src/main.js +0 -29
  204. package/src/mixin/website.js +0 -121
  205. package/src/router.js +0 -57
  206. package/src/widgets/MobileMenu.vue +0 -182
  207. package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
  208. package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
  209. package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
  210. package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
  211. package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
  212. package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
  213. package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
  214. package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
  215. package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
  216. package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
  217. package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
  218. package/test.json +0 -22
  219. /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
  220. /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
@@ -1,76 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
- <div class="flex flex-row items-center">
4
- <label class="flex-1">Font Size</label>
5
- <Dropdown v-model="fontSize[index]">
6
- <option value="">Unset</option>
7
- <option v-for="value in values" :value="`${viewType}${value[0]}`">
8
- {{ value[1] }}
9
- </option>
10
- </Dropdown>
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- export default{
18
-
19
- inject: [ 'viewTypes' ],
20
-
21
- props: {
22
-
23
- index: {
24
- type: Number,
25
- required: true
26
- },
27
-
28
- value: {
29
- type: Object,
30
- required: true
31
- },
32
-
33
- viewType: {
34
- type: String,
35
- required: true
36
- },
37
-
38
- },
39
-
40
- computed: {
41
-
42
- fontSize(){
43
- if(!Array.isArray(this.value.props.fontSize))
44
- this.value.props.fontSize = this.viewTypes.map(_ => '')
45
- return this.value.props.fontSize
46
- }
47
-
48
- },
49
-
50
- data(){
51
- return {
52
- values: [
53
- [ 'text-xs', 'Extra Small' ],
54
- [ 'text-sm', 'Small' ],
55
- [ 'text-base', 'Normal' ],
56
- [ 'text-lg', 'Large' ],
57
- [ 'text-xl', 'Extra Large' ],
58
- [ 'text-2xl', 'Extra Large 2' ],
59
- [ 'text-3xl', 'Extra Large 3' ],
60
- [ 'text-4xl', 'Extra Large 4' ],
61
- [ 'text-5xl', 'Extra Large 5' ],
62
- [ 'text-6xl', 'Extra Large 6' ],
63
- ]
64
- }
65
- }
66
-
67
- }
68
-
69
- </script>
70
-
71
- <style module>
72
-
73
- .comp{
74
- }
75
-
76
- </style>
@@ -1,68 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
-
4
- <div class="flex flex-row items-center gap-3">
5
- <Textbox v-model="value.name" class="flex-1 p-0 border-none" :placeholder="value.type" />
6
- <Switch v-model="value.props.enabled" />
7
- </div>
8
-
9
- <div class="flex flex-row items-center gap-3">
10
- <label class="flex-1">Text</label>
11
- <Textbox v-model="value.props.text" />
12
- </div>
13
-
14
- <div class="flex flex-col gap-1">
15
- <label class="flex-1">Target</label>
16
- <Textbox v-model="value.props.target" />
17
- </div>
18
-
19
- <PropertySetting :value="value" :index="index" :viewType="viewType" :keys="keys" />
20
-
21
- </div>
22
- </template>
23
-
24
- <script>
25
-
26
- import {defineAsyncComponent} from "vue";
27
-
28
- export default{
29
-
30
- components: {
31
- ActionSetting: defineAsyncComponent(() => import('./ActionSetting.vue')),
32
- PropertySetting: defineAsyncComponent(() => import('./PropertySetting.vue'))
33
- },
34
-
35
- data(){
36
- return {
37
- keys: [
38
- ]
39
- }
40
- },
41
-
42
- inject: [ 'viewTypes' ],
43
-
44
- name: 'ButtonSetting',
45
-
46
- props: {
47
-
48
- index: Number,
49
-
50
- value: {
51
- type: Object,
52
- required: true
53
- },
54
-
55
- viewType: String,
56
-
57
- },
58
- }
59
-
60
- </script>
61
-
62
- <style module>
63
-
64
- .comp{
65
- @apply flex flex-col gap-5;
66
- }
67
-
68
- </style>
@@ -1,106 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
-
4
- <div class="flex flex-row items-center gap-3">
5
- <Textbox v-model="value.name" class="flex-1 p-0 border-none" :placeholder="value.type" />
6
- <Switch v-model="value.props.enabled" />
7
- </div>
8
-
9
- <div class="flex flex-row gap-2 items-center">
10
- <label class="flex-1">Open</label>
11
- <Switch v-model="value.props.debugOpen" />
12
- </div>
13
-
14
- <div class="flex flex-row gap-2 items-center">
15
- <label class="flex-1">Position</label>
16
- <Dropdown v-model="value.props.mode" class="w-[120px]">
17
- <option value="left">Left</option>
18
- <option value="right">Right</option>
19
- <option value="top">Top</option>
20
- <option value="middle">Middle</option>
21
- </Dropdown>
22
- </div>
23
-
24
- <PropertySetting :value="value"
25
- :index="index"
26
- :viewType="viewType"
27
- :keys="keys" />
28
-
29
- </div>
30
- </template>
31
-
32
- <script>
33
-
34
- import {defineAsyncComponent} from "vue";
35
-
36
- export default{
37
-
38
- components: {
39
- PropertySetting: defineAsyncComponent(() => import('./PropertySetting.vue')),
40
- },
41
-
42
- computed: {
43
-
44
- flexAlign(){
45
- if(!Array.isArray(this.value.props.flexAlign))
46
- this.value.props.flexAlign = []
47
-
48
- return this.value.props.flexAlign
49
- },
50
-
51
- flexJustify(){
52
- if(!Array.isArray(this.value.props.flexJustify))
53
- this.value.props.flexJustify = []
54
-
55
- return this.value.props.flexJustify
56
- },
57
-
58
- gap(){
59
- if(!Array.isArray(this.value.props.gap))
60
- this.value.props.gap = [ 'gap-2' ]
61
-
62
- return this.value.props.gap
63
- },
64
-
65
- wrap(){
66
- if(!Array.isArray(this.value.props.wrap))
67
- this.value.props.wrap = []
68
-
69
- return this.value.props.wrap
70
- },
71
-
72
- },
73
-
74
- data(){
75
- return {
76
- keys: [
77
- ]
78
- }
79
- },
80
-
81
- inject: [ 'uploadImage', 'viewTypes' ],
82
-
83
- props: {
84
-
85
- index: Number,
86
-
87
- value: {
88
- type: Object,
89
- required: true
90
- },
91
-
92
- viewType: String,
93
-
94
- },
95
-
96
- }
97
-
98
- </script>
99
-
100
- <style module>
101
-
102
- .comp{
103
- @apply flex flex-col gap-5;
104
- }
105
-
106
- </style>
@@ -1,73 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
-
4
- <div class="flex flex-row items-center gap-3">
5
- <Textbox v-model="value.name" class="flex-1 p-0 border-none" :placeholder="value.type" />
6
- <Switch v-model="value.props.enabled" />
7
- </div>
8
-
9
- <div class="flex flex-row items-center">
10
- <label class="flex-1">propertyName</label>
11
- <Dropdown v-model="propertyName[index]">
12
- <option value="">Unset</option>
13
- <option v-for="value in values" :value="`${viewType}${value[0]}`">
14
- {{ value[1] }}
15
- </option>
16
- </Dropdown>
17
- </div>
18
- </div>
19
- </template>
20
-
21
- <script>
22
-
23
- export default{
24
-
25
- inject: [ 'viewTypes' ],
26
-
27
- props: {
28
-
29
- index: {
30
- type: Number,
31
- required: true
32
- },
33
-
34
- value: {
35
- type: Object,
36
- required: true
37
- },
38
-
39
- viewType: {
40
- type: String,
41
- required: true
42
- },
43
-
44
- },
45
-
46
- computed: {
47
-
48
- propertyName(){
49
- if(!Array.isArray(this.value.props.propertyName))
50
- this.value.props.propertyName = this.viewTypes.map(_ => '')
51
- return this.value.props.propertyName
52
- }
53
-
54
- },
55
-
56
- data(){
57
- return {
58
- values: [
59
- [ 'value', 'text' ],
60
- ]
61
- }
62
- }
63
-
64
- }
65
-
66
- </script>
67
-
68
- <style module>
69
-
70
- .comp{
71
- }
72
-
73
- </style>
@@ -1,77 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
-
4
- <strong>Style Setting</strong>
5
-
6
- <div class="flex flex-col gap-3">
7
-
8
- <div class="flex flex-row items-center gap-2">
9
- <label class="flex-1">Normal Font</label>
10
- <button type="button" class="text-primary">
11
- Add Style
12
- </button>
13
- </div>
14
- <div>
15
- <div class="flex flex-row items-center gap-2">
16
- <label class="flex-1">Font Family</label>
17
- <Dropdown class="w-[120px]" v-model="normalStyle.font">
18
- <option value="">Default</option>
19
- <option value="Lato">Lato</option>
20
- <option value="Nunito">Nunito</option>
21
- <option value="Poppins">Poppins</option>
22
- <option value="Quicksand">Quicksand</option>
23
- </Dropdown>
24
- </div>
25
- </div>
26
-
27
- </div>
28
-
29
- </div>
30
- </template>
31
-
32
- <script>
33
-
34
- export default{
35
-
36
- computed: {
37
-
38
- normalStyle(){
39
- if(!this.style.normal){
40
- this.style.normal = {}
41
- }
42
- return this.style.normal
43
- },
44
-
45
- style(){
46
- if(!this.value.style){
47
- this.value.style = {}
48
- }
49
- return this.value.style
50
- },
51
-
52
- },
53
-
54
- props: {
55
-
56
- index: Number,
57
-
58
- value: {
59
- type: Object,
60
- required: true
61
- },
62
-
63
- viewType: String,
64
-
65
- }
66
-
67
- }
68
-
69
- </script>
70
-
71
- <style module>
72
-
73
- .comp{
74
- @apply flex flex-col gap-5;
75
- }
76
-
77
- </style>
@@ -1,207 +0,0 @@
1
- <template>
2
- <div class="flex flex-col gap-5">
3
-
4
- <div class="flex flex-row items-center gap-3">
5
- <Textbox v-model="value.name" class="flex-1 p-0 border-none" :placeholder="value.type" />
6
- <Switch v-model="value.props.enabled" />
7
- </div>
8
-
9
- <div>
10
- <label class="flex-1">SVG</label>
11
- <div class="flex flex-row gap-2">
12
- <div>
13
- <div class="bg-text-50 rounded-lg p-2">
14
- <Svg :html="value.props.html" />
15
- </div>
16
- </div>
17
- <div class="flex flex-col gap-2 items-start">
18
- <button type="button" class="text-primary" @click="$refs.file.click()">Upload SVG File</button>
19
- <input type="file" ref="file" accept="image/svg+xml" class="hidden" @change="onFileUpload" />
20
-
21
- <button type="button" class="text-primary" @click="$refs.modal.open({ html:svg.html })">
22
- Upload SVG HTML
23
- </button>
24
- </div>
25
- </div>
26
- </div>
27
-
28
- <div class="flex flex-row gap-2">
29
- <div>
30
- <label>Width</label>
31
- <Dropdown v-model="svg.width" class="w-[80px] mt-1">
32
- <option value="">Auto</option>
33
- <option value="16px">16px</option>
34
- <option value="24px">24px</option>
35
- <option value="32px">32px</option>
36
- <option value="36px">36px</option>
37
- <option value="48px">48px</option>
38
- <option value="64px">64px</option>
39
- </Dropdown>
40
- </div>
41
- <div>
42
- <label>Height</label>
43
- <Dropdown v-model="svg.height" class="w-[80px] mt-1">
44
- <option value="">Auto</option>
45
- <option value="16px">16px</option>
46
- <option value="24px">24px</option>
47
- <option value="32px">32px</option>
48
- <option value="36px">36px</option>
49
- <option value="48px">48px</option>
50
- <option value="64px">64px</option>
51
- </Dropdown>
52
- </div>
53
- </div>
54
-
55
- <div class="flex flex-row gap-2">
56
- <div>
57
- <label>Fill Color</label>
58
- <Dropdown v-model="svg.fillColor" class="w-[120px] mt-1">
59
- <option value="fill-primary-600">Primary 600</option>
60
- </Dropdown>
61
- </div>
62
- </div>
63
-
64
- <Modal ref="modal" width="360" height="360">
65
-
66
- <template v-slot:head>
67
- <div class="relative p-5">
68
- <h3>Add SVG</h3>
69
- <div class="absolute top-0 right-0 p-2">
70
- <button type="button" class="p-2" @click="$refs.modal.close()">
71
- <svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
72
- <path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
73
- </svg>
74
- </button>
75
- </div>
76
- </div>
77
- </template>
78
-
79
- <template v-slot:foot="{ context }">
80
- <div class="p-5">
81
- <Button class="w-[90px]" @click="svg.html = context.html; $refs.modal.close()">OK</Button>
82
- </div>
83
- </template>
84
-
85
- <template #default="{ context }">
86
- <div class="flex-1 p-5">
87
- <Textarea v-model="context.html" rows="6" />
88
- </div>
89
- </template>
90
-
91
- </Modal>
92
-
93
- <br />
94
- <br />
95
- <pre class="hidden text-xs break-all">{{ value.props.html }}</pre>
96
-
97
- </div>
98
- </template>
99
-
100
- <script>
101
-
102
- export default{
103
-
104
- computed: {
105
-
106
- svg(){
107
- if(typeof this.value.svg !== 'object')
108
- this.value.svg = {}
109
- return this.value.svg
110
- }
111
-
112
- },
113
-
114
- data(){
115
- return {
116
- }
117
- },
118
-
119
- inject: [ 'alert', 'viewTypes' ],
120
-
121
- methods: {
122
-
123
- onFileUpload(e){
124
-
125
- const reader = new FileReader();
126
- reader.addEventListener('load', () => {
127
- this.svg.html = reader.result
128
- }, false)
129
- reader.addEventListener('error', (e) => {
130
- this.alert(this.$t('Unable to read file'))
131
- })
132
- reader.readAsText(this.$refs.file.files[0]);
133
-
134
- },
135
-
136
- },
137
-
138
- props: {
139
-
140
- index: {
141
- type: Number,
142
- required: true
143
- },
144
-
145
- value: {
146
- type: Object,
147
- required: true
148
- },
149
-
150
- viewType: {
151
- type: String,
152
- required: true
153
- },
154
-
155
- },
156
-
157
- watch: {
158
-
159
- svg: {
160
- deep: true,
161
- handler(to){
162
-
163
- const html = to.html
164
-
165
- const aDiv = document.createElement('div')
166
- aDiv.innerHTML = html
167
-
168
- const svg = aDiv.firstElementChild
169
-
170
- if(svg){
171
-
172
- const hasHeight = !!svg.getAttribute('height') || !!svg.style.height
173
- const hasWidth = !!svg.getAttribute('width') || !!svg.style.width
174
-
175
- if(this.svg.width || !hasWidth){
176
- svg.style.width = this.svg.width ? this.svg.width : '16px'
177
- }
178
-
179
- if(this.svg.height || !hasHeight){
180
- svg.style.height = this.svg.height ? this.svg.height : '16px'
181
- }
182
-
183
- svg.classList.add(this.svg.fillColor)
184
- svg.removeAttribute('height')
185
- svg.removeAttribute('width')
186
-
187
- this.value.props.html = aDiv.innerHTML
188
- }
189
- else{
190
- this.value.props.html = ''
191
- }
192
-
193
- }
194
- }
195
-
196
- }
197
-
198
- }
199
-
200
- </script>
201
-
202
- <style module>
203
-
204
- .comp{
205
- }
206
-
207
- </style>
@@ -1,70 +0,0 @@
1
- <template>
2
- <div :class="$style.comp">
3
- <div class="flex flex-row items-center">
4
- <label class="flex-1">Text Transform</label>
5
- <Dropdown v-model="textTransform[index]">
6
- <option value="">Unset</option>
7
- <option v-for="value in values" :value="`${viewType}${value[0]}`">
8
- {{ value[1] }}
9
- </option>
10
- </Dropdown>
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- export default{
18
-
19
- inject: [ 'viewTypes' ],
20
-
21
- props: {
22
-
23
- index: {
24
- type: Number,
25
- required: true
26
- },
27
-
28
- value: {
29
- type: Object,
30
- required: true
31
- },
32
-
33
- viewType: {
34
- type: String,
35
- required: true
36
- },
37
-
38
- },
39
-
40
- computed: {
41
-
42
- textTransform(){
43
- if(!Array.isArray(this.value.props.textTransform))
44
- this.value.props.textTransform = this.viewTypes.map(_ => '')
45
- return this.value.props.textTransform
46
- }
47
-
48
- },
49
-
50
- data(){
51
- return {
52
- values: [
53
- [ 'capitalize', 'Capitalize' ],
54
- [ 'lowercase', 'Lowercase' ],
55
- [ 'normal-case', 'Normal' ],
56
- [ 'uppercase', 'Uppercase' ],
57
- ]
58
- }
59
- }
60
-
61
- }
62
-
63
- </script>
64
-
65
- <style module>
66
-
67
- .comp{
68
- }
69
-
70
- </style>