@pantograph/pattern-vue 0.0.1 → 0.0.2
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.
|
@@ -52,6 +52,7 @@ export type InputPasswordEmits = InputExtendsEmits & InputNotExtendsEmits & {
|
|
|
52
52
|
* Default props for the InputPassword component
|
|
53
53
|
*/
|
|
54
54
|
export declare const INPUT_PASSWORD_DEFAULT_PROPS: {
|
|
55
|
+
readonly visible: undefined;
|
|
55
56
|
readonly visibleIcon: "tabler:eye-off";
|
|
56
57
|
readonly invisibleIcon: "tabler:eye";
|
|
57
58
|
readonly readonly: undefined;
|
|
@@ -80,6 +81,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<In
|
|
|
80
81
|
disabled: boolean;
|
|
81
82
|
clearIcon: string;
|
|
82
83
|
bordered: boolean;
|
|
84
|
+
visible: boolean;
|
|
83
85
|
visibleIcon: string;
|
|
84
86
|
invisibleIcon: string;
|
|
85
87
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>, Readonly<import('@pantograph/vue').InputExtendsSlots> & import('@pantograph/vue').InputExtendsSlots>;
|
package/dist/use/index.js
CHANGED
|
@@ -52,6 +52,7 @@ function W(s, e) {
|
|
|
52
52
|
}
|
|
53
53
|
const P = {
|
|
54
54
|
...D,
|
|
55
|
+
visible: void 0,
|
|
55
56
|
visibleIcon: "tabler:eye-off",
|
|
56
57
|
invisibleIcon: "tabler:eye"
|
|
57
58
|
}, u = /* @__PURE__ */ A({
|
|
@@ -98,10 +99,10 @@ const P = {
|
|
|
98
99
|
defaultValue: !1,
|
|
99
100
|
passive: t.visible === void 0
|
|
100
101
|
}
|
|
101
|
-
), i = a(() => n.value ? "text" : "password"),
|
|
102
|
+
), i = a(() => n.value ? "text" : "password"), v = () => {
|
|
102
103
|
n.value = !n.value;
|
|
103
|
-
},
|
|
104
|
-
() => H({ ..._, ...
|
|
104
|
+
}, I = W(t, r), _ = N(), p = a(
|
|
105
|
+
() => H({ ..._, ...I.value }, [
|
|
105
106
|
"visible",
|
|
106
107
|
"onUpdate:visible",
|
|
107
108
|
"invisibleIcon",
|
|
@@ -109,14 +110,14 @@ const P = {
|
|
|
109
110
|
])
|
|
110
111
|
), B = () => {
|
|
111
112
|
const d = (c) => {
|
|
112
|
-
var
|
|
113
|
-
const
|
|
114
|
-
return S(
|
|
113
|
+
var f;
|
|
114
|
+
const b = (f = o.trailing) == null ? void 0 : f.call(o, c);
|
|
115
|
+
return S(b) ? y(z, {
|
|
115
116
|
size: c.iconSize,
|
|
116
117
|
icon: n.value ? t.visibleIcon : t.invisibleIcon,
|
|
117
|
-
onClick:
|
|
118
|
+
onClick: v,
|
|
118
119
|
"aria-label": n.value ? "Hide password" : "Show password"
|
|
119
|
-
}) :
|
|
120
|
+
}) : b;
|
|
120
121
|
};
|
|
121
122
|
return y(
|
|
122
123
|
x,
|
|
@@ -138,7 +139,7 @@ const P = {
|
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
141
|
Object.assign(u, w(u, "InputPassword"));
|
|
141
|
-
const $ = "0.0.
|
|
142
|
+
const $ = "0.0.1", q = function(s, e = {}) {
|
|
142
143
|
const { cssInJs: t } = e;
|
|
143
144
|
return s.config.globalProperties.$pantographCssInJs = t, import("@pantograph/tokens/style/index.css"), t || import("@pantograph/styles/index.css"), Object.values(L).forEach((o) => {
|
|
144
145
|
o.install && s.use(o);
|
package/dist/use/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var C=Object.create;var
|
|
1
|
+
"use strict";var C=Object.create;var v=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var T=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of h(e))!E.call(o,s)&&s!==t&&v(o,s,{get:()=>e[s],enumerable:!(n=A(e,s))||n.enumerable});return o};var _=(o,e,t)=>(t=o!=null?C(j(o)):{},T(e||!o||!o.__esModule?v(t,"default",{value:o,enumerable:!0}):t,o));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=require("@pantograph/utils-vue"),l=require("vue"),d=require("@pantograph/utils"),u=require("@pantograph/vue"),N=Object.freeze(Object.defineProperty({__proto__:null,get INPUT_PASSWORD_DEFAULT_PROPS(){return y},get InputPassword(){return c},get default(){return I}},Symbol.toStringTag,{value:"Module"}));function F(o,e){const t={...o};for(let n=0;n<e.length;n++){const s=e[n];delete t[s]}return t}function U(o){const e=l.getCurrentInstance(),t=e==null?void 0:e.type.emits,n={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${e==null?void 0:e.type.__name}`),t==null||t.forEach(s=>{n[l.toHandlerKey(l.camelize(s))]=(...i)=>o(s,...i)}),n}function V(o){const e=l.getCurrentInstance(),t=Object.keys((e==null?void 0:e.type.props)??{}).reduce((s,i)=>{const r=(e==null?void 0:e.type.props[i]).default;return r!==void 0&&(s[i]=r),s},{}),n=l.toRef(o);return l.computed(()=>{const s={},i=(e==null?void 0:e.vnode.props)??{};return Object.keys(i).forEach(r=>{s[l.camelize(r)]=i[r]}),Object.keys({...t,...s}).reduce((r,a)=>(n.value[a]!==void 0&&(r[a]=n.value[a]),r),{})})}function D(o,e){const t=V(o),n=e?U(e):{};return l.computed(()=>({...t.value,...n}))}const y={...u.INPUT_DEFAULT_PROPS,visible:void 0,visibleIcon:"tabler:eye-off",invisibleIcon:"tabler:eye"},c=l.defineComponent({...d.getComponentOptions("InputPassword"),__name:"InputPassword",props:l.mergeDefaults({readonly:{type:Boolean},disabled:{type:Boolean},autoFocus:{type:Boolean},leading:{},trailing:{},clearIcon:{},trailingCls:{type:[Array,Object,String,Number,null,Boolean]},clearIconCls:{type:[Array,Object,String,Number,null,Boolean]},dividerCls:{type:[Array,Object,String,Number,null,Boolean]},leadingCls:{type:[Array,Object,String,Number,null,Boolean]},class:{type:[Array,Object,String,Number,null,Boolean]},allowClear:{type:Boolean},bordered:{type:Boolean},simple:{type:Boolean},size:{},status:{},steps:{type:Boolean},contentFit:{type:Boolean},outsideFgColor:{type:Boolean},id:{},maxlength:{},type:{},placeholder:{},required:{type:Boolean},modelValue:{},defaultValue:{},visible:{type:Boolean},visibleIcon:{},invisibleIcon:{}},y),emits:["blur","focus","clear","pointerdown","update:modelValue","change","update:visible"],setup(o,{emit:e}){const t=o,n=l.useSlots(),s=e,i=d.getBemElement(u.inputPrefix,"password_type"),r=b.useVModel(t,"visible",s,{defaultValue:!1,passive:t.visible===void 0}),a=l.computed(()=>r.value?"text":"password"),S=()=>{r.value=!r.value},O=D(t,s),B=l.useAttrs(),f=l.computed(()=>F({...B,...O.value},["visible","onUpdate:visible","invisibleIcon","visibleIcon"])),w=()=>{const g=p=>{var P;const m=(P=n.trailing)==null?void 0:P.call(n,p);return b.isEmptyElement(m)?l.h(u.Icon,{size:p.iconSize,icon:r.value?t.visibleIcon:t.invisibleIcon,onClick:S,"aria-label":r.value?"Hide password":"Show password"}):m};return l.h(u.Input,{...f.value,type:a.value,trailingCls:d.normCls(i,f.value.trailingCls)},{...n,trailing:g})};return(g,p)=>(l.openBlock(),l.createBlock(w))}});Object.assign(c,b.installComponent(c,"InputPassword"));const R="0.0.1",k=function(o,e={}){const{cssInJs:t}=e;return o.config.globalProperties.$pantographCssInJs=t,import("@pantograph/tokens/style/index.css"),t||import("@pantograph/styles/index.css"),Object.values(N).forEach(n=>{n.install&&o.use(n)}),o},I={version:R,install:k};exports.INPUT_PASSWORD_DEFAULT_PROPS=y;exports._sfc_main=c;exports.default=I;
|