vueless 0.0.546 → 0.0.548

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.546",
3
+ "version": "0.0.548",
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
@@ -86,10 +86,11 @@ const currentLocale = computed(() => merge(defaultConfig.i18n, i18nGlobal, props
86
86
 
87
87
  const elementId = props.id || useId();
88
88
 
89
- const { config, inputAttrs, activeInputAttrs, calendarAttrs, wrapperAttrs } = useAttrs(props, {
90
- isTop,
91
- isRight,
92
- });
89
+ const { config, datepickerInputAttrs, datepickerInputActiveAttrs, calendarAttrs, wrapperAttrs } =
90
+ useAttrs(props, {
91
+ isTop,
92
+ isRight,
93
+ });
93
94
 
94
95
  function activate() {
95
96
  isShownCalendar.value = true;
@@ -195,7 +196,7 @@ defineExpose({
195
196
  :size="size"
196
197
  :left-icon="leftIcon"
197
198
  :right-icon="rightIcon"
198
- v-bind="isShownCalendar ? activeInputAttrs : inputAttrs"
199
+ v-bind="isShownCalendar ? datepickerInputActiveAttrs : datepickerInputAttrs"
199
200
  @focus="activate"
200
201
  >
201
202
  <template #left>
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "relative",
3
- input: "{UInput}",
4
- activeInput: {
3
+ datepickerInput: "{UInput}",
4
+ datepickerInputActive: {
5
5
  component: "{UInput}",
6
6
  wrapper: "ring-dynamic rounded-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
7
7
  },
@@ -134,14 +134,14 @@ const {
134
134
  config,
135
135
  wrapperAttrs,
136
136
  calendarAttrs,
137
- inputAttrs,
137
+ datepickerInputAttrs,
138
138
  menuAttrs,
139
139
  buttonWrapperAttrs,
140
140
  buttonAttrs,
141
141
  shiftRangeButtonAttrs,
142
142
  rangeInputWrapperAttrs,
143
143
  rangeInputErrorAttrs,
144
- activeInputAttrs,
144
+ datepickerActiveInputAttrs,
145
145
  rangeInputFirstAttrs,
146
146
  rangeInputLastAttrs,
147
147
  periodRowAttrs,
@@ -570,7 +570,7 @@ function onInputCalendar(value: RangeDate) {
570
570
  readonly
571
571
  :left-icon="leftIcon"
572
572
  :right-icon="rightIcon"
573
- v-bind="isShownMenu ? activeInputAttrs : inputAttrs"
573
+ v-bind="isShownMenu ? datepickerActiveInputAttrs : datepickerInputAttrs"
574
574
  @focus="activate"
575
575
  >
576
576
  <template #left>
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "relative",
3
- input: "{UInput}",
4
- activeInput: {
3
+ datepickerInput: "{UInput}",
4
+ datepickerInputActive: {
5
5
  component: "{UInput}",
6
6
  wrapper: {
7
7
  base: "ring-dynamic rounded-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.546",
4
+ "version": "0.0.548",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -10478,6 +10478,18 @@
10478
10478
  }
10479
10479
  ]
10480
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
+ },
10481
10493
  {
10482
10494
  "name": "clickCell",
10483
10495
  "description": "Triggers when the cell is clicked.",
@@ -10717,7 +10729,10 @@
10717
10729
  "name": "click"
10718
10730
  },
10719
10731
  {
10720
- "name": "click-cell"
10732
+ "name": "dblclick"
10733
+ },
10734
+ {
10735
+ "name": "clickCell"
10721
10736
  }
10722
10737
  ],
10723
10738
  "slots": [