@otwb/ui 2.0.25 → 2.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.
@@ -4,6 +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
8
  import { VOverflow, VResizeObserver } from "vueuc";
8
9
  import { Sortable } from "sortablejs/modular/sortable.core.esm.js";
9
10
  import { pickProps } from "@otwb/common/object";
@@ -405,27 +406,28 @@ const DataCustom = /* @__PURE__ */ defineComponent({
405
406
  save: ""
406
407
  },
407
408
  setup(x, { emit: S }) {
408
- let { t: C } = useI18n(), w = useRoute();
409
- function T() {
409
+ let { t: C } = useI18n();
410
+ function w() {
411
+ let e = useRoute$1();
410
412
  if (x.showFixed) {
411
- w.name + "";
412
- let e = w.name + "__table";
413
+ e.name + "";
414
+ let b = e.name + "__table";
413
415
  $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
414
- __table: localStorage.getItem(e),
415
- url: w.name
416
+ __table: localStorage.getItem(b),
417
+ url: e.name
416
418
  }, { requestType: "json" }).then((e) => {
417
419
  $msg.success("配置保存成功!");
418
420
  });
419
421
  } else S("save");
420
422
  }
421
- function E(e, b, C) {
423
+ function T(e, b, C) {
422
424
  S("custom", {
423
425
  key: e[x.keyField],
424
426
  [b]: C
425
427
  });
426
428
  }
427
- let D = ref();
428
- return watch(D, (e) => {
429
+ let E = ref();
430
+ return watch(E, (e) => {
429
431
  e.$el && Sortable.create(e.$el, {
430
432
  animation: 150,
431
433
  ghostClass: "ghost",
@@ -457,14 +459,14 @@ const DataCustom = /* @__PURE__ */ defineComponent({
457
459
  text: !0,
458
460
  type: "primary",
459
461
  size: "small",
460
- onClick: () => T()
462
+ onClick: () => w()
461
463
  }, { default: () => [createTextVNode("保存")] }), createVNode(NButton, {
462
464
  text: !0,
463
465
  type: "primary",
464
466
  size: "small",
465
467
  onClick: () => S("custom", !0)
466
468
  }, _isSlot$6(e = C("common.page.custom.reset")) ? e : { default: () => [e] })])] }), createVNode(NFlex, {
467
- ref: D,
469
+ ref: E,
468
470
  vertical: !0
469
471
  }, _isSlot$6(b = x.data.filter((e) => e[x.visiblityField] !== !1).map((e) => createVNode(DataCustomItem, {
470
472
  key: e[x.keyField],
@@ -472,8 +474,8 @@ const DataCustom = /* @__PURE__ */ defineComponent({
472
474
  hidden: e[x.hiddenField],
473
475
  fixed: e[x.fixedField],
474
476
  showFixed: x.showFixed,
475
- onUpdateHidden: (b) => E(e, "hidden", b),
476
- onUpdateFixed: (b) => E(e, "fixed", b)
477
+ onUpdateHidden: (b) => T(e, "hidden", b),
478
+ onUpdateFixed: (b) => T(e, "fixed", b)
477
479
  }, null))) ? b : { default: () => [b] })] });
478
480
  }
479
481
  });
@@ -749,69 +751,69 @@ const DataForm = /* @__PURE__ */ defineComponent({
749
751
  "collapse"
750
752
  ],
751
753
  setup(b, { expose: x, emit: S }) {
752
- let C = useRoute(), w = () => {
753
- let e = C.name + "__form";
754
- C.name + "", $fetch.post(`${SERVER_CTX.SYS}/cli/module/custom-config/save`, {
755
- __form: localStorage.getItem(e),
756
- url: C.name
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
757
759
  }, { requestType: "json" }).then((e) => {
758
760
  $msg.success("配置保存成功!");
759
761
  });
760
- }, { t: T } = useI18n(), E = (e) => {
762
+ }, { t: w } = useI18n(), T = (e) => {
761
763
  S("filter", b.model, e);
762
- }, D = (e) => {
764
+ }, E = (e) => {
763
765
  S("reset", e), b.filterOnReset && S("filter", b.model, e);
764
- }, k = ref(b.defaultCollapsed), A = (e) => {
765
- k.value = e;
766
+ }, D = ref(b.defaultCollapsed), k = (e) => {
767
+ D.value = e;
766
768
  };
767
- x({ collapse: A });
768
- let j = reactive({
769
+ x({ collapse: k });
770
+ let A = reactive({
769
771
  span: 6,
770
772
  suffix: !0
771
773
  });
772
774
  return () => {
773
- let { filterOnReset: e, filterText: x, resetText: C, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
775
+ let { filterOnReset: e, filterText: x, resetText: j, customizable: N, defaultCollapsed: P, collapsible: F, grid: I,...L } = b;
774
776
  return createVNode(DataForm, mergeProps({ grid: {
775
777
  cols: "12 768:18 1200:30 1536:30",
776
778
  yGap: 16,
777
779
  xGap: 12,
778
780
  ...I,
779
- collapsed: k.value
781
+ collapsed: D.value
780
782
  } }, L, {
781
783
  showFeedback: !1,
782
- showAction: j,
783
- onSubmit: E,
784
- onReset: D
785
- }), { action: ({ cols: e, spans: E }) => (j.suffix = e < E + j.span, createVNode(NFlex, {
786
- justify: j.suffix ? "end" : "start",
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",
787
789
  align: "center"
788
790
  }, { default: () => [
789
- F && j.suffix ? createVNode(NButton, {
791
+ F && A.suffix ? createVNode(NButton, {
790
792
  class: "collapsedBtn",
791
793
  text: !0,
792
794
  type: "primary",
793
795
  iconPlacement: "right",
794
- renderIcon: k.value ? IDown : IUp,
795
- onClick: () => A(!k.value)
796
- }, { default: () => [k.value ? T("common.page.filter.expand") : T("common.page.filter.collapse")] }) : void 0,
797
- j.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
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")]),
798
800
  createVNode(NButton, {
799
801
  class: "submitWrap",
800
802
  attrType: "submit",
801
803
  type: "primary",
802
804
  disabled: b.disabled,
803
805
  loading: b.loading
804
- }, { default: () => [x || T("common.page.filter.submitText")] }),
806
+ }, { default: () => [x || w("common.page.filter.submitText")] }),
805
807
  createVNode(NButton, {
806
808
  attrType: "reset",
807
809
  disabled: b.disabled || b.loading
808
- }, { default: () => [C || T("common.page.form.resetText")] }),
810
+ }, { default: () => [j || w("common.page.form.resetText")] }),
809
811
  N ? createVNode(DataCustom, {
810
812
  isFilter: !0,
811
813
  keyField: "name",
812
814
  showFixed: !1,
813
815
  data: L.items,
814
- onSave: w,
816
+ onSave: C,
815
817
  onCustom: (e) => S("custom", e),
816
818
  size: 16,
817
819
  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-BMteXZVn.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";
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-BMteXZVn.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";
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.25",
3
+ "version": "2.0.27",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "otwb UI",