vft 0.0.313 → 0.0.314

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.
@@ -3,15 +3,15 @@ import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
4
  import "../../../utils/ns-cover.js";
5
5
  import "lodash-es";
6
- import { getCurrentInstance as l, inject as g, ref as C, computed as i, unref as p, provide as x } from "vue";
6
+ import { ref as g, getCurrentInstance as l, inject as C, computed as i, unref as p, provide as x } from "vue";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
8
8
  import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = C();
12
+ const a = g();
13
13
  function d(o, e = void 0) {
14
- const n = l() ? g(m, a) : a;
14
+ const n = l() ? C(m, a) : a;
15
15
  return o ? i(() => n.value?.[o] ?? e) : n;
16
16
  }
17
17
  function B(o) {
@@ -1,9 +1,9 @@
1
- import { defineComponent as C, computed as t, createElementBlock as f, openBlock as n, normalizeStyle as T, normalizeClass as k, unref as r, createBlock as s, createCommentVNode as d, mergeProps as c, normalizeProps as S, toDisplayString as w } from "vue";
1
+ import { defineComponent as C, computed as t, createElementBlock as d, openBlock as r, normalizeStyle as T, normalizeClass as k, unref as l, createBlock as s, createCommentVNode as y, mergeProps as u, normalizeProps as S, toDisplayString as w } from "vue";
2
2
  import { VftClampTooltip as L } from "../clamp-tooltip/index.js";
3
- import { VftIcon as y } from "../icon/index.js";
3
+ import { VftIcon as g } from "../icon/index.js";
4
4
  import "@vueuse/core";
5
5
  import { singleAttrToObj as O, removeUnit as V } from "@vft/utils";
6
- import { addUnit as g } from "../../utils/helper.js";
6
+ import { addUnit as h } from "../../utils/helper.js";
7
7
  import { generateCssVars as j } from "../../utils/ns-cover.js";
8
8
  import "lodash-es";
9
9
  import { useNamespace as b } from "../../hooks/use-namespace/index.js";
@@ -31,21 +31,21 @@ const N = { key: 2 }, P = C({
31
31
  useClamp: { type: Boolean }
32
32
  },
33
33
  setup(e) {
34
- const u = b("icon-text"), h = t(() => e.hoverColor ? e.hoverColor : e.color), l = t(() => O(e.icon, "icon", { size: e.size, color: e.color })), m = t(() => e.direction === "col"), v = t(() => {
35
- const o = g(e.distance);
36
- return m.value ? e.reverse ? { marginTop: o } : { marginBottom: o } : e.reverse ? { marginLeft: o } : { marginRight: o };
37
- }), i = t(() => V(e.size)), a = t(() => i.value < 12), p = t(() => i.value && a.value ? { transform: `scale(${i.value / 12})` } : {}), x = t(() => {
34
+ const m = b("icon-text"), i = t(() => e.hoverColor ? e.hoverColor : e.color), n = t(() => O(e.icon, "icon", { size: e.size, color: e.color })), v = t(() => e.direction === "col"), f = t(() => {
35
+ const o = h(e.distance);
36
+ return v.value ? e.reverse ? { marginTop: o } : { marginBottom: o } : e.reverse ? { marginLeft: o } : { marginRight: o };
37
+ }), a = t(() => V(e.size)), c = t(() => a.value < 12), p = t(() => a.value && c.value ? { transform: `scale(${a.value / 12})` } : {}), x = t(() => {
38
38
  const o = j(
39
39
  {
40
40
  cursor: e.pointer ? "pointer" : void 0,
41
41
  color: e.color,
42
- "hover-color": h.value,
43
- fontSize: a.value ? "12px" : g(e.size)
42
+ "hover-color": i.value,
43
+ fontSize: c.value ? "12px" : h(e.size)
44
44
  },
45
45
  "icon-text"
46
46
  );
47
47
  return {
48
- ...a.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
48
+ ...c.value && e.adjustOrigin ? { transformOrigin: "left top" } : {},
49
49
  ...o,
50
50
  ...p.value
51
51
  };
@@ -55,13 +55,19 @@ const N = { key: 2 }, P = C({
55
55
  showTooltip: e.showTooltip,
56
56
  ...e.clampTooltipCfg
57
57
  }));
58
- return (o, B) => (n(), f("span", {
59
- class: k([r(u).b(), r(u).is("col", m.value)]),
58
+ return (o, B) => (r(), d("span", {
59
+ class: k([l(m).b(), l(m).is("col", v.value)]),
60
60
  style: T(x.value)
61
61
  }, [
62
- !o.reverse && l.value?.icon ? (n(), s(r(y), c({ key: 0 }, l.value, { style: v.value }), null, 16, ["style"])) : d("", !0),
63
- o.useClamp ? (n(), s(r(L), S(c({ key: 1 }, z.value)), null, 16)) : (n(), f("span", N, w(o.text), 1)),
64
- o.reverse && l.value?.icon ? (n(), s(r(y), c({ key: 3 }, l.value, { style: v.value }), null, 16, ["style"])) : d("", !0)
62
+ !o.reverse && n.value?.icon ? (r(), s(l(g), u({ key: 0 }, n.value, {
63
+ "hover-color": i.value,
64
+ style: f.value
65
+ }), null, 16, ["hover-color", "style"])) : y("", !0),
66
+ o.useClamp ? (r(), s(l(L), S(u({ key: 1 }, z.value)), null, 16)) : (r(), d("span", N, w(o.text), 1)),
67
+ o.reverse && n.value?.icon ? (r(), s(l(g), u({ key: 3 }, n.value, {
68
+ style: f.value,
69
+ "hover-color": i.value
70
+ }), null, 16, ["style", "hover-color"])) : y("", !0)
65
71
  ], 6));
66
72
  }
67
73
  });
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.313",
3
+ "version": "0.0.314",
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.313";
1
+ const o = "0.0.314";
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"),C=require("../clamp-tooltip/index.cjs"),a=require("../icon/index.cjs");require("@vueuse/core");const s=require("@vft/utils"),m=require("../../utils/helper.cjs"),p=require("../../utils/ns-cover.cjs");require("lodash-es");const B=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const k={key:2},h=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...h,props:{text:{},icon:{},color:{},hoverColor:{},distance:{default:3},reverse:{type:Boolean},size:{},direction:{default:"row"},pointer:{type:Boolean},adjustOrigin:{type:Boolean,default:!0},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const i=B.useNamespace("icon-text"),d=e.computed(()=>o.hoverColor?o.hoverColor:o.color),n=e.computed(()=>s.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),c=e.computed(()=>o.direction==="col"),u=e.computed(()=>{const t=m.addUnit(o.distance);return c.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),r=e.computed(()=>s.removeUnit(o.size)),l=e.computed(()=>r.value<12),v=e.computed(()=>r.value&&l.value?{transform:`scale(${r.value/12})`}:{}),f=e.computed(()=>{const t=p.generateCssVars({cursor:o.pointer?"pointer":void 0,color:o.color,"hover-color":d.value,fontSize:l.value?"12px":m.addUnit(o.size)},"icon-text");return{...l.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...v.value}}),g=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,y)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(i).b(),e.unref(i).is("col",c.value)]),style:e.normalizeStyle(f.value)},[!t.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(a.VftIcon),e.mergeProps({key:0},n.value,{style:u.value}),null,16,["style"])):e.createCommentVNode("",!0),t.useClamp?(e.openBlock(),e.createBlock(e.unref(C.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},g.value)),null,16)):(e.openBlock(),e.createElementBlock("span",k,e.toDisplayString(t.text),1)),t.reverse&&n.value?.icon?(e.openBlock(),e.createBlock(e.unref(a.VftIcon),e.mergeProps({key:3},n.value,{style:u.value}),null,16,["style"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../clamp-tooltip/index.cjs"),s=require("../icon/index.cjs");require("@vueuse/core");const m=require("@vft/utils"),v=require("../../utils/helper.cjs"),C=require("../../utils/ns-cover.cjs");require("lodash-es");const p=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const B={key:2},k=e.defineComponent({name:"vft-icon-text"}),q=e.defineComponent({...k,props:{text:{},icon:{},color:{},hoverColor:{},distance:{default:3},reverse:{type:Boolean},size:{},direction:{default:"row"},pointer:{type:Boolean},adjustOrigin:{type:Boolean,default:!0},maxLines:{},showTooltip:{type:Boolean},clampTooltipCfg:{},useClamp:{type:Boolean}},setup(o){const c=p.useNamespace("icon-text"),n=e.computed(()=>o.hoverColor?o.hoverColor:o.color),r=e.computed(()=>m.singleAttrToObj(o.icon,"icon",{size:o.size,color:o.color})),u=e.computed(()=>o.direction==="col"),a=e.computed(()=>{const t=v.addUnit(o.distance);return u.value?o.reverse?{marginTop:t}:{marginBottom:t}:o.reverse?{marginLeft:t}:{marginRight:t}}),l=e.computed(()=>m.removeUnit(o.size)),i=e.computed(()=>l.value<12),d=e.computed(()=>l.value&&i.value?{transform:`scale(${l.value/12})`}:{}),f=e.computed(()=>{const t=C.generateCssVars({cursor:o.pointer?"pointer":void 0,color:o.color,"hover-color":n.value,fontSize:i.value?"12px":v.addUnit(o.size)},"icon-text");return{...i.value&&o.adjustOrigin?{transformOrigin:"left top"}:{},...t,...d.value}}),g=e.computed(()=>({text:o.text,maxLines:o.maxLines,showTooltip:o.showTooltip,...o.clampTooltipCfg}));return(t,y)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass([e.unref(c).b(),e.unref(c).is("col",u.value)]),style:e.normalizeStyle(f.value)},[!t.reverse&&r.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:0},r.value,{"hover-color":n.value,style:a.value}),null,16,["hover-color","style"])):e.createCommentVNode("",!0),t.useClamp?(e.openBlock(),e.createBlock(e.unref(h.VftClampTooltip),e.normalizeProps(e.mergeProps({key:1},g.value)),null,16)):(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.text),1)),t.reverse&&r.value?.icon?(e.openBlock(),e.createBlock(e.unref(s.VftIcon),e.mergeProps({key:3},r.value,{style:a.value,"hover-color":n.value}),null,16,["style","hover-color"])):e.createCommentVNode("",!0)],6))}});exports.default=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.313";exports.version=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.0.314";exports.version=e;
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.313",
3
+ "version": "0.0.314",
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.313",
3
+ "version": "0.0.314",
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/store": "0.0.54",
59
- "@vft/utils": "0.0.127",
60
- "@vft/use": "0.0.76",
61
59
  "@vft/constants": "0.0.72",
60
+ "@vft/router": "0.0.65",
61
+ "@vft/utils": "0.0.127",
62
62
  "@vft/directives": "0.0.33",
63
- "@vft/router": "0.0.65"
63
+ "@vft/use": "0.0.76"
64
64
  },
65
65
  "vetur": {
66
66
  "tags": "tags.json",
package/web-types.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.313","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}
1
+ {"$schema":"http://json.schemastore.org/web-types","framework":"vue","name":"vft","version":"0.0.314","js-types-syntax":"typescript","description-markup":"markdown","contributions":{"html":{}}}