el-plus 0.0.20 → 0.0.21

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.
@@ -1,4 +1,4 @@
1
- /*! ElPlus v0.0.20 */
1
+ /*! ElPlus v0.0.21 */
2
2
 
3
3
  import { useAttrs, getCurrentInstance, inject, provide, ref, nextTick, defineComponent, computed, createVNode, Fragment, withDirectives, resolveComponent, mergeProps, resolveDirective, useTemplateRef, createTextVNode, h, mergeModels, useModel, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withCtx, renderSlot, renderList, createBlock, vShow, toDisplayString, reactive, useSlots, watch, onMounted, createSlots, normalizeProps, guardReactiveProps, markRaw, Transition, shallowReactive, isVNode, render, createElementVNode, toRaw } from 'vue';
4
4
  import { buttonProps, useLocale as useLocale$1, ElLoading, ElMessage, ElMessageBox, formProps as formProps$1, formEmits as formEmits$1, ElTooltip, formItemProps as formItemProps$1, ElFormItem, ElForm, ElRow, ElCol, inputProps as inputProps$1, inputEmits as inputEmits$1, ElDialog, ElButton, ElTable, ElIcon, selectProps as selectProps$1, selectEmits as selectEmits$1, ElPageHeader, datePickerProps, linkProps as linkProps$1 } from 'element-plus';
@@ -2868,13 +2868,13 @@ function useSelect(props, emit) {
2868
2868
  };
