@varlet/ui 2.8.6 → 2.9.0-alpha.1678371604765

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/es/style.mjs CHANGED
@@ -25,6 +25,7 @@ import './date-picker/style/index.mjs'
25
25
  import './dialog/style/index.mjs'
26
26
  import './divider/style/index.mjs'
27
27
  import './ellipsis/style/index.mjs'
28
+ import './fab/style/index.mjs'
28
29
  import './form/style/index.mjs'
29
30
  import './form-details/style/index.mjs'
30
31
  import './hover/style/index.mjs'
@@ -1,13 +1,11 @@
1
- import { useAtParentIndex, useParent } from '../utils/components.mjs';
2
- import { TABS_BIND_TAB_KEY, TABS_COUNT_TAB_KEY } from '../tabs/provide.mjs';
1
+ import { useParent } from '@varlet/use';
2
+ import { TABS_BIND_TAB_KEY } from '../tabs/provide.mjs';
3
3
  export function useTabs() {
4
4
  var {
5
5
  parentProvider,
6
- bindParent
7
- } = useParent(TABS_BIND_TAB_KEY);
8
- var {
6
+ bindParent,
9
7
  index
10
- } = useAtParentIndex(TABS_COUNT_TAB_KEY);
8
+ } = useParent(TABS_BIND_TAB_KEY);
11
9
 
12
10
  if (!parentProvider || !bindParent || !index) {
13
11
  throw Error('<var-tab/> must in <var-tabs/>');
@@ -1,13 +1,11 @@
1
- import { useAtParentIndex, useParent } from '../utils/components.mjs';
2
- import { TABS_ITEMS_BIND_TAB_ITEM_KEY, TABS_ITEMS_COUNT_TAB_ITEM_KEY } from '../tabs-items/provide.mjs';
1
+ import { useParent } from '@varlet/use';
2
+ import { TABS_ITEMS_BIND_TAB_ITEM_KEY } from '../tabs-items/provide.mjs';
3
3
  export function useTabsItems() {
4
4
  var {
5
5
  parentProvider,
6
- bindParent
7
- } = useParent(TABS_ITEMS_BIND_TAB_ITEM_KEY);
8
- var {
6
+ bindParent,
9
7
  index
10
- } = useAtParentIndex(TABS_ITEMS_COUNT_TAB_ITEM_KEY);
8
+ } = useParent(TABS_ITEMS_BIND_TAB_ITEM_KEY);
11
9
 
12
10
  if (!parentProvider || !bindParent || !index) {
13
11
  throw Error('<var-tab-item/> must in <var-tabs-items/>');
@@ -1,14 +1,11 @@
1
- import { useAtChildrenCounter, useChildren } from '../utils/components.mjs';
1
+ import { useChildren } from '@varlet/use';
2
2
  export var TABS_BIND_TAB_KEY = Symbol('TABS_BIND_TAB_KEY');
3
- export var TABS_COUNT_TAB_KEY = Symbol('TABS_COUNT_TAB_KEY');
4
3
  export function useTabList() {
5
4
  var {
6
5
  childProviders,
7
- bindChildren
8
- } = useChildren(TABS_BIND_TAB_KEY);
9
- var {
6
+ bindChildren,
10
7
  length
11
- } = useAtChildrenCounter(TABS_COUNT_TAB_KEY);
8
+ } = useChildren(TABS_BIND_TAB_KEY);
12
9
  return {
13
10
  length,
14
11
  tabList: childProviders,
@@ -1,14 +1,11 @@
1
- import { useAtChildrenCounter, useChildren } from '../utils/components.mjs';
1
+ import { useChildren } from '@varlet/use';
2
2
  export var TABS_ITEMS_BIND_TAB_ITEM_KEY = Symbol('TABS_ITEMS_BIND_TAB_ITEM_KEY');
3
- export var TABS_ITEMS_COUNT_TAB_ITEM_KEY = Symbol('TABS_ITEMS_COUNT_TAB_ITEM_KEY');
4
3
  export function useTabItem() {
5
4
  var {
6
5
  bindChildren,
7
- childProviders
8
- } = useChildren(TABS_ITEMS_BIND_TAB_ITEM_KEY);
9
- var {
6
+ childProviders,
10
7
  length
11
- } = useAtChildrenCounter(TABS_ITEMS_COUNT_TAB_ITEM_KEY);
8
+ } = useChildren(TABS_ITEMS_BIND_TAB_ITEM_KEY);
12
9
  return {
13
10
  length,
14
11
  tabItemList: childProviders,
@@ -37,6 +37,9 @@ export var props = {
37
37
  default: 'hover',
38
38
  validator: triggerValidator
39
39
  },
40
+ reference: {
41
+ type: String
42
+ },
40
43
  placement: {
41
44
  type: String,
42
45
  default: 'bottom',
@@ -9,7 +9,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
9
9
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
10
 
11
11
  import { useEventListener } from '@varlet/use';
12
- import { createApp, h, getCurrentInstance, inject, onUnmounted, computed, provide, reactive, isVNode, onMounted, onBeforeUnmount, nextTick, ref, onActivated, onDeactivated } from 'vue';
12
+ import { createApp, h, getCurrentInstance, inject, onUnmounted, computed, provide, reactive, isVNode, onMounted, onBeforeUnmount, nextTick, ref, onActivated, onDeactivated, Comment, Fragment } from 'vue';
13
13
  import { isArray, removeItem } from '@varlet/shared';
14
14
  export function pickProps(props, propsKey) {
15
15
  return Array.isArray(propsKey) ? propsKey.reduce((pickedProps, key) => {
@@ -53,6 +53,24 @@ export function mountInstance(component, props, eventListener) {
53
53
  unmountInstance: unmount
54
54
  };
55
55
  }
56
+ export function flatFragment(vNodes) {
57
+ var result = [];
58
+ vNodes.forEach(vNode => {
59
+ if (vNode.type === Comment) {
60
+ return;
61
+ }
62
+
63
+ if (vNode.type === Fragment && isArray(vNode.children)) {
64
+ vNode.children.forEach(item => {
65
+ result.push(item);
66
+ });
67
+ return;
68
+ }
69
+
70
+ result.push(vNode);
71
+ });
72
+ return result;
73
+ }
56
74
  export function flatVNodes(subTree) {
57
75
  var vNodes = [];
58
76