straw-ui-vue 0.1.2 → 0.1.4

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.
Files changed (49) hide show
  1. package/dist/components/st-button/st-button.vue_vue_type_script_setup_true_lang.cjs +1 -1
  2. package/dist/components/st-button/st-button.vue_vue_type_script_setup_true_lang.js +8 -8
  3. package/dist/components/st-button/types.d.ts +2 -2
  4. package/dist/components/st-checkbox/st-checkbox.vue_vue_type_script_setup_true_lang.cjs +1 -1
  5. package/dist/components/st-checkbox/st-checkbox.vue_vue_type_script_setup_true_lang.js +10 -19
  6. package/dist/components/st-dialog/index.d.ts +3 -3
  7. package/dist/components/st-dialog/st-dialog.vue.d.ts +4 -4
  8. package/dist/components/st-dialog/st-dialog.vue_vue_type_script_setup_true_lang.cjs +1 -1
  9. package/dist/components/st-dialog/st-dialog.vue_vue_type_script_setup_true_lang.js +88 -91
  10. package/dist/components/st-dialog/types.d.ts +1 -1
  11. package/dist/components/st-input/st-input.vue.cjs +1 -1
  12. package/dist/components/st-input/st-input.vue.js +1 -1
  13. package/dist/components/st-input/st-input.vue_vue_type_script_setup_true_lang.cjs +1 -1
  14. package/dist/components/st-input/st-input.vue_vue_type_script_setup_true_lang.js +3 -3
  15. package/dist/components/st-menu/index.d.ts +3 -0
  16. package/dist/components/st-menu/st-menu-node.vue_vue_type_script_setup_true_lang.cjs +1 -1
  17. package/dist/components/st-menu/st-menu-node.vue_vue_type_script_setup_true_lang.js +4 -4
  18. package/dist/components/st-menu/st-menu.vue.d.ts +1 -0
  19. package/dist/components/st-menu/st-menu.vue_vue_type_script_setup_true_lang.cjs +1 -1
  20. package/dist/components/st-menu/st-menu.vue_vue_type_script_setup_true_lang.js +11 -5
  21. package/dist/components/st-popover/index.d.ts +3 -3
  22. package/dist/components/st-popover/st-popover.vue.d.ts +1 -1
  23. package/dist/components/st-popover/st-popover.vue_vue_type_script_setup_true_lang.cjs +1 -1
  24. package/dist/components/st-popover/st-popover.vue_vue_type_script_setup_true_lang.js +12 -2
  25. package/dist/components/st-popover/types.d.ts +2 -2
  26. package/dist/components/st-select/index.d.ts +6 -6
  27. package/dist/components/st-select/st-select.vue.d.ts +2 -2
  28. package/dist/components/st-select/st-select.vue_vue_type_script_setup_true_lang.cjs +1 -1
  29. package/dist/components/st-select/st-select.vue_vue_type_script_setup_true_lang.js +4 -4
  30. package/dist/components/st-select/types.d.ts +2 -2
  31. package/dist/components/st-sidebar/st-sidebar.vue_vue_type_script_setup_true_lang.cjs +1 -1
  32. package/dist/components/st-sidebar/st-sidebar.vue_vue_type_script_setup_true_lang.js +1 -1
  33. package/dist/components/st-splitter-panel/st-splitter-panel.vue_vue_type_script_setup_true_lang.cjs +1 -1
  34. package/dist/components/st-splitter-panel/st-splitter-panel.vue_vue_type_script_setup_true_lang.js +1 -1
  35. package/dist/components/st-toggle/st-toggle.vue_vue_type_script_setup_true_lang.cjs +1 -1
  36. package/dist/components/st-toggle/st-toggle.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/dist/components/st-tooltip/st-tooltip.vue_vue_type_script_setup_true_lang.cjs +1 -1
  38. package/dist/components/st-tooltip/st-tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
  39. package/dist/components/st-tree/st-tree-node.vue_vue_type_script_setup_true_lang.cjs +1 -1
  40. package/dist/components/st-tree/st-tree-node.vue_vue_type_script_setup_true_lang.js +6 -6
  41. package/dist/generated-safelist.cjs +1 -1
  42. package/dist/generated-safelist.js +1 -1
  43. package/dist/index.css +1 -1
  44. package/dist/index.d.ts +15 -12
  45. package/dist/unocss-preset.d.ts +8 -2
  46. package/dist/unocssPreset.cjs +1 -1
  47. package/dist/unocssPreset.js +10 -2
  48. package/dist/variables.css +28 -26
  49. package/package.json +93 -94
@@ -1 +1 @@
1
- const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs");let n=require("vue");var r=[`disabled`],i={key:0,class:`i-ri-loader-4-line animate-spin`},a=(0,n.defineComponent)({inheritAttrs:!1,__name:`st-button`,props:{variant:{default:`default`},type:{default:`default`},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{}},emits:[`click`],setup(a,{emit:o}){let s={default:`h-9 px-4 text-3.5 gap-1.5`,icon:`w-9 h-9`},c={primary:`bg-primary text-primary-foreground`,default:`bg-secondary text-secondary-foreground`,ghost:`bg-transparent text-foreground`},l={primary:`hover:bg-primary/90`,default:`hover:bg-secondary/80`,ghost:`hover:bg-secondary/80`},u=a,d=(0,n.useAttrs)(),f=o,p=(0,n.useSlots)(),m=t.cva({base:`inline-flex items-center justify-center rounded-radius font-default transition-all duration-150 ease-in-out border-none outline-none select-none`,variants:{variant:{primary:c.primary,default:c.default,ghost:c.ghost},type:{default:s.default,icon:s.icon},disabled:{true:`opacity-50 cursor-not-allowed`},loading:{true:`cursor-not-allowed`}},defaultVariants:{variant:`default`,type:`default`}}),h=(0,n.computed)(()=>e.cn(m({variant:u.variant,type:u.type,disabled:u.disabled,loading:u.loading}),!u.disabled&&!u.loading?l[u.variant]:``,d.class)),g=(0,n.computed)(()=>u.type===`icon`),_=(0,n.computed)(()=>u.disabled||u.loading),v=(0,n.computed)(()=>u.prefixIcon||p.prefixIcon),y=(0,n.computed)(()=>u.suffixIcon||p.suffixIcon),b=e=>`i-ri-${e}`,x=e=>{_.value||f(`click`,e)};return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`button`,{class:(0,n.normalizeClass)(h.value),style:(0,n.normalizeStyle)((0,n.unref)(d).style),disabled:_.value,onClick:x},[u.loading?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,i)):(0,n.createCommentVNode)(``,!0),g.value?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[u.prefixIcon?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,{key:0,class:(0,n.normalizeClass)(b(u.prefixIcon))},null,2)):(0,n.renderSlot)(e.$slots,`default`,{key:1})],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:2},[v.value?(0,n.renderSlot)(e.$slots,`prefixIcon`,{key:0},()=>[(0,n.createElementVNode)(`i`,{class:(0,n.normalizeClass)(b(u.prefixIcon))},null,2)]):(0,n.createCommentVNode)(``,!0),(0,n.renderSlot)(e.$slots,`default`),y.value?(0,n.renderSlot)(e.$slots,`suffixIcon`,{key:1},()=>[(0,n.createElementVNode)(`i`,{class:(0,n.normalizeClass)(b(u.suffixIcon))},null,2)]):(0,n.createCommentVNode)(``,!0)],64))],14,r))}});exports.default=a;
1
+ const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs");let n=require("vue");var r=[`disabled`],i={key:0,class:`i-lucide-loader-2 animate-spin`},a=(0,n.defineComponent)({inheritAttrs:!1,__name:`st-button`,props:{variant:{default:`default`},type:{default:`default`},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{}},emits:[`click`],setup(a,{emit:o}){let s={default:`h-9 px-4 text-3.5 gap-1.5`,icon:`w-9 h-9`},c={primary:`bg-primary text-primary-foreground`,default:`bg-secondary text-secondary-foreground`,ghost:`bg-transparent text-foreground`},l={primary:`hover:bg-primary/90`,default:`hover:bg-secondary/80`,ghost:`hover:bg-accent`},u=a,d=(0,n.useAttrs)(),f=o,p=(0,n.useSlots)(),m=t.cva({base:`inline-flex items-center justify-center rounded font-default transition-all duration-150 ease-in-out border-none outline-none select-none`,variants:{variant:{primary:c.primary,default:c.default,ghost:c.ghost},type:{default:s.default,icon:s.icon},disabled:{true:`opacity-50 cursor-not-allowed`},loading:{true:`cursor-not-allowed`}},defaultVariants:{variant:`default`,type:`default`}}),h=(0,n.computed)(()=>e.cn(m({variant:u.variant,type:u.type,disabled:u.disabled,loading:u.loading}),!u.disabled&&!u.loading?l[u.variant]:``,d.class)),g=(0,n.computed)(()=>u.type===`icon`),_=(0,n.computed)(()=>u.disabled||u.loading),v=(0,n.computed)(()=>u.prefixIcon||p.prefixIcon),y=(0,n.computed)(()=>u.suffixIcon||p.suffixIcon),b=e=>{_.value||f(`click`,e)};return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`button`,{class:(0,n.normalizeClass)(h.value),style:(0,n.normalizeStyle)((0,n.unref)(d).style),disabled:_.value,onClick:b},[u.loading?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,i)):(0,n.createCommentVNode)(``,!0),g.value?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[u.prefixIcon?((0,n.openBlock)(),(0,n.createElementBlock)(`i`,{key:0,class:(0,n.normalizeClass)(u.prefixIcon)},null,2)):(0,n.renderSlot)(e.$slots,`default`,{key:1})],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:2},[v.value?(0,n.renderSlot)(e.$slots,`prefixIcon`,{key:0},()=>[(0,n.createElementVNode)(`i`,{class:(0,n.normalizeClass)(u.prefixIcon)},null,2)]):(0,n.createCommentVNode)(``,!0),(0,n.renderSlot)(e.$slots,`default`),y.value?(0,n.renderSlot)(e.$slots,`suffixIcon`,{key:1},()=>[(0,n.createElementVNode)(`i`,{class:(0,n.normalizeClass)(u.suffixIcon)},null,2)]):(0,n.createCommentVNode)(``,!0)],64))],14,r))}});exports.default=a;
@@ -4,7 +4,7 @@ import { Fragment as n, computed as r, createCommentVNode as i, createElementBlo
4
4
  //#region src/components/st-button/st-button.vue?vue&type=script&setup=true&lang.ts
5
5
  var h = ["disabled"], g = {
6
6
  key: 0,
7
- class: "i-ri-loader-4-line animate-spin"
7
+ class: "i-lucide-loader-2 animate-spin"
8
8
  }, _ = /*@__PURE__*/ s({
9
9
  inheritAttrs: !1,
10
10
  __name: "st-button",
@@ -34,9 +34,9 @@ var h = ["disabled"], g = {
34
34
  }, b = {
35
35
  primary: "hover:bg-primary/90",
36
36
  default: "hover:bg-secondary/80",
37
- ghost: "hover:bg-secondary/80"
37
+ ghost: "hover:bg-accent"
38
38
  }, x = s, S = p(), C = _, w = m(), T = t({
39
- base: "inline-flex items-center justify-center rounded-radius font-default transition-all duration-150 ease-in-out border-none outline-none select-none",
39
+ base: "inline-flex items-center justify-center rounded font-default transition-all duration-150 ease-in-out border-none outline-none select-none",
40
40
  variants: {
41
41
  variant: {
42
42
  primary: y.primary,
@@ -59,21 +59,21 @@ var h = ["disabled"], g = {
59
59
  type: x.type,
60
60
  disabled: x.disabled,
61
61
  loading: x.loading
62
- }), !x.disabled && !x.loading ? b[x.variant] : "", S.class)), D = r(() => x.type === "icon"), O = r(() => x.disabled || x.loading), k = r(() => x.prefixIcon || w.prefixIcon), A = r(() => x.suffixIcon || w.suffixIcon), j = (e) => `i-ri-${e}`, M = (e) => {
62
+ }), !x.disabled && !x.loading ? b[x.variant] : "", S.class)), D = r(() => x.type === "icon"), O = r(() => x.disabled || x.loading), k = r(() => x.prefixIcon || w.prefixIcon), A = r(() => x.suffixIcon || w.suffixIcon), j = (e) => {
63
63
  O.value || C("click", e);
64
64
  };
65
65
  return (e, t) => (u(), a("button", {
66
66
  class: c(E.value),
67
67
  style: l(f(S).style),
68
68
  disabled: O.value,
69
- onClick: M
69
+ onClick: j
70
70
  }, [x.loading ? (u(), a("i", g)) : i("", !0), D.value ? (u(), a(n, { key: 1 }, [x.prefixIcon ? (u(), a("i", {
71
71
  key: 0,
72
- class: c(j(x.prefixIcon))
72
+ class: c(x.prefixIcon)
73
73
  }, null, 2)) : d(e.$slots, "default", { key: 1 })], 64)) : (u(), a(n, { key: 2 }, [
74
- k.value ? d(e.$slots, "prefixIcon", { key: 0 }, () => [o("i", { class: c(j(x.prefixIcon)) }, null, 2)]) : i("", !0),
74
+ k.value ? d(e.$slots, "prefixIcon", { key: 0 }, () => [o("i", { class: c(x.prefixIcon) }, null, 2)]) : i("", !0),
75
75
  d(e.$slots, "default"),
76
- A.value ? d(e.$slots, "suffixIcon", { key: 1 }, () => [o("i", { class: c(j(x.suffixIcon)) }, null, 2)]) : i("", !0)
76
+ A.value ? d(e.$slots, "suffixIcon", { key: 1 }, () => [o("i", { class: c(x.suffixIcon) }, null, 2)]) : i("", !0)
77
77
  ], 64))], 14, h));
78
78
  }
