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