snail.vue 1.0.49 → 1.0.50

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.
@@ -96,6 +96,17 @@ type DisabledOptions = {
96
96
  */
97
97
  disabled?: boolean;
98
98
  };
99
+ /**
100
+ * 值 配置选项
101
+ */
102
+ type ValueOptions<T> = {
103
+ /**
104
+ * 已有值
105
+ * - 用于渲染组件时,传入已有数据;
106
+ * - 具体传值规则,有组件自己决定
107
+ */
108
+ value?: T;
109
+ };
99
110
  /**
100
111
  * 确认区域 配置选项
101
112
  * - 约束 确认区域 的 确定、取消 按钮
@@ -802,7 +813,7 @@ type SelectBaseOptions<T> = {
802
813
  type SelectBaseEvents<T> = {
803
814
  /**
804
815
  * 选中的【选择项】改变时
805
- * - @param values 已选的【选择项】:单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
816
+ * - @param values 已选的【选择项】,未选中则为空数组:单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
806
817
  */
807
818
  change: [values: SelectItem<T>[]];
808
819
  };
@@ -819,23 +830,9 @@ type SelectItem<T> = TreeNode<T, TreeNodeExtend & {
819
830
  }>;
820
831
  /**
821
832
  * 选项菜单组件 配置选项
833
+ * - value 已选的【选择项】;单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
822
834
  */
823
- type SelectOptions<T> = ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<T> & {
824
- /** 父类<see cref="SelectBaseOptions"/>已有属性:
825
- * items 【选择项】集合
826
- * search 启用 【搜索】功能
827
- * searchPlaceholder 搜索框提示语
828
- * multiple 是否【多选模式】
829
- * showPath 显示选项路径
830
- * popupStyle 弹出的选项选择窗体样式
831
- */
832
- /**
833
- * 禁用【值的路径】
834
- * - 仅在 multiple 不为 true 时生效
835
- * - 为true时,则v-model绑定时为单个值而非数组
836
- */
837
- valuePathDisabled?: boolean;
838
- };
835
+ type SelectOptions<T> = ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<T> & ValueOptions<SelectItem<T>[]> & {};
839
836
  /**
840
837
  * 选项菜单 组件 事件
841
838
  */
@@ -1918,16 +1915,10 @@ declare const components: {
1918
1915
  "onUpdate:modelValue"?: (value: string) => any;
1919
1916
  }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
1920
1917
  Select: {
1921
- new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1922
- valuePathDisabled?: boolean;
1923
- } & {
1924
- modelValue?: SelectItem<any>[] | SelectItem<any>;
1925
- }> & Readonly<{
1918
+ new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<SelectOptions<any>> & Readonly<{
1926
1919
  onChange?: (values: SelectItem<any>[]) => any;
1927
- "onUpdate:modelValue"?: (value: SelectItem<any> | SelectItem<any>[]) => any;
1928
1920
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1929
1921
  change: (values: SelectItem<any>[]) => any;
1930
- "update:modelValue": (value: SelectItem<any> | SelectItem<any>[]) => any;
1931
1922
  }, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
1932
1923
  P: {};
1933
1924
  B: {};
@@ -1935,27 +1926,16 @@ declare const components: {
1935
1926
  C: {};
1936
1927
  M: {};
1937
1928
  Defaults: {};
1938
- }, Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1939
- valuePathDisabled?: boolean;
1940
- } & {
1941
- modelValue?: SelectItem<any>[] | SelectItem<any>;
1942
- }> & Readonly<{
1929
+ }, Readonly<SelectOptions<any>> & Readonly<{
1943
1930
  onChange?: (values: SelectItem<any>[]) => any;
1944
- "onUpdate:modelValue"?: (value: SelectItem<any> | SelectItem<any>[]) => any;
1945
1931
  }>, {}, {}, {}, {}, {}>;
1946
1932
  __isFragment?: never;
1947
1933
  __isTeleport?: never;
1948
1934
  __isSuspense?: never;
1949
- } & vue.ComponentOptionsBase<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1950
- valuePathDisabled?: boolean;
1951
- } & {
1952
- modelValue?: SelectItem<any>[] | SelectItem<any>;
1953
- }> & Readonly<{
1935
+ } & vue.ComponentOptionsBase<Readonly<SelectOptions<any>> & Readonly<{
1954
1936
  onChange?: (values: SelectItem<any>[]) => any;
1955
- "onUpdate:modelValue"?: (value: SelectItem<any> | SelectItem<any>[]) => any;
1956
1937
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1957
1938
  change: (values: SelectItem<any>[]) => any;
1958
- "update:modelValue": (value: SelectItem<any> | SelectItem<any>[]) => any;
1959
1939
  }, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
