snail.vue 1.0.50 → 1.0.52

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/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # 1. **概述**
2
+
3
+ **snail.vue 基于 vue 3.x,实现一些常用功能模块,通过 MIT 协议开放使用:**
4
+
5
+ 1. **基于 vue 封装常用组件(如表单、列表、树、弹窗、容器、提示等组件),并不断补充**
6
+ 2. **提供基于 vue 的通用数据结构和事件模型**
7
+ 3. **对 vue 的部分功能做了再次封装,简化使用和生命周期管理**
8
+
9
+ # 2. **环境搭建**
10
+
11
+ ## 2.1. **依赖安装**
12
+
13
+ 1. **安装 npm 包**
14
+ 2. **注册依赖组件**
15
+ 3. **打包输出**
16
+
17
+ ## 2.2. **动态注册**
18
+
19
+ # 3. **使用说明**
20
+
21
+ ## 3.1. **base 基础组件**
22
+
23
+ **封装基础 vue 组件,如 Button、Select、Header、Icon、Search、Switch 等等**
24
+
25
+ **详细说明:**[https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8)
26
+
27
+ | **组件** | **简介** |
28
+ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
29
+ | [Button](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#s1zYq) | **按钮组件;集成 type、size 属性,封装大小和类型,简化使用** |
30
+ | [Choose](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#gCenb) | **选择组件;集成 radio、checkbook 常用功能,支持选项组;支持美化和原生两种渲染模式** |
31
+ | [Icon](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#xf4og) | **图标组件;使用 svg 进行图标绘,内置常用图标类型;并支持自定义图标绘制路径** |
32
+ | [Search](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#VoyjZ) | **搜索组件;封装搜索输入框、搜索按钮;支持自动完成等功能** |
33
+ | [Select](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#NPAQL) | **选项菜单组件;对原生 select 的扩充,支持多级选项,支持单选和多选等** |
34
+ | [Switch](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#sOSDT) | **开关组件;支持只读、v-model 绑定操纵** |
35
+ | [Reactive](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#LzpHK) | **响应式模块,非 vue 组件;对 vue 响应时做了封装,集成常用生命周期管理** |
36
+ | [Footer](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#Mk0Pf) | **尾部组件;和 Header 配套,封装确定、取消按钮;不常用** |
37
+ | [Header](https://www.yuque.com/snail-devx/js/mhieowa8ddbdhgu8#jQkjV) | **头部组件;封装标题、关闭按钮,用于 page 和 dialog 模式;支持插槽** |
38
+
39
+ ## 3.2. **container 容器组件**
40
+
41
+ **实现对子组件的动态加载,如列表、树、滚动容器,折叠面板,动态组件等等;**
42
+
43
+ **详细说明:**[https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc)
44
+
45
+ | **组件** | **简介** |
46
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
47
+ | [dynamic](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#NNGJt) | **动态组件;vue 的 Component 组件扩展,支持 url、name、object 方式加载异步组件,并支持 event、props、model、slot 等绑定** |
48
+ | [fold](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#sJOfO) | **折叠面板组件;通过 slot 加载实际内容,封装折叠 title 实现面板展开、收起功能** |
49
+ | [layout](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#lGmps) | **布局组件;实现上中下、左中右布局,通过 slot 指定每块内容** |
50
+ | [scroll](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#IcwVh) | **滚动组件;实现滚动条状态、事件封装,并通过 class、event 等方式对外,通过 slot 加载实际内容** |
51
+ | [sort](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#dKA7E) | **排序组件;集成 sortable.js 库,实现再次封装,暴露常见属性** |
52
+ | [table](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#UViu6) | **表格组件;封装表头、内容区域,基于 TableCol、TableRow 子组件对外做自定义渲染** |
53
+ | [tree](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#tKdSd) | **树组件;基于 nodes 渲染树,支持节点自定义,集成节点事件和本地搜索** |
54
+ | [wrapper](https://www.yuque.com/snail-devx/js/kaynh9t44gbl6fxc#gita6) | **包裹层组件;作为常用组件的包裹层,自动实现组件在 page 和 popup 中展现,让内容组件关注核心逻辑即可** |
55
+
56
+ ## 3.3. **form 表单组件**
57
+
58
+ **封装表单专属组件,如 input、文件上传等**
59
+
60
+ **详细说明:**[https://www.yuque.com/snail-devx/js/wl1q8db0qms764eg](https://www.yuque.com/snail-devx/js/wl1q8db0qms764eg)
61
+
62
+ | **组件** | **简介** |
63
+ | ------------------------------------------------------------------- | ----------------------------------------------- |
64
+ | [input](https://www.yuque.com/snail-devx/js/wl1q8db0qms764eg#lw7O6) | **输入框组件,对原生 input 做美化,支持标题等** |
65
+
66
+ ## 3.4. **popup 弹窗组件**
67
+
68
+ **基于 IPopupManager 实现弹窗管理,自动管理弹窗层级、弹窗生命周期;提供基础 popup 弹窗方法;并扩展 dialog、follow、toast、confirm 弹窗方法**
69
+
70
+ **详细说明:**[https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2)
71
+
72
+ | **弹窗方法** | **简介** |
73
+ | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
74
+ | [usePopup](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#MF7uV) | **弹窗管理器接口实现接口,后续 popup、dialog 等弹窗的具体实现** |
75
+ | [popup](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#gppwu) | **通用弹窗方法;管理弹窗生成周期,自动分配弹层,实现属性、事件绑定** |
76
+ | [dialog](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#YZ42j) | **模态弹窗;利用 popup 实现弹窗遮罩,支持关闭前拦截** |
77
+ | [follow](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#lMTk5) | **跟随弹窗;弹窗自动跟随指定 target 元素,实现高度、宽度跟随、位置跟随、位置智能感知** |
78
+ | [toast](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#FWNH1) | **消息提示弹窗;模拟 Android 的 Toast 弹窗提示消息** |
79
+ | [confirm](https://www.yuque.com/snail-devx/js/byho94c6ms40kdb2#wohc0) | **确认弹窗;模拟实现原生 confirm 弹窗** |
80
+
81
+ ## 3.5. **prompt 提示组件**
82
+
83
+ **封装一些提示性质的通用组件,如数据加载状态、无数据提醒等等**
84
+
85
+ **详细说明:**[https://www.yuque.com/snail-devx/js/kp0nznuu61qs8zgw](https://www.yuque.com/snail-devx/js/kp0nznuu61qs8zgw)
86
+
87
+ | **组件** | **简介** |
88
+ | ------------------------------------------------------------------------- | ------------------------------------------------------ |
89
+ | [drag-verify](https://www.yuque.com/snail-devx/js/kp0nznuu61qs8zgw#YN3YF) | **拖拽验证组件;拖动滑块验证,给出验证提示和结果信息** |
90
+ | [empty](https://www.yuque.com/snail-devx/js/kp0nznuu61qs8zgw#qZsqi) | **空组件;用于提示无数据、无搜索结果等空状态** |
91
+ | [loading](https://www.yuque.com/snail-devx/js/kp0nznuu61qs8zgw#IuBmQ) | **加载组件;用于在数据加载过程中进行加载提示** |
@@ -1094,7 +1094,7 @@ type ChooseEvents<T> = {
1094
1094
  /**
1095
1095
  * 按钮配置选项
1096
1096
  */
1097
- type ButtonOptions = {
1097
+ type ButtonOptions = TitleOptions & {
1098
1098
  /**
1099
1099
  * 按钮尺寸
1100
1100
  * - max : 120 X 40
package/dist/snail.vue.js CHANGED
@@ -3,6 +3,7 @@ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderS
3
3
  import { throwError, isArrayNotEmpty, isStringNotEmpty, isArray, newId, 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
4
  import { link, css, useObserver, useAnimation } from 'snail.view';
5
5
 
6
+ const _hoisted_1$g = ["title"];
6
7
  var _sfc_main$t = defineComponent({
7
8
  ...{
8
9
  name: "Button",
@@ -10,15 +11,16 @@ var _sfc_main$t = defineComponent({
10
11
  },
11
12
  __name: "button",
12
13
  props: {
14
+ title: {},
13
15
  size: {},
14
16
  type: {}
15
17
  },
16
18
  setup(__props) {
17
- const props = __props;
18
19
  return (_ctx, _cache) => {
19
20
  return openBlock(), createElementBlock("div", {
20
- class: normalizeClass(["snail-button", [props.size, props.type]])
21
- }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮"))])], 2);
21
+ class: normalizeClass(["snail-button", [_ctx.size, _ctx.type]]),
22
+ title: _ctx.title
23
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = createTextVNode("按钮"))])], 10, _hoisted_1$g);
22
24
  };
23
25
  }
24
26
  });
@@ -167,25 +169,25 @@ var _sfc_main$r = defineComponent({
167
169
  }
168
170
  return (_ctx, _cache) => {
169
171
  return openBlock(), createElementBlock("div", {
170
- class: normalizeClass(["snail-choose", props.readonly ? "readonly" : ""])
172
+ class: normalizeClass(["snail-choose", _ctx.readonly ? "readonly" : ""])
171
173
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(chooseItemsRef.value, (item, index) => {
172
174
  return openBlock(), createElementBlock("div", {
173
175
  key: item.key,
174
176
  class: normalizeClass(["choose-item", item.checked ? "checked" : ""]),
175
- style: normalizeStyle(unref(css).buildStyle(props.itemStyle)),
177
+ style: normalizeStyle(unref(css).buildStyle(_ctx.itemStyle)),
176
178
  onClick: $event => onItemClick(item)
177
179
  }, [unref(mode) == "native" ? (openBlock(), createElementBlock("input", {
178
180
  key: 0,
179
- type: props.type,
181
+ type: _ctx.type,
180
182
  checked: item.checked
181
183
  }, null, 8, _hoisted_2$9)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
182
184
  key: 1,
183
- class: normalizeClass(["item-beautiful", [props.type, item.checked ? "item-checked" : "item-unchecked"]])
185
+ class: normalizeClass(["item-beautiful", [_ctx.type, item.checked ? "item-checked" : "item-unchecked"]])
184
186
  }, [item.checked ? (openBlock(), createBlock(_sfc_main$s, {
185
187
  key: 0,
186
188
  type: "success",
187
189
  size: 12,
188
- color: props.readonly ? "#8a9099" : "white"
190
+ color: _ctx.readonly ? "#8a9099" : "white"
189
191
  }, null, 8, ["color"])) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), item.text ? (openBlock(), createElementBlock("span", {
190
192
  key: 2,
191
193
  class: "item-text",
@@ -225,25 +227,24 @@ var _sfc_main$q = defineComponent({
225
227
  let {
226
228
  emit: __emit
227
229
  } = _ref;
228
- const props = __props;
229
230
  const emits = __emit;
230
231
  return (_ctx, _cache) => {
231
232
  return openBlock(), createElementBlock("footer", {
232
233
  class: normalizeClass(["snail-footer", {
233
- "start-divider": props.divider
234
- }, props.align || "right"])
235
- }, [renderSlot(_ctx.$slots, "default", {}, () => [props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$t, {
234
+ "start-divider": _ctx.divider
235
+ }, _ctx.align || "right"])
236
+ }, [renderSlot(_ctx.$slots, "default", {}, () => [_ctx.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$t, {
236
237
  key: 0,
237
238
  size: "max",
238
239
  type: "default",
239
240
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
240
- textContent: toDisplayString(props.cancelName || "取消")
241
- }, null, 8, ["textContent"])) : createCommentVNode("", true), props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$t, {
241
+ textContent: toDisplayString(_ctx.cancelName || "取消")
242
+ }, null, 8, ["textContent"])) : createCommentVNode("", true), _ctx.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$t, {
242
243
  key: 1,
243
244
  size: "max",
244
245
  type: "primary",
245
246
  onClick: _cache[1] || (_cache[1] = $event => emits("confirm")),
246
- textContent: toDisplayString(props.confirmName || "确定")
247
+ textContent: toDisplayString(_ctx.confirmName || "确定")
247
248
  }, null, 8, ["textContent"])) : createCommentVNode("", true)])], 2);
248
249
  };
249
250
  }
@@ -341,11 +342,11 @@ var _sfc_main$o = defineComponent({
341
342
  }
342
343
  return (_ctx, _cache) => {
343
344
  return openBlock(), createElementBlock("div", {
344
- class: normalizeClass(["snail-search", props.readonly ? "readonly" : ""])
345
+ class: normalizeClass(["snail-search", _ctx.readonly ? "readonly" : ""])
345
346
  }, [withDirectives(createElementVNode("input", {
346
347
  type: "search",
347
- placeholder: props.placeholder,
348
- readonly: props.readonly == true,
348
+ placeholder: _ctx.placeholder,
349
+ readonly: _ctx.readonly,
349
350
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
350
351
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
351
352
  }, null, 40, _hoisted_1$c), [[vModelText, textModel.value, void 0, {
@@ -601,23 +602,22 @@ var _sfc_main$n = defineComponent({
601
602
  }
602
603
  },
603
604
  setup(__props) {
604
- const props = __props;
605
605
  return (_ctx, _cache) => {
606
606
  return openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$p, {
607
607
  "use-to": "dialog",
608
- title: props.title || "提示",
609
- onClose: _cache[0] || (_cache[0] = $event => props.closePopup(false))
608
+ title: _ctx.title || "提示",
609
+ onClose: _cache[0] || (_cache[0] = $event => _ctx.closePopup(false))
610
610
  }, null, 8, ["title"]), createElementVNode("div", {
611
611
  class: "confirm-body",
612
- innerHTML: props.message || "请确认?"
612
+ innerHTML: _ctx.message || "请确认?"
613
613
  }, null, 8, _hoisted_2$8), createVNode(_sfc_main$q, {
614
614
  align: "right",
615
- "cancel-name": props.cancelName,
616
- "cancel-disabled": props.cancelDisabled,
617
- "confirm-name": props.confirmName,
618
- "confirm-disabled": props.confirmDisabled,
619
- onCancel: _cache[1] || (_cache[1] = $event => props.closePopup(false)),
620
- onConfirm: _cache[2] || (_cache[2] = $event => props.closePopup(true))
615
+ "cancel-name": _ctx.cancelName,
616
+ "cancel-disabled": _ctx.cancelDisabled,
617
+ "confirm-name": _ctx.confirmName,
618
+ "confirm-disabled": _ctx.confirmDisabled,
619
+ onCancel: _cache[1] || (_cache[1] = $event => _ctx.closePopup(false)),
620
+ onConfirm: _cache[2] || (_cache[2] = $event => _ctx.closePopup(true))
621
621
  }, null, 8, ["cancel-name", "cancel-disabled", "confirm-name", "confirm-disabled"])]);
622
622
  };
623
623
  }
@@ -1326,14 +1326,13 @@ var _sfc_main$g = defineComponent({
1326
1326
  imageUrl: {}
1327
1327
  },
1328
1328
  setup(__props) {
1329
- const props = __props;
1330
1329
  const defaultImageBase64 = getNoDataBase64Image();
1331
1330
  return (_ctx, _cache) => {
1332
1331
  return openBlock(), createElementBlock("div", _hoisted_1$9, [createElementVNode("img", {
1333
- src: props.imageUrl || unref(defaultImageBase64)
1332
+ src: _ctx.imageUrl || unref(defaultImageBase64)
1334
1333
  }, null, 8, _hoisted_2$6), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
1335
1334
  class: "message",
1336
- textContent: toDisplayString(props.message || "无数据")
1335
+ textContent: toDisplayString(_ctx.message || "无数据")
1337
1336
  }, null, 8, _hoisted_3$5)])]);
1338
1337
  };
1339
1338
  }
@@ -1752,11 +1751,11 @@ var _sfc_main$d = defineComponent({
1752
1751
  return (_ctx, _cache) => {
1753
1752
  return openBlock(), createElementBlock("div", {
1754
1753
  class: normalizeClass(["snail-select", {
1755
- "readonly": props.readonly
1754
+ "readonly": _ctx.readonly
1756
1755
  }]),
1757
1756
  onClick: _cache[0] || (_cache[0] = $event => onClick()),
1758
1757
  ref: "select"
1759
- }, [props.items && props.items.length > 0 ? (openBlock(), createElementBlock(Fragment, {
1758
+ }, [_ctx.items && _ctx.items.length > 0 ? (openBlock(), createElementBlock(Fragment, {
1760
1759
  key: 0
1761
1760
  }, [selectedItemsRef.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1$7, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
1762
1761
  class: "select-text",
@@ -1765,7 +1764,7 @@ var _sfc_main$d = defineComponent({
1765
1764
  }, null, 8, _hoisted_2$4)])])) : (openBlock(), createElementBlock("div", {
1766
1765
  key: 1,
1767
1766
  class: "select-result text-tips",
1768
- textContent: toDisplayString(props.readonly ? "" : props.placeholder || "请选择")
1767
+ textContent: toDisplayString(_ctx.readonly ? "" : _ctx.placeholder || "请选择")
1769
1768
  }, null, 8, _hoisted_3$3)), createVNode(_sfc_main$s, {
1770
1769
  type: "arrow",
1771
1770
  size: 24,
@@ -1814,7 +1813,7 @@ var _sfc_main$c = defineComponent({
1814
1813
  }
1815
1814
  return (_ctx, _cache) => {
1816
1815
  return openBlock(), createElementBlock("div", {
1817
- class: normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", props.readonly ? "readonly" : ""]]),
1816
+ class: normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", _ctx.readonly ? "readonly" : ""]]),
1818
1817
  onClick: onSwitchChange
1819
1818
  }, _cache[0] || (_cache[0] = [createElementVNode("div", {
1820
1819
  class: "on"
@@ -1863,7 +1862,6 @@ var _sfc_main$b = defineComponent({
1863
1862
  let {
1864
1863
  emit: __emit
1865
1864
  } = _ref;
1866
- const props = __props;
1867
1865
  const emits = __emit;
1868
1866
  const {
1869
1867
  transition
@@ -1913,12 +1911,12 @@ var _sfc_main$b = defineComponent({
1913
1911
  class: normalizeClass(["snail-fold", statusModel.value])
1914
1912
  }, [createElementVNode("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "header", {}, () => [createElementVNode("div", {
1915
1913
  class: "title",
1916
- textContent: toDisplayString(props.title)
1917
- }, null, 8, _hoisted_2$3), !!props.subtitle ? (openBlock(), createElementBlock("div", {
1914
+ textContent: toDisplayString(_ctx.title)
1915
+ }, null, 8, _hoisted_2$3), !!_ctx.subtitle ? (openBlock(), createElementBlock("div", {
1918
1916
  key: 0,
1919
1917
  class: "subtitle",
1920
- textContent: toDisplayString(props.subtitle)
1921
- }, null, 8, _hoisted_3$2)) : createCommentVNode("", true), props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$2, [createVNode(_sfc_main$s, {
1918
+ textContent: toDisplayString(_ctx.subtitle)
1919
+ }, null, 8, _hoisted_3$2)) : createCommentVNode("", true), _ctx.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$2, [createVNode(_sfc_main$s, {
1922
1920
  type: "arrow",
1923
1921
  title: statusModel.value == "expand" ? "收起" : "展开",
1924
1922
  onClick: onStatusClick
@@ -2059,13 +2057,12 @@ var _sfc_main$9 = defineComponent({
2059
2057
  scroll: {}
2060
2058
  },
2061
2059
  setup(__props) {
2062
- const props = __props;
2063
2060
  return (_ctx, _cache) => {
2064
2061
  return openBlock(), createElementBlock("div", {
2065
- class: normalizeClass(["snail-layout", props.mode])
2062
+ class: normalizeClass(["snail-layout", _ctx.mode])
2066
2063
  }, [_ctx.$slots.start ? (openBlock(), createElementBlock("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "start")])) : createCommentVNode("", true), createVNode(_sfc_main$a, mergeProps({
2067
2064
  class: "layout-body"
2068
- }, props.scroll), {
2065
+ }, _ctx.scroll), {
2069
2066
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
2070
2067
  _: 3
2071
2068
  }, 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", _hoisted_2$2, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("", true)], 2);
@@ -2181,10 +2178,10 @@ var _sfc_main$7 = defineComponent({
2181
2178
  return (_ctx, _cache) => {
2182
2179
  return openBlock(), createBlock(_sfc_main$a, {
2183
2180
  class: normalizeClass(["snail-table", {
2184
- "start-border": props.border == true
2181
+ "start-border": _ctx.border == true
2185
2182
  }]),
2186
- "scroll-x": props.scrollX,
2187
- "scroll-y": props.scrollY
2183
+ "scroll-x": _ctx.scrollX,
2184
+ "scroll-y": _ctx.scrollY
2188
2185
  }, {
2189
2186
  default: withCtx(() => [createElementVNode("div", {
2190
2187
  class: "table-header",
@@ -2261,7 +2258,7 @@ var _sfc_main$5 = defineComponent({
2261
2258
  const styleRef = computed(() => css.buildStyle(props));
2262
2259
  return (_ctx, _cache) => {
2263
2260
  return openBlock(), createElementBlock("div", {
2264
- class: normalizeClass(["table-col", props.textAlign]),
2261
+ class: normalizeClass(["table-col", _ctx.textAlign]),
2265
2262
  style: normalizeStyle(styleRef.value)
2266
2263
  }, [renderSlot(_ctx.$slots, "default")], 6);
2267
2264
  };
@@ -2466,20 +2463,20 @@ var _sfc_main$3 = defineComponent({
2466
2463
  emits("click", node, parents);
2467
2464
  }
2468
2465
  return (_ctx, _cache) => {
2469
- return openBlock(), createElementBlock("div", _hoisted_1$2, [props.search ? (openBlock(), createBlock(_sfc_main$o, mergeProps({
2466
+ return openBlock(), createElementBlock("div", _hoisted_1$2, [_ctx.search ? (openBlock(), createBlock(_sfc_main$o, mergeProps({
2470
2467
  key: 0
2471
- }, props.search, {
2468
+ }, _ctx.search, {
2472
2469
  onSearch
2473
2470
  }), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$a, {
2474
2471
  "scroll-y": true
2475
2472
  }, {
2476
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.nodes || [], node => {
2473
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.nodes || [], node => {
2477
2474
  return openBlock(), createBlock(_sfc_main$4, {
2478
2475
  key: unref(context).getKey(node),
2479
2476
  node,
2480
2477
  parent: void 0,
2481
2478
  level: 1,
2482
- options: props.nodeOptions,
2479
+ options: _ctx.nodeOptions,
2483
2480
  context: unref(context),
2484
2481
  onClick: onTreeNodeClick
2485
2482
  }, {
@@ -2513,11 +2510,10 @@ var _sfc_main$2 = defineComponent({
2513
2510
  let {
2514
2511
  emit: __emit
2515
2512
  } = _ref;
2516
- const props = __props;
2517
2513
  const emits = __emit;
2518
2514
  return (_ctx, _cache) => {
2519
2515
  return openBlock(), createElementBlock("div", {
2520
- class: normalizeClass(["snail-wrapper", props.inPopup ? "in-popup" : "in-normal"])
2516
+ class: normalizeClass(["snail-wrapper", _ctx.inPopup ? "in-popup" : "in-normal"])
2521
2517
  }, [_ctx.header && _ctx.header.disabled != true ? (openBlock(), createBlock(_sfc_main$p, mergeProps({
2522
2518
  key: 0
2523
2519
  }, _ctx.header || {
@@ -2609,21 +2605,21 @@ var _sfc_main$1 = defineComponent({
2609
2605
  return (_ctx, _cache) => {
2610
2606
  return openBlock(), createElementBlock("div", {
2611
2607
  class: normalizeClass(["snail-input", {
2612
- "readonly": props.readonly
2608
+ "readonly": _ctx.readonly
2613
2609
  }])
2614
- }, [!!props.title ? (openBlock(), createElementBlock("div", {
2610
+ }, [!!_ctx.title ? (openBlock(), createElementBlock("div", {
2615
2611
  key: 0,
2616
2612
  class: "input-title",
2617
2613
  style: normalizeStyle(titleStyleRef.value)
2618
2614
  }, [createElementVNode("span", {
2619
2615
  class: "text",
2620
- textContent: toDisplayString(props.title)
2621
- }, null, 8, _hoisted_1$1), props.readonly != true && props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3, [createElementVNode("input", {
2616
+ textContent: toDisplayString(_ctx.title)
2617
+ }, null, 8, _hoisted_1$1), _ctx.readonly != true && _ctx.required == true ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3, [createElementVNode("input", {
2622
2618
  ref: "input-el",
2623
- type: props.type || "text",
2619
+ type: _ctx.type || "text",
2624
2620
  value: inputModel.value,
2625
- readonly: props.readonly == true,
2626
- placeholder: props.placeholder,
2621
+ readonly: _ctx.readonly == true,
2622
+ placeholder: _ctx.placeholder,
2627
2623
  title: inputModel.value,
2628
2624
  onChange: onValueChange,
2629
2625
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
@@ -5,6 +5,7 @@
5
5
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.SnailVue = global.SnailVue || {}, global.Vue, global.Snail, global.SnailView));
6
6
  })(this, (function (exports, vue, snail_core, snail_view) { 'use strict';
7
7
 
8
+ const _hoisted_1$g = ["title"];
8
9
  var _sfc_main$t = vue.defineComponent({
9
10
  ...{
10
11
  name: "Button",
@@ -12,15 +13,16 @@
12
13
  },
13
14
  __name: "button",
14
15
  props: {
16
+ title: {},
15
17
  size: {},
16
18
  type: {}
17
19
  },
18
20
  setup(__props) {
19
- const props = __props;
20
21
  return (_ctx, _cache) => {
21
22
  return vue.openBlock(), vue.createElementBlock("div", {
22
- class: vue.normalizeClass(["snail-button", [props.size, props.type]])
23
- }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = vue.createTextVNode("按钮"))])], 2);
23
+ class: vue.normalizeClass(["snail-button", [_ctx.size, _ctx.type]]),
24
+ title: _ctx.title
25
+ }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [_cache[0] || (_cache[0] = vue.createTextVNode("按钮"))])], 10, _hoisted_1$g);
24
26
  };
25
27
  }
26
28
  });
@@ -169,25 +171,25 @@
169
171
  }
170
172
  return (_ctx, _cache) => {
171
173
  return vue.openBlock(), vue.createElementBlock("div", {
172
- class: vue.normalizeClass(["snail-choose", props.readonly ? "readonly" : ""])
174
+ class: vue.normalizeClass(["snail-choose", _ctx.readonly ? "readonly" : ""])
173
175
  }, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(chooseItemsRef.value, (item, index) => {
174
176
  return vue.openBlock(), vue.createElementBlock("div", {
175
177
  key: item.key,
176
178
  class: vue.normalizeClass(["choose-item", item.checked ? "checked" : ""]),
177
- style: vue.normalizeStyle(vue.unref(snail_view.css).buildStyle(props.itemStyle)),
179
+ style: vue.normalizeStyle(vue.unref(snail_view.css).buildStyle(_ctx.itemStyle)),
178
180
  onClick: $event => onItemClick(item)
179
181
  }, [vue.unref(mode) == "native" ? (vue.openBlock(), vue.createElementBlock("input", {
180
182
  key: 0,
181
- type: props.type,
183
+ type: _ctx.type,
182
184
  checked: item.checked
183
185
  }, null, 8, _hoisted_2$9)) : vue.unref(mode) == "beautiful" ? (vue.openBlock(), vue.createElementBlock("div", {
184
186
  key: 1,
185
- class: vue.normalizeClass(["item-beautiful", [props.type, item.checked ? "item-checked" : "item-unchecked"]])
187
+ class: vue.normalizeClass(["item-beautiful", [_ctx.type, item.checked ? "item-checked" : "item-unchecked"]])
186
188
  }, [item.checked ? (vue.openBlock(), vue.createBlock(_sfc_main$s, {
187
189
  key: 0,
188
190
  type: "success",
189
191
  size: 12,
190
- color: props.readonly ? "#8a9099" : "white"
192
+ color: _ctx.readonly ? "#8a9099" : "white"
191
193
  }, null, 8, ["color"])) : vue.createCommentVNode("", true)], 2)) : vue.createCommentVNode("", true), item.text ? (vue.openBlock(), vue.createElementBlock("span", {
192
194
  key: 2,
193
195
  class: "item-text",
@@ -227,25 +229,24 @@
227
229
  let {
228
230
  emit: __emit
229
231
  } = _ref;
230
- const props = __props;
231
232
  const emits = __emit;
232
233
  return (_ctx, _cache) => {
233
234
  return vue.openBlock(), vue.createElementBlock("footer", {
234
235
  class: vue.normalizeClass(["snail-footer", {
235
- "start-divider": props.divider
236
- }, props.align || "right"])
237
- }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [props.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
236
+ "start-divider": _ctx.divider
237
+ }, _ctx.align || "right"])
238
+ }, [vue.renderSlot(_ctx.$slots, "default", {}, () => [_ctx.cancelDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
238
239
  key: 0,
239
240
  size: "max",
240
241
  type: "default",
241
242
  onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
242
- textContent: vue.toDisplayString(props.cancelName || "取消")
243
- }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), props.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
243
+ textContent: vue.toDisplayString(_ctx.cancelName || "取消")
244
+ }, null, 8, ["textContent"])) : vue.createCommentVNode("", true), _ctx.confirmDisabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
244
245
  key: 1,
245
246
  size: "max",
246
247
  type: "primary",
247
248
  onClick: _cache[1] || (_cache[1] = $event => emits("confirm")),
248
- textContent: vue.toDisplayString(props.confirmName || "确定")
249
+ textContent: vue.toDisplayString(_ctx.confirmName || "确定")
249
250
  }, null, 8, ["textContent"])) : vue.createCommentVNode("", true)])], 2);
250
251
  };
251
252
  }
@@ -343,11 +344,11 @@
343
344
  }
344
345
  return (_ctx, _cache) => {
345
346
  return vue.openBlock(), vue.createElementBlock("div", {
346
- class: vue.normalizeClass(["snail-search", props.readonly ? "readonly" : ""])
347
+ class: vue.normalizeClass(["snail-search", _ctx.readonly ? "readonly" : ""])
347
348
  }, [vue.withDirectives(vue.createElementVNode("input", {
348
349
  type: "search",
349
- placeholder: props.placeholder,
350
- readonly: props.readonly == true,
350
+ placeholder: _ctx.placeholder,
351
+ readonly: _ctx.readonly,
351
352
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => textModel.value = $event),
352
353
  onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
353
354
  }, null, 40, _hoisted_1$c), [[vue.vModelText, textModel.value, void 0, {
@@ -603,23 +604,22 @@
603
604
  }
604
605
  },
605
606
  setup(__props) {
606
- const props = __props;
607
607
  return (_ctx, _cache) => {
608
608
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [vue.createVNode(_sfc_main$p, {
609
609
  "use-to": "dialog",
610
- title: props.title || "提示",
611
- onClose: _cache[0] || (_cache[0] = $event => props.closePopup(false))
610
+ title: _ctx.title || "提示",
611
+ onClose: _cache[0] || (_cache[0] = $event => _ctx.closePopup(false))
612
612
  }, null, 8, ["title"]), vue.createElementVNode("div", {
613
613
  class: "confirm-body",
614
- innerHTML: props.message || "请确认?"
614
+ innerHTML: _ctx.message || "请确认?"
615
615
  }, null, 8, _hoisted_2$8), vue.createVNode(_sfc_main$q, {
616
616
  align: "right",
617
- "cancel-name": props.cancelName,
618
- "cancel-disabled": props.cancelDisabled,
619
- "confirm-name": props.confirmName,
620
- "confirm-disabled": props.confirmDisabled,
621
- onCancel: _cache[1] || (_cache[1] = $event => props.closePopup(false)),
622
- onConfirm: _cache[2] || (_cache[2] = $event => props.closePopup(true))
617
+ "cancel-name": _ctx.cancelName,
618
+ "cancel-disabled": _ctx.cancelDisabled,
619
+ "confirm-name": _ctx.confirmName,
620
+ "confirm-disabled": _ctx.confirmDisabled,
621
+ onCancel: _cache[1] || (_cache[1] = $event => _ctx.closePopup(false)),
622
+ onConfirm: _cache[2] || (_cache[2] = $event => _ctx.closePopup(true))
623
623
  }, null, 8, ["cancel-name", "cancel-disabled", "confirm-name", "confirm-disabled"])]);
624
624
  };
625
625
  }
@@ -1328,14 +1328,13 @@
1328
1328
  imageUrl: {}
1329
1329
  },
1330
1330
  setup(__props) {
1331
- const props = __props;
1332
1331
  const defaultImageBase64 = getNoDataBase64Image();
1333
1332
  return (_ctx, _cache) => {
1334
1333
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$9, [vue.createElementVNode("img", {
1335
- src: props.imageUrl || vue.unref(defaultImageBase64)
1334
+ src: _ctx.imageUrl || vue.unref(defaultImageBase64)
1336
1335
  }, null, 8, _hoisted_2$6), vue.renderSlot(_ctx.$slots, "default", {}, () => [vue.createElementVNode("div", {
1337
1336
  class: "message",
1338
- textContent: vue.toDisplayString(props.message || "无数据")
1337
+ textContent: vue.toDisplayString(_ctx.message || "无数据")
1339
1338
  }, null, 8, _hoisted_3$5)])]);
1340
1339
  };
1341
1340
  }
@@ -1754,11 +1753,11 @@
1754
1753
  return (_ctx, _cache) => {
1755
1754
  return vue.openBlock(), vue.createElementBlock("div", {
1756
1755
  class: vue.normalizeClass(["snail-select", {
1757
- "readonly": props.readonly
1756
+ "readonly": _ctx.readonly
1758
1757
  }]),
1759
1758
  onClick: _cache[0] || (_cache[0] = $event => onClick()),
1760
1759
  ref: "select"
1761
- }, [props.items && props.items.length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1760
+ }, [_ctx.items && _ctx.items.length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
1762
1761
  key: 0
1763
1762
  }, [selectedItemsRef.value.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$7, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
1764
1763
  class: "select-text",
@@ -1767,7 +1766,7 @@
1767
1766
  }, null, 8, _hoisted_2$4)])])) : (vue.openBlock(), vue.createElementBlock("div", {
1768
1767
  key: 1,
1769
1768
  class: "select-result text-tips",
1770
- textContent: vue.toDisplayString(props.readonly ? "" : props.placeholder || "请选择")
1769
+ textContent: vue.toDisplayString(_ctx.readonly ? "" : _ctx.placeholder || "请选择")
1771
1770
  }, null, 8, _hoisted_3$3)), vue.createVNode(_sfc_main$s, {
1772
1771
  type: "arrow",
1773
1772
  size: 24,
@@ -1816,7 +1815,7 @@
1816
1815
  }
1817
1816
  return (_ctx, _cache) => {
1818
1817
  return vue.openBlock(), vue.createElementBlock("div", {
1819
- class: vue.normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", props.readonly ? "readonly" : ""]]),
1818
+ class: vue.normalizeClass(["snail-switch", [switchModel.value ? "on" : "off", _ctx.readonly ? "readonly" : ""]]),
1820
1819
  onClick: onSwitchChange
1821
1820
  }, _cache[0] || (_cache[0] = [vue.createElementVNode("div", {
1822
1821
  class: "on"
@@ -1865,7 +1864,6 @@
1865
1864
  let {
1866
1865
  emit: __emit
1867
1866
  } = _ref;
1868
- const props = __props;
1869
1867
  const emits = __emit;
1870
1868
  const {
1871
1869
  transition
@@ -1915,12 +1913,12 @@
1915
1913
  class: vue.normalizeClass(["snail-fold", statusModel.value])
1916
1914
  }, [vue.createElementVNode("div", _hoisted_1$6, [vue.renderSlot(_ctx.$slots, "header", {}, () => [vue.createElementVNode("div", {
1917
1915
  class: "title",
1918
- textContent: vue.toDisplayString(props.title)
1919
- }, null, 8, _hoisted_2$3), !!props.subtitle ? (vue.openBlock(), vue.createElementBlock("div", {
1916
+ textContent: vue.toDisplayString(_ctx.title)
1917
+ }, null, 8, _hoisted_2$3), !!_ctx.subtitle ? (vue.openBlock(), vue.createElementBlock("div", {
1920
1918
  key: 0,
1921
1919
  class: "subtitle",
1922
- textContent: vue.toDisplayString(props.subtitle)
1923
- }, null, 8, _hoisted_3$2)) : vue.createCommentVNode("", true), props.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [vue.createVNode(_sfc_main$s, {
1920
+ textContent: vue.toDisplayString(_ctx.subtitle)
1921
+ }, null, 8, _hoisted_3$2)) : vue.createCommentVNode("", true), _ctx.disabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [vue.createVNode(_sfc_main$s, {
1924
1922
  type: "arrow",
1925
1923
  title: statusModel.value == "expand" ? "收起" : "展开",
1926
1924
  onClick: onStatusClick
@@ -2061,13 +2059,12 @@
2061
2059
  scroll: {}
2062
2060
  },
2063
2061
  setup(__props) {
2064
- const props = __props;
2065
2062
  return (_ctx, _cache) => {
2066
2063
  return vue.openBlock(), vue.createElementBlock("div", {
2067
- class: vue.normalizeClass(["snail-layout", props.mode])
2064
+ class: vue.normalizeClass(["snail-layout", _ctx.mode])
2068
2065
  }, [_ctx.$slots.start ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$5, [vue.renderSlot(_ctx.$slots, "start")])) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$a, vue.mergeProps({
2069
2066
  class: "layout-body"
2070
- }, props.scroll), {
2067
+ }, _ctx.scroll), {
2071
2068
  default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
2072
2069
  _: 3
2073
2070
  }, 16), _ctx.$slots.end ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [vue.renderSlot(_ctx.$slots, "end")])) : vue.createCommentVNode("", true)], 2);
@@ -2183,10 +2180,10 @@
2183
2180
  return (_ctx, _cache) => {
2184
2181
  return vue.openBlock(), vue.createBlock(_sfc_main$a, {
2185
2182
  class: vue.normalizeClass(["snail-table", {
2186
- "start-border": props.border == true
2183
+ "start-border": _ctx.border == true
2187
2184
  }]),
2188
- "scroll-x": props.scrollX,
2189
- "scroll-y": props.scrollY
2185
+ "scroll-x": _ctx.scrollX,
2186
+ "scroll-y": _ctx.scrollY
2190
2187
  }, {
2191
2188
  default: vue.withCtx(() => [vue.createElementVNode("div", {
2192
2189
  class: "table-header",
@@ -2263,7 +2260,7 @@
2263
2260
  const styleRef = vue.computed(() => snail_view.css.buildStyle(props));
2264
2261
  return (_ctx, _cache) => {
2265
2262
  return vue.openBlock(), vue.createElementBlock("div", {
2266
- class: vue.normalizeClass(["table-col", props.textAlign]),
2263
+ class: vue.normalizeClass(["table-col", _ctx.textAlign]),
2267
2264
  style: vue.normalizeStyle(styleRef.value)
2268
2265
  }, [vue.renderSlot(_ctx.$slots, "default")], 6);
2269
2266
  };
@@ -2468,20 +2465,20 @@
2468
2465
  emits("click", node, parents);
2469
2466
  }
2470
2467
  return (_ctx, _cache) => {
2471
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$o, vue.mergeProps({
2468
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [_ctx.search ? (vue.openBlock(), vue.createBlock(_sfc_main$o, vue.mergeProps({
2472
2469
  key: 0
2473
- }, props.search, {
2470
+ }, _ctx.search, {
2474
2471
  onSearch
2475
2472
  }), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$a, {
2476
2473
  "scroll-y": true
2477
2474
  }, {
2478
- default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.nodes || [], node => {
2475
+ default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.nodes || [], node => {
2479
2476
  return vue.openBlock(), vue.createBlock(_sfc_main$4, {
2480
2477
  key: vue.unref(context).getKey(node),
2481
2478
  node,
2482
2479
  parent: void 0,
2483
2480
  level: 1,
2484
- options: props.nodeOptions,
2481
+ options: _ctx.nodeOptions,
2485
2482
  context: vue.unref(context),
2486
2483
  onClick: onTreeNodeClick
2487
2484
  }, {
@@ -2515,11 +2512,10 @@
2515
2512
  let {
2516
2513
  emit: __emit
2517
2514
  } = _ref;
2518
- const props = __props;
2519
2515
  const emits = __emit;
2520
2516
  return (_ctx, _cache) => {
2521
2517
  return vue.openBlock(), vue.createElementBlock("div", {
2522
- class: vue.normalizeClass(["snail-wrapper", props.inPopup ? "in-popup" : "in-normal"])
2518
+ class: vue.normalizeClass(["snail-wrapper", _ctx.inPopup ? "in-popup" : "in-normal"])
2523
2519
  }, [_ctx.header && _ctx.header.disabled != true ? (vue.openBlock(), vue.createBlock(_sfc_main$p, vue.mergeProps({
2524
2520
  key: 0
2525
2521
  }, _ctx.header || {
@@ -2611,21 +2607,21 @@
2611
2607
  return (_ctx, _cache) => {
2612
2608
  return vue.openBlock(), vue.createElementBlock("div", {
2613
2609
  class: vue.normalizeClass(["snail-input", {
2614
- "readonly": props.readonly
2610
+ "readonly": _ctx.readonly
2615
2611
  }])
2616
- }, [!!props.title ? (vue.openBlock(), vue.createElementBlock("div", {
2612
+ }, [!!_ctx.title ? (vue.openBlock(), vue.createElementBlock("div", {
2617
2613
  key: 0,
2618
2614
  class: "input-title",
2619
2615
  style: vue.normalizeStyle(titleStyleRef.value)
2620
2616
  }, [vue.createElementVNode("span", {
2621
2617
  class: "text",
2622
- textContent: vue.toDisplayString(props.title)
2623
- }, null, 8, _hoisted_1$1), props.readonly != true && props.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3, [vue.createElementVNode("input", {
2618
+ textContent: vue.toDisplayString(_ctx.title)
2619
+ }, null, 8, _hoisted_1$1), _ctx.readonly != true && _ctx.required == true ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2)) : vue.createCommentVNode("", true)], 4)) : vue.createCommentVNode("", true), vue.createElementVNode("div", _hoisted_3, [vue.createElementVNode("input", {
2624
2620
  ref: "input-el",
2625
- type: props.type || "text",
2621
+ type: _ctx.type || "text",
2626
2622
  value: inputModel.value,
2627
- readonly: props.readonly == true,
2628
- placeholder: props.placeholder,
2623
+ readonly: _ctx.readonly == true,
2624
+ placeholder: _ctx.placeholder,
2629
2625
  title: inputModel.value,
2630
2626
  onChange: onValueChange,
2631
2627
  onClick: _cache[0] || (_cache[0] = $event => emits("click"))
@@ -1,47 +1,47 @@
1
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}
2
+ .snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;justify-content:center;overflow:hidden;-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
3
  /* src:base\choose.vue index:0 */
4
4
  .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:first-child{margin-left:0}.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>div.item-beautiful{align-items:center;display:flex;flex-shrink:0;justify-content:center;overflow:hidden}.snail-choose>div.choose-item>div.item-beautiful.radio{border-radius:50%;height:16px;width:16px}.snail-choose>div.choose-item>div.item-beautiful.checkbox{height:14px;width:14px}.snail-choose>div.choose-item>div.item-beautiful.item-unchecked{border:1px solid #8a9099}.snail-choose>div.choose-item>div.item-beautiful.item-checked{background-color:#4c9aff;border:1px solid #4c9aff}.snail-choose>div.choose-item>span{margin-left:4px}.snail-choose>div.choose-item>span.item-des{color:#8a9099}.snail-choose.readonly>div.choose-item{cursor:auto}.snail-choose.readonly>div.choose-item>div.item-beautiful.item-unchecked{opacity:.5}.snail-choose.readonly>div.choose-item>div.item-beautiful.item-checked{background-color:#d5d7db;border-color:#d5d7db}
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: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}
5
7
  /* src:base\footer.vue index:0 */
6
8
  .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:flex-start}.snail-footer.center{justify-content:center}.snail-footer.right{justify-content:flex-end}
7
- /* src:base\search.vue index:0 */
8
- .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
9
  /* src:base\icon.vue index:0 */
10
10
  .snail-icon{cursor:pointer;opacity:1}
11
- /* src:base\header.vue index:0 */
12
- .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}
11
+ /* src:base\search.vue index:0 */
12
+ .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}
13
13
  /* src:base\select.vue index:0 */
14
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{align-items:center;cursor:text;display:flex;height:100%;padding:0 8px;width:100%}.snail-select.readonly{cursor:auto}.snail-select.readonly>svg.snail-icon{display:none}
15
- /* src:container\dynamic.vue index:0 */
16
- .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
17
15
  /* src:base\switch.vue index:0 */
18
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}
17
+ /* src:container\dynamic.vue index:0 */
18
+ .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
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:flex-end;display:flex;flex:1;justify-content:flex-end}.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
- /* src:container\scroll.vue index:0 */
22
- .snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
23
21
  /* src:container\layout.vue index:0 */
24
22
  .snail-layout{display:flex;height:100%;overflow:hidden;width:100%}.snail-layout>.layout-end,.snail-layout>.layout-start{flex-shrink:0}.snail-layout>.layout-body{flex:1}.snail-layout.horizontal{flex-direction:row}.snail-layout.horizontal>div{height:100%}.snail-layout.horizontal>.layout-end,.snail-layout.horizontal>.layout-start{width:-moz-fit-content;width:fit-content}.snail-layout.vertical{flex-direction:column}.snail-layout.vertical>div{width:100%}.snail-layout.vertical>.layout-end,.snail-layout.vertical>.layout-start{height:-moz-fit-content;height:fit-content}
25
23
  /* src:container\table.vue index:0 */
26
24
  .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\scroll.vue index:0 */
26
+ .snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
27
+ /* src:container\components\table-col.vue index:0 */
28
+ .table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:flex-start}.table-col.center{justify-content:center}.table-col.right{justify-content:flex-end}
27
29
  /* src:container\sort.vue index:0 */
28
30
  .snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
29
31
  /* src:container\components\table-row.vue index:0 */
30
32
  .table-row{align-items:center;display:flex}
31
33
  /* src:container\tree.vue index:0 */
32
34
  .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}
33
- /* src:container\components\table-col.vue index:0 */
34
- .table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:flex-start}.table-col.center{justify-content:center}.table-col.right{justify-content:flex-end}
35
35
  /* src:container\wrapper.vue index:0 */
36
36
  .snail-wrapper{background-color:#fff;display:flex;flex-direction:column}.snail-wrapper>.snail-scroll{flex:1}.snail-wrapper.in-normal{flex:1;height:100%;overflow:hidden;width:100%}.snail-wrapper.in-popup{height:80%;min-width:800px;overflow:hidden;width:60%}
37
37
  /* src:form\input.vue index:0 */
38
38
  .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}
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 .3s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
41
- /* src:prompt\empty.vue index:0 */
42
- .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}
43
39
  /* src:prompt\drag-verify.vue index:0 */
44
40
  .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}}
41
+ /* src:prompt\empty.vue index:0 */
42
+ .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}
43
+ /* src:prompt\loading.vue index:0 */
44
+ .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 .3s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
45
45
  /* src:popup\components\confirm-container.vue index:0 */
46
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
47
  /* src:popup\components\dialog-container.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.50",
6
+ "version": "1.0.52",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",