@whitesev/pops 1.9.6 → 2.0.0
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 +307 -177
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +307 -177
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +307 -177
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +307 -177
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +307 -177
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +307 -177
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/components/panel/selectType.d.ts +6 -0
- package/dist/types/src/utils/PopsSafeUtils.d.ts +6 -0
- package/package.json +1 -1
- package/src/Pops.ts +4 -3
- package/src/components/folder/index.ts +45 -32
- package/src/components/panel/PanelHandleContentDetails.ts +270 -138
- package/src/components/panel/config.ts +3 -0
- package/src/components/panel/selectType.ts +8 -0
- package/src/components/rightClickMenu/index.ts +9 -3
- package/src/components/searchSuggestion/index.ts +13 -4
- package/src/components/tooltip/index.ts +2 -1
- package/src/utils/PopsDOMUtils.ts +9 -3
- package/src/utils/PopsSafeUtils.ts +22 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { PopsPanelCommonDetails } from "./commonType";
|
|
2
|
+
import type { PopsPanelFormsDetails } from "./formsType";
|
|
3
|
+
import type { PopsPanelFormsTotalDetails } from "./indexType";
|
|
2
4
|
/**
|
|
3
5
|
* pops.panel的 select
|
|
4
6
|
*/
|
|
@@ -71,5 +73,9 @@ export interface PopsPanelSelectDetails<T = any> extends PopsPanelCommonDetails<
|
|
|
71
73
|
* + select元素触发change事件
|
|
72
74
|
*/
|
|
73
75
|
disable?(value: T): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* 子配置,跟随切换改变
|
|
78
|
+
*/
|
|
79
|
+
forms?: (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[] | (() => (PopsPanelFormsDetails | PopsPanelFormsTotalDetails)[]);
|
|
74
80
|
}[];
|
|
75
81
|
}
|
package/package.json
CHANGED
package/src/Pops.ts
CHANGED
|
@@ -78,12 +78,13 @@ import { PopsMathFloatUtils } from "./utils/PopsMathUtils";
|
|
|
78
78
|
import { PanelHandleContentDetails } from "./components/panel/PanelHandleContentDetails";
|
|
79
79
|
import { GlobalConfig } from "./GlobalConfig";
|
|
80
80
|
import { PopsTooltip, type PopsTooltipResult } from "./components/tooltip";
|
|
81
|
+
import { PopsSafeUtils } from "./utils/PopsSafeUtils";
|
|
81
82
|
|
|
82
83
|
class Pops {
|
|
83
84
|
/** 配置 */
|
|
84
85
|
config = {
|
|
85
86
|
/** 版本号 */
|
|
86
|
-
version: "
|
|
87
|
+
version: "2025.3.2",
|
|
87
88
|
cssText: {
|
|
88
89
|
/** 主CSS */
|
|
89
90
|
index: indexCSS,
|
|
@@ -194,7 +195,7 @@ class Pops {
|
|
|
194
195
|
/* 处理获取当前所有的动画名 */
|
|
195
196
|
this.config.isInit = true;
|
|
196
197
|
let animationStyle = document.createElement("style");
|
|
197
|
-
animationStyle
|
|
198
|
+
PopsSafeUtils.setSafeHTML(animationStyle, this.config.cssText.anim);
|
|
198
199
|
popsDOMUtils.appendHead(animationStyle);
|
|
199
200
|
this.config.animation = null as any;
|
|
200
201
|
this.config.animation = PopsInstanceUtils.getKeyFrames(
|
|
@@ -283,7 +284,7 @@ class Pops {
|
|
|
283
284
|
* 提示框
|
|
284
285
|
* @param details 配置
|
|
285
286
|
*/
|
|
286
|
-
tooltip = <T extends PopsToolTipDetails=PopsToolTipDetails>(details: T) => {
|
|
287
|
+
tooltip = <T extends PopsToolTipDetails = PopsToolTipDetails>(details: T) => {
|
|
287
288
|
let popsTooltip = new PopsTooltip(details) as PopsTooltipResult<T>;
|
|
288
289
|
return popsTooltip;
|
|
289
290
|
};
|
|
@@ -4,6 +4,7 @@ import { PopsHandler } from "../../handler/PopsHandler";
|
|
|
4
4
|
import { pops } from "../../Pops";
|
|
5
5
|
import { popsDOMUtils } from "../../utils/PopsDOMUtils";
|
|
6
6
|
import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
|
|
7
|
+
import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
|
|
7
8
|
import { popsUtils } from "../../utils/PopsUtils";
|
|
8
9
|
import { PopsFolderConfig } from "./config";
|
|
9
10
|
import { Folder_ICON } from "./folderIcon";
|
|
@@ -387,27 +388,36 @@ export class PopsFolder {
|
|
|
387
388
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
388
389
|
fileTimeElement.className = "pops-folder-list-table__body-td";
|
|
389
390
|
fileFormatSize.className = "pops-folder-list-table__body-td";
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
391
|
+
PopsSafeUtils.setSafeHTML(
|
|
392
|
+
fileNameElement,
|
|
393
|
+
/*html*/ `
|
|
394
|
+
<div class="pops-folder-list-file-name cursor-p">
|
|
395
|
+
<div>
|
|
396
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
397
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
398
|
+
${fileName}
|
|
399
|
+
</a>
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
`
|
|
403
|
+
);
|
|
404
|
+
PopsSafeUtils.setSafeHTML(
|
|
405
|
+
fileTimeElement,
|
|
406
|
+
/*html*/ `
|
|
407
|
+
<div class="pops-folder-list__time">
|
|
408
|
+
<span>${latestTime}</span>
|
|
409
|
+
</div>
|
|
410
|
+
`
|
|
411
|
+
);
|
|
412
|
+
PopsSafeUtils.setSafeHTML(
|
|
413
|
+
fileFormatSize,
|
|
414
|
+
/*html*/ `
|
|
415
|
+
<div class="pops-folder-list-format-size">
|
|
416
|
+
<span>${fileSize}</span>
|
|
417
|
+
</div>
|
|
418
|
+
`
|
|
419
|
+
);
|
|
405
420
|
|
|
406
|
-
fileFormatSize.innerHTML = `
|
|
407
|
-
<div class="pops-folder-list-format-size">
|
|
408
|
-
<span>${fileSize}</span>
|
|
409
|
-
</div>
|
|
410
|
-
`;
|
|
411
421
|
/* 存储原来的值 */
|
|
412
422
|
let __value__ = {
|
|
413
423
|
fileName: origin_fileName,
|
|
@@ -479,17 +489,20 @@ export class PopsFolder {
|
|
|
479
489
|
}
|
|
480
490
|
folderELement.className = "pops-folder-list-table__body-row";
|
|
481
491
|
fileNameElement.className = "pops-folder-list-table__body-td";
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
492
|
+
PopsSafeUtils.setSafeHTML(
|
|
493
|
+
fileNameElement,
|
|
494
|
+
/*html*/ `
|
|
495
|
+
<div class="pops-folder-list-file-name pops-mobile-folder-list-file-name cursor-p">
|
|
496
|
+
<img src="${fileIcon}" alt="${fileType}" class="pops-folder-list-file-icon u-file-icon u-file-icon--list">
|
|
497
|
+
<div>
|
|
498
|
+
<a title="${fileName}" class="pops-folder-list-file-name-title-text inline-block-v-middle text-ellip list-name-text">
|
|
499
|
+
${fileName}
|
|
500
|
+
</a>
|
|
501
|
+
<span>${latestTime} ${fileSize}</span>
|
|
502
|
+
</div>
|
|
503
|
+
</div>
|
|
504
|
+
`
|
|
505
|
+
);
|
|
493
506
|
/* 存储原来的值 */
|
|
494
507
|
let __value__ = {
|
|
495
508
|
fileName: origin_fileName,
|
|
@@ -511,7 +524,7 @@ export class PopsFolder {
|
|
|
511
524
|
* 清空每行的元素
|
|
512
525
|
*/
|
|
513
526
|
function clearFolerRow() {
|
|
514
|
-
folderListBodyElement
|
|
527
|
+
PopsSafeUtils.setSafeHTML(folderListBodyElement, "");
|
|
515
528
|
}
|
|
516
529
|
function getArrowIconElement() {
|
|
517
530
|
let iconArrowElement = popsDOMUtils.createElement("div", {
|