@oneb/ui-vue 0.0.38 → 0.0.39
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/OneBrowserMenu.vue_vue_type_script_setup_true_lang-562e2fdb.cjs +1 -0
- package/dist/{OneBrowserMenu.vue_vue_type_script_setup_true_lang-b65a0a0a.js → OneBrowserMenu.vue_vue_type_script_setup_true_lang-59fac367.js} +117 -117
- package/dist/button/index.cjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/dropdown/index.cjs +1 -1
- package/dist/dropdown/index.js +1 -1
- package/dist/form/index.cjs +1 -1
- package/dist/form/index.js +125 -125
- package/dist/index-3615f53c.cjs +1 -0
- package/dist/{index-72d69e4e.js → index-f136b5ea.js} +51 -51
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/layout/index.cjs +1 -1
- package/dist/layout/index.js +168 -168
- package/package.json +1 -1
- package/dist/OneBrowserMenu.vue_vue_type_script_setup_true_lang-4b350df0.cjs +0 -1
- package/dist/button/OneButton.vue.d.ts +0 -2
- package/dist/button/SpinnerIcon.vue.d.ts +0 -2
- package/dist/button/util.d.ts +0 -2
- package/dist/card/OneCard.vue.d.ts +0 -2
- package/dist/card/OneCardBody.vue.d.ts +0 -2
- package/dist/card/OneCardFooter.vue.d.ts +0 -2
- package/dist/card/OneCardHeader.vue.d.ts +0 -2
- package/dist/common/OneAvatar.vue.d.ts +0 -2
- package/dist/dropdown/OneBrowserMenu.vue.d.ts +0 -2
- package/dist/dropdown/OneDropdown.vue.d.ts +0 -2
- package/dist/dropdown/OneDropdownDivider.vue.d.ts +0 -2
- package/dist/dropdown/OneDropdownItem.vue.d.ts +0 -2
- package/dist/dropdown/OneUserMenu.vue.d.ts +0 -2
- package/dist/form/OneForm.vue.d.ts +0 -2
- package/dist/form/OneFormFeedback.vue.d.ts +0 -2
- package/dist/form/OneFormField.vue.d.ts +0 -2
- package/dist/form/OneFormInput.vue.d.ts +0 -2
- package/dist/form/OneFormLabel.vue.d.ts +0 -2
- package/dist/index-e804f148.cjs +0 -1
- package/dist/layout/IconOneb.vue.d.ts +0 -2
- package/dist/layout/OneMainLayout.vue.d.ts +0 -2
- package/dist/layout/OneSidebar.vue.d.ts +0 -2
- package/dist/layout/OneSidebarLink.vue.d.ts +0 -2
package/dist/form/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { r as
|
|
3
|
-
const
|
|
1
|
+
import { inject as _, computed as t, defineComponent as g, provide as E, openBlock as l, createElementBlock as n, withModifiers as L, renderSlot as C, unref as d, createTextVNode as M, toDisplayString as v, Fragment as $, renderList as V, createCommentVNode as h, createElementVNode as m, ref as q, onMounted as P, normalizeClass as b, createBlock as k, resolveDynamicComponent as z, createVNode as O } from "vue";
|
|
2
|
+
import { r as D } from "../XMarkIcon-51ef0691.js";
|
|
3
|
+
const T = {
|
|
4
4
|
id: {
|
|
5
5
|
type: String,
|
|
6
6
|
required: !1
|
|
@@ -9,7 +9,7 @@ const G = {
|
|
|
9
9
|
type: Object,
|
|
10
10
|
required: !1
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, G = {
|
|
13
13
|
id: {
|
|
14
14
|
type: String,
|
|
15
15
|
required: !1
|
|
@@ -31,7 +31,7 @@ const G = {
|
|
|
31
31
|
type: Array,
|
|
32
32
|
required: !1
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, H = {
|
|
35
35
|
name: {
|
|
36
36
|
type: String,
|
|
37
37
|
required: !1
|
|
@@ -40,12 +40,12 @@ const G = {
|
|
|
40
40
|
type: Array,
|
|
41
41
|
required: !1
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, J = {
|
|
44
44
|
label: {
|
|
45
45
|
type: String,
|
|
46
46
|
required: !1
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, K = {
|
|
49
49
|
id: {
|
|
50
50
|
type: String,
|
|
51
51
|
required: !1
|
|
@@ -107,7 +107,7 @@ const G = {
|
|
|
107
107
|
required: !1,
|
|
108
108
|
default: []
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, I = () => _(
|
|
111
111
|
"BaseForm",
|
|
112
112
|
() => ({
|
|
113
113
|
formId: t(() => {
|
|
@@ -116,7 +116,7 @@ const G = {
|
|
|
116
116
|
})
|
|
117
117
|
}),
|
|
118
118
|
!0
|
|
119
|
-
), S = () =>
|
|
119
|
+
), S = () => _(
|
|
120
120
|
"BaseFormField",
|
|
121
121
|
() => ({
|
|
122
122
|
inputId: t(() => {
|
|
@@ -126,55 +126,55 @@ const G = {
|
|
|
126
126
|
hasError: t(() => !1)
|
|
127
127
|
}),
|
|
128
128
|
!0
|
|
129
|
-
),
|
|
129
|
+
), Q = ["onSubmit", "id"], he = /* @__PURE__ */ g({
|
|
130
130
|
__name: "OneForm",
|
|
131
|
-
props:
|
|
131
|
+
props: T,
|
|
132
132
|
emits: ["submit"],
|
|
133
133
|
setup(u, { emit: a }) {
|
|
134
|
-
const r = u
|
|
135
|
-
|
|
134
|
+
const r = u;
|
|
135
|
+
E("BaseForm", {
|
|
136
136
|
formId: t(() => r.id),
|
|
137
137
|
validation: t(() => r.validation)
|
|
138
138
|
});
|
|
139
139
|
const i = () => {
|
|
140
|
-
|
|
140
|
+
a("submit");
|
|
141
141
|
};
|
|
142
|
-
return (
|
|
143
|
-
onSubmit:
|
|
144
|
-
id:
|
|
142
|
+
return (s, o) => (l(), n("form", {
|
|
143
|
+
onSubmit: L(i, ["prevent"]),
|
|
144
|
+
id: s.id,
|
|
145
145
|
class: "space-y-3"
|
|
146
146
|
}, [
|
|
147
|
-
|
|
148
|
-
], 40,
|
|
147
|
+
C(s.$slots, "default")
|
|
148
|
+
], 40, Q));
|
|
149
149
|
}
|
|
150
|
-
}),
|
|
150
|
+
}), R = ["for"], U = /* @__PURE__ */ g({
|
|
151
151
|
__name: "OneFormLabel",
|
|
152
|
-
props:
|
|
152
|
+
props: J,
|
|
153
153
|
setup(u) {
|
|
154
154
|
const { inputId: a } = S();
|
|
155
|
-
return (r,
|
|
156
|
-
for:
|
|
155
|
+
return (r, i) => (l(), n("label", {
|
|
156
|
+
for: d(a),
|
|
157
157
|
class: "block text-sm font-medium text-primary-content select-none"
|
|
158
158
|
}, [
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
C(r.$slots, "default", {}, () => [
|
|
160
|
+
M(v(r.label), 1)
|
|
161
161
|
])
|
|
162
|
-
], 8,
|
|
162
|
+
], 8, R));
|
|
163
163
|
}
|
|
164
|
-
}),
|
|
164
|
+
}), W = {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: "text-danger-content text-xs space-y-1"
|
|
167
|
-
},
|
|
167
|
+
}, X = /* @__PURE__ */ g({
|
|
168
168
|
__name: "OneFormFeedback",
|
|
169
|
-
props:
|
|
169
|
+
props: H,
|
|
170
170
|
setup(u) {
|
|
171
|
-
const a = u, { validation: r } =
|
|
172
|
-
return (o,
|
|
173
|
-
(l(!0), n(
|
|
171
|
+
const a = u, { validation: r } = I(), { inputName: i } = S(), s = t(() => i.value == null && a.name == null ? a.errors ?? [] : r.value == null ? a.errors ?? [] : (r.value ?? {})[a.name || i.value] ?? a.errors ?? []);
|
|
172
|
+
return (o, c) => s.value.length > 0 ? (l(), n("div", W, [
|
|
173
|
+
(l(!0), n($, null, V(s.value, (y) => (l(), n("div", { key: y }, v(y), 1))), 128))
|
|
174
174
|
])) : h("", !0);
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
|
-
function
|
|
177
|
+
function Y(u, a) {
|
|
178
178
|
return l(), n("svg", {
|
|
179
179
|
xmlns: "http://www.w3.org/2000/svg",
|
|
180
180
|
fill: "none",
|
|
@@ -183,19 +183,19 @@ function Z(u, a) {
|
|
|
183
183
|
stroke: "currentColor",
|
|
184
184
|
"aria-hidden": "true"
|
|
185
185
|
}, [
|
|
186
|
-
|
|
186
|
+
m("path", {
|
|
187
187
|
"stroke-linecap": "round",
|
|
188
188
|
"stroke-linejoin": "round",
|
|
189
189
|
d: "M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
|
|
190
190
|
}),
|
|
191
|
-
|
|
191
|
+
m("path", {
|
|
192
192
|
"stroke-linecap": "round",
|
|
193
193
|
"stroke-linejoin": "round",
|
|
194
194
|
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
195
195
|
})
|
|
196
196
|
]);
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function Z(u, a) {
|
|
199
199
|
return l(), n("svg", {
|
|
200
200
|
xmlns: "http://www.w3.org/2000/svg",
|
|
201
201
|
fill: "none",
|
|
@@ -204,42 +204,42 @@ function x(u, a) {
|
|
|
204
204
|
stroke: "currentColor",
|
|
205
205
|
"aria-hidden": "true"
|
|
206
206
|
}, [
|
|
207
|
-
|
|
207
|
+
m("path", {
|
|
208
208
|
"stroke-linecap": "round",
|
|
209
209
|
"stroke-linejoin": "round",
|
|
210
210
|
d: "M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"
|
|
211
211
|
})
|
|
212
212
|
]);
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const x = ["id", "disabled"], ee = ["selected"], re = ["selected", "value"], le = ["name", "id", "value", "placeholder", "disabled", "readonly"], ae = {
|
|
215
215
|
key: 2,
|
|
216
216
|
class: "flex w-full space-x-3 items-center"
|
|
217
|
-
},
|
|
217
|
+
}, ne = ["type", "name", "id", "disabled", "readonly", "checked"], oe = ["for"], te = {
|
|
218
218
|
key: 3,
|
|
219
219
|
class: "w-full space-y-1"
|
|
220
|
-
},
|
|
220
|
+
}, se = ["name", "id", "value", "disabled", "readonly", "checked"], de = ["for"], ie = {
|
|
221
221
|
key: 4,
|
|
222
222
|
class: "relative"
|
|
223
|
-
},
|
|
223
|
+
}, ue = { class: "absolute p-2 px-3 rounded-md h-full flex items-center select-none" }, pe = ["type", "name", "id", "value", "placeholder", "disabled", "readonly"], ce = /* @__PURE__ */ g({
|
|
224
224
|
__name: "OneFormInput",
|
|
225
|
-
props:
|
|
225
|
+
props: K,
|
|
226
226
|
emits: ["update:modelValue"],
|
|
227
227
|
setup(u, { emit: a }) {
|
|
228
|
-
const r = u,
|
|
229
|
-
|
|
230
|
-
r.autofocus &&
|
|
228
|
+
const r = u, { inputId: i, inputName: s, hasError: o } = S(), c = q(null), y = q(!1);
|
|
229
|
+
P(() => {
|
|
230
|
+
r.autofocus && c.value && c.value.focus();
|
|
231
231
|
});
|
|
232
|
-
const
|
|
232
|
+
const j = t(() => r.modelValue != null && r.modelValue !== ""), f = t(() => {
|
|
233
233
|
if (r.id)
|
|
234
234
|
return r.id;
|
|
235
235
|
const e = (i == null ? void 0 : i.value) || "";
|
|
236
236
|
return r.name ? `${e}-${r.name}` : e || "";
|
|
237
|
-
}),
|
|
238
|
-
|
|
239
|
-
},
|
|
237
|
+
}), N = () => {
|
|
238
|
+
a("update:modelValue", "");
|
|
239
|
+
}, A = t(() => {
|
|
240
240
|
const e = {
|
|
241
241
|
"shadow-sm": r.type !== "range",
|
|
242
|
-
"border-danger-base":
|
|
242
|
+
"border-danger-base": o.value || r.invalid,
|
|
243
243
|
"pl-10": r.icon != null,
|
|
244
244
|
"pr-10": r.type === "password",
|
|
245
245
|
"rounded-full": r.rounded,
|
|
@@ -248,19 +248,19 @@ const ee = ["id", "disabled"], re = ["selected"], le = ["selected", "value"], ae
|
|
|
248
248
|
"py-2.5": r.large,
|
|
249
249
|
"py-2": !r.large
|
|
250
250
|
};
|
|
251
|
-
return r.inputClass != null && (typeof r.inputClass == "string" ? e[r.inputClass] = !0 : r.inputClass instanceof Array && r.inputClass.forEach((
|
|
252
|
-
e[
|
|
251
|
+
return r.inputClass != null && (typeof r.inputClass == "string" ? e[r.inputClass] = !0 : r.inputClass instanceof Array && r.inputClass.forEach((F) => {
|
|
252
|
+
e[F] = !0;
|
|
253
253
|
})), e;
|
|
254
|
-
}),
|
|
255
|
-
r.type === "checkbox" ?
|
|
254
|
+
}), w = (e) => {
|
|
255
|
+
r.type === "checkbox" ? a("update:modelValue", e.target.checked) : a("update:modelValue", e.target.value);
|
|
256
256
|
};
|
|
257
|
-
return (e,
|
|
257
|
+
return (e, F) => e.type === "select" ? (l(), n("select", {
|
|
258
258
|
key: 0,
|
|
259
259
|
id: f.value,
|
|
260
260
|
ref_key: "inputElement",
|
|
261
|
-
ref:
|
|
261
|
+
ref: c,
|
|
262
262
|
class: b(["border border-primary-stroke px-3 w-full", {
|
|
263
|
-
"border-danger-base":
|
|
263
|
+
"border-danger-base": d(o) || e.invalid,
|
|
264
264
|
"text-secondary-content": e.modelValue === "" || e.modelValue == null,
|
|
265
265
|
"rounded-full": e.rounded,
|
|
266
266
|
"rounded-md": !e.rounded,
|
|
@@ -275,21 +275,21 @@ const ee = ["id", "disabled"], re = ["selected"], le = ["selected", "value"], ae
|
|
|
275
275
|
selected: e.modelValue === "" || e.modelValue == null,
|
|
276
276
|
disabled: "",
|
|
277
277
|
hidden: ""
|
|
278
|
-
}, v(e.placeholder), 9,
|
|
279
|
-
(l(!0), n(
|
|
280
|
-
selected:
|
|
281
|
-
key:
|
|
282
|
-
value:
|
|
283
|
-
}, v(
|
|
284
|
-
], 10,
|
|
278
|
+
}, v(e.placeholder), 9, ee)) : h("", !0),
|
|
279
|
+
(l(!0), n($, null, V(e.options, (p) => (l(), n("option", {
|
|
280
|
+
selected: p.key === e.modelValue,
|
|
281
|
+
key: p.key,
|
|
282
|
+
value: p.key
|
|
283
|
+
}, v(p.value), 9, re))), 128))
|
|
284
|
+
], 10, x)) : e.type === "textarea" ? (l(), n("textarea", {
|
|
285
285
|
key: 1,
|
|
286
|
-
name: e.name || s
|
|
286
|
+
name: e.name || d(s),
|
|
287
287
|
id: f.value,
|
|
288
288
|
value: e.modelValue,
|
|
289
|
-
onInput:
|
|
289
|
+
onInput: w,
|
|
290
290
|
rows: "3",
|
|
291
291
|
class: b(["border border-primary-stroke px-3 w-full placeholder-gray-400", {
|
|
292
|
-
"border-danger-base":
|
|
292
|
+
"border-danger-base": d(o),
|
|
293
293
|
"rounded-3xl": e.rounded,
|
|
294
294
|
"rounded-md": !e.rounded,
|
|
295
295
|
"text-lg": e.large,
|
|
@@ -300,105 +300,105 @@ const ee = ["id", "disabled"], re = ["selected"], le = ["selected", "value"], ae
|
|
|
300
300
|
disabled: e.disabled,
|
|
301
301
|
readonly: e.readonly,
|
|
302
302
|
ref_key: "inputElement",
|
|
303
|
-
ref:
|
|
304
|
-
}, null, 42,
|
|
305
|
-
|
|
303
|
+
ref: c
|
|
304
|
+
}, null, 42, le)) : e.type === "checkbox" ? (l(), n("div", ae, [
|
|
305
|
+
m("input", {
|
|
306
306
|
type: e.type,
|
|
307
|
-
name: e.name || s
|
|
307
|
+
name: e.name || d(s),
|
|
308
308
|
id: f.value,
|
|
309
309
|
value: !0,
|
|
310
|
-
onInput:
|
|
310
|
+
onInput: w,
|
|
311
311
|
disabled: e.disabled,
|
|
312
312
|
readonly: e.readonly,
|
|
313
313
|
class: b(["rounded-md border border-primary-stroke px-2 py-2 shadow-sm", {
|
|
314
|
-
"border-danger-base":
|
|
314
|
+
"border-danger-base": d(o) || e.invalid
|
|
315
315
|
}]),
|
|
316
316
|
checked: e.modelValue === !0,
|
|
317
317
|
ref_key: "inputElement",
|
|
318
|
-
ref:
|
|
319
|
-
}, null, 42,
|
|
320
|
-
|
|
318
|
+
ref: c
|
|
319
|
+
}, null, 42, ne),
|
|
320
|
+
m("label", {
|
|
321
321
|
for: f.value,
|
|
322
322
|
class: "text-primary-content select-none"
|
|
323
|
-
}, v(e.placeholder), 9,
|
|
324
|
-
])) : e.type === "radio" ? (l(), n("div",
|
|
325
|
-
(l(!0), n(
|
|
326
|
-
key:
|
|
323
|
+
}, v(e.placeholder), 9, oe)
|
|
324
|
+
])) : e.type === "radio" ? (l(), n("div", te, [
|
|
325
|
+
(l(!0), n($, null, V(e.options, (p, B) => (l(), n("div", {
|
|
326
|
+
key: p.key,
|
|
327
327
|
class: "flex w-full space-x-3 items-center"
|
|
328
328
|
}, [
|
|
329
|
-
|
|
329
|
+
m("input", {
|
|
330
330
|
type: "radio",
|
|
331
|
-
name: e.name || s
|
|
332
|
-
id: `${f.value}-${
|
|
333
|
-
value:
|
|
334
|
-
onInput:
|
|
331
|
+
name: e.name || d(s),
|
|
332
|
+
id: `${f.value}-${B}`,
|
|
333
|
+
value: p.key,
|
|
334
|
+
onInput: w,
|
|
335
335
|
disabled: e.disabled,
|
|
336
336
|
readonly: e.readonly,
|
|
337
337
|
class: b(["rounded-md border border-primary-stroke px-3 py-2 shadow-sm", {
|
|
338
|
-
"border-danger-base":
|
|
338
|
+
"border-danger-base": d(o) || e.invalid
|
|
339
339
|
}]),
|
|
340
|
-
checked:
|
|
340
|
+
checked: p.key === e.modelValue,
|
|
341
341
|
ref_for: !0,
|
|
342
342
|
ref_key: "inputElement",
|
|
343
|
-
ref:
|
|
344
|
-
}, null, 42,
|
|
345
|
-
|
|
346
|
-
for: `${f.value}-${
|
|
343
|
+
ref: c
|
|
344
|
+
}, null, 42, se),
|
|
345
|
+
m("label", {
|
|
346
|
+
for: `${f.value}-${B}`,
|
|
347
347
|
class: "text-primary-content select-none"
|
|
348
|
-
}, v(
|
|
348
|
+
}, v(p.value), 9, de)
|
|
349
349
|
]))), 128))
|
|
350
|
-
])) : (l(), n("div",
|
|
351
|
-
|
|
352
|
-
e.icon ? (l(), k(
|
|
350
|
+
])) : (l(), n("div", ie, [
|
|
351
|
+
m("div", ue, [
|
|
352
|
+
e.icon ? (l(), k(z(e.icon), {
|
|
353
353
|
key: 0,
|
|
354
354
|
class: "w-5 h-5 text-primary-content"
|
|
355
355
|
})) : h("", !0)
|
|
356
356
|
]),
|
|
357
|
-
|
|
358
|
-
type:
|
|
359
|
-
name: e.name || s
|
|
357
|
+
m("input", {
|
|
358
|
+
type: y.value ? "text" : e.type,
|
|
359
|
+
name: e.name || d(s),
|
|
360
360
|
id: f.value,
|
|
361
361
|
value: e.modelValue,
|
|
362
|
-
onInput:
|
|
362
|
+
onInput: w,
|
|
363
363
|
placeholder: e.placeholder,
|
|
364
364
|
disabled: e.disabled,
|
|
365
365
|
readonly: e.readonly,
|
|
366
|
-
class: b(["border border-primary-stroke w-full px-3 placeholder-gray-400",
|
|
366
|
+
class: b(["border border-primary-stroke w-full px-3 placeholder-gray-400", A.value]),
|
|
367
367
|
ref_key: "inputElement",
|
|
368
|
-
ref:
|
|
369
|
-
}, null, 42,
|
|
370
|
-
e.clearable &&
|
|
368
|
+
ref: c
|
|
369
|
+
}, null, 42, pe),
|
|
370
|
+
e.clearable && j.value ? (l(), n("div", {
|
|
371
371
|
key: 0,
|
|
372
|
-
onClick:
|
|
372
|
+
onClick: N,
|
|
373
373
|
class: "absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"
|
|
374
374
|
}, [
|
|
375
|
-
|
|
375
|
+
O(d(D), { class: "w-5 h-5 text-secondary-content hover:text-primary-base" })
|
|
376
376
|
])) : e.type === "password" ? (l(), n("div", {
|
|
377
377
|
key: 1,
|
|
378
|
-
onClick:
|
|
378
|
+
onClick: F[0] || (F[0] = (p) => y.value = !y.value),
|
|
379
379
|
class: "absolute p-2 px-3 rounded-md h-full flex items-center right-0 top-0 hover:cursor-pointer select-none"
|
|
380
380
|
}, [
|
|
381
|
-
|
|
381
|
+
y.value ? (l(), k(d(Z), {
|
|
382
382
|
key: 0,
|
|
383
383
|
class: "w-5 h-5 text-primary-content hover:text-primary-base"
|
|
384
|
-
})) : (l(), k(
|
|
384
|
+
})) : (l(), k(d(Y), {
|
|
385
385
|
key: 1,
|
|
386
386
|
class: "w-5 h-5 text-secondary-content hover:text-primary-base"
|
|
387
387
|
}))
|
|
388
388
|
])) : h("", !0)
|
|
389
389
|
]));
|
|
390
390
|
}
|
|
391
|
-
}),
|
|
391
|
+
}), me = { class: "space-y-1" }, ye = {
|
|
392
392
|
key: 2,
|
|
393
393
|
class: "text-xs text-secondary-content select-none"
|
|
394
|
-
},
|
|
394
|
+
}, be = /* @__PURE__ */ g({
|
|
395
395
|
__name: "OneFormField",
|
|
396
|
-
props:
|
|
396
|
+
props: G,
|
|
397
397
|
setup(u) {
|
|
398
|
-
const a = u, { formId: r, validation:
|
|
399
|
-
() => a.errors != null && a.errors.length > 0 ? !0 : a.name == null ? !1 : (
|
|
398
|
+
const a = u, { formId: r, validation: i } = I(), s = t(
|
|
399
|
+
() => a.errors != null && a.errors.length > 0 ? !0 : a.name == null ? !1 : (i.value ?? {})[a.name] != null
|
|
400
400
|
);
|
|
401
|
-
return
|
|
401
|
+
return E("BaseFormField", {
|
|
402
402
|
inputId: t(() => {
|
|
403
403
|
const o = r.value || "form";
|
|
404
404
|
if (a.id != null)
|
|
@@ -407,26 +407,26 @@ const ee = ["id", "disabled"], re = ["selected"], le = ["selected", "value"], ae
|
|
|
407
407
|
return `${o}-field-${a.name}`;
|
|
408
408
|
}),
|
|
409
409
|
inputName: t(() => a.name),
|
|
410
|
-
hasError:
|
|
411
|
-
}), (o,
|
|
412
|
-
o.label ? (l(), k(
|
|
410
|
+
hasError: s
|
|
411
|
+
}), (o, c) => (l(), n("div", me, [
|
|
412
|
+
o.label ? (l(), k(U, {
|
|
413
413
|
key: 0,
|
|
414
414
|
label: o.label
|
|
415
415
|
}, null, 8, ["label"])) : h("", !0),
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
C(o.$slots, "default", {}, () => [
|
|
417
|
+
O(ce)
|
|
418
418
|
]),
|
|
419
|
-
|
|
419
|
+
s.value ? (l(), k(X, {
|
|
420
420
|
key: 1,
|
|
421
421
|
errors: o.errors
|
|
422
|
-
}, null, 8, ["errors"])) : o.hint.length > 0 ? (l(), n("p",
|
|
422
|
+
}, null, 8, ["errors"])) : o.hint.length > 0 ? (l(), n("p", ye, v(o.hint), 1)) : h("", !0)
|
|
423
423
|
]));
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
426
|
export {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
he as OneForm,
|
|
428
|
+
X as OneFormFeedback,
|
|
429
|
+
be as OneFormField,
|
|
430
430
|
ce as OneFormInput,
|
|
431
|
-
|
|
431
|
+
U as OneFormLabel
|
|
432
432
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),b=require("./_plugin-vue_export-helper-f246444f.cjs");const g={},h={class:"spinner",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{animation:"one-sp-ico-rot 2.7s linear infinite"}},f=e.createElementVNode("circle",{style:{"stroke-linecap":"round",animation:"one-sp-ico-dash 1.7s ease-in-out infinite"},class:"opacity-75",cx:"12",cy:"12",r:"8",fill:"none",stroke:"currentColor","stroke-width":"2"},null,-1),v=[f];function y(o,n){return e.openBlock(),e.createElementBlock("svg",h,v)}const i=b._export_sfc(g,[["render",y]]),k={variant:{type:String,default:"primary"},size:{type:String,default:"md"},label:{type:String},icon:{type:[Function,Object]},isLoading:{type:Boolean},isSubmit:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},active:{type:Boolean,default:!1},iconClass:{type:[String,Array]},iconAfter:{type:[Function,Object]}},w=["relative inline-flex","border","items-center justify-center","font-medium whitespace-nowrap","disabled:opacity-50 disabled:cursor-default","focus:outline-none focus:ring-2 focus:ring-offset-2","transition-colors duration-200"],C={sm:["px-2 py-1 text-sm"],md:["px-3 py-2"],lg:["px-4 py-3"]},_={primary:["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"],secondary:["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"],info:["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"],success:["rounded-md border-transparent bg-success-base disabled:bg-success-hover text-white text-sm hover:bg-success-hover focus:ring-success-glow"],warning:["rounded-md border-transparent bg-warning-base disabled:bg-warning-hover text-white text-sm hover:bg-warning-hover focus:ring-warning-glow"],danger:["rounded-md border-transparent bg-danger-base disabled:bg-danger-hover text-white text-sm hover:bg-danger-hover focus:ring-danger-glow"],touch:["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"],link:["rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"],none:["rounded-md border-transparent text-gray-500"]},x=(o="primary",n="md")=>{const s=[];return s.push(...w),s.push(..._[o]??[]),o!=="touch"&&s.push(...C[n]??[]),s},B=["disabled","title","type","onClick"],z=e.defineComponent({__name:"OneButton",props:k,emits:["click"],setup(o,{emit:n}){const s=o,c=()=>{n("click")},r=e.computed(()=>s.icon),a=e.computed(()=>s.iconAfter),u=e.computed(()=>{const t=x(s.variant,s.size);return s.variant==="touch"&&s.active&&t.push("bg-primary-body-active"),t}),d=e.computed(()=>s.disabled||s.isLoading),p=e.computed(()=>s.label&&s.label.length>0&&s.variant!=="touch"),m=e.computed(()=>{const t=["inline-block text-ellipsis overflow-hidden"];return r.value!=null&&t.push("ml-2"),a.value!=null&&t.push("mr-2"),t}),l=e.computed(()=>{const t=[];return s.size==="sm"?t.push("w-3 h-3"):s.size==="lg"?t.push("w-5 h-5"):t.push("w-4 h-4"),typeof s.iconClass=="string"?t.push(s.iconClass):s.iconClass instanceof Array&&t.push(...s.iconClass),t});return(t,L)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(u.value),disabled:d.value,title:t.label,type:t.isSubmit?"submit":"button",onClick:e.withModifiers(c,["stop"])},[r.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(i,{key:0,class:e.normalizeClass(l.value)},null,8,["class"])):r.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:1,class:e.normalizeClass(l.value)},null,8,["class"])):e.createCommentVNode("",!0),p.value?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(m.value)},e.toDisplayString(t.label),3)):e.createCommentVNode("",!0),a.value!=null&&t.isLoading?(e.openBlock(),e.createBlock(i,{key:3,class:e.normalizeClass(l.value)},null,8,["class"])):a.value!=null?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{key:4,class:e.normalizeClass(l.value)},null,8,["class"])):e.createCommentVNode("",!0)],10,B))}});exports.SpinnerIcon=i;exports._sfc_main=z;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { openBlock as n, createElementBlock as
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { openBlock as n, createElementBlock as p, createElementVNode as w, defineComponent as x, computed as t, normalizeClass as o, withModifiers as _, createBlock as u, resolveDynamicComponent as b, createCommentVNode as d, toDisplayString as k } from "vue";
|
|
2
|
+
import { _ as C } from "./_plugin-vue_export-helper-dad06003.js";
|
|
3
|
+
const B = {}, L = {
|
|
4
4
|
class: "spinner",
|
|
5
5
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6
6
|
viewBox: "0 0 24 24",
|
|
7
7
|
style: { animation: "one-sp-ico-rot 2.7s linear infinite" }
|
|
8
|
-
},
|
|
8
|
+
}, S = /* @__PURE__ */ w("circle", {
|
|
9
9
|
style: { "stroke-linecap": "round", animation: "one-sp-ico-dash 1.7s ease-in-out infinite" },
|
|
10
10
|
class: "opacity-75",
|
|
11
11
|
cx: "12",
|
|
@@ -14,13 +14,13 @@ const L = {}, S = {
|
|
|
14
14
|
fill: "none",
|
|
15
15
|
stroke: "currentColor",
|
|
16
16
|
"stroke-width": "2"
|
|
17
|
-
}, null, -1),
|
|
18
|
-
|
|
17
|
+
}, null, -1), z = [
|
|
18
|
+
S
|
|
19
19
|
];
|
|
20
|
-
function
|
|
21
|
-
return n(),
|
|
20
|
+
function I(r, a) {
|
|
21
|
+
return n(), p("svg", L, z);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const m = /* @__PURE__ */ C(B, [["render", I]]), A = {
|
|
24
24
|
variant: {
|
|
25
25
|
type: String,
|
|
26
26
|
default: "primary"
|
|
@@ -56,7 +56,7 @@ const g = /* @__PURE__ */ B(L, [["render", A]]), j = {
|
|
|
56
56
|
iconAfter: {
|
|
57
57
|
type: [Function, Object]
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, j = [
|
|
60
60
|
"relative inline-flex",
|
|
61
61
|
"border",
|
|
62
62
|
"items-center justify-center",
|
|
@@ -64,11 +64,11 @@ const g = /* @__PURE__ */ B(L, [["render", A]]), j = {
|
|
|
64
64
|
"disabled:opacity-50 disabled:cursor-default",
|
|
65
65
|
"focus:outline-none focus:ring-2 focus:ring-offset-2",
|
|
66
66
|
"transition-colors duration-200"
|
|
67
|
-
],
|
|
67
|
+
], D = {
|
|
68
68
|
sm: ["px-2 py-1 text-sm"],
|
|
69
69
|
md: ["px-3 py-2"],
|
|
70
70
|
lg: ["px-4 py-3"]
|
|
71
|
-
},
|
|
71
|
+
}, O = {
|
|
72
72
|
primary: ["rounded-md border-transparent bg-primary-base disabled:bg-primary-hover text-sm text-white hover:bg-primary-hover focus:ring-primary-glow"],
|
|
73
73
|
secondary: ["rounded-md border-primary-stroke bg-primary-body disabled:bg-primary-body-hover text-black text-sm hover:bg-primary-body-hover focus:ring-tertiary-glow"],
|
|
74
74
|
info: ["rounded-md border-transparent bg-info-base disabled:bg-info-hover text-white text-sm hover:bg-info-hover focus:ring-info-glow"],
|
|
@@ -78,57 +78,57 @@ const g = /* @__PURE__ */ B(L, [["render", A]]), j = {
|
|
|
78
78
|
touch: ["rounded-full border-transparent text-black hover:bg-primary-body-hover hover:shadow p-3 text-sm focus:ring-tertiary-glow"],
|
|
79
79
|
link: ["rounded-md border-transparent items-center text-info-base hover:text-info-hover text-sm"],
|
|
80
80
|
none: ["rounded-md border-transparent text-gray-500"]
|
|
81
|
-
},
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
},
|
|
81
|
+
}, E = (r = "primary", a = "md") => {
|
|
82
|
+
const e = [];
|
|
83
|
+
return e.push(...j), e.push(...O[r] ?? []), r !== "touch" && e.push(...D[a] ?? []), e;
|
|
84
|
+
}, F = ["disabled", "title", "type", "onClick"], M = /* @__PURE__ */ x({
|
|
85
85
|
__name: "OneButton",
|
|
86
|
-
props:
|
|
86
|
+
props: A,
|
|
87
87
|
emits: ["click"],
|
|
88
|
-
setup(
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
}),
|
|
95
|
-
const
|
|
88
|
+
setup(r, { emit: a }) {
|
|
89
|
+
const e = r, g = () => {
|
|
90
|
+
a("click");
|
|
91
|
+
}, i = t(() => e.icon), l = t(() => e.iconAfter), h = t(() => {
|
|
92
|
+
const s = E(e.variant, e.size);
|
|
93
|
+
return e.variant === "touch" && e.active && s.push("bg-primary-body-active"), s;
|
|
94
|
+
}), f = t(() => e.disabled || e.isLoading), y = t(() => e.label && e.label.length > 0 && e.variant !== "touch"), v = t(() => {
|
|
95
|
+
const s = [
|
|
96
96
|
"inline-block text-ellipsis overflow-hidden"
|
|
97
97
|
];
|
|
98
|
-
return
|
|
99
|
-
}),
|
|
100
|
-
const
|
|
101
|
-
return
|
|
98
|
+
return i.value != null && s.push("ml-2"), l.value != null && s.push("mr-2"), s;
|
|
99
|
+
}), c = t(() => {
|
|
100
|
+
const s = [];
|
|
101
|
+
return e.size === "sm" ? s.push("w-3 h-3") : e.size === "lg" ? s.push("w-5 h-5") : s.push("w-4 h-4"), typeof e.iconClass == "string" ? s.push(e.iconClass) : e.iconClass instanceof Array && s.push(...e.iconClass), s;
|
|
102
102
|
});
|
|
103
|
-
return (
|
|
104
|
-
class:
|
|
105
|
-
disabled:
|
|
106
|
-
title:
|
|
107
|
-
type:
|
|
108
|
-
onClick:
|
|
103
|
+
return (s, N) => (n(), p("button", {
|
|
104
|
+
class: o(h.value),
|
|
105
|
+
disabled: f.value,
|
|
106
|
+
title: s.label,
|
|
107
|
+
type: s.isSubmit ? "submit" : "button",
|
|
108
|
+
onClick: _(g, ["stop"])
|
|
109
109
|
}, [
|
|
110
|
-
|
|
110
|
+
i.value != null && s.isLoading ? (n(), u(m, {
|
|
111
111
|
key: 0,
|
|
112
|
-
class:
|
|
113
|
-
}, null, 8, ["class"])) :
|
|
112
|
+
class: o(c.value)
|
|
113
|
+
}, null, 8, ["class"])) : i.value != null ? (n(), u(b(i.value), {
|
|
114
114
|
key: 1,
|
|
115
|
-
class:
|
|
116
|
-
}, null, 8, ["class"])) :
|
|
117
|
-
|
|
115
|
+
class: o(c.value)
|
|
116
|
+
}, null, 8, ["class"])) : d("", !0),
|
|
117
|
+
y.value ? (n(), p("span", {
|
|
118
118
|
key: 2,
|
|
119
|
-
class:
|
|
120
|
-
},
|
|
121
|
-
|
|
119
|
+
class: o(v.value)
|
|
120
|
+
}, k(s.label), 3)) : d("", !0),
|
|
121
|
+
l.value != null && s.isLoading ? (n(), u(m, {
|
|
122
122
|
key: 3,
|
|
123
|
-
class:
|
|
124
|
-
}, null, 8, ["class"])) :
|
|
123
|
+
class: o(c.value)
|
|
124
|
+
}, null, 8, ["class"])) : l.value != null ? (n(), u(b(l.value), {
|
|
125
125
|
key: 4,
|
|
126
|
-
class:
|
|
127
|
-
}, null, 8, ["class"])) :
|
|
128
|
-
], 10,
|
|
126
|
+
class: o(c.value)
|
|
127
|
+
}, null, 8, ["class"])) : d("", !0)
|
|
128
|
+
], 10, F));
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
export {
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
m as S,
|
|
133
|
+
M as _
|
|
134
134
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-3615f53c.cjs"),r=require("./card/index.cjs"),e=require("./form/index.cjs"),n=require("./OneBrowserMenu.vue_vue_type_script_setup_true_lang-562e2fdb.cjs"),O=require("./dropdown/index.cjs"),a=require("./common/index.cjs");require("vue");require("./_plugin-vue_export-helper-f246444f.cjs");require("./XMarkIcon-f94baa4c.cjs");exports.OneButton=o._sfc_main;exports.OneCard=r.OneCard;exports.OneCardBody=r.OneCardBody;exports.OneCardFooter=r.OneCardFooter;exports.OneCardHeader=r.OneCardHeader;exports.OneForm=e.OneForm;exports.OneFormFeedback=e.OneFormFeedback;exports.OneFormField=e.OneFormField;exports.OneFormInput=e.OneFormInput;exports.OneFormLabel=e.OneFormLabel;exports.OneBrowserMenu=n._sfc_main$3;exports.OneDropdown=n._sfc_main;exports.OneDropdownItem=n._sfc_main$1;exports.OneUserMenu=n._sfc_main$2;exports.OneDropdownDivider=O.OneDropdownDivider;exports.OneAvatar=a.OneAvatar;
|