From a687ebbe262ca2a4eb6bfa085e02649243318c1d Mon Sep 17 00:00:00 2001 From: Yeshwanth munagapati Date: Tue, 12 Nov 2024 20:57:03 +0530 Subject: [PATCH 1/4] documentation for kselect --- lib/KSelect/index.vue | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/lib/KSelect/index.vue b/lib/KSelect/index.vue index cfba6eeff..7a18a6f11 100644 --- a/lib/KSelect/index.vue +++ b/lib/KSelect/index.vue @@ -43,6 +43,7 @@ :class="labelClasses" :style="activeColorStyle" > + {{ label }} @@ -51,6 +52,7 @@ class="ui-select-display-value" :class="{ 'is-placeholder': !hasDisplayText }" > + {{ hasDisplayText ? displayText : ( hasFloatingLabel && isLabelInline) ? null : placeholder }} @@ -106,6 +108,7 @@ @mouseover.native.stop="onMouseover(option)" > +
+ {{ noResultsText }} @@ -128,12 +132,14 @@
+ {{ invalidText }}
+ {{ help }} @@ -214,14 +220,14 @@ }, }, /** - * Placeholder + * Sets the placeholder value */ placeholder: { type: String, default: '', }, /** - * Label + * Set default label */ label: { type: String, @@ -255,6 +261,9 @@ type: String, default: '', }, + /** + * key attribute to identify individual elements within a list rendered + */ keys: { type: Object, default() { @@ -297,6 +306,10 @@ type: Boolean, default: false, }, + /** + * If provided, shows a KIconButton with the given text + * + */ clearText: { type: String, default: '', @@ -500,14 +513,23 @@ showDropdown() { if (this.showDropdown) { this.onOpen(); + /** + * Emit on opening dropdown + */ this.$emit('dropdown-open'); } else { this.onClose(); + /** + * Emit on closing dropdown + */ this.$emit('dropdown-close'); } }, query() { + /** + * Emit on change query + */ this.$emit('query-change', this.query); }, @@ -575,7 +597,10 @@ setValue(value) { value = value ? value : this.multiple ? [] : ''; this.selection = value; - + /** + * Emitted when the value is selected or + * Emitted when reset method is called. + */ this.$emit('input', value); }, @@ -863,7 +888,8 @@ }, /** - * @public + * Resets the selected values of dropdown + * @public This is a public method */ reset() { this.setValue(JSON.parse(this.initialValue)); From c6a5384d284a2673edb976aab4465269ef950fb0 Mon Sep 17 00:00:00 2001 From: Yeshwanth munagapati Date: Wed, 13 Nov 2024 13:55:47 +0530 Subject: [PATCH 2/4] fixing lint issues --- lib/KSelect/index.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/KSelect/index.vue b/lib/KSelect/index.vue index 7a18a6f11..fc30c994d 100644 --- a/lib/KSelect/index.vue +++ b/lib/KSelect/index.vue @@ -308,8 +308,8 @@ }, /** * If provided, shows a KIconButton with the given text - * - */ + * + */ clearText: { type: String, default: '', @@ -529,7 +529,7 @@ query() { /** * Emit on change query - */ + */ this.$emit('query-change', this.query); }, @@ -597,10 +597,10 @@ setValue(value) { value = value ? value : this.multiple ? [] : ''; this.selection = value; - /** - * Emitted when the value is selected or - * Emitted when reset method is called. - */ + /** + * Emitted when the value is selected or + * Emitted when reset method is called. + */ this.$emit('input', value); }, From 22eedf96993f72026e591af87327e42259f48aae Mon Sep 17 00:00:00 2001 From: Yeshwanth munagapati Date: Thu, 21 Nov 2024 18:25:14 +0530 Subject: [PATCH 3/4] resolving PR comments --- lib/KSelect/index.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/KSelect/index.vue b/lib/KSelect/index.vue index fc30c994d..0f00236ac 100644 --- a/lib/KSelect/index.vue +++ b/lib/KSelect/index.vue @@ -227,7 +227,7 @@ default: '', }, /** - * Set default label + * Specifies the label text. Default is empty if not provided. */ label: { type: String, @@ -262,7 +262,7 @@ default: '', }, /** - * key attribute to identify individual elements within a list rendered + * Used as a key identifier for individual elements in a rendered list. */ keys: { type: Object, @@ -307,8 +307,7 @@ default: false, }, /** - * If provided, shows a KIconButton with the given text - * + * Displays a KIconButton with the specified text when provided. */ clearText: { type: String, @@ -528,7 +527,7 @@ query() { /** - * Emit on change query + * Emits whenever the query value changes. */ this.$emit('query-change', this.query); }, @@ -598,8 +597,7 @@ value = value ? value : this.multiple ? [] : ''; this.selection = value; /** - * Emitted when the value is selected or - * Emitted when reset method is called. + * Emits an 'input' event with the new value when the selection is updated. */ this.$emit('input', value); }, From c43e8e27d9f529df2423d811e52653c4141e83ca Mon Sep 17 00:00:00 2001 From: Yeshwanth munagapati Date: Thu, 28 Nov 2024 08:51:38 +0530 Subject: [PATCH 4/4] solving PR comments --- lib/KSelect/index.vue | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/KSelect/index.vue b/lib/KSelect/index.vue index 0f00236ac..21e207149 100644 --- a/lib/KSelect/index.vue +++ b/lib/KSelect/index.vue @@ -43,7 +43,7 @@ :class="labelClasses" :style="activeColorStyle" > - + {{ label }}
@@ -52,7 +52,7 @@ class="ui-select-display-value" :class="{ 'is-placeholder': !hasDisplayText }" > - + {{ hasDisplayText ? displayText : ( hasFloatingLabel && isLabelInline) ? null : placeholder }} @@ -108,7 +108,7 @@ @mouseover.native.stop="onMouseover(option)" > - +
- + {{ noResultsText }} @@ -132,14 +132,14 @@
- + {{ invalidText }}
- + {{ help }} @@ -262,7 +262,8 @@ default: '', }, /** - * Used as a key identifier for individual elements in a rendered list. + * Object that defines the label, value and image keys in objects of the `options` prop. + * Default: { label: 'label', value: 'value', image: 'image' } */ keys: { type: Object, @@ -307,7 +308,7 @@ default: false, }, /** - * Displays a KIconButton with the specified text when provided. + * Defines the tooltip and aria-label of the clear button if the select is clearable. */ clearText: { type: String,