@una-ui/nuxt 0.42.0 → 0.43.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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.42.0",
4
+ "version": "0.43.0",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -8,7 +8,7 @@ import 'unocss';
8
8
  import 'unocss-preset-animations';
9
9
 
10
10
  const name = "@una-ui/nuxt";
11
- const version = "0.42.0";
11
+ const version = "0.43.0";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -44,147 +44,147 @@ const module = defineNuxtModule({
44
44
  path: resolve(runtimeDir, "components", "elements"),
45
45
  prefix: options.prefix,
46
46
  global: options.global,
47
- watch: nuxt.options.dev,
47
+ watch: options.dev,
48
48
  priority: 10
49
49
  });
50
50
  addComponentsDir({
51
51
  path: resolve(runtimeDir, "components/elements", "tabs"),
52
52
  prefix: options.prefix,
53
53
  global: options.global,
54
- watch: nuxt.options.dev,
54
+ watch: options.dev,
55
55
  priority: 10
56
56
  });
57
57
  addComponentsDir({
58
58
  path: resolve(runtimeDir, "components/elements", "card"),
59
59
  prefix: options.prefix,
60
60
  global: options.global,
61
- watch: nuxt.options.dev,
61
+ watch: options.dev,
62
62
  priority: 10
63
63
  });
64
64
  addComponentsDir({
65
65
  path: resolve(runtimeDir, "components/elements", "dropdown-menu"),
66
66
  prefix: options.prefix,
67
67
  global: options.global,
68
- watch: nuxt.options.dev,
68
+ watch: options.dev,
69
69
  priority: 10
70
70
  });
71
71
  addComponentsDir({
72
72
  path: resolve(runtimeDir, "components/elements", "popover"),
73
73
  prefix: options.prefix,
74
74
  global: options.global,
75
- watch: nuxt.options.dev,
75
+ watch: options.dev,
76
76
  priority: 10
77
77
  });
78
78
  addComponentsDir({
79
79
  path: resolve(runtimeDir, "components/elements", "collapsible"),
80
80
  prefix: options.prefix,
81
81
  global: options.global,
82
- watch: nuxt.options.dev,
82
+ watch: options.dev,
83
83
  priority: 10
84
84
  });
85
85
  addComponentsDir({
86
86
  path: resolve(runtimeDir, "components/elements", "tooltip"),
87
87
  prefix: options.prefix,
88
88
  global: options.global,
89
- watch: nuxt.options.dev,
89
+ watch: options.dev,
90
90
  priority: 10
91
91
  });
92
92
  addComponentsDir({
93
93
  path: resolve(runtimeDir, "components/elements", "pagination"),
94
94
  prefix: options.prefix,
95
95
  global: options.global,
96
- watch: nuxt.options.dev,
96
+ watch: options.dev,
97
97
  priority: 10
98
98
  });
99
99
  addComponentsDir({
100
100
  path: resolve(runtimeDir, "components/elements", "dialog"),
101
101
  prefix: options.prefix,
102
102
  global: options.global,
103
- watch: nuxt.options.dev,
103
+ watch: options.dev,
104
104
  priority: 10
105
105
  });
106
106
  addComponentsDir({
107
107
  path: resolve(runtimeDir, "components", "forms"),
108
108
  prefix: options.prefix,
109
109
  global: options.global,
110
- watch: nuxt.options.dev,
110
+ watch: options.dev,
111
111
  priority: 10
112
112
  });
113
113
  addComponentsDir({
114
114
  path: resolve(runtimeDir, "components/forms", "select"),
115
115
  prefix: options.prefix,
116
116
  global: options.global,
117
- watch: nuxt.options.dev,
117
+ watch: options.dev,
118
118
  priority: 10
119
119
  });
120
120
  addComponentsDir({
121
121
  path: resolve(runtimeDir, "components/forms", "radio-group"),
122
122
  prefix: options.prefix,
123
123
  global: options.global,
124
- watch: nuxt.options.dev,
124
+ watch: options.dev,
125
125
  priority: 10
126
126
  });
