@appscode/design-system 2.0.75 → 2.0.76

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": "@appscode/design-system",
3
- "version": "2.0.75",
3
+ "version": "2.0.76",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -3,6 +3,8 @@
3
3
 
4
4
  .table-container {
5
5
  &.ac-table-container {
6
+ margin-bottom: 8px;
7
+
6
8
  &::-webkit-scrollbar {
7
9
  height: 7px;
8
10
  }
@@ -11,6 +11,7 @@ interface Props {
11
11
  isDynamicWidthTable?: boolean;
12
12
  fullWidth?: number;
13
13
  columnStriped?: boolean;
14
+ modifierClass?: string;
14
15
  }
15
16
 
16
17
  const props = withDefaults(defineProps<Props>(), {
@@ -22,6 +23,7 @@ const props = withDefaults(defineProps<Props>(), {
22
23
  isDynamicWidthTable: false,
23
24
  fullWidth: 1920,
24
25
  columnStriped: false,
26
+ modifierClass: "",
25
27
  });
26
28
 
27
29
  const emit = defineEmits(["sort", "scroller"]);
@@ -125,90 +127,93 @@ onUpdated(() => {
125
127
  </script>
126
128
 
127
129
  <template>
128
- <table-container ref="ac_table_container" @scroller="handleScroller">
129
- <table
130
- ref="ac_table"
131
- class="table ac-table is-bordered"
132
- :class="{
133
- 'is-fullwidth': !isDynamicWidthTable || isFullTableLoaderActive || isTableEmpty || isLoaderActive,
134
- // 'ac-striped': !columnStriped,
135
- // 'is-bordered': columnStriped,
136
- }"
137
- >
138
- <thead>
139
- <table-row v-if="isFullTableLoaderActive">
140
- <th v-for="i in loaderCols" :key="i">
141
- <cell-value :is-loader-active="true" />
142
- </th>
143
- </table-row>
144
- <table-row v-else>
145
- <th v-if="collapsible" style="width: 20px" />
146
- <th
147
- v-for="(tableHeader, idx) in tableHeaders"
148
- :key="idx"
149
- :class="{
150
- sorting: headerSortables[idx].enabled,
151
- 'sorting-desc': headerSortables[idx].mode === 'desc',
152
- 'sorting-asc': headerSortables[idx].mode === 'asc',
153
- 'has-text-centered': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'center',
154
- 'has-text-left': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'left',
155
- 'has-text-right': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'right',
156
- }"
157
- @click.prevent="headerSortables[idx].enabled && emitSortEvent(idx)"
158
- >
159
- {{ headerLabels[idx] }}
160
- <span
161
- v-if="tableHeader.dashboard && tableHeader.dashboard.status && tableHeader.dashboard.status !== 'Success'"
162
- :title="tableHeader.dashboard && tableHeader.dashboard.message"
163
- class="icon has-text-danger"
164
- >
165
- <i class="fa fa-exclamation-triangle" />
166
- </span>
167
- </th>
168
- <th ref="action-section" v-if="actionable"></th>
169
- <fake-table-cell v-if="fakeCellWidth > 0" :is-header-cell="true" :fake-cell-width="fakeCellWidth" />
170
- </table-row>
171
- </thead>
172
- <!-- table row loaders -->
173
- <tbody v-if="isFullTableLoaderActive || isLoaderActive">
174
- <table-row v-if="isFullTableLoaderActive">
175
- <th v-for="i in loaderCols" :key="i">
176
- <cell-value :is-loader-active="true" />
177
- </th>
178
- </table-row>
179
- <table-row v-else>
180
- <table-cell v-for="(tableHeader, idx) in tableHeaders" :key="headerLabels[idx]">
181
- <cell-value :is-loader-active="true" :cell-title="headerLabels[idx]" />
182
- </table-cell>
183
- </table-row>
184
- </tbody>
185
- <!-- table row loaders -->
186
- <template v-else>
187
- <tbody v-if="!isTableEmpty">
188
- <!-- table rows -->
189
- <slot :fake-cell-width="fakeCellWidth" />
190
- </tbody>
191
- <tbody v-else>
192
- <table-row class="is-hoverless">
193
- <table-cell
194
- :colspan="tableHeaders.length + (actionable ? 1 : 0) + (collapsible ? 1 : 0)"
195
- class="no-data-available has-text-centered"
130
+ <div class="table-wrapper" :class="modifierClass">
131
+ <table-container ref="ac_table_container" @scroller="handleScroller">
132
+ <table
133
+ ref="ac_table"
134
+ class="table ac-table is-bordered"
135
+ :class="{
136
+ 'is-fullwidth': !isDynamicWidthTable || isFullTableLoaderActive || isTableEmpty || isLoaderActive,
137
+ // 'ac-striped': !columnStriped,
138
+ // 'is-bordered': columnStriped,
139
+ }"
140
+ >
141
+ <thead>
142
+ <table-row v-if="isFullTableLoaderActive">
143
+ <th v-for="i in loaderCols" :key="i">
144
+ <cell-value :is-loader-active="true" />
145
+ </th>
146
+ </table-row>
147
+ <table-row v-else>
148
+ <th v-if="collapsible" style="width: 20px" />
149
+ <th
150
+ v-for="(tableHeader, idx) in tableHeaders"
151
+ :key="idx"
152
+ :class="{
153
+ sorting: headerSortables[idx].enabled,
154
+ 'sorting-desc': headerSortables[idx].mode === 'desc',
155
+ 'sorting-asc': headerSortables[idx].mode === 'asc',
156
+ 'has-text-centered': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'center',
157
+ 'has-text-left': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'left',
158
+ 'has-text-right': typeof tableHeader === 'string' ? false : tableHeader.textAlign === 'right',
159
+ }"
160
+ @click.prevent="headerSortables[idx].enabled && emitSortEvent(idx)"
196
161
  >
197
- <empty-table-info />
162
+ {{ headerLabels[idx] }}
163
+ <span
164
+ v-if="
165
+ tableHeader.dashboard && tableHeader.dashboard.status && tableHeader.dashboard.status !== 'Success'
166
+ "
167
+ :title="tableHeader.dashboard && tableHeader.dashboard.message"
168
+ class="icon has-text-danger"
169
+ >
170
+ <i class="fa fa-exclamation-triangle" />
171
+ </span>
172
+ </th>
173
+ <th ref="action-section" v-if="actionable"></th>
174
+ <fake-table-cell v-if="fakeCellWidth > 0" :is-header-cell="true" :fake-cell-width="fakeCellWidth" />
175
+ </table-row>
176
+ </thead>
177
+ <!-- table row loaders -->
178
+ <tbody v-if="isFullTableLoaderActive || isLoaderActive">
179
+ <table-row v-if="isFullTableLoaderActive">
180
+ <th v-for="i in loaderCols" :key="i">
181
+ <cell-value :is-loader-active="true" />
182
+ </th>
183
+ </table-row>
184
+ <table-row v-else>
185
+ <table-cell v-for="(tableHeader, idx) in tableHeaders" :key="headerLabels[idx]">
186
+ <cell-value :is-loader-active="true" :cell-title="headerLabels[idx]" />
198
187
  </table-cell>
199
188
  </table-row>
200
189
  </tbody>
201
- </template>
202
- </table>
203
-
204
- <!-- table footer info start -->
205
- <slot name="table-footer-info" />
206
- <!-- table footer info end -->
207
-
190
+ <!-- table row loaders -->
191
+ <template v-else>
192
+ <tbody v-if="!isTableEmpty">
193
+ <!-- table rows -->
194
+ <slot :fake-cell-width="fakeCellWidth" />
195
+ </tbody>
196
+ <tbody v-else>
197
+ <table-row class="is-hoverless">
198
+ <table-cell
199
+ :colspan="tableHeaders.length + (actionable ? 1 : 0) + (collapsible ? 1 : 0)"
200
+ class="no-data-available has-text-centered"
201
+ >
202
+ <empty-table-info />
203
+ </table-cell>
204
+ </table-row>
205
+ </tbody>
206
+ </template>
207
+ </table>
208
+
209
+ <!-- table footer info start -->
210
+ <slot name="table-footer-info" />
211
+ <!-- table footer info end -->
212
+ </table-container>
208
213
  <!-- pagination start -->
209
214
  <slot name="table-pagination" />
210
215
  <!-- pagination end -->
211
- </table-container>
216
+ </div>
212
217
  </template>
213
218
 
214
219
  <style lang="scss">