Config plugin finally working.

This commit is contained in:
Scott Duensing 2022-01-06 20:38:03 -06:00
parent 4bf0d99b44
commit 6e1e458613
4 changed files with 34 additions and 14 deletions

View file

@ -4,8 +4,8 @@ use KangarooPunch\KwConfig;
use Kirby\Toolkit\A; use Kirby\Toolkit\A;
return [ return [
'title' => [ 'name' => [
'label' => 'Title', 'label' => 'Name',
'type' => 'text' 'type' => 'text'
], ],
'type' => [ 'type' => [
@ -22,7 +22,7 @@ return [
'type' => 'textarea', 'type' => 'textarea',
'buttons' => false 'buttons' => false
], ],
'price' => [ 'data' => [
'label' => 'Value', 'label' => 'Value',
'type' => 'text' 'type' => 'text'
] ]

View file

@ -14,6 +14,14 @@
overflow: hidden; overflow: hidden;
background: var(--color-white); background: var(--color-white);
} }
.k-kwconfig th {
font-weight: var(--font-bold);
}
.k-kwconfig th button {
font: inherit;
text-align: left;
width: 100%;
}
.k-kwconfig-name { .k-kwconfig-name {
/* width: 8rem; */ /* width: 8rem; */
} }
@ -28,8 +36,8 @@
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
text-align: right !important; text-align: right !important;
} }
.k-kwconfig th button { .k-kwconfig-options {
font: inherit; padding: 0 !important;
text-align: left; width: 3rem;
width: 100%; overflow: visible !important;
} }

View file

@ -14,8 +14,8 @@
return _vm.sortBy("description"); return _vm.sortBy("description");
} } }, [_vm._v(" Description "), _vm.sort === "description" ? _c("span", { domProps: { "innerHTML": _vm._s(_vm.sortArrow) } }) : _vm._e()])]), _c("th", { staticClass: "k-kwconfig-data" }, [_c("button", { on: { "click": function($event) { } } }, [_vm._v(" Description "), _vm.sort === "description" ? _c("span", { domProps: { "innerHTML": _vm._s(_vm.sortArrow) } }) : _vm._e()])]), _c("th", { staticClass: "k-kwconfig-data" }, [_c("button", { on: { "click": function($event) {
return _vm.sortBy("data"); return _vm.sortBy("data");
} } }, [_vm._v(" Value "), _vm.sort === "data" ? _c("span", { domProps: { "innerHTML": _vm._s(_vm.sortArrow) } }) : _vm._e()])])]), _vm._l(_vm.kwconfig, function(kwconfig, name) { } } }, [_vm._v(" Value "), _vm.sort === "data" ? _c("span", { domProps: { "innerHTML": _vm._s(_vm.sortArrow) } }) : _vm._e()])]), _c("th", { staticClass: "k-kwconfig-options" })]), _vm._l(_vm.kwconfig, function(kwconfig, name) {
return _c("tr", { key: name }, [_c("td", { staticClass: "k-kwconfig-name" }, [_vm._v(_vm._s(kwconfig.name))]), _c("td", { staticClass: "k-kwconfig-type" }, [_vm._v(_vm._s(kwconfig.type))]), _c("td", { staticClass: "k-kwconfig-description" }, [_vm._v(_vm._s(kwconfig.description))]), _c("td", { staticClass: "k-kwconfig-data" }, [_vm._v(_vm._s(kwconfig.data)), _c("k-options-dropdown", { attrs: { "options": "kwconfig/" + name } })], 1)]); return _c("tr", { key: name }, [_c("td", { staticClass: "k-kwconfig-name" }, [_vm._v(_vm._s(kwconfig.name))]), _c("td", { staticClass: "k-kwconfig-type" }, [_vm._v(_vm._s(kwconfig.type))]), _c("td", { staticClass: "k-kwconfig-description" }, [_vm._v(_vm._s(kwconfig.description))]), _c("td", { staticClass: "k-kwconfig-data" }, [_vm._v(_vm._s(kwconfig.data))]), _c("td", { staticClass: "k-kwconfig-options" }, [_c("k-options-dropdown", { attrs: { "options": "kwconfig/" + name } })], 1)]);
})], 2)], 1)], 1); })], 2)], 1)], 1);
}; };
var staticRenderFns$1 = []; var staticRenderFns$1 = [];

View file

@ -37,12 +37,16 @@
<span v-if="sort === 'data'" v-html="sortArrow"/> <span v-if="sort === 'data'" v-html="sortArrow"/>
</button> </button>
</th> </th>
<th class="k-kwconfig-options"></th>
</tr> </tr>
<tr v-for="(kwconfig, name) in kwconfig" :key="name"> <tr v-for="(kwconfig, name) in kwconfig" :key="name">
<td class="k-kwconfig-name">{{ kwconfig.name }}</td> <td class="k-kwconfig-name">{{ kwconfig.name }}</td>
<td class="k-kwconfig-type">{{ kwconfig.type }}</td> <td class="k-kwconfig-type">{{ kwconfig.type }}</td>
<td class="k-kwconfig-description">{{ kwconfig.description }}</td> <td class="k-kwconfig-description">{{ kwconfig.description }}</td>
<td class="k-kwconfig-data">{{ kwconfig.data }}<k-options-dropdown :options="'kwconfig/' + name" /></td> <td class="k-kwconfig-data">{{ kwconfig.data }}</td>
<td class="k-kwconfig-options">
<k-options-dropdown :options="'kwconfig/' + name" />
</td>
</tr> </tr>
</table> </table>
</k-view> </k-view>
@ -92,6 +96,14 @@ export default {
overflow: hidden; overflow: hidden;
background: var(--color-white); background: var(--color-white);
} }
.k-kwconfig th {
font-weight: var(--font-bold);
}
.k-kwconfig th button {
font: inherit;
text-align: left;
width: 100%;
}
.k-kwconfig-name { .k-kwconfig-name {
/* width: 8rem; */ /* width: 8rem; */
} }
@ -106,9 +118,9 @@ export default {
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
text-align: right !important; text-align: right !important;
} }
.k-kwconfig th button { .k-kwconfig-options {
font: inherit; padding: 0 !important;
text-align: left; width: 3rem;
width: 100%; overflow: visible !important;
} }
</style> </style>