@avakhula/ui 0.0.26 → 0.0.28

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": "@avakhula/ui",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
package/src/App.vue CHANGED
@@ -15,6 +15,7 @@
15
15
  :options="options"
16
16
  :is-required="true"
17
17
  :is-multiple="false"
18
+ @close="onClose"
18
19
  />
19
20
 
20
21
  <button @click="changeValue">Change value</button>
@@ -119,6 +120,9 @@ export default {
119
120
  console.log("test");
120
121
  this.test = testData[0].id;
121
122
  },
123
+ onClose(a) {
124
+ console.log("onClose", a)
125
+ }
122
126
  },
123
127
  };
124
128
  </script>
@@ -156,11 +156,13 @@ export default {
156
156
  this.$globalEvents.$emit("dropdown:open", this);
157
157
  },
158
158
  close() {
159
- if (this.disabled) {
160
- return;
159
+ if (this.isOpenedState) {
160
+ if (this.disabled) {
161
+ return;
162
+ }
163
+ this.isOpenedState = false;
164
+ this.$emit("close");
161
165
  }
162
- this.isOpenedState = false;
163
- this.$emit("close");
164
166
  },
165
167
  debouncedOpen() {
166
168
  this.timeout = setTimeout(() => {
@@ -4,6 +4,7 @@
4
4
  :disabled="isLoading"
5
5
  :is-resizable="isResizable"
6
6
  :vertical="vertical"
7
+ @close="onClose"
7
8
  ref="dropdown"
8
9
  >
9
10
  <template v-if="hasTrigger" v-slot:trigger>
@@ -831,6 +832,13 @@ export default {
831
832
  });
832
833
  this.filter(this.filterString, options);
833
834
  },
835
+ onClose() {
836
+ if (this.isMultiple) {
837
+ this.$emit("close", Object.keys(this.selected));
838
+ } else {
839
+ this.$emit("close", Object.keys(this.selected)[0]);
840
+ }
841
+ },
834
842
  },
835
843
  computed: {
836
844
  hasTrigger() {
@@ -1,6 +1,5 @@
1
- // import { createApp, h } from "vue";
2
- import IbTooltip from "../../components/Tooltip/Tooltip.vue";
3
1
  import { createApp } from "vue";
2
+ import IbTooltip from "../../components/Tooltip/Tooltip.vue";
4
3
 
5
4
  export const TooltipDirective = {
6
5
  mounted(el, binding) {