@vipl520/dk-ui 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +282 -115
  3. package/dist/index.min.js +7 -7
  4. package/dist/index.min.js.map +1 -1
  5. package/dist/index.min.mjs +7 -7
  6. package/dist/index.min.mjs.map +1 -1
  7. package/dist/index.mjs +282 -115
  8. package/dist/web-types.json +1 -1
  9. package/es/attachment/src/attachment.vue2.mjs +2 -1
  10. package/es/attachment/src/attachment.vue2.mjs.map +1 -1
  11. package/es/dialog/index.d.ts +15 -0
  12. package/es/dialog/src/dialog.vue.d.ts +9 -0
  13. package/es/dialog/src/dialog.vue2.mjs +3 -5
  14. package/es/dialog/src/dialog.vue2.mjs.map +1 -1
  15. package/es/dialog/src/props.d.ts +4 -0
  16. package/es/dialog/src/props.mjs +4 -0
  17. package/es/dialog/src/props.mjs.map +1 -1
  18. package/es/file-input/src/file-input.vue2.mjs +4 -15
  19. package/es/file-input/src/file-input.vue2.mjs.map +1 -1
  20. package/es/file-input/style/index.css +1 -1
  21. package/es/file-input/style/index.scss +3 -3
  22. package/es/form/index.d.ts +24 -9
  23. package/es/form/src/form.vue.d.ts +15 -5
  24. package/es/form/src/form.vue2.mjs +62 -10
  25. package/es/form/src/form.vue2.mjs.map +1 -1
  26. package/es/form/src/props.d.ts +7 -2
  27. package/es/form/src/props.mjs +7 -2
  28. package/es/form/src/props.mjs.map +1 -1
  29. package/es/icon/index.d.ts +12 -45
  30. package/es/icon/src/icon.vue.d.ts +6 -27
  31. package/es/icon/src/icon.vue2.mjs +9 -6
  32. package/es/icon/src/icon.vue2.mjs.map +1 -1
  33. package/es/icon/src/props.d.ts +3 -12
  34. package/es/icon/src/props.mjs +3 -12
  35. package/es/icon/src/props.mjs.map +1 -1
  36. package/es/index.scss +5 -0
  37. package/es/table/index.d.ts +15 -0
  38. package/es/table/src/components/ComSearch.vue2.mjs +79 -19
  39. package/es/table/src/components/ComSearch.vue2.mjs.map +1 -1
  40. package/es/table/src/components/FieldRender.vue2.mjs +37 -15
  41. package/es/table/src/components/FieldRender.vue2.mjs.map +1 -1
  42. package/es/table/src/components/header.vue2.mjs +9 -1
  43. package/es/table/src/components/header.vue2.mjs.map +1 -1
  44. package/es/table/src/props.d.ts +4 -0
  45. package/es/table/src/props.mjs +4 -0
  46. package/es/table/src/props.mjs.map +1 -1
  47. package/es/table/src/table.vue.d.ts +9 -0
  48. package/es/table/src/table.vue2.mjs +7 -6
  49. package/es/table/src/table.vue2.mjs.map +1 -1
  50. package/es/table/style/index.css +1 -1
  51. package/es/table/style/index.scss +1 -1
  52. package/es/table/utils/dkTable.d.ts +2 -0
  53. package/es/table/utils/dkTable.mjs +19 -1
  54. package/es/table/utils/dkTable.mjs.map +1 -1
  55. package/es/table/utils/dkTableApi.mjs +15 -7
  56. package/es/table/utils/dkTableApi.mjs.map +1 -1
  57. package/es/tiny-editor/src/tiny-editor.vue2.mjs +5 -2
  58. package/es/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
  59. package/lib/attachment/src/attachment.vue2.js +5 -4
  60. package/lib/attachment/src/attachment.vue2.js.map +1 -1
  61. package/lib/dialog/index.d.ts +15 -0
  62. package/lib/dialog/src/dialog.vue.d.ts +9 -0
  63. package/lib/dialog/src/dialog.vue2.js +3 -5
  64. package/lib/dialog/src/dialog.vue2.js.map +1 -1
  65. package/lib/dialog/src/props.d.ts +4 -0
  66. package/lib/dialog/src/props.js +4 -0
  67. package/lib/dialog/src/props.js.map +1 -1
  68. package/lib/file-input/src/file-input.vue2.js +4 -15
  69. package/lib/file-input/src/file-input.vue2.js.map +1 -1
  70. package/lib/file-input/style/index.css +1 -1
  71. package/lib/file-input/style/index.scss +3 -3
  72. package/lib/form/index.d.ts +24 -9
  73. package/lib/form/src/form.vue.d.ts +15 -5
  74. package/lib/form/src/form.vue2.js +60 -8
  75. package/lib/form/src/form.vue2.js.map +1 -1
  76. package/lib/form/src/props.d.ts +7 -2
  77. package/lib/form/src/props.js +7 -2
  78. package/lib/form/src/props.js.map +1 -1
  79. package/lib/icon/index.d.ts +12 -45
  80. package/lib/icon/src/icon.vue.d.ts +6 -27
  81. package/lib/icon/src/icon.vue2.js +9 -6
  82. package/lib/icon/src/icon.vue2.js.map +1 -1
  83. package/lib/icon/src/props.d.ts +3 -12
  84. package/lib/icon/src/props.js +3 -12
  85. package/lib/icon/src/props.js.map +1 -1
  86. package/lib/index.scss +5 -0
  87. package/lib/table/index.d.ts +15 -0
  88. package/lib/table/src/components/ComSearch.vue2.js +79 -19
  89. package/lib/table/src/components/ComSearch.vue2.js.map +1 -1
  90. package/lib/table/src/components/FieldRender.vue2.js +37 -15
  91. package/lib/table/src/components/FieldRender.vue2.js.map +1 -1
  92. package/lib/table/src/components/header.vue2.js +8 -0
  93. package/lib/table/src/components/header.vue2.js.map +1 -1
  94. package/lib/table/src/props.d.ts +4 -0
  95. package/lib/table/src/props.js +4 -0
  96. package/lib/table/src/props.js.map +1 -1
  97. package/lib/table/src/table.vue.d.ts +9 -0
  98. package/lib/table/src/table.vue2.js +7 -6
  99. package/lib/table/src/table.vue2.js.map +1 -1
  100. package/lib/table/style/index.css +1 -1
  101. package/lib/table/style/index.scss +1 -1
  102. package/lib/table/utils/dkTable.d.ts +2 -0
  103. package/lib/table/utils/dkTable.js +19 -1
  104. package/lib/table/utils/dkTable.js.map +1 -1
  105. package/lib/table/utils/dkTableApi.js +15 -7
  106. package/lib/table/utils/dkTableApi.js.map +1 -1
  107. package/lib/tiny-editor/src/tiny-editor.vue2.js +4 -1
  108. package/lib/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
  109. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { defineComponent, reactive, ref, computed, watch, onMounted, resolveComponent, openBlock, createBlock, unref, withCtx, createElementVNode, normalizeStyle, createVNode, renderSlot, createTextVNode, createCommentVNode, createElementBlock } from 'vue';
