@pantograph/vue 0.30.1 → 0.30.3
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/Base/BaseInput/BaseInput.d.ts +11 -2
- package/dist/BaseInput.vue_vue_type_style_index_0_lang-DdjridzV.js +1 -0
- package/dist/BaseInput.vue_vue_type_style_index_0_lang-Djl15xzS.js +159 -0
- package/dist/Blanket/Blanket.d.ts +11 -0
- package/dist/Blanket/index.d.ts +1 -1
- package/dist/Blanket/index.js +5 -1
- package/dist/Blanket/index.umd.cjs +1 -1
- package/dist/Blanket.vue_vue_type_style_index_0_lang-Dv68meO4.js +22 -0
- package/dist/Blanket.vue_vue_type_style_index_0_lang-WKNPEuJI.js +1 -0
- package/dist/ColorPicker/index.js +2 -2
- package/dist/ColorPicker/index.umd.cjs +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-DC7OjAIp.js → ColorPicker.vue_vue_type_style_index_0_lang-BVjzmZnp.js} +1 -1
- package/dist/{ColorPicker.vue_vue_type_style_index_0_lang-BbPbMX-k.js → ColorPicker.vue_vue_type_style_index_0_lang-Did8RS1T.js} +1 -1
- package/dist/ColorSwatchGroup/index.js +1 -1
- package/dist/ColorSwatchGroup/index.umd.cjs +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-DroX6p45.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-CDF1AL9P.js} +1 -1
- package/dist/{ColorSwatchGroup.vue_vue_type_style_index_0_lang-B3fzpT99.js → ColorSwatchGroup.vue_vue_type_style_index_0_lang-C_XuCb0R.js} +1 -1
- package/dist/Combobox/index.js +62 -60
- package/dist/Combobox/index.umd.cjs +1 -1
- package/dist/GOPicker/index.js +2 -2
- package/dist/GOPicker/index.umd.cjs +1 -1
- package/dist/Input/Input.d.ts +174 -1
- package/dist/Input/index.js +1 -1
- package/dist/Input/index.umd.cjs +1 -1
- package/dist/Input.vue_vue_type_script_setup_true_lang-ByHGhDsA.js +126 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-CTIaAkrW.js +1 -0
- package/dist/InputNumber/InputNumber.d.ts +174 -1
- package/dist/InputNumber/index.js +1 -1
- package/dist/InputNumber/index.umd.cjs +1 -1
- package/dist/{InputNumber.vue_vue_type_script_setup_true_lang-Dx8V2Sz8.js → InputNumber.vue_vue_type_script_setup_true_lang-C4GMpH6O.js} +179 -162
- package/dist/InputNumber.vue_vue_type_script_setup_true_lang-DW-JqPiv.js +1 -0
- package/dist/Pagination/index.js +26 -25
- package/dist/Pagination/index.umd.cjs +1 -1
- package/dist/Steps/Step.d.ts +45 -0
- package/dist/Steps/StepLeading.d.ts +2 -0
- package/dist/Steps/Steps.d.ts +50 -0
- package/dist/Steps/index.d.ts +5 -1
- package/dist/Steps/index.js +247 -1
- package/dist/Steps/index.umd.cjs +1 -1
- package/dist/index.js +375 -360
- package/dist/index.umd.cjs +1 -1
- package/dist/style/index.css +1 -1
- package/dist/use/index.js +400 -359
- package/dist/use/index.umd.cjs +1 -1
- package/package.json +54 -51
- package/dist/BaseInput.vue_vue_type_style_index_0_lang-D3zq7oKh.js +0 -1
- package/dist/BaseInput.vue_vue_type_style_index_0_lang-aX7hcK86.js +0 -136
- package/dist/Input.vue_vue_type_script_setup_true_lang-DW0Xc_1z.js +0 -112
- package/dist/Input.vue_vue_type_script_setup_true_lang-DoaHfVrM.js +0 -1
- package/dist/InputNumber.vue_vue_type_script_setup_true_lang-URIsXuko.js +0 -1
package/dist/Pagination/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as ee, computed as p, ref as te, createElementBlock as
|
|
1
|
+
import { defineComponent as ee, computed as p, ref as te, createElementBlock as c, openBlock as s, normalizeClass as l, unref as e, createElementVNode as f, createBlock as z, createCommentVNode as x, withCtx as F, createTextVNode as L, toDisplayString as C, Fragment as w, isRef as ae, renderList as ne, mergeProps as ie, createVNode as oe, renderSlot as se, normalizeProps as le, guardReactiveProps as re, nextTick as ue } from "vue";
|
|
2
2
|
import { cva as de } from "class-variance-authority";
|
|
3
3
|
import { _ as pe } from "../Divider.vue_vue_type_style_index_0_lang-GfWcHNix.js";
|
|
4
|
-
import { _ as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { _ as
|
|
4
|
+
import { _ as ce } from "../Segmented.vue_vue_type_style_index_0_lang-BXQbBiaE.js";
|
|
5
|
+
import { _ as me } from "../InputNumber.vue_vue_type_script_setup_true_lang-C4GMpH6O.js";
|
|
6
|
+
import { _ as D } from "../BaseButton.vue_vue_type_style_index_0_lang-qkW0olhp.js";
|
|
7
7
|
import { _ as ge } from "../Icon.vue_vue_type_style_index_0_lang-CD9EvvB5.js";
|
|
8
8
|
import { useFormInput as ve, useVModel as j, installComponent as fe } from "@pantograph/utils-vue";
|
|
9
9
|
import { getComponentOptions as Ce, getBemBlock as he, getBemElement as r, generateVariantClassList as U, normCls as u, getComponentName as be } from "@pantograph/utils";
|
|
@@ -73,20 +73,20 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
73
73
|
}
|
|
74
74
|
a || (g.value = a);
|
|
75
75
|
}
|
|
76
|
-
}), S = p(() => Math.min(Math.max(o.value ?? 1, 0),
|
|
76
|
+
}), S = p(() => Math.min(Math.max(o.value ?? 1, 0), m.value)), H = p(() => i.total ?? 0), N = p(() => g.value ?? 0), m = p(() => Math.max(1, Math.ceil(H.value / N.value))), K = p(() => {
|
|
77
77
|
const a = i.total ?? 0, t = S.value, n = a && t ? (t - 1) * N.value + 1 : 0;
|
|
78
78
|
return {
|
|
79
79
|
start: n,
|
|
80
80
|
end: Math.min(n + N.value - 1, a),
|
|
81
81
|
total: i.total,
|
|
82
82
|
page: t,
|
|
83
|
-
pageCount:
|
|
83
|
+
pageCount: m.value
|
|
84
84
|
};
|
|
85
85
|
}), B = "ellipsis", I = (a, t) => {
|
|
86
86
|
const n = t - a + 1;
|
|
87
87
|
return Array.from({ length: n }, (y, v) => v + a);
|
|
88
88
|
}, k = (a) => a.map((t) => typeof t == "number" ? { type: "page", value: t } : { type: "ellipsis" }), Q = p(() => {
|
|
89
|
-
const t =
|
|
89
|
+
const t = m.value, n = 2, y = Math.max(S.value - n, 1), v = Math.min(S.value + n, t), M = Math.min(2 * n + 5, m.value) - 2, T = (
|
|
90
90
|
// default condition
|
|
91
91
|
y > 3 && // if the current page is towards the end of the list
|
|
92
92
|
Math.abs(t - M - 1 + 1) > 2 && // if the current page is towards the middle of the list
|
|
@@ -128,13 +128,13 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
128
128
|
}
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
|
-
return (a, t) => (s(),
|
|
131
|
+
return (a, t) => (s(), c("div", {
|
|
132
132
|
class: l(e(u)(e(q)(i), i.class))
|
|
133
133
|
}, [
|
|
134
134
|
f("div", {
|
|
135
135
|
class: l(e(u)(e(h), i.paginationCls))
|
|
136
136
|
}, [
|
|
137
|
-
a.hidePerv ? x("", !0) : (s(), z(
|
|
137
|
+
a.hidePerv ? x("", !0) : (s(), z(D, {
|
|
138
138
|
key: 0,
|
|
139
139
|
size: "sm",
|
|
140
140
|
type: "ghost",
|
|
@@ -145,16 +145,16 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
145
145
|
disabled: e(b) ?? !!(e(o) && e(o) <= 1),
|
|
146
146
|
onClick: W
|
|
147
147
|
}, {
|
|
148
|
-
default:
|
|
149
|
-
|
|
148
|
+
default: F(() => [
|
|
149
|
+
L(C(a.pervText), 1)
|
|
150
150
|
]),
|
|
151
151
|
_: 1
|
|
152
152
|
}, 8, ["variant", "disabled"])),
|
|
153
|
-
a.simple ? (s(),
|
|
153
|
+
a.simple ? (s(), c(w, { key: 1 }, [
|
|
154
154
|
f("div", {
|
|
155
155
|
class: l(e(u)(e(r)(e(h), "text"), i.paginationTextCls))
|
|
156
156
|
}, C(a.pageText), 3),
|
|
157
|
-
a.showInput ? (s(), z(
|
|
157
|
+
a.showInput ? (s(), z(me, {
|
|
158
158
|
key: 0,
|
|
159
159
|
modelValue: e(o),
|
|
160
160
|
"onUpdate:modelValue": t[0] || (t[0] = (n) => ae(o) ? o.value = n : null),
|
|
@@ -162,9 +162,10 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
162
162
|
size: "sm",
|
|
163
163
|
min: 1,
|
|
164
164
|
controls: !1,
|
|
165
|
-
|
|
165
|
+
contentFit: "",
|
|
166
|
+
max: m.value,
|
|
166
167
|
class: l(e(u)(e(r)(e(h), "current"), i.paginationCurrentCls))
|
|
167
|
-
}, null, 8, ["modelValue", "disabled", "max", "class"])) : (s(),
|
|
168
|
+
}, null, 8, ["modelValue", "disabled", "max", "class"])) : (s(), c("div", {
|
|
168
169
|
key: 1,
|
|
169
170
|
class: l(e(u)(e(r)(e(h), "current"), i.paginationCurrentCls))
|
|
170
171
|
}, C(e(o)), 3)),
|
|
@@ -172,16 +173,16 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
172
173
|
class: l(e(u)(e(r)(e(h), "count"), i.paginationCountCls))
|
|
173
174
|
}, [
|
|
174
175
|
t[2] || (t[2] = f("div", null, "/", -1)),
|
|
175
|
-
f("div", null, C(
|
|
176
|
+
f("div", null, C(m.value), 1)
|
|
176
177
|
], 2)
|
|
177
|
-
], 64)) : (s(!0),
|
|
178
|
+
], 64)) : (s(!0), c(w, { key: 2 }, ne(Q.value, (n, y) => (s(), c(w, {
|
|
178
179
|
key: n.value ?? n.type
|
|
179
180
|
}, [
|
|
180
|
-
n.type === "page" ? (s(),
|
|
181
|
+
n.type === "page" ? (s(), c("button", ie({
|
|
181
182
|
key: 0,
|
|
182
183
|
onClick: (v) => Y(n),
|
|
183
184
|
class: e(u)(e(r)(e(d), "item"), a.itemCls)
|
|
184
|
-
}, { ref_for: !0 }, Z(n), { disabled: e(b) }), C(n.value), 17, Pe)) : (s(),
|
|
185
|
+
}, { ref_for: !0 }, Z(n), { disabled: e(b) }), C(n.value), 17, Pe)) : (s(), c("div", {
|
|
185
186
|
key: 1,
|
|
186
187
|
class: l(e(u)(e(r)(e(d), "item"), a.itemCls))
|
|
187
188
|
}, [
|
|
@@ -191,7 +192,7 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
191
192
|
})
|
|
192
193
|
], 2))
|
|
193
194
|
], 64))), 128)),
|
|
194
|
-
a.hideNext ? x("", !0) : (s(), z(
|
|
195
|
+
a.hideNext ? x("", !0) : (s(), z(D, {
|
|
195
196
|
key: 3,
|
|
196
197
|
size: "sm",
|
|
197
198
|
type: "ghost",
|
|
@@ -199,11 +200,11 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
199
200
|
postIcon: "tabler:chevron-right",
|
|
200
201
|
icon: "tabler:chevron-right",
|
|
201
202
|
postIconFlipOnDir: "rtl",
|
|
202
|
-
disabled: e(b) ?? !!(e(o) && e(o) >=
|
|
203
|
+
disabled: e(b) ?? !!(e(o) && e(o) >= m.value),
|
|
203
204
|
onClick: X
|
|
204
205
|
}, {
|
|
205
|
-
default:
|
|
206
|
-
|
|
206
|
+
default: F(() => [
|
|
207
|
+
L(C(a.nextText), 1)
|
|
207
208
|
]),
|
|
208
209
|
_: 1
|
|
209
210
|
}, 8, ["variant", "disabled"]))
|
|
@@ -211,7 +212,7 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
211
212
|
f("div", {
|
|
212
213
|
class: l(e(u)(e(r)(e(d), "pageSize"), i.sizeCls))
|
|
213
214
|
}, [
|
|
214
|
-
a.hideSize ? x("", !0) : (s(), z(
|
|
215
|
+
a.hideSize ? x("", !0) : (s(), z(ce, {
|
|
215
216
|
key: 0,
|
|
216
217
|
options: V.value,
|
|
217
218
|
size: "sm",
|
|
@@ -224,7 +225,7 @@ const ye = ["between", "start", "center", "end"], Pe = ["onClick", "disabled"],
|
|
|
224
225
|
type: "vertical",
|
|
225
226
|
class: l(e(r)(e(d), "divider"))
|
|
226
227
|
}, null, 8, ["class"])) : x("", !0),
|
|
227
|
-
a.hideTotal ? x("", !0) : (s(),
|
|
228
|
+
a.hideTotal ? x("", !0) : (s(), c("div", {
|
|
228
229
|
key: 2,
|
|
229
230
|
class: l(e(u)(e(r)(e(d), "total"), i.totalCls))
|
|
230
231
|
}, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("class-variance-authority"),U=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),$=require("../Segmented.vue_vue_type_style_index_0_lang-CLYRU64q.js"),G=require("../InputNumber.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J=require("class-variance-authority"),U=require("../Divider.vue_vue_type_style_index_0_lang-D3wrVsBd.js"),$=require("../Segmented.vue_vue_type_style_index_0_lang-CLYRU64q.js"),G=require("../InputNumber.vue_vue_type_script_setup_true_lang-DW-JqPiv.js"),N=require("../BaseButton.vue_vue_type_style_index_0_lang-D1jasaOz.js"),H=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),k=require("@pantograph/utils-vue"),l=require("@pantograph/utils"),z=require("../isNumber-DMOjxgl8.js"),I=["between","start","center","end"],K=["onClick","disabled"],S=e.defineComponent({...l.getComponentOptions("Pagination"),__name:"Pagination",props:{page:{},total:{default:0},showInput:{type:Boolean},disabled:{type:Boolean,default:void 0},iconButton:{type:Boolean},simple:{type:Boolean},hidePerv:{type:Boolean},hideNext:{type:Boolean},hideSize:{type:Boolean},hideTotal:{type:Boolean},resetPageOnChangeSize:{type:Boolean},sizes:{},pageSize:{},pervText:{default:"Previous"},nextText:{default:"Next"},pageText:{default:"Page"},justify:{default:"between"},class:{},sizeCls:{},paginationCls:{},totalCls:{},itemCls:{},paginationTextCls:{},paginationCurrentCls:{},paginationCountCls:{}},emits:["update:pageSize","update:page"],setup(M,{emit:T}){const o=M,x=T,s=l.getBemBlock("pagination"),m=l.getBemElement(s,"pagination"),q=J.cva(s,{variants:{justify:l.generateVariantClassList(I,s),simple:l.generateVariantClassList("simple",s)}}),_=e.computed(()=>(o.sizes??[10,25,50,100]).filter(n=>z.isNumber(n)&&n>0).map(String)),{getDisabled:d}=k.useFormInput(),i=k.useVModel(o,"page",x,{passive:o.page===void 0,defaultValue:1}),D=_.value[0]?Number(_.value[0]):void 0,u=k.useVModel(o,"pageSize",x,{passive:o.pageSize===void 0,defaultValue:o.pageSize??D,onChange(){o.resetPageOnChangeSize&&(i.value=1)}}),V=e.computed({get(){return z.isNumber(u.value)?String(u.value):u.value},set(n){const t=Number(n);if(t||t===0){u.value=t;return}n||(u.value=n)}}),f=e.computed(()=>Math.min(Math.max(i.value??1,0),r.value)),w=e.computed(()=>o.total??0),h=e.computed(()=>u.value??0),r=e.computed(()=>Math.max(1,Math.ceil(w.value/h.value))),F=e.computed(()=>{const n=o.total??0,t=f.value,a=n&&t?(t-1)*h.value+1:0;return{start:a,end:Math.min(a+h.value-1,n),total:o.total,page:t,pageCount:r.value}}),v="ellipsis",C=(n,t)=>{const a=t-n+1;return Array.from({length:a},(p,c)=>c+n)},B=n=>n.map(t=>typeof t=="number"?{type:"page",value:t}:{type:"ellipsis"}),O=e.computed(()=>{const t=r.value,a=2,p=Math.max(f.value-a,1),c=Math.min(f.value+a,t),y=Math.min(2*a+5,r.value)-2,b=p>3&&Math.abs(t-y-1+1)>2&&Math.abs(p-1)>2,P=c<t-2&&Math.abs(t-y)>2&&Math.abs(t-c)>2;if(!b&&P){const g=C(1,y);return B([...g,v,t])}if(b&&!P){const g=C(t-y+1,t);return B([1,v,...g])}if(b&&P){const g=C(p,c);return B([1,v,...g,v,t])}return B(C(1,t))}),L=()=>{i.value=(i.value??2)-1},R=()=>{i.value=(i.value??0)+1},j=n=>{z.isNumber(n.value)&&(i.value=n.value,e.nextTick(()=>{var t,a;return(a=(t=E.value)==null?void 0:t.focus)==null?void 0:a.call(t)}))},E=e.ref(),A=n=>{const t=n.value===f.value;return{"data-selected":t,ref:a=>{a&&t&&(E.value=a)}}};return(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(q)(o),o.class))},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(m),o.paginationCls))},[n.hidePerv?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(N._sfc_main,{key:0,size:"sm",type:"ghost",variant:o.iconButton?"icon":"simple",preIcon:"tabler:chevron-left",icon:"tabler:chevron-left",preIconFlipOnDir:"rtl",disabled:e.unref(d)??!!(e.unref(i)&&e.unref(i)<=1),onClick:L},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.pervText),1)]),_:1},8,["variant","disabled"])),n.simple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(m),"text"),o.paginationTextCls))},e.toDisplayString(n.pageText),3),n.showInput?(e.openBlock(),e.createBlock(G._sfc_main,{key:0,modelValue:e.unref(i),"onUpdate:modelValue":t[0]||(t[0]=a=>e.isRef(i)?i.value=a:null),disabled:e.unref(d),size:"sm",min:1,controls:!1,contentFit:"",max:r.value,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(m),"current"),o.paginationCurrentCls))},null,8,["modelValue","disabled","max","class"])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(m),"current"),o.paginationCurrentCls))},e.toDisplayString(e.unref(i)),3)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(m),"count"),o.paginationCountCls))},[t[2]||(t[2]=e.createElementVNode("div",null,"/",-1)),e.createElementVNode("div",null,e.toDisplayString(r.value),1)],2)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(O.value,(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:a.value??a.type},[a.type==="page"?(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:0,onClick:c=>j(a),class:e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(s),"item"),n.itemCls)},{ref_for:!0},A(a),{disabled:e.unref(d)}),e.toDisplayString(a.value),17,K)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(s),"item"),n.itemCls))},[e.createVNode(H._sfc_main,{size:"12px",icon:"tabler:dots"})],2))],64))),128)),n.hideNext?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(N._sfc_main,{key:3,size:"sm",type:"ghost",variant:o.iconButton?"icon":"simple",postIcon:"tabler:chevron-right",icon:"tabler:chevron-right",postIconFlipOnDir:"rtl",disabled:e.unref(d)??!!(e.unref(i)&&e.unref(i)>=r.value),onClick:R},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.nextText),1)]),_:1},8,["variant","disabled"]))],2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(s),"pageSize"),o.sizeCls))},[n.hideSize?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($._sfc_main,{key:0,options:_.value,size:"sm",modelValue:V.value,"onUpdate:modelValue":t[1]||(t[1]=a=>V.value=a),disabled:e.unref(d)},null,8,["options","modelValue","disabled"])),!n.hideTotal&&!n.hideSize?(e.openBlock(),e.createBlock(U._sfc_main,{key:1,type:"vertical",class:e.normalizeClass(e.unref(l.getBemElement)(e.unref(s),"divider"))},null,8,["class"])):e.createCommentVNode("",!0),n.hideTotal?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(l.normCls)(e.unref(l.getBemElement)(e.unref(s),"total"),o.totalCls))},[e.renderSlot(n.$slots,"total",e.normalizeProps(e.guardReactiveProps(F.value)))],2))],2)],2))}}),Q=k.installComponent(S,l.getComponentName("Pagination"));exports.Pagination=S;exports.PaginationJustifies=I;exports.PaginationPlugin=Q;exports.default=S;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IconProps } from '../Icon';
|
|
2
|
+
import { StepStatus } from './Steps.model';
|
|
3
|
+
import { ClassValue } from 'class-variance-authority/types';
|
|
4
|
+
export interface StepItemProps extends IconProps {
|
|
5
|
+
index?: number;
|
|
6
|
+
status?: StepStatus;
|
|
7
|
+
number?: number | string;
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
containerCls?: ClassValue;
|
|
11
|
+
contentCls?: ClassValue;
|
|
12
|
+
titleCls?: ClassValue;
|
|
13
|
+
descriptionCls?: ClassValue;
|
|
14
|
+
iconCls?: ClassValue;
|
|
15
|
+
numberCls?: ClassValue;
|
|
16
|
+
leadingCls?: ClassValue;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface StepItemSlots {
|
|
20
|
+
title?: (params?: object) => any;
|
|
21
|
+
description?: (params?: object) => any;
|
|
22
|
+
leading?: (params?: object) => any;
|
|
23
|
+
icon?: (params?: object) => any;
|
|
24
|
+
}
|
|
25
|
+
export interface StepItemEmits {
|
|
26
|
+
(e: 'click'): void;
|
|
27
|
+
}
|
|
28
|
+
export interface StepItemContext {
|
|
29
|
+
props: StepItemProps;
|
|
30
|
+
slots: StepItemSlots;
|
|
31
|
+
}
|
|
32
|
+
export declare const injectStepContext: <T extends StepItemContext | null | undefined = StepItemContext>(fallback?: T | undefined) => T extends null ? StepItemContext | null : StepItemContext, provideStepContext: (contextValue: StepItemContext) => StepItemContext;
|
|
33
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<StepItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
34
|
+
click: () => any;
|
|
35
|
+
}, string, import('vue').PublicProps, Readonly<StepItemProps> & Readonly<{
|
|
36
|
+
onClick?: (() => any) | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
status: StepStatus;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<StepItemSlots> & StepItemSlots>;
|
|
40
|
+
export default _default;
|
|
41
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
42
|
+
new (): {
|
|
43
|
+
$slots: S;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ClassValue } from 'class-variance-authority/types';
|
|
2
|
+
import { StepLeadingType } from './Steps.model';
|
|
3
|
+
import { StepItemProps } from './Step';
|
|
4
|
+
export type StepItem = Omit<StepItemProps, 'index' | 'status' | 'number'> & {
|
|
5
|
+
error?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface StepsProps {
|
|
8
|
+
items?: StepItem[];
|
|
9
|
+
modelValue?: number;
|
|
10
|
+
vertical?: boolean;
|
|
11
|
+
class?: ClassValue;
|
|
12
|
+
leadingType?: StepLeadingType;
|
|
13
|
+
}
|
|
14
|
+
export interface StepsEmits {
|
|
15
|
+
(e: 'update:modelValue', value?: number): void;
|
|
16
|
+
(e: 'change', value?: number): void;
|
|
17
|
+
}
|
|
18
|
+
export interface StepsSlots {
|
|
19
|
+
default?: (params?: {
|
|
20
|
+
items: StepItem[];
|
|
21
|
+
}) => never;
|
|
22
|
+
item?: (item: StepItemProps) => never;
|
|
23
|
+
leading?: (item: StepItemProps) => never;
|
|
24
|
+
title?: (item: StepItemProps) => never;
|
|
25
|
+
description?: (item: StepItemProps) => never;
|
|
26
|
+
icon?: (item: StepItemProps) => never;
|
|
27
|
+
}
|
|
28
|
+
export declare const stepsPrefix: string;
|
|
29
|
+
export declare const stepPrefix: string;
|
|
30
|
+
export interface StepsContext {
|
|
31
|
+
props: StepsProps;
|
|
32
|
+
}
|
|
33
|
+
export declare const injectStepsContext: <T extends StepsContext | null | undefined = StepsContext>(fallback?: T | undefined) => T extends null ? StepsContext | null : StepsContext, provideStepsContext: (contextValue: StepsContext) => StepsContext;
|
|
34
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<StepsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
35
|
+
change: (value?: number | undefined) => any;
|
|
36
|
+
"update:modelValue": (value?: number | undefined) => any;
|
|
37
|
+
}, string, import('vue').PublicProps, Readonly<StepsProps> & Readonly<{
|
|
38
|
+
onChange?: ((value?: number | undefined) => any) | undefined;
|
|
39
|
+
"onUpdate:modelValue"?: ((value?: number | undefined) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
modelValue: number;
|
|
42
|
+
items: StepItem[];
|
|
43
|
+
leadingType: StepLeadingType;
|
|
44
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<StepsSlots> & StepsSlots>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
package/dist/Steps/index.d.ts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const StepsPlugin: import('vue').Plugin;
|
|
2
|
+
export declare const StepPlugin: import('vue').Plugin;
|
|
3
|
+
export { default as Steps, default, stepsPrefix, stepPrefix, injectStepsContext, provideStepsContext, type StepItem, type StepsContext, type StepsEmits, type StepsProps, type StepsSlots, } from './Steps';
|
|
4
|
+
export { default as Step, injectStepContext, provideStepContext, type StepItemProps, type StepItemContext, type StepItemEmits, type StepItemSlots, } from './Step';
|
|
5
|
+
export * from './Steps.model';
|
package/dist/Steps/index.js
CHANGED
|
@@ -1 +1,247 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as $, createBlock as V, openBlock as y, h as b, useSlots as w, unref as l, normalizeClass as h, withCtx as C, createElementVNode as D, createVNode as k, computed as M, normalizeStyle as O, renderSlot as v, normalizeProps as U, guardReactiveProps as X, createElementBlock as Y, Fragment as q, renderList as A, mergeProps as S } from "vue";
|
|
2
|
+
import { cva as x } from "class-variance-authority";
|
|
3
|
+
import { getComponentOptions as T, getBemElement as m, isEmptyLikeLodash as H, normCls as d, getBemModifier as J, generateVariantClassList as I, getBemBlock as K, getValidNumber as Q, getComponentName as F } from "@pantograph/utils";
|
|
4
|
+
import { isEmptyElement as B, useVModel as W, installComponent as G } from "@pantograph/utils-vue";
|
|
5
|
+
import { _ as Z } from "../Icon.vue_vue_type_style_index_0_lang-CD9EvvB5.js";
|
|
6
|
+
import { omit as ee } from "es-toolkit";
|
|
7
|
+
import { createContext as R, RovingFocusItem as te, RovingFocusGroup as se } from "reka-ui";
|
|
8
|
+
const oe = ["completed", "current", "upcoming", "error"], Se = ["number", "icon"], ne = /* @__PURE__ */ $({
|
|
9
|
+
...T("StepLeading"),
|
|
10
|
+
__name: "StepLeading",
|
|
11
|
+
setup(_) {
|
|
12
|
+
const r = re(), o = m(u, "leading"), a = () => {
|
|
13
|
+
if (r.props.icon) return r.props.icon;
|
|
14
|
+
switch (r.props.status) {
|
|
15
|
+
case "current":
|
|
16
|
+
return "tabler:progress";
|
|
17
|
+
case "upcoming":
|
|
18
|
+
return "tabler:circle-dashed";
|
|
19
|
+
case "error":
|
|
20
|
+
return "tabler:progress-alert";
|
|
21
|
+
case "completed":
|
|
22
|
+
return "tabler:circle-check-filled";
|
|
23
|
+
}
|
|
24
|
+
}, c = () => {
|
|
25
|
+
var L, z, E, N;
|
|
26
|
+
const f = (z = (L = r.slots).leading) == null ? void 0 : z.call(L, {}), p = !B(f), g = () => b(
|
|
27
|
+
"div",
|
|
28
|
+
{ class: d(m(o, "number"), r.props.numberCls) },
|
|
29
|
+
p ? f : r.props.number
|
|
30
|
+
), s = a(), i = (N = (E = r.slots).icon) == null ? void 0 : N.call(E, {});
|
|
31
|
+
let e = !1;
|
|
32
|
+
const t = () => (e = !0, b(
|
|
33
|
+
Z,
|
|
34
|
+
{
|
|
35
|
+
...ee(r.props, ["status", "number", "iconCls", "numberCls"]),
|
|
36
|
+
icon: s,
|
|
37
|
+
size: "xsm",
|
|
38
|
+
class: d(r.props.iconCls)
|
|
39
|
+
},
|
|
40
|
+
() => i
|
|
41
|
+
));
|
|
42
|
+
let n;
|
|
43
|
+
return p ? n = g() : !B(i) || r.props.icon || H(r.props.number) ? n = t() : n = g(), b(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
class: d(o, r.props.leadingCls, {
|
|
47
|
+
[J(o, "icon")]: e
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
n
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
return (f, p) => (y(), V(c));
|
|
54
|
+
}
|
|
55
|
+
}), [re, ie] = R("Step"), j = /* @__PURE__ */ $({
|
|
56
|
+
...T("Step"),
|
|
57
|
+
__name: "Step",
|
|
58
|
+
props: {
|
|
59
|
+
index: {},
|
|
60
|
+
status: { default: "upcoming" },
|
|
61
|
+
number: {},
|
|
62
|
+
title: {},
|
|
63
|
+
description: {},
|
|
64
|
+
containerCls: {},
|
|
65
|
+
contentCls: {},
|
|
66
|
+
titleCls: {},
|
|
67
|
+
descriptionCls: {},
|
|
68
|
+
iconCls: {},
|
|
69
|
+
numberCls: {},
|
|
70
|
+
leadingCls: {},
|
|
71
|
+
disabled: { type: Boolean },
|
|
72
|
+
size: {},
|
|
73
|
+
class: {},
|
|
74
|
+
icon: {},
|
|
75
|
+
flipOnDir: {},
|
|
76
|
+
customStroke: { type: Boolean },
|
|
77
|
+
flipX: { type: Boolean },
|
|
78
|
+
flipY: { type: Boolean }
|
|
79
|
+
},
|
|
80
|
+
emits: ["click"],
|
|
81
|
+
setup(_, { emit: r }) {
|
|
82
|
+
const o = _, a = w(), c = x(u, {
|
|
83
|
+
variants: {
|
|
84
|
+
status: I(oe, u),
|
|
85
|
+
vertical: I("vertical", u)
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
ie({
|
|
89
|
+
props: o,
|
|
90
|
+
slots: a
|
|
91
|
+
});
|
|
92
|
+
const f = le(), p = (e) => {
|
|
93
|
+
o.disabled && (e.preventDefault(), e.stopPropagation());
|
|
94
|
+
}, g = () => {
|
|
95
|
+
var n;
|
|
96
|
+
let e;
|
|
97
|
+
const t = (n = a.title) == null ? void 0 : n.call(a, {});
|
|
98
|
+
if (B(t) ? e = o.title : e = t, e)
|
|
99
|
+
return b("div", { class: d(m(u, "title"), o.titleCls) }, e);
|
|
100
|
+
}, s = () => {
|
|
101
|
+
var n;
|
|
102
|
+
let e;
|
|
103
|
+
const t = (n = a.description) == null ? void 0 : n.call(a, {});
|
|
104
|
+
if (B(t) ? e = o.description : e = t, e)
|
|
105
|
+
return b(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
class: d(m(u, "description"), "paragraph", o.descriptionCls)
|
|
109
|
+
},
|
|
110
|
+
e
|
|
111
|
+
);
|
|
112
|
+
}, i = () => {
|
|
113
|
+
const e = g(), t = s();
|
|
114
|
+
if (e || t)
|
|
115
|
+
return b("div", { class: d(m(u, "content"), o.contentCls) }, [
|
|
116
|
+
e,
|
|
117
|
+
t
|
|
118
|
+
]);
|
|
119
|
+
};
|
|
120
|
+
return (e, t) => {
|
|
121
|
+
var n;
|
|
122
|
+
return y(), V(l(te), {
|
|
123
|
+
as: "button",
|
|
124
|
+
tabStopId: (n = e.index) == null ? void 0 : n.toString(),
|
|
125
|
+
onPointerdown: p,
|
|
126
|
+
disabled: e.disabled,
|
|
127
|
+
class: h(
|
|
128
|
+
l(d)(
|
|
129
|
+
l(c)({
|
|
130
|
+
status: e.status,
|
|
131
|
+
vertical: l(f).props.vertical
|
|
132
|
+
}),
|
|
133
|
+
o.class
|
|
134
|
+
)
|
|
135
|
+
)
|
|
136
|
+
}, {
|
|
137
|
+
default: C(() => [
|
|
138
|
+
D("div", {
|
|
139
|
+
class: h(l(m)(l(u), "line"))
|
|
140
|
+
}, null, 2),
|
|
141
|
+
D("div", {
|
|
142
|
+
class: h(l(d)(l(m)(l(u), "container"), e.containerCls))
|
|
143
|
+
}, [
|
|
144
|
+
k(ne),
|
|
145
|
+
k(i)
|
|
146
|
+
], 2)
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 8, ["tabStopId", "disabled", "class"]);
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}), P = K("steps"), u = m(P, "step"), [le, ae] = R("Steps"), ce = /* @__PURE__ */ $({
|
|
153
|
+
...T("Steps"),
|
|
154
|
+
__name: "Steps",
|
|
155
|
+
props: {
|
|
156
|
+
items: { default: () => [] },
|
|
157
|
+
modelValue: { default: 0 },
|
|
158
|
+
vertical: { type: Boolean },
|
|
159
|
+
class: {},
|
|
160
|
+
leadingType: { default: "icon" }
|
|
161
|
+
},
|
|
162
|
+
emits: ["update:modelValue", "change"],
|
|
163
|
+
setup(_, { emit: r }) {
|
|
164
|
+
const o = _, a = r;
|
|
165
|
+
w();
|
|
166
|
+
const c = W(o, "modelValue", a, {
|
|
167
|
+
onChange: (s) => {
|
|
168
|
+
a("change", s);
|
|
169
|
+
},
|
|
170
|
+
defaultValue: 0
|
|
171
|
+
}), f = x(P, {
|
|
172
|
+
variants: {
|
|
173
|
+
vertical: I("vertical", P)
|
|
174
|
+
}
|
|
175
|
+
}), p = M(() => {
|
|
176
|
+
var s;
|
|
177
|
+
return ((s = o.items) == null ? void 0 : s.map((i, e) => {
|
|
178
|
+
const t = e < c.value ? "completed" : e === c.value ? "current" : "upcoming", n = i.error ? "error" : t;
|
|
179
|
+
return {
|
|
180
|
+
...i,
|
|
181
|
+
"data-completed": t === "completed" ? "" : void 0,
|
|
182
|
+
status: n,
|
|
183
|
+
index: e,
|
|
184
|
+
number: o.leadingType === "number" ? e + 1 : void 0,
|
|
185
|
+
disabled: i.disabled ? i.disabled : e > c.value + 1
|
|
186
|
+
};
|
|
187
|
+
})) ?? [];
|
|
188
|
+
}), g = (s) => {
|
|
189
|
+
const i = Q(s);
|
|
190
|
+
i !== void 0 && i !== c.value && (c.value = i);
|
|
191
|
+
};
|
|
192
|
+
return ae({ props: o }), (s, i) => {
|
|
193
|
+
var e;
|
|
194
|
+
return y(), V(l(se), {
|
|
195
|
+
as: "div",
|
|
196
|
+
style: O({
|
|
197
|
+
gridTemplateColumns: s.vertical ? "repeat(1, minmax(0, 1fr))" : `repeat(${p.value.length}, minmax(0, 1fr))`
|
|
198
|
+
}),
|
|
199
|
+
orientation: s.vertical ? "vertical" : "horizontal",
|
|
200
|
+
currentTabStopId: (e = l(c)) == null ? void 0 : e.toString(),
|
|
201
|
+
"onUpdate:currentTabStopId": g,
|
|
202
|
+
class: h(l(d)(l(f)({ vertical: s.vertical }), o.class))
|
|
203
|
+
}, {
|
|
204
|
+
default: C(() => [
|
|
205
|
+
v(s.$slots, "default", U(X({ items: p.value })), () => [
|
|
206
|
+
(y(!0), Y(q, null, A(p.value, (t, n) => v(s.$slots, "item", S({
|
|
207
|
+
key: n,
|
|
208
|
+
ref_for: !0
|
|
209
|
+
}, t), () => [
|
|
210
|
+
k(j, S({ ref_for: !0 }, t), {
|
|
211
|
+
leading: C(() => [
|
|
212
|
+
v(s.$slots, "leading", S({ ref_for: !0 }, t))
|
|
213
|
+
]),
|
|
214
|
+
title: C(() => [
|
|
215
|
+
v(s.$slots, "title", S({ ref_for: !0 }, t))
|
|
216
|
+
]),
|
|
217
|
+
description: C(() => [
|
|
218
|
+
v(s.$slots, "description", S({ ref_for: !0 }, t))
|
|
219
|
+
]),
|
|
220
|
+
icon: C(() => [
|
|
221
|
+
v(s.$slots, "icon", S({ ref_for: !0 }, t))
|
|
222
|
+
]),
|
|
223
|
+
_: 2
|
|
224
|
+
}, 1040)
|
|
225
|
+
])), 128))
|
|
226
|
+
])
|
|
227
|
+
]),
|
|
228
|
+
_: 3
|
|
229
|
+
}, 8, ["style", "orientation", "currentTabStopId", "class"]);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}), Ce = G(ce, F("Steps")), be = G(j, F("Step"));
|
|
233
|
+
export {
|
|
234
|
+
j as Step,
|
|
235
|
+
Se as StepLeadingTypes,
|
|
236
|
+
be as StepPlugin,
|
|
237
|
+
oe as StepStatuses,
|
|
238
|
+
ce as Steps,
|
|
239
|
+
Ce as StepsPlugin,
|
|
240
|
+
ce as default,
|
|
241
|
+
re as injectStepContext,
|
|
242
|
+
le as injectStepsContext,
|
|
243
|
+
ie as provideStepContext,
|
|
244
|
+
ae as provideStepsContext,
|
|
245
|
+
u as stepPrefix,
|
|
246
|
+
P as stepsPrefix
|
|
247
|
+
};
|
package/dist/Steps/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),P=require("class-variance-authority"),n=require("@pantograph/utils"),f=require("@pantograph/utils-vue"),L=require("../Icon.vue_vue_type_style_index_0_lang-DOQsa_aO.js"),z=require("es-toolkit"),v=require("reka-ui"),k=["completed","current","upcoming","error"],N=["number","icon"],$=e.defineComponent({...n.getComponentOptions("StepLeading"),__name:"StepLeading",setup(C){const i=V(),r=n.getBemElement(u,"leading"),c=()=>{if(i.props.icon)return i.props.icon;switch(i.props.status){case"current":return"tabler:progress";case"upcoming":return"tabler:circle-dashed";case"error":return"tabler:progress-alert";case"completed":return"tabler:circle-check-filled"}},p=()=>{var _,B,y,E;const d=(B=(_=i.slots).leading)==null?void 0:B.call(_,{}),m=!f.isEmptyElement(d),g=()=>e.h("div",{class:n.normCls(n.getBemElement(r,"number"),i.props.numberCls)},m?d:i.props.number),o=c(),a=(E=(y=i.slots).icon)==null?void 0:E.call(y,{});let t=!1;const s=()=>(t=!0,e.h(L._sfc_main,{...z.omit(i.props,["status","number","iconCls","numberCls"]),icon:o,size:"xsm",class:n.normCls(i.props.iconCls)},()=>a));let l;return m?l=g():!f.isEmptyElement(a)||i.props.icon||n.isEmptyLikeLodash(i.props.number)?l=s():l=g(),e.h("div",{class:n.normCls(r,i.props.leadingCls,{[n.getBemModifier(r,"icon")]:t})},l)};return(d,m)=>(e.openBlock(),e.createBlock(p))}}),[V,x]=v.createContext("Step"),b=e.defineComponent({...n.getComponentOptions("Step"),__name:"Step",props:{index:{},status:{default:"upcoming"},number:{},title:{},description:{},containerCls:{},contentCls:{},titleCls:{},descriptionCls:{},iconCls:{},numberCls:{},leadingCls:{},disabled:{type:Boolean},size:{},class:{},icon:{},flipOnDir:{},customStroke:{type:Boolean},flipX:{type:Boolean},flipY:{type:Boolean}},emits:["click"],setup(C,{emit:i}){const r=C,c=e.useSlots(),p=P.cva(u,{variants:{status:n.generateVariantClassList(k,u),vertical:n.generateVariantClassList("vertical",u)}});x({props:r,slots:c});const d=I(),m=t=>{r.disabled&&(t.preventDefault(),t.stopPropagation())},g=()=>{var l;let t;const s=(l=c.title)==null?void 0:l.call(c,{});if(f.isEmptyElement(s)?t=r.title:t=s,t)return e.h("div",{class:n.normCls(n.getBemElement(u,"title"),r.titleCls)},t)},o=()=>{var l;let t;const s=(l=c.description)==null?void 0:l.call(c,{});if(f.isEmptyElement(s)?t=r.description:t=s,t)return e.h("div",{class:n.normCls(n.getBemElement(u,"description"),"paragraph",r.descriptionCls)},t)},a=()=>{const t=g(),s=o();if(t||s)return e.h("div",{class:n.normCls(n.getBemElement(u,"content"),r.contentCls)},[t,s])};return(t,s)=>{var l;return e.openBlock(),e.createBlock(e.unref(v.RovingFocusItem),{as:"button",tabStopId:(l=t.index)==null?void 0:l.toString(),onPointerdown:m,disabled:t.disabled,class:e.normalizeClass(e.unref(n.normCls)(e.unref(p)({status:t.status,vertical:e.unref(d).props.vertical}),r.class))},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.getBemElement)(e.unref(u),"line"))},null,2),e.createElementVNode("div",{class:e.normalizeClass(e.unref(n.normCls)(e.unref(n.getBemElement)(e.unref(u),"container"),t.containerCls))},[e.createVNode($),e.createVNode(a)],2)]),_:1},8,["tabStopId","disabled","class"])}}}),S=n.getBemBlock("steps"),u=n.getBemElement(S,"step"),[I,T]=v.createContext("Steps"),h=e.defineComponent({...n.getComponentOptions("Steps"),__name:"Steps",props:{items:{default:()=>[]},modelValue:{default:0},vertical:{type:Boolean},class:{},leadingType:{default:"icon"}},emits:["update:modelValue","change"],setup(C,{emit:i}){const r=C,c=i;e.useSlots();const p=f.useVModel(r,"modelValue",c,{onChange:o=>{c("change",o)},defaultValue:0}),d=P.cva(S,{variants:{vertical:n.generateVariantClassList("vertical",S)}}),m=e.computed(()=>{var o;return((o=r.items)==null?void 0:o.map((a,t)=>{const s=t<p.value?"completed":t===p.value?"current":"upcoming",l=a.error?"error":s;return{...a,"data-completed":s==="completed"?"":void 0,status:l,index:t,number:r.leadingType==="number"?t+1:void 0,disabled:a.disabled?a.disabled:t>p.value+1}}))??[]}),g=o=>{const a=n.getValidNumber(o);a!==void 0&&a!==p.value&&(p.value=a)};return T({props:r}),(o,a)=>{var t;return e.openBlock(),e.createBlock(e.unref(v.RovingFocusGroup),{as:"div",style:e.normalizeStyle({gridTemplateColumns:o.vertical?"repeat(1, minmax(0, 1fr))":`repeat(${m.value.length}, minmax(0, 1fr))`}),orientation:o.vertical?"vertical":"horizontal",currentTabStopId:(t=e.unref(p))==null?void 0:t.toString(),"onUpdate:currentTabStopId":g,class:e.normalizeClass(e.unref(n.normCls)(e.unref(d)({vertical:o.vertical}),r.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default",e.normalizeProps(e.guardReactiveProps({items:m.value})),()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(s,l)=>e.renderSlot(o.$slots,"item",e.mergeProps({key:l,ref_for:!0},s),()=>[e.createVNode(b,e.mergeProps({ref_for:!0},s),{leading:e.withCtx(()=>[e.renderSlot(o.$slots,"leading",e.mergeProps({ref_for:!0},s))]),title:e.withCtx(()=>[e.renderSlot(o.$slots,"title",e.mergeProps({ref_for:!0},s))]),description:e.withCtx(()=>[e.renderSlot(o.$slots,"description",e.mergeProps({ref_for:!0},s))]),icon:e.withCtx(()=>[e.renderSlot(o.$slots,"icon",e.mergeProps({ref_for:!0},s))]),_:2},1040)])),128))])]),_:3},8,["style","orientation","currentTabStopId","class"])}}}),w=f.installComponent(h,n.getComponentName("Steps")),q=f.installComponent(b,n.getComponentName("Step"));exports.Step=b;exports.StepLeadingTypes=N;exports.StepPlugin=q;exports.StepStatuses=k;exports.Steps=h;exports.StepsPlugin=w;exports.default=h;exports.injectStepContext=V;exports.injectStepsContext=I;exports.provideStepContext=x;exports.provideStepsContext=T;exports.stepPrefix=u;exports.stepsPrefix=S;
|