@gspa/ui 0.1.4 → 0.2.0
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 +17 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js +205 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs +1 -0
- package/dist/DataTable.css +1 -0
- package/dist/DataTableToolBar.css +1 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js +205 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-mEO-VA6R.cjs +1 -0
- package/dist/Header.css +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js +137 -0
- package/dist/Loader.css +1 -0
- package/dist/ReminderConfig.css +1 -0
- package/dist/ReusableForm.css +1 -0
- package/dist/Sidebar.css +1 -0
- package/dist/Toast.css +1 -0
- package/dist/components/AccordionItem.cjs +1 -1
- package/dist/components/AccordionItem.js +5 -5
- package/dist/components/Alert.cjs +1 -1
- package/dist/components/Alert.js +71 -66
- package/dist/components/Button.cjs +1 -1
- package/dist/components/Button.js +2 -188
- package/dist/components/DataTable.cjs +1 -1
- package/dist/components/DataTable.js +1 -1
- package/dist/components/DataTableFilters.cjs +1 -1
- package/dist/components/DataTableFilters.js +19 -19
- package/dist/components/DataTableToolBar.cjs +1 -1
- package/dist/components/DataTableToolBar.js +1 -1
- package/dist/components/FormField.cjs +1 -1
- package/dist/components/FormField.js +2 -188
- package/dist/components/GraphFilters.cjs +1 -1
- package/dist/components/GraphFilters.js +29 -29
- package/dist/components/Icon.cjs +1 -1
- package/dist/components/Icon.js +23 -16
- package/dist/components/Input.cjs +1 -1
- package/dist/components/Input.js +2 -164
- package/dist/components/ReusableForm.cjs +1 -1
- package/dist/components/ReusableForm.js +187 -158
- package/dist/components/ThemeConfigurator.cjs +1 -1
- package/dist/components/ThemeConfigurator.js +51 -28
- package/dist/gspa-ui.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +123 -117
- package/dist/layouts/AuthLayout.cjs +1 -1
- package/dist/layouts/AuthLayout.js +110 -112
- package/dist/lib/form-field.cjs +1 -0
- package/dist/lib/form-field.js +4 -0
- package/dist/lib/icon.cjs +1 -0
- package/dist/lib/icon.js +4 -0
- package/dist/lib/theme.cjs +1 -1
- package/dist/lib/theme.js +73 -63
- package/dist/src/components/Alert.vue.d.ts.map +1 -1
- package/dist/src/components/Button.vue.d.ts +127 -29
- package/dist/src/components/Button.vue.d.ts.map +1 -1
- package/dist/src/components/Checkbox.vue.d.ts +2 -2
- package/dist/src/components/DataTable.vue.d.ts +1 -1
- package/dist/src/components/FormField.vue.d.ts +106 -38
- package/dist/src/components/FormField.vue.d.ts.map +1 -1
- package/dist/src/components/Icon.vue.d.ts.map +1 -1
- package/dist/src/components/Input.vue.d.ts +137 -33
- package/dist/src/components/Input.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableFormModal.vue.d.ts +1 -1
- package/dist/src/components/Textarea.vue.d.ts +2 -2
- package/dist/src/index.d.ts +9 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/AuthLayout.vue.d.ts +2 -0
- package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
- package/dist/src/lib/form-field.d.ts +2 -0
- package/dist/src/lib/form-field.d.ts.map +1 -0
- package/dist/src/lib/icon.d.ts +2 -0
- package/dist/src/lib/icon.d.ts.map +1 -0
- package/dist/src/lib/theme.d.ts +4 -0
- package/dist/src/lib/theme.d.ts.map +1 -1
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/styles/auth-layout.css +1 -0
- package/dist/styles/button.css +1 -0
- package/dist/styles/form-field.css +1 -0
- package/dist/styles/input.css +1 -0
- package/dist/styles/tokens.css +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -3
- package/dist/src/__tests__/Alert.spec.d.ts +0 -2
- package/dist/src/__tests__/Alert.spec.d.ts.map +0 -1
- package/dist/src/__tests__/App.spec.d.ts +0 -2
- package/dist/src/__tests__/App.spec.d.ts.map +0 -1
- package/dist/src/__tests__/AuthLayout.spec.d.ts +0 -2
- package/dist/src/__tests__/AuthLayout.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Badge.spec.d.ts +0 -2
- package/dist/src/__tests__/Badge.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Button.spec.d.ts +0 -2
- package/dist/src/__tests__/Button.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Card.spec.d.ts +0 -2
- package/dist/src/__tests__/Card.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Checkbox.spec.d.ts +0 -2
- package/dist/src/__tests__/Checkbox.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Dropdown.spec.d.ts +0 -2
- package/dist/src/__tests__/Dropdown.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Input.spec.d.ts +0 -2
- package/dist/src/__tests__/Input.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Modal.spec.d.ts +0 -2
- package/dist/src/__tests__/Modal.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Radio.spec.d.ts +0 -2
- package/dist/src/__tests__/Radio.spec.d.ts.map +0 -1
- package/dist/src/__tests__/ReusableForm.spec.d.ts +0 -2
- package/dist/src/__tests__/ReusableForm.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Tabs.spec.d.ts +0 -2
- package/dist/src/__tests__/Tabs.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts.map +0 -1
|
@@ -1,190 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cva as v } from "class-variance-authority";
|
|
3
|
-
import { cn as o } from "../utils/cn.js";
|
|
4
|
-
import M from "./DatePicker.js";
|
|
5
|
-
const j = ["for"], H = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "ui-danger ml-1",
|
|
8
|
-
"aria-label": "required"
|
|
9
|
-
}, U = { class: "relative" }, A = ["aria-label"], G = ["id"], J = ["id"], R = {
|
|
10
|
-
__name: "FormField",
|
|
11
|
-
props: {
|
|
12
|
-
label: String,
|
|
13
|
-
description: String,
|
|
14
|
-
error: String,
|
|
15
|
-
success: String,
|
|
16
|
-
helpText: String,
|
|
17
|
-
required: { type: Boolean, default: !1 },
|
|
18
|
-
type: { type: String, default: "text" },
|
|
19
|
-
// Added type prop
|
|
20
|
-
modelValue: [String, Date],
|
|
21
|
-
size: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: "md",
|
|
24
|
-
validator: (e) => ["sm", "md", "lg"].includes(e)
|
|
25
|
-
},
|
|
26
|
-
id: String
|
|
27
|
-
},
|
|
28
|
-
emits: ["update:modelValue"],
|
|
29
|
-
setup(e, { emit: k }) {
|
|
30
|
-
const f = e, w = k, S = `field-${Math.random().toString(36).slice(2, 9)}`, i = x(() => `${f.id || S}-${Math.random().toString(36).slice(2, 5)}`), c = x(() => !!f.error), d = E(!1), g = () => {
|
|
31
|
-
d.value = !d.value;
|
|
32
|
-
}, $ = x(() => {
|
|
33
|
-
const l = [];
|
|
34
|
-
return f.error ? l.push(`${i.value}-error`) : f.helpText && l.push(`${i.value}-help`), l.length > 0 ? l.join(" ") : void 0;
|
|
35
|
-
}), q = v("ui-text", {
|
|
36
|
-
variants: {
|
|
37
|
-
size: {
|
|
38
|
-
sm: "space-y-1",
|
|
39
|
-
md: "space-y-2",
|
|
40
|
-
lg: "space-y-3"
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
defaultVariants: { size: "md" }
|
|
44
|
-
}), B = v("block ui-text", {
|
|
45
|
-
variants: {
|
|
46
|
-
size: {
|
|
47
|
-
sm: "text-xs font-medium",
|
|
48
|
-
md: "text-sm font-medium",
|
|
49
|
-
lg: "text-base font-medium"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: { size: "md" }
|
|
53
|
-
}), T = v("ui-text", {
|
|
54
|
-
variants: {
|
|
55
|
-
size: {
|
|
56
|
-
sm: "text-xs",
|
|
57
|
-
md: "text-sm",
|
|
58
|
-
lg: "text-base"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
defaultVariants: { size: "md" }
|
|
62
|
-
}), z = v("flex items-start gap-2", {
|
|
63
|
-
variants: {
|
|
64
|
-
size: {
|
|
65
|
-
sm: "text-xs",
|
|
66
|
-
md: "text-sm",
|
|
67
|
-
lg: "text-sm"
|
|
68
|
-
},
|
|
69
|
-
intent: {
|
|
70
|
-
error: "ui-danger",
|
|
71
|
-
success: "ui-success"
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
defaultVariants: { size: "md", intent: "error" }
|
|
75
|
-
}), C = v("ui-text", {
|
|
76
|
-
variants: {
|
|
77
|
-
size: {
|
|
78
|
-
sm: "text-xs",
|
|
79
|
-
md: "text-sm",
|
|
80
|
-
lg: "text-sm"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
defaultVariants: { size: "md" }
|
|
84
|
-
});
|
|
85
|
-
return (l, V) => {
|
|
86
|
-
const y = N("font-awesome-icon");
|
|
87
|
-
return a(), s("div", {
|
|
88
|
-
class: r(t(o)(t(q)({ size: e.size }), l.$attrs.class))
|
|
89
|
-
}, [
|
|
90
|
-
e.label ? (a(), s("label", {
|
|
91
|
-
key: 0,
|
|
92
|
-
for: i.value,
|
|
93
|
-
class: r(t(o)(t(B)({ size: e.size })))
|
|
94
|
-
}, [
|
|
95
|
-
P(m(e.label) + " ", 1),
|
|
96
|
-
e.required ? (a(), s("span", H, "*")) : n("", !0)
|
|
97
|
-
], 10, j)) : n("", !0),
|
|
98
|
-
e.description ? (a(), s("p", {
|
|
99
|
-
key: 1,
|
|
100
|
-
class: r(t(o)(t(T)({ size: e.size })))
|
|
101
|
-
}, m(e.description), 3)) : n("", !0),
|
|
102
|
-
h("div", U, [
|
|
103
|
-
e.type === "date" ? (a(), I(M, {
|
|
104
|
-
key: 0,
|
|
105
|
-
id: i.value,
|
|
106
|
-
"model-value": e.modelValue,
|
|
107
|
-
disabled: !1,
|
|
108
|
-
required: e.required,
|
|
109
|
-
class: r(c.value ? "border-(--ui-danger)" : ""),
|
|
110
|
-
"onUpdate:modelValue": V[0] || (V[0] = (D) => w("update:modelValue", D))
|
|
111
|
-
}, null, 8, ["id", "model-value", "required", "class"])) : F(l.$slots, "default", {
|
|
112
|
-
key: 1,
|
|
113
|
-
fieldId: i.value,
|
|
114
|
-
hasError: c.value,
|
|
115
|
-
ariaDescribedBy: $.value,
|
|
116
|
-
showPassword: d.value,
|
|
117
|
-
togglePasswordVisibility: g
|
|
118
|
-
}),
|
|
119
|
-
e.type === "password" ? (a(), s("button", {
|
|
120
|
-
key: 2,
|
|
121
|
-
type: "button",
|
|
122
|
-
class: "absolute inset-y-0 right-0 pr-3 flex items-center ui-text hover:text-(--ui-text) transition-colors",
|
|
123
|
-
"aria-label": d.value ? "Hide password" : "Show password",
|
|
124
|
-
onClick: g
|
|
125
|
-
}, [
|
|
126
|
-
u(y, {
|
|
127
|
-
icon: d.value ? "eye-slash" : "eye",
|
|
128
|
-
class: "w-4 h-4"
|
|
129
|
-
}, null, 8, ["icon"])
|
|
130
|
-
], 8, A)) : n("", !0)
|
|
131
|
-
]),
|
|
132
|
-
u(b, {
|
|
133
|
-
"enter-active-class": "transition-all duration-200",
|
|
134
|
-
"enter-from-class": "opacity-0 -translate-y-1",
|
|
135
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
136
|
-
"leave-active-class": "transition-all duration-150",
|
|
137
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
138
|
-
"leave-to-class": "opacity-0 -translate-y-1"
|
|
139
|
-
}, {
|
|
140
|
-
default: p(() => [
|
|
141
|
-
c.value ? (a(), s("div", {
|
|
142
|
-
key: 0,
|
|
143
|
-
id: `${i.value}-error`,
|
|
144
|
-
class: r(t(o)(t(z)({ size: e.size, intent: "error" }))),
|
|
145
|
-
role: "alert",
|
|
146
|
-
"aria-live": "polite"
|
|
147
|
-
}, [
|
|
148
|
-
u(y, {
|
|
149
|
-
icon: "exclamation-triangle",
|
|
150
|
-
class: "w-4 h-4 shrink-0 mt-0.5"
|
|
151
|
-
}),
|
|
152
|
-
h("span", null, m(e.error), 1)
|
|
153
|
-
], 10, G)) : n("", !0)
|
|
154
|
-
]),
|
|
155
|
-
_: 1
|
|
156
|
-
}),
|
|
157
|
-
e.helpText && !c.value ? (a(), s("p", {
|
|
158
|
-
key: 2,
|
|
159
|
-
id: `${i.value}-help`,
|
|
160
|
-
class: r(t(o)(t(C)({ size: e.size })))
|
|
161
|
-
}, m(e.helpText), 11, J)) : n("", !0),
|
|
162
|
-
u(b, {
|
|
163
|
-
"enter-active-class": "transition-all duration-200",
|
|
164
|
-
"enter-from-class": "opacity-0 -translate-y-1",
|
|
165
|
-
"enter-to-class": "opacity-100 translate-y-0",
|
|
166
|
-
"leave-active-class": "transition-all duration-150",
|
|
167
|
-
"leave-from-class": "opacity-100 translate-y-0",
|
|
168
|
-
"leave-to-class": "opacity-0 -translate-y-1"
|
|
169
|
-
}, {
|
|
170
|
-
default: p(() => [
|
|
171
|
-
e.success && !c.value ? (a(), s("div", {
|
|
172
|
-
key: 0,
|
|
173
|
-
class: r(t(o)(t(z)({ size: e.size, intent: "success" })))
|
|
174
|
-
}, [
|
|
175
|
-
u(y, {
|
|
176
|
-
icon: "check",
|
|
177
|
-
class: "w-4 h-4 shrink-0 mt-0.5"
|
|
178
|
-
}),
|
|
179
|
-
h("span", null, m(e.success), 1)
|
|
180
|
-
], 2)) : n("", !0)
|
|
181
|
-
]),
|
|
182
|
-
_: 1
|
|
183
|
-
})
|
|
184
|
-
], 2);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
};
|
|
1
|
+
import { _ as f } from "../FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js";
|
|
188
2
|
export {
|
|
189
|
-
|
|
3
|
+
f as default
|
|
190
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),z=require("class-variance-authority"),D=require("../utils/cn.cjs"),m=require("../Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs"),y=require("./Select.cjs"),u=require("./Icon.cjs"),$={class:"border-b"},q={key:0,class:"flex items-center gap-3 min-w-64"},A={class:"relative flex-1"},R={class:"relative flex-1"},U={key:1,class:"min-w-40"},L={class:"relative"},M={key:2,class:"min-w-40"},I={class:"relative"},P=["value"],j={key:3,class:"flex items-center gap-2"},G={class:"flex items-center gap-3 ml-auto"},O={class:"flex items-center gap-3 flex-wrap"},H=["onClick"],J={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:o=>["default","minimal","bordered"].includes(o)},padding:{type:String,default:"normal",validator:o=>["compact","normal","comfortable"].includes(o)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(o,{emit:h}){const c=o,i=h,r=e.ref(""),s=e.ref(""),d=e.ref("bar"),n=e.ref(""),g=z.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"",minimal:"bg-transparent",bordered:""},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),x=e.computed(()=>r.value||s.value||n.value),p=e.computed(()=>{const l=[];if(r.value||s.value){let t="";r.value&&s.value?t=`${r.value} to ${s.value}`:r.value?t=`From ${r.value}`:s.value&&(t=`Until ${s.value}`),t&&l.push({key:"date",label:"Date Range",value:t,icon:"calendar"})}if(n.value){const t=c.dataSources.find(a=>a.value===n.value);l.push({key:"dataSource",label:"Data Source",value:t?.label||n.value,icon:"database"})}return l}),C=e.computed(()=>D.cn(g({variant:c.variant,padding:c.padding}))),v=e.computed(()=>"w-full pl-10 pr-3 py-2 border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm ui-surface "),f=e.computed(()=>"w-full pr-8 appearance-none border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm py-2 pl-3 ui-surface "),V=e.computed(()=>"ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"),k=e.computed(()=>"ui-text ui-primary-bg hover:bg-(--ui-primary-strong) border border-(--ui-primary) px-3 py-2 rounded-lg text-sm font-medium transition-all"),b=e.computed(()=>"ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"),N=e.computed(()=>"px-6 py-3 ui-primary-soft border-t border-(--ui-primary-soft)"),B=e.computed(()=>"text-sm font-semibold ui-primary"),w=e.computed(()=>"flex items-center gap-1.5 ui-surface border border-(--ui-primary-soft) ui-primary px-3 py-1.5 rounded-full text-sm font-medium"),E=e.computed(()=>"ui-primary hover:text-(--ui-primary) ml-1 hover:bg-(--ui-primary-soft) rounded-full p-0.5 transition-all"),F=l=>{d.value=l.target.value,i("update:chartType",l.target.value)},S=l=>{n.value=l.target.value,i("update:dataSource",l.target.value)},T=()=>{r.value="",s.value="",n.value="",i("clear-filters")},_=l=>{switch(l){case"date":r.value="",s.value="";break;case"dataSource":n.value="";break}};return e.watch(()=>r.value,l=>{i("update:dateFrom",l)}),e.watch(()=>s.value,l=>{i("update:dateTo",l)}),(l,t)=>(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",{class:e.normalizeClass(C.value)},[o.showDateFilter?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",A,[e.createVNode(u.default,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>r.value=a),type:"date",class:e.normalizeClass(v.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),t[6]||(t[6]=e.createElementVNode("span",{class:"ui-text text-sm"},"to",-1)),e.createElementVNode("div",R,[e.createVNode(u.default,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>s.value=a),type:"date",class:e.normalizeClass(v.value),placeholder:"To date"},null,2),[[e.vModelText,s.value]])])])):e.createCommentVNode("",!0),o.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",L,[e.createVNode(y.default,{modelValue:d.value,"onUpdate:modelValue":t[2]||(t[2]=a=>d.value=a),class:e.normalizeClass(f.value),onChange:F},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(u.default,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"})])])):e.createCommentVNode("",!0),o.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",I,[e.createVNode(y.default,{modelValue:n.value,"onUpdate:modelValue":t[3]||(t[3]=a=>n.value=a),class:e.normalizeClass(f.value),onChange:S},{default:e.withCtx(()=>[t[8]||(t[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.dataSources,a=>(e.openBlock(),e.createElementBlock("option",{key:a.value,value:a.value},e.toDisplayString(a.label),9,P))),128))]),_:1},8,["modelValue","class"]),e.createVNode(u.default,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 ui-text pointer-events-none"})])])):e.createCommentVNode("",!0),l.$slots.filters?(e.openBlock(),e.createElementBlock("div",j,[e.renderSlot(l.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",G,[x.value?(e.openBlock(),e.createBlock(m._sfc_main,{key:0,class:e.normalizeClass(V.value),onClick:T},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),t[9]||(t[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),o.showExport?(e.openBlock(),e.createBlock(m._sfc_main,{key:1,class:e.normalizeClass(k.value),onClick:t[4]||(t[4]=a=>l.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"download",class:"w-4 h-4 mr-2"}),t[10]||(t[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),o.showRefresh?(e.openBlock(),e.createBlock(m._sfc_main,{key:2,class:e.normalizeClass(b.value),onClick:t[5]||(t[5]=a=>l.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(u.default,{icon:"sync",class:"w-4 h-4 mr-2"}),t[11]||(t[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),p.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(N.value)},[e.createElementVNode("div",O,[e.createElementVNode("span",{class:e.normalizeClass(B.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.key,class:e.normalizeClass(w.value)},[e.createVNode(u.default,{icon:a.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(a.label)+": "+e.toDisplayString(a.value),1),e.createElementVNode("button",{class:e.normalizeClass(E.value),onClick:K=>_(a.key)},[e.createVNode(u.default,{icon:"circle-xmark",class:"w-3 h-3"})],10,H)],2))),128))])],2)):e.createCommentVNode("",!0)]))}};exports.default=J;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as h, computed as
|
|
1
|
+
import { ref as h, computed as r, watch as $, createElementBlock as c, openBlock as s, createElementVNode as l, createCommentVNode as m, normalizeClass as o, createVNode as d, withDirectives as T, vModelText as B, withCtx as y, Fragment as D, renderList as E, toDisplayString as b, renderSlot as O, createBlock as C, createTextVNode as w } from "vue";
|
|
2
2
|
import { cva as Q } from "class-variance-authority";
|
|
3
3
|
import { cn as W } from "../utils/cn.js";
|
|
4
|
-
import k from "
|
|
4
|
+
import { _ as k } from "../Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js";
|
|
5
5
|
import R from "./Select.js";
|
|
6
6
|
import v from "./Icon.js";
|
|
7
7
|
const X = { class: "border-b" }, Y = {
|
|
@@ -13,7 +13,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
13
13
|
}, ae = { class: "relative" }, le = {
|
|
14
14
|
key: 2,
|
|
15
15
|
class: "min-w-40"
|
|
16
|
-
},
|
|
16
|
+
}, se = { class: "relative" }, re = ["value"], oe = {
|
|
17
17
|
key: 3,
|
|
18
18
|
class: "flex items-center gap-2"
|
|
19
19
|
}, ne = { class: "flex items-center gap-3 ml-auto" }, ie = { class: "flex items-center gap-3 flex-wrap" }, ue = ["onClick"], he = {
|
|
@@ -77,7 +77,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
77
77
|
variant: "default",
|
|
78
78
|
padding: "normal"
|
|
79
79
|
}
|
|
80
|
-
}), N =
|
|
80
|
+
}), N = r(() => i.value || u.value || p.value), F = r(() => {
|
|
81
81
|
const a = [];
|
|
82
82
|
if (i.value || u.value) {
|
|
83
83
|
let e = "";
|
|
@@ -98,28 +98,28 @@ const X = { class: "border-b" }, Y = {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
return a;
|
|
101
|
-
}),
|
|
101
|
+
}), _ = r(
|
|
102
102
|
() => W(A({
|
|
103
103
|
variant: g.variant,
|
|
104
104
|
padding: g.padding
|
|
105
105
|
}))
|
|
106
|
-
), S =
|
|
106
|
+
), S = r(
|
|
107
107
|
() => "w-full pl-10 pr-3 py-2 border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm ui-surface "
|
|
108
|
-
), V =
|
|
108
|
+
), V = r(
|
|
109
109
|
() => "w-full pr-8 appearance-none border ui-border-strong rounded-lg focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent text-sm py-2 pl-3 ui-surface "
|
|
110
|
-
),
|
|
110
|
+
), L = r(
|
|
111
111
|
() => "ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
112
|
-
), z =
|
|
112
|
+
), z = r(
|
|
113
113
|
() => "ui-text ui-primary-bg hover:bg-(--ui-primary-strong) border border-(--ui-primary) px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
114
|
-
), G =
|
|
114
|
+
), G = r(
|
|
115
115
|
() => "ui-text hover:text-(--ui-text) border hover:brightness-105 px-3 py-2 rounded-lg text-sm font-medium transition-all"
|
|
116
|
-
), I =
|
|
116
|
+
), I = r(
|
|
117
117
|
() => "px-6 py-3 ui-primary-soft border-t border-(--ui-primary-soft)"
|
|
118
|
-
), M =
|
|
118
|
+
), M = r(
|
|
119
119
|
() => "text-sm font-semibold ui-primary"
|
|
120
|
-
), P =
|
|
120
|
+
), P = r(
|
|
121
121
|
() => "flex items-center gap-1.5 ui-surface border border-(--ui-primary-soft) ui-primary px-3 py-1.5 rounded-full text-sm font-medium"
|
|
122
|
-
), j =
|
|
122
|
+
), j = r(
|
|
123
123
|
() => "ui-primary hover:text-(--ui-primary) ml-1 hover:bg-(--ui-primary-soft) rounded-full p-0.5 transition-all"
|
|
124
124
|
), q = (a) => {
|
|
125
125
|
x.value = a.target.value, f("update:chartType", a.target.value);
|
|
@@ -141,11 +141,11 @@ const X = { class: "border-b" }, Y = {
|
|
|
141
141
|
f("update:dateFrom", a);
|
|
142
142
|
}), $(() => u.value, (a) => {
|
|
143
143
|
f("update:dateTo", a);
|
|
144
|
-
}), (a, e) => (
|
|
144
|
+
}), (a, e) => (s(), c("div", X, [
|
|
145
145
|
l("div", {
|
|
146
|
-
class: o(
|
|
146
|
+
class: o(_.value)
|
|
147
147
|
}, [
|
|
148
|
-
n.showDateFilter ? (
|
|
148
|
+
n.showDateFilter ? (s(), c("div", Y, [
|
|
149
149
|
l("div", Z, [
|
|
150
150
|
d(v, {
|
|
151
151
|
icon: "calendar",
|
|
@@ -176,7 +176,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
176
176
|
])
|
|
177
177
|
])
|
|
178
178
|
])) : m("", !0),
|
|
179
|
-
n.showChartTypeFilter ? (
|
|
179
|
+
n.showChartTypeFilter ? (s(), c("div", te, [
|
|
180
180
|
l("div", ae, [
|
|
181
181
|
d(R, {
|
|
182
182
|
modelValue: x.value,
|
|
@@ -197,8 +197,8 @@ const X = { class: "border-b" }, Y = {
|
|
|
197
197
|
})
|
|
198
198
|
])
|
|
199
199
|
])) : m("", !0),
|
|
200
|
-
n.dataSources.length > 0 ? (
|
|
201
|
-
l("div",
|
|
200
|
+
n.dataSources.length > 0 ? (s(), c("div", le, [
|
|
201
|
+
l("div", se, [
|
|
202
202
|
d(R, {
|
|
203
203
|
modelValue: p.value,
|
|
204
204
|
"onUpdate:modelValue": e[3] || (e[3] = (t) => p.value = t),
|
|
@@ -207,10 +207,10 @@ const X = { class: "border-b" }, Y = {
|
|
|
207
207
|
}, {
|
|
208
208
|
default: y(() => [
|
|
209
209
|
e[8] || (e[8] = l("option", { value: "" }, " All Sources ", -1)),
|
|
210
|
-
(
|
|
210
|
+
(s(!0), c(D, null, E(n.dataSources, (t) => (s(), c("option", {
|
|
211
211
|
key: t.value,
|
|
212
212
|
value: t.value
|
|
213
|
-
}, b(t.label), 9,
|
|
213
|
+
}, b(t.label), 9, re))), 128))
|
|
214
214
|
]),
|
|
215
215
|
_: 1
|
|
216
216
|
}, 8, ["modelValue", "class"]),
|
|
@@ -220,13 +220,13 @@ const X = { class: "border-b" }, Y = {
|
|
|
220
220
|
})
|
|
221
221
|
])
|
|
222
222
|
])) : m("", !0),
|
|
223
|
-
a.$slots.filters ? (
|
|
223
|
+
a.$slots.filters ? (s(), c("div", oe, [
|
|
224
224
|
O(a.$slots, "filters")
|
|
225
225
|
])) : m("", !0),
|
|
226
226
|
l("div", ne, [
|
|
227
|
-
N.value ? (
|
|
227
|
+
N.value ? (s(), C(k, {
|
|
228
228
|
key: 0,
|
|
229
|
-
class: o(
|
|
229
|
+
class: o(L.value),
|
|
230
230
|
onClick: J
|
|
231
231
|
}, {
|
|
232
232
|
default: y(() => [
|
|
@@ -238,7 +238,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
238
238
|
]),
|
|
239
239
|
_: 1
|
|
240
240
|
}, 8, ["class"])) : m("", !0),
|
|
241
|
-
n.showExport ? (
|
|
241
|
+
n.showExport ? (s(), C(k, {
|
|
242
242
|
key: 1,
|
|
243
243
|
class: o(z.value),
|
|
244
244
|
onClick: e[4] || (e[4] = (t) => a.$emit("export"))
|
|
@@ -252,7 +252,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
252
252
|
]),
|
|
253
253
|
_: 1
|
|
254
254
|
}, 8, ["class"])) : m("", !0),
|
|
255
|
-
n.showRefresh ? (
|
|
255
|
+
n.showRefresh ? (s(), C(k, {
|
|
256
256
|
key: 2,
|
|
257
257
|
class: o(G.value),
|
|
258
258
|
onClick: e[5] || (e[5] = (t) => a.$emit("refresh"))
|
|
@@ -268,7 +268,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
268
268
|
}, 8, ["class"])) : m("", !0)
|
|
269
269
|
])
|
|
270
270
|
], 2),
|
|
271
|
-
F.value.length > 0 ? (
|
|
271
|
+
F.value.length > 0 ? (s(), c("div", {
|
|
272
272
|
key: 0,
|
|
273
273
|
class: o(I.value)
|
|
274
274
|
}, [
|
|
@@ -276,7 +276,7 @@ const X = { class: "border-b" }, Y = {
|
|
|
276
276
|
l("span", {
|
|
277
277
|
class: o(M.value)
|
|
278
278
|
}, "Active filters:", 2),
|
|
279
|
-
(
|
|
279
|
+
(s(!0), c(D, null, E(F.value, (t) => (s(), c("div", {
|
|
280
280
|
key: t.key,
|
|
281
281
|
class: o(P.value)
|
|
282
282
|
}, [
|
package/dist/components/Icon.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@fortawesome/vue-fontawesome"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("@fortawesome/vue-fontawesome"),d=require("../lib/icon.cjs"),m={__name:"Icon",props:{icon:{type:String,default:null},name:{type:String,default:null},prefix:{type:String,default:"fa"},size:{type:String,default:"md"},color:String,ariaLabel:String},setup(a){const l=a,n=e.computed(()=>l.icon||l.name),t=e.inject(d.ICON_ADAPTER_KEY,null),r=e.computed(()=>typeof t!="function"||!n.value?null:t({name:n.value,prefix:l.prefix})),o=e.computed(()=>({xs:"xs",sm:"sm",md:"lg",lg:"xl",xl:"2x",xxl:"3x"})[l.size]||"lg"),c=e.computed(()=>l.color?l.color.startsWith("text-")?l.color:`text-${l.color}`:"text-current"),i=e.computed(()=>[c.value,"inline-block"]);return(u,f)=>r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(i.value),"aria-hidden":!a.ariaLabel,"aria-label":a.ariaLabel,role:a.ariaLabel?"img":void 0},null,8,["class","aria-hidden","aria-label","role"])):n.value?(e.openBlock(),e.createBlock(e.unref(s.FontAwesomeIcon),{key:1,icon:[a.prefix,n.value],size:o.value,class:e.normalizeClass(i.value),"aria-hidden":!a.ariaLabel,"aria-label":a.ariaLabel,role:a.ariaLabel?"img":void 0},null,8,["icon","size","class","aria-hidden","aria-label","role"])):e.createCommentVNode("",!0)}};exports.default=m;
|
package/dist/components/Icon.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { computed as l, createBlock as
|
|
2
|
-
import { FontAwesomeIcon as
|
|
3
|
-
|
|
1
|
+
import { computed as l, inject as f, createBlock as o, createCommentVNode as x, openBlock as c, resolveDynamicComponent as b, normalizeClass as s, unref as v } from "vue";
|
|
2
|
+
import { FontAwesomeIcon as g } from "@fortawesome/vue-fontawesome";
|
|
3
|
+
import { ICON_ADAPTER_KEY as p } from "../lib/icon.js";
|
|
4
|
+
const h = {
|
|
4
5
|
__name: "Icon",
|
|
5
6
|
props: {
|
|
6
7
|
icon: {
|
|
@@ -22,8 +23,8 @@ const z = {
|
|
|
22
23
|
color: String,
|
|
23
24
|
ariaLabel: String
|
|
24
25
|
},
|
|
25
|
-
setup(
|
|
26
|
-
const
|
|
26
|
+
setup(e) {
|
|
27
|
+
const a = e, n = l(() => a.icon || a.name), r = f(p, null), i = l(() => typeof r != "function" || !n.value ? null : r({ name: n.value, prefix: a.prefix })), u = l(() => ({
|
|
27
28
|
xs: "xs",
|
|
28
29
|
sm: "sm",
|
|
29
30
|
md: "lg",
|
|
@@ -31,21 +32,27 @@ const z = {
|
|
|
31
32
|
lg: "xl",
|
|
32
33
|
xl: "2x",
|
|
33
34
|
xxl: "3x"
|
|
34
|
-
})[
|
|
35
|
-
|
|
35
|
+
})[a.size] || "lg"), d = l(() => a.color ? a.color.startsWith("text-") ? a.color : `text-${a.color}` : "text-current"), t = l(() => [
|
|
36
|
+
d.value,
|
|
36
37
|
"inline-block"
|
|
37
38
|
]);
|
|
38
|
-
return (
|
|
39
|
+
return (m, y) => i.value ? (c(), o(b(i.value), {
|
|
39
40
|
key: 0,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
class: s(t.value),
|
|
42
|
+
"aria-hidden": !e.ariaLabel,
|
|
43
|
+
"aria-label": e.ariaLabel,
|
|
44
|
+
role: e.ariaLabel ? "img" : void 0
|
|
45
|
+
}, null, 8, ["class", "aria-hidden", "aria-label", "role"])) : n.value ? (c(), o(v(g), {
|
|
46
|
+
key: 1,
|
|
47
|
+
icon: [e.prefix, n.value],
|
|
48
|
+
size: u.value,
|
|
49
|
+
class: s(t.value),
|
|
50
|
+
"aria-hidden": !e.ariaLabel,
|
|
51
|
+
"aria-label": e.ariaLabel,
|
|
52
|
+
role: e.ariaLabel ? "img" : void 0
|
|
53
|
+
}, null, 8, ["icon", "size", "class", "aria-hidden", "aria-label", "role"])) : x("", !0);
|
|
47
54
|
}
|
|
48
55
|
};
|
|
49
56
|
export {
|
|
50
|
-
|
|
57
|
+
h as default
|
|
51
58
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs");exports.default=e._sfc_main;
|
package/dist/components/Input.js
CHANGED
|
@@ -1,166 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import I from "./Icon.js";
|
|
3
|
-
const q = { class: "relative" }, N = {
|
|
4
|
-
key: 0,
|
|
5
|
-
class: "absolute left-3 top-1/2 transform -translate-y-1/2 pointer-events-none"
|
|
6
|
-
}, E = ["id", "type", "value", "placeholder", "disabled", "readonly", "required", "autocomplete", "aria-describedby", "aria-invalid"], j = {
|
|
7
|
-
key: 1,
|
|
8
|
-
class: "absolute right-3 top-1/2 transform -translate-y-1/2"
|
|
9
|
-
}, D = ["aria-label"], $ = {
|
|
10
|
-
__name: "Input",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: {
|
|
13
|
-
type: [String, Number],
|
|
14
|
-
default: ""
|
|
15
|
-
},
|
|
16
|
-
type: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: "text",
|
|
19
|
-
validator: (e) => ["text", "email", "password", "number", "tel", "url", "search", "date", "time", "color", "file"].includes(e)
|
|
20
|
-
},
|
|
21
|
-
placeholder: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
24
|
-
},
|
|
25
|
-
disabled: {
|
|
26
|
-
type: Boolean,
|
|
27
|
-
default: !1
|
|
28
|
-
},
|
|
29
|
-
readonly: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: !1
|
|
32
|
-
},
|
|
33
|
-
required: {
|
|
34
|
-
type: Boolean,
|
|
35
|
-
default: !1
|
|
36
|
-
},
|
|
37
|
-
size: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "md",
|
|
40
|
-
validator: (e) => ["sm", "md", "lg"].includes(e)
|
|
41
|
-
},
|
|
42
|
-
variant: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: "default",
|
|
45
|
-
validator: (e) => ["default", "error", "success"].includes(e)
|
|
46
|
-
},
|
|
47
|
-
iconLeft: {
|
|
48
|
-
type: [String, Object],
|
|
49
|
-
default: null
|
|
50
|
-
},
|
|
51
|
-
iconRight: {
|
|
52
|
-
type: [String, Object],
|
|
53
|
-
default: null
|
|
54
|
-
},
|
|
55
|
-
clearable: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: !1
|
|
58
|
-
},
|
|
59
|
-
clearLabel: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: "Clear input"
|
|
62
|
-
},
|
|
63
|
-
autocomplete: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: null
|
|
66
|
-
},
|
|
67
|
-
error: {
|
|
68
|
-
type: String,
|
|
69
|
-
default: null
|
|
70
|
-
},
|
|
71
|
-
id: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: null
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
emits: ["update:modelValue", "blur", "focus", "clear", "keydown"],
|
|
77
|
-
setup(e, { expose: y, emit: b }) {
|
|
78
|
-
const t = e, r = b, n = z(null), c = a(() => t.id || V()), p = (l) => {
|
|
79
|
-
r("update:modelValue", l.target.value);
|
|
80
|
-
}, v = (l) => {
|
|
81
|
-
r("blur", l);
|
|
82
|
-
}, g = (l) => {
|
|
83
|
-
r("focus", l);
|
|
84
|
-
}, h = (l) => {
|
|
85
|
-
r("keydown", l);
|
|
86
|
-
}, x = () => {
|
|
87
|
-
r("update:modelValue", ""), r("clear"), n.value?.focus();
|
|
88
|
-
}, S = a(() => !!t.error || t.variant === "error"), k = a(() => {
|
|
89
|
-
if (t.error) return `${c.value}-error`;
|
|
90
|
-
}), w = a(() => ({
|
|
91
|
-
sm: "px-3 py-1.5 text-sm",
|
|
92
|
-
md: "px-3 py-2 text-sm",
|
|
93
|
-
lg: "px-4 py-3 text-base"
|
|
94
|
-
})[t.size]), B = a(() => ({
|
|
95
|
-
default: "ui-border-strong focus:border-(--ui-primary) focus:ring-(--ui-primary)",
|
|
96
|
-
error: "border-(--ui-danger-soft) focus:border-(--ui-danger) focus:ring-(--ui-danger)",
|
|
97
|
-
success: "border-(--ui-success-soft) focus:border-(--ui-success) focus:ring-(--ui-success)"
|
|
98
|
-
})[t.variant]), d = a(() => ["ui-text", {
|
|
99
|
-
sm: "w-4 h-4",
|
|
100
|
-
md: "w-4 h-4",
|
|
101
|
-
lg: "w-5 h-5"
|
|
102
|
-
}[t.size]]), C = a(() => [
|
|
103
|
-
"block rounded-lg border ui-surface transition-colors duration-200",
|
|
104
|
-
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
105
|
-
"disabled:bg-(--ui-surface) disabled:text-(--ui-text) disabled:cursor-not-allowed",
|
|
106
|
-
"placeholder:text-(--ui-text-muted)",
|
|
107
|
-
t.type === "color" ? "w-20 h-12 cursor-pointer" : "w-full",
|
|
108
|
-
w.value,
|
|
109
|
-
B.value,
|
|
110
|
-
{
|
|
111
|
-
"pl-10": t.iconLeft,
|
|
112
|
-
"pr-10": t.iconRight || t.clearable
|
|
113
|
-
}
|
|
114
|
-
]);
|
|
115
|
-
return y({
|
|
116
|
-
focus: () => n.value?.focus(),
|
|
117
|
-
blur: () => n.value?.blur(),
|
|
118
|
-
select: () => n.value?.select()
|
|
119
|
-
}), (l, F) => (o(), s("div", q, [
|
|
120
|
-
e.iconLeft ? (o(), s("div", N, [
|
|
121
|
-
(o(), f(m(e.iconLeft), {
|
|
122
|
-
class: i(d.value)
|
|
123
|
-
}, null, 8, ["class"]))
|
|
124
|
-
])) : u("", !0),
|
|
125
|
-
R("input", {
|
|
126
|
-
id: c.value,
|
|
127
|
-
ref_key: "inputRef",
|
|
128
|
-
ref: n,
|
|
129
|
-
type: e.type,
|
|
130
|
-
value: e.modelValue,
|
|
131
|
-
placeholder: e.placeholder,
|
|
132
|
-
disabled: e.disabled,
|
|
133
|
-
readonly: e.readonly,
|
|
134
|
-
required: e.required,
|
|
135
|
-
autocomplete: e.autocomplete,
|
|
136
|
-
class: i(C.value),
|
|
137
|
-
"aria-describedby": k.value,
|
|
138
|
-
"aria-invalid": S.value,
|
|
139
|
-
onInput: p,
|
|
140
|
-
onBlur: v,
|
|
141
|
-
onFocus: g,
|
|
142
|
-
onKeydown: h
|
|
143
|
-
}, null, 42, E),
|
|
144
|
-
e.iconRight || e.clearable ? (o(), s("div", j, [
|
|
145
|
-
e.clearable && e.modelValue && !e.disabled ? (o(), s("button", {
|
|
146
|
-
key: 0,
|
|
147
|
-
class: "ui-text hover:text-(--ui-text) transition-colors",
|
|
148
|
-
type: "button",
|
|
149
|
-
"aria-label": e.clearLabel,
|
|
150
|
-
onClick: x
|
|
151
|
-
}, [
|
|
152
|
-
L(I, {
|
|
153
|
-
name: "x",
|
|
154
|
-
class: "w-5 h-5"
|
|
155
|
-
})
|
|
156
|
-
], 8, D)) : e.iconRight ? (o(), f(m(e.iconRight), {
|
|
157
|
-
key: 1,
|
|
158
|
-
class: i(d.value)
|
|
159
|
-
}, null, 8, ["class"])) : u("", !0)
|
|
160
|
-
])) : u("", !0)
|
|
161
|
-
]));
|
|
162
|
-
}
|
|
163
|
-
};
|
|
1
|
+
import { _ as f } from "../Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js";
|
|
164
2
|
export {
|
|
165
|
-
|
|
3
|
+
f as default
|
|
166
4
|
};
|