zartui 3.1.18 → 3.1.19
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 +23 -23
- package/es/calendar/Calendar.mjs +1 -2
- package/es/date-time-picker/DateTimePicker.mjs +15 -0
- package/es/dialog/index.css +1 -1
- package/es/drawer-select/DrawerSelect.d.ts +17 -1
- package/es/drawer-select/DrawerSelect.mjs +9 -4
- package/es/drawer-select/index.d.ts +11 -0
- package/es/dropdown-item/DropdownItem.d.ts +26 -0
- package/es/dropdown-item/DropdownItem.mjs +11 -9
- package/es/dropdown-item/index.d.ts +18 -0
- package/es/dropdown-menu/DropdownMenu.mjs +4 -1
- package/es/dropdown-menu/index.css +1 -1
- package/es/empty/Empty.mjs +5 -1
- package/es/empty/Images.d.ts +14 -11
- package/es/empty/Images.mjs +89 -89
- package/es/empty/types.d.ts +1 -0
- package/es/hierarchy-select/index.css +1 -1
- package/es/lazyload/vue-lazyload/index.d.ts +55 -55
- package/es/media-picker/MediaPicker.d.ts +4 -0
- package/es/media-picker/MediaPicker.mjs +28 -14
- package/es/media-picker/index.d.ts +3 -0
- package/es/media-picker/type.d.ts +2 -0
- package/es/media-picker/util/wx-util.d.ts +4 -0
- package/es/media-picker/util/wx-util.mjs +67 -0
- package/es/popup/index.css +1 -1
- package/es/slider/Slider.mjs +15 -16
- package/es/slider/index.css +1 -1
- package/es/table/Table.d.ts +13 -0
- package/es/table/Table.mjs +28 -7
- package/es/table/index.css +1 -1
- package/es/table/index.d.ts +9 -0
- package/es/table/style/index.mjs +6 -0
- package/es/tabs/TabsTitle.mjs +1 -0
- package/es/tabs/index.css +1 -1
- package/es/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/es/text-ellipsis/TextEllipsis.mjs +15 -4
- package/es/text-ellipsis/index.d.ts +9 -0
- package/es/text-ellipsis/style/index.mjs +7 -0
- package/es/toast/index.css +1 -1
- package/es/vue-sfc-shim.d.ts +6 -6
- package/es/vue-tsx-shim.d.ts +23 -23
- package/lib/calendar/Calendar.js +1 -2
- package/lib/date-time-picker/DateTimePicker.js +15 -0
- package/lib/dialog/index.css +1 -1
- package/lib/drawer-select/DrawerSelect.d.ts +17 -1
- package/lib/drawer-select/DrawerSelect.js +9 -4
- package/lib/drawer-select/index.d.ts +11 -0
- package/lib/dropdown-item/DropdownItem.d.ts +26 -0
- package/lib/dropdown-item/DropdownItem.js +10 -8
- package/lib/dropdown-item/index.d.ts +18 -0
- package/lib/dropdown-menu/DropdownMenu.js +4 -1
- package/lib/dropdown-menu/index.css +1 -1
- package/lib/empty/Empty.js +5 -1
- package/lib/empty/Images.d.ts +14 -11
- package/lib/empty/Images.js +89 -89
- package/lib/empty/types.d.ts +1 -0
- package/lib/hierarchy-select/index.css +1 -1
- package/lib/index.css +1 -1
- package/lib/lazyload/vue-lazyload/index.d.ts +55 -55
- package/lib/media-picker/MediaPicker.d.ts +4 -0
- package/lib/media-picker/MediaPicker.js +27 -13
- package/lib/media-picker/index.d.ts +3 -0
- package/lib/media-picker/type.d.ts +2 -0
- package/lib/media-picker/util/wx-util.d.ts +4 -0
- package/lib/media-picker/util/wx-util.js +86 -0
- package/lib/popup/index.css +1 -1
- package/lib/slider/Slider.js +15 -16
- package/lib/slider/index.css +1 -1
- package/lib/table/Table.d.ts +13 -0
- package/lib/table/Table.js +37 -6
- package/lib/table/index.css +1 -1
- package/lib/table/index.d.ts +9 -0
- package/lib/table/style/index.js +6 -0
- package/lib/tabs/TabsTitle.js +1 -0
- package/lib/tabs/index.css +1 -1
- package/lib/text-ellipsis/TextEllipsis.d.ts +13 -0
- package/lib/text-ellipsis/TextEllipsis.js +13 -2
- package/lib/text-ellipsis/index.d.ts +9 -0
- package/lib/text-ellipsis/style/index.js +7 -0
- package/lib/toast/index.css +1 -1
- package/lib/vue-sfc-shim.d.ts +6 -6
- package/lib/vue-tsx-shim.d.ts +23 -23
- package/lib/web-types.json +1 -1
- package/lib/zartui.cjs.js +710 -577
- package/lib/zartui.es.js +710 -577
- package/lib/zartui.js +710 -577
- package/lib/zartui.min.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# ZartUI
|
|
2
|
-
|
|
3
|
-
[ZartUI](https://zartui.egova.com.cn) 是数字政通基于 Vue 研发的一款面向政务场景的移动端组件库。
|
|
4
|
-
|
|
5
|
-
Zart(读音 /zɑːt/)的命名,灵感源自数字政通秉承的理念:让城市治理变得更智慧。Zart = zt + smart, zt是政通的首字母缩写,smart代表公司理念中的“智慧”,将smart中间的“ar”字母包裹于zt之间,体现了ZartUI的核心目标:追求极致的用户体验,致力于做灵活智能的组件库。
|
|
6
|
-
|
|
7
|
-
## 特性
|
|
8
|
-
|
|
9
|
-
1)【组件重构】【组件审核】提供50多个高质量组件,覆盖移动端各类场景;
|
|
10
|
-
|
|
11
|
-
2)【UI重构】基于全新的视觉规范;
|
|
12
|
-
|
|
13
|
-
3)【在线网站】完善的文档、示例、演示效果;
|
|
14
|
-
|
|
15
|
-
4)支持主题定制、按需引入;
|
|
16
|
-
|
|
17
|
-
5)支持Vue3.0、TypeScript;
|
|
18
|
-
|
|
19
|
-
6)性能佳,组件平均体积小(min+gzip);
|
|
20
|
-
|
|
21
|
-
## 浏览器支持
|
|
22
|
-
|
|
23
|
-
ZartUI 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致)。
|
|
1
|
+
# ZartUI
|
|
2
|
+
|
|
3
|
+
[ZartUI](https://zartui.egova.com.cn) 是数字政通基于 Vue 研发的一款面向政务场景的移动端组件库。
|
|
4
|
+
|
|
5
|
+
Zart(读音 /zɑːt/)的命名,灵感源自数字政通秉承的理念:让城市治理变得更智慧。Zart = zt + smart, zt是政通的首字母缩写,smart代表公司理念中的“智慧”,将smart中间的“ar”字母包裹于zt之间,体现了ZartUI的核心目标:追求极致的用户体验,致力于做灵活智能的组件库。
|
|
6
|
+
|
|
7
|
+
## 特性
|
|
8
|
+
|
|
9
|
+
1)【组件重构】【组件审核】提供50多个高质量组件,覆盖移动端各类场景;
|
|
10
|
+
|
|
11
|
+
2)【UI重构】基于全新的视觉规范;
|
|
12
|
+
|
|
13
|
+
3)【在线网站】完善的文档、示例、演示效果;
|
|
14
|
+
|
|
15
|
+
4)支持主题定制、按需引入;
|
|
16
|
+
|
|
17
|
+
5)支持Vue3.0、TypeScript;
|
|
18
|
+
|
|
19
|
+
6)性能佳,组件平均体积小(min+gzip);
|
|
20
|
+
|
|
21
|
+
## 浏览器支持
|
|
22
|
+
|
|
23
|
+
ZartUI 3 支持现代浏览器以及 Chrome >= 51、iOS >= 10.0(与 Vue 3 一致)。
|
package/es/calendar/Calendar.mjs
CHANGED
|
@@ -474,8 +474,7 @@ var stdin_default = defineComponent({
|
|
|
474
474
|
watch(() => props.show, init);
|
|
475
475
|
watch(() => [props.type, props.minDate, props.maxDate], () => reset(getInitialDate(currentDate.value)));
|
|
476
476
|
watch(() => props.defaultDate, (value = null) => {
|
|
477
|
-
|
|
478
|
-
scrollToCurrentDate();
|
|
477
|
+
reset(value);
|
|
479
478
|
});
|
|
480
479
|
watch(titleDate, (newValue) => {
|
|
481
480
|
if (props.showType === "inline" && newValue) {
|
|
@@ -146,6 +146,21 @@ var stdin_default = defineComponent({
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
+
watch(() => props.modelValue, onOpen, {
|
|
150
|
+
deep: true
|
|
151
|
+
});
|
|
152
|
+
watch(() => props.startValue, () => {
|
|
153
|
+
currentStartValue.value = props.startValue;
|
|
154
|
+
currentStartText.value = genOriginValueText(props.startValue);
|
|
155
|
+
}, {
|
|
156
|
+
deep: true
|
|
157
|
+
});
|
|
158
|
+
watch(() => props.endValue, () => {
|
|
159
|
+
currentEndValue.value = props.endValue;
|
|
160
|
+
currentEndText.value = genOriginValueText(props.endValue);
|
|
161
|
+
}, {
|
|
162
|
+
deep: true
|
|
163
|
+
});
|
|
149
164
|
const renderTitle = () => {
|
|
150
165
|
if (!props.range) {
|
|
151
166
|
return _createVNode("div", {
|
package/es/dialog/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-dialog-width: 350px;--zt-dialog-max-width: 90%;--zt-dialog-transition: var(--zt-duration-base);--zt-dialog-radius: 12px;--zt-dialog-background: var(--zt-background-popup);--zt-dialog-header-font-weight: var(--zt-font-bold);--zt-dialog-header-padding-top: 24px;--zt-dialog-header-isolated-padding: var(--zt-padding-lg) 0;--zt-dialog-header-primary-padding: 10px;--zt-dialog-message-padding: var(--zt-padding-lg) var(--zt-padding-md);--zt-dialog-message-max-height: 60vh;--zt-dialog-has-title-message-text-color: var(--zt-gray-a6);--zt-dialog-has-title-message-padding-top: var(--zt-padding-xs);--zt-dialog-has-title-message-primary-header: var(--zt-padding-lg);--zt-dialog-confirm-button-text-color: var(--zt-white);--zt-dialog-cancel-button-background-color: var(--zt-white)}.zt-dialog{top:45%;width:var(--zt-dialog-width);max-width:var(--zt-dialog-max-width);overflow:hidden;font-size:var(--zt-font-size-lg);background:var(--zt-dialog-background);border-radius:var(--zt-dialog-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--zt-dialog-transition);transition-property:transform,opacity}.zt-dialog__header{color:var(--zt-text-color);padding-top:var(--zt-dialog-header-padding-top);font-weight:var(--zt-dialog-header-font-weight);line-height:var(--zt-line-height-lg);text-align:center}.zt-dialog__header--isolated{padding:var(--zt-dialog-header-isolated-padding)}.zt-dialog__header--custom-title{padding-left:0;padding-right:0;padding-top:0}.zt-dialog__header--primary{padding:var(--zt-dialog-header-primary-padding);background:var(--zt-primary-color);color:var(--zt-white)}.zt-dialog__content{text-align:center;font-size:0}.zt-dialog__message{display:inline-block;color:var(--zt-gray-a8);max-height:var(--zt-dialog-message-max-height);padding:var(--zt-dialog-message-padding);overflow-y:auto;font-size:var(--zt-font-size-lg);line-height:var(--zt-line-height-md);white-space:pre-wrap;text-align:left;word-wrap:break-word;-webkit-overflow-scrolling:touch}.zt-dialog__message--has-title{padding-top:var(--zt-dialog-has-title-message-padding-top);color:var(--zt-dialog-has-title-message-text-color);font-size:var(--zt-font-size-md)}.zt-dialog__message--primary-header{padding-top:var(--zt-dialog-has-title-message-primary-header)}.zt-dialog__message--left{text-align:left}.zt-dialog__message--right{text-align:right}.zt-dialog__message--justify{text-align:justify}.zt-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none;margin:0 var(--zt-padding-xl) var(--zt-padding-lg)}.zt-dialog__confirm,.zt-dialog__cancel{flex:1;margin:0;background-color:var(--zt-dialog-cancel-button-background-color)}.zt-dialog__confirm,.zt-dialog__confirm:active{color:var(--zt-dialog-confirm-button-text-color)}.zt-dialog__confirm--with-cancel{margin-left:8px}.zt-dialog--round-button .zt-dialog__footer{position:relative;height:auto;padding:var(--zt-padding-xs) var(--zt-padding-lg) var(--zt-padding-md)}.zt-dialog--round-button .zt-dialog__message{padding-bottom:var(--zt-padding-md);color:var(--zt-text-color)}.zt-dialog--round-button .zt-dialog__confirm,.zt-dialog--round-button .zt-dialog__cancel{height:var(--zt-dialog-round-button-height)}.zt-dialog--round-button .zt-dialog__confirm{color:var(--zt-white)}.zt-dialog-bounce-enter-from{transform:translate3d(
|
|
1
|
+
:root{--zt-dialog-width: 350px;--zt-dialog-max-width: 90%;--zt-dialog-transition: var(--zt-duration-base);--zt-dialog-radius: 12px;--zt-dialog-background: var(--zt-background-popup);--zt-dialog-header-font-weight: var(--zt-font-bold);--zt-dialog-header-padding-top: 24px;--zt-dialog-header-isolated-padding: var(--zt-padding-lg) 0;--zt-dialog-header-primary-padding: 10px;--zt-dialog-message-padding: var(--zt-padding-lg) var(--zt-padding-md);--zt-dialog-message-max-height: 60vh;--zt-dialog-has-title-message-text-color: var(--zt-gray-a6);--zt-dialog-has-title-message-padding-top: var(--zt-padding-xs);--zt-dialog-has-title-message-primary-header: var(--zt-padding-lg);--zt-dialog-confirm-button-text-color: var(--zt-white);--zt-dialog-cancel-button-background-color: var(--zt-white)}.zt-dialog{top:45%;width:var(--zt-dialog-width);max-width:var(--zt-dialog-max-width);overflow:hidden;font-size:var(--zt-font-size-lg);background:var(--zt-dialog-background);border-radius:var(--zt-dialog-radius);-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:var(--zt-dialog-transition);transition-property:transform,opacity}.zt-dialog__header{color:var(--zt-text-color);padding-top:var(--zt-dialog-header-padding-top);font-weight:var(--zt-dialog-header-font-weight);line-height:var(--zt-line-height-lg);text-align:center}.zt-dialog__header--isolated{padding:var(--zt-dialog-header-isolated-padding)}.zt-dialog__header--custom-title{padding-left:0;padding-right:0;padding-top:0}.zt-dialog__header--primary{padding:var(--zt-dialog-header-primary-padding);background:var(--zt-primary-color);color:var(--zt-white)}.zt-dialog__content{text-align:center;font-size:0}.zt-dialog__message{display:inline-block;color:var(--zt-gray-a8);max-height:var(--zt-dialog-message-max-height);padding:var(--zt-dialog-message-padding);overflow-y:auto;font-size:var(--zt-font-size-lg);line-height:var(--zt-line-height-md);white-space:pre-wrap;text-align:left;word-wrap:break-word;-webkit-overflow-scrolling:touch}.zt-dialog__message--has-title{padding-top:var(--zt-dialog-has-title-message-padding-top);color:var(--zt-dialog-has-title-message-text-color);font-size:var(--zt-font-size-md)}.zt-dialog__message--primary-header{padding-top:var(--zt-dialog-has-title-message-primary-header)}.zt-dialog__message--left{text-align:left}.zt-dialog__message--right{text-align:right}.zt-dialog__message--justify{text-align:justify}.zt-dialog__footer{display:flex;overflow:hidden;-webkit-user-select:none;user-select:none;margin:0 var(--zt-padding-xl) var(--zt-padding-lg)}.zt-dialog__confirm,.zt-dialog__cancel{flex:1;margin:0;background-color:var(--zt-dialog-cancel-button-background-color)}.zt-dialog__confirm,.zt-dialog__confirm:active{color:var(--zt-dialog-confirm-button-text-color)}.zt-dialog__confirm--with-cancel{margin-left:8px}.zt-dialog--round-button .zt-dialog__footer{position:relative;height:auto;padding:var(--zt-padding-xs) var(--zt-padding-lg) var(--zt-padding-md)}.zt-dialog--round-button .zt-dialog__message{padding-bottom:var(--zt-padding-md);color:var(--zt-text-color)}.zt-dialog--round-button .zt-dialog__confirm,.zt-dialog--round-button .zt-dialog__cancel{height:var(--zt-dialog-round-button-height)}.zt-dialog--round-button .zt-dialog__confirm{color:var(--zt-white)}.zt-dialog-bounce-enter-from{transform:translate3d(0,-50%,0) scale(.7);opacity:0}.zt-dialog-bounce-leave-active{transform:translate3d(0,-50%,0) scale(.9);opacity:0}.zt-theme-dark{--zt-dialog-cancel-button-background-color: rbga(255, 255, 255, .2)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
-
import { DrawerSelectFieldNames, DrawerSelectTreeNode } from './types';
|
|
2
|
+
import { DrawerSelectFieldNames, DrawerSelectTreeNode, FlatTreeNode } from './types';
|
|
3
3
|
declare const drawerSelectProps: {
|
|
4
4
|
treeData: {
|
|
5
5
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
@@ -18,6 +18,11 @@ declare const drawerSelectProps: {
|
|
|
18
18
|
type: BooleanConstructor;
|
|
19
19
|
default: boolean;
|
|
20
20
|
};
|
|
21
|
+
defaultSelectNode: PropType<FlatTreeNode>;
|
|
22
|
+
activeClassName: {
|
|
23
|
+
type: PropType<string>;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
21
26
|
};
|
|
22
27
|
export type DrawerSelectProps = ExtractPropTypes<typeof drawerSelectProps>;
|
|
23
28
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -38,6 +43,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
38
43
|
type: BooleanConstructor;
|
|
39
44
|
default: boolean;
|
|
40
45
|
};
|
|
46
|
+
defaultSelectNode: PropType<FlatTreeNode>;
|
|
47
|
+
activeClassName: {
|
|
48
|
+
type: PropType<string>;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
41
51
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
42
52
|
treeData: {
|
|
43
53
|
type: PropType<DrawerSelectTreeNode[]>;
|
|
@@ -56,6 +66,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
66
|
type: BooleanConstructor;
|
|
57
67
|
default: boolean;
|
|
58
68
|
};
|
|
69
|
+
defaultSelectNode: PropType<FlatTreeNode>;
|
|
70
|
+
activeClassName: {
|
|
71
|
+
type: PropType<string>;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
59
74
|
}>> & {
|
|
60
75
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
61
76
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
@@ -64,5 +79,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
79
|
placeholder: string;
|
|
65
80
|
treeData: DrawerSelectTreeNode[];
|
|
66
81
|
expandAll: boolean;
|
|
82
|
+
activeClassName: string;
|
|
67
83
|
}, {}>;
|
|
68
84
|
export default _default;
|
|
@@ -18,7 +18,9 @@ const drawerSelectProps = {
|
|
|
18
18
|
expandAll: {
|
|
19
19
|
type: Boolean,
|
|
20
20
|
default: false
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
defaultSelectNode: Object,
|
|
23
|
+
activeClassName: makeStringProp("")
|
|
22
24
|
};
|
|
23
25
|
var stdin_default = defineComponent({
|
|
24
26
|
name,
|
|
@@ -29,7 +31,7 @@ var stdin_default = defineComponent({
|
|
|
29
31
|
}) {
|
|
30
32
|
const keyword = ref("");
|
|
31
33
|
const expandNode = ref();
|
|
32
|
-
const selectNode = ref();
|
|
34
|
+
const selectNode = ref(props.defaultSelectNode);
|
|
33
35
|
const flatArray = ref([]);
|
|
34
36
|
const show = ref(false);
|
|
35
37
|
const searchRef = ref();
|
|
@@ -228,6 +230,7 @@ var stdin_default = defineComponent({
|
|
|
228
230
|
const renderItem = (item) => {
|
|
229
231
|
var _a, _b;
|
|
230
232
|
const empty = isEmpty(item);
|
|
233
|
+
const active = empty && ((_a = selectNode.value) == null ? void 0 : _a.value) == item[fields.value.value];
|
|
231
234
|
return _createVNode("div", {
|
|
232
235
|
"onClick": (e) => {
|
|
233
236
|
e.stopPropagation();
|
|
@@ -246,8 +249,10 @@ var stdin_default = defineComponent({
|
|
|
246
249
|
"size": "20"
|
|
247
250
|
}, null)]), _createVNode("div", {
|
|
248
251
|
"class": [bem("item--label", {
|
|
249
|
-
active
|
|
250
|
-
}), "zt-hairline--top"
|
|
252
|
+
active
|
|
253
|
+
}), "zt-hairline--top", {
|
|
254
|
+
[props.activeClassName]: active
|
|
255
|
+
}]
|
|
251
256
|
}, [item[fields.value.text]])]), _createVNode("div", {
|
|
252
257
|
"class": [bem("item--child")]
|
|
253
258
|
}, [!empty && item.checked && ((_b = item[fields.value.children]) == null ? void 0 : _b.map(renderItem))])]);
|
|
@@ -16,6 +16,11 @@ export declare const DrawerSelect: import("../utils").WithInstall<import("vue").
|
|
|
16
16
|
type: BooleanConstructor;
|
|
17
17
|
default: boolean;
|
|
18
18
|
};
|
|
19
|
+
defaultSelectNode: import("vue").PropType<import("./types").FlatTreeNode>;
|
|
20
|
+
activeClassName: {
|
|
21
|
+
type: import("vue").PropType<string>;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
19
24
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("select" | "change")[], "select" | "change", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
25
|
treeData: {
|
|
21
26
|
type: import("vue").PropType<import("./types").DrawerSelectTreeNode[]>;
|
|
@@ -34,6 +39,11 @@ export declare const DrawerSelect: import("../utils").WithInstall<import("vue").
|
|
|
34
39
|
type: BooleanConstructor;
|
|
35
40
|
default: boolean;
|
|
36
41
|
};
|
|
42
|
+
defaultSelectNode: import("vue").PropType<import("./types").FlatTreeNode>;
|
|
43
|
+
activeClassName: {
|
|
44
|
+
type: import("vue").PropType<string>;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
37
47
|
}>> & {
|
|
38
48
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
39
49
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
@@ -42,6 +52,7 @@ export declare const DrawerSelect: import("../utils").WithInstall<import("vue").
|
|
|
42
52
|
placeholder: string;
|
|
43
53
|
treeData: import("./types").DrawerSelectTreeNode[];
|
|
44
54
|
expandAll: boolean;
|
|
55
|
+
activeClassName: string;
|
|
45
56
|
}, {}>>;
|
|
46
57
|
export default DrawerSelect;
|
|
47
58
|
export type { DrawerSelectProps } from './DrawerSelect';
|
|
@@ -22,6 +22,14 @@ export declare const dropdownItemProps: {
|
|
|
22
22
|
titleClass: PropType<unknown>;
|
|
23
23
|
multiSelect: BooleanConstructor;
|
|
24
24
|
itemLabel: StringConstructor;
|
|
25
|
+
placeholder: {
|
|
26
|
+
type: PropType<string>;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
resetDefaultValue: {
|
|
30
|
+
type: PropType<any[]>;
|
|
31
|
+
default: () => any[];
|
|
32
|
+
};
|
|
25
33
|
};
|
|
26
34
|
export type DropdownItemProps = ExtractPropTypes<typeof dropdownItemProps>;
|
|
27
35
|
declare const _default: import("vue").DefineComponent<{
|
|
@@ -45,6 +53,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
45
53
|
titleClass: PropType<unknown>;
|
|
46
54
|
multiSelect: BooleanConstructor;
|
|
47
55
|
itemLabel: StringConstructor;
|
|
56
|
+
placeholder: {
|
|
57
|
+
type: PropType<string>;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
resetDefaultValue: {
|
|
61
|
+
type: PropType<any[]>;
|
|
62
|
+
default: () => any[];
|
|
63
|
+
};
|
|
48
64
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
49
65
|
title: StringConstructor;
|
|
50
66
|
options: {
|
|
@@ -66,6 +82,14 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
82
|
titleClass: PropType<unknown>;
|
|
67
83
|
multiSelect: BooleanConstructor;
|
|
68
84
|
itemLabel: StringConstructor;
|
|
85
|
+
placeholder: {
|
|
86
|
+
type: PropType<string>;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
resetDefaultValue: {
|
|
90
|
+
type: PropType<any[]>;
|
|
91
|
+
default: () => any[];
|
|
92
|
+
};
|
|
69
93
|
}>> & {
|
|
70
94
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
71
95
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
@@ -77,9 +101,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
77
101
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
78
102
|
}, {
|
|
79
103
|
disabled: boolean;
|
|
104
|
+
placeholder: string;
|
|
80
105
|
lazyRender: boolean;
|
|
81
106
|
options: DropdownItemOption[];
|
|
82
107
|
modelValueArray: any[];
|
|
83
108
|
multiSelect: boolean;
|
|
109
|
+
resetDefaultValue: any[];
|
|
84
110
|
}, {}>;
|
|
85
111
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mergeProps as _mergeProps, createTextVNode as _createTextVNode, withDirectives as _withDirectives, vShow as _vShow, createVNode as _createVNode } from "vue";
|
|
2
2
|
import { reactive, Teleport, defineComponent, computed } from "vue";
|
|
3
|
-
import { truthProp, unknownProp, getZIndexStyle, createNamespace, makeArrayProp, HAPTICS_FEEDBACK, extend } from "../utils/index.mjs";
|
|
3
|
+
import { truthProp, unknownProp, getZIndexStyle, createNamespace, makeArrayProp, HAPTICS_FEEDBACK, extend, makeStringProp } from "../utils/index.mjs";
|
|
4
4
|
import { DROPDOWN_KEY } from "../dropdown-menu/DropdownMenu.mjs";
|
|
5
5
|
import { useParent } from "@zartui/use";
|
|
6
6
|
import { useExpose } from "../composables/use-expose.mjs";
|
|
@@ -21,7 +21,9 @@ const dropdownItemProps = {
|
|
|
21
21
|
modelValueArray: makeArrayProp(),
|
|
22
22
|
titleClass: unknownProp,
|
|
23
23
|
multiSelect: Boolean,
|
|
24
|
-
itemLabel: String
|
|
24
|
+
itemLabel: String,
|
|
25
|
+
placeholder: makeStringProp("\u672A\u9009\u62E9"),
|
|
26
|
+
resetDefaultValue: makeArrayProp()
|
|
25
27
|
};
|
|
26
28
|
var stdin_default = defineComponent({
|
|
27
29
|
name,
|
|
@@ -78,10 +80,9 @@ var stdin_default = defineComponent({
|
|
|
78
80
|
}
|
|
79
81
|
};
|
|
80
82
|
const onClickReset = () => {
|
|
81
|
-
|
|
82
|
-
item.selected = false;
|
|
83
|
-
});
|
|
83
|
+
var _a;
|
|
84
84
|
modelArray.splice(0);
|
|
85
|
+
modelArray.push(...(_a = props.resetDefaultValue) != null ? _a : []);
|
|
85
86
|
state.showPopup = false;
|
|
86
87
|
emit("reset");
|
|
87
88
|
};
|
|
@@ -117,7 +118,7 @@ var stdin_default = defineComponent({
|
|
|
117
118
|
if (title.length > 0) {
|
|
118
119
|
title = title.substring(0, title.length - 1);
|
|
119
120
|
}
|
|
120
|
-
return title
|
|
121
|
+
return title;
|
|
121
122
|
}
|
|
122
123
|
const match = props.options.find((option) => option[fields.value.value] === props.modelValue);
|
|
123
124
|
return match ? match[fields.value.text] : "";
|
|
@@ -130,8 +131,11 @@ var stdin_default = defineComponent({
|
|
|
130
131
|
const text = option[fields.value.text];
|
|
131
132
|
let active = false;
|
|
132
133
|
if (props.multiSelect) {
|
|
133
|
-
if (
|
|
134
|
+
if (modelArray == null ? void 0 : modelArray.includes(value)) {
|
|
134
135
|
active = true;
|
|
136
|
+
option.selected = true;
|
|
137
|
+
} else {
|
|
138
|
+
option.selected = false;
|
|
135
139
|
}
|
|
136
140
|
} else {
|
|
137
141
|
active = value === props.modelValue;
|
|
@@ -139,12 +143,10 @@ var stdin_default = defineComponent({
|
|
|
139
143
|
const onClick = () => {
|
|
140
144
|
if (props.multiSelect) {
|
|
141
145
|
if (option.selected) {
|
|
142
|
-
option.selected = false;
|
|
143
146
|
modelArray.splice(modelArray.indexOf(value), 1);
|
|
144
147
|
emit("update:modelValue", -value);
|
|
145
148
|
emit("change", -value);
|
|
146
149
|
} else {
|
|
147
|
-
option.selected = true;
|
|
148
150
|
modelArray.push(value);
|
|
149
151
|
emit("update:modelValue", value);
|
|
150
152
|
emit("change", value);
|
|
@@ -20,6 +20,14 @@ export declare const DropdownItem: import("../utils").WithInstall<import("vue").
|
|
|
20
20
|
titleClass: import("vue").PropType<unknown>;
|
|
21
21
|
multiSelect: BooleanConstructor;
|
|
22
22
|
itemLabel: StringConstructor;
|
|
23
|
+
placeholder: {
|
|
24
|
+
type: import("vue").PropType<string>;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
resetDefaultValue: {
|
|
28
|
+
type: import("vue").PropType<any[]>;
|
|
29
|
+
default: () => any[];
|
|
30
|
+
};
|
|
23
31
|
}, (() => JSX.Element) | undefined, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm")[], "reset" | "open" | "update:modelValue" | "change" | "close" | "opened" | "closed" | "confirm", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
24
32
|
title: StringConstructor;
|
|
25
33
|
options: {
|
|
@@ -41,6 +49,14 @@ export declare const DropdownItem: import("../utils").WithInstall<import("vue").
|
|
|
41
49
|
titleClass: import("vue").PropType<unknown>;
|
|
42
50
|
multiSelect: BooleanConstructor;
|
|
43
51
|
itemLabel: StringConstructor;
|
|
52
|
+
placeholder: {
|
|
53
|
+
type: import("vue").PropType<string>;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
resetDefaultValue: {
|
|
57
|
+
type: import("vue").PropType<any[]>;
|
|
58
|
+
default: () => any[];
|
|
59
|
+
};
|
|
44
60
|
}>> & {
|
|
45
61
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
46
62
|
onReset?: ((...args: any[]) => any) | undefined;
|
|
@@ -52,10 +68,12 @@ export declare const DropdownItem: import("../utils").WithInstall<import("vue").
|
|
|
52
68
|
onConfirm?: ((...args: any[]) => any) | undefined;
|
|
53
69
|
}, {
|
|
54
70
|
disabled: boolean;
|
|
71
|
+
placeholder: string;
|
|
55
72
|
lazyRender: boolean;
|
|
56
73
|
options: import("./types").DropdownItemOption[];
|
|
57
74
|
modelValueArray: any[];
|
|
58
75
|
multiSelect: boolean;
|
|
76
|
+
resetDefaultValue: any[];
|
|
59
77
|
}, {}>>;
|
|
60
78
|
export default DropdownItem;
|
|
61
79
|
export { dropdownItemProps } from './DropdownItem';
|
|
@@ -82,6 +82,7 @@ var stdin_default = defineComponent({
|
|
|
82
82
|
if (item.$slots.header) {
|
|
83
83
|
return item.$slots.header(item);
|
|
84
84
|
}
|
|
85
|
+
const itemTitle = item.renderTitle();
|
|
85
86
|
return _createVNode("div", {
|
|
86
87
|
"id": `${id}-${index}`,
|
|
87
88
|
"role": "button",
|
|
@@ -107,7 +108,9 @@ var stdin_default = defineComponent({
|
|
|
107
108
|
}, [_createVNode("div", {
|
|
108
109
|
"class": "zt-ellipsis",
|
|
109
110
|
"style": "padding-right: 18px"
|
|
110
|
-
}, [slots.title ||
|
|
111
|
+
}, [slots.title || (itemTitle ? itemTitle : _createVNode("div", {
|
|
112
|
+
"class": [bem("placeholder")]
|
|
113
|
+
}, [item.placeholder])), slots.icon || _createVNode(ZtIcon, {
|
|
111
114
|
"class": bem("icon"),
|
|
112
115
|
"name": "spinner-expand"
|
|
113
116
|
}, null)])])]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--zt-dropdown-menu-background: var(--zt-background-popup);--zt-dropdown-menu-bar-padding: 0 12px;--zt-dropdown-menu-item-margin: 12px 4px;--zt-dropdown-menu-item-height: 36px;--zt-dropdown-menu-item-padding: 0 12px;--zt-dropdown-menu-title-text-color: var(--zt-text-color);--zt-dropdown-menu-title-active-text-color: var(--zt-primary-color);--zt-dropdown-menu-title-disabled-text-color: var(--zt-text-color-2);--zt-dropdown-menu-option-active-color: var(--zt-primary-color);--zt-dropdown-menu-content-max-height: 80%}:root[zt-theme-size=large]{--zt-dropdown-menu-item-height: 48px}.zt-dropdown-menu{-webkit-user-select:none;user-select:none}.zt-dropdown-menu__bar{position:relative;display:flex;padding:var(--zt-dropdown-menu-bar-padding);align-items:center}.zt-dropdown-menu__bar--opened{z-index:calc(var(--zt-dropdown-item-z-index) + 1)}.zt-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;background:var(--zt-dropdown-menu-background);min-width:0;margin:var(--zt-dropdown-menu-item-margin);height:var(--zt-dropdown-menu-item-height);border-radius:calc(var(--zt-dropdown-menu-item-height) / 2);padding:var(--zt-dropdown-menu-item-padding);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);cursor:pointer}.zt-dropdown-menu__item:last-child{margin-right:0}.zt-dropdown-menu__item:active{opacity:.7}.zt-dropdown-menu__item--disabled:active{opacity:1}.zt-dropdown-menu__item--disabled .zt-dropdown-menu__title{color:var(--zt-dropdown-menu-title-disabled-text-color)}.zt-dropdown-menu__title{position:relative;box-sizing:border-box;width:100%;color:var(--zt-dropdown-menu-title-text-color);font-size:var(--zt-font-size-md)}.zt-dropdown-menu__title .zt-icon{position:absolute;right:0;top:3px;color:var(--zt-gray-4)}.zt-dropdown-menu__title--active{color:var(--zt-dropdown-menu-title-active-text-color)}.zt-dropdown-menu__title--active .zt-icon{color:currentColor}.zt-dropdown-menu__title--active .zt-dropdown-menu__icon{transform:rotate(180deg)}.zt-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}
|
|
1
|
+
:root{--zt-dropdown-menu-background: var(--zt-background-popup);--zt-dropdown-menu-bar-padding: 0 12px;--zt-dropdown-menu-item-margin: 12px 4px;--zt-dropdown-menu-item-height: 36px;--zt-dropdown-menu-item-padding: 0 12px;--zt-dropdown-menu-title-text-color: var(--zt-text-color);--zt-dropdown-menu-title-active-text-color: var(--zt-primary-color);--zt-dropdown-menu-title-disabled-text-color: var(--zt-text-color-2);--zt-dropdown-menu-option-active-color: var(--zt-primary-color);--zt-dropdown-menu-content-max-height: 80%}:root[zt-theme-size=large]{--zt-dropdown-menu-item-height: 48px}.zt-dropdown-menu{-webkit-user-select:none;user-select:none}.zt-dropdown-menu__bar{position:relative;display:flex;padding:var(--zt-dropdown-menu-bar-padding);align-items:center}.zt-dropdown-menu__bar--opened{z-index:calc(var(--zt-dropdown-item-z-index) + 1)}.zt-dropdown-menu__item{display:flex;flex:1;align-items:center;justify-content:center;background:var(--zt-dropdown-menu-background);min-width:0;margin:var(--zt-dropdown-menu-item-margin);height:var(--zt-dropdown-menu-item-height);border-radius:calc(var(--zt-dropdown-menu-item-height) / 2);padding:var(--zt-dropdown-menu-item-padding);font-size:var(--zt-font-size-md);line-height:var(--zt-line-height-md);cursor:pointer}.zt-dropdown-menu__item:last-child{margin-right:0}.zt-dropdown-menu__item:active{opacity:.7}.zt-dropdown-menu__item--disabled:active{opacity:1}.zt-dropdown-menu__item--disabled .zt-dropdown-menu__title{color:var(--zt-dropdown-menu-title-disabled-text-color)}.zt-dropdown-menu__title{position:relative;box-sizing:border-box;width:100%;color:var(--zt-dropdown-menu-title-text-color);font-size:var(--zt-font-size-md)}.zt-dropdown-menu__title .zt-icon{position:absolute;right:0;top:3px;color:var(--zt-gray-4)}.zt-dropdown-menu__title--active{color:var(--zt-dropdown-menu-title-active-text-color)}.zt-dropdown-menu__title--active .zt-icon{color:currentColor}.zt-dropdown-menu__title--active .zt-dropdown-menu__icon{transform:rotate(180deg)}.zt-dropdown-menu__title--down:after{margin-top:-1px;transform:rotate(135deg)}.zt-dropdown-menu__placeholder{color:var(--zt-gray-a2)}
|
package/es/empty/Empty.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { createVNode as _createVNode } from "vue";
|
|
|
2
2
|
import { defineComponent } from "vue";
|
|
3
3
|
import { getSizeStyle, makeStringProp, createNamespace } from "../utils/index.mjs";
|
|
4
4
|
import { renderNotFound, renderServerError, renderAccessRestricted, renderDeveloping, renderNetworkError, renderEmptyResult, renderFindNull, renderEmptyInterface, renderReportSuccess, renderReportError, renderNoCollect } from "./Images.mjs";
|
|
5
|
+
import { useId } from "../composables/use-id.mjs";
|
|
5
6
|
const [name, bem] = createNamespace("empty");
|
|
6
7
|
const PRESET_IMAGES = {
|
|
7
8
|
default: renderNotFound,
|
|
@@ -28,12 +29,15 @@ var stdin_default = defineComponent({
|
|
|
28
29
|
setup(props, {
|
|
29
30
|
slots
|
|
30
31
|
}) {
|
|
32
|
+
const baseId = useId();
|
|
33
|
+
const getId = (num) => `${baseId}-${num}`;
|
|
34
|
+
const getUrlById = (num) => `url(#${getId(num)})`;
|
|
31
35
|
const renderImage = () => {
|
|
32
36
|
var _a;
|
|
33
37
|
if (slots.image) {
|
|
34
38
|
return slots.image();
|
|
35
39
|
}
|
|
36
|
-
return ((_a = PRESET_IMAGES[props.image]) == null ? void 0 : _a.call(PRESET_IMAGES, bem)) || _createVNode("img", {
|
|
40
|
+
return ((_a = PRESET_IMAGES[props.image]) == null ? void 0 : _a.call(PRESET_IMAGES, bem, getId, getUrlById)) || _createVNode("img", {
|
|
37
41
|
"src": props.image
|
|
38
42
|
}, null);
|
|
39
43
|
};
|
package/es/empty/Images.d.ts
CHANGED
|
@@ -5,16 +5,19 @@
|
|
|
5
5
|
* fill修改为class={bem('svg-defs-path-fill')};
|
|
6
6
|
* feColorMatrix需要调整内部value矩阵值,feOffset需要调整内部的in的值为SourceGraphic,具体可参考empty组件已有的svg元素。
|
|
7
7
|
* 经过这些操作,svg图标就会随主色变换颜色
|
|
8
|
+
*
|
|
9
|
+
* linearGradient中使用到的id需要从getId方法中生成,避免多次使用zt-empty出现id重复
|
|
8
10
|
*/
|
|
9
11
|
import { BEM } from '../utils';
|
|
10
|
-
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const
|
|
19
|
-
export declare const
|
|
20
|
-
export declare const
|
|
12
|
+
import type { EmptySvgIdFn } from './types';
|
|
13
|
+
export declare const renderNotFound: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
14
|
+
export declare const renderServerError: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
15
|
+
export declare const renderAccessRestricted: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
16
|
+
export declare const renderDeveloping: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
17
|
+
export declare const renderNetworkError: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
18
|
+
export declare const renderEmptyResult: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
19
|
+
export declare const renderFindNull: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
20
|
+
export declare const renderEmptyInterface: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
21
|
+
export declare const renderReportSuccess: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
22
|
+
export declare const renderReportError: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|
|
23
|
+
export declare const renderNoCollect: (bem: BEM, getId: EmptySvgIdFn, getUrlById: EmptySvgIdFn) => JSX.Element;
|