snail.vue 1.0.27 → 1.0.29

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/.code-snippets ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "vue template:": {
3
+ "scope": "vue",
4
+ "prefix": "VueTemplate",
5
+ "body": [
6
+ "<!-- 组件介绍写到这里 -->",
7
+ "<template>",
8
+ "\t",
9
+ "</template>",
10
+ "",
11
+ "<script setup lang=\"ts\">",
12
+ "import { ref, shallowRef, watch ,onActivated, onDeactivated} from \"vue\";",
13
+ "",
14
+ "// ***************************************** 👉 组件定义 *****************************************",
15
+ "// 1、props、data",
16
+ "// 2、可选配置选项",
17
+ "defineOptions({ name: 组件名称, inheritAttrs: true, });",
18
+ "",
19
+ "// ***************************************** 👉 方法+事件 ****************************************",
20
+ "",
21
+ "// ***************************************** 👉 组件渲染 *****************************************",
22
+ "// 1、数据初始化、变化监听",
23
+ "// 2、生命周期响应",
24
+ "",
25
+ "// 监听组件激活和卸载,适配KeepAlive组件内使用",
26
+ "onActivated(() => console.log(\"onActivated\"));",
27
+ "onDeactivated(() => console.log(\"onDeactivated\"));",
28
+ "</script>",
29
+ "",
30
+ "<style lang=\"less\">",
31
+ "// 引入基础Mixins样式",
32
+ "@import \"snail.view/dist/styles/base-mixins.less\";",
33
+ "",
34
+ "</style>"
35
+ ],
36
+ "description": "Vue组件模板代码"
37
+ }
38
+ }
@@ -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, App, Ref, ShallowRef } from 'vue';
4
+ import { Component, App, ShallowRef } from 'vue';
5
5
  import { IScope } from 'snail.core';
6
6
 
7
7
  /**
@@ -456,6 +456,42 @@ type ButtonOptions = {
456
456
  type: "primary" | "default" | "link";
457
457
  };
458
458
 
459
+ /**
460
+ * 接口:响应式管理器
461
+ */
462
+ interface IReactiveManager {
463
+ /**
464
+ * 【过渡】响应式变量值
465
+ * - 通过设置 rv.value 的值来实现.value值过渡
466
+ * - 执行顺序 from、to
467
+ * - 开始时,设置 rv.value 值为 from;延迟time时间后,强制销毁scope
468
+ * - 销毁scope时,强制将 rv.value 值设置为 to 值
469
+ * @param rv 响应式变量对象
470
+ * @param effect 过渡效果配置,约束 from end 样式
471
+ * @param time 过渡持续时间,到时间后销毁作用域
472
+ * @returns 作用域对象,可销毁【值过渡】效果
473
+ */
474
+ transition<T>(rv: {
475
+ value?: T;
476
+ }, effect: {
477
+ from: T;
478
+ to: T;
479
+ }, time: number): IScope;
480
+ }
481
+
482
+ /**
483
+ * 响应式 模块;
484
+ * 1、针对Vue的响应式相关功能,做一些便捷封装
485
+ * 2、方便使用,减少重复性代码量
486
+ */
487
+
488
+ /**
489
+ * 使用【响应式管理器】
490
+ * - 请在Vue组件的setup中使用此方法,否则 getCurrentScope 方法无法取到值
491
+ * @returns 全新的【响应式管理器】+作用域
492
+ */
493
+ declare function useReactive(): IReactiveManager & IScope;
494
+
459
495
  /**
460
496
  * Vue App助手类,做一些app实例的辅助性工作
461
497
  */
@@ -485,23 +521,6 @@ declare function triggerAppCreated(app: App): App;
485
521
  */
486
522
  declare function getSvgIcon(options: IconOptions): IconPathOptions;
487
523
 
