snail.vue 1.0.48 → 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.
package/.code-snippets CHANGED
@@ -39,5 +39,11 @@
39
39
  "scope": "html",
40
40
  "description": "公共类样式:提示文本",
41
41
  "body": "class=\"text-tips\"",
42
+ },
43
+ ".placeholder":{
44
+ "prefix": ".placeholder",
45
+ "scope": "html",
46
+ "description": "placeholder,针对div、span元素,设置placeholder样式",
47
+ "body": "placeholder",
42
48
  }
43
49
  }
@@ -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
  * - 约束 确认区域 的 确定、取消 按钮
@@ -450,6 +461,13 @@ interface ITreeBaseContext<T> {
450
461
  * @returns 从【顶级节点】->【指定节点】的全路径数据
451
462
  */
452
463
  getPath(node: TreeNode<T, TreeNodeExtend>): TreeNode<T, TreeNodeExtend>[];
464
+ /**
465
+ * 获取指定【树节点】的唯一Key值
466
+ * - 相同节点确保唯一,且不变;用于唯一标记此节点
467
+ * @param node
468
+ * @returns 返回节点唯一Key值
469
+ */
470
+ getKey(node: TreeNode<T>): string;
453
471
  }
454
472
  /**
455
473
  * 树搜索结果
@@ -777,6 +795,12 @@ type SelectBaseOptions<T> = {
777
795
  * - 仅针对【单选模式】生效
778
796
  */
779
797
  showPath?: boolean;
798
+ /**
799
+ * 是否显示【清空已选】按钮
800
+ * - true:则在弹窗的底部显示【清空已选】按钮,点击时清空所有已选选项
801
+ * - 若存在多级选项,仅在第一级弹窗中显示
802
+ */
803
+ showClear?: boolean;
780
804
  /**
781
805
  * 选择项 follow弹窗样式
782
806
  * - 支持指定弹窗高度,如最大高度,不指定则默认尽可能展示全
@@ -789,7 +813,7 @@ type SelectBaseOptions<T> = {
789
813
  type SelectBaseEvents<T> = {
790
814
  /**
791
815
  * 选中的【选择项】改变时
792
- * - @param values 已选的【选择项】:多级单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
816
+ * - @param values 已选的【选择项】,未选中则为空数组:单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
793
817
  */
794
818
  change: [values: SelectItem<T>[]];
795
819
  };
@@ -806,8 +830,9 @@ type SelectItem<T> = TreeNode<T, TreeNodeExtend & {
806
830
  }>;
807
831
  /**
808
832
  * 选项菜单组件 配置选项
833
+ * - value 已选的【选择项】;单选时,为【选择项】路径(父->子);其他情况为已选的【选择项】
809
834
  */
810
- type SelectOptions<T> = ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<T> & {};
835
+ type SelectOptions<T> = ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<T> & ValueOptions<SelectItem<T>[]> & {};
811
836
  /**
812
837
  * 选项菜单 组件 事件
813
838
  */
@@ -862,6 +887,20 @@ type SelectPopupOptions<T> = SelectBaseOptions<T> & {
862
887
  */
863
888
  level: number;
864
889
  };
890
+ /**
891
+ * 【选项菜单】 弹窗组件事件
892
+ */
893
+ type SelectPopupEvents<T> = {
894
+ /**
895
+ * 清空选项
896
+ */
897
+ clear: [];
898
+ /**
899
+ * 选项点击事件
900
+ * @param path 选中的【选择项】路径;父->子
901
+ */
902
+ click: [path: SelectItem<T>[]];
903
+ };
865
904
  /**
866
905
  * 【选项菜单】 弹窗组件扩展
867
906
  */
