@otwb/ui 2.0.27 → 2.0.29

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.
@@ -4,7 +4,7 @@ import { g as useStyle, h as useMergedClsPrefix, n as cB, r as cE, t as c } from
4
4
  import { Fragment, computed, createTextVNode, createVNode, defineComponent, inject, isVNode, mergeProps, nextTick, reactive, ref, shallowRef, toRaw, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
5
5
  import { toReactive, unrefElement, until, useCurrentElement, useElementSize, watchDebounced } from "@vueuse/core";
6
6
  import { NAvatar, NAvatarGroup, NButton, NCard, NCheckbox, NCheckboxGroup, NDataTable, NDropdown, NEllipsis, NEmpty, NFlex, NForm, NFormItem, NGi, NGrid, NH4, NIcon, NInput, NList, NListItem, NPagination, NPerformantEllipsis, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpin, NTag, NText, NTooltip, NTransfer, NTree, NTreeSelect, dataTableProps, formProps, useDialog } from "ithinkdt-ui";
7
- import { useRoute as useRoute$1 } from "vue-router";
7
+ import { useRoute } from "vue-router";
8
8
  import { VOverflow, VResizeObserver } from "vueuc";
9
9
  import { Sortable } from "sortablejs/modular/sortable.core.esm.js";
10
10
  import { pickProps } from "@otwb/common/object";
@@ -406,28 +406,27 @@ const DataCustom = /* @__PURE__ */ defineComponent({
406
406
  save: ""
407
407
  },
408
408
  setup(x, { emit: S }) {
409
- let { t: C } = useI18n();
410
- function w() {
411
- let e = useRoute$1();
409
+ let { t: C } = useI18n(), w = useRoute();
410
+ function T() {
412
411
  if (x.showFixed) {
413
- e.name + "";
414
- let b = e.name + "__table";
412
+ w.name + "";
413
+ let e = w.name + "__table";
415
414
  $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
416
- __table: localStorage.getItem(b),
417
- url: e.name
415
+ __table: localStorage.getItem(e),
416
+ url: w.name
418
417
  }, { requestType: "json" }).then((e) => {
419
418
  $msg.success("配置保存成功!");
420
419
  });
421
420
  } else S("save");
422
421
  }
423
- function T(e, b, C) {
422
+ function E(e, b, C) {
424
423
  S("custom", {
425
424
  key: e[x.keyField],
426
425
  [b]: C
427
426
  });
428
427
  }
429
- let E = ref();
430
- return watch(E, (e) => {
428
+ let D = ref();
429
+ return watch(D, (e) => {
431
430
  e.$el && Sortable.create(e.$el, {
432
431
  animation: 150,
433
432
  ghostClass: "ghost",
@@ -459,14 +458,14 @@ const DataCustom = /* @__PURE__ */ defineComponent({
459
458
  text: !0,
460
459
  type: "primary",
461
460
  size: "small",
462
- onClick: () => w()
461
+ onClick: () => T()
463
462
  }, { default: () => [createTextVNode("保存")] }), createVNode(NButton, {
464
463
  text: !0,
465
464
  type: "primary",
466
465
  size: "small",
467
466
  onClick: () => S("custom", !0)
468
467
  }, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })])] }), createVNode(NFlex, {
469
- ref: E,
468
+ ref: D,
470
469
  vertical: !0
471
470
  }, _isSlot$6(b = x.data.filter((e) => e[x.visiblityField] !== !1).map((e) => createVNode(DataCustomItem, {
472
471
  key: e[x.keyField],
@@ -474,8 +473,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
474
473
  hidden: e[x.hiddenField],
475
474
  fixed: e[x.fixedField],
476
475
  showFixed: x.showFixed,
477
- onUpdateHidden: (b) => T(e, "hidden", b),
478
- onUpdateFixed: (b) => T(e, "fixed", b)
476
+ onUpdateHidden: (b) => E(e, "hidden", b),
477
+ onUpdateFixed: (b) => E(e, "fixed", b)
479
478
  }, null))) ? b : { default: () => [b] })] });
480
479
  }
481
480
  });
