snail.vue 2.0.5 → 2.0.7

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.
@@ -637,6 +637,55 @@ type TreeNodeSlotOptions<Node> = {
637
637
  toggle(): void;
638
638
  };
639
639
 
640
+ /**
641
+ * Vue 动画容器组件配置选项
642
+ */
643
+ type TransitionOptions = {
644
+ /**
645
+ * 动画的自定义类样式名称
646
+ * - 默认为 `snail-transition`;不会作为 Transition的 name 属性名
647
+ * - 动画生效时组成的`class`规则为:`customClass`+动画状态;类似`snail-transition enter-from`
648
+ * - 动画状态可选值:
649
+ * |-------------------|----------------------|
650
+ * | -- |-- |
651
+ * | enter-active | 进入动画的生效状态 |
652
+ * | enter-from | 进入动画的起始状态 |
653
+ * | enter-to | 进入动画的结束状态 |
654
+ * | leave-active | 离开动画的生效状态 |
655
+ * | leave-from | 离开动画的起始状态 |
656
+ * | leave-to | 离开动画的结束状态 |
657
+ *
658
+ */
659
+ customClass?: string;
660
+ /**
661
+ * 动画效果
662
+ * - 配合 `customClass` 使用,用于标记动画的具体实现
663
+ * - 作为默认动画效果,组装出来的动画效果类似 `snail-transition fade enter-from`
664
+ * - 效果可选值;默认值 fade
665
+ * |----------------|-------------|----------------------------------|---------------------------------|
666
+ * | -- |-- |-- |-- |
667
+ * | `fade` | 淡入淡出 | 进入时 `opacity` 0-1 | 离开时 `opacity` 1 - 0 |
668
+ * | `scale` | 缩放动画 | 进入时 `scale` 0-1 | 离开时 `scale` 0 - 1 |
669
+ * | `rotate` | 旋转动画 | 进入时 `rotate` 360deg - 0 | 离开时 `rotate` 0 - 360deg |
670
+ * | `up` | 上进上出 | 进入时 `translateY` 100% - 0 | 离开时 `translateY` 0 - -100% |
671
+ * | `down` | 下进下出 | 进入时 `translateY` -100% - 0 | 离开时 `translateY` 0 - 100% |
672
+ * | `up-down` | 上进下出 | 进入时 `translateY` 100% - 0 | 离开时 `translateY` 0 - 100% |
673
+ * | `down-up` | 下进上出 | 进入时 `translateY` -100% - 0 | 离开时 `translateY` 0 - -100% |
674
+ * | `left` | 左进左出 | 进入时 `translateX` -100% - 0 | 离开时 `translateX` 0 - -100% |
675
+ * | `right` | 右进右出 | 进入时 `translateX` 100% - 0 | 离开时 `translateX` 0 - 100% |
676
+ * | `left-right` | 左进右出 | 进入时 `translateX` -100% - 0 | 离开时 `translateX` 0 - 100% |
677
+ * | `right-left` | 右进左出 | 进入时 `translateX` 100% - 0 | 离开时 `translateX` 0 - -100% |
678
+ */
679
+ effect?: TransitionEffect | Array<TransitionEffect>;
680
+ /**
681
+ * 是分组动画,还是单个动画
682
+ * - true 则使用 TransitionGroup
683
+ * - false 则使用 Transition
684
+ */
685
+ group: boolean;
686
+ };
687
+ type TransitionEffect = "fade" | "scale" | "rotate" | "up" | "down" | "up-down" | "down-up" | "left" | "right" | "left-right" | "right-left";
688
+
640
689
  /**
641
690
  * Table配置选项
642
691
  */
@@ -668,6 +717,169 @@ type TableRowOptions = HeightStyle & {};
668
717
  */
669
718
  type TableColOptions = BaseStyle & FlexBoxStyle & WidthStyle & BorderStyle & PaddingStyle;
670
719
 
