@mixd-id/web-scaffold 0.1.230406066 → 0.1.230406067

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406066",
4
+ "version": "0.1.230406067",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -2,7 +2,7 @@
2
2
  <div :class="$style.comp">
3
3
  <input :id="id" type="checkbox" :checked="checked" @change="onChange" :disabled="isDisabled"/>
4
4
  <label :for="id">
5
- <div :class="$style.indicator">
5
+ <div :class="$style.indicator" v-if="Boolean(showIcon)">
6
6
  <Transition name="checkbox">
7
7
  <div v-if="checked">
8
8
  <svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.2.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M470.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 338.7 425.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
@@ -25,7 +25,11 @@ export default {
25
25
  value: undefined,
26
26
  trueValue: undefined,
27
27
  falseValue: undefined,
28
- disabled: undefined
28
+ disabled: undefined,
29
+ showIcon: {
30
+ type: undefined,
31
+ default: true
32
+ }
29
33
  },
30
34
 
31
35
  computed: {
@@ -0,0 +1,62 @@
1
+ <template>
2
+ <div :class="$style.comp">
3
+ <div class="flex flex-row bg-text-50 p-2">
4
+ <div class="flex-1">&nbsp;</div>
5
+ </div>
6
+ <code v-html="modelValue" contenteditable="true" spellcheck="false"
7
+ @paste="onPaste"></code>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+
13
+ export default{
14
+
15
+ props:{
16
+
17
+ modelValue: String
18
+
19
+ },
20
+
21
+ methods: {
22
+
23
+ beautify(){
24
+ const html = JSON.parse(JSON.stringify(this.modelValue, null, 2))
25
+ console.log(html)
26
+ this.$emit('update:modelValue', html)
27
+ },
28
+
29
+ onPaste(e) {
30
+ e.preventDefault()
31
+
32
+ let text = (e.clipboardData || window.clipboardData).getData("text");
33
+ const el = document.createElement('div')
34
+ el.innerHTML = text
35
+ text = el.innerText
36
+
37
+ this.$emit('update:modelValue', text)
38
+ }
39
+
40
+ }
41
+
42
+ }
43
+
44
+ </script>
45
+
46
+ <style module>
47
+
48
+ .comp{
49
+ @apply border-text-50 border-[1px] rounded-lg overflow-hidden flex flex-col;
50
+ }
51
+
52
+ .comp code{
53
+ @apply p-6 bg-base-300;
54
+ white-space: pre-wrap;
55
+ tab-size: 1rem;
56
+ }
57
+
58
+ .comp [contenteditable]{
59
+ outline: 0px solid transparent;
60
+ }
61
+
62
+ </style>
@@ -228,7 +228,7 @@ export default{
228
228
  },
229
229
 
230
230
  mounted() {
231
- this.html = this.modelValue
231
+ this.update()
232
232
  },
233
233
 
234
234
  methods: {
@@ -431,6 +431,10 @@ export default{
431
431
  this.updateModelValue()
432
432
  },
433
433
 
434
+ update(){
435
+ this.html = this.modelValue
436
+ },
437
+
434
438
  updateModelValue(){
435
439
 
436
440
  let html = this.$refs.article.innerHTML
@@ -144,7 +144,7 @@ export default{
144
144
 
145
145
  methods: {
146
146
 
147
- open(context){
147
+ open(context = {}){
148
148
  this.context = context
149
149
  this._state = true
150
150
  },
@@ -15,6 +15,8 @@ import {parseBoolean} from "../utils/helpers.mjs";
15
15
 
16
16
  export default{
17
17
 
18
+ emits: [ 'change' ],
19
+
18
20
  props:{
19
21
  name: String,
20
22
  checked: undefined,
@@ -44,6 +46,7 @@ export default{
44
46
  onChange(){
45
47
  if(this.isDisabled) return
46
48
  this.$emit('update:modelValue', this.value)
49
+ this.$emit('change')
47
50
  }
48
51
 
49
52
  }
package/src/index.js CHANGED
@@ -248,6 +248,7 @@ export default{
248
248
  app.component('ButtonGroup', defineAsyncComponent(() => import("./components/ButtonGroup.vue")))
249
249
  app.component('ChatTyping', defineAsyncComponent(() => import("./components/ChatTyping.vue")))
250
250
  app.component('Checkbox', defineAsyncComponent(() => import("./components/Checkbox.vue")))
251
+ app.component('CodeEditor', defineAsyncComponent(() => import("./components/CodeEditor.vue")))
251
252
  app.component('CopyToClipboard', defineAsyncComponent(() => import("./components/CopyToClipboard.vue")))
252
253
  app.component('Countdown', defineAsyncComponent(() => import("./components/Countdown.vue")))
253
254
  app.component('Datepicker', defineAsyncComponent(() => import("./components/Datepicker.vue")))
@@ -296,9 +297,9 @@ export default{
296
297
  app.component('VirtualScroll', defineAsyncComponent(() => import("./components/VirtualScroll.vue")))
297
298
  app.component('VirtualTable', defineAsyncComponent(() => import("./components/VirtualTable.vue")))
298
299
  app.component('Slider', defineAsyncComponent(() => import("./components/Slider.vue")))
300
+ app.component('SplitPane', defineAsyncComponent(() => import("./components/SplitPane.vue")))
299
301
  app.component('TabView', defineAsyncComponent(() => import("./components/TabView.vue")))
300
302
  app.component('TextEditor', defineAsyncComponent(() => import("./components/TextEditor.vue")))
301
- app.component('SplitPane', defineAsyncComponent(() => import("./components/SplitPane.vue")))
302
303
 
303
304
 
304
305
  }