yc-design-vue 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/es/Alert/index.vue2.js +2 -2
- package/es/Calendar/Calendar.vue2.js +2 -2
- package/es/Carousel/Carousel.vue.js +1 -1
- package/es/Carousel/Carousel.vue2.js +15 -14
- package/es/Carousel/hooks/useContext.js +4 -3
- package/es/Cascader/CascaderIcon.vue2.js +2 -2
- package/es/Checkbox/Checkbox.vue2.js +2 -2
- package/es/Collapse/CollapseItem.vue2.js +2 -2
- package/es/Drawer/Drawer.vue2.js +2 -2
- package/es/Image/ImagePreview.vue.js +1 -1
- package/es/Image/ImagePreview.vue2.js +10 -8
- package/es/Input/Input.vue2.js +2 -2
- package/es/Input/InputSuffix.vue2.js +2 -2
- package/es/InputNumber/InputOperaBtn.vue2.js +1 -1
- package/es/InputTag/index.vue2.js +2 -2
- package/es/Menu/SubMenu.vue2.js +2 -2
- package/es/Message/Message.vue2.js +2 -2
- package/es/Modal/Modal.vue2.js +2 -2
- package/es/Notification/Notification.vue2.js +2 -2
- package/es/PageHeader/index.vue2.js +2 -2
- package/es/Radio/Radio.vue2.js +2 -2
- package/es/Select/SelectIcon.vue2.js +2 -2
- package/es/Tabs/TabButton.vue2.js +2 -2
- package/es/Tag/index.vue2.js +2 -2
- package/es/Textarea/index.vue2.js +2 -2
- package/es/TimePicker/TimePicker.vue2.js +2 -2
- package/es/Transfer/TransferPanel.vue2.js +4 -4
- package/es/Trigger/index.vue2.js +2 -2
- package/es/Typography/TypographyBase.vue2.js +2 -2
- package/es/_shared/components/{ExpandTransition.vue.js → ExpandTransition.vue2.js} +1 -1
- package/es/_shared/components/{IconButton.vue2.js → IconButton.vue.js} +1 -1
- package/es/_shared/icons/IconCopy.vue.js +16 -1
- package/es/_shared/icons/IconCopy.vue2.js +1 -16
- package/es/_shared/icons/IconDelete.vue.js +1 -16
- package/es/_shared/icons/IconDelete.vue2.js +16 -1
- package/es/_shared/icons/IconEdit.vue.js +16 -1
- package/es/_shared/icons/IconEdit.vue2.js +1 -16
- package/es/_shared/icons/IconMinus.vue.js +16 -1
- package/es/_shared/icons/IconMinus.vue2.js +1 -16
- package/es/_shared/icons/IconSearch.vue.js +1 -16
- package/es/_shared/icons/IconSearch.vue2.js +16 -1
- package/es/_shared/utils/dom.js +6 -6
- package/es/node_modules/@vueuse/core/index.js +3 -1
- package/es/node_modules/@vueuse/shared/index.js +76 -1
- package/es/style.css +1 -1
- package/lib/Alert/index.vue2.js +1 -1
- package/lib/Calendar/Calendar.vue2.js +1 -1
- package/lib/Carousel/Carousel.vue.js +1 -1
- package/lib/Carousel/Carousel.vue2.js +1 -1
- package/lib/Carousel/hooks/useContext.js +1 -1
- package/lib/Cascader/CascaderIcon.vue2.js +1 -1
- package/lib/Checkbox/Checkbox.vue2.js +1 -1
- package/lib/Collapse/CollapseItem.vue2.js +1 -1
- package/lib/Drawer/Drawer.vue2.js +1 -1
- package/lib/Image/ImagePreview.vue.js +1 -1
- package/lib/Image/ImagePreview.vue2.js +1 -1
- package/lib/Input/Input.vue2.js +1 -1
- package/lib/Input/InputSuffix.vue2.js +1 -1
- package/lib/InputNumber/InputOperaBtn.vue2.js +1 -1
- package/lib/InputTag/index.vue2.js +1 -1
- package/lib/Menu/SubMenu.vue2.js +1 -1
- package/lib/Message/Message.vue2.js +1 -1
- package/lib/Modal/Modal.vue2.js +1 -1
- package/lib/Notification/Notification.vue2.js +1 -1
- package/lib/PageHeader/index.vue2.js +1 -1
- package/lib/Radio/Radio.vue2.js +1 -1
- package/lib/Select/SelectIcon.vue2.js +1 -1
- package/lib/Tabs/TabButton.vue2.js +1 -1
- package/lib/Tag/index.vue2.js +1 -1
- package/lib/Textarea/index.vue2.js +1 -1
- package/lib/TimePicker/TimePicker.vue2.js +1 -1
- package/lib/Transfer/TransferPanel.vue2.js +1 -1
- package/lib/Trigger/index.vue2.js +1 -1
- package/lib/Typography/TypographyBase.vue2.js +1 -1
- package/lib/_shared/components/ExpandTransition.vue2.js +1 -0
- package/lib/_shared/components/IconButton.vue.js +1 -0
- package/lib/_shared/icons/IconCopy.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue2.js +1 -1
- package/lib/_shared/icons/IconDelete.vue.js +1 -1
- package/lib/_shared/icons/IconDelete.vue2.js +1 -1
- package/lib/_shared/icons/IconEdit.vue.js +1 -1
- package/lib/_shared/icons/IconEdit.vue2.js +1 -1
- package/lib/_shared/icons/IconMinus.vue.js +1 -1
- package/lib/_shared/icons/IconMinus.vue2.js +1 -1
- package/lib/_shared/icons/IconSearch.vue.js +1 -1
- package/lib/_shared/icons/IconSearch.vue2.js +1 -1
- package/lib/_shared/utils/dom.js +1 -1
- package/lib/node_modules/@vueuse/core/index.js +1 -1
- package/lib/node_modules/@vueuse/shared/index.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/_shared/components/ExpandTransition.vue.js +0 -1
- package/lib/_shared/components/IconButton.vue2.js +0 -1
@@ -1,19 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import YcIcon from "../components/Icon.vue2.js";
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
|
-
__name: "IconEdit",
|
5
|
-
setup(__props) {
|
6
|
-
return (_ctx, _cache) => {
|
7
|
-
return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
8
|
-
default: withCtx(() => _cache[0] || (_cache[0] = [
|
9
|
-
createElementVNode("path", { d: "m30.48 19.038 5.733-5.734a1 1 0 0 0 0-1.414l-5.586-5.586a1 1 0 0 0-1.414 0l-5.734 5.734m7 7L15.763 33.754a1 1 0 0 1-.59.286l-6.048.708a1 1 0 0 1-1.113-1.069l.477-6.31a1 1 0 0 1 .29-.631l14.7-14.7m7 7-7-7M6 42h36" }, null, -1)
|
10
|
-
])),
|
11
|
-
_: 1,
|
12
|
-
__: [0]
|
13
|
-
}, 16);
|
14
|
-
};
|
15
|
-
}
|
16
|
-
});
|
1
|
+
import _sfc_main from "./IconEdit.vue.js";
|
17
2
|
export {
|
18
3
|
_sfc_main as default
|
19
4
|
};
|
@@ -1,4 +1,19 @@
|
|
1
|
-
import
|
1
|
+
import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
|
2
|
+
import YcIcon from "../components/Icon.vue2.js";
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
|
+
__name: "IconMinus",
|
5
|
+
setup(__props) {
|
6
|
+
return (_ctx, _cache) => {
|
7
|
+
return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
8
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
9
|
+
createElementVNode("path", { d: "M5 24h38" }, null, -1)
|
10
|
+
])),
|
11
|
+
_: 1,
|
12
|
+
__: [0]
|
13
|
+
}, 16);
|
14
|
+
};
|
15
|
+
}
|
16
|
+
});
|
2
17
|
export {
|
3
18
|
_sfc_main as default
|
4
19
|
};
|
@@ -1,19 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import YcIcon from "../components/Icon.vue2.js";
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
|
-
__name: "IconMinus",
|
5
|
-
setup(__props) {
|
6
|
-
return (_ctx, _cache) => {
|
7
|
-
return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
8
|
-
default: withCtx(() => _cache[0] || (_cache[0] = [
|
9
|
-
createElementVNode("path", { d: "M5 24h38" }, null, -1)
|
10
|
-
])),
|
11
|
-
_: 1,
|
12
|
-
__: [0]
|
13
|
-
}, 16);
|
14
|
-
};
|
15
|
-
}
|
16
|
-
});
|
1
|
+
import _sfc_main from "./IconMinus.vue.js";
|
17
2
|
export {
|
18
3
|
_sfc_main as default
|
19
4
|
};
|
@@ -1,19 +1,4 @@
|
|
1
|
-
import
|
2
|
-
import YcIcon from "../components/Icon.vue2.js";
|
3
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
|
-
__name: "IconSearch",
|
5
|
-
setup(__props) {
|
6
|
-
return (_ctx, _cache) => {
|
7
|
-
return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
8
|
-
default: withCtx(() => _cache[0] || (_cache[0] = [
|
9
|
-
createElementVNode("path", { d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485" }, null, -1)
|
10
|
-
])),
|
11
|
-
_: 1,
|
12
|
-
__: [0]
|
13
|
-
}, 16);
|
14
|
-
};
|
15
|
-
}
|
16
|
-
});
|
1
|
+
import _sfc_main from "./IconSearch.vue2.js";
|
17
2
|
export {
|
18
3
|
_sfc_main as default
|
19
4
|
};
|
@@ -1,4 +1,19 @@
|
|
1
|
-
import
|
1
|
+
import { defineComponent, createBlock, openBlock, normalizeProps, guardReactiveProps, withCtx, createElementVNode } from "vue";
|
2
|
+
import YcIcon from "../components/Icon.vue2.js";
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
4
|
+
__name: "IconSearch",
|
5
|
+
setup(__props) {
|
6
|
+
return (_ctx, _cache) => {
|
7
|
+
return openBlock(), createBlock(YcIcon, normalizeProps(guardReactiveProps(_ctx.$attrs)), {
|
8
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [
|
9
|
+
createElementVNode("path", { d: "M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485" }, null, -1)
|
10
|
+
])),
|
11
|
+
_: 1,
|
12
|
+
__: [0]
|
13
|
+
}, 16);
|
14
|
+
};
|
15
|
+
}
|
16
|
+
});
|
2
17
|
export {
|
3
18
|
_sfc_main as default
|
4
19
|
};
|
package/es/_shared/utils/dom.js
CHANGED
@@ -70,7 +70,7 @@ const findFirstScrollableParent = (element) => {
|
|
70
70
|
}
|
71
71
|
let currentElement = element.parentElement;
|
72
72
|
while (currentElement && currentElement !== document.body) {
|
73
|
-
const style =
|
73
|
+
const style = getComputedStyle(currentElement);
|
74
74
|
const overflow = style.overflowY || style.overflow;
|
75
75
|
const isScrollable = ["auto", "scroll"].includes(overflow);
|
76
76
|
const canScroll = currentElement.scrollHeight > currentElement.clientHeight;
|
@@ -91,15 +91,15 @@ const throttleByRaf = (cb) => {
|
|
91
91
|
let timer = 0;
|
92
92
|
const throttle2 = (...args) => {
|
93
93
|
if (timer) {
|
94
|
-
|
94
|
+
cancelAnimationFrame(timer);
|
95
95
|
}
|
96
|
-
timer =
|
96
|
+
timer = requestAnimationFrame(() => {
|
97
97
|
cb(...args);
|
98
98
|
timer = 0;
|
99
99
|
});
|
100
100
|
};
|
101
101
|
throttle2.cancel = () => {
|
102
|
-
|
102
|
+
cancelAnimationFrame(timer);
|
103
103
|
timer = 0;
|
104
104
|
};
|
105
105
|
return throttle2;
|
@@ -152,7 +152,7 @@ const valueToPx = (value) => {
|
|
152
152
|
return value;
|
153
153
|
};
|
154
154
|
function isHorizontallyScrollable(element) {
|
155
|
-
const style =
|
155
|
+
const style = getComputedStyle(element);
|
156
156
|
const isScrollableOverflow = style.overflowX === "scroll" || style.overflowX === "auto";
|
157
157
|
const isVisible = style.display !== "none" && style.visibility !== "hidden";
|
158
158
|
if (!isVisible) {
|
@@ -162,7 +162,7 @@ function isHorizontallyScrollable(element) {
|
|
162
162
|
return isScrollableOverflow && isContentLarger;
|
163
163
|
}
|
164
164
|
function isVerticallyScrollable(element) {
|
165
|
-
const style =
|
165
|
+
const style = getComputedStyle(element);
|
166
166
|
const isScrollableOverflow = style.overflowY === "scroll" || style.overflowY === "auto";
|
167
167
|
const isVisible = style.display !== "none" && style.visibility !== "hidden";
|
168
168
|
if (!isVisible) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { tryOnScopeDispose, toArray, watchImmediate, isClient, isObject, makeDestructurable, camelize, tryOnMounted, toRefs, noop, isIOS, notNullish, useThrottleFn, useDebounceFn, pxValue, injectLocal, useTimeoutFn, createSingletonPromise } from "../shared/index.js";
|
2
|
-
import { createFilterWrapper, debounceFilter, getLifeCycleTarget, throttleFilter } from "../shared/index.js";
|
2
|
+
import { createFilterWrapper, debounceFilter, getLifeCycleTarget, throttleFilter, useInterval, useIntervalFn } from "../shared/index.js";
|
3
3
|
import { computed, toValue, watch, shallowRef, getCurrentInstance, onMounted, unref, defineComponent, ref, reactive, watchEffect, hasInjectionContext, toRaw } from "vue";
|
4
4
|
function createReusableTemplate(options = {}) {
|
5
5
|
const {
|
@@ -1080,6 +1080,8 @@ export {
|
|
1080
1080
|
useElementBounding,
|
1081
1081
|
useElementSize,
|
1082
1082
|
useEventListener,
|
1083
|
+
useInterval,
|
1084
|
+
useIntervalFn,
|
1083
1085
|
useMediaQuery,
|
1084
1086
|
useMounted,
|
1085
1087
|
useMutationObserver,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getCurrentScope, onScopeDispose, watch, onMounted, nextTick, isRef, toRefs as toRefs$1, customRef, toValue, getCurrentInstance, hasInjectionContext, inject,
|
1
|
+
import { getCurrentScope, onScopeDispose, watch, onMounted, nextTick, isRef, toRefs as toRefs$1, customRef, toValue, getCurrentInstance, shallowRef, hasInjectionContext, inject, readonly } from "vue";
|
2
2
|
function tryOnScopeDispose(fn) {
|
3
3
|
if (getCurrentScope()) {
|
4
4
|
onScopeDispose(fn);
|
@@ -240,6 +240,79 @@ function tryOnMounted(fn, sync = true, target) {
|
|
240
240
|
else
|
241
241
|
nextTick(fn);
|
242
242
|
}
|
243
|
+
function useIntervalFn(cb, interval = 1e3, options = {}) {
|
244
|
+
const {
|
245
|
+
immediate = true,
|
246
|
+
immediateCallback = false
|
247
|
+
} = options;
|
248
|
+
let timer = null;
|
249
|
+
const isActive = shallowRef(false);
|
250
|
+
function clean() {
|
251
|
+
if (timer) {
|
252
|
+
clearInterval(timer);
|
253
|
+
timer = null;
|
254
|
+
}
|
255
|
+
}
|
256
|
+
function pause() {
|
257
|
+
isActive.value = false;
|
258
|
+
clean();
|
259
|
+
}
|
260
|
+
function resume() {
|
261
|
+
const intervalValue = toValue(interval);
|
262
|
+
if (intervalValue <= 0)
|
263
|
+
return;
|
264
|
+
isActive.value = true;
|
265
|
+
if (immediateCallback)
|
266
|
+
cb();
|
267
|
+
clean();
|
268
|
+
if (isActive.value)
|
269
|
+
timer = setInterval(cb, intervalValue);
|
270
|
+
}
|
271
|
+
if (immediate && isClient)
|
272
|
+
resume();
|
273
|
+
if (isRef(interval) || typeof interval === "function") {
|
274
|
+
const stopWatch = watch(interval, () => {
|
275
|
+
if (isActive.value && isClient)
|
276
|
+
resume();
|
277
|
+
});
|
278
|
+
tryOnScopeDispose(stopWatch);
|
279
|
+
}
|
280
|
+
tryOnScopeDispose(pause);
|
281
|
+
return {
|
282
|
+
isActive,
|
283
|
+
pause,
|
284
|
+
resume
|
285
|
+
};
|
286
|
+
}
|
287
|
+
function useInterval(interval = 1e3, options = {}) {
|
288
|
+
const {
|
289
|
+
controls: exposeControls = false,
|
290
|
+
immediate = true,
|
291
|
+
callback
|
292
|
+
} = options;
|
293
|
+
const counter = shallowRef(0);
|
294
|
+
const update = () => counter.value += 1;
|
295
|
+
const reset = () => {
|
296
|
+
counter.value = 0;
|
297
|
+
};
|
298
|
+
const controls = useIntervalFn(
|
299
|
+
callback ? () => {
|
300
|
+
update();
|
301
|
+
callback(counter.value);
|
302
|
+
} : update,
|
303
|
+
interval,
|
304
|
+
{ immediate }
|
305
|
+
);
|
306
|
+
if (exposeControls) {
|
307
|
+
return {
|
308
|
+
counter,
|
309
|
+
reset,
|
310
|
+
...controls
|
311
|
+
};
|
312
|
+
} else {
|
313
|
+
return counter;
|
314
|
+
}
|
315
|
+
}
|
243
316
|
function useTimeoutFn(cb, interval, options = {}) {
|
244
317
|
const {
|
245
318
|
immediate = true,
|
@@ -310,6 +383,8 @@ export {
|
|
310
383
|
tryOnMounted,
|
311
384
|
tryOnScopeDispose,
|
312
385
|
useDebounceFn,
|
386
|
+
useInterval,
|
387
|
+
useIntervalFn,
|
313
388
|
useThrottleFn,
|
314
389
|
useTimeoutFn,
|
315
390
|
watchImmediate
|