79
79
  });
@@ -20,9 +20,9 @@ export interface ButtonProps {
20
20
  disabled?: boolean;
21
21
  /** 是否显示加载状态 */
22
22
  loading?: boolean;
23
- /** 前缀图标名称(Remix Icon,不含 i-ri- 前缀) */
23
+ /** 前缀图标名称(Lucide 图标,不含 i-lucide- 前缀) */
24
24
  prefixIcon?: string;
25
- /** 后缀图标名称(Remix Icon,不含 i-ri- 前缀) */
25
+ /** 后缀图标名称(Lucide 图标,不含 i-lucide- 前缀) */
26
26
  suffixIcon?: string;
27
27
  }
28
28
 
@@ -1 +1 @@
1
- const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs");let n=require("vue");var r=[`checked`,`disabled`],i=(0,n.defineComponent)({inheritAttrs:!1,__name:`st-checkbox`,props:(0,n.mergeModels)({disabled:{type:Boolean,default:!1},trueValue:{type:[Boolean,String,Number],default:!0},falseValue:{type:[Boolean,String,Number],default:!1}},{modelValue:{type:[Boolean,String,Number],default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(i){let a=i,o=(0,n.useModel)(i,`modelValue`),s=(0,n.useSlots)(),c=(0,n.useAttrs)(),l=(0,n.inject)(`checkboxGroup`,null),u=(0,n.computed)(()=>!!s.default),d=(0,n.computed)(()=>l&&l.disabled.value||a.disabled),f=(0,n.computed)(()=>l?l.modelValue.value.includes(a.trueValue):o.value===a.trueValue),p=t.cva({base:`inline-flex items-center cursor-pointer select-none gap-2`,variants:{disabled:{true:`cursor-not-allowed opacity-50`,false:``}}}),m=(0,n.computed)(()=>e.cn(p({disabled:d.value}),c.class)),h=(0,n.computed)(()=>e.cn(`sr-only`)),g=t.cva({base:`flex items-center justify-center border-2 rounded-radius transition-all duration-200 w-5 h-5`,variants:{checked:{true:`bg-primary border-primary`,false:`bg-background border-input hover:border-ring`},disabled:{true:`cursor-not-allowed`,false:`cursor-pointer`}}}),_=(0,n.computed)(()=>g({checked:f.value,disabled:d.value})),v=(0,n.computed)(()=>e.cn(`text-primary-foreground w-2.5 h-2.5`)),y=(0,n.computed)(()=>e.cn(`w-full h-full`)),b=t.cva({base:`text-foreground text-sm`,variants:{disabled:{true:`text-muted-foreground`,false:``}}}),x=(0,n.computed)(()=>b({disabled:d.value})),S=e=>{d.value&&e.preventDefault()},C=()=>{d.value||(l?l.updateValue(a.trueValue,!f.value):o.value=f.value?a.falseValue:a.trueValue)};return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`label`,{class:(0,n.normalizeClass)(m.value),style:(0,n.normalizeStyle)((0,n.unref)(c).style),onClick:S},[(0,n.createElementVNode)(`input`,{checked:f.value,class:(0,n.normalizeClass)(h.value),disabled:d.value,type:`checkbox`,onChange:C},null,42,r),(0,n.createElementVNode)(`span`,{class:(0,n.normalizeClass)(_.value)},[f.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(v.value)},[((0,n.openBlock)(),(0,n.createElementBlock)(`svg`,{class:(0,n.normalizeClass)(y.value),fill:`none`,viewBox:`0 0 12 12`,xmlns:`http://www.w3.org/2000/svg`},[...t[0]||=[(0,n.createElementVNode)(`path`,{d:`M2 6L5 9L10 3`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},null,-1)]],2))],2)):(0,n.createCommentVNode)(``,!0)],2),u.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(x.value)},[(0,n.renderSlot)(e.$slots,`default`)],2)):(0,n.createCommentVNode)(``,!0)],6))}});exports.default=i;
1
+ const e=require("../../utils/cn.cjs"),t=require("../../utils/cva/index.cjs");let n=require("vue");var r=[`checked`,`disabled`],i=(0,n.defineComponent)({inheritAttrs:!1,__name:`st-checkbox`,props:(0,n.mergeModels)({disabled:{type:Boolean,default:!1},trueValue:{type:[Boolean,String,Number],default:!0},falseValue:{type:[Boolean,String,Number],default:!1}},{modelValue:{type:[Boolean,String,Number],default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(i){let a=i,o=(0,n.useModel)(i,`modelValue`),s=(0,n.useSlots)(),c=(0,n.useAttrs)(),l=(0,n.inject)(`checkboxGroup`,null),u=(0,n.computed)(()=>!!s.default),d=(0,n.computed)(()=>l&&l.disabled.value||a.disabled),f=(0,n.computed)(()=>l?l.modelValue.value.includes(a.trueValue):o.value===a.trueValue),p=t.cva({base:`inline-flex items-center cursor-pointer select-none gap-2`,variants:{disabled:{true:`cursor-not-allowed opacity-50`,false:``}}}),m=(0,n.computed)(()=>e.cn(p({disabled:d.value}),c.class)),h=(0,n.computed)(()=>e.cn(`sr-only`)),g=t.cva({base:`flex items-center justify-center border-2 rounded transition-all duration-200 w-5 h-5`,variants:{checked:{true:`bg-primary border-primary`,false:`bg-background border-input hover:border-ring`},disabled:{true:`cursor-not-allowed`,false:`cursor-pointer`}}}),_=(0,n.computed)(()=>g({checked:f.value,disabled:d.value})),v=(0,n.computed)(()=>e.cn(`text-primary-foreground w-full h-full inline-flex items-center justify-center text-3.5 translate-y-0.25`));(0,n.computed)(()=>e.cn(`w-full h-full`));let y=t.cva({base:`text-foreground text-sm`,variants:{disabled:{true:`text-muted-foreground`,false:``}}}),b=(0,n.computed)(()=>y({disabled:d.value})),x=e=>{d.value&&e.preventDefault()},S=()=>{d.value||(l?l.updateValue(a.trueValue,!f.value):o.value=f.value?a.falseValue:a.trueValue)};return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`label`,{class:(0,n.normalizeClass)(m.value),style:(0,n.normalizeStyle)((0,n.unref)(c).style),onClick:x},[(0,n.createElementVNode)(`input`,{checked:f.value,class:(0,n.normalizeClass)(h.value),disabled:d.value,type:`checkbox`,onChange:S},null,42,r),(0,n.createElementVNode)(`span`,{class:(0,n.normalizeClass)(_.value)},[f.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(v.value)},[...t[0]||=[(0,n.createElementVNode)(`i`,{class:`i-lucide-check`},null,-1)]],2)):(0,n.createCommentVNode)(``,!0)],2),u.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(b.value)},[(0,n.renderSlot)(e.$slots,`default`)],2)):(0,n.createCommentVNode)(``,!0)],6))}});exports.default=i;
@@ -46,7 +46,7 @@ var _ = ["checked", "disabled"], v = /*@__PURE__*/ o({
46
46
  false: ""
47
47
  } }
