@mixd-id/web-scaffold 0.1.230406392 → 0.1.230406394
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
|
<template>
|
|
2
2
|
<div :class="$style.comp">
|
|
3
3
|
|
|
4
|
-
<div class="overflow-x-auto bg-text-50">
|
|
4
|
+
<div class="overflow-x-auto bg-text-50" :class="containerClass">
|
|
5
5
|
<div class="flex flex-row">
|
|
6
6
|
<button class="p-3" type="button" @click="format('bold')">
|
|
7
7
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path d="M0 64C0 46.3 14.3 32 32 32H80 96 224c70.7 0 128 57.3 128 128c0 31.3-11.3 60.1-30 82.3c37.1 22.4 62 63.1 62 109.7c0 70.7-57.3 128-128 128H96 80 32c-17.7 0-32-14.3-32-32s14.3-32 32-32H48V256 96H32C14.3 96 0 81.7 0 64zM224 224c35.3 0 64-28.7 64-64s-28.7-64-64-64H112V224H224zM112 288V416H256c35.3 0 64-28.7 64-64s-28.7-64-64-64H224 112z"/></svg>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<button class="p-3" type="button" ref="listBtn" @click="$refs.listContext.open($refs.listBtn)">
|
|
22
22
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M64 144c26.5 0 48-21.5 48-48s-21.5-48-48-48S16 69.5 16 96s21.5 48 48 48zM192 64c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H192zM64 464c26.5 0 48-21.5 48-48s-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48zm48-208c0-26.5-21.5-48-48-48s-48 21.5-48 48s21.5 48 48 48s48-21.5 48-48z"/></svg>
|
|
23
23
|
</button>
|
|
24
|
-
<button class="p-3" type="button" @click="createImage">
|
|
24
|
+
<button v-if="uploadImage" class="p-3" type="button" @click="createImage">
|
|
25
25
|
<svg width="14" height="14" class="fill-text-400 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M152 120c-26.51 0-48 21.49-48 48s21.49 48 48 48s48-21.49 48-48S178.5 120 152 120zM447.1 32h-384C28.65 32-.0091 60.65-.0091 96v320c0 35.35 28.65 64 63.1 64h384c35.35 0 64-28.65 64-64V96C511.1 60.65 483.3 32 447.1 32zM463.1 409.3l-136.8-185.9C323.8 218.8 318.1 216 312 216c-6.113 0-11.82 2.768-15.21 7.379l-106.6 144.1l-37.09-46.1c-3.441-4.279-8.934-6.809-14.77-6.809c-5.842 0-11.33 2.529-14.78 6.809l-75.52 93.81c0-.0293 0 .0293 0 0L47.99 96c0-8.822 7.178-16 16-16h384c8.822 0 16 7.178 16 16V409.3z"/></svg>
|
|
26
26
|
</button>
|
|
27
27
|
<button class="p-3" type="button" @click="createLink">
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
|
|
37
37
|
<article ref="article" contenteditable="true" v-html="html" @paste="onPaste" spellcheck="false"
|
|
38
|
-
@input="onInput" @click="onClick"
|
|
38
|
+
@input="onInput" @click="onClick" :class="containerClass"
|
|
39
39
|
@blur="onBlur">
|
|
40
40
|
</article>
|
|
41
41
|
|
|
@@ -258,7 +258,9 @@ export default{
|
|
|
258
258
|
|
|
259
259
|
props:{
|
|
260
260
|
modelValue: String,
|
|
261
|
-
uploadImage: String
|
|
261
|
+
uploadImage: String,
|
|
262
|
+
containerClass: String,
|
|
263
|
+
itemClass: String,
|
|
262
264
|
},
|
|
263
265
|
|
|
264
266
|
computed: {
|
package/src/components/List.vue
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<div class="p-3 flex flex-col gap-1 bg-base-300">
|
|
58
58
|
<button v-for="(preset, idx) in config.presets"
|
|
59
59
|
class="p-2 px-5 text-left flex flex-row items-center rounded-md"
|
|
60
|
-
:class="
|
|
60
|
+
:class="configParams.presetIdx === preset.uid ? 'bg-primary-200 text-white' : 'hover:bg-primary-100'"
|
|
61
61
|
type="button"
|
|
62
62
|
@click="selectPreset(idx)">
|
|
63
63
|
<label class="flex-1 pr-12">
|
|
@@ -546,9 +546,11 @@ export default{
|
|
|
546
546
|
selectPreset(idx){
|
|
547
547
|
if(this.config.presets[idx]){
|
|
548
548
|
this.configParams.presetIdx = this.config.presets[idx].uid
|
|
549
|
+
console.log('idx', this.config.presets)
|
|
550
|
+
console.log('idx', idx, this.configParams.presetIdx)
|
|
549
551
|
this.load()
|
|
550
|
-
this.$refs.presetSelector
|
|
551
|
-
this.$refs.contextMenu
|
|
552
|
+
this.$refs.presetSelector?.close()
|
|
553
|
+
this.$refs.contextMenu?.close()
|
|
552
554
|
}
|
|
553
555
|
},
|
|
554
556
|
|
package/src/components/Modal.vue
CHANGED
|
@@ -141,11 +141,14 @@ export default{
|
|
|
141
141
|
close(){
|
|
142
142
|
if(this.hash){
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
let hash = this.$route.hash
|
|
145
145
|
.split('#')
|
|
146
146
|
.filter(_ => _.length > 0 && !_.startsWith(this.hash.substring(1)))
|
|
147
147
|
.join('#')
|
|
148
148
|
|
|
149
|
+
if(hash.substring(0, 1) !== '#')
|
|
150
|
+
hash = '#' + hash
|
|
151
|
+
|
|
149
152
|
this.$router.replace({
|
|
150
153
|
...this.$route,
|
|
151
154
|
hash
|
package/src/utils/helpers.js
CHANGED
|
@@ -536,16 +536,20 @@ function capitalize(str) {
|
|
|
536
536
|
}
|
|
537
537
|
|
|
538
538
|
const removeUnderscoredKey = (obj) => {
|
|
539
|
-
if(
|
|
539
|
+
if (Array.isArray(obj)) {
|
|
540
|
+
return obj.map(removeUnderscoredKey);
|
|
541
|
+
}
|
|
542
|
+
else if (obj !== null && typeof obj === 'object') {
|
|
540
543
|
for(let key in obj){
|
|
541
544
|
if(key.startsWith('_')){
|
|
542
545
|
delete obj[key]
|
|
543
546
|
}
|
|
544
|
-
else if(Array.isArray(obj[key])){
|
|
545
|
-
obj[key]
|
|
547
|
+
else if(Array.isArray(obj[key]) || (obj[key] !== null && typeof obj[key] === 'object')){
|
|
548
|
+
removeUnderscoredKey(obj[key])
|
|
546
549
|
}
|
|
547
550
|
}
|
|
548
551
|
}
|
|
552
|
+
return obj;
|
|
549
553
|
}
|
|
550
554
|
|
|
551
555
|
const hashMake = async (text) => {
|
|
@@ -202,8 +202,9 @@ const generateTotalColumns = (preset, items) => {
|
|
|
202
202
|
items.push(totalItem)
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
let presetUidSalt = 0
|
|
205
206
|
const getPresetUid = function(extra = ''){
|
|
206
|
-
return md5('preset-' + new Date().getTime() + extra)
|
|
207
|
+
return md5('preset-' + new Date().getTime() + extra + (++presetUidSalt))
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
export {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
<div class="flex flex-col bg-base-300 border-t-[1px] border-b-[1px] border-text-50 divide-y divide-text-50">
|
|
56
56
|
<div v-for="(preset, idx) in config.presets"
|
|
57
57
|
class="px-6 text-left hover:bg-primary-200 hover:text-white flex flex-row items-center">
|
|
58
|
-
<div class="flex-1 py-4" @click="select(
|
|
58
|
+
<div class="flex-1 py-4" @click="select(preset)">
|
|
59
59
|
{{ preset.name }}
|
|
60
60
|
</div>
|
|
61
61
|
<button type="button"
|
|
@@ -479,6 +479,18 @@ export default{
|
|
|
479
479
|
|
|
480
480
|
computed: {
|
|
481
481
|
|
|
482
|
+
configParams(){
|
|
483
|
+
if(!this.config.params)
|
|
484
|
+
this.config.params = {}
|
|
485
|
+
|
|
486
|
+
if(this.config.presets.length > 0 &&
|
|
487
|
+
(!this.config.params.presetIdx ||
|
|
488
|
+
!this.config.presets.find(_ => _.uid === this.config.params.presetIdx)))
|
|
489
|
+
this.config.params.presetIdx = this.config.presets[0].uid
|
|
490
|
+
|
|
491
|
+
return this.config.params
|
|
492
|
+
},
|
|
493
|
+
|
|
482
494
|
filterColumns(){
|
|
483
495
|
return JSON.parse(JSON.stringify(this.config.columns ?? []))
|
|
484
496
|
.filter(_ => !('filterable' in _) || _.filterable)
|
|
@@ -641,8 +653,8 @@ export default{
|
|
|
641
653
|
})
|
|
642
654
|
},
|
|
643
655
|
|
|
644
|
-
select(
|
|
645
|
-
this.
|
|
656
|
+
select(item){
|
|
657
|
+
this.configParams.presetIdx = item.uid
|
|
646
658
|
this.close()
|
|
647
659
|
this.$emit('select')
|
|
648
660
|
},
|