eco-vue-js 0.9.7 → 0.9.9
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/components/Button/WButton.vue.js +2 -2
- package/dist/components/Form/WFormValidator.vue.d.ts +2 -0
- package/dist/components/Form/WFormValidator.vue.d.ts.map +1 -1
- package/dist/components/Form/WFormValidator.vue.js +5 -3
- package/dist/components/Modal/WModalStepper.vue.d.ts +300 -170
- package/dist/components/Modal/WModalStepper.vue.d.ts.map +1 -1
- package/dist/components/Modal/WModalStepper.vue.js +1 -0
- package/dist/components/Tabs/WTabs.vue.d.ts +146 -85
- package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.js +62 -55
- package/dist/components/Tabs/WTabsStepper.vue.d.ts +294 -170
- package/dist/components/Tabs/WTabsStepper.vue.d.ts.map +1 -1
- package/dist/components/Tabs/WTabsStepper.vue.js +8 -3
- package/dist/components/Tabs/components/TabItem.vue.d.ts +190 -2
- package/dist/components/Tabs/components/TabItem.vue.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabItem.vue.js +36 -16
- package/dist/components/Tabs/components/TabTitleButton.vue.d.ts +31 -5
- package/dist/components/Tabs/components/TabTitleButton.vue.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabTitleButton.vue.js +118 -62
- package/dist/components/Tabs/types.d.ts +4 -1
- package/dist/components/Tabs/types.d.ts.map +1 -1
- package/package.json +1 -1
@@ -1,6 +1,18 @@
|
|
1
|
-
import { defineComponent, useTemplateRef, watch, nextTick, onMounted, openBlock, createElementBlock, createElementVNode,
|
1
|
+
import { defineComponent, useTemplateRef, watch, nextTick, onMounted, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, unref, createCommentVNode, renderSlot, normalizeProps, mergeProps, Suspense, withCtx, resolveDynamicComponent, createTextVNode, toDisplayString, guardReactiveProps, createVNode, Transition } from 'vue';
|
2
|
+
import IconCheckCircle from '../../../assets/icons/sax/IconCheckCircle.svg.js';
|
3
|
+
import IconClose from '../../../assets/icons/sax/IconClose.svg.js';
|
4
|
+
import IconNegativeInfo from '../../../assets/icons/sax/IconNegativeInfo.svg.js';
|
2
5
|
|
3
|
-
const _hoisted_1 =
|
6
|
+
const _hoisted_1 = ["disabled"];
|
7
|
+
const _hoisted_2 = {
|
8
|
+
key: 0,
|
9
|
+
class: "p-8"
|
10
|
+
};
|
11
|
+
const _hoisted_3 = { class: "whitespace-nowrap px-4" };
|
12
|
+
const _hoisted_4 = {
|
13
|
+
key: 2,
|
14
|
+
class: "absolute bottom-0 h-1 w-full rounded-sm bg-current"
|
15
|
+
};
|
4
16
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
17
|
__name: "TabTitleButton",
|
6
18
|
props: {
|
@@ -8,29 +20,36 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
20
|
index: {},
|
9
21
|
hasError: { type: Boolean },
|
10
22
|
hasChanges: { type: Boolean },
|
23
|
+
hasValue: { type: Boolean },
|
11
24
|
title: {},
|
12
25
|
icon: {},
|
26
|
+
first: { type: Boolean },
|
27
|
+
last: { type: Boolean },
|
28
|
+
disabled: { type: Boolean },
|
29
|
+
stepper: { type: Boolean },
|
30
|
+
showHasValue: { type: Boolean },
|
31
|
+
noIndicator: { type: Boolean },
|
13
32
|
side: { type: Boolean }
|
14
33
|
},
|
15
34
|
emits: ["click", "update:indicator-style", "update:scroll-position"],
|
16
35
|
setup(__props, { expose: __expose, emit: __emit }) {
|
17
36
|
const props = __props;
|
18
37
|
const emit = __emit;
|
19
|
-
const
|
38
|
+
const containerRef = useTemplateRef("container");
|
20
39
|
const updateIndicator = () => {
|
21
|
-
if (!props.active) return;
|
22
|
-
if (!
|
40
|
+
if (!props.active || props.noIndicator) return;
|
41
|
+
if (!containerRef.value || !containerRef.value.offsetWidth) return;
|
23
42
|
if (props.side) {
|
24
43
|
emit("update:indicator-style", {
|
25
|
-
height:
|
26
|
-
top:
|
44
|
+
height: containerRef.value.offsetHeight + "px",
|
45
|
+
top: containerRef.value.offsetTop + "px",
|
27
46
|
left: "0",
|
28
47
|
width: "0.25rem"
|
29
48
|
});
|
30
49
|
} else {
|
31
50
|
emit("update:indicator-style", {
|
32
|
-
width:
|
33
|
-
left:
|
51
|
+
width: containerRef.value.offsetWidth + "px",
|
52
|
+
left: containerRef.value.offsetLeft + "px",
|
34
53
|
bottom: "0",
|
35
54
|
height: "0.25rem"
|
36
55
|
});
|
@@ -38,11 +57,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
57
|
};
|
39
58
|
const updateScrollPosition = () => {
|
40
59
|
if (!props.active) return;
|
41
|
-
if (!
|
60
|
+
if (!containerRef.value || !containerRef.value.offsetWidth) return;
|
42
61
|
if (props.side) {
|
43
|
-
emit("update:scroll-position", { top:
|
62
|
+
emit("update:scroll-position", { top: containerRef.value.offsetTop + containerRef.value.offsetHeight / 2 });
|
44
63
|
} else {
|
45
|
-
emit("update:scroll-position", { left:
|
64
|
+
emit("update:scroll-position", { left: containerRef.value.offsetLeft + containerRef.value.offsetWidth / 2 });
|
46
65
|
}
|
47
66
|
};
|
48
67
|
const update = () => {
|
@@ -64,60 +83,97 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
83
|
update
|
65
84
|
});
|
66
85
|
return (_ctx, _cache) => {
|
67
|
-
return openBlock(), createElementBlock("
|
68
|
-
ref: "
|
69
|
-
class: "
|
70
|
-
|
86
|
+
return openBlock(), createElementBlock("div", {
|
87
|
+
ref: "container",
|
88
|
+
class: normalizeClass(["relative grid", {
|
89
|
+
"col-span-2 grid grid-cols-subgrid": _ctx.side,
|
90
|
+
"grid-cols-[1fr,auto]": !_ctx.side
|
91
|
+
}])
|
71
92
|
}, [
|
72
|
-
createElementVNode("
|
73
|
-
|
74
|
-
|
75
|
-
"text-
|
76
|
-
|
93
|
+
createElementVNode("button", {
|
94
|
+
disabled: _ctx.disabled,
|
95
|
+
class: normalizeClass(["w-ripple-trigger grid select-none snap-center grid-cols-[auto,1fr] font-semibold outline-none transition-colors duration-500", {
|
96
|
+
"text-primary-default dark:text-primary-dark": !_ctx.hasError && _ctx.active,
|
97
|
+
"text-negative dark:text-negative-dark": _ctx.hasError,
|
98
|
+
"text-positive dark:text-positive-dark": _ctx.showHasValue && !_ctx.active && !_ctx.hasError && _ctx.hasValue,
|
99
|
+
"text-description": !_ctx.active && !_ctx.hasError && (_ctx.showHasValue ? !_ctx.hasValue : true),
|
100
|
+
"cursor-not-allowed opacity-50": _ctx.disabled,
|
101
|
+
"cursor-pointer": !_ctx.disabled
|
102
|
+
}]),
|
103
|
+
onClick: _cache[0] || (_cache[0] = ($event) => !_ctx.disabled && _ctx.$emit("click", $event))
|
77
104
|
}, [
|
78
|
-
_ctx
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
105
|
+
_ctx.stepper ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
106
|
+
createElementVNode("div", {
|
107
|
+
class: normalizeClass(["text-default dark:text-default-dark rounded-full bg-[inherit] bg-opacity-100 p-1 outline transition-[outline-width] duration-500", {
|
108
|
+
"bg-negative dark:bg-negative-dark outline-negative/10 dark:outline-negative-dark/10": _ctx.hasError,
|
109
|
+
"bg-positive dark:bg-positive-dark outline-positive/10 dark:outline-positive-dark/10": !_ctx.hasError && _ctx.hasValue,
|
110
|
+
"bg-gray-400 outline-gray-400/10 dark:bg-gray-600 dark:outline-gray-600/10": !_ctx.hasError && !_ctx.hasValue,
|
111
|
+
"outline-[1.5rem]": _ctx.active
|
112
|
+
}])
|
113
|
+
}, [
|
114
|
+
_ctx.hasError ? (openBlock(), createBlock(unref(IconNegativeInfo), {
|
115
|
+
key: 0,
|
116
|
+
class: "size-8"
|
117
|
+
})) : _ctx.hasValue ? (openBlock(), createBlock(unref(IconCheckCircle), {
|
118
|
+
key: 1,
|
119
|
+
class: "size-8"
|
120
|
+
})) : (openBlock(), createBlock(unref(IconClose), {
|
121
|
+
key: 2,
|
122
|
+
class: "size-8"
|
123
|
+
}))
|
124
|
+
], 2)
|
125
|
+
])) : createCommentVNode("", true),
|
126
|
+
createElementVNode("div", {
|
127
|
+
class: normalizeClass(["relative col-start-2", {
|
128
|
+
"mt-3": _ctx.stepper,
|
129
|
+
"w-ripple w-ripple-hover": !_ctx.disabled
|
83
130
|
}])
|
84
131
|
}, [
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
132
|
+
_ctx.$slots.title ? renderSlot(_ctx.$slots, "title", normalizeProps(mergeProps({ key: 0 }, { hasChanges: _ctx.hasChanges, hasError: _ctx.hasError, hasValue: _ctx.hasValue }))) : (openBlock(), createElementBlock("div", {
|
133
|
+
key: 1,
|
134
|
+
class: normalizeClass(["flex items-center", {
|
135
|
+
"h-10 justify-center text-center": !_ctx.side,
|
136
|
+
"py-3 text-start": _ctx.side
|
137
|
+
}])
|
138
|
+
}, [
|
139
|
+
createElementVNode("div", _hoisted_3, [
|
140
|
+
_ctx.icon !== void 0 ? (openBlock(), createBlock(Suspense, { key: 0 }, {
|
141
|
+
fallback: withCtx(() => _cache[1] || (_cache[1] = [
|
142
|
+
createElementVNode("svg", { class: "square-5 -mt-1 inline" }, [
|
143
|
+
createElementVNode("g")
|
144
|
+
], -1)
|
145
|
+
])),
|
146
|
+
default: withCtx(() => [
|
147
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { class: "square-5 -mt-1 inline" }))
|
148
|
+
]),
|
149
|
+
_: 1
|
150
|
+
})) : createCommentVNode("", true),
|
151
|
+
createTextVNode(" " + toDisplayString(_ctx.title), 1)
|
152
|
+
]),
|
153
|
+
renderSlot(_ctx.$slots, "suffix", normalizeProps(guardReactiveProps({ hasChanges: _ctx.hasChanges, hasError: _ctx.hasError, hasValue: _ctx.hasValue })))
|
154
|
+
], 2)),
|
155
|
+
createVNode(Transition, {
|
156
|
+
"enter-active-class": "transition-opacity",
|
157
|
+
"leave-active-class": "transition-opacity",
|
158
|
+
"enter-from-class": "opacity-0",
|
159
|
+
"leave-to-class": "opacity-0"
|
160
|
+
}, {
|
161
|
+
default: withCtx(() => [
|
162
|
+
_ctx.hasChanges ? (openBlock(), createElementBlock("div", {
|
163
|
+
key: 0,
|
164
|
+
class: normalizeClass(["square-2 absolute right-0 top-0 rounded-full transition-colors duration-500", {
|
165
|
+
"bg-info dark:bg-info-dark": !_ctx.hasError,
|
166
|
+
"bg-negative dark:bg-negative-dark": _ctx.hasError
|
167
|
+
}])
|
168
|
+
}, null, 2)) : createCommentVNode("", true)
|
169
|
+
]),
|
170
|
+
_: 1
|
171
|
+
}),
|
172
|
+
_ctx.stepper ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true)
|
173
|
+
], 2)
|
174
|
+
], 10, _hoisted_1),
|
175
|
+
renderSlot(_ctx.$slots, "right", normalizeProps(guardReactiveProps({ hasChanges: _ctx.hasChanges, hasError: _ctx.hasError, hasValue: _ctx.hasValue })))
|
176
|
+
], 2);
|
121
177
|
};
|
122
178
|
}
|
123
179
|
});
|
@@ -8,8 +8,11 @@ export interface TabsProps {
|
|
8
8
|
disableMinHeight?: boolean;
|
9
9
|
noHeader?: boolean;
|
10
10
|
switchToNew?: boolean;
|
11
|
+
noIndicator?: boolean;
|
12
|
+
stepper?: boolean;
|
13
|
+
showHasValue?: boolean;
|
11
14
|
}
|
12
|
-
export type TabsStepperProps = Omit<TabsProps, 'switchToNew' | '
|
15
|
+
export type TabsStepperProps = Omit<TabsProps, 'switchToNew' | 'noIndicator' | 'side'>;
|
13
16
|
export type TabsItemScopedProps = {
|
14
17
|
hasError: boolean;
|
15
18
|
hasChanges: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,KAAK,CAAA;AAE9B,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,KAAK,EAAE,CAAA;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,KAAK,CAAA;AAE9B,MAAM,WAAW,SAAS;IACxB,WAAW,CAAC,EAAE,KAAK,EAAE,CAAA;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,aAAa,GAAG,MAAM,CAAC,CAAA;AAEtF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA"}
|