plain-design 1.0.0-beta.10 → 1.0.0-beta.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.10",
3
+ "version": "1.0.0-beta.11",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -1,4 +1,4 @@
1
- import {designComponent, getComponentCls, iHTMLDivElement, iHTMLElement, iTransitionEvent, nextIndex, onBeforeUnmount, onMounted, Portal, PropType, reactive, SimpleFunction, useClassCache, useRefs, useStyleCache} from "plain-design-composition";
1
+ import {designComponent, getComponentCls, iHTMLDivElement, iHTMLElement, iMouseEvent, iTransitionEvent, nextIndex, onBeforeUnmount, onMounted, Portal, PropType, reactive, SimpleFunction, useClassCache, useRefs, useStyleCache} from "plain-design-composition";
2
2
  import {ePopupAnimation, iPopupOption, iPopupRefs, PopupItemProvide} from "./utils/popup.utils";
3
3
  import {createEffects} from "plain-utils/utils/createEffects";
4
4
  import {delay} from "plain-utils/utils/delay";
@@ -262,6 +262,14 @@ export const PopupItem = designComponent({
262
262
  };
263
263
  return check;
264
264
  })(),
265
+ /**
266
+ * 阻止点击popup的事件冒泡,如果有div包裹popup几点,在react中即使popup不是这个div的子节点也会导致事件冒泡到div上
267
+ * @author 韦胜健
268
+ * @date 2023/8/10 11:27
269
+ */
270
+ onClickPopup: (e: iMouseEvent) => {
271
+ e.stopPropagation();
272
+ },
265
273
  };
266
274
 
267
275
  onMounted(async () => {
@@ -369,6 +377,7 @@ export const PopupItem = designComponent({
369
377
  data-popup-show={String(state.isShow)}
370
378
  onTransitionEnd={handler.onTransitionend}
371
379
  style={styles.value}
380
+ onClick={handler.onClickPopup}
372
381
  >
373
382
  {/*slide的情况下,arrow得放body外面,避免被overflow:hidden*/}
374
383
  {!!state.option.arrowSize && !state.option.noArrow && state.option.animation !== ePopupAnimation.scale && (<div className="popup-item-arrow" ref={onRef.arrow}/>)}