@studio-west/component-sw 1.0.3 → 1.0.5
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/README.md +284 -76
- package/dist/{SwAffix-C-WH1AXb.js → SwAffix-DQctfUrW.js} +45 -18
- package/dist/{SwBackTop-DmChxDF3.js → SwBackTop-C2evKTw6.js} +13 -8
- package/dist/SwBreadcrumb-BhK5ikm_.js +47 -0
- package/dist/SwDrawer-BOufiYl-.js +116 -0
- package/dist/SwEmpty-Bcga9O61.js +35 -0
- package/dist/SwProgress-DeUCmFKn.js +95 -0
- package/dist/SwRate-CL9lWRld.js +104 -0
- package/dist/SwSegmented-FmTR7s71.js +74 -0
- package/dist/{SwSwitch-Cxk-eNTf.js → SwSwitch-D7fUgARl.js} +9 -3
- package/dist/component-sw.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +9 -4
- package/package.json +5 -1
- package/types/index.d.ts +77 -1
- package/dist/SwDrawer-CE-pDRBB.js +0 -86
package/types/index.d.ts
CHANGED
|
@@ -115,12 +115,15 @@ export interface SwDadataProps {
|
|
|
115
115
|
export interface SwDrawerProps {
|
|
116
116
|
class?: string
|
|
117
117
|
title?: string
|
|
118
|
-
placement?: 'left' | 'right'
|
|
118
|
+
placement?: 'left' | 'right' | 'top' | 'bottom'
|
|
119
119
|
size?: string
|
|
120
120
|
after?: string
|
|
121
121
|
iconAfter?: string
|
|
122
122
|
modal?: boolean
|
|
123
123
|
closeOnClickModal?: boolean
|
|
124
|
+
tab?: boolean
|
|
125
|
+
tabLabel?: string
|
|
126
|
+
tabBefore?: string
|
|
124
127
|
}
|
|
125
128
|
|
|
126
129
|
export interface SwBackTopProps {
|
|
@@ -128,6 +131,7 @@ export interface SwBackTopProps {
|
|
|
128
131
|
visibilityHeight?: number
|
|
129
132
|
right?: string
|
|
130
133
|
bottom?: string
|
|
134
|
+
target?: string | HTMLElement
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
export interface SwAffixProps {
|
|
@@ -136,6 +140,7 @@ export interface SwAffixProps {
|
|
|
136
140
|
offsetBottom?: number
|
|
137
141
|
boundary?: string
|
|
138
142
|
boundaryEdge?: 'top' | 'bottom'
|
|
143
|
+
target?: string | HTMLElement
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
export interface SwTagProps {
|
|
@@ -172,6 +177,67 @@ export interface SwPaginationProps {
|
|
|
172
177
|
modelValue?: number
|
|
173
178
|
}
|
|
174
179
|
|
|
180
|
+
export interface SwProgressProps {
|
|
181
|
+
class?: string
|
|
182
|
+
percentage?: number
|
|
183
|
+
type?: 'primary' | 'success' | 'info' | 'warning' | 'danger' | ''
|
|
184
|
+
circle?: boolean
|
|
185
|
+
width?: number
|
|
186
|
+
strokeWidth?: number
|
|
187
|
+
showText?: boolean
|
|
188
|
+
text?: string
|
|
189
|
+
indeterminate?: boolean
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface SwEmptyProps {
|
|
193
|
+
class?: string
|
|
194
|
+
description?: string
|
|
195
|
+
before?: string
|
|
196
|
+
imageSize?: number
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface SwBreadcrumbItem {
|
|
200
|
+
label: string
|
|
201
|
+
href?: string
|
|
202
|
+
disabled?: boolean
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export interface SwBreadcrumbProps {
|
|
206
|
+
class?: string
|
|
207
|
+
items?: SwBreadcrumbItem[]
|
|
208
|
+
separator?: string
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface SwRateProps {
|
|
212
|
+
class?: string
|
|
213
|
+
modelValue?: number
|
|
214
|
+
max?: number
|
|
215
|
+
allowHalf?: boolean
|
|
216
|
+
disabled?: boolean
|
|
217
|
+
readonly?: boolean
|
|
218
|
+
clearable?: boolean
|
|
219
|
+
showScore?: boolean
|
|
220
|
+
size?: 'large' | 'small' | ''
|
|
221
|
+
voidIcon?: string
|
|
222
|
+
icon?: string
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface SwSegmentedOption {
|
|
226
|
+
label: string
|
|
227
|
+
value: string | number
|
|
228
|
+
disabled?: boolean
|
|
229
|
+
before?: string
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface SwSegmentedProps {
|
|
233
|
+
class?: string
|
|
234
|
+
modelValue?: string | number
|
|
235
|
+
options?: SwSegmentedOption[]
|
|
236
|
+
size?: 'large' | 'small' | ''
|
|
237
|
+
disabled?: boolean
|
|
238
|
+
block?: boolean
|
|
239
|
+
}
|
|
240
|
+
|
|
175
241
|
export interface SwMenuProps {
|
|
176
242
|
menuItems: Record<string, any> | Array<{ [componentName: string]: any }>
|
|
177
243
|
class?: string
|
|
@@ -206,6 +272,11 @@ export type SwAffix = DefineComponent<SwAffixProps>
|
|
|
206
272
|
export type SwTag = DefineComponent<SwTagProps>
|
|
207
273
|
export type SwBadge = DefineComponent<SwBadgeProps>
|
|
208
274
|
export type SwPagination = DefineComponent<SwPaginationProps>
|
|
275
|
+
export type SwProgress = DefineComponent<SwProgressProps>
|
|
276
|
+
export type SwEmpty = DefineComponent<SwEmptyProps>
|
|
277
|
+
export type SwBreadcrumb = DefineComponent<SwBreadcrumbProps>
|
|
278
|
+
export type SwRate = DefineComponent<SwRateProps>
|
|
279
|
+
export type SwSegmented = DefineComponent<SwSegmentedProps>
|
|
209
280
|
export type SwMenu = DefineComponent<SwMenuProps>
|
|
210
281
|
export type SwFile = DefineComponent<SwFileProps>
|
|
211
282
|
|
|
@@ -223,6 +294,11 @@ declare module 'vue' {
|
|
|
223
294
|
SwTag: SwTag
|
|
224
295
|
SwBadge: SwBadge
|
|
225
296
|
SwPagination: SwPagination
|
|
297
|
+
SwProgress: SwProgress
|
|
298
|
+
SwEmpty: SwEmpty
|
|
299
|
+
SwBreadcrumb: SwBreadcrumb
|
|
300
|
+
SwRate: SwRate
|
|
301
|
+
SwSegmented: SwSegmented
|
|
226
302
|
// Add other components as needed
|
|
227
303
|
SwAlert: DefineComponent
|
|
228
304
|
SwButtonGroup: DefineComponent
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./SwIcon-BbL8Tu2z.js";
|
|
2
|
-
import { t } from "./SwButton-XAFVTlsb.js";
|
|
3
|
-
import { Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, nextTick as p, normalizeClass as m, normalizeStyle as h, onUnmounted as g, openBlock as _, ref as v, renderSlot as y, toDisplayString as b, unref as x, useModel as S, useSlots as C, watch as w, withCtx as T, withModifiers as E } from "vue";
|
|
4
|
-
//#region src/components/SwDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var D = { key: 0 }, O = { class: "sw-drawer-body" }, k = { key: 1 }, A = 250, j = /* @__PURE__ */ d({
|
|
6
|
-
__name: "SwDrawer",
|
|
7
|
-
props: /*@__PURE__*/ f({
|
|
8
|
-
class: { default: "" },
|
|
9
|
-
title: { default: "" },
|
|
10
|
-
placement: { default: "right" },
|
|
11
|
-
size: { default: "30%" },
|
|
12
|
-
after: { default: "" },
|
|
13
|
-
iconAfter: { default: "" },
|
|
14
|
-
modal: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: !1
|
|
17
|
-
},
|
|
18
|
-
closeOnClickModal: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: !0
|
|
21
|
-
}
|
|
22
|
-
}, {
|
|
23
|
-
modelValue: {
|
|
24
|
-
type: Boolean,
|
|
25
|
-
default: !1
|
|
26
|
-
},
|
|
27
|
-
modelModifiers: {}
|
|
28
|
-
}),
|
|
29
|
-
emits: /*@__PURE__*/ f(["close"], ["update:modelValue"]),
|
|
30
|
-
setup(d, { emit: f }) {
|
|
31
|
-
let j = S(d, "modelValue"), M = d, N = f, P = C(), F = v(""), I = i(() => M.after || M.iconAfter), L = () => {
|
|
32
|
-
typeof document > "u" || (F.value = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
33
|
-
}, R = () => {
|
|
34
|
-
typeof document > "u" || (document.body.style.overflow = F.value);
|
|
35
|
-
}, z = () => {
|
|
36
|
-
j.value = !1, N("close");
|
|
37
|
-
}, B = () => {
|
|
38
|
-
M.closeOnClickModal && z();
|
|
39
|
-
}, V = (e) => {
|
|
40
|
-
e.key === "Escape" && j.value && z();
|
|
41
|
-
};
|
|
42
|
-
w(() => j.value, (e) => {
|
|
43
|
-
typeof window > "u" || (e ? (L(), p(() => window.addEventListener("keydown", V))) : window.removeEventListener("keydown", V));
|
|
44
|
-
});
|
|
45
|
-
let H = () => {
|
|
46
|
-
R();
|
|
47
|
-
};
|
|
48
|
-
return g(() => {
|
|
49
|
-
R(), typeof window < "u" && window.removeEventListener("keydown", V);
|
|
50
|
-
}), (i, f) => (_(), a(n, { to: "body" }, [u(r, {
|
|
51
|
-
name: "sw-drawer",
|
|
52
|
-
appear: "",
|
|
53
|
-
duration: {
|
|
54
|
-
enter: A,
|
|
55
|
-
leave: A
|
|
56
|
-
},
|
|
57
|
-
onAfterLeave: H
|
|
58
|
-
}, {
|
|
59
|
-
default: T(() => [j.value ? (_(), s("div", {
|
|
60
|
-
key: 0,
|
|
61
|
-
class: m(["sw-drawer-mask", [M.class, { "is-modal": d.modal }]]),
|
|
62
|
-
onClick: E(B, ["self"])
|
|
63
|
-
}, [c("aside", {
|
|
64
|
-
class: m(["sw-drawer", [`is-${d.placement}`]]),
|
|
65
|
-
style: h({ width: d.size }),
|
|
66
|
-
role: "dialog",
|
|
67
|
-
"aria-modal": "true"
|
|
68
|
-
}, [
|
|
69
|
-
d.title || x(P).header || I.value ? (_(), s("header", D, [y(i.$slots, "header", {}, () => [l(b(d.title), 1)]), I.value ? (_(), a(t, {
|
|
70
|
-
key: 0,
|
|
71
|
-
link: "",
|
|
72
|
-
type: "primary",
|
|
73
|
-
onClick: z
|
|
74
|
-
}, {
|
|
75
|
-
default: T(() => [u(e, { "icon-class": I.value }, null, 8, ["icon-class"])]),
|
|
76
|
-
_: 1
|
|
77
|
-
})) : o("", !0)])) : o("", !0),
|
|
78
|
-
c("div", O, [y(i.$slots, "default")]),
|
|
79
|
-
x(P).footer ? (_(), s("footer", k, [y(i.$slots, "footer")])) : o("", !0)
|
|
80
|
-
], 6)], 2)) : o("", !0)]),
|
|
81
|
-
_: 3
|
|
82
|
-
}, 8, ["duration"])]));
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
//#endregion
|
|
86
|
-
export { j as default };
|