Skip to content

Commit

Permalink
PATCH: feat(table): add tableLayout prop to BIMDataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Jul 18, 2022
1 parent e98ec3f commit c636314
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
8 changes: 6 additions & 2 deletions src/BIMDataComponents/BIMDataTable/BIMDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
height: paginated ? `${(perPage + 1) * rowHeight}px` : undefined,
}"
>
<table :style="{ width: tableWidth }">
<table :style="{ width: tableWidth, tableLayout }">
<thead>
<tr key="head-row-0" :style="{ height: `${rowHeight}px` }">
<th class="cell-checkbox" v-if="selectable">
Expand Down Expand Up @@ -137,9 +137,13 @@ export default {
default: "",
},
tableWidth: {
type: [Number, String],
type: String,
default: "100%",
},
tableLayout: {
type: String,
default: "auto",
},
},
emits: [
"selection-changed",
Expand Down
12 changes: 4 additions & 8 deletions src/web/views/Components/Table/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@
@selection-changed="simpleExample.selection = $event"
/>
<div class="selection-box">
<div class="selection-box__label">
Selection :
</div>
<div class="selection-box__label">Selection :</div>
<div
class="selection-box__item"
v-for="(s, i) of simpleExample.selection"
:key="i"
>
{{ `[${i}] - ${s.join(", ")}` }}
</div>
<div v-show="simpleExample.selection.length === 0">
( None )
</div>
<div v-show="simpleExample.selection.length === 0">( None )</div>
</div>
</template>

Expand Down Expand Up @@ -165,7 +161,7 @@
<pre>
let columns = [
{ id: "fullName", label: "Name" },
{ id: "age", label: "Age", width: "40px" },
{ id: "age", label: "Age", width: "64px" },
{ id: "country", label: "Country", width: "200px", align: "center" }
];
</pre>
Expand Down Expand Up @@ -305,7 +301,7 @@ export default {
advancedExample: {
columns: [
{ id: "fullName", label: "Name" },
{ id: "age", label: "Age", width: "40px" },
{ id: "age", label: "Age", width: "64px" },
{ id: "country", label: "Country", width: "200px", align: "center" },
],
rows: [
Expand Down
26 changes: 17 additions & 9 deletions src/web/views/Components/Table/props-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,7 @@ export default [
"Number",
"",
"50",
"Use this prop to set rows height (in px)",
"",
],
[
"tableWidth",
"[Number, String]",
"",
"100%",
"Use this prop to set table widt (in px)",
"Use this prop to set rows height (in px).",
"",
],
[
Expand Down Expand Up @@ -72,4 +64,20 @@ export default [
"A text to display when the table is empty",
"'Empty Table'",
],
[
"tableWidth",
"String",
"",
"100%",
"Use this prop to set table width.",
"",
],
[
"tableLayout",
"String",
"",
"auto",
"Use this prop to set table-layout css property (e.g. 'auto' or 'fixed').",
"",
],
];

0 comments on commit c636314

Please sign in to comment.