@@ -751,69 +750,69 @@ const DataForm = /* @__PURE__ */ defineComponent({
751
750
  "collapse"
752
751
  ],
753
752
  setup(b, { expose: x, emit: S }) {
754
- let C = () => {
755
- let e = useRoute$1(), b = e.name + "__form";
756
- e.name + "", $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
757
- __form: localStorage.getItem(b),
758
- url: e.name
753
+ let C = useRoute(), w = () => {
754
+ let e = C.name + "__form";
755
+ C.name + "", $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
756
+ __form: localStorage.getItem(e),
757
+ url: C.name
759
758
  }, { requestType: "json" }).then((e) => {
760
759
  $msg.success("配置保存成功!");
761
760
  });
762
- }, { t: w } = useI18n(), T = (e) => {
761
+ }, { t: T } = useI18n(), E = (e) => {
763
762
  S("filter", b.model, e);
764
- }, E = (e) => {
763
+ }, D = (e) => {
765
764
  S("reset", e), b.filterOnReset && S("filter", b.model, e);
766
- }, D = ref(b.defaultCollapsed), k = (e) => {
767
- D.value = e;
765
+ }, k = ref(b.defaultCollapsed), A = (e) => {
766
+ k.value = e;
768
767
  };
769
- x({ collapse: k });
770
- let A = reactive({
768
+ x({ collapse: A });
769
+ let j = reactive({
771
770
  span: 6,
772
771
  suffix: !0
773
772
  });
774
773
  return () => {
775
- let { filterOnReset: e, filterText: x, resetText: j, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
774
+ let { filterOnReset: e, filterText: x, resetText: C, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
776
775
  return createVNode(DataForm, mergeProps({ grid: {
777
776
  cols: "12 768:18 1200:30 1536:30",
778
777
  yGap: 16,
779
778
  xGap: 12,
780
779
  ...I,
781
- collapsed: D.value
780
+ collapsed: k.value
782
781
  } }, L, {
783
782
  showFeedback: !1,
784
- showAction: A,
785
- onSubmit: T,
786
- onReset: E
787
- }), { action: ({ cols: e, spans: T }) => (A.suffix = e < T + A.span, createVNode(NFlex, {
788
- justify: A.suffix ? "end" : "start",
783
+ showAction: j,
784
+ onSubmit: E,
785
+ onReset: D
786
+ }), { action: ({ cols: e, spans: E }) => (j.suffix = e < E + j.span, createVNode(NFlex, {
787
+ justify: j.suffix ? "end" : "start",
789
788
  align: "center"
790
789
  }, { default: () => [
791
- F && A.suffix ? createVNode(NButton, {
790
+ F && j.suffix ? createVNode(NButton, {
792
791
  class: "collapsedBtn",
793
792
  text: !0,
794
793
  type: "primary",
795
794
  iconPlacement: "right",
796
- renderIcon: D.value ? IDown : IUp,
797
- onClick: () => k(!D.value)
798
- }, { default: () => [D.value ? w("common.page.filter.expand") : w("common.page.filter.collapse")] }) : void 0,
799
- A.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
795
+ renderIcon: k.value ? IDown : IUp,
796
+ onClick: () => A(!k.value)
797
+ }, { default: () => [k.value ? T("common.page.filter.expand") : T("common.page.filter.collapse")] }) : void 0,
798
+ j.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
800
799
  createVNode(NButton, {
801
800
  class: "submitWrap",
802
801
  attrType: "submit",
803
802
  type: "primary",
804
803
  disabled: b.disabled,
805
804
  loading: b.loading
806
- }, { default: () => [x || w("common.page.filter.submitText")] }),
805
+ }, { default: () => [x || T("common.page.filter.submitText")] }),
807
806
  createVNode(NButton, {
808
807
  attrType: "reset",
809
808
  disabled: b.disabled || b.loading
810
- }, { default: () => [j || w("common.page.form.resetText")] }),
809
+ }, { default: () => [C || T("common.page.form.resetText")] }),
811
810
  N ? createVNode(DataCustom, {
812
811
  isFilter: !0,
813
812
  keyField: "name",
814
813
  showFixed: !1,
815
814
  data: L.items,
816
- onSave: C,
815
+ onSave: w,
817
816
  onCustom: (e) => S("custom", e),
818
817
  size: 16,
819
818
  type: "primary"
@@ -1,5 +1,5 @@
1
1
  import "./use-i18n-Dx7V4KrY.js";
2
2
  import "./directives-CRvPGywW.js";
3
3
  import "./use-style-DcT-1dj4.js";
4
- import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-fVJ6Vk1p.js";
4
+ import { a as NRadios, c as DataSelection, d as useLocaleEdit, f as DataFilter, g as NCheckboxes, h as DataActions, i as renderUsers, l as DataPagination, m as DataCustom, n as DtUserDept, o as DataTable, p as DataForm, r as DtUserRender, s as useDataTableDrag, t as DtDeptRender, u as DataLocaleInput } from "./components-tytSIKSx.js";
5
5
  export { DataActions, DataCustom, DataFilter, DataForm, DataLocaleInput, DataPagination, DataSelection, DataTable, DtDeptRender, DtUserDept, DtUserRender, NCheckboxes, NRadios, renderUsers, useDataTableDrag, useLocaleEdit };
package/dist/page.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as useI18n } from "./use-i18n-Dx7V4KrY.js";
2
2
  import "./directives-CRvPGywW.js";
3
3
  import "./use-style-DcT-1dj4.js";
4
- import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-fVJ6Vk1p.js";
4
+ import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-tytSIKSx.js";
5
5
  import { computed, createVNode, defineComponent, h, isVNode, mergeProps, nextTick, ref, shallowRef, unref } from "vue";
6
6
  import { until } from "@vueuse/core";
7
7
  import { NButton, NCheckbox, NColorPicker, NDatePicker, NDrawer, NDrawerContent, NFlex, NInput, NInputNumber, NModal, NScrollbar, NSelect, NText, NUpload, useMessage } from "ithinkdt-ui";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@otwb/ui",
3
- "version": "2.0.27",
3
+ "version": "2.0.29",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",