720
+ /**
721
+ * 排序组件 配置选项
722
+ * - 整理部分SortableJs中的配置,不分逻辑不开放
723
+ */
724
+ type SortOptions<T> = {
725
+ /**
726
+ * 变化器
727
+ * - 在此元素值发生变化时,重新刷新排序面板
728
+ * - 如在增加元素时,改变此值实现 新元素 可拖拽排序
729
+ */
730
+ changer: T;
731
+ /**
732
+ * 拖动哪个元素
733
+ * - 传入类样式选择器;如 .table-row
734
+ */
735
+ draggable: string;
736
+ /**
737
+ * 哪个元素启动拖拽
738
+ * - 传入类样式选择器;如 .sort-handle
739
+ * - 不传入则默认 draggable
740
+ * - 若自定义,则传入 draggable 下的dom元素作为启动拖拽的句柄
741
+ */
742
+ handle?: string;
743
+ /**
744
+ * 拖动的元素上增加的类样式
745
+ * - 执行拖拽时随着鼠标移动元素,脱离文档流了
746
+ * - 可自定义一些样式实现拖动元素的高度、宽度自定义等
747
+ * - 默认:snail-sort-drag
748
+ */
749
+ dragClass?: string;
750
+ /**
751
+ * 幽灵元素类样式名称
752
+ * - 拖动时在面板上占位的元素
753
+ * - 默认:snail-sort-ghost
754
+ */
755
+ ghostClass?: string;
756
+ /**
757
+ * 过滤器,不需要进行拖动的元素
758
+ * - 传入类样式选择器;如 .sort-handle
759
+ * - 实现特定子元素不触发拖动排序功能
760
+ */
761
+ filter?: string;
762
+ /**
763
+ * 排序组
764
+ * - 组相同时,可跨组拖拽排序
765
+ * - 不传入,则内部生成guid
766
+ * - 为
767
+ */
768
+ group?: string | SortGroupOptions;
769
+ /**
770
+ * 动画时间
771
+ * - 单位ms;默认150ms
772
+ */
773
+ animation?: number;
774
+ /**
775
+ * 禁用排序效果
776
+ * - 为true时,此容器内元素不能拖动,此不构建sortable实例
777
+ */
778
+ disabled?: boolean;
779
+ /**
780
+ * 在当前容器内是否禁用拖拽排序
781
+ * - 为true时,此容器内部不能拖拽,但可拖动到其他同名group内
782
+ * - 初期想用sort,但作Vue组件属性时,bool类型不传值会自动默认false,和初衷不符
783
+ */
784
+ sortDisabled?: boolean;
785
+ };
786
+ /**
787
+ * 排序组件的Group属性配置选项
788
+ */
789
+ type SortGroupOptions = {
790
+ /**
791
+ * 排序组名称;
792
+ * - 不传入时自动生成
793
+ */
794
+ name: string;
795
+ /**
796
+ * 定义从这个列表容器移动出去的设置
797
+ * - true:列表容器内的列表单元可以被移出;
798
+ * - false:列表容器内的列表单元不可以被移出;
799
+ * - "clone":列表单元移出,移动的为该元素的副本;
800
+ * - function:用来进行pull的函数判断,可以进行复杂逻辑,在函数中return false/true来判断是否移出;
801
+ */
802
+ pull: true | false | "clone" | SortGroupHook;
803
+ /**
804
+ * 用来定义往这个列表容器放置列表单元的的设置
805
+ * - true:列表容器可以从其他列表容器内放入列表单元;
806
+ * - false:与true相反;
807
+ * - string|string[]:代表的是group配置项里定义的name值。如['foo','bar']
808
+ * - function:用来进行put的函数判断,可以进行复杂逻辑,在函数中return false/true来判断是否放入;
809
+ */
810
+ put: true | false | string | string[] | SortGroupHook;
811
+ };
812
+ /**
813
+ * 排序组件的Group属性钩子
814
+ * - 用于pull和put中使用,返回false时不执行pull、put操作
815
+ * - @param item 移动的元素
816
+ * - @param to 目标容器dom元素
817
+ * - @param from 来源容器dom元素
818
+ */
819
+ type SortGroupHook = (item: HTMLElement, to: HTMLElement, from: HTMLElement) => void;
820
+ /**
821
+ * 排序组件 事件
822
+ */
823
+ type SortEvents = {
824
+ /**
825
+ * 开始拖拽
826
+ */
827
+ start: [evt: SortEvent];
828
+ /**
829
+ * 移动中
830
+ */
831
+ move: [evt: SortEvent, originalEvent: SortEvent];
832
+ /**
833
+ * 移动到新容器时
834
+ */
835
+ add: [evt: SortEvent];
836
+ /**
837
+ * 从当前容器移除时
838
+ */
839
+ remove: [evt: SortEvent];
840
+ /**
841
+ * 结束拖拽
842
+ */
843
+ end: [evt: SortEvent];
844
+ /**
845
+ * 元素排序顺序变化
846
+ * @param oldIndex 旧位置索引值
847
+ * @param newIndex 新顺序索引值
848
+ */
849
+ update: [oldIndex: number, newIndex: number];
850
+ };
851
+ /**
852
+ * 排序事件对象
853
+ */
854
+ type SortEvent = {
855
+ /**
856
+ * 目标容器
857
+ */
858
+ to: HTMLElement;
859
+ /**
860
+ * 来源容器
861
+ */
862
+ from: HTMLElement;
863
+ /**
864
+ * 被移动的元素
865
+ * - 在`group.pull`配置为 clone 时,此值为原始元素,复制元素放到原来位置了
866
+ */
867
+ item: HTMLElement;
868
+ /**
869
+ * 副本的元素
870
+ * - 在`group.pull`配置为 clone 时
871
+ */
872
+ clone: HTMLElement;
873
+ /**
874
+ * 容器中的原序号
875
+ */
876
+ oldIndex: number | undefined;
877
+ /**
878
+ * 容器中的新序号
879
+ */
880
+ newIndex: number | undefined;
881
+ };
882
+
671
883
  /**
672
884
  * 布局组件 数据结构
673
885
  */
@@ -735,6 +947,20 @@ type ComponentOptions = {
735
947
  */
736
948
  url?: string;
737
949
  };
