@huntflow/ui 0.0.47 → 0.0.48
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.
- package/README.md +7 -0
- package/dist/assets/sprite.svg +1 -0
- package/dist/components/base-button/button.vue.d.ts +13 -6
- package/dist/components/base-checkbox/checkbox.vue.d.ts +11 -4
- package/dist/components/base-icon/icon.vue.d.ts +3 -0
- package/dist/components/base-icon/index.d.ts +4 -0
- package/dist/components/base-icon/types.d.ts +5 -0
- package/dist/components/base-input/input.vue.d.ts +12 -5
- package/dist/components/base-select/select.vue.d.ts +22 -13
- package/dist/components/index.d.ts +3 -1
- package/dist/sprite.svg +1 -0
- package/dist/ui.cjs.js +2 -2
- package/dist/ui.es.js +240 -131
- package/package.json +9 -3
package/dist/ui.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";var
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
(function(){"use strict";var e;try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(e=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:e.content,o.appendChild(document.createTextNode('._button_1ey6t_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_1ey6t_1 ._contentWrapper_1ey6t_13{display:flex;align-items:center}._button_1ey6t_1:focus{outline:none}._primary_1ey6t_23{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_1ey6t_23:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_1ey6t_23:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_1ey6t_23._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_1ey6t_44{color:var(--hf-button-danger-text-color);border:1px solid var(--hf-button-danger-background-color);background-color:var(--hf-button-danger-background-color)}._danger_1ey6t_44:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_1ey6t_44:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_1ey6t_44._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_1ey6t_64{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_1ey6t_64:hover{background-color:var(--hf-button-default-hover-background-color)}._default_1ey6t_64:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._link_1ey6t_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_1ey6t_84{width:100%}._disabled_1ey6t_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._disabled_1ey6t_88:hover{background-color:inherit}._loading_1ey6t_98{cursor:wait}._loading_1ey6t_98 ._content_1ey6t_13{visibility:hidden}._circle_1ey6t_106{border-radius:100%;padding:0!important}._bordered_1ey6t_38{border:1px solid currentColor}._icon_1ey6t_115{display:flex;align-items:center}._iconLeft_1ey6t_120{margin-right:8px}._iconRight_1ey6t_124{margin-left:8px}._xs_1ey6t_128{padding:4px 8px;font-size:12px}._s_1ey6t_133{padding:6px 12px;font-size:14px;line-height:20px}._m_1ey6t_139{padding:6px 12px;font-size:15px;line-height:24px}._l_1ey6t_78{padding:16px 32px;font-size:18px}._xl_1ey6t_150{padding:20px 40px;font-size:20px}._loadingWrapper_1ey6t_155{width:100%;height:100%;position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center}._loadingWrapper_1ey6t_155 ._spinner_1ey6t_166{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.05);border-top-color:#fff;border-radius:50%;animation:_spin_1ey6t_166 .6s linear infinite}@keyframes _spin_1ey6t_166{to{transform:rotate(360deg)}}._wrapper_f5n0f_1{display:flex;flex-direction:column}._label_f5n0f_6{margin-bottom:4px;font-size:15px;font-weight:500;line-height:20px}._container_f5n0f_13{position:relative;display:flex;align-items:center}._input_f5n0f_19{flex:1;padding:8px 12px;font-size:15px;line-height:24px;border:1px solid #00000029;border-radius:12px;outline:none;transition:border-color .3s}._input_f5n0f_19._error_f5n0f_29{border:1px solid #FF0000}._input_f5n0f_19._error_f5n0f_29:focus{outline:3px solid #FFD6D6}._input_f5n0f_19:focus{outline:3px solid #C4EDFA}._xs_f5n0f_41{padding:4px 8px;font-size:12px}._s_f5n0f_46{padding:6px 10px;font-size:13px}._m_f5n0f_51{padding:8px 12px;font-size:14px}._l_f5n0f_6{padding:10px 14px;font-size:16px}._xl_f5n0f_61{padding:12px 16px;font-size:18px}._disabled_f5n0f_66{background-color:#e9ecef;cursor:not-allowed}._errorText_f5n0f_71{margin-top:4px;font-size:14px;line-height:20px;color:red}._prefix_f5n0f_78,._suffix_f5n0f_79{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_f5n0f_78{left:8px}._suffix_f5n0f_79{right:8px}._loading_f5n0f_94{cursor:wait}._spinner_f5n0f_98{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_f5n0f_98 .6s linear infinite}@keyframes _spin_f5n0f_98{to{transform:rotate(360deg)}}._label_jcdiv_1{display:flex;align-items:center;gap:8px;height:20px}._label_jcdiv_1._disabled_jcdiv_7{color:gray;cursor:not-allowed}._label_jcdiv_1 span{margin-top:-5px}._input_jcdiv_17[type=checkbox]{vertical-align:-2px;margin:0;border-radius:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;width:16px;height:16px;border:1px solid #25CFE8;transform:translateY(-.075em);display:grid;place-content:center}._input_jcdiv_17._error_jcdiv_30[type=checkbox]{border:1px solid #FF0000}._input_jcdiv_17[type=checkbox]:before{content:"";width:16px;height:16px;clip-path:polygon(0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%);transform:scale(0);transform-origin:bottom left;transition:.12s transform ease-in-out;background-color:#25cfe8;border-radius:4px}._input_jcdiv_17[type=checkbox]:checked:before{transform:scale(1)}._input_jcdiv_17[type=checkbox]:focus{outline:2px solid #C4EDFA}._input_jcdiv_17._error_jcdiv_30[type=checkbox]:focus{outline:2px solid #FFD6D6}._input_jcdiv_17[type=checkbox]:disabled{border-color:#00000029;opacity:30%;color:#000;cursor:not-allowed}._text_jcdiv_70{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:15px;line-height:20px}._errorText_jcdiv_76{color:red;font-size:12px}._icon_1p8iz_2{font-style:normal;display:inline-block;vertical-align:middle}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f="_button_1ey6t_1",y="_contentWrapper_1ey6t_13",b="_primary_1ey6t_23",k="_bordered_1ey6t_38",v="_danger_1ey6t_44",g="_link_1ey6t_78",B="_block_1ey6t_84",h="_disabled_1ey6t_88",$="_loading_1ey6t_98",C="_content_1ey6t_13",E="_circle_1ey6t_106",z="_icon_1ey6t_115",N="_iconLeft_1ey6t_120",V="_iconRight_1ey6t_124",S="_xs_1ey6t_128",I="_s_1ey6t_133",M="_m_1ey6t_139",x="_l_1ey6t_78",T="_xl_1ey6t_150",w="_loadingWrapper_1ey6t_155",W="_spinner_1ey6t_166",j="_spin_1ey6t_166",r={button:f,contentWrapper:y,primary:b,bordered:k,danger:v,default:"_default_1ey6t_64",link:g,block:B,disabled:h,loading:$,content:C,circle:E,icon:z,iconLeft:N,iconRight:V,xs:S,s:I,m:M,l:x,xl:T,loadingWrapper:w,spinner:W,spin:j},D=["name","type","disabled"],L=e.defineComponent({__name:"button",props:{size:{default:"m"},className:{},type:{default:"default"},block:{type:Boolean},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},active:{type:Boolean,default:!1},name:{},circle:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},htmlType:{}},emits:["click"],setup(a){const o=a,l=e.computed(()=>[r.button,r[o.size],r[o.type],{[r.block]:o.block,[r.disabled]:o.disabled,[r.loading]:o.loading,[r.active]:o.active,[r.circle]:o.circle,[r.bordered]:o.bordered},o.className]);return(t,n)=>(e.openBlock(),e.createElementBlock("button",{name:t.name,class:e.normalizeClass(l.value),type:t.htmlType,disabled:t.disabled,onClick:n[0]||(n[0]=i=>t.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(r).loadingWrapper)},[e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).spinner)},null,2)],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(r).contentWrapper)},[t.$slots.leftIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(r).icon,e.unref(r).iconLeft])},[e.renderSlot(t.$slots,"leftIcon")],2)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(e.unref(r).content)},[e.renderSlot(t.$slots,"default")],2),t.$slots.rightIcon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([e.unref(r).icon,e.unref(r).iconRight])},[e.renderSlot(t.$slots,"rightIcon")],2)):e.createCommentVNode("",!0)],2)],10,D))}}),R="_wrapper_f5n0f_1",O="_label_f5n0f_6",P="_container_f5n0f_13",U="_input_f5n0f_19",q="_error_f5n0f_29",A="_xs_f5n0f_41",K="_s_f5n0f_46",F="_m_f5n0f_51",G="_l_f5n0f_6",H="_xl_f5n0f_61",J="_disabled_f5n0f_66",Q="_errorText_f5n0f_71",X="_prefix_f5n0f_78",Y="_suffix_f5n0f_79",Z="_loading_f5n0f_94",ee="_spinner_f5n0f_98",ne="_spin_f5n0f_98",c={wrapper:R,label:O,container:P,input:U,error:q,xs:A,s:K,m:F,l:G,xl:H,disabled:J,errorText:Q,prefix:X,suffix:Y,loading:Z,spinner:ee,spin:ne},te=["for"],oe=["id","name","type","disabled","placeholder"],se=e.defineComponent({__name:"input",props:e.mergeModels({value:{},type:{default:"text"},id:{},name:{},disabled:{type:Boolean},label:{},placeholder:{},loading:{type:Boolean},error:{},size:{default:"m"},className:{}},{value:{},valueModifiers:{}}),emits:e.mergeModels(["update:value","enter"],["update:value"]),setup(a,{emit:o}){const l=e.useModel(a,"value"),t=a,n=o,i=e.computed(()=>[c.input,c[t.size],{[c.disabled]:t.disabled,[c.error]:t.error,[c.loading]:t.loading},t.className]),p=s=>{n("update:value",s.target.value)},m=s=>{s.key==="Enter"&&n("enter")};return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(c).wrapper)},[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:s.id,class:e.normalizeClass(e.unref(c).label)},e.toDisplayString(s.label),11,te)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(c).container)},[s.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(c).prefix)},[e.renderSlot(s.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:s.id,"onUpdate:modelValue":u[0]||(u[0]=_=>l.value=_),name:s.name,type:s.type,disabled:s.disabled||s.loading,placeholder:s.placeholder,class:e.normalizeClass(i.value),onInput:p,onKeydown:m},null,42,oe),[[e.vModelDynamic,l.value]]),s.$slots.suffix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(c).suffix)},[e.renderSlot(s.$slots,"suffix")],2)):e.createCommentVNode("",!0),s.loading?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(c).spinner)},null,2)):e.createCommentVNode("",!0)],2),s.error?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(c).errorText)},e.toDisplayString(s.error),3)):e.createCommentVNode("",!0)],2))}}),le="_label_jcdiv_1",re="_disabled_jcdiv_7",ae="_input_jcdiv_17",ce="_error_jcdiv_30",ie="_text_jcdiv_70",de="_errorText_jcdiv_76",d={label:le,disabled:re,input:ae,error:ce,text:ie,errorText:de},pe=["for"],ue=["id","name","disabled"],me=e.defineComponent({__name:"checkbox",props:e.mergeModels({id:{},name:{},disabled:{type:Boolean},label:{},error:{},className:{}},{checked:{type:Boolean},checkedModifiers:{}}),emits:["update:checked"],setup(a){const o=e.useModel(a,"checked"),l=a,t=e.computed(()=>[d.label,{[d.disabled]:l.disabled},l.className]);return(n,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("label",{for:n.id,class:e.normalizeClass(t.value)},[e.withDirectives(e.createElementVNode("input",{id:n.id,"onUpdate:modelValue":i[0]||(i[0]=p=>o.value=p),name:n.name,type:"checkbox",disabled:n.disabled,class:e.normalizeClass([e.unref(d).input,{[e.unref(d).error]:!!l.error}])},null,10,ue),[[e.vModelCheckbox,o.value]]),n.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(d).text)},[e.renderSlot(n.$slots,"default")],2)):e.createCommentVNode("",!0)],10,pe),n.error?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d).errorText)},e.toDisplayString(n.error),3)):e.createCommentVNode("",!0)]))}}),_e=["aria-label","width","height"],fe=["xlink:href"],ye=e.defineComponent({__name:"icon",props:{type:{},color:{},block:{type:Boolean}},setup(a){const o=a,l=e.computed(()=>{const n=o.type.match(/(\d+)$/);return n?parseInt(n[1],10):16}),t=e.computed(()=>{const n={};return o.color&&(n.color=o.color),o.block&&(n.display="block"),n});return(n,i)=>(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(n.$style.icon),"aria-label":n.type,style:e.normalizeStyle(t.value),role:"img",width:l.value,height:l.value},[e.createElementVNode("use",{"xlink:href":`../assets/sprite.svg#${n.type}`},null,8,fe)],14,_e))}}),be="_icon_1p8iz_2",ke={icon:be},ve=(a,o)=>{const l=a.__vccOpts||a;for(const[t,n]of o)l[t]=n;return l},ge={$style:ke},Be=ve(ye,[["__cssModules",ge]]),he=()=>{const a="huntflow-uikit-icons-sprite",o="/src/assets/sprite.svg";if(!document.getElementById(a)){const l=document.createElement("svg");l.style.display="none",l.id=a;const t=document.createElement("defs"),n=document.createElement("use");n.setAttribute("href",`${o}`),t.appendChild(n),l.appendChild(t),document.body.appendChild(l)}};exports.BaseButton=L;exports.BaseCheckbox=me;exports.BaseIcon=Be;exports.BaseInput=se;exports.useIcons=he;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
(function(){"use strict";var
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
4
|
-
button:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
(function(){"use strict";var e;try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(e=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:e.content,o.appendChild(document.createTextNode('._button_1ey6t_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_1ey6t_1 ._contentWrapper_1ey6t_13{display:flex;align-items:center}._button_1ey6t_1:focus{outline:none}._primary_1ey6t_23{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_1ey6t_23:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_1ey6t_23:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_1ey6t_23._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_1ey6t_44{color:var(--hf-button-danger-text-color);border:1px solid var(--hf-button-danger-background-color);background-color:var(--hf-button-danger-background-color)}._danger_1ey6t_44:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_1ey6t_44:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_1ey6t_44._bordered_1ey6t_38{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_1ey6t_64{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_1ey6t_64:hover{background-color:var(--hf-button-default-hover-background-color)}._default_1ey6t_64:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._link_1ey6t_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_1ey6t_84{width:100%}._disabled_1ey6t_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._disabled_1ey6t_88:hover{background-color:inherit}._loading_1ey6t_98{cursor:wait}._loading_1ey6t_98 ._content_1ey6t_13{visibility:hidden}._circle_1ey6t_106{border-radius:100%;padding:0!important}._bordered_1ey6t_38{border:1px solid currentColor}._icon_1ey6t_115{display:flex;align-items:center}._iconLeft_1ey6t_120{margin-right:8px}._iconRight_1ey6t_124{margin-left:8px}._xs_1ey6t_128{padding:4px 8px;font-size:12px}._s_1ey6t_133{padding:6px 12px;font-size:14px;line-height:20px}._m_1ey6t_139{padding:6px 12px;font-size:15px;line-height:24px}._l_1ey6t_78{padding:16px 32px;font-size:18px}._xl_1ey6t_150{padding:20px 40px;font-size:20px}._loadingWrapper_1ey6t_155{width:100%;height:100%;position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center}._loadingWrapper_1ey6t_155 ._spinner_1ey6t_166{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.05);border-top-color:#fff;border-radius:50%;animation:_spin_1ey6t_166 .6s linear infinite}@keyframes _spin_1ey6t_166{to{transform:rotate(360deg)}}._wrapper_f5n0f_1{display:flex;flex-direction:column}._label_f5n0f_6{margin-bottom:4px;font-size:15px;font-weight:500;line-height:20px}._container_f5n0f_13{position:relative;display:flex;align-items:center}._input_f5n0f_19{flex:1;padding:8px 12px;font-size:15px;line-height:24px;border:1px solid #00000029;border-radius:12px;outline:none;transition:border-color .3s}._input_f5n0f_19._error_f5n0f_29{border:1px solid #FF0000}._input_f5n0f_19._error_f5n0f_29:focus{outline:3px solid #FFD6D6}._input_f5n0f_19:focus{outline:3px solid #C4EDFA}._xs_f5n0f_41{padding:4px 8px;font-size:12px}._s_f5n0f_46{padding:6px 10px;font-size:13px}._m_f5n0f_51{padding:8px 12px;font-size:14px}._l_f5n0f_6{padding:10px 14px;font-size:16px}._xl_f5n0f_61{padding:12px 16px;font-size:18px}._disabled_f5n0f_66{background-color:#e9ecef;cursor:not-allowed}._errorText_f5n0f_71{margin-top:4px;font-size:14px;line-height:20px;color:red}._prefix_f5n0f_78,._suffix_f5n0f_79{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_f5n0f_78{left:8px}._suffix_f5n0f_79{right:8px}._loading_f5n0f_94{cursor:wait}._spinner_f5n0f_98{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_f5n0f_98 .6s linear infinite}@keyframes _spin_f5n0f_98{to{transform:rotate(360deg)}}._label_jcdiv_1{display:flex;align-items:center;gap:8px;height:20px}._label_jcdiv_1._disabled_jcdiv_7{color:gray;cursor:not-allowed}._label_jcdiv_1 span{margin-top:-5px}._input_jcdiv_17[type=checkbox]{vertical-align:-2px;margin:0;border-radius:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;width:16px;height:16px;border:1px solid #25CFE8;transform:translateY(-.075em);display:grid;place-content:center}._input_jcdiv_17._error_jcdiv_30[type=checkbox]{border:1px solid #FF0000}._input_jcdiv_17[type=checkbox]:before{content:"";width:16px;height:16px;clip-path:polygon(0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%);transform:scale(0);transform-origin:bottom left;transition:.12s transform ease-in-out;background-color:#25cfe8;border-radius:4px}._input_jcdiv_17[type=checkbox]:checked:before{transform:scale(1)}._input_jcdiv_17[type=checkbox]:focus{outline:2px solid #C4EDFA}._input_jcdiv_17._error_jcdiv_30[type=checkbox]:focus{outline:2px solid #FFD6D6}._input_jcdiv_17[type=checkbox]:disabled{border-color:#00000029;opacity:30%;color:#000;cursor:not-allowed}._text_jcdiv_70{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:15px;line-height:20px}._errorText_jcdiv_76{color:red;font-size:12px}._icon_1p8iz_2{font-style:normal;display:inline-block;vertical-align:middle}')),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import { defineComponent as v, computed as b, openBlock as c, createElementBlock as d, normalizeClass as o, unref as a, createElementVNode as u, createCommentVNode as _, renderSlot as m, mergeModels as h, useModel as B, toDisplayString as g, withDirectives as x, vModelDynamic as E, vModelCheckbox as T, normalizeStyle as w } from "vue";
|
|
3
|
+
const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t_23", W = "_bordered_1ey6t_38", j = "_danger_1ey6t_44", L = "_link_1ey6t_78", R = "_block_1ey6t_84", S = "_disabled_1ey6t_88", V = "_loading_1ey6t_98", D = "_content_1ey6t_13", U = "_circle_1ey6t_106", A = "_icon_1ey6t_115", K = "_iconLeft_1ey6t_120", O = "_iconRight_1ey6t_124", P = "_xs_1ey6t_128", q = "_s_1ey6t_133", F = "_m_1ey6t_139", G = "_l_1ey6t_78", H = "_xl_1ey6t_150", J = "_loadingWrapper_1ey6t_155", Q = "_spinner_1ey6t_166", X = "_spin_1ey6t_166", r = {
|
|
4
|
+
button: z,
|
|
5
|
+
contentWrapper: M,
|
|
6
|
+
primary: N,
|
|
7
|
+
bordered: W,
|
|
8
|
+
danger: j,
|
|
9
|
+
default: "_default_1ey6t_64",
|
|
9
10
|
link: L,
|
|
10
|
-
block:
|
|
11
|
-
disabled:
|
|
12
|
-
loading:
|
|
11
|
+
block: R,
|
|
12
|
+
disabled: S,
|
|
13
|
+
loading: V,
|
|
13
14
|
content: D,
|
|
14
|
-
circle:
|
|
15
|
-
icon:
|
|
16
|
-
iconLeft:
|
|
17
|
-
iconRight:
|
|
18
|
-
xs:
|
|
19
|
-
s:
|
|
20
|
-
m:
|
|
21
|
-
l:
|
|
22
|
-
xl:
|
|
23
|
-
loadingWrapper:
|
|
24
|
-
spinner:
|
|
25
|
-
spin:
|
|
26
|
-
},
|
|
15
|
+
circle: U,
|
|
16
|
+
icon: A,
|
|
17
|
+
iconLeft: K,
|
|
18
|
+
iconRight: O,
|
|
19
|
+
xs: P,
|
|
20
|
+
s: q,
|
|
21
|
+
m: F,
|
|
22
|
+
l: G,
|
|
23
|
+
xl: H,
|
|
24
|
+
loadingWrapper: J,
|
|
25
|
+
spinner: Q,
|
|
26
|
+
spin: X
|
|
27
|
+
}, Y = ["name", "type", "disabled"], je = /* @__PURE__ */ v({
|
|
27
28
|
__name: "button",
|
|
28
29
|
props: {
|
|
29
30
|
size: { default: "m" },
|
|
@@ -39,77 +40,80 @@ const T = "_button_d4llw_1", z = "_primary_d4llw_19", C = "_bordered_d4llw_34",
|
|
|
39
40
|
htmlType: {}
|
|
40
41
|
},
|
|
41
42
|
emits: ["click"],
|
|
42
|
-
setup(
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
setup(i) {
|
|
44
|
+
const t = i, l = b(() => [
|
|
45
|
+
r.button,
|
|
46
|
+
r[t.size],
|
|
47
|
+
r[t.type],
|
|
47
48
|
{
|
|
48
|
-
[
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
49
|
+
[r.block]: t.block,
|
|
50
|
+
[r.disabled]: t.disabled,
|
|
51
|
+
[r.loading]: t.loading,
|
|
52
|
+
[r.active]: t.active,
|
|
53
|
+
[r.circle]: t.circle,
|
|
54
|
+
[r.bordered]: t.bordered
|
|
54
55
|
},
|
|
55
|
-
|
|
56
|
+
t.className
|
|
56
57
|
]);
|
|
57
|
-
return (
|
|
58
|
-
name:
|
|
59
|
-
class:
|
|
60
|
-
type:
|
|
61
|
-
disabled:
|
|
62
|
-
onClick:
|
|
58
|
+
return (s, e) => (c(), d("button", {
|
|
59
|
+
name: s.name,
|
|
60
|
+
class: o(l.value),
|
|
61
|
+
type: s.htmlType,
|
|
62
|
+
disabled: s.disabled,
|
|
63
|
+
onClick: e[0] || (e[0] = (f) => s.$emit("click"))
|
|
63
64
|
}, [
|
|
64
|
-
|
|
65
|
+
s.loading ? (c(), d("div", {
|
|
65
66
|
key: 0,
|
|
66
|
-
class:
|
|
67
|
+
class: o(a(r).loadingWrapper)
|
|
67
68
|
}, [
|
|
68
|
-
|
|
69
|
-
class:
|
|
69
|
+
u("span", {
|
|
70
|
+
class: o(a(r).spinner)
|
|
70
71
|
}, null, 2)
|
|
71
|
-
], 2)) :
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
], 2)) : _("", !0),
|
|
73
|
+
u("div", {
|
|
74
|
+
class: o(a(r).contentWrapper)
|
|
75
|
+
}, [
|
|
76
|
+
s.$slots.leftIcon ? (c(), d("span", {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: o([a(r).icon, a(r).iconLeft])
|
|
75
79
|
}, [
|
|
76
|
-
|
|
77
|
-
], 2),
|
|
78
|
-
|
|
79
|
-
class:
|
|
80
|
+
m(s.$slots, "leftIcon")
|
|
81
|
+
], 2)) : _("", !0),
|
|
82
|
+
u("span", {
|
|
83
|
+
class: o(a(r).content)
|
|
80
84
|
}, [
|
|
81
|
-
|
|
85
|
+
m(s.$slots, "default")
|
|
82
86
|
], 2),
|
|
83
|
-
|
|
84
|
-
key:
|
|
85
|
-
class:
|
|
87
|
+
s.$slots.rightIcon ? (c(), d("span", {
|
|
88
|
+
key: 1,
|
|
89
|
+
class: o([a(r).icon, a(r).iconRight])
|
|
86
90
|
}, [
|
|
87
|
-
|
|
88
|
-
], 2)) :
|
|
89
|
-
])
|
|
90
|
-
], 10,
|
|
91
|
+
m(s.$slots, "rightIcon")
|
|
92
|
+
], 2)) : _("", !0)
|
|
93
|
+
], 2)
|
|
94
|
+
], 10, Y));
|
|
91
95
|
}
|
|
92
|
-
}),
|
|
93
|
-
wrapper:
|
|
94
|
-
label:
|
|
95
|
-
container:
|
|
96
|
-
input:
|
|
97
|
-
error:
|
|
98
|
-
xs:
|
|
96
|
+
}), Z = "_wrapper_f5n0f_1", ee = "_label_f5n0f_6", se = "_container_f5n0f_13", te = "_input_f5n0f_19", ne = "_error_f5n0f_29", oe = "_xs_f5n0f_41", le = "_s_f5n0f_46", ae = "_m_f5n0f_51", re = "_l_f5n0f_6", ie = "_xl_f5n0f_61", ce = "_disabled_f5n0f_66", de = "_errorText_f5n0f_71", pe = "_prefix_f5n0f_78", _e = "_suffix_f5n0f_79", ue = "_loading_f5n0f_94", fe = "_spinner_f5n0f_98", ye = "_spin_f5n0f_98", p = {
|
|
97
|
+
wrapper: Z,
|
|
98
|
+
label: ee,
|
|
99
|
+
container: se,
|
|
100
|
+
input: te,
|
|
101
|
+
error: ne,
|
|
102
|
+
xs: oe,
|
|
99
103
|
s: le,
|
|
100
|
-
m:
|
|
101
|
-
l:
|
|
102
|
-
xl:
|
|
103
|
-
disabled:
|
|
104
|
-
errorText:
|
|
105
|
-
prefix:
|
|
106
|
-
suffix:
|
|
107
|
-
loading:
|
|
108
|
-
spinner:
|
|
109
|
-
spin:
|
|
110
|
-
},
|
|
104
|
+
m: ae,
|
|
105
|
+
l: re,
|
|
106
|
+
xl: ie,
|
|
107
|
+
disabled: ce,
|
|
108
|
+
errorText: de,
|
|
109
|
+
prefix: pe,
|
|
110
|
+
suffix: _e,
|
|
111
|
+
loading: ue,
|
|
112
|
+
spinner: fe,
|
|
113
|
+
spin: ye
|
|
114
|
+
}, me = ["for"], be = ["id", "name", "type", "disabled", "placeholder"], Le = /* @__PURE__ */ v({
|
|
111
115
|
__name: "input",
|
|
112
|
-
props: /* @__PURE__ */
|
|
116
|
+
props: /* @__PURE__ */ h({
|
|
113
117
|
value: {},
|
|
114
118
|
type: { default: "text" },
|
|
115
119
|
id: {},
|
|
@@ -125,71 +129,176 @@ const T = "_button_d4llw_1", z = "_primary_d4llw_19", C = "_bordered_d4llw_34",
|
|
|
125
129
|
value: {},
|
|
126
130
|
valueModifiers: {}
|
|
127
131
|
}),
|
|
128
|
-
emits: /* @__PURE__ */
|
|
129
|
-
setup(
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
emits: /* @__PURE__ */ h(["update:value", "enter"], ["update:value"]),
|
|
133
|
+
setup(i, { emit: t }) {
|
|
134
|
+
const l = B(i, "value"), s = i, e = t, f = b(() => [
|
|
135
|
+
p.input,
|
|
136
|
+
p[s.size],
|
|
133
137
|
{
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
[
|
|
138
|
+
[p.disabled]: s.disabled,
|
|
139
|
+
[p.error]: s.error,
|
|
140
|
+
[p.loading]: s.loading
|
|
137
141
|
},
|
|
138
|
-
|
|
139
|
-
]),
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
142
|
+
s.className
|
|
143
|
+
]), $ = (n) => {
|
|
144
|
+
e("update:value", n.target.value);
|
|
145
|
+
}, C = (n) => {
|
|
146
|
+
n.key === "Enter" && e("enter");
|
|
143
147
|
};
|
|
144
|
-
return (
|
|
145
|
-
class:
|
|
148
|
+
return (n, k) => (c(), d("div", {
|
|
149
|
+
class: o(a(p).wrapper)
|
|
146
150
|
}, [
|
|
147
|
-
|
|
151
|
+
n.label ? (c(), d("label", {
|
|
148
152
|
key: 0,
|
|
149
|
-
for:
|
|
150
|
-
class:
|
|
151
|
-
}, g(
|
|
152
|
-
|
|
153
|
-
class:
|
|
153
|
+
for: n.id,
|
|
154
|
+
class: o(a(p).label)
|
|
155
|
+
}, g(n.label), 11, me)) : _("", !0),
|
|
156
|
+
u("div", {
|
|
157
|
+
class: o(a(p).container)
|
|
154
158
|
}, [
|
|
155
|
-
|
|
159
|
+
n.$slots.prefix ? (c(), d("span", {
|
|
156
160
|
key: 0,
|
|
157
|
-
class:
|
|
161
|
+
class: o(a(p).prefix)
|
|
158
162
|
}, [
|
|
159
|
-
|
|
160
|
-
], 2)) :
|
|
161
|
-
x(
|
|
162
|
-
id:
|
|
163
|
-
"onUpdate:modelValue":
|
|
164
|
-
name:
|
|
165
|
-
type:
|
|
166
|
-
disabled:
|
|
167
|
-
placeholder:
|
|
168
|
-
class:
|
|
169
|
-
onInput:
|
|
170
|
-
onKeydown:
|
|
171
|
-
}, null, 42,
|
|
172
|
-
[
|
|
163
|
+
m(n.$slots, "prefix")
|
|
164
|
+
], 2)) : _("", !0),
|
|
165
|
+
x(u("input", {
|
|
166
|
+
id: n.id,
|
|
167
|
+
"onUpdate:modelValue": k[0] || (k[0] = (I) => l.value = I),
|
|
168
|
+
name: n.name,
|
|
169
|
+
type: n.type,
|
|
170
|
+
disabled: n.disabled || n.loading,
|
|
171
|
+
placeholder: n.placeholder,
|
|
172
|
+
class: o(f.value),
|
|
173
|
+
onInput: $,
|
|
174
|
+
onKeydown: C
|
|
175
|
+
}, null, 42, be), [
|
|
176
|
+
[E, l.value]
|
|
173
177
|
]),
|
|
174
|
-
|
|
178
|
+
n.$slots.suffix ? (c(), d("span", {
|
|
175
179
|
key: 1,
|
|
176
|
-
class:
|
|
180
|
+
class: o(a(p).suffix)
|
|
177
181
|
}, [
|
|
178
|
-
|
|
179
|
-
], 2)) :
|
|
180
|
-
|
|
182
|
+
m(n.$slots, "suffix")
|
|
183
|
+
], 2)) : _("", !0),
|
|
184
|
+
n.loading ? (c(), d("span", {
|
|
181
185
|
key: 2,
|
|
182
|
-
class:
|
|
183
|
-
}, null, 2)) :
|
|
186
|
+
class: o(a(p).spinner)
|
|
187
|
+
}, null, 2)) : _("", !0)
|
|
184
188
|
], 2),
|
|
185
|
-
|
|
189
|
+
n.error ? (c(), d("p", {
|
|
186
190
|
key: 1,
|
|
187
|
-
class:
|
|
188
|
-
}, g(
|
|
191
|
+
class: o(a(p).errorText)
|
|
192
|
+
}, g(n.error), 3)) : _("", !0)
|
|
189
193
|
], 2));
|
|
190
194
|
}
|
|
191
|
-
})
|
|
195
|
+
}), ve = "_label_jcdiv_1", $e = "_disabled_jcdiv_7", he = "_input_jcdiv_17", ge = "_error_jcdiv_30", ke = "_text_jcdiv_70", Be = "_errorText_jcdiv_76", y = {
|
|
196
|
+
label: ve,
|
|
197
|
+
disabled: $e,
|
|
198
|
+
input: he,
|
|
199
|
+
error: ge,
|
|
200
|
+
text: ke,
|
|
201
|
+
errorText: Be
|
|
202
|
+
}, xe = ["for"], Ce = ["id", "name", "disabled"], Re = /* @__PURE__ */ v({
|
|
203
|
+
__name: "checkbox",
|
|
204
|
+
props: /* @__PURE__ */ h({
|
|
205
|
+
id: {},
|
|
206
|
+
name: {},
|
|
207
|
+
disabled: { type: Boolean },
|
|
208
|
+
label: {},
|
|
209
|
+
error: {},
|
|
210
|
+
className: {}
|
|
211
|
+
}, {
|
|
212
|
+
checked: { type: Boolean },
|
|
213
|
+
checkedModifiers: {}
|
|
214
|
+
}),
|
|
215
|
+
emits: ["update:checked"],
|
|
216
|
+
setup(i) {
|
|
217
|
+
const t = B(i, "checked"), l = i, s = b(() => [
|
|
218
|
+
y.label,
|
|
219
|
+
{
|
|
220
|
+
[y.disabled]: l.disabled
|
|
221
|
+
},
|
|
222
|
+
l.className
|
|
223
|
+
]);
|
|
224
|
+
return (e, f) => (c(), d("div", null, [
|
|
225
|
+
u("label", {
|
|
226
|
+
for: e.id,
|
|
227
|
+
class: o(s.value)
|
|
228
|
+
}, [
|
|
229
|
+
x(u("input", {
|
|
230
|
+
id: e.id,
|
|
231
|
+
"onUpdate:modelValue": f[0] || (f[0] = ($) => t.value = $),
|
|
232
|
+
name: e.name,
|
|
233
|
+
type: "checkbox",
|
|
234
|
+
disabled: e.disabled,
|
|
235
|
+
class: o([a(y).input, { [a(y).error]: !!l.error }])
|
|
236
|
+
}, null, 10, Ce), [
|
|
237
|
+
[T, t.value]
|
|
238
|
+
]),
|
|
239
|
+
e.$slots.default ? (c(), d("span", {
|
|
240
|
+
key: 0,
|
|
241
|
+
class: o(a(y).text)
|
|
242
|
+
}, [
|
|
243
|
+
m(e.$slots, "default")
|
|
244
|
+
], 2)) : _("", !0)
|
|
245
|
+
], 10, xe),
|
|
246
|
+
e.error ? (c(), d("div", {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: o(a(y).errorText)
|
|
249
|
+
}, g(e.error), 3)) : _("", !0)
|
|
250
|
+
]));
|
|
251
|
+
}
|
|
252
|
+
}), Ie = ["aria-label", "width", "height"], Ee = ["xlink:href"], Te = /* @__PURE__ */ v({
|
|
253
|
+
__name: "icon",
|
|
254
|
+
props: {
|
|
255
|
+
type: {},
|
|
256
|
+
color: {},
|
|
257
|
+
block: { type: Boolean }
|
|
258
|
+
},
|
|
259
|
+
setup(i) {
|
|
260
|
+
const t = i, l = b(() => {
|
|
261
|
+
const e = t.type.match(/(\d+)$/);
|
|
262
|
+
return e ? parseInt(e[1], 10) : 16;
|
|
263
|
+
}), s = b(() => {
|
|
264
|
+
const e = {};
|
|
265
|
+
return t.color && (e.color = t.color), t.block && (e.display = "block"), e;
|
|
266
|
+
});
|
|
267
|
+
return (e, f) => (c(), d("svg", {
|
|
268
|
+
class: o(e.$style.icon),
|
|
269
|
+
"aria-label": e.type,
|
|
270
|
+
style: w(s.value),
|
|
271
|
+
role: "img",
|
|
272
|
+
width: l.value,
|
|
273
|
+
height: l.value
|
|
274
|
+
}, [
|
|
275
|
+
u("use", {
|
|
276
|
+
"xlink:href": `../assets/sprite.svg#${e.type}`
|
|
277
|
+
}, null, 8, Ee)
|
|
278
|
+
], 14, Ie));
|
|
279
|
+
}
|
|
280
|
+
}), we = "_icon_1p8iz_2", ze = {
|
|
281
|
+
icon: we
|
|
282
|
+
}, Me = (i, t) => {
|
|
283
|
+
const l = i.__vccOpts || i;
|
|
284
|
+
for (const [s, e] of t)
|
|
285
|
+
l[s] = e;
|
|
286
|
+
return l;
|
|
287
|
+
}, Ne = {
|
|
288
|
+
$style: ze
|
|
289
|
+
}, Se = /* @__PURE__ */ Me(Te, [["__cssModules", Ne]]), Ve = () => {
|
|
290
|
+
const i = "huntflow-uikit-icons-sprite", t = "/src/assets/sprite.svg";
|
|
291
|
+
if (!document.getElementById(i)) {
|
|
292
|
+
const l = document.createElement("svg");
|
|
293
|
+
l.style.display = "none", l.id = i;
|
|
294
|
+
const s = document.createElement("defs"), e = document.createElement("use");
|
|
295
|
+
e.setAttribute("href", `${t}`), s.appendChild(e), l.appendChild(s), document.body.appendChild(l);
|
|
296
|
+
}
|
|
297
|
+
};
|
|
192
298
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
299
|
+
je as BaseButton,
|
|
300
|
+
Re as BaseCheckbox,
|
|
301
|
+
Se as BaseIcon,
|
|
302
|
+
Le as BaseInput,
|
|
303
|
+
Ve as useIcons
|
|
195
304
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@huntflow/ui",
|
|
3
3
|
"description": "HuntFlow UiKit, icons, utils library",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.48",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "HuntFlow Developer",
|
|
8
8
|
"nickname": "developer",
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"preview": "vite preview",
|
|
23
23
|
"storybook": "storybook dev -p 6006",
|
|
24
24
|
"build-storybook": "storybook build",
|
|
25
|
-
"lint": "eslint './src/**/*.{js,vue,ts}' --quiet"
|
|
25
|
+
"lint": "eslint './src/**/*.{js,vue,ts}' --quiet",
|
|
26
|
+
"icons": "npx tsx utils/figma-icons.ts"
|
|
26
27
|
},
|
|
27
28
|
"publishConfig": {
|
|
28
29
|
"access": "public"
|
|
@@ -61,7 +62,9 @@
|
|
|
61
62
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
62
63
|
"@vue/eslint-config-typescript": "^14.1.4",
|
|
63
64
|
"autoprefixer": "^10.4.20",
|
|
65
|
+
"axios": "^1.7.9",
|
|
64
66
|
"css-has-pseudo": "^7.0.2",
|
|
67
|
+
"dotenv": "^16.4.7",
|
|
65
68
|
"eslint": "^9.17.0",
|
|
66
69
|
"eslint-config-prettier": "^9.1.0",
|
|
67
70
|
"eslint-plugin-jest": "^28.9.0",
|
|
@@ -74,12 +77,15 @@
|
|
|
74
77
|
"storybook": "^8.4.7",
|
|
75
78
|
"stylelint": "^16.12.0",
|
|
76
79
|
"stylelint-config-recommended": "^14.0.1",
|
|
77
|
-
"
|
|
80
|
+
"tsx": "^4.19.2",
|
|
81
|
+
"typescript": "~5.6.2",
|
|
78
82
|
"typescript-eslint": "^8.18.1",
|
|
79
83
|
"vite": "^5.4.10",
|
|
80
84
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
81
85
|
"vite-plugin-dts": "^4.3.0",
|
|
82
86
|
"vite-plugin-eslint2": "^5.0.3",
|
|
87
|
+
"vite-plugin-static-copy": "^2.2.0",
|
|
88
|
+
"vite-svg-sprite-wrapper": "^1.4.1",
|
|
83
89
|
"vue-tsc": "^2.1.8"
|
|
84
90
|
}
|
|
85
91
|
}
|