48
48
  }), E = n(() => e(T({ disabled: C.value }), b.class)), D = n(() => e("sr-only")), O = t({
49
- base: "flex items-center justify-center border-2 rounded-radius transition-all duration-200 w-5 h-5",
49
+ base: "flex items-center justify-center border-2 rounded transition-all duration-200 w-5 h-5",
50
50
  variants: {
51
51
  checked: {
52
52
  true: "bg-primary border-primary",
@@ -60,47 +60,38 @@ var _ = ["checked", "disabled"], v = /*@__PURE__*/ o({
60
60
  }), k = n(() => O({
61
61
  checked: w.value,
62
62
  disabled: C.value
63
- })), A = n(() => e("text-primary-foreground w-2.5 h-2.5")), j = n(() => e("w-full h-full")), M = t({
63
+ })), A = n(() => e("text-primary-foreground w-full h-full inline-flex items-center justify-center text-3.5 translate-y-0.25"));
64
+ n(() => e("w-full h-full"));
65
+ let j = t({
64
66
  base: "text-foreground text-sm",
65
67
  variants: { disabled: {
66
68
  true: "text-muted-foreground",
67
69
  false: ""
68
70
  } }
69
- }), N = n(() => M({ disabled: C.value })), P = (e) => {
71
+ }), M = n(() => j({ disabled: C.value })), N = (e) => {
70
72
  C.value && e.preventDefault();
71
- }, F = () => {
73
+ }, P = () => {
72
74
  C.value || (x ? x.updateValue(c.trueValue, !w.value) : v.value = w.value ? c.falseValue : c.trueValue);
73
75
  };
74
76
  return (e, t) => (d(), i("label", {
75
77
  class: l(E.value),
76
78
  style: u(p(b).style),
77
- onClick: P
79
+ onClick: N
78
80
  }, [
79
81
  a("input", {
80
82
  checked: w.value,
81
83
  class: l(D.value),
82
84
  disabled: C.value,
83
85
  type: "checkbox",
84
- onChange: F
86
+ onChange: P
85
87
  }, null, 42, _),
86
88
  a("span", { class: l(k.value) }, [w.value ? (d(), i("span", {
87
89
  key: 0,
88
90
  class: l(A.value)
89
- }, [(d(), i("svg", {
90
- class: l(j.value),
91
- fill: "none",
92
- viewBox: "0 0 12 12",
93
- xmlns: "http://www.w3.org/2000/svg"
94
- }, [...t[0] ||= [a("path", {
95
- d: "M2 6L5 9L10 3",
96
- stroke: "currentColor",
97
- "stroke-linecap": "round",
98
- "stroke-linejoin": "round",
99
- "stroke-width": "2"
100
- }, null, -1)]], 2))], 2)) : r("", !0)], 2),
91
+ }, [...t[0] ||= [a("i", { class: "i-lucide-check" }, null, -1)]], 2)) : r("", !0)], 2),
101
92
  S.value ? (d(), i("span", {
102
93
  key: 0,
103
- class: l(N.value)
94
+ class: l(M.value)
104
95
  }, [f(e.$slots, "default")], 2)) : r("", !0)
105
96
  ], 6));
106
97
  }
@@ -16,7 +16,7 @@ export declare const StDialog: import('../../utils/with-install.js').SFCWithInst
16
16
  fullscreen: boolean;
17
17
  modal: boolean;
18
18
  closeOnClickModal: boolean;
19
- customClass: string;
19
+ customClass: commonClass;
20
20
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
21
21
  P: {};
22
22
  B: {};
@@ -39,7 +39,7 @@ export declare const StDialog: import('../../utils/with-install.js').SFCWithInst
39
39
  fullscreen: boolean;
40
40
  modal: boolean;
41
41
  closeOnClickModal: boolean;
42
- customClass: string;
42
+ customClass: commonClass;
43
43
  }>;
44
44
  __isFragment?: never;
45
45
  __isTeleport?: never;
@@ -61,7 +61,7 @@ export declare const StDialog: import('../../utils/with-install.js').SFCWithInst
61
61
  fullscreen: boolean;
62
62
  modal: boolean;
63
63
  closeOnClickModal: boolean;