950
+ /**
951
+ * 提取组件的props类型
952
+ * - 有效的 Props 类型:extends Record<string, any>
953
+ * - 有效类型则返回 Props 自身;否则无效,为undefined
954
+ */
955
+ type PropsType<Props> = Props extends Record<string, any> ? Props : undefined;
956
+ /**
957
+ * 事件发射器类型
958
+ * - 将【组件中组件】转换为vue的 defineEmits 类型
959
+ * - 用于将组件的事件发射器包裹传递到其他组件、class中使用
960
+ */
961
+ type EmitterType<Events extends Record<string, any[]>> = {
962
+ <K extends keyof Events>(event: K, ...payload: Events[K]): any;
963
+ };
738
964
  /**
739
965
  * 提取【组件事件】类型
740
966
  * - 将【组件事件】中的key首字母小写,追加上on前缀;key对应的value为监听函数参数
@@ -743,12 +969,6 @@ type ComponentOptions = {
743
969
  type EventsType<Events> = Events extends Record<string, unknown[]> ? ({
744
970
  [key in keyof Events as `on${Capitalize<string & key>}`]?: (...args: Events[key]) => void;
745
971
  }) : never;
746
- /**
747
- * 提取组件的props类型
748
- * - 有效的 Props 类型:extends Record<string, any>
749
- * - 有效类型则返回 Props 自身;否则无效,为undefined
750
- */
751
- type PropsType<Props> = Props extends Record<string, any> ? Props : undefined;
752
972
  /**
753
973
  * 组件绑定 配置选项
754
974
  * - Props、Events、Model 为可选泛型,分别约束 props、events、model 属性
@@ -972,6 +1192,271 @@ type SelectNodeEvents<T> = {
972
1192
  click: [item: SelectItem<T>, parent?: SelectItem<T>];
973
1193
  };
974
1194
 
1195
+ /**
1196
+ * 基础事件实体
1197
+ * 1、把一些常用事件,封装为原子结构,方便复用
1198
+ * 2、不强制必须复用,根据自身情况
1199
+ */
1200
+ /**
1201
+ * 事件:点击
1202
+ */
1203
+ type ClickEvents = {
1204
+ /**
1205
+ * 单击事件
1206
+ */
1207
+ click: [];
1208
+ };
1209
+ /**
1210
+ * 事件:值改变
1211
+ * - 描述值的改变过程,新值是什么,改变前的旧值是什么
1212
+ */
1213
+ type ChangeEvents<T> = {
1214
+ /**
1215
+ * 值改变;约束新旧值
1216
+ * @param newValue 新值
1217
+ * @param oldValue 旧值
1218
+ */
1219
+ change: [newValue: T, oldValue?: T];
1220
+ };
1221
+ /**
1222
+ * 事件:移动
1223
+ * - 可描述数据索引位置变化
1224
+ * - 可用于数组元素拖动排序,调整位置等逻辑
1225
+ */
1226
+ type MoveEvents = {
1227
+ /**
1228
+ * 移动事件
1229
+ * @param fromIndex 从哪个索引位置开始移动
1230
+ * @param toIndex 移动到的索引位置
1231
+ */
1232
+ move: [fromIndex: number, toIndex: number];
1233
+ };
1234
+ /**
1235
+ * 事件:删除数据
1236
+ * - 描述要删除的具体数据
1237
+ */
1238
+ type DeleteEvents<T> = {
1239
+ /**
1240
+ * 删除事件
1241
+ * @param value 要删除的数据
1242
+ */
1243
+ delete: [value?: T];
1244
+ };
1245
+ /**
1246
+ * 事件:关闭
1247
+ */
1248
+ type CloseEvents = {
1249
+ /**
1250
+ * 关闭事件
1251
+ */
1252
+ close: [];
1253
+ };
1254
+
1255
+ /**
1256
+ * 数值控件的数据结构
1257
+ */
1258
+
1259
+ /**
1260
+ * 数值组件的基础配置选项
1261
+ */
1262
+ type NumberBaseOptions = {
1263
+ /**
1264
+ * 最小值
1265
+ */
1266
+ minValue?: number;
1267
+ /**
1268
+ * 最大值
1269
+ */
1270
+ maxValue?: number;
1271
+ /**
1272
+ * 值超过阈值(最大值、最小值)时的处理模式
1273
+ * - 默认值为 `keep`;可选取值范围:
1274
+ * - - `keep` 保持原样值显示,不做任何处理
1275
+ * - - `clamp` 截断超出阈值值,低于最小值时直接取最小值,超过最大值时,强制值为最大值
1276
+ * - 值超过阈值时,会自动触发事件,事件名`NumberEvents`的`belowMin`和`exceedMax`
1277
+ */
1278
+ clamp?: "keep" | "clamp";
1279
+ /**
1280
+ * 精度,保留几位小数
1281
+ * - 要求0、正整数,输入小数则强制整数
1282
+ * - 负数、不传入则不处理
1283
+ */
1284
+ precision?: number;
1285
+ /**
1286
+ * 对数值进行千分位格式处理
1287
+ * - 默认值为 `disabled`;可选值范围:
1288
+ * - `disabled` 禁用千分位功能
1289
+ * - `inline` 内联千分位功能
1290
+ * - `below` 下拉千分位功能
1291
+ */
1292
+ thousands?: "disabled" | "inline" | "below";
1293
+ /**
1294
+ * 是否启用数值大写格式化处理
1295
+ * - 为true时,转成中文大写值
1296
+ * - 单位自动为“元”,不支持美元等
1297
+ * - 如金额时,自动转为壹仟壹佰壹拾壹元叁角叁分
1298
+ * - 小数点后面只处理两位(角分);剩余不处理
1299
+ */
1300
+ upper?: boolean;
1301
+ /**
1302
+ * 格式化时的放大系数
1303
+ * - 用于在格式化千分位、大写时,对实际值进行系数放大,value*formatMultiplier
1304
+ * - 仅接收正整数,取值规则为10^n,默认1
1305
+ * - 千分位格式化时,仅`thousands`为`below`时才进行放到系数处理
1306
+ * - 使用示例例:金额是为万元单位时,这里的放大系数就为 “10000”
1307
+ */
1308
+ formatMultiplier?: number;
1309
+ /**
1310
+ * 前缀字符串
1311
+ * - 如金额时,可配置前缀 ¥
1312
+ */
1313
+ prefix?: string;
1314
+ /**
1315
+ * 后缀字符串
1316
+ * - 如金额时,可配置后缀 元/美元、、
1317
+ */
1318
+ suffix?: string;
1319
+ /**
1320
+ * 数值控制器
1321
+ * - 便捷加减调整数值的控制按钮
1322
+ * - 默认值`disabled`;可选值范围:
1323
+ * - - `disabled` 时禁用
1324
+ * - - `default` 默认模式,左侧 — 右侧 +
1325
+ * - - `right` 右侧模式,+ - 都在右侧
1326
+ */
1327
+ controls?: "disabled" | "default" | "right";
1328
+ /**
1329
+ * 数值步长值
1330
+ * - `controls` 未禁用时生效
1331
+ * - 每次+、- 的步长值
1332
+ */
1333
+ step?: number;
1334
+ };
1335
+ /**
1336
+ * 数值组件的配置选项
1337
+ */
1338
+ type NumberOptions = PlaceholderOptions & ReadonlyOptions & NumberBaseOptions;
1339
+ /**
1340
+ * 接口:数值格式化器
1341
+ */
1342
+ interface INumberFormatter extends Required<Readonly<Pick<NumberBaseOptions, "minValue" | "maxValue" | "precision" | "thousands" | "upper">>> {
1343
+ /**
1344
+ * 格式化输入文本
1345
+ * @param text 输入文本
1346
+ * @param isEnd 是否是输入结束,true时,已经输入结束将进行数值精度处理
1347
+ * @returns 数值格式化结果
1348
+ */
1349
+ format(text: string, isEnd: boolean): NumberFormatResult;
1350
+ /**
1351
+ * 进行阈值检测,检测是否超过设定的最大值、最小值
1352
+ * @param number 要检测的数值
1353
+ * @returns 检测结果,`number` 新的值,`belowMin`是否低于最小值,`exceedMax`是否超过最大值
1354
+ */
1355
+ checkThreshold(number: any): {
1356
+ number: number;
1357
+ belowMin: boolean;
1358
+ exceedMax: boolean;
1359
+ };
1360
+ /**
1361
+ * 对数值文本转大写
1362
+ * @param result
1363
+ * @returns 大写文本值
1364
+ */
1365
+ buildUpper(result: NumberFormatResult): string;
1366
+ /**
1367
+ * 对数值文本进行千分位格式化
1368
+ * @param result
1369
+ * @returns 格式化后的文本值
1370
+ */
1371
+ buildThousands(result: NumberFormatResult): string;
1372
+ /**
1373
+ * 基于步长计算值
1374
+ * @param number 要重新计算的数值
1375
+ * @param isPlus true为+,false为-
1376
+ * @returns 新的数值
1377
+ */
1378
+ calcByStep(number: number, isPlus: boolean): number;
1379
+ }
1380
+ /**
1381
+ * 数值格式化结果
1382
+ */
1383
+ type NumberFormatResult = {
1384
+ /**
1385
+ * 输入是否是有效输入
1386
+ * - `- 0 1 2 3 4 5 6 7 8 9 0 .`算是合法输入
1387
+ */
1388
+ readonly valid: boolean;
1389
+ /**
1390
+ * 有效的数值
1391
+ * - undefined时,输入无法转换成有效的数值
1392
+ */
1393
+ readonly number: number | undefined;
1394
+ /**
1395
+ * 数值的显示文本
1396
+ * - 无千分位等处理的数值显示文本
1397
+ * - 若需要在行内显示 千分位 格式文本,需要单独处理
1398
+ */
1399
+ readonly text: string;
1400
+ /**
1401
+ * 格式化数值时发生的错误
1402
+ * - 输入数值有效,但是格式化时发生错误了
1403
+ */
1404
+ readonly error?: string;
1405
+ /**
1406
+ * 是否是负数
1407
+ * - true 时说明以`-`开始;false时为正数
1408
+ * - 若为true,但`integerPart`为undefined,则说明仅输入了`-`
1409
+ */
1410
+ readonly isNegative?: boolean;
1411
+ /**
1412
+ * 是否是小数
1413
+ * - true 时说明有小数点“.”;false 时为整数
1414
+ * - 若为true,但`decimalPart`为undefined,则说明是以`.`结尾,还没输入具体的小数部分
1415
+ */
1416
+ readonly isDecimal?: boolean;
1417
+ /**
1418
+ * 数值输入的整数部分
1419
+ * - 取整数部分绝对值,如-1.2,仅为1
1420
+ */
1421
+ readonly integerPart?: string;
1422
+ /**
1423
+ * 小数部分
1424
+ */
1425
+ readonly decimalPart?: string;
1426
+ /**
1427
+ * 进行系数放大后的整数部分
1428
+ */
1429
+ readonly integerPartAfterMultiplier?: string;
1430
+ /**
1431
+ * 进行系数放大后的小数部分
1432
+ */
1433
+ readonly decimalPartAfterMultiplier?: string;
1434
+ };
1435
+ /**
1436
+ * 数值组件的事件选项
1437
+ */
1438
+ type NumberEvents = ChangeEvents<number> & {
1439
+ /**
1440
+ * 数值发生错误时
1441
+ * - 若超过最大的精度范围
1442
+ * - 其他未知异常等
1443
+ * @param reason 错误原因
1444
+ */
1445
+ error: [reason: string];
1446
+ /**
1447
+ * 小于最小值
1448
+ * @param value 当前值
1449
+ * @param minValue 最小值
1450
+ */
1451
+ belowMin: [value: number, minValue: number];
1452
+ /**
1453
+ * 超过最大值
1454
+ * @param value 当前值
1455
+ * @param maxValue 最大值
1456
+ */
1457
+ exceedMax: [value: number, maxValue: number];
1458
+ };
1459
+
975
1460
  /**
976
1461
  * 图标配置选项
977
1462
  * - title 作为鼠标移入图标时的提示
@@ -1260,66 +1745,6 @@ type ButtonOptions = TitleOptions & {
1260
1745
  type: "primary" | "default" | "link";
1261
1746
  };
1262
1747
 
1263
- /**
1264
- * 基础事件实体
1265
- * 1、把一些常用事件,封装为原子结构,方便复用
1266
- * 2、不强制必须复用,根据自身情况
1267
- */
1268
- /**
1269
- * 事件:点击
1270
- */
1271
- type ClickEvents = {
1272
- /**
1273
- * 单击事件
1274
- */
1275
- click: [];
1276
- };
1277
- /**
1278
- * 事件:值改变
1279
- * - 描述值的改变过程,新值是什么,改变前的旧值是什么
1280
- */
1281
- type ChangeEvents<T> = {
1282
- /**
1283
- * 值改变;约束新旧值
1284
- * @param newValue 新值
1285
- * @param oldValue 旧值
1286
- */
1287
- change: [newValue: T, oldValue?: T];
1288
- };
1289
- /**
1290
- * 事件:移动
1291
- * - 可描述数据索引位置变化
1292
- * - 可用于数组元素拖动排序,调整位置等逻辑
1293
- */
1294
- type MoveEvents = {
1295
- /**
1296
- * 移动事件
1297
- * @param fromIndex 从哪个索引位置开始移动
1298
- * @param toIndex 移动到的索引位置
1299
- */
1300
- move: [fromIndex: number, toIndex: number];
1301
- };
1302
- /**
1303
- * 事件:删除数据
1304
- * - 描述要删除的具体数据
1305
- */
1306
- type DeleteEvents<T> = {
1307
- /**
1308
- * 删除事件
1309
- * @param value 要删除的数据
1310
- */
1311
- delete: [value?: T];
1312
- };
1313
- /**
1314
- * 事件:关闭
1315
- */
1316
- type CloseEvents = {
1317
- /**
1318
- * 关闭事件
1319
- */
1320
- close: [];
1321
- };
1322
-
1323
1748
  /**
1324
1749
  * 输入框配置选项
1325
1750
  * - title 将作为 输入框标题区域文本;不传入则不展示 标题区域,仅展示输入框
@@ -1424,6 +1849,61 @@ type SwitchEvents = {
1424
1849
  change: [value: boolean];
1425
1850
  };
1426
1851
 
1852
+ /**
1853
+ * 多行文本框组件配置选项
1854
+ */
1855
+ type TextareaOptions = ReadonlyOptions & PlaceholderOptions & {
1856
+ /**
1857
+ * 是否自适应高度
1858
+ * - 传入true时,根据文本框内容,自动调整高度
1859
+ * - 若传入maxRows,则自动高度不会超过maxRows
1860
+ */
1861
+ autoHeight: boolean;
1862
+ /**
1863
+ * 最小行数
1864
+ * - 作为默认行数
1865
+ * - 不传入则默认4
1866
+ */
1867
+ minRows?: number;
1868
+ /**
1869
+ * 最大行数
1870
+ * - 不传入则默认10
1871
+ * - `autoHeight`为true时生效;
1872
+ */
1873
+ maxRows?: number;
1874
+ };
1875
+ /**
1876
+ * 多行文本框组件事件
1877
+ */
1878
+ type TextareaEvents = {
1879
+ /**
1880
+ * 获取焦点时
1881
+ */
1882
+ focus: [];
1883
+ /**
1884
+ * 输入时
1885
+ * @param value 输入框内容
1886
+ */
1887
+ input: [value: string];
1888
+ /**
1889
+ * 失焦时
1890
+ * @param value 输入框内容
1891
+ */
1892
+ blur: [value: string];
1893
+ /**
1894
+ * 输入框内容发生改变时
1895
+ * @param value 输入框内容
1896
+ */
1897
+ change: [value: string];
1898
+ };
1899
+
1900
+ /**
1901
+ * 使用【响应式管理器】
1902
+ * - 请在Vue组件的setup中使用此方法,否则 getCurrentScope 方法无法取到值
1903
+ * @returns 全新的【响应式管理器】+作用域
1904
+ */
1905
+ declare function useReactive(): IReactiveManager & IScope;
1906
+
1427
1907
  /**
1428
1908
  * 树的基础组件信息
1429
1909
  * 1、组件基础上下文 默认实现
@@ -1437,13 +1917,6 @@ type SwitchEvents = {
1437
1917
  */