488
- /**
489
- * 响应式助手类,封装一些响应式相关的工具方法
490
- */
491
-
492
- /**
493
- * 作用域ref,方法执行逻辑:
494
- * -1、初始化作用域,设置rv值: rv.value = start
495
- * -2、在延迟 dealy 销毁作用域,设置rv值:rv.value = end
496
- * - 备注示例:可和 snail.core 中的 waitInScope 方法联动实现:api请求开始时显示loading,api请求结束后隐藏loading
497
- * @param rv 响应式变量对象
498
- * @param start 起始值,scope创建时执行 rv.value = start
499
- * @param end 销毁值,scope销毁时执行 rv.value = end
500
- * @param dealy 销毁时的延迟时间;单位 ms ;实现延迟设置 end 值
501
- * @returns 新创建的作用域对象
502
- */
503
- declare function scopeRef<T>(rv: Ref<T> | ShallowRef<T>, start: T, end: T, dealy?: number): IScope;
504
-
505
524
  /**
506
525
  * 模态弹窗显示的组件配置选项
507
526
  */
@@ -978,5 +997,5 @@ declare const components: {
978
997
  */
979
998
  declare function mount(options: ComponentMountOptions, onDestroyed?: (fn: () => void) => void): IScope;
980
999
 
981
- export { components, confirm, getSvgIcon, mount, onAppCreated, openDialog, scopeDialog, scopeRef, toast, triggerAppCreated };
1000
+ export { components, confirm, getSvgIcon, mount, onAppCreated, openDialog, scopeDialog, toast, triggerAppCreated, useReactive };
982
1001
  export type { ButtonOptions, ComponentMountOptions, ComponentOptions, ConfirmHandle, ConfirmOptions, Dialog, DialogHandle, DialogOpenResult, DialogOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, FoldEvents, FoldOptions, FoldStatus, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IconOptions, IconPathOptions, IconType, InputEvents, InputOptions, LoadingOptions, ScrollEvents, ScrollOptions, ScrollTouchType, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, ToastHandle, ToastOptions };
package/dist/snail.vue.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //@ sourceURL=/snail.vue.js
2
- import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, createBlock, createCommentVNode, toDisplayString, createElementVNode, normalizeProps, guardReactiveProps, unref, computed, mergeProps, mergeModels, useModel, Transition, withCtx, ref, shallowRef, watch, onErrorCaptured, onActivated, onDeactivated, Fragment, resolveDynamicComponent, createSlots, renderList, useTemplateRef, onUnmounted, createVNode, normalizeStyle, TransitionGroup, withModifiers, createApp, onMounted } from 'vue';
3
- import { tidyString, throwError, mustString, mustFunction, useScope, isStringNotEmpty, isObject, script, delay, getMessage, useHook, mustObject, defer, newId, isFunction } from 'snail.core';
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, TransitionGroup, withModifiers, createApp, onMounted, getCurrentScope, onScopeDispose } from 'vue';
3
+ import { tidyString, throwError, mustString, useScopes, mountScope, throwIfFalse, isObject, mustFunction, useScope, isStringNotEmpty, script, delay, getMessage, useHook, mustObject, defer, newId, isFunction, onMountScope } from 'snail.core';
4
4
  import { link, useAnimation, css, useObserver } from 'snail.view';
5
5
 
