@maxax/ui 1.1.3 → 1.1.5

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,7 +1,7 @@
1
1
  import { camelize, isNumber, isString, removeClass, addClass, pascalCase, isClient as isClient$1, hasClass, withInstall, downloadFileStatic, isFunction, downloadFileByResponseData, guid, attrAccept as attrAccept$1, isElement, isObject as isObject$1, isUndefined, isBoolean, getSlot, isArray, deepMerge, cloneDeep as cloneDeep$2, call, isNull, classNames, getValueKey, tryConstructArray, isNil, tryDeconstructArray, tryDeconstructObject, isEmpty, isPascalCase, mergeArray, getStyle as getStyle$1, kebabCase, findNodeAll, calculate } from "@maxax/utils";
2
2
  import { shallowRef, shallowReadonly, onUnmounted, onMounted, nextTick, getCurrentScope, onScopeDispose, toValue, getCurrentInstance, watch, computed, unref, Fragment, isVNode, Comment, Text, watchEffect, onBeforeUnmount, inject, ref, isRef, toRaw, defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, renderSlot, h, useAttrs, mergeProps, createBlock, createCommentVNode, withCtx, createTextVNode, toDisplayString, createVNode, useSlots, createSlots, useTemplateRef, normalizeStyle, provide, reactive, toRefs, resolveComponent, Transition, withDirectives, withModifiers, withKeys, resolveDynamicComponent, vShow, render as render$1, renderList, toRef, normalizeProps, guardReactiveProps, vModelText, createApp, mergeDefaults, triggerRef, TransitionGroup, toHandlers } from "vue";
3
3
  import BScroll from "@better-scroll/core";
4
- import { NTooltip, NButton, NInput, 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, NModal, NProgress } from "naive-ui";
4
+ import { NTooltip, NButton, NButtonGroup, NDropdown, NInput, 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, NModal, NProgress } from "naive-ui";
5
5
  import { b as buildLocaleContext, z as zhCN } from "./utils-WrckZ9PX.js";
6
6
  import { merge, cloneDeep as cloneDeep$1, uniqBy, get, omit, has, set, unset, isNumber as isNumber$1, isPlainObject, isBoolean as isBoolean$1, isFunction as isFunction$1, isArray as isArray$1, isString as isString$1, isEqual, concat, partition } from "lodash-es";
7
7
  import { useBoolean, useMergedState as useMergedState$1, useEventListener as useEventListener$1, useBreakpoint } from "@maxax/hooks";
@@ -1128,7 +1128,7 @@ const useZIndex = (zIndexOverrides) => {
1128
1128
  nextZIndex
1129
1129
  };
1130
1130
  };