1438
1918
  declare function useTreeContext<T>(nodes: TreeNode<T, TreeNodeExtend>[], activeNodeRef?: ShallowRef<TreeNode<T, TreeNodeExtend>>): ITreeBaseContext<T> & IScope;
1439
1919
 
1440
- /**
1441
- * 使用【响应式管理器】
1442
- * - 请在Vue组件的setup中使用此方法,否则 getCurrentScope 方法无法取到值
1443
- * @returns 全新的【响应式管理器】+作用域
1444
- */
1445
- declare function useReactive(): IReactiveManager & IScope;
1446
-
1447
1920
  /**
1448
1921
  * Vue App助手类,做一些app实例的辅助性工作
1449
1922
  */
@@ -1479,73 +1952,6 @@ declare function triggerAppCreated(app: App, type?: AppType): App;
1479
1952
  */
1480
1953
  declare function getSvgDraw(iconType: IconType, draw: string[] | string): string[];
1481
1954
 
1482
- /**
1483
- * 排序组件 配置选项
1484
- * - disabled 禁用排序效果,不能再拖拽元素排序
1485
- * - 整理部分SortableJs中的配置,不分逻辑不开放
1486
- */
1487
- type SortOptions<T> = DisabledOptions & {
1488
- /**
1489
- * 变化器
1490
- * - 在此元素值发生变化时,重新刷新排序面板
1491
- * - 如在增加元素时,改变此值实现 新元素 可拖拽排序
1492
- */
1493
- changer: T;
1494
- /**
1495
- * 拖动哪个元素
1496
- * - 传入类样式选择器;如 .table-row
1497
- */
1498
- draggable: string;
1499
- /**
1500
- * 哪个元素启动拖拽
1501
- * - 传入类样式选择器;如 .sort-handle
1502
- * - 不传入则默认 draggable
1503
- * - 若自定义,则传入 draggable 下的dom元素作为启动拖拽的句柄
1504
- */
1505
- handle?: string;
1506
- /**
1507
- * 拖动的元素上增加的类样式
1508
- * - 执行拖拽时随着鼠标移动元素,脱离文档流了
1509
- * - 可自定义一些样式实现拖动元素的高度、宽度自定义等
1510
- * - 默认:snail-sort-drag
1511
- */
1512
- dragClass?: string;
1513
- /**
1514
- * 幽灵元素类样式名称
1515
- * - 拖动时在面板上占位的元素
1516
- * - 默认:snail-sort-ghost
1517
- */
1518
- ghostClass?: string;
1519
- /**
1520
- * 过滤器,不需要进行拖动的元素
1521
- * - 传入类样式选择器;如 .sort-handle
1522
- * - 实现特定子元素不触发拖动排序功能
1523
- */
1524
- filter?: string;
1525
- /**
1526
- * 排序组
1527
- * - 组相同时,可跨组拖拽排序
1528
- * - 不传入,则内部生成guid
1529
- */
1530
- group?: string;
1531
- /**
1532
- * 动画时间
1533
- * - 单位ms;默认150ms
1534
- */
1535
- animation?: number;
1536
- };
1537
- /**
1538
- * 排序组件 事件
1539
- */
1540
- type SortEvents = {
1541
- /**
1542
- * 元素排序顺序变化
1543
- * @param oldIndex 旧位置索引值
1544
- * @param newIndex 新顺序索引值
1545
- */
1546
- update: [oldIndex: number, newIndex: number];
1547
- };
1548
-
1549
1955
  /**
1550
1956
  * 动态加载组件 组件配置选项
1551
1957
  */
