From 5c20b748d4d5b2abd9c097e70fe22549e5d8edbf Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Tue, 31 May 2022 16:09:59 +0200 Subject: [PATCH] feat(select): add nullLabel prop --- src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue | 3 +++ .../BIMDataSelect/BIMDataSelectMulti.vue | 6 ++++++ .../BIMDataSelect/BIMDataSelectSingle.vue | 8 +++++++- src/web/views/Components/Select/props-data.js | 6 ++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue b/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue index 01620f39..45feed1b 100644 --- a/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue +++ b/src/BIMDataComponents/BIMDataSelect/BIMDataSelect.vue @@ -51,6 +51,9 @@ export default { type: Boolean, default: false, }, + nullLabel: { + type: String, + }, disabled: { type: Boolean, default: false, diff --git a/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue b/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue index fe75ed9b..705c6532 100644 --- a/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue +++ b/src/BIMDataComponents/BIMDataSelect/BIMDataSelectMulti.vue @@ -87,6 +87,9 @@ export default { modelValue: { type: Array, }, + nullLabel: { + type: String, + }, disabled: { type: Boolean, default: false, @@ -116,6 +119,9 @@ export default { return option; }, optionLabel(option) { + if (this.nullLabel && option == null) { + return this.nullLabel; + } if (this.optionLabelKey && option) { return option[this.optionLabelKey]; } diff --git a/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue b/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue index 7099f2d5..e78f6f12 100644 --- a/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue +++ b/src/BIMDataComponents/BIMDataSelect/BIMDataSelectSingle.vue @@ -27,7 +27,7 @@ class="bimdata-select__option-list__entry" @click="onNullValueClick()" > - None + {{ nullLabel || "None" }}