@whitesev/pops 1.5.4 → 1.5.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.
@@ -19,12 +19,19 @@ export interface PopsPromptDetails extends PopsTitleConfig, PopsDragConfig, Pops
19
19
  password?: boolean;
20
20
  /**
21
21
  * 是否支持多行输入
22
+ * @default false
22
23
  */
23
24
  row?: boolean;
24
25
  /**
25
26
  * 是否自动获取焦点
27
+ * @default true
26
28
  */
27
29
  focus?: boolean;
30
+ /**
31
+ * 是否自动选择输入框的所有文字
32
+ * @default false
33
+ */
34
+ select?: boolean;
28
35
  /**
29
36
  * 输入框内的提示文字
30
37
  */
@@ -22,10 +22,12 @@ export interface PopsTitleConfig {
22
22
  text?: string;
23
23
  /**
24
24
  * 文字的位置
25
+ * @default "left"
25
26
  */
26
27
  position?: PopsTextAlign;
27
28
  /**
28
29
  * 文字是否是html
30
+ * @default false
29
31
  */
30
32
  html?: boolean;
31
33
  /**
@@ -46,6 +48,7 @@ export interface PopsContentConfig {
46
48
  text?: string;
47
49
  /**
48
50
  * 文字是否是html
51
+ * @default false
49
52
  */
50
53
  html?: boolean;
51
54
  /**
@@ -60,7 +63,8 @@ export interface PopsContentConfig {
60
63
  export interface PopsButtonConfig {
61
64
  btn?: {
62
65
  /**
63
- * 按钮的位置,默认left
66
+ * 按钮的位置
67
+ * @default "flex-end"
64
68
  */
65
69
  position?: PopsJustifyContent;
66
70
  /**
@@ -76,14 +80,17 @@ export interface PopsMoreButtonConfig<T = {}> {
76
80
  btn?: PopsButtonConfig["btn"] & {
77
81
  /**
78
82
  * 是否合并按钮
83
+ * @default false
79
84
  */
80
85
  merge?: boolean;
81
86
  /**
82
87
  * 是否对合并的按钮逆反
88
+ * @default false
83
89
  */
84
90
  mergeReverse?: boolean;
85
91
  /**
86
92
  * 是否逆反
93
+ * @default false
87
94
  */
88
95
  reverse?: boolean;
89
96
  /**
@@ -106,14 +113,17 @@ export interface PopsMoreButtonConfig<T = {}> {
106
113
  export interface PopsDragConfig {
107
114
  /**
108
115
  * 是否可以按钮标题栏进行拖拽,默认false
116
+ * @default false
109
117
  */
110
118
  drag?: boolean;
111
119
  /**
112
120
  * 是否限制拖拽在浏览器窗口内移动,默认true
121
+ * @default true
113
122
  */
114
123
  dragLimit?: boolean;
115
124
  /**
116
125
  * 当启用dragLimit时,该参数为弹窗在窗口中的距离边际的距离,默认为3(px)
126
+ * @default 3
117
127
  */
118
128
  dragExtraDistance?: number;
119
129
  /**
@@ -149,26 +159,32 @@ export interface PopsCommonConfig {
149
159
  class?: string;
150
160
  /**
151
161
  * 是否是唯一的,默认false
162
+ * @default false
152
163
  */
153
164
  only?: boolean;
154
165
  /**
155
166
  * 宽度,默认350px
167
+ * @default 350
156
168
  */
157
169
  width: string;
158
170
  /**
159
171
  * 高度,默认200px
172
+ * @default 200
160
173
  */
161
174
  height: string;
162
175
  /**
163
176
  * 位置,默认center
177
+ * @default "center"
164
178
  */
165
179
  position?: PopsPosition;
166
180
  /**
167
181
  * 动画,默认pops-anim-fadein-zoom
182
+ * @default "pops-anim-fadein-zoom"
168
183
  */
169
184
  animation?: PopsAnimation;
170
185
  /**
171
186
  * z-index显示层级,默认10000
187
+ * @default 10000
172
188
  */
173
189
  zIndex?: number | (() => number);
174
190
  /**
@@ -179,6 +195,7 @@ export interface PopsCommonConfig {
179
195
  * 是否禁用页面滚动,默认false
180
196
  *
181
197
  * 暂时不会生效
198
+ * @default false
182
199
  */
183
200
  forbiddenScroll?: boolean;
184
201
  /**
@@ -4,15 +4,18 @@
4
4
  export interface PopsMaskDetails {
5
5
  /**
6
6
  * 是否启用遮罩层,默认false
7
+ * @default false
7
8
  */
8
9
  enable?: boolean;
9
10
  clickEvent?: {
10
11
  /**
11
12
  * 点击遮罩层是否触发关闭事件
13
+ * @default false
12
14
  */
13
15
  toClose?: boolean;
14
16
  /**
15
17
  * 点击遮罩层是否触发隐藏事件
18
+ * @default false
16
19
  */
17
20
  toHide?: boolean;
18
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "弹窗库",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
package/src/Pops.ts CHANGED
@@ -80,7 +80,7 @@ class Pops {
80
80
  /** 配置 */
81
81
  config = {
82
82
  /** 版本号 */
83
- version: "2024.9.10",
83
+ version: "2024.9.14",
84
84
  cssText: {
85
85
  /** 主CSS */
86
86
  index: indexCSS,
@@ -109,7 +109,7 @@ section.pops-panel-container > ul li {
109
109
  justify-content: space-between;
110
110
  align-items: center;
111
111
  margin: 10px 20px;
112
- gap: 1rem;
112
+ gap: 10px;
113
113
  }
114
114
  section.pops-panel-container li.pops-panel-forms-container-item {
115
115
  display: block;
@@ -27,6 +27,7 @@ export class PopsPrompt {
27
27
  },
28
28
  content: {
29
29
  text: "",
30
+ select: false,
30
31
  password: false,
31
32
  row: false,
32
33
  focus: true,
@@ -288,9 +289,12 @@ export class PopsPrompt {
288
289
  }
289
290
  /* 设置自动获取焦点 */
290
291
  if (config.content.focus) {
291
- $input?.focus();
292
+ $input.focus();
293
+ }
294
+ /* 设置自动选中所有文字 */
295
+ if (config.content.select) {
296
+ $input.select();
292
297
  }
293
-
294
298
  return PopsHandler.handleResultDetails(eventDetails);
295
299
  }
296
300
  }
@@ -29,12 +29,19 @@ export interface PopsPromptDetails
29
29
  password?: boolean;
30
30
  /**
31
31
  * 是否支持多行输入
32
+ * @default false
32
33
  */
33
34
  row?: boolean;
34
35
  /**
35
36
  * 是否自动获取焦点
37
+ * @default true
36
38
  */
37
39
  focus?: boolean;
40
+ /**
41
+ * 是否自动选择输入框的所有文字
42
+ * @default false
43
+ */
44
+ select?: boolean;
38
45
  /**
39
46
  * 输入框内的提示文字
40
47
  */
@@ -22,10 +22,12 @@ export interface PopsTitleConfig {
22
22
  text?: string;
23
23
  /**
24
24
  * 文字的位置
25
+ * @default "left"
25
26
  */
26
27
  position?: PopsTextAlign;
27
28
  /**
28
29
  * 文字是否是html
30
+ * @default false
29
31
  */
30
32
  html?: boolean;
31
33
  /**
@@ -46,6 +48,7 @@ export interface PopsContentConfig {
46
48
  text?: string;
47
49
  /**
48
50
  * 文字是否是html
51
+ * @default false
49
52
  */
50
53
  html?: boolean;
51
54
  /**
@@ -60,7 +63,8 @@ export interface PopsContentConfig {
60
63
  export interface PopsButtonConfig {
61
64
  btn?: {
62
65
  /**
63
- * 按钮的位置,默认left
66
+ * 按钮的位置
67
+ * @default "flex-end"
64
68
  */
65
69
  position?: PopsJustifyContent;
66
70
  /**
@@ -76,14 +80,17 @@ export interface PopsMoreButtonConfig<T = {}> {
76
80
  btn?: PopsButtonConfig["btn"] & {
77
81
  /**
78
82
  * 是否合并按钮
83
+ * @default false
79
84
  */
80
85
  merge?: boolean;
81
86
  /**
82
87
  * 是否对合并的按钮逆反
88
+ * @default false
83
89
  */
84
90
  mergeReverse?: boolean;
85
91
  /**
86
92
  * 是否逆反
93
+ * @default false
87
94
  */
88
95
  reverse?: boolean;
89
96
  /**
@@ -106,14 +113,17 @@ export interface PopsMoreButtonConfig<T = {}> {
106
113
  export interface PopsDragConfig {
107
114
  /**
108
115
  * 是否可以按钮标题栏进行拖拽,默认false
116
+ * @default false
109
117
  */
110
118
  drag?: boolean;
111
119
  /**
112
120
  * 是否限制拖拽在浏览器窗口内移动,默认true
121
+ * @default true
113
122
  */
114
123
  dragLimit?: boolean;
115
124
  /**
116
125
  * 当启用dragLimit时,该参数为弹窗在窗口中的距离边际的距离,默认为3(px)
126
+ * @default 3
117
127
  */
118
128
  dragExtraDistance?: number;
119
129
  /**
@@ -149,26 +159,32 @@ export interface PopsCommonConfig {
149
159
  class?: string;
150
160
  /**
151
161
  * 是否是唯一的,默认false
162
+ * @default false
152
163
  */
153
164
  only?: boolean;
154
165
  /**
155
166
  * 宽度,默认350px
167
+ * @default 350
156
168
  */
157
169
  width: string;
158
170
  /**
159
171
  * 高度,默认200px
172
+ * @default 200
160
173
  */
161
174
  height: string;
162
175
  /**
163
176
  * 位置,默认center
177
+ * @default "center"
164
178
  */
165
179
  position?: PopsPosition;
166
180
  /**
167
181
  * 动画,默认pops-anim-fadein-zoom
182
+ * @default "pops-anim-fadein-zoom"
168
183
  */
169
184
  animation?: PopsAnimation;
170
185
  /**
171
186
  * z-index显示层级,默认10000
187
+ * @default 10000
172
188
  */
173
189
  zIndex?: number | (() => number);
174
190
  /**
@@ -179,6 +195,7 @@ export interface PopsCommonConfig {
179
195
  * 是否禁用页面滚动,默认false
180
196
  *
181
197
  * 暂时不会生效
198
+ * @default false
182
199
  */
183
200
  forbiddenScroll?: boolean;
184
201
  /**
@@ -4,15 +4,18 @@
4
4
  export interface PopsMaskDetails {
5
5
  /**
6
6
  * 是否启用遮罩层,默认false
7
+ * @default false
7
8
  */
8
9
  enable?: boolean;
9
10
  clickEvent?: {
10
11
  /**
11
12
  * 点击遮罩层是否触发关闭事件
13
+ * @default false
12
14
  */
13
15
  toClose?: boolean;
14
16
  /**
15
17
  * 点击遮罩层是否触发隐藏事件
18
+ * @default false
16
19
  */
17
20
  toHide?: boolean;
18
21
  };