@v-c/tabs 1.0.2 → 1.1.0-rc.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.
@@ -32,7 +32,9 @@ var OperationNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
32
32
  tabMoving: { type: Boolean },
33
33
  getPopupContainer: {},
34
34
  popupClassName: {},
35
- popupStyle: {}
35
+ popupStyle: {},
36
+ classNames: {},
37
+ styles: {}
36
38
  },
37
39
  setup(__props, { expose: __expose }) {
38
40
  const props = __props;
@@ -79,7 +81,8 @@ var OperationNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */
79
81
  "type": "button",
80
82
  "aria-label": removeAriaLabel.value || "remove",
81
83
  "tabindex": 0,
82
- "class": `${dropdownPrefix.value}-menu-item-remove`,
84
+ "class": clsx(`${dropdownPrefix.value}-menu-item-remove`, props.classNames?.remove),
85
+ "style": props.styles?.remove,
83
86
  "onClick": (e) => {
84
87
  e.stopPropagation();
85
88
  onRemoveTab(e, key);
@@ -35,7 +35,9 @@ var TabNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
35
35
  onFocus: { type: Function },
36
36
  onBlur: { type: Function },
37
37
  style: {},
38
- className: {}
38
+ className: {},
39
+ classNames: {},
40
+ styles: {}
39
41
  },
40
42
  setup(__props) {
41
43
  const props = __props;
@@ -53,6 +55,7 @@ var TabNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
53
55
  const cls = computed(() => [
54
56
  tabPrefix.value,
55
57
  props.className,
58
+ props.classNames?.item,
56
59
  {
57
60
  [`${tabPrefix.value}-with-remove`]: removable.value,
58
61
  [`${tabPrefix.value}-active`]: active.value,
@@ -60,6 +63,10 @@ var TabNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
60
63
  [`${tabPrefix.value}-focus`]: focus.value
61
64
  }
62
65
  ]);
66
+ const mergedStyle = computed(() => ({
67
+ ...props.styles?.item,
68
+ ...props.style
69
+ }));
63
70
  function onRemove(event) {
64
71
  event.preventDefault();
65
72
  event.stopPropagation();
@@ -105,7 +112,8 @@ var TabNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
105
112
  "type": "button",
106
113
  "aria-label": props.removeAriaLabel || "remove",
107
114
  "tabindex": active.value ? 0 : -1,
108
- "class": [`${tabPrefix.value}-remove`],
115
+ "class": [`${tabPrefix.value}-remove`, props.classNames?.remove],
116
+ "style": props.styles?.remove,
109
117
  "onClick": (e) => {
110
118
  e.stopPropagation();
111
119
  onRemove(e);
@@ -115,7 +123,7 @@ var TabNode_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ define
115
123
  "key": tab.value.key,
116
124
  "data-node-key": genDataNodeKey(tab.value.key),
117
125
  "class": cls.value,
118
- "style": props.style,
126
+ "style": mergedStyle.value,
119
127
  "onClick": onInternalClick
120
128
  }, children);
121
129
  });
@@ -429,9 +429,14 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
429
429
  key: tab.key,
430
430
  tab,
431
431
  className: unref(tabsClassNames)?.item,
432
- style: i === 0 ? unref(styles)?.item : {
433
- ...isHorizontal.value ? { marginInlineStart: tabBarGutter.value } : { marginTop: tabBarGutter.value },
434
- ...unref(styles)?.item || {}
432
+ style: i === 0 ? void 0 : isHorizontal.value ? { marginInlineStart: tabBarGutter.value } : { marginTop: tabBarGutter.value },
433
+ classNames: {
434
+ item: unref(tabsClassNames)?.item,
435
+ remove: unref(tabsClassNames)?.remove
436
+ },
437
+ styles: {
438
+ item: unref(styles)?.item,
439
+ remove: unref(styles)?.remove
435
440
  },
436
441
  closable: tab.closable,
437
442
  editable: unref(editable),
@@ -490,7 +495,9 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
490
495
  tabs: hiddenTabs.value,
491
496
  "class-name": [unref(tabsClassNames)?.operations, !hasDropdown.value ? operationsHiddenClassName.value : void 0],
492
497
  "popup-style": unref(styles)?.popup,
493
- "tab-moving": !!lockAnimation.value
498
+ "tab-moving": !!lockAnimation.value,
499
+ "class-names": { remove: unref(tabsClassNames)?.remove },
500
+ styles: { remove: unref(styles)?.remove }
494
501
  }, {
495
502
  id: unref(id),
496
503
  rtl: unref(rtl),
@@ -509,7 +516,9 @@ var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
509
516
  "tabs",
510
517
  "class-name",
511
518
  "popup-style",
512
- "tab-moving"
519
+ "tab-moving",
520
+ "class-names",
521
+ "styles"
513
522
  ]),
514
523
  createVNode(ExtraContent_default, {
515
524
  ref_key: "extraRightRef",
@@ -84,6 +84,8 @@ export interface OperationNodeProps {
84
84
  getPopupContainer?: (node: HTMLElement) => HTMLElement;
85
85
  popupClassName?: string;
86
86
  popupStyle?: CSSProperties;
87
+ classNames?: Partial<Record<'remove', string>>;
88
+ styles?: Partial<Record<'remove', CSSProperties>>;
87
89
  }
88
90
  export interface TabNodeProps {
89
91
  id: string | null;
@@ -107,10 +109,12 @@ export interface TabNodeProps {
107
109
  onBlur: FocusEventHandler;
108
110
  style?: CSSProperties;
109
111
  className?: string;
112
+ classNames?: Partial<Record<'item' | 'remove', string>>;
113
+ styles?: Partial<Record<'item' | 'remove', CSSProperties>>;
110
114
  }
111
115
  export type TabPosition = 'left' | 'right' | 'top' | 'bottom';
112
116
  export type GetIndicatorSize = number | ((origin: number) => number);
113
- export type SemanticName = string;
117
+ export type SemanticName = 'popup' | 'item' | 'indicator' | 'content' | 'header' | 'remove';
114
118
  export type RenderTabBar = (props: Record<string, any>, TabNavListComponent: any) => VueNode;
115
119
  export interface IndicatorConfig {
116
120
  size?: GetIndicatorSize;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/tabs",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.1.0-rc.1",
5
5
  "description": "tabs ui component for react",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -32,11 +32,11 @@
32
32
  "vue": "^3.0.0"
33
33
  },
34
34
  "dependencies": {
35
+ "@v-c/menu": "^1.1.0-rc.1",
35
36
  "@v-c/dropdown": "^1.0.2",
36
- "@v-c/menu": "^1.0.12",
37
- "@v-c/overflow": "^1.0.4",
38
- "@v-c/util": "^1.0.19",
39
- "@v-c/resize-observer": "^1.0.8"
37
+ "@v-c/resize-observer": "^1.0.8",
38
+ "@v-c/overflow": "^1.0.5",
39
+ "@v-c/util": "^1.0.19"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "vite build",