@otwb/ui 2.0.15 → 2.0.17
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 +1 -1
- package/auto-imports.d.ts +15 -15
- package/auto-imports.js +34 -34
- package/dist/{components-Da6YLAnC.js → components-M__4fWLn.js} +41 -25
- package/dist/components.css +1 -0
- package/dist/components.js +1 -1
- package/dist/page.js +1 -1
- package/esm/components.d.ts +448 -448
- package/esm/components.js +1 -1
- package/esm/design.d.ts +243 -243
- package/esm/directives.d.ts +42 -42
- package/esm/directives.js +1 -1
- package/esm/index.d.ts +19 -19
- package/esm/index.js +1 -1
- package/esm/page.d.ts +170 -170
- package/esm/page.js +1 -1
- package/esm/use-style.d.ts +10 -10
- package/esm/use-style.js +1 -1
- package/locale.d.ts +78 -78
- package/package.json +8 -7
- package/unocss-preset.d.ts +5 -5
- package/unocss-preset.js +105 -94
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)]),
|
|
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
|
-
},
|
|
118
|
-
|
|
119
|
-
|
|
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, {
|
|
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: "
|
|
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, {
|
|
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
|
-
})
|
|
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: "
|
|
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
|
|
746
|
-
yGap:
|
|
747
|
-
xGap:
|
|
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:
|
|
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}
|
package/dist/components.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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";
|