@whitesev/pops 3.0.1 → 3.0.2

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.
Files changed (35) hide show
  1. package/dist/index.amd.js +901 -494
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +1 -1
  4. package/dist/index.amd.min.js.map +1 -1
  5. package/dist/index.cjs.js +901 -494
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +1 -1
  8. package/dist/index.cjs.min.js.map +1 -1
  9. package/dist/index.esm.js +901 -494
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +1 -1
  12. package/dist/index.esm.min.js.map +1 -1
  13. package/dist/index.iife.js +901 -494
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +1 -1
  16. package/dist/index.iife.min.js.map +1 -1
  17. package/dist/index.system.js +901 -494
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +1 -1
  20. package/dist/index.system.min.js.map +1 -1
  21. package/dist/index.umd.js +901 -494
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +1 -1
  24. package/dist/index.umd.min.js.map +1 -1
  25. package/dist/types/src/Pops.d.ts +69 -29
  26. package/dist/types/src/components/panel/handlerComponents.d.ts +202 -55
  27. package/dist/types/src/components/panel/index.d.ts +1 -1
  28. package/dist/types/src/components/panel/types/components-select.d.ts +42 -5
  29. package/package.json +3 -3
  30. package/src/components/panel/defaultConfig.ts +278 -228
  31. package/src/components/panel/handlerComponents.ts +551 -197
  32. package/src/components/panel/index.css +67 -12
  33. package/src/components/panel/types/components-select.ts +42 -5
  34. package/src/components/rightClickMenu/index.css +1 -1
  35. package/src/css/common.css +4 -4
@@ -361,262 +361,312 @@ export const PopsPanelDefaultConfig = (): DeepRequired<PopsPanelConfig> => {
361
361
  placeholder: "请输入内容",
362
362
  },
