m-eleplus-crud 0.0.3 → 0.0.4

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.
Files changed (44) hide show
  1. package/dist/index.full.js +27 -16
  2. package/dist/index.full.min.js +15 -15
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +16 -16
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +28 -17
  7. package/es/components/form/src/form.d.ts +5 -1
  8. package/es/index.mjs +3 -3
  9. package/es/packages/components/form/index.mjs +2 -2
  10. package/es/packages/components/form/src/form.mjs +25 -622
  11. package/es/packages/components/form/src/form.mjs.map +1 -1
  12. package/es/packages/components/form/src/form2.mjs +633 -25
  13. package/es/packages/components/form/src/form2.mjs.map +1 -1
  14. package/es/packages/components/index.mjs +3 -3
  15. package/es/packages/components/picture/index.mjs +2 -2
  16. package/es/packages/components/picture/src/picture.mjs +19 -26
  17. package/es/packages/components/picture/src/picture.mjs.map +1 -1
  18. package/es/packages/components/picture/src/picture2.mjs +26 -19
  19. package/es/packages/components/picture/src/picture2.mjs.map +1 -1
  20. package/es/packages/components/search/index.mjs +2 -2
  21. package/es/packages/components/search/src/search.mjs +423 -25
  22. package/es/packages/components/search/src/search.mjs.map +1 -1
  23. package/es/packages/components/search/src/search2.mjs +25 -423
  24. package/es/packages/components/search/src/search2.mjs.map +1 -1
  25. package/lib/components/form/src/form.d.ts +5 -1
  26. package/lib/index.js +3 -3
  27. package/lib/packages/components/form/index.js +2 -2
  28. package/lib/packages/components/form/src/form.js +26 -622
  29. package/lib/packages/components/form/src/form.js.map +1 -1
  30. package/lib/packages/components/form/src/form2.js +633 -26
  31. package/lib/packages/components/form/src/form2.js.map +1 -1
  32. package/lib/packages/components/index.js +3 -3
  33. package/lib/packages/components/picture/index.js +2 -2
  34. package/lib/packages/components/picture/src/picture.js +20 -26
  35. package/lib/packages/components/picture/src/picture.js.map +1 -1
  36. package/lib/packages/components/picture/src/picture2.js +26 -20
  37. package/lib/packages/components/picture/src/picture2.js.map +1 -1
  38. package/lib/packages/components/search/index.js +2 -2
  39. package/lib/packages/components/search/src/search.js +423 -26
  40. package/lib/packages/components/search/src/search.js.map +1 -1
  41. package/lib/packages/components/search/src/search2.js +26 -423
  42. package/lib/packages/components/search/src/search2.js.map +1 -1
  43. package/package.json +1 -1
  44. package/web-types.json +1 -1
@@ -1,6 +1,6 @@
1
1
  /*! M ElePlus Crud v0.0.1 */
2
2
 
3
- import { shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, inject, computed, isRef, provide, renderSlot, useSlots, resolveComponent, createVNode, withModifiers, withCtx, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withKeys, createTextVNode, toDisplayString, normalizeStyle, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, resolveDynamicComponent, onBeforeUnmount, Text, reactive, h, markRaw, toRefs, Transition, withDirectives, vShow, isVNode, render as render$1, createSlots, normalizeProps, guardReactiveProps, resolveDirective } from 'vue';
3
+ import { shallowRef, watchEffect, readonly, getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, watch, ref, defineComponent, openBlock, createElementBlock, createElementVNode, warn, inject, computed, isRef, provide, renderSlot, useSlots, resolveComponent, createVNode, withModifiers, withCtx, Fragment, renderList, createBlock, createCommentVNode, mergeProps, withKeys, createTextVNode, toDisplayString, normalizeStyle, toHandlers, toRef, onUnmounted, useAttrs as useAttrs$1, normalizeClass, resolveDynamicComponent, onBeforeUnmount, Text, reactive, h, markRaw, toRefs, Transition, withDirectives, vShow, isVNode, render as render$1, createSlots, normalizeProps, guardReactiveProps, resolveDirective } from 'vue';
4
4
 