@@ -939,6 +978,18 @@ type IconOptions = TitleOptions & {
939
978
  * 图标大小:默认24
940
979
  */
941
980
  size?: number;
981
+ /**
982
+ * 轮廓描边颜色
983
+ * - 配合 strokeWidth 使用,完成图标加粗效果等
984
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/stroke
985
+ */
986
+ stroke?: string;
987
+ /**
988
+ * 轮廓宽度
989
+ * - 配合 stroke 使用,完成图标加粗效果等
990
+ * @see https://developer.mozilla.org/zh-CN/docs/Web/SVG/Reference/Attribute/stroke-width
991
+ */
992
+ strokeWidth?: number;
942
993
  /**
943
994
  * 图标绘制路径
944
995
  * - 等效 svg-path的d属性
@@ -968,10 +1019,12 @@ type IconOptions = TitleOptions & {
968
1019
  * - 指向类:
969
1020
  * - - arrow 向右箭头
970
1021
  * - 其他类:
1022
+ * - - plus 加号
1023
+ * - - subtract 减号
971
1024
  * - - grip 紧握图标,垂直方向,一般用于拖动句柄
972
1025
  * - - custom 自定义图标:此时IconOptions.draw属性传入绘制路径
973
1026
  */
974
- type IconType = "success" | "error" | "warn" | "close" | "trash" | "download" | "print" | "edit" | "arrow" | "grip" | "custom";
1027
+ type IconType = "success" | "error" | "warn" | "close" | "trash" | "download" | "print" | "edit" | "arrow" | "plus" | "subtract" | "grip" | "custom";
975
1028
 
976
1029
  /**
977
1030
  * 检查选项 数据结构
@@ -1231,11 +1284,11 @@ declare function triggerAppCreated(app: App, type?: AppType): App;
1231
1284
 
1232
1285
  /**
1233
1286
  * 基于类型获取Svg图标绘制路径
1234
- * @param type 图标类型
1235
- * @param color 填充颜色,不传入则使用默认的
1287
+ * @param iconType 图标类型
1288
+ * @param draw 绘制路径;自定义时生效
1236
1289
  * @returns 图标路径
1237
1290
  */
1238
- declare function getSvgDraw(options: IconOptions): string[];
1291
+ declare function getSvgDraw(iconType: IconType, draw: string[] | string): string[];
1239
1292
 
1240
1293
  /**
1241
1294
  * 排序组件 配置选项
@@ -1862,14 +1915,10 @@ declare const components: {
1862
1915
  "onUpdate:modelValue"?: (value: string) => any;
1863
1916
  }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
1864
1917
  Select: {
1865
- new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1866
- modelValue?: SelectItem<any>[];
1867
- }> & Readonly<{
1918
+ new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<SelectOptions<any>> & Readonly<{
1868
1919
  onChange?: (values: SelectItem<any>[]) => any;
1869
- "onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
1870
1920
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1871
1921
  change: (values: SelectItem<any>[]) => any;
1872
- "update:modelValue": (value: SelectItem<any>[]) => any;
1873
1922
  }, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
1874
1923
  P: {};
1875
1924
  B: {};
@@ -1877,23 +1926,16 @@ declare const components: {
1877
1926
  C: {};
1878
1927
  M: {};
1879
1928
  Defaults: {};
1880
- }, Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1881
- modelValue?: SelectItem<any>[];
1882
- }> & Readonly<{
1929
+ }, Readonly<SelectOptions<any>> & Readonly<{
1883
1930
  onChange?: (values: SelectItem<any>[]) => any;
1884
- "onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
1885
1931
  }>, {}, {}, {}, {}, {}>;
1886
1932
  __isFragment?: never;
1887
1933
  __isTeleport?: never;
1888
1934
  __isSuspense?: never;
1889
- } & vue.ComponentOptionsBase<Readonly<ReadonlyOptions & PlaceholderOptions & SelectBaseOptions<any> & {
1890
- modelValue?: SelectItem<any>[];
1891
- }> & Readonly<{
1935
+ } & vue.ComponentOptionsBase<Readonly<SelectOptions<any>> & Readonly<{
1892
1936
  onChange?: (values: SelectItem<any>[]) => any;
1893
- "onUpdate:modelValue"?: (value: SelectItem<any>[]) => any;
1894
1937
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
1895
1938
  change: (values: SelectItem<any>[]) => any;
1896
- "update:modelValue": (value: SelectItem<any>[]) => any;
1897
1939
  }, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
1898
1940
  $slots: {
1899
1941
  default?: (props: {
@@ -2321,4 +2363,4 @@ declare const components: {
2321
2363
  };
2322
2364
 
2323
2365
  export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
2324
- 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, 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 };