@maxax/ui 1.1.42 → 1.1.44
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/components/basic-cascader/BasicCascader.vue.d.ts.map +1 -1
- package/dist/components/basic-select/BasicSelect.vue.d.ts.map +1 -1
- package/dist/components/basic-text/BasicText.vue.d.ts.map +1 -1
- package/dist/components/basic-text/interface.d.ts +1 -0
- package/dist/components/basic-text/interface.d.ts.map +1 -1
- package/dist/components/basic-tree/BasicTree.vue.d.ts +9 -3
- package/dist/components/basic-tree/BasicTree.vue.d.ts.map +1 -1
- package/dist/components/basic-tree/constants.d.ts +2 -2
- package/dist/components/basic-tree/constants.d.ts.map +1 -1
- package/dist/components/basic-tree/interface.d.ts +9 -5
- package/dist/components/basic-tree/interface.d.ts.map +1 -1
- package/dist/composable/use-event-bus.d.ts +2 -0
- package/dist/composable/use-event-bus.d.ts.map +1 -0
- package/dist/index.cjs +32 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +38 -20
- package/dist/index.mjs.map +1 -1
- package/dist/locales.cjs.map +1 -1
- package/dist/locales.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, getTransitionProps, collapseMotion, getTransitionGroupProps } from "@maxax/utils";
|
|
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, Comment, Text, triggerRef, TransitionGroup } from "vue";
|
|
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";
|
|
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
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";
|
|
@@ -2263,8 +2263,8 @@ function requireMapTree() {
|
|
|
2263
2263
|
return rest;
|
|
2264
2264
|
});
|
|
2265
2265
|
}
|
|
2266
|
-
var
|
|
2267
|
-
mapTree_1 =
|
|
2266
|
+
var mapTree2 = helperCreateTreeFunc(mapTreeItem);
|
|
2267
|
+
mapTree_1 = mapTree2;
|
|
2268
2268
|
return mapTree_1;
|
|
2269
2269
|
}
|
|
2270
2270
|
var filterTree_1;
|
|
@@ -5772,7 +5772,7 @@ function requireXeUtils() {
|
|
|
5772
5772
|
var toTreeArray = requireToTreeArray();
|
|
5773
5773
|
var findTree = requireFindTree();
|
|
5774
5774
|
var eachTree = requireEachTree();
|
|
5775
|
-
var
|
|
5775
|
+
var mapTree2 = requireMapTree();
|
|
5776
5776
|
var filterTree = requireFilterTree();
|
|
5777
5777
|
var searchTree = requireSearchTree();
|
|
5778
5778
|
var arrayIndexOf = requireArrayIndexOf();
|
|
@@ -5951,7 +5951,7 @@ function requireXeUtils() {
|
|
|
5951
5951
|
toTreeArray,
|
|
5952
5952
|
findTree,
|
|
5953
5953
|
eachTree,
|
|
5954
|
-
mapTree,
|
|
5954
|
+
mapTree: mapTree2,
|
|
5955
5955
|
filterTree,
|
|
5956
5956
|
searchTree,
|
|
5957
5957
|
// base
|
|
@@ -11967,7 +11967,8 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
11967
11967
|
size: {},
|
|
11968
11968
|
type: {},
|
|
11969
11969
|
weight: { type: Boolean },
|
|
11970
|
-
tag: { type: Boolean }
|
|
11970
|
+
tag: { type: Boolean },
|
|
11971
|
+
pointer: { type: Boolean }
|
|
11971
11972
|
},
|
|
11972
11973
|
setup(__props) {
|
|
11973
11974
|
const props = __props;
|
|
@@ -11982,6 +11983,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
11982
11983
|
flex: props.icon,
|
|
11983
11984
|
"items-center": props.icon,
|
|
11984
11985
|
"gap-2": props.icon,
|
|
11986
|
+
"cursor-pointer": props.pointer || false,
|
|
11985
11987
|
[m(props.size)]: props.size || "small",
|
|
11986
11988
|
[m(props.type)]: props.type || "default",
|
|
11987
11989
|
[is("weight")]: props.weight || false,
|
|
@@ -30449,25 +30451,30 @@ const XTreeSearch = withInstall(_sfc_main$7);
|
|
|
30449
30451
|
const DEFAULT_TRANSFORM_CONFIG = {
|
|
30450
30452
|
id: "id",
|
|
30451
30453
|
pid: "parentId",
|
|
30452
|
-
children: "children"
|
|
30453
|
-
labelField: "deptName",
|
|
30454
|
-
valueField: "id"
|
|
30454
|
+
children: "children"
|
|
30455
30455
|
};
|
|
30456
30456
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
30457
30457
|
__name: "BasicTree",
|
|
30458
|
-
props: {
|
|
30458
|
+
props: /* @__PURE__ */ mergeModels({
|
|
30459
|
+
modelValue: {},
|
|
30459
30460
|
immediate: { type: Boolean, default: true },
|
|
30460
30461
|
api: {},
|
|
30461
30462
|
beforeFetch: {},
|
|
30462
30463
|
afterFetch: {},
|
|
30463
30464
|
transform: { default: () => DEFAULT_TRANSFORM_CONFIG },
|
|
30464
30465
|
listField: {},
|
|
30465
|
-
treeConfig: {}
|
|
30466
|
-
|
|
30467
|
-
|
|
30466
|
+
treeConfig: {},
|
|
30467
|
+
labelField: {},
|
|
30468
|
+
valueField: {}
|
|
30469
|
+
}, {
|
|
30470
|
+
"modelValue": {},
|
|
30471
|
+
"modelModifiers": {}
|
|
30472
|
+
}),
|
|
30473
|
+
emits: /* @__PURE__ */ mergeModels(["update:modelValue", "load", "expand", "check", "uncheck", "select", "unselect", "set-data", "check-change", "selected-change", "checked-change", "click", "node-dblclick", "node-right-click", "node-dragstart", "node-dragenter", "node-dragover", "node-dragleave", "node-drop"], ["update:modelValue"]),
|
|
30468
30474
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
30469
30475
|
const props = __props;
|
|
30470
30476
|
const emit = __emit;
|
|
30477
|
+
const modelValue = useModel(__props, "modelValue");
|
|
30471
30478
|
const slots = useSlots();
|
|
30472
30479
|
const { b, e } = useNamespace("basic-tree");
|
|
30473
30480
|
const treeRef = useTemplateRef("treeRef");
|
|
@@ -30493,8 +30500,16 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
30493
30500
|
}));
|
|
30494
30501
|
const treeArray = ref([]);
|
|
30495
30502
|
const loading = ref(true);
|
|
30503
|
+
function formatterTreeData(data) {
|
|
30504
|
+
return mapTree(data, {
|
|
30505
|
+
conversion: (node) => {
|
|
30506
|
+
node.data = node;
|
|
30507
|
+
return node;
|
|
30508
|
+
}
|
|
30509
|
+
});
|
|
30510
|
+
}
|
|
30496
30511
|
async function fetch2() {
|
|
30497
|
-
const { api, beforeFetch, afterFetch, transform, listField = "resultList" } = props;
|
|
30512
|
+
const { api, beforeFetch, afterFetch, transform, listField = "resultList", valueField = "value", labelField = "label" } = props;
|
|
30498
30513
|
if (!api) return;
|
|
30499
30514
|
loading.value = true;
|
|
30500
30515
|
const params = beforeFetch ? await beforeFetch() : {};
|
|
@@ -30503,11 +30518,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
30503
30518
|
let resultItems = isArrayResult ? res.data : get(res.data, listField);
|
|
30504
30519
|
resultItems = afterFetch ? await afterFetch(resultItems) : resultItems;
|
|
30505
30520
|
if (transform) {
|
|
30506
|
-
resultItems = listToTree(resultItems, { ...transform || {} });
|
|
30521
|
+
resultItems = listToTree(resultItems, { ...transform || {}, valueField, labelField });
|
|
30507
30522
|
}
|
|
30508
|
-
|
|
30523
|
+
const treeData = formatterTreeData(resultItems);
|
|
30524
|
+
setTreeData(treeData);
|
|
30509
30525
|
loading.value = false;
|
|
30510
|
-
emit("load",
|
|
30526
|
+
emit("load", treeData);
|
|
30511
30527
|
}
|
|
30512
30528
|
function getTreeData() {
|
|
30513
30529
|
return treeArray.value || [];
|
|
@@ -30541,7 +30557,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
30541
30557
|
}, [
|
|
30542
30558
|
createVNode(unref(XTreeSearch), mergeProps({
|
|
30543
30559
|
ref_key: "treeRef",
|
|
30544
|
-
ref: treeRef
|
|
30560
|
+
ref: treeRef,
|
|
30561
|
+
modelValue: modelValue.value,
|
|
30562
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
30545
30563
|
}, treeConfig.value, toHandlers(unref(treeListeners))), createSlots({ _: 2 }, [
|
|
30546
30564
|
renderList(Object.keys(unref(slots)), (slot) => {
|
|
30547
30565
|
return {
|
|
@@ -30551,7 +30569,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
30551
30569
|
])
|
|
30552
30570
|
};
|
|
30553
30571
|
})
|
|
30554
|
-
]), 1040)
|
|
30572
|
+
]), 1040, ["modelValue"])
|
|
30555
30573
|
], 2)), [
|
|
30556
30574
|
[unref(vLoading), loading.value]
|
|
30557
30575
|
])
|