@maxax/ui 1.1.47 → 1.1.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { addUnit, pascalCase, isClient as isClient$1, hasClass, addClass, getScrollbarWidth, getStyle, removeClass, isNumber, withInstall, guid, isFunction, isString, isElement, isObject as isObject$1, isUndefined, downloadFileStatic, downloadFileByResponseData, attrAccept as attrAccept$1, isBoolean, getSlot, isArray, deepMerge, cloneDeep as cloneDeep$2, mergeArray, findNodeAll, calculate, call, isNull, getValueKey, classNames, tryConstructArray, isNil, tryDeconstructArray, tryDeconstructObject, isEmpty, isPascalCase, kebabCase, listToTree, mapTree, getTransitionProps, collapseMotion, getTransitionGroupProps } from "@maxax/utils";
1
+ import { addUnit, pascalCase, isClient as isClient$1, hasClass, addClass, getScrollbarWidth, getStyle, removeClass, isNumber, withInstall, guid, isFunction, isString, isElement, isObject as isObject$1, isUndefined, downloadFileStatic, downloadFileByResponseData, attrAccept as attrAccept$1, isBoolean, getSlot, isArray, deepMerge, cloneDeep as cloneDeep$2, mergeArray, findNodeAll, calculate, listToTree, call, isNull, getValueKey, classNames, tryConstructArray, isNil, tryDeconstructArray, tryDeconstructObject, isEmpty, isPascalCase, kebabCase, mapTree, getTransitionProps, collapseMotion, getTransitionGroupProps } from "@maxax/utils";
2
2
  import { shallowRef, shallowReadonly, onUnmounted, onMounted, nextTick, getCurrentScope, onScopeDispose, toValue, getCurrentInstance, watch, computed, unref, watchEffect, onBeforeUnmount, reactive, ref, inject, isRef, toRaw, defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, h, useAttrs, mergeProps, Fragment, createBlock, createCommentVNode, withCtx, createTextVNode, toDisplayString, createVNode, useSlots, createSlots, provide, toRefs, resolveComponent, Transition, withDirectives, withModifiers, normalizeStyle, withKeys, resolveDynamicComponent, vShow, isVNode, render as render$1, useTemplateRef, renderList, normalizeProps, guardReactiveProps, toRef, vModelText, createApp, toHandlers, mergeDefaults, mergeModels, useModel, Comment, Text, triggerRef, TransitionGroup } from "vue";
3
3
  import BScroll from "@better-scroll/core";
4
4
  import { NTooltip, NButton, NInput, NButtonGroup, NDropdown, NModal, NProgress, NCard, NCascader, NDatePicker, NDrawer, NDrawerContent, NSelect, NInputNumber, NUpload, NAutoComplete, NDynamicTags, NTreeSelect, NTimePicker, NSwitch, NCheckbox, NCheckboxGroup, NRadio, NRadioButton, NRadioGroup, NSlider, NTransfer, NDivider, NColorPicker, NRate, NCol, NFormItem, NForm, NRow, NPopover, NTabs, NTabPane, NScrollbar, NEmpty, NPagination, NSpin } from "naive-ui";
5
- import { merge, cloneDeep as cloneDeep$1, uniqBy, isBoolean as isBoolean$1, isFunction as isFunction$1, isArray as isArray$1, isString as isString$1, isEqual, get, concat, omit, has, set, unset, isNumber as isNumber$1, isPlainObject, partition } from "lodash-es";
5
+ import { merge, cloneDeep as cloneDeep$1, uniqBy, omit, isBoolean as isBoolean$1, isFunction as isFunction$1, isArray as isArray$1, isString as isString$1, isEqual, get, concat, has, set, unset, isNumber as isNumber$1, isPlainObject, partition } from "lodash-es";
6
6
  import { VxePager } from "vxe-pc-ui";
7
7
  import { VxeUI, VxePager as VxePager2 } from "vxe-pc-ui";
8
8
  import { VxeUI as VxeUI2, VxeGrid } from "vxe-table";
@@ -10550,7 +10550,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
10550
10550
  getSchema,
10551
10551
  schemaRef
