@otwb/ui 2.0.15 → 2.0.16

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/README.md CHANGED
@@ -1 +1 @@
1
- # @otwb/ui
1
+ # @otwb/ui
package/auto-imports.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- export declare const UIDirectives: {
2
- type: 'directive'
3
- resolve: (name: string) => string | undefined
4
- }[]
5
-
6
- export declare const UIComponents: {
7
- type: 'component'
8
- resolve: (name: string) => string | undefined
9
- }[]
10
-
11
- export declare const UI: {
12
- from: string
13
- imports: (string | { name: string, type: boolean })[]
14
- }[]
15
- export default UI
1
+ export declare const UIDirectives: {
2
+ type: 'directive'
3
+ resolve: (name: string) => string | undefined
4
+ }[]
5
+
6
+ export declare const UIComponents: {
7
+ type: 'component'
8
+ resolve: (name: string) => string | undefined
9
+ }[]
10
+
11
+ export declare const UI: {
12
+ from: string
13
+ imports: (string | { name: string, type: boolean })[]
14
+ }[]
15
+ export default UI
package/auto-imports.js CHANGED
@@ -1,34 +1,34 @@
1
- export const UIDirectives = [
2
- {
3
- type: 'directive',
4
- resolve(name) {
5
- return ['Spin', 'Tooltip'].includes(name)
6
- ? { name: `v${name}`, from: '@otwb/ui/directives' }
7
- : undefined
8
- },
9
- },
10
- ]
11
-
12
- export const UIComponents = [
13
- {
14
- type: 'component',
15
- resolve(name) {
16
- return ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'].includes(name)
17
- ? { name, from: '@otwb/ui/components' }
18
- : undefined
19
- },
20
- },
21
- ]
22
-
23
- export const UI = [
24
- {
25
- from: '@otwb/ui/directives',
26
- imports: ['vSpin', 'vTooltip'],
27
- },
28
- {
29
- from: '@otwb/ui/components',
30
- imports: ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'],
31
- },
32
- ]
33
-
34
- export default UI
1
+ export const UIDirectives = [
2
+ {
3
+ type: 'directive',
4
+ resolve(name) {
5
+ return ['Spin', 'Tooltip'].includes(name)
6
+ ? { name: `v${name}`, from: '@otwb/ui/directives' }
7
+ : undefined
8
+ },
9
+ },
10
+ ]
11
+
12
+ export const UIComponents = [
13
+ {
14
+ type: 'component',
15
+ resolve(name) {
16
+ return ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'].includes(name)
17
+ ? { name, from: '@otwb/ui/components' }
18
+ : undefined
19
+ },
20
+ },
21
+ ]
22
+
23
+ export const UI = [
24
+ {
25
+ from: '@otwb/ui/directives',
26
+ imports: ['vSpin', 'vTooltip'],
27
+ },
28
+ {
29
+ from: '@otwb/ui/components',
30
+ imports: ['DataTable', 'DataForm', 'DataCustom', 'DataFilter', 'DataSelection', 'DataPagination'],
31
+ },
32
+ ]
33
+
34
+ export default UI
@@ -107,16 +107,13 @@ const NCheckboxes = /* @__PURE__ */ defineComponent({
107
107
  }, e), [createVNode("path", {
108
108
  fill: "currentColor",
109
109
  d: "M11 18h2v-2h-2v2m1-16A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8s8 3.59 8 8s-3.59 8-8 8m0-14a4 4 0 0 0-4 4h2a2 2 0 0 1 2-2a2 2 0 0 1 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4Z"
110
- }, null)]), ICustom = (e) => createVNode("svg", mergeProps({
110
+ }, null)]), IFilterCustom = (e) => createVNode("svg", {
111
111
  xmlns: "http://www.w3.org/2000/svg",
112
112
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
113
- role: "img",
114
- width: "1em",
115
- height: "1em",
116
113
  viewBox: "0 0 1024 1024"
117
- }, e), [createVNode("path", {
118
- fill: "currentColor",
119
- d: "m924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 0 0 9.3-35.2l-.9-2.6a443.74 443.74 0 0 0-79.7-137.9l-1.8-2.1a32.12 32.12 0 0 0-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 0 0-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 0 0-25.8 25.7l-15.8 85.4a351.86 351.86 0 0 0-99 57.4l-81.9-29.1a32 32 0 0 0-35.1 9.5l-1.8 2.1a446.02 446.02 0 0 0-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1c0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 0 0-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0 0 35.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0 0 25.8 25.7l2.7.5a449.4 449.4 0 0 0 159 0l2.7-.5a32.05 32.05 0 0 0 25.8-25.7l15.7-85a350 350 0 0 0 99.7-57.6l81.3 28.9a32 32 0 0 0 35.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1l74.7 63.9a370.03 370.03 0 0 1-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3l-17.9 97a377.5 377.5 0 0 1-85 0l-17.9-97.2l-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9l-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5l-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5c0-15.3 1.2-30.6 3.7-45.5l6.5-40l-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2l31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3l17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97l38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8l92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176s176-78.8 176-176s-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 0 1 512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 0 1 400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 0 1 624 502c0 29.9-11.7 58-32.8 79.2z"
114
+ }, [createVNode("path", {
115
+ d: "M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z",
116
+ fill: "currentColor"
120
117
  }, null)]), IDrag = (e) => createVNode("svg", mergeProps({
121
118
  xmlns: "http://www.w3.org/2000/svg",
122
119
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
@@ -433,7 +430,10 @@ const DataCustom = /* @__PURE__ */ defineComponent({
433
430
  trigger: () => withDirectives(createVNode(NButton, {
434
431
  text: !0,
435
432
  type: x.type
436
- }, { default: () => [createVNode(NIcon, { size: x.size }, { default: () => [createVNode(ICustom, null, null)] })] }), [[vTooltip, x.tooltip ?? C("common.page.custom.tooltip")]]),
433
+ }, { default: () => [createVNode(NIcon, {
434
+ size: x.size,
435
+ color: "#000"
436
+ }, { default: () => [createVNode(IFilterCustom, null, null)] })] }), [[vTooltip, x.tooltip ?? C("common.page.custom.tooltip")]]),
437
437
  default: () => {
438
438
  let e, b;
439
439
  return createVNode(NFlex, { vertical: !0 }, { default: () => [createVNode(NFlex, { justify: "space-between" }, { default: () => [createVNode("div", { style: "font-weight: bold" }, [x.tooltip ?? C("common.page.custom.tooltip")]), createVNode(NButton, {
@@ -457,6 +457,10 @@ const DataCustom = /* @__PURE__ */ defineComponent({
457
457
  });
458
458
  }
459
459
  });
460
+ var DataForm_module_default = {
461
+ nformWrap: "_nformWrap_b73uh_1",
462
+ ngridWrap: "_ngridWrap_b73uh_17"
463
+ };
460
464
  function _isSlot$5(e) {
461
465
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !isVNode(e);
462
466
  }
@@ -550,7 +554,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
550
554
  },
551
555
  labelPlacement: {
552
556
  type: String,
553
- default: "left"
557
+ default: "top"
554
558
  }
555
559
  },
556
560
  emits: [
@@ -576,6 +580,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
576
580
  }), () => {
577
581
  let { items: e, loading: x, validation: j, showColon: N, showAction: P, actionAlign: F, submitText: I, submitDisabled: L, resetText: R, tooltipPlacement: B, showFeedback: V, labelWidth: H = "7.2em", labelAlign: U = b.labelPlacement === "top" ? "left" : "right", grid: W, succeeded: G, successText: K = I,...q } = b, J = !b.readonly && V !== !1;
578
582
  return createVNode(NForm, mergeProps({
583
+ class: DataForm_module_default.nformWrap,
579
584
  labelWidth: H,
580
585
  labelAlign: U,
581
586
  onReset: T,
@@ -584,7 +589,10 @@ const DataForm = /* @__PURE__ */ defineComponent({
584
589
  }, q), { default: () => [createVNode(NGrid, mergeProps({
585
590
  ref: k,
586
591
  itemResponsive: !0
587
- }, W, { yGap: J ? 0 : W?.yGap ?? 24 }), { default: () => {
592
+ }, W, {
593
+ class: DataForm_module_default.ngridWrap,
594
+ yGap: J ? 0 : W?.yGap ?? 24
595
+ }), { default: () => {
588
596
  let w = 0;
589
597
  return createVNode(Fragment, null, [e.map(({ hidden: e, name: x, render: S, label: C, showColon: T, span: E = 6, rowSpan: D, offset: k = 0, tooltip: A, tooltipPlacement: N = b.tooltipPlacement, validationStatus: P = j[x]?.errors?.some((e) => e !== void 0) ? "error" : j[x]?.warnings?.some((e) => e !== void 0) ? "warnings" : j[x] ? "success" : void 0, readonly: F = b.readonly, showRequireMark: I = !F, showTooltipWhenReadonly: L = !1,...R }) => {
590
598
  if (e) return;
@@ -666,7 +674,12 @@ const DataForm = /* @__PURE__ */ defineComponent({
666
674
  } })] });
667
675
  };
668
676
  }
669
- }), DataFilter = /* @__PURE__ */ defineComponent({
677
+ });
678
+ var DataFilter_module_default = {
679
+ submitWrap: "_submitWrap_kqtax_1",
680
+ collapsedBtn: "_collapsedBtn_kqtax_5"
681
+ };
682
+ const DataFilter = /* @__PURE__ */ defineComponent({
670
683
  name: "DataFilter",
671
684
  props: {
672
685
  grid: {
@@ -680,7 +693,7 @@ const DataForm = /* @__PURE__ */ defineComponent({
680
693
  },
681
694
  labelPlacement: {
682
695
  type: String,
683
- default: "left"
696
+ default: "top"
684
697
  },
685
698
  items: {
686
699
  type: Array,
@@ -742,9 +755,9 @@ const DataForm = /* @__PURE__ */ defineComponent({
742
755
  return () => {
743
756
  let { filterOnReset: e, filterText: x, resetText: A, customizable: j, defaultCollapsed: N, collapsible: P, grid: F,...I } = b;
744
757
  return createVNode(DataForm, mergeProps({ grid: {
745
- cols: "12 768:18 1280:24 1536:30",
746
- yGap: 20,
747
- xGap: 8,
758
+ cols: "12 768:18 1200:30 1536:30",
759
+ yGap: 16,
760
+ xGap: 12,
748
761
  ...F,
749
762
  collapsed: E.value
750
763
  } }, I, {
@@ -756,8 +769,17 @@ const DataForm = /* @__PURE__ */ defineComponent({
756
769
  justify: k.suffix ? "end" : "start",
757
770
  align: "center"
758
771
  }, { default: () => [
772
+ P && k.suffix ? createVNode(NButton, {
773
+ class: DataFilter_module_default.collapsedBtn,
774
+ text: !0,
775
+ type: "primary",
776
+ iconPlacement: "right",
777
+ renderIcon: E.value ? IDown : IUp,
778
+ onClick: () => D(!E.value)
779
+ }, { default: () => [E.value ? C("common.page.filter.expand") : C("common.page.filter.collapse")] }) : void 0,
759
780
  k.suffix ? void 0 : createVNode("span", null, [createTextVNode("\xA0\xA0\xA0\xA0")]),
760
781
  createVNode(NButton, {
782
+ class: DataFilter_module_default.submitWrap,
761
783
  attrType: "submit",
762
784
  type: "primary",
763
785
  disabled: b.disabled,
@@ -772,16 +794,9 @@ const DataForm = /* @__PURE__ */ defineComponent({
772
794
  showFixed: !1,
773
795
  data: I.items,
774
796
  onCustom: (e) => S("custom", e),
775
- size: 18,
797
+ size: 16,
776
798
  type: "primary"
777
- }, null) : void 0,
778
- P && k.suffix ? createVNode(NButton, {
779
- text: !0,
780
- type: "primary",
781
- iconPlacement: "right",
782
- renderIcon: E.value ? IDown : IUp,
783
- onClick: () => D(!E.value)
784
- }, { default: () => [E.value ? C("common.page.filter.expand") : C("common.page.filter.collapse")] }) : void 0
799
+ }, null) : void 0
785
800
  ] })) });
786
801
  };
787
802
  }
@@ -1368,6 +1383,7 @@ const DtUserDept = /* @__PURE__ */ defineComponent({
1368
1383
  checkable: b.multiple,
1369
1384
  selectable: !b.multiple,
1370
1385
  multiple: !1,
1386
+ clearable: !0,
1371
1387
  blockLine: !0,
1372
1388
  checkOnClick: !0,
1373
1389
  pattern: S,
@@ -1530,8 +1546,8 @@ const DtUserDept = /* @__PURE__ */ defineComponent({
1530
1546
  options: e,
1531
1547
  multiple: b.multiple,
1532
1548
  size: b.size,
1533
- clearable: !0,
1534
1549
  placeholder: b.placeholder,
1550
+ clearable: !0,
1535
1551
  disabled: b.disabled || void 0,
1536
1552
  value: b.modelValue,
1537
1553
  renderTag: b.multiple ? q : void 0,
@@ -0,0 +1 @@
1
+ ._nformWrap_b73uh_1 .n-form-item{display:block!important}._nformWrap_b73uh_1 .n-form-item .n-input,._nformWrap_b73uh_1 .n-form-item .n-base-selection__border,._nformWrap_b73uh_1 .n-form-item .n-base-selection__state-border{border-radius:2px!important}._nformWrap_b73uh_1 .n-form-item .n-text{color:#000!important}._ngridWrap_b73uh_17>div:last-child{align-items:end;display:flex}._submitWrap_kqtax_1{background-color:#176bf8!important}._collapsedBtn_kqtax_5 .n-button__content{color:#000!important}._collapsedBtn_kqtax_5 .n-button__icon{color:#d9d9d9!important}
@@ -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-Da6YLAnC.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-M__4fWLn.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-Da6YLAnC.js";
4
+ import { a as NRadios, g as NCheckboxes, n as DtUserDept, p as DataForm, r as DtUserRender, t as DtDeptRender } from "./components-M__4fWLn.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";