127
127
  addComponentsDir({
128
128
  path: resolve(runtimeDir, "components", "misc"),
129
129
  prefix: options.prefix,
130
130
  global: options.global,
131
- watch: nuxt.options.dev,
131
+ watch: options.dev,
132
132
  priority: 10
133
133
  });
134
134
  addComponentsDir({
135
135
  path: resolve(runtimeDir, "components", "navigation"),
136
136
  prefix: options.prefix,
137
137
  global: options.global,
138
- watch: nuxt.options.dev,
138
+ watch: options.dev,
139
139
  priority: 10
140
140
  });
141
141
  addComponentsDir({
142
142
  path: resolve(runtimeDir, "components/data", "table"),
143
143
  prefix: options.prefix,
144
144
  global: options.global,
145
- watch: nuxt.options.dev,
145
+ watch: options.dev,
146
146
  priority: 10
147
147
  });
148
148
  addComponentsDir({
149
149
  path: resolve(runtimeDir, "components/navigation", "breadcrumb"),
150
150
  prefix: options.prefix,
151
151
  global: options.global,
152
- watch: nuxt.options.dev,
152
+ watch: options.dev,
153
153
  priority: 10
154
154
  });
155
155
  addComponentsDir({
156
156
  path: resolve(runtimeDir, "components", "overlays"),
157
157
  prefix: options.prefix,
158
158
  global: options.global,
159
- watch: nuxt.options.dev,
159
+ watch: options.dev,
160
160
  priority: 10
161
161
  });
162
162
  addComponentsDir({
163
163
  path: resolve(runtimeDir, "components/overlays", "toast"),
164
164
  prefix: options.prefix,
165
165
  global: options.global,
166
- watch: nuxt.options.dev,
166
+ watch: options.dev,
167
167
  priority: 10
168
168
  });
169
169
  addComponentsDir({
170
170
  path: resolve(runtimeDir, "components", "sheet"),
171
171
  prefix: options.prefix,
172
172
  global: options.global,
173
- watch: nuxt.options.dev,
173
+ watch: options.dev,
174
174
  priority: 10
175
175
  });
176
176
  addComponentsDir({
177
177
  path: resolve(runtimeDir, "components", "sidebar"),
178
178
  prefix: options.prefix,
179
179
  global: options.global,
180
- watch: nuxt.options.dev,
180
+ watch: options.dev,
181
181
  priority: 10
182
182
  });
183
183
  addComponentsDir({
184
184
  path: resolve(runtimeDir, "components", "scroll-area"),
185
185
  prefix: options.prefix,
186
186
  global: options.global,
187
- watch: nuxt.options.dev,
187
+ watch: options.dev,
188
188
  priority: 10
189
189
  });