64
- customClass: string;
64
+ customClass: commonClass;
65
65
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
66
66
  $slots: {
67
67
  title?: (props: {}) => any;
@@ -4,15 +4,15 @@ type __VLS_ModelProps = {
4
4
  modelValue?: boolean;
5
5
  };
6
6
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
7
- declare var __VLS_21: {}, __VLS_23: {}, __VLS_25: {}, __VLS_27: {};
7
+ declare var __VLS_21: {}, __VLS_23: {}, __VLS_41: {}, __VLS_43: {};
8
8
  type __VLS_Slots = {} & {
9
9
  title?: (props: typeof __VLS_21) => any;
10
10
  } & {
11
11
  extra?: (props: typeof __VLS_23) => any;
12
12
  } & {
13
- default?: (props: typeof __VLS_25) => any;
13
+ default?: (props: typeof __VLS_41) => any;
14
14
  } & {
15
- footer?: (props: typeof __VLS_27) => any;
15
+ footer?: (props: typeof __VLS_43) => any;
16
16
  };
17
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
18
  "update:modelValue": (value: boolean) => any;
@@ -29,7 +29,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
29
29
  fullscreen: boolean;
30
30
  modal: boolean;
31
31
  closeOnClickModal: boolean;
32
- customClass: string;
32
+ customClass: commonClass;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
34
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
35
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- const e=require("../../utils/cn.cjs");let t=require("vue");var n={key:1,class:`text-4 font-600 text-foreground`},r={class:`flex items-center gap-2`},i={class:`flex-1 overflow-auto p-4`},a={key:0,class:`flex justify-end gap-2 border-t border-solid border-border p-4`},o=(0,t.defineComponent)({inheritAttrs:!1,__name:`st-dialog`,props:(0,t.mergeModels)({title:{default:``},width:{default:`500px`},height:{default:`auto`},closable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},center:{type:Boolean,default:!0},customClass:{default:``},animation:{default:`zoom`}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let s=(0,t.useAttrs)(),c=o,l=(0,t.useModel)(o,`modelValue`),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(!1),p=(0,t.ref)({isDragging:!1,startX:0,startY:0,offsetX:0,offsetY:0}),m=(0,t.computed)(()=>e.cn(`st-dialog-overlay`,`fixed`,`inset-0`,`z-999`,`flex`,{"bg-black/50":c.modal,"items-center":c.center,"justify-center":c.center},s.class)),h=(0,t.computed)(()=>e.cn(`st-dialog-container`,`flex`,`flex-col`,`bg-background`,`rounded-radius`,`shadow-lg`,`overflow-hidden`,c.customClass,{"st-dialog-container--fullscreen":f.value,"w-screen h-screen":f.value,"cursor-move":c.draggable&&!p.value.isDragging,"cursor-grabbing":p.value.isDragging},s.class)),g=(0,t.computed)(()=>{if(f.value)return{};let e={width:c.width};return c.height!==`auto`&&(e.height=c.height),(p.value.offsetX!==0||p.value.offsetY!==0)&&(e.translate=`${p.value.offsetX}px ${p.value.offsetY}px`),e}),_=(0,t.computed)(()=>[`flex`,`items-center`,`justify-between`,`border-b`,`border-solid`,`border-border`,`p-4`,`select-none`,{"cursor-grab":c.draggable&&!p.value.isDragging,"cursor-grabbing":p.value.isDragging}]),v=(0,t.computed)(()=>[`inline-flex`,`items-center`,`justify-center`,`w-8`,`h-8`,`rounded-radius`,`cursor-pointer`,`text-4`,`text-muted-foreground`,`hover:bg-muted`,`hover:text-foreground`,`transition-all`,`duration-150`]),y=(0,t.computed)(()=>f.value?`i-ri-fullscreen-exit-line`:`i-ri-fullscreen-line`),b=()=>{f.value=!f.value,f.value&&x()},x=()=>{p.value={isDragging:!1,startX:0,startY:0,offsetX:0,offsetY:0}},S=e=>{!c.draggable||f.value||e.target.closest(`.flex.items-center.gap-2`)||(e.preventDefault(),p.value.isDragging=!0,p.value.startX=e.clientX-p.value.offsetX,p.value.startY=e.clientY-p.value.offsetY,document.addEventListener(`mousemove`,C),document.addEventListener(`mouseup`,w))},C=e=>{p.value.isDragging&&(p.value.offsetX=e.clientX-p.value.startX,p.value.offsetY=e.clientY-p.value.startY)},w=()=>{p.value.isDragging=!1,document.removeEventListener(`mousemove`,C),document.removeEventListener(`mouseup`,w)},T=()=>{l.value=!1},E=()=>{c.closeOnClickModal&&T()};return(0,t.watch)(l,e=>{e&&(x(),f.value=!1)}),(e,o)=>((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createVNode)(t.Transition,{appear:``,"enter-from-class":`opacity-0`,"enter-active-class":`transition-opacity duration-250 ease-[var(--animate-ease-out)]`,"leave-active-class":`transition-opacity duration-150 ease-[var(--animate-ease-in)]`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(m.value),style:(0,t.normalizeStyle)((0,t.unref)(s).style),onClick:E},[(0,t.createVNode)(t.Transition,{appear:``,"enter-from-class":`scale-0 opacity-0`,"enter-active-class":`transition-[scale,opacity] duration-250 ease-[var(--animate-ease-out-back),var(--animate-ease-out)]`,"leave-active-class":`transition-[scale,opacity] duration-150 ease-[var(--animate-ease-in)]`,"leave-to-class":`scale-0 opacity-0`,onClick:o[0]||=(0,t.withModifiers)(()=>{},[`stop`])},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`dialogRef`,ref:u,class:(0,t.normalizeClass)(h.value),style:(0,t.normalizeStyle)(g.value)},[(0,t.createElementVNode)(`div`,{ref_key:`headerRef`,ref:d,class:(0,t.normalizeClass)(_.value),onMousedown:S},[e.$slots.title?(0,t.renderSlot)(e.$slots,`title`,{key:0}):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,n,(0,t.toDisplayString)(c.title),1)),(0,t.createElementVNode)(`div`,r,[(0,t.renderSlot)(e.$slots,`extra`),c.fullscreen?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:(0,t.normalizeClass)(v.value),onClick:b},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(y.value)},null,2)],2)):(0,t.createCommentVNode)(``,!0),c.closable?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:(0,t.normalizeClass)(v.value),onClick:T},[...o[1]||=[(0,t.createElementVNode)(`i`,{class:`i-ri-close-line`},null,-1)]],2)):(0,t.createCommentVNode)(``,!0)])],34),(0,t.createElementVNode)(`div`,i,[(0,t.renderSlot)(e.$slots,`default`)]),e.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,a,[(0,t.renderSlot)(e.$slots,`footer`)])):(0,t.createCommentVNode)(``,!0)],6)]),_:3})],6)):(0,t.createCommentVNode)(``,!0)]),_:3})]))}});exports.default=o;
1
+ const e=require("../../utils/cn.cjs");let t=require("vue");var n={key:1,class:`text-4 font-600 text-foreground`},r={class:`flex items-center gap-2`},i={class:`flex-1 overflow-auto p-4`},a={key:0,class:`flex justify-end gap-2 border-t border-solid border-border p-4`},o=(0,t.defineComponent)({inheritAttrs:!1,__name:`st-dialog`,props:(0,t.mergeModels)({title:{default:``},width:{default:`500px`},height:{default:`auto`},closable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},fullscreen:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},center:{type:Boolean,default:!0},customClass:{default:``},animation:{default:`zoom`}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(o){let s=(0,t.useAttrs)(),c=o,l=(0,t.useModel)(o,`modelValue`),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(!1),p=(0,t.ref)({isDragging:!1,startX:0,startY:0,offsetX:0,offsetY:0}),m=(0,t.computed)(()=>e.cn(`st-dialog-overlay`,`fixed`,`inset-0`,`z-999`,`flex`,{"bg-black/50":c.modal,"items-center":c.center,"justify-center":c.center},s.class)),h=(0,t.computed)(()=>e.cn(`st-dialog-container`,`flex`,`flex-col`,`bg-background`,`rounded`,`shadow-lg`,`overflow-hidden`,c.customClass,{"st-dialog-container--fullscreen":f.value,"w-screen h-screen":f.value,"cursor-move":c.draggable&&!p.value.isDragging,"cursor-grabbing":p.value.isDragging},s.class)),g=(0,t.computed)(()=>{if(f.value)return{};let e={width:c.width};return c.height!==`auto`&&(e.height=c.height),(p.value.offsetX!==0||p.value.offsetY!==0)&&(e.translate=`${p.value.offsetX}px ${p.value.offsetY}px`),e}),_=(0,t.computed)(()=>[`flex`,`items-center`,`justify-between`,`border-b`,`border-solid`,`border-border`,`p-4`,`select-none`,{"cursor-grab":c.draggable&&!p.value.isDragging,"cursor-grabbing":p.value.isDragging}]),v=(0,t.computed)(()=>f.value?`i-lucide-minimize-2`:`i-lucide-maximize-2`),y=()=>{f.value=!f.value,f.value&&b()},b=()=>{p.value={isDragging:!1,startX:0,startY:0,offsetX:0,offsetY:0}},x=e=>{!c.draggable||f.value||e.target.closest(`.flex.items-center.gap-2`)||(e.preventDefault(),p.value.isDragging=!0,p.value.startX=e.clientX-p.value.offsetX,p.value.startY=e.clientY-p.value.offsetY,document.addEventListener(`mousemove`,S),document.addEventListener(`mouseup`,C))},S=e=>{p.value.isDragging&&(p.value.offsetX=e.clientX-p.value.startX,p.value.offsetY=e.clientY-p.value.startY)},C=()=>{p.value.isDragging=!1,document.removeEventListener(`mousemove`,S),document.removeEventListener(`mouseup`,C)},w=()=>{l.value=!1},T=()=>{c.closeOnClickModal&&w()};return(0,t.watch)(l,e=>{e&&(b(),f.value=!1)}),(e,o)=>{let f=(0,t.resolveComponent)(`st-button`);return(0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[(0,t.createVNode)(t.Transition,{appear:``,"enter-active-class":`transition-opacity duration-250 ease-[var(--animate-ease-out)]`,"enter-from-class":`opacity-0`,"leave-active-class":`transition-opacity duration-150 ease-[var(--animate-ease-in)]`,"leave-to-class":`opacity-0`},{default:(0,t.withCtx)(()=>[l.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:(0,t.normalizeClass)(m.value),style:(0,t.normalizeStyle)((0,t.unref)(s).style),onClick:T},[(0,t.createVNode)(t.Transition,{appear:``,"enter-active-class":`transition-[scale,opacity] duration-250 ease-[var(--animate-ease-out-back),var(--animate-ease-out)]`,"enter-from-class":`scale-0 opacity-0`,"leave-active-class":`transition-[scale,opacity] duration-150 ease-[var(--animate-ease-in)]`,"leave-to-class":`scale-0 opacity-0`,onClick:o[0]||=(0,t.withModifiers)(()=>{},[`stop`])},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{ref_key:`dialogRef`,ref:u,class:(0,t.normalizeClass)(h.value),style:(0,t.normalizeStyle)(g.value)},[(0,t.createElementVNode)(`div`,{ref_key:`headerRef`,ref:d,class:(0,t.normalizeClass)(_.value),onMousedown:x},[e.$slots.title?(0,t.renderSlot)(e.$slots,`title`,{key:0}):((0,t.openBlock)(),(0,t.createElementBlock)(`span`,n,(0,t.toDisplayString)(c.title),1)),(0,t.createElementVNode)(`div`,r,[(0,t.renderSlot)(e.$slots,`extra`),c.fullscreen?((0,t.openBlock)(),(0,t.createBlock)(f,{key:0,type:`icon`,variant:`ghost`,onClick:y},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(v.value)},null,2)]),_:1})):(0,t.createCommentVNode)(``,!0),c.closable?((0,t.openBlock)(),(0,t.createBlock)(f,{key:1,type:`icon`,variant:`ghost`,onClick:w},{default:(0,t.withCtx)(()=>[...o[1]||=[(0,t.createElementVNode)(`i`,{class:`i-lucide-x`},null,-1)]]),_:1})):(0,t.createCommentVNode)(``,!0)])],34),(0,t.createElementVNode)(`div`,i,[(0,t.renderSlot)(e.$slots,`default`)]),e.$slots.footer?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,a,[(0,t.renderSlot)(e.$slots,`footer`)])):(0,t.createCommentVNode)(``,!0)],6)]),_:3})],6)):(0,t.createCommentVNode)(``,!0)]),_:3})])}}});exports.default=o;
@@ -1,13 +1,13 @@
1
1
  import { cn as e } from "../../utils/cn.js";
