@mixd-id/web-scaffold 0.1.230406279 → 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.230406279",
4
+ "version": "0.1.230406281",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -212,7 +212,7 @@ export default{
212
212
  }
213
213
 
214
214
  .title{
215
- @apply whitespace-nowrap overflow-hidden;
215
+ @apply text-center;
216
216
  }
217
217
 
218
218
  .details{
@@ -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
@@ -574,6 +574,12 @@ const chartToSequelizeWhere = async (chart, opt) => {
574
574
  order = literal(`DATE_FORMAT(${model.name}.${field}, \"%Y-%m-%d\")`)
575
575
  break
576
576
 
577
+ case 'hour':
578
+ attributes.push([literal(`DATE_FORMAT(${model.name}.${field}, "%H")`), xAxis[0].key])
579
+ group.push(literal(`DATE_FORMAT(${model.name}.${field}, "%H")`))
580
+ order = literal(`DATE_FORMAT(${model.name}.${field}, \"%H\")`)
581
+ break
582
+
577
583
  default:
578
584
  attributes.push([literal(`${model.name}.${field}`), xAxe.key])
579
585
  group.push(literal(`${model.name}.${field}`))
@@ -20,21 +20,12 @@ const sortsFn = function(a, b, sorts, index){
20
20
  }
21
21
 
22
22
  const pickColumns = function(columns, keys){
23
- if(!Array.isArray(columns)) return keys
23
+ if(!Array.isArray(columns)) return []
24
24
 
25
- const picked = []
25
+ const picked = JSON.parse(JSON.stringify(columns))
26
26
 
27
- const groupedColumns = columns
28
- .reduce((acc, column) => {
29
- acc[column.key] = column
30
- return acc
31
- }, {})
32
-
33
- for(let key of keys){
34
- if(groupedColumns[key]){
35
- groupedColumns[key].visible = true
36
- picked.push(groupedColumns[key])
37
- }
27
+ for(let idx in picked){
28
+ picked[idx].visible = keys.includes(picked[idx].key)
38
29
  }
39
30
 
40
31
  return picked
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div :class="$style.comp" v-if="config">
3
3
 
4
- <TransitionGroup name="openltr" tag="div">
4
+ <TransitionGroup name="openltr" tag="div" class="flex-1 flex">
5
5
 
6
6
  <div v-if="$route.hash.indexOf(this.editHash) < 0" key="panel1" class="flex-1 flex flex-col">
7
7
 
@@ -274,6 +274,7 @@
274
274
  @change="apply()">
275
275
  <option value="none">None</option>
276
276
  <option value="date">Date</option>
277
+ <option value="hour">Hour</option>
277
278
  </Dropdown>
278
279
  </div>
279
280
  <button type="button" @click="xAxis.splice(index, 1); apply()">
@@ -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