@dt-frames/ui 1.0.25 → 1.0.27

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.
@@ -208,6 +208,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
208
208
  }>>;
209
209
  setFormModel: (key: string, value: any) => void;
210
210
  handleMethod: (params: boolean | import("@dt-frames/core").ButtonProps) => void;
211
+ handleEnterPress: () => void;
211
212
  getActionsProps: import("vue").ComputedRef<Recordable<any>>;
212
213
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("register" | "reset")[], "register" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
213
214
  mode: {
@@ -117,6 +117,7 @@ declare const _default: import("vue").DefineComponent<{
117
117
  }>>;
118
118
  setFormModel: (key: string, value: any) => void;
119
119
  handleMethod: (params: boolean | ButtonProps) => void;
120
+ handleEnterPress: () => void;
120
121
  getActionsProps: import("vue").ComputedRef<Recordable<any>>;
121
122
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("register" | "reset")[], "register" | "reset", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
122
123
  mode: {
package/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, toRefs, isVNode, inject, onUnmounted, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef, useAttrs as useAttrs$1, normalizeProps, guardReactiveProps, withDirectives, resolveDirective, render, createSlots, useSlots as useSlots$1, withModifiers, vShow, toRef, Transition } from "vue";
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, toRefs, isVNode, inject, onUnmounted, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef, useAttrs as useAttrs$1, normalizeProps, guardReactiveProps, withDirectives, resolveDirective, render, withKeys, createSlots, useSlots as useSlots$1, withModifiers, vShow, toRef, Transition } from "vue";
2
2
  import { isString, isArray as isArray$1, isObject, isFunction, error, useTimeoutFn, useAttrs, useSlots, dispatchResize, BAR_MAP, off, renderThumbStyle, on, useAppStore, addResizeListener, removeResizeListener, windowResizeFn, isNumber, isBoolean, isNull, DtCache, CacheKey, deepMerge, http, getDynamicProps, getDictValueByCode, formatNumber, isVnode, getPopupContainer, isNullAndUnDef, useMessage, isEmpty, useTheme, useMenu, useHeader, useGo, Pages, localeList, changeLocale, Theme, MenuMode, MenuType, useThemeStore, ContentMode, useMultipleTab, copyText, MenuSplitTye, isUrl, openWindow, RouteReuseStore, menuList2Map, useApp } from "@dt-frames/core";
3
3
  import { InputSearch, Tooltip, Modal as Modal$1, RadioGroup, RadioButton, InputGroup, Input, Button, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Form, FormItem, Row, Popover, Spin, Dropdown, Menu, MenuItem, CheckboxGroup, Table, Upload, Image, MenuDivider, Tree, Empty, BackTop, Breadcrumb, Avatar, Drawer, SubMenu, LayoutHeader, LayoutSider, Tabs, TabPane, LayoutFooter, LayoutContent, ConfigProvider, Layout } from "ant-design-vue";
4
4
  import { isEqual, omit, cloneDeep, upperFirst, set, uniqBy, difference, get, trim } from "lodash-es";
@@ -2034,22 +2034,21 @@ function useModalOut() {
2034
2034
  (_a = getInstance()) == null ? void 0 : _a.setModalProps({
2035
2035
  visible: true
2036
2036
  });
2037
- const { data, afterClose } = params || {};
2037
+ const { data = null, afterClose } = params || {};
2038
2038
  const id = unref(uid);
2039
2039
  cbTransfer[unref(uid)] = (rsp) => {
2040
2040
  if (afterClose && isFunction(afterClose)) {
2041
2041
  afterClose(rsp);
2042
2042
  }
2043
2043
  };
2044
- if (!data)
2045
- return;
2044
+ let dataToRaw = isObject(data) ? { ...toRaw(data) } : data;
2046
2045
  if (openOnSet) {
2047
- dataTransfer[id] = { ...toRaw(data) };
2046
+ dataTransfer[id] = dataToRaw;
2048
2047
  return;
2049
2048
  }
2050
- const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data));
2049
+ const equal = isEqual(toRaw(dataTransfer[id]), dataToRaw);
2051
2050
  if (!equal) {
2052
- dataTransfer[id] = toRaw(data);
2051
+ dataTransfer[id] = dataToRaw;
2053
2052
  }
2054
2053
  },
