@redseed/redseed-ui-vue3 6.4.5 → 6.4.7

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": "@redseed/redseed-ui-vue3",
3
- "version": "6.4.5",
3
+ "version": "6.4.7",
4
4
  "description": "RedSeed UI Vue 3 components",
5
5
  "main": "index.js",
6
6
  "repository": "https://github.com/redseedtraining/redseed-ui",
@@ -21,6 +21,10 @@ const props = defineProps({
21
21
  return value.every(row => typeof row === 'object' && row.id && (row.clickable === undefined || typeof row.clickable === 'boolean'))
22
22
  },
23
23
  },
24
+ fixedColumns: {
25
+ type: Boolean,
26
+ default: false,
27
+ },
24
28
  clickableRows: {
25
29
  type: Boolean,
26
30
  default: false,
@@ -68,7 +72,13 @@ const props = defineProps({
68
72
  </template>
69
73
 
70
74
  <div v-if="!!rows.length"
71
- class="rsui-table"
75
+ :class="[
76
+ 'rsui-table',
77
+ {
78
+ 'rsui-table--auto': !fixedColumns,
79
+ 'rsui-table--fixed': fixedColumns,
80
+ },
81
+ ]"
72
82
  >
73
83
  <div class="rsui-table__container">
74
84
  <table>
@@ -78,6 +88,8 @@ const props = defineProps({
78
88
  :key="column.key"
79
89
  scope="col"
80
90
  :alignment="column?.alignment"
91
+ :fixed="fixedColumns"
92
+ :width="column?.width"
81
93
  :sort="column?.sort"
82
94
  @sort="$emit('sort', { column: { ...column, ...$event } })"
83
95
  >
@@ -99,6 +111,7 @@ const props = defineProps({
99
111
  <Td v-for="column in columns"
100
112
  :key="column.key"
101
113
  :alignment="column?.alignment"
114
+ :fixed="fixedColumns"
102
115
  >
103
116
  <slot :name="'td-' + column.key"
104
117
  :row="row"
@@ -125,8 +138,20 @@ const props = defineProps({
125
138
  .rsui-table {
126
139
  @apply w-full;
127
140
 
141
+ &--auto {
142
+ table {
143
+ @apply table-auto;
144
+ }
145
+ }
146
+
147
+ &--fixed {
148
+ table {
149
+ @apply table-fixed;
150
+ }
151
+ }
152
+
128
153
  table {
129
- @apply w-full border-collapse table-auto;
154
+ @apply w-full border-collapse;
130
155
 
131
156
  thead {
132
157
  tr {
@@ -134,7 +159,7 @@ const props = defineProps({
134
159
 
135
160
  th {
136
161
  @apply bg-background-disabled;
137
- @apply font-semibold text-xs leading-5 text-text-secondary hover:text-text-primary;
162
+ @apply font-semibold text-xs leading-6 text-text-secondary hover:text-text-primary;
138
163
  }
139
164
  }
140
165
  }
@@ -5,6 +5,10 @@ const props = defineProps({
5
5
  default: 'left',
6
6
  validator: value => ['left', 'center', 'right'].includes(value),
7
7
  },
8
+ fixed: {
9
+ type: Boolean,
10
+ default: false,
11
+ },
8
12
  })
9
13
  </script>
10
14
 
@@ -14,6 +18,8 @@ const props = defineProps({
14
18
  {
15
19
  'rsui-td--center': alignment === 'center',
16
20
  'rsui-td--right': alignment === 'right',
21
+ 'rsui-td--auto': !fixed,
22
+ 'rsui-td--fixed': fixed,
17
23
  },
18
24
  ]">
19
25
  <slot></slot>
@@ -21,8 +27,8 @@ const props = defineProps({
21
27
  </template>
22
28
  <style lang="scss" scoped>
23
29
  .rsui-td {
24
- @apply text-left whitespace-nowrap;
25
- @apply py-3 px-6 text-sm leading-6 text-text-secondary;
30
+ @apply text-left;
31
+ @apply py-3 px-5 text-sm leading-6 text-text-secondary;
26
32
 
27
33
  &--center {
28
34
  @apply text-center;
@@ -30,5 +36,13 @@ const props = defineProps({
30
36
  &--right {
31
37
  @apply text-right;
32
38
  }
39
+
40
+ &--auto {
41
+ @apply whitespace-nowrap;
42
+ }
43
+
44
+ &--fixed {
45
+ @apply whitespace-normal overflow-scroll overscroll-contain;
46
+ }
33
47
  }
34
48
  </style>
@@ -8,6 +8,15 @@ const props = defineProps({
8
8
  default: 'left',
9
9
  validator: value => ['left', 'center', 'right'].includes(value),
10
10
  },
11
+ fixed: {
12
+ type: Boolean,
13
+ default: false,
14
+ },
15
+ width: {
16
+ type: String,
17
+ default: 'md',
18
+ validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value),
19
+ },
11
20
  sort: {
12
21
  type: [Boolean, String],
13
22
  default: false,
@@ -46,6 +55,13 @@ function handleSort() {
46
55
  {
47
56
  'rsui-th--center': alignment === 'center',
48
57
  'rsui-th--right': alignment === 'right',
58
+ 'rsui-th--auto': !fixed,
59
+ 'rsui-th--fixed': fixed,
60
+ 'rsui-th--xs': fixed && width === 'xs',
61
+ 'rsui-th--sm': fixed && width === 'sm',
62
+ 'rsui-th--md': fixed && width === 'md',
63
+ 'rsui-th--lg': fixed && width === 'lg',
64
+ 'rsui-th--xl': fixed && width === 'xl',
49
65
  'rsui-th--sortable': sortable,
50
66
  },
51
67
  ]"
@@ -75,29 +91,59 @@ function handleSort() {
75
91
  </template>
76
92
  <style lang="scss" scoped>
77
93
  .rsui-th {
78
- @apply text-left whitespace-nowrap;
79
- @apply py-3 px-6 text-sm leading-6 text-text-secondary;
94
+ @apply text-left;
95
+ @apply py-3 px-5 text-sm leading-6 text-text-secondary;
80
96
 
81
97
  &--center {
82
98
  @apply text-center;
83
99
  }
100
+
84
101
  &--right {
85
102
  @apply text-right;
86
103
  }
104
+
105
+ &--auto {
106
+ @apply whitespace-nowrap;
107
+ }
108
+
109
+ &--fixed {
110
+ @apply whitespace-normal break-all;
111
+ }
112
+
113
+ &--xs {
114
+ @apply w-28;
115
+ }
116
+
117
+ &--sm {
118
+ @apply w-40;
119
+ }
120
+
121
+ &--md {
122
+ @apply w-56;
123
+ }
124
+
125
+ &--lg {
126
+ @apply w-72;
127
+ }
128
+
129
+ &--xl {
130
+ @apply w-96;
131
+ }
132
+
87
133
  &--sortable {
88
134
  @apply cursor-pointer;
89
135
  }
90
136
 
91
137
  &__content {
92
- @apply inline-flex items-center gap-1;
138
+ @apply inline-flex gap-1;
93
139
  }
94
140
 
95
141
  &__sort {
96
- @apply shrink-0;
142
+ @apply shrink-0 pt-1.5;
97
143
  }
98
144
 
99
145
  &__sort-icon {
100
- @apply size-3 transition-all;
146
+ @apply size-3.5 transition-all;
101
147
 
102
148
  &--desc {
103
149
  @apply rotate-180;