2
- import { createNamespace, isArray, isNumber, isObject, request } from '@vipl520/utils';
1
+ import { defineComponent, reactive, ref, computed, watch, onMounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createVNode, unref, renderSlot, createTextVNode, createElementBlock, createCommentVNode } from 'vue';
2
+ import { createNamespace, isArray, isObject, request } from '@vipl520/utils';
3
3
  import formCreate from '@form-create/element-ui';
4
4
  import { formProps } from './props.mjs';
5
5
  import config from './config.mjs';
@@ -35,7 +35,6 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
35
35
  const fApi = ref();
36
36
  const loading = ref(true);
37
37
  const buttonLoading = ref(false);
38
- const minHeight = computed(() => isNumber(props.minHeight) ? `${props.minHeight}px` : props.minHeight);
39
38
  const showDialog = ref(false);
40
39
  const formConfig = computed(() => ({ ...config$1, ...props.extraConfig }));
41
40
  const { width } = useWindowSize();
@@ -47,6 +46,58 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
47
46
  emit("update:modelValue", val || {});
48
47
  }
49
48
  );
49
+ const dialogWidth = computed(() => {
50
+ let defaultWidth = "800px";
51
+ if (props.dialog?.width) {
52
+ defaultWidth = props.dialog?.width;
53
+ }
54
+ if (_formData.value?.config?.width) {
55
+ defaultWidth = _formData.value?.config?.width;
56
+ }
57
+ return width.value < 768 ? "100%" : defaultWidth;
58
+ });
59
+ const dialogStyle = computed(() => {
60
+ const style = {
61
+ minHeight: void 0,
62
+ maxHeight: void 0
63
+ };
64
+ if (props.dialog?.minHeight) {
65
+ style.minHeight = props.dialog?.minHeight;
66
+ }
67
+ if (props.dialog?.maxHeight) {
68
+ style.maxHeight = props.dialog?.maxHeight;
69
+ }
70
+ if (_formData.value?.config?.minHeight) {
71
+ style.minHeight = _formData.value?.config?.minHeight;
72
+ }
73
+ if (_formData.value?.config?.maxHeight) {
74
+ style.maxHeight = _formData.value?.config?.maxHeight;
75
+ }
76
+ return style;
77
+ });
78
+ const draggable = computed(() => {
79
+ let draggable2 = true;
80
+ if (props.dialog?.draggable) {
81
+ draggable2 = props.dialog?.draggable;
82
+ }
83
+ if (_formData.value?.config?.draggable !== void 0) {
84
+ draggable2 = _formData.value?.config?.draggable;
85
+ }
86
+ return draggable2;
87
+ });
88
+ const isFullscreen = computed(() => {
89
+ let defaultFullscreen = false;
90
+ if (props.dialog?.width) {
91
+ defaultFullscreen = props.dialog?.fullscreen;
92
+ }
93
+ if (_formData.value?.config?.fullscreen) {
94
+ defaultFullscreen = _formData.value?.config?.fullscreen;
95
+ }
96
+ if (width.value < 768) {
97
+ defaultFullscreen = true;
98
+ }
99
+ return defaultFullscreen;
100
+ });
50
101
  const setFormData = (formData) => {
51
102
  value.value = null;
52
103
  _formData.value = formData;
@@ -135,16 +186,17 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
135
186
  modelValue: showDialog.value,
136
187
  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => showDialog.value = $event),
