snail.vue 1.0.30 → 1.0.32
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/snail.vue.d.ts +22 -10
- package/dist/snail.vue.js +32 -20
- package/dist/snail.vue.umd.js +35 -19
- package/dist/styles/app.css +1 -0
- package/dist/styles/snail.vue.vue.css +15 -15
- package/package.json +2 -2
package/dist/snail.vue.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as snail_view from 'snail.view';
|
|
2
2
|
import { BaseStyle, WidthStyle, FlexBoxStyle, HeightStyle, BorderStyle, PaddingStyle } from 'snail.view';
|
|
3
3
|
import * as vue from 'vue';
|
|
4
|
-
import { Component,
|
|
4
|
+
import { Component, ShallowRef, Ref, App } from 'vue';
|
|
5
5
|
import { IScope, IAsyncScope } from 'snail.core';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -461,7 +461,7 @@ type ButtonOptions = {
|
|
|
461
461
|
*/
|
|
462
462
|
interface IReactiveManager {
|
|
463
463
|
/**
|
|
464
|
-
*
|
|
464
|
+
* 响应式【过渡】变量值
|
|
465
465
|
* - 通过设置 rv.value 的值来实现.value值过渡
|
|
466
466
|
* - 执行顺序 from、to
|
|
467
467
|
* - 开始时,设置 rv.value 值为 from;延迟time时间后,强制销毁scope
|
|
@@ -471,19 +471,31 @@ interface IReactiveManager {
|
|
|
471
471
|
* @param time 过渡持续时间,到时间后销毁作用域
|
|
472
472
|
* @returns 作用域对象,可销毁【值过渡】效果
|
|
473
473
|
*/
|
|
474
|
-
transition<T>(rv: {
|
|
475
|
-
value?: T;
|
|
476
|
-
}, effect: {
|
|
474
|
+
transition<T>(rv: ShallowRef<T> | Ref<T>, effect: {
|
|
477
475
|
from: T;
|
|
478
476
|
to: T;
|
|
479
477
|
}, time: number): IScope;
|
|
478
|
+
/**
|
|
479
|
+
* 响应式【加载】任务
|
|
480
|
+
* - 任务运行时,设置loading.value=true
|
|
481
|
+
* - 任务完成后,设置loading.value=false
|
|
482
|
+
* - 可通过delay值,延迟执行 loading.value=false 操作
|
|
483
|
+
* - 可在api请求等耗时操作任务过程中,实现响应式显隐Loading组件
|
|
484
|
+
* @param task 要运行的任务
|
|
485
|
+
* @param loading 正在加载的响应式变量
|
|
486
|
+
* @param delay 延迟时间,单位ms;不传则不延迟
|
|
487
|
+
* @returns 任务自身
|
|
488
|
+
*/
|
|
489
|
+
load<T, E>(task: Promise<T>, loading: ShallowRef<boolean> | Ref<boolean>, delay: number): Promise<{
|
|
490
|
+
success: boolean;
|
|
491
|
+
data?: T;
|
|
492
|
+
error?: E;
|
|
493
|
+
}>;
|
|
480
494
|
}
|
|
481
|
-
|
|
482
495
|
/**
|
|
483
|
-
*
|
|
484
|
-
* 1、针对Vue的响应式相关功能,做一些便捷封装
|
|
485
|
-
* 2、方便使用,减少重复性代码量
|
|
496
|
+
* 响应式变量
|
|
486
497
|
*/
|
|
498
|
+
type ReactiveVar<T> = ShallowRef<T> | Ref<T>;
|
|
487
499
|
|
|
488
500
|
/**
|
|
489
501
|
* 使用【响应式管理器】
|
|
@@ -1066,4 +1078,4 @@ declare const components: {
|
|
|
1066
1078
|
};
|
|
1067
1079
|
|
|
1068
1080
|
export { components, getSvgIcon, mount, onAppCreated, triggerAppCreated, usePopup, useReactive };
|
|
1069
|
-
export type { ButtonOptions, ComponentMountOptions, ComponentOptions, ConfirmOptions, DailogExtend, DialogHandle, DialogOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, FoldEvents, FoldOptions, FoldStatus, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, IconOptions, IconPathOptions, IconType, InputEvents, InputOptions, LoadingOptions, PopupDescriptor, PopupExtend, PopupFlagOptions, PopupHandle, PopupOptions, PopupStatus, ScrollEvents, ScrollOptions, ScrollTouchType, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, ToastOptions };
|
|
1081
|
+
export type { ButtonOptions, ComponentMountOptions, ComponentOptions, ConfirmOptions, DailogExtend, DialogHandle, DialogOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, FoldEvents, FoldOptions, FoldStatus, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, IconOptions, IconPathOptions, IconType, InputEvents, InputOptions, LoadingOptions, PopupDescriptor, PopupExtend, PopupFlagOptions, PopupHandle, PopupOptions, PopupStatus, ReactiveVar, ScrollEvents, ScrollOptions, ScrollTouchType, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, ToastOptions };
|
package/dist/snail.vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//@ sourceURL=/snail.vue.js
|
|
2
2
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, createBlock, createCommentVNode, toDisplayString, createElementVNode, normalizeProps, guardReactiveProps, unref, mergeModels, useModel, Transition, withCtx, ref, shallowRef, watch, onErrorCaptured, onActivated, onDeactivated, Fragment, resolveDynamicComponent, mergeProps, createSlots, renderList, useTemplateRef, onUnmounted, createVNode, computed, normalizeStyle, createApp, onMounted, withModifiers, getCurrentScope, onScopeDispose } from 'vue';
|
|
3
|
-
import { tidyString, throwError, mustString, useScopes, mountScope, throwIfFalse, isObject, mustFunction, useScope, isStringNotEmpty, script, delay,
|
|
3
|
+
import { tidyString, throwError, mustString, useScopes, mountScope, throwIfFalse, isPromise, wait, isObject, mustFunction, useScope, isStringNotEmpty, script, delay, mustObject, isFunction, useHook, defer, useAsyncScope, onMountScope } from 'snail.core';
|
|
4
4
|
import { link, useAnimation, css, useObserver } from 'snail.view';
|
|
5
5
|
|
|
6
6
|
var _sfc_main$j = defineComponent({
|
|
@@ -251,8 +251,17 @@ function useReactive() {
|
|
|
251
251
|
clearTimeout(endId);
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
|
+
function load(task, status, delay) {
|
|
255
|
+
throwIfFalse(isPromise(task), "task: task must be a Promise.");
|
|
256
|
+
status.value = true;
|
|
257
|
+
task.finally(function () {
|
|
258
|
+
delay > 0 ? setTimeout(() => status.value = false, delay) : status.value = false;
|
|
259
|
+
});
|
|
260
|
+
return wait(task);
|
|
261
|
+
}
|
|
254
262
|
const manager = mountScope({
|
|
255
|
-
transition
|
|
263
|
+
transition,
|
|
264
|
+
load
|
|
256
265
|
});
|
|
257
266
|
manager.onDestroy(scopes.destroy);
|
|
258
267
|
return Object.freeze(manager);
|
|
@@ -345,7 +354,7 @@ var _sfc_main$d = defineComponent({
|
|
|
345
354
|
isObject(comp) || isStringNotEmpty(comp) ? dynamicComponent.value = comp : dynamicError.value = `load component failed:return nulll or undefined. url:${__props.url}.`;
|
|
346
355
|
} catch (ex) {
|
|
347
356
|
dynamicComponent.value = void 0;
|
|
348
|
-
dynamicError.value =
|
|
357
|
+
dynamicError.value = ex.message;
|
|
349
358
|
}
|
|
350
359
|
} else {
|
|
351
360
|
dynamicError.value = "load error: name component、url are all empty.";
|
|
@@ -431,7 +440,9 @@ var _sfc_main$c = defineComponent({
|
|
|
431
440
|
} = _ref;
|
|
432
441
|
const props = __props;
|
|
433
442
|
const emit = __emit;
|
|
434
|
-
const
|
|
443
|
+
const {
|
|
444
|
+
transition
|
|
445
|
+
} = useAnimation();
|
|
435
446
|
const status = useModel(__props, "status");
|
|
436
447
|
const statusWatch = watch(status, updateFoldStyle);
|
|
437
448
|
const statusIcon = getFoldStatusDraw();
|
|
@@ -440,7 +451,7 @@ var _sfc_main$c = defineComponent({
|
|
|
440
451
|
function updateFoldStyle() {
|
|
441
452
|
const isExpand = status.value == "expand";
|
|
442
453
|
if (foldStatusSpanRef.value) {
|
|
443
|
-
|
|
454
|
+
transition(foldStatusSpanRef.value, {
|
|
444
455
|
from: {
|
|
445
456
|
transition: "transform 0.2s ease",
|
|
446
457
|
transform: isExpand ? "rotateZ(180deg)" : "rotate(0)"
|
|
@@ -456,7 +467,7 @@ var _sfc_main$c = defineComponent({
|
|
|
456
467
|
if (foldBodyRef.value) {
|
|
457
468
|
const minHeight = 32;
|
|
458
469
|
const maxHeight = minHeight + foldBodyRef.value.getBoundingClientRect().height;
|
|
459
|
-
|
|
470
|
+
transition(foldBodyRef.value.parentElement, {
|
|
460
471
|
from: {
|
|
461
472
|
transition: "height 0.2s ease",
|
|
462
473
|
overflow: "hidden",
|
|
@@ -659,6 +670,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
659
670
|
function mount(options, onDestroyed) {
|
|
660
671
|
mustObject(options, "options");
|
|
661
672
|
options.target instanceof HTMLElement || throwError("options.target must be a HTMLElement");
|
|
673
|
+
options.target.classList.add("snail-app");
|
|
662
674
|
const app = createApp(_sfc_main$d, {
|
|
663
675
|
name: options.name,
|
|
664
676
|
compponent: options.component,
|
|
@@ -713,7 +725,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
713
725
|
} = _ref;
|
|
714
726
|
const props = __props;
|
|
715
727
|
const emit = __emit;
|
|
716
|
-
const inputRef = useTemplateRef("
|
|
728
|
+
const inputRef = useTemplateRef("input-el");
|
|
717
729
|
const inputModel = useModel(__props, "modelValue");
|
|
718
730
|
const validateRef = shallowRef();
|
|
719
731
|
const titleStyle = computed(() => css.buildStyle(props.titleStyle));
|
|
@@ -736,8 +748,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
736
748
|
class: "text",
|
|
737
749
|
textContent: toDisplayString(props.title)
|
|
738
750
|
}, null, 8, _hoisted_1$4), props.readonly != true && props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$3)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$1, [createElementVNode("input", {
|
|
739
|
-
|
|
740
|
-
ref: inputRef,
|
|
751
|
+
ref: "input-el",
|
|
741
752
|
type: props.type || "text",
|
|
742
753
|
value: inputModel.value,
|
|
743
754
|
readonly: props.readonly,
|
|
@@ -794,7 +805,7 @@ function checkPopup(options) {
|
|
|
794
805
|
throwIfFalse(isStringNotEmpty(options.name) || isObject(options.component) || isStringNotEmpty(options.url), "checkPopup: options.name/component/url cannot be invalid at same time.");
|
|
795
806
|
options.zIndex > 0 || (options.zIndex = DEFAULT_ZINDEX);
|
|
796
807
|
} catch (ex) {
|
|
797
|
-
return
|
|
808
|
+
return ex.message;
|
|
798
809
|
}
|
|
799
810
|
}
|
|
800
811
|
function openPopup(container, options, extOptions) {
|
|
@@ -824,7 +835,7 @@ const initPopupApp = function () {
|
|
|
824
835
|
return function () {
|
|
825
836
|
if (popupApp == void 0) {
|
|
826
837
|
const container = document.createElement("div");
|
|
827
|
-
container.classList.add("snail-popup-app");
|
|
838
|
+
container.classList.add("snail-app", "snail-popup-app");
|
|
828
839
|
container.style = "height:0 !important; width:0 !important;";
|
|
829
840
|
document.body.appendChild(container);
|
|
830
841
|
popupApp = createApp(_sfc_main$6, {
|
|
@@ -930,11 +941,13 @@ var _sfc_main$5 = defineComponent({
|
|
|
930
941
|
},
|
|
931
942
|
setup(__props) {
|
|
932
943
|
const props = __props;
|
|
933
|
-
const
|
|
944
|
+
const {
|
|
945
|
+
onEvent
|
|
946
|
+
} = useObserver();
|
|
934
947
|
const loading = shallowRef(false);
|
|
935
948
|
onMounted(() => {
|
|
936
949
|
loading.value = true;
|
|
937
|
-
|
|
950
|
+
onEvent(window, "keyup", event => {
|
|
938
951
|
event.key === "Escape" && props.dialogStatus.value == "active" && props.closeOnEscape && props.closeDialog();
|
|
939
952
|
});
|
|
940
953
|
});
|
|
@@ -1068,13 +1081,10 @@ var _sfc_main$2 = defineComponent({
|
|
|
1068
1081
|
props: {
|
|
1069
1082
|
type: {},
|
|
1070
1083
|
message: {},
|
|
1071
|
-
id: {},
|
|
1072
|
-
zIndex: {},
|
|
1073
1084
|
inPopup: {},
|
|
1074
1085
|
closePopup: {
|
|
1075
1086
|
type: Function
|
|
1076
|
-
}
|
|
1077
|
-
popupStatus: {}
|
|
1087
|
+
}
|
|
1078
1088
|
},
|
|
1079
1089
|
setup(__props) {
|
|
1080
1090
|
const props = __props;
|
|
@@ -1226,7 +1236,9 @@ var _sfc_main$1 = defineComponent({
|
|
|
1226
1236
|
emit: __emit
|
|
1227
1237
|
} = _ref;
|
|
1228
1238
|
const emit = __emit;
|
|
1229
|
-
const
|
|
1239
|
+
const {
|
|
1240
|
+
onEvent
|
|
1241
|
+
} = useObserver();
|
|
1230
1242
|
const isTouch = "ontouchstart" in window;
|
|
1231
1243
|
const dragHandle = useTemplateRef("dragHandle");
|
|
1232
1244
|
const dragInfo = ref({
|
|
@@ -1265,8 +1277,8 @@ var _sfc_main$1 = defineComponent({
|
|
|
1265
1277
|
}
|
|
1266
1278
|
}
|
|
1267
1279
|
isTouch || onMounted(function () {
|
|
1268
|
-
|
|
1269
|
-
|
|
1280
|
+
onEvent(window, "mousemove", onDragMove);
|
|
1281
|
+
onEvent(window, "mouseup", onDragEnd);
|
|
1270
1282
|
});
|
|
1271
1283
|
return (_ctx, _cache) => {
|
|
1272
1284
|
return openBlock(), createElementBlock("div", {
|
package/dist/snail.vue.umd.js
CHANGED
|
@@ -74,6 +74,10 @@
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
+
var addLink = href => setTimeout(snail_view.link.register, 0, href);
|
|
78
|
+
|
|
79
|
+
addLink("/styles/snail.vue.vue.css");
|
|
80
|
+
|
|
77
81
|
function getSvgIcon(options) {
|
|
78
82
|
var {
|
|
79
83
|
type,
|
|
@@ -249,8 +253,17 @@
|
|
|
249
253
|
clearTimeout(endId);
|
|
250
254
|
});
|
|
251
255
|
}
|
|
256
|
+
function load(task, status, delay) {
|
|
257
|
+
snail_core.throwIfFalse(snail_core.isPromise(task), "task: task must be a Promise.");
|
|
258
|
+
status.value = true;
|
|
259
|
+
task.finally(function () {
|
|
260
|
+
delay > 0 ? setTimeout(() => status.value = false, delay) : status.value = false;
|
|
261
|
+
});
|
|
262
|
+
return snail_core.wait(task);
|
|
263
|
+
}
|
|
252
264
|
const manager = snail_core.mountScope({
|
|
253
|
-
transition
|
|
265
|
+
transition,
|
|
266
|
+
load
|
|
254
267
|
});
|
|
255
268
|
manager.onDestroy(scopes.destroy);
|
|
256
269
|
return Object.freeze(manager);
|
|
@@ -343,7 +356,7 @@
|
|
|
343
356
|
snail_core.isObject(comp) || snail_core.isStringNotEmpty(comp) ? dynamicComponent.value = comp : dynamicError.value = `load component failed:return nulll or undefined. url:${__props.url}.`;
|
|
344
357
|
} catch (ex) {
|
|
345
358
|
dynamicComponent.value = void 0;
|
|
346
|
-
dynamicError.value =
|
|
359
|
+
dynamicError.value = ex.message;
|
|
347
360
|
}
|
|
348
361
|
} else {
|
|
349
362
|
dynamicError.value = "load error: name component、url are all empty.";
|
|
@@ -429,7 +442,9 @@
|
|
|
429
442
|
} = _ref;
|
|
430
443
|
const props = __props;
|
|
431
444
|
const emit = __emit;
|
|
432
|
-
const
|
|
445
|
+
const {
|
|
446
|
+
transition
|
|
447
|
+
} = snail_view.useAnimation();
|
|
433
448
|
const status = vue.useModel(__props, "status");
|
|
434
449
|
const statusWatch = vue.watch(status, updateFoldStyle);
|
|
435
450
|
const statusIcon = getFoldStatusDraw();
|
|
@@ -438,7 +453,7 @@
|
|
|
438
453
|
function updateFoldStyle() {
|
|
439
454
|
const isExpand = status.value == "expand";
|
|
440
455
|
if (foldStatusSpanRef.value) {
|
|
441
|
-
|
|
456
|
+
transition(foldStatusSpanRef.value, {
|
|
442
457
|
from: {
|
|
443
458
|
transition: "transform 0.2s ease",
|
|
444
459
|
transform: isExpand ? "rotateZ(180deg)" : "rotate(0)"
|
|
@@ -454,7 +469,7 @@
|
|
|
454
469
|
if (foldBodyRef.value) {
|
|
455
470
|
const minHeight = 32;
|
|
456
471
|
const maxHeight = minHeight + foldBodyRef.value.getBoundingClientRect().height;
|
|
457
|
-
|
|
472
|
+
transition(foldBodyRef.value.parentElement, {
|
|
458
473
|
from: {
|
|
459
474
|
transition: "height 0.2s ease",
|
|
460
475
|
overflow: "hidden",
|
|
@@ -657,6 +672,7 @@
|
|
|
657
672
|
function mount(options, onDestroyed) {
|
|
658
673
|
snail_core.mustObject(options, "options");
|
|
659
674
|
options.target instanceof HTMLElement || snail_core.throwError("options.target must be a HTMLElement");
|
|
675
|
+
options.target.classList.add("snail-app");
|
|
660
676
|
const app = vue.createApp(_sfc_main$d, {
|
|
661
677
|
name: options.name,
|
|
662
678
|
compponent: options.component,
|
|
@@ -711,7 +727,7 @@
|
|
|
711
727
|
} = _ref;
|
|
712
728
|
const props = __props;
|
|
713
729
|
const emit = __emit;
|
|
714
|
-
const inputRef = vue.useTemplateRef("
|
|
730
|
+
const inputRef = vue.useTemplateRef("input-el");
|
|
715
731
|
const inputModel = vue.useModel(__props, "modelValue");
|
|
716
732
|
const validateRef = vue.shallowRef();
|
|
717
733
|
const titleStyle = vue.computed(() => snail_view.css.buildStyle(props.titleStyle));
|
|
@@ -734,8 +750,7 @@
|
|
|
734
750
|
class: "text",
|
|
735
751
|
textContent: vue.toDisplayString(props.title)
|
|
736
752
|
}, null, 8, _hoisted_1$4), props.readonly != true && props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$3)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3$1, [vue.createElementVNode("input", {
|
|
737
|
-
|
|
738
|
-
ref: inputRef,
|
|
753
|
+
ref: "input-el",
|
|
739
754
|
type: props.type || "text",
|
|
740
755
|
value: inputModel.value,
|
|
741
756
|
readonly: props.readonly,
|
|
@@ -792,7 +807,7 @@
|
|
|
792
807
|
snail_core.throwIfFalse(snail_core.isStringNotEmpty(options.name) || snail_core.isObject(options.component) || snail_core.isStringNotEmpty(options.url), "checkPopup: options.name/component/url cannot be invalid at same time.");
|
|
793
808
|
options.zIndex > 0 || (options.zIndex = DEFAULT_ZINDEX);
|
|
794
809
|
} catch (ex) {
|
|
795
|
-
return
|
|
810
|
+
return ex.message;
|
|
796
811
|
}
|
|
797
812
|
}
|
|
798
813
|
function openPopup(container, options, extOptions) {
|
|
@@ -822,7 +837,7 @@
|
|
|
822
837
|
return function () {
|
|
823
838
|
if (popupApp == void 0) {
|
|
824
839
|
const container = document.createElement("div");
|
|
825
|
-
container.classList.add("snail-popup-app");
|
|
840
|
+
container.classList.add("snail-app", "snail-popup-app");
|
|
826
841
|
container.style = "height:0 !important; width:0 !important;";
|
|
827
842
|
document.body.appendChild(container);
|
|
828
843
|
popupApp = vue.createApp(_sfc_main$6, {
|
|
@@ -928,11 +943,13 @@
|
|
|
928
943
|
},
|
|
929
944
|
setup(__props) {
|
|
930
945
|
const props = __props;
|
|
931
|
-
const
|
|
946
|
+
const {
|
|
947
|
+
onEvent
|
|
948
|
+
} = snail_view.useObserver();
|
|
932
949
|
const loading = vue.shallowRef(false);
|
|
933
950
|
vue.onMounted(() => {
|
|
934
951
|
loading.value = true;
|
|
935
|
-
|
|
952
|
+
onEvent(window, "keyup", event => {
|
|
936
953
|
event.key === "Escape" && props.dialogStatus.value == "active" && props.closeOnEscape && props.closeDialog();
|
|
937
954
|
});
|
|
938
955
|
});
|
|
@@ -1066,13 +1083,10 @@
|
|
|
1066
1083
|
props: {
|
|
1067
1084
|
type: {},
|
|
1068
1085
|
message: {},
|
|
1069
|
-
id: {},
|
|
1070
|
-
zIndex: {},
|
|
1071
1086
|
inPopup: {},
|
|
1072
1087
|
closePopup: {
|
|
1073
1088
|
type: Function
|
|
1074
|
-
}
|
|
1075
|
-
popupStatus: {}
|
|
1089
|
+
}
|
|
1076
1090
|
},
|
|
1077
1091
|
setup(__props) {
|
|
1078
1092
|
const props = __props;
|
|
@@ -1224,7 +1238,9 @@
|
|
|
1224
1238
|
emit: __emit
|
|
1225
1239
|
} = _ref;
|
|
1226
1240
|
const emit = __emit;
|
|
1227
|
-
const
|
|
1241
|
+
const {
|
|
1242
|
+
onEvent
|
|
1243
|
+
} = snail_view.useObserver();
|
|
1228
1244
|
const isTouch = "ontouchstart" in window;
|
|
1229
1245
|
const dragHandle = vue.useTemplateRef("dragHandle");
|
|
1230
1246
|
const dragInfo = vue.ref({
|
|
@@ -1263,8 +1279,8 @@
|
|
|
1263
1279
|
}
|
|
1264
1280
|
}
|
|
1265
1281
|
isTouch || vue.onMounted(function () {
|
|
1266
|
-
|
|
1267
|
-
|
|
1282
|
+
onEvent(window, "mousemove", onDragMove);
|
|
1283
|
+
onEvent(window, "mouseup", onDragEnd);
|
|
1268
1284
|
});
|
|
1269
1285
|
return (_ctx, _cache) => {
|
|
1270
1286
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.snail-app{font-family:Microsoft YaHei,微软雅黑,Hiragino Sans GB,tahoma,arial,simsun,\ 宋体,"sans-serif"}.snail-app,.snail-app *{box-sizing:border-box}.snail-app input{border-radius:4px;font:inherit;margin:0;outline:0!important}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/* src:base\footer.vue index:0 */
|
|
2
2
|
.snail-footer{align-items:center;background-color:#fff;display:flex;flex-shrink:0;height:72px;padding:0 40px;width:100%}.snail-footer>.snail-button:nth-child(n+2){margin-left:20px}.snail-footer.start-divider{border-top:1px solid #dddfed}.snail-footer.left{justify-content:left}.snail-footer.center{justify-content:center}.snail-footer.right{justify-content:right}
|
|
3
|
-
/* src:base\button.vue index:0 */
|
|
4
|
-
.snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;font-size:14px;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.snail-button.max{height:40px;width:120px}.snail-button.middle{height:32px;width:90px}.snail-button.normal{height:28px;width:54px}.snail-button.small{height:20px;width:30px}.snail-button.primary{background-color:#5ca3ff;color:#fff}.snail-button.default{background-color:#fff;border:1px solid #dddfed;color:#2e2f33}.snail-button.link{color:#4c9aff}
|
|
5
3
|
/* src:base\header.vue index:0 */
|
|
6
|
-
.snail-header{align-items:center;background-color:#fff;display:flex;flex-shrink:0;position:relative;width:100%}.snail-header>.header-title{color:#2e3033;flex:1;line-height:48px;overflow:hidden;padding
|
|
4
|
+
.snail-header{align-items:center;background-color:#fff;display:flex;flex-shrink:0;position:relative;width:100%}.snail-header>.header-title{color:#2e3033;flex:1;line-height:48px;overflow:hidden;padding:0 30px;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-header>.header-title.left{text-align:left}.snail-header>.header-title.center{text-align:center}.snail-header>.header-title.right{text-align:right}.snail-header.start-divider{border-bottom:1px solid #dddfed}.snail-header.page{height:48px}.snail-header.page>.header-title{font-size:16px;font-weight:700}.snail-header.page>.close-icon{margin-right:18px}.snail-header.dialog{height:64px;padding-top:16px}.snail-header.dialog>.header-title{font-size:20px}.snail-header.dialog>.close-icon{position:absolute;right:8px;top:8px}
|
|
7
5
|
/* src:base\icon.vue index:0 */
|
|
8
6
|
.snail-icon{cursor:pointer;opacity:1}
|
|
9
|
-
/* src:
|
|
10
|
-
.snail-
|
|
7
|
+
/* src:base\button.vue index:0 */
|
|
8
|
+
.snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;font-size:14px;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.snail-button.max{height:40px;width:120px}.snail-button.middle{height:32px;width:90px}.snail-button.normal{height:28px;width:54px}.snail-button.small{height:20px;width:30px}.snail-button.primary{background-color:#5ca3ff;color:#fff}.snail-button.default{background-color:#fff;border:1px solid #dddfed;color:#2e2f33}.snail-button.link{color:#4c9aff}
|
|
11
9
|
/* src:base\switch.vue index:0 */
|
|
12
10
|
.snail-switch{border-radius:10px 10px 10px 10px;cursor:pointer;height:20px!important;overflow:hidden;position:relative;width:36px!important}.snail-switch>div{height:100%;width:100%}.snail-switch>div.on{background-color:#5ca3ff}.snail-switch>div.off{background-color:#c4c8cc;position:absolute;transition:left .2s ease}.snail-switch>div.status{background:#fff;border-radius:10px 10px 10px 10px;height:16px;position:absolute;top:2px;transition:left .2s ease;width:16px}.snail-switch.on>div.off{left:100%;top:0}.snail-switch.on>div.status{left:calc(100% - 18px)}.snail-switch.off>div.off{left:0;top:0}.snail-switch.off>div.status{left:2px}.snail-switch.readonly{cursor:default}
|
|
13
|
-
/* src:container\fold.vue index:0 */
|
|
14
|
-
.snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-size:14px;font-weight:700;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:right;display:flex;flex:1;justify-content:right}.snail-fold>div.fold-body{padding-left:20px}
|
|
15
11
|
/* src:container\scroll.vue index:0 */
|
|
16
12
|
.snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
|
|
13
|
+
/* src:container\fold.vue index:0 */
|
|
14
|
+
.snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-size:14px;font-weight:700;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:right;display:flex;flex:1;justify-content:right}.snail-fold>div.fold-body{padding-left:20px}
|
|
15
|
+
/* src:container\table.vue index:0 */
|
|
16
|
+
.snail-table{display:flex;flex-direction:column}.snail-table>div.table-footer,.snail-table>div.table-header{align-items:center;display:flex;flex-shrink:0;width:100%}.snail-table>div.table-header{position:sticky!important;top:0}.snail-table>div.table-body{flex:1;width:100%}.snail-table.start-border>div.table-body>.table-row>.table-col:nth-child(n+2),.snail-table.start-border>div.table-footer>.table-col:nth-child(n+2),.snail-table.start-border>div.table-header>.table-col:nth-child(n+2){border-left:none!important}.snail-table.start-border>div.table-body>.table-row>.table-col,.snail-table.start-border>div.table-footer>.table-col{border-top:none!important}
|
|
17
17
|
/* src:container\components\table-col.vue index:0 */
|
|
18
18
|
.table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:left}.table-col.center{justify-content:center}.table-col.right{justify-content:right}
|
|
19
|
+
/* src:container\dynamic.vue index:0 */
|
|
20
|
+
.snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
|
|
19
21
|
/* src:container\components\table-row.vue index:0 */
|
|
20
22
|
.table-row{align-items:center;display:flex;min-width:100%}
|
|
21
|
-
/* src:container\table.vue index:0 */
|
|
22
|
-
.snail-table{display:flex;flex-direction:column}.snail-table>div.table-footer,.snail-table>div.table-header{align-items:center;display:flex;flex-shrink:0;width:100%}.snail-table>div.table-header{position:sticky!important;top:0}.snail-table>div.table-body{flex:1;width:100%}.snail-table.start-border>div.table-body>.table-row>.table-col:nth-child(n+2),.snail-table.start-border>div.table-footer>.table-col:nth-child(n+2),.snail-table.start-border>div.table-header>.table-col:nth-child(n+2){border-left:none!important}.snail-table.start-border>div.table-body>.table-row>.table-col,.snail-table.start-border>div.table-footer>.table-col{border-top:none!important}
|
|
23
|
-
/* src:form\input.vue index:0 */
|
|
24
|
-
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;font-size:14px;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{border:1px solid #dddfed;color:#2e3033;flex:1;font-size:14px;font-weight:400;padding:0 10px;text-overflow:ellipsis}.snail-input>.input-body>input:focus{border:1px solid #3292ea}.snail-input>.input-body>span{background-color:red;flex-shrink:0}.snail-input.readonly>div.input-body>input:focus{border:1px solid #dddfed}
|
|
25
23
|
/* src:prompt\drag-verify.vue index:0 */
|
|
26
24
|
.snail-drag-verify{background:#f8f9fa;border:1px solid #dddfed;border-radius:8px;height:40px;overflow:hidden;position:relative;width:100%}.snail-drag-verify>div{height:100%;width:100%}.snail-drag-verify>.drag-progress{background-color:#0c6;transition:width .5s ease-in-out}.snail-drag-verify>.drag-handle,.snail-drag-verify>.verify-message{left:0;position:absolute;top:0;transition:left .5s ease-in-out}.snail-drag-verify>.verify-message{background-image:-webkit-linear-gradient(left,#666,#666 45%,#fff 50%,#666 55%,#666);-webkit-text-fill-color:transparent;align-items:center;animation:snail-drag-verify 2s linear infinite;-webkit-background-clip:text;background-clip:text;background-size:200% 100%;color:#7e848c;display:flex;font-size:12px;font-weight:400;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-drag-verify>.drag-handle{align-items:center;background-color:#fff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQAAAGBQUGBaWmJZWWJYWGNYWGNZWWJYWGJZWWBYWGNYWGNZWWRYWIqwlb0AAAANdFJOUwAQMMDQoFBgcCCw4ECQ8pPMAAAAP0lEQVQI12NgwATTGBgawAwRBYZwMIPRiYErAcxSFmA0AjN4HBikBcCsUgYmQxQGE0wKphhIQrSzwAyEW4EOACHhB32zIad6AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;border-right:1px solid #dddfed;cursor:move;display:flex;justify-content:center;width:40px}.snail-drag-verify.dragging>.drag-handle,.snail-drag-verify.dragging>.drag-progress{transition:none!important}.snail-drag-verify.success>.verify-message{-webkit-text-fill-color:#fff;color:#fff}.snail-drag-verify.success>.drag-handle>svg{background:#76c61d;border-radius:50%;padding:4px}@keyframes snail-drag-verify{0%{background-position:0 0}to{background-position:-200% 0}}
|
|
27
25
|
/* src:prompt\empty.vue index:0 */
|
|
28
26
|
.snail-empty{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:100%}.snail-empty>img{height:60px;width:60px}.snail-empty>div.message{color:#babdc2;font-size:14px;font-weight:400;padding:0 10px 10px}
|
|
29
27
|
/* src:prompt\loading.vue index:0 */
|
|
30
28
|
.snail-loading{height:100%;left:0;position:absolute;top:0;width:100%;z-index:10000}.snail-loading.show-mask{background-color:rgba(0,0,0,.15)}.snail-loading:after,.snail-loading:before{animation:snail-loading-stretch 1s ease-in-out infinite;border-radius:50%;content:"";display:block;display:inline-block;height:10px;left:50%;margin-left:-18px;margin-top:-6px;position:absolute;top:50%;width:10px}.snail-loading:before{background-color:#279bf1}.snail-loading:after{animation-delay:-.5s;background:#64d214;margin-left:0;margin-right:-18px}@keyframes snail-loading-stretch{0%,to{transform:scale(1)}50%{transform:scale(2)}}.snail-loading-enter-active,.snail-loading-leave-active{transition:opacity .5s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
|
|
31
|
-
/* src:
|
|
32
|
-
.snail-
|
|
29
|
+
/* src:form\input.vue index:0 */
|
|
30
|
+
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;font-size:14px;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{border:1px solid #dddfed;color:#2e3033;flex:1;font-size:14px;font-weight:400;padding:0 10px;text-overflow:ellipsis}.snail-input>.input-body>input:focus{border:1px solid #3292ea}.snail-input>.input-body>span{background-color:red;flex-shrink:0}.snail-input.readonly>div.input-body>input:focus{border:1px solid #dddfed}
|
|
33
31
|
/* src:popup\components\dialog-container.vue index:0 */
|
|
34
|
-
.snail-dialog{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%}.snail-dialog:before{background-color:rgba(24,27,33,.45);content:"";height:100%;position:absolute;width:100%}.snail-dialog>.dialog-body{background-color:#fff;border-radius:4px;box-shadow:0 0 15px rgba(0,0,0,.3);
|
|
32
|
+
.snail-dialog{align-items:center;display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%}.snail-dialog:before{background-color:rgba(24,27,33,.45);content:"";height:100%;position:absolute;width:100%}.snail-dialog>.dialog-body{background-color:#fff;border-radius:4px;box-shadow:0 0 15px rgba(0,0,0,.3);position:relative}.snail-dialog.unactive:before{display:none!important}.snail-dialog.unactive>.dialog-body{box-shadow:0 0 4px rgba(0,0,0,.3)}.snail-dialog-enter-active,.snail-dialog-leave-active{transition:scale .1s ease-in-out,opacity .1s ease}.snail-dialog-enter-from{opacity:0;scale:.4}.snail-dialog-leave-to{opacity:0;scale:0}
|
|
35
33
|
/* src:popup\components\popup-container.vue index:0 */
|
|
36
34
|
.snail-popup{left:0;position:fixed;top:0}.snail-popup-enter-active,.snail-popup-leave-active{transition:opacity .1s ease}.snail-popup-enter-from,.snail-popup-leave-to{opacity:0}
|
|
37
35
|
/* src:popup\components\toast-container.vue index:0 */
|
|
38
|
-
.snail-toast{background:rgba(0,0,0,.7);border-radius:10px;color:#fff;display:flex;left:50%;max-height:200px;max-width:400px;min-width:200px;opacity:0;overflow:hidden;padding:20px 35px 20px 15px;position:fixed;top:50%;transform:translate(-50%,-50%);transition:opacity .5s ease}.snail-toast.show-toast{opacity:1}.snail-toast>svg.close-icon{position:absolute;right:10px;top:12px}.snail-toast>div.icon{align-items:center;align-self:center;background:hsla(0,0%,100%,.15);border-radius:50%;display:flex;height:26px;justify-content:center;margin-right:6px;width:26px}.snail-toast>div.icon>svg{background:#fff;border-radius:50%;cursor:none!important}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
36
|
+
.snail-toast{background:rgba(0,0,0,.7);border-radius:10px;color:#fff;display:flex;left:50%;max-height:200px;max-width:400px;min-width:200px;opacity:0;overflow:hidden;padding:20px 35px 20px 15px;position:fixed;top:50%;transform:translate(-50%,-50%);transition:opacity .5s ease}.snail-toast.show-toast{opacity:1}.snail-toast>svg.close-icon{position:absolute;right:10px;top:12px}.snail-toast>div.icon{align-items:center;align-self:center;background:hsla(0,0%,100%,.15);border-radius:50%;display:flex;height:26px;justify-content:center;margin-right:6px;width:26px}.snail-toast>div.icon>svg{background:#fff;border-radius:50%;cursor:none!important}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
37
|
+
/* src:popup\components\confirm-container.vue index:0 */
|
|
38
|
+
.snail-confirm{background-color:#fff;border-radius:4px;color:#2e2f33;display:flex;flex-direction:column;max-height:350px;max-width:548px;min-width:348px}.snail-confirm>div.confirm-body{flex:1;font-size:14px;margin:20px 40px;overflow:auto;word-wrap:break-word}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "依赖【snail】,基于vue封装常用UI组件",
|
|
4
4
|
"author": "snail_dev@163.com",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.32",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/snail.vue.js",
|
|
9
9
|
"module": "dist/snail.vue.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"vue": "^3.5.14",
|
|
18
|
-
"snail.core": ">=2.0.
|
|
18
|
+
"snail.core": ">=2.0.10",
|
|
19
19
|
"snail.view": ">=1.0.13"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|