eco-vue-js 0.8.35 → 0.8.36

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,6 +10,8 @@ declare function __VLS_template(): {
10
10
  slots?: import('vue').VNode[];
11
11
  lessTransitions?: boolean;
12
12
  initTab?: number;
13
+ side?: boolean;
14
+ disableMinHeight?: boolean;
13
15
  }> & Readonly<{
14
16
  "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
15
17
  "onUpdate:current"?: ((value: number) => any) | undefined;
@@ -39,6 +41,8 @@ declare function __VLS_template(): {
39
41
  slots?: import('vue').VNode[];
40
42
  lessTransitions?: boolean;
41
43
  initTab?: number;
44
+ side?: boolean;
45
+ disableMinHeight?: boolean;
42
46
  }> & Readonly<{
43
47
  "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
44
48
  "onUpdate:current"?: ((value: number) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"WModalStepper.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/WModalStepper.vue"],"names":[],"mappings":"AAuNA,iBAAS,cAAc;;uBA6MI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAUhB,OAAO,IAA6B;EAEjD;AAyBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YAzTX,MAAM,EAAE;cACN,OAAO;eACN,OAAO;mBACH,OAAO;;gBA2BP,IAAI;oBANA,IAAI;;;;;;;;;YAxBf,MAAM,EAAE;cACN,OAAO;eACN,OAAO;mBACH,OAAO;;;;;;;;kFAqUtB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"WModalStepper.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/WModalStepper.vue"],"names":[],"mappings":"AAuNA,iBAAS,cAAc;;uBA6MI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAUhB,OAAO,IAA6B;EAEjD;AAyBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;YAzTX,MAAM,EAAE;cACN,OAAO;eACN,OAAO;mBACH,OAAO;;gBA2BP,IAAI;oBANA,IAAI;;;;;;;;;YAxBf,MAAM,EAAE;cACN,OAAO;eACN,OAAO;mBACH,OAAO;;;;;;;;kFAqUtB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -7,6 +7,8 @@ declare const _default: import('vue').DefineComponent<{
7
7
  slots?: VNode[];
8
8
  lessTransitions?: boolean;
9
9
  initTab?: number;
10
+ side?: boolean;
11
+ disableMinHeight?: boolean;
10
12
  }, {
11
13
  updateIndex: (value: number) => void;
12
14
  next: () => void;
@@ -26,6 +28,8 @@ declare const _default: import('vue').DefineComponent<{
26
28
  slots?: VNode[];
27
29
  lessTransitions?: boolean;
28
30
  initTab?: number;
31
+ side?: boolean;
32
+ disableMinHeight?: boolean;
29
33
  }> & Readonly<{
30
34
  "onUpdate:has-changes"?: ((value: boolean) => any) | undefined;
31
35
  "onUpdate:current"?: ((value: number) => any) | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"WTabs.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Tabs/WTabs.vue"],"names":[],"mappings":"AA4OA,OAAO,EAAkC,KAAK,KAAK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YAC7C,KAAK,EAAE;sBACG,OAAO;cACf,MAAM;WACT,OAAO;uBACK,OAAO;;yBAyCA,MAAM;gBAajB,IAAI;oBAIA,IAAI;sBAkCA,MAAM,6GAAqE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;wBAIhI,MAAM;;UAAuE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC;uBAIvI,MAAM,KAAsE,UAAU,CAAC,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC;;;;;YA3GpJ,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;gBAC7B,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;YACrC,YAAY,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC;YAC7C,KAAK,EAAE;sBACG,OAAO;cACf,MAAM;WACT,OAAO;uBACK,OAAO;;;;;AAmb5B,wBAWG"}
@@ -1,16 +1,11 @@
1
- import { defineComponent, useSlots, computed, ref, reactive, inject, watch, onMounted, onUnmounted, openBlock, createElementBlock, Fragment, renderList, normalizeClass, unref, createElementVNode, createBlock, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, Transition, withCtx, normalizeStyle, TransitionGroup, nextTick } from 'vue';
1
+ import { defineComponent, useSlots, computed, ref, reactive, inject, watch, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, Fragment, renderList, unref, createElementVNode, createBlock, resolveDynamicComponent, createCommentVNode, createTextVNode, toDisplayString, createVNode, Transition, withCtx, normalizeStyle, TransitionGroup, nextTick } from 'vue';
2
2
  import _sfc_main$1 from './components/TabItem.vue.js';
3
3
  import _sfc_main$2 from '../Form/WForm.vue.js';
4
4
  import { throttle, debounce } from '../../utils/utils.js';
5
5
  import { wTabItemListener, wTabItemUnlistener } from './models/injection.js';
6
6
 
7
- const _hoisted_1 = { class: "mb-8" };
8
- const _hoisted_2 = {
9
- key: 0,
10
- class: "relative flex mb-4 overflow-x-auto overscroll-x-contain no-scrollbar snap-x snap-always snap-mandatory"
11
- };
12
- const _hoisted_3 = ["onClick"];
13
- const _hoisted_4 = { class: "relative whitespace-nowrap px-4" };
7
+ const _hoisted_1 = ["onClick"];
8
+ const _hoisted_2 = { class: "relative whitespace-nowrap px-4" };
14
9
  const _sfc_main = /* @__PURE__ */ defineComponent({
15
10
  __name: "WTabs",
16
11
  props: {
@@ -19,7 +14,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
19
14
  icons: {},
20
15
  slots: {},
21
16
  lessTransitions: { type: Boolean },
22
- initTab: {}
17
+ initTab: {},
18
+ side: { type: Boolean },
19
+ disableMinHeight: { type: Boolean }
23
20
  },
24
21
  emits: ["update:current", "update:has-changes"],
25
22
  setup(__props, { expose: __expose, emit: __emit }) {
@@ -66,10 +63,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
63
  if (!props.names) return;
67
64
  const element = button.value[current.value];
68
65
  if (!element || !element.offsetWidth) return;
69
- indicatorStyle.value = {
70
- width: element.offsetWidth + "px",
71
- left: element.offsetLeft + "px"
72
- };
66
+ if (props.side) {
67
+ indicatorStyle.value = {
68
+ height: element.offsetHeight + "px",
69
+ top: element.offsetTop + "px",
70
+ left: "0",
71
+ width: "0.25rem"
72
+ };
73
+ } else {
74
+ indicatorStyle.value = {
75
+ width: element.offsetWidth + "px",
76
+ left: element.offsetLeft + "px",
77
+ bottom: "0",
78
+ height: "0.25rem"
79
+ };
80
+ }
73
81
  };
74
82
  const updateHeight = (value) => {
75
83
  if (minHeight.value >= value) return;
@@ -111,22 +119,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
111
119
  initModel
112
120
  });
113
121
  return (_ctx, _cache) => {
114
- return openBlock(), createElementBlock("div", _hoisted_1, [
115
- _ctx.names ? (openBlock(), createElementBlock("div", _hoisted_2, [
122
+ return openBlock(), createElementBlock("div", {
123
+ class: normalizeClass(["mb-8 grid gap-4", {
124
+ "grid grid-cols-1": !_ctx.side,
125
+ "grid grid-cols-[auto,1fr] items-start": _ctx.side
126
+ }])
127
+ }, [
128
+ _ctx.names ? (openBlock(), createElementBlock("div", {
129
+ key: 0,
130
+ class: normalizeClass(["relative flex overflow-x-auto overscroll-x-contain no-scrollbar snap-x snap-always snap-mandatory", {
131
+ "flex-col": _ctx.side
132
+ }])
133
+ }, [
116
134
  (openBlock(true), createElementBlock(Fragment, null, renderList(defaultSlots.value, (_, index) => {
117
135
  return openBlock(), createElementBlock("button", {
118
136
  ref_for: true,
119
137
  ref_key: "button",
120
138
  ref: button,
121
139
  key: index,
122
- class: normalizeClass(["flex-1 font-semibold flex items-center justify-center h-10 cursor-pointer snap-center relative w-ripple w-ripple-hover select-none transition-colors duration-500 outline-none", {
140
+ class: normalizeClass(["flex-1 font-semibold flex items-center cursor-pointer snap-center relative w-ripple w-ripple-hover select-none transition-colors duration-500 outline-none", {
123
141
  "text-description": current.value !== index && isValidMap[index] !== false,
124
142
  "text-primary-default dark:text-primary-dark": current.value === index && isValidMap[index] !== false,
125
- "text-negative dark:text-negative-dark": isValidMap[index] === false
143
+ "text-negative dark:text-negative-dark": isValidMap[index] === false,
144
+ "h-10 text-center justify-center": !_ctx.side,
145
+ "py-3 text-start pr-4": _ctx.side
126
146
  }]),
127
147
  onClick: ($event) => unref(switchTab)(index)
128
148
  }, [
129
- createElementVNode("div", _hoisted_4, [
149
+ createElementVNode("div", _hoisted_2, [
130
150
  _ctx.icons?.[index] ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icons?.[index]), {
131
151
  key: 0,
132
152
  class: "inline -mt-1"
@@ -141,7 +161,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
141
161
  default: withCtx(() => [
142
162
  hasChangesMap[index] ? (openBlock(), createElementBlock("div", {
143
163
  key: 0,
144
- class: normalizeClass(["absolute top-0 -right-4 square-2 rounded-full transition-colors duration-500", {
164
+ class: normalizeClass(["absolute top-0 right-0 square-2 rounded-full transition-colors duration-500", {
145
165
  "bg-info dark:bg-info-dark": isValidMap[index] !== false,
146
166
  "bg-negative dark:bg-negative-dark": isValidMap[index] === false
147
167
  }])
@@ -150,26 +170,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
150
170
  _: 2
151
171
  }, 1024)
152
172
  ])
153
- ], 10, _hoisted_3);
173
+ ], 10, _hoisted_1);
154
174
  }), 128)),
155
175
  createElementVNode("div", {
156
- class: normalizeClass(["absolute bottom-0 h-1 rounded-sm duration-500", {
176
+ class: normalizeClass(["absolute rounded-sm duration-500", {
157
177
  "bg-primary-default dark:bg-primary-dark": isValidMap[current.value] !== false,
158
178
  "bg-negative dark:bg-negative-dark": isValidMap[current.value] === false,
159
- "transition-[left,width,background-color]": indicatorStyle.value !== void 0
179
+ "transition-[left,width,background-color]": !_ctx.side && indicatorStyle.value !== void 0,
180
+ "transition-[top,height,background-color]": _ctx.side && indicatorStyle.value !== void 0
160
181
  }]),
161
182
  style: normalizeStyle(indicatorStyle.value)
162
183
  }, null, 6)
163
- ])) : createCommentVNode("", true),
184
+ ], 2)) : createCommentVNode("", true),
164
185
  createElementVNode("div", {
165
186
  class: "relative transition-[min-height] h-full duration-300",
166
187
  style: normalizeStyle({ minHeight: minHeight.value ? minHeight.value + "px" : "auto", "--direction-factor": isDirect.value ? "1" : "-1" })
167
188
  }, [
168
189
  createVNode(TransitionGroup, {
169
- "enter-active-class": "transition-transform duration-[250ms] w-full",
170
- "leave-active-class": "transition-transform duration-[250ms] w-full absolute top-0",
171
- "enter-from-class": _ctx.lessTransitions ? "opacity-0" : "translate-x-[calc((100%+var(--inner-margin))*var(--direction-factor))]",
172
- "leave-to-class": _ctx.lessTransitions ? "opacity-0" : "translate-x-[calc((100%+var(--inner-margin))*var(--direction-factor)*-1)]"
190
+ "enter-active-class": "transition-[transform,opacity] duration-[250ms] w-full",
191
+ "leave-active-class": "transition-[transform,opacity] duration-[250ms] w-full absolute top-0",
192
+ "enter-from-class": _ctx.lessTransitions || _ctx.side ? "opacity-0" : "translate-x-[calc((100%+var(--inner-margin))*var(--direction-factor))]",
193
+ "leave-to-class": _ctx.lessTransitions || _ctx.side ? "opacity-0" : "translate-x-[calc((100%+var(--inner-margin))*var(--direction-factor)*-1)]"
173
194
  }, {
174
195
  default: withCtx(() => [
175
196
  (openBlock(true), createElementBlock(Fragment, null, renderList(defaultSlots.value, (slot, index) => {
@@ -180,7 +201,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
180
201
  key: index,
181
202
  "is-active": index === current.value,
182
203
  class: "width-full",
183
- "onUpdate:height": updateHeight
204
+ "onUpdate:height": _cache[0] || (_cache[0] = ($event) => !_ctx.disableMinHeight && updateHeight($event))
184
205
  }, {
185
206
  default: withCtx(() => [
186
207
  createVNode(_sfc_main$2, {
@@ -205,7 +226,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
205
226
  _: 1
206
227
  }, 8, ["enter-from-class", "leave-to-class"])
207
228
  ], 4)
208
- ]);
229
+ ], 2);
209
230
  };
210
231
  }
211
232
  });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/rsmple/eco-vue-js.git"
6
6
  },
7
- "version": "0.8.35",
7
+ "version": "0.8.36",
8
8
  "scripts": {
9
9
  "dev": "vite",
10
10
  "build": "run-p type-check build-only",