1131
- const _sfc_main$V = /* @__PURE__ */ defineComponent({
1131
+ const _sfc_main$X = /* @__PURE__ */ defineComponent({
1132
1132
  __name: "better-scroll",
1133
1133
  props: {
1134
1134
  options: {}
@@ -2854,7 +2854,7 @@ const Icon = defineComponent((props, { emit }) => {
2854
2854
  emits: ["load"]
2855
2855
  });
2856
2856
  const _hoisted_1$c = ["xlink:href"];
2857
- const _sfc_main$U = /* @__PURE__ */ defineComponent({
2857
+ const _sfc_main$W = /* @__PURE__ */ defineComponent({
2858
2858
  __name: "BasicSvgIcon",
2859
2859
  props: {
2860
2860
  icon: {},
@@ -2900,8 +2900,8 @@ const _sfc_main$U = /* @__PURE__ */ defineComponent({
2900
2900
  };
2901
2901
  }
2902
2902
  });
2903
- const XBasicSvgIcon = withInstall(_sfc_main$U);
2904
- const _sfc_main$T = /* @__PURE__ */ defineComponent({
2903
+ const XBasicSvgIcon = withInstall(_sfc_main$W);
2904
+ const _sfc_main$V = /* @__PURE__ */ defineComponent({
2905
2905
  ...{
2906
2906
  inheritAttrs: false
2907
2907
  },
@@ -2950,7 +2950,7 @@ const _sfc_main$T = /* @__PURE__ */ defineComponent({
2950
2950
  };
2951
2951
  }
2952
2952
  });
2953
- const _sfc_main$S = /* @__PURE__ */ defineComponent({
2953
+ const _sfc_main$U = /* @__PURE__ */ defineComponent({
2954
2954
  __name: "full-screen",
2955
2955
  props: {
2956
2956
  full: { type: Boolean }
@@ -2958,7 +2958,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
2958
2958
  setup(__props) {
2959
2959
  const { t } = useLocale();
2960
2960
  return (_ctx, _cache) => {
2961
- return openBlock(), createBlock(_sfc_main$T, {
2961
+ return openBlock(), createBlock(_sfc_main$V, {
2962
2962
  key: String(__props.full),
2963
2963
  "tooltip-content": __props.full ? unref(t)("max.icon.fullscreenExit") : unref(t)("max.icon.fullscreen")
2964
2964
  }, {
@@ -2976,7 +2976,7 @@ const _sfc_main$S = /* @__PURE__ */ defineComponent({
2976
2976
  };
2977
2977
  }
2978
2978
  });
2979
- const _sfc_main$R = /* @__PURE__ */ defineComponent({
2979
+ const _sfc_main$T = /* @__PURE__ */ defineComponent({
2980
2980
  __name: "icon-tooltip",
2981
2981
  props: {
2982
2982
  icon: { default: "mdi-help-circle" },
@@ -3016,7 +3016,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
3016
3016
  };
3017
3017
  }
3018
3018
  });
3019
- const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3019
+ const _sfc_main$S = /* @__PURE__ */ defineComponent({
3020
3020
  __name: "menu-toggler",
3021
3021
  props: {
3022
3022
  collapsed: { type: Boolean },
@@ -3042,7 +3042,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3042
3042
  return icons[arrowIcon][collapsed];
3043
3043
  });
3044
3044
  return (_ctx, _cache) => {
3045
- return openBlock(), createBlock(_sfc_main$T, {
3045
+ return openBlock(), createBlock(_sfc_main$V, {
3046
3046
  key: String(__props.collapsed),
3047
3047
  "tooltip-content": __props.collapsed ? unref(t)("max.icon.expand") : unref(t)("max.icon.collapse"),
3048
3048
  "tooltip-placement": "bottom-start",
@@ -3056,7 +3056,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3056
3056
  };
3057
3057
  }
3058
3058
  });
3059
- const _sfc_main$P = /* @__PURE__ */ defineComponent({
3059
+ const _sfc_main$R = /* @__PURE__ */ defineComponent({
3060
3060
  __name: "pin-toggler",
3061
3061
  props: {
3062
3062
  pin: { type: Boolean }
@@ -3066,7 +3066,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3066
3066
  const { t } = useLocale();
3067
3067
  const icon = computed(() => props.pin ? "mdi-pin-off" : "mdi-pin");
3068
3068
  return (_ctx, _cache) => {
3069
- return openBlock(), createBlock(_sfc_main$T, {
3069
+ return openBlock(), createBlock(_sfc_main$V, {
3070
3070
  "tooltip-content": __props.pin ? unref(t)("max.icon.unpin") : unref(t)("max.icon.pin"),
3071
3071
  "tooltip-placement": "bottom-start",
3072
3072
  "z-index": 100
@@ -3079,7 +3079,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3079
3079
  };
3080
3080
  }
3081
3081
  });
3082
- const _sfc_main$O = /* @__PURE__ */ defineComponent({
3082
+ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
3083
3083
  __name: "reload-button",
3084
3084
  props: {
3085
3085
  loading: { type: Boolean }
@@ -3088,7 +3088,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
3088
3088
  const { t } = useLocale();
3089
3089
  const { b } = useNamespace("reload-button");
3090
3090
  return (_ctx, _cache) => {
3091
- return openBlock(), createBlock(_sfc_main$T, {
3091
+ return openBlock(), createBlock(_sfc_main$V, {
3092
3092
  "tooltip-content": unref(t)("max.icon.reload")
3093
3093
  }, {
3094
3094
  default: withCtx(() => [
@@ -3102,14 +3102,14 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
3102
3102
  };
3103
3103
  }
3104
3104
  });
3105
- const XCommonBetterScroll = withInstall(_sfc_main$V);
3106
- const XCommonButtonIcon = withInstall(_sfc_main$T);
3107
- const XCommonFullScreen = withInstall(_sfc_main$S);
3108
- const XCommonIconTooltip = withInstall(_sfc_main$R);
3109
- const XCommonMenuToggler = withInstall(_sfc_main$Q);
3110
- const XCommonPinToggler = withInstall(_sfc_main$P);
3111
- const XCommonReloadButton = withInstall(_sfc_main$O);
3112
- const _sfc_main$N = /* @__PURE__ */ defineComponent({
3105
+ const XCommonBetterScroll = withInstall(_sfc_main$X);
3106
+ const XCommonButtonIcon = withInstall(_sfc_main$V);
3107
+ const XCommonFullScreen = withInstall(_sfc_main$U);
3108
+ const XCommonIconTooltip = withInstall(_sfc_main$T);
3109
+ const XCommonMenuToggler = withInstall(_sfc_main$S);
3110
+ const XCommonPinToggler = withInstall(_sfc_main$R);
3111
+ const XCommonReloadButton = withInstall(_sfc_main$Q);
3112
+ const _sfc_main$P = /* @__PURE__ */ defineComponent({
3113
3113
  __name: "BasicArrow",
3114
3114
  props: {
3115
3115
  expand: { type: Boolean },
@@ -3141,8 +3141,8 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
3141
3141
  };
3142
3142
  }
3143
3143
  });
3144
- const XBasicArrow = withInstall(_sfc_main$N);
3145
- const _sfc_main$M = /* @__PURE__ */ defineComponent({
3144
+ const XBasicArrow = withInstall(_sfc_main$P);
3145
+ const _sfc_main$O = /* @__PURE__ */ defineComponent({
3146
3146
  __name: "BasicButton",
3147
3147
  props: {
3148
3148
  size: {},
@@ -3197,8 +3197,8 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
3197
3197
  };
3198
3198
  }
3199
3199
  });
3200
- const XBasicButton = withInstall(_sfc_main$M);
3201
- const _sfc_main$L = /* @__PURE__ */ defineComponent({
3200
+ const XBasicButton = withInstall(_sfc_main$O);
3201
+ const _sfc_main$N = /* @__PURE__ */ defineComponent({
3202
3202
  __name: "BasicButtonCreate",
3203
3203
  emits: ["click"],
3204
3204
  setup(__props, { emit: __emit }) {
@@ -3223,7 +3223,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3223
3223
  };
3224
3224
  }
3225
3225
  });
3226
- const _sfc_main$K = /* @__PURE__ */ defineComponent({
3226
+ const _sfc_main$M = /* @__PURE__ */ defineComponent({
3227
3227
  __name: "BasicButtonDelete",
3228
3228
  emits: ["click"],
3229
3229
  setup(__props, { emit: __emit }) {
@@ -3248,7 +3248,69 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3248
3248
  };
3249
3249
  }
3250
3250
  });
3251
- const _sfc_main$J = /* @__PURE__ */ defineComponent({
3251
+ const _sfc_main$L = /* @__PURE__ */ defineComponent({
3252
+ __name: "BasicButtonDrop",
3253
+ props: {
3254
+ disabled: { type: Boolean },
3255
+ icon: {},
3256
+ options: { default: () => [] }
3257
+ },
3258
+ emits: ["click"],
3259
+ setup(__props, { emit: __emit }) {
3260
+ const props = __props;
3261
+ const emit = __emit;
3262
+ const { b } = useNamespace("basic-button-drop");
3263
+ const cOptions = computed(() => {
3264
+ var _a;
3265
+ return ((_a = props.options) != null ? _a : []).map((option) => {
3266
+ return option;
3267
+ });
3268
+ });
3269
+ function handleSelect(key2) {
3270
+ emit("click", key2);
3271
+ }
3272
+ function handleClick() {
3273
+ if (cOptions.value.length === 0) {
3274
+ return;
3275
+ }
3276
+ const defaultKey = cOptions.value[0].key;
3277
+ emit("click", defaultKey);
3278
+ }
3279
+ return (_ctx, _cache) => {
3280
+ return openBlock(), createBlock(unref(NButtonGroup), null, {
3281
+ default: withCtx(() => [
3282
+ createVNode(unref(XBasicButton), {
3283
+ type: "primary",
3284
+ icon: __props.icon,
3285
+ disabled: __props.disabled,
3286
+ onClick: handleClick
3287
+ }, {
3288
+ default: withCtx(() => [
3289
+ renderSlot(_ctx.$slots, "default")
3290
+ ]),
3291
+ _: 3
3292
+ }, 8, ["icon", "disabled"]),
3293
+ createVNode(unref(NDropdown), {
3294
+ trigger: "click",
3295
+ options: cOptions.value,
3296
+ onSelect: handleSelect
3297
+ }, {
3298
+ default: withCtx(() => [
3299
+ createVNode(unref(XBasicButton), {
3300
+ type: "primary",
3301
+ icon: "ri:arrow-down-s-line",
3302
+ class: normalizeClass(unref(b)())
3303
+ }, null, 8, ["class"])
3304
+ ]),
3305
+ _: 1
3306
+ }, 8, ["options"])
3307
+ ]),
3308
+ _: 3
3309
+ });
3310
+ };
3311
+ }
3312
+ });
3313
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3252
3314
  __name: "BasicButtonEdit",
3253
3315
  emits: ["click"],
3254
3316
  setup(__props, { emit: __emit }) {
@@ -3273,7 +3335,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3273
3335
  };
3274
3336
  }
3275
3337
  });
3276
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
3338
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3277
3339
  __name: "BasicButtonExport",
3278
3340
  props: {
3279
3341
  href: {},
@@ -3324,6 +3386,43 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3324
3386
  };
3325
3387
  }
3326
3388
  });
3389
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3390
+ __name: "BasicButtonExportDrop",
3391
+ props: {
3392
+ disabled: { type: Boolean },
3393
+ icon: { default: "ri:export-line" },
3394
+ options: { default: () => [
3395
+ { label: "全部导出", key: "all" },
3396
+ { label: "按选择条目导出", key: "select" }
3397
+ ] }
3398
+ },
3399
+ emits: ["click"],
3400
+ setup(__props, { emit: __emit }) {
3401
+ const props = __props;
3402
+ const emit = __emit;
3403
+ const cOptions = computed(() => {
3404
+ var _a;
3405
+ return ((_a = props.options) != null ? _a : []).map((option) => {
3406
+ return option;
3407
+ });
3408
+ });
3409
+ function handleClick(key2) {
3410
+ emit("click", key2);
3411
+ }
3412
+ return (_ctx, _cache) => {
3413
+ return openBlock(), createBlock(_sfc_main$L, {
3414
+ icon: __props.icon,
3415
+ options: cOptions.value,
3416
+ onClick: handleClick
3417
+ }, {
3418
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
3419
+ createTextVNode(" 导出 ", -1)
3420
+ ])]),
3421
+ _: 1
3422
+ }, 8, ["icon", "options"]);
3423
+ };
3424
+ }
3425
+ });
3327
3426
  const _hoisted_1$b = ["multiple", "name", "accept"];
3328
3427
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
3329
3428
  __name: "BasicButtonImport",
@@ -3447,12 +3546,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
3447
3546
  };
3448
3547
  }
3449
3548
  });
3450
- const XBasicButtonCreate = withInstall(_sfc_main$L);
3451
- const XBasicButtonEdit = withInstall(_sfc_main$J);
3452
- const XBasicButtonDelete = withInstall(_sfc_main$K);
3453
- const XBasicButtonExport = withInstall(_sfc_main$I);
3549
+ const XBasicButtonCreate = withInstall(_sfc_main$N);
3550
+ const XBasicButtonEdit = withInstall(_sfc_main$K);
3551
+ const XBasicButtonDelete = withInstall(_sfc_main$M);
3552
+ const XBasicButtonExport = withInstall(_sfc_main$J);
3454
3553
  const XBasicButtonImport = withInstall(_sfc_main$H);
3455
3554
  const XBasicButtonPrint = withInstall(_sfc_main$G);
3555
+ const XBasicButtonDrop = withInstall(_sfc_main$L);
3556
+ const XBasicButtonExportDrop = withInstall(_sfc_main$I);
3456
3557
  !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
3457
3558
  !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
3458
3559
  const hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -4705,7 +4806,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
4705
4806
  class: normalizeClass(basicTextClass.value),
4706
4807
  title: unref(isString)(unref(mergedValueRef)) ? unref(mergedValueRef) : void 0
4707
4808
  }, [
4708
- __props.icon ? (openBlock(), createBlock(_sfc_main$U, {
4809
+ __props.icon ? (openBlock(), createBlock(_sfc_main$W, {
4709
4810
  key: 0,
4710
4811
  icon: __props.icon,
4711
4812
  class: normalizeClass(__props.iconClass),
@@ -15468,7 +15569,6 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
15468
15569
  );
15469
15570
  const slotNames = ["cover", "header-extra", "header"];
15470
15571
  return (_ctx, _cache) => {
15471
- const _component_XBasicTitle = resolveComponent("XBasicTitle");
15472
15572
  return openBlock(), createBlock(unref(NModal), mergeProps(getBindValues.value, {
15473
15573
  show: visibleRef.value,
15474
15574
  "onUpdate:show": _cache[0] || (_cache[0] = ($event) => visibleRef.value = $event),
@@ -15490,7 +15590,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
15490
15590
  !_ctx.$slots.header && __props.title ? {
15491
15591
  name: "header",
15492
15592
  fn: withCtx(() => [
15493
- createVNode(_component_XBasicTitle, null, {
15593
+ createVNode(unref(XBasicTitle), null, {
15494
15594
  default: withCtx(() => [
15495
15595
  createTextVNode(toDisplayString(__props.title), 1)
15496
15596
  ]),
@@ -26939,8 +27039,10 @@ export {
26939
27039
  XBasicButton,
26940
27040
  XBasicButtonCreate,
26941
27041
  XBasicButtonDelete,
27042
+ XBasicButtonDrop,
26942
27043
  XBasicButtonEdit,
26943
27044
  XBasicButtonExport,
27045
+ XBasicButtonExportDrop,
26944
27046
  XBasicButtonGroup,
26945
27047
  XBasicButtonImport,
26946
27048
  XBasicButtonPrint,