@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.
- package/dist/index.amd.js +901 -494
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +901 -494
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +901 -494
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +901 -494
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +901 -494
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +901 -494
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Pops.d.ts +69 -29
- package/dist/types/src/components/panel/handlerComponents.d.ts +202 -55
- package/dist/types/src/components/panel/index.d.ts +1 -1
- package/dist/types/src/components/panel/types/components-select.d.ts +42 -5
- package/package.json +3 -3
- package/src/components/panel/defaultConfig.ts +278 -228
- package/src/components/panel/handlerComponents.ts +551 -197
- package/src/components/panel/index.css +67 -12
- package/src/components/panel/types/components-select.ts +42 -5
- package/src/components/rightClickMenu/index.css +1 -1
- package/src/css/common.css +4 -4
package/dist/types/src/Pops.d.ts
CHANGED
|
@@ -289,7 +289,7 @@ declare class Pops {
|
|
|
289
289
|
notDisable(): void;
|
|
290
290
|
};
|
|
291
291
|
};
|
|
292
|
-
|
|
292
|
+
createSectionContainerItem_slider(viewConfig: import("./components/panel/types/components-slider").PopsPanelSliderConfig): {
|
|
293
293
|
$el: HTMLLIElement;
|
|
294
294
|
handler: {
|
|
295
295
|
[Symbol.toStringTag]: string;
|
|
@@ -423,7 +423,41 @@ declare class Pops {
|
|
|
423
423
|
handler: {
|
|
424
424
|
[Symbol.toStringTag]: string;
|
|
425
425
|
$el: {
|
|
426
|
-
itemLeftTextContainer: HTMLElement
|
|
426
|
+
itemLeftTextContainer: HTMLElement;
|
|
427
|
+
$container: HTMLElement;
|
|
428
|
+
$select: HTMLSelectElement;
|
|
429
|
+
};
|
|
430
|
+
$eleKey: {
|
|
431
|
+
disable: string;
|
|
432
|
+
value: string;
|
|
433
|
+
viewConfig: string;
|
|
434
|
+
};
|
|
435
|
+
$data: {
|
|
436
|
+
data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>[];
|
|
437
|
+
defaultValue: any;
|
|
438
|
+
};
|
|
439
|
+
init(): void;
|
|
440
|
+
setNodeValue($ele: HTMLElement, key: string, value: any): void;
|
|
441
|
+
getNodeValue($ele: HTMLElement, key: string): any;
|
|
442
|
+
disable(): void;
|
|
443
|
+
notDisable(): void;
|
|
444
|
+
isDisabled(): boolean;
|
|
445
|
+
initOption(): void;
|
|
446
|
+
setOptionSelected($option: HTMLOptionElement): void;
|
|
447
|
+
setSelectOptionsDisableStatus(): void;
|
|
448
|
+
setOptionDisableStatus($option: HTMLOptionElement): void;
|
|
449
|
+
getSelectOptionInfo($option: HTMLOptionElement): {
|
|
450
|
+
value: any;
|
|
451
|
+
text: string;
|
|
452
|
+
views: NonNullable<IFunction<(import("./components/panel/types").PopsPanelViewConfig | import("./components/panel/types/components-container").PopsPanelContainerConfig)[]> | undefined>;
|
|
453
|
+
$option: HTMLOptionElement;
|
|
454
|
+
};
|
|
455
|
+
onValueChange(): void;
|
|
456
|
+
onClick(): void;
|
|
457
|
+
} | {
|
|
458
|
+
[Symbol.toStringTag]: string;
|
|
459
|
+
$el: {
|
|
460
|
+
$itemLeftContainer: HTMLElement;
|
|
427
461
|
$container: HTMLElement;
|
|
428
462
|
$wrapper: HTMLElement;
|
|
429
463
|
$section: HTMLElement;
|
|
@@ -455,8 +489,8 @@ declare class Pops {
|
|
|
455
489
|
setItemSelected($el: HTMLElement): void;
|
|
456
490
|
removeItemSelected($el: HTMLElement): void;
|
|
457
491
|
isItemSelected($el: HTMLElement): boolean;
|
|
458
|
-
addSelectedItemInfo(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): void;
|
|
459
492
|
getItemDataOption($el: HTMLElement): import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>;
|
|
493
|
+
addSelectedItemInfo(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): void;
|
|
460
494
|
removeSelectedItemInfo(): void;
|
|
461
495
|
updateSelectedInfo(data?: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): void;
|
|
462
496
|
resetCurrentSelectedInfo(): void;
|
|
@@ -477,45 +511,51 @@ declare class Pops {
|
|
|
477
511
|
} | {
|
|
478
512
|
[Symbol.toStringTag]: string;
|
|
479
513
|
$el: {
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
};
|
|
484
|
-
$eleKey: {
|
|
485
|
-
disable: string;
|
|
486
|
-
value: string;
|
|
487
|
-
viewConfig: string;
|
|
514
|
+
$itemLeftContainer: HTMLElement;
|
|
515
|
+
$container: HTMLElement;
|
|
516
|
+
$wrapper: HTMLElement;
|
|
488
517
|
};
|
|
489
518
|
$data: {
|
|
490
519
|
data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>[];
|
|
491
520
|
defaultValue: any;
|
|
521
|
+
selectedData: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any> | undefined;
|
|
522
|
+
rotateKey: string;
|
|
492
523
|
};
|
|
493
524
|
init(): void;
|
|
494
|
-
|
|
495
|
-
|
|
525
|
+
initDefault(): void;
|
|
526
|
+
initEl(): void;
|
|
496
527
|
disable(): void;
|
|
497
|
-
|
|
528
|
+
cancleDisable(): void;
|
|
498
529
|
isDisabled(): boolean;
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
530
|
+
createSelectItemElement(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): HTMLDivElement;
|
|
531
|
+
setSelectItemText(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>, $select: HTMLElement): void;
|
|
532
|
+
onSelectItemClick(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any> | undefined, $el: HTMLElement): void;
|
|
533
|
+
onValueChangeCallback(data?: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>, isUpdateSelectItem?: boolean): void;
|
|
534
|
+
updateAllSelectItemStatus(): void;
|
|
535
|
+
resetAllSelectedItemStatus(): void;
|
|
536
|
+
addSelectedItemInfo(data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): void;
|
|
537
|
+
removeSelectedItemInfo(): void;
|
|
538
|
+
updateSelectedInfo(data?: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>): void;
|
|
539
|
+
resetCurrentSelectedInfo(): void;
|
|
540
|
+
setSelectItemDisabled($select: HTMLElement): void;
|
|
541
|
+
removeSelectItemDisabled($select: HTMLElement): void;
|
|
542
|
+
isSelectItemDisabled($select: HTMLElement): string | true | null;
|
|
543
|
+
setItemSelected($select: HTMLElement): void;
|
|
544
|
+
removeItemSelected($select: HTMLElement): void;
|
|
545
|
+
isItemSelected($select: HTMLElement): boolean;
|
|
546
|
+
getAllSelectItems(onlySelected?: boolean): {
|
|
547
|
+
data: import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>;
|
|
548
|
+
$select: HTMLElement;
|
|
549
|
+
}[];
|
|
550
|
+
getItemDataOption($el: HTMLElement): import("./components/panel/types/components-select").PopsPanelSelectDataOption<any>;
|
|
551
|
+
} | undefined;
|
|
512
552
|
};
|
|
513
553
|
createSectionContainerItem_select_multiple(viewConfig: import("./components/panel/types/components-selectMultiple").PopsPanelSelectMultipleConfig<any>): {
|
|
514
554
|
$el: HTMLLIElement;
|
|
515
555
|
handler: {
|
|
516
556
|
[Symbol.toStringTag]: string;
|
|
517
557
|
$el: {
|
|
518
|
-
|
|
558
|
+
$itemLeftContainer: HTMLElement | null;
|
|
519
559
|
$container: HTMLElement;
|
|
520
560
|
$wrapper: HTMLElement;
|
|
521
561
|
$section: HTMLElement;
|
|
@@ -758,6 +798,7 @@ declare class Pops {
|
|
|
758
798
|
panel: (config: PopsPanelConfig) => {
|
|
759
799
|
addEventListener: <K extends keyof import("./components/panel/types").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/types").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
760
800
|
removeEventListener: <K extends keyof import("./components/panel/types").PopsPanelEventType>(event: K, listener: (evt: CustomEvent<import("./components/panel/types").PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
801
|
+
mode: import("./types/main").PopsType;
|
|
761
802
|
close: () => Promise<void>;
|
|
762
803
|
hide: () => Promise<void>;
|
|
763
804
|
show: () => Promise<void>;
|
|
@@ -768,7 +809,6 @@ declare class Pops {
|
|
|
768
809
|
$anim: HTMLDivElement;
|
|
769
810
|
$pops: HTMLDivElement;
|
|
770
811
|
$mask?: HTMLDivElement | undefined;
|
|
771
|
-
mode: import("./types/main").PopsType;
|
|
772
812
|
};
|
|
773
813
|
/**
|
|
774
814
|
* 右键菜单
|
|
@@ -170,7 +170,7 @@ export declare const PanelHandlerComponents: () => {
|
|
|
170
170
|
* 获取中间容器的元素<li>
|
|
171
171
|
* @param viewConfig
|
|
172
172
|
*/
|
|
173
|
-
|
|
173
|
+
createSectionContainerItem_slider(viewConfig: PopsPanelSliderConfig): {
|
|
174
174
|
$el: HTMLLIElement;
|
|
175
175
|
handler: {
|
|
176
176
|
[Symbol.toStringTag]: string;
|
|
@@ -521,7 +521,86 @@ export declare const PanelHandlerComponents: () => {
|
|
|
521
521
|
handler: {
|
|
522
522
|
[Symbol.toStringTag]: string;
|
|
523
523
|
$el: {
|
|
524
|
-
itemLeftTextContainer: HTMLElement
|
|
524
|
+
itemLeftTextContainer: HTMLElement;
|
|
525
|
+
$container: HTMLElement;
|
|
526
|
+
$select: HTMLSelectElement;
|
|
527
|
+
};
|
|
528
|
+
$eleKey: {
|
|
529
|
+
disable: string;
|
|
530
|
+
value: string;
|
|
531
|
+
viewConfig: string;
|
|
532
|
+
};
|
|
533
|
+
$data: {
|
|
534
|
+
data: PopsPanelSelectDataOption<any>[];
|
|
535
|
+
defaultValue: any;
|
|
536
|
+
};
|
|
537
|
+
init(): void;
|
|
538
|
+
/**
|
|
539
|
+
* 给option元素设置属性
|
|
540
|
+
* @param $ele
|
|
541
|
+
* @param key
|
|
542
|
+
* @param value
|
|
543
|
+
*/
|
|
544
|
+
setNodeValue($ele: HTMLElement, key: string, value: any): void;
|
|
545
|
+
/**
|
|
546
|
+
* 获取option元素上设置的属性
|
|
547
|
+
* @param $ele
|
|
548
|
+
* @param value
|
|
549
|
+
* @param key
|
|
550
|
+
*/
|
|
551
|
+
getNodeValue($ele: HTMLElement, key: string): any;
|
|
552
|
+
/**
|
|
553
|
+
* 禁用选项
|
|
554
|
+
*/
|
|
555
|
+
disable(): void;
|
|
556
|
+
/**
|
|
557
|
+
* 取消禁用
|
|
558
|
+
*/
|
|
559
|
+
notDisable(): void;
|
|
560
|
+
/**
|
|
561
|
+
* 判断是否禁用
|
|
562
|
+
*/
|
|
563
|
+
isDisabled(): boolean;
|
|
564
|
+
/**
|
|
565
|
+
* 初始化选项
|
|
566
|
+
*/
|
|
567
|
+
initOption(): void;
|
|
568
|
+
/**
|
|
569
|
+
* 设置选项选中
|
|
570
|
+
* @param $option
|
|
571
|
+
*/
|
|
572
|
+
setOptionSelected($option: HTMLOptionElement): void;
|
|
573
|
+
/**
|
|
574
|
+
* 检测所有option并设置禁用状态
|
|
575
|
+
*/
|
|
576
|
+
setSelectOptionsDisableStatus(): void;
|
|
577
|
+
/**
|
|
578
|
+
* 设置禁用状态
|
|
579
|
+
* @param $option
|
|
580
|
+
*/
|
|
581
|
+
setOptionDisableStatus($option: HTMLOptionElement): void;
|
|
582
|
+
/**
|
|
583
|
+
* 获取option上的信息
|
|
584
|
+
* @param $option
|
|
585
|
+
*/
|
|
586
|
+
getSelectOptionInfo($option: HTMLOptionElement): {
|
|
587
|
+
value: any;
|
|
588
|
+
text: string;
|
|
589
|
+
views: NonNullable<IFunction<(PopsPanelViewConfig | PopsPanelContainerConfig)[]> | undefined>;
|
|
590
|
+
$option: HTMLOptionElement;
|
|
591
|
+
};
|
|
592
|
+
/**
|
|
593
|
+
* 监听选择内容改变
|
|
594
|
+
*/
|
|
595
|
+
onValueChange(): void;
|
|
596
|
+
/**
|
|
597
|
+
* 监听点击事件
|
|
598
|
+
*/
|
|
599
|
+
onClick(): void;
|
|
600
|
+
} | {
|
|
601
|
+
[Symbol.toStringTag]: string;
|
|
602
|
+
$el: {
|
|
603
|
+
$itemLeftContainer: HTMLElement;
|
|
525
604
|
/** 选择框容器 */
|
|
526
605
|
$container: HTMLElement;
|
|
527
606
|
/** 选择框包裹的容器 */
|
|
@@ -630,17 +709,17 @@ export declare const PanelHandlerComponents: () => {
|
|
|
630
709
|
* @param $el
|
|
631
710
|
*/
|
|
632
711
|
isItemSelected($el: HTMLElement): boolean;
|
|
712
|
+
/**
|
|
713
|
+
* 获取项上存储的信息
|
|
714
|
+
* @param $el 选项元素
|
|
715
|
+
*/
|
|
716
|
+
getItemDataOption($el: HTMLElement): PopsPanelSelectDataOption<any>;
|
|
633
717
|
/**
|
|
634
718
|
* 添加选中信息
|
|
635
719
|
* @param data 选择项的数据
|
|
636
720
|
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
637
721
|
*/
|
|
638
722
|
addSelectedItemInfo(data: PopsPanelSelectDataOption<any>): void;
|
|
639
|
-
/**
|
|
640
|
-
* 获取项上存储的信息
|
|
641
|
-
* @param $el 选项元素
|
|
642
|
-
*/
|
|
643
|
-
getItemDataOption($el: HTMLElement): PopsPanelSelectDataOption<any>;
|
|
644
723
|
/**
|
|
645
724
|
* 移除选中信息
|
|
646
725
|
* @param data 选择项的数据
|
|
@@ -710,83 +789,151 @@ export declare const PanelHandlerComponents: () => {
|
|
|
710
789
|
} | {
|
|
711
790
|
[Symbol.toStringTag]: string;
|
|
712
791
|
$el: {
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
disable: string;
|
|
719
|
-
value: string;
|
|
720
|
-
viewConfig: string;
|
|
792
|
+
$itemLeftContainer: HTMLElement;
|
|
793
|
+
/** 选择框容器 */
|
|
794
|
+
$container: HTMLElement;
|
|
795
|
+
/** 选择框包裹的容器 */
|
|
796
|
+
$wrapper: HTMLElement;
|
|
721
797
|
};
|
|
722
798
|
$data: {
|
|
799
|
+
/**
|
|
800
|
+
* 数据
|
|
801
|
+
*/
|
|
723
802
|
data: PopsPanelSelectDataOption<any>[];
|
|
803
|
+
/**
|
|
804
|
+
* 默认值
|
|
805
|
+
*/
|
|
724
806
|
defaultValue: any;
|
|
807
|
+
/**
|
|
808
|
+
* 选择的信息
|
|
809
|
+
*/
|
|
810
|
+
selectedData: PopsPanelSelectDataOption<any> | undefined;
|
|
811
|
+
/**
|
|
812
|
+
* 箭头旋转的属性
|
|
813
|
+
*/
|
|
814
|
+
rotateKey: string;
|
|
725
815
|
};
|
|
816
|
+
/** 初始化 */
|
|
726
817
|
init(): void;
|
|
818
|
+
/** 初始化默认值 */
|
|
819
|
+
initDefault(): void;
|
|
820
|
+
/** 初始化$ele变量 */
|
|
821
|
+
initEl(): void;
|
|
727
822
|
/**
|
|
728
|
-
*
|
|
729
|
-
* @param $ele
|
|
730
|
-
* @param key
|
|
731
|
-
* @param value
|
|
823
|
+
* 禁用选项容器
|
|
732
824
|
*/
|
|
733
|
-
|
|
825
|
+
disable(): void;
|
|
734
826
|
/**
|
|
735
|
-
*
|
|
736
|
-
* @param $ele
|
|
737
|
-
* @param value
|
|
738
|
-
* @param key
|
|
827
|
+
* 取消禁用选项容器
|
|
739
828
|
*/
|
|
740
|
-
|
|
829
|
+
cancleDisable(): void;
|
|
741
830
|
/**
|
|
742
|
-
*
|
|
831
|
+
* 判断当前是否已禁用选项容器
|
|
743
832
|
*/
|
|
744
|
-
|
|
833
|
+
isDisabled(): boolean;
|
|
745
834
|
/**
|
|
746
|
-
*
|
|
835
|
+
* 创建选择项
|
|
836
|
+
* @param data 数据
|
|
747
837
|
*/
|
|
748
|
-
|
|
838
|
+
createSelectItemElement(data: PopsPanelSelectDataOption<any>): HTMLDivElement;
|
|
749
839
|
/**
|
|
750
|
-
*
|
|
840
|
+
* 设置选择项的文字
|
|
841
|
+
* @param data 选择项的数据
|
|
842
|
+
* @param $select 选择项元素
|
|
751
843
|
*/
|
|
752
|
-
|
|
844
|
+
setSelectItemText(data: PopsPanelSelectDataOption<any>, $select: HTMLElement): void;
|
|
753
845
|
/**
|
|
754
|
-
*
|
|
846
|
+
* 设置选择项点击事件
|
|
755
847
|
*/
|
|
756
|
-
|
|
848
|
+
onSelectItemClick(data: PopsPanelSelectDataOption<any> | undefined, $el: HTMLElement): void;
|
|
757
849
|
/**
|
|
758
|
-
*
|
|
759
|
-
* @param
|
|
850
|
+
* 选中的值改变的回调
|
|
851
|
+
* @param data 当前的选中信息
|
|
760
852
|
*/
|
|
761
|
-
|
|
853
|
+
onValueChangeCallback(data?: PopsPanelSelectDataOption<any>, isUpdateSelectItem?: boolean): void;
|
|
762
854
|
/**
|
|
763
|
-
*
|
|
855
|
+
* 更新选项弹窗内的所有选项元素的状态
|
|
856
|
+
*
|
|
857
|
+
* + 更新禁用状态
|
|
858
|
+
* + 更新选中状态
|
|
764
859
|
*/
|
|
765
|
-
|
|
860
|
+
updateAllSelectItemStatus(): void;
|
|
766
861
|
/**
|
|
767
|
-
*
|
|
768
|
-
*
|
|
862
|
+
* 重置所有已选中的项以下状态
|
|
863
|
+
*
|
|
864
|
+
* + 更新选项显示的文字
|
|
865
|
+
* + 移除禁用状态
|
|
866
|
+
* + 移除选中状态
|
|
769
867
|
*/
|
|
770
|
-
|
|
868
|
+
resetAllSelectedItemStatus(): void;
|
|
771
869
|
/**
|
|
772
|
-
*
|
|
773
|
-
* @param
|
|
870
|
+
* 添加选中信息
|
|
871
|
+
* @param data 选择项的数据
|
|
872
|
+
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
774
873
|
*/
|
|
775
|
-
|
|
776
|
-
value: any;
|
|
777
|
-
text: string;
|
|
778
|
-
views: NonNullable<IFunction<(PopsPanelViewConfig | PopsPanelContainerConfig)[]> | undefined>;
|
|
779
|
-
$option: HTMLOptionElement;
|
|
780
|
-
};
|
|
874
|
+
addSelectedItemInfo(data: PopsPanelSelectDataOption<any>): void;
|
|
781
875
|
/**
|
|
782
|
-
*
|
|
876
|
+
* 移除选中信息
|
|
877
|
+
* @param data 选择项的数据
|
|
783
878
|
*/
|
|
784
|
-
|
|
879
|
+
removeSelectedItemInfo(): void;
|
|
785
880
|
/**
|
|
786
|
-
*
|
|
881
|
+
* 更新选中信息
|
|
882
|
+
* @param data 数据
|
|
787
883
|
*/
|
|
788
|
-
|
|
789
|
-
|
|
884
|
+
updateSelectedInfo(data?: PopsPanelSelectDataOption<any>): void;
|
|
885
|
+
/**
|
|
886
|
+
* 从保存的已选中的信息列表中移除目标信息
|
|
887
|
+
*/
|
|
888
|
+
resetCurrentSelectedInfo(): void;
|
|
889
|
+
/**
|
|
890
|
+
* 设置选择项禁用
|
|
891
|
+
* @param $select 选择项元素
|
|
892
|
+
*/
|
|
893
|
+
setSelectItemDisabled($select: HTMLElement): void;
|
|
894
|
+
/**
|
|
895
|
+
* 移除选择项的禁用状态
|
|
896
|
+
* @param $select 选择项元素
|
|
897
|
+
*/
|
|
898
|
+
removeSelectItemDisabled($select: HTMLElement): void;
|
|
899
|
+
/**
|
|
900
|
+
* 判断选择项是否禁用
|
|
901
|
+
* @param $select 选择项元素
|
|
902
|
+
*/
|
|
903
|
+
isSelectItemDisabled($select: HTMLElement): string | true | null;
|
|
904
|
+
/**
|
|
905
|
+
* 设置选择项选中
|
|
906
|
+
* @param $select 选择项元素(.select-item)
|
|
907
|
+
*/
|
|
908
|
+
setItemSelected($select: HTMLElement): void;
|
|
909
|
+
/**
|
|
910
|
+
* 移除选择项选中
|
|
911
|
+
* @param $select 选择项元素(.select-item)
|
|
912
|
+
*/
|
|
913
|
+
removeItemSelected($select: HTMLElement): void;
|
|
914
|
+
/**
|
|
915
|
+
* 判断选择项是否选中
|
|
916
|
+
* @param $select 选择项元素(.select-item)
|
|
917
|
+
*/
|
|
918
|
+
isItemSelected($select: HTMLElement): boolean;
|
|
919
|
+
/**
|
|
920
|
+
* 获取所有选项的信息
|
|
921
|
+
* @param [onlySelected=true] 是否仅获取选中的项的信息
|
|
922
|
+
* + true (默认)仅获取选中项的信息
|
|
923
|
+
* + false 获取所有选择项的信息
|
|
924
|
+
*/
|
|
925
|
+
getAllSelectItems(onlySelected?: boolean): {
|
|
926
|
+
/** 选项信息数据 */
|
|
927
|
+
data: PopsPanelSelectDataOption<any>;
|
|
928
|
+
/** 选项元素 */
|
|
929
|
+
$select: HTMLElement;
|
|
930
|
+
}[];
|
|
931
|
+
/**
|
|
932
|
+
* 获取项上存储的信息
|
|
933
|
+
* @param $el 选项元素
|
|
934
|
+
*/
|
|
935
|
+
getItemDataOption($el: HTMLElement): PopsPanelSelectDataOption<any>;
|
|
936
|
+
} | undefined;
|
|
790
937
|
};
|
|
791
938
|
/**
|
|
792
939
|
* type ==> select-multiple
|
|
@@ -799,7 +946,7 @@ export declare const PanelHandlerComponents: () => {
|
|
|
799
946
|
[Symbol.toStringTag]: string;
|
|
800
947
|
$el: {
|
|
801
948
|
/** 左侧文本容器 */
|
|
802
|
-
|
|
949
|
+
$itemLeftContainer: HTMLElement | null;
|
|
803
950
|
/** 选择框容器 */
|
|
804
951
|
$container: HTMLElement;
|
|
805
952
|
/** 选择框包裹的容器 */
|
|
@@ -4,6 +4,7 @@ export declare const PopsPanel: {
|
|
|
4
4
|
init(__config__: PopsPanelConfig): {
|
|
5
5
|
addEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
6
6
|
removeEventListener: <K extends keyof PopsPanelEventType>(event: K, listener: (evt: CustomEvent<PopsPanelEventType[K]>) => void, options?: boolean | EventListenerOptions) => void;
|
|
7
|
+
mode: PopsType;
|
|
7
8
|
close: () => Promise<void>;
|
|
8
9
|
hide: () => Promise<void>;
|
|
9
10
|
show: () => Promise<void>;
|
|
@@ -14,6 +15,5 @@ export declare const PopsPanel: {
|
|
|
14
15
|
$anim: HTMLDivElement;
|
|
15
16
|
$pops: HTMLDivElement;
|
|
16
17
|
$mask?: HTMLDivElement | undefined;
|
|
17
|
-
mode: PopsType;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -2,7 +2,37 @@ import type { PopsPanelGeneralConfig } from "./components-common";
|
|
|
2
2
|
import type { PopsPanelContainerConfig } from "./components-container";
|
|
3
3
|
import type { PopsPanelViewConfig } from ".";
|
|
4
4
|
import type { PopsAlertConfig } from "../../alert/types";
|
|
5
|
-
export
|
|
5
|
+
export type PopsPanelSelectMode = "native" | "dialog" | "horizontal";
|
|
6
|
+
/**
|
|
7
|
+
* 分组配置
|
|
8
|
+
*
|
|
9
|
+
* 用在mode="dialog"里
|
|
10
|
+
*/
|
|
11
|
+
export type PopsPanelSelectDialogGroupOption<T> = {
|
|
12
|
+
/**
|
|
13
|
+
* 是否是分组
|
|
14
|
+
* @default false
|
|
15
|
+
*
|
|
16
|
+
* + true 这时候text的值是显示的分组名,value是可以忽略的
|
|
17
|
+
*/
|
|
18
|
+
isGroup?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 分组内部选择是否是单选
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
isSingleSelect?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 分组数据列表
|
|
26
|
+
*
|
|
27
|
+
* 该数据仅在mode === "dialog"下生效
|
|
28
|
+
* @default []
|
|
29
|
+
*/
|
|
30
|
+
groupDataOptions?: IFunction<Omit<PopsPanelSelectDataOption<T>, keyof PopsPanelSelectDialogGroupOption<T>>[]>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* 选择项的配置数据
|
|
34
|
+
*/
|
|
35
|
+
export type PopsPanelSelectDataOption<T> = {
|
|
6
36
|
/**
|
|
7
37
|
* 真正的值
|
|
8
38
|
*/
|
|
@@ -59,7 +89,7 @@ export interface PopsPanelSelectDataOption<T> {
|
|
|
59
89
|
valid: boolean;
|
|
60
90
|
message?: string;
|
|
61
91
|
};
|
|
62
|
-
}
|
|
92
|
+
};
|
|
63
93
|
/**
|
|
64
94
|
* pops.panel的 select
|
|
65
95
|
*/
|
|
@@ -106,6 +136,8 @@ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<P
|
|
|
106
136
|
* 点击select元素触发该回调
|
|
107
137
|
* @param event 点击事件
|
|
108
138
|
* @param selectElement 当前的select元素
|
|
139
|
+
* @returns
|
|
140
|
+
* + false 阻止更新状态
|
|
109
141
|
*/
|
|
110
142
|
clickCallBack?(event: PointerEvent | MouseEvent,
|
|
111
143
|
/** 当前已选中的信息 */
|
|
@@ -115,10 +147,15 @@ export interface PopsPanelSelectConfig<T = any> extends PopsPanelGeneralConfig<P
|
|
|
115
147
|
*/
|
|
116
148
|
data: IFunction<PopsPanelSelectDataOption<T>[]>;
|
|
117
149
|
/**
|
|
118
|
-
*
|
|
119
|
-
* @default
|
|
150
|
+
* 显示模式
|
|
151
|
+
* @default "native"
|
|
152
|
+
*/
|
|
153
|
+
mode?: PopsPanelSelectMode;
|
|
154
|
+
/**
|
|
155
|
+
* 宽度
|
|
156
|
+
* @default "200px"
|
|
120
157
|
*/
|
|
121
|
-
|
|
158
|
+
width?: number | string;
|
|
122
159
|
/**
|
|
123
160
|
* 弹出的下拉列表弹窗的配置
|
|
124
161
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@whitesev/pops",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "弹窗库,包含了alert、confirm、prompt、drawer、loading、iframe、rightClickMenu等组件",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/WhiteSevs/TamperMonkeyScript/tree/master/lib/pops#readme",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@rollup/plugin-terser": "^0.4.4",
|
|
52
52
|
"@rollup/plugin-typescript": "12.3.0",
|
|
53
53
|
"browserslist": "^4.28.0",
|
|
54
|
-
"caniuse-lite": "^1.0.
|
|
54
|
+
"caniuse-lite": "^1.0.30001756",
|
|
55
55
|
"eslint": "^9.39.1",
|
|
56
56
|
"eslint-config-prettier": "^10.1.8",
|
|
57
57
|
"eslint-plugin-compat": "^6.0.2",
|
|
58
58
|
"eslint-plugin-prettier": "^5.5.4",
|
|
59
59
|
"globals": "^16.5.0",
|
|
60
|
-
"rollup": "^4.53.
|
|
60
|
+
"rollup": "^4.53.3",
|
|
61
61
|
"rollup-plugin-clear": "^2.0.7",
|
|
62
62
|
"rollup-plugin-import-css": "^4.1.2",
|
|
63
63
|
"tslib": "^2.8.1",
|