6
6
  var _sfc_main$h = defineComponent({
@@ -23,10 +23,6 @@ var _sfc_main$h = defineComponent({
23
23
  }
24
24
  });
25
25
 
26
- var addLink = href => setTimeout(link.register, 0, href);
27
-
28
- addLink("/styles/snail.vue.vue.css");
29
-
30
26
  var _sfc_main$g = defineComponent({
31
27
  ...{
32
28
  name: "Footer",
@@ -139,6 +135,10 @@ var _sfc_main$f = defineComponent({
139
135
  }
140
136
  });
141
137
 
138
+ var addLink = href => setTimeout(link.register, 0, href);
139
+
140
+ addLink("/styles/snail.vue.vue.css");
141
+
142
142
  const _hoisted_1$8 = ["textContent"];
143
143
  var _sfc_main$e = defineComponent({
144
144
  ...{
@@ -170,11 +170,6 @@ var _sfc_main$e = defineComponent({
170
170
  emit: __emit
171
171
  } = _ref;
172
172
  const emit = __emit;
173
- const closeIconOptions = computed(() => ({
174
- type: "close",
175
- color: __props.useTo == "page" ? "#2e3033" : "#464953",
176
- size: 22
177
- }));
178
173
  return (_ctx, _cache) => {
179
174
  return openBlock(), createElementBlock("header", {
180
175
  class: normalizeClass(["snail-header", _ctx.useTo, {
@@ -184,12 +179,14 @@ var _sfc_main$e = defineComponent({
184
179
  key: 0,
185
180
  textContent: toDisplayString(_ctx.title),
186
181
  class: normalizeClass(["header-title", _ctx.titleAlign])
187
- }, null, 10, _hoisted_1$8)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$f, mergeProps({
182
+ }, null, 10, _hoisted_1$8)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), _ctx.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$f, {
188
183
  key: 1,
189
- class: "close-icon"
190
- }, closeIconOptions.value, {
184
+ type: "close",
185
+ size: 22,
186
+ color: _ctx.useTo == "page" ? "#2e3033" : "#464953",
187
+ class: "close-icon",
191
188
  onClick: _cache[0] || (_cache[0] = $event => emit("close"))
192
- }), null, 16)) : createCommentVNode("", true)], 2);
189
+ }, null, 8, ["color"])) : createCommentVNode("", true)], 2);
193
190
  };
194
191
  }
195
192
  });
@@ -242,6 +239,25 @@ var _sfc_main$d = defineComponent({
242
239
  }
243
240
  });
244
241
 
242
+ function useReactive() {
243
+ const scopes = useScopes();
244
+ function transition(rv, effect, time) {
245
+ throwIfFalse(isObject(effect), "transition: effect must be an object.");
246
+ const scope = scopes.get();
247
+ rv.value = effect.from;
248
+ const endId = setTimeout(scope.destroy, time);
249
+ return scope.onDestroy(function () {
250
+ rv.value = effect.to;
251
+ clearTimeout(endId);
252
+ });
253
+ }
254
+ const manager = mountScope({
255
+ transition
256
+ });
257
+ manager.onDestroy(scopes.destroy);
258
+ return Object.freeze(manager);
259
+ }
260
+
245
261
  const appCreatedFns = [];
