@tb-dev/vue-components 0.2.5 → 0.2.6
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,5 +1,9 @@
|
|
|
1
1
|
import { SidebarProps } from './types';
|
|
2
2
|
import { VNode } from 'vue';
|
|
3
|
+
type __VLS_Props = SidebarProps;
|
|
4
|
+
type __VLS_PublicProps = {
|
|
5
|
+
'open'?: boolean;
|
|
6
|
+
} & __VLS_Props;
|
|
3
7
|
declare function __VLS_template(): {
|
|
4
8
|
attrs: Partial<{}>;
|
|
5
9
|
slots: Readonly<{
|
|
@@ -19,7 +23,11 @@ declare function __VLS_template(): {
|
|
|
19
23
|
rootEl: any;
|
|
20
24
|
};
|
|
21
25
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
26
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
"update:open": (value: boolean) => any;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
30
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
31
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
32
|
export default _default;
|
|
25
33
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/dist/index.js
CHANGED
|
@@ -2269,9 +2269,9 @@ const _sfc_main$1V = /* @__PURE__ */ defineComponent({
|
|
|
2269
2269
|
get: () => props.modelValue ?? void 0,
|
|
2270
2270
|
set: (it) => emit("update:modelValue", it ?? null)
|
|
2271
2271
|
});
|
|
2272
|
-
const
|
|
2272
|
+
const component = useTemplateRef("inputComponent");
|
|
2273
2273
|
const inputEl = computed(() => {
|
|
2274
|
-
return
|
|
2274
|
+
return component.value?.$el;
|
|
2275
2275
|
});
|
|
2276
2276
|
function focus() {
|
|
2277
2277
|
inputEl.value?.focus();
|
|
@@ -2285,8 +2285,7 @@ const _sfc_main$1V = /* @__PURE__ */ defineComponent({
|
|
|
2285
2285
|
__expose({ inputEl, focus, blur, select });
|
|
2286
2286
|
return (_ctx, _cache) => {
|
|
2287
2287
|
return openBlock(), createBlock(unref(_sfc_main$1W), {
|
|
2288
|
-
|
|
2289
|
-
ref: inputComponent,
|
|
2288
|
+
ref: "inputComponent",
|
|
2290
2289
|
modelValue: value.value,
|
|
2291
2290
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
2292
2291
|
modelModifiers: { trim: true },
|
|
@@ -2546,8 +2545,8 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
|
|
|
2546
2545
|
setup(__props, { expose: __expose }) {
|
|
2547
2546
|
const props = __props;
|
|
2548
2547
|
const value = useModel(__props, "modelValue");
|
|
2549
|
-
const
|
|
2550
|
-
const inputEl = computed(() =>
|
|
2548
|
+
const component = useTemplateRef("inputComponent");
|
|
2549
|
+
const inputEl = computed(() => component.value?.inputEl);
|
|
2551
2550
|
function focus() {
|
|
2552
2551
|
inputEl.value?.focus();
|
|
2553
2552
|
}
|
|
@@ -2560,8 +2559,7 @@ const _sfc_main$1O = /* @__PURE__ */ defineComponent({
|
|
|
2560
2559
|
__expose({ inputEl, focus, blur, select });
|
|
2561
2560
|
return (_ctx, _cache) => {
|
|
2562
2561
|
return openBlock(), createBlock(unref(_sfc_main$1V), {
|
|
2563
|
-
|
|
2564
|
-
ref: inputComponent,
|
|
2562
|
+
ref: "inputComponent",
|
|
2565
2563
|
modelValue: value.value,
|
|
2566
2564
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
2567
2565
|
type: "text",
|
|
@@ -3487,8 +3485,8 @@ const _sfc_main$1k = /* @__PURE__ */ defineComponent({
|
|
|
3487
3485
|
setup(__props, { expose: __expose }) {
|
|
3488
3486
|
const props = __props;
|
|
3489
3487
|
const isOpen = useModel(__props, "modelValue");
|
|
3490
|
-
const
|
|
3491
|
-
onClickOutside(
|
|
3488
|
+
const component = useTemplateRef("contentEl");
|
|
3489
|
+
onClickOutside(component, () => {
|
|
3492
3490
|
if (!props.keepOpen) close();
|
|
3493
3491
|
});
|
|
3494
3492
|
function open() {
|
|
@@ -5336,16 +5334,21 @@ const sidebarMenuButtonVariants = cva(
|
|
|
5336
5334
|
|
|
5337
5335
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
5338
5336
|
__name: "Sidebar",
|
|
5339
|
-
props: {
|
|
5337
|
+
props: /* @__PURE__ */ mergeModels({
|
|
5340
5338
|
collapsible: {},
|
|
5341
5339
|
defaultOpen: { type: Boolean },
|
|
5342
5340
|
side: {},
|
|
5343
5341
|
variant: {},
|
|
5344
5342
|
width: {},
|
|
5345
5343
|
widthMobile: {}
|
|
5346
|
-
},
|
|
5344
|
+
}, {
|
|
5345
|
+
"open": { type: Boolean, ...{ required: false } },
|
|
5346
|
+
"openModifiers": {}
|
|
5347
|
+
}),
|
|
5348
|
+
emits: ["update:open"],
|
|
5347
5349
|
setup(__props) {
|
|
5348
5350
|
const props = __props;
|
|
5351
|
+
const open = useModel(__props, "open");
|
|
5349
5352
|
const sidebarStyle = computed(() => {
|
|
5350
5353
|
const style = {};
|
|
5351
5354
|
if (props.width) style["--sidebar-width"] = toPixel(props.width);
|
|
@@ -5354,6 +5357,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5354
5357
|
});
|
|
5355
5358
|
return (_ctx, _cache) => {
|
|
5356
5359
|
return openBlock(), createBlock(unref(_sfc_main$v), {
|
|
5360
|
+
open: open.value,
|
|
5361
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
5357
5362
|
"default-open": _ctx.defaultOpen,
|
|
5358
5363
|
style: normalizeStyle(sidebarStyle.value)
|
|
5359
5364
|
}, {
|
|
@@ -5393,7 +5398,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
5393
5398
|
})) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
5394
5399
|
]),
|
|
5395
5400
|
_: 3
|
|
5396
|
-
}, 8, ["default-open", "style"]);
|
|
5401
|
+
}, 8, ["open", "default-open", "style"]);
|
|
5397
5402
|
};
|
|
5398
5403
|
}
|
|
5399
5404
|
});
|
|
@@ -6204,9 +6209,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6204
6209
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
6205
6210
|
const props = __props;
|
|
6206
6211
|
const emit = __emit;
|
|
6207
|
-
const
|
|
6212
|
+
const component = useTemplateRef("textareaComponent");
|
|
6208
6213
|
const textareaEl = computed(() => {
|
|
6209
|
-
return
|
|
6214
|
+
return component.value?.$el;
|
|
6210
6215
|
});
|
|
6211
6216
|
const value = computed({
|
|
6212
6217
|
// eslint-disable-next-line no-undefined
|
|
@@ -6218,10 +6223,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6218
6223
|
});
|
|
6219
6224
|
__expose({ textareaEl });
|
|
6220
6225
|
return (_ctx, _cache) => {
|
|
6221
|
-
return openBlock(), createBlock(unref(_sfc_main$3), mergeProps({
|
|
6222
|
-
ref_key: "textareaComponent",
|
|
6223
|
-
ref: textareaComponent
|
|
6224
|
-
}, _ctx.$attrs, {
|
|
6226
|
+
return openBlock(), createBlock(unref(_sfc_main$3), mergeProps({ ref: "textareaComponent" }, _ctx.$attrs, {
|
|
6225
6227
|
modelValue: value.value,
|
|
6226
6228
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
|
|
6227
6229
|
modelModifiers: { trim: true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/vue-components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Vue components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"lucide-vue-next": "^0.511.0",
|
|
33
33
|
"reka-ui": "^2.3.0",
|
|
34
34
|
"tailwind-merge": "^3.3.0",
|
|
35
|
-
"tw-animate-css": "^1.3.
|
|
36
|
-
"vue": "^3.5.
|
|
35
|
+
"tw-animate-css": "^1.3.2",
|
|
36
|
+
"vue": "^3.5.16",
|
|
37
37
|
"vue-router": "^4.5.1",
|
|
38
38
|
"vue-sonner": "^2.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@tailwindcss/vite": "^4.1.8",
|
|
42
42
|
"@tb-dev/eslint-config": "^7.1.5",
|
|
43
|
-
"@types/node": "^22.15.
|
|
43
|
+
"@types/node": "^22.15.28",
|
|
44
44
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
45
45
|
"eslint": "^9.27.0",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
47
|
"prettier-plugin-css-order": "^2.1.2",
|
|
48
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
48
|
+
"prettier-plugin-tailwindcss": "^0.6.12",
|
|
49
49
|
"tailwindcss": "^4.1.8",
|
|
50
50
|
"tslib": "^2.8.1",
|
|
51
51
|
"typescript": "~5.8.3",
|