2
- import { Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, useAttrs as v, useModel as y, watch as b, withCtx as x, withModifiers as S } from "vue";
2
+ import { Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderSlot as h, resolveComponent as g, toDisplayString as _, unref as v, useAttrs as y, useModel as b, watch as x, withCtx as S, withModifiers as C } from "vue";
3
3
  //#region src/components/st-dialog/st-dialog.vue?vue&type=script&setup=true&lang.ts
4
- var C = {
4
+ var w = {
5
5
  key: 1,
6
6
  class: "text-4 font-600 text-foreground"
7
- }, w = { class: "flex items-center gap-2" }, T = { class: "flex-1 overflow-auto p-4" }, E = {
7
+ }, T = { class: "flex items-center gap-2" }, E = { class: "flex-1 overflow-auto p-4" }, D = {
8
8
  key: 0,
9
9
  class: "flex justify-end gap-2 border-t border-solid border-border p-4"
10
- }, D = /*@__PURE__*/ l({
10
+ }, O = /*@__PURE__*/ l({
11
11
  inheritAttrs: !1,
12
12
  __name: "st-dialog",
13
13
  props: /*@__PURE__*/ u({
@@ -49,26 +49,26 @@ var C = {
49
49
  }),
50
50
  emits: ["update:modelValue"],
51
51
  setup(l) {
52
- let u = v(), D = l, O = y(l, "modelValue"), k = m(null), A = m(null), j = m(!1), M = m({
52
+ let u = y(), O = l, k = b(l, "modelValue"), A = m(null), j = m(null), M = m(!1), N = m({
53
53
  isDragging: !1,
54
54
  startX: 0,
55
55
  startY: 0,
56
56
  offsetX: 0,
57
57
  offsetY: 0
58
- }), N = r(() => e("st-dialog-overlay", "fixed", "inset-0", "z-999", "flex", {
59
- "bg-black/50": D.modal,
60
- "items-center": D.center,
61
- "justify-center": D.center
62
- }, u.class)), P = r(() => e("st-dialog-container", "flex", "flex-col", "bg-background", "rounded-radius", "shadow-lg", "overflow-hidden", D.customClass, {
63
- "st-dialog-container--fullscreen": j.value,
64
- "w-screen h-screen": j.value,
65
- "cursor-move": D.draggable && !M.value.isDragging,
66
- "cursor-grabbing": M.value.isDragging
67
- }, u.class)), F = r(() => {
68
- if (j.value) return {};
69
- let e = { width: D.width };
70
- return D.height !== "auto" && (e.height = D.height), (M.value.offsetX !== 0 || M.value.offsetY !== 0) && (e.translate = `${M.value.offsetX}px ${M.value.offsetY}px`), e;
71
- }), I = r(() => [
58
+ }), P = r(() => e("st-dialog-overlay", "fixed", "inset-0", "z-999", "flex", {
59
+ "bg-black/50": O.modal,
60
+ "items-center": O.center,
61
+ "justify-center": O.center
62
+ }, u.class)), F = r(() => e("st-dialog-container", "flex", "flex-col", "bg-background", "rounded", "shadow-lg", "overflow-hidden", O.customClass, {
63
+ "st-dialog-container--fullscreen": M.value,
64
+ "w-screen h-screen": M.value,
65
+ "cursor-move": O.draggable && !N.value.isDragging,
66
+ "cursor-grabbing": N.value.isDragging
67
+ }, u.class)), I = r(() => {
68
+ if (M.value) return {};
69
+ let e = { width: O.width };
70
+ return O.height !== "auto" && (e.height = O.height), (N.value.offsetX !== 0 || N.value.offsetY !== 0) && (e.translate = `${N.value.offsetX}px ${N.value.offsetY}px`), e;
71
+ }), L = r(() => [
72
72
  "flex",
73
73
  "items-center",
74
74
  "justify-between",
@@ -78,27 +78,13 @@ var C = {
78
78
  "p-4",
79
79
  "select-none",
80
80
  {
81
- "cursor-grab": D.draggable && !M.value.isDragging,
82
- "cursor-grabbing": M.value.isDragging
81
+ "cursor-grab": O.draggable && !N.value.isDragging,
82
+ "cursor-grabbing": N.value.isDragging
83
83
  }
84
- ]), L = r(() => [
85
- "inline-flex",
86
- "items-center",
87
- "justify-center",
88
- "w-8",
89
- "h-8",
90
- "rounded-radius",
91
- "cursor-pointer",
92
- "text-4",
93
- "text-muted-foreground",
94
- "hover:bg-muted",
95
- "hover:text-foreground",
96
- "transition-all",
97
- "duration-150"
98
- ]), R = r(() => j.value ? "i-ri-fullscreen-exit-line" : "i-ri-fullscreen-line"), z = () => {
99
- j.value = !j.value, j.value && B();
84
+ ]), R = r(() => M.value ? "i-lucide-minimize-2" : "i-lucide-maximize-2"), z = () => {
85
+ M.value = !M.value, M.value && B();
100
86
  }, B = () => {
101
- M.value = {
87
+ N.value = {
102
88
  isDragging: !1,
103
89
  startX: 0,
104
90
  startY: 0,
@@ -106,70 +92,81 @@ var C = {
106
92
  offsetY: 0
107
93
  };
108
94
  }, V = (e) => {
109
- !D.draggable || j.value || e.target.closest(".flex.items-center.gap-2") || (e.preventDefault(), M.value.isDragging = !0, M.value.startX = e.clientX - M.value.offsetX, M.value.startY = e.clientY - M.value.offsetY, document.addEventListener("mousemove", H), document.addEventListener("mouseup", U));
95
+ !O.draggable || M.value || e.target.closest(".flex.items-center.gap-2") || (e.preventDefault(), N.value.isDragging = !0, N.value.startX = e.clientX - N.value.offsetX, N.value.startY = e.clientY - N.value.offsetY, document.addEventListener("mousemove", H), document.addEventListener("mouseup", U));
110
96
  }, H = (e) => {
111
- M.value.isDragging && (M.value.offsetX = e.clientX - M.value.startX, M.value.offsetY = e.clientY - M.value.startY);
97
+ N.value.isDragging && (N.value.offsetX = e.clientX - N.value.startX, N.value.offsetY = e.clientY - N.value.startY);
112
98
  }, U = () => {
113
- M.value.isDragging = !1, document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", U);
99
+ N.value.isDragging = !1, document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", U);
114
100
  }, W = () => {
115
- O.value = !1;
101
+ k.value = !1;
116
102
  }, G = () => {
117
- D.closeOnClickModal && W();
103
+ O.closeOnClickModal && W();
118
104
  };
119
- return b(O, (e) => {
120
- e && (B(), j.value = !1);
121
- }), (e, r) => (p(), i(t, { to: "body" }, [c(n, {
122
- appear: "",
123
- "enter-from-class": "opacity-0",
124
- "enter-active-class": "transition-opacity duration-250 ease-[var(--animate-ease-out)]",
125
- "leave-active-class": "transition-opacity duration-150 ease-[var(--animate-ease-in)]",
126
- "leave-to-class": "opacity-0"
127
- }, {
128
- default: x(() => [O.value ? (p(), o("div", {
129
- key: 0,
130
- class: d(N.value),
131
- style: f(_(u).style),
132
- onClick: G
133
- }, [c(n, {
105
+ return x(k, (e) => {
106
+ e && (B(), M.value = !1);
107
+ }), (e, r) => {
108
+ let l = g("st-button");
109
+ return p(), i(t, { to: "body" }, [c(n, {
134
110
  appear: "",
135
- "enter-from-class": "scale-0 opacity-0",
136
- "enter-active-class": "transition-[scale,opacity] duration-250 ease-[var(--animate-ease-out-back),var(--animate-ease-out)]",
137
- "leave-active-class": "transition-[scale,opacity] duration-150 ease-[var(--animate-ease-in)]",
138
- "leave-to-class": "scale-0 opacity-0",
139
- onClick: r[0] ||= S(() => {}, ["stop"])
111
+ "enter-active-class": "transition-opacity duration-250 ease-[var(--animate-ease-out)]",
112
+ "enter-from-class": "opacity-0",
113
+ "leave-active-class": "transition-opacity duration-150 ease-[var(--animate-ease-in)]",
114
+ "leave-to-class": "opacity-0"
140
115
  }, {
141
- default: x(() => [s("div", {
142
- ref_key: "dialogRef",
143
- ref: k,
116
+ default: S(() => [k.value ? (p(), o("div", {
117
+ key: 0,
144
118
  class: d(P.value),
145
- style: f(F.value)
146
- }, [
147
- s("div", {
148
- ref_key: "headerRef",
119
+ style: f(v(u).style),
120
+ onClick: G
121
+ }, [c(n, {
122
+ appear: "",
123
+ "enter-active-class": "transition-[scale,opacity] duration-250 ease-[var(--animate-ease-out-back),var(--animate-ease-out)]",
124
+ "enter-from-class": "scale-0 opacity-0",
125
+ "leave-active-class": "transition-[scale,opacity] duration-150 ease-[var(--animate-ease-in)]",
126
+ "leave-to-class": "scale-0 opacity-0",
127
+ onClick: r[0] ||= C(() => {}, ["stop"])
128
+ }, {
129
+ default: S(() => [s("div", {
130
+ ref_key: "dialogRef",
149
131
  ref: A,
150
- class: d(I.value),
151
- onMousedown: V
152
- }, [e.$slots.title ? h(e.$slots, "title", { key: 0 }) : (p(), o("span", C, g(D.title), 1)), s("div", w, [
153
- h(e.$slots, "extra"),
154
- D.fullscreen ? (p(), o("span", {
155
- key: 0,
156
- class: d(L.value),
157
- onClick: z
158
- }, [s("i", { class: d(R.value) }, null, 2)], 2)) : a("", !0),
159
- D.closable ? (p(), o("span", {
160
- key: 1,
132
+ class: d(F.value),
133
+ style: f(I.value)
134
+ }, [
135
+ s("div", {
136
+ ref_key: "headerRef",
137
+ ref: j,
161
138
  class: d(L.value),
162
- onClick: W
163
- }, [...r[1] ||= [s("i", { class: "i-ri-close-line" }, null, -1)]], 2)) : a("", !0)
164
- ])], 34),
165
- s("div", T, [h(e.$slots, "default")]),
166
- e.$slots.footer ? (p(), o("div", E, [h(e.$slots, "footer")])) : a("", !0)
167
- ], 6)]),
139
+ onMousedown: V
140
+ }, [e.$slots.title ? h(e.$slots, "title", { key: 0 }) : (p(), o("span", w, _(O.title), 1)), s("div", T, [
141
+ h(e.$slots, "extra"),
142
+ O.fullscreen ? (p(), i(l, {
143
+ key: 0,
144
+ type: "icon",
145
+ variant: "ghost",
146
+ onClick: z
147
+ }, {
148
+ default: S(() => [s("i", { class: d(R.value) }, null, 2)]),
149
+ _: 1
150
+ })) : a("", !0),
151
+ O.closable ? (p(), i(l, {
152
+ key: 1,
153
+ type: "icon",
154
+ variant: "ghost",
155
+ onClick: W
156
+ }, {
157
+ default: S(() => [...r[1] ||= [s("i", { class: "i-lucide-x" }, null, -1)]]),
158
+ _: 1
159
+ })) : a("", !0)
160
+ ])], 34),
161
+ s("div", E, [h(e.$slots, "default")]),
162
+ e.$slots.footer ? (p(), o("div", D, [h(e.$slots, "footer")])) : a("", !0)
163
+ ], 6)]),
164
+ _: 3
165
+ })], 6)) : a("", !0)]),
168
166
  _: 3
169
- })], 6)) : a("", !0)]),
170
- _: 3
171
- })]));
167
+ })]);
168
+ };
172
169
  }
173
170
  });
174
171
  //#endregion
175
- export { D as default };
172
+ export { O as default };
@@ -21,7 +21,7 @@ export interface DialogProps {
21
21
  /** 是否居中显示 */
22
22
  center?: boolean;
23
23
  /** 自定义类名 */
24
- customClass?: string;
24
+ customClass?: commonClass;
25
25
  /** 弹窗打开时的动画名称 */
26
26
  animation?: string;
27
27
  }
@@ -1 +1 @@
1
- const e=require("./st-input.vue_vue_type_script_setup_true_lang.cjs");;/* empty css */var t=require("../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[[`__scopeId`,`data-v-19943572`]]);exports.default=t;
1
+ const e=require("./st-input.vue_vue_type_script_setup_true_lang.cjs");;/* empty css */var t=require("../../_virtual/_plugin-vue_export-helper.cjs").default(e.default,[[`__scopeId`,`data-v-1bd39f9b`]]);exports.default=t;
@@ -2,6 +2,6 @@ import e from "./st-input.vue_vue_type_script_setup_true_lang.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  //#region src/components/st-input/st-input.vue
5
- var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-19943572"]]);
5
+ var n = /*#__PURE__*/ t(e, [["__scopeId", "data-v-1bd39f9b"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1 +1 @@
1
- const e=require("../../utils/cn.cjs");let t=require("vue");var n={key:0,class:`st-input__prefix inline-flex items-center text-foreground`},r=[`autocomplete`,`disabled`,`maxlength`,`minlength`,`placeholder`,`readonly`,`type`],i={key:3,class:`st-input__word-limit select-none text-xs text-muted-foreground`},a={key:4,class:`st-input__suffix inline-flex items-center text-foreground`},o=(0,t.defineComponent)({inheritAttrs:!1,__name:`st-input`,props:(0,t.mergeModels)({modelValue:{},type:{default:`text`},placeholder:{default:``},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,t.mergeModels)([`update:modelValue`,`input`,`change`,`focus`,`blur`,`clear`],[`update:modelValue`]),setup(o,{expose:s,emit:c}){let l=(0,t.useAttrs)(),u=o,d=c;(0,t.useSlots)();let f=(0,t.useModel)(o,`modelValue`),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.computed)(()=>{let e=f.value;return typeof e==`string`?e.length:String(e).length}),v=(0,t.computed)(()=>u.type===`password`?m.value?`text`:`password`:u.type),y=(0,t.computed)(()=>{if(u.type===`password`)return`new-password`}),b=(0,t.computed)(()=>u.clearable&&!u.disabled&&f.value&&h.value),x=(0,t.computed)(()=>u.type===`password`&&u.showPassword&&!u.disabled),S=(0,t.computed)(()=>e.cn(`st-input`,`relative inline-flex items-center gap-2.5 px-2.5 rounded-radius border border-input bg-background transition-colors transition-shadow`,`focus-within:border-ring focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 focus-within:ring-offset-background`,`h-10 text-sm`,{"st-input--disabled cursor-not-allowed opacity-50":u.disabled},l.class)),C=(0,t.computed)(()=>e.cn(`st-input__inner`,`h-full w-full flex-1 min-w-0 min-h-0 bg-transparent outline-none text-foreground`,`placeholder:text-muted-foreground`,`disabled:cursor-not-allowed disabled:opacity-50`)),w=()=>{h.value=!0},T=()=>{h.value=!1},E=e=>{d(`input`,e)},D=e=>{d(`change`,e)},O=e=>{g.value=!0,d(`focus`,e)},k=e=>{g.value=!1,d(`blur`,e)},A=()=>{f.value=``,d(`clear`),p.value?.focus()},j=()=>{m.value=!m.value};return s({focus:()=>{p.value?.focus()},blur:()=>{p.value?.blur()},select:()=>{p.value?.select()},inputRef:p}),(e,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)(S.value),style:(0,t.normalizeStyle)((0,t.unref)(l).style),onMouseenter:w,onMouseleave:T},[e.$slots.prefix||u.prefixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,n,[(0,t.renderSlot)(e.$slots,`prefix`,{},()=>[u.prefixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:0,class:(0,t.normalizeClass)([u.prefixIcon,`st-input__prefix-icon text-foreground`])},null,2)):(0,t.createCommentVNode)(``,!0)],!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`inputRef`,ref:p,"onUpdate:modelValue":o[0]||=e=>f.value=e,autocomplete:y.value,class:(0,t.normalizeClass)(C.value),disabled:u.disabled,maxlength:u.maxlength,minlength:u.minlength,placeholder:u.placeholder,readonly:u.readonly,type:v.value,onBlur:k,onChange:D,onFocus:O,onInput:E},null,42,r),[[t.vModelDynamic,f.value]]),b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`st-input__clear text-foreground cursor-pointer active:opacity-80`,onClick:A},[...o[1]||=[(0,t.createElementVNode)(`i`,{class:`i-ri-close-fill`},null,-1)]])):(0,t.createCommentVNode)(``,!0),x.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:`st-input__password-toggle text-foreground cursor-pointer active:opacity-80`,onClick:j},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(m.value?`i-ri-eye-off-line`:`i-ri-eye-line`)},null,2)])):(0,t.createCommentVNode)(``,!0),u.showWordLimit&&u.maxlength?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,i,(0,t.toDisplayString)(_.value)+`/`+(0,t.toDisplayString)(u.maxlength),1)):(0,t.createCommentVNode)(``,!0),e.$slots.suffix||u.suffixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,a,[(0,t.renderSlot)(e.$slots,`suffix`,{},()=>[u.suffixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:0,class:(0,t.normalizeClass)([u.suffixIcon,`st-input__suffix-icon text-foreground`])},null,2)):(0,t.createCommentVNode)(``,!0)],!0)])):(0,t.createCommentVNode)(``,!0)],38))}});exports.default=o;
1
+ const e=require("../../utils/cn.cjs");let t=require("vue");var n={key:0,class:`st-input__prefix inline-flex items-center text-foreground`},r=[`autocomplete`,`disabled`,`maxlength`,`minlength`,`placeholder`,`readonly`,`type`],i={key:3,class:`st-input__word-limit select-none text-xs text-muted-foreground`},a={key:4,class:`st-input__suffix inline-flex items-center text-foreground`},o=(0,t.defineComponent)({inheritAttrs:!1,__name:`st-input`,props:(0,t.mergeModels)({modelValue:{},type:{default:`text`},placeholder:{default:``},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},maxlength:{},minlength:{},showWordLimit:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{}},{modelValue:{default:``},modelModifiers:{}}),emits:(0,t.mergeModels)([`update:modelValue`,`input`,`change`,`focus`,`blur`,`clear`],[`update:modelValue`]),setup(o,{expose:s,emit:c}){let l=(0,t.useAttrs)(),u=o,d=c;(0,t.useSlots)();let f=(0,t.useModel)(o,`modelValue`),p=(0,t.ref)(null),m=(0,t.ref)(!1),h=(0,t.ref)(!1),g=(0,t.ref)(!1),_=(0,t.computed)(()=>{let e=f.value;return typeof e==`string`?e.length:String(e).length}),v=(0,t.computed)(()=>u.type===`password`?m.value?`text`:`password`:u.type),y=(0,t.computed)(()=>{if(u.type===`password`)return`new-password`}),b=(0,t.computed)(()=>u.clearable&&!u.disabled&&f.value&&h.value),x=(0,t.computed)(()=>u.type===`password`&&u.showPassword&&!u.disabled),S=(0,t.computed)(()=>e.cn(`st-input`,`relative inline-flex items-center gap-2.5 px-2.5 rounded border border-input bg-background transition-colors transition-shadow`,`focus-within:border-ring focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 focus-within:ring-offset-background`,`h-10 text-sm`,{"st-input--disabled cursor-not-allowed opacity-50":u.disabled},l.class)),C=(0,t.computed)(()=>e.cn(`st-input__inner`,`h-full w-full flex-1 min-w-0 min-h-0 bg-transparent outline-none text-foreground`,`placeholder:text-muted-foreground`,`disabled:cursor-not-allowed disabled:opacity-50`)),w=()=>{h.value=!0},T=()=>{h.value=!1},E=e=>{d(`input`,e)},D=e=>{d(`change`,e)},O=e=>{g.value=!0,d(`focus`,e)},k=e=>{g.value=!1,d(`blur`,e)},A=()=>{f.value=``,d(`clear`),p.value?.focus()},j=()=>{m.value=!m.value};return s({focus:()=>{p.value?.focus()},blur:()=>{p.value?.blur()},select:()=>{p.value?.select()},inputRef:p}),(e,o)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)(S.value),style:(0,t.normalizeStyle)((0,t.unref)(l).style),onMouseenter:w,onMouseleave:T},[e.$slots.prefix||u.prefixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,n,[(0,t.renderSlot)(e.$slots,`prefix`,{},()=>[u.prefixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:0,class:(0,t.normalizeClass)([u.prefixIcon,`st-input__prefix-icon text-foreground`])},null,2)):(0,t.createCommentVNode)(``,!0)],!0)])):(0,t.createCommentVNode)(``,!0),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`inputRef`,ref:p,"onUpdate:modelValue":o[0]||=e=>f.value=e,autocomplete:y.value,class:(0,t.normalizeClass)(C.value),disabled:u.disabled,maxlength:u.maxlength,minlength:u.minlength,placeholder:u.placeholder,readonly:u.readonly,type:v.value,onBlur:k,onChange:D,onFocus:O,onInput:E},null,42,r),[[t.vModelDynamic,f.value]]),b.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`st-input__clear text-foreground cursor-pointer active:opacity-80`,onClick:A},[...o[1]||=[(0,t.createElementVNode)(`i`,{class:`i-lucide-x`},null,-1)]])):(0,t.createCommentVNode)(``,!0),x.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:2,class:`st-input__password-toggle text-foreground cursor-pointer active:opacity-80`,onClick:j},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(m.value?`i-lucide-eye-off`:`i-lucide-eye`)},null,2)])):(0,t.createCommentVNode)(``,!0),u.showWordLimit&&u.maxlength?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,i,(0,t.toDisplayString)(_.value)+`/`+(0,t.toDisplayString)(u.maxlength),1)):(0,t.createCommentVNode)(``,!0),e.$slots.suffix||u.suffixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,a,[(0,t.renderSlot)(e.$slots,`suffix`,{},()=>[u.suffixIcon?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:0,class:(0,t.normalizeClass)([u.suffixIcon,`st-input__suffix-icon text-foreground`])},null,2)):(0,t.createCommentVNode)(``,!0)],!0)])):(0,t.createCommentVNode)(``,!0)],38))}});exports.default=o;
@@ -69,7 +69,7 @@ var y = {
69
69
  return typeof e == "string" ? e.length : String(e).length;
70
70
  }), N = t(() => T.type === "password" ? k.value ? "text" : "password" : T.type), P = t(() => {
71
71
  if (T.type === "password") return "new-password";
72
- }), F = t(() => T.clearable && !T.disabled && D.value && A.value), I = t(() => T.type === "password" && T.showPassword && !T.disabled), L = t(() => e("st-input", "relative inline-flex items-center gap-2.5 px-2.5 rounded-radius border border-input bg-background transition-colors transition-shadow", "focus-within:border-ring focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 focus-within:ring-offset-background", "h-10 text-sm", { "st-input--disabled cursor-not-allowed opacity-50": T.disabled }, w.class)), R = t(() => e("st-input__inner", "h-full w-full flex-1 min-w-0 min-h-0 bg-transparent outline-none text-foreground", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed disabled:opacity-50")), z = () => {
72
+ }), F = t(() => T.clearable && !T.disabled && D.value && A.value), I = t(() => T.type === "password" && T.showPassword && !T.disabled), L = t(() => e("st-input", "relative inline-flex items-center gap-2.5 px-2.5 rounded border border-input bg-background transition-colors transition-shadow", "focus-within:border-ring focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-0 focus-within:ring-offset-background", "h-10 text-sm", { "st-input--disabled cursor-not-allowed opacity-50": T.disabled }, w.class)), R = t(() => e("st-input__inner", "h-full w-full flex-1 min-w-0 min-h-0 bg-transparent outline-none text-foreground", "placeholder:text-muted-foreground", "disabled:cursor-not-allowed disabled:opacity-50")), z = () => {
73
73
  A.value = !0;
74
74
  }, B = () => {
75
75
  A.value = !1;
@@ -128,12 +128,12 @@ var y = {
128
128
  key: 1,
129
129
  class: "st-input__clear text-foreground cursor-pointer active:opacity-80",
130
130
  onClick: G
131
- }, [...t[1] ||= [i("i", { class: "i-ri-close-fill" }, null, -1)]])) : n("", !0),
131
+ }, [...t[1] ||= [i("i", { class: "i-lucide-x" }, null, -1)]])) : n("", !0),
132
132
  I.value ? (l(), r("span", {
133
133
  key: 2,
134
134
  class: "st-input__password-toggle text-foreground cursor-pointer active:opacity-80",
135
135
  onClick: K
136
- }, [i("i", { class: s(k.value ? "i-ri-eye-off-line" : "i-ri-eye-line") }, null, 2)])) : n("", !0),
136
+ }, [i("i", { class: s(k.value ? "i-lucide-eye-off" : "i-lucide-eye") }, null, 2)])) : n("", !0),
137
137
  T.showWordLimit && T.maxlength ? (l(), r("span", x, f(M.value) + "/" + f(T.maxlength), 1)) : n("", !0),
