@tb-dev/vue 0.3.14 → 0.3.16

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,5 @@
1
- import { VNode } from 'vue';
2
1
  import { SidebarProps } from './types';
2
+ import { VNode } from 'vue';
3
3
  declare function __VLS_template(): {
4
4
  attrs: Partial<{}>;
5
5
  slots: Readonly<{
@@ -1,3 +1,9 @@
1
+ import { SidebarProps as Props } from '../__base/sidebar';
1
2
  export interface SidebarProps {
3
+ collapsible?: Props['collapsible'];
2
4
  defaultOpen?: boolean;
5
+ side?: Props['side'];
6
+ variant?: Props['variant'];
7
+ width?: string | number;
8
+ widthMobile?: string | number;
3
9
  }
@@ -1,7 +1,9 @@
1
1
  import { Option } from '@tb-dev/utils';
2
2
  export interface TextareaProps {
3
3
  autocapitalize?: boolean;
4
+ autofocus?: boolean;
4
5
  class?: string;
6
+ cols?: number;
5
7
  disabled?: boolean;
6
8
  label?: string;
7
9
  labelClass?: string;
@@ -12,4 +14,5 @@ export interface TextareaProps {
12
14
  placeholder?: string;
13
15
  readonly?: boolean;
14
16
  required?: boolean;
17
+ rows?: number;
15
18
  }
package/dist/index.js CHANGED
@@ -2431,7 +2431,6 @@ const _sfc_main$1G = /* @__PURE__ */ defineComponent({
2431
2431
  createVNode(unref(_sfc_main$1P), {
2432
2432
  modelValue: value.value,
2433
2433
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
2434
- modelModifiers: { trim: true },
2435
2434
  type: "text",
2436
2435
  placeholder: _ctx.placeholder,
2437
2436
  disabled: _ctx.disabled,
@@ -4958,13 +4957,32 @@ const sidebarMenuButtonVariants = cva(
4958
4957
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
4959
4958
  __name: "Sidebar",
4960
4959
  props: {
4961
- defaultOpen: { type: Boolean }
4960
+ collapsible: {},
4961
+ defaultOpen: { type: Boolean },
4962
+ side: {},
4963
+ variant: {},
4964
+ width: {},
4965
+ widthMobile: {}
4962
4966
  },
4963
4967
  setup(__props) {
4968
+ const props = __props;
4969
+ const sidebarStyle = computed(() => {
4970
+ const style = {};
4971
+ if (props.width) style["--sidebar-width"] = toPixel(props.width);
4972
+ if (props.widthMobile) style["--sidebar-width-mobile"] = toPixel(props.widthMobile);
4973
+ return style;
4974
+ });
4964
4975
  return (_ctx, _cache) => {
4965
- return openBlock(), createBlock(unref(_sfc_main$t), { "default-open": _ctx.defaultOpen }, {
4976
+ return openBlock(), createBlock(unref(_sfc_main$t), {
4977
+ "default-open": _ctx.defaultOpen,
4978
+ style: normalizeStyle(sidebarStyle.value)
4979
+ }, {
4966
4980
  default: withCtx(() => [
4967
- createVNode(unref(_sfc_main$R), null, {
4981
+ createVNode(unref(_sfc_main$R), {
4982
+ collapsible: _ctx.collapsible,
4983
+ side: _ctx.side,
4984
+ variant: _ctx.variant
4985
+ }, {
4968
4986
  default: withCtx(() => [
4969
4987
  _ctx.$slots.header ? (openBlock(), createBlock(unref(_sfc_main$K), { key: 0 }, {
4970
4988
  default: withCtx(() => [
@@ -4986,7 +5004,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4986
5004
  })) : createCommentVNode("", true)
4987
5005
  ]),
4988
5006
  _: 3
4989
- }),
5007
+ }, 8, ["collapsible", "side", "variant"]),
4990
5008
  _ctx.$slots.inset ? (openBlock(), createBlock(unref(_sfc_main$J), { key: 0 }, {
4991
5009
  default: withCtx(() => [
4992
5010
  renderSlot(_ctx.$slots, "inset")
@@ -4995,7 +5013,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
4995
5013
  })) : renderSlot(_ctx.$slots, "default", { key: 1 })
4996
5014
  ]),
4997
5015
  _: 3
4998
- }, 8, ["default-open"]);
5016
+ }, 8, ["default-open", "style"]);
4999
5017
  };
5000
5018
  }
5001
5019
  });
@@ -5701,7 +5719,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5701
5719
  __name: "Textarea",
5702
5720
  props: {
5703
5721
  autocapitalize: { type: Boolean },
5722
+ autofocus: { type: Boolean },
5704
5723
  class: {},
5724
+ cols: {},
5705
5725
  disabled: { type: Boolean },
5706
5726
  label: {},
5707
5727
  labelClass: {},
@@ -5711,7 +5731,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5711
5731
  onBlur: { type: Function },
5712
5732
  placeholder: {},
5713
5733
  readonly: { type: Boolean },
5714
- required: { type: Boolean }
5734
+ required: { type: Boolean },
5735
+ rows: {}
5715
5736
  },
5716
5737
  emits: ["update:modelValue"],
5717
5738
  setup(__props, { emit: __emit }) {
@@ -5730,26 +5751,28 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
5730
5751
  createVNode(unref(_sfc_main$2), {
5731
5752
  modelValue: value.value,
5732
5753
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => value.value = $event),
5733
- modelModifiers: { trim: true },
5734
5754
  type: "text",
5735
5755
  autocapitalize: _ctx.autocapitalize,
5736
5756
  autocomplete: "off",
5737
5757
  autocorrect: "off",
5758
+ autofocus: _ctx.autofocus,
5759
+ cols: _ctx.cols,
5738
5760
  disabled: _ctx.disabled,
5739
5761
  maxlength: _ctx.max,
5740
5762
  minlength: _ctx.min,
5741
5763
  placeholder: _ctx.placeholder,
5742
5764
  readonly: _ctx.readonly,
5743
5765
  required: _ctx.required,
5766
+ rows: _ctx.rows,
5744
5767
  spellcheck: "false",
5745
5768
  class: normalizeClass(
5746
5769
  unref(cn)(
5747
- "h-full resize-none font-normal focus-visible:ring-0 disabled:cursor-default",
5770
+ "size-full resize-none font-normal focus-visible:ring-0 disabled:cursor-default",
5748
5771
  props.class
5749
5772
  )
5750
5773
  ),
5751
5774
  onBlur: _ctx.onBlur
5752
- }, null, 8, ["modelValue", "autocapitalize", "disabled", "maxlength", "minlength", "placeholder", "readonly", "required", "class", "onBlur"])
5775
+ }, null, 8, ["modelValue", "autocapitalize", "autofocus", "cols", "disabled", "maxlength", "minlength", "placeholder", "readonly", "required", "rows", "class", "onBlur"])
5753
5776
  ]),
5754
5777
  _: 1
5755
5778
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tb-dev/vue",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Vue utilities",
5
5
  "license": "MIT",
6
6
  "type": "module",