dreambuilders-ui 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs DELETED
@@ -1,516 +0,0 @@
1
- import { Fragment as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useSlots as b, useTemplateRef as x, watch as S, withCtx as C, withModifiers as w } from "vue";
2
- //#region src/components/button/src/Button.vue?vue&type=script&setup=true&lang.ts
3
- var T = {
4
- key: 0,
5
- class: "iconfont loading icon-loading"
6
- }, E = /*@__PURE__*/ l({
7
- name: "DbButton",
8
- __name: "Button",
9
- props: {
10
- type: { default: "default" },
11
- size: { default: "default" },
12
- nativeType: { default: "button" },
13
- tag: { default: "button" },
14
- loadingIcon: { default: "" },
15
- icon: { default: "" },
16
- color: { default: "" },
17
- disabled: {
18
- type: Boolean,
19
- default: !1
20
- },
21
- loading: {
22
- type: Boolean,
23
- default: !1
24
- },
25
- plain: {
26
- type: Boolean,
27
- default: !1
28
- },
29
- round: {
30
- type: Boolean,
31
- default: !1
32
- },
33
- dashed: {
34
- type: Boolean,
35
- default: !1
36
- },
37
- circle: {
38
- type: Boolean,
39
- default: !1
40
- },
41
- link: {
42
- type: Boolean,
43
- default: !1
44
- },
45
- text: {
46
- type: Boolean,
47
- default: !1
48
- },
49
- autofocus: {
50
- type: Boolean,
51
- default: !1
52
- }
53
- },
54
- emits: ["click"],
55
- setup(e, { emit: t }) {
56
- let o = e, s = t, c = n(() => o.disabled || o.loading), l = n(() => [
57
- "db-button",
58
- `db-button-type__${o.type}`,
59
- `db-button-size__${o.size}`,
60
- {
61
- "is-disabled": c.value,
62
- "is-plain": o.plain,
63
- "is-round": o.round,
64
- "is-dashed": o.dashed,
65
- "is-circle": o.circle,
66
- "is-link": o.link,
67
- "is-text": o.text,
68
- "is-loading": o.loading
69
- }
70
- ]), u = n(() => {
71
- if (!o.color) return {};
72
- let e = o.color, t = {
73
- "--db-button-background-color": e,
74
- "--db-button-border-color": e,
75
- "--db-button-color": "#ffffff",
76
- "--db-button-background-color-hover": `color-mix(in srgb, ${e}, white 30%)`,
77
- "--db-button-border-color-hover": `color-mix(in srgb, ${e}, white 30%)`,
78
- "--db-button-color-hover": "#ffffff",
79
- "--db-button-background-color-active": `color-mix(in srgb, ${e}, white 30%)`,
80
- "--db-button-border-color-active": `color-mix(in srgb, ${e}, white 30%)`,
81
- "--db-button-color-active": "#ffffff"
82
- };
83
- return o.plain && (t["--db-button-background-color"] = "transparent", t["--db-button-background-color-hover"] = "transparent", t["--db-button-background-color-active"] = "transparent", t["--db-button-color"] = e, t["--db-button-color-hover"] = `color-mix(in srgb, ${e}, white 30%)`, t["--db-button-color-active"] = `color-mix(in srgb, ${e}, white 30%)`, t["--db-button-border-color"] = e, t["--db-button-border-color-hover"] = `color-mix(in srgb, ${e}, white 30%)`, t["--db-button-border-color-active"] = `color-mix(in srgb, ${e}, white 30%)`), o.text && (t["--db-button-background-color"] = "transparent", t["--db-button-background-color-hover"] = `color-mix(in srgb, ${e}, white 92%)`, t["--db-button-background-color-active"] = `color-mix(in srgb, ${e}, white 92%)`, t["--db-button-border-color"] = "transparent", t["--db-button-border-color-hover"] = `color-mix(in srgb, ${e}, white 92%)`, t["--db-button-border-color-active"] = `color-mix(in srgb, ${e}, white 92%)`, t["--db-button-color"] = e, t["--db-button-color-hover"] = e, t["--db-button-color-active"] = e), o.link && (t["--db-button-background-color"] = "transparent", t["--db-button-background-color-hover"] = "transparent", t["--db-button-background-color-active"] = "transparent", t["--db-button-border-color"] = "transparent", t["--db-button-border-color-hover"] = "transparent", t["--db-button-border-color-active"] = "transparent", t["--db-button-color"] = e, t["--db-button-color-hover"] = `color-mix(in srgb, ${e}, white 30%)`, t["--db-button-color-active"] = `color-mix(in srgb, ${e}, white 30%)`), t;
84
- });
85
- function p(e) {
86
- c.value || s("click", e);
87
- }
88
- return (t, n) => (m(), r(_(e.tag), {
89
- class: d(l.value),
90
- type: e.nativeType,
91
- disabled: c.value,
92
- autofocus: e.autofocus,
93
- style: f(u.value),
94
- onClick: p
95
- }, {
96
- default: C(() => [
97
- e.loading && !e.loadingIcon ? (m(), a("i", T)) : i("", !0),
98
- e.loading && e.loadingIcon ? (m(), a("image", {
99
- key: 1,
100
- class: d([
101
- "iconfont",
102
- "loading",
103
- `icon-${e.loadingIcon}`
104
- ])
105
- }, null, 2)) : i("", !0),
106
- e.icon && !e.loading ? (m(), a("i", {
107
- key: 2,
108
- class: d(["iconfont", `icon-${e.icon}`])
109
- }, null, 2)) : i("", !0),
110
- g(t.$slots, "default", {}, void 0, !0)
111
- ]),
112
- _: 3
113
- }, 8, [
114
- "class",
115
- "type",
116
- "disabled",
117
- "autofocus",
118
- "style"
119
- ]));
120
- }
121
- }), D = (e, t) => {
122
- let n = e.__vccOpts || e;
123
- for (let [e, r] of t) n[e] = r;
124
- return n;
125
- }, O = /*#__PURE__*/ D(E, [["__scopeId", "data-v-bc3a041a"]]), k = /*#__PURE__*/ D(/* @__PURE__ */ l({
126
- name: "DbButtonGroup",
127
- __name: "ButtonGroup",
128
- props: { direction: { default: "horizontal" } },
129
- setup(e) {
130
- let t = e, r = n(() => ["db-button-group", `db-button-group-direction__${t.direction}`]);
131
- return (e, t) => (m(), a("div", { class: d(r.value) }, [g(e.$slots, "default", {}, void 0, !0)], 2));
132
- }
133
- }), [["__scopeId", "data-v-d8f67fe3"]]), A = {
134
- key: 0,
135
- class: "db-input-group__prepend"
136
- }, j = [
137
- "value",
138
- "placeholder",
139
- "disabled",
140
- "readonly",
141
- "rows",
142
- "name",
143
- "autocomplete",
144
- "autofocus",
145
- "form",
146
- "maxlength",
147
- "minlength",
148
- "tabindex"
149
- ], M = {
150
- key: 0,
151
- class: "db-input-limit"
152
- }, N = { class: "db-input-limit__inner" }, P = [
153
- "type",
154
- "value",
155
- "placeholder",
156
- "disabled",
157
- "readonly",
158
- "name",
159
- "autocomplete",
160
- "autofocus",
161
- "form",
162
- "maxlength",
163
- "minlength",
164
- "tabindex"
165
- ], F = {
166
- key: 3,
167
- class: "db-input-group__append"
168
- }, I = /*#__PURE__*/ D(/* @__PURE__ */ l({
169
- name: "DbInput",
170
- __name: "Input",
171
- props: {
172
- modelValue: { default: "" },
173
- type: { default: "text" },
174
- size: { default: "default" },
175
- placeholder: { default: "" },
176
- clearable: {
177
- type: Boolean,
178
- default: !1
179
- },
180
- showPassword: {
181
- type: Boolean,
182
- default: !1
183
- },
184
- disabled: {
185
- type: Boolean,
186
- default: !1
187
- },
188
- readonly: {
189
- type: Boolean,
190
- default: !1
191
- },
192
- suffixIcon: {},
193
- prefixIcon: {},
194
- rows: { default: 2 },
195
- autosize: {
196
- type: [Boolean, Object],
197
- default: !1
198
- },
199
- autocomplete: { default: "off" },
200
- autofocus: {
201
- type: Boolean,
202
- default: !1
203
- },
204
- form: { default: "" },
205
- name: { default: "" },
206
- minlength: {},
207
- maxlength: {},
208
- showWordLimit: {
209
- type: Boolean,
210
- default: !1
211
- },
212
- resize: { default: "vertical" },
213
- tabindex: { default: void 0 }
214
- },
215
- emits: [
216
- "update:modelValue",
217
- "input",
218
- "change",
219
- "focus",
220
- "blur",
221
- "clear",
222
- "keydown",
223
- "keyup",
224
- "keypress"
225
- ],
226
- setup(t, { expose: r, emit: s }) {
227
- let c = t, l = s;
228
- r({
229
- focus: () => y.value?.focus(),
230
- blur: () => y.value?.blur(),
231
- select: () => y.value?.select()
232
- });
233
- let _ = b(), y = x("input-ref"), C = h(!1), T = h(!1), E = n(() => c.type === "textarea"), D = n(() => !!_.prepend), O = n(() => !!_.prepend), k = n(() => c.showPassword && c.type === "password" ? T.value ? "text" : "password" : c.type), I = n(() => String(c.modelValue ?? "")), L = n(() => c.clearable && I.value && !c.disabled && !c.readonly), R = n(() => I.value.length), z = n(() => c.showWordLimit && c.maxlength !== void 0), B = n(() => `db-input-size__${c.size}`), V = n(() => E.value ? [
234
- "db-textarea",
235
- B.value,
236
- {
237
- "is-disabled": c.disabled,
238
- "is-focus": C.value
239
- }
240
- ] : D.value || O.value ? ["db-input-group", B.value] : [
241
- "db-input",
242
- B.value,
243
- {
244
- "is-disabled": c.disabled,
245
- "is-focus": C.value
246
- }
247
- ]);
248
- function H(e) {
249
- let t = e.target.value;
250
- l("update:modelValue", t), l("input", t), u(() => J());
251
- }
252
- function U(e) {
253
- let t = e.target.value;
254
- l("change", t);
255
- }
256
- function W(e) {
257
- C.value = !0, l("focus", e);
258
- }
259
- function G(e) {
260
- C.value = !1, l("blur", e);
261
- }
262
- function K() {
263
- l("update:modelValue", ""), l("input", ""), l("change", ""), l("clear"), u(() => {
264
- y.value?.focus(), J();
265
- });
266
- }
267
- function q() {
268
- T.value = !T.value;
269
- }
270
- function J() {
271
- if (!E.value || !c.autosize || !y.value) return;
272
- let e = y.value, { autosize: t } = c;
273
- e.style.height = "auto";
274
- let n = e.scrollHeight;
275
- if (typeof t == "object") {
276
- let { minRows: e, maxRows: r } = t;
277
- if (e) {
278
- let t = e * 20 + 22;
279
- n = Math.max(n, t);
280
- }
281
- if (r) {
282
- let e = r * 20 + 22;
283
- n = Math.min(n, e);
284
- }
285
- }
286
- e.style.height = `${n}px`;
287
- }
288
- return p(() => {
289
- J();
290
- }), S(() => c.modelValue, () => u(() => J())), (n, r) => (m(), a("div", { class: d(V.value) }, [
291
- !E.value && D.value ? (m(), a("div", A, [g(n.$slots, "prepend", {}, void 0, !0)])) : i("", !0),
292
- E.value ? (m(), a(e, { key: 1 }, [o("textarea", {
293
- ref: "input-ref",
294
- class: "db-textarea__inner",
295
- style: f({ resize: t.resize }),
296
- value: I.value,
297
- placeholder: t.placeholder,
298
- disabled: t.disabled,
299
- readonly: t.readonly,
300
- rows: t.rows,
301
- name: t.name,
302
- autocomplete: t.autocomplete,
303
- autofocus: t.autofocus,
304
- form: t.form,
305
- maxlength: t.maxlength,
306
- minlength: t.minlength,
307
- tabindex: t.tabindex,
308
- onInput: H,
309
- onChange: U,
310
- onFocus: W,
311
- onBlur: G,
312
- onKeydown: r[0] ||= (e) => l("keydown", e),
313
- onKeyup: r[1] ||= (e) => l("keyup", e),
314
- onKeypress: r[2] ||= (e) => l("keypress", e)
315
- }, null, 44, j), z.value ? (m(), a("div", M, [o("span", N, v(R.value) + "/" + v(t.maxlength), 1)])) : i("", !0)], 64)) : i("", !0),
316
- E.value ? i("", !0) : (m(), a("div", {
317
- key: 2,
318
- class: d(["db-input__wrapper", {
319
- "is-focus": C.value,
320
- "is-disabled": t.disabled
321
- }])
322
- }, [
323
- t.prefixIcon ? (m(), a("i", {
324
- key: 0,
325
- class: d(["iconfont", `icon-${t.prefixIcon}`])
326
- }, null, 2)) : i("", !0),
327
- o("input", {
328
- ref: "input-ref",
329
- class: "db-input__inner",
330
- type: k.value,
331
- value: I.value,
332
- placeholder: t.placeholder,
333
- disabled: t.disabled,
334
- readonly: t.readonly,
335
- name: t.name,
336
- autocomplete: t.autocomplete,
337
- autofocus: t.autofocus,
338
- form: t.form,
339
- maxlength: t.maxlength,
340
- minlength: t.minlength,
341
- tabindex: t.tabindex,
342
- onInput: H,
343
- onChange: U,
344
- onFocus: W,
345
- onBlur: G,
346
- onKeydown: r[3] ||= (e) => l("keydown", e),
347
- onKeyup: r[4] ||= (e) => l("keyup", e),
348
- onKeypress: r[5] ||= (e) => l("keypress", e)
349
- }, null, 40, P),
350
- L.value ? (m(), a("i", {
351
- key: 1,
352
- class: d(["iconfont", "icon-clear"]),
353
- onClick: w(K, ["stop"])
354
- })) : i("", !0),
355
- t.type === "password" && t.showPassword ? (m(), a("image", {
356
- key: 2,
357
- class: d(["iconfont", "icon-showPassword"]),
358
- onClick: w(q, ["stop"])
359
- })) : i("", !0),
360
- t.suffixIcon ? (m(), a("i", {
361
- key: 3,
362
- class: d(["iconfont", `icon-${t.suffixIcon}`])
363
- }, null, 2)) : i("", !0)
364
- ], 2)),
365
- !E.value && O.value ? (m(), a("div", F, [g(n.$slots, "append", {}, void 0, !0)])) : i("", !0)
366
- ], 2));
367
- }
368
- }), [["__scopeId", "data-v-e3bb386b"]]), L = /*#__PURE__*/ D(/* @__PURE__ */ l({
369
- name: "DbText",
370
- __name: "Text",
371
- props: {
372
- type: { default: "default" },
373
- size: { default: "default" },
374
- tag: { default: "span" },
375
- truncated: {
376
- type: Boolean,
377
- default: !1
378
- },
379
- lineClamp: { default: void 0 },
380
- disabled: {
381
- type: Boolean,
382
- default: !1
383
- },
384
- strong: {
385
- type: Boolean,
386
- default: !1
387
- },
388
- italic: {
389
- type: Boolean,
390
- default: !1
391
- },
392
- underline: {
393
- type: Boolean,
394
- default: !1
395
- },
396
- delete: {
397
- type: Boolean,
398
- default: !1
399
- },
400
- marked: {
401
- type: Boolean,
402
- default: !1
403
- },
404
- code: {
405
- type: Boolean,
406
- default: !1
407
- },
408
- color: { default: "" }
409
- },
410
- setup(e) {
411
- let t = e, i = n(() => [
412
- "db-text",
413
- `db-text-type__${t.type}`,
414
- `db-text-size__${t.size}`,
415
- {
416
- "is-truncated": t.truncated && !t.lineClamp,
417
- "is-disabled": t.disabled,
418
- "is-strong": t.strong,
419
- "is-italic": t.italic,
420
- "is-underline": t.underline,
421
- "is-delete": t.delete,
422
- "is-marked": t.marked,
423
- "is-code": t.code
424
- }
425
- ]), a = n(() => {
426
- let e = {};
427
- return t.color && (e.color = t.color), t.lineClamp && (e.overflow = "hidden", e.display = "-webkit-box", e.WebkitBoxOrient = "vertical", e.WebkitLineClamp = t.lineClamp, e.wordBreak = "break-all"), e;
428
- });
429
- return (t, n) => (m(), r(_(e.tag), {
430
- class: d(i.value),
431
- style: f(a.value)
432
- }, {
433
- default: C(() => [g(t.$slots, "default", {}, void 0, !0)]),
434
- _: 3
435
- }, 8, ["class", "style"]));
436
- }
437
- }), [["__scopeId", "data-v-b274d22b"]]), R = {
438
- key: 0,
439
- class: "db-alert__icon"
440
- }, z = { class: "db-alert__content" }, B = { class: "db-alert__title" }, V = {
441
- key: 0,
442
- class: "db-alert__description"
443
- }, H = /*#__PURE__*/ D(/* @__PURE__ */ l({
444
- name: "DbAlert",
445
- __name: "Alert",
446
- props: {
447
- type: { default: "info" },
448
- title: { default: "" },
449
- description: { default: "" },
450
- closable: {
451
- type: Boolean,
452
- default: !0
453
- },
454
- closeText: { default: "" },
455
- showIcon: {
456
- type: Boolean,
457
- default: !1
458
- },
459
- center: {
460
- type: Boolean,
461
- default: !1
462
- },
463
- effect: { default: "light" }
464
- },
465
- emits: ["close"],
466
- setup(e, { emit: l }) {
467
- let u = e, f = l, p = b(), _ = h(!0), x = n(() => u.description || p.description), S = n(() => [
468
- "db-alert",
469
- `db-alert--${u.type}`,
470
- `db-alert--${u.effect}`,
471
- {
472
- "is-center": u.center,
473
- "is-with-description": x.value,
474
- "is-closable": u.closable
475
- }
476
- ]);
477
- function w(e) {
478
- _.value = !1, f("close", e);
479
- }
480
- return (n, l) => (m(), r(t, { name: "alert-fade" }, {
481
- default: C(() => [_.value ? (m(), a("div", {
482
- key: 0,
483
- class: d(S.value),
484
- role: "alert"
485
- }, [
486
- e.showIcon || y(p).icon ? (m(), a("span", R, [g(n.$slots, "icon", {}, () => [o("i", { class: d(["iconfont", `icon-${e.type}`]) }, null, 2)], !0)])) : i("", !0),
487
- o("div", z, [o("span", B, [g(n.$slots, "default", {}, () => [s(v(e.title), 1)], !0)]), x.value ? (m(), a("p", V, [g(n.$slots, "description", {}, () => [s(v(e.description), 1)], !0)])) : i("", !0)]),
488
- e.closable ? (m(), a("span", {
489
- key: 1,
490
- class: "db-alert__closebtn",
491
- onClick: w
492
- }, [g(n.$slots, "close", {}, () => [c(y(O), {
493
- link: "",
494
- icon: "close",
495
- onClick: w
496
- }, {
497
- default: C(() => [s(v(e.closeText), 1)]),
498
- _: 1
499
- })], !0)])) : i("", !0)
500
- ], 2)) : i("", !0)]),
501
- _: 3
502
- }));
503
- }
504
- }), [["__scopeId", "data-v-54b0171d"]]), U = [
505
- O,
506
- k,
507
- I,
508
- L,
509
- H
510
- ];
511
- function W(e) {
512
- U.forEach((t) => e.component(t.name, t));
513
- }
514
- var G = { install: W };
515
- //#endregion
516
- export { H as DbAlert, O as DbButton, k as DbButtonGroup, I as DbInput, L as DbText, G as default, W as install };