vft 0.0.333 → 0.0.334

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,31 +1,31 @@
1
1
  import { defineComponent as B, useSlots as ge, computed as y, createElementBlock as m, openBlock as l, unref as e, normalizeStyle as ve, normalizeClass as a, createCommentVNode as f, createElementVNode as p, renderSlot as I, withDirectives as x, Fragment as ye, renderList as Ie, createBlock as C, withModifiers as F, withCtx as Ce, createTextVNode as he, toDisplayString as K, mergeProps as be, isRef as De, vModelText as ke, vShow as we } from "vue";
2
- import { useAttrs as Se } from "../../hooks/use-attrs/index.js";
2
+ import "../form/index.js";
3
+ import { VftIcon as $ } from "../icon/index.js";
4
+ import { VftTag as Se } from "../tag/index.js";
5
+ import { useAttrs as Te } from "../../hooks/use-attrs/index.js";
3
6
  import "@vueuse/core";
4
- import { noop as Te } from "@vft/utils";
7
+ import { noop as Re } from "@vft/utils";
5
8
  import "../config-provider/hooks/use-global-config.js";
6
9
  import "lodash-es";
7
10
  import "../../hooks/use-model-toggle/index.js";
8
11
  import "@popperjs/core";
9
12
  import "../../hooks/use-z-index/index.js";
10
- import { useCalcInputWidth as Re } from "../../hooks/use-calc-input-width/index.js";
11
- import { VftIcon as $ } from "../icon/index.js";
12
- import { VftTag as Me } from "../tag/index.js";
13
- import "../form/index.js";
14
- import { inputTagEmits as Ve, inputTagProps as Ee } from "./input-tag.js";
15
- import { useDragTag as ze } from "./composables/use-drag-tag.js";
16
- import { useHovering as Le } from "./composables/use-hovering.js";
17
- import { useInputTag as xe } from "./composables/use-input-tag.js";
18
- import { useInputTagDom as Fe } from "./composables/use-input-tag-dom.js";
13
+ import { useCalcInputWidth as Ve } from "../../hooks/use-calc-input-width/index.js";
14
+ import { useDragTag as Me } from "./composables/use-drag-tag.js";
15
+ import { useHovering as Ee } from "./composables/use-hovering.js";
16
+ import { useInputTag as ze } from "./composables/use-input-tag.js";
17
+ import { useInputTagDom as Le } from "./composables/use-input-tag-dom.js";
18
+ import { inputTagEmits as xe, inputTagProps as Fe } from "./input-tag.js";
19
19
  import { useFormItem as Ke, useFormItemInputId as $e } from "../form/hooks/use-form-item.js";
20
20
  const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplete", "tabindex", "placeholder", "autofocus", "ariaLabel"], Ne = ["textContent"], Ae = B({
21
- name: "ElInputTag",
21
+ name: "VftInputTag",
22
22
  inheritAttrs: !1
