@pantograph/pattern-vue 0.0.2 → 0.0.3
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,16 +1,12 @@
|
|
|
1
1
|
import { InputExtendsEmits, InputExtendsProps, InputNotExtendsEmits, InputNotExtendsProps, InputSlots } from '@pantograph/vue';
|
|
2
2
|
/**
|
|
3
|
-
* Props
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* - Instead, import the split pair (`InputExtendsProps` + `InputNotExtendsProps`)
|
|
9
|
-
* and compose them with intersections (`&`).
|
|
10
|
-
*
|
|
11
|
-
* Extends all `Input` props and adds `visible` for password visibility control.
|
|
3
|
+
* Props inherited from Input component
|
|
4
|
+
*/
|
|
5
|
+
export type InputPasswordExtendsProps = InputExtendsProps & InputNotExtendsProps;
|
|
6
|
+
/**
|
|
7
|
+
* Props specific to InputPassword component
|
|
12
8
|
*/
|
|
13
|
-
export type
|
|
9
|
+
export type InputPasswordNotExtendsProps = {
|
|
14
10
|
/**
|
|
15
11
|
* Whether the password is visible (v-model)
|
|
16
12
|
*/
|
|
@@ -26,6 +22,12 @@ export type InputPasswordProps = InputExtendsProps & InputNotExtendsProps & {
|
|
|
26
22
|
*/
|
|
27
23
|
invisibleIcon?: string;
|
|
28
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Props for the InputPassword component
|
|
27
|
+
*
|
|
28
|
+
* Extends all `Input` props and adds `visible` for password visibility control.
|
|
29
|
+
*/
|
|
30
|
+
export type InputPasswordProps = InputPasswordExtendsProps & InputPasswordNotExtendsProps;
|
|
29
31
|
/**
|
|
30
32
|
* Slots for the InputPassword component
|
|
31
33
|
*
|
|
@@ -34,20 +36,24 @@ export type InputPasswordProps = InputExtendsProps & InputNotExtendsProps & {
|
|
|
34
36
|
*/
|
|
35
37
|
export type InputPasswordSlots = InputSlots;
|
|
36
38
|
/**
|
|
37
|
-
* Emits
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* Extends all `Input` emits and adds visible state update.
|
|
39
|
+
* Emits inherited from Input component
|
|
40
|
+
*/
|
|
41
|
+
export type InputPasswordExtendsEmits = InputExtendsEmits & InputNotExtendsEmits;
|
|
42
|
+
/**
|
|
43
|
+
* Emits specific to InputPassword component
|
|
44
44
|
*/
|
|
45
|
-
export type
|
|
45
|
+
export type InputPasswordNotExtendsEmits = {
|
|
46
46
|
/**
|
|
47
47
|
* Emitted when the visible state is updated
|
|
48
48
|
*/
|
|
49
49
|
'update:visible': [value: boolean];
|
|
50
50
|
};
|
|
51
|
+
/**
|
|
52
|
+
* Emits for the InputPassword component
|
|
53
|
+
*
|
|
54
|
+
* Extends all `Input` emits and adds visible state update.
|
|
55
|
+
*/
|
|
56
|
+
export type InputPasswordEmits = InputPasswordExtendsEmits & InputPasswordNotExtendsEmits;
|
|
51
57
|
/**
|
|
52
58
|
* Default props for the InputPassword component
|
|
53
59
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefineComponent } from '@pantograph/utils-vue';
|
|
2
|
-
import { default as InputPassword, InputPasswordSlots, InputPasswordEmits, InputPasswordProps, INPUT_PASSWORD_DEFAULT_PROPS } from './InputPassword';
|
|
3
|
-
export { InputPassword, type InputPasswordProps, type InputPasswordSlots, type InputPasswordEmits, INPUT_PASSWORD_DEFAULT_PROPS, };
|
|
2
|
+
import { default as InputPassword, InputPasswordSlots, InputPasswordEmits, InputPasswordExtendsEmits, InputPasswordExtendsProps, InputPasswordNotExtendsEmits, InputPasswordNotExtendsProps, InputPasswordProps, INPUT_PASSWORD_DEFAULT_PROPS } from './InputPassword';
|
|
3
|
+
export { InputPassword, type InputPasswordProps, type InputPasswordExtendsProps, type InputPasswordNotExtendsProps, type InputPasswordSlots, type InputPasswordEmits, type InputPasswordExtendsEmits, type InputPasswordNotExtendsEmits, INPUT_PASSWORD_DEFAULT_PROPS, };
|
|
4
4
|
declare module 'vue' {
|
|
5
5
|
interface GlobalComponents {
|
|
6
6
|
InputPassword: DefineComponent<InputPasswordProps, InputPasswordSlots, InputPasswordEmits>;
|
package/dist/use/index.js
CHANGED
|
@@ -139,7 +139,7 @@ const P = {
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
Object.assign(u, w(u, "InputPassword"));
|
|
142
|
-
const $ = "0.0.
|
|
142
|
+
const $ = "0.0.2", q = function(s, e = {}) {
|
|
143
143
|
const { cssInJs: t } = e;
|
|
144
144
|
return s.config.globalProperties.$pantographCssInJs = t, import("@pantograph/tokens/style/index.css"), t || import("@pantograph/styles/index.css"), Object.values(L).forEach((o) => {
|
|
145
145
|
o.install && s.use(o);
|
package/dist/use/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
"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.2",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;
|