246
262
  function onAppCreated(fn) {
247
263
  mustFunction(fn, "fn");
@@ -256,13 +272,6 @@ function triggerAppCreated(app) {
256
272
  return app;
257
273
  }
258
274
 
259
- function scopeRef(rv, start, end, dealy) {
260
- rv.value = start;
261
- return useScope().onDestroy(() => {
262
- dealy > 0 ? setTimeout(() => rv.value = end, dealy) : rv.value = end;
263
- });
264
- }
265
-
266
275
  var _sfc_main$c = defineComponent({
267
276
  ...{
268
277
  name: "Loading",
@@ -422,7 +431,7 @@ var _sfc_main$a = defineComponent({
422
431
  } = _ref;
423
432
  const props = __props;
424
433
  const emit = __emit;
425
- const animationScope = useAnimation();
434
+ const animation = useAnimation();
426
435
  const status = useModel(__props, "status");
427
436
  const statusWatch = watch(status, updateFoldStyle);
428
437
  const statusIcon = getFoldStatusDraw();
@@ -431,7 +440,7 @@ var _sfc_main$a = defineComponent({
431
440
  function updateFoldStyle() {
432
441
  const isExpand = status.value == "expand";
433
442
  if (foldStatusSpanRef.value) {
434
- animationScope.transition(foldStatusSpanRef.value, {
443
+ animation.transition(foldStatusSpanRef.value, {
435
444
  from: {
436
445
  transition: "transform 0.2s ease",
437
446
  transform: isExpand ? "rotateZ(180deg)" : "rotate(0)"
@@ -447,7 +456,7 @@ var _sfc_main$a = defineComponent({
447
456
  if (foldBodyRef.value) {
448
457
  const minHeight = 32;
449
458
  const maxHeight = minHeight + foldBodyRef.value.getBoundingClientRect().height;
450
- animationScope.transition(foldBodyRef.value.parentElement, {
459
+ animation.transition(foldBodyRef.value.parentElement, {
451
460
  from: {
452
461
  transition: "height 0.2s ease",
453
462
  overflow: "hidden",
@@ -477,7 +486,6 @@ var _sfc_main$a = defineComponent({
477
486
  emit("change", status.value);
478
487
  }
479
488
  onUnmounted(() => {
480
- animationScope.destroy();
481
489
  statusWatch.stop();
482
490
  });
483
491
  return (_ctx, _cache) => {
@@ -911,7 +919,6 @@ var _sfc_main$3 = defineComponent({
911
919
  showToast.value = true;
912
920
  });
913
921
  onUnmounted(() => {
914
- observer.destroy();
915
922
  destroyTimer && clearTimeout(destroyTimer);
916
923
  });
917
924
  return (_ctx, _cache) => {
@@ -985,17 +992,18 @@ var _sfc_main$2 = defineComponent({
985
992
  "use-to": "dialog",
986
993
  title: props.title || "提示",
987
994
  onClose: _cache[0] || (_cache[0] = $event => props.closeDialog(false))
988
- }, null, 8, ["title"]), createElementVNode("main", {
995
+ }, null, 8, ["title"]), createElementVNode("div", {
996
+ class: "confirm-body",
989
997
  innerHTML: props.message || "请确认?"
990
998
  }, null, 8, _hoisted_2$1), createVNode(_sfc_main$g, {
991
999
  align: "right",
992
1000
  "cancel-name": props.cancelName,
993
- "cancel-disable": props.cancelDisabled,
1001
+ "cancel-disabled": props.cancelDisabled,
994
1002
  "confirm-name": props.confirmName,
995
- "confirm-disable": props.confirmDisabled,
1003
+ "confirm-disabled": props.confirmDisabled,
996
1004
  onCancel: _cache[1] || (_cache[1] = $event => props.closeDialog(false)),
997
1005
  onConfirm: _cache[2] || (_cache[2] = $event => props.closeDialog(true))
998
- }, null, 8, ["cancel-name", "cancel-disable", "confirm-name", "confirm-disable"])]);
1006
+ }, null, 8, ["cancel-name", "cancel-disabled", "confirm-name", "confirm-disabled"])]);
999
1007
  };
1000
1008
  }
1001
1009
  });
@@ -1104,7 +1112,6 @@ var _sfc_main$1 = defineComponent({
1104
1112
  observer.onEvent(window, "mousemove", onDragMove);
1105
1113
  observer.onEvent(window, "mouseup", onDragEnd);
1106
1114
  });
1107
- onUnmounted(observer.destroy);
1108
1115
  return (_ctx, _cache) => {
1109
1116
  return openBlock(), createElementBlock("div", {
1110
1117
  class: normalizeClass(["snail-drag-verify", {
@@ -1206,5 +1213,6 @@ function mount(options, onDestroyed) {
1206
1213
  isFunction(onDestroyed) && onDestroyed(scope.destroy);
1207
1214
  return scope;
1208
1215
  }
1216
+ onMountScope(scope => getCurrentScope() && onScopeDispose(scope.destroy));
1209
1217
 
1210
- export { components, confirm, getSvgIcon, mount, onAppCreated, openDialog, scopeDialog, scopeRef, toast, triggerAppCreated };
1218
+ export { components, confirm, getSvgIcon, mount, onAppCreated, openDialog, scopeDialog, toast, triggerAppCreated, useReactive };
@@ -168,11 +168,6 @@
168
168
  emit: __emit
169
169
  } = _ref;
170
170
  const emit = __emit;
171
- const closeIconOptions = vue.computed(() => ({
172
- type: "close",
173
- color: __props.useTo == "page" ? "#2e3033" : "#464953",
174
- size: 22
175
- }));
176
171
  return (_ctx, _cache) => {
177
172
  return vue.openBlock(), vue.createElementBlock("header", {
178
173
  class: vue.normalizeClass(["snail-header", _ctx.useTo, {
@@ -182,12 +177,14 @@
182
177
  key: 0,
183
178
  textContent: vue.toDisplayString(_ctx.title),
184
179
  class: vue.normalizeClass(["header-title", _ctx.titleAlign])
185
- }, null, 10, _hoisted_1$8)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), _ctx.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$f, vue.mergeProps({
180
+ }, null, 10, _hoisted_1$8)) : vue.createCommentVNode("", true), vue.renderSlot(_ctx.$slots, "default"), _ctx.closeDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$f, {
186
181
  key: 1,
187
- class: "close-icon"
188
- }, closeIconOptions.value, {
182
+ type: "close",
183
+ size: 22,
184
+ color: _ctx.useTo == "page" ? "#2e3033" : "#464953",
185
+ class: "close-icon",
189
186
  onClick: _cache[0] || (_cache[0] = $event => emit("close"))
190
- }), null, 16)) : vue.createCommentVNode("", true)], 2);
187
+ }, null, 8, ["color"])) : vue.createCommentVNode("", true)], 2);
191
188
  };
192
189
  }
193
190
  });
@@ -240,6 +237,25 @@
240
237
  }
241
238
  });
242
239
 
240
+ function useReactive() {
241
+ const scopes = snail_core.useScopes();
242
+ function transition(rv, effect, time) {
243
+ snail_core.throwIfFalse(snail_core.isObject(effect), "transition: effect must be an object.");
244
+ const scope = scopes.get();
245
+ rv.value = effect.from;
246
+ const endId = setTimeout(scope.destroy, time);
247
+ return scope.onDestroy(function () {
248
+ rv.value = effect.to;
249
+ clearTimeout(endId);
250
+ });
251
+ }
252
+ const manager = snail_core.mountScope({
253
+ transition
254
+ });
255
+ manager.onDestroy(scopes.destroy);
256
+ return Object.freeze(manager);
257
+ }
258
+
243
259
  const appCreatedFns = [];
244
260
  function onAppCreated(fn) {
245
261
  snail_core.mustFunction(fn, "fn");
@@ -254,13 +270,6 @@
254
270
  return app;
255
271
  }
256
272
 
257
- function scopeRef(rv, start, end, dealy) {
258
- rv.value = start;
259
- return snail_core.useScope().onDestroy(() => {
260
- dealy > 0 ? setTimeout(() => rv.value = end, dealy) : rv.value = end;
261
- });
262
- }
263
-
264
273
  var _sfc_main$c = vue.defineComponent({
265
274
  ...{
266
275
  name: "Loading",
@@ -420,7 +429,7 @@
420
429
  } = _ref;
421
430
  const props = __props;
422
431
  const emit = __emit;
423
- const animationScope = snail_view.useAnimation();
432
+ const animation = snail_view.useAnimation();
424
433
  const status = vue.useModel(__props, "status");
425
434
  const statusWatch = vue.watch(status, updateFoldStyle);
426
435
  const statusIcon = getFoldStatusDraw();
@@ -429,7 +438,7 @@
429
438
  function updateFoldStyle() {
430
439
  const isExpand = status.value == "expand";
431
440
  if (foldStatusSpanRef.value) {
432
- animationScope.transition(foldStatusSpanRef.value, {
441
+ animation.transition(foldStatusSpanRef.value, {
433
442
  from: {
434
443
  transition: "transform 0.2s ease",
435
444
  transform: isExpand ? "rotateZ(180deg)" : "rotate(0)"
@@ -445,7 +454,7 @@
445
454
  if (foldBodyRef.value) {
446
455
  const minHeight = 32;
447
456
  const maxHeight = minHeight + foldBodyRef.value.getBoundingClientRect().height;
448
- animationScope.transition(foldBodyRef.value.parentElement, {
457
+ animation.transition(foldBodyRef.value.parentElement, {
449
458
  from: {
450
459
  transition: "height 0.2s ease",
451
460
  overflow: "hidden",
@@ -475,7 +484,6 @@
475
484
  emit("change", status.value);
476
485
  }
477
486
  vue.onUnmounted(() => {
478
- animationScope.destroy();
479
487
  statusWatch.stop();
480
488
  });
481
489
  return (_ctx, _cache) => {
@@ -909,7 +917,6 @@
909
917
  showToast.value = true;
910
918
  });
911
919
  vue.onUnmounted(() => {
912
- observer.destroy();
913
920
  destroyTimer && clearTimeout(destroyTimer);
914
921
  });
915
922
  return (_ctx, _cache) => {
@@ -983,17 +990,18 @@
983
990
  "use-to": "dialog",
984
991
  title: props.title || "提示",
985
992
  onClose: _cache[0] || (_cache[0] = $event => props.closeDialog(false))
986
- }, null, 8, ["title"]), vue.createElementVNode("main", {
993
+ }, null, 8, ["title"]), vue.createElementVNode("div", {
994
+ class: "confirm-body",
987
995
  innerHTML: props.message || "请确认?"
988
996
  }, null, 8, _hoisted_2$1), vue.createVNode(_sfc_main$g, {
989
997
  align: "right",
990
998
  "cancel-name": props.cancelName,
991
- "cancel-disable": props.cancelDisabled,
999
+ "cancel-disabled": props.cancelDisabled,
992
1000
  "confirm-name": props.confirmName,
993
- "confirm-disable": props.confirmDisabled,
1001
+ "confirm-disabled": props.confirmDisabled,
994
1002
  onCancel: _cache[1] || (_cache[1] = $event => props.closeDialog(false)),
995
1003
  onConfirm: _cache[2] || (_cache[2] = $event => props.closeDialog(true))
996
- }, null, 8, ["cancel-name", "cancel-disable", "confirm-name", "confirm-disable"])]);
1004
+ }, null, 8, ["cancel-name", "cancel-disabled", "confirm-name", "confirm-disabled"])]);
997
1005
  };
998
1006
  }
999
1007
  });
@@ -1102,7 +1110,6 @@
1102
1110
  observer.onEvent(window, "mousemove", onDragMove);
1103
1111
  observer.onEvent(window, "mouseup", onDragEnd);
1104
1112
  });
1105
- vue.onUnmounted(observer.destroy);
1106
1113
  return (_ctx, _cache) => {
1107
1114
  return vue.openBlock(), vue.createElementBlock("div", {
1108
1115
  class: vue.normalizeClass(["snail-drag-verify", {
@@ -1204,6 +1211,7 @@
1204
1211
  snail_core.isFunction(onDestroyed) && onDestroyed(scope.destroy);
1205
1212
  return scope;
1206
1213
  }
1214
+ snail_core.onMountScope(scope => vue.getCurrentScope() && vue.onScopeDispose(scope.destroy));
1207
1215
 
1208
1216
  exports.components = components;
1209
1217
  exports.confirm = confirm;
@@ -1212,8 +1220,8 @@
1212
1220
  exports.onAppCreated = onAppCreated;
1213
1221
  exports.openDialog = openDialog;
1214
1222
  exports.scopeDialog = scopeDialog;
1215
- exports.scopeRef = scopeRef;
1216
1223
  exports.toast = toast;
1217
1224
  exports.triggerAppCreated = triggerAppCreated;
1225
+ exports.useReactive = useReactive;
1218
1226
 
1219
1227
  }));
@@ -1,36 +1,36 @@
1
1
  /* src:base\button.vue index:0 */
2
- .snail-button{align-items:center;border-radius:2px;cursor:pointer;display:inline-flex;font-size:14px;justify-content:center;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}
3
- /* src:base\header.vue index:0 */
4
- .snail-header{align-items:center;background-color:#fff;display:flex;flex-direction:row;flex-shrink:0;position:relative;width:100%}.snail-header>.header-title{color:#2e3033;flex:1;line-height:48px;overflow:hidden;padding-left:24px;text-overflow:ellipsis;white-space:nowrap}.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}
2
+ .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\footer.vue index:0 */
6
4
  .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}
7
- /* src:container\dynamic.vue index:0 */
8
- .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
5
+ /* 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-left:24px;text-overflow:ellipsis;white-space:nowrap;width:100%}.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}
9
7
  /* src:base\icon.vue index:0 */
10
8
  .snail-icon{cursor:pointer;opacity:1}
11
- /* src:container\fold.vue index:0 */
12
- .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;white-space:nowrap}.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{display:flex;flex:1;justify-content:right;justify-self:right}.snail-fold>div.fold-body{padding-left:20px}
13
9
  /* src:base\switch.vue index:0 */
14
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}
11
+ /* src:container\dynamic.vue index:0 */
12
+ .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
15
13
  /* src:container\scroll.vue index:0 */
16
14
  .snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
17
- /* src:container\components\table-col.vue index:0 */
18
- .table-col{align-items:center;display:inline-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\components\table-row.vue index:0 */
20
- .table-row{align-items:center;display:flex;min-width:100%}
21
15
  /* src:container\table.vue index:0 */
22
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
+ /* src:container\fold.vue index:0 */
18
+ .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}
19
+ /* src:container\components\table-row.vue index:0 */
20
+ .table-row{align-items:center;display:flex;min-width:100%}
21
+ /* src:container\components\table-col.vue index:0 */
22
+ .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}
23
23
  /* src:form\input.vue index:0 */
24
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
+ /* src:prompt\drag-verify.vue index:0 */
26
+ .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}}
25
27
  /* src:prompt\empty.vue index:0 */
26
28
  .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}
27
- /* src:prompt\drag-verify.vue index:0 */
28
- .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{align-items:center;background-image:-webkit-linear-gradient(left,#666,#666 45%,#fff 50%,#666 55%,#666);color:#7e848c;display:flex;font-size:12px;font-weight:400;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-text-fill-color:transparent;animation:snail-drag-verify 2s linear infinite;-webkit-background-clip:text;background-clip:text;background-size:200% 100%}.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}}
29
29
  /* src:prompt\loading.vue index:0 */
30
- .snail-loading{bottom:0;left:0;position:absolute;right:0;top:0;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}
30
+ .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
31
  /* src:prompt\components\toast.vue index:0 */
32
32
  .snail-toast{background:rgba(0,0,0,.7);border-radius:5px;color:#fff;display:flex;max-height:200px;max-width:500px;min-width:200px;opacity:.2;overflow:hidden;padding:20px 30px 20px 20px;position:fixed;transition:opacity .2s ease;z-index:99999}.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}
33
- /* src:container\components\dialog-wrapper.vue index:0 */
34
- .snail-dialog{align-items:center;bottom:0;display:flex;justify-content:center;left:0;overflow:hidden;position:fixed;right:0;top:0}.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);box-sizing:border-box;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:prompt\components\confirm.vue index:0 */
36
- .snail-confirm{background-color:#fff;border-radius:4px;box-sizing:border-box;color:#2e2f33;display:flex;flex-direction:column;max-height:350px;max-width:548px;min-width:348px}.snail-confirm>main{flex:1;font-size:14px;margin:20px 40px;overflow:auto;word-wrap:break-word;box-sizing:border-box}
34
+ .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}
35
+ /* src:container\components\dialog-wrapper.vue index:0 */
36
+ .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);box-sizing:border-box;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}
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.27",
6
+ "version": "1.0.29",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",
@@ -15,8 +15,8 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "vue": "^3.5.14",
18
- "snail.core": ">=2.0.6",
19
- "snail.view": ">=1.0.11"
18
+ "snail.core": ">=2.0.8",
19
+ "snail.view": ">=1.0.12"
20
20
  },
21
21
  "devDependencies": {
22
22
  "vue-tsc": "^2.2.10",