23
23
  }), ro = /* @__PURE__ */ B({
24
24
  ...Ae,
25
- props: Ee,
26
- emits: Ve,
25
+ props: Fe,
26
+ emits: xe,
27
27
  setup(N, { expose: A, emit: P }) {
28
- const c = N, U = P, H = Se(), O = ge(), { form: W, formItem: g } = Ke(), { inputId: j } = $e(c, { formItemContext: g }), h = y(() => W?.statusIcon ?? !1), s = y(() => g?.validateState || ""), q = {
28
+ const c = N, U = P, H = Te(), O = ge(), { form: W, formItem: g } = Ke(), { inputId: j } = $e(c, { formItemContext: g }), h = y(() => W?.statusIcon ?? !1), s = y(() => g?.validateState || ""), q = {
29
29
  validating: "icon-loading",
30
30
  success: "icon-circle-check",
31
31
  error: "icon-circle-close"
@@ -45,17 +45,17 @@ const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplet
45
45
  handleRemoveTag: _,
46
46
  handleClear: ee,
47
47
  handleCompositionStart: R,
48
- handleCompositionUpdate: M,
49
- handleCompositionEnd: V,
48
+ handleCompositionUpdate: V,
49
+ handleCompositionEnd: M,
50
50
  focus: E,
51
51
  blur: oe
52
- } = xe({ props: c, emit: U, formItem: g }), { hovering: te, handleMouseEnter: z, handleMouseLeave: L } = Le(), { calculatorRef: ne, inputStyle: ae } = Re(), {
52
+ } = ze({ props: c, emit: U, formItem: g }), { hovering: te, handleMouseEnter: z, handleMouseLeave: L } = Ee(), { calculatorRef: ne, inputStyle: ae } = Ve(), {
53
53
  dropIndicatorRef: re,
54
54
  showDropIndicator: le,
55
55
  handleDragStart: se,
56
56
  handleDragOver: ie,
57
57
  handleDragEnd: de
58
- } = ze({ wrapperRef: D, handleDragged: Z, afterDragged: E }), {
58
+ } = Me({ wrapperRef: D, handleDragged: Z, afterDragged: E }), {
59
59
  ns: r,
60
60
  nsInput: v,
61
61
  containerKls: pe,
@@ -63,7 +63,7 @@ const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplet
63
63
  innerKls: me,
64
64
  showClear: fe,
65
65
  showSuffix: ce
66
- } = Fe({
66
+ } = Le({
67
67
  props: c,
68
68
  hovering: te,
69
69
  isFocused: J,
@@ -96,7 +96,7 @@ const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplet
96
96
  p("div", {
97
97
  class: a(e(me))
98
98
  }, [
99
- (l(!0), m(ye, null, Ie(n.modelValue, (t, d) => (l(), C(e(Me), {
99
+ (l(!0), m(ye, null, Ie(n.modelValue, (t, d) => (l(), C(e(Se), {
100
100
  key: d,
101
101
  size: e(X),
102
102
  closable: e(k),
@@ -145,9 +145,9 @@ const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplet
145
145
  onCompositionstart: o[2] || (o[2] = //@ts-ignore
146
146
  (...t) => e(R) && e(R)(...t)),
147
147
  onCompositionupdate: o[3] || (o[3] = //@ts-ignore
148
- (...t) => e(M) && e(M)(...t)),
149
- onCompositionend: o[4] || (o[4] = //@ts-ignore
150
148
  (...t) => e(V) && e(V)(...t)),
149
+ onCompositionend: o[4] || (o[4] = //@ts-ignore
150
+ (...t) => e(M) && e(M)(...t)),
151
151
  onInput: o[5] || (o[5] = //@ts-ignore
152
152
  (...t) => e(S) && e(S)(...t)),
153
153
  onKeydown: o[6] || (o[6] = //@ts-ignore
@@ -179,7 +179,7 @@ const Be = ["id", "minlength", "maxlength", "disabled", "readonly", "autocomplet
179
179
  e(fe) ? (l(), C(e($), {
180
180
  key: 0,
181
181
  class: a([e(r).e("icon"), e(r).e("clear")]),
182
- onMousedown: F(e(Te), ["prevent"]),
182
+ onMousedown: F(e(Re), ["prevent"]),
183
183
  onClick: e(ee),
184
184
  icon: "icon-circle-close"
185
185
  }, null, 8, ["class", "onMousedown", "onClick"])) : f("", !0),
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.333",
3
+ "version": "0.0.334",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.333";
1
+ const o = "0.0.334";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),ae=require("../../hooks/use-attrs/index.cjs");require("@vueuse/core");const le=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const se=require("../../hooks/use-calc-input-width/index.cjs"),S=require("../icon/index.cjs"),ue=require("../tag/index.cjs");require("../form/index.cjs");const V=require("./input-tag.cjs"),ie=require("./composables/use-drag-tag.cjs"),de=require("./composables/use-hovering.cjs"),fe=require("./composables/use-input-tag.cjs"),ce=require("./composables/use-input-tag-dom.cjs"),w=require("../form/hooks/use-form-item.cjs"),pe=["id","minlength","maxlength","disabled","readonly","autocomplete","tabindex","placeholder","autofocus","ariaLabel"],me=["textContent"],ge=e.defineComponent({name:"ElInputTag",inheritAttrs:!1}),ve=e.defineComponent({...ge,props:V.inputTagProps,emits:V.inputTagEmits,setup(T,{expose:E,emit:z}){const i=T,B=z,M=ae.useAttrs(),N=e.useSlots(),{form:R,formItem:d}=w.useFormItem(),{inputId:x}=w.useFormItemInputId(i,{formItemContext:d}),c=e.computed(()=>R?.statusIcon??!1),a=e.computed(()=>d?.validateState||""),$={validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"},p=e.computed(()=>a.value&&$[a.value]),{inputRef:F,wrapperRef:m,isFocused:L,inputValue:l,size:K,tagSize:P,placeholder:A,closable:g,disabled:v,handleDragged:H,handleInput:C,handleKeydown:I,handleRemoveTag:O,handleClear:U,handleCompositionStart:k,handleCompositionUpdate:y,handleCompositionEnd:h,focus:D,blur:j}=fe.useInputTag({props:i,emit:B,formItem:d}),{hovering:W,handleMouseEnter:b,handleMouseLeave:q}=de.useHovering(),{calculatorRef:G,inputStyle:J}=se.useCalcInputWidth(),{dropIndicatorRef:Q,showDropIndicator:X,handleDragStart:Y,handleDragOver:Z,handleDragEnd:_}=ie.useDragTag({wrapperRef:m,handleDragged:H,afterDragged:D}),{ns:t,nsInput:f,containerKls:ee,containerStyle:ne,innerKls:re,showClear:oe,showSuffix:te}=ce.useInputTagDom({props:i,hovering:W,isFocused:L,inputValue:l,disabled:v,size:K,validateState:a,validateIcon:p,needStatusIcon:c});return E({focus:D,blur:j}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:m,class:e.normalizeClass(e.unref(ee)),style:e.normalizeStyle(e.unref(ne)),onMouseenter:n[7]||(n[7]=(...r)=>e.unref(b)&&e.unref(b)(...r)),onMouseleave:n[8]||(n[8]=(...r)=>e.unref(q)&&e.unref(q)(...r))},[e.unref(N).prefix?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t).e("prefix"))},[e.renderSlot(o.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(re))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.modelValue,(r,s)=>(e.openBlock(),e.createBlock(e.unref(ue.VftTag),{key:s,size:e.unref(P),closable:e.unref(g),type:o.tagType,effect:o.tagEffect,draggable:e.unref(g)&&o.draggable,"disable-transitions":"",onClose:u=>e.unref(O)(s),onDragstart:u=>e.unref(Y)(u,s),onDragover:u=>e.unref(Z)(u,s),onDragend:e.unref(_),onDrop:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"tag",{value:r,index:s},()=>[e.createTextVNode(e.toDisplayString(r),1)])]),_:2},1032,["size","closable","type","effect","draggable","onClose","onDragstart","onDragover","onDragend"]))),128)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("input-wrapper"))},[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(x),ref_key:"inputRef",ref:F,"onUpdate:modelValue":n[1]||(n[1]=r=>e.isRef(l)?l.value=r:null)},e.unref(M),{type:"text",minlength:o.minlength,maxlength:o.maxlength,disabled:e.unref(v),readonly:o.readonly,autocomplete:o.autocomplete,tabindex:o.tabindex,placeholder:e.unref(A),autofocus:o.autofocus,ariaLabel:o.ariaLabel,class:e.unref(t).e("input"),style:e.unref(J),onCompositionstart:n[2]||(n[2]=(...r)=>e.unref(k)&&e.unref(k)(...r)),onCompositionupdate:n[3]||(n[3]=(...r)=>e.unref(y)&&e.unref(y)(...r)),onCompositionend:n[4]||(n[4]=(...r)=>e.unref(h)&&e.unref(h)(...r)),onInput:n[5]||(n[5]=(...r)=>e.unref(C)&&e.unref(C)(...r)),onKeydown:n[6]||(n[6]=(...r)=>e.unref(I)&&e.unref(I)(...r))}),null,16,pe),[[e.vModelText,e.unref(l)]]),e.createElementVNode("span",{ref_key:"calculatorRef",ref:G,"aria-hidden":"true",class:e.normalizeClass(e.unref(t).e("input-calculator")),textContent:e.toDisplayString(e.unref(l))},null,10,me)],2),e.withDirectives(e.createElementVNode("div",{ref_key:"dropIndicatorRef",ref:Q,class:e.normalizeClass(e.unref(t).e("drop-indicator"))},null,2),[[e.vShow,e.unref(X)]])],2),e.unref(te)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(t).e("suffix"))},[e.renderSlot(o.$slots,"suffix"),e.unref(oe)?(e.openBlock(),e.createBlock(e.unref(S.VftIcon),{key:0,class:e.normalizeClass([e.unref(t).e("icon"),e.unref(t).e("clear")]),onMousedown:e.withModifiers(e.unref(le.noop),["prevent"]),onClick:e.unref(U),icon:"icon-circle-close"},null,8,["class","onMousedown","onClick"])):e.createCommentVNode("",!0),a.value&&p.value&&c.value?(e.openBlock(),e.createBlock(e.unref(S.VftIcon),{key:1,class:e.normalizeClass([e.unref(f).e("icon"),e.unref(f).e("validateIcon"),e.unref(f).is("loading",a.value==="validating")]),icon:"validateIcon"},null,8,["class"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],38))}});exports.default=ve;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../form/index.cjs");const S=require("../icon/index.cjs"),ae=require("../tag/index.cjs"),le=require("../../hooks/use-attrs/index.cjs");require("@vueuse/core");const se=require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const ue=require("../../hooks/use-calc-input-width/index.cjs"),ie=require("./composables/use-drag-tag.cjs"),de=require("./composables/use-hovering.cjs"),fe=require("./composables/use-input-tag.cjs"),ce=require("./composables/use-input-tag-dom.cjs"),V=require("./input-tag.cjs"),w=require("../form/hooks/use-form-item.cjs"),pe=["id","minlength","maxlength","disabled","readonly","autocomplete","tabindex","placeholder","autofocus","ariaLabel"],me=["textContent"],ge=e.defineComponent({name:"VftInputTag",inheritAttrs:!1}),ve=e.defineComponent({...ge,props:V.inputTagProps,emits:V.inputTagEmits,setup(T,{expose:z,emit:B}){const i=T,E=B,M=le.useAttrs(),N=e.useSlots(),{form:R,formItem:d}=w.useFormItem(),{inputId:x}=w.useFormItemInputId(i,{formItemContext:d}),c=e.computed(()=>R?.statusIcon??!1),a=e.computed(()=>d?.validateState||""),$={validating:"icon-loading",success:"icon-circle-check",error:"icon-circle-close"},p=e.computed(()=>a.value&&$[a.value]),{inputRef:F,wrapperRef:m,isFocused:L,inputValue:l,size:K,tagSize:P,placeholder:A,closable:g,disabled:v,handleDragged:H,handleInput:C,handleKeydown:I,handleRemoveTag:O,handleClear:U,handleCompositionStart:k,handleCompositionUpdate:y,handleCompositionEnd:h,focus:D,blur:j}=fe.useInputTag({props:i,emit:E,formItem:d}),{hovering:W,handleMouseEnter:b,handleMouseLeave:q}=de.useHovering(),{calculatorRef:G,inputStyle:J}=ue.useCalcInputWidth(),{dropIndicatorRef:Q,showDropIndicator:X,handleDragStart:Y,handleDragOver:Z,handleDragEnd:_}=ie.useDragTag({wrapperRef:m,handleDragged:H,afterDragged:D}),{ns:t,nsInput:f,containerKls:ee,containerStyle:ne,innerKls:re,showClear:oe,showSuffix:te}=ce.useInputTagDom({props:i,hovering:W,isFocused:L,inputValue:l,disabled:v,size:K,validateState:a,validateIcon:p,needStatusIcon:c});return z({focus:D,blur:j}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:m,class:e.normalizeClass(e.unref(ee)),style:e.normalizeStyle(e.unref(ne)),onMouseenter:n[7]||(n[7]=(...r)=>e.unref(b)&&e.unref(b)(...r)),onMouseleave:n[8]||(n[8]=(...r)=>e.unref(q)&&e.unref(q)(...r))},[e.unref(N).prefix?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(t).e("prefix"))},[e.renderSlot(o.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(re))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.modelValue,(r,s)=>(e.openBlock(),e.createBlock(e.unref(ae.VftTag),{key:s,size:e.unref(P),closable:e.unref(g),type:o.tagType,effect:o.tagEffect,draggable:e.unref(g)&&o.draggable,"disable-transitions":"",onClose:u=>e.unref(O)(s),onDragstart:u=>e.unref(Y)(u,s),onDragover:u=>e.unref(Z)(u,s),onDragend:e.unref(_),onDrop:n[0]||(n[0]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"tag",{value:r,index:s},()=>[e.createTextVNode(e.toDisplayString(r),1)])]),_:2},1032,["size","closable","type","effect","draggable","onClose","onDragstart","onDragover","onDragend"]))),128)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(t).e("input-wrapper"))},[e.withDirectives(e.createElementVNode("input",e.mergeProps({id:e.unref(x),ref_key:"inputRef",ref:F,"onUpdate:modelValue":n[1]||(n[1]=r=>e.isRef(l)?l.value=r:null)},e.unref(M),{type:"text",minlength:o.minlength,maxlength:o.maxlength,disabled:e.unref(v),readonly:o.readonly,autocomplete:o.autocomplete,tabindex:o.tabindex,placeholder:e.unref(A),autofocus:o.autofocus,ariaLabel:o.ariaLabel,class:e.unref(t).e("input"),style:e.unref(J),onCompositionstart:n[2]||(n[2]=(...r)=>e.unref(k)&&e.unref(k)(...r)),onCompositionupdate:n[3]||(n[3]=(...r)=>e.unref(y)&&e.unref(y)(...r)),onCompositionend:n[4]||(n[4]=(...r)=>e.unref(h)&&e.unref(h)(...r)),onInput:n[5]||(n[5]=(...r)=>e.unref(C)&&e.unref(C)(...r)),onKeydown:n[6]||(n[6]=(...r)=>e.unref(I)&&e.unref(I)(...r))}),null,16,pe),[[e.vModelText,e.unref(l)]]),e.createElementVNode("span",{ref_key:"calculatorRef",ref:G,"aria-hidden":"true",class:e.normalizeClass(e.unref(t).e("input-calculator")),textContent:e.toDisplayString(e.unref(l))},null,10,me)],2),e.withDirectives(e.createElementVNode("div",{ref_key:"dropIndicatorRef",ref:Q,class:e.normalizeClass(e.unref(t).e("drop-indicator"))},null,2),[[e.vShow,e.unref(X)]])],2),e.unref(te)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(t).e("suffix"))},[e.renderSlot(o.$slots,"suffix"),e.unref(oe)?(e.openBlock(),e.createBlock(e.unref(S.VftIcon),{key:0,class:e.normalizeClass([e.unref(t).e("icon"),e.unref(t).e("clear")]),onMousedown:e.withModifiers(e.unref(se.noop),["prevent"]),onClick:e.unref(U),icon:"icon-circle-close"},null,8,["class","onMousedown","onClick"])):e.createCommentVNode("",!0),a.value&&p.value&&c.value?(e.openBlock(),e.createBlock(e.unref(S.VftIcon),{key:1,class:e.normalizeClass([e.unref(f).e("icon"),e.unref(f).e("validateIcon"),e.unref(f).is("loading",a.value==="validating")]),icon:"validateIcon"},null,8,["class"])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)],38))}});exports.default=ve;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.333";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.334";exports.version=e;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.333",
3
+ "version": "0.0.334",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vft",
3
- "version": "0.0.333",
3
+ "version": "0.0.334",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -56,11 +56,11 @@
56
56
  "sortablejs": "1.15.0",
57
57
  "photoswipe": "5.4.4",
58
58
  "@vft/constants": "0.0.72",
59
- "@vft/router": "0.0.65",
60
59
  "@vft/store": "0.0.54",
61
- "@vft/utils": "0.0.128",
62
60
  "@vft/use": "0.0.76",
63
- "@vft/directives": "0.0.33"
61
+ "@vft/directives": "0.0.33",
62
+ "@vft/utils": "0.0.128",
63
+ "@vft/router": "0.0.65"
64
64
  },
65
65
  "vetur": {
66
66
  "tags": "tags.json",