363
363
  {
364
- className: "panel-select-disabled",
365
- text: "select-disabled",
366
- type: "select",
367
- disabled: true,
368
- getValue() {
369
- return "text";
370
- },
371
- callback(isSelectedInfo) {
372
- if (isSelectedInfo == null) return;
373
- console.log(`select当前选项:${isSelectedInfo.value},当前选项文本:${isSelectedInfo.text}`);
374
- },
375
- data: [
376
- {
377
- value: "all",
378
- text: "所有",
379
- disable() {
380
- return false;
381
- },
382
- },
364
+ type: "container",
365
+ text: "",
366
+ views: [
383
367
  {
384
- value: "text",
385
- text: "文本",
386
- disable() {
387
- return false;
368
+ className: "panel-select-disabled",
369
+ text: "select-disabled",
370
+ type: "select",
371
+ disabled: true,
372
+ getValue() {
373
+ return "text";
388
374
  },
389
- },
390
- {
391
- value: "html",
392
- text: "超文本",
393
- disable() {
394
- return false;
375
+ callback(isSelectedInfo) {
376
+ if (isSelectedInfo == null) return;
377
+ console.log(`select当前选项:${isSelectedInfo.value},当前选项文本:${isSelectedInfo.text}`);
395
378
  },
379
+ data: [
380
+ {
381
+ value: "all",
382
+ text: "所有",
383
+ disable() {
384
+ return false;
385
+ },
386
+ },
387
+ {
388
+ value: "text",
389
+ text: "文本",
390
+ disable() {
391
+ return false;
392
+ },
393
+ },
394
+ {
395
+ value: "html",
396
+ text: "超文本",
397
+ disable() {
398
+ return false;
399
+ },
400
+ },
401
+ ],
396
402
  },
397
- ],
398
- },
399
- {
400
- className: "panel-select-multiple-disabled",
401
- type: "select-multiple",
402
- text: "select-multiple-disabled",
403
- disabled: true,
404
- placeholder: "请至少选择一个选项",
405
- getValue() {
406
- return ["select-1", "select-2"];
407
- },
408
- callback(selectInfo) {
409
- console.log(`select值改变,多选信息`, selectInfo);
410
- },
411
- clickCallBack(event, isSelectedInfo) {
412
- console.log("点击", event, isSelectedInfo);
413
- },
414
- closeIconClickCallBack(event, data) {
415
- console.log("点击关闭图标的事件", data);
416
- },
417
- data: [
418
- {
419
- value: "select-1",
420
- text: "单选1",
421
- isHTML: false,
422
- },
423
- {
424
- value: "select-2",
425
- text: "单选2",
426
- isHTML: false,
427
- },
428
- {
429
- value: "select-3",
430
- text: "单选3",
431
- isHTML: false,
432
- },
433
- {
434
- value: "select-4",
435
- text: "单选4",
436
- isHTML: false,
437
- },
438
- ],
439
- },
440
- {
441
- className: "panel-select",
442
- text: "select",
443
- type: "select",
444
- getValue() {
445
- return "all";
446
- },
447
- callback(isSelectedInfo) {
448
- if (isSelectedInfo == null) return;
449
- console.log(`select当前选项:${isSelectedInfo.value},当前选项文本:${isSelectedInfo.text}`);
450
- },
451
- data: [
452
403
  {
453
- value: "all",
454
- text: "所有",
455
- disable() {
456
- return false;
404
+ className: "panel-select-multiple-disabled",
405
+ type: "select-multiple",
406
+ text: "select-multiple-disabled",
407
+ disabled: true,
408
+ placeholder: "请至少选择一个选项",
409
+ getValue() {
410
+ return ["select-1", "select-2"];
457
411
  },
458
- },
459
- {
460
- value: "text",
461
- text: "文本",
462
- disable() {
463
- return false;
412
+ callback(selectInfo) {
413
+ console.log(`select值改变,多选信息`, selectInfo);
464
414
  },
465
- },
466
- {
467
- value: "html",
468
- text: "超文本",
469
- disable() {
470
- return false;
415
+ clickCallBack(event, isSelectedInfo) {
416
+ console.log("点击", event, isSelectedInfo);
471
417
  },
472
- },
473
- ],
474
- },
475
- {
476
- className: "panel-select-dialog",
477
- text: "select-dialog",
478
- type: "select",
479
- getValue() {
480
- return window.localStorage.getItem("select-dialog-customInput") || "";
481
- },
482
- callback(isSelectedInfo) {
483
- if (isSelectedInfo == null) {
484
- console.warn(`select当前选项为空`);
485
- return;
486
- }
487
- if (isSelectedInfo.addCustomInput) {
488
- if (isSelectedInfo.value === "") {
489
- // 空值,不存储
490
- if (isSelectedInfo.customInputStoreKey) {
491
- console.log(`select删除自定义输入的值`);
492
- window.localStorage.removeItem(isSelectedInfo.customInputStoreKey);
493
- }
494
- } else {
495
- console.log(
496
- `select当前自定义输入框内容:${isSelectedInfo.value},当前选项显示文本:${isSelectedInfo.text}`
497
- );
498
- if (isSelectedInfo.customInputStoreKey) {
499
- window.localStorage.setItem(isSelectedInfo.customInputStoreKey!, isSelectedInfo.value);
500
- }
501
- }
502
- } else {
503
- console.log(`select当前选项:${isSelectedInfo.value},当前选项显示文本:${isSelectedInfo.text}`);
504
- }
505
- },
506
- data: [
507
- {
508
- value: "all",
509
- text: "所有",
510
- disable() {
511
- return false;
418
+ closeIconClickCallBack(event, data) {
419
+ console.log("点击关闭图标的事件", data);
512
420
  },
421
+ data: [
422
+ {
423
+ value: "select-1",
424
+ text: "单选1",
425
+ isHTML: false,
426
+ },
427
+ {
428
+ value: "select-2",
429
+ text: "单选2",
430
+ isHTML: false,
431
+ },
432
+ {
433
+ value: "select-3",
434
+ text: "单选3",
435
+ isHTML: false,
436
+ },
437
+ {
438
+ value: "select-4",
439
+ text: "单选4",
440
+ isHTML: false,
441
+ },
442
+ ],
513
443
  },
514
444
  {
515
- value: "text",
516
- text: "文本",
517
- disable(value, selectInfo) {
518
- if (selectInfo?.value === "all") return true;
519
- return false;
445
+ className: "panel-select-native",
446
+ text: "select-native",
447
+ type: "select",
448
+ mode: "native",
449
+ getValue() {
450
+ return "all";
520
451
  },
521
- },
522
- {
523
- value: "html",
524
- text: "超文本",
525
- disable(value, selectInfo) {
526
- if (selectInfo?.value === "all") return true;
527
- return false;
452
+ callback(isSelectedInfo) {
453
+ if (isSelectedInfo == null) return;
454
+ console.log(`select当前选项:${isSelectedInfo.value},当前选项文本:${isSelectedInfo.text}`);
528
455
  },
456
+ data: [
457
+ {
458
+ value: "all",
459
+ text: "所有",
460
+ disable() {
461
+ return false;
462
+ },
463
+ },
464
+ {
465
+ value: "text",
466
+ text: "文本",
467
+ disable() {
468
+ return false;
469
+ },
470
+ },
471
+ {
472
+ value: "html",
473
+ text: "超文本",
474
+ disable() {
475
+ return false;
476
+ },
477
+ },
478
+ ],
529
479
  },
530
480
  {
531
- value: "own",
532
- text: "自定义",
533
- disable(value, selectInfo) {
534
- if (selectInfo?.value === "all") return true;
535
- return false;
481
+ className: "panel-select-dialog",
482
+ text: "select-dialog",
483
+ type: "select",
484
+ mode: "dialog",
485
+ getValue() {
486
+ return window.localStorage.getItem("select-dialog-customInput") || "";
536
487
  },
537
- },
538
- {
539
- value: window.localStorage.getItem("select-dialog-customInput") || "",
540
- text: window.localStorage.getItem("select-dialog-customInput") || "",
541
- addCustomInput: true,
542
- customInputStoreKey: "select-dialog-customInput",
543
- onValid(dataOption) {
544
- if (dataOption.value === "123") {
545
- console.error("非规范值");
546
- return {
547
- valid: false,
548
- message: "非规范值",
549
- };
488
+ callback(isSelectedInfo) {
489
+ if (isSelectedInfo == null) {
490
+ console.warn(`select当前选项为空`);
491
+ return;
492
+ }
493
+ if (isSelectedInfo.addCustomInput) {
494
+ if (isSelectedInfo.value === "") {
495
+ // 空值,不存储
496
+ if (isSelectedInfo.customInputStoreKey) {
497
+ console.log(`select删除自定义输入的值`);
498
+ window.localStorage.removeItem(isSelectedInfo.customInputStoreKey);
499
+ }
500
+ } else {
501
+ console.log(
502
+ `select当前自定义输入框内容:${isSelectedInfo.value},当前选项显示文本:${isSelectedInfo.text}`
503
+ );
504
+ if (isSelectedInfo.customInputStoreKey) {
505
+ window.localStorage.setItem(isSelectedInfo.customInputStoreKey!, isSelectedInfo.value);
506
+ }
507
+ }
508
+ } else {
509
+ console.log(`select当前选项:${isSelectedInfo.value},当前选项显示文本:${isSelectedInfo.text}`);
550
510
  }
551
- return {
552
- valid: true,
553
- };
554
511
  },
512
+ data: [
513
+ {
514
+ value: "all",
515
+ text: "所有",
516
+ disable() {
517
+ return false;
518
+ },
519
+ },
520
+ {
521
+ value: "text",
522
+ text: "文本",
523
+ disable(value, selectInfo) {
524
+ if (selectInfo?.value === "all") return true;
525
+ return false;
526
+ },
527
+ },
528
+ {
529
+ value: "html",
530
+ text: "超文本",
531
+ disable(value, selectInfo) {
532
+ if (selectInfo?.value === "all") return true;
533
+ return false;
534
+ },
535
+ },
536
+ {
537
+ value: "own",
538
+ text: "自定义",
539
+ disable(value, selectInfo) {
540
+ if (selectInfo?.value === "all") return true;
541
+ return false;
542
+ },
543
+ },
544
+ {
545
+ value: window.localStorage.getItem("select-dialog-customInput") || "",
546
+ text: window.localStorage.getItem("select-dialog-customInput") || "",
547
+ addCustomInput: true,
548
+ customInputStoreKey: "select-dialog-customInput",
549
+ onValid(dataOption) {
550
+ if (dataOption.value === "123") {
551
+ console.error("非规范值");
552
+ return {
553
+ valid: false,
554
+ message: "非规范值",
555
+ };
556
+ }
557
+ return {
558
+ valid: true,
559
+ };
560
+ },
561
+ },
562
+ ],
555
563
  },
556
- ],
557
- useDialog: true,
558
- },
559
- {
560
- className: "panel-select-multiple",
561
- type: "select-multiple",
562
- text: "select-multiple",
563
- placeholder: "请至少选择一个选项",
564
- getValue() {
565
- return ["select-1", "select-2"];
566
- },
567
- callback(selectInfo) {
568
- console.log(`select值改变,多选信息`, selectInfo);
569
- },
570
- clickCallBack(event, isSelectedInfo) {
571
- console.log("点击", event, isSelectedInfo);
572
- },
573
- closeIconClickCallBack(event, data) {
574
- console.log("点击关闭图标的事件", data);
575
- },
576
- data: [
577
564
  {
578
- value: "select-1",
579
- text: "单选1",
580
- isHTML: false,
581
- disable(value, allSelectedInfo) {
582
- return allSelectedInfo.findIndex((it) => ["select-5"].includes(it.value)) !== -1;
565
+ className: "panel-select-horizontal",
566
+ text: "select-horizontal",
567
+ type: "select",
568
+ mode: "horizontal",
569
+ getValue() {
570
+ return "text";
583
571
  },
584
- },
585
- {
586
- value: "select-2",
587
- text: "单选2",
588
- isHTML: false,
589
- disable(value, allSelectedInfo) {
590
- return allSelectedInfo.findIndex((it) => ["select-5"].includes(it.value)) !== -1;
572
+ callback(isSelectedInfo) {
573
+ if (isSelectedInfo == null) return;
574
+ console.log(`select当前选项:${isSelectedInfo.value},当前选项文本:${isSelectedInfo.text}`);
591
575
  },
576
+ data: [
577
+ {
578
+ value: "all",
579
+ text: "所有",
580
+ disable() {
581
+ return false;
582
+ },
583
+ },
584
+ {
585
+ value: "text",
586
+ text: "文本",
587
+ disable() {
588
+ return false;
589
+ },
590
+ },
591
+ {
592
+ value: "html",
593
+ text: "超文本",
594
+ disable() {
595
+ return false;
596
+ },
597
+ },
598
+ {
599
+ value: "own",
600
+ text: "自定义",
601
+ disable() {
602
+ return true;
603
+ },
604
+ },
605
+ ],
592
606
  },
593
607
  {
594
- value: "select-3",
595
- text: "单选3",
596
- isHTML: false,
597
- disable(value, allSelectedInfo) {
598
- return allSelectedInfo.findIndex((it) => ["select-2", "select-5"].includes(it.value)) !== -1;
608
+ className: "panel-select-multiple",
609
+ type: "select-multiple",
610
+ text: "select-multiple",
611
+ placeholder: "请至少选择一个选项",
612
+ getValue() {
613
+ return ["select-1", "select-2"];
599
614
  },
600
- },
601
- {
602
- value: "select-4",
603
- text: "单选4",
604
- isHTML: false,
605
- disable(value, allSelectedInfo) {
606
- return allSelectedInfo.findIndex((it) => ["select-3", "select-5"].includes(it.value)) !== -1;
615
+ callback(selectInfo) {
616
+ console.log(`select值改变,多选信息`, selectInfo);
607
617
  },
608
- },
609
- {
610
- value: "select-5",
611
- text(value, allSelectedInfo) {
612
- return allSelectedInfo.findIndex((it) => ["select-4"].includes(it.value)) !== -1
613
- ? "单选5-禁用"
614
- : "单选5";
618
+ clickCallBack(event, isSelectedInfo) {
619
+ console.log("点击", event, isSelectedInfo);
615
620
  },
616
- isHTML: false,
617
- disable(value, allSelectedInfo) {
618
- return allSelectedInfo.findIndex((it) => ["select-4"].includes(it.value)) !== -1;
621
+ closeIconClickCallBack(event, data) {
622
+ console.log("点击关闭图标的事件", data);
619
623
  },
624
+ data: [
625
+ {
626
+ value: "select-1",
627
+ text: "单选1",
628
+ isHTML: false,
629
+ disable(value, allSelectedInfo) {
630
+ return allSelectedInfo.findIndex((it) => ["select-5"].includes(it.value)) !== -1;
631
+ },
632
+ },
633
+ {
634
+ value: "select-2",
635
+ text: "单选2",
636
+ isHTML: false,
637
+ disable(value, allSelectedInfo) {
638
+ return allSelectedInfo.findIndex((it) => ["select-5"].includes(it.value)) !== -1;
639
+ },
640
+ },
641
+ {
642
+ value: "select-3",
643
+ text: "单选3",
644
+ isHTML: false,
645
+ disable(value, allSelectedInfo) {
646
+ return allSelectedInfo.findIndex((it) => ["select-2", "select-5"].includes(it.value)) !== -1;
647
+ },
648
+ },
649
+ {
650
+ value: "select-4",
651
+ text: "单选4",
652
+ isHTML: false,
653
+ disable(value, allSelectedInfo) {
654
+ return allSelectedInfo.findIndex((it) => ["select-3", "select-5"].includes(it.value)) !== -1;
655
+ },
656
+ },
657
+ {
658
+ value: "select-5",
659
+ text(value, allSelectedInfo) {
660
+ return allSelectedInfo.findIndex((it) => ["select-4"].includes(it.value)) !== -1
661
+ ? "单选5-禁用"
662
+ : "单选5";
663
+ },
664
+ isHTML: false,
665
+ disable(value, allSelectedInfo) {
666
+ return allSelectedInfo.findIndex((it) => ["select-4"].includes(it.value)) !== -1;
667
+ },
668
+ },
669
+ ],
620
670
  },
621
671
  ],
622
672
  },