190
190
  if (options.themeable) {
@@ -40,6 +40,7 @@ import TableRow from './TableRow.vue'
40
40
 
41
41
  const props = withDefaults(defineProps <NTableProps<TData, TValue>>(), {
42
42
  enableMultiRowSelection: true,
43
+ enableSortingRemoval: true,
43
44
  })
44
45
 
45
46
  const emit = defineEmits(['select', 'selectAll', 'expand'])
@@ -4,14 +4,12 @@ import type { NSelectProps, SelectGroup as SelectGroupType } from '../../../type
4
4
  </script>
5
5
 
6
6
  <script setup lang="ts" generic="T extends AcceptableValue">
7
- import { reactivePick } from '@vueuse/core'
8
- import { useForwardPropsEmits } from 'reka-ui'
9
- import { isEqualObject } from '../../../utils'
7
+ import { SelectRoot, useForwardPropsEmits } from 'reka-ui'
8
+ import { cn, isEqualObject } from '../../../utils'
10
9
  import SelectContent from './SelectContent.vue'
11
10
  import SelectGroup from './SelectGroup.vue'
12
11
  import SelectItem from './SelectItem.vue'
13
12
  import SelectLabel from './SelectLabel.vue'
14
- import SelectRoot from './SelectRoot.vue'
15
13
  import SelectSeparator from './SelectSeparator.vue'
16
14
  import SelectTrigger from './SelectTrigger.vue'
17
15
  import SelectValue from './SelectValue.vue'
@@ -22,13 +20,7 @@ const props = withDefaults(defineProps<NSelectProps<T>>(), {
22
20
 
23
21
  const emits = defineEmits<SelectRootEmits>()
24
22
 
25
- const rootProps = reactivePick(props, [
26
- 'modelValue',
27
- 'defaultValue',
28
- 'multiple',
29
- 'disabled',
30
- ])
31
- const forwarded = useForwardPropsEmits(rootProps, emits)
23
+ const forwarded = useForwardPropsEmits(props, emits)
32
24
 
33
25
  function formatSelectedValue(value: unknown) {
34
26
  if (!value || (Array.isArray(value) && value.length === 0))
@@ -71,118 +63,124 @@ function isItemSelected(item: unknown, modelValue: unknown) {
71
63
  <template>
72
64
  <SelectRoot
73
65
  v-slot="{ modelValue, open }"
66
+ :class="cn(
67
+ props.una?.select,
68
+ props.class,
69
+ )"
74
70
  v-bind="forwarded"
75
71
  >
76
- <SelectTrigger
77
- :id
78
- :size
79
- :status
80
- :select
81
- v-bind="props._selectTrigger"
82
- :una
83
- >
84
- <slot name="trigger" :model-value :open="open">
85
- <SelectValue
86
- :placeholder="props.placeholder"
87
- v-bind="props._selectValue"
88
- :aria-label="formatSelectedValue(modelValue)"
89
- :data-status="status"
90
- :una
91
- >
92
- <slot name="value" :model-value :open>
93
- {{ formatSelectedValue(modelValue) || props.placeholder }}
94
- </slot>
95
- </SelectValue>
96
- </slot>
97
- </SelectTrigger>
98
-
99
- <SelectContent
100
- :size
101
- v-bind="{
102
- ..._selectContent,
103
- _selectScrollDownButton,
104
- _selectScrollUpButton,
105
- }"
106
- :una
107
- >
108
- <slot name="content" :items="items">
109
- <template v-if="!group">
110
- <SelectLabel
111
- v-if="label"
112
- v-bind="_selectLabel"
72
+ <slot name="root" :model-value :open>
73
+ <SelectTrigger
74
+ :id
75
+ :size
76
+ :status
77
+ :select
78
+ v-bind="props._selectTrigger"
79
+ :una
80
+ >
81
+ <slot name="trigger" :model-value :open="open">
82
+ <SelectValue
83
+ :placeholder="props.placeholder"
84
+ v-bind="props._selectValue"
85
+ :aria-label="formatSelectedValue(modelValue)"
86
+ :data-status="status"
113
87
  :una
114
88
  >
115
- <slot name="label" :label>
116
- {{ label }}
89
+ <slot name="value" :model-value :open>
90
+ {{ formatSelectedValue(modelValue) || props.placeholder }}
117
91
  </slot>
118
- </SelectLabel>
119
-
120
- <template
121
- v-for="item in items"
122
- :key="item"
123
- >
124
- <SelectItem
125
- :value="item"
126
- :size
127
- :select-item
128
- v-bind="props._selectItem"
129
- :is-selected="isItemSelected(item, modelValue)"
92
+ </SelectValue>
93
+ </slot>
94
+ </SelectTrigger>
95
+
96
+ <SelectContent
97
+ :size
98
+ v-bind="{
99
+ ..._selectContent,
100
+ _selectScrollDownButton,
101
+ _selectScrollUpButton,
102
+ }"
103
+ :una
104
+ >
105
+ <slot name="content" :items="items">
106
+ <template v-if="!group">
107
+ <SelectLabel
108
+ v-if="label"
109
+ v-bind="_selectLabel"
130
110
  :una
131
111
  >
132
- <slot name="item" :item="item">
133
- {{ props.itemKey && item ? (item as any)[props.itemKey] : item }}
112
+ <slot name="label" :label>
113
+ {{ label }}
134
114
  </slot>
135
- </SelectItem>
136
- </template>
137
- </template>
138
-
139
- <template v-if="group">
140
- <SelectGroup
141
- v-for="(group, i) in items as SelectGroupType<T>[]"
142
- :key="i"
143
- v-bind="props._selectGroup"
144
- :una
145
- >
146
- <SelectSeparator
147
- v-if="i > 0"
148
- v-bind="props._selectSeparator"
149
- :una
150
- />
115
+ </SelectLabel>
151
116
 
152
- <slot name="group" :items="group">
153
- <SelectLabel
154
- v-if="group.label"
117
+ <template
118
+ v-for="item in items"
119
+ :key="item"
120
+ >
121
+ <SelectItem
122
+ :value="item"
155
123
  :size
156
- v-bind="{ ...props._selectLabel, ...group._selectLabel }"
124
+ :select-item
125
+ v-bind="props._selectItem"
126
+ :is-selected="isItemSelected(item, modelValue)"
157
127
  :una
158
128
  >
159
- <slot name="label" :label="group.label">
160
- {{ group.label }}
129
+ <slot name="item" :item="item">
130
+ {{ props.itemKey && item ? (item as any)[props.itemKey] : item }}
161
131
  </slot>
162
- </SelectLabel>
132
+ </SelectItem>
133
+ </template>
134
+ </template>
163
135
 
164
- <template
165
- v-for="item in group.items"
166
- :key="item"
167
- >
168
- <SelectItem
169
- :value="item"
136
+ <template v-if="group">
137
+ <SelectGroup
138
+ v-for="(group, i) in items as SelectGroupType<T>[]"
139
+ :key="i"
140
+ v-bind="props._selectGroup"
141
+ :una
142
+ >
143
+ <SelectSeparator
144
+ v-if="i > 0"
145
+ v-bind="props._selectSeparator"
146
+ :una
147
+ />
148
+
149
+ <slot name="group" :items="group">
150
+ <SelectLabel
151
+ v-if="group.label"
170
152
  :size
171
- :select-item
172
- v-bind="{ ..._selectItem, ...group._selectItem }"
173
- :is-selected="isItemSelected(item, modelValue)"
153
+ v-bind="{ ...props._selectLabel, ...group._selectLabel }"
174
154
  :una
175
155
  >
176
- <slot name="item" :item="item">
177
- {{ props.itemKey ? (item as any)[props.itemKey] : item }}
156
+ <slot name="label" :label="group.label">
157
+ {{ group.label }}
178
158
  </slot>
179
- </SelectItem>
180
- </template>
181
- </slot>
182
- </SelectGroup>
183
- </template>
184
- <slot />
185
- </slot>
186
- </SelectContent>
159
+ </SelectLabel>
160
+
161
+ <template
162
+ v-for="item in group.items"
163
+ :key="item"
164
+ >
165
+ <SelectItem
166
+ :value="item"
167
+ :size
168
+ :select-item
169
+ v-bind="{ ..._selectItem, ...group._selectItem }"
170
+ :is-selected="isItemSelected(item, modelValue)"
171
+ :una
172
+ >
173
+ <slot name="item" :item="item">
174
+ {{ props.itemKey ? (item as any)[props.itemKey] : item }}
175
+ </slot>
176
+ </SelectItem>
177
+ </template>
178
+ </slot>
179
+ </SelectGroup>
180
+ </template>
181
+ <slot />
182
+ </slot>
183
+ </SelectContent>
184
+ </slot>
187
185
  </SelectRoot>
188
186
  </template>
@@ -59,7 +59,7 @@ const status = computed(() => props.status ?? 'default')
59
59
  props.una?.selectTriggerLeading,
60
60
  ),
61
61
  btnTrailing: cn(
62
- 'select-trigger-trailing',
62
+ 'select-trigger-trailing rtl:mr-auto ltr:ml-auto',
63
63
  props.una?.btnTrailing,
64
64
  props.una?.selectTriggerTrailing,
65
65
  ),
@@ -5,7 +5,6 @@ interface BaseExtensions {
5
5
  class?: HTMLAttributes['class'];
6
6
  size?: HTMLAttributes['class'];
7
7
  }
8
- type RootExtensions = SelectRootProps & BaseExtensions;
9
8
  type TriggerExtensions = SelectTriggerProps & Omit<NButtonProps, 'una'> & BaseExtensions;
10
9
  type ValueExtensions = SelectValueProps & BaseExtensions;
11
10
  type ScrollDownButtonExtensions = SelectScrollDownButtonProps & BaseExtensions;
@@ -16,7 +15,7 @@ type ItemTextExtensions = SelectItemTextProps & BaseExtensions;
16
15
  type GroupExtensions = SelectGroupProps & BaseExtensions;
17
16
  type LabelExtensions = SelectLabelProps & BaseExtensions;
18
17
  type SeparatorExtensions = SelectSeparatorProps & BaseExtensions;
19
- type SelectExtensions = NSelectRootProps & BaseExtensions & Pick<NSelectValueProps, 'placeholder'> & Pick<NSelectItemProps, 'selectItem'> & Pick<NSelectTriggerProps, 'status' | 'select' | 'id'>;
18
+ type SelectExtensions = SelectRootProps & BaseExtensions & Pick<NSelectValueProps, 'placeholder'> & Pick<NSelectItemProps, 'selectItem'> & Pick<NSelectTriggerProps, 'status' | 'select' | 'id'>;
20
19
  export interface SelectGroup<T extends AcceptableValue> {
21
20
  label?: string;
22
21
  items: T[];
@@ -60,11 +59,6 @@ export interface NSelectProps<T extends AcceptableValue> extends SelectExtension
60
59
  _selectLabel?: Partial<NSelectLabelProps>;
61
60
  una?: NSelectUnaProps;
62
61
  }
63
- export interface NSelectRootProps extends RootExtensions {
64
- una?: {
65
- selectRoot?: HTMLAttributes['class'];
66
- };
67
- }
68
62
  export interface NSelectTriggerProps extends TriggerExtensions {
69
63
  /**
70
64
  * The unique id of the select trigger to be used for the form field.
@@ -131,7 +125,6 @@ export interface NSelectSeparator extends SeparatorExtensions {
131
125
  }
132
126
  export interface NSelectUnaProps {
133
127
  select?: HTMLAttributes['class'];
134
- selectRoot?: HTMLAttributes['class'];
135
128
  selectTrigger?: HTMLAttributes['class'];
136
129
  selectTriggerTrailing?: HTMLAttributes['class'];
137
130
  selectTriggerTrailingIcon?: HTMLAttributes['class'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.42.0",
4
+ "version": "0.43.0",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -48,8 +48,8 @@
48
48
  "typescript": "5.6.3",
49
49
  "unocss": "^66.0.0",
50
50
  "unocss-preset-animations": "^1.1.1",
51
- "@una-ui/extractor-vue-script": "^0.42.0",
52
- "@una-ui/preset": "^0.42.0"
51
+ "@una-ui/preset": "^0.43.0",
52
+ "@una-ui/extractor-vue-script": "^0.43.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@iconify-json/lucide": "^1.2.30",
@@ -1,27 +0,0 @@
1
- <script setup lang="ts">
2
- import type { SelectRootEmits } from 'reka-ui'
3
- import type { NSelectRootProps } from '../../../types'
4
- import { SelectRoot, useForwardPropsEmits } from 'reka-ui'
5
- import { cn } from '../../../utils'
6
-
7
- const props = defineProps<NSelectRootProps>()
8
- const emits = defineEmits<SelectRootEmits>()
9
-
10
- const forwarded = useForwardPropsEmits(props, emits)
11
- </script>
12
-
13
- <template>
14
- <SelectRoot
15
- v-slot="slotProps"
16
- :class="cn(
17
- 'select-root',
18
- props.una?.selectRoot,
19
- props.class,
20
- )"
21
- v-bind="forwarded"
22
- >
23
- <slot
24
- v-bind="slotProps"
25
- />
26
- </SelectRoot>
27
- </template>