@whitesev/pops 2.2.4 → 2.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.amd.js +214 -146
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +214 -146
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +214 -146
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +214 -146
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +214 -146
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +214 -146
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/components/panel/types/components-selectMultiple.d.ts +1 -1
- package/dist/types/src/handler/PopsElementHandler.d.ts +11 -11
- package/package.json +1 -1
- package/src/Pops.ts +1 -1
- package/src/components/alert/index.ts +6 -6
- package/src/components/confirm/index.ts +6 -6
- package/src/components/drawer/index.ts +6 -6
- package/src/components/folder/index.ts +5 -5
- package/src/components/iframe/index.css +1 -1
- package/src/components/iframe/index.ts +4 -4
- package/src/components/loading/index.ts +3 -3
- package/src/components/panel/config.ts +17 -1
- package/src/components/panel/handlerComponents.ts +160 -39
- package/src/components/panel/index.css +79 -23
- package/src/components/panel/index.ts +4 -4
- package/src/components/panel/types/components-selectMultiple.ts +1 -1
- package/src/components/prompt/index.ts +6 -6
- package/src/css/animation.css +5 -22
- package/src/css/button.css +35 -39
- package/src/css/index.css +10 -11
- package/src/handler/PopsElementHandler.ts +72 -67
- package/src/handler/PopsHandler.ts +4 -4
package/src/css/animation.css
CHANGED
|
@@ -62,21 +62,21 @@
|
|
|
62
62
|
@keyframes searchSelectFalIn {
|
|
63
63
|
from {
|
|
64
64
|
opacity: 0;
|
|
65
|
-
display:none;
|
|
65
|
+
display: none;
|
|
66
66
|
}
|
|
67
67
|
to {
|
|
68
|
-
display:block;
|
|
68
|
+
display: block;
|
|
69
69
|
opacity: 1;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
@keyframes searchSelectFalOut {
|
|
73
73
|
from {
|
|
74
|
-
display:block;
|
|
74
|
+
display: block;
|
|
75
75
|
opacity: 1;
|
|
76
76
|
}
|
|
77
77
|
to {
|
|
78
78
|
opacity: 0;
|
|
79
|
-
display:none;
|
|
79
|
+
display: none;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -1915,24 +1915,7 @@
|
|
|
1915
1915
|
}
|
|
1916
1916
|
0% {
|
|
1917
1917
|
opacity: 1;
|
|
1918
|
-
transform: matrix3d(
|
|
1919
|
-
1,
|
|
1920
|
-
0,
|
|
1921
|
-
0,
|
|
1922
|
-
0,
|
|
1923
|
-
0,
|
|
1924
|
-
1,
|
|
1925
|
-
0,
|
|
1926
|
-
0,
|
|
1927
|
-
0,
|
|
1928
|
-
0,
|
|
1929
|
-
1,
|
|
1930
|
-
0,
|
|
1931
|
-
0,
|
|
1932
|
-
0,
|
|
1933
|
-
0type=close,
|
|
1934
|
-
1
|
|
1935
|
-
);
|
|
1918
|
+
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
|
|
1936
1919
|
}
|
|
1937
1920
|
}
|
|
1938
1921
|
@keyframes pops-anim-roll-reverse {
|
package/src/css/button.css
CHANGED
|
@@ -358,188 +358,184 @@
|
|
|
358
358
|
.pops-panel-button-no-icon .pops-panel-button_inner i {
|
|
359
359
|
display: none;
|
|
360
360
|
}
|
|
361
|
-
.pops-panel-button-right-icon {
|
|
362
|
-
}
|
|
363
361
|
.pops-panel-button-right-icon .pops-panel-button_inner {
|
|
364
362
|
flex-direction: row-reverse;
|
|
365
363
|
}
|
|
366
|
-
.pops-panel-button-right-icon .pops-panel-button_inner i {
|
|
367
|
-
}
|
|
368
364
|
.pops-panel-button .pops-panel-button_inner i:has(svg),
|
|
369
365
|
.pops-panel-button-right-icon .pops-panel-button-text {
|
|
370
366
|
margin-right: 6px;
|
|
371
367
|
}
|
|
372
368
|
|
|
373
|
-
.pops button[type="default"] {
|
|
369
|
+
.pops button[data-type="default"] {
|
|
374
370
|
--button-color: var(--button-default-color);
|
|
375
371
|
--button-bd-color: var(--button-default-bd-color);
|
|
376
372
|
--button-bg-color: var(--button-default-bg-color);
|
|
377
373
|
}
|
|
378
|
-
.pops button[type="default"]:active {
|
|
374
|
+
.pops button[data-type="default"]:active {
|
|
379
375
|
--button-color: var(--button-default-active-color);
|
|
380
376
|
--button-bd-color: var(--button-default-active-bd-color);
|
|
381
377
|
--button-bg-color: var(--button-default-active-bg-color);
|
|
382
378
|
}
|
|
383
|
-
.pops button[type="default"]:hover {
|
|
379
|
+
.pops button[data-type="default"]:hover {
|
|
384
380
|
--button-color: var(--button-default-hover-color);
|
|
385
381
|
--button-bd-color: var(--button-default-hover-bd-color);
|
|
386
382
|
--button-bg-color: var(--button-default-hover-bg-color);
|
|
387
383
|
}
|
|
388
|
-
.pops button[type="default"]:focus-visible {
|
|
384
|
+
.pops button[data-type="default"]:focus-visible {
|
|
389
385
|
outline: var(--button-default-focus-visible-outline);
|
|
390
386
|
outline-offset: var(--button-default-focus-visible-outline-offset);
|
|
391
387
|
}
|
|
392
|
-
.pops button[type="default"]:disabled {
|
|
388
|
+
.pops button[data-type="default"]:disabled {
|
|
393
389
|
--button-color: var(--button-default-disabled-color);
|
|
394
390
|
--button-bd-color: var(--button-default-disabled-bd-color);
|
|
395
391
|
--button-bg-color: var(--button-default-disabled-bg-color);
|
|
396
392
|
}
|
|
397
393
|
|
|
398
|
-
.pops button[type="primary"] {
|
|
394
|
+
.pops button[data-type="primary"] {
|
|
399
395
|
--button-color: var(--button-primary-color);
|
|
400
396
|
--button-bd-color: var(--button-primary-bd-color);
|
|
401
397
|
--button-bg-color: var(--button-primary-bg-color);
|
|
402
398
|
}
|
|
403
|
-
.pops button[type="primary"]:active {
|
|
399
|
+
.pops button[data-type="primary"]:active {
|
|
404
400
|
--button-color: var(--button-primary-active-color);
|
|
405
401
|
--button-bd-color: var(--button-primary-active-bd-color);
|
|
406
402
|
--button-bg-color: var(--button-primary-active-bg-color);
|
|
407
403
|
}
|
|
408
|
-
.pops button[type="primary"]:hover {
|
|
404
|
+
.pops button[data-type="primary"]:hover {
|
|
409
405
|
--button-color: var(--button-primary-hover-color);
|
|
410
406
|
--button-bd-color: var(--button-primary-hover-bd-color);
|
|
411
407
|
--button-bg-color: var(--button-primary-hover-bg-color);
|
|
412
408
|
}
|
|
413
|
-
.pops button[type="primary"]:focus-visible {
|
|
409
|
+
.pops button[data-type="primary"]:focus-visible {
|
|
414
410
|
outline: var(--button-primary-focus-visible-outline);
|
|
415
411
|
outline-offset: var(--button-primary-focus-visible-outline-offset);
|
|
416
412
|
}
|
|
417
|
-
.pops button[type="primary"]:disabled {
|
|
413
|
+
.pops button[data-type="primary"]:disabled {
|
|
418
414
|
--button-color: var(--button-primary-disabled-color);
|
|
419
415
|
--button-bd-color: var(--button-primary-disabled-bd-color);
|
|
420
416
|
--button-bg-color: var(--button-primary-disabled-bg-color);
|
|
421
417
|
}
|
|
422
418
|
|
|
423
|
-
.pops button[type="success"] {
|
|
419
|
+
.pops button[data-type="success"] {
|
|
424
420
|
--button-color: var(--button-success-color);
|
|
425
421
|
--button-bd-color: var(--button-success-bd-color);
|
|
426
422
|
--button-bg-color: var(--button-success-bg-color);
|
|
427
423
|
}
|
|
428
|
-
.pops button[type="success"]:active {
|
|
424
|
+
.pops button[data-type="success"]:active {
|
|
429
425
|
--button-color: var(--button-success-active-color);
|
|
430
426
|
--button-bd-color: var(--button-success-active-bd-color);
|
|
431
427
|
--button-bg-color: var(--button-success-active-bg-color);
|
|
432
428
|
}
|
|
433
|
-
.pops button[type="success"]:hover {
|
|
429
|
+
.pops button[data-type="success"]:hover {
|
|
434
430
|
--button-color: var(--button-success-hover-color);
|
|
435
431
|
--button-bd-color: var(--button-success-hover-bd-color);
|
|
436
432
|
--button-bg-color: var(--button-success-hover-bg-color);
|
|
437
433
|
}
|
|
438
|
-
.pops button[type="success"]:focus-visible {
|
|
434
|
+
.pops button[data-type="success"]:focus-visible {
|
|
439
435
|
outline: var(--button-success-focus-visible-outline);
|
|
440
436
|
outline-offset: var(--button-success-focus-visible-outline-offset);
|
|
441
437
|
}
|
|
442
|
-
.pops button[type="success"]:disabled {
|
|
438
|
+
.pops button[data-type="success"]:disabled {
|
|
443
439
|
--button-color: var(--button-success-disabled-color);
|
|
444
440
|
--button-bd-color: var(--button-success-disabled-bd-color);
|
|
445
441
|
--button-bg-color: var(--button-success-disabled-bg-color);
|
|
446
442
|
}
|
|
447
443
|
|
|
448
|
-
.pops button[type="info"] {
|
|
444
|
+
.pops button[data-type="info"] {
|
|
449
445
|
--button-color: var(--button-info-color);
|
|
450
446
|
--button-bd-color: var(--button-info-bd-color);
|
|
451
447
|
--button-bg-color: var(--button-info-bg-color);
|
|
452
448
|
}
|
|
453
|
-
.pops button[type="info"]:active {
|
|
449
|
+
.pops button[data-type="info"]:active {
|
|
454
450
|
--button-color: var(--button-info-active-color);
|
|
455
451
|
--button-bd-color: var(--button-info-active-bd-color);
|
|
456
452
|
--button-bg-color: var(--button-info-active-bg-color);
|
|
457
453
|
}
|
|
458
|
-
.pops button[type="info"]:hover {
|
|
454
|
+
.pops button[data-type="info"]:hover {
|
|
459
455
|
--button-color: var(--button-info-hover-color);
|
|
460
456
|
--button-bd-color: var(--button-info-hover-bd-color);
|
|
461
457
|
--button-bg-color: var(--button-info-hover-bg-color);
|
|
462
458
|
}
|
|
463
|
-
.pops button[type="info"]:focus-visible {
|
|
459
|
+
.pops button[data-type="info"]:focus-visible {
|
|
464
460
|
outline: var(--button-info-focus-visible-outline);
|
|
465
461
|
outline-offset: var(--button-info-focus-visible-outline-offset);
|
|
466
462
|
}
|
|
467
|
-
.pops button[type="info"]:disabled {
|
|
463
|
+
.pops button[data-type="info"]:disabled {
|
|
468
464
|
--button-color: var(--button-success-disabled-color);
|
|
469
465
|
--button-bd-color: var(--button-success-disabled-bd-color);
|
|
470
466
|
--button-bg-color: var(--button-success-disabled-bg-color);
|
|
471
467
|
}
|
|
472
468
|
|
|
473
|
-
.pops button[type="warning"] {
|
|
469
|
+
.pops button[data-type="warning"] {
|
|
474
470
|
--button-color: var(--button-warning-color);
|
|
475
471
|
--button-bd-color: var(--button-warning-bd-color);
|
|
476
472
|
--button-bg-color: var(--button-warning-bg-color);
|
|
477
473
|
}
|
|
478
|
-
.pops button[type="warning"]:active {
|
|
474
|
+
.pops button[data-type="warning"]:active {
|
|
479
475
|
--button-color: var(--button-warning-active-color);
|
|
480
476
|
--button-bd-color: var(--button-warning-active-bd-color);
|
|
481
477
|
--button-bg-color: var(--button-warning-active-bg-color);
|
|
482
478
|
}
|
|
483
|
-
.pops button[type="warning"]:hover {
|
|
479
|
+
.pops button[data-type="warning"]:hover {
|
|
484
480
|
--button-color: var(--button-warning-hover-color);
|
|
485
481
|
--button-bd-color: var(--button-warning-hover-bd-color);
|
|
486
482
|
--button-bg-color: var(--button-warning-hover-bg-color);
|
|
487
483
|
}
|
|
488
|
-
.pops button[type="warning"]:focus-visible {
|
|
484
|
+
.pops button[data-type="warning"]:focus-visible {
|
|
489
485
|
outline: var(--button-warning-focus-visible-outline);
|
|
490
486
|
outline-offset: var(--button-warning-focus-visible-outline-offset);
|
|
491
487
|
}
|
|
492
|
-
.pops button[type="warning"]:disabled {
|
|
488
|
+
.pops button[data-type="warning"]:disabled {
|
|
493
489
|
--button-color: var(--button-success-disabled-color);
|
|
494
490
|
--button-bd-color: var(--button-success-disabled-bd-color);
|
|
495
491
|
--button-bg-color: var(--button-success-disabled-bg-color);
|
|
496
492
|
}
|
|
497
493
|
|
|
498
|
-
.pops button[type="danger"] {
|
|
494
|
+
.pops button[data-type="danger"] {
|
|
499
495
|
--button-color: var(--button-danger-color);
|
|
500
496
|
--button-bd-color: var(--button-danger-bd-color);
|
|
501
497
|
--button-bg-color: var(--button-danger-bg-color);
|
|
502
498
|
}
|
|
503
|
-
.pops button[type="danger"]:active {
|
|
499
|
+
.pops button[data-type="danger"]:active {
|
|
504
500
|
--button-color: var(--button-danger-active-color);
|
|
505
501
|
--button-bd-color: var(--button-danger-active-bd-color);
|
|
506
502
|
--button-bg-color: var(--button-danger-active-bg-color);
|
|
507
503
|
}
|
|
508
|
-
.pops button[type="danger"]:hover {
|
|
504
|
+
.pops button[data-type="danger"]:hover {
|
|
509
505
|
--button-color: var(--button-danger-hover-color);
|
|
510
506
|
--button-bd-color: var(--button-danger-hover-bd-color);
|
|
511
507
|
--button-bg-color: var(--button-danger-hover-bg-color);
|
|
512
508
|
}
|
|
513
|
-
.pops button[type="danger"]:focus-visible {
|
|
509
|
+
.pops button[data-type="danger"]:focus-visible {
|
|
514
510
|
outline: var(--button-danger-focus-visible-outline);
|
|
515
511
|
outline-offset: var(--button-danger-focus-visible-outline-offset);
|
|
516
512
|
}
|
|
517
|
-
.pops button[type="danger"]:disabled {
|
|
513
|
+
.pops button[data-type="danger"]:disabled {
|
|
518
514
|
--button-color: var(--button-success-disabled-color);
|
|
519
515
|
--button-bd-color: var(--button-success-disabled-bd-color);
|
|
520
516
|
--button-bg-color: var(--button-success-disabled-bg-color);
|
|
521
517
|
}
|
|
522
518
|
|
|
523
|
-
.pops button[type="xiaomi-primary"] {
|
|
519
|
+
.pops button[data-type="xiaomi-primary"] {
|
|
524
520
|
--button-color: var(--button-xiaomi-primary-color);
|
|
525
521
|
--button-bd-color: var(--button-xiaomi-primary-bd-color);
|
|
526
522
|
--button-bg-color: var(--button-xiaomi-primary-bg-color);
|
|
527
523
|
}
|
|
528
|
-
.pops button[type="xiaomi-primary"]:active {
|
|
524
|
+
.pops button[data-type="xiaomi-primary"]:active {
|
|
529
525
|
--button-color: var(--button-xiaomi-primary-active-color);
|
|
530
526
|
--button-bd-color: var(--button-xiaomi-primary-active-bd-color);
|
|
531
527
|
--button-bg-color: var(--button-xiaomi-primary-active-bg-color);
|
|
532
528
|
}
|
|
533
|
-
.pops button[type="xiaomi-primary"]:hover {
|
|
529
|
+
.pops button[data-type="xiaomi-primary"]:hover {
|
|
534
530
|
--button-color: var(--button-xiaomi-primary-hover-color);
|
|
535
531
|
--button-bd-color: var(--button-xiaomi-primary-hover-bd-color);
|
|
536
532
|
--button-bg-color: var(--button-xiaomi-primary-hover-bg-color);
|
|
537
533
|
}
|
|
538
|
-
.pops button[type="xiaomi-primary"]:focus-visible {
|
|
534
|
+
.pops button[data-type="xiaomi-primary"]:focus-visible {
|
|
539
535
|
outline: var(--button-xiaomi-primary-focus-visible-outline);
|
|
540
536
|
outline-offset: var(--button-xiaomi-primary-focus-visible-outline-offset);
|
|
541
537
|
}
|
|
542
|
-
.pops button[type="xiaomi-primary"]:disabled {
|
|
538
|
+
.pops button[data-type="xiaomi-primary"]:disabled {
|
|
543
539
|
--button-color: var(--button-success-disabled-color);
|
|
544
540
|
--button-bd-color: var(--button-success-disabled-bd-color);
|
|
545
541
|
--button-bg-color: var(--button-success-disabled-bg-color);
|
package/src/css/index.css
CHANGED
|
@@ -18,14 +18,11 @@
|
|
|
18
18
|
--pops-bd-color: rgb(235, 238, 245, var(--pops-bd-opacity));
|
|
19
19
|
--pops-box-shadow-color: rgba(0, 0, 0, 0.12);
|
|
20
20
|
--pops-title-color: #000000;
|
|
21
|
-
--pops-title-border-color:
|
|
21
|
+
--pops-title-border-color: var(--pops-bd-color);
|
|
22
22
|
--pops-content-color: #000000;
|
|
23
|
-
--pops-bottom-btn-controls-border-color:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
229,
|
|
27
|
-
var(--pops-bd-opacity)
|
|
28
|
-
);
|
|
23
|
+
--pops-bottom-btn-controls-border-color: var(--pops-bd-color);
|
|
24
|
+
--pops-components-is-disabled-text-color: #a8abb2;
|
|
25
|
+
--pops-components-is-disabled-bg-color: #f5f7fa;
|
|
29
26
|
}
|
|
30
27
|
@media (prefers-color-scheme: dark) {
|
|
31
28
|
.pops {
|
|
@@ -35,8 +32,10 @@
|
|
|
35
32
|
--pops-bd-color: rgb(55, 55, 55, var(--pops-bd-opacity));
|
|
36
33
|
--pops-box-shadow-color: rgba(81, 81, 81, 0.12);
|
|
37
34
|
--pops-title-color: #e8e8e8;
|
|
38
|
-
--pops-title-border-color:
|
|
35
|
+
--pops-title-border-color: var(--pops-bd-color);
|
|
39
36
|
--pops-content-color: #e5e5e5;
|
|
37
|
+
--pops-components-is-disabled-text-color: #a8abb2;
|
|
38
|
+
--pops-components-is-disabled-bg-color: #262727;
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
.pops {
|
|
@@ -118,9 +117,9 @@
|
|
|
118
117
|
color: #888;
|
|
119
118
|
cursor: pointer;
|
|
120
119
|
}
|
|
121
|
-
.pops-header-controls button.pops-header-control[type="max"],
|
|
122
|
-
.pops-header-controls button.pops-header-control[type="mise"],
|
|
123
|
-
.pops-header-controls button.pops-header-control[type="min"] {
|
|
120
|
+
.pops-header-controls button.pops-header-control[data-type="max"],
|
|
121
|
+
.pops-header-controls button.pops-header-control[data-type="mise"],
|
|
122
|
+
.pops-header-controls button.pops-header-control[data-type="min"] {
|
|
124
123
|
outline: 0 !important;
|
|
125
124
|
border: 0;
|
|
126
125
|
border-color: rgb(136, 136, 136, var(--pops-bd-opacity));
|
|
@@ -22,7 +22,7 @@ export const PopsElementHandler = {
|
|
|
22
22
|
* @param zIndex z-index
|
|
23
23
|
* @param style
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
createMask(guid: string, zIndex: number = 101, style = ""): string {
|
|
26
26
|
zIndex = zIndex - 100;
|
|
27
27
|
if (style.startsWith(";")) {
|
|
28
28
|
style = style.replace(";", "");
|
|
@@ -38,7 +38,7 @@ export const PopsElementHandler = {
|
|
|
38
38
|
* @param bottomBtnHTML
|
|
39
39
|
* @param zIndex
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
createAnim(
|
|
42
42
|
guid: string,
|
|
43
43
|
type: PopsSupportAnimDetailsType,
|
|
44
44
|
config: PopsSupportAnimDetails[keyof PopsSupportAnimDetails],
|
|
@@ -79,38 +79,40 @@ export const PopsElementHandler = {
|
|
|
79
79
|
* @param type
|
|
80
80
|
* @param config
|
|
81
81
|
*/
|
|
82
|
-
|
|
82
|
+
createHeader(
|
|
83
83
|
type: PopsSupportHeaderTitleDetailsType,
|
|
84
84
|
config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]
|
|
85
85
|
): string {
|
|
86
86
|
if (!config.btn) {
|
|
87
87
|
return "";
|
|
88
88
|
}
|
|
89
|
-
let
|
|
90
|
-
if (type !== "iframe" && !
|
|
89
|
+
let confirm_config = config as PopsConfirmDetails;
|
|
90
|
+
if (type !== "iframe" && !confirm_config.btn?.close?.enable) {
|
|
91
91
|
return "";
|
|
92
92
|
}
|
|
93
93
|
let resultHTML = "";
|
|
94
94
|
// let btnStyle = "";
|
|
95
95
|
let closeHTML = "";
|
|
96
|
-
let
|
|
97
|
-
if (type === "iframe" &&
|
|
96
|
+
let iframe_config = config as PopsIframeDetails;
|
|
97
|
+
if (type === "iframe" && iframe_config.topRightButton?.trim() !== "") {
|
|
98
98
|
/* iframe的 */
|
|
99
99
|
let topRightButtonHTML = "";
|
|
100
|
-
|
|
100
|
+
iframe_config.topRightButton.split("|").forEach((item: string) => {
|
|
101
|
+
// 最小化、最大化、窗口化、关闭按钮
|
|
101
102
|
item = item.toLowerCase();
|
|
102
103
|
topRightButtonHTML += /*html*/ `
|
|
103
|
-
<button class="pops-header-control" type="${item}">
|
|
104
|
+
<button class="pops-header-control" type="button" data-type="${item}">
|
|
104
105
|
<i class="pops-icon">${PopsIcon.getIcon(item)}</i>
|
|
105
106
|
</button>`;
|
|
106
107
|
});
|
|
107
108
|
resultHTML = /*html*/ `
|
|
108
109
|
<div class="pops-header-controls" data-margin>${topRightButtonHTML}</div>`;
|
|
109
110
|
} else {
|
|
110
|
-
if (
|
|
111
|
+
if (confirm_config.btn?.close?.enable) {
|
|
112
|
+
// 关闭按钮
|
|
111
113
|
closeHTML = /*html*/ `
|
|
112
114
|
<div class="pops-header-controls">
|
|
113
|
-
<button class="pops-header-control" type="close" data-header>
|
|
115
|
+
<button class="pops-header-control" type="button" data-type="close" data-header>
|
|
114
116
|
<i class="pops-icon">${PopsIcon.getIcon("close")}</i>
|
|
115
117
|
</button>
|
|
116
118
|
</div>`;
|
|
@@ -120,25 +122,42 @@ export const PopsElementHandler = {
|
|
|
120
122
|
|
|
121
123
|
return resultHTML;
|
|
122
124
|
},
|
|
125
|
+
/**
|
|
126
|
+
* 获取标题style
|
|
127
|
+
* @param type 弹窗类型
|
|
128
|
+
* @param config 弹窗配置
|
|
129
|
+
*/
|
|
130
|
+
createHeaderStyle(
|
|
131
|
+
type: PopsSupportHeaderTitleDetailsType,
|
|
132
|
+
config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]
|
|
133
|
+
) {
|
|
134
|
+
return {
|
|
135
|
+
headerStyle: config?.title?.html ? config?.title?.style || "" : "",
|
|
136
|
+
headerPStyle: config?.title?.html ? "" : config?.title?.style || "",
|
|
137
|
+
};
|
|
138
|
+
},
|
|
123
139
|
/**
|
|
124
140
|
* 获取底部按钮层HTML
|
|
125
141
|
* @param type
|
|
126
142
|
* @param config
|
|
127
143
|
*/
|
|
128
|
-
|
|
144
|
+
createBottom(
|
|
129
145
|
type: PopsSupportBottomBtnDetailsType,
|
|
130
|
-
config: Omit<
|
|
146
|
+
config: Omit<
|
|
147
|
+
PopsSupportBottomBtnDetails[keyof PopsSupportBottomBtnDetails],
|
|
148
|
+
"content"
|
|
149
|
+
>
|
|
131
150
|
): string {
|
|
132
|
-
if (
|
|
151
|
+
if (config.btn == null) {
|
|
133
152
|
// 未设置btn参数
|
|
134
153
|
return "";
|
|
135
154
|
}
|
|
136
|
-
let
|
|
155
|
+
let confirm_config = config as Required<PopsConfirmDetails>;
|
|
137
156
|
if (
|
|
138
157
|
!(
|
|
139
158
|
config.btn?.ok?.enable ||
|
|
140
|
-
|
|
141
|
-
|
|
159
|
+
confirm_config.btn?.cancel?.enable ||
|
|
160
|
+
confirm_config.btn?.other?.enable
|
|
142
161
|
)
|
|
143
162
|
) {
|
|
144
163
|
// 确定、取消、其它按钮都未启用直接返回
|
|
@@ -154,7 +173,7 @@ export const PopsElementHandler = {
|
|
|
154
173
|
btnStyle += `justify-content: ${config.btn.position};`;
|
|
155
174
|
}
|
|
156
175
|
|
|
157
|
-
if (
|
|
176
|
+
if (confirm_config.btn.reverse) {
|
|
158
177
|
btnStyle += "flex-direction: row-reverse;";
|
|
159
178
|
}
|
|
160
179
|
if (config.btn?.ok?.enable) {
|
|
@@ -166,7 +185,7 @@ export const PopsElementHandler = {
|
|
|
166
185
|
okButtonSizeClassName = "pops-button-" + config.btn.ok.size;
|
|
167
186
|
}
|
|
168
187
|
let okIconHTML = "";
|
|
169
|
-
let okIcon =
|
|
188
|
+
let okIcon = confirm_config.btn.ok!.icon! as PopsIconType | string;
|
|
170
189
|
if (okIcon !== "") {
|
|
171
190
|
// 判断图标是否是svg库内的
|
|
172
191
|
let iconHTML = "";
|
|
@@ -180,29 +199,28 @@ export const PopsElementHandler = {
|
|
|
180
199
|
}
|
|
181
200
|
okHTML = /*html*/ `
|
|
182
201
|
<button
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
202
|
+
class="pops-${type}-btn-ok ${okButtonSizeClassName}"
|
|
203
|
+
type="button"
|
|
204
|
+
data-type="${confirm_config.btn.ok?.type}"
|
|
205
|
+
data-has-icon="${(confirm_config.btn.ok!.icon || "") !== ""}"
|
|
206
|
+
data-rightIcon="${confirm_config.btn.ok?.rightIcon}"
|
|
187
207
|
>${okIconHTML}<span>${config.btn.ok.text}</span>
|
|
188
208
|
</button>`;
|
|
189
209
|
}
|
|
190
210
|
|
|
191
|
-
if (
|
|
211
|
+
if (confirm_config.btn?.cancel?.enable) {
|
|
192
212
|
/* 处理取消按钮的尺寸问题 */
|
|
193
213
|
let cancelButtonSizeClassName = "";
|
|
194
214
|
|
|
195
|
-
if (
|
|
215
|
+
if (confirm_config.btn.cancel.size === "large") {
|
|
196
216
|
cancelButtonSizeClassName =
|
|
197
|
-
"pops-button-" +
|
|
198
|
-
} else if (
|
|
217
|
+
"pops-button-" + confirm_config.btn.cancel.size;
|
|
218
|
+
} else if (confirm_config.btn.cancel.size === "small") {
|
|
199
219
|
cancelButtonSizeClassName =
|
|
200
|
-
"pops-button-" +
|
|
220
|
+
"pops-button-" + confirm_config.btn.cancel.size;
|
|
201
221
|
}
|
|
202
222
|
let cancelIconHTML = "";
|
|
203
|
-
let cancelIcon =
|
|
204
|
-
| PopsIconType
|
|
205
|
-
| string;
|
|
223
|
+
let cancelIcon = confirm_config.btn.cancel!.icon as PopsIconType | string;
|
|
206
224
|
if (cancelIcon !== "") {
|
|
207
225
|
let iconHTML = "";
|
|
208
226
|
// 判断图标是否是svg库内的
|
|
@@ -212,31 +230,32 @@ export const PopsElementHandler = {
|
|
|
212
230
|
iconHTML = cancelIcon;
|
|
213
231
|
}
|
|
214
232
|
iconHTML = iconHTML || "";
|
|
215
|
-
cancelIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${
|
|
233
|
+
cancelIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${confirm_config.btn.cancel.iconIsLoading}">${iconHTML}</i>`;
|
|
216
234
|
}
|
|
217
235
|
cancelHTML = /*html*/ `
|
|
218
236
|
<button
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
237
|
+
class="pops-${type}-btn-cancel ${cancelButtonSizeClassName}"
|
|
238
|
+
type="button"
|
|
239
|
+
data-type="${confirm_config.btn.cancel.type}"
|
|
240
|
+
data-has-icon="${(confirm_config.btn.cancel.icon || "") !== ""}"
|
|
241
|
+
data-rightIcon="${confirm_config.btn.cancel.rightIcon}"
|
|
242
|
+
>${cancelIconHTML}<span>${confirm_config.btn.cancel.text}</span>
|
|
224
243
|
</button>`;
|
|
225
244
|
}
|
|
226
245
|
|
|
227
|
-
if (
|
|
246
|
+
if (confirm_config.btn?.other?.enable) {
|
|
228
247
|
/* 处理其它按钮的尺寸问题 */
|
|
229
248
|
let otherButtonSizeClassName = "";
|
|
230
249
|
|
|
231
|
-
if (
|
|
250
|
+
if (confirm_config.btn.other.size === "large") {
|
|
232
251
|
otherButtonSizeClassName =
|
|
233
|
-
"pops-button-" +
|
|
234
|
-
} else if (
|
|
252
|
+
"pops-button-" + confirm_config.btn.other.size;
|
|
253
|
+
} else if (confirm_config.btn.other.size === "small") {
|
|
235
254
|
otherButtonSizeClassName =
|
|
236
|
-
"pops-button-" +
|
|
255
|
+
"pops-button-" + confirm_config.btn.other.size;
|
|
237
256
|
}
|
|
238
257
|
let otherIconHTML = "";
|
|
239
|
-
let otherIcon =
|
|
258
|
+
let otherIcon = confirm_config.btn.other!.icon as PopsIconType | string;
|
|
240
259
|
if (otherIcon !== "") {
|
|
241
260
|
let iconHTML = "";
|
|
242
261
|
// 判断图标是否是svg库内的
|
|
@@ -246,21 +265,22 @@ export const PopsElementHandler = {
|
|
|
246
265
|
otherIcon;
|
|
247
266
|
}
|
|
248
267
|
iconHTML = iconHTML || "";
|
|
249
|
-
otherIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${
|
|
268
|
+
otherIconHTML = /*html*/ `<i class="pops-bottom-icon" is-loading="${confirm_config.btn.other.iconIsLoading}">${iconHTML}</i>`;
|
|
250
269
|
}
|
|
251
270
|
ohterHTML = /*html*/ `
|
|
252
271
|
<button
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
272
|
+
class="pops-${type}-btn-other ${otherButtonSizeClassName}"
|
|
273
|
+
type="button"
|
|
274
|
+
data-type="${confirm_config.btn.other.type}"
|
|
275
|
+
data-has-icon="${(confirm_config.btn.other.icon || "") !== ""}"
|
|
276
|
+
data-rightIcon="${confirm_config.btn.other.rightIcon}"
|
|
277
|
+
>${otherIconHTML}<span>${confirm_config.btn.other.text}</span>
|
|
258
278
|
</button>`;
|
|
259
279
|
}
|
|
260
280
|
|
|
261
|
-
if (
|
|
281
|
+
if (confirm_config.btn.merge) {
|
|
262
282
|
let flexStyle = "display: flex;";
|
|
263
|
-
if (
|
|
283
|
+
if (confirm_config.btn.mergeReverse) {
|
|
264
284
|
flexStyle += "flex-direction: row-reverse;";
|
|
265
285
|
} else {
|
|
266
286
|
flexStyle += "flex-direction: row;";
|
|
@@ -276,27 +296,12 @@ export const PopsElementHandler = {
|
|
|
276
296
|
}
|
|
277
297
|
return resultHTML;
|
|
278
298
|
},
|
|
279
|
-
/**
|
|
280
|
-
* 获取标题style
|
|
281
|
-
* @param type 弹窗类型
|
|
282
|
-
* @param config 弹窗配置
|
|
283
|
-
*/
|
|
284
|
-
getHeaderStyle(
|
|
285
|
-
type: PopsSupportHeaderTitleDetailsType,
|
|
286
|
-
config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]
|
|
287
|
-
) {
|
|
288
|
-
return {
|
|
289
|
-
headerStyle: config?.title?.html ? config?.title?.style || "" : "",
|
|
290
|
-
|
|
291
|
-
headerPStyle: config?.title?.html ? "" : config?.title?.style || "",
|
|
292
|
-
};
|
|
293
|
-
},
|
|
294
299
|
/**
|
|
295
300
|
* 获取内容style
|
|
296
301
|
* @param type 弹窗类型
|
|
297
302
|
* @param config 弹窗配置
|
|
298
303
|
*/
|
|
299
|
-
|
|
304
|
+
createContentStyle(
|
|
300
305
|
type: PopsSupportContentDetailsType,
|
|
301
306
|
config: PopsSupportContentDetails[keyof PopsSupportContentDetails]
|
|
302
307
|
) {
|
|
@@ -324,25 +324,25 @@ export const PopsHandler = {
|
|
|
324
324
|
* 顶部缩小按钮
|
|
325
325
|
*/
|
|
326
326
|
headerMinBtnElement: animElement.querySelector<HTMLDivElement>(
|
|
327
|
-
".pops-header-control[type='min']"
|
|
327
|
+
".pops-header-control[data-type='min']"
|
|
328
328
|
)!,
|
|
329
329
|
/**
|
|
330
330
|
* 顶部放大按钮
|
|
331
331
|
*/
|
|
332
332
|
headerMaxBtnElement: animElement.querySelector<HTMLDivElement>(
|
|
333
|
-
".pops-header-control[type='max']"
|
|
333
|
+
".pops-header-control[data-type='max']"
|
|
334
334
|
)!,
|
|
335
335
|
/**
|
|
336
336
|
* 顶部恢复原样按钮
|
|
337
337
|
*/
|
|
338
338
|
headerMiseBtnElement: animElement.querySelector<HTMLDivElement>(
|
|
339
|
-
".pops-header-control[type='mise']"
|
|
339
|
+
".pops-header-control[data-type='mise']"
|
|
340
340
|
)!,
|
|
341
341
|
/**
|
|
342
342
|
* 顶部关闭按钮
|
|
343
343
|
*/
|
|
344
344
|
headerCloseBtnElement: animElement.querySelector<HTMLDivElement>(
|
|
345
|
-
".pops-header-control[type='close']"
|
|
345
|
+
".pops-header-control[data-type='close']"
|
|
346
346
|
)!,
|
|
347
347
|
/**
|
|
348
348
|
* 文件夹列表元素
|