5
5
  const INSTALLED_KEY = Symbol("INSTALLED_KEY");
6
6
 
@@ -12804,6 +12804,17 @@ const _sfc_main$9 = defineComponent({
12804
12804
  }
12805
12805
  }
12806
12806
  };
12807
+ const getFormItemEventBind = (column) => {
12808
+ const result = {};
12809
+ for (const key in column) {
12810
+ if (key.startsWith("event")) {
12811
+ let funName = key.replace("event", "");
12812
+ funName = funName.charAt(0).toLowerCase() + funName.slice(1);
12813
+ result[funName] = column[key];
12814
+ }
12815
+ }
12816
+ return result;
12817
+ };
12807
12818
  const formatDicValue = (row, column) => {
12808
12819
  let dictLabel = "";
12809
12820
  const findLabelByValue = (dicData, value) => {
@@ -12955,7 +12966,7 @@ const _sfc_main$9 = defineComponent({
12955
12966
  [
12956
12967
  createCommentVNode(""),
12957
12968
  createCommentVNode("\u8F93\u5165\u6846"),
12958
- createVNode(_component_el_input, {
12969
+ createVNode(_component_el_input, mergeProps({
12959
12970
  modelValue: unref(proxys)[column.prop || ""],
12960
12971
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
12961
12972
  modelModifiers: { trim: true },
@@ -12965,7 +12976,7 @@ const _sfc_main$9 = defineComponent({
12965
12976
  "show-word-limit": column.showWordLimit,
12966
12977
  "show-password": column.showPassword,
12967
12978
  type: !column.type || column.type === "input" ? "text" : column.type
12968
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "show-password", "type"])
12979
+ }, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "placeholder", "maxlength", "show-word-limit", "show-password", "type"])
12969
12980
  ],
12970
12981
  2112
12971
12982
  )) : column.type === "select" ? (openBlock(), createElementBlock(
@@ -12974,7 +12985,7 @@ const _sfc_main$9 = defineComponent({
12974
12985
  [
12975
12986
  createCommentVNode(""),
12976
12987
  createCommentVNode("\u4E0B\u62C9\u6846"),
12977
- createVNode(_component_el_select, {
12988
+ createVNode(_component_el_select, mergeProps({
12978
12989
  modelValue: unref(proxys)[column.prop || ""],
12979
12990
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
12980
12991
  modelModifiers: { trim: true },
@@ -12987,7 +12998,7 @@ const _sfc_main$9 = defineComponent({
12987
12998
  remote: column.remote,
12988
12999
  "remote-method": column.remoteMethod,
12989
13000
  loading: column.loading
12990
- }, {
13001
+ }, toHandlers(getFormItemEventBind(column))), {
12991
13002
  default: withCtx(() => [
12992
13003
  (openBlock(true), createElementBlock(
12993
13004
  Fragment,
@@ -13003,7 +13014,7 @@ const _sfc_main$9 = defineComponent({
13003
13014
  ))
13004
13015
  ]),
13005
13016
  _: 2
13006
- }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "clearable", "filterable", "filter-method", "remote", "remote-method", "loading"])
13017
+ }, 1040, ["modelValue", "onUpdate:modelValue", "placeholder", "multiple", "clearable", "filterable", "filter-method", "remote", "remote-method", "loading"])
13007
13018
  ],
13008
13019
  2112
13009
13020
  )) : column.type === "radio" ? (openBlock(), createElementBlock(
@@ -13012,11 +13023,11 @@ const _sfc_main$9 = defineComponent({
13012
13023
  [
13013
13024
  createCommentVNode(""),
13014
13025
  createCommentVNode("radio"),
13015
- createVNode(_component_el_radio_group, {
13026
+ createVNode(_component_el_radio_group, mergeProps({
13016
13027
  modelValue: unref(proxys)[column.prop || ""],
13017
13028
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
13018
13029
  style: { "width": "100%" }
13019
- }, {
13030
+ }, toHandlers(getFormItemEventBind(column))), {
13020
13031
  default: withCtx(() => [
13021
13032
  (openBlock(true), createElementBlock(
13022
13033
  Fragment,
@@ -13040,7 +13051,7 @@ const _sfc_main$9 = defineComponent({
13040
13051
  ))
13041
13052
  ]),
13042
13053
  _: 2
13043
- }, 1032, ["modelValue", "onUpdate:modelValue"])
13054
+ }, 1040, ["modelValue", "onUpdate:modelValue"])
13044
13055
  ],
13045
13056
  2112
13046
13057
  )) : column.type === "checkbox" ? (openBlock(), createElementBlock(
@@ -13049,11 +13060,11 @@ const _sfc_main$9 = defineComponent({
13049
13060
  [
13050
13061
  createCommentVNode(""),
13051
13062
  createCommentVNode("checkbox"),
13052
- createVNode(_component_el_checkbox_group, {
13063
+ createVNode(_component_el_checkbox_group, mergeProps({
13053
13064
  modelValue: unref(proxys)[column.prop || ""],
13054
13065
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
13055
13066
  style: { "width": "100%" }
13056
- }, {
13067
+ }, toHandlers(getFormItemEventBind(column))), {
13057
13068
  default: withCtx(() => [
13058
13069
  (openBlock(true), createElementBlock(
13059
13070
  Fragment,
@@ -13069,7 +13080,7 @@ const _sfc_main$9 = defineComponent({
13069
13080
  ))
13070
13081
  ]),
13071
13082
  _: 2
13072
- }, 1032, ["modelValue", "onUpdate:modelValue"])
13083
+ }, 1040, ["modelValue", "onUpdate:modelValue"])
13073
13084
  ],
13074
13085
  2112
13075
13086
  )) : column.type === "switch" ? (openBlock(), createElementBlock(
@@ -13085,12 +13096,12 @@ const _sfc_main$9 = defineComponent({
13085
13096
  Fragment,
13086
13097
  { key: 1 },
13087
13098
  [
13088
- createVNode(_component_el_switch, {
13099
+ createVNode(_component_el_switch, mergeProps({
13089
13100
  modelValue: unref(proxys)[column.prop || ""],
13090
13101
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
13091
13102
  "active-value": column.dicData[0].value,
13092
13103
  "inactive-value": column.dicData[1].value
13093
- }, null, 8, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"]),
13104
+ }, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "active-value", "inactive-value"]),
13094
13105
  createElementVNode(
13095
13106
  "span",
13096
13107
  { style: { "font-size": "var(--el-font-size-base)", "color": "var(--el-text-color-regular)", "margin-left": "6px" } },
@@ -13108,7 +13119,7 @@ const _sfc_main$9 = defineComponent({
13108
13119
  [
13109
13120
  createCommentVNode(""),
13110
13121
  createCommentVNode("\u65F6\u95F4"),
13111
- column.type !== "time" && column.type !== "timerange" ? (openBlock(), createBlock(_component_el_date_picker, {
13122
+ column.type !== "time" && column.type !== "timerange" ? (openBlock(), createBlock(_component_el_date_picker, mergeProps({
13112
13123
  key: 0,
13113
13124
  modelValue: unref(proxys)[column.prop || ""],
13114
13125
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
@@ -13118,7 +13129,7 @@ const _sfc_main$9 = defineComponent({
13118
13129
  "end-placeholder": column.endPlaceholder,
13119
13130
  format: column.format,
13120
13131
  "value-format": column.valueFormat || getValueFormatByType(column.type)
13121
- }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "clearable", "start-placeholder", "end-placeholder", "format", "value-format"])) : (openBlock(), createBlock(_component_el_time_picker, {
13132
+ }, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "type", "clearable", "start-placeholder", "end-placeholder", "format", "value-format"])) : (openBlock(), createBlock(_component_el_time_picker, mergeProps({
13122
13133
  key: 1,
13123
13134
  modelValue: unref(proxys)[column.prop || ""],
13124
13135
  "onUpdate:modelValue": ($event) => unref(proxys)[column.prop || ""] = $event,
@@ -13127,7 +13138,7 @@ const _sfc_main$9 = defineComponent({
13127
13138
  "start-placeholder": column.startPlaceholder,
13128
13139
  "end-placeholder": column.endPlaceholder,
13129
13140
  "value-format": column.valueFormat || getValueFormatByType(column.type)
13130
- }, null, 8, ["modelValue", "onUpdate:modelValue", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
13141
+ }, toHandlers(getFormItemEventBind(column))), null, 16, ["modelValue", "onUpdate:modelValue", "is-range", "clearable", "start-placeholder", "end-placeholder", "value-format"]))
13131
13142
  ],
13132
13143
  64
13133
13144
  )) : column.type === "picture" ? (openBlock(), createElementBlock(
@@ -1,10 +1,13 @@
1
1
  import type { ColumnType, ICommonColumn } from '../../common';
2
2
  import type { FormItemRule } from 'element-plus';
3
3
  import type { ExtractPropTypes } from 'vue';
4
+ type EventHandlers = {
5
+ [K in `event${string}`]?: (...args: any[]) => any;
6
+ };
4
7
  /**
5
8
  * @description 公开的form column配置
6
9
  */
7
- export interface IFormCommonColumn {
10
+ export interface IFormCommonColumn extends EventHandlers {
8
11
  /**
9
12
  * 表单校验规则
10
13
  */
@@ -89,3 +92,4 @@ export declare const formProps: {
89
92
  export type FormProps = ExtractPropTypes<typeof formProps>;
90
93
  export declare const formEmits: {};
91
94
  export type FormEmits = typeof formEmits;
95
+ export {};
package/es/index.mjs CHANGED
@@ -7,9 +7,9 @@ export { provideGlobalConfig, useGlobalComponentSettings, useGlobalConfig } from
7
7
  export { MConfigProvider } from './packages/components/config-provider/index.mjs';
8
8
  export { tableEmits, tableProps } from './packages/components/table/src/table.mjs';
9
9
  export { MTable } from './packages/components/table/index.mjs';
10
- export { searchEmits, searchProps } from './packages/components/search/src/search.mjs';
10
+ export { searchEmits, searchProps } from './packages/components/search/src/search2.mjs';
11
11
  export { MSearch } from './packages/components/search/index.mjs';
12
- export { pictureEmits, pictureProps } from './packages/components/picture/src/picture2.mjs';
12
+ export { pictureEmits, pictureProps } from './packages/components/picture/src/picture.mjs';
13
13
  export { MPicture } from './packages/components/picture/index.mjs';
14
14
  export { dialogEmits, dialogProps } from './packages/components/dialog/src/dialog.mjs';
15
15
  export { MDialog } from './packages/components/dialog/index.mjs';
@@ -17,7 +17,7 @@ export { qrcodeEmits, qrcodeProps } from './packages/components/qrcode/src/qrcod
17
17
  export { MQrcode } from './packages/components/qrcode/index.mjs';
18
18
  export { barcodeEmits, barcodeProps } from './packages/components/barcode/src/barcode.mjs';
19
19
  export { MBarcode } from './packages/components/barcode/index.mjs';
20
- export { formEmits, formProps } from './packages/components/form/src/form2.mjs';
20
+ export { formEmits, formProps } from './packages/components/form/src/form.mjs';
21
21
  export { MForm } from './packages/components/form/index.mjs';
22
22
  export { crudEmits, crudProps } from './packages/components/crud/src/crud2.mjs';
23
23
  export { MCrud } from './packages/components/crud/index.mjs';
@@ -1,5 +1,5 @@
1
- import Form from './src/form.mjs';
2
- export { formEmits, formProps } from './src/form2.mjs';
1
+ import Form from './src/form2.mjs';
2
+ export { formEmits, formProps } from './src/form.mjs';
3
3
  import { withInstall } from '../../utils/vue/install.mjs';
4
4
 
5
5
  const MForm = withInstall(Form);