@polymarbot/nuxt-layer-shadcn-ui 0.6.3 → 0.6.4

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.
@@ -28,7 +28,7 @@ const meta = {
28
28
  showTime: false,
29
29
  disabled: false,
30
30
  readonly: false,
31
- placeholder: undefined,
31
+ placeholder: '',
32
32
  minDate: undefined,
33
33
  maxDate: undefined,
34
34
  valueFormat: undefined,
@@ -86,7 +86,7 @@ const timeConfig = computed(() => {
86
86
  <div @click.stop>
87
87
  <Input
88
88
  :modelValue="value"
89
- :placeholder="placeholder ?? T('placeholder')"
89
+ :placeholder="placeholder || T('placeholder')"
90
90
  :disabled="disabled"
91
91
  :readonly="readonly"
92
92
  @update:modelValue="(v: string | undefined) => onInput(v ?? '')"
@@ -27,8 +27,8 @@ const meta = {
27
27
  showTime: false,
28
28
  disabled: false,
29
29
  readonly: false,
30
- startPlaceholder: undefined,
31
- endPlaceholder: undefined,
30
+ startPlaceholder: '',
31
+ endPlaceholder: '',
32
32
  maxSpanDays: undefined,
33
33
  valueFormat: undefined,
34
34
  autoApply: true,
@@ -97,7 +97,7 @@ const endMaxDate = computed(() => {
97
97
  :showTime="showTime"
98
98
  :disabled="disabled"
99
99
  :readonly="readonly"
100
- :placeholder="startPlaceholder ?? T('startPlaceholder')"
100
+ :placeholder="startPlaceholder || T('startPlaceholder')"
101
101
  :minDate="startMinDate"
102
102
  :maxDate="startMaxDate"
103
103
  :valueFormat="valueFormat"
@@ -112,7 +112,7 @@ const endMaxDate = computed(() => {
112
112
  :showTime="showTime"
113
113
  :disabled="disabled"
114
114
  :readonly="readonly"
115
- :placeholder="endPlaceholder ?? T('endPlaceholder')"
115
+ :placeholder="endPlaceholder || T('endPlaceholder')"
116
116
  :minDate="endMinDate"
117
117
  :maxDate="endMaxDate"
118
118
  :valueFormat="valueFormat"
@@ -19,8 +19,8 @@ const meta = {
19
19
  end: undefined,
20
20
  min: 0,
21
21
  max: 100,
22
- startPlaceholder: undefined,
23
- endPlaceholder: undefined,
22
+ startPlaceholder: '',
23
+ endPlaceholder: '',
24
24
  disabled: false,
25
25
  },
26
26
  render: args => ({
@@ -38,7 +38,7 @@ const end = computed({
38
38
  v-bind="$attrs"
39
39
  :min="min"
40
40
  :max="end ?? max"
41
- :placeholder="startPlaceholder ?? T('startPlaceholder')"
41
+ :placeholder="startPlaceholder || T('startPlaceholder')"
42
42
  fluid
43
43
  />
44
44
  <span class="leading-0 text-muted-foreground">
@@ -49,7 +49,7 @@ const end = computed({
49
49
  v-bind="$attrs"
50
50
  :min="start ?? min"
51
51
  :max="max"
52
- :placeholder="endPlaceholder ?? T('endPlaceholder')"
52
+ :placeholder="endPlaceholder || T('endPlaceholder')"
53
53
  fluid
54
54
  />
55
55
  </div>
@@ -135,8 +135,8 @@ function handleSearch (value: string) {
135
135
  // -- Empty text --
136
136
 
137
137
  const computedEmptyText = computed(() => {
138
- if (keyword.value) return props.searchEmptyText ?? T('noSearchItems')
139
- return props.emptyText ?? T('noItems')
138
+ if (keyword.value) return props.searchEmptyText || T('noSearchItems')
139
+ return props.emptyText || T('noItems')
140
140
  })
141
141
 
142
142
  // -- Popover open/close --
@@ -188,9 +188,10 @@ defineExpose({ refresh: resetAndLoad })
188
188
  :options="displayedOptions"
189
189
  :filter="filterFunction"
190
190
  :placeholder="placeholder"
191
- :disabled="disabled"
192
191
  :searchPlaceholder="searchPlaceholder"
193
192
  :emptyText="computedEmptyText"
193
+ :disabled="disabled"
194
+ :loading="isLoading"
194
195
  @search="handleSearch"
195
196
  @open="handleOpen"
196
197
  @close="handleClose"
@@ -220,7 +221,6 @@ defineExpose({ refresh: resetAndLoad })
220
221
  <EffectIntersectionChecker
221
222
  v-if="hasMore"
222
223
  :disabled="isLoading"
223
- bao
224
224
  class="py-2 flex items-center justify-center"
225
225
  @show="loadMore"
226
226
  >
@@ -36,6 +36,7 @@ const meta = {
36
36
  argTypes: {
37
37
  placeholder: { control: 'text' },
38
38
  disabled: { control: 'boolean' },
39
+ loading: { control: 'boolean' },
39
40
  filter: { control: 'boolean' },
40
41
  multiple: { control: 'boolean' },
41
42
  searchPlaceholder: { control: 'text' },
@@ -44,6 +45,7 @@ const meta = {
44
45
  args: {
45
46
  placeholder: 'Select an option',
46
47
  disabled: false,
48
+ loading: false,
47
49
  filter: false,
48
50
  multiple: false,
49
51
  searchPlaceholder: '',
@@ -277,6 +279,14 @@ export const Disabled: Story = {
277
279
  }),
278
280
  }
279
281
 
282
+ export const Loading: Story = {
283
+ parameters: noControls,
284
+ args: {
285
+ loading: true,
286
+ placeholder: 'Loading options',
287
+ },
288
+ }
289
+
280
290
  export const EventHandling: Story = {
281
291
  parameters: noControls,
282
292
  render: () => ({
@@ -29,6 +29,7 @@ const props = withDefaults(defineProps<SelectProps<TValue, TMeta>>(), {
29
29
  modelValue: undefined,
30
30
  placeholder: undefined,
31
31
  disabled: false,
32
+ loading: false,
32
33
  filter: false,
33
34
  searchPlaceholder: undefined,
34
35
  emptyText: undefined,
@@ -188,7 +189,7 @@ function handleClear (event: MouseEvent) {
188
189
  v-else
189
190
  class="text-muted-foreground"
190
191
  >
191
- {{ placeholder ?? T('placeholder') }}
192
+ {{ placeholder || T('placeholder') }}
192
193
  </span>
193
194
  </span>
194
195
  <InputGroupAddon
@@ -205,6 +206,12 @@ function handleClear (event: MouseEvent) {
205
206
  </InputGroupAddon>
206
207
  <InputGroupAddon align="inline-end">
207
208
  <Icon
209
+ v-if="loading"
210
+ name="loader-circle"
211
+ class="size-4 animate-spin opacity-50"
212
+ />
213
+ <Icon
214
+ v-else
208
215
  name="chevron-down"
209
216
  class="size-4 opacity-50"
210
217
  />
@@ -221,11 +228,11 @@ function handleClear (event: MouseEvent) {
221
228
  >
222
229
  <CommandInput
223
230
  v-if="!!filter"
224
- :placeholder="searchPlaceholder ?? T('searchPlaceholder')"
231
+ :placeholder="searchPlaceholder || T('searchPlaceholder')"
225
232
  />
226
233
  <CommandList>
227
234
  <CommandEmpty>
228
- {{ emptyText ?? T('noItems') }}
235
+ {{ emptyText || T('noItems') }}
229
236
  </CommandEmpty>
230
237
 
231
238
  <template
@@ -13,6 +13,8 @@ export type SelectBaseProps<V extends string | number = string, M = unknown> = {
13
13
  options?: SelectOption<V, M>[]
14
14
  placeholder?: string
15
15
  disabled?: boolean
16
+ /** Show a spinner in place of the chevron */
17
+ loading?: boolean
16
18
  /** true: enable client-side label filter; function: custom filter (disables internal filter) */
17
19
  filter?: boolean | SelectFilterFunction
18
20
  /** Search input placeholder */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarbot/nuxt-layer-shadcn-ui",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "description": "Nuxt layer providing shadcn-vue based UI components",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -42,5 +42,5 @@
42
42
  "vue-i18n": "^11",
43
43
  "vue-router": "^4 || ^5"
44
44
  },
45
- "gitHead": "93045d977de0e19a823787d21ba9631a3d5b7ee8"
45
+ "gitHead": "e42537ea3be4edff97c84d3dd26529538b280472"
46
46
  }