vueless 0.0.545 → 0.0.547

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.545",
3
+ "version": "0.0.547",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -61,6 +61,12 @@ const emit = defineEmits([
61
61
  */
62
62
  "clickRow",
63
63
 
64
+ /**
65
+ * Triggers when the row is double-clicked.
66
+ * @property {object} row
67
+ */
68
+ "doubleClickRow",
69
+
64
70
  /**
65
71
  * Triggers when the cell is clicked.
66
72
  * @property {object} cell
@@ -394,6 +400,10 @@ function onClickRow(row: Row) {
394
400
  emit("clickRow", row);
395
401
  }
396
402
 
403
+ function onDoubleClickRow(row: Row) {
404
+ emit("doubleClickRow", row);
405
+ }
406
+
397
407
  function onClickCell(cell: Cell, row: Row) {
398
408
  emit("clickCell", cell, row);
399
409
  }
@@ -665,6 +675,7 @@ defineExpose({
665
675
  :empty-cell-label="emptyCellLabel"
666
676
  :data-test="`${dataTest}-row`"
667
677
  @click="onClickRow"
678
+ @dblclick="onDoubleClickRow"
668
679
  @click-cell="onClickCell"
669
680
  @toggle-row-visibility="onToggleRowVisibility"
670
681
  >
@@ -22,7 +22,7 @@ const LAST_NESTED_ROW_SHIFT_REM = 2;
22
22
 
23
23
  const props = defineProps<UTableRowProps>();
24
24
 
25
- const emit = defineEmits(["toggleRowVisibility", "click", "click-cell"]);
25
+ const emit = defineEmits(["toggleRowVisibility", "click", "dblclick", "clickCell"]);
26
26
 
27
27
  const selectedRows = defineModel("selectedRows", { type: Array, default: () => [] });
28
28
 
@@ -103,7 +103,7 @@ function getIconWidth() {
103
103
  }
104
104
 
105
105
  function getCellClasses(row: Row, key: string) {
106
- const isCellData = typeof row[key] === "object" && "class" in row[key];
106
+ const isCellData = typeof row[key] === "object" && row[key] !== null && "class" in row[key];
107
107
  const cell = row[key] as CellObject;
108
108
  const cellClasses = isCellData ? cell?.class : undefined;
109
109
 
@@ -155,6 +155,10 @@ function onClick(row: Row) {
155
155
  emit("click", row);
156
156
  }
157
157
 
158
+ function onDoubleClick(row: Row) {
159
+ emit("dblclick", row);
160
+ }
161
+
158
162
  function setCellTitle(mutations: MutationRecord[]) {
159
163
  mutations.forEach((mutation) => {
160
164
  const { target } = mutation;
@@ -196,7 +200,7 @@ function onClickToggleIcon() {
196
200
  }
197
201
 
198
202
  function onClickCell(cell: unknown | string | number, row: Row) {
199
- emit("click-cell", cell, row);
203
+ emit("clickCell", cell, row);
200
204
  }
201
205
 
202
206
  function getRowClasses(row: Row) {
@@ -217,6 +221,7 @@ function getRowAttrs(rowId: string | number) {
217
221
  v-bind="{ ...$attrs, ...getRowAttrs(row.id) }"
218
222
  :class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
219
223
  @click="onClick(props.row)"
224
+ @dblclick="onDoubleClick(props.row)"
220
225
  >
221
226
  <td
222
227
  v-if="selectable"
@@ -326,6 +331,7 @@ function getRowAttrs(rowId: string | number) {
326
331
  :empty-cell-label="emptyCellLabel"
327
332
  @toggle-row-visibility="onClickToggleRowChild"
328
333
  @click="onClick"
334
+ @dblclick="onDoubleClick"
329
335
  >
330
336
  <template
331
337
  v-for="(value, key, index) in mapRowColumns(singleNestedRow, columns)"
@@ -356,6 +362,7 @@ function getRowAttrs(rowId: string | number) {
356
362
  :empty-cell-label="emptyCellLabel"
357
363
  @toggle-row-visibility="onClickToggleRowChild"
358
364
  @click="onClick"
365
+ @dblclick="onDoubleClick"
359
366
  @click-cell="onClickCell"
360
367
  >
361
368
  <template
@@ -19,7 +19,6 @@ import type { Option } from "../ui.dropdown-list/types.ts";
19
19
  defineOptions({ inheritAttrs: false });
20
20
 
21
21
  const props = withDefaults(defineProps<UDropdownBadgeProps>(), {
22
- label: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).label,
23
22
  options: () => [],
24
23
  labelKey: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).labelKey,
25
24
  variant: getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).variant,
@@ -19,7 +19,6 @@ import type { Option } from "../ui.dropdown-list/types.ts";
19
19
  defineOptions({ inheritAttrs: false });
20
20
 
21
21
  const props = withDefaults(defineProps<UDropdownButtonProps>(), {
22
- label: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).label,
23
22
  options: () => [],
24
23
  labelKey: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).labelKey,
25
24
  variant: getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).variant,
@@ -20,7 +20,6 @@ defineOptions({ inheritAttrs: false });
20
20
 
21
21
  const props = withDefaults(defineProps<UDropdownLinkProps>(), {
22
22
  options: () => [],
23
- label: getDefault<UDropdownLinkProps>(defaultConfig, UDropdownLink).label,
24
23
  labelKey: getDefault<UDropdownLinkProps>(defaultConfig, UDropdownLink).labelKey,
25
24
  color: getDefault<UDropdownLinkProps>(defaultConfig, UDropdownLink).color,
26
25
  size: getDefault<UDropdownLinkProps>(defaultConfig, UDropdownLink).size,
@@ -116,7 +116,19 @@ watch(
116
116
  })
117
117
  .reduce((acc, cur) => acc + cur, 0);
118
118
 
119
- wrapperMaxHeight.value = `${maxHeight + 10}px`;
119
+ const wrapperStyle = getComputedStyle(wrapperRef.value as Element);
120
+ const wrapperPaddingTop = parseFloat(wrapperStyle.paddingTop || "0");
121
+ const wrapperPaddingBottom = parseFloat(wrapperStyle.paddingBottom || "0");
122
+ const wrapperBorderTop = parseFloat(wrapperStyle.borderTopWidth || "0");
123
+ const wrapperBorderBottom = parseFloat(wrapperStyle.borderBottomWidth || "0");
124
+
125
+ wrapperMaxHeight.value = `${
126
+ maxHeight +
127
+ wrapperPaddingTop +
128
+ wrapperPaddingBottom +
129
+ wrapperBorderTop +
130
+ wrapperBorderBottom
131
+ }px`;
120
132
  });
121
133
  },
122
134
  { immediate: true },
@@ -1,16 +1,16 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: `
3
- my-2 flex w-full absolute right-0 z-50
4
- rounded-dynamic border border-gray-300 bg-white shadow
3
+ my-2 p-1 flex w-full absolute z-50 shadow
4
+ rounded-dynamic border border-gray-300 bg-white
5
5
  overflow-auto [-webkit-overflow-scrolling:touch]
6
6
  focus:outline-none
7
7
  `,
8
- list: "m-1 p-0 inline-block list-none align-top w-full",
8
+ list: "list-none align-top w-full h-full",
9
9
  listItem: "group/item block",
10
10
  option: {
11
11
  base: `
12
12
  rounded px-2 py-2.5 flex items-center align-middle whitespace-nowrap cursor-pointer
13
- font-normal !leading-none normal-case text-gray-900
13
+ font-normal !leading-none text-gray-900
14
14
  hover:bg-brand-50 active:bg-brand-100
15
15
  overflow-hidden text-ellipsis
16
16
  `,
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.545",
4
+ "version": "0.0.547",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -3955,8 +3955,7 @@
3955
3955
  "value": {
3956
3956
  "kind": "expression",
3957
3957
  "type": "string"
3958
- },
3959
- "default": "getDefault<UDropdownBadgeProps>(defaultConfig, UDropdownBadge).label"
3958
+ }
3960
3959
  },
3961
3960
  {
3962
3961
  "name": "options",
@@ -4191,8 +4190,7 @@
4191
4190
  "value": {
4192
4191
  "kind": "expression",
4193
4192
  "type": "string"
4194
- },
4195
- "default": "getDefault<UDropdownButtonProps>(defaultConfig, UDropdownButton).label"
4193
+ }
4196
4194
  },
4197
4195
  {
4198
4196
  "name": "options",
@@ -4461,8 +4459,7 @@
4461
4459
  "value": {
4462
4460
  "kind": "expression",
4463
4461
  "type": "string"
4464
- },
4465
- "default": "getDefault<UDropdownLinkProps>(defaultConfig, UDropdownLink).label"
4462
+ }
4466
4463
  },
4467
4464
  {
4468
4465
  "name": "options",
@@ -10481,6 +10478,18 @@
10481
10478
  }
10482
10479
  ]
10483
10480
  },
10481
+ {
10482
+ "name": "doubleClickRow",
10483
+ "description": "Triggers when the row is double-clicked.",
10484
+ "properties": [
10485
+ {
10486
+ "type": [
10487
+ "object"
10488
+ ],
10489
+ "name": "row"
10490
+ }
10491
+ ]
10492
+ },
10484
10493
  {
10485
10494
  "name": "clickCell",
10486
10495
  "description": "Triggers when the cell is clicked.",
@@ -10720,7 +10729,10 @@
10720
10729
  "name": "click"
10721
10730
  },
10722
10731
  {
10723
- "name": "click-cell"
10732
+ "name": "dblclick"
10733
+ },
10734
+ {
10735
+ "name": "clickCell"
10724
10736
  }
10725
10737
  ],
10726
10738
  "slots": [