137
188
  title: _formData.value?.title ? _formData.value?.title : "\u8868\u5355",
138
- width: unref(width).value < 768 ? "100%" : "800px",
139
- "default-fullscreen": unref(width).value < 768,
189
+ width: dialogWidth.value,
190
+ "default-fullscreen": isFullscreen.value,
140
191
  "min-height": "200px",
192
+ draggable: draggable.value,
141
193
  "append-to-body": ""
142
194
  }, {
143
195
  default: withCtx(() => [
144
196
  createElementVNode(
145
197
  "div",
146
198
  {
147
- style: normalizeStyle({ minHeight: minHeight.value }),
199
+ style: normalizeStyle(dialogStyle.value),
148
200
  class: "dk-form"
149
201
  },
150
202
  [
@@ -155,6 +207,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
155
207
  rule: _formData.value.rules,
156
208
  "handle-icon": false,
157
209
  class: "formBox",
210
+ style: { "padding": "10px" },
158
211
  "onUpdate:api": _cache[1] || (_cache[1] = ($event) => fApi.value = $event),
159
212
  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => value.value = $event)
160
213
  }, null, 8, ["modelValue", "option", "rule"]),
@@ -185,16 +238,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
185
238
  ],
186
239
  4
187
240
  /* STYLE */
188
- ),
189
- createCommentVNode(' <div v-else :style="{ minHeight }"></div>')
241
+ )
190
242
  ]),
191
243
  _: 3
192
244
  /* FORWARDED */
