@aplus-frontend/ui 0.0.1-beta.5 → 0.0.1-beta.7
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/es/index.mjs +114 -83
- package/es/src/ap-action/constant.d.ts +0 -0
- package/es/src/ap-action/group/index.vue.d.ts +38 -0
- package/es/src/ap-action/group/index.vue.mjs +64 -0
- package/es/src/ap-action/group/index.vue2.mjs +4 -0
- package/es/src/ap-action/index.d.ts +14 -0
- package/es/src/ap-action/index.mjs +17 -0
- package/es/src/ap-action/interface.d.ts +81 -0
- package/es/src/ap-action/item/index.vue.d.ts +44 -0
- package/es/src/ap-action/item/index.vue.mjs +49 -0
- package/es/src/ap-action/item/index.vue2.mjs +4 -0
- package/es/src/ap-action/item-dropdown/index.vue.d.ts +57 -0
- package/es/src/ap-action/item-dropdown/index.vue.mjs +92 -0
- package/es/src/ap-action/item-dropdown/index.vue2.mjs +4 -0
- package/es/src/ap-action/item-modal/index.vue.d.ts +41 -0
- package/es/src/ap-action/item-modal/index.vue.mjs +34 -0
- package/es/src/ap-action/item-modal/index.vue2.mjs +4 -0
- package/es/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/es/src/ap-action/item-popconfirm/index.vue.mjs +37 -0
- package/es/src/ap-action/item-popconfirm/index.vue2.mjs +4 -0
- package/es/src/ap-action/style/item-dropdown.css +11 -0
- package/es/src/ap-action/style/item.css +28 -0
- package/es/src/ap-field/checkbox/helper.mjs +5 -0
- package/es/src/ap-field/checkbox/index.vue.d.ts +39 -0
- package/es/src/ap-field/checkbox/index.vue.mjs +56 -0
- package/es/src/ap-field/checkbox/index.vue2.mjs +4 -0
- package/es/src/ap-field/date/constant.mjs +50 -0
- package/es/src/ap-field/date/helper.d.ts +2 -0
- package/es/src/ap-field/date/helper.mjs +10 -0
- package/es/src/ap-field/date/index.vue.d.ts +57 -0
- package/es/src/ap-field/date/index.vue.mjs +75 -0
- package/es/src/ap-field/date/index.vue2.mjs +4 -0
- package/es/src/ap-field/date-range/index.vue.d.ts +59 -0
- package/es/src/ap-field/date-range/index.vue.mjs +87 -0
- package/es/src/ap-field/date-range/index.vue2.mjs +4 -0
- package/es/src/ap-field/index.d.ts +9 -3
- package/es/src/ap-field/interface.d.ts +65 -5
- package/es/src/ap-field/number/helper.d.ts +1 -0
- package/es/src/ap-field/number/helper.mjs +14 -0
- package/es/src/ap-field/number/index.vue.d.ts +72 -0
- package/es/src/ap-field/number/index.vue.mjs +108 -0
- package/es/src/ap-field/number/index.vue2.mjs +4 -0
- package/es/src/ap-field/number/style.css +6 -0
- package/es/src/ap-field/radio/helper.d.ts +4 -0
- package/es/src/ap-field/radio/helper.mjs +5 -0
- package/es/src/ap-field/radio/index.vue.d.ts +40 -0
- package/es/src/ap-field/radio/index.vue.mjs +68 -0
- package/es/src/ap-field/radio/index.vue2.mjs +4 -0
- package/es/src/ap-field/select/index.vue.d.ts +235 -0
- package/es/src/ap-field/select/index.vue.mjs +114 -0
- package/es/src/ap-field/select/index.vue2.mjs +4 -0
- package/es/src/ap-field/switch/index.vue.d.ts +54 -0
- package/es/src/ap-field/switch/index.vue.mjs +122 -0
- package/es/src/ap-field/switch/index.vue2.mjs +4 -0
- package/es/src/ap-field/text/index.vue.d.ts +63 -0
- package/es/src/ap-field/text/index.vue.mjs +132 -0
- package/es/src/ap-field/text/index.vue2.mjs +4 -0
- package/es/src/ap-field/text-area/index.vue.d.ts +49 -0
- package/es/src/ap-field/text-area/index.vue.mjs +86 -0
- package/es/src/ap-field/text-area/index.vue2.mjs +4 -0
- package/es/src/ap-field/text-area/style.css +5 -0
- package/es/src/ap-form/index.d.ts +64 -64
- package/es/src/base-button/index.d.ts +28 -28
- package/es/src/basic/help.vue.d.ts +1 -1
- package/es/src/basic/index.d.ts +3 -3
- package/es/src/config-provider/config-provider.d.ts +2 -2
- package/es/src/config-provider/index.d.ts +6 -6
- package/es/src/count-down/index.d.ts +12 -12
- package/es/src/cropper/cropper-avatar.vue.d.ts +1 -1
- package/es/src/cropper/cropper-image.vue.d.ts +1 -1
- package/es/src/cropper/index.d.ts +42 -42
- package/es/src/description/description.vue.d.ts +1 -1
- package/es/src/description/index.d.ts +3 -3
- package/es/src/design-token/index.d.ts +4 -0
- package/es/src/design-token/index.mjs +59 -0
- package/es/src/dropdown/dropdown.vue.d.ts +1 -1
- package/es/src/dropdown/index.d.ts +7 -7
- package/es/src/icon/index.d.ts +41 -41
- package/es/src/icon-picker/icon-picker.vue.d.ts +3 -3
- package/es/src/icon-picker/index.d.ts +45 -45
- package/es/src/index.d.ts +3 -0
- package/es/src/index.mjs +121 -90
- package/es/src/modal/basic.vue.d.ts +3 -2
- package/es/src/modal/basic.vue.mjs +53 -49
- package/es/src/modal/components/modal-footer.vue.d.ts +1 -1
- package/es/src/modal/components/modal.d.ts +1 -1
- package/es/src/modal/index.d.ts +7 -8
- package/es/src/modal/index.mjs +2 -3
- package/es/src/modal/props.mjs +1 -1
- package/es/src/modal/style/index.css +29 -30
- package/es/src/pro-form/components/api-radio-group.vue.d.ts +1 -1
- package/es/src/pro-form/components/api-select.vue.d.ts +2 -2
- package/es/src/pro-form/components/api-tree.vue.d.ts +1 -1
- package/es/src/pro-form/hooks/use-form-events.mjs +22 -22
- package/es/src/pro-form/hooks/use-form-values.mjs +12 -12
- package/es/src/pro-form/hooks/use-label-width.d.ts +5 -5
- package/es/src/pro-form/pro-form.vue.d.ts +1 -1
- package/es/src/pro-form/pro-form.vue.mjs +23 -23
- package/es/src/pro-table/hooks/use-columns.mjs +24 -24
- package/es/src/strength-meter/index.d.ts +12 -12
- package/es/src/theme/ap-action/item-dropdown.css +11 -0
- package/es/src/theme/ap-action/item.css +28 -0
- package/es/src/theme/ap-field/number.css +6 -0
- package/es/src/theme/ap-field/text-area.css +5 -0
- package/es/src/theme/modal/index.css +29 -30
- package/es/src/type.d.ts +3 -1
- package/es/src/utils/index.d.ts +7 -0
- package/lib/index.js +1 -1
- package/lib/src/ap-action/constant.d.ts +0 -0
- package/lib/src/ap-action/group/index.vue.d.ts +38 -0
- package/lib/src/ap-action/group/index.vue.js +1 -0
- package/lib/src/ap-action/group/index.vue2.js +1 -0
- package/lib/src/ap-action/index.d.ts +14 -0
- package/lib/src/ap-action/index.js +1 -0
- package/lib/src/ap-action/interface.d.ts +81 -0
- package/lib/src/ap-action/item/index.vue.d.ts +44 -0
- package/lib/src/ap-action/item/index.vue.js +1 -0
- package/lib/src/ap-action/item/index.vue2.js +1 -0
- package/lib/src/ap-action/item-dropdown/index.vue.d.ts +57 -0
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -0
- package/lib/src/ap-action/item-dropdown/index.vue2.js +1 -0
- package/lib/src/ap-action/item-modal/index.vue.d.ts +41 -0
- package/lib/src/ap-action/item-modal/index.vue.js +1 -0
- package/lib/src/ap-action/item-modal/index.vue2.js +1 -0
- package/lib/src/ap-action/item-popconfirm/index.vue.d.ts +343 -0
- package/lib/src/ap-action/item-popconfirm/index.vue.js +1 -0
- package/lib/src/ap-action/item-popconfirm/index.vue2.js +1 -0
- package/lib/src/ap-action/style/item-dropdown.css +11 -0
- package/lib/src/ap-action/style/item.css +28 -0
- package/lib/src/ap-field/checkbox/helper.js +1 -0
- package/lib/src/ap-field/checkbox/index.vue.d.ts +39 -0
- package/lib/src/ap-field/checkbox/index.vue.js +1 -0
- package/lib/src/ap-field/checkbox/index.vue2.js +1 -0
- package/lib/src/ap-field/date/constant.js +1 -0
- package/lib/src/ap-field/date/helper.d.ts +2 -0
- package/lib/src/ap-field/date/helper.js +1 -0
- package/lib/src/ap-field/date/index.vue.d.ts +57 -0
- package/lib/src/ap-field/date/index.vue.js +1 -0
- package/lib/src/ap-field/date/index.vue2.js +1 -0
- package/lib/src/ap-field/date-range/index.vue.d.ts +59 -0
- package/lib/src/ap-field/date-range/index.vue.js +1 -0
- package/lib/src/ap-field/date-range/index.vue2.js +1 -0
- package/lib/src/ap-field/index.d.ts +9 -3
- package/lib/src/ap-field/interface.d.ts +65 -5
- package/lib/src/ap-field/number/helper.d.ts +1 -0
- package/lib/src/ap-field/number/helper.js +1 -0
- package/lib/src/ap-field/number/index.vue.d.ts +72 -0
- package/lib/src/ap-field/number/index.vue.js +1 -0
- package/lib/src/ap-field/number/index.vue2.js +1 -0
- package/lib/src/ap-field/number/style.css +6 -0
- package/lib/src/ap-field/radio/helper.d.ts +4 -0
- package/lib/src/ap-field/radio/helper.js +1 -0
- package/lib/src/ap-field/radio/index.vue.d.ts +40 -0
- package/lib/src/ap-field/radio/index.vue.js +1 -0
- package/lib/src/ap-field/radio/index.vue2.js +1 -0
- package/lib/src/ap-field/select/index.vue.d.ts +235 -0
- package/lib/src/ap-field/select/index.vue.js +1 -0
- package/lib/src/ap-field/select/index.vue2.js +1 -0
- package/lib/src/ap-field/switch/index.vue.d.ts +54 -0
- package/lib/src/ap-field/switch/index.vue.js +1 -0
- package/lib/src/ap-field/switch/index.vue2.js +1 -0
- package/lib/src/ap-field/text/index.vue.d.ts +63 -0
- package/lib/src/ap-field/text/index.vue.js +1 -0
- package/lib/src/ap-field/text/index.vue2.js +1 -0
- package/lib/src/ap-field/text-area/index.vue.d.ts +49 -0
- package/lib/src/ap-field/text-area/index.vue.js +1 -0
- package/lib/src/ap-field/text-area/index.vue2.js +1 -0
- package/lib/src/ap-field/text-area/style.css +5 -0
- package/lib/src/ap-form/index.d.ts +64 -64
- package/lib/src/base-button/index.d.ts +28 -28
- package/lib/src/basic/help.vue.d.ts +1 -1
- package/lib/src/basic/index.d.ts +3 -3
- package/lib/src/config-provider/config-provider.d.ts +2 -2
- package/lib/src/config-provider/index.d.ts +6 -6
- package/lib/src/count-down/index.d.ts +12 -12
- package/lib/src/cropper/cropper-avatar.vue.d.ts +1 -1
- package/lib/src/cropper/cropper-image.vue.d.ts +1 -1
- package/lib/src/cropper/index.d.ts +42 -42
- package/lib/src/description/description.vue.d.ts +1 -1
- package/lib/src/description/index.d.ts +3 -3
- package/lib/src/design-token/index.d.ts +4 -0
- package/lib/src/design-token/index.js +1 -0
- package/lib/src/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/src/dropdown/index.d.ts +7 -7
- package/lib/src/icon/index.d.ts +41 -41
- package/lib/src/icon-picker/icon-picker.vue.d.ts +3 -3
- package/lib/src/icon-picker/index.d.ts +45 -45
- package/lib/src/index.d.ts +3 -0
- package/lib/src/index.js +1 -1
- package/lib/src/modal/basic.vue.d.ts +3 -2
- package/lib/src/modal/basic.vue.js +1 -1
- package/lib/src/modal/components/modal-footer.vue.d.ts +1 -1
- package/lib/src/modal/components/modal.d.ts +1 -1
- package/lib/src/modal/index.d.ts +7 -8
- package/lib/src/modal/index.js +1 -1
- package/lib/src/modal/props.js +1 -1
- package/lib/src/modal/style/index.css +29 -30
- package/lib/src/pro-form/components/api-radio-group.vue.d.ts +1 -1
- package/lib/src/pro-form/components/api-select.vue.d.ts +2 -2
- package/lib/src/pro-form/components/api-tree.vue.d.ts +1 -1
- package/lib/src/pro-form/hooks/use-form-events.js +1 -1
- package/lib/src/pro-form/hooks/use-form-values.js +1 -1
- package/lib/src/pro-form/hooks/use-label-width.d.ts +5 -5
- package/lib/src/pro-form/pro-form.vue.d.ts +1 -1
- package/lib/src/pro-form/pro-form.vue.js +1 -1
- package/lib/src/pro-table/hooks/use-columns.js +1 -1
- package/lib/src/strength-meter/index.d.ts +12 -12
- package/lib/src/theme/ap-action/item-dropdown.css +11 -0
- package/lib/src/theme/ap-action/item.css +28 -0
- package/lib/src/theme/ap-field/number.css +6 -0
- package/lib/src/theme/ap-field/text-area.css +5 -0
- package/lib/src/theme/modal/index.css +29 -30
- package/lib/src/type.d.ts +3 -1
- package/lib/src/utils/index.d.ts +7 -0
- package/package.json +3 -3
|
@@ -110,7 +110,7 @@ export declare function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsR
|
|
|
110
110
|
contextmenu?: string | undefined;
|
|
111
111
|
dir?: string | undefined;
|
|
112
112
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
113
|
-
hidden?: "" |
|
|
113
|
+
hidden?: "" | (boolean | "true" | "false") | "hidden" | "until-found" | undefined;
|
|
114
114
|
id?: string | undefined;
|
|
115
115
|
inert?: (boolean | "true" | "false") | undefined;
|
|
116
116
|
lang?: string | undefined;
|
|
@@ -141,11 +141,11 @@ export declare function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsR
|
|
|
141
141
|
results?: (string | number) | undefined;
|
|
142
142
|
security?: string | undefined;
|
|
143
143
|
unselectable?: "on" | "off" | undefined;
|
|
144
|
-
inputmode?: "text" | "search" | "
|
|
144
|
+
inputmode?: "text" | "search" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
|
|
145
145
|
is?: string | undefined;
|
|
146
146
|
'aria-activedescendant'?: string | undefined;
|
|
147
147
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
148
|
-
'aria-autocomplete'?: "
|
|
148
|
+
'aria-autocomplete'?: "inline" | "none" | "both" | "list" | undefined;
|
|
149
149
|
'aria-busy'?: (boolean | "true" | "false") | undefined;
|
|
150
150
|
'aria-checked'?: (boolean | "true" | "false") | "mixed" | undefined;
|
|
151
151
|
'aria-colcount'?: (string | number) | undefined;
|
|
@@ -156,12 +156,12 @@ export declare function useItemLabelWidth(schemaItemRef: Ref<FormSchema>, propsR
|
|
|
156
156
|
'aria-describedby'?: string | undefined;
|
|
157
157
|
'aria-details'?: string | undefined;
|
|
158
158
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
159
|
-
'aria-dropeffect'?: "
|
|
159
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
|
|
160
160
|
'aria-errormessage'?: string | undefined;
|
|
161
161
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
162
162
|
'aria-flowto'?: string | undefined;
|
|
163
163
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
164
|
-
'aria-haspopup'?: "
|
|
164
|
+
'aria-haspopup'?: "menu" | "dialog" | (boolean | "true" | "false") | "grid" | "listbox" | "tree" | undefined;
|
|
165
165
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
166
166
|
'aria-invalid'?: (boolean | "true" | "false") | "grammar" | "spelling" | undefined;
|
|
167
167
|
'aria-keyshortcuts'?: string | undefined;
|
|
@@ -66,7 +66,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
|
|
|
66
66
|
"onAdvanced-change"?: ((...args: any[]) => any) | undefined;
|
|
67
67
|
"onField-value-change"?: ((...args: any[]) => any) | undefined;
|
|
68
68
|
}, {
|
|
69
|
-
size: "
|
|
69
|
+
size: "default" | "small" | "large";
|
|
70
70
|
layout: "inline" | "horizontal" | "vertical";
|
|
71
71
|
labelWidth: string | number;
|
|
72
72
|
rulesMessageJoinLabel: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("ant-design-vue"),oe=require("./components/form-item.vue.js"),re=require("./components/form-action.vue.js"),R=require("./helper.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("ant-design-vue"),oe=require("./components/form-item.vue.js"),re=require("./components/form-action.vue.js"),R=require("./helper.js"),y=require("dayjs"),ne=require("@aplus-frontend/utils"),ae=require("./hooks/use-form-values.js"),se=require("./hooks/use-advanced.js"),ue=require("./hooks/use-form-events.js"),le=require("./hooks/use-form-context.js"),ce=require("./hooks/use-auto-focus.js");require("../modal/index.js");const ie=require("@vueuse/core"),fe=require("lodash-unified");require("../config-provider/index.js");require("./style/index.css");const de=require("../modal/hooks/use-modal-context.js"),me=require("../config-provider/hooks/use-namespace.js"),pe=e.defineComponent({name:"BasicForm",__name:"pro-form",props:{name:{},layout:{default:"horizontal"},model:{default:()=>({})},labelWidth:{default:0},labelAlign:{},rowProps:{},submitOnReset:{type:Boolean},submitOnChange:{type:Boolean},labelCol:{},wrapperCol:{},baseRowStyle:{},baseColProps:{},schemas:{default:()=>[]},mergeDynamicData:{},compact:{type:Boolean},emptySpan:{default:0},size:{default:"default"},disabled:{type:Boolean},readonly:{type:Boolean},fieldMapToTime:{default:()=>[]},autoSetPlaceHolder:{type:Boolean,default:!0},autoSubmitOnEnter:{type:Boolean,default:!1},rulesMessageJoinLabel:{type:Boolean,default:!0},showAdvancedButton:{type:Boolean},autoFocusFirstItem:{type:Boolean},autoAdvancedLine:{default:3},alwaysShowLines:{default:1},showActionButtonGroup:{type:Boolean,default:!0},resetButtonOptions:{},submitButtonOptions:{},actionColOptions:{},showResetButton:{type:Boolean,default:!0},showSubmitButton:{type:Boolean,default:!0},resetFunc:{},submitFunc:{},transformDateFunc:{type:Function,default:a=>{var f;return((f=a==null?void 0:a.format)==null?void 0:f.call(a,"YYYY-MM-DD HH:mm:ss"))??a}},colon:{type:Boolean},tableAction:{}},emits:["advanced-change","reset","submit","register","field-value-change"],setup(a,{expose:f,emit:T}){const d=a,m=T,E=e.useAttrs(),s=e.reactive({}),i=de.useModalContext(),F=e.reactive({isAdvanced:!0,hideAdvanceBtn:!1,isLoad:!1,actionSpan:6}),p=e.ref({}),h=e.ref(!1),B=e.ref(),S=e.ref(null),b=e.ref(null),{b:k,m:O}=me.useNamespace("basic-form"),n=e.computed(()=>({...d,...e.unref(B)})),L=e.computed(()=>[k(),{[O("compact")]:e.unref(n).compact}]),I=e.computed(()=>{const{baseRowStyle:t={},rowProps:r}=e.unref(n);return{style:t,...r}}),H=e.computed(()=>({...E,...d,...e.unref(n)})),l=e.computed(()=>{const t=fe.cloneDeep(e.unref(S)||e.unref(n).schemas);for(const r of t){const{defaultValue:o,component:u,componentProps:c={},isHandleDateDefaultValue:ee=!0}=r;if(ee&&o&&u&&R.dateItemType.includes(u)){const te={schema:r,tableAction:d.tableAction??{},formModel:s,formActionType:{}},g=c?typeof c=="function"?c(te).valueFormat:c.valueFormat:null;if(!Array.isArray(o))r.defaultValue=g?y(o).format(g):y(o);else{const V=[];o.forEach(M=>{V.push(g?y(M).format(g):y(M))}),r.defaultValue=V}}}return e.unref(n).showAdvancedButton?t.filter(r=>!R.isIncludeSimpleComponents(r.component)):t}),{handleToggleAdvanced:N,fieldsIsAdvancedMap:x}=se.default({advanceState:F,emit:m,getProps:n,getSchema:l,formModel:s,defaultValueRef:p}),{handleFormValues:$,initDefault:w}=ae.useFormValues({getProps:n,defaultValueRef:p,getSchema:l,formModel:s});ce.useAutoFocus({getSchema:l,getProps:n,isInitedDefault:h,formElRef:b});const{handleSubmit:v,setFieldsValue:P,clearValidate:z,validate:Y,validateFields:_,getFieldsValue:j,updateSchema:U,resetSchema:q,appendSchemaByField:K,removeSchemaByField:G,resetFields:C,scrollToField:J}=ue.useFormEvents({emit:m,getProps:n,formModel:s,getSchema:l,defaultValueRef:p,formElRef:b,schemaRef:S,handleFormValues:$});le.createFormContext({resetAction:C,submitAction:v}),e.watch(()=>e.unref(n).model,()=>{const{model:t}=e.unref(n);t&&P(t)},{immediate:!0}),e.watch(()=>d.schemas,t=>{q(t??[])}),e.watch(()=>l.value,t=>{e.nextTick(()=>{var r;(r=i==null?void 0:i.redoModalHeight)==null||r.call(i)}),!e.unref(h)&&t!=null&&t.length&&(w(),h.value=!0)}),e.watch(()=>s,ie.useDebounceFn(()=>{e.unref(n).submitOnChange&&v()},300),{deep:!0});async function W(t){B.value=ne.deepMerge(e.unref(B)||{},t)}function Q(t,r,o){s[t]=r,m("field-value-change",t,r),o&&o.itemProps&&!o.itemProps.autoLink&&_([t]).catch(u=>{})}function X(t){const{autoSubmitOnEnter:r}=e.unref(n);if(r&&t.key==="Enter"&&t.target&&t.target instanceof HTMLElement){const o=t.target;o&&o.tagName&&o.tagName.toUpperCase()=="INPUT"&&v()}}const A={getFieldsValue:j,setFieldsValue:P,resetFields:C,updateSchema:U,resetSchema:q,setProps:W,removeSchemaByField:G,appendSchemaByField:K,clearValidate:z,validateFields:_,validate:Y,submit:v,scrollToField:J},Z=e.computed(()=>({...n.value,...F}));return f({...A}),e.onMounted(()=>{w(),m("register",A)}),(t,r)=>(e.openBlock(),e.createBlock(e.unref(D.Form),e.mergeProps(H.value,{class:L.value,ref_key:"formElRef",ref:b,model:s,onKeypress:e.withKeys(X,["enter"])}),{default:e.withCtx(()=>[e.createVNode(e.unref(D.Row),e.normalizeProps(e.guardReactiveProps(I.value)),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"formHeader"),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,o=>(e.openBlock(),e.createBlock(oe.default,{key:o.field,isAdvanced:e.unref(x)[o.field],tableAction:t.tableAction,formActionType:A,schema:o,formProps:n.value,allDefaultValues:p.value,formModel:s,setFormModel:Q},e.createSlots({_:2},[e.renderList(Object.keys(t.$slots),u=>({name:u,fn:e.withCtx(c=>[e.renderSlot(t.$slots,u,e.mergeProps({ref_for:!0},c||{}))])}))]),1032,["isAdvanced","tableAction","schema","formProps","allDefaultValues","formModel"]))),128)),e.createVNode(re.default,e.mergeProps(Z.value,{onToggleAdvanced:e.unref(N)}),e.createSlots({_:2},[e.renderList(["resetBefore","submitBefore","advanceBefore","advanceAfter"],o=>({name:o,fn:e.withCtx(u=>[e.renderSlot(t.$slots,o,e.normalizeProps(e.guardReactiveProps(u||{})))])}))]),1040,["onToggleAdvanced"]),e.renderSlot(t.$slots,"formFooter")]),_:3},16)]),_:3},16,["class","model"]))}});exports.default=pe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue"),j=require("../components/editable/index.js"),a=require("lodash-unified"),_=require("../const.js"),P=require("dayjs");require("../../config-provider/index.js");const X=require("../../config-provider/hooks/use-global-config.js"),B=require("../../config-provider/hooks/use-locale.js");function p(t,r){const{key:l,dataIndex:c,children:d}=t;t.align=t.align||_.DEFAULT_ALIGN,r&&(l||(t.key=typeof c=="object"?c.join("-"):c),a.isBoolean(t.ellipsis)||Object.assign(t,{ellipsis:r})),d&&d.length&&y(d,!!r)}function y(t,r){t&&t.forEach(l=>{const{children:c}=l;p(l,r),y(c,r)})}function k(t,r){const{actionColumn:l}=f.unref(t);if(!l)return;const c=r.findIndex(d=>d.flag===_.ACTION_COLUMN_FLAG);c===-1&&r.push({...r[c],fixed:"right",...l,flag:_.ACTION_COLUMN_FLAG})}function z(t,r){const l=X.useGlobalConfig(),{t:c}=B.useLocale(),d=l.value.table.defaultPageSize,x=l.value.table.permissionValidator,g=f.ref(f.unref(t).columns);let u=f.unref(t).columns;const O=f.computed(()=>{const e=a.cloneDeep(f.unref(g));if(b(t,r,e),k(t,e),!e)return[];const{ellipsis:n}=f.unref(t);return e.forEach(s=>{const{customRender:o,slots:i}=s;p(s,Reflect.has(s,"ellipsis")?!!s.ellipsis:!!n&&!o&&!i)}),e});function w(e){const n=e.ifShow;let s=!0;return a.isBoolean(n)&&(s=n),a.isFunction(n)&&(s=n(e)),s}const S=f.computed(()=>{const e=m(f.unref(O)),n=o=>{const{slots:i,customRender:I,format:h,edit:A,editRow:C,flag:L}=o;(!i||!(i!=null&&i.title))&&(o.customTitle=o.title);const F=[_.INDEX_COLUMN_FLAG,_.ACTION_COLUMN_FLAG].includes(L);return!I&&h&&!A&&!F&&(o.customRender=({text:N,record:q,index:R})=>E(N,h,q,R)),(A||C)&&!F&&(o.customRender=j.renderEditCell(o)),f.reactive(o)};return a.cloneDeep(e).filter(o=>x(o.auth)&&w(o)).map(o=>{var i;return(i=o.children)!=null&&i.length&&(o.children=o.children.map(n)),n(o)})});f.watch(()=>f.unref(t).columns,e=>{g.value=e,u=(e==null?void 0:e.filter(n=>!n.flag))??[]});function b(e,n,s){const{showIndexColumn:o,indexColumnProps:i,isTreeTable:I}=f.unref(e);let h=!1;if(f.unref(I)||(s.forEach(()=>{const C=s.findIndex(L=>L.flag===_.INDEX_COLUMN_FLAG);o?h=C===-1:!o&&C!==-1&&s.splice(C,1)}),!h))return;const A=s.some(C=>C.fixed==="left");s.unshift({flag:_.INDEX_COLUMN_FLAG,width:60,title:c("ap.table.index"),align:"center",customRender:({index:C})=>{const L=f.unref(n);if(a.isBoolean(L))return`${C+1}`;const{current:F=1,pageSize:N=d}=L;return((F<1?1:F)-1)*N+C+1},...A?{fixed:"left"}:{},...i})}function G(e,n){!e||!n||u.forEach(s=>{if(s.dataIndex===e){Object.assign(s,n);return}})}function v(e){const n=a.cloneDeep(e);if(!a.isArray(n))return;if(n.length<=0){g.value=[];return}const s=n[0],o=u.map(i=>i.dataIndex);if(!a.isString(s)&&!a.isArray(s))g.value=n;else{const i=n.map(h=>h.toString()),I=[];u.forEach(h=>{var A;I.push({...h,defaultHidden:!i.includes(((A=h.dataIndex)==null?void 0:A.toString())||h.key)})}),a.isEqual(o,n)||I.sort((h,A)=>{var C,L;return i.indexOf((C=h.dataIndex)==null?void 0:C.toString())-i.indexOf((L=A.dataIndex)==null?void 0:L.toString())}),g.value=I}}function M(e){const{ignoreIndex:n,ignoreAction:s,sort:o}=e||{};let i=f.toRaw(f.unref(O));return n&&(i=i.filter(I=>I.flag!==_.INDEX_COLUMN_FLAG)),s&&(i=i.filter(I=>I.flag!==_.ACTION_COLUMN_FLAG)),o&&(i=m(i)),i}function T(){return u}function D(e){a.isArray(e)&&(u=e.filter(n=>!n.flag))}function U(e,n){n.width=e}return{getColumnsRef:O,getCacheColumns:T,getColumns:M,setColumns:v,setColumnWidth:U,getViewColumns:S,setCacheColumnsByField:G,setCacheColumns:D}}function m(t){const r=[],l=[],c=[];for(const u of t){if(u.fixed==="left"){r.push(u);continue}if(u.fixed==="right"){l.push(u);continue}c.push(u)}const d=u=>!u.defaultHidden,x=[...r,...c,...l].filter(d),g=[...x];for(;g.length;){const u=g[0];Array.isArray(u.children)?(u.children=u.children.filter(d),g.shift(),g.unshift(...u.children)):g.shift()}return x}function E(t,r,l,c){if(!r)return t;if(a.isFunction(r))return r(t,l,c);try{const d="date|";if(a.isString(r)&&r.startsWith(d)&&t){const x=r.replace(d,"");return x?P(t).format(x):t}if(a.isMap(r))return r.get(t)}catch{return t}}exports.formatCell=E;exports.useColumns=z;
|
|
@@ -2,12 +2,12 @@ import { CreateComponentPublicInstance, ExtractPropTypes, PropType, ComponentOpt
|
|
|
2
2
|
export * from './interface';
|
|
3
3
|
export declare const StrengthMeter: {
|
|
4
4
|
new (...args: any[]): CreateComponentPublicInstance<Readonly< ExtractPropTypes<{
|
|
5
|
-
value: {
|
|
6
|
-
type: PropType<string>;
|
|
7
|
-
};
|
|
8
5
|
disabled: {
|
|
9
6
|
type: PropType<boolean>;
|
|
10
7
|
};
|
|
8
|
+
value: {
|
|
9
|
+
type: PropType<string>;
|
|
10
|
+
};
|
|
11
11
|
showInput: {
|
|
12
12
|
type: PropType<boolean>;
|
|
13
13
|
default: boolean;
|
|
@@ -19,12 +19,12 @@ export declare const StrengthMeter: {
|
|
|
19
19
|
change: (...args: any[]) => void;
|
|
20
20
|
"score-change": (...args: any[]) => void;
|
|
21
21
|
}, VNodeProps & AllowedComponentProps & ComponentCustomProps & Readonly< ExtractPropTypes<{
|
|
22
|
-
value: {
|
|
23
|
-
type: PropType<string>;
|
|
24
|
-
};
|
|
25
22
|
disabled: {
|
|
26
23
|
type: PropType<boolean>;
|
|
27
24
|
};
|
|
25
|
+
value: {
|
|
26
|
+
type: PropType<string>;
|
|
27
|
+
};
|
|
28
28
|
showInput: {
|
|
29
29
|
type: PropType<boolean>;
|
|
30
30
|
default: boolean;
|
|
@@ -42,12 +42,12 @@ export declare const StrengthMeter: {
|
|
|
42
42
|
M: {};
|
|
43
43
|
Defaults: {};
|
|
44
44
|
}, Readonly< ExtractPropTypes<{
|
|
45
|
-
value: {
|
|
46
|
-
type: PropType<string>;
|
|
47
|
-
};
|
|
48
45
|
disabled: {
|
|
49
46
|
type: PropType<boolean>;
|
|
50
47
|
};
|
|
48
|
+
value: {
|
|
49
|
+
type: PropType<string>;
|
|
50
|
+
};
|
|
51
51
|
showInput: {
|
|
52
52
|
type: PropType<boolean>;
|
|
53
53
|
default: boolean;
|
|
@@ -62,12 +62,12 @@ export declare const StrengthMeter: {
|
|
|
62
62
|
__isTeleport?: undefined;
|
|
63
63
|
__isSuspense?: undefined;
|
|
64
64
|
} & ComponentOptionsBase<Readonly< ExtractPropTypes<{
|
|
65
|
-
value: {
|
|
66
|
-
type: PropType<string>;
|
|
67
|
-
};
|
|
68
65
|
disabled: {
|
|
69
66
|
type: PropType<boolean>;
|
|
70
67
|
};
|
|
68
|
+
value: {
|
|
69
|
+
type: PropType<string>;
|
|
70
|
+
};
|
|
71
71
|
showInput: {
|
|
72
72
|
type: PropType<boolean>;
|
|
73
73
|
default: boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.aplus-action-item {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
font-size: 14px;
|
|
4
|
+
line-height: 22px;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
.aplus-action-item--primary {
|
|
8
|
+
color: #0070ff;
|
|
9
|
+
}
|
|
10
|
+
.aplus-action-item--success {
|
|
11
|
+
color: #2ed1a3;
|
|
12
|
+
}
|
|
13
|
+
.aplus-action-item--error {
|
|
14
|
+
color: #FF4D4F;
|
|
15
|
+
}
|
|
16
|
+
.aplus-action-item--warn {
|
|
17
|
+
color: #FFA940;
|
|
18
|
+
}
|
|
19
|
+
.aplus-action-item--loading {
|
|
20
|
+
opacity: 0.35;
|
|
21
|
+
transition: opacity 0.2s;
|
|
22
|
+
}
|
|
23
|
+
.aplus-action-item--loading .btn-loading-icon {
|
|
24
|
+
margin-right: 4px;
|
|
25
|
+
}
|
|
26
|
+
.aplus-action-item--disabled {
|
|
27
|
+
color: #ABB7CC;
|
|
28
|
+
}
|
|
@@ -14,48 +14,50 @@
|
|
|
14
14
|
.fullscreen-modal .ant-modal-footer {
|
|
15
15
|
margin-top: 0;
|
|
16
16
|
}
|
|
17
|
-
.
|
|
17
|
+
.aplus-basic-modal {
|
|
18
18
|
width: 520px;
|
|
19
19
|
padding-bottom: 0;
|
|
20
20
|
}
|
|
21
|
-
.
|
|
22
|
-
padding:
|
|
21
|
+
.aplus-basic-modal .ant-modal-body > .aplus-scrollbar {
|
|
22
|
+
padding: 20px;
|
|
23
|
+
padding-bottom: 0;
|
|
23
24
|
}
|
|
24
|
-
.ant-modal-title {
|
|
25
|
+
.aplus-basic-modal .ant-modal-title {
|
|
25
26
|
font-size: 16px;
|
|
26
27
|
font-weight: bold;
|
|
27
28
|
}
|
|
28
|
-
.ant-modal-title .
|
|
29
|
+
.aplus-basic-modal .ant-modal-title .aplus-basic-title {
|
|
29
30
|
cursor: move !important;
|
|
31
|
+
padding-left: 0;
|
|
30
32
|
}
|
|
31
|
-
.
|
|
33
|
+
.aplus-basic-modal .ant-modal-body {
|
|
32
34
|
padding: 0;
|
|
33
35
|
}
|
|
34
|
-
.
|
|
36
|
+
.aplus-basic-modal .ant-modal-body > .aplus-scrollbar > .aplus-scrollbar__bar.is-horizontal {
|
|
35
37
|
display: none;
|
|
36
38
|
}
|
|
37
|
-
.ant-modal-large {
|
|
39
|
+
.aplus-basic-modal .ant-modal-large {
|
|
38
40
|
top: 60px;
|
|
39
41
|
}
|
|
40
|
-
.ant-modal-large--mini {
|
|
42
|
+
.aplus-basic-modal .ant-modal-large .ant-modal--mini {
|
|
41
43
|
top: 16px;
|
|
42
44
|
}
|
|
43
|
-
.ant-modal-header {
|
|
44
|
-
padding:
|
|
45
|
+
.aplus-basic-modal .ant-modal-header {
|
|
46
|
+
padding: 15px 20px;
|
|
47
|
+
margin-bottom: 0;
|
|
45
48
|
border-bottom: 1px solid #eee;
|
|
46
49
|
}
|
|
47
|
-
.ant-modal-content {
|
|
50
|
+
.aplus-basic-modal .ant-modal-content {
|
|
48
51
|
padding: 0 !important;
|
|
49
|
-
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 #000000;
|
|
50
52
|
}
|
|
51
|
-
.ant-modal-footer {
|
|
52
|
-
padding:
|
|
53
|
-
|
|
53
|
+
.aplus-basic-modal .ant-modal-footer {
|
|
54
|
+
padding: 20px;
|
|
55
|
+
margin-top: 0;
|
|
54
56
|
}
|
|
55
|
-
.ant-modal-footer button + button {
|
|
57
|
+
.aplus-basic-modal .ant-modal-footer button + button {
|
|
56
58
|
margin-left: 10px;
|
|
57
59
|
}
|
|
58
|
-
.ant-modal-close {
|
|
60
|
+
.aplus-basic-modal .ant-modal-close {
|
|
59
61
|
top: 0 !important;
|
|
60
62
|
right: 0 !important;
|
|
61
63
|
width: auto !important;
|
|
@@ -63,41 +65,38 @@
|
|
|
63
65
|
background: transparent !important;
|
|
64
66
|
font-weight: normal;
|
|
65
67
|
}
|
|
66
|
-
.ant-modal-close-x {
|
|
68
|
+
.aplus-basic-modal .ant-modal-close-x {
|
|
67
69
|
display: inline-block;
|
|
68
70
|
width: 96px;
|
|
69
71
|
height: 56px;
|
|
70
72
|
line-height: 56px !important;
|
|
71
73
|
}
|
|
72
|
-
.ant-modal-confirm-body .ant-modal-confirm-content > * {
|
|
74
|
+
.aplus-basic-modal .ant-modal-confirm-body .ant-modal-confirm-content > * {
|
|
73
75
|
color: #909399;
|
|
74
76
|
}
|
|
75
|
-
.ant-modal-confirm-confirm.error .ant-modal-confirm-body > .anticon {
|
|
77
|
+
.aplus-basic-modal .ant-modal-confirm-confirm.error .ant-modal-confirm-body > .anticon {
|
|
76
78
|
color: #ed6f6f;
|
|
77
79
|
}
|
|
78
|
-
.ant-modal-confirm-btns .ant-btn:last-child {
|
|
80
|
+
.aplus-basic-modal .ant-modal-confirm-btns .ant-btn:last-child {
|
|
79
81
|
margin-right: 0;
|
|
80
82
|
}
|
|
81
|
-
.ant-modal-confirm-info .ant-modal-confirm-body > .anticon {
|
|
83
|
+
.aplus-basic-modal .ant-modal-confirm-info .ant-modal-confirm-body > .anticon {
|
|
82
84
|
color: #efbd47;
|
|
83
85
|
}
|
|
84
|
-
.ant-modal-confirm-confirm.success .ant-modal-confirm-body > .anticon {
|
|
86
|
+
.aplus-basic-modal .ant-modal-confirm-confirm.success .ant-modal-confirm-body > .anticon {
|
|
85
87
|
color: #34b77c;
|
|
86
88
|
}
|
|
87
|
-
|
|
88
|
-
padding: 24px !important;
|
|
89
|
-
}
|
|
90
|
-
@media screen and (max-height: 600px) {
|
|
89
|
+
@media screen and (height <= 600px) {
|
|
91
90
|
.ant-modal {
|
|
92
91
|
top: 60px;
|
|
93
92
|
}
|
|
94
93
|
}
|
|
95
|
-
@media screen and (
|
|
94
|
+
@media screen and (height <= 540px) {
|
|
96
95
|
.ant-modal {
|
|
97
96
|
top: 30px;
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
|
-
@media screen and (
|
|
99
|
+
@media screen and (height <= 480px) {
|
|
101
100
|
.ant-modal {
|
|
102
101
|
top: 10px;
|
|
103
102
|
}
|
package/lib/src/type.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties } from 'vue';
|
|
1
|
+
import { CSSProperties, VNode } from 'vue';
|
|
2
2
|
|
|
3
3
|
export type StyleValue = string | CSSProperties | Array<StyleValue>;
|
|
4
4
|
export type Nullable<T> = T | null;
|
|
@@ -24,4 +24,6 @@ export interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
|
|
24
24
|
}
|
|
25
25
|
export type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null;
|
|
26
26
|
export type EmitType = ReturnType<typeof defineEmits>;
|
|
27
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
28
|
+
export type VueNode = VNodeChildAtom | VNodeChildAtom[] | VNode;
|
|
27
29
|
export {};
|
package/lib/src/utils/index.d.ts
CHANGED
|
@@ -4,3 +4,10 @@
|
|
|
4
4
|
export declare function getPopupContainer(node?: HTMLElement): HTMLElement;
|
|
5
5
|
export declare function isDef<T = unknown>(val?: T): val is T;
|
|
6
6
|
export declare function getDynamicProps<T extends Record<string, unknown>, U>(props: T): Partial<U>;
|
|
7
|
+
/**
|
|
8
|
+
* 按条件移除
|
|
9
|
+
* @param obj
|
|
10
|
+
* @param when
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function omitWhen<T extends object, K extends keyof T>(obj: T, fieldList?: K[], when?: (field: string, fieldValue: T[K]) => boolean): Omit<T, K>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.7",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"dayjs": "^1.11.11",
|
|
52
52
|
"lodash-unified": "^1.0.3",
|
|
53
53
|
"sortablejs": "^1.15.2",
|
|
54
|
-
"@aplus-frontend/
|
|
55
|
-
"@aplus-frontend/
|
|
54
|
+
"@aplus-frontend/hooks": "1.0.2",
|
|
55
|
+
"@aplus-frontend/utils": "1.0.14"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"ant-design-vue": "^4.2.1"
|