sprintify-ui 0.0.13 → 0.0.14

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.
@@ -1,23 +1,43 @@
1
1
  <template>
2
- <input
3
- ref="input"
4
- :value="modelValue"
5
- :type="type"
6
- :name="name"
7
- :step="step"
8
- :disabled="disabled"
9
- :placeholder="placeholder"
10
- :required="required"
11
- class="rounded border-slate-300 disabled:cursor-not-allowed disabled:text-slate-300"
12
- :autocomplete="autocomplete ? 'on' : 'off'"
13
- @keydown.enter="onEnter"
14
- @input="$emit('update:modelValue', transformInputValue($event))"
15
- />
2
+ <div class="inline-flex rounded border border-slate-300">
3
+ <div
4
+ v-if="icon && iconPosition == 'left'"
5
+ class="flex shrink-0 items-center justify-center rounded-l border-r border-slate-300 bg-slate-100 px-3 text-slate-600"
6
+ >
7
+ <BaseIcon icon="heroicons:phone-20-solid" />
8
+ </div>
9
+ <input
10
+ ref="input"
11
+ :value="modelValue"
12
+ :type="type"
13
+ :name="name"
14
+ :step="step"
15
+ :disabled="disabled"
16
+ :placeholder="placeholder"
17
+ :required="required"
18
+ class="border-none bg-transparent outline-none focus:z-[1] focus:ring-2 focus:ring-primary-600 focus:ring-offset-1 disabled:cursor-not-allowed disabled:text-slate-300"
19
+ :class="{
20
+ 'rounded-r': icon && iconPosition == 'left',
21
+ 'rounded-l': icon && iconPosition == 'right',
22
+ rounded: !icon,
23
+ }"
24
+ :autocomplete="autocomplete ? 'on' : 'off'"
25
+ @keydown.enter="onEnter"
26
+ @input="$emit('update:modelValue', transformInputValue($event))"
27
+ />
28
+ <div
29
+ v-if="icon && iconPosition == 'right'"
30
+ class="flex shrink-0 items-center justify-center rounded-r border-l border-slate-300 bg-slate-100 px-3 text-slate-600"
31
+ >
32
+ <BaseIcon icon="heroicons:phone-20-solid" />
33
+ </div>
34
+ </div>
16
35
  </template>
17
36
 
18
37
  <script lang="ts" setup>
19
38
  import { get, isNumber, isString, trim } from 'lodash';
20
39
  import { PropType } from 'vue';
40
+ import { BaseIcon } from './index';
21
41
 
22
42
  const props = defineProps({
23
43
  modelValue: {
@@ -59,6 +79,14 @@ const props = defineProps({
59
79
  default: false,
60
80
  type: Boolean,
61
81
  },
82
+ icon: {
83
+ default: null,
84
+ type: String,
85
+ },
86
+ iconPosition: {
87
+ default: 'left',
88
+ type: String as PropType<'left' | 'right'>,
89
+ },
62
90
  });
63
91
 
64
92
  defineEmits(['update:modelValue']);
@@ -36,7 +36,7 @@ const EMPTY_VALUE_EXTERNAL = null;
36
36
  const props = defineProps({
37
37
  modelValue: {
38
38
  default: undefined,
39
- type: [String, Number, null, undefined] as PropType<Option>,
39
+ type: [String, Number, null] as PropType<Option | undefined>,
40
40
  },
41
41
  name: {
42
42
  default: undefined,
@@ -36,7 +36,7 @@ import { RouteLocationRaw } from 'vue-router';
36
36
  const props = defineProps({
37
37
  to: {
38
38
  default: undefined,
39
- type: [Object, String, undefined] as PropType<RouteLocationRaw | undefined>,
39
+ type: [Object, String] as PropType<RouteLocationRaw | undefined>,
40
40
  },
41
41
  action: {
42
42
  default: undefined,
@@ -18,8 +18,8 @@ import { PropType } from 'vue';
18
18
 
19
19
  defineProps({
20
20
  modelValue: {
21
- required: true,
22
- type: [String, undefined] as PropType<string | undefined>,
21
+ default: undefined,
22
+ type: String as PropType<string | undefined>,
23
23
  },
24
24
  type: {
25
25
  type: String,