ph-utils 0.11.4 → 0.11.5

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/lib/dom.d.ts CHANGED
@@ -162,7 +162,7 @@ export declare function formatStyle(styleObj: (string | undefined | null | "")[]
162
162
  * 对指定的 HTML 元素应用显示过渡效果。
163
163
  * @param target - 要应用过渡效果的 HTML 元素。
164
164
  * @param properties - 包含要改变的 CSS 属性及其目标值的数组。eg. [['opacity', '0.5']]
165
- * @param duration - 过渡效果的持续时间,默认为 "0.3s"。
165
+ * @param duration - 过渡效果的持续时间,如果不传, 则不会应用 transition-style, 可以自己在 css 中进行定义。
166
166
  * 该方法首先将元素的 display 属性设置为 "none",然后设置过渡属性,
167
167
  * 在下一个 DOM 更新周期后显示元素并移除设置的属性,从而实现过渡效果。
168
168
  *
@@ -173,7 +173,7 @@ export declare function formatStyle(styleObj: (string | undefined | null | "")[]
173
173
  ]);
174
174
  * ```
175
175
  */
176
- export declare function startTransition(target: HTMLElement, properties: [string, string][], duration?: string | undefined | null): void;
176
+ export declare function startTransition(target: HTMLElement, properties: [string, string][], duration?: string): void;
177
177
  /**
178
178
  * 结束元素的过渡效果,并在过渡结束后隐藏元素。
179
179
  * @param target - 要操作的 HTML 元素。
package/lib/dom.js CHANGED
@@ -336,7 +336,7 @@ export function formatStyle(styleObj) {
336
336
  * 对指定的 HTML 元素应用显示过渡效果。
337
337
  * @param target - 要应用过渡效果的 HTML 元素。
338
338
  * @param properties - 包含要改变的 CSS 属性及其目标值的数组。eg. [['opacity', '0.5']]
339
- * @param duration - 过渡效果的持续时间,默认为 "0.3s"。
339
+ * @param duration - 过渡效果的持续时间,如果不传, 则不会应用 transition-style, 可以自己在 css 中进行定义。
340
340
  * 该方法首先将元素的 display 属性设置为 "none",然后设置过渡属性,
341
341
  * 在下一个 DOM 更新周期后显示元素并移除设置的属性,从而实现过渡效果。
342
342
  *
@@ -347,7 +347,7 @@ export function formatStyle(styleObj) {
347
347
  ]);
348
348
  * ```
349
349
  */
350
- export function startTransition(target, properties, duration = "0.3s") {
350
+ export function startTransition(target, properties, duration) {
351
351
  target.style.setProperty("display", "none");
352
352
  const trans = [];
353
353
  for (let i = 0, len = properties.length; i < len; i++) {
package/package.json CHANGED
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "./*": "./lib/*"
70
70
  },
71
- "version": "0.11.4",
71
+ "version": "0.11.5",
72
72
  "type": "module",
73
73
  "repository": {
74
74
  "type": "git",