@mixd-id/web-scaffold 0.1.230406102 → 0.1.230406104

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.230406102",
4
+ "version": "0.1.230406104",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -11,6 +11,8 @@
11
11
  "exports": {
12
12
  ".": "./src/index.js",
13
13
  "./themes/default": "./src/themes/default/index.js",
14
+ "./components/Modal2.vue": "./src/components/Modal2.vue",
15
+ "./components/Textbox.vue": "./src/components/Textbox.vue",
14
16
  "./mixin/component": "./src/mixin/component.js",
15
17
  "./mixin/edit-mode": "./src/mixin/edit-mode.js",
16
18
  "./helpers": {
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <div>
3
3
  <Teleport to=".bW9k">
4
- <Transition :name="transition" @after-leave="onAfterLeave" @after-enter="$emit('show')">
4
+ <Transition :name="transition"
5
+ appear
6
+ @after-leave="onAfterLeave"
7
+ @after-enter="$emit('show')">
5
8
  <div v-if="computedState" :class="computedClass" ref="modal" :style="computedStyle"
6
9
  :data-state="computedState ? 1 : 0">
7
10
  <form v-if="useForm" @submit.prevent="$emit('submit')">
@@ -122,25 +125,18 @@ export default{
122
125
  watch:{
123
126
 
124
127
  computedState(to, from){
125
-
126
- if(to){
127
- let overlay = document.querySelector('.bW9k')
128
- if(overlay){
129
- overlay.classList.add('bW9l')
130
- }
131
-
132
- registerModal(this)
133
- }
134
- else{
135
- unRegisterModal(this)
136
- }
128
+ this.setState(to)
137
129
  }
138
130
 
139
131
  },
140
132
 
141
133
  mounted() {
142
134
  document.querySelector('.bW9k').addEventListener('click', this.onDismiss)
143
- window,addEventListener('keydown', this.onKeyDown)
135
+ window.addEventListener('keydown', this.onKeyDown)
136
+
137
+ if(this.computedState){
138
+ this.setState(this.computedState)
139
+ }
144
140
  },
145
141
 
146
142
  methods: {
@@ -184,6 +180,20 @@ export default{
184
180
  if(this.dismissable && this.$refs.modal && e.keyCode === 27){
185
181
  this.$emit('dismiss')
186
182
  }
183
+ },
184
+
185
+ setState(to){
186
+ if(to){
187
+ let overlay = document.querySelector('.bW9k')
188
+ if(overlay){
189
+ overlay.classList.add('bW9l')
190
+ }
191
+
192
+ registerModal(this)
193
+ }
194
+ else{
195
+ unRegisterModal(this)
196
+ }
187
197
  }
188
198
  }
189
199
 
@@ -121,29 +121,18 @@ export default{
121
121
  watch:{
122
122
 
123
123
  computedState(to, from){
124
-
125
- if(to){
126
- let overlay = document.querySelector('.bW9k')
127
- if(overlay){
128
- overlay.classList.add('bW9l')
129
- }
130
-
131
- this.$emit('show')
132
- registerModal(this)
133
- }
134
- else{
135
- this.$nextTick(() => {
136
- this.onAfterLeave()
137
- unRegisterModal(this)
138
- })
139
- }
124
+ this.setState(to)
140
125
  }
141
126
 
142
127
  },
143
128
 
144
129
  mounted() {
145
130
  document.querySelector('.bW9k').addEventListener('click', this.onDismiss)
146
- window,addEventListener('keydown', this.onKeyDown)
131
+ window.addEventListener('keydown', this.onKeyDown)
132
+
133
+ if(this.computedState){
134
+ this.setState(this.computedState)
135
+ }
147
136
  },
148
137
 
149
138
  methods: {
@@ -187,6 +176,24 @@ export default{
187
176
  if(this.dismissable && this.$refs.modal && e.keyCode === 27){
188
177
  this.$emit('dismiss')
189
178
  }
179
+ },
180
+
181
+ setState(to){
182
+ if(to){
183
+ let overlay = document.querySelector('.bW9k')
184
+ if(overlay){
185
+ overlay.classList.add('bW9l')
186
+ }
187
+
188
+ this.$emit('show')
189
+ registerModal(this)
190
+ }
191
+ else{
192
+ this.$nextTick(() => {
193
+ this.onAfterLeave()
194
+ unRegisterModal(this)
195
+ })
196
+ }
190
197
  }
191
198
  }
192
199
 
@@ -187,7 +187,8 @@ export default{
187
187
  .size-lg{ @apply min-h-[var(--h-cp-lg)]; }
188
188
 
189
189
  .textbox>input{
190
- @apply flex-1 outline-none p-2 bg-transparent
190
+ @apply flex-1 outline-none p-2 bg-transparent;
191
+ font-size: inherit;
191
192
  }
192
193
 
193
194
  .active{
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="$style.comp">
2
+ <div class="grid">
3
3
  <div v-for="(icon, index) in icons" :key="index" class="text-center p-3">
4
4
  <router-link :to="icon.target ?? ''">
5
5
  <Image :src="imageUrl(icon)" class="inline-block aspect-square w-[90%] md:w-[95%] max-w-[64px] rounded-xl"