@tb-dev/vue 0.3.31 → 0.3.33

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,10 +1,36 @@
1
1
  import { InputProps } from './types';
2
- declare const _default: import('vue').DefineComponent<InputProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
2
+ declare function focus(): void;
3
+ declare const _default: import('vue').DefineComponent<InputProps, {
4
+ focus: typeof focus;
5
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
6
  "update:modelValue": (value: string | null) => any;
4
7
  }, string, import('vue').PublicProps, Readonly<InputProps> & Readonly<{
5
8
  "onUpdate:modelValue"?: ((value: string | null) => any) | undefined;
6
9
  }>, {
7
10
  type: import('vue').InputTypeHTMLAttribute;
8
11
  spellcheck: boolean | "true" | "false";
9
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
13
+ inputEl: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
14
+ defaultValue?: string | number;
15
+ modelValue?: string | number;
16
+ class?: import('vue').HTMLAttributes["class"];
17
+ }> & Readonly<{
18
+ "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
19
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ "update:modelValue": (payload: string | number) => any;
21
+ }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLInputElement, import('vue').ComponentProvideOptions, {
22
+ P: {};
23
+ B: {};
24
+ D: {};
25
+ C: {};
26
+ M: {};
27
+ Defaults: {};
28
+ }, Readonly<{
29
+ defaultValue?: string | number;
30
+ modelValue?: string | number;
31
+ class?: import('vue').HTMLAttributes["class"];
32
+ }> & Readonly<{
33
+ "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
34
+ }>, {}, {}, {}, {}, {}> | null;
35
+ }, any>;
10
36
  export default _default;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { cva } from 'class-variance-authority';
2
- import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, resolveDynamicComponent, createCommentVNode, normalizeStyle, mergeModels, useModel, createElementVNode, createTextVNode, withDirectives, isRef, vModelText, normalizeProps, guardReactiveProps, useTemplateRef, ref, renderList, createSlots, toRef, effectScope } from 'vue';
2
+ import { inject as inject$1, toValue, defineComponent, computed, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, normalizeClass, createElementBlock, Fragment, createVNode, toDisplayString, resolveDynamicComponent, createCommentVNode, normalizeStyle, mergeModels, useModel, createElementVNode, createTextVNode, withDirectives, isRef, vModelText, useTemplateRef, normalizeProps, guardReactiveProps, ref, renderList, createSlots, toRef, effectScope } from 'vue';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { clsx } from 'clsx';
5
5
  import { unwrap, isNil, toPixel } from '@tb-dev/utils';
@@ -2371,20 +2371,28 @@ const _sfc_main$1T = /* @__PURE__ */ defineComponent({
2371
2371
  type: { default: "text" }
2372
2372
  },
2373
2373
  emits: ["update:modelValue"],
2374
- setup(__props, { emit: __emit }) {
2374
+ setup(__props, { expose: __expose, emit: __emit }) {
2375
2375
  const props = __props;
2376
2376
  const emit = __emit;
2377
+ const inputEl = useTemplateRef("inputEl");
2377
2378
  const value = computed({
2378
2379
  // eslint-disable-next-line no-undefined
2379
2380
  get: () => props.modelValue ?? void 0,
2380
2381
  set: (it) => emit("update:modelValue", it ?? null)
2381
2382
  });
2382
2383
  const [DefineTemplate, ReuseTemplate] = createReusableTemplate();
2384
+ function focus() {
2385
+ inputEl.value?.$el?.focus();
2386
+ }
2387
+ __expose({ focus });
2383
2388
  return (_ctx, _cache) => {
2384
2389
  return openBlock(), createElementBlock(Fragment, null, [
2385
2390
  createVNode(unref(DefineTemplate), null, {
2386
2391
  default: withCtx(() => [
2387
- createVNode(unref(_sfc_main$1U), mergeProps(_ctx.$attrs, {
2392
+ createVNode(unref(_sfc_main$1U), mergeProps({
2393
+ ref_key: "inputEl",
2394
+ ref: inputEl
2395
+ }, _ctx.$attrs, {
2388
2396
  modelValue: value.value,
2389
2397
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
2390
2398
  modelModifiers: { trim: true },
@@ -5752,7 +5760,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
5752
5760
  "data-slot": "table-cell",
5753
5761
  class: normalizeClass(
5754
5762
  unref(cn)(
5755
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
5763
+ "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
5756
5764
  props.class
5757
5765
  )
5758
5766
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/vue",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "description": "Vue utilities",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "composables"
26
26
  ],
27
27
  "dependencies": {
28
- "@tanstack/vue-table": "^8.21.2",
28
+ "@tanstack/vue-table": "^8.21.3",
29
29
  "@tb-dev/utils": "^6.0.1",
30
30
  "@vueuse/core": "^13.1.0",
31
31
  "class-variance-authority": "^0.7.1",
@@ -50,7 +50,7 @@
50
50
  "tailwindcss": "^4.1.4",
51
51
  "tslib": "^2.8.1",
52
52
  "typescript": "~5.8.3",
53
- "vite": "^6.2.6",
53
+ "vite": "^6.3.1",
54
54
  "vite-plugin-dts": "^4.5.3",
55
55
  "vue-tsc": "~2.2.8"
56
56
  },