@@ -1734,6 +2140,15 @@ type ToastOptions = {
1734
2140
  * 提示消息;支持html格式
1735
2141
  */
1736
2142
  message: string;
2143
+ /**
2144
+ * 提示显示时间
2145
+ * - 单位毫秒,默认1500ms
2146
+ */
2147
+ duration?: number;
2148
+ /**
2149
+ * 关闭按钮是否禁用
2150
+ */
2151
+ closeDisabled?: boolean;
1737
2152
  };
1738
2153
 
1739
2154
  /**
@@ -2060,6 +2475,44 @@ declare const components: {
2060
2475
  };
2061
2476
  });
2062
2477
  Icon: vue.DefineComponent<IconOptions, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<IconOptions> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2478
+ Input: vue.DefineComponent<ReadonlyOptions & PlaceholderOptions & TitleOptions & {
2479
+ type?: "text" | "number" | "password";
2480
+ required?: boolean;
2481
+ titleStyle?: snail_view.BaseStyle & snail_view.WidthStyle & snail_view.FlexBoxStyle;
2482
+ } & {
2483
+ modelValue?: string;
2484
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2485
+ change: (value: string) => any;
2486
+ click: () => any;
2487
+ "update:modelValue": (value: string) => any;
2488
+ }, string, vue.PublicProps, Readonly<ReadonlyOptions & PlaceholderOptions & TitleOptions & {
2489
+ type?: "text" | "number" | "password";
2490
+ required?: boolean;
2491
+ titleStyle?: snail_view.BaseStyle & snail_view.WidthStyle & snail_view.FlexBoxStyle;
2492
+ } & {
2493
+ modelValue?: string;
2494
+ }> & Readonly<{
2495
+ onChange?: (value: string) => any;
2496
+ onClick?: () => any;
2497
+ "onUpdate:modelValue"?: (value: string) => any;
2498
+ }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2499
+ Number: vue.DefineComponent<PlaceholderOptions & ReadonlyOptions & NumberBaseOptions & {
2500
+ modelValue?: number;
2501
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2502
+ error: (reason: string) => any;
2503
+ change: (newValue: number, oldValue?: number) => any;
2504
+ "update:modelValue": (value: number) => any;
2505
+ belowMin: (value: number, minValue: number) => any;
2506
+ exceedMax: (value: number, maxValue: number) => any;
2507
+ }, string, vue.PublicProps, Readonly<PlaceholderOptions & ReadonlyOptions & NumberBaseOptions & {
2508
+ modelValue?: number;
2509
+ }> & Readonly<{
2510
+ onError?: (reason: string) => any;
2511
+ onChange?: (newValue: number, oldValue?: number) => any;
2512
+ "onUpdate:modelValue"?: (value: number) => any;
2513
+ onBelowMin?: (value: number, minValue: number) => any;
2514
+ onExceedMax?: (value: number, maxValue: number) => any;
2515
+ }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2063
2516
  Search: vue.DefineComponent<ReadonlyOptions & PlaceholderOptions & {
2064
2517
  autoComplete?: boolean;
2065
2518
  } & {
@@ -2115,6 +2568,31 @@ declare const components: {
2115
2568
  onChange?: (value: boolean) => any;
2116
2569
  "onUpdate:modelValue"?: (value: boolean) => any;
2117
2570
  }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2571
+ Textarea: vue.DefineComponent<ReadonlyOptions & PlaceholderOptions & {
2572
+ autoHeight: boolean;
2573
+ minRows?: number;
2574
+ maxRows?: number;
2575
+ } & {
2576
+ modelValue?: string;
2577
+ }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2578
+ blur: (value: string) => any;
2579
+ change: (value: string) => any;
2580
+ focus: () => any;
2581
+ input: (value: string) => any;
2582
+ "update:modelValue": (value: string) => any;
2583
+ }, string, vue.PublicProps, Readonly<ReadonlyOptions & PlaceholderOptions & {
2584
+ autoHeight: boolean;
2585
+ minRows?: number;
2586
+ maxRows?: number;
2587
+ } & {
2588
+ modelValue?: string;
2589
+ }> & Readonly<{
2590
+ onBlur?: (value: string) => any;
2591
+ onChange?: (value: string) => any;
2592
+ onFocus?: () => any;
2593
+ onInput?: (value: string) => any;
2594
+ "onUpdate:modelValue"?: (value: string) => any;
2595
+ }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
2118
2596
  Dynamic: {
2119
2597
  new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<ComponentOptions & Pick<ComponentBindOptions<Record<string, any>>, "props">> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, vue.PublicProps, {}, true, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
2120
2598
  P: {};
@@ -2262,18 +2740,30 @@ declare const components: {
2262
2740
  };
2263
2741
  });
2264
2742
  Sort: {
2265
- new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<DisabledOptions & {
2743
+ new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<{
2266
2744
  changer: any;
2267
2745
  draggable: string;
2268
2746
  handle?: string;
2269
2747
  dragClass?: string;
2270
2748
  ghostClass?: string;
2271
2749
  filter?: string;
2272
- group?: string;
2750
+ group?: string | SortGroupOptions;
2273
2751
  animation?: number;
2752
+ disabled?: boolean;
2753
+ sortDisabled?: boolean;
2274
2754
  }> & Readonly<{
2755
+ onEnd?: (evt: SortEvent) => any;
2756
+ onAdd?: (evt: SortEvent) => any;
2757
+ onStart?: (evt: SortEvent) => any;
2758
+ onMove?: (evt: SortEvent, originalEvent: SortEvent) => any;
2759
+ onRemove?: (evt: SortEvent) => any;
2275
2760
  onUpdate?: (oldIndex: number, newIndex: number) => any;
2276
2761
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2762
+ end: (evt: SortEvent) => any;
2763
+ add: (evt: SortEvent) => any;
2764
+ start: (evt: SortEvent) => any;
2765
+ move: (evt: SortEvent, originalEvent: SortEvent) => any;
2766
+ remove: (evt: SortEvent) => any;
2277
2767
  update: (oldIndex: number, newIndex: number) => any;
2278
2768
  }, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
2279
2769
  P: {};
@@ -2282,33 +2772,52 @@ declare const components: {
2282
2772
  C: {};
2283
2773
  M: {};
2284
2774
  Defaults: {};
2285
- }, Readonly<DisabledOptions & {
2775
+ }, Readonly<{
2286
2776
  changer: any;
2287
2777
  draggable: string;
2288
2778
  handle?: string;
2289
2779
  dragClass?: string;
2290
2780
  ghostClass?: string;
2291
2781
  filter?: string;
2292
- group?: string;
2782
+ group?: string | SortGroupOptions;
2293
2783
  animation?: number;
2784
+ disabled?: boolean;
2785
+ sortDisabled?: boolean;
2294
2786
  }> & Readonly<{
2787
+ onEnd?: (evt: SortEvent) => any;
2788
+ onAdd?: (evt: SortEvent) => any;
2789
+ onStart?: (evt: SortEvent) => any;
2790
+ onMove?: (evt: SortEvent, originalEvent: SortEvent) => any;
2791
+ onRemove?: (evt: SortEvent) => any;
2295
2792
  onUpdate?: (oldIndex: number, newIndex: number) => any;
2296
2793
  }>, {}, {}, {}, {}, {}>;
2297
2794
  __isFragment?: never;
2298
2795
  __isTeleport?: never;
2299
2796
  __isSuspense?: never;
2300
- } & vue.ComponentOptionsBase<Readonly<DisabledOptions & {
2797
+ } & vue.ComponentOptionsBase<Readonly<{
2301
2798
  changer: any;
2302
2799
  draggable: string;
2303
2800
  handle?: string;
2304
2801
  dragClass?: string;
2305
2802
  ghostClass?: string;
2306
2803
  filter?: string;
2307
- group?: string;
2804
+ group?: string | SortGroupOptions;
2308
2805
  animation?: number;
2806
+ disabled?: boolean;
2807
+ sortDisabled?: boolean;
2309
2808
  }> & Readonly<{
2809
+ onEnd?: (evt: SortEvent) => any;
2810
+ onAdd?: (evt: SortEvent) => any;
2811
+ onStart?: (evt: SortEvent) => any;
2812
+ onMove?: (evt: SortEvent, originalEvent: SortEvent) => any;
2813
+ onRemove?: (evt: SortEvent) => any;
2310
2814
  onUpdate?: (oldIndex: number, newIndex: number) => any;
2311
2815
  }>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2816
+ end: (evt: SortEvent) => any;
2817
+ add: (evt: SortEvent) => any;
2818
+ start: (evt: SortEvent) => any;
2819
+ move: (evt: SortEvent, originalEvent: SortEvent) => any;
2820
+ remove: (evt: SortEvent) => any;
2312
2821
  update: (oldIndex: number, newIndex: number) => any;
2313
2822
  }, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
2314
2823
  $slots: {
@@ -2370,6 +2879,23 @@ declare const components: {
2370
2879
  default?: (props: {}) => any;
2371
2880
  };
2372
2881
  });
2882
+ Transitions: {
2883
+ new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<TransitionOptions> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, vue.PublicProps, {}, false, {}, {}, vue.GlobalComponents, vue.GlobalDirectives, string, {}, any, vue.ComponentProvideOptions, {
2884
+ P: {};
2885
+ B: {};
2886
+ D: {};
2887
+ C: {};
2888
+ M: {};
2889
+ Defaults: {};
2890
+ }, Readonly<TransitionOptions> & Readonly<{}>, {}, {}, {}, {}, {}>;
2891
+ __isFragment?: never;
2892
+ __isTeleport?: never;
2893
+ __isSuspense?: never;
2894
+ } & vue.ComponentOptionsBase<Readonly<TransitionOptions> & Readonly<{}>, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, {}, {}, string, {}, vue.GlobalComponents, vue.GlobalDirectives, string, vue.ComponentProvideOptions> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & (new () => {
2895
+ $slots: {
2896
+ default?: (props: {}) => any;
2897
+ };
2898
+ });
2373
2899
  Tree: {
2374
2900
  new (...args: any[]): vue.CreateComponentPublicInstanceWithMixins<Readonly<{
2375
2901
  nodes: TreeNodeModel<any>[];
@@ -2461,27 +2987,6 @@ declare const components: {
2461
2987
  default?: (props: {}) => any;
2462
2988
  };
2463
2989
  });
2464
- Input: vue.DefineComponent<ReadonlyOptions & PlaceholderOptions & TitleOptions & {
2465
- type?: "text" | "number" | "password";
2466
- required?: boolean;
2467
- titleStyle?: snail_view.BaseStyle & snail_view.WidthStyle & snail_view.FlexBoxStyle;
2468
- } & {
2469
- modelValue?: string;
2470
- }, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
2471
- change: (value: string) => any;
2472
- click: () => any;
2473
- "update:modelValue": (value: string) => any;
2474
- }, string, vue.PublicProps, Readonly<ReadonlyOptions & PlaceholderOptions & TitleOptions & {
2475
- type?: "text" | "number" | "password";
2476
- required?: boolean;
2477
- titleStyle?: snail_view.BaseStyle & snail_view.WidthStyle & snail_view.FlexBoxStyle;
2478
- } & {
2479
- modelValue?: string;
2480
- }> & Readonly<{
2481
- onChange?: (value: string) => any;
2482
- onClick?: () => any;
2483
- "onUpdate:modelValue"?: (value: string) => any;
2484
- }>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
2485
2990
  DragVerify: vue.DefineComponent<DragVerifyOptions, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
2486
2991
  success: () => any;
2487
2992
  }, string, vue.PublicProps, Readonly<DragVerifyOptions> & Readonly<{
@@ -2524,4 +3029,4 @@ declare const components: {
2524
3029
  };
2525
3030
 
2526
3031
  export { components, getSvgDraw, mount, onAppCreated, triggerAppCreated, usePopup, useReactive, useTreeContext };
2527
- export type { ButtonOptions, ChangeEvents, ChooseEvents, ChooseItem, ChooseOptions, ClickEvents, CloseEvents, ComponentBindOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DatePickerEvents, DatepickerOptions, 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 };
3032
+ export type { ButtonOptions, ChangeEvents, ChooseEvents, ChooseItem, ChooseOptions, ClickEvents, CloseEvents, ComponentBindOptions, ComponentOptions, ConfirmAreaOptions, ConfirmOptions, DatePickerEvents, DatepickerOptions, DeleteEvents, DialogHandle, DialogOptions, DisabledOptions, DragVerifyInfo, DragVerifyOptions, EmitterType, EmptyOptions, EventsType, FoldEvents, FoldOptions, FoldStatus, FollowElectResult, FollowExtend, FollowHandle, FollowOptions, FollowStrategy, FollowStrategyOptions, FooterEvents, FooterOptions, HeaderEvents, HeaderOptions, INumberFormatter, IPopupManager, IReactiveManager, ISelectContext, ITreeBaseContext, IconOptions, IconType, InputEvents, InputOptions, LayoutOptions, LoadingOptions, MessageOptions, MoveEvents, NumberBaseOptions, NumberEvents, NumberFormatResult, NumberOptions, 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, SortEvent, SortEvents, SortGroupHook, SortGroupOptions, SortOptions, SwitchEvents, SwitchOptions, TableColOptions, TableOptions, TableRowOptions, TextareaEvents, TextareaOptions, TitleOptions, ToastOptions, TransitionEffect, TransitionOptions, TreeEvents, TreeNode, TreeNodeEvents, TreeNodeExtend, TreeNodeModel, TreeNodeOptions, TreeNodeRenderOptions, TreeNodeSlotOptions, TreeOptions, TreeSearchResult, ValueOptions, WrapperEvents, WrapperOptions };