@zl-ui-kit/components 0.18.5 → 0.18.6
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
|
@@ -1643,7 +1643,10 @@ const statusActions = (item: Item): ActionItem[] => [
|
|
|
1643
1643
|
插槽内容接入父组件的渲染上下文,数据变化会正常更新;`v-model` 双向绑定当前页签 key。常用场景
|
|
1644
1644
|
(分页卡片的分类筛选)见 §6.3 ②。
|
|
1645
1645
|
- `ZlDynamicComponent`:schema→VNode 渲染引擎,默认 `el-input`。
|
|
1646
|
-
- `ZlGrid`(+`ZlGridItem`):自绘栅格,label
|
|
1646
|
+
- `ZlGrid`(+`ZlGridItem`):自绘栅格,label 自适应/省略提示/字典。
|
|
1647
|
+
**每项可独立跨列**:`IGridItem.size` 设该项跨列数(默认 1,`'auto'` 占满所在行剩余列),容器 `cols` 是总列数。
|
|
1648
|
+
配合使用可排不规则栅格——如 `cols=4` 时前四项 `size: 2`、后两项 `size: 1`,
|
|
1649
|
+
渲染为 `[A|A|B|B] / [C|C|D|D] / [E|F|·|·]`(前四项两两占一整行,后两项各占半行)。
|
|
1647
1650
|
|
|
1648
1651
|
### ZlTree —— 树形控件(多选 / 暴露方法)
|
|
1649
1652
|
|
|
@@ -4410,15 +4413,15 @@ import { ZlCheckboxTag } from '@zl-ui-kit/components'
|
|
|
4410
4413
|
|
|
4411
4414
|
**props**
|
|
4412
4415
|
|
|
4413
|
-
| 属性 | 类型 | 默认值 | 必填 | 示例 | 说明
|
|
4414
|
-
| ------------ | ------------------------------- | ---------- | ---- | -------------------- |
|
|
4415
|
-
| `modelValue` | `any` | — | 否 | `v-model="value"` | `v-model` 绑定的值(`defineModel` 隐式声明)
|
|
4416
|
-
| `options` | `CheckboxTagOption[]` | `() => []` | 否 | `:options="options"` | 标签候选列表,每项可配图标与互斥组
|
|
4417
|
-
| `single` | `boolean` | — | 否 | `single` | 单选模式(值为单值)
|
|
4418
|
-
| `rounded` | `boolean`
|
|
4419
|
-
| `bordered` | `boolean` | `true` | 否 | `:bordered="false"` |
|
|
4420
|
-
| `fill` | `boolean` | `true` | 否 | `:fill="false"` | 是否填充背景色,默认开启
|
|
4421
|
-
| `size` | `'mini' \| 'small' \| 'medium'` | `'small'` | 否 | `size="mini"` | 标签尺寸档位,默认 small
|
|
4416
|
+
| 属性 | 类型 | 默认值 | 必填 | 示例 | 说明 |
|
|
4417
|
+
| ------------ | ------------------------------- | ---------- | ---- | -------------------- | ----------------------------------------------------------------------------------------- |
|
|
4418
|
+
| `modelValue` | `any` | — | 否 | `v-model="value"` | `v-model` 绑定的值(`defineModel` 隐式声明) |
|
|
4419
|
+
| `options` | `CheckboxTagOption[]` | `() => []` | 否 | `:options="options"` | 标签候选列表,每项可配图标与互斥组 |
|
|
4420
|
+
| `single` | `boolean` | — | 否 | `single` | 单选模式(值为单值) |
|
|
4421
|
+
| `rounded` | `boolean \| number \| string` | `true` | 否 | `:rounded="rounded"` | 是否圆角显示,默认开启;也可为具体圆角值(数字 px 或 CSS 长度),false 关闭(直角/small) |
|
|
4422
|
+
| `bordered` | `boolean` | `true` | 否 | `:bordered="false"` | 是否显示边框,默认开启 |
|
|
4423
|
+
| `fill` | `boolean` | `true` | 否 | `:fill="false"` | 是否填充背景色,默认开启 |
|
|
4424
|
+
| `size` | `'mini' \| 'small' \| 'medium'` | `'small'` | 否 | `size="mini"` | 标签尺寸档位,默认 small |
|
|
4422
4425
|
|
|
4423
4426
|
**事件(emits)**
|
|
4424
4427
|
|
|
@@ -5011,7 +5014,7 @@ import { ZlGrid } from '@zl-ui-kit/components'
|
|
|
5011
5014
|
</script>
|
|
5012
5015
|
|
|
5013
5016
|
<template>
|
|
5014
|
-
<ZlGrid :data="data" :cols="
|
|
5017
|
+
<ZlGrid :data="data" :cols="4" border :grid="grid" />
|
|
5015
5018
|
</template>
|
|
5016
5019
|
```
|
|
5017
5020
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.zl-checkbox-tag{display:inline-flex;flex-wrap:wrap;gap:8px}.zl-checkbox-tag .zl-
|
|
1
|
+
.zl-checkbox-tag{display:inline-flex;flex-wrap:wrap;gap:8px}.zl-checkbox-tag .zl-checkbox-tag__plain:not(.zl-tag-selected){background-color:var(--zl-fill-2)}.zl-checkbox-tag .zl-checkbox-tag__plain:not(.zl-tag-selected):hover:not(.zl-tag-disabled){background-color:var(--zl-fill-3)}.zl-checkbox-tag .zl-tag.zl-tag-selected:not(.zl-tag-disabled):hover{background-color:var(--tag-color-fill)}.zl-checkbox-tag .zl-tag-disabled{color:var(--zl-text-4)}.zl-checkbox-tag .zl-tag-disabled.zl-tag-selected{background-color:var(--zl-primary-1);color:var(--zl-primary-3);border-color:var(--zl-primary-3)}
|
|
@@ -12,9 +12,9 @@ type __VLS_Props = {
|
|
|
12
12
|
options?: CheckboxTagOption[];
|
|
13
13
|
/** 单选模式(值为单值) */
|
|
14
14
|
single?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
rounded?: boolean;
|
|
17
|
-
/**
|
|
15
|
+
/** 是否圆角显示,默认开启;也可为具体圆角值(数字 px 或 CSS 长度),false 关闭(直角/small) */
|
|
16
|
+
rounded?: boolean | number | string;
|
|
17
|
+
/** 是否显示边框,默认开启 */
|
|
18
18
|
bordered?: boolean;
|
|
19
19
|
/** 是否填充背景色,默认开启 */
|
|
20
20
|
fill?: boolean;
|
|
@@ -44,7 +44,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
44
44
|
fill: boolean;
|
|
45
45
|
size: "mini" | "small" | "medium";
|
|
46
46
|
bordered: boolean;
|
|
47
|
-
rounded: boolean;
|
|
47
|
+
rounded: boolean | number | string;
|
|
48
48
|
options: CheckboxTagOption[];
|
|
49
49
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
50
50
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as x, useModel as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as x, useModel as b, computed as t, ref as h, openBlock as c, createElementBlock as v, Fragment as k, renderList as m, createBlock as y, normalizeStyle as z, normalizeClass as B, withCtx as C, renderSlot as S, mergeProps as V, createTextVNode as $, toDisplayString as E, mergeModels as M } from "vue";
|
|
2
|
+
import w from "../ZlTag/index.vue.mjs";
|
|
3
3
|
import '../ZlTag/index.css';/* empty css */
|
|
4
|
-
const
|
|
4
|
+
const N = { class: "zl-checkbox-tag" }, F = /* @__PURE__ */ x({
|
|
5
5
|
name: "ZlCheckboxTag",
|
|
6
6
|
__name: "index",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ M({
|
|
8
8
|
options: { default: () => [] },
|
|
9
9
|
single: { type: Boolean },
|
|
10
|
-
rounded: { type: Boolean, default: !0 },
|
|
10
|
+
rounded: { type: [Boolean, Number, String], default: !0 },
|
|
11
11
|
bordered: { type: Boolean, default: !0 },
|
|
12
12
|
fill: { type: Boolean, default: !0 },
|
|
13
13
|
size: { default: "small" }
|
|
@@ -17,51 +17,55 @@ const M = { class: "zl-checkbox-tag" }, T = /* @__PURE__ */ x({
|
|
|
17
17
|
}),
|
|
18
18
|
emits: ["update:modelValue"],
|
|
19
19
|
setup(o) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const a = o, u = b(o, "modelValue"), f = t(() => {
|
|
21
|
+
if (typeof a.rounded == "number") return { "--zl-radius-round": `${a.rounded}px` };
|
|
22
|
+
if (typeof a.rounded == "string") return { "--zl-radius-round": a.rounded };
|
|
23
|
+
}), i = t(() => a.options.some((e) => e.exclusive)), d = h();
|
|
24
|
+
if (i.value && u.value) {
|
|
25
|
+
const e = a.options.find((n) => n.value === u.value[0]);
|
|
23
26
|
d.value = e?.exclusive;
|
|
24
27
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
28
|
+
const r = t(() => new Set(a.single ? [u.value] : u.value ?? []));
|
|
29
|
+
function p(e) {
|
|
27
30
|
if (e.disabled) return;
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const
|
|
31
|
-
|
|
31
|
+
const n = a.single ? [u.value] : [...u.value ?? []], l = n.includes(e.value);
|
|
32
|
+
if (i.value && !l) {
|
|
33
|
+
const s = e;
|
|
34
|
+
s.exclusive === !0 || s.exclusive !== d.value ? (u.value = [e.value], d.value = s.exclusive) : u.value = [...n, e.value];
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
37
|
if (l) {
|
|
35
|
-
const
|
|
36
|
-
|
|
38
|
+
const s = n.filter((g) => g !== e.value);
|
|
39
|
+
u.value = a.single ? s[0] : s;
|
|
37
40
|
} else
|
|
38
|
-
|
|
41
|
+
a.single ? u.value = e.value : u.value = [...n, e.value];
|
|
39
42
|
}
|
|
40
|
-
return (e,
|
|
41
|
-
(
|
|
43
|
+
return (e, n) => (c(), v("div", N, [
|
|
44
|
+
(c(!0), v(k, null, m(o.options, (l) => (c(), y(w, {
|
|
42
45
|
key: l.value,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
class: B({ "zl-checkbox-tag__plain": !r.value.has(l.value) && o.fill }),
|
|
47
|
+
style: z(f.value),
|
|
48
|
+
rounded: o.rounded !== !1,
|
|
49
|
+
color: r.value.has(l.value) ? "primary" : void 0,
|
|
50
|
+
bordered: o.bordered,
|
|
47
51
|
selectable: "",
|
|
48
|
-
selected:
|
|
52
|
+
selected: r.value.has(l.value),
|
|
49
53
|
disabled: l.disabled,
|
|
50
54
|
icon: l.icon,
|
|
51
55
|
size: o.size,
|
|
52
|
-
onClick: (
|
|
56
|
+
onClick: (s) => p(l)
|
|
53
57
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
default: C(() => [
|
|
59
|
+
S(e.$slots, "default", V({ ref_for: !0 }, { item: l, checked: r.value.has(l.value) }), () => [
|
|
60
|
+
$(E(l.label), 1)
|
|
57
61
|
])
|
|
58
62
|
]),
|
|
59
63
|
_: 2
|
|
60
|
-
}, 1032, ["
|
|
64
|
+
}, 1032, ["class", "style", "rounded", "color", "bordered", "selected", "disabled", "icon", "size", "onClick"]))), 128))
|
|
61
65
|
]));
|
|
62
66
|
}
|
|
63
67
|
});
|
|
64
68
|
export {
|
|
65
|
-
|
|
69
|
+
F as default
|
|
66
70
|
};
|
|
67
71
|
//# sourceMappingURL=index.vue.mjs.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zl-ui-kit/components",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ZL UI 业务组件库(Element Plus 体系,Zl 前缀)——首批:Icon/AutoTooltip/Tag/CornerTag/Text/Title/Copy/Empty/Pagination/DictTag",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"file-type": "^20.4.1",
|
|
40
40
|
"dt-sql-parser": "^4.3.1",
|
|
41
41
|
"sql-formatter": "^15.4.2",
|
|
42
|
-
"@zl-ui-kit/
|
|
43
|
-
"@zl-ui-kit/icons": "0.18.
|
|
44
|
-
"@zl-ui-kit/
|
|
42
|
+
"@zl-ui-kit/utils": "0.18.6",
|
|
43
|
+
"@zl-ui-kit/icons": "0.18.6",
|
|
44
|
+
"@zl-ui-kit/composables": "0.18.6"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@vueuse/core": "^12.3.0 || ^13.0.0 || ^14.0.0 || ^15.0.0",
|
|
@@ -98,10 +98,10 @@
|
|
|
98
98
|
"@vue-office/pdf": "^2.0.10",
|
|
99
99
|
"@vue-office/pptx": "1.0.1",
|
|
100
100
|
"echarts": "^5.6.0",
|
|
101
|
+
"@jichuang/eslint-config": "1.0.0",
|
|
101
102
|
"@jichuang/tsconfig": "1.0.0",
|
|
102
103
|
"@jichuang/vite-config": "1.0.0",
|
|
103
|
-
"@zl-ui-kit/theme": "0.18.
|
|
104
|
-
"@jichuang/eslint-config": "1.0.0"
|
|
104
|
+
"@zl-ui-kit/theme": "0.18.6"
|
|
105
105
|
},
|
|
106
106
|
"repository": {
|
|
107
107
|
"type": "git",
|