@king-design/intact 3.6.2-beta.0 → 3.6.2-beta.1

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.
@@ -41,9 +41,13 @@ export class Dropdown extends BaseDropdown<
41
41
  DropdownProps,
42
42
  DropdownEvents,
43
43
  DropdownBlocks
44
- > { }
44
+ > {
45
+ static readonly __isDropdown = true;
46
+ }
45
47
  export class DropdownMenu extends BaseDropdownMenu<
46
48
  DropdownMenuProps,
47
49
  DropdownMenuEvents,
48
50
  DropdownMenuBlocks
49
- > { }
51
+ > {
52
+ static readonly __isDropdownMenu = true;
53
+ }
@@ -1,10 +1,9 @@
1
- import {Component, TypeDefs, inject, VNodeComponentClass} from 'intact';
1
+ import {Component, TypeDefs, inject} from 'intact';
2
2
  import template from './item.vdt';
3
3
  import {bind} from '../utils';
4
4
  import {useItemKeyboard} from './useItemKeyboard';
5
5
  import {Dropdown, DROPDOWN} from './dropdown';
6
6
  import {type DropdownMenu, DROPDOWN_MENU} from './menu';
7
- import { Dropdown as ExportDropdown, DropdownMenu as ExportDropdownMenu } from '.';
8
7
  import { useConfigContext } from '../config';
9
8
  import type { Tooltip } from '../tooltip/tooltip';
10
9
 
@@ -75,13 +74,14 @@ export class DropdownItem extends Component<DropdownItemProps, DropdownItemEvent
75
74
  let parent = this.$senior;
76
75
  while (parent) {
77
76
  // Tooltip extends Dropdown, it's also a instance of Dropdown
78
- // so use constructor to detect
79
- // if (parent instanceof DropdownMenu) {
80
- if (parent.constructor === ExportDropdownMenu) {
77
+ // we should exclude this case, so use constructor to detect
78
+ // @modify: Check using hasOwnProperty to avoid inheritance issues and circle reference
79
+ const constructor = parent.constructor as any;
80
+ if (constructor.hasOwnProperty('__isDropdownMenu')) {
81
81
  return;
82
82
  }
83
- if (parent.constructor === ExportDropdown) {
84
- return parent;
83
+ if (constructor.hasOwnProperty('__isDropdown')) {
84
+ return parent as Dropdown;
85
85
  }
86
86
  parent = parent.$senior;
87
87
  }
@@ -121,4 +121,4 @@ function useKeyboardForDropdownItem(instance: DropdownItem) {
121
121
  instance.select();
122
122
  },
123
123
  });
124
- }
124
+ }
@@ -4,6 +4,8 @@ export * from './item';
4
4
  export type { Position as PositionOption, PositionShorthand } from './dropdown';
5
5
  export type { DropdownProps, DropdownEvents, DropdownBlocks, DropdownMenuProps, DropdownMenuEvents, DropdownMenuBlocks, };
6
6
  export declare class Dropdown extends BaseDropdown<DropdownProps, DropdownEvents, DropdownBlocks> {
7
+ static readonly __isDropdown = true;
7
8
  }
8
9
  export declare class DropdownMenu extends BaseDropdownMenu<DropdownMenuProps, DropdownMenuEvents, DropdownMenuBlocks> {
10
+ static readonly __isDropdownMenu = true;
9
11
  }
@@ -23,10 +23,12 @@ export var Dropdown = /*#__PURE__*/function (_BaseDropdown) {
23
23
  }
24
24
  return Dropdown;
25
25
  }(BaseDropdown);
26
+ Dropdown.__isDropdown = true;
26
27
  export var DropdownMenu = /*#__PURE__*/function (_BaseDropdownMenu) {
27
28
  _inheritsLoose(DropdownMenu, _BaseDropdownMenu);
28
29
  function DropdownMenu() {
29
30
  return _BaseDropdownMenu.apply(this, arguments) || this;
30
31
  }
31
32
  return DropdownMenu;
32
- }(BaseDropdownMenu);
33
+ }(BaseDropdownMenu);
34
+ DropdownMenu.__isDropdownMenu = true;
@@ -22,6 +22,6 @@ export declare class DropdownItem extends Component<DropdownItemProps, DropdownI
22
22
  private config;
23
23
  init(): void;
24
24
  select(): void;
25
- hasSubMenu(): undefined;
25
+ hasSubMenu(): Dropdown<import("./dropdown").DropdownProps, import("./dropdown").DropdownEvents, import("./dropdown").DropdownBlocks> | undefined;
26
26
  private onClick;
27
27
  }
@@ -7,7 +7,6 @@ import { bind } from '../utils';
7
7
  import { useItemKeyboard } from './useItemKeyboard';
8
8
  import { DROPDOWN } from './dropdown';
9
9
  import { DROPDOWN_MENU } from './menu';
10
- import { Dropdown as ExportDropdown, DropdownMenu as ExportDropdownMenu } from '.';
11
10
  import { useConfigContext } from '../config';
12
11
  var typeDefs = {
13
12
  disabled: Boolean,
@@ -62,12 +61,13 @@ export var DropdownItem = /*#__PURE__*/function (_Component) {
62
61
  var parent = this.$senior;
63
62
  while (parent) {
64
63
  // Tooltip extends Dropdown, it's also a instance of Dropdown
65
- // so use constructor to detect
66
- // if (parent instanceof DropdownMenu) {
67
- if (parent.constructor === ExportDropdownMenu) {
64
+ // we should exclude this case, so use constructor to detect
65
+ // @modify: Check using hasOwnProperty to avoid inheritance issues and circle reference
66
+ var _constructor = parent.constructor;
67
+ if (_constructor.hasOwnProperty('__isDropdownMenu')) {
68
68
  return;
69
69
  }
70
- if (parent.constructor === ExportDropdown) {
70
+ if (_constructor.hasOwnProperty('__isDropdown')) {
71
71
  return parent;
72
72
  }
73
73
  parent = parent.$senior;
package/es/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.2-beta.0
2
+ * @king-design v3.6.2-beta.1
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -66,4 +66,4 @@ export * from './components/upload';
66
66
  export * from './components/view';
67
67
  export * from './components/virtualList';
68
68
  export * from './components/wave';
69
- export declare const version = "3.6.2-beta.0";
69
+ export declare const version = "3.6.2-beta.1";
package/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.2-beta.0
2
+ * @king-design v3.6.2-beta.1
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -67,5 +67,5 @@ export * from './components/upload';
67
67
  export * from './components/view';
68
68
  export * from './components/virtualList';
69
69
  export * from './components/wave';
70
- export var version = '3.6.2-beta.0';
70
+ export var version = '3.6.2-beta.1';
71
71
  /* generate end */
package/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v3.6.2-beta.0
2
+ * @king-design v3.6.2-beta.1
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -71,6 +71,6 @@ export * from './components/view';
71
71
  export * from './components/virtualList';
72
72
  export * from './components/wave';
73
73
 
74
- export const version = '3.6.2-beta.0';
74
+ export const version = '3.6.2-beta.1';
75
75
 
76
76
  /* generate end */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@king-design/intact",
3
- "version": "3.6.2-beta.0",
3
+ "version": "3.6.2-beta.1",
4
4
  "description": "A component library written in Intact for Intact, Vue, React and Angular",
5
5
  "main": "es/index.js",
6
6
  "engines": {