@soft-stech/bootsman-ui-shadcn 2.0.14 → 2.0.16
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/{BuiTableHeader.vue_vue_type_script_setup_true_lang-B6wyr0bg.js → BuiTableHeader.vue_vue_type_script_setup_true_lang-Di2FKUwD.js} +10 -12
- package/dist/components/input/BuiInput.vue.d.ts +3 -1
- package/dist/components/input/BuiPasswordInput.vue.d.ts +2 -0
- package/dist/components/input/index.js +151 -98
- package/dist/components/table/BuiTableHeader.js +1 -1
- package/dist/components/table/index.js +133 -128
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/input/BuiInput.vue +41 -1
- package/src/components/input/BuiPasswordInput.vue +15 -6
- package/src/components/table/BuiDataTable.vue +53 -49
- package/src/components/table/BuiTableHeader.vue +1 -3
- package/src/stories/BuiInput.stories.ts +20 -0
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { g as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as s, ref as a, createElementBlock as i, openBlock as o, normalizeClass as c, unref as n, renderSlot as h } from "vue";
|
|
2
|
+
import { g as p } from "./utils-DhVytAXN.js";
|
|
3
|
+
const v = /* @__PURE__ */ s({
|
|
4
4
|
__name: "BuiTableHeader",
|
|
5
5
|
props: {
|
|
6
6
|
class: {},
|
|
7
7
|
freezeHeader: { type: Boolean }
|
|
8
8
|
},
|
|
9
|
-
setup(t, { expose:
|
|
10
|
-
const e =
|
|
11
|
-
|
|
9
|
+
setup(t, { expose: l }) {
|
|
10
|
+
const e = a(null);
|
|
11
|
+
l({ headRef: e });
|
|
12
12
|
const r = t;
|
|
13
|
-
return (
|
|
13
|
+
return (d, f) => (o(), i("thead", {
|
|
14
14
|
ref_key: "headRef",
|
|
15
15
|
ref: e,
|
|
16
16
|
class: c(
|
|
17
|
-
n(
|
|
17
|
+
n(p)(
|
|
18
18
|
r.class,
|
|
19
19
|
r.freezeHeader ? "sticky top-0 z-1 [&_th:first-child>div>div]:pl-3 [&_th:last-child>div>div]:border-r-0 [&_th:last-child>div>div]:pr-14 [&_tr:last-child]:border-b-0" : "[&_th:first-child>div]:pl-3 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-14"
|
|
20
20
|
)
|
|
21
21
|
)
|
|
22
22
|
}, [
|
|
23
|
-
h("
|
|
24
|
-
p(l.$slots, "default")
|
|
25
|
-
])
|
|
23
|
+
h(d.$slots, "default")
|
|
26
24
|
], 2));
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
export {
|
|
30
|
-
|
|
28
|
+
v as _
|
|
31
29
|
};
|
|
@@ -14,5 +14,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
14
14
|
"update:modelValue": (payload: string | number) => any;
|
|
15
15
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
16
|
"onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
|
|
17
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
18
|
+
searchInput: HTMLInputElement;
|
|
19
|
+
}, any>;
|
|
18
20
|
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
defaultValue?: 'password' | 'text';
|
|
3
|
+
showPasswordTranslation?: string;
|
|
4
|
+
hidePasswordTranslation?: string;
|
|
3
5
|
};
|
|
4
6
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
7
|
export default _default;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { h as
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { useVModel as
|
|
1
|
+
import { h as B, F as O, g as _, _ as R, j as S } from "../../utils-DhVytAXN.js";
|
|
2
|
+
import { defineComponent as x, inject as z, toRef as A, ref as v, useTemplateRef as X, createElementBlock as w, withDirectives as E, openBlock as i, createBlock as g, createCommentVNode as T, createElementVNode as h, unref as a, normalizeClass as k, isRef as F, vModelText as G, withCtx as y, createVNode as n, vModelDynamic as H, computed as $, mergeProps as D, createTextVNode as K, toDisplayString as L, mergeModels as Y, useModel as q, watch as I, normalizeStyle as M } from "vue";
|
|
3
|
+
import { useVModel as J, useElementBounding as U } from "@vueuse/core";
|
|
4
|
+
import { c as Q, d as P } from "../../colorUtils-BgA4kYw8.js";
|
|
5
|
+
import { BuiBadge as W } from "../badge/index.js";
|
|
4
6
|
import "vee-validate";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { _ as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { BuiColorPicker as q } from "../color-picker/index.js";
|
|
7
|
+
import { _ as Z } from "../../BuiPopover.vue_vue_type_script_setup_true_lang-C21Z50mT.js";
|
|
8
|
+
import { _ as ee } from "../../BuiPopoverTrigger.vue_vue_type_script_setup_true_lang-DRd7CSVn.js";
|
|
9
|
+
import { _ as ae } from "../../BuiPopoverContent.vue_vue_type_script_setup_true_lang-D3uzwVKl.js";
|
|
10
|
+
import { BuiColorPicker as te } from "../color-picker/index.js";
|
|
11
|
+
import { X as le } from "../../x-BYvGkYUz.js";
|
|
11
12
|
/**
|
|
12
13
|
* @license lucide-vue-next v0.544.0 - ISC
|
|
13
14
|
*
|
|
14
15
|
* This source code is licensed under the ISC license.
|
|
15
16
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
17
|
*/
|
|
17
|
-
const
|
|
18
|
+
const oe = B("eye-off", [
|
|
18
19
|
[
|
|
19
20
|
"path",
|
|
20
21
|
{
|
|
@@ -38,7 +39,7 @@ const J = _("eye-off", [
|
|
|
38
39
|
* This source code is licensed under the ISC license.
|
|
39
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
41
|
*/
|
|
41
|
-
const
|
|
42
|
+
const se = B("eye", [
|
|
42
43
|
[
|
|
43
44
|
"path",
|
|
44
45
|
{
|
|
@@ -54,7 +55,7 @@ const Q = _("eye", [
|
|
|
54
55
|
* This source code is licensed under the ISC license.
|
|
55
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
56
57
|
*/
|
|
57
|
-
const
|
|
58
|
+
const re = B("palette", [
|
|
58
59
|
[
|
|
59
60
|
"path",
|
|
60
61
|
{
|
|
@@ -66,7 +67,10 @@ const W = _("palette", [
|
|
|
66
67
|
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
|
|
67
68
|
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
|
|
68
69
|
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }]
|
|
69
|
-
]),
|
|
70
|
+
]), ne = {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "group relative flex flex-row items-center"
|
|
73
|
+
}, ie = ["readonly", "disabled", "placeholder"], de = ["readonly", "disabled", "placeholder", "type"], C = /* @__PURE__ */ x({
|
|
70
74
|
__name: "BuiInput",
|
|
71
75
|
props: {
|
|
72
76
|
defaultValue: {},
|
|
@@ -79,89 +83,138 @@ const W = _("palette", [
|
|
|
79
83
|
type: {}
|
|
80
84
|
},
|
|
81
85
|
emits: ["update:modelValue"],
|
|
82
|
-
setup(
|
|
83
|
-
const e =
|
|
86
|
+
setup(d, { emit: o }) {
|
|
87
|
+
const e = d, t = J(e, "modelValue", o, {
|
|
84
88
|
passive: !0,
|
|
85
89
|
defaultValue: e.defaultValue
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
(
|
|
90
|
+
}), u = z(O, A(!1)), l = v(!1), s = X("searchInput"), c = () => {
|
|
91
|
+
l.value = !0;
|
|
92
|
+
}, r = () => {
|
|
93
|
+
l.value = !1;
|
|
94
|
+
}, f = (m) => {
|
|
95
|
+
(m.key === "Home" || m.key === "End") && l.value && m.stopPropagation();
|
|
96
|
+
}, j = () => {
|
|
97
|
+
s.value && (s.value.focus(), t.value = "");
|
|
92
98
|
};
|
|
93
|
-
return (
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
return (m, b) => e.type === "search" ? (i(), w("div", ne, [
|
|
100
|
+
E(h("input", {
|
|
101
|
+
ref_key: "searchInput",
|
|
102
|
+
ref: s,
|
|
103
|
+
"onUpdate:modelValue": b[0] || (b[0] = (V) => F(t) ? t.value = V : null),
|
|
104
|
+
class: k(
|
|
105
|
+
a(_)(
|
|
106
|
+
a(N)({ variant: m.variant }),
|
|
107
|
+
e.class ?? "",
|
|
108
|
+
"pr-6",
|
|
109
|
+
!e.variant || e.variant === "default" ? "group-hover:border-primary" : ""
|
|
110
|
+
)
|
|
111
|
+
),
|
|
112
|
+
readonly: a(u) || e.readonly,
|
|
113
|
+
disabled: e.disabled,
|
|
114
|
+
placeholder: e.placeholder,
|
|
115
|
+
type: "text",
|
|
116
|
+
onFocus: c,
|
|
117
|
+
onBlur: r,
|
|
118
|
+
onKeydown: f
|
|
119
|
+
}, null, 42, ie), [
|
|
120
|
+
[G, a(t)]
|
|
121
|
+
]),
|
|
122
|
+
a(t) && a(t).toString().length > 0 ? (i(), g(R, {
|
|
123
|
+
key: 0,
|
|
124
|
+
variant: "none",
|
|
125
|
+
class: "hover:text-primary text-foreground invisible absolute top-2 right-2 h-fit w-fit p-[1px] group-hover:visible",
|
|
126
|
+
onClick: j
|
|
127
|
+
}, {
|
|
128
|
+
default: y(() => [
|
|
129
|
+
n(a(le), {
|
|
130
|
+
size: 14,
|
|
131
|
+
class: "pointer-events-none shrink-0"
|
|
132
|
+
})
|
|
133
|
+
]),
|
|
134
|
+
_: 1
|
|
135
|
+
})) : T("", !0)
|
|
136
|
+
])) : E((i(), w("input", {
|
|
137
|
+
key: 1,
|
|
138
|
+
"onUpdate:modelValue": b[1] || (b[1] = (V) => F(t) ? t.value = V : null),
|
|
139
|
+
class: k(a(_)(a(N)({ variant: m.variant }), e.class ?? "")),
|
|
140
|
+
readonly: a(u) || e.readonly,
|
|
97
141
|
disabled: e.disabled,
|
|
98
142
|
placeholder: e.placeholder,
|
|
99
143
|
type: e.type || "text",
|
|
100
|
-
onFocus:
|
|
101
|
-
onBlur:
|
|
102
|
-
onKeydown:
|
|
103
|
-
}, null, 42,
|
|
104
|
-
[
|
|
144
|
+
onFocus: c,
|
|
145
|
+
onBlur: r,
|
|
146
|
+
onKeydown: f
|
|
147
|
+
}, null, 42, de)), [
|
|
148
|
+
[H, a(t)]
|
|
105
149
|
]);
|
|
106
150
|
}
|
|
107
|
-
}),
|
|
151
|
+
}), ue = { class: "relative flex" }, Ce = /* @__PURE__ */ x({
|
|
108
152
|
inheritAttrs: !1,
|
|
109
153
|
__name: "BuiPasswordInput",
|
|
110
154
|
props: {
|
|
111
|
-
defaultValue: {}
|
|
155
|
+
defaultValue: {},
|
|
156
|
+
showPasswordTranslation: {},
|
|
157
|
+
hidePasswordTranslation: {}
|
|
112
158
|
},
|
|
113
|
-
setup(
|
|
114
|
-
const e =
|
|
115
|
-
function
|
|
159
|
+
setup(d) {
|
|
160
|
+
const o = d, e = v(o.defaultValue ?? "password");
|
|
161
|
+
function p() {
|
|
116
162
|
e.value === "password" ? e.value = "text" : e.value = "password";
|
|
117
163
|
}
|
|
118
|
-
|
|
119
|
-
|
|
164
|
+
const t = $(() => o.showPasswordTranslation ?? "Show password"), u = $(() => o.hidePasswordTranslation ?? "Hide password");
|
|
165
|
+
return (l, s) => (i(), w("div", ue, [
|
|
166
|
+
n(a(C), D(l.$attrs, {
|
|
120
167
|
type: e.value,
|
|
121
|
-
class: a(
|
|
168
|
+
class: a(_)(l.$attrs.class ?? "", "pr-8")
|
|
122
169
|
}), null, 16, ["type", "class"]),
|
|
123
|
-
|
|
124
|
-
onClick:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
e.value === "password" ?
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
170
|
+
n(R, {
|
|
171
|
+
onClick: p,
|
|
172
|
+
variant: "none",
|
|
173
|
+
class: "text-muted-foreground hover:text-foreground absolute top-0 right-3 flex h-full w-fit items-center justify-center p-0",
|
|
174
|
+
"aria-label": e.value === "password" ? t.value : u.value,
|
|
175
|
+
"aria-pressed": e.value !== "password"
|
|
176
|
+
}, {
|
|
177
|
+
default: y(() => [
|
|
178
|
+
e.value === "password" ? (i(), g(a(se), {
|
|
179
|
+
key: 0,
|
|
180
|
+
class: "pointer-events-none h-4 w-4 shrink-0 cursor-pointer"
|
|
181
|
+
})) : (i(), g(a(oe), {
|
|
182
|
+
key: 1,
|
|
183
|
+
class: "pointer-events-none h-4 w-4 shrink-0 cursor-pointer"
|
|
184
|
+
}))
|
|
185
|
+
]),
|
|
186
|
+
_: 1
|
|
187
|
+
}, 8, ["aria-label", "aria-pressed"])
|
|
135
188
|
]));
|
|
136
189
|
}
|
|
137
|
-
}),
|
|
190
|
+
}), ce = { class: "relative flex" }, pe = 12, Ee = /* @__PURE__ */ x({
|
|
138
191
|
inheritAttrs: !1,
|
|
139
192
|
__name: "BuiBadgedInput",
|
|
140
193
|
props: {
|
|
141
194
|
badge: {}
|
|
142
195
|
},
|
|
143
|
-
setup(
|
|
144
|
-
const o =
|
|
145
|
-
return (
|
|
146
|
-
|
|
147
|
-
style: { paddingRight: a(
|
|
196
|
+
setup(d) {
|
|
197
|
+
const o = d, e = v(null), { width: p } = U(e);
|
|
198
|
+
return (t, u) => (i(), w("div", ce, [
|
|
199
|
+
n(a(C), D(t.$attrs, {
|
|
200
|
+
style: { paddingRight: a(p) + pe + "px" }
|
|
148
201
|
}), null, 16, ["style"]),
|
|
149
|
-
o.badge ? (
|
|
202
|
+
o.badge ? (i(), g(W, {
|
|
150
203
|
key: 0,
|
|
151
204
|
ref_key: "badgeEl",
|
|
152
205
|
ref: e,
|
|
153
206
|
class: "hover:bg-primary/8 dark:hover:bg-primary/30 absolute top-1 right-2 flex items-center justify-center rounded-sm"
|
|
154
207
|
}, {
|
|
155
|
-
default:
|
|
156
|
-
|
|
208
|
+
default: y(() => [
|
|
209
|
+
K(L(o.badge), 1)
|
|
157
210
|
]),
|
|
158
211
|
_: 1
|
|
159
|
-
}, 512)) :
|
|
212
|
+
}, 512)) : T("", !0)
|
|
160
213
|
]));
|
|
161
214
|
}
|
|
162
|
-
}),
|
|
215
|
+
}), fe = { class: "nowrap text-foreground relative flex w-32 flex-row font-medium uppercase" }, me = 12, Fe = /* @__PURE__ */ x({
|
|
163
216
|
__name: "BuiColorInput",
|
|
164
|
-
props: /* @__PURE__ */
|
|
217
|
+
props: /* @__PURE__ */ Y({
|
|
165
218
|
id: {},
|
|
166
219
|
defaultValue: { default: "#FFFFFF" },
|
|
167
220
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -171,51 +224,51 @@ const W = _("palette", [
|
|
|
171
224
|
modelModifiers: {}
|
|
172
225
|
}),
|
|
173
226
|
emits: ["update:modelValue"],
|
|
174
|
-
setup(
|
|
175
|
-
const o =
|
|
176
|
-
return
|
|
177
|
-
|
|
178
|
-
}),
|
|
179
|
-
e.value = s.value,
|
|
180
|
-
}), (
|
|
181
|
-
default:
|
|
182
|
-
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
|
|
227
|
+
setup(d) {
|
|
228
|
+
const o = d, e = q(d, "modelValue", void 0), p = v(null), { width: t } = U(p), u = () => e.value && P.test(e.value) ? e.value : o.defaultValue && P.test(o.defaultValue) ? o.defaultValue : "#FFFFFF", l = v(u().substring(1)), s = v(u());
|
|
229
|
+
return I(l, () => {
|
|
230
|
+
Q.test(l.value) && (e.value = `#${l.value}`, s.value = `#${l.value}`);
|
|
231
|
+
}), I(s, () => {
|
|
232
|
+
e.value = s.value, l.value = s.value.substring(1);
|
|
233
|
+
}), (c, r) => (i(), g(a(Z), null, {
|
|
234
|
+
default: y(() => [
|
|
235
|
+
n(a(ee), null, {
|
|
236
|
+
default: y(() => [
|
|
237
|
+
h("div", fe, [
|
|
238
|
+
h("div", {
|
|
186
239
|
ref_key: "paletteBadge",
|
|
187
|
-
ref:
|
|
188
|
-
class:
|
|
240
|
+
ref: p,
|
|
241
|
+
class: k(a(_)("absolute top-1.5 left-2 flex flex-row items-center gap-1", c.ui?.badgeClass))
|
|
189
242
|
}, [
|
|
190
|
-
|
|
191
|
-
|
|
243
|
+
n(a(re), { class: "h-4 w-4 shrink-0" }),
|
|
244
|
+
h("div", {
|
|
192
245
|
class: "h-4 w-4 rounded-sm",
|
|
193
|
-
style:
|
|
246
|
+
style: M({ backgroundColor: s.value })
|
|
194
247
|
}, null, 4),
|
|
195
|
-
|
|
248
|
+
r[2] || (r[2] = h("div", { class: "text-foreground/[.56] font-bold" }, "#", -1))
|
|
196
249
|
], 2),
|
|
197
|
-
|
|
198
|
-
modelValue:
|
|
199
|
-
"onUpdate:modelValue":
|
|
200
|
-
id:
|
|
201
|
-
style:
|
|
202
|
-
disabled:
|
|
203
|
-
class:
|
|
250
|
+
n(C, {
|
|
251
|
+
modelValue: l.value,
|
|
252
|
+
"onUpdate:modelValue": r[0] || (r[0] = (f) => l.value = f),
|
|
253
|
+
id: c.id,
|
|
254
|
+
style: M({ paddingLeft: a(t) + me + "px" }),
|
|
255
|
+
disabled: c.disabled,
|
|
256
|
+
class: k(c.ui?.inputClass)
|
|
204
257
|
}, null, 8, ["modelValue", "id", "style", "disabled", "class"])
|
|
205
258
|
])
|
|
206
259
|
]),
|
|
207
260
|
_: 1
|
|
208
261
|
}),
|
|
209
|
-
|
|
262
|
+
n(a(ae), {
|
|
210
263
|
class: "w-fit",
|
|
211
264
|
align: "start"
|
|
212
265
|
}, {
|
|
213
|
-
default:
|
|
214
|
-
|
|
266
|
+
default: y(() => [
|
|
267
|
+
n(te, {
|
|
215
268
|
modelValue: s.value,
|
|
216
|
-
"onUpdate:modelValue":
|
|
269
|
+
"onUpdate:modelValue": r[1] || (r[1] = (f) => s.value = f),
|
|
217
270
|
format: "hex",
|
|
218
|
-
disabled:
|
|
271
|
+
disabled: c.disabled,
|
|
219
272
|
ui: { selectorClass: "ring-popover", trackClass: "ring-popover" }
|
|
220
273
|
}, null, 8, ["modelValue", "disabled"])
|
|
221
274
|
]),
|
|
@@ -225,7 +278,7 @@ const W = _("palette", [
|
|
|
225
278
|
_: 1
|
|
226
279
|
}));
|
|
227
280
|
}
|
|
228
|
-
}),
|
|
281
|
+
}), N = S(
|
|
229
282
|
"flex h-8 w-full rounded-sm bg-background border px-2 py-1 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-30 dark:disabled:opacity-55 read-only:opacity-30 dark:read-only:opacity-55 aria-invalid:border-destructive-foreground",
|
|
230
283
|
{
|
|
231
284
|
variants: {
|
|
@@ -241,9 +294,9 @@ const W = _("palette", [
|
|
|
241
294
|
}
|
|
242
295
|
);
|
|
243
296
|
export {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
297
|
+
Ee as BuiBadgedInput,
|
|
298
|
+
Fe as BuiColorInput,
|
|
299
|
+
C as BuiInput,
|
|
300
|
+
Ce as BuiPasswordInput,
|
|
301
|
+
N as inputVariants
|
|
249
302
|
};
|