@a-vision-software/vue-input-components 1.2.13 → 1.3.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@a-vision-software/vue-input-components",
3
- "version": "1.2.13",
3
+ "version": "1.3.0",
4
4
  "description": "A collection of reusable Vue 3 input components with TypeScript support",
5
5
  "author": "A-Vision Software",
6
6
  "license": "MIT",
@@ -1,84 +1,36 @@
1
1
  <template>
2
- <div
3
- class="text-input"
4
- :class="{
5
- [`label-${labelPosition}`]: label,
6
- [`label-align-${labelAlign}`]: label,
7
- }"
8
- :style="[
9
- { width: type === 'date' ? totalWidth || '12rem' : totalWidth || '100%' },
10
- labelStyle,
11
- {
12
- '--max-textarea-height': props.maxHeight || props.height || '14rem',
13
- '--textarea-height': props.height || '5.5rem',
14
- },
15
- ]"
16
- >
2
+ <div class="text-input" :class="{
3
+ [`label-${labelPosition}`]: label,
4
+ [`label-align-${labelAlign}`]: label,
5
+ }" :style="[
6
+ { width: type === 'date' ? totalWidth || '12rem' : totalWidth || '100%' },
7
+ labelStyle,
8
+ {
9
+ '--max-textarea-height': props.maxHeight || props.height || '14rem',
10
+ '--textarea-height': props.height || '5.5rem',
11
+ },
12
+ ]">
17
13
  <label v-if="label" :for="id" class="label">
18
14
  {{ label }}
19
15
  </label>
20
- <div
21
- class="input-wrapper"
22
- :class="{
23
- 'has-error': error,
24
- 'has-icon': icon,
25
- }"
26
- >
16
+ <div class="input-wrapper" :class="{
17
+ 'has-error': error,
18
+ 'has-icon': icon,
19
+ }">
27
20
  <div v-if="icon" class="icon-wrapper" @click="focusInput">
28
21
  <font-awesome-icon :icon="icon" class="icon" />
29
22
  </div>
30
- <Datepicker
31
- v-if="type === 'date'"
32
- :id="id"
33
- v-model="dateValue"
34
- :placeholder="placeholder"
35
- :disabled="disabled"
36
- :readonly="readonly"
37
- :min-date="min"
38
- :max-date="max"
39
- :format="dateFormat"
40
- :enable-time-picker="false"
41
- :auto-apply="true"
42
- :close-on-auto-apply="true"
43
- :clearable="true"
44
- :input-class-name="['input', { 'has-icon': icon }]"
45
- @update:model-value="handleDateChange"
46
- @focus="handleFocus"
47
- @blur="handleBlur"
48
- />
49
- <input
50
- v-else-if="!isTextarea"
51
- :id="id"
52
- :type="type"
53
- :value="modelValue"
54
- :placeholder="placeholder"
55
- :required="required"
56
- :disabled="disabled"
57
- :readonly="readonly"
58
- :maxlength="maxlength"
59
- class="input"
60
- @input="handleInput"
61
- @focus="handleFocus"
62
- @blur="handleBlur"
63
- @keydown="handleKeydown"
64
- ref="inputRef"
65
- />
66
- <textarea
67
- v-else
68
- :id="id"
69
- :value="modelValue"
70
- :placeholder="placeholder"
71
- :required="required"
72
- :disabled="disabled"
73
- class="input"
74
- @input="handleInput"
75
- ref="inputRef"
76
- ></textarea>
77
- <span
78
- v-if="required && !showSaved && !showChanged"
79
- class="status-indicator required-indicator"
80
- >required</span
81
- >
23
+ <Datepicker v-if="type === 'date'" :id="id" v-model="dateValue" :placeholder="placeholder" :disabled="disabled"
24
+ :readonly="readonly" :min-date="min" :max-date="max" :format="dateFormat" :enable-time-picker="false"
25
+ :auto-apply="true" :close-on-auto-apply="true" :clearable="true"
26
+ :input-class-name="['input', { 'has-icon': icon }]" @update:model-value="handleDateChange" @focus="handleFocus"
27
+ @blur="handleBlur" />
28
+ <input v-else-if="!isTextarea" :id="id" :type="type" :value="modelValue" :placeholder="placeholder"
29
+ :required="required" :disabled="disabled" :readonly="readonly" :maxlength="maxlength" class="input"
30
+ @input="handleInput" @focus="handleFocus" @blur="handleBlur" @keydown="handleKeydown" ref="inputRef" />
31
+ <textarea v-else :id="id" :value="modelValue" :placeholder="placeholder" :required="required" :disabled="disabled"
32
+ class="input" @input="handleInput" ref="inputRef"></textarea>
33
+ <span v-if="required && !showSaved && !showChanged" class="status-indicator required-indicator">required</span>
82
34
  <transition name="fade">
83
35
  <span v-if="showSaved && !error" class="status-indicator saved-indicator">saved</span>
84
36
  </transition>
@@ -350,6 +302,7 @@ defineExpose({
350
302
  .input {
351
303
  padding: 0.75rem 1rem;
352
304
  border: none;
305
+ border-radius: 0.5rem;
353
306
  outline: none;
354
307
  font-size: 1rem;
355
308
  color: var(--text-color);
@@ -402,11 +355,11 @@ defineExpose({
402
355
 
403
356
  .status-indicator {
404
357
  position: absolute;
405
- top: -0.1rem;
358
+ top: -1px;
359
+ line-height: 1px;
406
360
  right: 0.5rem;
407
361
  font-size: 0.75rem;
408
362
  color: var(--text-muted);
409
- line-height: 0px;
410
363
  background-color: var(--input-bg-color);
411
364
  padding: 0 0.25rem;
412
365
  }
package/src/index.ts CHANGED
@@ -2,7 +2,8 @@ import TextInput from './components/TextInput.vue'
2
2
  import FileUpload from './components/FileUpload.vue'
3
3
  import Navigation from './components/Navigation.vue'
4
4
  import Action from './components/Action.vue'
5
+ import Dropdown from './components/Dropdown.vue'
5
6
 
6
- export { TextInput, FileUpload, Navigation, Action }
7
+ export { TextInput, FileUpload, Navigation, Action, Dropdown }
7
8
 
8
9
  export * from './types'