2055
2054
  closeModal: () => {
@@ -3101,7 +3100,7 @@ var _sfc_main$Q = defineComponent({
3101
3100
  default: () => [createVNode("div", {
3102
3101
  "style": "display:flex"
3103
3102
  }, [createVNode("div", {
3104
- "style": "flex:1;"
3103
+ "style": "flex:1; width: 100%;"
3105
3104
  }, [getContent()]), !!suffix && createVNode("span", {
3106
3105
  "class": "suffix"
3107
3106
  }, [getSuffix()])])]
@@ -3188,19 +3187,12 @@ var _sfc_main$Q = defineComponent({
3188
3187
  disabled = dynamicDisabled(unref(getValues));
3189
3188
  return disabled;
3190
3189
  });
3191
- const {
3192
- enterToSearch = appConf.ui.form.enterToSearch,
3193
- onSearch,
3194
- mode
3195
- } = props.formProps;
3196
3190
  const itemProps = {
3197
3191
  allowClear: appConf.ui.form.allowClear,
3198
3192
  getPopupContainer: (trigger) => trigger.parentNode,
3199
3193
  size: size || appConf.ui.form.size,
3200
3194
  ...unref(getComponentProps),
3201
- disabled: unref(getDisable),
3202
- onPressEnter: mode === "search" && enterToSearch ? onSearch : () => {
3203
- }
3195
+ disabled: unref(getDisable)
3204
3196
  };
3205
3197
  if (!itemProps.disabled && component !== "RangePicker") {
3206
3198
  itemProps.placeholder = ((_a = unref(getComponentProps)) == null ? void 0 : _a.placeholder) || createPlaceholder(component);
@@ -3466,6 +3458,7 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3466
3458
  const _component_FormItem = resolveComponent("FormItem");
3467
3459
  const _component_Col = resolveComponent("Col");
3468
3460
  const _directive_icon = resolveDirective("icon");
3461
+ const _directive_auth = resolveDirective("auth");
3469
3462
  return _ctx.show ? (openBlock(), createBlock(_component_Col, normalizeProps(mergeProps({ key: 0 }, _ctx.colOpt)), {
3470
3463
  default: withCtx(() => [
3471
3464
  createVNode(_component_FormItem, {
@@ -3477,12 +3470,11 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3477
3470
  default: withCtx(() => [
3478
3471
  (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.buttonList, (button) => {
3479
3472
  return openBlock(), createElementBlock(Fragment, null, [
3480
- (button.show === void 0 ? true : button.show) ? (openBlock(), createBlock(_component_Button, {
3473
+ (button.show === void 0 ? true : button.show) ? withDirectives((openBlock(), createBlock(_component_Button, {
3481
3474
  key: 0,
3482
3475
  type: button.type,
3483
3476
  class: normalizeClass(button.class),
3484
3477
  disabled: button.disabled,
3485
- permission: button.auth,
3486
3478
  loading: button.loading,
3487
3479
  onClick: ($event) => _ctx.handleBtnClick(button)
3488
3480
  }, {
@@ -3498,7 +3490,9 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
3498
3490
  ]) : createCommentVNode("", true)
3499
3491
  ]),
3500
3492
  _: 2
3501
- }, 1032, ["type", "class", "disabled", "permission", "loading", "onClick"])) : createCommentVNode("", true)
3493
+ }, 1032, ["type", "class", "disabled", "loading", "onClick"])), [
3494
+ [_directive_auth, button.auth]
3495
+ ]) : createCommentVNode("", true)
3502
3496
  ], 64);
3503
3497
  }), 256)),
3504
3498
  _ctx.showAdvanceRef ? (openBlock(), createBlock(_component_Button, {
@@ -3968,6 +3962,11 @@ const _sfc_main$O = defineComponent({
3968
3962
  });
3969
3963
  }
3970
3964
  }
3965
+ function handleEnterPress() {
3966
+ if (appConf.ui.form.enterToSearch && unref(getProps).mode === "search") {
3967
+ handleMethod(SEARCH_BTNS.filter((it) => it.name === SEARCH_BTN_NAME)[0]);
3968
+ }
3969
+ }
3971
3970
  const {
3972
3971
  updateSchema,
3973
3972
  resetSchema,
@@ -4079,6 +4078,7 @@ const _sfc_main$O = defineComponent({
4079
4078
  props,
4080
4079
  setFormModel,
4081
4080
  handleMethod,
4081
+ handleEnterPress,
4082
4082
  getActionsProps
4083
4083
  };
4084
4084
  }
@@ -4092,7 +4092,8 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
4092
4092
  ref: "formElRef",
4093
4093
  class: _ctx.getFormClass,
4094
4094
  model: _ctx.formModel,
4095
- layout: _ctx.getLayout
4095
+ layout: _ctx.getLayout,
4096
+ onKeypress: withKeys(_ctx.handleEnterPress, ["enter"])
4096
4097
  }), {
4097
4098
  default: withCtx(() => [
4098
4099
  createVNode(_component_Row, normalizeProps(guardReactiveProps(_ctx.getProps.rowProps)), {
@@ -4126,7 +4127,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
4126
4127
  }, 16)
4127
4128
  ]),
4128
4129
  _: 3
4129
- }, 16, ["class", "model", "layout"]);
4130
+ }, 16, ["class", "model", "layout", "onKeypress"]);
4130
4131
  }
4131
4132
  var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$4]]);
