bge-ui 1.1.3 → 1.1.4
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/dist/index.js +13 -5
- package/dist/tooltip/usePopper.d.ts +1 -1
- package/package.json +1 -1
- package/src/button/index.vue +1 -1
- package/src/tooltip/usePopper.ts +11 -4
package/dist/index.js
CHANGED
|
@@ -37,14 +37,14 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
},
|
|
38
38
|
setup(__props) {
|
|
39
39
|
return (_ctx, _cache) => {
|
|
40
|
-
const
|
|
40
|
+
const _component_ColorLoading = resolveComponent("ColorLoading");
|
|
41
41
|
return openBlock(), createElementBlock("button", {
|
|
42
42
|
type: "button",
|
|
43
43
|
class: normalizeClass(`bge-button bge-button--${__props.type} bge-button--${__props.size} ${__props.loading ? "loading" : ""}`),
|
|
44
44
|
disabled: __props.disabled || __props.loading
|
|
45
45
|
}, [
|
|
46
46
|
createElementVNode("span", _hoisted_2$1y, [
|
|
47
|
-
createVNode(
|
|
47
|
+
createVNode(_component_ColorLoading, {
|
|
48
48
|
size: __props.size === "default" ? 20 : __props.size === "large" ? 24 : 16,
|
|
49
49
|
color: ""
|
|
50
50
|
}, null, 8, ["size"])
|
|
@@ -7777,16 +7777,24 @@ const usePopper = function(triggerReference, suppliedOptions = {}) {
|
|
|
7777
7777
|
isOpened.value = false;
|
|
7778
7778
|
}
|
|
7779
7779
|
}, getCloseDelay());
|
|
7780
|
-
const toggleTooltip = (status = "") => {
|
|
7780
|
+
const toggleTooltip = (status = "", isDelay = true) => {
|
|
7781
7781
|
let nextStatus = status;
|
|
7782
7782
|
if (status === "") {
|
|
7783
7783
|
nextStatus = isOpened.value ? "close" : "open";
|
|
7784
7784
|
}
|
|
7785
7785
|
if (nextStatus === "open") {
|
|
7786
|
-
|
|
7786
|
+
if (isDelay) {
|
|
7787
|
+
openWithDelay();
|
|
7788
|
+
} else {
|
|
7789
|
+
isOpened.value = true;
|
|
7790
|
+
}
|
|
7787
7791
|
return;
|
|
7788
7792
|
}
|
|
7789
|
-
|
|
7793
|
+
if (isDelay) {
|
|
7794
|
+
closeWithDelay();
|
|
7795
|
+
} else {
|
|
7796
|
+
isOpened.value = false;
|
|
7797
|
+
}
|
|
7790
7798
|
};
|
|
7791
7799
|
const toggleTooltipHover = (status = "", source = "") => {
|
|
7792
7800
|
if (options.hover === false) {
|
|
@@ -248,7 +248,7 @@ declare const usePopper: (triggerReference: any, suppliedOptions?: Options) => {
|
|
|
248
248
|
update: () => Promise<Partial<import("@popperjs/core").State>>;
|
|
249
249
|
setOptions: (setOptionsAction: Partial<import("@popperjs/core").OptionsGeneric<any>> | ((prev: Partial<import("@popperjs/core").OptionsGeneric<any>>) => Partial<import("@popperjs/core").OptionsGeneric<any>>)) => Promise<Partial<import("@popperjs/core").State>>;
|
|
250
250
|
} | undefined>;
|
|
251
|
-
toggleTooltip: (status?: string) => void;
|
|
251
|
+
toggleTooltip: (status?: string, isDelay?: boolean) => void;
|
|
252
252
|
isOpened: import("vue").ComputedRef<boolean>;
|
|
253
253
|
};
|
|
254
254
|
export { usePopper };
|
package/package.json
CHANGED
package/src/button/index.vue
CHANGED
|
@@ -37,7 +37,7 @@ defineProps({
|
|
|
37
37
|
|
|
38
38
|
<template>
|
|
39
39
|
<button type="button" :class="`bge-button bge-button--${type} bge-button--${size} ${loading ? 'loading' : ''}`" :disabled="disabled || loading">
|
|
40
|
-
<span class="loading-icon"><
|
|
40
|
+
<span class="loading-icon"><ColorLoading :size="size === 'default' ? 20 : (size === 'large' ? 24 : 16)" color=""></ColorLoading></span>
|
|
41
41
|
<span>
|
|
42
42
|
<slot></slot>
|
|
43
43
|
</span>
|
package/src/tooltip/usePopper.ts
CHANGED
|
@@ -221,7 +221,7 @@ const usePopper = function (triggerReference, suppliedOptions: Options = {}) {
|
|
|
221
221
|
*
|
|
222
222
|
* @param {string} status The status of the tooltip (open|close)
|
|
223
223
|
*/
|
|
224
|
-
const toggleTooltip = (status = '') => {
|
|
224
|
+
const toggleTooltip = (status = '', isDelay = true) => {
|
|
225
225
|
let nextStatus = status;
|
|
226
226
|
|
|
227
227
|
if (status === '') {
|
|
@@ -229,11 +229,18 @@ const usePopper = function (triggerReference, suppliedOptions: Options = {}) {
|
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
if (nextStatus === 'open') {
|
|
232
|
-
|
|
232
|
+
if (isDelay) {
|
|
233
|
+
openWithDelay();
|
|
234
|
+
} else {
|
|
235
|
+
isOpened.value = true
|
|
236
|
+
}
|
|
233
237
|
return;
|
|
234
238
|
}
|
|
235
|
-
|
|
236
|
-
|
|
239
|
+
if (isDelay) {
|
|
240
|
+
closeWithDelay();
|
|
241
|
+
} else {
|
|
242
|
+
isOpened.value = false
|
|
243
|
+
}
|
|
237
244
|
};
|
|
238
245
|
|
|
239
246
|
/**
|