@saasmakers/ui 0.1.99 → 0.1.101

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.
@@ -30,7 +30,7 @@ const uuid = ref(`${Math.floor((1 + Math.random()) * 0x100000)}`)
30
30
  >
31
31
  <div class="flex flex-1 items-center">
32
32
  <input
33
- v-show="!loading"
33
+ v-if="!loading"
34
34
  :id="uuid"
35
35
  v-model="modelValue"
36
36
  class="border border-gray-300 rounded-lg accent-indigo-700 transition-shadow flex-initial dark:border-gray-700"
@@ -7,7 +7,6 @@ const props = withDefaults(defineProps<Omit<FieldTime, 'modelValue'>>(), {
7
7
  disabled: false,
8
8
  hideError: true,
9
9
  icon: undefined,
10
- id: undefined,
11
10
  label: '',
12
11
  labelIcon: undefined,
13
12
  name: undefined,
@@ -24,11 +23,19 @@ const { getIcon } = useLayerIcons()
24
23
 
25
24
  const modelValue = defineModel<FieldTime['modelValue']>({ default: '' })
26
25
 
26
+ const inputRef = ref<HTMLInputElement>()
27
27
  const uuid = ref(`${Math.floor((1 + Math.random()) * 0x100000)}`)
28
28
 
29
29
  function onFieldBlur(event: FocusEvent) {
30
30
  emit('blur', event, modelValue.value, props.name)
31
31
  }
32
+
33
+ function onContainerClick() {
34
+ if (!props.disabled && inputRef.value) {
35
+ inputRef.value.focus()
36
+ inputRef.value.showPicker?.()
37
+ }
38
+ }
32
39
  </script>
33
40
 
34
41
  <template>
@@ -56,6 +63,7 @@ function onFieldBlur(event: FocusEvent) {
56
63
  'text-sm h-12': size === 'base',
57
64
  'text-base h-14': size === 'lg',
58
65
  }"
66
+ @click="onContainerClick"
59
67
  >
60
68
  <BaseIcon
61
69
  :icon="getIcon('clock')"
@@ -63,7 +71,8 @@ function onFieldBlur(event: FocusEvent) {
63
71
  />
64
72
 
65
73
  <input
66
- :id="`${id}`"
74
+ :id="uuid"
75
+ ref="inputRef"
67
76
  v-model="modelValue"
68
77
  class="cursor-pointer text-sm outline-none [&::-webkit-calendar-picker-indicator]:hidden"
69
78
  :class="{
@@ -187,7 +187,6 @@ export interface FieldTime {
187
187
  disabled?: boolean
188
188
  hideError?: boolean
189
189
  icon?: string
190
- id: number | string
191
190
  label?: BaseTextText
192
191
  labelIcon?: string
193
192
  modelValue: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
3
  "type": "module",
4
- "version": "0.1.99",
4
+ "version": "0.1.101",
5
5
  "private": false,
6
6
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
7
7
  "license": "MIT",