vueless 0.0.436 → 0.0.437

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.436",
3
+ "version": "0.0.437",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -181,8 +181,6 @@
181
181
  :columns="columns"
182
182
  :config="config"
183
183
  :attrs="keysAttrs"
184
- v-bind="getRowAttrs(row.id)"
185
- :class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
186
184
  @click="onClickRow"
187
185
  @click-cell="onClickCell"
188
186
  @toggle-row-visibility="onToggleRowVisibility"
@@ -526,8 +524,6 @@ const {
526
524
  bodyRowAfterCellAttrs,
527
525
  bodyRowBeforeAttrs,
528
526
  bodyRowBeforeCellAttrs,
529
- bodyRowAttrs,
530
- bodyRowCheckedAttrs,
531
527
  footerAttrs,
532
528
  bodyRowDateDividerAttrs,
533
529
  headerCellBaseAttrs,
@@ -614,16 +610,6 @@ function getDateDividerLabel(rowDate) {
614
610
  : rowDate;
615
611
  }
616
612
 
617
- function getRowAttrs(rowId) {
618
- return selectedRows.value.includes(rowId) ? bodyRowCheckedAttrs.value : bodyRowAttrs.value;
619
- }
620
-
621
- function getRowClasses(row) {
622
- const rowClasses = row?.class || "";
623
-
624
- return typeof rowClasses === "function" ? rowClasses(row) : rowClasses;
625
- }
626
-
627
613
  function setFooterCellWidth(width) {
628
614
  const ZERO_WIDTH = 0;
629
615
 
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <tr v-bind="$attrs" @click="onClick(props.row)">
2
+ <tr
3
+ v-bind="{ ...$attrs, ...getRowAttrs(row.id) }"
4
+ :class="cx([getRowAttrs(row.id).class, getRowClasses(row)])"
5
+ @click="onClick(props.row)"
6
+ >
3
7
  <td
4
8
  v-if="selectable"
5
9
  :style="getNestedCheckboxShift()"
@@ -79,8 +83,12 @@
79
83
 
80
84
  <UTableRow
81
85
  v-if="isSingleNestedRow && row.row && !row.row.isHidden && !row.nestedData"
82
- v-bind="$attrs"
86
+ v-bind="{
87
+ ...$attrs,
88
+ ...getRowAttrs(row.row.id),
89
+ }"
83
90
  v-model:selected-rows="selectedRows"
91
+ :class="cx([getRowAttrs(row.row.id).class, getRowClasses(row.row)])"
84
92
  :attrs="attrs"
85
93
  :columns="columns"
86
94
  :row="row.row"
@@ -104,8 +112,12 @@
104
112
  <template v-for="nestedRow in row.row" :key="nestedRow.id">
105
113
  <UTableRow
106
114
  v-if="!nestedRow.isHidden"
107
- v-bind="$attrs"
115
+ v-bind="{
116
+ ...$attrs,
117
+ ...getRowAttrs(nestedRow.id),
118
+ }"
108
119
  v-model:selected-rows="selectedRows"
120
+ :class="cx([getRowAttrs(nestedRow.id).class, getRowClasses(nestedRow)])"
109
121
  :attrs="attrs"
110
122
  :columns="columns"
111
123
  :row="nestedRow"
@@ -210,7 +222,9 @@ const {
210
222
  } = props.attrs;
211
223
 
212
224
  const toggleIconConfig = computed(() =>
213
- props.row?.row?.isHidden ? bodyCellNestedExpandIconAttrs : bodyCellNestedCollapseIconAttrs,
225
+ props.row?.row?.isHidden
226
+ ? bodyCellNestedExpandIconAttrs.value
227
+ : bodyCellNestedCollapseIconAttrs.value,
214
228
  );
215
229
 
216
230
  const shift = computed(() => (props.row.row ? 1.5 : 2));
@@ -304,4 +318,16 @@ function onClickToggleIcon() {
304
318
  function onClickCell(cell, row) {
305
319
  emit("click-cell", cell, row);
306
320
  }
321
+
322
+ function getRowClasses(row) {
323
+ const rowClasses = row?.class || "";
324
+
325
+ return typeof rowClasses === "function" ? rowClasses(row) : rowClasses;
326
+ }
327
+
328
+ function getRowAttrs(rowId) {
329
+ return selectedRows.value.includes(rowId)
330
+ ? props.attrs.bodyRowCheckedAttrs.value
331
+ : props.attrs.bodyRowAttrs.value;
332
+ }
307
333
  </script>
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.436",
4
+ "version": "0.0.437",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",