@maxax/ui 1.1.4 → 1.1.6

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,72 @@ 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, e } = 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), {
3281
+ class: normalizeClass(unref(b)())
3282
+ }, {
3283
+ default: withCtx(() => [
3284
+ createVNode(unref(XBasicButton), {
3285
+ type: "primary",
3286
+ icon: __props.icon,
3287
+ disabled: __props.disabled,
3288
+ class: normalizeClass(unref(e)("trigger-button")),
3289
+ onClick: handleClick
3290
+ }, {
3291
+ default: withCtx(() => [
3292
+ renderSlot(_ctx.$slots, "default")
3293
+ ]),
3294
+ _: 3
3295
+ }, 8, ["icon", "disabled", "class"]),
3296
+ createVNode(unref(NDropdown), {
3297
+ trigger: "click",
3298
+ options: cOptions.value,
3299
+ onSelect: handleSelect
3300
+ }, {
3301
+ default: withCtx(() => [
3302
+ createVNode(unref(XBasicButton), {
3303
+ type: "primary",
3304
+ icon: "ri:arrow-down-s-line",
3305
+ class: normalizeClass(unref(e)("trigger-arrow"))
3306
+ }, null, 8, ["class"])
3307
+ ]),
3308
+ _: 1
3309
+ }, 8, ["options"])
3310
+ ]),
3311
+ _: 3
3312
+ }, 8, ["class"]);
3313
+ };
3314
+ }
3315
+ });
3316
+ const _sfc_main$K = /* @__PURE__ */ defineComponent({
3252
3317
  __name: "BasicButtonEdit",
3253
3318
  emits: ["click"],
3254
3319
  setup(__props, { emit: __emit }) {
@@ -3273,7 +3338,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3273
3338
  };
3274
3339
  }
3275
3340
  });
3276
- const _sfc_main$I = /* @__PURE__ */ defineComponent({
3341
+ const _sfc_main$J = /* @__PURE__ */ defineComponent({
3277
3342
  __name: "BasicButtonExport",
3278
3343
  props: {
3279
3344
  href: {},
@@ -3324,6 +3389,43 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3324
3389
  };
3325
3390
  }
3326
3391
  });
3392
+ const _sfc_main$I = /* @__PURE__ */ defineComponent({
3393
+ __name: "BasicButtonExportDrop",
3394
+ props: {
3395
+ disabled: { type: Boolean },
3396
+ icon: { default: "ri:export-line" },
3397
+ options: { default: () => [
3398
+ { label: "全部导出", key: "all" },
3399
+ { label: "按选择条目导出", key: "select" }
3400
+ ] }
3401
+ },
3402
+ emits: ["click"],
3403
+ setup(__props, { emit: __emit }) {
3404
+ const props = __props;
3405
+ const emit = __emit;
3406
+ const cOptions = computed(() => {
3407
+ var _a;
3408
+ return ((_a = props.options) != null ? _a : []).map((option) => {
3409
+ return option;
3410
+ });
3411
+ });
3412
+ function handleClick(key2) {
3413
+ emit("click", key2);
3414
+ }
3415
+ return (_ctx, _cache) => {
3416
+ return openBlock(), createBlock(_sfc_main$L, {
3417
+ icon: __props.icon,
3418
+ options: cOptions.value,
3419
+ onClick: handleClick
3420
+ }, {
3421
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [
3422
+ createTextVNode(" 导出 ", -1)
3423
+ ])]),
3424
+ _: 1
3425
+ }, 8, ["icon", "options"]);
3426
+ };
3427
+ }
3428
+ });
3327
3429
  const _hoisted_1$b = ["multiple", "name", "accept"];
3328
3430
  const _sfc_main$H = /* @__PURE__ */ defineComponent({
3329
3431
  __name: "BasicButtonImport",
@@ -3447,12 +3549,14 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
3447
3549
  };
3448
3550
  }
3449
3551
  });
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);
3552
+ const XBasicButtonCreate = withInstall(_sfc_main$N);
3553
+ const XBasicButtonEdit = withInstall(_sfc_main$K);
3554
+ const XBasicButtonDelete = withInstall(_sfc_main$M);
3555
+ const XBasicButtonExport = withInstall(_sfc_main$J);
3454
3556
  const XBasicButtonImport = withInstall(_sfc_main$H);
3455
3557
  const XBasicButtonPrint = withInstall(_sfc_main$G);
3558
+ const XBasicButtonDrop = withInstall(_sfc_main$L);
3559
+ const XBasicButtonExportDrop = withInstall(_sfc_main$I);
3456
3560
  !!(process.env.NODE_ENV !== "production") ? Object.freeze({}) : {};
3457
3561
  !!(process.env.NODE_ENV !== "production") ? Object.freeze([]) : [];
3458
3562
  const hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -4705,7 +4809,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
4705
4809
  class: normalizeClass(basicTextClass.value),
4706
4810
  title: unref(isString)(unref(mergedValueRef)) ? unref(mergedValueRef) : void 0
4707
4811
  }, [
4708
- __props.icon ? (openBlock(), createBlock(_sfc_main$U, {
4812
+ __props.icon ? (openBlock(), createBlock(_sfc_main$W, {
4709
4813
  key: 0,
4710
4814
  icon: __props.icon,
4711
4815
  class: normalizeClass(__props.iconClass),
@@ -26938,8 +27042,10 @@ export {
26938
27042
  XBasicButton,
26939
27043
  XBasicButtonCreate,
26940
27044
  XBasicButtonDelete,
27045
+ XBasicButtonDrop,
26941
27046
  XBasicButtonEdit,
26942
27047
  XBasicButtonExport,
27048
+ XBasicButtonExportDrop,
26943
27049
  XBasicButtonGroup,
26944
27050
  XBasicButtonImport,
26945
27051
  XBasicButtonPrint,