@vipl520/dk-ui 1.0.8 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +1 -1
- package/dist/index.js +282 -115
- package/dist/index.min.js +7 -7
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +7 -7
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +282 -115
- package/dist/web-types.json +1 -1
- package/es/attachment/src/attachment.vue2.mjs +2 -1
- package/es/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/dialog/index.d.ts +15 -0
- package/es/dialog/src/dialog.vue.d.ts +9 -0
- package/es/dialog/src/dialog.vue2.mjs +3 -5
- package/es/dialog/src/dialog.vue2.mjs.map +1 -1
- package/es/dialog/src/props.d.ts +4 -0
- package/es/dialog/src/props.mjs +4 -0
- package/es/dialog/src/props.mjs.map +1 -1
- package/es/file-input/src/file-input.vue2.mjs +4 -15
- package/es/file-input/src/file-input.vue2.mjs.map +1 -1
- package/es/file-input/style/index.css +1 -1
- package/es/file-input/style/index.scss +3 -3
- package/es/form/index.d.ts +24 -9
- package/es/form/src/form.vue.d.ts +15 -5
- package/es/form/src/form.vue2.mjs +62 -10
- package/es/form/src/form.vue2.mjs.map +1 -1
- package/es/form/src/props.d.ts +7 -2
- package/es/form/src/props.mjs +7 -2
- package/es/form/src/props.mjs.map +1 -1
- package/es/icon/index.d.ts +12 -45
- package/es/icon/src/icon.vue.d.ts +6 -27
- package/es/icon/src/icon.vue2.mjs +9 -6
- package/es/icon/src/icon.vue2.mjs.map +1 -1
- package/es/icon/src/props.d.ts +3 -12
- package/es/icon/src/props.mjs +3 -12
- package/es/icon/src/props.mjs.map +1 -1
- package/es/index.scss +5 -0
- package/es/table/index.d.ts +15 -0
- package/es/table/src/components/ComSearch.vue2.mjs +79 -19
- package/es/table/src/components/ComSearch.vue2.mjs.map +1 -1
- package/es/table/src/components/FieldRender.vue2.mjs +37 -15
- package/es/table/src/components/FieldRender.vue2.mjs.map +1 -1
- package/es/table/src/components/header.vue2.mjs +9 -1
- package/es/table/src/components/header.vue2.mjs.map +1 -1
- package/es/table/src/props.d.ts +4 -0
- package/es/table/src/props.mjs +4 -0
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue.d.ts +9 -0
- package/es/table/src/table.vue2.mjs +7 -6
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/style/index.css +1 -1
- package/es/table/style/index.scss +1 -1
- package/es/table/utils/dkTable.d.ts +2 -0
- package/es/table/utils/dkTable.mjs +19 -1
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/es/table/utils/dkTableApi.mjs +15 -7
- package/es/table/utils/dkTableApi.mjs.map +1 -1
- package/es/tiny-editor/src/tiny-editor.vue2.mjs +5 -2
- package/es/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
- package/lib/attachment/src/attachment.vue2.js +5 -4
- package/lib/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/dialog/index.d.ts +15 -0
- package/lib/dialog/src/dialog.vue.d.ts +9 -0
- package/lib/dialog/src/dialog.vue2.js +3 -5
- package/lib/dialog/src/dialog.vue2.js.map +1 -1
- package/lib/dialog/src/props.d.ts +4 -0
- package/lib/dialog/src/props.js +4 -0
- package/lib/dialog/src/props.js.map +1 -1
- package/lib/file-input/src/file-input.vue2.js +4 -15
- package/lib/file-input/src/file-input.vue2.js.map +1 -1
- package/lib/file-input/style/index.css +1 -1
- package/lib/file-input/style/index.scss +3 -3
- package/lib/form/index.d.ts +24 -9
- package/lib/form/src/form.vue.d.ts +15 -5
- package/lib/form/src/form.vue2.js +60 -8
- package/lib/form/src/form.vue2.js.map +1 -1
- package/lib/form/src/props.d.ts +7 -2
- package/lib/form/src/props.js +7 -2
- package/lib/form/src/props.js.map +1 -1
- package/lib/icon/index.d.ts +12 -45
- package/lib/icon/src/icon.vue.d.ts +6 -27
- package/lib/icon/src/icon.vue2.js +9 -6
- package/lib/icon/src/icon.vue2.js.map +1 -1
- package/lib/icon/src/props.d.ts +3 -12
- package/lib/icon/src/props.js +3 -12
- package/lib/icon/src/props.js.map +1 -1
- package/lib/index.scss +5 -0
- package/lib/table/index.d.ts +15 -0
- package/lib/table/src/components/ComSearch.vue2.js +79 -19
- package/lib/table/src/components/ComSearch.vue2.js.map +1 -1
- package/lib/table/src/components/FieldRender.vue2.js +37 -15
- package/lib/table/src/components/FieldRender.vue2.js.map +1 -1
- package/lib/table/src/components/header.vue2.js +8 -0
- package/lib/table/src/components/header.vue2.js.map +1 -1
- package/lib/table/src/props.d.ts +4 -0
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue.d.ts +9 -0
- package/lib/table/src/table.vue2.js +7 -6
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/style/index.css +1 -1
- package/lib/table/style/index.scss +1 -1
- package/lib/table/utils/dkTable.d.ts +2 -0
- package/lib/table/utils/dkTable.js +19 -1
- package/lib/table/utils/dkTable.js.map +1 -1
- package/lib/table/utils/dkTableApi.js +15 -7
- package/lib/table/utils/dkTableApi.js.map +1 -1
- package/lib/tiny-editor/src/tiny-editor.vue2.js +4 -1
- package/lib/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"form.vue2.js","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"width.value < 768 ? '100%' : '800px'\"\n :default-fullscreen=\"width.value < 768\"\n min-height=\"200px\"\n append-to-body\n >\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, request, isNumber, isObject, isArray } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { ref, reactive, onMounted, computed, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\nconst minHeight = computed(() => (isNumber(props.minHeight) ? `${props.minHeight}px` : props.minHeight))\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n console.error(res)\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","value","isArray","config","reactive","_config","ref","computed","isNumber","useWindowSize","watch","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACp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UC,qBAAA,CAAA,OAAA,CAAQ,IAAI,GAAG,CAAA,CAAA;AACzB,UAAK,IAAA,CAAA,QAAA,EAAU,MAAM,GAAG,CAAA,CAAA;AACxB,UAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CACA,KAAM,CAAA,CAAC,GAAQ,KAAA;AACd,UAAUA,qBAAA,CAAA,KAAA,CAAM,IAAI,GAAG,CAAA,CAAA;AACvB,UAAK,IAAA,CAAA,MAAA,EAAQ,MAAM,GAAG,CAAA,CAAA;AACtB,UAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,SACvB,CAAA,CAAA;AAAA,OACE,MAAA;AACL,QAAA,IAAA,CAAK,UAAU,IAAI,CAAA,CAAA;AACnB,QAAA,aAAA,CAAc,KAAQ,GAAA,KAAA,CAAA;AAAA,OACxB;AACA,MAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB,CAAA;AACA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"form.vue2.js","sources":["../../../src/form/src/form.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkForm',\n});\n</script>\n<template>\n <DkDialog\n v-if=\"props.isDialog\"\n v-model=\"showDialog\"\n :title=\"_formData?.title ? _formData?.title : '表单'\"\n :width=\"dialogWidth\"\n :default-fullscreen=\"isFullscreen\"\n min-height=\"200px\"\n :draggable=\"draggable\"\n append-to-body\n >\n <div :style=\"dialogStyle\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n style=\"padding: 10px\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n </DkDialog>\n <div v-else>\n <div :style=\"{ minHeight }\" class=\"dk-form\">\n <FormCreate\n v-model=\"value\"\n :option=\"formConfig\"\n :rule=\"_formData.rules\"\n :handle-icon=\"false\"\n class=\"formBox\"\n @update:api=\"fApi = $event\"\n @update:value=\"value = $event\"\n />\n <div :style=\"{ marginLeft: config.form.labelWidth }\" class=\"m-t-10px\">\n <slot name=\"buttons\">\n <el-button type=\"primary\" :loading=\"buttonLoading\" @click=\"checkForm\"> 提交 </el-button>\n </slot>\n </div>\n </div>\n <!-- <div v-else :style=\"{ minHeight }\"></div>-->\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { createNamespace, isArray, isNumber, isObject, request } from '@vipl520/utils'\nimport formCreate from '@form-create/element-ui'\nimport { formProps } from './props'\nimport { computed, onMounted, reactive, ref, watch } from 'vue'\nimport _config from './config'\nimport { ElButton, ElMessage } from 'element-plus'\nimport { useWindowSize } from '@vueuse/core'\n\nconst [_, bem] = createNamespace('form')\n\nformCreate.register({\n name: 'help',\n init({ value }, rule) {\n // 判断value是字符串还是数组,如果是字符串则转换为数组,如果是数组则不变\n if (!isArray(value)) {\n value = [value]\n }\n rule.suffix = {\n type: 'p',\n children: value,\n class: 'form-help',\n }\n },\n})\n\n\nconst FormCreate = formCreate.$form()\n\nconst props = defineProps(formProps)\n\nconst config = reactive(_config)\nconst fApi = ref()\nconst loading = ref(true)\nconst buttonLoading = ref(false)\n\nconst showDialog = ref(false)\nconst formConfig = computed(() => ({ ...config, ...props.extraConfig }))\nconst { width } = useWindowSize()\nconst value = ref(null)\nconst _formData = ref(props.formData || {})\nconst emit = defineEmits(['submit', 'fail', 'update:modelValue'])\nwatch(\n () => value.value,\n (val) => {\n emit('update:modelValue', val || {})\n }\n)\n// 弹窗宽度\nconst dialogWidth = computed(() => {\n let defaultWidth = '800px'\n if (props.dialog?.width) {\n defaultWidth = props.dialog?.width\n }\n if (_formData.value?.config?.width) {\n defaultWidth = _formData.value?.config?.width\n }\n return width.value < 768 ? '100%' : defaultWidth\n})\n// 弹窗内样式\nconst dialogStyle = computed(() => {\n const style = {\n minHeight: undefined,\n maxHeight: undefined,\n }\n if (props.dialog?.minHeight) {\n style.minHeight = props.dialog?.minHeight\n }\n if (props.dialog?.maxHeight) {\n style.maxHeight = props.dialog?.maxHeight\n }\n if (_formData.value?.config?.minHeight) {\n style.minHeight = _formData.value?.config?.minHeight\n }\n if (_formData.value?.config?.maxHeight) {\n style.maxHeight = _formData.value?.config?.maxHeight\n }\n return style\n})\nconst draggable = computed(() => {\n let draggable = true\n if (props.dialog?.draggable) {\n draggable = props.dialog?.draggable\n }\n if (_formData.value?.config?.draggable !== undefined) {\n draggable = _formData.value?.config?.draggable\n }\n return draggable\n})\n// 是否全屏\nconst isFullscreen = computed(() => {\n let defaultFullscreen = false\n if (props.dialog?.width) {\n defaultFullscreen = props.dialog?.fullscreen\n }\n if (_formData.value?.config?.fullscreen) {\n defaultFullscreen = _formData.value?.config?.fullscreen\n }\n if (width.value < 768) {\n defaultFullscreen = true\n }\n return defaultFullscreen\n})\n\nconst setFormData = (formData: any) => {\n value.value = null\n _formData.value = formData\n}\n\nconst initFormData = (formUrl?: string | object) => {\n if (!formUrl) {\n formUrl = props.formUrl\n }\n\n if (props.formData) {\n loading.value = false\n } else if (formUrl) {\n let data: {}\n if (isObject(formUrl)) {\n data = formUrl\n } else {\n data = {\n url: formUrl,\n method: 'post',\n }\n }\n request(data)\n .then((res) => {\n _formData.value = res.data\n loading.value = false\n })\n .catch((res) => {\n loading.value = false\n console.error(res)\n })\n }\n}\n\nconst checkForm = () => {\n fApi.value\n .validate()\n .then(() => {\n fApi.value\n .submit((data: any) => {\n onSubmit(data)\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n })\n .catch((fail: object) => {\n ElMessage.warning(Object.values(fail)[0][0].message)\n })\n}\n\nconst onSubmit = (data: any) => {\n if (props.isLoading) {\n buttonLoading.value = true\n }\n if (props.isSubmit) {\n request({\n url: props.path + _formData.value.action,\n method: _formData.value.method,\n data: { formData: data },\n })\n .then((res) => {\n ElMessage.success(res.msg)\n emit('submit', data, res)\n buttonLoading.value = false\n })\n .catch((res) => {\n ElMessage.error(res.msg)\n emit('fail', data, res)\n buttonLoading.value = false\n })\n } else {\n emit('submit', data)\n buttonLoading.value = false\n }\n showDialog.value = false\n}\n\nconst show = () => {\n showDialog.value = true\n}\nonMounted(() => {\n initFormData()\n})\n// 导出\ndefineExpose({\n showDialog,\n buttonLoading,\n fApi,\n value,\n show,\n checkForm,\n onSubmit,\n initFormData,\n setFormData,\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","value","isArray","config","reactive","_config","ref","computed","useWindowSize","watch","draggable","isObject","request","ElMessage","onMounted"],"mappings":";;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,MAAM,CAAA,CAAA;AA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AAA;AAAA,KACrB,CAAA;AAEA,IAAA,MAAM,OAAO,MAAM;AACjB,MAAA,UAAA,CAAW,KAAQ,GAAA,IAAA,CAAA;AAAA,KACrB,CAAA;AACA,IAAAC,aAAA,CAAU,MAAM;AACd,MAAa,YAAA,EAAA,CAAA;AAAA,KACd,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,IAAA;AAAA,MACA,SAAA;AAAA,MACA,QAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/form/src/props.d.ts
CHANGED
@@ -26,7 +26,7 @@ export declare const formProps: {
|
|
26
26
|
};
|
27
27
|
minHeight: {
|
28
28
|
default: string;
|
29
|
-
type:
|
29
|
+
type: StringConstructor;
|
30
30
|
};
|
31
31
|
isDialog: {
|
32
32
|
default: boolean;
|
@@ -37,7 +37,12 @@ export declare const formProps: {
|
|
37
37
|
type: BooleanConstructor;
|
38
38
|
};
|
39
39
|
dialog: {
|
40
|
-
default: () => {
|
40
|
+
default: () => {
|
41
|
+
width: string;
|
42
|
+
fullscreen: boolean;
|
43
|
+
minHeight: string;
|
44
|
+
draggable: boolean;
|
45
|
+
};
|
41
46
|
type: ObjectConstructor;
|
42
47
|
};
|
43
48
|
};
|
package/lib/form/src/props.js
CHANGED
@@ -19,7 +19,7 @@ const formProps = {
|
|
19
19
|
// 显示加载
|
20
20
|
isLoading: { default: true, type: Boolean },
|
21
21
|
// 默认高度
|
22
|
-
minHeight: { default: "
|
22
|
+
minHeight: { default: "300px", type: String },
|
23
23
|
// 是否为弹窗
|
24
24
|
isDialog: { default: false, type: Boolean },
|
25
25
|
// 弹窗显示后获取formData
|
@@ -27,7 +27,12 @@ const formProps = {
|
|
27
27
|
// 弹窗配置
|
28
28
|
dialog: {
|
29
29
|
default: () => {
|
30
|
-
return {
|
30
|
+
return {
|
31
|
+
width: "800px",
|
32
|
+
fullscreen: false,
|
33
|
+
minHeight: "200px",
|
34
|
+
draggable: true
|
35
|
+
};
|
31
36
|
},
|
32
37
|
type: Object
|
33
38
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../src/form/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const formProps = {\n // 表单数据\n formData: { type: Object, default: null },\n // 是否提交\n isSubmit: { type: Boolean, default: true },\n // 表单配置\n extraConfig: {\n default: () => {\n return {}\n },\n type: Object,\n },\n // 表单路径\n path: { default: '', type: String },\n // 表单接口\n formUrl: { default: '', type: [String, Object] },\n // 显示加载\n isLoading: { default: true, type: Boolean },\n // 默认高度\n minHeight: { default: '
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../src/form/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const formProps = {\n // 表单数据\n formData: { type: Object, default: null },\n // 是否提交\n isSubmit: { type: Boolean, default: true },\n // 表单配置\n extraConfig: {\n default: () => {\n return {}\n },\n type: Object,\n },\n // 表单路径\n path: { default: '', type: String },\n // 表单接口\n formUrl: { default: '', type: [String, Object] },\n // 显示加载\n isLoading: { default: true, type: Boolean },\n // 默认高度\n minHeight: { default: '300px', type: String },\n // 是否为弹窗\n isDialog: { default: false, type: Boolean },\n // 弹窗显示后获取formData\n dialogWait: { default: true, type: Boolean },\n // 弹窗配置\n dialog: {\n default: () => {\n return {\n width: '800px',\n fullscreen: false,\n minHeight: '200px',\n draggable: true,\n }\n },\n type: Object,\n },\n}\n\nexport type FormProps = ExtractPropTypes<typeof formProps>\n"],"names":[],"mappings":";;AAEO,MAAM,SAAY,GAAA;AAAA;AAAA,EAEvB,QAAU,EAAA,EAAE,IAAM,EAAA,MAAA,EAAQ,SAAS,IAAK,EAAA;AAAA;AAAA,EAExC,QAAU,EAAA,EAAE,IAAM,EAAA,OAAA,EAAS,SAAS,IAAK,EAAA;AAAA;AAAA,EAEzC,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA,EAEA,IAAM,EAAA,EAAE,OAAS,EAAA,EAAA,EAAI,MAAM,MAAO,EAAA;AAAA;AAAA,EAElC,OAAA,EAAS,EAAE,OAAS,EAAA,EAAA,EAAI,MAAM,CAAC,MAAA,EAAQ,MAAM,CAAE,EAAA;AAAA;AAAA,EAE/C,SAAW,EAAA,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,OAAQ,EAAA;AAAA;AAAA,EAE1C,SAAW,EAAA,EAAE,OAAS,EAAA,OAAA,EAAS,MAAM,MAAO,EAAA;AAAA;AAAA,EAE5C,QAAU,EAAA,EAAE,OAAS,EAAA,KAAA,EAAO,MAAM,OAAQ,EAAA;AAAA;AAAA,EAE1C,UAAY,EAAA,EAAE,OAAS,EAAA,IAAA,EAAM,MAAM,OAAQ,EAAA;AAAA;AAAA,EAE3C,MAAQ,EAAA;AAAA,IACN,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,OAAA;AAAA,QACP,UAAY,EAAA,KAAA;AAAA,QACZ,SAAW,EAAA,OAAA;AAAA,QACX,SAAW,EAAA,IAAA;AAAA,OACb,CAAA;AAAA,KACF;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
package/lib/icon/index.d.ts
CHANGED
@@ -4,14 +4,12 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
4
4
|
$data: {};
|
5
5
|
$props: {
|
6
6
|
icon?: string | undefined;
|
7
|
-
color?: string | undefined;
|
8
|
-
size?: number | undefined;
|
9
|
-
hoverColor?: string | undefined;
|
10
7
|
showEl?: boolean | undefined;
|
11
8
|
showVant?: boolean | undefined;
|
12
9
|
key?: string | number | symbol | undefined;
|
13
10
|
style?: unknown;
|
14
11
|
class?: unknown;
|
12
|
+
readonly color?: string | undefined;
|
15
13
|
ref?: import("vue").VNodeRef | undefined;
|
16
14
|
ref_for?: boolean | undefined;
|
17
15
|
ref_key?: string | undefined;
|
@@ -53,6 +51,8 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
53
51
|
}>) => void) | ((vnode: import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
54
52
|
[key: string]: any;
|
55
53
|
}>) => void)[] | undefined;
|
54
|
+
readonly size?: number | undefined;
|
55
|
+
readonly hoverColor?: string | undefined;
|
56
56
|
};
|
57
57
|
$attrs: {
|
58
58
|
[x: string]: unknown;
|
@@ -72,18 +72,9 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
72
72
|
default: string;
|
73
73
|
type: StringConstructor;
|
74
74
|
};
|
75
|
-
color:
|
76
|
-
|
77
|
-
|
78
|
-
};
|
79
|
-
size: {
|
80
|
-
default: number;
|
81
|
-
type: NumberConstructor;
|
82
|
-
};
|
83
|
-
hoverColor: {
|
84
|
-
default: string;
|
85
|
-
type: StringConstructor;
|
86
|
-
};
|
75
|
+
color: StringConstructor;
|
76
|
+
size: NumberConstructor;
|
77
|
+
hoverColor: StringConstructor;
|
87
78
|
showEl: {
|
88
79
|
default: boolean;
|
89
80
|
type: BooleanConstructor;
|
@@ -94,9 +85,6 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
94
85
|
};
|
95
86
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
96
87
|
icon: string;
|
97
|
-
color: string;
|
98
|
-
size: number;
|
99
|
-
hoverColor: string;
|
100
88
|
showEl: boolean;
|
101
89
|
showVant: boolean;
|
102
90
|
}, {}, string, {}> & {
|
@@ -124,18 +112,9 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
124
112
|
default: string;
|
125
113
|
type: StringConstructor;
|
126
114
|
};
|
127
|
-
color:
|
128
|
-
|
129
|
-
|
130
|
-
};
|
131
|
-
size: {
|
132
|
-
default: number;
|
133
|
-
type: NumberConstructor;
|
134
|
-
};
|
135
|
-
hoverColor: {
|
136
|
-
default: string;
|
137
|
-
type: StringConstructor;
|
138
|
-
};
|
115
|
+
color: StringConstructor;
|
116
|
+
size: NumberConstructor;
|
117
|
+
hoverColor: StringConstructor;
|
139
118
|
showEl: {
|
140
119
|
default: boolean;
|
141
120
|
type: BooleanConstructor;
|
@@ -153,18 +132,9 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
153
132
|
default: string;
|
154
133
|
type: StringConstructor;
|
155
134
|
};
|
156
|
-
color:
|
157
|
-
|
158
|
-
|
159
|
-
};
|
160
|
-
size: {
|
161
|
-
default: number;
|
162
|
-
type: NumberConstructor;
|
163
|
-
};
|
164
|
-
hoverColor: {
|
165
|
-
default: string;
|
166
|
-
type: StringConstructor;
|
167
|
-
};
|
135
|
+
color: StringConstructor;
|
136
|
+
size: NumberConstructor;
|
137
|
+
hoverColor: StringConstructor;
|
168
138
|
showEl: {
|
169
139
|
default: boolean;
|
170
140
|
type: BooleanConstructor;
|
@@ -175,9 +145,6 @@ export declare const Icon: import("@vipl520/utils").WithInstall<{
|
|
175
145
|
};
|
176
146
|
}>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
177
147
|
icon: string;
|
178
|
-
color: string;
|
179
|
-
size: number;
|
180
|
-
hoverColor: string;
|
181
148
|
showEl: boolean;
|
182
149
|
showVant: boolean;
|
183
150
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
@@ -3,18 +3,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
3
|
default: string;
|
4
4
|
type: StringConstructor;
|
5
5
|
};
|
6
|
-
color:
|
7
|
-
|
8
|
-
|
9
|
-
};
|
10
|
-
size: {
|
11
|
-
default: number;
|
12
|
-
type: NumberConstructor;
|
13
|
-
};
|
14
|
-
hoverColor: {
|
15
|
-
default: string;
|
16
|
-
type: StringConstructor;
|
17
|
-
};
|
6
|
+
color: StringConstructor;
|
7
|
+
size: NumberConstructor;
|
8
|
+
hoverColor: StringConstructor;
|
18
9
|
showEl: {
|
19
10
|
default: boolean;
|
20
11
|
type: BooleanConstructor;
|
@@ -28,18 +19,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
28
19
|
default: string;
|
29
20
|
type: StringConstructor;
|
30
21
|
};
|
31
|
-
color:
|
32
|
-
|
33
|
-
|
34
|
-
};
|
35
|
-
size: {
|
36
|
-
default: number;
|
37
|
-
type: NumberConstructor;
|
38
|
-
};
|
39
|
-
hoverColor: {
|
40
|
-
default: string;
|
41
|
-
type: StringConstructor;
|
42
|
-
};
|
22
|
+
color: StringConstructor;
|
23
|
+
size: NumberConstructor;
|
24
|
+
hoverColor: StringConstructor;
|
43
25
|
showEl: {
|
44
26
|
default: boolean;
|
45
27
|
type: BooleanConstructor;
|
@@ -50,9 +32,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
50
32
|
};
|
51
33
|
}>>, {
|
52
34
|
icon: string;
|
53
|
-
color: string;
|
54
|
-
size: number;
|
55
|
-
hoverColor: string;
|
56
35
|
showEl: boolean;
|
57
36
|
showVant: boolean;
|
58
37
|
}, {}>, {
|
@@ -41,12 +41,15 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
41
41
|
return key;
|
42
42
|
});
|
43
43
|
const getIconifyStyle = vue.computed(() => {
|
44
|
-
const { color, size } = props;
|
45
|
-
|
46
|
-
|
47
|
-
color
|
48
|
-
|
49
|
-
|
44
|
+
const { color, size, hoverColor } = props;
|
45
|
+
const style = {};
|
46
|
+
if (color)
|
47
|
+
style.color = color;
|
48
|
+
if (size)
|
49
|
+
style.fontSize = `${size}px`;
|
50
|
+
if (hoverColor)
|
51
|
+
style["--hover-color"] = hoverColor;
|
52
|
+
return style;
|
50
53
|
});
|
51
54
|
const iconType = vue.computed(() => {
|
52
55
|
let type = "cloud";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"icon.vue2.js","sources":["../../../src/icon/src/icon.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIcon',\n});\n</script>\n<template>\n <el-icon :class=\"bem()\" :style=\"getIconifyStyle\">\n <slot>\n <Icon v-if=\"iconType === 'cloud'\" :icon=\"props.icon\" />\n <component :is=\"props.icon\" v-if=\"iconType === 'el'\" />\n <van-icon v-if=\"iconType === 'vant'\" :class=\"bem()\" :name=\"props.icon\" :style=\"getIconifyStyle\"></van-icon>\n </slot>\n </el-icon>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\nimport { computed } from 'vue'\nimport { createNamespace } from '@vipl520/utils'\nimport { iconProps } from './props'\nimport * as ElementPlusIconsVue from '@element-plus/icons-vue'\nimport icons from '@vant/icons'\n\nconst [_, bem] = createNamespace('icon')\n\n\nconst props = defineProps(iconProps)\n// 获取element-plus所有图标\nconst elIcons = Object.keys(ElementPlusIconsVue).map((key) => {\n return key\n})\nconst getIconifyStyle = computed(() => {\n const { color, size } = props\n
|
1
|
+
{"version":3,"file":"icon.vue2.js","sources":["../../../src/icon/src/icon.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkIcon',\n});\n</script>\n<template>\n <el-icon :class=\"bem()\" :style=\"getIconifyStyle\">\n <slot>\n <Icon v-if=\"iconType === 'cloud'\" :icon=\"props.icon\" />\n <component :is=\"props.icon\" v-if=\"iconType === 'el'\" />\n <van-icon v-if=\"iconType === 'vant'\" :class=\"bem()\" :name=\"props.icon\" :style=\"getIconifyStyle\"></van-icon>\n </slot>\n </el-icon>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\nimport { computed } from 'vue'\nimport { createNamespace } from '@vipl520/utils'\nimport { iconProps } from './props'\nimport * as ElementPlusIconsVue from '@element-plus/icons-vue'\nimport icons from '@vant/icons'\n\nconst [_, bem] = createNamespace('icon')\n\n\nconst props = defineProps(iconProps)\n// 获取element-plus所有图标\nconst elIcons = Object.keys(ElementPlusIconsVue).map((key) => {\n return key\n})\nconst getIconifyStyle = computed(() => {\n const { color, size, hoverColor } = props\n const style: any = {}\n if (color) style.color = color\n if (size) style.fontSize = `${size}px`\n if (hoverColor) style['--hover-color'] = hoverColor\n return style\n})\n\nconst iconType = computed(() => {\n let type = 'cloud'\n if (elIcons.includes(props.icon) && props.showEl) {\n type = 'el'\n }\n if (props.showVant) {\n // 这里类型有些问题\n if (icons.basic.includes(props.icon)) {\n type = 'vant'\n }\n if (icons.outline.includes(props.icon)) {\n type = 'vant'\n }\n if (icons.filled.includes(props.icon)) {\n type = 'vant'\n }\n }\n return type\n})\n</script>\n"],"names":["__MACROS_defineComponent","createNamespace","ElementPlusIconsVue","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAoBD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAIC,sBAAgB,MAAM,CAAA,CAAA;AAKvC,IAAA,MAAM,UAAU,MAAO,CAAA,IAAA,CAAKC,8BAAmB,CAAE,CAAA,GAAA,CAAI,CAAC,GAAQ,KAAA;AAC5D,MAAO,OAAA,GAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,eAAA,GAAkBC,aAAS,MAAM;AACrC,M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: string;
|
8
8
|
type: StringConstructor;
|
9
9
|
};
|
10
|
-
color:
|
11
|
-
|
12
|
-
|
13
|
-
};
|
14
|
-
size: {
|
15
|
-
default: number;
|
16
|
-
type: NumberConstructor;
|
17
|
-
};
|
18
|
-
hoverColor: {
|
19
|
-
default: string;
|
20
|
-
type: StringConstructor;
|
21
|
-
};
|
10
|
+
color: StringConstructor;
|
11
|
+
size: NumberConstructor;
|
12
|
+
hoverColor: StringConstructor;
|
22
13
|
showEl: {
|
23
14
|
default: boolean;
|
24
15
|
type: BooleanConstructor;
|
package/lib/icon/src/props.js
CHANGED
@@ -10,20 +10,11 @@ const iconProps = {
|
|
10
10
|
type: String
|
11
11
|
},
|
12
12
|
// icon color
|
13
|
-
color:
|
14
|
-
default: "",
|
15
|
-
type: String
|
16
|
-
},
|
13
|
+
color: String,
|
17
14
|
// icon size
|
18
|
-
size:
|
19
|
-
default: 14,
|
20
|
-
type: Number
|
21
|
-
},
|
15
|
+
size: Number,
|
22
16
|
// icon hover
|
23
|
-
hoverColor:
|
24
|
-
default: "",
|
25
|
-
type: String
|
26
|
-
},
|
17
|
+
hoverColor: String,
|
27
18
|
showEl: {
|
28
19
|
default: true,
|
29
20
|
type: Boolean
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../src/icon/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const iconProps = {\n /**\n * 类型定义\n */\n // icon name\n icon: {\n default: '',\n type: String,\n },\n // icon color\n color:
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../src/icon/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const iconProps = {\n /**\n * 类型定义\n */\n // icon name\n icon: {\n default: '',\n type: String,\n },\n // icon color\n color: String,\n // icon size\n size: Number,\n // icon hover\n hoverColor: String,\n showEl: {\n default: true,\n type: Boolean,\n },\n showVant: {\n default: true,\n type: Boolean,\n },\n}\n\nexport type IconProps = ExtractPropTypes<typeof iconProps>\n"],"names":[],"mappings":";;AAEO,MAAM,SAAY,GAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKvB,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA,EAEA,KAAO,EAAA,MAAA;AAAA;AAAA,EAEP,IAAM,EAAA,MAAA;AAAA;AAAA,EAEN,UAAY,EAAA,MAAA;AAAA,EACZ,MAAQ,EAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AACF;;;;"}
|
package/lib/index.scss
CHANGED
package/lib/table/index.d.ts
CHANGED
@@ -4,6 +4,7 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
4
4
|
$data: {};
|
5
5
|
$props: {
|
6
6
|
tableApi?: string | undefined;
|
7
|
+
cacheTable?: boolean | undefined;
|
7
8
|
key?: string | number | symbol | undefined;
|
8
9
|
style?: unknown;
|
9
10
|
class?: unknown;
|
@@ -67,12 +68,17 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
67
68
|
default: string;
|
68
69
|
type: StringConstructor;
|
69
70
|
};
|
71
|
+
cacheTable: {
|
72
|
+
default: boolean;
|
73
|
+
type: BooleanConstructor;
|
74
|
+
};
|
70
75
|
}>>, {
|
71
76
|
DkTable: import("./utils/dkTable").default;
|
72
77
|
TableRef: import("vue").Ref<any>;
|
73
78
|
FormRef: import("vue").Ref<any>;
|
74
79
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
75
80
|
tableApi: string;
|
81
|
+
cacheTable: boolean;
|
76
82
|
}, {}, string, {}> & {
|
77
83
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
78
84
|
created?: ((() => void) | (() => void)[]) | undefined;
|
@@ -98,6 +104,10 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
98
104
|
default: string;
|
99
105
|
type: StringConstructor;
|
100
106
|
};
|
107
|
+
cacheTable: {
|
108
|
+
default: boolean;
|
109
|
+
type: BooleanConstructor;
|
110
|
+
};
|
101
111
|
}>> & import("vue").ShallowUnwrapRef<{
|
102
112
|
DkTable: import("./utils/dkTable").default;
|
103
113
|
TableRef: import("vue").Ref<any>;
|
@@ -111,12 +121,17 @@ export declare const Table: import("@vipl520/utils").WithInstall<{
|
|
111
121
|
default: string;
|
112
122
|
type: StringConstructor;
|
113
123
|
};
|
124
|
+
cacheTable: {
|
125
|
+
default: boolean;
|
126
|
+
type: BooleanConstructor;
|
127
|
+
};
|
114
128
|
}>>, {
|
115
129
|
DkTable: import("./utils/dkTable").default;
|
116
130
|
TableRef: import("vue").Ref<any>;
|
117
131
|
FormRef: import("vue").Ref<any>;
|
118
132
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
119
133
|
tableApi: string;
|
134
|
+
cacheTable: boolean;
|
120
135
|
}, {}, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
121
136
|
$slots: Partial<Record<NonNullable<string | number>, (_: {}) => any>> & Partial<Record<string, (_: any) => any>> & {
|
122
137
|
columnPrepend?(_: {}): any;
|