@mixd-id/web-scaffold 0.2.240705 → 0.2.250801009

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +79 -167
  11. package/src/components/Card.vue +235 -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 +8 -3
  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 +524 -402
  44. package/src/components/ListContextMenu.vue +88 -0
  45. package/src/components/ListItem.vue +5 -3
  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 +11 -17
  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 +11 -16
  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 +147 -67
  94. package/src/themes/default/index.js +83 -155
  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 +37 -29
  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 +112 -234
  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 +227 -116
  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 +693 -704
  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
@@ -123,7 +123,7 @@ export default{
123
123
  <style module>
124
124
 
125
125
  .comp{
126
- @apply hidden md:block bg-base;
126
+ @apply hidden md:block;
127
127
  }
128
128
  .comp.mobileView{
129
129
  @apply hidden
@@ -136,7 +136,7 @@ export default{
136
136
  }
137
137
 
138
138
  .comp tbody td{
139
- @apply bg-base relative border-r-[1px] border-text-50;
139
+ @apply bg-base relative border-r-[1px] border-border-50;
140
140
  vertical-align: top;
141
141
  }
142
142
 
@@ -83,7 +83,7 @@ export default{
83
83
  }
84
84
  .comp>*{
85
85
  @apply border-b-[2px] border-transparent;
86
- @apply p-2;
86
+ @apply p-2 px-3;
87
87
  }
88
88
  .comp>*[class*="active"]{
89
89
  @apply border-b-[2px] border-primary;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div :class="$style.comp" :style="computedStyle">
3
3
  <div :class="$style.head">
4
4
  <h2 v-if="title">{{ title }}</h2>
5
5
  <p v-if="description" v-html="description"></p>
@@ -32,7 +32,7 @@
32
32
 
33
33
  <script>
34
34
 
35
- import { componentMixin } from '../mixin/component';
35
+ import {componentMixin} from '../mixin/component';
36
36
  import dayjs from "dayjs";
37
37
 
38
38
  export default{
@@ -1,38 +1,26 @@
1
1
  <template>
2
- <div v-html="html" :class="$style.comp"></div>
2
+ <component :is="tag" v-html="htmlText2[$device.mediaIndex]"></component>
3
3
  </template>
4
4
 
5
5
  <script>
6
6
 
7
7
  import {componentMixin} from "../mixin/component";
8
- import {strVars} from "../utils/helpers.mjs";
9
8
 
10
9
  export default{
11
10
 
12
- computed: {
13
-
14
- html(){
15
- let text = this.htmlText2[this.$device.mediaIndex]
16
-
17
- if(this.editMode !== 'design' && this.data){
18
- text = strVars(text, this.data)
19
- }
20
-
21
- return text
22
- }
23
-
24
- },
25
-
26
11
  mixins: [ componentMixin ],
27
12
 
28
13
  props: {
29
14
 
15
+ tag: {
16
+ type: String,
17
+ default: 'div'
18
+ },
19
+
30
20
  htmlText2: {
31
21
  type: Array,
32
22
  default: () => []
33
- },
34
-
35
- data: Object
23
+ }
36
24
 
37
25
  }
38
26
 
@@ -42,8 +30,5 @@ export default{
42
30
 
43
31
  <style module>
44
32
 
45
- .comp{
46
- @apply whitespace-pre-wrap;
47
- }
48
33
 
49
34
  </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :class="$style.comp">
3
3
  <Textbox v-model="modelValue.text" @blur="$emit('change')" class="border-none"/>
4
- <div class="bg-base-300 flex flex-row gap-2 border-t-[1px] border-text-200 px-2">
4
+ <div class="bg-base-300 flex flex-row gap-2 border-t-[1px] border-border-200 px-2">
5
5
  <Dropdown v-model="modelValue.tagName" size="sm" variant="transparent">
6
6
  <option value="default">Default</option>
7
7
  <option value="h1">Heading 1</option>
@@ -79,7 +79,7 @@ export default{
79
79
  <style module>
80
80
 
81
81
  .comp{
82
- @apply flex flex-col border-[1px] border-text-200 bg-base-50 rounded-lg overflow-hidden;
82
+ @apply flex flex-col border-[1px] border-border-200 bg-base-300 rounded-lg overflow-hidden;
83
83
  }
84
84
 
85
- </style>
85
+ </style>
@@ -1,21 +1,23 @@
1
1
  <template>
2
- <div :class="$style.comp">
3
-
4
- <div class="flex flex-row items-start">
5
- <span contenteditable="true" spellcheck="false"
6
- ref="html"
7
- v-html="html"
8
- :class="`${$style.content}${itemClass ? ' ' + itemClass : ''}`"
9
- @blur="saveSelection($refs.html)"
10
- @paste="onPaste"
11
- @input="onInput"></span>
12
-
13
- <button v-if="variant === 'minimal'" type="button" class="p-3" @click="$refs.modal.open()">
14
- <svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg>
15
- </button>
2
+ <div :class="$style.comp" @click="log(modelValue)">
3
+
4
+ <div class="flex flex-row items-start">
5
+ <span :contenteditable="!readonly" spellcheck="false"
6
+ ref="html"
7
+ v-html="html"
8
+ :class="`${$style.content}${itemClass ? ' ' + itemClass : ''}`"
9
+ @blur="onBlur"
10
+ @paste="onPaste"
11
+ @input="onInput"></span>
12
+
13
+ <slot name="end" :comp="this">
14
+ <button v-if="variant === 'minimal' && !readonly" type="button" class="p-3" @click="$refs.modal.open()">
15
+ <svg width="14" height="14" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg>
16
+ </button>
17
+ </slot>
16
18
  </div>
17
19
 
18
- <div v-if="variant !== 'minimal'" class="flex flex-row bg-base-300" @dblclick.alt="log(JSON.stringify(modelValue))">
20
+ <div v-if="variant !== 'minimal' && !readonly" class="flex flex-row bg-base-300" @dblclick.alt="log(JSON.stringify(modelValue))">
19
21
  <div class="flex-1 flex flex-row gap-2 overflow-x-auto p-1" :class="$style.noScrollbar">
20
22
  <button type="button" v-for="item in viewedItems" :class="$style.tag2" class="text-xs" @click="add(item)">{{ item.text ?? item.value }}</button>
21
23
  </div>
@@ -57,7 +59,7 @@
57
59
 
58
60
  </div>
59
61
  </Modal>
60
- </div>
62
+ </div>
61
63
  </template>
62
64
 
63
65
  <script>
@@ -66,7 +68,7 @@ import {restoreSelection, saveSelection} from "../utils/selection";
66
68
 
67
69
  export default{
68
70
 
69
- emits: [ 'update:modelValue' ],
71
+ emits: [ 'blur', 'update:modelValue' ],
70
72
 
71
73
  props:{
72
74
 
@@ -76,7 +78,12 @@ export default{
76
78
 
77
79
  modelValue: String,
78
80
 
79
- items: Array,
81
+ items: {
82
+ type: Array,
83
+ default: () => []
84
+ },
85
+
86
+ readonly: Boolean,
80
87
 
81
88
  variant: String,
82
89
 
@@ -118,7 +125,7 @@ export default{
118
125
 
119
126
  let range = selection.getRangeAt(0);
120
127
  if(range.commonAncestorContainer.parentNode !== this.$refs.html &&
121
- range.commonAncestorContainer !== this.$refs.html) return
128
+ range.commonAncestorContainer !== this.$refs.html) return
122
129
 
123
130
  let currentNode = range.startContainer;
124
131
 
@@ -146,6 +153,10 @@ export default{
146
153
 
147
154
  this.insertElement(el)
148
155
  this.onInput()
156
+
157
+ const itemExists = this.items.find(_ => _.value === item.value)
158
+ if(!itemExists)
159
+ this.items.push(item)
149
160
  },
150
161
 
151
162
  add(item){
@@ -174,6 +185,11 @@ export default{
174
185
  e.target.parentNode.removeChild(e.target)
175
186
  },
176
187
 
188
+ onBlur(){
189
+ this.saveSelection(this.$refs.html)
190
+ this.$emit('blur')
191
+ },
192
+
177
193
  onPaste(e){
178
194
  e.preventDefault()
179
195
  const text = e.clipboardData.getData('text/plain')
@@ -205,8 +221,8 @@ export default{
205
221
 
206
222
  modelValue: {
207
223
  immediate: true,
208
- handler(val){
209
- if(this.isInternal){
224
+ handler(val) {
225
+ if (this.isInternal) {
210
226
  this.isInternal = false
211
227
  return
212
228
  }
@@ -214,7 +230,7 @@ export default{
214
230
  let html = val ?? ''
215
231
 
216
232
  let customItems = []
217
- if(typeof this.itemFn === 'function'){
233
+ if (typeof this.itemFn === 'function') {
218
234
  customItems = this.itemFn(html)
219
235
  }
220
236
 
@@ -223,8 +239,23 @@ export default{
223
239
  ...customItems
224
240
  ]
225
241
 
226
- for(let item of items){
227
- html = html.replaceAll(item.value, `<span title="${item.value.replaceAll('"', '')}" class="${this.$style.tag}" contenteditable="false" data-value="${item.value}">${item.text ?? item.value}</span>`, 'gi')
242
+ if(items.length === 0){
243
+ const match = html.match(/{{(.*?)}}/g)
244
+
245
+ if(match){
246
+ for(let tag of match){
247
+ items.push({
248
+ text: tag.replace(/{{(.*?)}}/, '$1').trim(),
249
+ value: tag
250
+ })
251
+ }
252
+ }
253
+ }
254
+
255
+ for (let item of items) {
256
+ html = html.replaceAll(item.value, `<span title="${item.value.replaceAll('"', '')}" ` +
257
+ `class="${this.$style.tag}" contenteditable="false" data-value="${item.value}">` +
258
+ `${item.text ?? item.value}</span>`, 'gi')
228
259
  }
229
260
 
230
261
  this.html = html
@@ -239,28 +270,28 @@ export default{
239
270
 
240
271
  <style module>
241
272
 
242
- .comp{
243
- @apply border-[1px] border-text-200 bg-base-50 rounded-lg min-w-[100px];
273
+ .comp {
274
+ @apply border-[1px] border-border-200 bg-base-300 rounded-lg min-w-[100px];
244
275
  @apply flex flex-col gap-2;
245
276
  @apply overflow-hidden;
246
277
  @apply divide-y divide-text-100;
247
278
  }
248
279
 
249
- .content{
280
+ .content {
250
281
  @apply flex-1 whitespace-pre-line outline-none p-2;
251
282
  }
252
283
 
253
- .comp .tag{
284
+ .comp .tag {
254
285
  @apply bg-text-100 p-1 rounded-lg whitespace-nowrap relative top-[-1px];
255
286
  @apply font-mono text-sm;
256
287
  }
257
288
 
258
- .tag2{
289
+ .tag2 {
259
290
  @apply bg-text-50 p-1 rounded-lg px-2 cursor-pointer whitespace-nowrap;
260
291
  @apply hover:bg-text-100 hover:text-white;
261
292
  }
262
293
 
263
- .noScrollbar::-webkit-scrollbar{
294
+ .noScrollbar::-webkit-scrollbar {
264
295
  display: none;
265
296
  }
266
297
 
@@ -144,7 +144,7 @@ export default{
144
144
 
145
145
  .textarea{
146
146
  @apply min-h-[var(--h-cp)];
147
- @apply flex items-start border-[1px] border-text-200 bg-base-500 rounded-lg overflow-hidden;
147
+ @apply flex items-start border-[1px] border-border-200 bg-base-400 rounded-lg overflow-hidden;
148
148
  @apply !max-h-[200px];
149
149
  }
150
150
  .textarea textarea{
@@ -155,36 +155,31 @@ export default{
155
155
  .textarea>textarea::-webkit-scrollbar{
156
156
  display: none;
157
157
  }
158
- .textarea>textarea::placeholder{
159
- @apply text-text-200;
160
- }
161
158
  .textarea.readonly{
162
159
  @apply bg-text-50;
163
160
  }
164
161
 
165
- .size-sm{ @apply min-h-[var(--h-cp-sm)]; }
166
- .size-sm textarea{ @apply text-sm; }
167
-
168
- .size-lg{ @apply min-h-[var(--h-cp-lg)]; }
169
- .size-lg textarea{ @apply text-lg p-2; }
170
-
171
-
172
162
  .active{
173
- @apply border-primary
163
+ @apply border-primary
174
164
  }
175
165
 
176
166
  .state--2{
177
- @apply border-red-500
167
+ @apply border-red-500
178
168
  }
179
169
 
180
170
  .align-left>input{
181
- @apply text-left
171
+ @apply text-left
182
172
  }
183
173
  .align-center>input{
184
- @apply text-center
174
+ @apply text-center
185
175
  }
186
176
  .align-right>input{
187
- @apply text-right
177
+ @apply text-right
188
178
  }
189
179
 
180
+ .size-sm textarea{ @apply text-sm; }
181
+
182
+ .size-lg{ @apply min-h-[var(--h-cp-lg)]; }
183
+ .size-lg textarea{ @apply text-lg p-2; }
184
+
190
185
  </style>
@@ -9,7 +9,7 @@
9
9
  :value="displayedValue" :readonly="Boolean(readonly)" @paste="onPaste"
10
10
  :class="itemClass" @click="$emit('input-click')"
11
11
  @keydown="onKeyDown"/>
12
- <button class="mr-2" v-if="Boolean(clearable) && !Boolean(readonly) && state >= 1 && modelValue" type="button" @click="$emit('clear')">
12
+ <button class="mr-2" v-show="Boolean(clearable) && !Boolean(readonly) && state >= 1 && modelValue" type="button" @click="$emit('clear')">
13
13
  <svg :class="$style.svg" width="19" height="19" viewBox="0 0 24 24" class="fill-text-200 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
14
14
  <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"/>
15
15
  </svg>
@@ -53,6 +53,7 @@ export default{
53
53
 
54
54
  placeholder: String,
55
55
  readonly: undefined,
56
+ disabled: undefined,
56
57
  maxlength: {
57
58
  type: [ String, Number ],
58
59
  default: 255
@@ -72,9 +73,9 @@ export default{
72
73
  computedClass(){
73
74
  return [
74
75
  this.$style.textbox,
75
- this.$style['variant-' + this.variant],
76
76
  this.$style['state-' + this.computedState],
77
77
  this.readonly ? this.$style.readonly : '',
78
+ this.disabled ? this.$style.disabled : '',
78
79
  this.isActive && !this.readonly ? this.$style.active : '',
79
80
  this.align ? this.$style['align-' + this.align] : '',
80
81
  this.size ? this.$style['size-' + this.size] : ''
@@ -182,25 +183,18 @@ export default{
182
183
 
183
184
  .textbox{
184
185
  @apply flex items-center;
185
- @apply border-[1px] border-text-200 bg-base-500 rounded-lg;
186
+ @apply border-[1px] border-border-200 bg-base-400 hover:border-border-300 rounded-lg;
186
187
  @apply overflow-hidden;
187
188
  }
188
-
189
- .textbox.readonly{
190
- @apply bg-text-50;
189
+ .textbox.active{
190
+ @apply !border-primary-600
191
191
  }
192
-
193
- .size-sm input{ @apply text-sm; }
194
-
195
-
196
192
  .textbox>input{
197
- @apply flex-1 outline-none p-2 bg-transparent;
198
- font-size: inherit;
193
+ @apply flex-1 outline-none p-2 bg-transparent;
194
+ font-size: inherit;
199
195
  }
200
196
 
201
- .active{
202
- @apply border-primary
203
- }
197
+ .size-sm input{ @apply text-sm; }
204
198
 
205
199
  .state--2{
206
200
  @apply border-red-500
@@ -219,8 +213,4 @@ export default{
219
213
  @apply text-right
220
214
  }
221
215
 
222
- .textbox.variant-minimal{
223
- @apply border-transparent;
224
- }
225
-
226
216
  </style>
@@ -1,27 +1,36 @@
1
1
  <template>
2
2
  <span :class="computedClass">
3
- <div>
4
- <slot></slot>
5
- </div>
6
- <div class="flex-1">
7
- <select @change="onChanged" ref="hour" :disabled="readonly">
3
+
4
+ <div class="w-[56px] flex flex-row items-center relative">
5
+ <select @change="onChanged" ref="hour" class="text-left w-full flex-1 px-3" :disabled="readonly">
8
6
  <option v-for="_hour in 24" :value="(_hour - 1).toString().padStart(2, '0')"
9
- :selected="(_hour - 1) === computedHour">
7
+ :selected="(_hour - 1) === computedHour">
10
8
  {{ (_hour - 1).toString().padStart(2, '0') }}
11
9
  </option>
12
10
  </select>
11
+
12
+ <div class="absolute top-0 bottom-0 right-0 p-2 flex justify-center items-center pointer-events-none">
13
+ <svg class="fill-text-300" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
14
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
15
+ </svg>
16
+ </div>
13
17
  </div>
14
- <div>
15
- <label>:</label>
16
- </div>
17
- <div class="flex-1">
18
- <select @change="onChanged" ref="minute" :disabled="readonly">
18
+
19
+ <div class="w-[56px] flex flex-row items-center relative">
20
+ <select @change="onChanged" ref="minute" class="text-left w-full flex-1 px-3" :disabled="readonly">
19
21
  <option v-for="_minute in 60" :value="(_minute - 1).toString().padStart(2, '0')"
20
- :selected="(_minute - 1) === computedMinute">
22
+ :selected="(_minute - 1) === computedMinute">
21
23
  {{ (_minute - 1).toString().padStart(2, '0') }}
22
24
  </option>
23
25
  </select>
26
+
27
+ <div class="absolute top-0 bottom-0 right-0 p-2 flex justify-center items-center pointer-events-none">
28
+ <svg class="fill-text-300" width="16" height="16" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
29
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967L11.8232 14.5126C11.9209 14.6102 12.0791 14.6102 12.1768 14.5126L17.9697 8.71967C18.2626 8.42677 18.7374 8.42677 19.0303 8.71967C19.3232 9.01256 19.3232 9.48743 19.0303 9.78033L13.2374 15.5732C12.554 16.2566 11.446 16.2566 10.7626 15.5732L4.96967 9.78033C4.67678 9.48744 4.67678 9.01256 4.96967 8.71967Z"/>
30
+ </svg>
31
+ </div>
24
32
  </div>
33
+
25
34
  </span>
26
35
  </template>
27
36
 
@@ -82,7 +91,9 @@ export default{
82
91
  <style module>
83
92
 
84
93
  .timepicker{
85
- @apply inline-flex flex-row items-center bg-base-50;
94
+ @apply inline-flex flex-row items-center;
95
+ @apply bg-base-400 border-[1px] border-border-200 rounded-lg;
96
+ @apply divide-x divide-border-50;
86
97
  }
87
98
 
88
99
  .timepicker label{
@@ -91,11 +102,10 @@ export default{
91
102
 
92
103
  .timepicker select{
93
104
  @apply w-full p-2 appearance-none bg-transparent outline-none;
94
- @apply border-[1px] border-text-200 rounded-lg;
95
105
  @apply text-center;
96
106
  }
97
107
  .timepicker:not(.readonly) select{
98
- @apply hover:border-text-300;
108
+ @apply hover:border-border-300;
99
109
  }
100
110
 
101
111
  .timepicker.timepicker-sm select{
@@ -83,8 +83,10 @@ export default{
83
83
  <style>
84
84
 
85
85
  .YWxl{
86
- @apply fixed top-0 left-0 right-0;
87
- z-index: 61;
86
+ @apply fixed top-0 w-full;
87
+ z-index: 150;
88
+ left: 50%;
89
+ transform: translate3d(-50%, 0, 0);
88
90
  }
89
91
 
90
92
  .YWxl-enter-active,
@@ -107,7 +109,7 @@ export default{
107
109
 
108
110
  .item{
109
111
  @apply flex p-3 gap-4;
110
- @apply max-w-[90vw] md:max-w-[480px] bg-base-500 mx-auto rounded-xl border-[1px] border-text-100;
112
+ @apply max-w-[90vw] md:max-w-[480px] bg-base-500 mx-auto rounded-xl border-[1px] border-border-100;
111
113
  @apply min-h-[var(--h-cp)];
112
114
  z-index: 61;
113
115
  }
@@ -0,0 +1,122 @@
1
+ <template>
2
+ <div :class="$style.el">
3
+
4
+ <div v-for="(menu, index) in value" class="flex flex-row gap-1">
5
+
6
+ <button v-if="menu.items"
7
+ :ref="`btn-${index}`"
8
+ class="p-2 px-6 flex items-center"
9
+ type="button"
10
+ @click="openSubmenu1(`${index}`)">
11
+ {{ menu.text }}
12
+ <svg class="fill-text-300 pointer-events-none" height="19" viewBox="0 0 24 24" width="19" xmlns="http://www.w3.org/2000/svg"><path class="secondary" d="M15.3 10.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z" fill-rule="evenodd"/></svg>
13
+ </button>
14
+
15
+ <router-link v-else :to="menu.target" class="p-2 px-6">
16
+ {{ menu.text }}
17
+ </router-link>
18
+
19
+ <ContextMenu class="rounded-none bg-base-300"
20
+ @dismiss="submenu1State = null"
21
+ :ref="`menu-${index}`">
22
+ <div class="divide-y divide-border-50 min-w-[200px] flex flex-col">
23
+ <div v-for="(submenu, submenuIndex) in menu.items"
24
+ class="flex-1 flex flex-col">
25
+
26
+ <div v-if="submenu.items" class="flex flex-col menu-item"
27
+ :ref="`btn-${index}-${submenuIndex}`"
28
+ @click.stop
29
+ @mouseover="openSubmenu2(`${index}-${submenuIndex}`)">
30
+ <div class="flex flex-row items-center p-3 px-4 pr-2">
31
+ <div class="flex-1">
32
+ {{ submenu.text }}
33
+ </div>
34
+ <svg class="fill-text-300" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg">
35
+ <path clip-rule="evenodd" d="M8.21967 19.0303C7.92678 18.7374 7.92678 18.2626 8.21967 17.9697L14.0126 12.1768C14.1102 12.0791 14.1102 11.9209 14.0126 11.8232L8.21967 6.03033C7.92678 5.73744 7.92678 5.26256 8.21967 4.96967C8.51256 4.67678 8.98744 4.67678 9.28033 4.96967L15.0732 10.7626C15.7566 11.446 15.7566 12.554 15.0732 13.2374L9.28033 19.0303C8.98744 19.3232 8.51256 19.3232 8.21967 19.0303Z" fill-rule="evenodd" />
36
+ </svg>
37
+ </div>
38
+ </div>
39
+
40
+ <router-link v-else :to="submenu.target" class="p-3 px-6 menu-item">
41
+ {{ submenu.text }}
42
+ </router-link>
43
+
44
+ <ContextMenu :ref="`menu-${index}-${submenuIndex}`" class="rounded-none bg-base-300" position="right">
45
+ <div class="divide-y divide-border-50 min-w-[200px] flex flex-col">
46
+ <div v-for="(submenu2, submenuIndex) in submenu.items" class="flex-1 flex flex-col">
47
+ <div v-if="submenu2.items" class="flex flex-col menu-item">
48
+ <div class="flex flex-row items-center p-3 px-4 pr-2">
49
+ <div class="flex-1">
50
+ {{ submenu2.text }}
51
+ </div>
52
+ <svg class="fill-text-300" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg">
53
+ <path clip-rule="evenodd" d="M8.21967 19.0303C7.92678 18.7374 7.92678 18.2626 8.21967 17.9697L14.0126 12.1768C14.1102 12.0791 14.1102 11.9209 14.0126 11.8232L8.21967 6.03033C7.92678 5.73744 7.92678 5.26256 8.21967 4.96967C8.51256 4.67678 8.98744 4.67678 9.28033 4.96967L15.0732 10.7626C15.7566 11.446 15.7566 12.554 15.0732 13.2374L9.28033 19.0303C8.98744 19.3232 8.51256 19.3232 8.21967 19.0303Z" fill-rule="evenodd" />
54
+ </svg>
55
+ </div>
56
+ </div>
57
+ <router-link v-else :to="submenu2.target" class="p-3 px-6 menu-item">
58
+ {{ submenu2.text }}
59
+ </router-link>
60
+ </div>
61
+ </div>
62
+ </ContextMenu>
63
+
64
+ </div>
65
+ </div>
66
+ </ContextMenu>
67
+ </div>
68
+
69
+ </div>
70
+ </template>
71
+
72
+ <script>
73
+
74
+ export default {
75
+
76
+ props: {
77
+
78
+ value: Array
79
+
80
+ },
81
+
82
+ methods: {
83
+
84
+ openSubmenu1(id){
85
+ if(this.submenu1State)
86
+ this.$refs['menu-' + this.submenu1State][0].close()
87
+
88
+ this.$refs['menu-' + id][0].open(this.$refs['btn-' + id][0])
89
+ this.submenu1State = id
90
+ },
91
+
92
+ openSubmenu2(id){
93
+ if(this.submenu2State)
94
+ this.$refs['menu-' + this.submenu2State][0].close()
95
+
96
+ if(this.submenu1State !== id.split('-')[0])
97
+ return
98
+
99
+ this.$refs['menu-' + id][0].open(this.$refs['btn-' + id][0])
100
+ this.submenu2State = id
101
+ }
102
+
103
+ },
104
+
105
+ data(){
106
+ return {
107
+ submenu1State: null,
108
+ submenu2State: null
109
+ }
110
+ }
111
+
112
+ }
113
+
114
+ </script>
115
+
116
+ <style module>
117
+
118
+ .el{
119
+ @apply flex flex-row gap-1;
120
+ }
121
+
122
+ </style>