snail.vue 1.0.39 → 1.0.41

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.
@@ -399,15 +399,15 @@ type TreeNodeRenderOptions = {
399
399
  /**
400
400
  * 树节点 插槽配置选项
401
401
  */
402
- type TreeNodeSlotOptions<T> = {
402
+ type TreeNodeSlotOptions<Node> = {
403
403
  /**
404
404
  * 当前节点
405
405
  */
406
- node: TreeNodeModel<T>;
406
+ node: Node;
407
407
  /**
408
408
  * 父节点
409
409
  */
410
- parent?: TreeNodeModel<T>;
410
+ parent?: Node;
411
411
  /**
412
412
  * 所处层级
413
413
  */
@@ -623,19 +623,13 @@ type SelectEvents<T> = SelectBaseEvents<T> & {};
623
623
  /**
624
624
  * 选项菜单 组件的Slot配置选项
625
625
  */
626
- type SelectSlotOptions<T> = {
627
- /**
628
- * 关闭Follow弹窗
629
- * - 将隐藏已弹出的选项 follow 弹窗
630
- * @returns 已弹出则销毁成功返回true;未弹出则销毁失败返回false
631
- */
632
- closeFollow(): boolean;
626
+ type SelectSlotOptions = {
633
627
  /**
634
- * 停止事件冒泡
635
- * - 解决问题:插槽内元素需要处理自定义click事件,此时不希望Select组件响应click事件
636
- * @param delay 在此延迟时间内,停止事件冒泡
628
+ * 清空已选【选择项】
629
+ * @param closeFollow 是否关闭【选择项】Follow弹窗
630
+ * @param stopPropagation 是否停止事件冒泡
637
631
  */
638
- stopPropagation(delay: number): any;
632
+ clear(closeFollow: boolean, stopPropagation: boolean): void;
639
633
  };
640
634
  /**
641
635
  * 【选项菜单】 组件上下文
@@ -1676,8 +1670,7 @@ declare const components: {
1676
1670
  }, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
1677
1671
  $slots: {
1678
1672
  default?: (props: {
1679
- closeFollow: () => boolean;
1680
- stopPropagation: (delay: number) => any;
1673
+ clear: (closeFollow: boolean, stopPropagation: boolean) => void;
1681
1674
  }) => any;
1682
1675
  };
1683
1676
  });
@@ -1927,8 +1920,8 @@ declare const components: {
1927
1920
  }, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
1928
1921
  $slots: {
1929
1922
  default?: (props: {
1930
- node: TreeNodeModel<any>;
1931
- parent?: TreeNodeModel<any>;
1923
+ node: any;
1924
+ parent?: any;
1932
1925
  level: number;
1933
1926
  click(): void;
1934
1927
  toggle(): void;
package/dist/snail.vue.js CHANGED
@@ -1,7 +1,7 @@
1
1
  //@ sourceURL=/snail.vue.js
2
2
  import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, mergeModels, useModel, computed, Fragment, renderList, normalizeStyle, unref, createElementVNode, createCommentVNode, toDisplayString, createBlock, shallowRef, withDirectives, vModelText, createVNode, createApp, Transition, withCtx, normalizeProps, guardReactiveProps, watch, ref, onErrorCaptured, resolveDynamicComponent, mergeProps, createSlots, onMounted, withModifiers, getCurrentInstance, nextTick, useTemplateRef, resolveComponent, onActivated, onDeactivated, onBeforeUnmount, getCurrentScope, onScopeDispose } from 'vue';
3
- import { isArray, newId, throwError, isArrayNotEmpty, isStringNotEmpty, mustFunction, useScope, removeFromArray, mustObject, throwIfFalse, isObject, isNumberNotNaN, useScopes, mountScope, isPromise, wait, script, delay, useTimer, defer, useAsyncScope, useHook, hasAny, throwIfTrue, isFunction, onMountScope } from 'snail.core';
4
- import { link, css, useObserver, useAnimation } from 'snail.view';
3
+ import { isArray, newId, throwError, isArrayNotEmpty, isStringNotEmpty, mustFunction, useScope, removeFromArray, mustObject, throwIfFalse, isObject, isNumberNotNaN, mountScope, useScopes, isPromise, wait, script, delay, useTimer, defer, useAsyncScope, useHook, hasAny, throwIfTrue, isFunction, onMountScope } from 'snail.core';
4
+ import { css, link, useObserver, useAnimation } from 'snail.view';
5
5
 
6
6
  var _sfc_main$r = defineComponent({
7
7
  ...{
@@ -23,10 +23,6 @@ var _sfc_main$r = 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
  const _hoisted_1$e = ["onClick"];
31
27
  const _hoisted_2$9 = ["type", "checked"];
32
28
  const _hoisted_3$6 = ["textContent"];
@@ -100,6 +96,10 @@ var _sfc_main$q = defineComponent({
100
96
  }
101
97
  });
102
98
 
99
+ var addLink = href => setTimeout(link.register, 0, href);
100
+
101
+ addLink("/styles/snail.vue.vue.css");
102
+
103
103
  var _sfc_main$p = defineComponent({
104
104
  ...{
105
105
  name: "Footer",
@@ -645,7 +645,6 @@ var _sfc_main$k = defineComponent({
645
645
  });
646
646
 
647
647
  function useReactive() {
648
- const scopes = useScopes();
649
648
  function transition(rv, effect, time) {
650
649
  throwIfFalse(isObject(effect), "transition: effect must be an object.");
651
650
  const scope = scopes.get();
@@ -674,7 +673,8 @@ function useReactive() {
674
673
  transition,
675
674
  load,
676
675
  watcher
677
- });
676
+ }, "IReactiveManager");
677
+ const scopes = useScopes();
678
678
  manager.onDestroy(scopes.destroy);
679
679
  return Object.freeze(manager);
680
680
  }
@@ -751,7 +751,7 @@ var _sfc_main$j = defineComponent({
751
751
  }, _ctx.$attrs), [_cache[0] || (_cache[0] = createTextVNode(" load component error:")), createElementVNode("span", null, toDisplayString(dynamicErrorRef.value), 1)], 16)) : dynamicComponentRef.value == void 0 ? (openBlock(), createBlock(_sfc_main$k, {
752
752
  key: 1,
753
753
  show: true,
754
- "disabled-mask": true
754
+ "mask-disabled": true
755
755
  })) : createCommentVNode("", true)], 64);
756
756
  };
757
757
  }
@@ -1026,7 +1026,6 @@ var _sfc_main$f = defineComponent({
1026
1026
  });
1027
1027
 
1028
1028
  function usePopup() {
1029
- const scopes = useScopes();
1030
1029
  function popup(options) {
1031
1030
  const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$g, options);
1032
1031
  return addScope2Scopes(scope);
@@ -1140,7 +1139,8 @@ function usePopup() {
1140
1139
  follow,
1141
1140
  confirm,
1142
1141
  toast
1143
- });
1142
+ }, "IPopupManager");
1143
+ const scopes = useScopes();
1144
1144
  manager.onDestroy(scopes.destroy);
1145
1145
  return Object.freeze(manager);
1146
1146
  }
@@ -1419,7 +1419,6 @@ var _sfc_main$c = defineComponent({
1419
1419
  });
1420
1420
 
1421
1421
  function useTreeContext(nodes) {
1422
- const scopes = useScopes();
1423
1422
  const failed = shallowRef();
1424
1423
  const patched = shallowRef();
1425
1424
  function doSearch(text) {
@@ -1452,9 +1451,8 @@ function useTreeContext(nodes) {
1452
1451
  isShow,
1453
1452
  isShowChildren,
1454
1453
  getPath
1455
- });
1454
+ }, "ITreeBaseContext");
1456
1455
  context.onDestroy(() => {
1457
- scopes.destroy();
1458
1456
  failed.value = void 0;
1459
1457
  patched.value = void 0;
1460
1458
  });
@@ -1497,7 +1495,6 @@ function searchPath(nodes, target) {
1497
1495
  }
1498
1496
 
1499
1497
  function useSelectContext(items, selectsRef) {
1500
- const treeContxt = useTreeContext(items);
1501
1498
  function selected(multiple, item) {
1502
1499
  if (selectsRef.value) {
1503
1500
  return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
@@ -1510,11 +1507,18 @@ function useSelectContext(items, selectsRef) {
1510
1507
  }
1511
1508
  return "";
1512
1509
  }
1513
- return Object.freeze({
1514
- ...treeContxt,
1515
- selected,
1516
- selectedText
1517
- });
1510
+ const context = Object.create(null);
1511
+ {
1512
+ const treeContxt = useTreeContext(items);
1513
+ Object.assign(context, treeContxt, {
1514
+ selected,
1515
+ selectedText
1516
+ });
1517
+ mountScope(context, "ISelectContext");
1518
+ treeContxt.onDestroy(() => context.destroyed || context.destroy());
1519
+ context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1520
+ }
1521
+ return Object.freeze(context);
1518
1522
  }
1519
1523
 
1520
1524
  const _hoisted_1$6 = {
@@ -1574,12 +1578,11 @@ var _sfc_main$b = defineComponent({
1574
1578
  const context = useSelectContext(props.items, valuesModel);
1575
1579
  const selectTextRef = computed(() => context.selectedText(props.multiple, props.showPath));
1576
1580
  const slotOptions = Object.freeze({
1577
- closeFollow,
1578
- stopPropagation
1581
+ clear
1579
1582
  });
1580
1583
  var followScope = void 0;
1581
1584
  var stopPropagationScope = void 0;
1582
- function closeFollow() {
1585
+ function destroyFollow() {
1583
1586
  if (followScope != void 0) {
1584
1587
  followScope.destroy();
1585
1588
  followScope = void 0;
@@ -1587,15 +1590,17 @@ var _sfc_main$b = defineComponent({
1587
1590
  }
1588
1591
  return false;
1589
1592
  }
1590
- function stopPropagation(delay) {
1593
+ function clear(closeFollow, stopPropagation) {
1594
+ valuesModel.value = [];
1595
+ closeFollow && destroyFollow();
1591
1596
  stopPropagationScope && stopPropagationScope.destroy();
1592
- stopPropagationScope = onTimeout(() => stopPropagationScope = void 0, delay);
1597
+ stopPropagationScope = stopPropagation ? onTimeout(() => stopPropagationScope = void 0, 200) : void 0;
1593
1598
  }
1594
1599
  async function onClick() {
1595
1600
  if (props.readonly == true || rootDom.value == void 0) {
1596
1601
  return;
1597
1602
  }
1598
- if (closeFollow() == true || stopPropagationScope != void 0) {
1603
+ if (destroyFollow() == true || stopPropagationScope != void 0) {
1599
1604
  return;
1600
1605
  }
1601
1606
  const values = valuesModel.value && valuesModel.value.length > 0 ? [...valuesModel.value] : [];
@@ -1636,16 +1641,16 @@ var _sfc_main$b = defineComponent({
1636
1641
  }]),
1637
1642
  onClick: _cache[0] || (_cache[0] = $event => onClick()),
1638
1643
  ref: "select"
1639
- }, [unref(hasAny)(props.items) == true ? (openBlock(), createElementBlock(Fragment, {
1644
+ }, [props.items && props.items.length > 0 ? (openBlock(), createElementBlock(Fragment, {
1640
1645
  key: 0
1641
- }, [unref(hasAny)(valuesModel.value) ? (openBlock(), createElementBlock("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
1646
+ }, [valuesModel.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
1642
1647
  class: "select-text",
1643
1648
  title: selectTextRef.value,
1644
1649
  textContent: toDisplayString(selectTextRef.value)
1645
1650
  }, null, 8, _hoisted_2$3)])])) : (openBlock(), createElementBlock("div", {
1646
1651
  key: 1,
1647
1652
  class: "select-result text-tips",
1648
- textContent: toDisplayString(props.placeholder || "请选择")
1653
+ textContent: toDisplayString(props.readonly ? "" : props.placeholder || "请选择")
1649
1654
  }, null, 8, _hoisted_3$3)), createVNode(_sfc_main$o, {
1650
1655
  type: "arrow",
1651
1656
  size: 24,
@@ -2442,6 +2447,8 @@ const components = {
2442
2447
  Loading: _sfc_main$k
2443
2448
  };
2444
2449
 
2445
- onMountScope(scope => getCurrentScope() && onScopeDispose(scope.destroy));
2450
+ onMountScope(scope => {
2451
+ getCurrentScope() && onScopeDispose(scope.destroy);
2452
+ });
2446
2453
 
2447
2454
  export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
@@ -25,10 +25,6 @@
25
25
  }
26
26
  });
27
27
 
28
- var addLink = href => setTimeout(snail_view.link.register, 0, href);
29
-
30
- addLink("/styles/snail.vue.vue.css");
31
-
32
28
  const _hoisted_1$e = ["onClick"];
33
29
  const _hoisted_2$9 = ["type", "checked"];
34
30
  const _hoisted_3$6 = ["textContent"];
@@ -102,6 +98,10 @@
102
98
  }
103
99
  });
104
100
 
101
+ var addLink = href => setTimeout(snail_view.link.register, 0, href);
102
+
103
+ addLink("/styles/snail.vue.vue.css");
104
+
105
105
  var _sfc_main$p = vue.defineComponent({
106
106
  ...{
107
107
  name: "Footer",
@@ -647,7 +647,6 @@
647
647
  });
648
648
 
649
649
  function useReactive() {
650
- const scopes = snail_core.useScopes();
651
650
  function transition(rv, effect, time) {
652
651
  snail_core.throwIfFalse(snail_core.isObject(effect), "transition: effect must be an object.");
653
652
  const scope = scopes.get();
@@ -676,7 +675,8 @@
676
675
  transition,
677
676
  load,
678
677
  watcher
679
- });
678
+ }, "IReactiveManager");
679
+ const scopes = snail_core.useScopes();
680
680
  manager.onDestroy(scopes.destroy);
681
681
  return Object.freeze(manager);
682
682
  }
@@ -753,7 +753,7 @@
753
753
  }, _ctx.$attrs), [_cache[0] || (_cache[0] = vue.createTextVNode(" load component error:")), vue.createElementVNode("span", null, vue.toDisplayString(dynamicErrorRef.value), 1)], 16)) : dynamicComponentRef.value == void 0 ? (vue.openBlock(), vue.createBlock(_sfc_main$k, {
754
754
  key: 1,
755
755
  show: true,
756
- "disabled-mask": true
756
+ "mask-disabled": true
757
757
  })) : vue.createCommentVNode("", true)], 64);
758
758
  };
759
759
  }
@@ -1028,7 +1028,6 @@
1028
1028
  });
1029
1029
 
1030
1030
  function usePopup() {
1031
- const scopes = snail_core.useScopes();
1032
1031
  function popup(options) {
1033
1032
  const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$g, options);
1034
1033
  return addScope2Scopes(scope);
@@ -1142,7 +1141,8 @@
1142
1141
  follow,
1143
1142
  confirm,
1144
1143
  toast
1145
- });
1144
+ }, "IPopupManager");
1145
+ const scopes = snail_core.useScopes();
1146
1146
  manager.onDestroy(scopes.destroy);
1147
1147
  return Object.freeze(manager);
1148
1148
  }
@@ -1421,7 +1421,6 @@
1421
1421
  });
1422
1422
 
1423
1423
  function useTreeContext(nodes) {
1424
- const scopes = snail_core.useScopes();
1425
1424
  const failed = vue.shallowRef();
1426
1425
  const patched = vue.shallowRef();
1427
1426
  function doSearch(text) {
@@ -1454,9 +1453,8 @@
1454
1453
  isShow,
1455
1454
  isShowChildren,
1456
1455
  getPath
1457
- });
1456
+ }, "ITreeBaseContext");
1458
1457
  context.onDestroy(() => {
1459
- scopes.destroy();
1460
1458
  failed.value = void 0;
1461
1459
  patched.value = void 0;
1462
1460
  });
@@ -1499,7 +1497,6 @@
1499
1497
  }
1500
1498
 
1501
1499
  function useSelectContext(items, selectsRef) {
1502
- const treeContxt = useTreeContext(items);
1503
1500
  function selected(multiple, item) {
1504
1501
  if (selectsRef.value) {
1505
1502
  return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
@@ -1512,11 +1509,18 @@
1512
1509
  }
1513
1510
  return "";
1514
1511
  }
1515
- return Object.freeze({
1516
- ...treeContxt,
1517
- selected,
1518
- selectedText
1519
- });
1512
+ const context = Object.create(null);
1513
+ {
1514
+ const treeContxt = useTreeContext(items);
1515
+ Object.assign(context, treeContxt, {
1516
+ selected,
1517
+ selectedText
1518
+ });
1519
+ snail_core.mountScope(context, "ISelectContext");
1520
+ treeContxt.onDestroy(() => context.destroyed || context.destroy());
1521
+ context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1522
+ }
1523
+ return Object.freeze(context);
1520
1524
  }
1521
1525
 
1522
1526
  const _hoisted_1$6 = {
@@ -1576,12 +1580,11 @@
1576
1580
  const context = useSelectContext(props.items, valuesModel);
1577
1581
  const selectTextRef = vue.computed(() => context.selectedText(props.multiple, props.showPath));
1578
1582
  const slotOptions = Object.freeze({
1579
- closeFollow,
1580
- stopPropagation
1583
+ clear
1581
1584
  });
1582
1585
  var followScope = void 0;
1583
1586
  var stopPropagationScope = void 0;
1584
- function closeFollow() {
1587
+ function destroyFollow() {
1585
1588
  if (followScope != void 0) {
1586
1589
  followScope.destroy();
1587
1590
  followScope = void 0;
@@ -1589,15 +1592,17 @@
1589
1592
  }
1590
1593
  return false;
1591
1594
  }
1592
- function stopPropagation(delay) {
1595
+ function clear(closeFollow, stopPropagation) {
1596
+ valuesModel.value = [];
1597
+ closeFollow && destroyFollow();
1593
1598
  stopPropagationScope && stopPropagationScope.destroy();
1594
- stopPropagationScope = onTimeout(() => stopPropagationScope = void 0, delay);
1599
+ stopPropagationScope = stopPropagation ? onTimeout(() => stopPropagationScope = void 0, 200) : void 0;
1595
1600
  }
1596
1601
  async function onClick() {
1597
1602
  if (props.readonly == true || rootDom.value == void 0) {
1598
1603
  return;
1599
1604
  }
1600
- if (closeFollow() == true || stopPropagationScope != void 0) {
1605
+ if (destroyFollow() == true || stopPropagationScope != void 0) {
1601
1606
  return;
1602
1607
  }
1603
1608
  const values = valuesModel.value && valuesModel.value.length > 0 ? [...valuesModel.value] : [];
@@ -1638,16 +1643,16 @@
1638
1643
  }]),
1639
1644
  onClick: _cache[0] || (_cache[0] = $event => onClick()),
1640
1645
  ref: "select"
1641
- }, [vue.unref(snail_core.hasAny)(props.items) == true ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1646
+ }, [props.items && props.items.length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1642
1647
  key: 0
1643
- }, [vue.unref(snail_core.hasAny)(valuesModel.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
1648
+ }, [valuesModel.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
1644
1649
  class: "select-text",
1645
1650
  title: selectTextRef.value,
1646
1651
  textContent: vue.toDisplayString(selectTextRef.value)
1647
1652
  }, null, 8, _hoisted_2$3)])])) : (vue.openBlock(), vue.createElementBlock("div", {
1648
1653
  key: 1,
1649
1654
  class: "select-result text-tips",
1650
- textContent: vue.toDisplayString(props.placeholder || "请选择")
1655
+ textContent: vue.toDisplayString(props.readonly ? "" : props.placeholder || "请选择")
1651
1656
  }, null, 8, _hoisted_3$3)), vue.createVNode(_sfc_main$o, {
1652
1657
  type: "arrow",
1653
1658
  size: 24,
@@ -2444,7 +2449,9 @@
2444
2449
  Loading: _sfc_main$k
2445
2450
  };
2446
2451
 
2447
- snail_core.onMountScope(scope => vue.getCurrentScope() && vue.onScopeDispose(scope.destroy));
2452
+ snail_core.onMountScope(scope => {
2453
+ vue.getCurrentScope() && vue.onScopeDispose(scope.destroy);
2454
+ });
2448
2455
 
2449
2456
  exports.components = components;
2450
2457
  exports.getSvgDraw = getSvgDraw;
@@ -1,53 +1,53 @@
1
- /* src:base\button.vue index:0 */
2
- .snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;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}
3
1
  /* src:base\choose.vue index:0 */
4
2
  .snail-choose{align-items:center;display:flex;flex-wrap:wrap;overflow-x:hidden}.snail-choose>div.choose-item{align-items:center;cursor:pointer;display:flex;flex-shrink:0;margin:0 8px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-choose>div.choose-item:after{content:"";height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.snail-choose>div.choose-item>input::checkmark{background-color:#2196f3;border-color:#2196f3}.snail-choose>div.choose-item>span{margin-left:4px}.snail-choose.readonly>div.choose-item{cursor:not-allowed}
3
+ /* src:base\button.vue index:0 */
4
+ .snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;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
+ /* src:base\footer.vue index:0 */
6
+ .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}
5
7
  /* src:base\header.vue index:0 */
6
8
  .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:bold}.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
- /* src:base\select.vue index:0 */
8
- .snail-select{align-items:center;background-color:#fff;border:1px solid #dddfed;border-radius:4px;color:#2e3033;cursor:pointer;display:flex;height:32px;width:100%}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;height:30px;overflow:hidden;padding:0 10px 0 6px}.snail-select>div.select-result>div.select-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-select>svg.snail-icon{flex-shrink:0;margin-right:4px}.snail-select>div.no-items{cursor:text;padding:0 8px}.snail-select.readonly{cursor:auto}.snail-select.readonly>svg.snail-icon{display:none}
9
+ /* src:base\search.vue index:0 */
10
+ .snail-search{align-items:center;background:#fff;display:flex;flex-shrink:0;height:34px}.snail-search>input{border-radius:0!important;flex:1;height:100%}.snail-search>div{align-items:center;border:1px solid #dddfed;border-left:none;display:flex;flex-shrink:0;height:100%;justify-content:center;width:34px}
9
11
  /* src:base\icon.vue index:0 */
10
12
  .snail-icon{cursor:pointer;opacity:1}
11
- /* src:base\footer.vue index:0 */
12
- .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}
13
+ /* src:base\select.vue index:0 */
14
+ .snail-select{align-items:center;background-color:#fff;border:1px solid #dddfed;border-radius:4px;color:#2e3033;cursor:pointer;display:flex;height:32px;width:100%}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;height:30px;overflow:hidden;padding:0 10px 0 6px}.snail-select>div.select-result>div.select-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-select>svg.snail-icon{flex-shrink:0;margin-right:4px}.snail-select>div.no-items{cursor:text;padding:0 8px}.snail-select.readonly{cursor:auto}.snail-select.readonly>svg.snail-icon{display:none}
13
15
  /* src:base\switch.vue index:0 */
14
- .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}
16
+ .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:not-allowed}
15
17
  /* src:container\dynamic.vue index:0 */
16
18
  .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
17
- /* src:base\search.vue index:0 */
18
- .snail-search{align-items:center;background:#fff;display:flex;flex-shrink:0;height:34px}.snail-search>input{border-radius:0!important;flex:1;height:100%}.snail-search>div{align-items:center;border:1px solid #dddfed;border-left:none;display:flex;flex-shrink:0;height:100%;justify-content:center;width:34px}
19
19
  /* src:container\fold.vue index:0 */
20
20
  .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-weight:bold;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-header>div.status>svg.snail-icon{transition:transform .2s ease}.snail-fold>div.fold-body{padding-left:20px}.snail-fold.expand>div.fold-header>div.status>svg.snail-icon{transform:rotate(-90deg)}.snail-fold.fold>div.fold-header>div.status>svg.snail-icon{transform:rotate(90deg)}
21
21
  /* src:container\scroll.vue index:0 */
22
22
  .snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
23
+ /* src:container\sort.vue index:0 */
24
+ .snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
23
25
  /* src:container\table.vue index:0 */
24
26
  .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{background-color:#fff;position:sticky!important;top:0;z-index:1}.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}
25
- /* src:container\components\table-row.vue index:0 */
26
- .table-row{align-items:center;display:flex}
27
27
  /* src:container\components\table-col.vue index:0 */
28
28
  .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}
29
+ /* src:container\components\table-row.vue index:0 */
30
+ .table-row{align-items:center;display:flex}
29
31
  /* src:container\tree.vue index:0 */
30
32
  .snail-tree{background-color:#fff;display:flex;flex-direction:column}.snail-tree .snail-search{flex-shrink:0;margin:12px}.snail-tree .snail-scroll{flex:1}
31
- /* src:container\sort.vue index:0 */
32
- .snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
33
33
  /* src:form\input.vue index:0 */
34
34
  .snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;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{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
35
35
  /* src:prompt\drag-verify.vue index:0 */
36
36
  .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}}
37
- /* src:prompt\loading.vue index:0 */
38
- .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}
39
37
  /* src:prompt\empty.vue index:0 */
40
38
  .snail-empty{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:150px;width:100%}.snail-empty>img{height:60px;width:60px}.snail-empty>div.message{color:#babdc2;font-weight:400;padding:0 10px 10px}
39
+ /* src:prompt\loading.vue index:0 */
40
+ .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}
41
+ /* src:popup\components\confirm-container.vue index:0 */
42
+ .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;margin:20px 40px;overflow:auto;word-wrap:break-word}
41
43
  /* src:popup\components\dialog-container.vue index:0 */
42
44
  .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%;opacity:1;position:absolute;transition:opacity .4s ease-in-out;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{opacity:0}.snail-dialog.unactive>.dialog-body{box-shadow:0 0 4px rgba(0,0,0,.3)}
45
+ /* src:popup\components\popup-container.vue index:0 */
46
+ .snail-popup{left:0;position:fixed;top:0}
43
47
  /* src:popup\components\follow-container.vue index:0 */
44
48
  .snail-follow{background-color:#fff;display:inline-block;max-height:100%;max-width:100%;position:fixed;transition-duration:.5s;transition-property:left,top;transition-timing-function:ease}
45
- /* src:popup\components\confirm-container.vue index:0 */
46
- .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;margin:20px 40px;overflow:auto;word-wrap:break-word}
47
49
  /* src:popup\components\toast-container.vue index:0 */
48
50
  .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;overflow:hidden;padding:20px 35px 20px 15px;position:fixed;top:50%;transform:translate(-50%,-50%)}.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}
49
- /* src:popup\components\popup-container.vue index:0 */
50
- .snail-popup{left:0;position:fixed;top:0}
51
51
  /* src:container\components\tree-node.vue index:0 */
52
52
  .snail-tree-node{align-items:center;display:flex;flex-wrap:nowrap;height:40px;width:100%}.snail-tree-node:hover{background-color:#f8f9fa}.snail-tree-node>.indent,.snail-tree-node>.node-slot,.snail-tree-node>.snail-icon{flex-shrink:0}.snail-tree-node>.node-fold{align-items:center;display:flex;height:100%;justify-content:center;width:24px}.snail-tree-node>.node-fold>.snail-icon{transition:transform .1s ease-in}.snail-tree-node>.node-fold>.snail-icon.fold{transform:rotate(-90deg)}.snail-tree-node>.node-slot,.snail-tree-node>.node-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.snail-tree-node>.node-text{color:#2e3033;flex:1;min-width:30px}.snail-tree-node.clickable>.node-text{cursor:pointer}.snail-tree-children{width:100%}.snail-tree-node.level-1>.indent{padding-left:4px}.snail-tree-node.level-2>.indent{padding-left:24px}.snail-tree-node.level-3>.indent{padding-left:48px}.snail-tree-node.level-4>.indent{padding-left:72px}.snail-tree-node.level-5>.indent{padding-left:96px}.snail-tree-node.level-6>.indent{padding-left:120px}.snail-tree-node.level-7>.indent{padding-left:144px}.snail-tree-node.level-8>.indent{padding-left:168px}.snail-tree-node.level-9>.indent{padding-left:192px}.snail-tree-node.level-10>.indent{padding-left:216px}
53
53
  /* src:base\components\select-popup.vue index: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.39",
6
+ "version": "1.0.41",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "vue": "^3.5.14",
17
- "snail.core": ">=2.0.11",
18
- "snail.view": ">=1.0.18",
17
+ "snail.core": ">=2.0.12",
18
+ "snail.view": ">=1.0.20",
19
19
  "sortablejs": ">=1.15.6"
20
20
  },
21
21
  "devDependencies": {