80 changed files with 528 additions and 630 deletions
@ -1,8 +1,7 @@ |
|||
import AppLocalePicker from './src/AppLocalePicker.vue'; |
|||
import AppPageFooter from './src/AppPageFooter.vue'; |
|||
import AppLogo from './src/AppLogo.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { AppLocalePicker, AppPageFooter, AppLogo }; |
|||
export { AppLocalePicker, AppLogo }; |
|||
|
|||
export default withInstall(AppLocalePicker, AppPageFooter, AppLogo); |
|||
export default withInstall(AppLocalePicker, AppLogo); |
|||
|
|||
@ -1,3 +1,9 @@ |
|||
export { default as BasicArrow } from './src/BasicArrow.vue'; |
|||
export { default as BasicHelp } from './src/BasicHelp.vue'; |
|||
export { default as BasicTitle } from './src/BasicTitle.vue'; |
|||
import BasicArrow from './src/BasicArrow.vue'; |
|||
import BasicHelp from './src/BasicHelp.vue'; |
|||
import BasicTitle from './src/BasicTitle.vue'; |
|||
|
|||
import { withInstall } from '../util'; |
|||
|
|||
export { BasicArrow, BasicHelp, BasicTitle }; |
|||
|
|||
export default withInstall(BasicArrow, BasicHelp, BasicTitle); |
|||
|
|||
@ -0,0 +1,7 @@ |
|||
import Breadcrumb from './src/Breadcrumb.vue'; |
|||
import BreadcrumbItem from './src/BreadcrumbItem.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { Breadcrumb, BreadcrumbItem }; |
|||
|
|||
export default withInstall(Breadcrumb, BreadcrumbItem); |
|||
@ -0,0 +1,6 @@ |
|||
import Button from './src/BasicButton.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { Button }; |
|||
|
|||
export default withInstall(Button); |
|||
@ -1,66 +0,0 @@ |
|||
import { VNodeChild } from 'vue'; |
|||
|
|||
export interface BasicButtonProps { |
|||
/** |
|||
* can be set to primary ghost dashed danger(added in 2.7) or omitted (meaning default) |
|||
* @default 'default' |
|||
* @type string |
|||
*/ |
|||
type?: 'primary' | 'danger' | 'dashed' | 'ghost' | 'default'; |
|||
|
|||
/** |
|||
* set the original html type of button |
|||
* @default 'button' |
|||
* @type string |
|||
*/ |
|||
htmlType?: 'button' | 'submit' | 'reset' | 'menu'; |
|||
|
|||
/** |
|||
* set the icon of button |
|||
* @type string |
|||
*/ |
|||
icon?: VNodeChild | JSX.Element; |
|||
|
|||
/** |
|||
* can be set to circle or circle-outline or omitted |
|||
* @type string |
|||
*/ |
|||
shape?: 'circle' | 'circle-outline'; |
|||
|
|||
/** |
|||
* can be set to small large or omitted |
|||
* @default 'default' |
|||
* @type string |
|||
*/ |
|||
size?: 'small' | 'large' | 'default'; |
|||
|
|||
/** |
|||
* set the loading status of button |
|||
* @default false |
|||
* @type boolean | { delay: number } |
|||
*/ |
|||
loading?: boolean | { delay: number }; |
|||
|
|||
/** |
|||
* disabled state of button |
|||
* @default false |
|||
* @type boolean |
|||
*/ |
|||
disabled?: boolean; |
|||
|
|||
/** |
|||
* make background transparent and invert text and border colors, added in 2.7 |
|||
* @default false |
|||
* @type boolean |
|||
*/ |
|||
ghost?: boolean; |
|||
|
|||
/** |
|||
* option to fit button width to its parent width |
|||
* @default false |
|||
* @type boolean |
|||
*/ |
|||
block?: boolean; |
|||
|
|||
onClick?: (e?: Event) => void; |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
import ClickOutSide from './src/index.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { ClickOutSide }; |
|||
|
|||
export default withInstall(ClickOutSide); |
|||
@ -1,5 +1,10 @@ |
|||
export { default as ScrollContainer } from './src/ScrollContainer.vue'; |
|||
export { default as CollapseContainer } from './src/collapse/CollapseContainer.vue'; |
|||
export { default as LazyContainer } from './src/LazyContainer.vue'; |
|||
import ScrollContainer from './src/ScrollContainer.vue'; |
|||
import CollapseContainer from './src/collapse/CollapseContainer.vue'; |
|||
import LazyContainer from './src/LazyContainer.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export * from './src/types.d'; |
|||
export * from './src/types'; |
|||
|
|||
export { ScrollContainer, CollapseContainer, LazyContainer }; |
|||
|
|||
export default withInstall(ScrollContainer, CollapseContainer, LazyContainer); |
|||
|
|||
@ -1,2 +1,3 @@ |
|||
export { createContextMenu, destroyContextMenu } from './src/createContextMenu'; |
|||
|
|||
export * from './src/types'; |
|||
|
|||
@ -1,2 +1,8 @@ |
|||
// Transform vue-count-to to support vue3 version
|
|||
export { default as CountTo } from './src/index.vue'; |
|||
|
|||
import CountTo from './src/index.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { CountTo }; |
|||
|
|||
export default withInstall(CountTo); |
|||
|
|||
@ -1,2 +1,7 @@ |
|||
export { default as Dropdown } from './src/Dropdown'; |
|||
import Dropdown from './src/Dropdown'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export * from './src/types'; |
|||
|
|||
export { Dropdown }; |
|||
export default withInstall(Dropdown); |
|||
|
|||
@ -1,6 +1,12 @@ |
|||
export { default as ImportExcel } from './src/ImportExcel.vue'; |
|||
export { default as ExportExcelModel } from './src/ExportExcelModel.vue'; |
|||
import ImportExcel from './src/ImportExcel.vue'; |
|||
import ExportExcelModel from './src/ExportExcelModel.vue'; |
|||
|
|||
export { jsonToSheetXlsx, aoaToSheetXlsx } from './src/Export2Excel'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export * from './src/types'; |
|||
|
|||
export { jsonToSheetXlsx, aoaToSheetXlsx } from './src/Export2Excel'; |
|||
|
|||
export { ImportExcel, ExportExcelModel }; |
|||
|
|||
export default withInstall(ImportExcel, ExportExcelModel); |
|||
|
|||
@ -1,3 +1,7 @@ |
|||
export { default as MarkDown } from './src/index.vue'; |
|||
import MarkDown from './src/index.vue'; |
|||
|
|||
import { withInstall } from '../util'; |
|||
|
|||
export * from './src/types'; |
|||
export { MarkDown }; |
|||
export default withInstall(MarkDown); |
|||
|
|||
@ -0,0 +1,6 @@ |
|||
import PageFooter from './src/PageFooter.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { PageFooter }; |
|||
|
|||
export default withInstall(PageFooter); |
|||
@ -1,84 +1,6 @@ |
|||
import { PropType } from 'vue'; |
|||
import StrengthMeter from './src/index'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
import { defineComponent, computed, ref, watch, unref, watchEffect } from 'vue'; |
|||
export { StrengthMeter }; |
|||
|
|||
import { Input } from 'ant-design-vue'; |
|||
|
|||
import zxcvbn from 'zxcvbn'; |
|||
import { extendSlots } from '/@/utils/helper/tsxHelper'; |
|||
|
|||
import './index.less'; |
|||
const prefixCls = 'strength-meter'; |
|||
export default defineComponent({ |
|||
name: 'StrengthMeter', |
|||
emits: ['score-change', 'change'], |
|||
props: { |
|||
value: { |
|||
type: String as PropType<string>, |
|||
default: undefined, |
|||
}, |
|||
|
|||
userInputs: { |
|||
type: Array as PropType<string[]>, |
|||
default: () => [], |
|||
}, |
|||
|
|||
showInput: { |
|||
type: Boolean as PropType<boolean>, |
|||
default: true, |
|||
}, |
|||
disabled: { |
|||
type: Boolean as PropType<boolean>, |
|||
default: false, |
|||
}, |
|||
}, |
|||
setup(props, { emit, attrs, slots }) { |
|||
const innerValueRef = ref(''); |
|||
const getPasswordStrength = computed(() => { |
|||
const { userInputs, disabled } = props; |
|||
if (disabled) return null; |
|||
const innerValue = unref(innerValueRef); |
|||
const score = innerValue |
|||
? zxcvbn(unref(innerValueRef), (userInputs as string[]) || null).score |
|||
: null; |
|||
emit('score-change', score); |
|||
return score; |
|||
}); |
|||
|
|||
function handleChange(e: ChangeEvent) { |
|||
innerValueRef.value = e.target.value; |
|||
} |
|||
|
|||
watchEffect(() => { |
|||
innerValueRef.value = props.value || ''; |
|||
}); |
|||
watch( |
|||
() => unref(innerValueRef), |
|||
(val) => { |
|||
emit('change', val); |
|||
} |
|||
); |
|||
|
|||
return () => { |
|||
const { showInput, disabled } = props; |
|||
return ( |
|||
<div class={prefixCls}> |
|||
{showInput && ( |
|||
<Input.Password |
|||
{...attrs} |
|||
allowClear={true} |
|||
value={unref(innerValueRef)} |
|||
onChange={handleChange} |
|||
disabled={disabled} |
|||
> |
|||
{extendSlots(slots)} |
|||
</Input.Password> |
|||
)} |
|||
<div class={`${prefixCls}-bar`}> |
|||
<div class={`${prefixCls}-bar__fill`} data-score={unref(getPasswordStrength)}></div> |
|||
</div> |
|||
</div> |
|||
); |
|||
}; |
|||
}, |
|||
}); |
|||
export default withInstall(StrengthMeter); |
|||
|
|||
@ -1,4 +1,4 @@ |
|||
@import (reference) '../../design/index.less'; |
|||
@import (reference) '../../../design/index.less'; |
|||
|
|||
.strength-meter { |
|||
position: relative; |
|||
@ -0,0 +1,77 @@ |
|||
import './index.less'; |
|||
|
|||
import { PropType } from 'vue'; |
|||
|
|||
import { defineComponent, computed, ref, watch, unref, watchEffect } from 'vue'; |
|||
|
|||
import { Input } from 'ant-design-vue'; |
|||
|
|||
import zxcvbn from 'zxcvbn'; |
|||
import { extendSlots } from '/@/utils/helper/tsxHelper'; |
|||
import { propTypes } from '/@/utils/propTypes'; |
|||
|
|||
const prefixCls = 'strength-meter'; |
|||
export default defineComponent({ |
|||
name: 'StrengthMeter', |
|||
props: { |
|||
value: propTypes.string, |
|||
|
|||
userInputs: { |
|||
type: Array as PropType<string[]>, |
|||
default: () => [], |
|||
}, |
|||
|
|||
showInput: propTypes.bool.def(true), |
|||
disabled: propTypes.bool, |
|||
}, |
|||
emits: ['score-change', 'change'], |
|||
setup(props, { emit, attrs, slots }) { |
|||
const innerValueRef = ref(''); |
|||
const getPasswordStrength = computed(() => { |
|||
const { userInputs, disabled } = props; |
|||
if (disabled) return null; |
|||
const innerValue = unref(innerValueRef); |
|||
const score = innerValue |
|||
? zxcvbn(unref(innerValueRef), (userInputs as string[]) || null).score |
|||
: null; |
|||
emit('score-change', score); |
|||
return score; |
|||
}); |
|||
|
|||
function handleChange(e: ChangeEvent) { |
|||
innerValueRef.value = e.target.value; |
|||
} |
|||
|
|||
watchEffect(() => { |
|||
innerValueRef.value = props.value || ''; |
|||
}); |
|||
watch( |
|||
() => unref(innerValueRef), |
|||
(val) => { |
|||
emit('change', val); |
|||
} |
|||
); |
|||
|
|||
return () => { |
|||
const { showInput, disabled } = props; |
|||
return ( |
|||
<div class={prefixCls}> |
|||
{showInput && ( |
|||
<Input.Password |
|||
{...attrs} |
|||
allowClear={true} |
|||
value={unref(innerValueRef)} |
|||
onChange={handleChange} |
|||
disabled={disabled} |
|||
> |
|||
{extendSlots(slots)} |
|||
</Input.Password> |
|||
)} |
|||
<div class={`${prefixCls}-bar`}> |
|||
<div class={`${prefixCls}-bar__fill`} data-score={unref(getPasswordStrength)}></div> |
|||
</div> |
|||
</div> |
|||
); |
|||
}; |
|||
}, |
|||
}); |
|||
@ -1 +1,5 @@ |
|||
export { default as Tinymce } from './src/Editor.vue'; |
|||
import Tinymce from './src/Editor.vue'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { Tinymce }; |
|||
export default withInstall(Tinymce); |
|||
|
|||
@ -1,4 +1,9 @@ |
|||
export { default as BasicDragVerify } from './src/DragVerify'; |
|||
export { default as RotateDragVerify } from './src/ImgRotate'; |
|||
import BasicDragVerify from './src/DragVerify'; |
|||
import RotateDragVerify from './src/ImgRotate'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export * from './src/types'; |
|||
|
|||
export { RotateDragVerify, BasicDragVerify }; |
|||
|
|||
export default withInstall(RotateDragVerify, BasicDragVerify); |
|||
|
|||
@ -1 +1,6 @@ |
|||
export { default as VirtualScroll } from './src/index'; |
|||
import VirtualScroll from './src/index'; |
|||
import { withInstall } from '../util'; |
|||
|
|||
export { VirtualScroll }; |
|||
|
|||
export default withInstall(VirtualScroll); |
|||
|
|||
@ -0,0 +1,40 @@ |
|||
import { CSSProperties, VNodeChild } from 'vue'; |
|||
import { createTypes, VueTypeValidableDef, VueTypesInterface } from 'vue-types'; |
|||
|
|||
type VueNode = VNodeChild | JSX.Element; |
|||
|
|||
type PropTypes = VueTypesInterface & { |
|||
readonly style: VueTypeValidableDef<CSSProperties>; |
|||
readonly VNodeChild: VueTypeValidableDef<VueNode>; |
|||
// readonly trueBool: VueTypeValidableDef<boolean>;
|
|||
}; |
|||
|
|||
const propTypes = createTypes({ |
|||
func: undefined, |
|||
bool: undefined, |
|||
string: undefined, |
|||
number: undefined, |
|||
object: undefined, |
|||
integer: undefined, |
|||
}) as PropTypes; |
|||
|
|||
propTypes.extend([ |
|||
{ |
|||
name: 'style', |
|||
getter: true, |
|||
type: [String, Object], |
|||
default: undefined, |
|||
}, |
|||
{ |
|||
name: 'VNodeChild', |
|||
getter: true, |
|||
type: undefined, |
|||
}, |
|||
// {
|
|||
// name: 'trueBool',
|
|||
// getter: true,
|
|||
// type: Boolean,
|
|||
// default: true,
|
|||
// },
|
|||
]); |
|||
export { propTypes }; |
|||
Loading…
Reference in new issue