10552
10552
  });
10553
- const getBindValue = computed(() => ({ ...attrs, ...unref(getProps) }));
10553
+ const getBindValue = computed(() => ({ ...omit(attrs, ["data-max-id"]), ...unref(getProps) }));
10554
10554
  watch(
10555
10555
  () => props.schemas,
10556
10556
  (schemas) => {
@@ -11759,7 +11759,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
11759
11759
  }
11760
11760
  const getBindValues = computed(() => {
11761
11761
  const propsData = {
11762
- ...attrs,
11762
+ ...omit(attrs, ["data-max-id"]),
11763
11763
  ...unref(getProps),
11764
11764
  loading: unref(getLoading),
11765
11765
  data: unref(getDataSourceRef),
@@ -12067,7 +12067,14 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12067
12067
  afterFetch: {},
12068
12068
  handleSearchInfoFn: {},
12069
12069
  searchInfo: {},
12070
- fetchSetting: { default: () => ({ listField: "resultList" }) }
12070
+ fetchSetting: { default: () => ({ listField: "resultList" }) },
12071
+ transform: {},
12072
+ labelField: {},
12073
+ valueField: {},
12074
+ cascaderConfig: {},
12075
+ "onUpdate:value": {},
12076
+ onUpdateValue: {},
12077
+ onChange: {}
12071
12078
  },
12072
12079
  setup(__props, { expose: __expose }) {
12073
12080
  const props = __props;
@@ -12083,6 +12090,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12083
12090
  const data = unref(dataSourceRef);
12084
12091
  return data.length > 0 ? data : props.options;
12085
12092
  });
12093
+ const cascaderConfig = computed(() => ({
12094
+ ...props.cascaderConfig || {}
12095
+ }));
12086
12096
  watch(
12087
12097
  () => props.searchInfo,
12088
12098
  () => {
@@ -12091,7 +12101,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12091
12101
  { deep: true, immediate: props.immediate }
12092
12102
  );
12093
12103
  async function fetch2(opt) {
12094
- const { api, dynamicApi, searchInfo, fetchSetting, beforeFetch, afterFetch, handleSearchInfoFn } = props;
12104
+ const { api, dynamicApi, searchInfo, fetchSetting, beforeFetch, afterFetch, handleSearchInfoFn, transform, valueField, labelField } = props;
12095
12105
  if (!api && !dynamicApi || loading.value) return;
12096
12106
  try {
12097
12107
  loading.value = true;
@@ -12110,6 +12120,9 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12110
12120
  if (afterFetch && isFunction(afterFetch)) {
12111
12121
  resultItems = await afterFetch(resultItems) || resultItems;
12112
12122
  }
12123
+ if (transform) {
12124
+ resultItems = listToTree(resultItems, { ...transform || {}, valueField, labelField });
12125
+ }
12113
12126
  dataSourceRef.value = resultItems;
12114
12127
  } catch (error) {
12115
12128
  console.error(error);
@@ -12150,7 +12163,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
12150
12163
  createElementVNode("div", {
12151
12164
  class: normalizeClass(unref(b)())
12152
12165
  }, null, 2),
12153
- createVNode(unref(NCascader), mergeProps(_ctx.$attrs, {
12166
+ createVNode(unref(NCascader), mergeProps(cascaderConfig.value, {
12154
12167
  value: unref(mergedValueRef),
12155
12168
  options: getOptions.value,
12156
12169
  class: unref(b)(),
@@ -16933,7 +16946,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
16933
16946
  initDefault
16934
16947
  });
16935
16948
  useAutoFocus({ getSchema, getProps, isInitedDefault: isInitedDefaultRef, formElRef });
16936
- const getBindValue = computed(() => ({ ...attrs, ...unref(getProps) }));
16949
+ const getBindValue = computed(() => ({ ...omit(attrs, ["data-max-id"]), ...unref(getProps) }));
16937
16950
  const getFormActionBindProps = computed(() => ({ ...getProps.value, ...advanceState }));
16938
16951
  async function setProps(formProps) {
16939
16952
  propsRef.value = deepMerge(unref(propsRef) || {}, formProps);