1960
1940
  $slots: {
1961
1941
  default?: (props: {
@@ -2383,4 +2363,4 @@ declare const components: {
2383
2363
  };
2384
2364
 
2385
2365
  export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
2386
- export type { ButtonOptions, ChangeEvents, ChooseEvents, ChooseItem, ChooseOptions, ClickEvents, CloseEvents, ComponentBindOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DeleteEvents, DialogHandle, DialogOptions, DisabledOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, EventsType, FoldEvents, FoldOptions, FoldStatus, FollowElectResult, FollowExtend, FollowHandle, FollowOptions, FollowStrategy, FollowStrategyOptions, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, ISelectContext, ITreeBaseContext, IconOptions, IconType, InputEvents, InputOptions, LayoutOptions, LoadingOptions, MessageOptions, MoveEvents, PlaceholderOptions, PopupDescriptor, PopupHandle, PopupOptions, PopupStatus, PopupStatusOptions, PropsType, ReactiveVar, ReadonlyOptions, ScrollEvents, ScrollOptions, ScrollStatus, SearchEvents, SearchOptions, SelectBaseEvents, SelectBaseOptions, SelectEvents, SelectItem, SelectNodeEvents, SelectNodeOptions, SelectOptions, SelectPopupEvents, SelectPopupExtend, SelectPopupOptions, SelectSlotOptions, SortEvents, SortOptions, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, TitleOptions, ToastOptions, TreeEvents, TreeNode, TreeNodeEvents, TreeNodeExtend, TreeNodeModel, TreeNodeOptions, TreeNodeRenderOptions, TreeNodeSlotOptions, TreeOptions, TreeSearchResult, WrapperEvents, WrapperOptions };
2366
+ export type { ButtonOptions, ChangeEvents, ChooseEvents, ChooseItem, ChooseOptions, ClickEvents, CloseEvents, ComponentBindOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DeleteEvents, DialogHandle, DialogOptions, DisabledOptions, DragVerifyInfo, DragVerifyOptions, EmptyOptions, EventsType, FoldEvents, FoldOptions, FoldStatus, FollowElectResult, FollowExtend, FollowHandle, FollowOptions, FollowStrategy, FollowStrategyOptions, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, IPopupManager, IReactiveManager, ISelectContext, ITreeBaseContext, IconOptions, IconType, InputEvents, InputOptions, LayoutOptions, LoadingOptions, MessageOptions, MoveEvents, PlaceholderOptions, PopupDescriptor, PopupHandle, PopupOptions, PopupStatus, PopupStatusOptions, PropsType, ReactiveVar, ReadonlyOptions, ScrollEvents, ScrollOptions, ScrollStatus, SearchEvents, SearchOptions, SelectBaseEvents, SelectBaseOptions, SelectEvents, SelectItem, SelectNodeEvents, SelectNodeOptions, SelectOptions, SelectPopupEvents, SelectPopupExtend, SelectPopupOptions, SelectSlotOptions, SortEvents, SortOptions, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, TitleOptions, ToastOptions, TreeEvents, TreeNode, TreeNodeEvents, TreeNodeExtend, TreeNodeModel, TreeNodeOptions, TreeNodeRenderOptions, TreeNodeSlotOptions, TreeOptions, TreeSearchResult, ValueOptions, WrapperEvents, WrapperOptions };
package/dist/snail.vue.js CHANGED
@@ -1190,6 +1190,119 @@ function usePopup() {
1190
1190
  return Object.freeze(manager);
1191
1191
  }
1192
1192
 
1193
+ function useTreeContext(nodes, activeNodeRef) {
1194
+ const failed = shallowRef();
1195
+ const patched = shallowRef();
1196
+ const nodeKeyMap = new Map();
1197
+ function doSearch(text) {
1198
+ text = isStringNotEmpty(text) ? text.toLowerCase() : void 0;
1199
+ const result = searchTree(nodes, text);
1200
+ failed.value = result.failed;
1201
+ patched.value = result.patched;
1202
+ }
1203
+ function isActived(node) {
1204
+ return activeNodeRef && activeNodeRef.value == node;
1205
+ }
1206
+ function isPatched(node) {
1207
+ return patched.value ? patched.value.includes(node) : false;
1208
+ }
1209
+ function isShow(node, needPatched) {
1210
+ if (node.hidden == true) {
1211
+ return false;
1212
+ }
1213
+ if (failed.value == void 0 || failed.value.includes(node) == false) {
1214
+ return true;
1215
+ }
1216
+ return needPatched == true ? isPatched(node) : false;
1217
+ }
1218
+ function isShowChildren(node, needPatched) {
1219
+ return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
1220
+ }
1221
+ function getPath(node) {
1222
+ return searchPath(nodes, node);
1223
+ }
1224
+ function getKey(node) {
1225
+ nodeKeyMap.has(node) || nodeKeyMap.set(node, newId());
1226
+ return nodeKeyMap.get(node);
1227
+ }
1228
+ const context = mountScope({
1229
+ doSearch,
1230
+ isActived,
1231
+ isPatched,
1232
+ isShow,
1233
+ isShowChildren,
1234
+ getPath,
1235
+ getKey
1236
+ }, "ITreeBaseContext");
1237
+ context.onDestroy(() => {
1238
+ failed.value = void 0;
1239
+ patched.value = void 0;
1240
+ });
1241
+ return Object.freeze(context);
1242
+ }
1243
+ function searchTree(nodes, text) {
1244
+ const result = Object.freeze({
1245
+ matched: [],
1246
+ failed: [],
1247
+ patched: []
1248
+ });
1249
+ for (const node of nodes || []) {
1250
+ const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
1251
+ matched ? result.matched.push(node) : result.failed.push(node);
1252
+ var childMatched = false;
1253
+ if (hasAny(node.children) == true) {
1254
+ const childResult = searchTree(node.children, text);
1255
+ result.matched.push(...childResult.matched);
1256
+ result.failed.push(...childResult.failed);
1257
+ result.patched.push(...childResult.patched);
1258
+ childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
1259
+ }
1260
+ childMatched && matched == false && result.patched.push(node);
1261
+ }
1262
+ return result;
1263
+ }
1264
+ function searchPath(nodes, target) {
1265
+ for (const node of nodes || []) {
1266
+ if (target === node) {
1267
+ return [node];
1268
+ }
1269
+ }
1270
+ for (const node of nodes || []) {
1271
+ const childPath = searchPath(node.children, target);
1272
+ if (childPath.length > 0) {
1273
+ return [node, ...childPath];
1274
+ }
1275
+ }
1276
+ return [];
1277
+ }
1278
+
1279
+ function useSelectContext(items, selectsRef) {
1280
+ function selected(multiple, item) {
1281
+ if (selectsRef.value) {
1282
+ return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
1283
+ }
1284
+ return false;
1285
+ }
1286
+ function selectedText(multiple, showPath) {
1287
+ if (selectsRef.value && selectsRef.value.length) {
1288
+ return multiple == true || showPath == true ? selectsRef.value.map(item => item.text).join(multiple ? "、" : " / ") : selectsRef.value[selectsRef.value.length - 1].text;
1289
+ }
1290
+ return "";
1291
+ }
1292
+ const context = Object.create(null);
1293
+ {
1294
+ const treeContxt = useTreeContext(items);
1295
+ Object.assign(context, treeContxt, {
1296
+ selected,
1297
+ selectedText
1298
+ });
1299
+ mountScope(context, "ISelectContext");
1300
+ treeContxt.onDestroy(() => context.destroyed || context.destroy());
1301
+ context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1302
+ }
1303
+ return Object.freeze(context);
1304
+ }
1305
+
1193
1306
  function getTwoArrowIconDraw() {
1194
1307
  return "M759.467 533.333L469.333 243.2l29.867-29.867 320 320-320 320-29.867-29.866 290.134-290.134z m-298.667 0L170.667 243.2l29.866-29.867 320 320-320 320-29.866-29.866L460.8 533.333z";
1195
1308
  }
@@ -1364,12 +1477,13 @@ var _sfc_main$e = defineComponent({
1364
1477
  "text-tips": itemsRef.value.length == 0,
1365
1478
  "has-group": itemsRef.value.find(node => node.type == "group") != void 0
1366
1479
  }));
1367
- const needClearButton = props.multiple == true ? props.level == 1 : props.level == 1 && isStringNotEmpty(context.selectedText(false, props.showPath));
1368
- const showClearButtonRef = computed(() => needClearButton && props.showClear && (props.multiple ? context.selectedText(true, props.showPath) : true));
1369
- const childDestroyTimerRef = shallowRef(void 0);
1370
1480
  var mouseStatus = "Leave";
1371
- var childFollowTargetDom = void 0;
1372
1481
  var childFollowScope = void 0;
1482
+ var childFollowTargetDom = void 0;
1483
+ const childDestroyTimerRef = shallowRef(void 0);
1484
+ const clearButtonClickedRef = shallowRef(false);
1485
+ const needClearButton = props.multiple == true ? props.level == 1 : props.level == 1 && isStringNotEmpty(context.selectedText(false, props.showPath));
1486
+ const showClearButtonRef = computed(() => needClearButton && props.showClear && (props.multiple ? clearButtonClickedRef.value || context.selectedText(true, props.showPath) : true));
1373
1487
  function watchOptionsChange() {
1374
1488
  const inValid = props.multiple == true && itemsRef.value && itemsRef.value.some(item => item.children && item.children.length > 0);
1375
1489
  if (inValid == true) {
@@ -1454,6 +1568,7 @@ var _sfc_main$e = defineComponent({
1454
1568
  }
1455
1569
  function onClearAllClick() {
1456
1570
  emits("clear");
1571
+ clearButtonClickedRef.value = true;
1457
1572
  props.closePopup([]);
1458
1573
  }
1459
1574
  {
@@ -1500,119 +1615,6 @@ var _sfc_main$e = defineComponent({
1500
1615
  }
1501
1616
  });
1502
1617
 
1503
- function useTreeContext(nodes, activeNodeRef) {
1504
- const failed = shallowRef();
1505
- const patched = shallowRef();
1506
- const nodeKeyMap = new Map();
1507
- function doSearch(text) {
1508
- text = isStringNotEmpty(text) ? text.toLowerCase() : void 0;
1509
- const result = searchTree(nodes, text);
1510
- failed.value = result.failed;
1511
- patched.value = result.patched;
1512
- }
1513
- function isActived(node) {
1514
- return activeNodeRef && activeNodeRef.value == node;
1515
- }
1516
- function isPatched(node) {
1517
- return patched.value ? patched.value.includes(node) : false;
1518
- }
1519
- function isShow(node, needPatched) {
1520
- if (node.hidden == true) {
1521
- return false;
1522
- }
1523
- if (failed.value == void 0 || failed.value.includes(node) == false) {
1524
- return true;
1525
- }
1526
- return needPatched == true ? isPatched(node) : false;
1527
- }
1528
- function isShowChildren(node, needPatched) {
1529
- return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
1530
- }
1531
- function getPath(node) {
1532
- return searchPath(nodes, node);
1533
- }
1534
- function getKey(node) {
1535
- nodeKeyMap.has(node) || nodeKeyMap.set(node, newId());
1536
- return nodeKeyMap.get(node);
1537
- }
1538
- const context = mountScope({
1539
- doSearch,
1540
- isActived,
1541
- isPatched,
1542
- isShow,
1543
- isShowChildren,
1544
- getPath,
1545
- getKey
1546
- }, "ITreeBaseContext");
1547
- context.onDestroy(() => {
1548
- failed.value = void 0;
1549
- patched.value = void 0;
1550
- });
1551
- return Object.freeze(context);
1552
- }
1553
- function searchTree(nodes, text) {
1554
- const result = Object.freeze({
1555
- matched: [],
1556
- failed: [],
1557
- patched: []
1558
- });
1559
- for (const node of nodes || []) {
1560
- const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
1561
- matched ? result.matched.push(node) : result.failed.push(node);
1562
- var childMatched = false;
1563
- if (hasAny(node.children) == true) {
1564
- const childResult = searchTree(node.children, text);
1565
- result.matched.push(...childResult.matched);
1566
- result.failed.push(...childResult.failed);
1567
- result.patched.push(...childResult.patched);
1568
- childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
1569
- }
1570
- childMatched && matched == false && result.patched.push(node);
1571
- }
1572
- return result;
1573
- }
1574
- function searchPath(nodes, target) {
1575
- for (const node of nodes || []) {
1576
- if (target === node) {
1577
- return [node];
1578
- }
1579
- }
1580
- for (const node of nodes || []) {
1581
- const childPath = searchPath(node.children, target);
1582
- if (childPath.length > 0) {
1583
- return [node, ...childPath];
1584
- }
1585
- }
1586
- return [];
1587
- }
1588
-
1589
- function useSelectContext(items, selectsRef) {
1590
- function selected(multiple, item) {
1591
- if (selectsRef.value) {
1592
- return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
1593
- }
1594
- return false;
1595
- }
1596
- function selectedText(multiple, showPath) {
1597
- if (selectsRef.value && selectsRef.value.length) {
1598
- return multiple == true || showPath == true ? selectsRef.value.map(item => item.text).join(multiple ? "、" : " / ") : selectsRef.value[selectsRef.value.length - 1].text;
1599
- }
1600
- return "";
1601
- }
1602
- const context = Object.create(null);
1603
- {
1604
- const treeContxt = useTreeContext(items);
1605
- Object.assign(context, treeContxt, {
1606
- selected,
1607
- selectedText
1608
- });
1609
- mountScope(context, "ISelectContext");
1610
- treeContxt.onDestroy(() => context.destroyed || context.destroy());
1611
- context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1612
- }
1613
- return Object.freeze(context);
1614
- }
1615
-
1616
1618
  const _hoisted_1$7 = {
1617
1619
  key: 0,
1618
1620
  class: "select-result"
@@ -1632,7 +1634,7 @@ var _sfc_main$d = defineComponent({
1632
1634
  inheritAttrs: true
1633
1635
  },
1634
1636
  __name: "select",
1635
- props: mergeModels({
1637
+ props: {
1636
1638
  readonly: {
1637
1639
  type: Boolean
1638
1640
  },
@@ -1649,21 +1651,15 @@ var _sfc_main$d = defineComponent({
1649
1651
  type: Boolean
1650
1652
  },
1651
1653
  popupStyle: {},
1652
- valuePathDisabled: {
1653
- type: Boolean
1654
- }
1655
- }, {
1656
- "modelValue": {},
1657
- "modelModifiers": {}
1658
- }),
1659
- emits: mergeModels(["change"], ["update:modelValue"]),
1654
+ value: {}
1655
+ },
1656
+ emits: ["change"],
1660
1657
  setup(__props, _ref) {
1661
1658
  let {
1662
1659
  emit: __emit
1663
1660
  } = _ref;
1664
1661
  const props = __props;
1665
1662
  const emits = __emit;
1666
- const valuesModel = useModel(__props, "modelValue");
1667
1663
  const {
1668
1664
  follow
1669
1665
  } = usePopup();
@@ -1671,7 +1667,7 @@ var _sfc_main$d = defineComponent({
1671
1667
  onTimeout
1672
1668
  } = useTimer();
1673
1669
  const rootDom = useTemplateRef("select");
1674
- const selectedItemsRef = computed(() => valuesModel.value ? Array.isArray(valuesModel.value) ? valuesModel.value : [valuesModel.value] : []);
1670
+ const selectedItemsRef = shallowRef(Array.isArray(props.value) ? [...props.value] : []);
1675
1671
  const context = useSelectContext(props.items, selectedItemsRef);
1676
1672
  const selectedTextRef = computed(() => context.selectedText(props.multiple, props.showPath));
1677
1673
  const slotOptions = Object.freeze({
@@ -1679,14 +1675,22 @@ var _sfc_main$d = defineComponent({
1679
1675
  });
1680
1676
  var followScope = void 0;
1681
1677
  var stopPropagationScope = void 0;
1682
- function updateModelValue(newValue, eventValues) {
1683
- if (valuesModel.value != newValue) {
1684
- valuesModel.value = newValue;
1685
- nextTick(() => emits("change", eventValues));
1678
+ function updateSelectedItems(values) {
1679
+ values = values || [];
1680
+ var isChange = true;
1681
+ if (values.length == (selectedItemsRef.value || []).length) {
1682
+ isChange = false;
1683
+ for (let index = 0; index < values.length; index++) {
1684
+ isChange = values[index] != selectedItemsRef.value[index];
1685
+ if (isChange) {
1686
+ break;
1687
+ }
1688
+ }
1689
+ }
1690
+ if (isChange == true) {
1691
+ selectedItemsRef.value = [...values];
1692
+ nextTick(() => emits("change", values));
1686
1693
  }
1687
- }
1688
- function isSingleValue() {
1689
- return props.multiple != true && props.valuePathDisabled == true;
1690
1694
  }
1691
1695
  function destroyFollow() {
1692
1696
  if (followScope != void 0) {
@@ -1700,7 +1704,7 @@ var _sfc_main$d = defineComponent({
1700
1704
  closeFollow && destroyFollow();
1701
1705
  stopPropagationScope && stopPropagationScope.destroy();
1702
1706
  stopPropagationScope = stopPropagation ? onTimeout(() => stopPropagationScope = void 0, 200) : void 0;
1703
- updateModelValue(isSingleValue() ? void 0 : [], []);
1707
+ updateSelectedItems([]);
1704
1708
  }
1705
1709
  async function onClick() {
1706
1710
  if (props.readonly == true || rootDom.value == void 0 || isArrayNotEmpty(props.items) == false) {
@@ -1709,8 +1713,6 @@ var _sfc_main$d = defineComponent({
1709
1713
  if (destroyFollow() == true || stopPropagationScope != void 0) {
1710
1714
  return;
1711
1715
  }
1712
- const values = [...selectedItemsRef.value];
1713
- props.multiple != true && values.length > 1 && values.splice(0, values.length - 1);
1714
1716
  context.doSearch(void 0);
1715
1717
  followScope = follow(rootDom.value, {
1716
1718
  name: "SelectPopup",
@@ -1743,12 +1745,9 @@ var _sfc_main$d = defineComponent({
1743
1745
  if (node) {
1744
1746
  path = [...selectedItemsRef.value];
1745
1747
  removeFromArray(path, node) == -1 && path.push(node);
1746
- updateModelValue(path, path);
1747
1748
  }
1748
- } else {
1749
- const newValue = isSingleValue() ? path[path.length - 1] : path;
1750
- updateModelValue(newValue, path);
1751
1749
  }
1750
+ updateSelectedItems(path);
1752
1751
  }
1753
1752
  return (_ctx, _cache) => {
1754
1753
  return openBlock(), createElementBlock("div", {
@@ -2015,6 +2014,17 @@ var _sfc_main$a = defineComponent({
2015
2014
  events.ybar && emits("ybar", ...events.ybar);
2016
2015
  events.top && emits("top");
2017
2016
  events.bottom && emits("bottom");
2017
+ if (rootDom.value) {
2018
+ rootDom.value.classList.remove("x-bar", "y-bar", "left", "right", "top", "bottom");
2019
+ const classes = [];
2020
+ status.xbar && classes.push("x-bar");
2021
+ status.ybar && classes.push("y-bar");
2022
+ status.left && classes.push("left");
2023
+ status.right && classes.push("right");
2024
+ status.top && classes.push("top");
2025
+ status.bottom && classes.push("bottom");
2026
+ classes.length && rootDom.value.classList.add(...classes);
2027
+ }
2018
2028
  }
2019
2029
  onMounted(() => {
2020
2030
  refreshScrollInfo();
@@ -1192,6 +1192,119 @@
1192
1192
  return Object.freeze(manager);
1193
1193
  }
1194
1194
 
1195
+ function useTreeContext(nodes, activeNodeRef) {
1196
+ const failed = vue.shallowRef();
1197
+ const patched = vue.shallowRef();
1198
+ const nodeKeyMap = new Map();
1199
+ function doSearch(text) {
1200
+ text = snail_core.isStringNotEmpty(text) ? text.toLowerCase() : void 0;
1201
+ const result = searchTree(nodes, text);
1202
+ failed.value = result.failed;
1203
+ patched.value = result.patched;
1204
+ }
1205
+ function isActived(node) {
1206
+ return activeNodeRef && activeNodeRef.value == node;
1207
+ }
1208
+ function isPatched(node) {
1209
+ return patched.value ? patched.value.includes(node) : false;
1210
+ }
1211
+ function isShow(node, needPatched) {
1212
+ if (node.hidden == true) {
1213
+ return false;
1214
+ }
1215
+ if (failed.value == void 0 || failed.value.includes(node) == false) {
1216
+ return true;
1217
+ }
1218
+ return needPatched == true ? isPatched(node) : false;
1219
+ }
1220
+ function isShowChildren(node, needPatched) {
1221
+ return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
1222
+ }
1223
+ function getPath(node) {
1224
+ return searchPath(nodes, node);
1225
+ }
1226
+ function getKey(node) {
1227
+ nodeKeyMap.has(node) || nodeKeyMap.set(node, snail_core.newId());
1228
+ return nodeKeyMap.get(node);
1229
+ }
1230
+ const context = snail_core.mountScope({
1231
+ doSearch,
1232
+ isActived,
1233
+ isPatched,
1234
+ isShow,
1235
+ isShowChildren,
1236
+ getPath,
1237
+ getKey
1238
+ }, "ITreeBaseContext");
1239
+ context.onDestroy(() => {
1240
+ failed.value = void 0;
1241
+ patched.value = void 0;
1242
+ });
1243
+ return Object.freeze(context);
1244
+ }
1245
+ function searchTree(nodes, text) {
1246
+ const result = Object.freeze({
1247
+ matched: [],
1248
+ failed: [],
1249
+ patched: []
1250
+ });
1251
+ for (const node of nodes || []) {
1252
+ const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
1253
+ matched ? result.matched.push(node) : result.failed.push(node);
1254
+ var childMatched = false;
1255
+ if (snail_core.hasAny(node.children) == true) {
1256
+ const childResult = searchTree(node.children, text);
1257
+ result.matched.push(...childResult.matched);
1258
+ result.failed.push(...childResult.failed);
1259
+ result.patched.push(...childResult.patched);
1260
+ childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
1261
+ }
1262
+ childMatched && matched == false && result.patched.push(node);
1263
+ }
1264
+ return result;
1265
+ }
1266
+ function searchPath(nodes, target) {
1267
+ for (const node of nodes || []) {
1268
+ if (target === node) {
1269
+ return [node];
1270
+ }
1271
+ }
1272
+ for (const node of nodes || []) {
1273
+ const childPath = searchPath(node.children, target);
1274
+ if (childPath.length > 0) {
1275
+ return [node, ...childPath];
1276
+ }
1277
+ }
1278
+ return [];
1279
+ }
1280
+
1281
+ function useSelectContext(items, selectsRef) {
1282
+ function selected(multiple, item) {
1283
+ if (selectsRef.value) {
1284
+ return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
1285
+ }
1286
+ return false;
1287
+ }
1288
+ function selectedText(multiple, showPath) {
1289
+ if (selectsRef.value && selectsRef.value.length) {
1290
+ return multiple == true || showPath == true ? selectsRef.value.map(item => item.text).join(multiple ? "、" : " / ") : selectsRef.value[selectsRef.value.length - 1].text;
1291
+ }
1292
+ return "";
1293
+ }
1294
+ const context = Object.create(null);
1295
+ {
1296
+ const treeContxt = useTreeContext(items);
1297
+ Object.assign(context, treeContxt, {
1298
+ selected,
1299
+ selectedText
1300
+ });
1301
+ snail_core.mountScope(context, "ISelectContext");
1302
+ treeContxt.onDestroy(() => context.destroyed || context.destroy());
1303
+ context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1304
+ }
1305
+ return Object.freeze(context);
1306
+ }
1307
+
1195
1308
  function getTwoArrowIconDraw() {
1196
1309
  return "M759.467 533.333L469.333 243.2l29.867-29.867 320 320-320 320-29.867-29.866 290.134-290.134z m-298.667 0L170.667 243.2l29.866-29.867 320 320-320 320-29.866-29.866L460.8 533.333z";
1197
1310
  }
@@ -1366,12 +1479,13 @@
1366
1479
  "text-tips": itemsRef.value.length == 0,
1367
1480
  "has-group": itemsRef.value.find(node => node.type == "group") != void 0
1368
1481
  }));
1369
- const needClearButton = props.multiple == true ? props.level == 1 : props.level == 1 && snail_core.isStringNotEmpty(context.selectedText(false, props.showPath));
1370
- const showClearButtonRef = vue.computed(() => needClearButton && props.showClear && (props.multiple ? context.selectedText(true, props.showPath) : true));
1371
- const childDestroyTimerRef = vue.shallowRef(void 0);
1372
1482
  var mouseStatus = "Leave";
1373
- var childFollowTargetDom = void 0;
1374
1483
  var childFollowScope = void 0;
1484
+ var childFollowTargetDom = void 0;
1485
+ const childDestroyTimerRef = vue.shallowRef(void 0);
1486
+ const clearButtonClickedRef = vue.shallowRef(false);
1487
+ const needClearButton = props.multiple == true ? props.level == 1 : props.level == 1 && snail_core.isStringNotEmpty(context.selectedText(false, props.showPath));
1488
+ const showClearButtonRef = vue.computed(() => needClearButton && props.showClear && (props.multiple ? clearButtonClickedRef.value || context.selectedText(true, props.showPath) : true));
1375
1489
  function watchOptionsChange() {
1376
1490
  const inValid = props.multiple == true && itemsRef.value && itemsRef.value.some(item => item.children && item.children.length > 0);
1377
1491
  if (inValid == true) {
@@ -1456,6 +1570,7 @@
1456
1570
  }
1457
1571
  function onClearAllClick() {
1458
1572
  emits("clear");
1573
+ clearButtonClickedRef.value = true;
1459
1574
  props.closePopup([]);
1460
1575
  }
1461
1576
  {
@@ -1502,119 +1617,6 @@
1502
1617
  }
1503
1618
  });
1504
1619
 
1505
- function useTreeContext(nodes, activeNodeRef) {
1506
- const failed = vue.shallowRef();
1507
- const patched = vue.shallowRef();
1508
- const nodeKeyMap = new Map();
1509
- function doSearch(text) {
1510
- text = snail_core.isStringNotEmpty(text) ? text.toLowerCase() : void 0;
1511
- const result = searchTree(nodes, text);
1512
- failed.value = result.failed;
1513
- patched.value = result.patched;
1514
- }
1515
- function isActived(node) {
1516
- return activeNodeRef && activeNodeRef.value == node;
1517
- }
1518
- function isPatched(node) {
1519
- return patched.value ? patched.value.includes(node) : false;
1520
- }
1521
- function isShow(node, needPatched) {
1522
- if (node.hidden == true) {
1523
- return false;
1524
- }
1525
- if (failed.value == void 0 || failed.value.includes(node) == false) {
1526
- return true;
1527
- }
1528
- return needPatched == true ? isPatched(node) : false;
1529
- }
1530
- function isShowChildren(node, needPatched) {
1531
- return node.children ? node.children.find(child => isShow(child, needPatched)) != void 0 : false;
1532
- }
1533
- function getPath(node) {
1534
- return searchPath(nodes, node);
1535
- }
1536
- function getKey(node) {
1537
- nodeKeyMap.has(node) || nodeKeyMap.set(node, snail_core.newId());
1538
- return nodeKeyMap.get(node);
1539
- }
1540
- const context = snail_core.mountScope({
1541
- doSearch,
1542
- isActived,
1543
- isPatched,
1544
- isShow,
1545
- isShowChildren,
1546
- getPath,
1547
- getKey
1548
- }, "ITreeBaseContext");
1549
- context.onDestroy(() => {
1550
- failed.value = void 0;
1551
- patched.value = void 0;
1552
- });
1553
- return Object.freeze(context);
1554
- }
1555
- function searchTree(nodes, text) {
1556
- const result = Object.freeze({
1557
- matched: [],
1558
- failed: [],
1559
- patched: []
1560
- });
1561
- for (const node of nodes || []) {
1562
- const matched = node.fixed == true || text == void 0 || (node.text || "").toLowerCase().indexOf(text) != -1;
1563
- matched ? result.matched.push(node) : result.failed.push(node);
1564
- var childMatched = false;
1565
- if (snail_core.hasAny(node.children) == true) {
1566
- const childResult = searchTree(node.children, text);
1567
- result.matched.push(...childResult.matched);
1568
- result.failed.push(...childResult.failed);
1569
- result.patched.push(...childResult.patched);
1570
- childMatched = childResult.matched.length > 0 || childResult.patched.length > 0;
1571
- }
1572
- childMatched && matched == false && result.patched.push(node);
1573
- }
1574
- return result;
1575
- }
1576
- function searchPath(nodes, target) {
1577
- for (const node of nodes || []) {
1578
- if (target === node) {
1579
- return [node];
1580
- }
1581
- }
1582
- for (const node of nodes || []) {
1583
- const childPath = searchPath(node.children, target);
1584
- if (childPath.length > 0) {
1585
- return [node, ...childPath];
1586
- }
1587
- }
1588
- return [];
1589
- }
1590
-
1591
- function useSelectContext(items, selectsRef) {
1592
- function selected(multiple, item) {
1593
- if (selectsRef.value) {
1594
- return multiple == true ? selectsRef.value.includes(item) : selectsRef.value[selectsRef.value.length - 1] == item;
1595
- }
1596
- return false;
1597
- }
1598
- function selectedText(multiple, showPath) {
1599
- if (selectsRef.value && selectsRef.value.length) {
1600
- return multiple == true || showPath == true ? selectsRef.value.map(item => item.text).join(multiple ? "、" : " / ") : selectsRef.value[selectsRef.value.length - 1].text;
1601
- }
1602
- return "";
1603
- }
1604
- const context = Object.create(null);
1605
- {
1606
- const treeContxt = useTreeContext(items);
1607
- Object.assign(context, treeContxt, {
1608
- selected,
1609
- selectedText
1610
- });
1611
- snail_core.mountScope(context, "ISelectContext");
1612
- treeContxt.onDestroy(() => context.destroyed || context.destroy());
1613
- context.onDestroy(() => treeContxt.destroyed || treeContxt.destroy());
1614
- }
1615
- return Object.freeze(context);
1616
- }
1617
-
1618
1620
  const _hoisted_1$7 = {
1619
1621
  key: 0,
1620
1622
  class: "select-result"
@@ -1634,7 +1636,7 @@
1634
1636
  inheritAttrs: true
1635
1637
  },
1636
1638
  __name: "select",
1637
- props: vue.mergeModels({
1639
+ props: {
1638
1640
  readonly: {
1639
1641
  type: Boolean
1640
1642
  },
@@ -1651,21 +1653,15 @@
1651
1653
  type: Boolean
1652
1654
  },
1653
1655
  popupStyle: {},
1654
- valuePathDisabled: {
1655
- type: Boolean
1656
- }
1657
- }, {
1658
- "modelValue": {},
1659
- "modelModifiers": {}
1660
- }),
1661
- emits: vue.mergeModels(["change"], ["update:modelValue"]),
1656
+ value: {}
1657
+ },
1658
+ emits: ["change"],
1662
1659
  setup(__props, _ref) {
1663
1660
  let {
1664
1661
  emit: __emit
1665
1662
  } = _ref;
1666
1663
  const props = __props;
1667
1664
  const emits = __emit;
1668
- const valuesModel = vue.useModel(__props, "modelValue");
1669
1665
  const {
1670
1666
  follow
1671
1667
  } = usePopup();
@@ -1673,7 +1669,7 @@
1673
1669
  onTimeout
1674
1670
  } = snail_core.useTimer();
1675
1671
  const rootDom = vue.useTemplateRef("select");
1676
- const selectedItemsRef = vue.computed(() => valuesModel.value ? Array.isArray(valuesModel.value) ? valuesModel.value : [valuesModel.value] : []);
1672
+ const selectedItemsRef = vue.shallowRef(Array.isArray(props.value) ? [...props.value] : []);
1677
1673
  const context = useSelectContext(props.items, selectedItemsRef);
1678
1674
  const selectedTextRef = vue.computed(() => context.selectedText(props.multiple, props.showPath));
1679
1675
  const slotOptions = Object.freeze({
@@ -1681,14 +1677,22 @@
1681
1677
  });
1682
1678
  var followScope = void 0;
1683
1679
  var stopPropagationScope = void 0;
1684
- function updateModelValue(newValue, eventValues) {
1685
- if (valuesModel.value != newValue) {
1686
- valuesModel.value = newValue;
1687
- vue.nextTick(() => emits("change", eventValues));
1680
+ function updateSelectedItems(values) {
1681
+ values = values || [];
1682
+ var isChange = true;
1683
+ if (values.length == (selectedItemsRef.value || []).length) {
1684
+ isChange = false;
1685
+ for (let index = 0; index < values.length; index++) {
1686
+ isChange = values[index] != selectedItemsRef.value[index];
1687
+ if (isChange) {
1688
+ break;
1689
+ }
1690
+ }
1691
+ }
1692
+ if (isChange == true) {
1693
+ selectedItemsRef.value = [...values];
1694
+ vue.nextTick(() => emits("change", values));
1688
1695
  }
1689
- }
1690
- function isSingleValue() {
1691
- return props.multiple != true && props.valuePathDisabled == true;
1692
1696
  }
1693
1697
  function destroyFollow() {
1694
1698
  if (followScope != void 0) {
@@ -1702,7 +1706,7 @@
1702
1706
  closeFollow && destroyFollow();
1703
1707
  stopPropagationScope && stopPropagationScope.destroy();
1704
1708
  stopPropagationScope = stopPropagation ? onTimeout(() => stopPropagationScope = void 0, 200) : void 0;
1705
- updateModelValue(isSingleValue() ? void 0 : [], []);
1709
+ updateSelectedItems([]);
1706
1710
  }
1707
1711
  async function onClick() {
1708
1712
  if (props.readonly == true || rootDom.value == void 0 || snail_core.isArrayNotEmpty(props.items) == false) {
@@ -1711,8 +1715,6 @@
1711
1715
  if (destroyFollow() == true || stopPropagationScope != void 0) {
1712
1716
  return;
1713
1717
  }
1714
- const values = [...selectedItemsRef.value];
1715
- props.multiple != true && values.length > 1 && values.splice(0, values.length - 1);
1716
1718
  context.doSearch(void 0);
1717
1719
  followScope = follow(rootDom.value, {
1718
1720
  name: "SelectPopup",
@@ -1745,12 +1747,9 @@
1745
1747
  if (node) {
1746
1748
  path = [...selectedItemsRef.value];
1747
1749
  snail_core.removeFromArray(path, node) == -1 && path.push(node);
1748
- updateModelValue(path, path);
1749
1750
  }
1750
- } else {
1751
- const newValue = isSingleValue() ? path[path.length - 1] : path;
1752
- updateModelValue(newValue, path);
1753
1751
  }
1752
+ updateSelectedItems(path);
1754
1753
  }
1755
1754
  return (_ctx, _cache) => {
1756
1755
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -2017,6 +2016,17 @@
2017
2016
  events.ybar && emits("ybar", ...events.ybar);
2018
2017
  events.top && emits("top");
2019
2018
  events.bottom && emits("bottom");
2019
+ if (rootDom.value) {
2020
+ rootDom.value.classList.remove("x-bar", "y-bar", "left", "right", "top", "bottom");
2021
+ const classes = [];
2022
+ status.xbar && classes.push("x-bar");
2023
+ status.ybar && classes.push("y-bar");
2024
+ status.left && classes.push("left");
2025
+ status.right && classes.push("right");
2026
+ status.top && classes.push("top");
2027
+ status.bottom && classes.push("bottom");
2028
+ classes.length && rootDom.value.classList.add(...classes);
2029
+ }
2020
2030
  }
2021
2031
  vue.onMounted(() => {
2022
2032
  refreshScrollInfo();
@@ -1,55 +1,55 @@
1
1
  /* src:base\button.vue index:0 */
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
- /* src:base\footer.vue index:0 */
4
- .snail-footer{align-items:center;background-color:#fff;display:flex;flex-shrink:0;height:72px;padding:0 40px;width:100%}.snail-footer>.snail-button:nth-child(n+2){margin-left:20px}.snail-footer.start-divider{border-top:1px solid #dddfed}.snail-footer.left{justify-content:flex-start}.snail-footer.center{justify-content:center}.snail-footer.right{justify-content:flex-end}
5
3
  /* src:base\choose.vue index:0 */
6
4
  .snail-choose{align-items:center;display:flex;flex-wrap:wrap;overflow-x:hidden}.snail-choose>div.choose-item{align-items:center;cursor:pointer;display:flex;flex-shrink:0;margin:0 8px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-choose>div.choose-item:first-child{margin-left:0}.snail-choose>div.choose-item:after{content:"";height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%}.snail-choose>div.choose-item>input::checkmark{background-color:#2196f3;border-color:#2196f3}.snail-choose>div.choose-item>div.item-beautiful{align-items:center;display:flex;flex-shrink:0;justify-content:center;overflow:hidden}.snail-choose>div.choose-item>div.item-beautiful.radio{border-radius:50%;height:16px;width:16px}.snail-choose>div.choose-item>div.item-beautiful.checkbox{height:14px;width:14px}.snail-choose>div.choose-item>div.item-beautiful.item-unchecked{border:1px solid #8a9099}.snail-choose>div.choose-item>div.item-beautiful.item-checked{background-color:#4c9aff;border:1px solid #4c9aff}.snail-choose>div.choose-item>span{margin-left:4px}.snail-choose>div.choose-item>span.item-des{color:#8a9099}.snail-choose.readonly>div.choose-item{cursor:auto}.snail-choose.readonly>div.choose-item>div.item-beautiful.item-unchecked{opacity:.5}.snail-choose.readonly>div.choose-item>div.item-beautiful.item-checked{background-color:#d5d7db;border-color:#d5d7db}
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}
5
+ /* src:base\footer.vue index:0 */
6
+ .snail-footer{align-items:center;background-color:#fff;display:flex;flex-shrink:0;height:72px;padding:0 40px;width:100%}.snail-footer>.snail-button:nth-child(n+2){margin-left:20px}.snail-footer.start-divider{border-top:1px solid #dddfed}.snail-footer.left{justify-content:flex-start}.snail-footer.center{justify-content:center}.snail-footer.right{justify-content:flex-end}
9
7
  /* src:base\search.vue index:0 */
10
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}
11
9
  /* src:base\icon.vue index:0 */
12
10
  .snail-icon{cursor:pointer;opacity:1}
11
+ /* src:base\header.vue index:0 */
12
+ .snail-header{align-items:center;background-color:#fff;display:flex;flex-shrink:0;position:relative;width:100%}.snail-header>.header-title{color:#2e3033;flex:1;line-height:48px;overflow:hidden;padding:0 30px;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-header>.header-title.left{text-align:left}.snail-header>.header-title.center{text-align:center}.snail-header>.header-title.right{text-align:right}.snail-header.start-divider{border-bottom:1px solid #dddfed}.snail-header.page{height:48px}.snail-header.page>.header-title{font-size:16px;font-weight:bold}.snail-header.page>.close-icon{margin-right:18px}.snail-header.dialog{height:64px;padding-top:16px}.snail-header.dialog>.header-title{font-size:20px}.snail-header.dialog>.close-icon{position:absolute;right:8px;top:8px}
13
13
  /* src:base\select.vue index:0 */
14
14
  .snail-select{align-items:center;background-color:#fff;border:1px solid #dddfed;border-radius:4px;color:#2e3033;cursor:pointer;display:flex;height:32px;width:100%}.snail-select>div.select-result{align-items:center;display:flex;flex:1;flex-wrap:nowrap;height:30px;overflow:hidden;padding:0 10px 0 6px}.snail-select>div.select-result>div.select-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-select>svg.snail-icon{flex-shrink:0;margin-right:4px}.snail-select>div.no-items{align-items:center;cursor:text;display:flex;height:100%;padding:0 8px;width:100%}.snail-select.readonly{cursor:auto}.snail-select.readonly>svg.snail-icon{display:none}
15
- /* src:base\switch.vue index:0 */
16
- .snail-switch{border-radius:10px 10px 10px 10px;cursor:pointer;height:20px!important;overflow:hidden;position:relative;width:36px!important}.snail-switch>div{height:100%;width:100%}.snail-switch>div.on{background-color:#5ca3ff}.snail-switch>div.off{background-color:#c4c8cc;position:absolute;transition:left .2s ease}.snail-switch>div.status{background:#fff;border-radius:10px 10px 10px 10px;height:16px;position:absolute;top:2px;transition:left .2s ease;width:16px}.snail-switch.on>div.off{left:100%;top:0}.snail-switch.on>div.status{left:calc(100% - 18px)}.snail-switch.off>div.off{left:0;top:0}.snail-switch.off>div.status{left:2px}.snail-switch.readonly{cursor:not-allowed}
17
15
  /* src:container\dynamic.vue index:0 */
18
16
  .snail-dynamic-error{color:red}.snail-dynamic-error>span{color:gray}
17
+ /* src:base\switch.vue index:0 */
18
+ .snail-switch{border-radius:10px 10px 10px 10px;cursor:pointer;height:20px!important;overflow:hidden;position:relative;width:36px!important}.snail-switch>div{height:100%;width:100%}.snail-switch>div.on{background-color:#5ca3ff}.snail-switch>div.off{background-color:#c4c8cc;position:absolute;transition:left .2s ease}.snail-switch>div.status{background:#fff;border-radius:10px 10px 10px 10px;height:16px;position:absolute;top:2px;transition:left .2s ease;width:16px}.snail-switch.on>div.off{left:100%;top:0}.snail-switch.on>div.status{left:calc(100% - 18px)}.snail-switch.off>div.off{left:0;top:0}.snail-switch.off>div.status{left:2px}.snail-switch.readonly{cursor:not-allowed}
19
19
  /* src:container\fold.vue index:0 */
20
20
  .snail-fold{flex-shrink:0}.snail-fold>div.fold-header{align-items:center;display:flex;height:32px;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.snail-fold>div.fold-header:before{background-color:#2c97fb;content:"";height:18px;left:0;position:absolute;top:7px;width:4px}.snail-fold>div.fold-header>.subtitle,.snail-fold>div.fold-header>.title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.snail-fold>div.fold-header>.title{color:#2e3033;font-weight:bold;padding-left:20px}.snail-fold>div.fold-header>.subtitle{color:#8a9099;font-size:13px}.snail-fold>div.fold-header>div.status{align-items:flex-end;display:flex;flex:1;justify-content:flex-end}.snail-fold>div.fold-header>div.status>svg.snail-icon{transition:transform .2s ease}.snail-fold>div.fold-body{padding-left:20px}.snail-fold.expand>div.fold-header>div.status>svg.snail-icon{transform:rotate(-90deg)}.snail-fold.fold>div.fold-header>div.status>svg.snail-icon{transform:rotate(90deg)}
21
21
  /* src:container\scroll.vue index:0 */
22
22
  .snail-scroll{overflow:hidden}.snail-scroll.scroll-x{overflow-x:auto}.snail-scroll.scroll-y{overflow-y:auto}
23
- /* src:container\sort.vue index:0 */
24
- .snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
25
23
  /* src:container\layout.vue index:0 */
26
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\table.vue index:0 */
28
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}
29
- /* src:container\components\table-col.vue index:0 */
30
- .table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:flex-start}.table-col.center{justify-content:center}.table-col.right{justify-content:flex-end}
27
+ /* src:container\sort.vue index:0 */
28
+ .snail-sort-drag{background:#fff;border:1px solid #4c9aff;border-radius:4px;cursor:move}.snail-sort-ghost{border:1px dashed #4c9aff;border-radius:4px}
31
29
  /* src:container\components\table-row.vue index:0 */
32
30
  .table-row{align-items:center;display:flex}
33
31
  /* src:container\tree.vue index:0 */
34
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:container\components\table-col.vue index:0 */
34
+ .table-col{align-items:center;display:flex;height:100%;white-space:nowrap}.table-col.left{justify-content:flex-start}.table-col.center{justify-content:center}.table-col.right{justify-content:flex-end}
35
35
  /* src:container\wrapper.vue index:0 */
36
36
  .snail-wrapper{background-color:#fff;display:flex;flex-direction:column}.snail-wrapper>.snail-scroll{flex:1}.snail-wrapper.in-normal{flex:1;height:100%;overflow:hidden;width:100%}.snail-wrapper.in-popup{height:80%;min-width:800px;overflow:hidden;width:60%}
37
37
  /* src:form\input.vue index:0 */
38
38
  .snail-input{display:inline-flex;min-height:34px}.snail-input>.input-title{flex-shrink:0;padding-top:6px}.snail-input>.input-title>span.text{color:#2e3033}.snail-input>.input-title>span.required{color:#f74b4b;margin-left:2px}.snail-input>.input-body{align-self:start;display:flex;flex:1;height:32px}.snail-input>.input-body>input{flex:1}.snail-input>.input-body>span{background-color:red;flex-shrink:0}
39
+ /* src:prompt\loading.vue index:0 */
40
+ .snail-loading{height:100%;left:0;position:absolute;top:0;width:100%;z-index:10000}.snail-loading.show-mask{background-color:rgba(0,0,0,.15)}.snail-loading:after,.snail-loading:before{animation:snail-loading-stretch 1s ease-in-out infinite;border-radius:50%;content:"";display:block;display:inline-block;height:10px;left:50%;margin-left:-18px;margin-top:-6px;position:absolute;top:50%;width:10px}.snail-loading:before{background-color:#279bf1}.snail-loading:after{animation-delay:-.5s;background:#64d214;margin-left:0;margin-right:-18px}@keyframes snail-loading-stretch{0%,to{transform:scale(1)}50%{transform:scale(2)}}.snail-loading-enter-active,.snail-loading-leave-active{transition:opacity .3s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
39
41
  /* src:prompt\empty.vue index:0 */
40
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}
41
43
  /* src:prompt\drag-verify.vue index:0 */
42
44
  .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}}
43
- /* src:prompt\loading.vue index:0 */
44
- .snail-loading{height:100%;left:0;position:absolute;top:0;width:100%;z-index:10000}.snail-loading.show-mask{background-color:rgba(0,0,0,.15)}.snail-loading:after,.snail-loading:before{animation:snail-loading-stretch 1s ease-in-out infinite;border-radius:50%;content:"";display:block;display:inline-block;height:10px;left:50%;margin-left:-18px;margin-top:-6px;position:absolute;top:50%;width:10px}.snail-loading:before{background-color:#279bf1}.snail-loading:after{animation-delay:-.5s;background:#64d214;margin-left:0;margin-right:-18px}@keyframes snail-loading-stretch{0%,to{transform:scale(1)}50%{transform:scale(2)}}.snail-loading-enter-active,.snail-loading-leave-active{transition:opacity .3s ease-in-out}.snail-loading-enter-from,.snail-loading-leave-to{opacity:0}
45
- /* 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)}
47
45
  /* src:popup\components\confirm-container.vue index:0 */
48
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}
49
- /* src:popup\components\popup-container.vue index:0 */
50
- .snail-popup{left:0;position:fixed;top:0}
47
+ /* src:popup\components\dialog-container.vue index:0 */
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
49
  /* src:popup\components\follow-container.vue index:0 */
52
50
  .snail-follow{background-color:#fff;display:inline-block;max-height:100%;max-width:100%;position:fixed;transition-duration:.1s;transition-property:left,top;transition-timing-function:ease}.snail-follow.initial{top:100%;transition:none}
51
+ /* src:popup\components\popup-container.vue index:0 */
52
+ .snail-popup{left:0;position:fixed;top:0}
53
53
  /* src:popup\components\toast-container.vue index:0 */
54
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}
55
55
  /* src:container\components\tree-node.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.49",
6
+ "version": "1.0.50",
7
7
  "type": "module",
8
8
  "main": "dist/snail.vue.js",
9
9
  "module": "dist/snail.vue.js",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "vue": "^3.5.14",
17
- "snail.core": ">=2.0.13",
17
+ "snail.core": ">=2.0.14",
18
18
  "snail.view": ">=1.0.24",
19
19
  "sortablejs": ">=1.15.6"
20
20
  },