@mixd-id/web-scaffold 0.1.230406280 → 0.1.230406281

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.230406280",
4
+ "version": "0.1.230406281",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div :class="computedClass">
3
3
  <slot name="start"></slot>
4
- <textarea :maxlength="maxlength"
5
- :placeholder="placeholder" :rows="rows" ref="input" @focus="isActive = true" @blur="onBlur" @input="onInput"
4
+ <textarea :maxlength="maxlength" :class="itemClass"
5
+ :placeholder="placeholder" :rows="computedRows" ref="input" @focus="isActive = true" @blur="onBlur" @input="onInput"
6
6
  :value="modelValue" :readonly="Boolean(readonly)" />
7
7
  <div v-if="state === -2 && !!(errors)">
8
8
  <svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
@@ -39,11 +39,6 @@ export default{
39
39
  default: ''
40
40
  },
41
41
 
42
- size: {
43
- type: String,
44
- default: ''
45
- },
46
-
47
42
  errors:{
48
43
  type: [ String, Array ],
49
44
  default: ''
@@ -51,6 +46,8 @@ export default{
51
46
 
52
47
  modelValue: [ String, Number ],
53
48
 
49
+ itemClass: String,
50
+
54
51
  placeholder: String,
55
52
 
56
53
  readonly: undefined,
@@ -67,8 +64,8 @@ export default{
67
64
  this.$emit('update:modelValue', to)
68
65
  this.$emit('change', to)
69
66
  this.$nextTick(() => {
70
- this.$el.style.height = '';
71
- this.$el.style.height = this.$refs.input.scrollHeight + 'px'
67
+ this.$refs.input.style.height = '';
68
+ this.$refs.input.style.height = this.$refs.input.scrollHeight + 'px'
72
69
  })
73
70
  }
74
71
 
@@ -94,10 +91,13 @@ export default{
94
91
  this.isActive && !this.readonly ? this.$style.active : '',
95
92
  this.align ? this.$style['align-' + this.align] : '',
96
93
  this.readonly ? this.$style.readonly : '',
97
- this.size ? this.$style['size-' + this.size] : ''
98
94
  ].join(' ')
99
95
  },
100
96
 
97
+ computedRows(){
98
+ return 1
99
+ },
100
+
101
101
  isDisabled(){
102
102
 
103
103
  }
@@ -138,12 +138,12 @@ export default{
138
138
 
139
139
  .textarea{
140
140
  @apply flex items-start border-[1px] border-text-200 bg-base-500 rounded-lg overflow-hidden;
141
- @apply !max-h-[200px];
142
141
  }
143
142
  .textarea textarea{
144
143
  @apply flex-1 outline-none p-2 bg-transparent resize-none;
145
144
  @apply self-stretch;
146
145
  scrollbar-width: none;
146
+ @apply !max-h-[200px];
147
147
  }
148
148
  .textarea>textarea::-webkit-scrollbar{
149
149
  display: none;
@@ -155,12 +155,6 @@ export default{
155
155
  @apply bg-text-50;
156
156
  }
157
157
 
158
- .size-sm{ @apply min-h-[var(--h-cp-sm)]; }
159
- .size-sm textarea{ @apply text-sm; }
160
-
161
- .size-lg{ @apply min-h-[var(--h-cp-lg)]; }
162
- .size-lg textarea{ @apply text-lg p-2; }
163
-
164
158
 
165
159
  .active{
166
160
  @apply border-primary
@@ -153,7 +153,7 @@
153
153
  <div class="w-[200px] border-r-[1px] border-text-50 overflow-y-auto">
154
154
 
155
155
  <div class="flex flex-col divide-y divide-text-50 border-b-[1px] border-text-50">
156
- <button v-for="column in sortedConfigColumns"
156
+ <button v-for="column in filterColumns"
157
157
  type="button"
158
158
  :disabled="filterColumnAdded(column)"
159
159
  class="px-6 py-3 text-left flex flex-row items-center gap-2"
@@ -478,8 +478,9 @@ export default{
478
478
 
479
479
  computed: {
480
480
 
481
- sortedConfigColumns(){
481
+ filterColumns(){
482
482
  return JSON.parse(JSON.stringify(this.config.columns ?? []))
483
+ .filter(_ => !('filterable' in _) || _.filterable)
483
484
  .sort((a, b) => (a.label ?? a.key).localeCompare(b.label ?? b.key))
484
485
  },
485
486
 
@@ -632,12 +633,10 @@ export default{
632
633
  return
633
634
  }
634
635
 
635
- this.confirm('Remove this preset?', {
636
- onConfirm: () => {
637
- this.config.presets.splice(idx, 1)
638
- if(this.config.presetIdx >= this.config.presets.length)
639
- this.config.presetIdx = this.config.presets.length - 1
640
- }
636
+ this.confirm('Remove this preset?', () => {
637
+ this.config.presets.splice(idx, 1)
638
+ if(this.config.presetIdx >= this.config.presets.length)
639
+ this.config.presetIdx = this.config.presets.length - 1
641
640
  })
642
641
  },
643
642