4132
4133
  function useForm(props) {
@@ -4774,7 +4775,7 @@ function usePagination(props) {
4774
4775
  pageSize: defaultPageSize,
4775
4776
  size: size === "small" ? "small" : "default",
4776
4777
  defaultPageSize,
4777
- showTotal: (total, range) => `\u603B\u5171${Math.ceil(total / unref(props).pagination.pageSize)}\u9875`,
4778
+ showTotal: (total, range) => `\u603B\u5171${total}\u6761`,
4778
4779
  showSizeChanger: true,
4779
4780
  pageSizeOptions,
4780
4781
  showQuickJumper: true,
@@ -5358,6 +5359,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5358
5359
  }
5359
5360
  return (_ctx, _cache) => {
5360
5361
  const _directive_icon = resolveDirective("icon");
5362
+ const _directive_auth = resolveDirective("auth");
5361
5363
  return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.btns, (item) => {
5362
5364
  return openBlock(), createElementBlock("span", _hoisted_1$s, [
5363
5365
  item.ifShow ? (openBlock(), createBlock(unref(Tooltip), {
@@ -5387,7 +5389,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5387
5389
  createVNode(unref(Menu), { class: "dt-action-select" }, {
5388
5390
  default: withCtx(() => [
5389
5391
  (openBlock(true), createElementBlock(Fragment, null, renderList(props.btns, (item) => {
5390
- return openBlock(), createElementBlock(Fragment, null, [
5392
+ return withDirectives((openBlock(), createElementBlock("span", null, [
5391
5393
  item.ifShow ? (openBlock(), createBlock(unref(MenuItem), {
5392
5394
  key: 0,
5393
5395
  onClick: ($event) => handleAction(item)
@@ -5402,7 +5404,9 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
5402
5404
  ]),
5403
5405
  _: 2
5404
5406
  }, 1032, ["onClick"])) : createCommentVNode("", true)
5405
- ], 64);
5407
+ ])), [
5408
+ [_directive_auth, item.auth]
5409
+ ]);
5406
5410
  }), 256))
5407
5411
  ]),
5408
5412
  _: 1
@@ -7197,6 +7201,7 @@ function useCurd(curdOpt) {
7197
7201
  }), null)]));
7198
7202
  };
7199
7203
  function add() {
7204
+ curdOpt.title = `\u65B0\u589E${curdOpt.title}`;
7200
7205
  formsVal.value = null;
7201
7206
  openModal();
7202
7207
  }
@@ -7227,6 +7232,7 @@ function useCurd(curdOpt) {
7227
7232
  primaryKey = "id",
7228
7233
  curd
7229
7234
  } = curdOpt;
7235
+ curdOpt.title = `\u7F16\u8F91${curdOpt.title}`;
7230
7236
  curd.onQueryById(row[primaryKey]).then((rsp) => {
7231
7237
  formsVal.value = rsp;
7232
7238
  nextTick(() => dispatchResize());
@@ -9787,13 +9793,14 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
9787
9793
  __name: "menu-item-content",
9788
9794
  props: contentProps,
9789
9795
  setup(__props) {
9796
+ const { getIsZH } = useHeader();
9790
9797
  return (_ctx, _cache) => {
9791
9798
  const _directive_icon = resolveDirective("icon");
9792
9799
  return openBlock(), createElementBlock("span", _hoisted_1$4, [
9793
9800
  withDirectives(createElementVNode("span", _hoisted_2$2, null, 512), [
9794
9801
  [_directive_icon, _ctx.item.icon]
9795
9802
  ]),
9796
- createTextVNode(" " + toDisplayString(_ctx.item.label), 1)
9803
+ createTextVNode(" " + toDisplayString(unref(getIsZH) ? _ctx.item.label : _ctx.item.enLabel), 1)
9797
9804
  ]);
9798
9805
  };
9799
9806
  }
@@ -10208,10 +10215,10 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
10208
10215
  const _sfc_main$8 = /* @__PURE__ */ defineComponent({
10209
10216
  __name: "drag-bar",
10210
10217
  setup(__props) {
10211
- const { getMiniWidthNumber, getCollapsed, getCanDrag } = useMenu();
10218
+ const { getCollapsed, getCanDrag, getMenuWidth } = useMenu();
10212
10219
  const getDragBarStyle = computed(() => {
10213
- if (unref(getCollapsed)) {
10214
- return { left: `${unref(getMiniWidthNumber)}px` };
10220
+ if (!unref(getCollapsed)) {
10221
+ return { left: `${unref(getMenuWidth)}px` };
10215
10222
  }
10216
10223
  return {};
10217
10224
  });
@@ -85,6 +85,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
85
85
  }>> & {
86
86
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
87
87
  }>>;
88
+ getIsZH: import("vue").ComputedRef<boolean>;
88
89
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
89
90
  item: {
90
91
  type: ObjectConstructor;
@@ -626,6 +626,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
626
626
  }>> & {
627
627
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
628
628
  }>>;
629
+ getIsZH: import("vue").ComputedRef<boolean>;
629
630
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
630
631
  item: {
631
632
  type: ObjectConstructor;
@@ -679,6 +680,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
679
680
  }>> & {
680
681
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
681
682
  }>>;
683
+ getIsZH: import("vue").ComputedRef<boolean>;
682
684
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
683
685
  item: {
684
686
  type: ObjectConstructor;
@@ -161,6 +161,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
161
161
  }>> & {
162
162
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
163
163
  }>>;
164
+ getIsZH: import("vue").ComputedRef<boolean>;
164
165
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
165
166
  item: {
166
167
  type: ObjectConstructor;
@@ -214,6 +215,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
214
215
  }>> & {
215
216
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
216
217
  }>>;
218
+ getIsZH: import("vue").ComputedRef<boolean>;
217
219
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
218
220
  item: {
219
221
  type: ObjectConstructor;
@@ -18,6 +18,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
18
18
  }>> & {
19
19
  [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
20
20
  }>>;
21
+ getIsZH: import("vue").ComputedRef<boolean>;
21
22
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
22
23
  item: {
23
24
  type: ObjectConstructor;
@@ -1,7 +1,7 @@
1
1
  declare const _sfc_main: import("vue").DefineComponent<{}, {
2
- getMiniWidthNumber: import("vue").ComputedRef<48 | 80>;
3
2
  getCollapsed: import("vue").ComputedRef<boolean>;
4
3
  getCanDrag: import("vue").ComputedRef<boolean>;
4
+ getMenuWidth: import("vue").ComputedRef<string | number>;
5
5
  getDragBarStyle: import("vue").ComputedRef<{
6
6
  left: string;
7
7
  } | {
@@ -136,9 +136,9 @@ declare const _sfc_main: import("vue").DefineComponent<{}, {
136
136
  isHorizontal: boolean;
137
137
  }>;
138
138
  DragBar: import("vue").DefineComponent<{}, {
139
- getMiniWidthNumber: import("vue").ComputedRef<48 | 80>;
140
139
  getCollapsed: import("vue").ComputedRef<boolean>;
141
140
  getCanDrag: import("vue").ComputedRef<boolean>;
141
+ getMenuWidth: import("vue").ComputedRef<string | number>;
142
142
  getDragBarStyle: import("vue").ComputedRef<{
143
143
  left: string;
144
144
  } | {
@@ -131,6 +131,7 @@
131
131
  margin-right: 12px;
132
132
  height: 40px !important;
133
133
  width: 28px;
134
+ flex: 0 0 28px;
134
135
  text-align: center;
135
136
  }
136
137
 
@@ -182,9 +183,8 @@
182
183
  }
183
184
 
184
185
  .dt-darg-bar{
185
- position: absolute;
186
+ position: fixed;
186
187
  top: 0;
187
- right: 0;
188
188
  z-index: @side-drag-z-index;
189
189
  width: 2px;
190
190
  height: 100%;
@@ -65,3 +65,7 @@
65
65
  }
66
66
  }
67
67
 
68
+ .ant-menu-dark .ant-menu-submenu-title:focus-visible {
69
+ box-shadow: none;
70
+ }
71
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dt-frames/ui",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "keywords": [
5
5
  "ui",
6
6
  "dt-ui"