@saasmakers/ui 0.1.64 → 0.1.65

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,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { BaseAlert } from '../../types/bases'
3
3
  import { Preferences } from '@capacitor/preferences'
4
+ import { getIcon } from '../../composables/useIcons'
4
5
 
5
6
  const props = withDefaults(defineProps<BaseAlert>(), {
6
7
  closingId: '',
@@ -127,7 +127,6 @@ function onClick(event: MouseEvent) {
127
127
  class="flex-initial"
128
128
  :color="iconColor"
129
129
  :icon="confirming ? undefined : icon"
130
- :light="light"
131
130
  :reverse="reverse"
132
131
  :size="size"
133
132
  :text="confirming ? t('confirm') : text"
@@ -136,7 +136,6 @@ function onRemove(event: MouseEvent) {
136
136
  <BaseAvatar
137
137
  v-if="avatar"
138
138
  class="h-full w-full"
139
- rounded="sm"
140
139
  :shadow="false"
141
140
  :src="avatar"
142
141
  />
@@ -23,10 +23,10 @@ const emit = defineEmits<{
23
23
  'attach': [event: MouseEvent, tagId?: number | string]
24
24
  'back': [event: MouseEvent]
25
25
  'click': [event: MouseEvent]
26
- 'create': [event: MouseEvent, name: string]
26
+ 'create': [event: FocusEvent | KeyboardEvent, name: string]
27
27
  'detach': [event: MouseEvent, tagId?: number | string]
28
28
  'remove': [event: MouseEvent, tagId?: number | string]
29
- 'update': [event: MouseEvent, name: string, tagId?: number | string]
29
+ 'update': [event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string]
30
30
  'update:modelValue': [value: (number | string)[]]
31
31
  }>()
32
32
 
@@ -61,7 +61,7 @@ const sortedTags = computed({
61
61
  },
62
62
  })
63
63
 
64
- function onCreateTag(event: MouseEvent, name: string) {
64
+ function onCreateTag(event: FocusEvent | KeyboardEvent, name: string) {
65
65
  showingTagCreationField.value = false
66
66
  keyForTagCreation.value = Date.now()
67
67
 
@@ -110,7 +110,7 @@ function onTagClick(event: MouseEvent, tagId?: number | string) {
110
110
  }
111
111
  }
112
112
 
113
- function onUpdateTag(event: MouseEvent, name: string, tagId?: number | string) {
113
+ function onUpdateTag(event: FocusEvent | KeyboardEvent, name: string, tagId?: number | string) {
114
114
  if (name) {
115
115
  emit('update', event, name, tagId)
116
116
  }
@@ -166,8 +166,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
166
166
  :size="size"
167
167
  :text="showingTagCreationField ? '' : t('newTag')"
168
168
  @click="onShowTagField"
169
- @input:blur="onCreateTag"
170
- @input:submit="onCreateTag"
169
+ @input-blur="onCreateTag"
170
+ @input-submit="onCreateTag"
171
171
  />
172
172
 
173
173
  <div class="flex items-center">
@@ -199,8 +199,8 @@ function onRemoveTag(event: MouseEvent, tagId?: number | string) {
199
199
  :text="tag.text"
200
200
  :to="tag.to"
201
201
  @click="onTagClick"
202
- @input:blur="onUpdateTag"
203
- @input:submit="onUpdateTag"
202
+ @input-blur="onUpdateTag"
203
+ @input-submit="onUpdateTag"
204
204
  @remove="onRemoveTag"
205
205
  />
206
206
  </template>
@@ -74,7 +74,7 @@ function onShowMore() {
74
74
  </script>
75
75
 
76
76
  <template>
77
- <Component
77
+ <component
78
78
  :is="to ? NuxtLinkLocale : 'div'"
79
79
  :class="{
80
80
  'font-bold': bold,
@@ -156,7 +156,7 @@ function onShowMore() {
156
156
  />
157
157
 
158
158
  <slot />
159
- </Component>
159
+ </component>
160
160
  </template>
161
161
 
162
162
  <i18n lang="json">
@@ -30,9 +30,9 @@ const props = withDefaults(defineProps<FieldInput>(), {
30
30
  const emit = defineEmits<{
31
31
  'blur': [event: FocusEvent]
32
32
  'focus': [event: FocusEvent]
33
- 'keyup': [event: KeyboardEvent, value: number | string ]
34
- 'submit': [event: KeyboardEvent, value: number | string ]
35
- 'update:modelValue': [value: number | string ]
33
+ 'keyup': [event: KeyboardEvent, value: string ]
34
+ 'submit': [event: KeyboardEvent, value: string ]
35
+ 'update:modelValue': [value: string ]
36
36
  }>()
37
37
 
38
38
  defineSlots<{
@@ -82,10 +82,10 @@ function onFieldFocus(event: FocusEvent) {
82
82
  }
83
83
 
84
84
  function onFieldInput(event: Event) {
85
- let value: number | string = (event.target as HTMLInputElement).value
85
+ let value = (event.target as HTMLInputElement).value
86
86
 
87
87
  if (props.type === 'number' && props.max && Number.parseInt(value) > props.max) {
88
- value = props.max
88
+ value = props.max.toString()
89
89
  }
90
90
 
91
91
  if (props.lowercaseOnly) {
@@ -87,6 +87,7 @@ function onFieldInput() {
87
87
  :id="uuid"
88
88
  ref="textarea"
89
89
  v-model="value"
90
+ v-bind="{ 'data-enable-grammarly': 'false' }"
90
91
  class="w-full flex-1 appearance-none rounded-lg text-gray-900 font-medium tracking-tight uppercase outline-none dark:text-gray-100 placeholder-gray-600 dark:placeholder-gray-400 focus:placeholder-gray-900 hover:placeholder-gray-900 dark:focus:placeholder-gray-100 dark:hover:placeholder-gray-100"
91
92
  :class="{
92
93
  'p-2.5': padding,
@@ -104,7 +105,6 @@ function onFieldInput() {
104
105
  'text-base': size === 'base',
105
106
  'text-lg': size === 'lg',
106
107
  }"
107
- data-enable-grammarly="false"
108
108
  :placeholder="placeholder"
109
109
  :rows="rows"
110
110
  spellcheck="false"
@@ -46,7 +46,7 @@ export interface FieldInput {
46
46
  lowercaseOnly?: boolean
47
47
  max?: number
48
48
  min?: number
49
- modelValue?: number | string
49
+ modelValue?: string
50
50
  placeholder?: string
51
51
  required?: boolean
52
52
  size?: FieldSize
@@ -1,6 +1,13 @@
1
1
  import type * as Bases from './bases'
2
2
  import type * as Fields from './fields'
3
3
 
4
+ declare module '@vue/runtime-core' {
5
+ interface ComponentCustomProperties {
6
+ vHotkey?: Record<string, (event?: KeyboardEvent | MouseEvent) => void>
7
+ vTooltip?: Record<string, any> | string
8
+ }
9
+ }
10
+
4
11
  declare global {
5
12
  // Libraries
6
13
  type ChartistBarChartData = import('chartist').BarChartData
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
3
  "type": "module",
4
- "version": "0.1.64",
4
+ "version": "0.1.65",
5
5
  "private": false,
6
6
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
7
7
  "license": "MIT",