vueless 0.0.542 → 0.0.543

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.542",
3
+ "version": "0.0.543",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -80,7 +80,7 @@ const addOptionKeyCombination = computed(() => {
80
80
  return isMac ? "(⌘ + Enter)" : "(Ctrl + Enter)";
81
81
  });
82
82
 
83
- const wrapperHeight = computed(() => {
83
+ const wrapperMaxHeight = computed(() => {
84
84
  if (!optionsRef.value?.length) return "auto";
85
85
 
86
86
  const maxHeight = optionsRef.value
@@ -88,7 +88,7 @@ const wrapperHeight = computed(() => {
88
88
  .map((el) => el.getBoundingClientRect().height)
89
89
  .reduce((acc, cur) => acc + cur, 0);
90
90
 
91
- return props.visibleOptions === undefined ? "auto" : `${maxHeight + 10}px`;
91
+ return !props.visibleOptions ? "auto" : `${maxHeight + 10}px`;
92
92
  });
93
93
 
94
94
  function onClickAddOption() {
@@ -202,7 +202,7 @@ defineExpose({
202
202
  <div
203
203
  ref="wrapper"
204
204
  tabindex="1"
205
- :style="{ maxHeight: wrapperHeight }"
205
+ :style="{ maxHeight: wrapperMaxHeight }"
206
206
  v-bind="wrapperAttrs"
207
207
  @keydown.self.down.prevent="pointerForward"
208
208
  @keydown.self.up.prevent="pointerBackward"
@@ -267,21 +267,30 @@ defineExpose({
267
267
  </template>
268
268
  </li>
269
269
 
270
- <div v-if="!options.length" v-bind="optionAttrs">
270
+ <li
271
+ v-if="!options.length"
272
+ ref="option"
273
+ v-bind="optionAttrs"
274
+ @mouseenter.self="pointerSet(options.length + 1)"
275
+ >
271
276
  <!-- @slot Use it to add something instead of empty state. -->
272
277
  <slot name="empty">
273
278
  <span v-bind="optionContentAttrs" v-text="currentLocale.noDataToShow" />
274
279
  </slot>
275
- </div>
280
+ </li>
276
281
 
277
282
  <!-- Add button -->
278
283
  <template v-if="addOption">
279
- <div v-bind="addOptionLabelWrapperAttrs" @click="onClickAddOption">
280
- <div v-bind="addOptionLabelAttrs">
284
+ <li
285
+ v-bind="addOptionLabelWrapperAttrs"
286
+ @click="onClickAddOption"
287
+ @mouseenter.self="pointerSet(options.length + 1)"
288
+ >
289
+ <span v-bind="addOptionLabelAttrs">
281
290
  {{ currentLocale.add }}
282
291
  <span v-bind="addOptionLabelHotkeyAttrs" v-text="addOptionKeyCombination" />
283
- </div>
284
- </div>
292
+ </span>
293
+ </li>
285
294
 
286
295
  <UButton round square v-bind="addOptionButtonAttrs" @click="onClickAddOption">
287
296
  <UIcon
@@ -49,13 +49,10 @@ export default /*tw*/ {
49
49
  },
50
50
  },
51
51
  },
52
- addOptionLabelWrapper: `
53
- flex items-center justify-between cursor-pointer p-3 hover:bg-brand-50
54
- active:bg-brand-100 active:font-medium -mb-6
55
- `,
56
- addOptionLabel: "text-sm font-medium text-gray-900",
52
+ addOptionLabelWrapper: "-mb-[1.375rem] active:bg-brand-100",
53
+ addOptionLabel: "text-sm leading-none font-medium text-gray-900",
57
54
  addOptionLabelHotkey: "text-gray-500",
58
- addOptionButton: "{UButton} sticky left-[calc(100%-2.3rem)] bottom-2.5 p-1",
55
+ addOptionButton: "{UButton} !leading-none sticky left-[calc(100%-2.15rem)] bottom-2 p-1",
59
56
  addOptionIcon: "{UIcon} bg-transparent",
60
57
  i18n: {
61
58
  noDataToShow: "No data to show.",
@@ -65,7 +62,6 @@ export default /*tw*/ {
65
62
  size: "md",
66
63
  labelKey: "label",
67
64
  valueKey: "id",
68
- optionHeight: 40,
69
65
  visibleOptions: undefined,
70
66
  disabled: false,
71
67
  addOption: false,
@@ -16,6 +16,9 @@ export default function useAttrs(props: UDropdownListProps): UseAttrs<Config> {
16
16
  const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
17
17
 
18
18
  const keysAttrs = getKeysAttrs({}, [], {
19
+ addOptionLabelWrapper: {
20
+ base: computed(() => [extendingKeysClasses.option.value]),
21
+ },
19
22
  group: {
20
23
  base: computed(() => [extendingKeysClasses.option.value]),
21
24
  },
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.542",
4
+ "version": "0.0.543",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",