vueless 0.0.704 → 0.0.706

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.704",
3
+ "version": "0.0.706",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -227,7 +227,7 @@ watch(
227
227
  },
228
228
  { deep: true },
229
229
  );
230
- watch(() => tableRows.value.length, updateSelectedRows);
230
+ watch(() => tableRows.value, updateSelectedRows, { deep: true });
231
231
  watch(() => props.rows, synchronizeTableItemsWithProps, { deep: true });
232
232
  watch(isHeaderSticky, setHeaderCellWidth);
233
233
  watch(isFooterSticky, (newValue) =>
@@ -326,7 +326,17 @@ function synchronizeTableItemsWithProps() {
326
326
  }
327
327
 
328
328
  function updateSelectedRows() {
329
- selectedRows.value = tableRows.value.filter((row) => row.isChecked).map((row) => row.id);
329
+ const newSelectedRows = tableRows.value.filter((row) => row.isChecked).map((row) => row.id);
330
+ const isNewRowsSelected = newSelectedRows.every((newRow) => selectedRows.value.includes(newRow));
331
+ const isSelectedSameRows = selectedRows.value.every((selectedRow) =>
332
+ newSelectedRows.includes(selectedRow),
333
+ );
334
+
335
+ if (isNewRowsSelected && isSelectedSameRows) {
336
+ return;
337
+ }
338
+
339
+ selectedRows.value = newSelectedRows;
330
340
  }
331
341
 
332
342
  function onKeyupEsc(event: KeyboardEvent) {
@@ -73,7 +73,13 @@ const { config, getDataTest, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs,
73
73
  </script>
74
74
 
75
75
  <template>
76
- <div v-click-outside="hideOptions" v-bind="wrapperAttrs">
76
+ <div
77
+ v-click-outside="hideOptions"
78
+ tabindex="1"
79
+ v-bind="wrapperAttrs"
80
+ @keydown.enter="onClickLink"
81
+ @keydown.space.prevent="onClickLink"
82
+ >
77
83
  <!--
78
84
  @slot Use it to add something before the label.
79
85
  @binding {boolean} opened
@@ -82,6 +88,7 @@ const { config, getDataTest, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs,
82
88
 
83
89
  <ULink
84
90
  :id="elementId"
91
+ tabindex="-1"
85
92
  :size="size"
86
93
  :label="label"
87
94
  :color="color"
@@ -91,8 +98,6 @@ const { config, getDataTest, wrapperAttrs, dropdownLinkAttrs, dropdownListAttrs,
91
98
  v-bind="dropdownLinkAttrs"
92
99
  :data-test="getDataTest()"
93
100
  @click="onClickLink"
94
- @keydown.enter="onClickLink"
95
- @keydown.space.prevent="onClickLink"
96
101
  >
97
102
  <template #default>
98
103
  <!--
@@ -1,13 +1,20 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "relative inline-flex items-center rounded",
3
+ base: `
4
+ relative inline-flex items-center outline-0 rounded
5
+ focus-visible:ring-dynamic focus-visible:ring-offset-4 focus-visible:ring-{color}-600
6
+ `,
4
7
  variants: {
8
+ color: {
9
+ grayscale: "focus-visible:ring-gray-900",
10
+ white: "focus-visible:ring-white",
11
+ },
5
12
  opened: {
6
13
  true: "group",
7
14
  },
8
15
  },
9
16
  },
10
- dropdownLink: "{ULink}",
17
+ dropdownLink: "{ULink} focus-visible:ring-offset-0 focus-visible:ring-0",
11
18
  toggleIcon: {
12
19
  base: "{UIcon} block transition duration-300 group-[]:rotate-180",
13
20
  variants: {