138
138
  e.$slots.suffix || T.suffixIcon ? (l(), r("span", S, [d(e.$slots, "suffix", {}, () => [T.suffixIcon ? (l(), r("i", {
139
139
  key: 0,
@@ -3,6 +3,7 @@ export declare const StMenu: import('../../utils/with-install.js').SFCWithInstal
3
3
  list: import("./types.d.ts").MenuItem[];
4
4
  placement?: import("./types.d.ts").MenuPlacement;
5
5
  trigger?: import("./types.d.ts").MenuTrigger;
6
+ triggerClass?: commonClass;
6
7
  }> & Readonly<{
7
8
  onSelect?: (item: import("./types.d.ts").MenuItem) => any;
8
9
  }>, import("./types.d.ts").MenuExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -21,6 +22,7 @@ export declare const StMenu: import('../../utils/with-install.js').SFCWithInstal
21
22
  list: import("./types.d.ts").MenuItem[];
22
23
  placement?: import("./types.d.ts").MenuPlacement;
23
24
  trigger?: import("./types.d.ts").MenuTrigger;
25
+ triggerClass?: commonClass;
24
26
  }> & Readonly<{
25
27
  onSelect?: (item: import("./types.d.ts").MenuItem) => any;
26
28
  }>, import("./types.d.ts").MenuExpose, {}, {}, {}, {
@@ -34,6 +36,7 @@ export declare const StMenu: import('../../utils/with-install.js').SFCWithInstal
34
36
  list: import("./types.d.ts").MenuItem[];
35
37
  placement?: import("./types.d.ts").MenuPlacement;
36
38
  trigger?: import("./types.d.ts").MenuTrigger;
39
+ triggerClass?: commonClass;
37
40
  }> & Readonly<{
38
41
  onSelect?: (item: import("./types.d.ts").MenuItem) => any;
39
42
  }>, import("./types.d.ts").MenuExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1 +1 @@
1
- const e=require("../../utils/cn.cjs"),t=require("../st-popover/st-popover.vue.cjs");let n=require("vue");var r={key:0,class:`h-px my-1 mx-2 bg-border`},i={key:1,class:`block`},a={key:0,class:`px-3 pt-1.5 pb-0.5 text-2.5 font-semibold tracking-wide uppercase text-muted-foreground select-none`},o={class:`flex items-center gap-2 px-3 py-1.25 rounded-radius cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-accent`},s={key:0,class:`inline-flex items-center justify-center w-4.5 h-4.5 text-4 flex-shrink-0`},c={class:`flex-1 min-w-0 min-h-0 truncate`},l={key:1,class:`text-3 text-muted-foreground ml-3 flex-shrink-0`},u={class:`flex items-center gap-2 px-3 py-1.25 rounded-radius cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-accent`},d={key:0,class:`inline-flex items-center justify-center w-4.5 h-4.5 text-4 flex-shrink-0`},f={class:`flex-1 min-w-0 min-h-0 truncate`},p={key:1,class:`text-3 text-muted-foreground ml-3 flex-shrink-0`},m=(0,n.defineComponent)({name:`StMenuNode`,inheritAttrs:!1,__name:`st-menu-node`,props:{item:{},depth:{default:0}},emits:[`select`],setup(m,{emit:h}){let g=(0,n.useAttrs)(),_=m,v=h,y=(0,n.inject)(`st-menu-hide`,()=>{}),b=(0,n.inject)(`st-menu-has-icon`,(0,n.ref)(!1)),x=(0,n.computed)(()=>!!(_.item.children&&_.item.children.length>0));(0,n.provide)(`st-menu-has-icon`,(0,n.computed)(()=>{if(!x.value)return!1;for(let e of _.item.children??[])if(e.type!==`divider`){if(e.type===`group`){for(let t of e.children??[])if(t.icon)return!0}else if(e.icon)return!0}return!1}));let S=(0,n.computed)(()=>e.cn(`relative rounded-radius`,`block`,{"opacity-40 cursor-not-allowed":_.item.disabled},g.class)),C=(0,n.computed)(()=>[`min-w-35`,`max-w-80`,`p-1`,`backdrop-blur-16`]);function w(){_.item.disabled||(_.item.action&&_.item.action(),v(`select`,_.item),y())}function T(e){v(`select`,e)}return(e,h)=>{let g=(0,n.resolveComponent)(`StMenuNode`,!0);return m.item.type===`divider`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,r)):m.item.type===`group`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,i,[m.item.label?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,a,(0,n.toDisplayString)(m.item.label),1)):(0,n.createCommentVNode)(``,!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(m.item.children??[],(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.key??t,depth:m.depth+1,item:e,onSelect:T},null,8,[`depth`,`item`]))),128))])):x.value?((0,n.openBlock)(),(0,n.createBlock)(t.default,{key:2,class:(0,n.normalizeClass)(C.value),"close-delay":200,"open-delay":150,"show-arrow":!1,"trigger-class":`block`,placement:`right-top`,trigger:`hover`},{trigger:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)(S.value)},[(0,n.createElementVNode)(`div`,o,[(0,n.unref)(b)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,s,[m.item.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(m.item.icon)},null,2)):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0),(0,n.createElementVNode)(`span`,c,(0,n.toDisplayString)(m.item.label),1),m.item.shortcut?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,l,(0,n.toDisplayString)(m.item.shortcut),1)):(0,n.createCommentVNode)(``,!0),h[0]||=(0,n.createElementVNode)(`span`,{class:`inline-flex items-center justify-center w-4 h-4 text-3.5 flex-shrink-0 ml-auto opacity-50`},[(0,n.createElementVNode)(`span`,{class:`i-ri-arrow-right-s-line`})],-1)])],2)]),content:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(m.item.children,(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.key??t,depth:m.depth+1,item:e,onSelect:T},null,8,[`depth`,`item`]))),128))]),_:1},8,[`class`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:3,class:(0,n.normalizeClass)(S.value),onClick:w},[(0,n.createElementVNode)(`div`,u,[(0,n.unref)(b)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,d,[m.item.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(m.item.icon)},null,2)):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0),(0,n.createElementVNode)(`span`,f,(0,n.toDisplayString)(m.item.label),1),m.item.shortcut?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,p,(0,n.toDisplayString)(m.item.shortcut),1)):(0,n.createCommentVNode)(``,!0)])],2))}}});exports.default=m;
1
+ const e=require("../../utils/cn.cjs"),t=require("../st-popover/st-popover.vue.cjs");let n=require("vue");var r={key:0,class:`h-px my-1 mx-2 bg-border`},i={key:1,class:`block`},a={key:0,class:`px-3 pt-1.5 pb-0.5 text-2.5 font-semibold tracking-wide uppercase text-muted-foreground select-none`},o={class:`flex items-center gap-2 px-3 py-1.25 rounded cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-accent`},s={key:0,class:`inline-flex items-center justify-center w-4.5 h-4.5 text-4 flex-shrink-0`},c={class:`flex-1 min-w-0 min-h-0 truncate`},l={key:1,class:`text-3 text-muted-foreground ml-3 flex-shrink-0`},u={class:`flex items-center gap-2 px-3 py-1.25 rounded cursor-pointer transition-colors duration-100 select-none whitespace-nowrap text-3.25 leading-5 text-foreground hover:bg-accent`},d={key:0,class:`inline-flex items-center justify-center w-4.5 h-4.5 text-4 flex-shrink-0`},f={class:`flex-1 min-w-0 min-h-0 truncate`},p={key:1,class:`text-3 text-muted-foreground ml-3 flex-shrink-0`},m=(0,n.defineComponent)({name:`StMenuNode`,inheritAttrs:!1,__name:`st-menu-node`,props:{item:{},depth:{default:0}},emits:[`select`],setup(m,{emit:h}){let g=(0,n.useAttrs)(),_=m,v=h,y=(0,n.inject)(`st-menu-hide`,()=>{}),b=(0,n.inject)(`st-menu-has-icon`,(0,n.ref)(!1)),x=(0,n.computed)(()=>!!(_.item.children&&_.item.children.length>0));(0,n.provide)(`st-menu-has-icon`,(0,n.computed)(()=>{if(!x.value)return!1;for(let e of _.item.children??[])if(e.type!==`divider`){if(e.type===`group`){for(let t of e.children??[])if(t.icon)return!0}else if(e.icon)return!0}return!1}));let S=(0,n.computed)(()=>e.cn(`relative rounded`,`block`,{"opacity-40 cursor-not-allowed":_.item.disabled},g.class)),C=(0,n.computed)(()=>[`min-w-35`,`max-w-80`,`p-1`,`backdrop-blur-16`]);function w(){_.item.disabled||(_.item.action&&_.item.action(),v(`select`,_.item),y())}function T(e){v(`select`,e)}return(e,h)=>{let g=(0,n.resolveComponent)(`StMenuNode`,!0);return m.item.type===`divider`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,r)):m.item.type===`group`?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,i,[m.item.label?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,a,(0,n.toDisplayString)(m.item.label),1)):(0,n.createCommentVNode)(``,!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(m.item.children??[],(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.key??t,depth:m.depth+1,item:e,onSelect:T},null,8,[`depth`,`item`]))),128))])):x.value?((0,n.openBlock)(),(0,n.createBlock)(t.default,{key:2,class:(0,n.normalizeClass)(C.value),"close-delay":200,"open-delay":150,"show-arrow":!1,"trigger-class":`block`,placement:`right-top`,trigger:`hover`},{trigger:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,{class:(0,n.normalizeClass)(S.value)},[(0,n.createElementVNode)(`div`,o,[(0,n.unref)(b)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,s,[m.item.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(m.item.icon)},null,2)):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0),(0,n.createElementVNode)(`span`,c,(0,n.toDisplayString)(m.item.label),1),m.item.shortcut?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,l,(0,n.toDisplayString)(m.item.shortcut),1)):(0,n.createCommentVNode)(``,!0),h[0]||=(0,n.createElementVNode)(`span`,{class:`inline-flex items-center justify-center w-4 h-4 text-3.5 flex-shrink-0 ml-auto opacity-50`},[(0,n.createElementVNode)(`span`,{class:`i-lucide-chevron-right`})],-1)])],2)]),content:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(m.item.children,(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.key??t,depth:m.depth+1,item:e,onSelect:T},null,8,[`depth`,`item`]))),128))]),_:1},8,[`class`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:3,class:(0,n.normalizeClass)(S.value),onClick:w},[(0,n.createElementVNode)(`div`,u,[(0,n.unref)(b)?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,d,[m.item.icon?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,{key:0,class:(0,n.normalizeClass)(m.item.icon)},null,2)):(0,n.createCommentVNode)(``,!0)])):(0,n.createCommentVNode)(``,!0),(0,n.createElementVNode)(`span`,f,(0,n.toDisplayString)(m.item.label),1),m.item.shortcut?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,p,(0,n.toDisplayString)(m.item.shortcut),1)):(0,n.createCommentVNode)(``,!0)])],2))}}});exports.default=m;