193
- }, 8, ["modelValue", "title", "width", "default-fullscreen"])) : (openBlock(), createElementBlock("div", _hoisted_1, [
245
+ }, 8, ["modelValue", "title", "width", "default-fullscreen", "draggable"])) : (openBlock(), createElementBlock("div", _hoisted_1, [
194
246
  createElementVNode(
195
247
  "div",
196
248
  {
197
- style: normalizeStyle({ minHeight: minHeight.value }),
249
+ style: normalizeStyle({ minHeight: _ctx.minHeight }),
198
250
  class: "dk-form"
199
251
  },
200
252
  [
@@ -1 +1 @@
1
- {"version":3,"file":"form.vue2.mjs","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","value","config","_config"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA2DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAA,UAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAAC,OAAQA,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAAA,CAAK,MAAS,GAAA;AAAA,UACZ,IAAM,EAAA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A;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,IAAA,SAAA,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.mjs","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","value","config","_config","draggable"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AA6DD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,MAAM,CAAA,CAAA;AAEvC,IAAA,UAAA,CAAW,QAAS,CAAA;AAAA,MAClB,IAAM,EAAA,MAAA;AAAA,MACN,IAAK,CAAA,EAAE,KAAAC,EAAAA,MAAAA,IAAS,IAAM,EAAA;AAEpB,QAAI,IAAA,CAAC,OAAQA,CAAAA,MAAK,CAAG,EAAA;AACnB,UAAAA,MAAAA,GAAQ,CAACA,MAAK,CAAA,CAAA;AAAA,SAChB;AACA,QAAA,IAAA,CAAK,MAAS,GAAA;AAAA,UACZ,IAAM,EAAA,GAAA;AAAA,UACN,QAAUA,EAAAA,MAAAA;AAAA,UACV,KAAO,EAAA,WAAA;AAAA,SACT,CAAA;AAAA,OACF;AAAA,KACD,CAAA,CAAA;AAGD,IAAM,MAAA,UAAA,GAAa,WAAW,KAAM,EAAA,CAAA;AAIpC,IAAM,MAAAC,QAAA,GAAS,SAASC,MAAO,CAAA,CAAA;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{
26
26
  };
27
27
  minHeight: {
28
28
  default: string;
29
- type: (StringConstructor | NumberConstructor)[];
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
  };
@@ -17,7 +17,7 @@ const formProps = {
17
17
  // 显示加载
18
18
  isLoading: { default: true, type: Boolean },
19
19
  // 默认高度
20
- minHeight: { default: "100px", type: [String, Number] },
20
+ minHeight: { default: "300px", type: String },
21
21
  // 是否为弹窗
22
22
  isDialog: { default: false, type: Boolean },
23
23
  // 弹窗显示后获取formData
@@ -25,7 +25,12 @@ const formProps = {
25
25
  // 弹窗配置
26
26
  dialog: {
27
27
  default: () => {
28
- return {};
28
+ return {
29
+ width: "800px",
30
+ fullscreen: false,
31
+ minHeight: "200px",
32
+ draggable: true
33
+ };
29
34
  },
30
35
  type: Object
31
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"props.mjs","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: '100px', type: [String, Number] },\n // 是否为弹窗\n isDialog: { default: false, type: Boolean },\n // 弹窗显示后获取formData\n dialogWait: { default: true, type: Boolean },\n // 弹窗配置\n dialog: {\n default: () => {\n return {}\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,SAAA,EAAW,EAAE,OAAS,EAAA,OAAA,EAAS,MAAM,CAAC,MAAA,EAAQ,MAAM,CAAE,EAAA;AAAA;AAAA,EAEtD,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,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
1
+ {"version":3,"file":"props.mjs","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;;;;"}
@@ -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
- default: string;
77
- type: StringConstructor;
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
- default: string;
129
- type: StringConstructor;
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
- default: string;
158
- type: StringConstructor;
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
- default: string;
8
- type: StringConstructor;
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
- default: string;
33
- type: StringConstructor;
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
  }, {}>, {
@@ -18,12 +18,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  return key;
19
19
  });
20
20
  const getIconifyStyle = computed(() => {
21
- const { color, size } = props;
22
- return {
23
- fontSize: `${size}px`,
24
- color,
25
- "--hover-color": props.hoverColor
26
- };
21
+ const { color, size, hoverColor } = props;
22
+ const style = {};
23
+ if (color)
24
+ style.color = color;
25
+ if (size)
26
+ style.fontSize = `${size}px`;
27
+ if (hoverColor)
28
+ style["--hover-color"] = hoverColor;
29
+ return style;
27
30
  });
28
31
  const iconType = computed(() => {
29
32
  let type = "cloud";
@@ -1 +1 @@
1
- {"version":3,"file":"icon.vue2.mjs","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 return {\n fontSize: `${size}px`,\n color,\n '--hover-color': props.hoverColor,\n }\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"],"mappings":";;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAoBD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,MAAM,CAAA,CAAA;AAKvC,IAAA,MAAM,UAAU,MAAO,CAAA,IAAA,CAAK,mBAAmB,CAAE,CAAA,GAAA,CAAI,CAAC,GAAQ,KAAA;AAC5D,MAAO,OAAA,GAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,eAAA,GAAkB,SAAS,MAAM;AACrC,MAAM,MAAA,EAAE,KAAO,EAAA,IAAA,EAAS,GAAA,KAAA,CAAA;AACxB,MAAO,OAAA;AAAA,QACL,QAAA,EAAU,GAAG,IAAI,CAAA,EAAA,CAAA;AAAA,QACjB,KAAA;AAAA,QACA,iBAAiB,KAAM,CAAA,UAAA;AAAA,OACzB,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC9B,MAAA,IAAI,IAAO,GAAA,OAAA,CAAA;AACX,MAAA,IAAI,QAAQ,QAAS,CAAA,KAAA,CAAM,IAAI,CAAA,IAAK,MAAM,MAAQ,EAAA;AAChD,QAAO,IAAA,GAAA,IAAA,CAAA;AAAA,OACT;AACA,MAAA,IAAI,MAAM,QAAU,EAAA;AAElB,QAAA,IAAI,KAAM,CAAA,KAAA,CAAM,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACpC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AACA,QAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACtC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AACA,QAAA,IAAI,KAAM,CAAA,MAAA,CAAO,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACrC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AAAA,OACF;AACA,MAAO,OAAA,IAAA,CAAA;AAAA,KACR,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"icon.vue2.mjs","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"],"mappings":";;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,QAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAoBD,IAAA,MAAM,CAAC,CAAA,EAAG,GAAG,CAAA,GAAI,gBAAgB,MAAM,CAAA,CAAA;AAKvC,IAAA,MAAM,UAAU,MAAO,CAAA,IAAA,CAAK,mBAAmB,CAAE,CAAA,GAAA,CAAI,CAAC,GAAQ,KAAA;AAC5D,MAAO,OAAA,GAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,eAAA,GAAkB,SAAS,MAAM;AACrC,MAAA,MAAM,EAAE,KAAA,EAAO,IAAM,EAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AACpC,MAAA,MAAM,QAAa,EAAC,CAAA;AACpB,MAAI,IAAA,KAAA;AAAO,QAAA,KAAA,CAAM,KAAQ,GAAA,KAAA,CAAA;AACzB,MAAI,IAAA,IAAA;AAAM,QAAM,KAAA,CAAA,QAAA,GAAW,GAAG,IAAI,CAAA,EAAA,CAAA,CAAA;AAClC,MAAI,IAAA,UAAA;AAAY,QAAA,KAAA,CAAM,eAAe,CAAI,GAAA,UAAA,CAAA;AACzC,MAAO,OAAA,KAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAM,MAAA,QAAA,GAAW,SAAS,MAAM;AAC9B,MAAA,IAAI,IAAO,GAAA,OAAA,CAAA;AACX,MAAA,IAAI,QAAQ,QAAS,CAAA,KAAA,CAAM,IAAI,CAAA,IAAK,MAAM,MAAQ,EAAA;AAChD,QAAO,IAAA,GAAA,IAAA,CAAA;AAAA,OACT;AACA,MAAA,IAAI,MAAM,QAAU,EAAA;AAElB,QAAA,IAAI,KAAM,CAAA,KAAA,CAAM,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACpC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AACA,QAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACtC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AACA,QAAA,IAAI,KAAM,CAAA,MAAA,CAAO,QAAS,CAAA,KAAA,CAAM,IAAI,CAAG,EAAA;AACrC,UAAO,IAAA,GAAA,MAAA,CAAA;AAAA,SACT;AAAA,OACF;AACA,MAAO,OAAA,IAAA,CAAA;AAAA,KACR,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,18 +7,9 @@ export declare const iconProps: {
7
7
  default: string;
8
8
  type: StringConstructor;
9
9
  };
10
- color: {
11
- default: string;
12
- type: StringConstructor;
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;
@@ -8,20 +8,11 @@ const iconProps = {
8
8
  type: String
9
9
  },
10
10
  // icon color
11
- color: {
12
- default: "",
13
- type: String
14
- },
11
+ color: String,
15
12
  // icon size
16
- size: {
17
- default: 14,
18
- type: Number
19
- },
13
+ size: Number,
20
14
  // icon hover
21
- hoverColor: {
22
- default: "",
23
- type: String
24
- },
15
+ hoverColor: String,
25
16
  showEl: {
26
17
  default: true,
27
18
  type: Boolean
@@ -1 +1 @@
1
- {"version":3,"file":"props.mjs","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: {\n default: '',\n type: String,\n },\n // icon size\n size: {\n default: 14,\n type: Number,\n },\n // icon hover\n hoverColor: {\n default: '',\n type: String,\n },\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;AAAA,IACL,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA,EAEA,IAAM,EAAA;AAAA,IACJ,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA;AAAA,EAEA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,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;;;;"}
1
+ {"version":3,"file":"props.mjs","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/es/index.scss CHANGED
@@ -40,6 +40,11 @@
40
40
  background-color: #ccc;
41
41
  }
42
42
 
43
+ *,
44
+ *::before,
45
+ *::after {
46
+ box-sizing: border-box;
47
+ }
43
48
 
44
49
  /* 由于unocss不支持 单独提取 */
45
50
  //.visible{visibility:visible;}
@@ -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;