snail.vue 1.0.38 → 1.0.40
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 +131 -40
- package/dist/snail.vue.js +105 -45
- package/dist/snail.vue.umd.js +104 -44
- package/dist/styles/app.css +1 -1
- package/dist/styles/snail.vue.vue.css +19 -19
- package/package.json +3 -3
package/dist/snail.vue.d.ts
CHANGED
|
@@ -166,28 +166,6 @@ type DragVerifyInfo = {
|
|
|
166
166
|
distance: number;
|
|
167
167
|
};
|
|
168
168
|
|
|
169
|
-
/**
|
|
170
|
-
* 搜索组件配置选项
|
|
171
|
-
*/
|
|
172
|
-
type SearchOptions = ReadonlyOptions & PlaceholderOptions & {
|
|
173
|
-
/**
|
|
174
|
-
* 启用【自动完成】
|
|
175
|
-
* - true 时,只要文本变化了,就触发 search 事件
|
|
176
|
-
* - false 时,只有点击【搜索】按钮,才触发 search 事件
|
|
177
|
-
*/
|
|
178
|
-
autoComplete?: boolean;
|
|
179
|
-
};
|
|
180
|
-
/**
|
|
181
|
-
* 搜索组件事件
|
|
182
|
-
*/
|
|
183
|
-
type SearchEvents = {
|
|
184
|
-
/**
|
|
185
|
-
* 事件:执行搜索
|
|
186
|
-
* @param value 为搜索文本
|
|
187
|
-
*/
|
|
188
|
-
search: [value: string];
|
|
189
|
-
};
|
|
190
|
-
|
|
191
169
|
/**
|
|
192
170
|
* 树形 数据相关的基础实体结构
|
|
193
171
|
* 1、封装一些基础实体;如树形节点数据结构
|
|
@@ -221,7 +199,7 @@ type TreeNodeExtend = {
|
|
|
221
199
|
* 节点Id,确保唯一
|
|
222
200
|
* - 不传入则内部自动 newId()
|
|
223
201
|
*/
|
|
224
|
-
id?: string;
|
|
202
|
+
readonly id?: string;
|
|
225
203
|
/**
|
|
226
204
|
* 是否可点击
|
|
227
205
|
* - true 此节点可点击,点击时触发 click 事件
|
|
@@ -255,18 +233,33 @@ interface ITreeBaseContext<T> {
|
|
|
255
233
|
*/
|
|
256
234
|
doSearch(text: string): void;
|
|
257
235
|
/**
|
|
258
|
-
*
|
|
236
|
+
* 是否是【补丁】节点
|
|
237
|
+
* - 子节点搜索命中时,父级路径上节点没命中,则作父级路径节点作为路径修补节点存在,避免命中子节点展示不出来
|
|
259
238
|
* @param node 要判断的节点
|
|
239
|
+
* @returns true 是补丁节点,false 不是补丁节点
|
|
240
|
+
*/
|
|
241
|
+
isPatched(node: TreeNode<T>): boolean;
|
|
242
|
+
/**
|
|
243
|
+
* 是否显示【树节点】
|
|
244
|
+
* @param node 要判断的节点
|
|
245
|
+
* @param needPatched 是否需要【补丁】节点。true时(补丁节点始终显示);false时(根据hidden和搜索结果判断)
|
|
260
246
|
* @returns 能显示返回true;否则返回false
|
|
261
247
|
*/
|
|
262
|
-
|
|
248
|
+
isShow(node: TreeNode<T, TreeNodeExtend>, needPatched: boolean): boolean;
|
|
263
249
|
/**
|
|
264
|
-
*
|
|
250
|
+
* 是否显示指定【树节点】的子节点
|
|
265
251
|
* - 不会判断node节点自身是否可显示
|
|
266
252
|
* @param node 要判断的节点
|
|
253
|
+
* @param needPatched 是否需要【补丁】节点。true时(补丁节点始终显示);false时(根据hidden和搜索结果判断)
|
|
267
254
|
* @returns 能显示返回true;否则返回false
|
|
268
255
|
*/
|
|
269
|
-
|
|
256
|
+
isShowChildren(node: TreeNode<T, TreeNodeExtend>, needPatched: boolean): boolean;
|
|
257
|
+
/**
|
|
258
|
+
* 获取指定【树节点】的路径
|
|
259
|
+
* @param node 树节点
|
|
260
|
+
* @returns 从【顶级节点】->【指定节点】的全路径数据
|
|
261
|
+
*/
|
|
262
|
+
getPath(node: TreeNode<T, TreeNodeExtend>): TreeNode<T, TreeNodeExtend>[];
|
|
270
263
|
}
|
|
271
264
|
/**
|
|
272
265
|
* 树搜索结果
|
|
@@ -280,6 +273,34 @@ type TreeSearchResult<T> = {
|
|
|
280
273
|
* 未匹配上的节点集合
|
|
281
274
|
*/
|
|
282
275
|
failed: TreeNode<T>[];
|
|
276
|
+
/**
|
|
277
|
+
* 搜索时的【补丁】节点集合
|
|
278
|
+
* - 子节点搜索命中时,父级路径上节点没命中,则作父级路径节点作为路径修补节点存在,避免命中子节点展示不出来
|
|
279
|
+
* - 仅在有搜索条件时成立,补丁节点同时在【failed】节点集合中
|
|
280
|
+
*/
|
|
281
|
+
patched: TreeNode<T>[];
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* 搜索组件配置选项
|
|
286
|
+
*/
|
|
287
|
+
type SearchOptions = ReadonlyOptions & PlaceholderOptions & {
|
|
288
|
+
/**
|
|
289
|
+
* 启用【自动完成】
|
|
290
|
+
* - true 时,只要文本变化了,就触发 search 事件
|
|
291
|
+
* - false 时,只有点击【搜索】按钮,才触发 search 事件
|
|
292
|
+
*/
|
|
293
|
+
autoComplete?: boolean;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* 搜索组件事件
|
|
297
|
+
*/
|
|
298
|
+
type SearchEvents = {
|
|
299
|
+
/**
|
|
300
|
+
* 事件:执行搜索
|
|
301
|
+
* @param value 为搜索文本
|
|
302
|
+
*/
|
|
303
|
+
search: [value: string];
|
|
283
304
|
};
|
|
284
305
|
|
|
285
306
|
/**
|
|
@@ -308,7 +329,13 @@ type TreeOptions<T> = {
|
|
|
308
329
|
/**
|
|
309
330
|
* 树组件事件
|
|
310
331
|
*/
|
|
311
|
-
type TreeEvents<T> = TreeNodeEvents<T> & {
|
|
332
|
+
type TreeEvents<T> = TreeNodeEvents<T> & {
|
|
333
|
+
/**
|
|
334
|
+
* 搜索完成后
|
|
335
|
+
* @param text 搜索文本
|
|
336
|
+
*/
|
|
337
|
+
(el: "searched", text: string): any;
|
|
338
|
+
};
|
|
312
339
|
/**
|
|
313
340
|
* 树节点 组件配置选项
|
|
314
341
|
*/
|
|
@@ -593,6 +620,23 @@ type SelectOptions<T> = ReadonlyOptions & PlaceholderOptions & SelectBaseOptions
|
|
|
593
620
|
* 选项菜单 组件 事件
|
|
594
621
|
*/
|
|
595
622
|
type SelectEvents<T> = SelectBaseEvents<T> & {};
|
|
623
|
+
/**
|
|
624
|
+
* 选项菜单 组件的Slot配置选项
|
|
625
|
+
*/
|
|
626
|
+
type SelectSlotOptions<T> = {
|
|
627
|
+
/**
|
|
628
|
+
* 关闭Follow弹窗
|
|
629
|
+
* - 将隐藏已弹出的选项 follow 弹窗
|
|
630
|
+
* @returns 已弹出则销毁成功返回true;未弹出则销毁失败返回false
|
|
631
|
+
*/
|
|
632
|
+
closeFollow(): boolean;
|
|
633
|
+
/**
|
|
634
|
+
* 停止事件冒泡
|
|
635
|
+
* - 解决问题:插槽内元素需要处理自定义click事件,此时不希望Select组件响应click事件
|
|
636
|
+
* @param delay 在此延迟时间内,停止事件冒泡
|
|
637
|
+
*/
|
|
638
|
+
stopPropagation(delay: number): any;
|
|
639
|
+
};
|
|
596
640
|
/**
|
|
597
641
|
* 【选项菜单】 组件上下文
|
|
598
642
|
*/
|
|
@@ -1596,17 +1640,47 @@ declare const components: {
|
|
|
1596
1640
|
onSearch?: (value: string) => any;
|
|
1597
1641
|
"onUpdate:modelValue"?: (value: string) => any;
|
|
1598
1642
|
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1599
|
-
Select:
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1643
|
+
Select: {
|
|
1644
|
+
new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
|
|
1645
|
+
modelValue?: SelectItem<any>[];
|
|
1646
|
+
}> & Readonly<{
|
|
1647
|
+
onChange?: (values: SelectItem<any>[]) => any;
|
|
1648
|
+
"onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
|
|
1649
|
+
}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
1650
|
+
change: (values: SelectItem<any>[]) => any;
|
|
1651
|
+
"update:modelValue": (value: SelectItem<any>[]) => any;
|
|
1652
|
+
}, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
1653
|
+
P: {};
|
|
1654
|
+
B: {};
|
|
1655
|
+
D: {};
|
|
1656
|
+
C: {};
|
|
1657
|
+
M: {};
|
|
1658
|
+
Defaults: {};
|
|
1659
|
+
}, Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
|
|
1660
|
+
modelValue?: SelectItem<any>[];
|
|
1661
|
+
}> & Readonly<{
|
|
1662
|
+
onChange?: (values: SelectItem<any>[]) => any;
|
|
1663
|
+
"onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
|
|
1664
|
+
}>, {}, {}, {}, {}, {}>;
|
|
1665
|
+
__isFragment?: never;
|
|
1666
|
+
__isTeleport?: never;
|
|
1667
|
+
__isSuspense?: never;
|
|
1668
|
+
} & vue.ComponentOptionsBase<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
|
|
1605
1669
|
modelValue?: SelectItem<any>[];
|
|
1606
1670
|
}> & Readonly<{
|
|
1607
1671
|
onChange?: (values: SelectItem<any>[]) => any;
|
|
1608
1672
|
"onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
|
|
1609
|
-
}>, {}, {}, {}, {},
|
|
1673
|
+
}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
1674
|
+
change: (values: SelectItem<any>[]) => any;
|
|
1675
|
+
"update:modelValue": (value: SelectItem<any>[]) => any;
|
|
1676
|
+
}, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1677
|
+
$slots: {
|
|
1678
|
+
default?: (props: {
|
|
1679
|
+
closeFollow: () => boolean;
|
|
1680
|
+
stopPropagation: (delay: number) => any;
|
|
1681
|
+
}) => any;
|
|
1682
|
+
};
|
|
1683
|
+
});
|
|
1610
1684
|
Switch: vue.DefineComponent<ReadonlyOptions & {
|
|
1611
1685
|
modelValue?: boolean;
|
|
1612
1686
|
}, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
@@ -1812,8 +1886,12 @@ declare const components: {
|
|
|
1812
1886
|
nodeOptions?: TreeNodeRenderOptions;
|
|
1813
1887
|
}> & Readonly<{
|
|
1814
1888
|
onClick?: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
1815
|
-
|
|
1889
|
+
onSearched?: (text: string) => any;
|
|
1890
|
+
}>, {
|
|
1891
|
+
context: ITreeBaseContext<any>;
|
|
1892
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1816
1893
|
click: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
1894
|
+
searched: (text: string) => any;
|
|
1817
1895
|
}, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
|
|
1818
1896
|
P: {};
|
|
1819
1897
|
B: {};
|
|
@@ -1827,7 +1905,10 @@ declare const components: {
|
|
|
1827
1905
|
nodeOptions?: TreeNodeRenderOptions;
|
|
1828
1906
|
}> & Readonly<{
|
|
1829
1907
|
onClick?: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
1830
|
-
|
|
1908
|
+
onSearched?: (text: string) => any;
|
|
1909
|
+
}>, {
|
|
1910
|
+
context: ITreeBaseContext<any>;
|
|
1911
|
+
}, {}, {}, {}, {}>;
|
|
1831
1912
|
__isFragment?: never;
|
|
1832
1913
|
__isTeleport?: never;
|
|
1833
1914
|
__isSuspense?: never;
|
|
@@ -1837,11 +1918,21 @@ declare const components: {
|
|
|
1837
1918
|
nodeOptions?: TreeNodeRenderOptions;
|
|
1838
1919
|
}> & Readonly<{
|
|
1839
1920
|
onClick?: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
1840
|
-
|
|
1921
|
+
onSearched?: (text: string) => any;
|
|
1922
|
+
}>, {
|
|
1923
|
+
context: ITreeBaseContext<any>;
|
|
1924
|
+
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
1841
1925
|
click: (node: TreeNodeModel<any>, parents?: TreeNodeModel<any>[]) => any;
|
|
1926
|
+
searched: (text: string) => any;
|
|
1842
1927
|
}, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
|
|
1843
1928
|
$slots: {
|
|
1844
|
-
default?: (props:
|
|
1929
|
+
default?: (props: {
|
|
1930
|
+
node: TreeNodeModel<any>;
|
|
1931
|
+
parent?: TreeNodeModel<any>;
|
|
1932
|
+
level: number;
|
|
1933
|
+
click(): void;
|
|
1934
|
+
toggle(): void;
|
|
1935
|
+
}) => any;
|
|
1845
1936
|
};
|
|
1846
1937
|
});
|
|
1847
1938
|
Input: vue.DefineComponent<ReadonlyOptions & PlaceholderOptions & TitleOptions & {
|
|
@@ -1907,4 +1998,4 @@ declare const components: {
|
|
|
1907
1998
|
};
|
|
1908
1999
|
|
|
1909
2000
|
export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
|
|
1910
|
-
export type { ButtonOptions, ChooseEvents, ChooseItem, ChooseOptions, ComponentMountOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DialogHandle, DialogOptions, DisabledOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, FoldEvents, FoldOptions, FoldStatus, FollowElectResult, FollowExtend, FollowHandle, FollowOptions, FollowStrategy, FollowStrategyOptions, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, ISelectContext, ITreeBaseContext, IconOptions, IconType, InputEvents, InputOptions, LoadingOptions, MessageOptions, PlaceholderOptions, PopupDescriptor, PopupHandle, PopupOptions, PopupStatus, PopupStatusOptions, ReactiveVar, ReadonlyOptions, ScrollEvents, ScrollOptions, ScrollTouchType, SearchEvents, SearchOptions, SelectBaseEvents, SelectBaseOptions, SelectEvents, SelectItem, SelectNodeEvents, SelectNodeOptions, SelectOptions, SelectPopupExtend, SelectPopupOptions, SortEvents, SortOptions, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, TitleOptions, ToastOptions, TreeEvents, TreeNode, TreeNodeEvents, TreeNodeExtend, TreeNodeModel, TreeNodeOptions, TreeNodeRenderOptions, TreeNodeSlotOptions, TreeOptions, TreeSearchResult };
|
|
2001
|
+
export type { ButtonOptions, ChooseEvents, ChooseItem, ChooseOptions, ComponentMountOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DialogHandle, DialogOptions, DisabledOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, FoldEvents, FoldOptions, FoldStatus, FollowElectResult, FollowExtend, FollowHandle, FollowOptions, FollowStrategy, FollowStrategyOptions, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, ISelectContext, ITreeBaseContext, IconOptions, IconType, InputEvents, InputOptions, LoadingOptions, MessageOptions, PlaceholderOptions, PopupDescriptor, PopupHandle, PopupOptions, PopupStatus, PopupStatusOptions, ReactiveVar, ReadonlyOptions, ScrollEvents, ScrollOptions, ScrollTouchType, SearchEvents, SearchOptions, SelectBaseEvents, SelectBaseOptions, SelectEvents, SelectItem, SelectNodeEvents, SelectNodeOptions, SelectOptions, SelectPopupExtend, SelectPopupOptions, SelectSlotOptions, SortEvents, SortOptions, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, TitleOptions, ToastOptions, TreeEvents, TreeNode, TreeNodeEvents, TreeNodeExtend, TreeNodeModel, TreeNodeOptions, TreeNodeRenderOptions, TreeNodeSlotOptions, TreeOptions, TreeSearchResult };
|
package/dist/snail.vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//@ sourceURL=/snail.vue.js
|
|
2
2
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, mergeModels, useModel, computed, Fragment, renderList, normalizeStyle, unref, createElementVNode, createCommentVNode, toDisplayString, createBlock, shallowRef, withDirectives, vModelText, createVNode, createApp, Transition, withCtx, normalizeProps, guardReactiveProps, watch, ref, onErrorCaptured, resolveDynamicComponent, mergeProps, createSlots, onMounted, withModifiers, getCurrentInstance, nextTick, useTemplateRef, resolveComponent, onActivated, onDeactivated, onBeforeUnmount, getCurrentScope, onScopeDispose } from 'vue';
|
|
3
|
-
import { isArray, newId, throwError, isArrayNotEmpty, isStringNotEmpty, mustFunction, useScope, removeFromArray, mustObject, throwIfFalse, isObject, isNumberNotNaN,
|
|
3
|
+
import { isArray, newId, throwError, isArrayNotEmpty, isStringNotEmpty, mustFunction, useScope, removeFromArray, mustObject, throwIfFalse, isObject, isNumberNotNaN, mountScope, useScopes, isPromise, wait, script, delay, useTimer, defer, useAsyncScope, useHook, hasAny, throwIfTrue, isFunction, onMountScope, getType } from 'snail.core';
|
|
4
4
|
import { css, link, useObserver, useAnimation } from 'snail.view';
|
|
5
5
|
|
|
6
6
|
var _sfc_main$r = defineComponent({
|
|
@@ -645,7 +645,6 @@ var _sfc_main$k = defineComponent({
|
|
|
645
645
|
});
|
|
646
646
|
|
|
647
647
|
function useReactive() {
|
|
648
|
-
const scopes = useScopes();
|
|
649
648
|
function transition(rv, effect, time) {
|
|
650
649
|
throwIfFalse(isObject(effect), "transition: effect must be an object.");
|
|
651
650
|
const scope = scopes.get();
|
|
@@ -674,7 +673,8 @@ function useReactive() {
|
|
|
674
673
|
transition,
|
|
675
674
|
load,
|
|
676
675
|
watcher
|
|
677
|
-
});
|
|
676
|
+
}, "IReactiveManager");
|
|
677
|
+
const scopes = useScopes();
|
|
678
678
|
manager.onDestroy(scopes.destroy);
|
|
679
679
|
return Object.freeze(manager);
|
|
680
680
|
}
|
|
@@ -1026,7 +1026,6 @@ var _sfc_main$f = defineComponent({
|
|
|
1026
1026
|
});
|
|
1027
1027
|
|
|
1028
1028
|
function usePopup() {
|
|
1029
|
-
const scopes = useScopes();
|
|
1030
1029
|
function popup(options) {
|
|
1031
1030
|
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$g, options);
|
|
1032
1031
|
return addScope2Scopes(scope);
|
|
@@ -1140,7 +1139,8 @@ function usePopup() {
|
|
|
1140
1139
|
follow,
|
|
1141
1140
|
confirm,
|
|
1142
1141
|
toast
|
|
1143
|
-
});
|
|
1142
|
+
}, "IPopupManager");
|
|
1143
|
+
const scopes = useScopes();
|
|
1144
1144
|
manager.onDestroy(scopes.destroy);
|
|
1145
1145
|
return Object.freeze(manager);
|
|
1146
1146
|
}
|
|
@@ -1207,8 +1207,8 @@ var _sfc_main$d = defineComponent({
|
|
|
1207
1207
|
const emits = __emit;
|
|
1208
1208
|
const rootDom = useTemplateRef("select-node");
|
|
1209
1209
|
const selectedRef = computed(() => __props.context.selected(__props.multiple, __props.item));
|
|
1210
|
-
const showRef = computed(() => __props.context.
|
|
1211
|
-
const showChildrenRef = __props.showChildren == true && __props.item.type == "group" ? computed(() => (__props.item.children || []).filter(__props.context.
|
|
1210
|
+
const showRef = computed(() => __props.context.isShow(__props.item, true));
|
|
1211
|
+
const showChildrenRef = __props.showChildren == true && __props.item.type == "group" ? computed(() => (__props.item.children || []).filter(item => __props.context.isShow(item, true))) : [];
|
|
1212
1212
|
const classRef = computed(() => ({
|
|
1213
1213
|
child: __props.showChildren != true,
|
|
1214
1214
|
clickable: __props.item.clickable,
|
|
@@ -1301,7 +1301,7 @@ var _sfc_main$c = defineComponent({
|
|
|
1301
1301
|
pinned,
|
|
1302
1302
|
parentPinned
|
|
1303
1303
|
} = props;
|
|
1304
|
-
const itemsRef = computed(() => (props.items || []).filter(context.
|
|
1304
|
+
const itemsRef = computed(() => (props.items || []).filter(item => context.isShow(item, true)));
|
|
1305
1305
|
const classRef = computed(() => ({
|
|
1306
1306
|
"snail-select-popup": true,
|
|
1307
1307
|
"child-popup": props.level > 1,
|
|
@@ -1419,51 +1419,80 @@ var _sfc_main$c = defineComponent({
|
|
|
1419
1419
|
});
|
|
1420
1420
|
|
|
1421
1421
|
function useTreeContext(nodes) {
|
|
1422
|
-
const scopes = useScopes();
|
|
1423
1422
|
const failed = shallowRef();
|
|
1423
|
+
const patched = shallowRef();
|
|
1424
1424
|
function doSearch(text) {
|
|
1425
1425
|
text = isStringNotEmpty(text) ? text.toLowerCase() : void 0;
|
|
1426
1426
|
const result = searchTree(nodes, text);
|
|
1427
1427
|
failed.value = result.failed;
|
|
1428
|
+
patched.value = result.patched;
|
|
1429
|
+
}
|
|
1430
|
+
function isPatched(node) {
|
|
1431
|
+
return patched.value ? patched.value.includes(node) : false;
|
|
1432
|
+
}
|
|
1433
|
+
function isShow(node, needPatched) {
|
|
1434
|
+
if (node.hidden == true) {
|
|
1435
|
+
return false;
|
|
1436
|
+
}
|
|
1437
|
+
if (failed.value == void 0 || failed.value.includes(node) == false) {
|
|
1438
|
+
return true;
|
|
1439
|
+
}
|
|
1440
|
+
return needPatched == true ? isPatched(node) : false;
|
|
1428
1441
|
}
|
|
1429
|
-
function
|
|
1430
|
-
return node.
|
|
1442
|
+
function isShowChildren(node, needPatched) {
|
|
1443
|
+
return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
|
|
1431
1444
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return
|
|
1445
|
+
function getPath(node) {
|
|
1446
|
+
return searchPath(nodes, node);
|
|
1434
1447
|
}
|
|
1435
1448
|
const context = mountScope({
|
|
1436
1449
|
doSearch,
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1450
|
+
isPatched,
|
|
1451
|
+
isShow,
|
|
1452
|
+
isShowChildren,
|
|
1453
|
+
getPath
|
|
1454
|
+
}, "ITreeBaseContext");
|
|
1440
1455
|
context.onDestroy(() => {
|
|
1441
|
-
scopes.destroy();
|
|
1442
1456
|
failed.value = void 0;
|
|
1457
|
+
patched.value = void 0;
|
|
1443
1458
|
});
|
|
1444
1459
|
return Object.freeze(context);
|
|
1445
1460
|
}
|
|
1446
1461
|
function searchTree(nodes, text) {
|
|
1447
1462
|
const result = Object.freeze({
|
|
1448
1463
|
matched: [],
|
|
1449
|
-
failed: []
|
|
1464
|
+
failed: [],
|
|
1465
|
+
patched: []
|
|
1450
1466
|
});
|
|
1451
1467
|
for (const node of nodes || []) {
|
|
1452
|
-
|
|
1468
|
+
const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
|
|
1469
|
+
matched ? result.matched.push(node) : result.failed.push(node);
|
|
1470
|
+
var childMatched = false;
|
|
1453
1471
|
if (hasAny(node.children) == true) {
|
|
1454
1472
|
const childResult = searchTree(node.children, text);
|
|
1455
1473
|
result.matched.push(...childResult.matched);
|
|
1456
1474
|
result.failed.push(...childResult.failed);
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
matched = matched || node.fixed == true;
|
|
1460
|
-
if (matched == false && node.searchable == true) {
|
|
1461
|
-
matched = text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
|
|
1475
|
+
result.patched.push(...childResult.patched);
|
|
1476
|
+
childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
|
|
1462
1477
|
}
|
|
1463
|
-
|
|
1478
|
+
childMatched && matched == false && result.patched.push(node);
|
|
1464
1479
|
}
|
|
1465
1480
|
return result;
|
|
1466
1481
|
}
|
|
1482
|
+
function searchPath(nodes, target) {
|
|
1483
|
+
for (const node of nodes || []) {
|
|
1484
|
+
if (target === node) {
|
|
1485
|
+
return [node];
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
for (const node of nodes || []) {
|
|
1489
|
+
const childPath = searchPath(node.children, target);
|
|
1490
|
+
if (childPath.length > 0) {
|
|
1491
|
+
return [node, ...childPath];
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
return [];
|
|
1495
|
+
}
|
|
1467
1496
|
|
|
1468
1497
|
function useSelectContext(items, selectsRef) {
|
|
1469
1498
|
const treeContxt = useTreeContext(items);
|
|
@@ -1486,8 +1515,11 @@ function useSelectContext(items, selectsRef) {
|
|
|
1486
1515
|
});
|
|
1487
1516
|
}
|
|
1488
1517
|
|
|
1489
|
-
const _hoisted_1$6 =
|
|
1490
|
-
|
|
1518
|
+
const _hoisted_1$6 = {
|
|
1519
|
+
key: 0,
|
|
1520
|
+
class: "select-result"
|
|
1521
|
+
};
|
|
1522
|
+
const _hoisted_2$3 = ["title", "textContent"];
|
|
1491
1523
|
const _hoisted_3$3 = ["textContent"];
|
|
1492
1524
|
const _hoisted_4$3 = {
|
|
1493
1525
|
key: 1,
|
|
@@ -1533,18 +1565,35 @@ var _sfc_main$b = defineComponent({
|
|
|
1533
1565
|
const {
|
|
1534
1566
|
follow
|
|
1535
1567
|
} = usePopup();
|
|
1568
|
+
const {
|
|
1569
|
+
onTimeout
|
|
1570
|
+
} = useTimer();
|
|
1536
1571
|
const rootDom = useTemplateRef("select");
|
|
1537
|
-
const
|
|
1538
|
-
const context = useSelectContext(props.items, selectsRef);
|
|
1572
|
+
const context = useSelectContext(props.items, valuesModel);
|
|
1539
1573
|
const selectTextRef = computed(() => context.selectedText(props.multiple, props.showPath));
|
|
1574
|
+
const slotOptions = Object.freeze({
|
|
1575
|
+
closeFollow,
|
|
1576
|
+
stopPropagation
|
|
1577
|
+
});
|
|
1540
1578
|
var followScope = void 0;
|
|
1579
|
+
var stopPropagationScope = void 0;
|
|
1580
|
+
function closeFollow() {
|
|
1581
|
+
if (followScope != void 0) {
|
|
1582
|
+
followScope.destroy();
|
|
1583
|
+
followScope = void 0;
|
|
1584
|
+
return true;
|
|
1585
|
+
}
|
|
1586
|
+
return false;
|
|
1587
|
+
}
|
|
1588
|
+
function stopPropagation(delay) {
|
|
1589
|
+
stopPropagationScope && stopPropagationScope.destroy();
|
|
1590
|
+
stopPropagationScope = onTimeout(() => stopPropagationScope = void 0, delay);
|
|
1591
|
+
}
|
|
1541
1592
|
async function onClick() {
|
|
1542
1593
|
if (props.readonly == true || rootDom.value == void 0) {
|
|
1543
1594
|
return;
|
|
1544
1595
|
}
|
|
1545
|
-
if (
|
|
1546
|
-
followScope.destroy();
|
|
1547
|
-
followScope = void 0;
|
|
1596
|
+
if (closeFollow() == true || stopPropagationScope != void 0) {
|
|
1548
1597
|
return;
|
|
1549
1598
|
}
|
|
1550
1599
|
const values = valuesModel.value && valuesModel.value.length > 0 ? [...valuesModel.value] : [];
|
|
@@ -1575,7 +1624,6 @@ var _sfc_main$b = defineComponent({
|
|
|
1575
1624
|
}
|
|
1576
1625
|
function onSelectItemChange(items) {
|
|
1577
1626
|
items = hasAny(items) ? [...items] : [];
|
|
1578
|
-
selectsRef.value = items;
|
|
1579
1627
|
valuesModel.value = items;
|
|
1580
1628
|
emits("change", items);
|
|
1581
1629
|
}
|
|
@@ -1588,14 +1636,11 @@ var _sfc_main$b = defineComponent({
|
|
|
1588
1636
|
ref: "select"
|
|
1589
1637
|
}, [unref(hasAny)(props.items) == true ? (openBlock(), createElementBlock(Fragment, {
|
|
1590
1638
|
key: 0
|
|
1591
|
-
}, [unref(hasAny)(
|
|
1592
|
-
key: 0,
|
|
1593
|
-
class: "select-result",
|
|
1594
|
-
title: selectTextRef.value
|
|
1595
|
-
}, [createElementVNode("div", {
|
|
1639
|
+
}, [unref(hasAny)(valuesModel.value) ? (openBlock(), createElementBlock("div", _hoisted_1$6, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))), () => [createElementVNode("div", {
|
|
1596
1640
|
class: "select-text",
|
|
1641
|
+
title: selectTextRef.value,
|
|
1597
1642
|
textContent: toDisplayString(selectTextRef.value)
|
|
1598
|
-
}, null, 8, _hoisted_2$3)]
|
|
1643
|
+
}, null, 8, _hoisted_2$3)])])) : (openBlock(), createElementBlock("div", {
|
|
1599
1644
|
key: 1,
|
|
1600
1645
|
class: "select-result text-tips",
|
|
1601
1646
|
textContent: toDisplayString(props.placeholder || "请选择")
|
|
@@ -2013,8 +2058,8 @@ var _sfc_main$3 = defineComponent({
|
|
|
2013
2058
|
const {
|
|
2014
2059
|
transition
|
|
2015
2060
|
} = useAnimation();
|
|
2016
|
-
const showRef = computed(() => __props.context.
|
|
2017
|
-
const showChildrenRef = computed(() => __props.context.
|
|
2061
|
+
const showRef = computed(() => __props.context.isShow(__props.node, true));
|
|
2062
|
+
const showChildrenRef = computed(() => __props.context.isShowChildren(__props.node, true));
|
|
2018
2063
|
const classRef = computed(() => {
|
|
2019
2064
|
const array = [`level-${__props.level}`];
|
|
2020
2065
|
__props.node.clickable && array.push("clickable");
|
|
@@ -2123,20 +2168,28 @@ var _sfc_main$2 = defineComponent({
|
|
|
2123
2168
|
search: {},
|
|
2124
2169
|
nodeOptions: {}
|
|
2125
2170
|
},
|
|
2126
|
-
emits: ["click"],
|
|
2171
|
+
emits: ["click", "searched"],
|
|
2127
2172
|
setup(__props, _ref) {
|
|
2128
2173
|
let {
|
|
2174
|
+
expose: __expose,
|
|
2129
2175
|
emit: __emit
|
|
2130
2176
|
} = _ref;
|
|
2131
2177
|
const props = __props;
|
|
2132
2178
|
const emits = __emit;
|
|
2133
2179
|
const context = useTreeContext(props.nodes);
|
|
2180
|
+
__expose({
|
|
2181
|
+
context
|
|
2182
|
+
});
|
|
2183
|
+
function onSearch(text) {
|
|
2184
|
+
context.doSearch(text);
|
|
2185
|
+
emits("searched", text);
|
|
2186
|
+
}
|
|
2134
2187
|
return (_ctx, _cache) => {
|
|
2135
2188
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [props.search ? (openBlock(), createBlock(_sfc_main$m, mergeProps({
|
|
2136
2189
|
key: 0
|
|
2137
2190
|
}, props.search, {
|
|
2138
|
-
onSearch
|
|
2139
|
-
}), null, 16
|
|
2191
|
+
onSearch
|
|
2192
|
+
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$8, {
|
|
2140
2193
|
"scroll-y": true
|
|
2141
2194
|
}, {
|
|
2142
2195
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(props.nodes || [], node => {
|
|
@@ -2387,6 +2440,13 @@ const components = {
|
|
|
2387
2440
|
Loading: _sfc_main$k
|
|
2388
2441
|
};
|
|
2389
2442
|
|
|
2390
|
-
onMountScope(scope =>
|
|
2443
|
+
onMountScope(scope => {
|
|
2444
|
+
const type = getType(scope);
|
|
2445
|
+
console.log(`%c${type}:`, "color:green", "scope mounted");
|
|
2446
|
+
getCurrentScope() && onScopeDispose(() => {
|
|
2447
|
+
console.log(`%c${type}:`, "color:blue", "scope auto destroyed");
|
|
2448
|
+
scope.destroy();
|
|
2449
|
+
});
|
|
2450
|
+
});
|
|
2391
2451
|
|
|
2392
2452
|
export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
|
package/dist/snail.vue.umd.js
CHANGED
|
@@ -647,7 +647,6 @@
|
|
|
647
647
|
});
|
|
648
648
|
|
|
649
649
|
function useReactive() {
|
|
650
|
-
const scopes = snail_core.useScopes();
|
|
651
650
|
function transition(rv, effect, time) {
|
|
652
651
|
snail_core.throwIfFalse(snail_core.isObject(effect), "transition: effect must be an object.");
|
|
653
652
|
const scope = scopes.get();
|
|
@@ -676,7 +675,8 @@
|
|
|
676
675
|
transition,
|
|
677
676
|
load,
|
|
678
677
|
watcher
|
|
679
|
-
});
|
|
678
|
+
}, "IReactiveManager");
|
|
679
|
+
const scopes = snail_core.useScopes();
|
|
680
680
|
manager.onDestroy(scopes.destroy);
|
|
681
681
|
return Object.freeze(manager);
|
|
682
682
|
}
|
|
@@ -1028,7 +1028,6 @@
|
|
|
1028
1028
|
});
|
|
1029
1029
|
|
|
1030
1030
|
function usePopup() {
|
|
1031
|
-
const scopes = snail_core.useScopes();
|
|
1032
1031
|
function popup(options) {
|
|
1033
1032
|
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$g, options);
|
|
1034
1033
|
return addScope2Scopes(scope);
|
|
@@ -1142,7 +1141,8 @@
|
|
|
1142
1141
|
follow,
|
|
1143
1142
|
confirm,
|
|
1144
1143
|
toast
|
|
1145
|
-
});
|
|
1144
|
+
}, "IPopupManager");
|
|
1145
|
+
const scopes = snail_core.useScopes();
|
|
1146
1146
|
manager.onDestroy(scopes.destroy);
|
|
1147
1147
|
return Object.freeze(manager);
|
|
1148
1148
|
}
|
|
@@ -1209,8 +1209,8 @@
|
|
|
1209
1209
|
const emits = __emit;
|
|
1210
1210
|
const rootDom = vue.useTemplateRef("select-node");
|
|
1211
1211
|
const selectedRef = vue.computed(() => __props.context.selected(__props.multiple, __props.item));
|
|
1212
|
-
const showRef = vue.computed(() => __props.context.
|
|
1213
|
-
const showChildrenRef = __props.showChildren == true && __props.item.type == "group" ? vue.computed(() => (__props.item.children || []).filter(__props.context.
|
|
1212
|
+
const showRef = vue.computed(() => __props.context.isShow(__props.item, true));
|
|
1213
|
+
const showChildrenRef = __props.showChildren == true && __props.item.type == "group" ? vue.computed(() => (__props.item.children || []).filter(item => __props.context.isShow(item, true))) : [];
|
|
1214
1214
|
const classRef = vue.computed(() => ({
|
|
1215
1215
|
child: __props.showChildren != true,
|
|
1216
1216
|
clickable: __props.item.clickable,
|
|
@@ -1303,7 +1303,7 @@
|
|
|
1303
1303
|
pinned,
|
|
1304
1304
|
parentPinned
|
|
1305
1305
|
} = props;
|
|
1306
|
-
const itemsRef = vue.computed(() => (props.items || []).filter(context.
|
|
1306
|
+
const itemsRef = vue.computed(() => (props.items || []).filter(item => context.isShow(item, true)));
|
|
1307
1307
|
const classRef = vue.computed(() => ({
|
|
1308
1308
|
"snail-select-popup": true,
|
|
1309
1309
|
"child-popup": props.level > 1,
|
|
@@ -1421,51 +1421,80 @@
|
|
|
1421
1421
|
});
|
|
1422
1422
|
|
|
1423
1423
|
function useTreeContext(nodes) {
|
|
1424
|
-
const scopes = snail_core.useScopes();
|
|
1425
1424
|
const failed = vue.shallowRef();
|
|
1425
|
+
const patched = vue.shallowRef();
|
|
1426
1426
|
function doSearch(text) {
|
|
1427
1427
|
text = snail_core.isStringNotEmpty(text) ? text.toLowerCase() : void 0;
|
|
1428
1428
|
const result = searchTree(nodes, text);
|
|
1429
1429
|
failed.value = result.failed;
|
|
1430
|
+
patched.value = result.patched;
|
|
1431
|
+
}
|
|
1432
|
+
function isPatched(node) {
|
|
1433
|
+
return patched.value ? patched.value.includes(node) : false;
|
|
1434
|
+
}
|
|
1435
|
+
function isShow(node, needPatched) {
|
|
1436
|
+
if (node.hidden == true) {
|
|
1437
|
+
return false;
|
|
1438
|
+
}
|
|
1439
|
+
if (failed.value == void 0 || failed.value.includes(node) == false) {
|
|
1440
|
+
return true;
|
|
1441
|
+
}
|
|
1442
|
+
return needPatched == true ? isPatched(node) : false;
|
|
1430
1443
|
}
|
|
1431
|
-
function
|
|
1432
|
-
return node.
|
|
1444
|
+
function isShowChildren(node, needPatched) {
|
|
1445
|
+
return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
|
|
1433
1446
|
}
|
|
1434
|
-
function
|
|
1435
|
-
return
|
|
1447
|
+
function getPath(node) {
|
|
1448
|
+
return searchPath(nodes, node);
|
|
1436
1449
|
}
|
|
1437
1450
|
const context = snail_core.mountScope({
|
|
1438
1451
|
doSearch,
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1452
|
+
isPatched,
|
|
1453
|
+
isShow,
|
|
1454
|
+
isShowChildren,
|
|
1455
|
+
getPath
|
|
1456
|
+
}, "ITreeBaseContext");
|
|
1442
1457
|
context.onDestroy(() => {
|
|
1443
|
-
scopes.destroy();
|
|
1444
1458
|
failed.value = void 0;
|
|
1459
|
+
patched.value = void 0;
|
|
1445
1460
|
});
|
|
1446
1461
|
return Object.freeze(context);
|
|
1447
1462
|
}
|
|
1448
1463
|
function searchTree(nodes, text) {
|
|
1449
1464
|
const result = Object.freeze({
|
|
1450
1465
|
matched: [],
|
|
1451
|
-
failed: []
|
|
1466
|
+
failed: [],
|
|
1467
|
+
patched: []
|
|
1452
1468
|
});
|
|
1453
1469
|
for (const node of nodes || []) {
|
|
1454
|
-
|
|
1470
|
+
const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
|
|
1471
|
+
matched ? result.matched.push(node) : result.failed.push(node);
|
|
1472
|
+
var childMatched = false;
|
|
1455
1473
|
if (snail_core.hasAny(node.children) == true) {
|
|
1456
1474
|
const childResult = searchTree(node.children, text);
|
|
1457
1475
|
result.matched.push(...childResult.matched);
|
|
1458
1476
|
result.failed.push(...childResult.failed);
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
matched = matched || node.fixed == true;
|
|
1462
|
-
if (matched == false && node.searchable == true) {
|
|
1463
|
-
matched = text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
|
|
1477
|
+
result.patched.push(...childResult.patched);
|
|
1478
|
+
childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
|
|
1464
1479
|
}
|
|
1465
|
-
|
|
1480
|
+
childMatched && matched == false && result.patched.push(node);
|
|
1466
1481
|
}
|
|
1467
1482
|
return result;
|
|
1468
1483
|
}
|
|
1484
|
+
function searchPath(nodes, target) {
|
|
1485
|
+
for (const node of nodes || []) {
|
|
1486
|
+
if (target === node) {
|
|
1487
|
+
return [node];
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
for (const node of nodes || []) {
|
|
1491
|
+
const childPath = searchPath(node.children, target);
|
|
1492
|
+
if (childPath.length > 0) {
|
|
1493
|
+
return [node, ...childPath];
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
return [];
|
|
1497
|
+
}
|
|
1469
1498
|
|
|
1470
1499
|
function useSelectContext(items, selectsRef) {
|
|
1471
1500
|
const treeContxt = useTreeContext(items);
|
|
@@ -1488,8 +1517,11 @@
|
|
|
1488
1517
|
});
|
|
1489
1518
|
}
|
|
1490
1519
|
|
|
1491
|
-
const _hoisted_1$6 =
|
|
1492
|
-
|
|
1520
|
+
const _hoisted_1$6 = {
|
|
1521
|
+
key: 0,
|
|
1522
|
+
class: "select-result"
|
|
1523
|
+
};
|
|
1524
|
+
const _hoisted_2$3 = ["title", "textContent"];
|
|
1493
1525
|
const _hoisted_3$3 = ["textContent"];
|
|
1494
1526
|
const _hoisted_4$3 = {
|
|
1495
1527
|
key: 1,
|
|
@@ -1535,18 +1567,35 @@
|
|
|
1535
1567
|
const {
|
|
1536
1568
|
follow
|
|
1537
1569
|
} = usePopup();
|
|
1570
|
+
const {
|
|
1571
|
+
onTimeout
|
|
1572
|
+
} = snail_core.useTimer();
|
|
1538
1573
|
const rootDom = vue.useTemplateRef("select");
|
|
1539
|
-
const
|
|
1540
|
-
const context = useSelectContext(props.items, selectsRef);
|
|
1574
|
+
const context = useSelectContext(props.items, valuesModel);
|
|
1541
1575
|
const selectTextRef = vue.computed(() => context.selectedText(props.multiple, props.showPath));
|
|
1576
|
+
const slotOptions = Object.freeze({
|
|
1577
|
+
closeFollow,
|
|
1578
|
+
stopPropagation
|
|
1579
|
+
});
|
|
1542
1580
|
var followScope = void 0;
|
|
1581
|
+
var stopPropagationScope = void 0;
|
|
1582
|
+
function closeFollow() {
|
|
1583
|
+
if (followScope != void 0) {
|
|
1584
|
+
followScope.destroy();
|
|
1585
|
+
followScope = void 0;
|
|
1586
|
+
return true;
|
|
1587
|
+
}
|
|
1588
|
+
return false;
|
|
1589
|
+
}
|
|
1590
|
+
function stopPropagation(delay) {
|
|
1591
|
+
stopPropagationScope && stopPropagationScope.destroy();
|
|
1592
|
+
stopPropagationScope = onTimeout(() => stopPropagationScope = void 0, delay);
|
|
1593
|
+
}
|
|
1543
1594
|
async function onClick() {
|
|
1544
1595
|
if (props.readonly == true || rootDom.value == void 0) {
|
|
1545
1596
|
return;
|
|
1546
1597
|
}
|
|
1547
|
-
if (
|
|
1548
|
-
followScope.destroy();
|
|
1549
|
-
followScope = void 0;
|
|
1598
|
+
if (closeFollow() == true || stopPropagationScope != void 0) {
|
|
1550
1599
|
return;
|
|
1551
1600
|
}
|
|
1552
1601
|
const values = valuesModel.value && valuesModel.value.length > 0 ? [...valuesModel.value] : [];
|
|
@@ -1577,7 +1626,6 @@
|
|
|
1577
1626
|
}
|
|
1578
1627
|
function onSelectItemChange(items) {
|
|
1579
1628
|
items = snail_core.hasAny(items) ? [...items] : [];
|
|
1580
|
-
selectsRef.value = items;
|
|
1581
1629
|
valuesModel.value = items;
|
|
1582
1630
|
emits("change", items);
|
|
1583
1631
|
}
|
|
@@ -1590,14 +1638,11 @@
|
|
|
1590
1638
|
ref: "select"
|
|
1591
1639
|
}, [vue.unref(snail_core.hasAny)(props.items) == true ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
1592
1640
|
key: 0
|
|
1593
|
-
}, [vue.unref(snail_core.hasAny)(
|
|
1594
|
-
key: 0,
|
|
1595
|
-
class: "select-result",
|
|
1596
|
-
title: selectTextRef.value
|
|
1597
|
-
}, [vue.createElementVNode("div", {
|
|
1641
|
+
}, [vue.unref(snail_core.hasAny)(valuesModel.value) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$6, [vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(vue.unref(slotOptions))), () => [vue.createElementVNode("div", {
|
|
1598
1642
|
class: "select-text",
|
|
1643
|
+
title: selectTextRef.value,
|
|
1599
1644
|
textContent: vue.toDisplayString(selectTextRef.value)
|
|
1600
|
-
}, null, 8, _hoisted_2$3)]
|
|
1645
|
+
}, null, 8, _hoisted_2$3)])])) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
1601
1646
|
key: 1,
|
|
1602
1647
|
class: "select-result text-tips",
|
|
1603
1648
|
textContent: vue.toDisplayString(props.placeholder || "请选择")
|
|
@@ -2015,8 +2060,8 @@
|
|
|
2015
2060
|
const {
|
|
2016
2061
|
transition
|
|
2017
2062
|
} = snail_view.useAnimation();
|
|
2018
|
-
const showRef = vue.computed(() => __props.context.
|
|
2019
|
-
const showChildrenRef = vue.computed(() => __props.context.
|
|
2063
|
+
const showRef = vue.computed(() => __props.context.isShow(__props.node, true));
|
|
2064
|
+
const showChildrenRef = vue.computed(() => __props.context.isShowChildren(__props.node, true));
|
|
2020
2065
|
const classRef = vue.computed(() => {
|
|
2021
2066
|
const array = [`level-${__props.level}`];
|
|
2022
2067
|
__props.node.clickable && array.push("clickable");
|
|
@@ -2125,20 +2170,28 @@
|
|
|
2125
2170
|
search: {},
|
|
2126
2171
|
nodeOptions: {}
|
|
2127
2172
|
},
|
|
2128
|
-
emits: ["click"],
|
|
2173
|
+
emits: ["click", "searched"],
|
|
2129
2174
|
setup(__props, _ref) {
|
|
2130
2175
|
let {
|
|
2176
|
+
expose: __expose,
|
|
2131
2177
|
emit: __emit
|
|
2132
2178
|
} = _ref;
|
|
2133
2179
|
const props = __props;
|
|
2134
2180
|
const emits = __emit;
|
|
2135
2181
|
const context = useTreeContext(props.nodes);
|
|
2182
|
+
__expose({
|
|
2183
|
+
context
|
|
2184
|
+
});
|
|
2185
|
+
function onSearch(text) {
|
|
2186
|
+
context.doSearch(text);
|
|
2187
|
+
emits("searched", text);
|
|
2188
|
+
}
|
|
2136
2189
|
return (_ctx, _cache) => {
|
|
2137
2190
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [props.search ? (vue.openBlock(), vue.createBlock(_sfc_main$m, vue.mergeProps({
|
|
2138
2191
|
key: 0
|
|
2139
2192
|
}, props.search, {
|
|
2140
|
-
onSearch
|
|
2141
|
-
}), null, 16
|
|
2193
|
+
onSearch
|
|
2194
|
+
}), null, 16)) : vue.createCommentVNode("", true), vue.createVNode(_sfc_main$8, {
|
|
2142
2195
|
"scroll-y": true
|
|
2143
2196
|
}, {
|
|
2144
2197
|
default: vue.withCtx(() => [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(props.nodes || [], node => {
|
|
@@ -2389,7 +2442,14 @@
|
|
|
2389
2442
|
Loading: _sfc_main$k
|
|
2390
2443
|
};
|
|
2391
2444
|
|
|
2392
|
-
snail_core.onMountScope(scope =>
|
|
2445
|
+
snail_core.onMountScope(scope => {
|
|
2446
|
+
const type = snail_core.getType(scope);
|
|
2447
|
+
console.log(`%c${type}:`, "color:green", "scope mounted");
|
|
2448
|
+
vue.getCurrentScope() && vue.onScopeDispose(() => {
|
|
2449
|
+
console.log(`%c${type}:`, "color:blue", "scope auto destroyed");
|
|
2450
|
+
scope.destroy();
|
|
2451
|
+
});
|
|
2452
|
+
});
|
|
2393
2453
|
|
|
2394
2454
|
exports.components = components;
|
|
2395
2455
|
exports.getSvgDraw = getSvgDraw;
|
package/dist/styles/app.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.snail-app{font-family:"Microsoft YaHei","微软雅黑","Hiragino Sans GB","tahoma","arial","simsun","宋体","sans-serif"}.snail-app,.snail-app *{box-sizing:border-box!important}.snail-app div,.snail-app span{font-size:14px}.snail-app input[type=email],.snail-app input[type=number],.snail-app input[type=password],.snail-app input[type=search],.snail-app input[type=text],.snail-app input[type=url]{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;border:1px solid #dddfed;border-radius:4px;color:#2e3033;font:inherit;font-size:14px;font-weight:400;margin:0;min-width:10px;outline:0!important;padding:0 10px;text-overflow:ellipsis}.snail-app input[type=email]::-webkit-search-cancel-button,.snail-app input[type=number]::-webkit-search-cancel-button,.snail-app input[type=password]::-webkit-search-cancel-button,.snail-app input[type=search]::-webkit-search-cancel-button,.snail-app input[type=text]::-webkit-search-cancel-button,.snail-app input[type=url]::-webkit-search-cancel-button{display:none}.snail-app input[type=email]:focus,.snail-app input[type=number]:focus,.snail-app input[type=password]:focus,.snail-app input[type=search]:focus,.snail-app input[type=text]:focus,.snail-app input[type=url]:focus{border:1px solid #3292ea}.snail-app input[type=email]:-moz-read-only:focus,.snail-app input[type=number]:-moz-read-only:focus,.snail-app input[type=password]:-moz-read-only:focus,.snail-app input[type=search]:-moz-read-only:focus,.snail-app input[type=text]:-moz-read-only:focus,.snail-app input[type=url]:-moz-read-only:focus{border:1px solid #dddfed}.snail-app input[type=email]:read-only:focus,.snail-app input[type=number]:read-only:focus,.snail-app input[type=password]:read-only:focus,.snail-app input[type=search]:read-only:focus,.snail-app input[type=text]:read-only:focus,.snail-app input[type=url]:read-only:focus{border:1px solid #dddfed}.snail-app input[type=checkbox],.snail-app input[type=radio]{margin:0;padding:0}.snail-app ::-webkit-scrollbar{background-color:transparent;border-radius:12px;height:10px;width:10px}.snail-app ::-webkit-scrollbar-button{display:none!important;height:0;width:0}.snail-app ::-webkit-scrollbar-thumb{background-color:hsla(0,0%,71%,.9);border:1px solid hsla(0,0%,100%,.85);border-radius:10px}.snail-app ::-webkit-scrollbar-track{background-color:transparent;border-radius:10px}.snail-app .text-tips{color:#8a9099;font-size:14px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
|
|
1
|
+
.snail-app{font-family:"Microsoft YaHei","微软雅黑","Hiragino Sans GB","tahoma","arial","simsun","宋体","sans-serif"}.snail-app,.snail-app *{box-sizing:border-box!important}.snail-app div,.snail-app span{font-size:14px}.snail-app input[type=email],.snail-app input[type=number],.snail-app input[type=password],.snail-app input[type=search],.snail-app input[type=text],.snail-app input[type=url]{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important;border:1px solid #dddfed;border-radius:4px;color:#2e3033;font:inherit;font-size:14px;font-weight:400;margin:0;min-width:10px;outline:0!important;padding:0 10px;text-overflow:ellipsis}.snail-app input[type=email]::-webkit-search-cancel-button,.snail-app input[type=number]::-webkit-search-cancel-button,.snail-app input[type=password]::-webkit-search-cancel-button,.snail-app input[type=search]::-webkit-search-cancel-button,.snail-app input[type=text]::-webkit-search-cancel-button,.snail-app input[type=url]::-webkit-search-cancel-button{display:none}.snail-app input[type=email]:focus,.snail-app input[type=number]:focus,.snail-app input[type=password]:focus,.snail-app input[type=search]:focus,.snail-app input[type=text]:focus,.snail-app input[type=url]:focus{border:1px solid #3292ea}.snail-app input[type=email]:-moz-read-only:focus,.snail-app input[type=number]:-moz-read-only:focus,.snail-app input[type=password]:-moz-read-only:focus,.snail-app input[type=search]:-moz-read-only:focus,.snail-app input[type=text]:-moz-read-only:focus,.snail-app input[type=url]:-moz-read-only:focus{border:1px solid #dddfed}.snail-app input[type=email]:read-only:focus,.snail-app input[type=number]:read-only:focus,.snail-app input[type=password]:read-only:focus,.snail-app input[type=search]:read-only:focus,.snail-app input[type=text]:read-only:focus,.snail-app input[type=url]:read-only:focus{border:1px solid #dddfed}.snail-app input[type=checkbox],.snail-app input[type=radio]{margin:0;padding:0}.snail-app ::-webkit-scrollbar{background-color:transparent;border-radius:12px;height:10px;width:10px}.snail-app ::-webkit-scrollbar-button{display:none!important;height:0;width:0}.snail-app ::-webkit-scrollbar-thumb{background-color:hsla(0,0%,71%,.9);border:1px solid hsla(0,0%,100%,.85);border-radius:10px}.snail-app ::-webkit-scrollbar-track{background-color:transparent;border-radius:10px}.snail-app .text-tips{color:#8a9099;font-size:14px;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* src:base\choose.vue index:0 */
|
|
2
2
|
.snail-choose{align-items:center;display:flex;flex-wrap:wrap;overflow-x:hidden}.snail-choose>div.choose-item{align-items:center;cursor:pointer;display:flex;flex-shrink:0;margin:0 8px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-choose>div.choose-item:after{content:"";height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.snail-choose>div.choose-item>input::checkmark{background-color:#2196f3;border-color:#2196f3}.snail-choose>div.choose-item>span{margin-left:4px}.snail-choose.readonly>div.choose-item{cursor:not-allowed}
|
|
3
3
|
/* src:base\button.vue index:0 */
|
|
4
|
-
.snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;
|
|
4
|
+
.snail-button{align-items:center;border-radius:2px;cursor:pointer;display:flex;display:inline-flex;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.snail-button.max{height:40px;width:120px}.snail-button.middle{height:32px;width:90px}.snail-button.normal{height:28px;width:54px}.snail-button.small{height:20px;width:30px}.snail-button.primary{background-color:#5ca3ff;color:#fff}.snail-button.default{background-color:#fff;border:1px solid #dddfed;color:#2e2f33}.snail-button.link{color:#4c9aff}
|
|
5
5
|
/* src:base\footer.vue index:0 */
|
|
6
6
|
.snail-footer{align-items:center;background-color:#fff;display:flex;flex-shrink:0;height:72px;padding:0 40px;width:100%}.snail-footer>.snail-button:nth-child(n+2){margin-left:20px}.snail-footer.start-divider{border-top:1px solid #dddfed}.snail-footer.left{justify-content:left}.snail-footer.center{justify-content:center}.snail-footer.right{justify-content:right}
|
|
7
|
-
/* src:base\header.vue index:0 */
|
|
8
|
-
.snail-header{align-items:center;background-color:#fff;display:flex;flex-shrink:0;position:relative;width:100%}.snail-header>.header-title{color:#2e3033;flex:1;line-height:48px;overflow:hidden;padding:0 30px;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-header>.header-title.left{text-align:left}.snail-header>.header-title.center{text-align:center}.snail-header>.header-title.right{text-align:right}.snail-header.start-divider{border-bottom:1px solid #dddfed}.snail-header.page{height:48px}.snail-header.page>.header-title{font-size:16px;font-weight:bold}.snail-header.page>.close-icon{margin-right:18px}.snail-header.dialog{height:64px;padding-top:16px}.snail-header.dialog>.header-title{font-size:20px}.snail-header.dialog>.close-icon{position:absolute;right:8px;top:8px}
|
|
9
7
|
/* src:base\icon.vue index:0 */
|
|
10
8
|
.snail-icon{cursor:pointer;opacity:1}
|
|
9
|
+
/* src:base\header.vue index:0 */
|
|
10
|
+
.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
|
+
/* src:base\select.vue index:0 */
|
|
14
|
+
.snail-select{align-items:center;background-color:#fff;border:1px solid #dddfed;border-radius:4px;color:#2e3033;cursor:pointer;display:flex;height:32px;width:100%}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;height:30px;overflow:hidden;padding:0 10px 0 6px}.snail-select>div.select-result>div.select-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-select>svg.snail-icon{flex-shrink:0;margin-right:4px}.snail-select>div.no-items{cursor:text;padding:0 8px}.snail-select.readonly{cursor:auto}.snail-select.readonly>svg.snail-icon{display:none}
|
|
11
15
|
/* src:base\switch.vue index:0 */
|
|
12
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:default}
|
|
13
|
-
/* src:base\select.vue index:0 */
|
|
14
|
-
.snail-select{align-items:center;background-color:#fff;border:1px solid #dddfed;border-radius:4px;color:#2e3033;cursor:pointer;display:flex;height:32px;width:100%}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;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}
|
|
15
17
|
/* src:container\dynamic.vue index:0 */
|
|
16
18
|
.snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
|
|
17
19
|
/* src:container\fold.vue index:0 */
|
|
18
|
-
.snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-
|
|
19
|
-
/* src:base\search.vue index:0 */
|
|
20
|
-
.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}
|
|
21
|
-
/* src:container\sort.vue index:0 */
|
|
22
|
-
.snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
|
|
20
|
+
.snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-weight:bold;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:right;display:flex;flex:1;justify-content:right}.snail-fold>div.fold-header>div.status>svg.snail-icon{transition:transform .2s ease}.snail-fold>div.fold-body{padding-left:20px}.snail-fold.expand>div.fold-header>div.status>svg.snail-icon{transform:rotate(-90deg)}.snail-fold.fold>div.fold-header>div.status>svg.snail-icon{transform:rotate(90deg)}
|
|
23
21
|
/* src:container\scroll.vue index:0 */
|
|
24
22
|
.snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
|
|
23
|
+
/* src:container\sort.vue index:0 */
|
|
24
|
+
.snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
|
|
25
25
|
/* src:container\table.vue index:0 */
|
|
26
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}
|
|
27
27
|
/* src:container\components\table-row.vue index:0 */
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
/* src:container\components\table-col.vue index:0 */
|
|
30
30
|
.table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:left}.table-col.center{justify-content:center}.table-col.right{justify-content:right}
|
|
31
31
|
/* src:container\tree.vue index:0 */
|
|
32
|
-
.snail-tree{background-color:#fff;display:flex;flex-direction:column}.snail-tree .snail-search{flex-
|
|
32
|
+
.snail-tree{background-color:#fff;display:flex;flex-direction:column}.snail-tree .snail-search{flex-shrink:0;margin:12px}.snail-tree .snail-scroll{flex:1}
|
|
33
|
+
/* src:form\input.vue index:0 */
|
|
34
|
+
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
|
|
33
35
|
/* src:prompt\drag-verify.vue index:0 */
|
|
34
36
|
.snail-drag-verify{background:#f8f9fa;border:1px solid #dddfed;border-radius:8px;height:40px;overflow:hidden;position:relative;width:100%}.snail-drag-verify>div{height:100%;width:100%}.snail-drag-verify>.drag-progress{background-color:#0c6;transition:width .5s ease-in-out}.snail-drag-verify>.drag-handle,.snail-drag-verify>.verify-message{left:0;position:absolute;top:0;transition:left .5s ease-in-out}.snail-drag-verify>.verify-message{background-image:-webkit-linear-gradient(left,#666,#666 45%,#fff 50%,#666 55%,#666);-webkit-text-fill-color:transparent;align-items:center;animation:snail-drag-verify 2s linear infinite;-webkit-background-clip:text;background-clip:text;background-size:200% 100%;color:#7e848c;display:flex;font-size:12px;font-weight:400;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-drag-verify>.drag-handle{align-items:center;background-color:#fff;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURQAAAGBQUGBaWmJZWWJYWGNYWGNZWWJYWGJZWWBYWGNYWGNZWWRYWIqwlb0AAAANdFJOUwAQMMDQoFBgcCCw4ECQ8pPMAAAAP0lEQVQI12NgwATTGBgawAwRBYZwMIPRiYErAcxSFmA0AjN4HBikBcCsUgYmQxQGE0wKphhIQrSzwAyEW4EOACHhB32zIad6AAAAAElFTkSuQmCC);background-position:50%;background-repeat:no-repeat;border-right:1px solid #dddfed;cursor:move;display:flex;justify-content:center;width:40px}.snail-drag-verify.dragging>.drag-handle,.snail-drag-verify.dragging>.drag-progress{transition:none!important}.snail-drag-verify.success>.verify-message{-webkit-text-fill-color:#fff;color:#fff}.snail-drag-verify.success>.drag-handle>svg{background:#76c61d;border-radius:50%;padding:4px}@keyframes snail-drag-verify{0%{background-position:0 0}to{background-position:-200% 0}}
|
|
35
|
-
/* src:form\input.vue index:0 */
|
|
36
|
-
.snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;font-size:14px;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
|
|
37
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-
|
|
38
|
+
.snail-empty{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:150px;width:100%}.snail-empty>img{height:60px;width:60px}.snail-empty>div.message{color:#babdc2;font-weight:400;padding:0 10px 10px}
|
|
39
39
|
/* src:prompt\loading.vue index:0 */
|
|
40
40
|
.snail-loading{height:100%;left:0;position:absolute;top:0;width:100%;z-index:10000}.snail-loading.show-mask{background-color:rgba(0,0,0,.15)}.snail-loading:after,.snail-loading:before{animation:snail-loading-stretch 1s ease-in-out infinite;border-radius:50%;content:"";display:block;display:inline-block;height:10px;left:50%;margin-left:-18px;margin-top:-6px;position:absolute;top:50%;width:10px}.snail-loading:before{background-color:#279bf1}.snail-loading:after{animation-delay:-.5s;background:#64d214;margin-left:0;margin-right:-18px}@keyframes snail-loading-stretch{0%,to{transform:scale(1)}50%{transform:scale(2)}}.snail-loading-enter-active,.snail-loading-leave-active{transition:opacity .5s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
|
|
41
|
-
/* src:popup\components\dialog-container.vue index:0 */
|
|
42
|
-
.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)}
|
|
43
41
|
/* src:popup\components\confirm-container.vue index:0 */
|
|
44
|
-
.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;
|
|
45
|
-
/* src:popup\components\toast-container.vue index:0 */
|
|
46
|
-
.snail-toast{background:rgba(0,0,0,.7);border-radius:10px;color:#fff;display:flex;left:50%;max-height:200px;max-width:400px;min-width:200px;overflow:hidden;padding:20px 35px 20px 15px;position:fixed;top:50%;transform:translate(-50%,-50%)}.snail-toast>svg.close-icon{position:absolute;right:10px;top:12px}.snail-toast>div.icon{align-items:center;align-self:center;background:hsla(0,0%,100%,.15);border-radius:50%;display:flex;height:26px;justify-content:center;margin-right:6px;width:26px}.snail-toast>div.icon>svg{background:#fff;border-radius:50%;cursor:none!important}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
42
|
+
.snail-confirm{background-color:#fff;border-radius:4px;color:#2e2f33;display:flex;flex-direction:column;max-height:350px;max-width:548px;min-width:348px}.snail-confirm>div.confirm-body{flex:1;margin:20px 40px;overflow:auto;word-wrap:break-word}
|
|
47
43
|
/* src:popup\components\follow-container.vue index:0 */
|
|
48
44
|
.snail-follow{background-color:#fff;display:inline-block;max-height:100%;max-width:100%;position:fixed;transition-duration:.5s;transition-property:left,top;transition-timing-function:ease}
|
|
45
|
+
/* src:popup\components\dialog-container.vue index:0 */
|
|
46
|
+
.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)}
|
|
49
47
|
/* src:popup\components\popup-container.vue index:0 */
|
|
50
48
|
.snail-popup{left:0;position:fixed;top:0}
|
|
49
|
+
/* src:popup\components\toast-container.vue index:0 */
|
|
50
|
+
.snail-toast{background:rgba(0,0,0,.7);border-radius:10px;color:#fff;display:flex;left:50%;max-height:200px;max-width:400px;min-width:200px;overflow:hidden;padding:20px 35px 20px 15px;position:fixed;top:50%;transform:translate(-50%,-50%)}.snail-toast>svg.close-icon{position:absolute;right:10px;top:12px}.snail-toast>div.icon{align-items:center;align-self:center;background:hsla(0,0%,100%,.15);border-radius:50%;display:flex;height:26px;justify-content:center;margin-right:6px;width:26px}.snail-toast>div.icon>svg{background:#fff;border-radius:50%;cursor:none!important}.snail-toast>div.message{flex:1;line-height:24px;overflow:hidden;word-break:break-all}
|
|
51
51
|
/* src:container\components\tree-node.vue index:0 */
|
|
52
52
|
.snail-tree-node{align-items:center;display:flex;flex-wrap:nowrap;height:40px;width:100%}.snail-tree-node:hover{background-color:#f8f9fa}.snail-tree-node>.indent,.snail-tree-node>.node-slot,.snail-tree-node>.snail-icon{flex-shrink:0}.snail-tree-node>.node-fold{align-items:center;display:flex;height:100%;justify-content:center;width:24px}.snail-tree-node>.node-fold>.snail-icon{transition:transform .1s ease-in}.snail-tree-node>.node-fold>.snail-icon.fold{transform:rotate(-90deg)}.snail-tree-node>.node-slot,.snail-tree-node>.node-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.snail-tree-node>.node-text{color:#2e3033;flex:1;min-width:30px}.snail-tree-node.clickable>.node-text{cursor:pointer}.snail-tree-children{width:100%}.snail-tree-node.level-1>.indent{padding-left:4px}.snail-tree-node.level-2>.indent{padding-left:24px}.snail-tree-node.level-3>.indent{padding-left:48px}.snail-tree-node.level-4>.indent{padding-left:72px}.snail-tree-node.level-5>.indent{padding-left:96px}.snail-tree-node.level-6>.indent{padding-left:120px}.snail-tree-node.level-7>.indent{padding-left:144px}.snail-tree-node.level-8>.indent{padding-left:168px}.snail-tree-node.level-9>.indent{padding-left:192px}.snail-tree-node.level-10>.indent{padding-left:216px}
|
|
53
53
|
/* src:base\components\select-popup.vue index:0 */
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "依赖【snail】,基于vue封装常用UI组件",
|
|
4
4
|
"author": "snail_dev@163.com",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.40",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/snail.vue.js",
|
|
9
9
|
"module": "dist/snail.vue.js",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"vue": "^3.5.14",
|
|
17
|
-
"snail.core": ">=2.0.
|
|
18
|
-
"snail.view": ">=1.0.
|
|
17
|
+
"snail.core": ">=2.0.12",
|
|
18
|
+
"snail.view": ">=1.0.20",
|
|
19
19
|
"sortablejs": ">=1.15.6"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|