@cregis/ui 0.1.1 → 0.1.2

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.
@@ -1,28 +1,499 @@
1
- import { defineComponent as o, inject as r, onMounted as b, watch as m, onUnmounted as s } from "vue";
2
- const i = Symbol("TABS_KEY"), T = /* @__PURE__ */ o({
1
+ import { defineComponent as k, computed as y, createElementBlock as r, openBlock as s, createElementVNode as u, createCommentVNode as h, mergeProps as p, createBlock as z, renderSlot as v, resolveDynamicComponent as Y, normalizeClass as g, toDisplayString as $, unref as W, ref as C, watch as S, normalizeStyle as x, withDirectives as F, vModelDynamic as j, withModifiers as Z, vModelText as G, createVNode as D, withCtx as P, createTextVNode as T, nextTick as M, reactive as H, provide as J, toRef as Q, Fragment as X, renderList as _, inject as ee, onMounted as te, onUnmounted as ae } from "vue";
2
+ import { EdsLoad as ie, EdsCloseCircleFill as le } from "@cregis/icon";
3
+ const ne = {
4
+ key: 0,
5
+ class: "cregis-button__icon-wrapper"
6
+ }, se = ["disabled"], oe = ["disabled"], re = ["disabled"], B = /* @__PURE__ */ k({
7
+ name: "Button",
8
+ inheritAttrs: !1,
9
+ __name: "Button",
10
+ props: {
11
+ type: { default: "primary" },
12
+ size: { default: "medium" },
13
+ plain: { type: Boolean },
14
+ text: { type: Boolean },
15
+ disabled: { type: Boolean },
16
+ loading: { type: Boolean },
17
+ block: { type: Boolean },
18
+ link: { type: Boolean },
19
+ icon: {},
20
+ iconType: { default: "rectangle" },
21
+ iconText: {},
22
+ affix: { type: Boolean }
23
+ },
24
+ setup(e) {
25
+ const t = e, i = y(() => t.size === "large" ? "20px" : t.size === "medium" ? "16px" : "12px"), d = y(() => t.size === "large" || t.size === "medium" ? "16px" : "12px"), l = y(() => {
26
+ if (t.plain || t.text)
27
+ switch (t.type) {
28
+ case "primary":
29
+ return "var(--material-vibrant-brand-primary)";
30
+ case "secondary":
31
+ return "var(--material-foreground-base-secondary)";
32
+ case "danger":
33
+ return "var(--material-vibrant-error-primary)";
34
+ case "foreground":
35
+ return "var(--material-foreground-base-primary)";
36
+ case "sameWhite":
37
+ return "var(--material-same-black)";
38
+ }
39
+ else
40
+ return t.type === "secondary" ? "var(--material-foreground-base-secondary)" : t.type === "foreground" ? "var(--text-face-primary)" : t.type === "sameWhite" ? "var(--text-same-black)" : "var(--material-same-white)";
41
+ });
42
+ return (a, o) => e.icon || a.$slots.icon ? (s(), r("div", ne, [
43
+ u("button", p(a.$attrs, {
44
+ class: ["cregis-button__icon", {
45
+ [`cregis-button__icon--${e.iconType}`]: e.iconType,
46
+ [`cregis-button__icon--${e.size}`]: e.size,
47
+ "is-disabled": e.disabled
48
+ }],
49
+ disabled: e.disabled || e.loading
50
+ }), [
51
+ e.icon ? (s(), z(Y(e.icon), {
52
+ key: 0,
53
+ size: i.value,
54
+ "stroke-width": 3
55
+ }, null, 8, ["size"])) : v(a.$slots, "icon", { key: 1 })
56
+ ], 16, se),
57
+ e.iconText ? (s(), r("span", {
58
+ key: 0,
59
+ class: g(["cregis-button__icon-text", { "is-disabled": e.disabled }])
60
+ }, $(e.iconText), 3)) : h("", !0)
61
+ ])) : e.link ? (s(), r("button", p({ key: 1 }, a.$attrs, {
62
+ class: ["cregis-button__link", {
63
+ [`cregis-button__link--${e.type}`]: e.type,
64
+ [`cregis-button__link--${e.size}`]: e.size,
65
+ "is-disabled": e.disabled
66
+ }],
67
+ disabled: e.disabled || e.loading
68
+ }), [
69
+ v(a.$slots, "default")
70
+ ], 16, oe)) : (s(), r("button", p({
71
+ key: 2,
72
+ ref: "buttonRef"
73
+ }, a.$attrs, {
74
+ class: ["cregis-button", {
75
+ [`cregis-button--${e.type}`]: e.type,
76
+ [`cregis-button--${e.size}`]: e.size,
77
+ "is-plain": e.plain,
78
+ "is-text": e.text,
79
+ "is-disabled": e.disabled,
80
+ "is-loading": e.loading,
81
+ "is-block": e.block,
82
+ "is-affix": e.affix
83
+ }],
84
+ disabled: e.disabled || e.loading
85
+ }), [
86
+ e.loading ? (s(), z(W(ie), {
87
+ key: 0,
88
+ class: "loading",
89
+ size: d.value,
90
+ color: l.value,
91
+ "stroke-width": 3
92
+ }, null, 8, ["size", "color"])) : v(a.$slots, "default", { key: 1 })
93
+ ], 16, re));
94
+ }
95
+ }), de = {
96
+ key: 0,
97
+ class: "cregis-input__prefix"
98
+ }, ue = ["type", "placeholder", "disabled"], ce = {
99
+ key: 2,
100
+ class: "cregis-input__suffix"
101
+ }, me = ["disabled", "placeholder", "rows"], be = {
102
+ key: 0,
103
+ class: "cregis-textarea__buttons"
104
+ }, ze = /* @__PURE__ */ k({
105
+ name: "Input",
106
+ inheritAttrs: !1,
107
+ __name: "Input",
108
+ props: {
109
+ type: { default: "text" },
110
+ modelValue: {},
111
+ size: { default: "medium" },
112
+ width: { default: "300px" },
113
+ placeholder: { default: "please input" },
114
+ disabled: { type: Boolean },
115
+ clearable: { type: Boolean },
116
+ inputStyle: {},
117
+ unit: {},
118
+ rows: { default: 3 }
119
+ },
120
+ emits: ["update:modelValue", "input", "change", "focus", "blur", "clear"],
121
+ setup(e, { expose: t, emit: i }) {
122
+ const d = e, l = i, a = C(d.modelValue);
123
+ S(
124
+ () => d.modelValue,
125
+ (n) => {
126
+ a.value = n;
127
+ }
128
+ );
129
+ const o = C(), c = C(0), f = C(!1);
130
+ let w = null;
131
+ const q = async () => {
132
+ await M(), o.value?.focus();
133
+ }, V = async () => {
134
+ l("update:modelValue", a.value), l("input", a.value), await M(), E();
135
+ }, R = () => {
136
+ l("change", a.value);
137
+ }, I = (n) => {
138
+ f.value = !0, l("focus", n);
139
+ }, L = (n) => {
140
+ f.value = !1, l("blur", n);
141
+ }, N = y(() => d.clearable && !d.disabled && !!a.value && f.value), A = () => {
142
+ a.value = "", l("update:modelValue", ""), l("clear"), l("input", ""), l("change", "");
143
+ }, E = () => {
144
+ w && cancelAnimationFrame(w), w = requestAnimationFrame(() => {
145
+ if (!o.value || o.value.tagName !== "INPUT") return;
146
+ const n = o.value, b = n.value, m = document.createElement("span");
147
+ m.style.position = "absolute", m.style.visibility = "hidden", m.style.whiteSpace = "pre", m.style.font = window.getComputedStyle(n).font, m.style.letterSpacing = window.getComputedStyle(n).letterSpacing, m.textContent = b || " ", document.body.appendChild(m), c.value = m.getBoundingClientRect().width, document.body.removeChild(m);
148
+ });
149
+ }, K = y(() => {
150
+ const n = {};
151
+ return c.value > 0 && (n.position = "absolute", n.left = `${c.value + 16}px`), n;
152
+ }), O = async () => {
153
+ try {
154
+ a.value = await navigator.clipboard.readText();
155
+ } catch (n) {
156
+ console.error("paste error:", n);
157
+ }
158
+ };
159
+ return t({
160
+ focus: q,
161
+ updateTextWidth: E
162
+ }), (n, b) => e.type !== "textarea" ? (s(), r("div", {
163
+ key: 0,
164
+ class: g(["cregis-input", {
165
+ [`cregis-input--${e.size}`]: e.size,
166
+ "is-disabled": e.disabled,
167
+ "is-prefix": n.$slots.prefix,
168
+ "is-suffix": n.$slots.suffix
169
+ }]),
170
+ style: x([{ width: e.width }, e.inputStyle])
171
+ }, [
172
+ u("div", {
173
+ class: g(["cregis-input__wrapper", { "is-focus": f.value }])
174
+ }, [
175
+ n.$slots.prefix ? (s(), r("span", de, [
176
+ v(n.$slots, "prefix")
177
+ ])) : h("", !0),
178
+ F(u("input", p({
179
+ class: "cregis-input__inner",
180
+ "onUpdate:modelValue": b[0] || (b[0] = (m) => a.value = m),
181
+ ref_key: "inputRef",
182
+ ref: o,
183
+ type: e.type,
184
+ placeholder: e.placeholder
185
+ }, n.$attrs, {
186
+ disabled: e.disabled,
187
+ onInput: V,
188
+ onChange: R,
189
+ onFocus: I,
190
+ onBlur: L
191
+ }), null, 16, ue), [
192
+ [j, a.value]
193
+ ]),
194
+ e.unit && a.value ? (s(), r("span", {
195
+ key: 1,
196
+ style: x(K.value),
197
+ class: "cregis-input__unit"
198
+ }, $(e.unit), 5)) : h("", !0),
199
+ n.$slots.suffix || N.value ? (s(), r("span", ce, [
200
+ v(n.$slots, "suffix"),
201
+ N.value ? (s(), z(B, {
202
+ key: 0,
203
+ class: "cregis-input__clear-button",
204
+ icon: W(le),
205
+ "icon-type": "square",
206
+ onClick: A,
207
+ onMousedown: b[1] || (b[1] = Z(() => {
208
+ }, ["prevent"]))
209
+ }, null, 8, ["icon"])) : h("", !0)
210
+ ])) : h("", !0)
211
+ ], 2)
212
+ ], 6)) : (s(), r("div", {
213
+ key: 1,
214
+ class: g(["cregis-textarea", { "is-disabled": e.disabled }]),
215
+ style: x([{ width: e.width }, e.inputStyle])
216
+ }, [
217
+ F(u("textarea", p({ class: "cregis-textarea__wrapper" }, n.$attrs, {
218
+ ref_key: "inputRef",
219
+ ref: o,
220
+ disabled: e.disabled,
221
+ placeholder: e.placeholder,
222
+ rows: e.rows,
223
+ "onUpdate:modelValue": b[2] || (b[2] = (m) => a.value = m),
224
+ onInput: V,
225
+ onChange: R,
226
+ onFocus: I,
227
+ onBlur: L
228
+ }), null, 16, me), [
229
+ [G, a.value]
230
+ ]),
231
+ e.disabled ? h("", !0) : (s(), r("div", be, [
232
+ D(B, {
233
+ class: "cregis-textarea__button",
234
+ link: "",
235
+ size: "small",
236
+ onClick: O
237
+ }, {
238
+ default: P(() => [...b[3] || (b[3] = [
239
+ T(" Paste ", -1)
240
+ ])]),
241
+ _: 1
242
+ }),
243
+ D(B, {
244
+ class: "cregis-textarea__button",
245
+ link: "",
246
+ size: "small",
247
+ disabled: !a.value,
248
+ onClick: A
249
+ }, {
250
+ default: P(() => [...b[4] || (b[4] = [
251
+ T(" Clear ", -1)
252
+ ])]),
253
+ _: 1
254
+ }, 8, ["disabled"])
255
+ ]))
256
+ ], 6));
257
+ }
258
+ }), fe = ["width", "height"], ge = {
259
+ stroke: "none",
260
+ "stroke-width": "1",
261
+ fill: "none",
262
+ "fill-rule": "evenodd"
263
+ }, ye = { transform: "translate(-394.000000, -457.000000)" }, he = { transform: "translate(394.000000, 457.000000)" }, ve = ["width", "height"], ke = /* @__PURE__ */ k({
264
+ __name: "checked-basis",
265
+ props: {
266
+ size: { default: "16px" }
267
+ },
268
+ setup(e) {
269
+ return (t, i) => (s(), r("svg", {
270
+ width: e.size,
271
+ height: e.size,
272
+ viewBox: "0 0 16 16",
273
+ version: "1.1",
274
+ xmlns: "http://www.w3.org/2000/svg",
275
+ "xmlns:xlink": "http://www.w3.org/1999/xlink"
276
+ }, [
277
+ u("g", ge, [
278
+ u("g", ye, [
279
+ u("g", he, [
280
+ u("rect", {
281
+ x: "0",
282
+ y: "0",
283
+ width: e.size,
284
+ height: e.size
285
+ }, null, 8, ve),
286
+ i[0] || (i[0] = u("path", {
287
+ d: "M6.67713976,13.5709642 C7.12567714,13.5709642 7.468039,13.3943662 7.70422535,13.0411701 L13.7562297,3.77789816 C13.8407367,3.65005417 13.9024919,3.52546046 13.9414951,3.40411701 C13.9804984,3.28277356 14,3.16468039 14,3.04983749 C14,2.74647887 13.8976165,2.49566631 13.6928494,2.29739978 C13.4880823,2.09913326 13.2307692,2 12.9209101,2 C12.7063922,2 12.5265439,2.04225352 12.3813651,2.12676056 C12.2361863,2.21126761 12.0975081,2.35536295 11.9653304,2.55904659 L6.65113759,10.9512459 L3.95016251,7.60346696 C3.71830986,7.32177681 3.43011918,7.18093174 3.08559047,7.18093174 C2.77139762,7.18093174 2.51191766,7.28169014 2.3071506,7.48320693 C2.10238353,7.68472373 2,7.93824485 2,8.24377031 C2,8.38028169 2.02329361,8.51083424 2.06988082,8.63542795 C2.11646804,8.76002167 2.19826652,8.88949079 2.31527627,9.02383532 L5.67280607,13.0899242 C5.94149512,13.4106176 6.27627302,13.5709642 6.67713976,13.5709642 Z",
288
+ fill: "currentColor",
289
+ "fill-rule": "nonzero"
290
+ }, null, -1))
291
+ ])
292
+ ])
293
+ ])
294
+ ], 8, fe));
295
+ }
296
+ }), pe = {
297
+ key: 0,
298
+ class: "cregis-checkbox--indeterminate"
299
+ }, Te = /* @__PURE__ */ k({
300
+ name: "Checkbox",
301
+ __name: "Checkbox",
302
+ props: {
303
+ modelValue: { type: [Boolean, Number], default: !1 },
304
+ label: {},
305
+ disabled: { type: Boolean, default: !1 },
306
+ circle: { type: Boolean },
307
+ indeterminate: { type: Boolean }
308
+ },
309
+ emits: ["update:modelValue", "change"],
310
+ setup(e, { emit: t }) {
311
+ const i = e, d = t, l = y(() => i.modelValue), a = () => {
312
+ i.disabled || d("update:modelValue", !l.value);
313
+ };
314
+ return S(
315
+ () => l.value,
316
+ () => {
317
+ d("change", l.value);
318
+ }
319
+ ), (o, c) => (s(), r("div", {
320
+ class: "cregis-checkbox__wrapper",
321
+ onClick: a
322
+ }, [
323
+ u("div", {
324
+ class: g(["cregis-checkbox", {
325
+ "is-disabled": e.disabled,
326
+ "is-checked": l.value,
327
+ "is-circle": e.circle,
328
+ "is-indeterminate": e.indeterminate
329
+ }])
330
+ }, [
331
+ e.indeterminate ? (s(), r("div", pe)) : (s(), z(ke, {
332
+ key: 1,
333
+ size: "10px"
334
+ }))
335
+ ], 2),
336
+ o.$slots.default || e.label ? (s(), r("span", {
337
+ key: 0,
338
+ class: g(["cregis-checkbox__label", { "is-disabled": e.disabled }])
339
+ }, [
340
+ v(o.$slots, "default", {}, () => [
341
+ T($(e.label), 1)
342
+ ])
343
+ ], 2)) : h("", !0)
344
+ ]));
345
+ }
346
+ }), Be = /* @__PURE__ */ k({
347
+ name: "Radio",
348
+ __name: "Radio",
349
+ props: {
350
+ modelValue: { type: [Boolean, String, Number] },
351
+ value: { type: [Boolean, String, Number] },
352
+ label: {},
353
+ disabled: { type: Boolean }
354
+ },
355
+ emits: ["update:modelValue", "change"],
356
+ setup(e, { emit: t }) {
357
+ const i = e, d = t, l = y(() => i.modelValue === i.value), a = () => {
358
+ i.disabled || (d("update:modelValue", i.value), d("change", i.value));
359
+ };
360
+ return (o, c) => (s(), r("div", {
361
+ class: "cregis-radio__wrapper",
362
+ onClick: a
363
+ }, [
364
+ u("div", {
365
+ class: g(["cregis-radio", {
366
+ "is-disabled": e.disabled,
367
+ "is-checked": l.value
368
+ }])
369
+ }, [...c[0] || (c[0] = [
370
+ u("div", { class: "cregis-radio__inner" }, null, -1)
371
+ ])], 2),
372
+ o.$slots.default || e.label ? (s(), r("span", {
373
+ key: 0,
374
+ class: g(["cregis-radio__label", { "is-disabled": e.disabled }])
375
+ }, [
376
+ v(o.$slots, "default", {}, () => [
377
+ T($(e.label), 1)
378
+ ])
379
+ ], 2)) : h("", !0)
380
+ ]));
381
+ }
382
+ }), Se = /* @__PURE__ */ k({
383
+ name: "Divider",
384
+ __name: "Divider",
385
+ props: {
386
+ direction: { default: "horizontal" },
387
+ borderStyle: { default: "solid" },
388
+ lineThickness: { default: "1px" },
389
+ color: { default: "var(--line-module)" },
390
+ margin: { default: "8px" },
391
+ length: {}
392
+ },
393
+ setup(e) {
394
+ const t = e, i = y(() => {
395
+ if (Array.isArray(t.margin)) {
396
+ const [l, a] = t.margin;
397
+ return t.direction === "horizontal" ? `${l} 0 ${a} 0` : `0 ${a} 0 ${l}`;
398
+ } else
399
+ return t.direction === "horizontal" ? `${t.margin} 0` : `0 ${t.margin}`;
400
+ }), d = y(() => t.direction === "horizontal" ? {
401
+ width: t.length || "100%",
402
+ borderTopWidth: t.lineThickness,
403
+ borderTopStyle: t.borderStyle,
404
+ borderTopColor: t.color,
405
+ margin: i.value
406
+ } : {
407
+ height: t.length || "1rem",
408
+ borderLeftWidth: t.lineThickness,
409
+ borderLeftStyle: t.borderStyle,
410
+ borderLeftColor: t.color,
411
+ margin: i.value
412
+ });
413
+ return (l, a) => (s(), r("div", {
414
+ class: g(["cregis-divider", {
415
+ [`cregis-divider--${e.direction}`]: e.direction
416
+ }]),
417
+ style: x(d.value)
418
+ }, null, 6));
419
+ }
420
+ }), U = Symbol("TABS_KEY"), xe = ["onClick"], $e = { style: { display: "none" } }, Ve = /* @__PURE__ */ k({
421
+ name: "Tabs",
422
+ __name: "Tabs",
423
+ props: {
424
+ modelValue: {},
425
+ type: { default: "default" },
426
+ size: { default: "medium" }
427
+ },
428
+ emits: ["update:modelValue"],
429
+ setup(e) {
430
+ const t = e, i = H([]), d = (o) => {
431
+ i.some((c) => c.name === o.name) || i.push(o);
432
+ }, l = (o) => {
433
+ const c = i.findIndex((f) => f.name === o);
434
+ c !== -1 && i.splice(c, 1);
435
+ }, a = y(() => t.type === "card" ? t.size === "large" ? {
436
+ borderRadius: "13px"
437
+ } : t.size === "medium" ? {
438
+ borderRadius: "11px"
439
+ } : {
440
+ borderRadius: "9px"
441
+ } : {
442
+ borderRadius: 0
443
+ });
444
+ return J(U, {
445
+ activeName: Q(t, "modelValue"),
446
+ registerTab: d,
447
+ unregisterTab: l
448
+ }), (o, c) => (s(), r("div", {
449
+ class: g(["cregis-tabs", {
450
+ [`cregis-tabs--${e.type}`]: e.type,
451
+ [`cregis-tabs--${e.size}`]: e.size
452
+ }])
453
+ }, [
454
+ (s(!0), r(X, null, _(i, (f) => (s(), r("div", {
455
+ key: f.name,
456
+ class: g(["cregis-tabs__item", { "is-active": e.modelValue === f.name }]),
457
+ style: x(a.value),
458
+ onClick: (w) => o.$emit("update:modelValue", f.name)
459
+ }, [
460
+ u("span", null, $(f.label), 1)
461
+ ], 14, xe))), 128)),
462
+ u("div", $e, [
463
+ v(o.$slots, "default")
464
+ ])
465
+ ], 2));
466
+ }
467
+ }), Re = /* @__PURE__ */ k({
3
468
  name: "TabPane",
4
469
  __name: "TabPane",
5
470
  props: {
6
471
  label: {},
7
472
  name: {}
8
473
  },
9
- setup(a) {
10
- const e = a, n = r(i);
11
- if (!n) throw new Error("TabPane must be used within Tabs");
12
- return b(() => {
13
- n.registerTab({ label: e.label, name: e.name });
14
- }), m(
15
- () => e.label,
16
- (t) => {
17
- n.unregisterTab(e.name), n.registerTab({ label: t, name: e.name });
474
+ setup(e) {
475
+ const t = e, i = ee(U);
476
+ if (!i) throw new Error("TabPane must be used within Tabs");
477
+ return te(() => {
478
+ i.registerTab({ label: t.label, name: t.name });
479
+ }), S(
480
+ () => t.label,
481
+ (d) => {
482
+ i.unregisterTab(t.name), i.registerTab({ label: d, name: t.name });
18
483
  }
19
- ), s(() => {
20
- n.unregisterTab(e.name);
484
+ ), ae(() => {
485
+ i.unregisterTab(t.name);
21
486
  }), () => {
22
487
  };
23
488
  }
24
489
  });
25
490
  export {
26
- i as TABS_KEY,
27
- T as TabPane
491
+ B as Button,
492
+ Te as Checkbox,
493
+ Se as Divider,
494
+ ze as Input,
495
+ Be as Radio,
496
+ U as TABS_KEY,
497
+ Re as TabPane,
498
+ Ve as Tabs
28
499
  };
@@ -7,6 +7,163 @@ import { InjectionKey } from 'vue';
7
7
  import { PublicProps } from 'vue';
8
8
  import { Ref } from 'vue';
9
9
 
10
+ declare const __VLS_component: DefineComponent<InputProps, {
11
+ focus: () => Promise<void>;
12
+ updateTextWidth: () => void;
13
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
14
+ "update:modelValue": (value: string | number) => any;
15
+ input: (value: string | number) => any;
16
+ change: (value: string | number) => any;
17
+ focus: (value: FocusEvent) => any;
18
+ blur: (value: FocusEvent) => any;
19
+ clear: () => any;
20
+ }, string, PublicProps, Readonly<InputProps> & Readonly<{
21
+ "onUpdate:modelValue"?: (value: string | number) => any;
22
+ onInput?: (value: string | number) => any;
23
+ onChange?: (value: string | number) => any;
24
+ onFocus?: (value: FocusEvent) => any;
25
+ onBlur?: (value: FocusEvent) => any;
26
+ onClear?: () => any;
27
+ }>, {
28
+ type: "text" | "number" | "textarea";
29
+ size: "small" | "medium" | "large";
30
+ width: string;
31
+ placeholder: string;
32
+ rows: number;
33
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
34
+ inputRef: HTMLTextAreaElement;
35
+ }, any>;
36
+
37
+ declare const __VLS_component_2: DefineComponent<ButtonProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
38
+ type: ButtonType;
39
+ size: ButtonSize;
40
+ iconType: IconButtonType;
41
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {
42
+ buttonRef: HTMLButtonElement;
43
+ }, any>;
44
+
45
+ declare const __VLS_component_3: DefineComponent<CheckboxProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
46
+ "update:modelValue": (value: number | boolean) => any;
47
+ change: (value: number | boolean) => any;
48
+ }, string, PublicProps, Readonly<CheckboxProps> & Readonly<{
49
+ "onUpdate:modelValue"?: (value: number | boolean) => any;
50
+ onChange?: (value: number | boolean) => any;
51
+ }>, {
52
+ disabled: boolean;
53
+ modelValue: boolean | number;
54
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
55
+
56
+ declare const __VLS_component_4: DefineComponent<RadioProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
57
+ "update:modelValue": (value: RadioValue) => any;
58
+ change: (value: RadioValue) => any;
59
+ }, string, PublicProps, Readonly<RadioProps> & Readonly<{
60
+ "onUpdate:modelValue"?: (value: RadioValue) => any;
61
+ onChange?: (value: RadioValue) => any;
62
+ }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
63
+
64
+ declare const __VLS_component_5: DefineComponent<TabsProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
65
+ "update:modelValue": (name: string | number) => any;
66
+ }, string, PublicProps, Readonly<TabsProps> & Readonly<{
67
+ "onUpdate:modelValue"?: (name: string | number) => any;
68
+ }>, {
69
+ type: "default" | "card";
70
+ size: TabSize;
71
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
72
+
73
+ declare function __VLS_template(): {
74
+ attrs: Partial<{}>;
75
+ slots: {
76
+ prefix?(_: {}): any;
77
+ suffix?(_: {}): any;
78
+ };
79
+ refs: {
80
+ inputRef: HTMLTextAreaElement;
81
+ };
82
+ rootEl: any;
83
+ };
84
+
85
+ declare function __VLS_template_2(): {
86
+ attrs: Partial<{}>;
87
+ slots: {
88
+ icon?(_: {}): any;
89
+ default?(_: {}): any;
90
+ default?(_: {}): any;
91
+ };
92
+ refs: {
93
+ buttonRef: HTMLButtonElement;
94
+ };
95
+ rootEl: any;
96
+ };
97
+
98
+ declare function __VLS_template_3(): {
99
+ attrs: Partial<{}>;
100
+ slots: {
101
+ default?(_: {}): any;
102
+ };
103
+ refs: {};
104
+ rootEl: HTMLDivElement;
105
+ };
106
+
107
+ declare function __VLS_template_4(): {
108
+ attrs: Partial<{}>;
109
+ slots: {
110
+ default?(_: {}): any;
111
+ };
112
+ refs: {};
113
+ rootEl: HTMLDivElement;
114
+ };
115
+
116
+ declare function __VLS_template_5(): {
117
+ attrs: Partial<{}>;
118
+ slots: {
119
+ default?(_: {}): any;
120
+ };
121
+ refs: {};
122
+ rootEl: HTMLDivElement;
123
+ };
124
+
125
+ declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
126
+
127
+ declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;
128
+
129
+ declare type __VLS_TemplateResult_3 = ReturnType<typeof __VLS_template_3>;
130
+
131
+ declare type __VLS_TemplateResult_4 = ReturnType<typeof __VLS_template_4>;
132
+
133
+ declare type __VLS_TemplateResult_5 = ReturnType<typeof __VLS_template_5>;
134
+
135
+ declare type __VLS_WithTemplateSlots<T, S> = T & {
136
+ new (): {
137
+ $slots: S;
138
+ };
139
+ };
140
+
141
+ declare type __VLS_WithTemplateSlots_2<T, S> = T & {
142
+ new (): {
143
+ $slots: S;
144
+ };
145
+ };
146
+
147
+ declare type __VLS_WithTemplateSlots_3<T, S> = T & {
148
+ new (): {
149
+ $slots: S;
150
+ };
151
+ };
152
+
153
+ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
154
+ new (): {
155
+ $slots: S;
156
+ };
157
+ };
158
+
159
+ declare type __VLS_WithTemplateSlots_5<T, S> = T & {
160
+ new (): {
161
+ $slots: S;
162
+ };
163
+ };
164
+
165
+ export declare const Button: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;
166
+
10
167
  export declare interface ButtonProps {
11
168
  type?: ButtonType;
12
169
  size?: ButtonSize;
@@ -26,6 +183,8 @@ export declare type ButtonSize = 'extraSmall' | 'small' | 'medium' | 'large';
26
183
 
27
184
  export declare type ButtonType = 'primary' | 'secondary' | 'danger' | 'foreground' | 'sameWhite';
28
185
 
186
+ export declare const Checkbox: __VLS_WithTemplateSlots_3<typeof __VLS_component_3, __VLS_TemplateResult_3["slots"]>;
187
+
29
188
  export declare interface CheckboxEmits {
30
189
  (e: 'update:modelValue', value: boolean | number): void;
31
190
  (e: 'change', value: boolean | number): void;
@@ -39,6 +198,14 @@ export declare interface CheckboxProps {
39
198
  indeterminate?: boolean;
40
199
  }
41
200
 
201
+ export declare const Divider: DefineComponent<DividerProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<DividerProps> & Readonly<{}>, {
202
+ color: string;
203
+ direction: "horizontal" | "vertical";
204
+ borderStyle: "solid" | "dashed" | "dotted";
205
+ lineThickness: string;
206
+ margin: string | [string, string];
207
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
208
+
42
209
  export declare interface DividerProps {
43
210
  direction?: 'horizontal' | 'vertical';
44
211
  borderStyle?: 'solid' | 'dashed' | 'dotted';
@@ -50,6 +217,8 @@ export declare interface DividerProps {
50
217
 
51
218
  export declare type IconButtonType = 'rectangle' | 'square' | 'circle' | 'professional';
52
219
 
220
+ export declare const Input: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
221
+
53
222
  export declare interface InputEmits {
54
223
  (e: 'update:modelValue', value: StringOrNumber): void;
55
224
  (e: 'input', value: StringOrNumber): void;
@@ -72,6 +241,8 @@ export declare interface InputProps {
72
241
  rows?: number;
73
242
  }
74
243
 
244
+ export declare const Radio: __VLS_WithTemplateSlots_4<typeof __VLS_component_4, __VLS_TemplateResult_4["slots"]>;
245
+
75
246
  export declare interface RadioEmits {
76
247
  (e: 'update:modelValue', value: RadioValue): void;
77
248
  (e: 'change', value: RadioValue): void;
@@ -95,6 +266,8 @@ export declare interface TabPaneProps {
95
266
  name: string | number;
96
267
  }
97
268
 
269
+ export declare const Tabs: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
270
+
98
271
  export declare const TABS_KEY: InjectionKey<TabsContext>;
99
272
 
100
273
  export declare interface TabsContext {
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.CregisUI={},n.Vue))})(this,(function(n,e){"use strict";const o=Symbol("TABS_KEY"),i=e.defineComponent({name:"TabPane",__name:"TabPane",props:{label:{},name:{}},setup(s){const t=s,a=e.inject(o);if(!a)throw new Error("TabPane must be used within Tabs");return e.onMounted(()=>{a.registerTab({label:t.label,name:t.name})}),e.watch(()=>t.label,r=>{a.unregisterTab(t.name),a.registerTab({label:r,name:t.name})}),e.onUnmounted(()=>{a.unregisterTab(t.name)}),()=>{}}});n.TABS_KEY=o,n.TabPane=i,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@cregis/icon")):typeof define=="function"&&define.amd?define(["exports","vue","@cregis/icon"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d.CregisUI={},d.Vue,d.CregisIcon))})(this,(function(d,e,k){"use strict";const z={key:0,class:"cregis-button__icon-wrapper"},V=["disabled"],S=["disabled"],T=["disabled"],f=e.defineComponent({name:"Button",inheritAttrs:!1,__name:"Button",props:{type:{default:"primary"},size:{default:"medium"},plain:{type:Boolean},text:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},block:{type:Boolean},link:{type:Boolean},icon:{},iconType:{default:"rectangle"},iconText:{},affix:{type:Boolean}},setup(t){const l=t,a=e.computed(()=>l.size==="large"?"20px":l.size==="medium"?"16px":"12px"),r=e.computed(()=>l.size==="large"||l.size==="medium"?"16px":"12px"),i=e.computed(()=>{if(l.plain||l.text)switch(l.type){case"primary":return"var(--material-vibrant-brand-primary)";case"secondary":return"var(--material-foreground-base-secondary)";case"danger":return"var(--material-vibrant-error-primary)";case"foreground":return"var(--material-foreground-base-primary)";case"sameWhite":return"var(--material-same-black)"}else return l.type==="secondary"?"var(--material-foreground-base-secondary)":l.type==="foreground"?"var(--text-face-primary)":l.type==="sameWhite"?"var(--text-same-black)":"var(--material-same-white)"});return(n,s)=>t.icon||n.$slots.icon?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("button",e.mergeProps(n.$attrs,{class:["cregis-button__icon",{[`cregis-button__icon--${t.iconType}`]:t.iconType,[`cregis-button__icon--${t.size}`]:t.size,"is-disabled":t.disabled}],disabled:t.disabled||t.loading}),[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,size:a.value,"stroke-width":3},null,8,["size"])):e.renderSlot(n.$slots,"icon",{key:1})],16,V),t.iconText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-button__icon-text",{"is-disabled":t.disabled}])},e.toDisplayString(t.iconText),3)):e.createCommentVNode("",!0)])):t.link?(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:1},n.$attrs,{class:["cregis-button__link",{[`cregis-button__link--${t.type}`]:t.type,[`cregis-button__link--${t.size}`]:t.size,"is-disabled":t.disabled}],disabled:t.disabled||t.loading}),[e.renderSlot(n.$slots,"default")],16,S)):(e.openBlock(),e.createElementBlock("button",e.mergeProps({key:2,ref:"buttonRef"},n.$attrs,{class:["cregis-button",{[`cregis-button--${t.type}`]:t.type,[`cregis-button--${t.size}`]:t.size,"is-plain":t.plain,"is-text":t.text,"is-disabled":t.disabled,"is-loading":t.loading,"is-block":t.block,"is-affix":t.affix}],disabled:t.disabled||t.loading}),[t.loading?(e.openBlock(),e.createBlock(e.unref(k.EdsLoad),{key:0,class:"loading",size:r.value,color:i.value,"stroke-width":3},null,8,["size","color"])):e.renderSlot(n.$slots,"default",{key:1})],16,T))}}),E={key:0,class:"cregis-input__prefix"},N=["type","placeholder","disabled"],R={key:2,class:"cregis-input__suffix"},I=["disabled","placeholder","rows"],D={key:0,class:"cregis-textarea__buttons"},P=e.defineComponent({name:"Input",inheritAttrs:!1,__name:"Input",props:{type:{default:"text"},modelValue:{},size:{default:"medium"},width:{default:"300px"},placeholder:{default:"please input"},disabled:{type:Boolean},clearable:{type:Boolean},inputStyle:{},unit:{},rows:{default:3}},emits:["update:modelValue","input","change","focus","blur","clear"],setup(t,{expose:l,emit:a}){const r=t,i=a,n=e.ref(r.modelValue);e.watch(()=>r.modelValue,o=>{n.value=o});const s=e.ref(),c=e.ref(0),b=e.ref(!1);let g=null;const J=async()=>{await e.nextTick(),s.value?.focus()},h=async()=>{i("update:modelValue",n.value),i("input",n.value),await e.nextTick(),w()},p=()=>{i("change",n.value)},B=o=>{b.value=!0,i("focus",o)},C=o=>{b.value=!1,i("blur",o)},$=e.computed(()=>r.clearable&&!r.disabled&&!!n.value&&b.value),x=()=>{n.value="",i("update:modelValue",""),i("clear"),i("input",""),i("change","")},w=()=>{g&&cancelAnimationFrame(g),g=requestAnimationFrame(()=>{if(!s.value||s.value.tagName!=="INPUT")return;const o=s.value,u=o.value,m=document.createElement("span");m.style.position="absolute",m.style.visibility="hidden",m.style.whiteSpace="pre",m.style.font=window.getComputedStyle(o).font,m.style.letterSpacing=window.getComputedStyle(o).letterSpacing,m.textContent=u||" ",document.body.appendChild(m),c.value=m.getBoundingClientRect().width,document.body.removeChild(m)})},Q=e.computed(()=>{const o={};return c.value>0&&(o.position="absolute",o.left=`${c.value+16}px`),o}),X=async()=>{try{n.value=await navigator.clipboard.readText()}catch(o){console.error("paste error:",o)}};return l({focus:J,updateTextWidth:w}),(o,u)=>t.type!=="textarea"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cregis-input",{[`cregis-input--${t.size}`]:t.size,"is-disabled":t.disabled,"is-prefix":o.$slots.prefix,"is-suffix":o.$slots.suffix}]),style:e.normalizeStyle([{width:t.width},t.inputStyle])},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-input__wrapper",{"is-focus":b.value}])},[o.$slots.prefix?(e.openBlock(),e.createElementBlock("span",E,[e.renderSlot(o.$slots,"prefix")])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({class:"cregis-input__inner","onUpdate:modelValue":u[0]||(u[0]=m=>n.value=m),ref_key:"inputRef",ref:s,type:t.type,placeholder:t.placeholder},o.$attrs,{disabled:t.disabled,onInput:h,onChange:p,onFocus:B,onBlur:C}),null,16,N),[[e.vModelDynamic,n.value]]),t.unit&&n.value?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(Q.value),class:"cregis-input__unit"},e.toDisplayString(t.unit),5)):e.createCommentVNode("",!0),o.$slots.suffix||$.value?(e.openBlock(),e.createElementBlock("span",R,[e.renderSlot(o.$slots,"suffix"),$.value?(e.openBlock(),e.createBlock(f,{key:0,class:"cregis-input__clear-button",icon:e.unref(k.EdsCloseCircleFill),"icon-type":"square",onClick:x,onMousedown:u[1]||(u[1]=e.withModifiers(()=>{},["prevent"]))},null,8,["icon"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)],6)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["cregis-textarea",{"is-disabled":t.disabled}]),style:e.normalizeStyle([{width:t.width},t.inputStyle])},[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({class:"cregis-textarea__wrapper"},o.$attrs,{ref_key:"inputRef",ref:s,disabled:t.disabled,placeholder:t.placeholder,rows:t.rows,"onUpdate:modelValue":u[2]||(u[2]=m=>n.value=m),onInput:h,onChange:p,onFocus:B,onBlur:C}),null,16,I),[[e.vModelText,n.value]]),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(f,{class:"cregis-textarea__button",link:"",size:"small",onClick:X},{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode(" Paste ",-1)])]),_:1}),e.createVNode(f,{class:"cregis-textarea__button",link:"",size:"small",disabled:!n.value,onClick:x},{default:e.withCtx(()=>[...u[4]||(u[4]=[e.createTextVNode(" Clear ",-1)])]),_:1},8,["disabled"])]))],6))}}),L=["width","height"],A={stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},F={transform:"translate(-394.000000, -457.000000)"},M={transform:"translate(394.000000, 457.000000)"},W=["width","height"],U=e.defineComponent({__name:"checked-basis",props:{size:{default:"16px"}},setup(t){return(l,a)=>(e.openBlock(),e.createElementBlock("svg",{width:t.size,height:t.size,viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[e.createElementVNode("g",A,[e.createElementVNode("g",F,[e.createElementVNode("g",M,[e.createElementVNode("rect",{x:"0",y:"0",width:t.size,height:t.size},null,8,W),a[0]||(a[0]=e.createElementVNode("path",{d:"M6.67713976,13.5709642 C7.12567714,13.5709642 7.468039,13.3943662 7.70422535,13.0411701 L13.7562297,3.77789816 C13.8407367,3.65005417 13.9024919,3.52546046 13.9414951,3.40411701 C13.9804984,3.28277356 14,3.16468039 14,3.04983749 C14,2.74647887 13.8976165,2.49566631 13.6928494,2.29739978 C13.4880823,2.09913326 13.2307692,2 12.9209101,2 C12.7063922,2 12.5265439,2.04225352 12.3813651,2.12676056 C12.2361863,2.21126761 12.0975081,2.35536295 11.9653304,2.55904659 L6.65113759,10.9512459 L3.95016251,7.60346696 C3.71830986,7.32177681 3.43011918,7.18093174 3.08559047,7.18093174 C2.77139762,7.18093174 2.51191766,7.28169014 2.3071506,7.48320693 C2.10238353,7.68472373 2,7.93824485 2,8.24377031 C2,8.38028169 2.02329361,8.51083424 2.06988082,8.63542795 C2.11646804,8.76002167 2.19826652,8.88949079 2.31527627,9.02383532 L5.67280607,13.0899242 C5.94149512,13.4106176 6.27627302,13.5709642 6.67713976,13.5709642 Z",fill:"currentColor","fill-rule":"nonzero"},null,-1))])])])],8,L))}}),q={key:0,class:"cregis-checkbox--indeterminate"},j=e.defineComponent({name:"Checkbox",__name:"Checkbox",props:{modelValue:{type:[Boolean,Number],default:!1},label:{},disabled:{type:Boolean,default:!1},circle:{type:Boolean},indeterminate:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:l}){const a=t,r=l,i=e.computed(()=>a.modelValue),n=()=>{a.disabled||r("update:modelValue",!i.value)};return e.watch(()=>i.value,()=>{r("change",i.value)}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:"cregis-checkbox__wrapper",onClick:n},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-checkbox",{"is-disabled":t.disabled,"is-checked":i.value,"is-circle":t.circle,"is-indeterminate":t.indeterminate}])},[t.indeterminate?(e.openBlock(),e.createElementBlock("div",q)):(e.openBlock(),e.createBlock(U,{key:1,size:"10px"}))],2),s.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-checkbox__label",{"is-disabled":t.disabled}])},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],2)):e.createCommentVNode("",!0)]))}}),K=e.defineComponent({name:"Radio",__name:"Radio",props:{modelValue:{type:[Boolean,String,Number]},value:{type:[Boolean,String,Number]},label:{},disabled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:l}){const a=t,r=l,i=e.computed(()=>a.modelValue===a.value),n=()=>{a.disabled||(r("update:modelValue",a.value),r("change",a.value))};return(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:"cregis-radio__wrapper",onClick:n},[e.createElementVNode("div",{class:e.normalizeClass(["cregis-radio",{"is-disabled":t.disabled,"is-checked":i.value}])},[...c[0]||(c[0]=[e.createElementVNode("div",{class:"cregis-radio__inner"},null,-1)])],2),s.$slots.default||t.label?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["cregis-radio__label",{"is-disabled":t.disabled}])},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],2)):e.createCommentVNode("",!0)]))}}),O=e.defineComponent({name:"Divider",__name:"Divider",props:{direction:{default:"horizontal"},borderStyle:{default:"solid"},lineThickness:{default:"1px"},color:{default:"var(--line-module)"},margin:{default:"8px"},length:{}},setup(t){const l=t,a=e.computed(()=>{if(Array.isArray(l.margin)){const[i,n]=l.margin;return l.direction==="horizontal"?`${i} 0 ${n} 0`:`0 ${n} 0 ${i}`}else return l.direction==="horizontal"?`${l.margin} 0`:`0 ${l.margin}`}),r=e.computed(()=>l.direction==="horizontal"?{width:l.length||"100%",borderTopWidth:l.lineThickness,borderTopStyle:l.borderStyle,borderTopColor:l.color,margin:a.value}:{height:l.length||"1rem",borderLeftWidth:l.lineThickness,borderLeftStyle:l.borderStyle,borderLeftColor:l.color,margin:a.value});return(i,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cregis-divider",{[`cregis-divider--${t.direction}`]:t.direction}]),style:e.normalizeStyle(r.value)},null,6))}}),y=Symbol("TABS_KEY"),Y=["onClick"],Z={style:{display:"none"}},G=e.defineComponent({name:"Tabs",__name:"Tabs",props:{modelValue:{},type:{default:"default"},size:{default:"medium"}},emits:["update:modelValue"],setup(t){const l=t,a=e.reactive([]),r=s=>{a.some(c=>c.name===s.name)||a.push(s)},i=s=>{const c=a.findIndex(b=>b.name===s);c!==-1&&a.splice(c,1)},n=e.computed(()=>l.type==="card"?l.size==="large"?{borderRadius:"13px"}:l.size==="medium"?{borderRadius:"11px"}:{borderRadius:"9px"}:{borderRadius:0});return e.provide(y,{activeName:e.toRef(l,"modelValue"),registerTab:r,unregisterTab:i}),(s,c)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cregis-tabs",{[`cregis-tabs--${t.type}`]:t.type,[`cregis-tabs--${t.size}`]:t.size}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a,b=>(e.openBlock(),e.createElementBlock("div",{key:b.name,class:e.normalizeClass(["cregis-tabs__item",{"is-active":t.modelValue===b.name}]),style:e.normalizeStyle(n.value),onClick:g=>s.$emit("update:modelValue",b.name)},[e.createElementVNode("span",null,e.toDisplayString(b.label),1)],14,Y))),128)),e.createElementVNode("div",Z,[e.renderSlot(s.$slots,"default")])],2))}}),H=e.defineComponent({name:"TabPane",__name:"TabPane",props:{label:{},name:{}},setup(t){const l=t,a=e.inject(y);if(!a)throw new Error("TabPane must be used within Tabs");return e.onMounted(()=>{a.registerTab({label:l.label,name:l.name})}),e.watch(()=>l.label,r=>{a.unregisterTab(l.name),a.registerTab({label:r,name:l.name})}),e.onUnmounted(()=>{a.unregisterTab(l.name)}),()=>{}}});d.Button=f,d.Checkbox=j,d.Divider=O,d.Input=P,d.Radio=K,d.TABS_KEY=y,d.TabPane=H,d.Tabs=G,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cregis/ui",
3
3
  "private": false,
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"