@mekari/pixel3-tabs 0.0.0
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/dist/chunk-5R2IYROF.mjs +43 -0
- package/dist/chunk-BCRB3ASV.mjs +29 -0
- package/dist/chunk-DKZ3Z2UI.mjs +61 -0
- package/dist/chunk-JEXLKDPT.mjs +38 -0
- package/dist/chunk-JQQ5YTMJ.mjs +31 -0
- package/dist/chunk-LAMJMXQC.mjs +56 -0
- package/dist/chunk-QVDBBOCQ.mjs +146 -0
- package/dist/chunk-QZ7VFGWC.mjs +6 -0
- package/dist/chunk-S5AGDSR2.mjs +8 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +379 -0
- package/dist/index.mjs +26 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/modules/tabs.context.d.mts +12 -0
- package/dist/modules/tabs.context.d.ts +12 -0
- package/dist/modules/tabs.context.js +33 -0
- package/dist/modules/tabs.context.mjs +9 -0
- package/dist/modules/tabs.hooks.d.mts +56 -0
- package/dist/modules/tabs.hooks.d.ts +56 -0
- package/dist/modules/tabs.hooks.js +174 -0
- package/dist/modules/tabs.hooks.mjs +16 -0
- package/dist/modules/tabs.props.d.mts +62 -0
- package/dist/modules/tabs.props.d.ts +62 -0
- package/dist/modules/tabs.props.js +88 -0
- package/dist/modules/tabs.props.mjs +13 -0
- package/dist/tab-list.d.mts +5 -0
- package/dist/tab-list.d.ts +5 -0
- package/dist/tab-list.js +114 -0
- package/dist/tab-list.mjs +9 -0
- package/dist/tab-panel.d.mts +29 -0
- package/dist/tab-panel.d.ts +29 -0
- package/dist/tab-panel.js +89 -0
- package/dist/tab-panel.mjs +10 -0
- package/dist/tab-panels.d.mts +5 -0
- package/dist/tab-panels.d.ts +5 -0
- package/dist/tab-panels.js +81 -0
- package/dist/tab-panels.mjs +9 -0
- package/dist/tab.d.mts +29 -0
- package/dist/tab.d.ts +29 -0
- package/dist/tab.js +134 -0
- package/dist/tab.mjs +10 -0
- package/dist/tabs.d.mts +56 -0
- package/dist/tabs.d.ts +56 -0
- package/dist/tabs.js +123 -0
- package/dist/tabs.mjs +10 -0
- package/package.json +41 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/modules/tabs.hooks.ts
|
|
22
|
+
var tabs_hooks_exports = {};
|
|
23
|
+
__export(tabs_hooks_exports, {
|
|
24
|
+
useTab: () => useTab,
|
|
25
|
+
useTabList: () => useTabList,
|
|
26
|
+
useTabPanel: () => useTabPanel,
|
|
27
|
+
useTabPanels: () => useTabPanels,
|
|
28
|
+
useTabs: () => useTabs
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(tabs_hooks_exports);
|
|
31
|
+
var import_vue = require("vue");
|
|
32
|
+
var import_css = require("@mekari/pixel3-styled-system/css");
|
|
33
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
34
|
+
var import_pixel3_utils2 = require("@mekari/pixel3-utils");
|
|
35
|
+
|
|
36
|
+
// src/modules/tabs.context.ts
|
|
37
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
38
|
+
var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
|
|
39
|
+
|
|
40
|
+
// src/modules/tabs.hooks.ts
|
|
41
|
+
function useTabs(props, emit) {
|
|
42
|
+
const selectedTab = (0, import_vue.ref)(props.defaultValue);
|
|
43
|
+
const selected = props.isManual ? (0, import_vue.computed)(() => props.modelValue) : selectedTab;
|
|
44
|
+
const id = (0, import_vue.computed)(() => props.id || `tabs-${(0, import_pixel3_utils2.useId)(4)}`);
|
|
45
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
46
|
+
return {
|
|
47
|
+
"data-pixel-component": "MpTabs",
|
|
48
|
+
id: id.value
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
function onChangeTab(value) {
|
|
52
|
+
if (!props.isManual) {
|
|
53
|
+
selectedTab.value = value;
|
|
54
|
+
}
|
|
55
|
+
emit("change", value);
|
|
56
|
+
emit("update:modelValue", value);
|
|
57
|
+
}
|
|
58
|
+
__name(onChangeTab, "onChangeTab");
|
|
59
|
+
return {
|
|
60
|
+
selectedTab: selected,
|
|
61
|
+
onChangeTab,
|
|
62
|
+
rootAttrs,
|
|
63
|
+
id
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
__name(useTabs, "useTabs");
|
|
67
|
+
function useTabList() {
|
|
68
|
+
const {
|
|
69
|
+
rootProps,
|
|
70
|
+
onChangeTab,
|
|
71
|
+
selectedTab,
|
|
72
|
+
id
|
|
73
|
+
} = useTabsContext();
|
|
74
|
+
const {
|
|
75
|
+
isShowBorder
|
|
76
|
+
} = rootProps;
|
|
77
|
+
const rootAttrs = (0, import_vue.reactive)({
|
|
78
|
+
"data-border": isShowBorder.value,
|
|
79
|
+
class: (0, import_css.css)({
|
|
80
|
+
position: "relative",
|
|
81
|
+
"&[data-border=true]": {
|
|
82
|
+
_before: {
|
|
83
|
+
content: '""',
|
|
84
|
+
height: "1px",
|
|
85
|
+
background: "gray.100",
|
|
86
|
+
position: "absolute",
|
|
87
|
+
right: 0,
|
|
88
|
+
left: 0,
|
|
89
|
+
bottom: "1px"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
const tabListAttrs = (0, import_vue.reactive)({
|
|
95
|
+
"data-pixel-component": "MpTabList",
|
|
96
|
+
class: (0, import_recipes.tabListRecipe)()
|
|
97
|
+
});
|
|
98
|
+
return {
|
|
99
|
+
tabsProps: rootProps,
|
|
100
|
+
onChangeTab,
|
|
101
|
+
selectedTab,
|
|
102
|
+
rootAttrs,
|
|
103
|
+
tabListAttrs,
|
|
104
|
+
tabsId: id
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
__name(useTabList, "useTabList");
|
|
108
|
+
function useTab(props, attrs) {
|
|
109
|
+
const {
|
|
110
|
+
rootProps,
|
|
111
|
+
id: tabsId
|
|
112
|
+
} = useTabsContext();
|
|
113
|
+
const {
|
|
114
|
+
variantColor
|
|
115
|
+
} = rootProps;
|
|
116
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
117
|
+
return {
|
|
118
|
+
role: "tab",
|
|
119
|
+
"data-pixel-component": "MpTab",
|
|
120
|
+
class: ["group", (0, import_recipes.tabRecipe)({
|
|
121
|
+
isSelected: props.isSelected,
|
|
122
|
+
variantColor: (0, import_vue.unref)(variantColor)
|
|
123
|
+
})],
|
|
124
|
+
id: props.id || `tab:${tabsId.value}-${attrs.index}`
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
const tabSelectedBorderAttrs = (0, import_vue.computed)(() => {
|
|
128
|
+
return {
|
|
129
|
+
isSelected: props.isSelected
|
|
130
|
+
};
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
rootAttrs,
|
|
134
|
+
tabSelectedBorderAttrs
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
__name(useTab, "useTab");
|
|
138
|
+
function useTabPanels() {
|
|
139
|
+
const {
|
|
140
|
+
selectedTab
|
|
141
|
+
} = useTabsContext();
|
|
142
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
143
|
+
return {
|
|
144
|
+
"data-pixel-component": "MpTabPanels"
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
return {
|
|
148
|
+
rootAttrs,
|
|
149
|
+
selectedTab
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
__name(useTabPanels, "useTabPanels");
|
|
153
|
+
function useTabPanel(props) {
|
|
154
|
+
const rootAttrs = (0, import_vue.computed)(() => {
|
|
155
|
+
return {
|
|
156
|
+
"data-pixel-component": "MpTabPanel",
|
|
157
|
+
style: {
|
|
158
|
+
display: props.isKeepAlive ? props.isSelected ? "unset" : "none" : ""
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
rootAttrs
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
__name(useTabPanel, "useTabPanel");
|
|
167
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
168
|
+
0 && (module.exports = {
|
|
169
|
+
useTab,
|
|
170
|
+
useTabList,
|
|
171
|
+
useTabPanel,
|
|
172
|
+
useTabPanels,
|
|
173
|
+
useTabs
|
|
174
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTab,
|
|
3
|
+
useTabList,
|
|
4
|
+
useTabPanel,
|
|
5
|
+
useTabPanels,
|
|
6
|
+
useTabs
|
|
7
|
+
} from "../chunk-QVDBBOCQ.mjs";
|
|
8
|
+
import "../chunk-S5AGDSR2.mjs";
|
|
9
|
+
import "../chunk-QZ7VFGWC.mjs";
|
|
10
|
+
export {
|
|
11
|
+
useTab,
|
|
12
|
+
useTabList,
|
|
13
|
+
useTabPanel,
|
|
14
|
+
useTabPanels,
|
|
15
|
+
useTabs
|
|
16
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const tabsProps: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: PropType<number>;
|
|
6
|
+
};
|
|
7
|
+
defaultValue: {
|
|
8
|
+
type: PropType<number>;
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
id: {
|
|
12
|
+
type: PropType<string>;
|
|
13
|
+
};
|
|
14
|
+
isManual: {
|
|
15
|
+
type: PropType<boolean>;
|
|
16
|
+
};
|
|
17
|
+
variantColor: {
|
|
18
|
+
type: PropType<"blue" | "green" | "orange" | "red" | "gray">;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
isShowBorder: {
|
|
22
|
+
type: PropType<boolean>;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
declare const tabProps: {
|
|
27
|
+
id: {
|
|
28
|
+
type: PropType<string>;
|
|
29
|
+
};
|
|
30
|
+
isSelected: {
|
|
31
|
+
type: PropType<boolean>;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
value: {
|
|
35
|
+
type: PropType<string>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const selectedBorderProps: {
|
|
39
|
+
isSelected: {
|
|
40
|
+
type: PropType<boolean>;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
declare const tabPanelProps: {
|
|
45
|
+
isSelected: {
|
|
46
|
+
type: PropType<boolean>;
|
|
47
|
+
};
|
|
48
|
+
value: {
|
|
49
|
+
type: PropType<string>;
|
|
50
|
+
};
|
|
51
|
+
isKeepAlive: {
|
|
52
|
+
type: PropType<boolean>;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type TabsEmits = (e: 'update:modelValue' | 'change', value?: number) => void;
|
|
57
|
+
type TabsProps = ExtractPropTypes<typeof tabsProps>;
|
|
58
|
+
type TabProps = ExtractPropTypes<typeof tabProps>;
|
|
59
|
+
type SelectedBorderProps = ExtractPropTypes<typeof selectedBorderProps>;
|
|
60
|
+
type TabPanelProps = ExtractPropTypes<typeof tabPanelProps>;
|
|
61
|
+
|
|
62
|
+
export { SelectedBorderProps, TabPanelProps, TabProps, TabsEmits, TabsProps, selectedBorderProps, tabPanelProps, tabProps, tabsProps };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const tabsProps: {
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: PropType<number>;
|
|
6
|
+
};
|
|
7
|
+
defaultValue: {
|
|
8
|
+
type: PropType<number>;
|
|
9
|
+
default: number;
|
|
10
|
+
};
|
|
11
|
+
id: {
|
|
12
|
+
type: PropType<string>;
|
|
13
|
+
};
|
|
14
|
+
isManual: {
|
|
15
|
+
type: PropType<boolean>;
|
|
16
|
+
};
|
|
17
|
+
variantColor: {
|
|
18
|
+
type: PropType<"blue" | "green" | "orange" | "red" | "gray">;
|
|
19
|
+
default: string;
|
|
20
|
+
};
|
|
21
|
+
isShowBorder: {
|
|
22
|
+
type: PropType<boolean>;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
declare const tabProps: {
|
|
27
|
+
id: {
|
|
28
|
+
type: PropType<string>;
|
|
29
|
+
};
|
|
30
|
+
isSelected: {
|
|
31
|
+
type: PropType<boolean>;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
value: {
|
|
35
|
+
type: PropType<string>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
declare const selectedBorderProps: {
|
|
39
|
+
isSelected: {
|
|
40
|
+
type: PropType<boolean>;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
declare const tabPanelProps: {
|
|
45
|
+
isSelected: {
|
|
46
|
+
type: PropType<boolean>;
|
|
47
|
+
};
|
|
48
|
+
value: {
|
|
49
|
+
type: PropType<string>;
|
|
50
|
+
};
|
|
51
|
+
isKeepAlive: {
|
|
52
|
+
type: PropType<boolean>;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type TabsEmits = (e: 'update:modelValue' | 'change', value?: number) => void;
|
|
57
|
+
type TabsProps = ExtractPropTypes<typeof tabsProps>;
|
|
58
|
+
type TabProps = ExtractPropTypes<typeof tabProps>;
|
|
59
|
+
type SelectedBorderProps = ExtractPropTypes<typeof selectedBorderProps>;
|
|
60
|
+
type TabPanelProps = ExtractPropTypes<typeof tabPanelProps>;
|
|
61
|
+
|
|
62
|
+
export { SelectedBorderProps, TabPanelProps, TabProps, TabsEmits, TabsProps, selectedBorderProps, tabPanelProps, tabProps, tabsProps };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/modules/tabs.props.ts
|
|
21
|
+
var tabs_props_exports = {};
|
|
22
|
+
__export(tabs_props_exports, {
|
|
23
|
+
selectedBorderProps: () => selectedBorderProps,
|
|
24
|
+
tabPanelProps: () => tabPanelProps,
|
|
25
|
+
tabProps: () => tabProps,
|
|
26
|
+
tabsProps: () => tabsProps
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(tabs_props_exports);
|
|
29
|
+
var tabsProps = {
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: Number
|
|
32
|
+
},
|
|
33
|
+
defaultValue: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 0
|
|
36
|
+
},
|
|
37
|
+
id: {
|
|
38
|
+
type: String
|
|
39
|
+
},
|
|
40
|
+
isManual: {
|
|
41
|
+
type: Boolean
|
|
42
|
+
},
|
|
43
|
+
variantColor: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "blue"
|
|
46
|
+
},
|
|
47
|
+
isShowBorder: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: true
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var tabProps = {
|
|
53
|
+
id: {
|
|
54
|
+
type: String
|
|
55
|
+
},
|
|
56
|
+
isSelected: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
value: {
|
|
61
|
+
type: String
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var selectedBorderProps = {
|
|
65
|
+
isSelected: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var tabPanelProps = {
|
|
71
|
+
isSelected: {
|
|
72
|
+
type: Boolean
|
|
73
|
+
},
|
|
74
|
+
value: {
|
|
75
|
+
type: String
|
|
76
|
+
},
|
|
77
|
+
isKeepAlive: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: true
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
83
|
+
0 && (module.exports = {
|
|
84
|
+
selectedBorderProps,
|
|
85
|
+
tabPanelProps,
|
|
86
|
+
tabProps,
|
|
87
|
+
tabsProps
|
|
88
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const MpTabList: vue.DefineComponent<{}, () => JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
|
|
4
|
+
|
|
5
|
+
export { MpTabList };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const MpTabList: vue.DefineComponent<{}, () => JSX.Element, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>;
|
|
4
|
+
|
|
5
|
+
export { MpTabList };
|
package/dist/tab-list.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/tab-list.tsx
|
|
22
|
+
var tab_list_exports = {};
|
|
23
|
+
__export(tab_list_exports, {
|
|
24
|
+
MpTabList: () => MpTabList
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(tab_list_exports);
|
|
27
|
+
var import_vue2 = require("vue");
|
|
28
|
+
var import_vue3 = require("vue");
|
|
29
|
+
|
|
30
|
+
// src/modules/tabs.hooks.ts
|
|
31
|
+
var import_vue = require("vue");
|
|
32
|
+
var import_css = require("@mekari/pixel3-styled-system/css");
|
|
33
|
+
var import_recipes = require("@mekari/pixel3-styled-system/recipes");
|
|
34
|
+
var import_pixel3_utils2 = require("@mekari/pixel3-utils");
|
|
35
|
+
|
|
36
|
+
// src/modules/tabs.context.ts
|
|
37
|
+
var import_pixel3_utils = require("@mekari/pixel3-utils");
|
|
38
|
+
var [TabsProvider, useTabsContext] = (0, import_pixel3_utils.usePixelCreateContext)("TabsContext");
|
|
39
|
+
|
|
40
|
+
// src/modules/tabs.hooks.ts
|
|
41
|
+
function useTabList() {
|
|
42
|
+
const {
|
|
43
|
+
rootProps,
|
|
44
|
+
onChangeTab,
|
|
45
|
+
selectedTab,
|
|
46
|
+
id
|
|
47
|
+
} = useTabsContext();
|
|
48
|
+
const {
|
|
49
|
+
isShowBorder
|
|
50
|
+
} = rootProps;
|
|
51
|
+
const rootAttrs = (0, import_vue.reactive)({
|
|
52
|
+
"data-border": isShowBorder.value,
|
|
53
|
+
class: (0, import_css.css)({
|
|
54
|
+
position: "relative",
|
|
55
|
+
"&[data-border=true]": {
|
|
56
|
+
_before: {
|
|
57
|
+
content: '""',
|
|
58
|
+
height: "1px",
|
|
59
|
+
background: "gray.100",
|
|
60
|
+
position: "absolute",
|
|
61
|
+
right: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
bottom: "1px"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
const tabListAttrs = (0, import_vue.reactive)({
|
|
69
|
+
"data-pixel-component": "MpTabList",
|
|
70
|
+
class: (0, import_recipes.tabListRecipe)()
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
tabsProps: rootProps,
|
|
74
|
+
onChangeTab,
|
|
75
|
+
selectedTab,
|
|
76
|
+
rootAttrs,
|
|
77
|
+
tabListAttrs,
|
|
78
|
+
tabsId: id
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
__name(useTabList, "useTabList");
|
|
82
|
+
|
|
83
|
+
// src/tab-list.tsx
|
|
84
|
+
var MpTabList = (0, import_vue3.defineComponent)({
|
|
85
|
+
name: "MpTabList",
|
|
86
|
+
setup(props, {
|
|
87
|
+
slots
|
|
88
|
+
}) {
|
|
89
|
+
const {
|
|
90
|
+
rootAttrs,
|
|
91
|
+
tabListAttrs,
|
|
92
|
+
onChangeTab,
|
|
93
|
+
selectedTab
|
|
94
|
+
} = useTabList();
|
|
95
|
+
return () => {
|
|
96
|
+
const clones = slots.default().map((vnode, index) => {
|
|
97
|
+
const clone = (0, import_vue3.cloneVNode)(vnode, {
|
|
98
|
+
isSelected: selectedTab.value === index,
|
|
99
|
+
index,
|
|
100
|
+
"aria-selected": selectedTab.value === index,
|
|
101
|
+
onClick: () => {
|
|
102
|
+
onChangeTab(index);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
return clone;
|
|
106
|
+
});
|
|
107
|
+
return (0, import_vue2.createVNode)("div", rootAttrs, [(0, import_vue2.createVNode)("div", tabListAttrs, [clones])]);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
112
|
+
0 && (module.exports = {
|
|
113
|
+
MpTabList
|
|
114
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const MpTabPanel: vue.DefineComponent<{
|
|
4
|
+
isSelected: {
|
|
5
|
+
type: vue.PropType<boolean>;
|
|
6
|
+
};
|
|
7
|
+
value: {
|
|
8
|
+
type: vue.PropType<string>;
|
|
9
|
+
};
|
|
10
|
+
isKeepAlive: {
|
|
11
|
+
type: vue.PropType<boolean>;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, () => JSX.Element | null, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
15
|
+
isSelected: {
|
|
16
|
+
type: vue.PropType<boolean>;
|
|
17
|
+
};
|
|
18
|
+
value: {
|
|
19
|
+
type: vue.PropType<string>;
|
|
20
|
+
};
|
|
21
|
+
isKeepAlive: {
|
|
22
|
+
type: vue.PropType<boolean>;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
}>>, {
|
|
26
|
+
isKeepAlive: boolean;
|
|
27
|
+
}, {}>;
|
|
28
|
+
|
|
29
|
+
export { MpTabPanel };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
|
|
3
|
+
declare const MpTabPanel: vue.DefineComponent<{
|
|
4
|
+
isSelected: {
|
|
5
|
+
type: vue.PropType<boolean>;
|
|
6
|
+
};
|
|
7
|
+
value: {
|
|
8
|
+
type: vue.PropType<string>;
|
|
9
|
+
};
|
|
10
|
+
isKeepAlive: {
|
|
11
|
+
type: vue.PropType<boolean>;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}, () => JSX.Element | null, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
|
|
15
|
+
isSelected: {
|
|
16
|
+
type: vue.PropType<boolean>;
|
|
17
|
+
};
|
|
18
|
+
value: {
|
|
19
|
+
type: vue.PropType<string>;
|
|
20
|
+
};
|
|
21
|
+
isKeepAlive: {
|
|
22
|
+
type: vue.PropType<boolean>;
|
|
23
|
+
default: boolean;
|
|
24
|
+
};
|
|
25
|
+
}>>, {
|
|
26
|
+
isKeepAlive: boolean;
|
|
27
|
+
}, {}>;
|
|
28
|
+
|
|
29
|
+
export { MpTabPanel };
|