@veritree/ui 0.82.0-1 → 0.82.0-10

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.
@@ -33,6 +33,10 @@ export const formControlMixin = {
33
33
  type: String,
34
34
  default: 'large',
35
35
  },
36
+ min: {
37
+ type: [String, Number],
38
+ default: null,
39
+ },
36
40
  },
37
41
 
38
42
  computed: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/ui",
3
- "version": "0.82.0-1",
3
+ "version": "0.82.0-10",
4
4
  "description": "veritree ui library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,18 +1,5 @@
1
1
  <template>
2
- <VTImage
3
- v-if="src"
4
- :src="src"
5
- v-bind="attrs"
6
- :width="width"
7
- :height="height"
8
- />
9
- <VTImage
10
- v-else-if="cdnSrc"
11
- :cdn-src="cdnSrc"
12
- v-bind="attrs"
13
- :width="width"
14
- :height="height"
15
- />
2
+ <VTImage :src="src" :width="width" :height="height" class="h-auto w-full" />
16
3
  </template>
17
4
 
18
5
  <script>
@@ -24,18 +11,10 @@ export default {
24
11
  components: { VTImage },
25
12
 
26
13
  props: {
27
- alt: {
28
- type: String,
29
- required: true,
30
- },
31
14
  src: {
32
15
  type: String,
33
16
  default: '',
34
17
  },
35
- cdnSrc: {
36
- type: [String, Object],
37
- default: null,
38
- },
39
18
  width: {
40
19
  type: String,
41
20
  default: '40',
@@ -45,14 +24,5 @@ export default {
45
24
  default: null,
46
25
  },
47
26
  },
48
-
49
- computed: {
50
- attrs() {
51
- return {
52
- alt: this.alt,
53
- class: 'h-auto w-full',
54
- };
55
- },
56
- },
57
27
  };
58
28
  </script>
@@ -76,6 +76,7 @@ export default {
76
76
  collapse() {
77
77
  this.expanded = false;
78
78
  },
79
+
79
80
  isVisible() {
80
81
  return this.expanded;
81
82
  },
@@ -3,6 +3,7 @@
3
3
  :class="classComputed"
4
4
  :value="value"
5
5
  :disabled="disabled"
6
+ :min="min"
6
7
  v-on="listeners"
7
8
  />
8
9
  </template>
@@ -22,6 +22,7 @@
22
22
  :maximum-view="maximumView"
23
23
  :show-edge-dates="showEdgeDates"
24
24
  :disabled-dates="disabledDatesComputed"
25
+ :use-utc="useUtc"
25
26
  @input="onInput"
26
27
  >
27
28
  <template #prevIntervalBtn>
@@ -46,6 +47,9 @@ import VTPopoverContent from './../Popover/VTPopoverContent.vue';
46
47
  import Datepicker from '@sum.cumo/vue-datepicker';
47
48
  import { IconChevronLeft, IconChevronRight } from '@veritree/icons';
48
49
  import dayjs from 'dayjs';
50
+ import utc from 'dayjs/plugin/utc';
51
+
52
+ dayjs.extend(utc);
49
53
 
50
54
  export default {
51
55
  name: 'VTInputDate',
@@ -98,6 +102,10 @@ export default {
98
102
  type: Boolean,
99
103
  default: false,
100
104
  },
105
+ useUtc: {
106
+ type: Boolean,
107
+ default: false,
108
+ },
101
109
  },
102
110
 
103
111
  computed: {
@@ -112,7 +120,13 @@ export default {
112
120
  },
113
121
 
114
122
  valueModelFormatted() {
115
- return dayjs(this.value).format(this.format);
123
+ let date = dayjs(this.value);
124
+
125
+ if (this.useUtc) {
126
+ date = date.utc();
127
+ }
128
+
129
+ return date.format(this.format);
116
130
  },
117
131
 
118
132
  disabledDatesComputed() {
@@ -6,6 +6,8 @@
6
6
  <input
7
7
  v-model="valueFormatted"
8
8
  :disabled="disabled"
9
+ :inputmode="inputmode"
10
+ :placeholder="placeholder"
9
11
  class="w-full"
10
12
  @input="onInput"
11
13
  @change="onChange"
@@ -37,24 +39,32 @@ export default {
37
39
  type: String,
38
40
  default: 'USD',
39
41
  },
42
+ // different type of number input (e.g. 'integer', 'decimal', 'currency')
43
+ format: {
44
+ type: String,
45
+ default: 'integer',
46
+ },
40
47
  locale: {
41
48
  type: String,
42
49
  default: 'en-US',
43
50
  },
44
- // different type of number input (e.g. 'integer', 'decimal', 'currency')
45
- format: {
51
+ placeholder: {
46
52
  type: String,
47
- default: 'integer',
53
+ default: null,
48
54
  },
49
55
  value: {
50
56
  type: [String, Number, Object, Array, Date],
51
57
  default: null,
52
58
  },
59
+ inputmode: {
60
+ type: String,
61
+ default: 'decimal',
62
+ },
53
63
  },
54
64
 
55
65
  data() {
56
66
  return {
57
- event: 'input',
67
+ event: null,
58
68
  key: null,
59
69
  };
60
70
  },
@@ -82,7 +92,7 @@ export default {
82
92
  let options = {};
83
93
 
84
94
  // only add the fraction digits on blur because on input it won't behave nicely
85
- if (this.format === 'currency' && this.event === 'blur') {
95
+ if (this.format === 'currency' && this.event !== 'input') {
86
96
  options = {
87
97
  minimumFractionDigits: 2,
88
98
  maximumFractionDigits: 2,
@@ -91,7 +101,9 @@ export default {
91
101
  options = {};
92
102
  }
93
103
 
94
- return Number(this.value).toLocaleString(this.locale, options);
104
+ const number = Number(this.value).toLocaleString(this.locale, options);
105
+
106
+ return number === '0' ? null : number;
95
107
  },
96
108
  set(value) {
97
109
  // value without formatting that will be
@@ -6,8 +6,8 @@
6
6
  headless
7
7
  ? null
8
8
  : hasObjectFit
9
- ? `h-full w-full ${objectFitComputed}`
10
- : null,
9
+ ? `h-full w-full ${objectFitComputed}`
10
+ : null,
11
11
  ]"
12
12
  v-bind="$attrs"
13
13
  @load="onLoad"
@@ -83,8 +83,8 @@ export default {
83
83
  ? this.objectFit === 'cover'
84
84
  ? 'object-cover'
85
85
  : this.objectFit === 'contain'
86
- ? 'object-contain'
87
- : null
86
+ ? 'object-contain'
87
+ : null
88
88
  : null;
89
89
  },
90
90
  },
@@ -15,14 +15,14 @@
15
15
  <span :class="[headless ? 'listbox-button__text' : 'truncate text-left']">
16
16
  <slot></slot>
17
17
  </span>
18
- <VTSpinner v-if="loading" class="-mr-0.5 max-w-4 max-h-4" />
19
18
  <span
20
- v-else
21
19
  :class="[
22
20
  headless ? 'listbox-button__icon' : '-mr-1 ml-2 shrink-0 text-gray-500',
23
21
  ]"
24
22
  >
23
+ <VTSpinner v-if="loading" class="mr-0.5 max-w-4 max-h-4" />
25
24
  <IconChevronDown
25
+ v-else
26
26
  class="w-5 text-gray-700 transition-transform"
27
27
  :class="{ 'rotate-180': expanded }"
28
28
  />