snail.vue 1.0.47 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snail.vue.d.ts +34 -7
- package/dist/snail.vue.js +73 -21
- package/dist/snail.vue.umd.js +73 -21
- package/dist/styles/snail.vue.vue.css +19 -19
- package/package.json +2 -2
package/dist/snail.vue.d.ts
CHANGED
|
@@ -416,6 +416,12 @@ interface ITreeBaseContext<T> {
|
|
|
416
416
|
* @param text 搜索文本
|
|
417
417
|
*/
|
|
418
418
|
doSearch(text: string): void;
|
|
419
|
+
/**
|
|
420
|
+
* 是否是【已激活】节点
|
|
421
|
+
* @param node 要判断的节点
|
|
422
|
+
* @returns true 是已激活节点,false 否
|
|
423
|
+
*/
|
|
424
|
+
isActived(node: TreeNode<T>): boolean;
|
|
419
425
|
/**
|
|
420
426
|
* 是否是【补丁】节点
|
|
421
427
|
* - 子节点搜索命中时,父级路径上节点没命中,则作父级路径节点作为路径修补节点存在,避免命中子节点展示不出来
|
|
@@ -568,6 +574,13 @@ type TreeNodeModel<T> = TreeNode<T, TreeNodeExtend>;
|
|
|
568
574
|
* 树节点 渲染配置选项
|
|
569
575
|
*/
|
|
570
576
|
type TreeNodeRenderOptions = {
|
|
577
|
+
/**
|
|
578
|
+
* 节点展开层级
|
|
579
|
+
* - 不传入则默认展开所有
|
|
580
|
+
* - 否则展开传入的层级;从2开始;第一级始终展开;如2则1、2层级展开
|
|
581
|
+
* -
|
|
582
|
+
*/
|
|
583
|
+
expandLevel?: number;
|
|
571
584
|
/**
|
|
572
585
|
* 是否禁用【折叠】子节点操作
|
|
573
586
|
* - true 时禁用 折叠操作
|
|
@@ -585,8 +598,8 @@ type TreeNodeRenderOptions = {
|
|
|
585
598
|
*/
|
|
586
599
|
type TreeNodeSlotOptions<Node> = {
|
|
587
600
|
/**
|
|
588
|
-
|
|
589
|
-
|
|
601
|
+
* 当前节点
|
|
602
|
+
*/
|
|
590
603
|
node: Node;
|
|
591
604
|
/**
|
|
592
605
|
* 父节点
|
|
@@ -1177,9 +1190,10 @@ type SwitchEvents = {
|
|
|
1177
1190
|
/**
|
|
1178
1191
|
* 使用【树上下文】
|
|
1179
1192
|
* @param nodes 树节点集合
|
|
1193
|
+
* @param activeNodeRef 当前激活的树节点引用;不传入,则无法实现 isActived 判断
|
|
1180
1194
|
* @returns 上下文对象+作用域
|
|
1181
1195
|
*/
|
|
1182
|
-
declare function useTreeContext<T>(nodes: TreeNode<T, TreeNodeExtend>[]): ITreeBaseContext<T> & IScope;
|
|
1196
|
+
declare function useTreeContext<T>(nodes: TreeNode<T, TreeNodeExtend>[], activeNodeRef?: ShallowRef<TreeNode<T, TreeNodeExtend>>): ITreeBaseContext<T> & IScope;
|
|
1183
1197
|
|
|
1184
1198
|
/**
|
|
1185
1199
|
* 使用【响应式管理器】
|
|
@@ -1720,8 +1734,9 @@ interface IPopupManager {
|
|
|
1720
1734
|
* @param type 提示类型:成功、失败、、、
|
|
1721
1735
|
* @param message 提示消息
|
|
1722
1736
|
* @param options 提示框配置选项
|
|
1737
|
+
* @returns 弹窗打开结果,外部可手动关闭弹窗
|
|
1723
1738
|
*/
|
|
1724
|
-
toast(type: IconType, message: string, options?: Omit<ToastOptions, "type" | "message">):
|
|
1739
|
+
toast(type: IconType, message: string, options?: Omit<ToastOptions, "type" | "message">): IScope;
|
|
1725
1740
|
}
|
|
1726
1741
|
|
|
1727
1742
|
/**
|
|
@@ -1990,7 +2005,10 @@ declare const components: {
|
|
|
1990
2005
|
onTop?: () => any;
|
|
1991
2006
|
onXbar?: (show: boolean) => any;
|
|
1992
2007
|
onYbar?: (show: boolean) => any;
|
|
1993
|
-
}>, {
|
|
2008
|
+
}>, {
|
|
2009
|
+
scroll: (left?: number, top?: number) => void;
|
|
2010
|
+
scrollTo: (left?: number, top?: number) => void;
|
|
2011
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
1994
2012
|
left: () => any;
|
|
1995
2013
|
right: () => any;
|
|
1996
2014
|
bottom: () => any;
|
|
@@ -2011,7 +2029,10 @@ declare const components: {
|
|
|
2011
2029
|
onTop?: () => any;
|
|
2012
2030
|
onXbar?: (show: boolean) => any;
|
|
2013
2031
|
onYbar?: (show: boolean) => any;
|
|
2014
|
-
}>, {
|
|
2032
|
+
}>, {
|
|
2033
|
+
scroll: (left?: number, top?: number) => void;
|
|
2034
|
+
scrollTo: (left?: number, top?: number) => void;
|
|
2035
|
+
}, {}, {}, {}, {}>;
|
|
2015
2036
|
__isFragment?: never;
|
|
2016
2037
|
__isTeleport?: never;
|
|
2017
2038
|
__isSuspense?: never;
|
|
@@ -2022,7 +2043,10 @@ declare const components: {
|
|
|
2022
2043
|
onTop?: () => any;
|
|
2023
2044
|
onXbar?: (show: boolean) => any;
|
|
2024
2045
|
onYbar?: (show: boolean) => any;
|
|
2025
|
-
}>, {
|
|
2046
|
+
}>, {
|
|
2047
|
+
scroll: (left?: number, top?: number) => void;
|
|
2048
|
+
scrollTo: (left?: number, top?: number) => void;
|
|
2049
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
2026
2050
|
left: () => any;
|
|
2027
2051
|
right: () => any;
|
|
2028
2052
|
bottom: () => any;
|
|
@@ -2153,6 +2177,7 @@ declare const components: {
|
|
|
2153
2177
|
onSearched?: (text: string) => any;
|
|
2154
2178
|
}>, {
|
|
2155
2179
|
context: ITreeBaseContext<any>;
|
|
2180
|
+
onTreeNodeClick: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => void;
|
|
2156
2181
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
2157
2182
|
click: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
2158
2183
|
searched: (text: string) => any;
|
|
@@ -2172,6 +2197,7 @@ declare const components: {
|
|
|
2172
2197
|
onSearched?: (text: string) => any;
|
|
2173
2198
|
}>, {
|
|
2174
2199
|
context: ITreeBaseContext<any>;
|
|
2200
|
+
onTreeNodeClick: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => void;
|
|
2175
2201
|
}, {}, {}, {}, {}>;
|
|
2176
2202
|
__isFragment?: never;
|
|
2177
2203
|
__isTeleport?: never;
|
|
@@ -2185,6 +2211,7 @@ declare const components: {
|
|
|
2185
2211
|
onSearched?: (text: string) => any;
|
|
2186
2212
|
}>, {
|
|
2187
2213
|
context: ITreeBaseContext<any>;
|
|
2214
|
+
onTreeNodeClick: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => void;
|
|
2188
2215
|
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
2189
2216
|
click: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
2190
2217
|
searched: (text: string) => any;
|
package/dist/snail.vue.js
CHANGED
|
@@ -877,7 +877,8 @@ var _sfc_main$j = defineComponent({
|
|
|
877
877
|
const {
|
|
878
878
|
onClient,
|
|
879
879
|
onSize,
|
|
880
|
-
onEvent
|
|
880
|
+
onEvent,
|
|
881
|
+
onMutation
|
|
881
882
|
} = useObserver();
|
|
882
883
|
const {
|
|
883
884
|
onTimeout
|
|
@@ -959,6 +960,11 @@ var _sfc_main$j = defineComponent({
|
|
|
959
960
|
onEvent(window, "resize", () => __props.options.closeOnResize ? closePopup(void 0) : rootDom.value && buildFollow());
|
|
960
961
|
onEvent(window, "keyup", evet => __props.options.closeOnEscape && evet.key === "Escape" && followExt.pinned.value != true && closePopup(void 0));
|
|
961
962
|
onEvent(window, "click", event => __props.options.closeOnMask && rootDom.value != event.target && rootDom.value.contains(event.target) == false && followExt.pinned.value != true && closePopup(void 0));
|
|
963
|
+
onMutation(rootDom.value, {
|
|
964
|
+
childList: true,
|
|
965
|
+
attributes: false,
|
|
966
|
+
subtree: true
|
|
967
|
+
}, buildFollow);
|
|
962
968
|
}, 100);
|
|
963
969
|
});
|
|
964
970
|
});
|
|
@@ -1151,7 +1157,7 @@ function usePopup() {
|
|
|
1151
1157
|
});
|
|
1152
1158
|
}
|
|
1153
1159
|
function toast(type, message, options) {
|
|
1154
|
-
popupInCustomContainer(_sfc_main$h, {
|
|
1160
|
+
return popupInCustomContainer(_sfc_main$h, {
|
|
1155
1161
|
url: "#ToastContainer",
|
|
1156
1162
|
props: {
|
|
1157
1163
|
...(options || Object.create(null)),
|
|
@@ -1474,7 +1480,7 @@ var _sfc_main$e = defineComponent({
|
|
|
1474
1480
|
}
|
|
1475
1481
|
});
|
|
1476
1482
|
|
|
1477
|
-
function useTreeContext(nodes) {
|
|
1483
|
+
function useTreeContext(nodes, activeNodeRef) {
|
|
1478
1484
|
const failed = shallowRef();
|
|
1479
1485
|
const patched = shallowRef();
|
|
1480
1486
|
function doSearch(text) {
|
|
@@ -1483,6 +1489,9 @@ function useTreeContext(nodes) {
|
|
|
1483
1489
|
failed.value = result.failed;
|
|
1484
1490
|
patched.value = result.patched;
|
|
1485
1491
|
}
|
|
1492
|
+
function isActived(node) {
|
|
1493
|
+
return activeNodeRef && activeNodeRef.value == node;
|
|
1494
|
+
}
|
|
1486
1495
|
function isPatched(node) {
|
|
1487
1496
|
return patched.value ? patched.value.includes(node) : false;
|
|
1488
1497
|
}
|
|
@@ -1503,6 +1512,7 @@ function useTreeContext(nodes) {
|
|
|
1503
1512
|
}
|
|
1504
1513
|
const context = mountScope({
|
|
1505
1514
|
doSearch,
|
|
1515
|
+
isActived,
|
|
1506
1516
|
isPatched,
|
|
1507
1517
|
isShow,
|
|
1508
1518
|
isShowChildren,
|
|
@@ -1884,6 +1894,7 @@ var _sfc_main$a = defineComponent({
|
|
|
1884
1894
|
emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
|
|
1885
1895
|
setup(__props, _ref) {
|
|
1886
1896
|
let {
|
|
1897
|
+
expose: __expose,
|
|
1887
1898
|
emit: __emit
|
|
1888
1899
|
} = _ref;
|
|
1889
1900
|
const props = __props;
|
|
@@ -1900,6 +1911,18 @@ var _sfc_main$a = defineComponent({
|
|
|
1900
1911
|
"scroll-y": props.scrollY == true
|
|
1901
1912
|
}));
|
|
1902
1913
|
var preStatus = void 0;
|
|
1914
|
+
__expose({
|
|
1915
|
+
scroll,
|
|
1916
|
+
scrollTo
|
|
1917
|
+
});
|
|
1918
|
+
function scroll(left, top) {
|
|
1919
|
+
left == void 0 || (rootDom.value.scrollLeft += left);
|
|
1920
|
+
top == void 0 || (rootDom.value.scrollTop += top);
|
|
1921
|
+
}
|
|
1922
|
+
function scrollTo(left, top) {
|
|
1923
|
+
left == void 0 || (rootDom.value.scrollLeft = left);
|
|
1924
|
+
top == void 0 || (rootDom.value.scrollTop = top);
|
|
1925
|
+
}
|
|
1903
1926
|
function refreshScrollInfo() {
|
|
1904
1927
|
const status = {
|
|
1905
1928
|
xbar: rootDom.value.scrollWidth > rootDom.value.clientWidth,
|
|
@@ -1984,7 +2007,7 @@ var _sfc_main$9 = defineComponent({
|
|
|
1984
2007
|
}, props.scroll), {
|
|
1985
2008
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1986
2009
|
_: 3
|
|
1987
|
-
}, 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", _hoisted_2$2, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("", true)
|
|
2010
|
+
}, 16), _ctx.$slots.end ? (openBlock(), createElementBlock("div", _hoisted_2$2, [renderSlot(_ctx.$slots, "end")])) : createCommentVNode("", true)], 2);
|
|
1988
2011
|
};
|
|
1989
2012
|
}
|
|
1990
2013
|
});
|
|
@@ -2194,7 +2217,7 @@ const _hoisted_3$1 = {
|
|
|
2194
2217
|
};
|
|
2195
2218
|
const _hoisted_4$1 = {
|
|
2196
2219
|
key: 1,
|
|
2197
|
-
class: "snail-tree-children",
|
|
2220
|
+
class: "snail-tree-children hidden",
|
|
2198
2221
|
ref: "children"
|
|
2199
2222
|
};
|
|
2200
2223
|
var _sfc_main$4 = defineComponent({
|
|
@@ -2222,13 +2245,13 @@ var _sfc_main$4 = defineComponent({
|
|
|
2222
2245
|
const {
|
|
2223
2246
|
transition
|
|
2224
2247
|
} = useAnimation();
|
|
2248
|
+
const {
|
|
2249
|
+
watcher
|
|
2250
|
+
} = useReactive();
|
|
2251
|
+
const treeNodeDom = useTemplateRef("tree-node");
|
|
2252
|
+
const isHoveredRef = shallowRef(false);
|
|
2225
2253
|
const showRef = computed(() => __props.context.isShow(__props.node, true));
|
|
2226
2254
|
const showChildrenRef = computed(() => __props.context.isShowChildren(__props.node, true));
|
|
2227
|
-
const classRef = computed(() => {
|
|
2228
|
-
const array = [`level-${__props.level}`];
|
|
2229
|
-
__props.node.clickable && array.push("clickable");
|
|
2230
|
-
return array;
|
|
2231
|
-
});
|
|
2232
2255
|
const slotOptions = Object.freeze({
|
|
2233
2256
|
node: __props.node,
|
|
2234
2257
|
parent: __props.parent,
|
|
@@ -2239,7 +2262,9 @@ var _sfc_main$4 = defineComponent({
|
|
|
2239
2262
|
const statusRef = shallowRef("expand");
|
|
2240
2263
|
const nextLevel = __props.level + 1;
|
|
2241
2264
|
const childrenDom = useTemplateRef("children");
|
|
2265
|
+
var nodeEmitsDisabled = false;
|
|
2242
2266
|
function toggleFold() {
|
|
2267
|
+
nodeEmitsDisabled = true;
|
|
2243
2268
|
switch (statusRef.value) {
|
|
2244
2269
|
case "expand":
|
|
2245
2270
|
statusRef.value = "fold";
|
|
@@ -2253,7 +2278,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
2253
2278
|
const maxHeight = childrenDom.value.scrollHeight;
|
|
2254
2279
|
transition(childrenDom.value, {
|
|
2255
2280
|
from: {
|
|
2256
|
-
transition:
|
|
2281
|
+
transition: `height 0.2s ease`,
|
|
2257
2282
|
overflow: "hidden",
|
|
2258
2283
|
height: `${statusRef.value == "fold" ? maxHeight : minHeight}px`
|
|
2259
2284
|
},
|
|
@@ -2268,7 +2293,10 @@ var _sfc_main$4 = defineComponent({
|
|
|
2268
2293
|
}
|
|
2269
2294
|
}
|
|
2270
2295
|
function onNodeClick(node) {
|
|
2271
|
-
node.clickable == true &&
|
|
2296
|
+
if (node.clickable == true && nodeEmitsDisabled != true) {
|
|
2297
|
+
emits("click", node, __props.parent ? [__props.parent] : void 0);
|
|
2298
|
+
}
|
|
2299
|
+
nodeEmitsDisabled = false;
|
|
2272
2300
|
}
|
|
2273
2301
|
function onNodeDoubleClick() {
|
|
2274
2302
|
__props.options.foldDisabled != true && toggleFold();
|
|
@@ -2277,17 +2305,36 @@ var _sfc_main$4 = defineComponent({
|
|
|
2277
2305
|
parents = __props.parent ? [__props.parent, ...parents] : parents;
|
|
2278
2306
|
emits("click", child, parents);
|
|
2279
2307
|
}
|
|
2308
|
+
watcher(isHoveredRef, newValue => {
|
|
2309
|
+
treeNodeDom.value.classList.remove("hovered");
|
|
2310
|
+
newValue && treeNodeDom.value.classList.add("hovered");
|
|
2311
|
+
});
|
|
2312
|
+
watcher(() => __props.context.isActived(__props.node), newValue => {
|
|
2313
|
+
treeNodeDom.value.classList.remove("actived");
|
|
2314
|
+
newValue && treeNodeDom.value.classList.add("actived");
|
|
2315
|
+
});
|
|
2316
|
+
onMounted(() => {
|
|
2317
|
+
if (childrenDom.value) {
|
|
2318
|
+
__props.options.expandLevel != void 0 && __props.options.expandLevel < nextLevel && toggleFold();
|
|
2319
|
+
childrenDom.value && childrenDom.value.classList.remove("hidden");
|
|
2320
|
+
nodeEmitsDisabled = false;
|
|
2321
|
+
}
|
|
2322
|
+
});
|
|
2280
2323
|
return (_ctx, _cache) => {
|
|
2281
2324
|
const _component_TreeNode = resolveComponent("TreeNode", true);
|
|
2282
2325
|
return openBlock(), createElementBlock(Fragment, null, [showRef.value ? (openBlock(), createElementBlock("div", {
|
|
2283
2326
|
key: 0,
|
|
2284
|
-
class: normalizeClass(["snail-tree-node",
|
|
2327
|
+
class: normalizeClass(["snail-tree-node", _ctx.node.clickable ? "clickable" : "", `level-${_ctx.level}`]),
|
|
2328
|
+
ref: "tree-node",
|
|
2329
|
+
onMouseenter: _cache[0] || (_cache[0] = $event => isHoveredRef.value = true),
|
|
2330
|
+
onMouseleave: _cache[1] || (_cache[1] = $event => isHoveredRef.value = false),
|
|
2331
|
+
onClick: _cache[2] || (_cache[2] = $event => onNodeClick(_ctx.node)),
|
|
2285
2332
|
onDblclick: onNodeDoubleClick
|
|
2286
2333
|
}, [_ctx.options.rewrite == true ? renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({
|
|
2287
2334
|
key: 0
|
|
2288
2335
|
}, unref(slotOptions)))) : (openBlock(), createElementBlock(Fragment, {
|
|
2289
2336
|
key: 1
|
|
2290
|
-
}, [_cache[
|
|
2337
|
+
}, [_cache[4] || (_cache[4] = createElementVNode("div", {
|
|
2291
2338
|
class: "indent"
|
|
2292
2339
|
}, null, -1)), _ctx.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$s, {
|
|
2293
2340
|
key: 0,
|
|
@@ -2300,8 +2347,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
2300
2347
|
}, null, 8, ["class"])) : createCommentVNode("", true)])) : createCommentVNode("", true), createElementVNode("div", {
|
|
2301
2348
|
class: "node-text",
|
|
2302
2349
|
title: _ctx.node.text,
|
|
2303
|
-
textContent: toDisplayString(_ctx.node.text)
|
|
2304
|
-
onClick: _cache[0] || (_cache[0] = $event => onNodeClick(_ctx.node))
|
|
2350
|
+
textContent: toDisplayString(_ctx.node.text)
|
|
2305
2351
|
}, null, 8, _hoisted_2$1), createElementVNode("div", _hoisted_3$1, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34)) : createCommentVNode("", true), showRef.value && showChildrenRef.value ? (openBlock(), createElementBlock("div", _hoisted_4$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.node.children, child => {
|
|
2306
2352
|
return openBlock(), createBlock(_component_TreeNode, {
|
|
2307
2353
|
key: child.id || unref(newId)(),
|
|
@@ -2310,7 +2356,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
2310
2356
|
level: nextLevel,
|
|
2311
2357
|
options: _ctx.options,
|
|
2312
2358
|
context: _ctx.context,
|
|
2313
|
-
onClick: _cache[
|
|
2359
|
+
onClick: _cache[3] || (_cache[3] = (node, parents) => onChildNodeClick(node, parents))
|
|
2314
2360
|
}, {
|
|
2315
2361
|
default: withCtx(slotProps => [renderSlot(_ctx.$slots, "default", mergeProps({
|
|
2316
2362
|
ref_for: true
|
|
@@ -2344,14 +2390,20 @@ var _sfc_main$3 = defineComponent({
|
|
|
2344
2390
|
} = _ref;
|
|
2345
2391
|
const props = __props;
|
|
2346
2392
|
const emits = __emit;
|
|
2347
|
-
const
|
|
2393
|
+
const activedNodeRef = shallowRef(void 0);
|
|
2394
|
+
const context = useTreeContext(props.nodes, activedNodeRef);
|
|
2348
2395
|
__expose({
|
|
2349
|
-
context
|
|
2396
|
+
context,
|
|
2397
|
+
onTreeNodeClick
|
|
2350
2398
|
});
|
|
2351
2399
|
function onSearch(text) {
|
|
2352
2400
|
context.doSearch(text);
|
|
2353
2401
|
emits("searched", text);
|
|
2354
2402
|
}
|
|
2403
|
+
function onTreeNodeClick(node, parents) {
|
|
2404
|
+
activedNodeRef.value = node;
|
|
2405
|
+
emits("click", node, parents);
|
|
2406
|
+
}
|
|
2355
2407
|
return (_ctx, _cache) => {
|
|
2356
2408
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [props.search ? (openBlock(), createBlock(_sfc_main$o, mergeProps({
|
|
2357
2409
|
key: 0
|
|
@@ -2368,13 +2420,13 @@ var _sfc_main$3 = defineComponent({
|
|
|
2368
2420
|
level: 1,
|
|
2369
2421
|
options: props.nodeOptions,
|
|
2370
2422
|
context: unref(context),
|
|
2371
|
-
onClick:
|
|
2423
|
+
onClick: onTreeNodeClick
|
|
2372
2424
|
}, {
|
|
2373
2425
|
default: withCtx(slotProps => [renderSlot(_ctx.$slots, "default", mergeProps({
|
|
2374
2426
|
ref_for: true
|
|
2375
2427
|
}, slotProps))]),
|
|
2376
2428
|
_: 2
|
|
2377
|
-
}, 1032, ["node", "options", "context"
|
|
2429
|
+
}, 1032, ["node", "options", "context"]);
|
|
2378
2430
|
}), 128))]),
|
|
2379
2431
|
_: 3
|
|
2380
2432
|
})]);
|
package/dist/snail.vue.umd.js
CHANGED
|
@@ -879,7 +879,8 @@
|
|
|
879
879
|
const {
|
|
880
880
|
onClient,
|
|
881
881
|
onSize,
|
|
882
|
-
onEvent
|
|
882
|
+
onEvent,
|
|
883
|
+
onMutation
|
|
883
884
|
} = snail_view.useObserver();
|
|
884
885
|
const {
|
|
885
886
|
onTimeout
|
|
@@ -961,6 +962,11 @@
|
|
|
961
962
|
onEvent(window, "resize", () => __props.options.closeOnResize ? closePopup(void 0) : rootDom.value && buildFollow());
|
|
962
963
|
onEvent(window, "keyup", evet => __props.options.closeOnEscape && evet.key === "Escape" && followExt.pinned.value != true && closePopup(void 0));
|
|
963
964
|
onEvent(window, "click", event => __props.options.closeOnMask && rootDom.value != event.target && rootDom.value.contains(event.target) == false && followExt.pinned.value != true && closePopup(void 0));
|
|
965
|
+
onMutation(rootDom.value, {
|
|
966
|
+
childList: true,
|
|
967
|
+
attributes: false,
|
|
968
|
+
subtree: true
|
|
969
|
+
}, buildFollow);
|
|
964
970
|
}, 100);
|
|
965
971
|
});
|
|
966
972
|
});
|
|
@@ -1153,7 +1159,7 @@
|
|
|
1153
1159
|
});
|
|
1154
1160
|
}
|
|
1155
1161
|
function toast(type, message, options) {
|
|
1156
|
-
popupInCustomContainer(_sfc_main$h, {
|
|
1162
|
+
return popupInCustomContainer(_sfc_main$h, {
|
|
1157
1163
|
url: "#ToastContainer",
|
|
1158
1164
|
props: {
|
|
1159
1165
|
...(options || Object.create(null)),
|
|
@@ -1476,7 +1482,7 @@
|
|
|
1476
1482
|
}
|
|
1477
1483
|
});
|
|
1478
1484
|
|
|
1479
|
-
function useTreeContext(nodes) {
|
|
1485
|
+
function useTreeContext(nodes, activeNodeRef) {
|
|
1480
1486
|
const failed = vue.shallowRef();
|
|
1481
1487
|
const patched = vue.shallowRef();
|
|
1482
1488
|
function doSearch(text) {
|
|
@@ -1485,6 +1491,9 @@
|
|
|
1485
1491
|
failed.value = result.failed;
|
|
1486
1492
|
patched.value = result.patched;
|
|
1487
1493
|
}
|
|
1494
|
+
function isActived(node) {
|
|
1495
|
+
return activeNodeRef && activeNodeRef.value == node;
|
|
1496
|
+
}
|
|
1488
1497
|
function isPatched(node) {
|
|
1489
1498
|
return patched.value ? patched.value.includes(node) : false;
|
|
1490
1499
|
}
|
|
@@ -1505,6 +1514,7 @@
|
|
|
1505
1514
|
}
|
|
1506
1515
|
const context = snail_core.mountScope({
|
|
1507
1516
|
doSearch,
|
|
1517
|
+
isActived,
|
|
1508
1518
|
isPatched,
|
|
1509
1519
|
isShow,
|
|
1510
1520
|
isShowChildren,
|
|
@@ -1886,6 +1896,7 @@
|
|
|
1886
1896
|
emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
|
|
1887
1897
|
setup(__props, _ref) {
|
|
1888
1898
|
let {
|
|
1899
|
+
expose: __expose,
|
|
1889
1900
|
emit: __emit
|
|
1890
1901
|
} = _ref;
|
|
1891
1902
|
const props = __props;
|
|
@@ -1902,6 +1913,18 @@
|
|
|
1902
1913
|
"scroll-y": props.scrollY == true
|
|
1903
1914
|
}));
|
|
1904
1915
|
var preStatus = void 0;
|
|
1916
|
+
__expose({
|
|
1917
|
+
scroll,
|
|
1918
|
+
scrollTo
|
|
1919
|
+
});
|
|
1920
|
+
function scroll(left, top) {
|
|
1921
|
+
left == void 0 || (rootDom.value.scrollLeft += left);
|
|
1922
|
+
top == void 0 || (rootDom.value.scrollTop += top);
|
|
1923
|
+
}
|
|
1924
|
+
function scrollTo(left, top) {
|
|
1925
|
+
left == void 0 || (rootDom.value.scrollLeft = left);
|
|
1926
|
+
top == void 0 || (rootDom.value.scrollTop = top);
|
|
1927
|
+
}
|
|
1905
1928
|
function refreshScrollInfo() {
|
|
1906
1929
|
const status = {
|
|
1907
1930
|
xbar: rootDom.value.scrollWidth > rootDom.value.clientWidth,
|
|
@@ -1986,7 +2009,7 @@
|
|
|
1986
2009
|
}, props.scroll), {
|
|
1987
2010
|
default: vue.withCtx(() => [vue.renderSlot(_ctx.$slots, "default")]),
|
|
1988
2011
|
_: 3
|
|
1989
|
-
}, 16), _ctx.$slots.end ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [vue.renderSlot(_ctx.$slots, "end")])) : vue.createCommentVNode("", true)
|
|
2012
|
+
}, 16), _ctx.$slots.end ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [vue.renderSlot(_ctx.$slots, "end")])) : vue.createCommentVNode("", true)], 2);
|
|
1990
2013
|
};
|
|
1991
2014
|
}
|
|
1992
2015
|
});
|
|
@@ -2196,7 +2219,7 @@
|
|
|
2196
2219
|
};
|
|
2197
2220
|
const _hoisted_4$1 = {
|
|
2198
2221
|
key: 1,
|
|
2199
|
-
class: "snail-tree-children",
|
|
2222
|
+
class: "snail-tree-children hidden",
|
|
2200
2223
|
ref: "children"
|
|
2201
2224
|
};
|
|
2202
2225
|
var _sfc_main$4 = vue.defineComponent({
|
|
@@ -2224,13 +2247,13 @@
|
|
|
2224
2247
|
const {
|
|
2225
2248
|
transition
|
|
2226
2249
|
} = snail_view.useAnimation();
|
|
2250
|
+
const {
|
|
2251
|
+
watcher
|
|
2252
|
+
} = useReactive();
|
|
2253
|
+
const treeNodeDom = vue.useTemplateRef("tree-node");
|
|
2254
|
+
const isHoveredRef = vue.shallowRef(false);
|
|
2227
2255
|
const showRef = vue.computed(() => __props.context.isShow(__props.node, true));
|
|
2228
2256
|
const showChildrenRef = vue.computed(() => __props.context.isShowChildren(__props.node, true));
|
|
2229
|
-
const classRef = vue.computed(() => {
|
|
2230
|
-
const array = [`level-${__props.level}`];
|
|
2231
|
-
__props.node.clickable && array.push("clickable");
|
|
2232
|
-
return array;
|
|
2233
|
-
});
|
|
2234
2257
|
const slotOptions = Object.freeze({
|
|
2235
2258
|
node: __props.node,
|
|
2236
2259
|
parent: __props.parent,
|
|
@@ -2241,7 +2264,9 @@
|
|
|
2241
2264
|
const statusRef = vue.shallowRef("expand");
|
|
2242
2265
|
const nextLevel = __props.level + 1;
|
|
2243
2266
|
const childrenDom = vue.useTemplateRef("children");
|
|
2267
|
+
var nodeEmitsDisabled = false;
|
|
2244
2268
|
function toggleFold() {
|
|
2269
|
+
nodeEmitsDisabled = true;
|
|
2245
2270
|
switch (statusRef.value) {
|
|
2246
2271
|
case "expand":
|
|
2247
2272
|
statusRef.value = "fold";
|
|
@@ -2255,7 +2280,7 @@
|
|
|
2255
2280
|
const maxHeight = childrenDom.value.scrollHeight;
|
|
2256
2281
|
transition(childrenDom.value, {
|
|
2257
2282
|
from: {
|
|
2258
|
-
transition:
|
|
2283
|
+
transition: `height 0.2s ease`,
|
|
2259
2284
|
overflow: "hidden",
|
|
2260
2285
|
height: `${statusRef.value == "fold" ? maxHeight : minHeight}px`
|
|
2261
2286
|
},
|
|
@@ -2270,7 +2295,10 @@
|
|
|
2270
2295
|
}
|
|
2271
2296
|
}
|
|
2272
2297
|
function onNodeClick(node) {
|
|
2273
|
-
node.clickable == true &&
|
|
2298
|
+
if (node.clickable == true && nodeEmitsDisabled != true) {
|
|
2299
|
+
emits("click", node, __props.parent ? [__props.parent] : void 0);
|
|
2300
|
+
}
|
|
2301
|
+
nodeEmitsDisabled = false;
|
|
2274
2302
|
}
|
|
2275
2303
|
function onNodeDoubleClick() {
|
|
2276
2304
|
__props.options.foldDisabled != true && toggleFold();
|
|
@@ -2279,17 +2307,36 @@
|
|
|
2279
2307
|
parents = __props.parent ? [__props.parent, ...parents] : parents;
|
|
2280
2308
|
emits("click", child, parents);
|
|
2281
2309
|
}
|
|
2310
|
+
watcher(isHoveredRef, newValue => {
|
|
2311
|
+
treeNodeDom.value.classList.remove("hovered");
|
|
2312
|
+
newValue && treeNodeDom.value.classList.add("hovered");
|
|
2313
|
+
});
|
|
2314
|
+
watcher(() => __props.context.isActived(__props.node), newValue => {
|
|
2315
|
+
treeNodeDom.value.classList.remove("actived");
|
|
2316
|
+
newValue && treeNodeDom.value.classList.add("actived");
|
|
2317
|
+
});
|
|
2318
|
+
vue.onMounted(() => {
|
|
2319
|
+
if (childrenDom.value) {
|
|
2320
|
+
__props.options.expandLevel != void 0 && __props.options.expandLevel < nextLevel && toggleFold();
|
|
2321
|
+
childrenDom.value && childrenDom.value.classList.remove("hidden");
|
|
2322
|
+
nodeEmitsDisabled = false;
|
|
2323
|
+
}
|
|
2324
|
+
});
|
|
2282
2325
|
return (_ctx, _cache) => {
|
|
2283
2326
|
const _component_TreeNode = vue.resolveComponent("TreeNode", true);
|
|
2284
2327
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [showRef.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
2285
2328
|
key: 0,
|
|
2286
|
-
class: vue.normalizeClass(["snail-tree-node",
|
|
2329
|
+
class: vue.normalizeClass(["snail-tree-node", _ctx.node.clickable ? "clickable" : "", `level-${_ctx.level}`]),
|
|
2330
|
+
ref: "tree-node",
|
|
2331
|
+
onMouseenter: _cache[0] || (_cache[0] = $event => isHoveredRef.value = true),
|
|
2332
|
+
onMouseleave: _cache[1] || (_cache[1] = $event => isHoveredRef.value = false),
|
|
2333
|
+
onClick: _cache[2] || (_cache[2] = $event => onNodeClick(_ctx.node)),
|
|
2287
2334
|
onDblclick: onNodeDoubleClick
|
|
2288
2335
|
}, [_ctx.options.rewrite == true ? vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.mergeProps({
|
|
2289
2336
|
key: 0
|
|
2290
2337
|
}, vue.unref(slotOptions)))) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
2291
2338
|
key: 1
|
|
2292
|
-
}, [_cache[
|
|
2339
|
+
}, [_cache[4] || (_cache[4] = vue.createElementVNode("div", {
|
|
2293
2340
|
class: "indent"
|
|
2294
2341
|
}, null, -1)), _ctx.options.foldDisabled != true ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [showChildrenRef.value ? (vue.openBlock(), vue.createBlock(_sfc_main$s, {
|
|
2295
2342
|
key: 0,
|
|
@@ -2302,8 +2349,7 @@
|
|
|
2302
2349
|
}, null, 8, ["class"])) : vue.createCommentVNode("", true)])) : vue.createCommentVNode("", true), vue.createElementVNode("div", {
|
|
2303
2350
|
class: "node-text",
|
|
2304
2351
|
title: _ctx.node.text,
|
|
2305
|
-
textContent: vue.toDisplayString(_ctx.node.text)
|
|
2306
|
-
onClick: _cache[0] || (_cache[0] = $event => onNodeClick(_ctx.node))
|
|
2352
|
+
textContent: vue.toDisplayString(_ctx.node.text)
|
|
2307
2353
|
}, null, 8, _hoisted_2$1), vue.createElementVNode("div", _hoisted_3$1, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))))])], 64))], 34)) : vue.createCommentVNode("", true), showRef.value && showChildrenRef.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.node.children, child => {
|
|
2308
2354
|
return vue.openBlock(), vue.createBlock(_component_TreeNode, {
|
|
2309
2355
|
key: child.id || vue.unref(snail_core.newId)(),
|
|
@@ -2312,7 +2358,7 @@
|
|
|
2312
2358
|
level: nextLevel,
|
|
2313
2359
|
options: _ctx.options,
|
|
2314
2360
|
context: _ctx.context,
|
|
2315
|
-
onClick: _cache[
|
|
2361
|
+
onClick: _cache[3] || (_cache[3] = (node, parents) => onChildNodeClick(node, parents))
|
|
2316
2362
|
}, {
|
|
2317
2363
|
default: vue.withCtx(slotProps => [vue.renderSlot(_ctx.$slots, "default", vue.mergeProps({
|
|
2318
2364
|
ref_for: true
|
|
@@ -2346,14 +2392,20 @@
|
|
|
2346
2392
|
} = _ref;
|
|
2347
2393
|
const props = __props;
|
|
2348
2394
|
const emits = __emit;
|
|
2349
|
-
const
|
|
2395
|
+
const activedNodeRef = vue.shallowRef(void 0);
|
|
2396
|
+
const context = useTreeContext(props.nodes, activedNodeRef);
|
|
2350
2397
|
__expose({
|
|
2351
|
-
context
|
|
2398
|
+
context,
|
|
2399
|
+
onTreeNodeClick
|
|
2352
2400
|
});
|
|
2353
2401
|
function onSearch(text) {
|
|
2354
2402
|
context.doSearch(text);
|
|
2355
2403
|
emits("searched", text);
|
|
2356
2404
|
}
|
|
2405
|
+
function onTreeNodeClick(node, parents) {
|
|
2406
|
+
activedNodeRef.value = node;
|
|
2407
|
+
emits("click", node, parents);
|
|
2408
|
+
}
|
|
2357
2409
|
return (_ctx, _cache) => {
|
|
2358
2410
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$o, vue.mergeProps({
|
|
2359
2411
|
key: 0
|
|
@@ -2370,13 +2422,13 @@
|
|
|
2370
2422
|
level: 1,
|
|
2371
2423
|
options: props.nodeOptions,
|
|
2372
2424
|
context: vue.unref(context),
|
|
2373
|
-
onClick:
|
|
2425
|
+
onClick: onTreeNodeClick
|
|
2374
2426
|
}, {
|
|
2375
2427
|
default: vue.withCtx(slotProps => [vue.renderSlot(_ctx.$slots, "default", vue.mergeProps({
|
|
2376
2428
|
ref_for: true
|
|
2377
2429
|
}, slotProps))]),
|
|
2378
2430
|
_: 2
|
|
2379
|
-
}, 1032, ["node", "options", "context"
|
|
2431
|
+
}, 1032, ["node", "options", "context"]);
|
|
2380
2432
|
}), 128))]),
|
|
2381
2433
|
_: 3
|
|
2382
2434
|
})]);
|
|
@@ -2,12 +2,14 @@
|
|
|
2
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
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;height:16px;justify-content:center;overflow:hidden;width:16px}.snail-choose>div.choose-item>div.item-beautiful.radio{border-radius:50%}.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}
|
|
7
5
|
/* src:base\icon.vue index:0 */
|
|
8
6
|
.snail-icon{cursor:pointer;opacity:1}
|
|
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\footer.vue index:0 */
|
|
10
10
|
.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}
|
|
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
13
|
/* src:base\select.vue index:0 */
|
|
12
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 */
|
|
@@ -16,45 +18,43 @@
|
|
|
16
18
|
.snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
|
|
17
19
|
/* src:container\fold.vue index:0 */
|
|
18
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)}
|
|
19
|
-
/* src:container\layout.vue index:0 */
|
|
20
|
-
.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}
|
|
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:
|
|
24
|
-
.snail-
|
|
25
|
-
/* src:container\table.vue index:0 */
|
|
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}
|
|
23
|
+
/* src:container\layout.vue index:0 */
|
|
24
|
+
.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}
|
|
27
25
|
/* src:container\sort.vue index:0 */
|
|
28
26
|
.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
|
-
/* src:container\
|
|
30
|
-
.snail-
|
|
27
|
+
/* src:container\table.vue index:0 */
|
|
28
|
+
.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}
|
|
31
29
|
/* src:container\components\table-row.vue index:0 */
|
|
32
30
|
.table-row{align-items:center;display:flex}
|
|
33
31
|
/* src:container\components\table-col.vue index:0 */
|
|
34
32
|
.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}
|
|
33
|
+
/* src:container\tree.vue index:0 */
|
|
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}
|
|
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
|
+
/* src:prompt\empty.vue index:0 */
|
|
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}
|
|
37
39
|
/* src:prompt\drag-verify.vue index:0 */
|
|
38
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}}
|
|
39
41
|
/* src:form\input.vue index:0 */
|
|
40
42
|
.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}
|
|
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
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 .
|
|
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
|
-
/* src:popup\components\popup-container.vue index:0 */
|
|
48
|
-
.snail-popup{left:0;position:fixed;top:0}
|
|
49
47
|
/* src:popup\components\dialog-container.vue index:0 */
|
|
50
48
|
.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)}
|
|
51
|
-
/* src:popup\components\toast-container.vue index:0 */
|
|
52
|
-
.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;padding:2px}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
53
49
|
/* src:popup\components\follow-container.vue index:0 */
|
|
54
50
|
.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}.snail-follow.initial{top:100%;transition:none}
|
|
55
|
-
/* src:
|
|
56
|
-
.snail-
|
|
51
|
+
/* src:popup\components\popup-container.vue index:0 */
|
|
52
|
+
.snail-popup{left:0;position:fixed;top:0}
|
|
53
|
+
/* src:popup\components\toast-container.vue index:0 */
|
|
54
|
+
.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;padding:2px}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
57
55
|
/* src:base\components\select-popup.vue index:0 */
|
|
58
56
|
.snail-select-popup{background:#fff;border:1px solid #dddfed;border-radius:4px;box-shadow:0 1px 5px 1px #dddfed;display:flex;flex-direction:column;max-height:90%;min-height:32px;overflow:auto}.snail-select-popup>div.snail-search{margin:12px}.snail-select-popup.child-popup{max-width:250px;min-width:200px;padding-bottom:6px;padding-top:6px}.snail-select-popup.child-popup.text-tips{justify-content:center;padding:0 12px;width:100px!important}
|
|
57
|
+
/* src:container\components\tree-node.vue index:0 */
|
|
58
|
+
.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{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-tree-children{width:100%}.snail-tree-children.hidden{display:none;height:0;overflow:hidden}.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}
|
|
59
59
|
/* src:base\components\select-node.vue index:0 */
|
|
60
60
|
.snail-select-popup>div.select-node{align-items:center;display:flex;flex-shrink:0;flex-wrap:nowrap;height:32px;padding-left:12px}.snail-select-popup>div.select-node:hover{background:#f8f9fa}.snail-select-popup>div.select-node.clickable{cursor:pointer}.snail-select-popup>div.select-node.group{color:#8a9099}.snail-select-popup>div.select-node.item{color:#2e3033;padding-right:10px}.snail-select-popup>div.select-node.selected{color:#4c9aff!important}.snail-select-popup>div.select-node>div.item-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-select-popup>div.select-node>svg.snail-icon{cursor:default;display:none}.snail-select-popup>div.select-node.child{color:#2e3033;padding-left:24px}.snail-select-popup>div.select-node.child>svg.snail-icon{display:initial}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "依赖【snail】,基于vue封装常用UI组件",
|
|
4
4
|
"author": "snail_dev@163.com",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.48",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/snail.vue.js",
|
|
9
9
|
"module": "dist/snail.vue.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"vue": "^3.5.14",
|
|
17
17
|
"snail.core": ">=2.0.13",
|
|
18
|
-
"snail.view": ">=1.0.
|
|
18
|
+
"snail.view": ">=1.0.23",
|
|
19
19
|
"sortablejs": ">=1.15.6"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|