2869
2869
  const getSelectItem = (value) => {
2870
2870
  if (Array.isArray(value)) {
2871
- if (!props.options) return [];
2872
- return props.options.filter((item) => {
2871
+ if (!customOptions.value) return [];
2872
+ return customOptions.value.filter((item) => {
2873
2873
  return value.indexOf(item[props.valueKey]) > -1;
2874
2874
  });
2875
2875
  }
2876
- if (!props.options) return {};
2877
- return props.options.find((item) => {
2876
+ if (!customOptions.value) return {};
2877
+ return customOptions.value.find((item) => {
2878
2878
  return item[props.valueKey] === value;
2879
2879
  }) || {};
2880
2880
  };
@@ -3106,8 +3106,7 @@ const EpTitle = withInstall(_sfc_main$3);
3106
3106
  const headerProps = {
3107
3107
  // 页面模式
3108
3108
  mode: {
3109
- type: String,
3110
- default: "add"
3109
+ type: String
3111
3110
  },
3112
3111
  allowBack: {
3113
3112
  type: Boolean,
@@ -3520,7 +3519,7 @@ var components = [
3520
3519
  EpLink
3521
3520
  ];
3522
3521
 
3523
- var version = "0.0.20";
3522
+ var version = "0.0.21";
3524
3523
 
3525
3524
  var globalProperties = {
3526
3525
  install(app) {
@@ -2,7 +2,6 @@ export declare const EpHeader: {
2
2
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
3
3
  readonly mode: {
4
4
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
5
- readonly default: "add";
6
5
  };
7
6
  readonly allowBack: {
8
7
  readonly type: BooleanConstructor;
@@ -31,7 +30,6 @@ export declare const EpHeader: {
31
30
  };
32
31
  readonly workflowId: StringConstructor;
33
32
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
34
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
35
33
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
36
34
  name: string;
37
35
  prop: string;
@@ -57,7 +55,6 @@ export declare const EpHeader: {
57
55
  }, Readonly<import("vue").ExtractPropTypes<{
58
56
  readonly mode: {
59
57
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
60
- readonly default: "add";
61
58
  };
62
59
  readonly allowBack: {
63
60
  readonly type: BooleanConstructor;
@@ -86,7 +83,6 @@ export declare const EpHeader: {
86
83
  };
87
84
  readonly workflowId: StringConstructor;
88
85
  }>> & Readonly<{}>, {}, {}, {}, {}, {
89
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
90
86
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
91
87
  name: string;
92
88
  prop: string;
@@ -109,7 +105,6 @@ export declare const EpHeader: {
109
105
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
110
106
  readonly mode: {
111
107
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
112
- readonly default: "add";
113
108
  };
114
109
  readonly allowBack: {
115
110
  readonly type: BooleanConstructor;
@@ -126,7 +121,6 @@ export declare const EpHeader: {
126
121
  };
127
122
  readonly workflowId: StringConstructor;
128
123
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
129
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
130
124
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
131
125
  name: string;
132
126
  prop: string;
@@ -4,7 +4,6 @@ export type defaultButtonsProps = 'modify' | 'save' | 'cancel' | 'refresh' | 'au
4
4
  export declare const headerProps: {
5
5
  readonly mode: {
6
6
  readonly type: PropType<PageMode>;
7
- readonly default: "add";
8
7
  };
9
8
  readonly allowBack: {
10
9
  readonly type: BooleanConstructor;
@@ -3,8 +3,7 @@ import { buttonsProps } from '../../buttons/src/buttons.mjs';
3
3
  const headerProps = {
4
4
  // 页面模式
5
5
  mode: {
6
- type: String,
7
- default: "add"
6
+ type: String
8
7
  },
9
8
  allowBack: {
10
9
  type: Boolean,
@@ -1 +1 @@
1
- {"version":3,"file":"header.mjs","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n default: 'add',\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":[],"mappings":";;AAUO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAG,YAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY;AACd;AAGO,MAAM,cAAc;;;;"}
1
+ {"version":3,"file":"header.mjs","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":[],"mappings":";;AAUO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAG,YAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY;AACd;AAGO,MAAM,cAAc;;;;"}
@@ -1,7 +1,6 @@
1
1
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  readonly mode: {
3
3
  readonly type: import("vue").PropType<import("packages/hooks").PageMode>;
4
- readonly default: "add";
5
4
  };
6
5
  readonly allowBack: {
7
6
  readonly type: BooleanConstructor;
@@ -20,7 +19,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
20
19
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
21
20
  readonly mode: {
22
21
  readonly type: import("vue").PropType<import("packages/hooks").PageMode>;
23
- readonly default: "add";
24
22
  };
25
23
  readonly allowBack: {
26
24
  readonly type: BooleanConstructor;
@@ -37,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
37
35
  };
38
36
  readonly workflowId: StringConstructor;
39
37
  }>> & Readonly<{}>, {
40
- readonly mode: import("packages/hooks").PageMode;
41
38
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
42
39
  name: string;
43
40
  prop: string;
@@ -48,13 +48,13 @@ function useSelect(props, emit) {
48
48
  };
49
49
  const getSelectItem = (value) => {
50
50
  if (Array.isArray(value)) {
51
- if (!props.options) return [];
52
- return props.options.filter((item) => {
51
+ if (!customOptions.value) return [];
52
+ return customOptions.value.filter((item) => {
53
53
  return value.indexOf(item[props.valueKey]) > -1;
54
54
  });
55
55
  }
56
- if (!props.options) return {};
57
- return props.options.find((item) => {
56
+ if (!customOptions.value) return {};
57
+ return customOptions.value.find((item) => {
58
58
  return item[props.valueKey] === value;
59
59
  }) || {};
60
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-select.mjs","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref } from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n customOptions.value = data as OptionArr\n } else if (data && typeof data === 'object') {\n const rawData = data as OptionObj\n customOptions.value = rawData?.list || rawData?.data || []\n } else {\n customOptions.value = []\n }\n hasLoaded = true\n },\n fail(error) {\n console.error(error)\n },\n },\n })\n // 下拉列表\n const customOptions = ref<SelectOption[]>([]) // 下拉列表\n // 加载下拉列表\n const loadOptions = (\n value: SelectProps['modelValue'],\n desc: string | undefined,\n ) => {\n if ((value || value === 0) && desc) {\n customOptions.value = [\n {\n [props.labelKey]: desc,\n [props.valueKey]: value,\n },\n ]\n }\n if (props.api) {\n if (!props.lazy && !props.remote) {\n requestFn!()\n }\n } else if (props.options?.length) {\n customOptions.value = props.options\n }\n }\n // 获取选中项\n const getSelectItem = (value: SelectProps['modelValue']) => {\n if (Array.isArray(value)) {\n if (!props.options) return []\n return props.options.filter((item: SelectOption) => {\n return value.indexOf(item[props.valueKey]) > -1\n })\n }\n if (!props.options) return {}\n return (\n props.options.find((item: SelectOption) => {\n return item[props.valueKey] === value\n }) || {}\n )\n }\n const expandAttrs = {\n loading: props.loading || loading?.value,\n remoteMethod: (query: string) => {\n if (!query) return\n requestFn!({\n $searchValue: query,\n })\n },\n onChange(value: SelectProps['modelValue']) {\n emit('change', value, getSelectItem(value))\n },\n onVisibleChange(visible: boolean) {\n if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {\n requestFn!()\n }\n emit('visible-change', visible)\n },\n }\n return {\n customOptions,\n loadOptions,\n expandAttrs,\n }\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,SAAA,CACd,OACA,IAAA,EACA;AACA,EAAA,IAAI,SAAA,GAAY,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,UAAA,CAAW;AAAA,IACxC,KAAK,KAAA,CAAM,GAAA;AAAA,IACX,QAAQ,KAAA,CAAM,MAAA;AAAA,IACd,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,aAAa,KAAA,CAAM,MAAA;AAAA,IACnB,KAAA,EAAO;AAAA,MACL,QAAQ,IAAA,EAAM;AAMZ,QAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,UAAA,aAAA,CAAc,KAAA,GAAQ,IAAA;AAAA,QACxB,CAAA,MAAA,IAAW,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AAC3C,UAAA,MAAM,OAAA,GAAU,IAAA;AAChB,UAAA,aAAA,CAAc,KAAA,GAAQ,OAAA,EAAS,IAAA,IAAQ,OAAA,EAAS,QAAQ,EAAC;AAAA,QAC3D,CAAA,MAAO;AACL,UAAA,aAAA,CAAc,QAAQ,EAAC;AAAA,QACzB;AACA,QAAA,SAAA,GAAY,IAAA;AAAA,MACd,CAAA;AAAA,MACA,KAAK,KA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KAAuB;AACzC,MAAA,OAAO,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA,KAAM,KAAA;AAAA,IAClC,CAAC,KAAK,EAAC;AAAA,EAEX,CAAA;AACA,EAAA,MAAM,WAAA,GAAc;AAAA,IAClB,OAAA,EAAS,KAAA,CAAM,OAAA,IAAW,OAAA,EAAS,KAAA;AAAA,IACnC,YAAA,EAAc,CAAC,KAAA,KAAkB;AAC/B,MAAA,IAAI,CAAC,KAAA,EAAO;AACZ,MAAA,SAAA,CAAW;AAAA,QACT,YAAA,EAAc;AAAA,OACf,CAAA;AAAA,IACH,CAAA;AAAA,IACA,SAAS,KAAA,EAAkC;AACzC,MAAA,IAAA,CAAK,QAAA,EAAU,KAAA,EAAO,aAAA,CAAc,KAAK,CAAC,CAAA;AAAA,IAC5C,CAAA;AAAA,IACA,gBAAgB,OAAA,EAAkB;AAChC,MAAA,IAAI,KAAA,CAAM,OAAO,KAAA,CAAM,IAAA,IAAQ,WAAW,CAAC,SAAA,IAAa,CAAC,KAAA,CAAM,MAAA,EAAQ;AACrE,QAAA,SAAA,EAAW;AAAA,MACb;AACA,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA;AAAA,IAChC;AAAA,GACF;AACA,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"use-select.mjs","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref } from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n customOptions.value = data as OptionArr\n } else if (data && typeof data === 'object') {\n const rawData = data as OptionObj\n customOptions.value = rawData?.list || rawData?.data || []\n } else {\n customOptions.value = []\n }\n hasLoaded = true\n },\n fail(error) {\n console.error(error)\n },\n },\n })\n // 下拉列表\n const customOptions = ref<SelectOption[]>([]) // 下拉列表\n // 加载下拉列表\n const loadOptions = (\n value: SelectProps['modelValue'],\n desc: string | undefined,\n ) => {\n if ((value || value === 0) && desc) {\n customOptions.value = [\n {\n [props.labelKey]: desc,\n [props.valueKey]: value,\n },\n ]\n }\n if (props.api) {\n if (!props.lazy && !props.remote) {\n requestFn!()\n }\n } else if (props.options?.length) {\n customOptions.value = props.options\n }\n }\n // 获取选中项\n const getSelectItem = (value: SelectProps['modelValue']) => {\n if (Array.isArray(value)) {\n if (!customOptions.value) return []\n return customOptions.value.filter((item: SelectOption) => {\n return value.indexOf(item[props.valueKey]) > -1\n })\n }\n if (!customOptions.value) return {}\n return (\n customOptions.value.find((item: SelectOption) => {\n return item[props.valueKey] === value\n }) || {}\n )\n }\n const expandAttrs = {\n loading: props.loading || loading?.value,\n remoteMethod: (query: string) => {\n if (!query) return\n requestFn!({\n $searchValue: query,\n })\n },\n onChange(value: SelectProps['modelValue']) {\n emit('change', value, getSelectItem(value))\n },\n onVisibleChange(visible: boolean) {\n if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {\n requestFn!()\n }\n emit('visible-change', visible)\n },\n }\n return {\n customOptions,\n loadOptions,\n expandAttrs,\n }\n}\n"],"names":[],"mappings":";;;AAIO,SAAS,SAAA,CACd,OACA,IAAA,EACA;AACA,EAAA,IAAI,SAAA,GAAY,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAI,UAAA,CAAW;AAAA,IACxC,KAAK,KAAA,CAAM,GAAA;AAAA,IACX,QAAQ,KAAA,CAAM,MAAA;A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,CAAM,OAAO,KAAA,CAAM,IAAA,IAAQ,WAAW,CAAC,SAAA,IAAa,CAAC,KAAA,CAAM,MAAA,EAAQ;AACrE,QAAA,SAAA,EAAW;AAAA,MACb;AACA,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA;AAAA,IAChC;AAAA,GACF;AACA,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- var version = "0.0.20";
1
+ var version = "0.0.21";
2
2
 
3
3
  export { version };
4
4
  //# sourceMappingURL=package.json.mjs.map
@@ -2,7 +2,6 @@ export declare const EpHeader: {
2
2
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
3
3
  readonly mode: {
4
4
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
5
- readonly default: "add";
6
5
  };
7
6
  readonly allowBack: {
8
7
  readonly type: BooleanConstructor;
@@ -31,7 +30,6 @@ export declare const EpHeader: {
31
30
  };
32
31
  readonly workflowId: StringConstructor;
33
32
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
34
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
35
33
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
36
34
  name: string;
37
35
  prop: string;
@@ -57,7 +55,6 @@ export declare const EpHeader: {
57
55
  }, Readonly<import("vue").ExtractPropTypes<{
58
56
  readonly mode: {
59
57
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
60
- readonly default: "add";
61
58
  };
62
59
  readonly allowBack: {
63
60
  readonly type: BooleanConstructor;
@@ -86,7 +83,6 @@ export declare const EpHeader: {
86
83
  };
87
84
  readonly workflowId: StringConstructor;
88
85
  }>> & Readonly<{}>, {}, {}, {}, {}, {
89
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
90
86
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
91
87
  name: string;
92
88
  prop: string;
@@ -109,7 +105,6 @@ export declare const EpHeader: {
109
105
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
110
106
  readonly mode: {
111
107
  readonly type: import("vue").PropType<import("packages/hooks/use-navigation.js").PageMode>;
112
- readonly default: "add";
113
108
  };
114
109
  readonly allowBack: {
115
110
  readonly type: BooleanConstructor;
@@ -126,7 +121,6 @@ export declare const EpHeader: {
126
121
  };
127
122
  readonly workflowId: StringConstructor;
128
123
  }>> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
129
- readonly mode: import("packages/hooks/use-navigation.js").PageMode;
130
124
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
131
125
  name: string;
132
126
  prop: string;
@@ -4,7 +4,6 @@ export type defaultButtonsProps = 'modify' | 'save' | 'cancel' | 'refresh' | 'au
4
4
  export declare const headerProps: {
5
5
  readonly mode: {
6
6
  readonly type: PropType<PageMode>;
7
- readonly default: "add";
8
7
  };
9
8
  readonly allowBack: {
10
9
  readonly type: BooleanConstructor;
@@ -5,8 +5,7 @@ var buttons = require('../../buttons/src/buttons.js');
5
5
  const headerProps = {
6
6
  // 页面模式
7
7
  mode: {
8
- type: String,
9
- default: "add"
8
+ type: String
10
9
  },
11
10
  allowBack: {
12
11
  type: Boolean,
@@ -1 +1 @@
1
- {"version":3,"file":"header.js","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n default: 'add',\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":["buttonsProps"],"mappings":";;;;AAUO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM,MAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAGA,oBAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY;AACd;AAGO,MAAM,cAAc;;;;;"}
1
+ {"version":3,"file":"header.js","sources":["../../../../../../packages/components/header/src/header.ts"],"sourcesContent":["import type { ExtractPropTypes, PropType } from 'vue'\nimport { buttonsProps } from '@el-plus/components/buttons'\nimport type { PageMode } from '@el-plus/hooks/use-navigation'\nexport type defaultButtonsProps =\n | 'modify'\n | 'save'\n | 'cancel'\n | 'refresh'\n | 'auditLog'\n\nexport const headerProps = {\n // 页面模式\n mode: {\n type: String as PropType<PageMode>,\n },\n allowBack: {\n type: Boolean,\n default: true,\n },\n buttons: {\n ...buttonsProps.list,\n },\n name: String, // 权限前缀\n // 要展示的默认按钮\n defaultButtons: {\n type: Array as PropType<defaultButtonsProps[]>,\n default: () => [],\n },\n // 工作流id\n workflowId: String,\n} as const\nexport type HeaderProps = ExtractPropTypes<typeof headerProps>\n\nexport const headerEmits = {}\nexport type HeaderEmits = typeof headerEmits\n"],"names":["buttonsProps"],"mappings":";;;;AAUO,MAAM,WAAA,GAAc;AAAA;AAAA,EAEzB,IAAA,EAAM;AAAA,IACJ,IAAA,EAAM;AAAA,GACR;AAAA,EACA,SAAA,EAAW;AAAA,IACT,IAAA,EAAM,OAAA;AAAA,IACN,OAAA,EAAS;AAAA,GACX;AAAA,EACA,OAAA,EAAS;AAAA,IACP,GAAGA,oBAAA,CAAa;AAAA,GAClB;AAAA,EACA,IAAA,EAAM,MAAA;AAAA;AAAA;AAAA,EAEN,cAAA,EAAgB;AAAA,IACd,IAAA,EAAM,KAAA;AAAA,IACN,OAAA,EAAS,MAAM;AAAC,GAClB;AAAA;AAAA,EAEA,UAAA,EAAY;AACd;AAGO,MAAM,cAAc;;;;;"}
@@ -1,7 +1,6 @@
1
1
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
2
  readonly mode: {
3
3
  readonly type: import("vue").PropType<import("packages/hooks").PageMode>;
4
- readonly default: "add";
5
4
  };
6
5
  readonly allowBack: {
7
6
  readonly type: BooleanConstructor;
@@ -20,7 +19,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
20
19
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
21
20
  readonly mode: {
22
21
  readonly type: import("vue").PropType<import("packages/hooks").PageMode>;
23
- readonly default: "add";
24
22
  };
25
23
  readonly allowBack: {
26
24
  readonly type: BooleanConstructor;
@@ -37,7 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
37
35
  };
38
36
  readonly workflowId: StringConstructor;
39
37
  }>> & Readonly<{}>, {
40
- readonly mode: import("packages/hooks").PageMode;
41
38
  readonly buttons: Partial<Omit<import("element-plus").ButtonProps, "disabled"> & {
42
39
  name: string;
43
40
  prop: string;
@@ -50,13 +50,13 @@ function useSelect(props, emit) {
50
50
  };
51
51
  const getSelectItem = (value) => {
52
52
  if (Array.isArray(value)) {
53
- if (!props.options) return [];
54
- return props.options.filter((item) => {
53
+ if (!customOptions.value) return [];
54
+ return customOptions.value.filter((item) => {
55
55
  return value.indexOf(item[props.valueKey]) > -1;
56
56
  });
57
57
  }
58
- if (!props.options) return {};
59
- return props.options.find((item) => {
58
+ if (!customOptions.value) return {};
59
+ return customOptions.value.find((item) => {
60
60
  return item[props.valueKey] === value;
61
61
  }) || {};
62
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"use-select.js","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref } from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n customOptions.value = data as OptionArr\n } else if (data && typeof data === 'object') {\n const rawData = data as OptionObj\n customOptions.value = rawData?.list || rawData?.data || []\n } else {\n customOptions.value = []\n }\n hasLoaded = true\n },\n fail(error) {\n console.error(error)\n },\n },\n })\n // 下拉列表\n const customOptions = ref<SelectOption[]>([]) // 下拉列表\n // 加载下拉列表\n const loadOptions = (\n value: SelectProps['modelValue'],\n desc: string | undefined,\n ) => {\n if ((value || value === 0) && desc) {\n customOptions.value = [\n {\n [props.labelKey]: desc,\n [props.valueKey]: value,\n },\n ]\n }\n if (props.api) {\n if (!props.lazy && !props.remote) {\n requestFn!()\n }\n } else if (props.options?.length) {\n customOptions.value = props.options\n }\n }\n // 获取选中项\n const getSelectItem = (value: SelectProps['modelValue']) => {\n if (Array.isArray(value)) {\n if (!props.options) return []\n return props.options.filter((item: SelectOption) => {\n return value.indexOf(item[props.valueKey]) > -1\n })\n }\n if (!props.options) return {}\n return (\n props.options.find((item: SelectOption) => {\n return item[props.valueKey] === value\n }) || {}\n )\n }\n const expandAttrs = {\n loading: props.loading || loading?.value,\n remoteMethod: (query: string) => {\n if (!query) return\n requestFn!({\n $searchValue: query,\n })\n },\n onChange(value: SelectProps['modelValue']) {\n emit('change', value, getSelectItem(value))\n },\n onVisibleChange(visible: boolean) {\n if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {\n requestFn!()\n }\n emit('visible-change', visible)\n },\n }\n return {\n customOptions,\n loadOptions,\n expandAttrs,\n }\n}\n"],"names":["useRequest","ref"],"mappings":";;;;;AAIO,SAAS,SAAA,CACd,OACA,IAAA,EACA;AACA,EAAA,IAAI,SAAA,GAAY,KAAA;AAChB,EAAA,MAAM,EAAE,OAAA,EAAS,SAAA,EAAU,GAAIA,qBAAA,CAAW;AAAA,IACxC,KAAK,KAAA,CAAM,GAAA;AAAA,IACX,QAAQ,KAAA,CAAM,MAAA;AAAA,IACd,SAAS,KAAA,CAAM,OAAA;AAAA,IACf,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,WAAW,KAAA,CAAM,SAAA;AAAA,IACjB,UAAU,KAAA,CAAM,QAAA;AAAA,IAChB,aAAa,KAAA,CAAM,MAAA;AAAA,IACnB,KAAA,EAAO;AAAA,MACL,QAAQ,IAAA,EAAM;AAMZ,QAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,EAAG;AACvB,UAAA,aAAA,CAAc,KAAA,GAAQ,IAAA;AAAA,QACxB,CAAA,MAAA,IAAW,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,EAAU;AAC3C,UAAA,MAAM,OAAA,GAAU,IAAA;AAChB,UAAA,aAAA,CAAc,KAAA,GAAQ,OA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,CAAC,CAAA,GAAI,EAAA;AAAA,MAC/C,CAAC,CAAA;AAAA,IACH;AACA,IAAA,IAAI,CAAC,KAAA,CAAM,OAAA,EAAS,OAAO,EAAC;AAC5B,IAAA,OACE,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,CAAC,IAAA,KAAuB;AACzC,MAAA,OAAO,IAAA,CAAK,KAAA,CAAM,QAAQ,CAAA,KAAM,KAAA;AAAA,IAClC,CAAC,KAAK,EAAC;AAAA,EAEX,CAAA;AACA,EAAA,MAAM,WAAA,GAAc;AAAA,IAClB,OAAA,EAAS,KAAA,CAAM,OAAA,IAAW,OAAA,EAAS,KAAA;AAAA,IACnC,YAAA,EAAc,CAAC,KAAA,KAAkB;AAC/B,MAAA,IAAI,CAAC,KAAA,EAAO;AACZ,MAAA,SAAA,CAAW;AAAA,QACT,YAAA,EAAc;AAAA,OACf,CAAA;AAAA,IACH,CAAA;AAAA,IACA,SAAS,KAAA,EAAkC;AACzC,MAAA,IAAA,CAAK,QAAA,EAAU,KAAA,EAAO,aAAA,CAAc,KAAK,CAAC,CAAA;AAAA,IAC5C,CAAA;AAAA,IACA,gBAAgB,OAAA,EAAkB;AAChC,MAAA,IAAI,KAAA,CAAM,OAAO,KAAA,CAAM,IAAA,IAAQ,WAAW,CAAC,SAAA,IAAa,CAAC,KAAA,CAAM,MAAA,EAAQ;AACrE,QAAA,SAAA,EAAW;AAAA,MACb;AACA,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA;AAAA,IAChC;AAAA,GACF;AACA,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"use-select.js","sources":["../../../../../../packages/components/select/src/use-select.ts"],"sourcesContent":["import { ref } from 'vue'\nimport type { SetupContext } from 'vue'\nimport { useRequest } from '@el-plus/hooks/use-request'\nimport type { SelectProps, SelectOption, SelectEmits } from './select'\nexport function useSelect(\n props: SelectProps,\n emit: SetupContext<SelectEmits>['emit'],\n) {\n let hasLoaded = false\n const { loading, requestFn } = useRequest({\n api: props.api,\n method: props.method,\n reqData: props.reqData,\n reqParams: props.reqParams,\n reqBefore: props.reqBefore,\n reqAfter: props.reqAfter,\n cancelToken: props.remote,\n hooks: {\n success(data) {\n type OptionArr = SelectOption[]\n interface OptionObj {\n list?: OptionArr\n data?: OptionArr\n }\n if (Array.isArray(data)) {\n customOptions.value = data as OptionArr\n } else if (data && typeof data === 'object') {\n const rawData = data as OptionObj\n customOptions.value = rawData?.list || rawData?.data || []\n } else {\n customOptions.value = []\n }\n hasLoaded = true\n },\n fail(error) {\n console.error(error)\n },\n },\n })\n // 下拉列表\n const customOptions = ref<SelectOption[]>([]) // 下拉列表\n // 加载下拉列表\n const loadOptions = (\n value: SelectProps['modelValue'],\n desc: string | undefined,\n ) => {\n if ((value || value === 0) && desc) {\n customOptions.value = [\n {\n [props.labelKey]: desc,\n [props.valueKey]: value,\n },\n ]\n }\n if (props.api) {\n if (!props.lazy && !props.remote) {\n requestFn!()\n }\n } else if (props.options?.length) {\n customOptions.value = props.options\n }\n }\n // 获取选中项\n const getSelectItem = (value: SelectProps['modelValue']) => {\n if (Array.isArray(value)) {\n if (!customOptions.value) return []\n return customOptions.value.filter((item: SelectOption) => {\n return value.indexOf(item[props.valueKey]) > -1\n })\n }\n if (!customOptions.value) return {}\n return (\n customOptions.value.find((item: SelectOption) => {\n return item[props.valueKey] === value\n }) || {}\n )\n }\n const expandAttrs = {\n loading: props.loading || loading?.value,\n remoteMethod: (query: string) => {\n if (!query) return\n requestFn!({\n $searchValue: query,\n })\n },\n onChange(value: SelectProps['modelValue']) {\n emit('change', value, getSelectItem(value))\n },\n onVisibleChange(visible: boolean) {\n if (props.api && props.lazy && visible && !hasLoaded && !props.remote) {\n requestFn!()\n }\n emit('visible-change', visible)\n },\n }\n return {\n customOptions,\n loadOptions,\n expandAttrs,\n }\n}\n"],"names":["useRequest","ref"],"mappings":";;;;;AAIO,SAAS,SAA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;AAAA,IACH,CAAA;AAAA,IACA,SAAS,KAAA,EAAkC;AACzC,MAAA,IAAA,CAAK,QAAA,EAAU,KAAA,EAAO,aAAA,CAAc,KAAK,CAAC,CAAA;AAAA,IAC5C,CAAA;AAAA,IACA,gBAAgB,OAAA,EAAkB;AAChC,MAAA,IAAI,KAAA,CAAM,OAAO,KAAA,CAAM,IAAA,IAAQ,WAAW,CAAC,SAAA,IAAa,CAAC,KAAA,CAAM,MAAA,EAAQ;AACrE,QAAA,SAAA,EAAW;AAAA,MACb;AACA,MAAA,IAAA,CAAK,kBAAkB,OAAO,CAAA;AAAA,IAChC;AAAA,GACF;AACA,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AACF;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var version = "0.0.20";
3
+ var version = "0.0.21";
4
4
 
5
5
  exports.version = version;
6
6
  //# sourceMappingURL=package.json.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "el-plus",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "description": "pro base on element-plus",
5
5
  "module": "./es/index.mjs",
6
6
  "keywords": [