hys-ui 0.1.0 → 0.1.1
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/CHANGELOG.md +26 -1
- package/README.md +16 -6
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysBadge/HysBadge.vue.js +1 -1
- package/dist/components/HysBadge/HysBadge2.vue.js +20 -19
- package/dist/components/HysCalendar/HysCalendar.vue.js +48 -40
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +9 -9
- package/dist/components/HysCascader/HysCascader.vue.js +88 -76
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +85 -2
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +22 -22
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +85 -2
- package/dist/components/HysForm/HysForm.vue.js +2 -2
- package/dist/components/HysForm/HysForm2.vue.js +66 -64
- package/dist/components/HysFormItem/HysFormItem.vue.js +53 -37
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +302 -2
- package/dist/components/HysInput/HysInput.vue.js +1 -1
- package/dist/components/HysInput/HysInput2.vue.js +42 -41
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +49 -40
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +34 -32
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +91 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +100 -2
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +80 -2
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +86 -67
- package/dist/components/HysSearch/HysSearch.vue.js +49 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +39 -34
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +130 -109
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +40 -40
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +15 -14
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +38 -27
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +42 -38
- package/dist/components/HysTabs/HysTabs.vue.js +1 -1
- package/dist/components/HysTabs/HysTabs2.vue.js +8 -6
- package/dist/components/HysTextarea/HysTextarea.vue.js +58 -48
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +159 -143
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +62 -61
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +64 -57
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +95 -77
- package/dist/composables/formContext.js +9 -3
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +40 -40
- package/dist/composables/useHysToast.js +148 -0
- package/dist/config.js +18 -15
- package/dist/index.js +10 -7
- package/dist/style.css +1 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +2 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +5 -1
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +21 -4
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +6 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +6 -0
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -0
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +3 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +40 -17
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +7 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -0
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +1 -1
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +1 -1
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +3 -1
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +11 -1
- package/dist/types/composables/formContext.d.ts +5 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/useFloating.d.ts +1 -1
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/index.d.ts +5 -0
- package/package.json +46 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
- Center toast messages at the top by default and add seven placement options.
|
|
6
|
+
- Remove the toast accent border; add warning/loading states, content/icon/action slots and timer pause/resume.
|
|
7
|
+
- Add useHysToast for keyed updates, grouping, bounded queues, close handles and completion callbacks.
|
|
8
|
+
- Improve toast transitions, narrow-screen layout and cached-page resource cleanup.
|
|
9
|
+
- Add createHysToast for shared services outside component setup.
|
|
10
|
+
- Match drawer entrance/exit directions to placement, including fullscreen; support explicit top/bottom height.
|
|
11
|
+
- Fit Gantt timelines to the available container width and preserve date calculations while resizing.
|
|
12
|
+
- Keep select options on one line, size popups to content, and add exact-width and custom filtering options.
|
|
13
|
+
- Preserve remote selection labels and improve keyboard navigation, disabled options and composition handling.
|
|
14
|
+
- Unify checkbox/radio visuals and compose them in trees, transfer lists and permission matrices.
|
|
15
|
+
- Add permission batch selection and transfer change events; preserve drag/drop animations.
|
|
16
|
+
- Prevent stale asynchronous switch, upload and dialog actions after cancellation or page changes.
|
|
17
|
+
- Improve form validation for custom controls, field descriptions, readonly behavior and reset feedback.
|
|
18
|
+
- Correct slider step alignment, calendar initial selection, numeric animation boundaries and resize cleanup.
|
|
19
|
+
- Synchronize pagination models after page-size changes and validate typed jump targets immediately.
|
|
20
|
+
- Preserve typed numeric precision and expose draft input events from number inputs.
|
|
21
|
+
- Respect disabled notification actions; defer incomplete search composition and cancel stale queries.
|
|
22
|
+
- Reset command highlights after filtering, normalize organization input and tour step bounds, and enable default tour Escape behavior.
|
|
23
|
+
- Guard pending rich-text link commands and improve composite form focus and keyboard file selection.
|
|
24
|
+
- Expand select examples and organize configuration panels into aligned parameter and behavior groups.
|
|
25
|
+
- Add formatted, highlighted, lazy-loaded source panels with toolbar copy actions and responsive layout.
|
|
26
|
+
- Simplify documentation to focus on component features, API and examples.
|
|
27
|
+
|
|
3
28
|
## 0.1.0
|
|
4
29
|
|
|
5
|
-
-
|
|
30
|
+
- Introduce reusable Vue components with Hys-prefixed public names.
|
|
6
31
|
- Add isolated styles, six themes, reactive configuration and public TypeScript declarations.
|
|
7
32
|
- Expand common interaction capabilities across form, selection, feedback, navigation, layout and data components.
|
|
8
33
|
- Add rule-based forms, asynchronous validation, reset and accessible field feedback.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# HYS UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
面向 Vue 3.5+ 的组件库,提供 TypeScript 类型、主题配置和独立的中文交互文档。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ npm run dev:docs
|
|
|
47
47
|
访问 http://127.0.0.1:5174。每个组件有独立路由、运行场景、源码、API 与说明,页面状态通过 KeepAlive 保留。API 从源码生成。
|
|
48
48
|
|
|
49
49
|
- `packages/ui`:唯一的组件源码及 npm 包。
|
|
50
|
-
- `apps/docs
|
|
50
|
+
- `apps/docs`:独立组件文档与交互示例。
|
|
51
51
|
- `tests`:核心行为回归。
|
|
52
52
|
- `scripts`:元信息提取、完整性检查、打包与发布验证。
|
|
53
53
|
|
|
@@ -59,15 +59,25 @@ npm run check:contracts
|
|
|
59
59
|
npm run check:release
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
`build:docs` 输出到 `apps/docs/dist`,部署服务需要将未知路径回退到 `index.html
|
|
62
|
+
`build:docs` 输出到 `apps/docs/dist`,部署服务需要将未知路径回退到 `index.html`。
|
|
63
63
|
|
|
64
|
-
##
|
|
64
|
+
## 轻提示
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
轻提示默认显示在顶部中间,支持七种位置、五种状态和自定义内容。
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { useHysToast } from 'hys-ui'
|
|
70
|
+
|
|
71
|
+
// 在组件 setup 中使用
|
|
72
|
+
const toast = useHysToast({ maxCount: 5 })
|
|
73
|
+
toast.success('保存成功')
|
|
74
|
+
const task = toast.loading('正在上传…')
|
|
75
|
+
task.update({ type: 'success', message: '上传完成', duration: 2000 })
|
|
76
|
+
```
|
|
67
77
|
|
|
68
78
|
## 发布
|
|
69
79
|
|
|
70
|
-
根工作区和文档应用为私有,npm 包名为 `hys-ui
|
|
80
|
+
根工作区和文档应用为私有,npm 包名为 `hys-ui`,版本 `0.1.1`,MIT 公开发布。
|
|
71
81
|
|
|
72
82
|
```bash
|
|
73
83
|
npm run pack:ui
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as b, ref as k, computed as C, watch as g, openBlock as o, createElementBlock as
|
|
1
|
+
import { defineComponent as b, ref as k, computed as C, watch as g, openBlock as o, createElementBlock as s, mergeProps as B, unref as t, createBlock as w, resolveDynamicComponent as A, createCommentVNode as l, createElementVNode as c, renderSlot as u, createTextVNode as d, toDisplayString as m, createVNode as N } from "vue";
|
|
2
2
|
import { useHysRootAttrs as V } from "../../config.js";
|
|
3
|
-
import { CircleCheck as
|
|
4
|
-
const
|
|
3
|
+
import { CircleCheck as I, TriangleAlert as $, CircleAlert as p, Info as x, X as z } from "lucide-vue-next";
|
|
4
|
+
const D = ["role"], E = { key: 0 }, j = /* @__PURE__ */ b({
|
|
5
5
|
__name: "HysAlert",
|
|
6
6
|
props: {
|
|
7
7
|
tone: { default: "info" },
|
|
@@ -14,41 +14,41 @@ const E = ["role"], H = { key: 0 }, j = /* @__PURE__ */ b({
|
|
|
14
14
|
},
|
|
15
15
|
emits: ["close", "update:visible"],
|
|
16
16
|
setup(e, { emit: y }) {
|
|
17
|
-
const f = V(),
|
|
18
|
-
g(() =>
|
|
17
|
+
const f = V(), r = e, a = y, n = k(!0), v = C(() => r.visible ?? n.value);
|
|
18
|
+
g(() => r.title, () => n.value = !0);
|
|
19
19
|
function h() {
|
|
20
|
-
n.value = !1,
|
|
20
|
+
n.value = !1, a("update:visible", !1), a("close");
|
|
21
21
|
}
|
|
22
|
-
return (
|
|
22
|
+
return (i, H) => v.value ? (o(), s("div", B({ key: 0 }, t(f), {
|
|
23
23
|
class: ["hys-ui-ex-alert", "hys-ui-ex-" + e.tone],
|
|
24
24
|
role: e.tone === "danger" ? "alert" : "status",
|
|
25
25
|
style: { justifyContent: e.center ? "center" : void 0 }
|
|
26
26
|
}), [
|
|
27
|
-
e.showIcon ? (o(), w(A(e.tone === "success" ? t(
|
|
27
|
+
e.showIcon ? (o(), w(A(e.tone === "success" ? t(I) : e.tone === "warning" ? t($) : e.tone === "danger" ? t(p) : t(x)), {
|
|
28
28
|
key: 0,
|
|
29
29
|
size: 18
|
|
30
30
|
})) : l("", !0),
|
|
31
31
|
c("div", null, [
|
|
32
|
-
e.title ? (o(),
|
|
33
|
-
u(
|
|
32
|
+
e.title || i.$slots.title ? (o(), s("strong", E, [
|
|
33
|
+
u(i.$slots, "title", {}, () => [
|
|
34
34
|
d(m(e.title), 1)
|
|
35
35
|
])
|
|
36
36
|
])) : l("", !0),
|
|
37
37
|
c("div", null, [
|
|
38
|
-
u(
|
|
38
|
+
u(i.$slots, "default", {}, () => [
|
|
39
39
|
d(m(e.description), 1)
|
|
40
40
|
])
|
|
41
41
|
])
|
|
42
42
|
]),
|
|
43
|
-
e.closable ? (o(),
|
|
43
|
+
e.closable ? (o(), s("button", {
|
|
44
44
|
key: 1,
|
|
45
45
|
type: "button",
|
|
46
46
|
"aria-label": "关闭提示",
|
|
47
47
|
onClick: h
|
|
48
48
|
}, [
|
|
49
|
-
N(t(
|
|
49
|
+
N(t(z), { size: 14 })
|
|
50
50
|
])) : l("", !0)
|
|
51
|
-
], 16,
|
|
51
|
+
], 16, D)) : l("", !0);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as A, ref as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
import { useMotion as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as A, ref as b, watch as M, onDeactivated as x, onActivated as y, onBeforeUnmount as N, openBlock as w, createElementBlock as B, mergeProps as k, unref as q, toDisplayString as D } from "vue";
|
|
2
|
+
import { useHysRootAttrs as H } from "../../config.js";
|
|
3
|
+
import { useMotion as R } from "../../motion/useMotion.js";
|
|
4
|
+
const S = ["aria-label"], P = /* @__PURE__ */ A({
|
|
5
5
|
__name: "HysAnimatedNumber",
|
|
6
6
|
props: {
|
|
7
7
|
value: {},
|
|
@@ -9,32 +9,35 @@ const H = ["aria-label"], E = /* @__PURE__ */ A({
|
|
|
9
9
|
decimals: { default: 0 }
|
|
10
10
|
},
|
|
11
11
|
setup(o) {
|
|
12
|
-
const
|
|
12
|
+
const l = H(), { effectiveMotion: u } = R(), t = o, n = b(Number.isFinite(t.value) ? t.value : 0);
|
|
13
13
|
let a = 0, r = !0;
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function i(e) {
|
|
15
|
+
return Number.isFinite(e) ? e : 0;
|
|
16
|
+
}
|
|
17
|
+
function f(e) {
|
|
18
|
+
if (e = i(e), cancelAnimationFrame(a), u.value === "off" || !Number.isFinite(t.duration) || t.duration <= 0) {
|
|
19
|
+
n.value = e;
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
const c = Math.min(1, (p -
|
|
22
|
-
|
|
22
|
+
const s = n.value, v = performance.now(), h = Math.max(1, t.duration);
|
|
23
|
+
function m(p) {
|
|
24
|
+
const c = Math.min(1, (p - v) / h), F = 1 - Math.pow(1 - c, 3);
|
|
25
|
+
n.value = s + (e - s) * F, c < 1 && (a = requestAnimationFrame(m));
|
|
23
26
|
}
|
|
24
|
-
a = requestAnimationFrame(
|
|
27
|
+
a = requestAnimationFrame(m);
|
|
25
28
|
}
|
|
26
|
-
return
|
|
27
|
-
r ?
|
|
29
|
+
return M(() => [t.value, t.duration, u.value], ([e]) => {
|
|
30
|
+
r ? f(e) : n.value = i(e);
|
|
28
31
|
}), x(() => {
|
|
29
32
|
r = !1, cancelAnimationFrame(a);
|
|
30
33
|
}), y(() => {
|
|
31
|
-
r = !0,
|
|
32
|
-
}),
|
|
34
|
+
r = !0, n.value = i(t.value);
|
|
35
|
+
}), N(() => cancelAnimationFrame(a)), (e, d) => (w(), B("span", k(q(l), {
|
|
33
36
|
class: "hys-ui-motion-number",
|
|
34
|
-
"aria-label": String(o.value)
|
|
35
|
-
}),
|
|
37
|
+
"aria-label": String(i(o.value))
|
|
38
|
+
}), D(n.value.toFixed(Number.isFinite(o.decimals) ? Math.max(0, Math.min(5, Math.floor(o.decimals))) : 0)), 17, S));
|
|
36
39
|
}
|
|
37
40
|
});
|
|
38
41
|
export {
|
|
39
|
-
|
|
42
|
+
P as default
|
|
40
43
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysBadge2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-743d37a3"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as y, openBlock as t, createElementBlock as o, mergeProps as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
import { X as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as y, openBlock as t, createElementBlock as o, mergeProps as b, unref as u, normalizeStyle as c, normalizeClass as n, renderSlot as f, withModifiers as v, createVNode as g, createCommentVNode as l, toDisplayString as h } from "vue";
|
|
2
|
+
import { useHysRootAttrs as B } from "../../config.js";
|
|
3
|
+
import { X as k } from "lucide-vue-next";
|
|
4
|
+
const C = /* @__PURE__ */ y({
|
|
5
5
|
__name: "HysBadge",
|
|
6
6
|
props: {
|
|
7
7
|
tone: { default: "blue" },
|
|
@@ -14,30 +14,31 @@ const S = /* @__PURE__ */ y({
|
|
|
14
14
|
showZero: { type: Boolean }
|
|
15
15
|
},
|
|
16
16
|
emits: ["close"],
|
|
17
|
-
setup(e, { emit:
|
|
18
|
-
const
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
setup(e, { emit: d }) {
|
|
18
|
+
const i = B(), m = d;
|
|
19
|
+
return (a, s) => (t(), o("span", b(u(i), { class: "hys-ui-badge-wrap" }), [
|
|
20
|
+
a.$slots.default || e.closable ? (t(), o("span", {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: n(["hys-ui-badge", ["hys-ui-badge-" + e.tone, { "hys-ui-badge-content": e.dot || e.value !== void 0 }]]),
|
|
23
|
+
style: c({ borderRadius: e.round ? "99px" : void 0, fontSize: e.size === "sm" ? "10px" : void 0 })
|
|
23
24
|
}, [
|
|
24
|
-
|
|
25
|
+
f(a.$slots, "default", {}, void 0, !0),
|
|
25
26
|
e.closable ? (t(), o("button", {
|
|
26
27
|
key: 0,
|
|
27
28
|
type: "button",
|
|
28
29
|
"aria-label": "关闭标签",
|
|
29
|
-
onClick:
|
|
30
|
+
onClick: s[0] || (s[0] = v((r) => m("close", r), ["stop"]))
|
|
30
31
|
}, [
|
|
31
|
-
|
|
32
|
-
])) :
|
|
33
|
-
], 6),
|
|
32
|
+
g(u(k), { size: 12 })
|
|
33
|
+
])) : l("", !0)
|
|
34
|
+
], 6)) : l("", !0),
|
|
34
35
|
e.dot || e.value !== void 0 && (e.value !== 0 || e.showZero) ? (t(), o("sup", {
|
|
35
|
-
key:
|
|
36
|
-
class: n(["hys-ui-badge-counter", { "hys-ui-badge-dot": e.dot }])
|
|
37
|
-
},
|
|
36
|
+
key: 1,
|
|
37
|
+
class: n(["hys-ui-badge-counter", { "hys-ui-badge-dot": e.dot, "hys-ui-badge-standalone": !a.$slots.default && !e.closable }])
|
|
38
|
+
}, h(e.dot ? "" : typeof e.value == "number" && e.value > e.max ? e.max + "+" : e.value), 3)) : l("", !0)
|
|
38
39
|
], 16));
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
C as default
|
|
43
44
|
};
|
|
@@ -1,80 +1,88 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
import { ChevronLeft as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as F, ref as k, watch as T, computed as $, openBlock as r, createElementBlock as i, mergeProps as A, unref as v, createElementVNode as d, createVNode as D, toDisplayString as c, Fragment as b, renderList as h, renderSlot as B, createTextVNode as M, createCommentVNode as R } from "vue";
|
|
2
|
+
import { useHysRootAttrs as Y } from "../../config.js";
|
|
3
|
+
import { ChevronLeft as x, ChevronRight as z } from "lucide-vue-next";
|
|
4
|
+
const E = { class: "hys-ui-ent-toolbar" }, H = { class: "hys-ui-ent-calendar" }, L = ["disabled", "aria-readonly", "aria-pressed", "onClick"], U = ["disabled", "onClick"], j = /* @__PURE__ */ F({
|
|
5
5
|
__name: "HysCalendar",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: {},
|
|
8
8
|
events: {},
|
|
9
|
+
disabled: { type: Boolean },
|
|
10
|
+
readonly: { type: Boolean },
|
|
9
11
|
disabledDate: { type: Function }
|
|
10
12
|
},
|
|
11
13
|
emits: ["update:modelValue", "select", "event"],
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
setup(a, { emit: V }) {
|
|
15
|
+
const S = Y(), N = a, y = V, g = /* @__PURE__ */ new Date(), l = k(g.getFullYear()), o = k(g.getMonth());
|
|
16
|
+
T(() => N.modelValue, (n) => {
|
|
17
|
+
if (!n || !/^\d{4}-\d{2}-\d{2}$/.test(n)) return;
|
|
18
|
+
const t = /* @__PURE__ */ new Date(n + "T00:00:00Z");
|
|
19
|
+
!Number.isNaN(t.getTime()) && t.toISOString().slice(0, 10) === n && (l.value = t.getUTCFullYear(), o.value = t.getUTCMonth());
|
|
20
|
+
}, { immediate: !0 });
|
|
21
|
+
const p = $(() => `${l.value}年${o.value + 1}月`), w = $(() => {
|
|
22
|
+
const n = (new Date(l.value, o.value, 1).getDay() + 6) % 7, t = new Date(l.value, o.value + 1, 0).getDate();
|
|
23
|
+
return [...Array(n).fill(null), ...Array.from({ length: t }, (e, m) => m + 1)];
|
|
16
24
|
});
|
|
17
|
-
function
|
|
18
|
-
const t = new Date(
|
|
19
|
-
|
|
25
|
+
function f(n) {
|
|
26
|
+
const t = new Date(l.value, o.value + n, 1);
|
|
27
|
+
l.value = t.getFullYear(), o.value = t.getMonth();
|
|
20
28
|
}
|
|
21
29
|
function s(n) {
|
|
22
|
-
return `${
|
|
30
|
+
return `${l.value}-${String(o.value + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
|
|
23
31
|
}
|
|
24
|
-
return (n, t) => (
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
return (n, t) => (r(), i("section", A(v(S), { class: "hys-ui-ent-panel" }), [
|
|
33
|
+
d("header", E, [
|
|
34
|
+
d("button", {
|
|
27
35
|
type: "button",
|
|
28
36
|
"aria-label": "上个月",
|
|
29
|
-
onClick: t[0] || (t[0] = (e) =>
|
|
37
|
+
onClick: t[0] || (t[0] = (e) => f(-1))
|
|
30
38
|
}, [
|
|
31
|
-
|
|
39
|
+
D(v(x), {
|
|
32
40
|
size: 16,
|
|
33
41
|
"aria-hidden": "true"
|
|
34
42
|
})
|
|
35
43
|
]),
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
d("strong", null, c(p.value), 1),
|
|
45
|
+
d("button", {
|
|
38
46
|
type: "button",
|
|
39
47
|
"aria-label": "下个月",
|
|
40
|
-
onClick: t[1] || (t[1] = (e) =>
|
|
48
|
+
onClick: t[1] || (t[1] = (e) => f(1))
|
|
41
49
|
}, [
|
|
42
|
-
|
|
50
|
+
D(v(z), {
|
|
43
51
|
size: 16,
|
|
44
52
|
"aria-hidden": "true"
|
|
45
53
|
})
|
|
46
54
|
])
|
|
47
55
|
]),
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
(
|
|
51
|
-
var
|
|
52
|
-
return
|
|
53
|
-
key:
|
|
56
|
+
d("div", H, [
|
|
57
|
+
(r(), i(b, null, h(["一", "二", "三", "四", "五", "六", "日"], (e) => d("strong", { key: e }, c(e), 1)), 64)),
|
|
58
|
+
(r(!0), i(b, null, h(w.value, (e, m) => {
|
|
59
|
+
var C;
|
|
60
|
+
return r(), i("div", {
|
|
61
|
+
key: m,
|
|
54
62
|
class: "hys-ui-ent-calendar-day"
|
|
55
63
|
}, [
|
|
56
|
-
e ? (
|
|
64
|
+
e ? (r(), i("button", {
|
|
57
65
|
key: 0,
|
|
58
66
|
type: "button",
|
|
59
|
-
disabled: (
|
|
60
|
-
"aria-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
67
|
+
disabled: a.disabled || ((C = a.disabledDate) == null ? void 0 : C.call(a, s(e))),
|
|
68
|
+
"aria-readonly": a.readonly || void 0,
|
|
69
|
+
"aria-pressed": a.modelValue === s(e),
|
|
70
|
+
onClick: (u) => !a.readonly && (y("select", s(e)), y("update:modelValue", s(e)))
|
|
64
71
|
}, [
|
|
65
|
-
|
|
72
|
+
B(n.$slots, "date", {
|
|
66
73
|
date: s(e),
|
|
67
74
|
day: e
|
|
68
75
|
}, () => [
|
|
69
|
-
|
|
76
|
+
M(c(e), 1)
|
|
70
77
|
])
|
|
71
|
-
], 8,
|
|
72
|
-
(
|
|
78
|
+
], 8, L)) : R("", !0),
|
|
79
|
+
(r(!0), i(b, null, h((a.events || []).filter((u) => e && u.date === s(e)), (u) => (r(), i("button", {
|
|
73
80
|
type: "button",
|
|
74
81
|
key: u.id,
|
|
75
82
|
class: "hys-ui-ent-event",
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
disabled: a.disabled,
|
|
84
|
+
onClick: (I) => y("event", u.id)
|
|
85
|
+
}, c(u.title), 9, U))), 128))
|
|
78
86
|
]);
|
|
79
87
|
}), 128))
|
|
80
88
|
])
|
|
@@ -82,5 +90,5 @@ const H = { class: "hys-ui-ent-toolbar" }, L = { class: "hys-ui-ent-calendar" },
|
|
|
82
90
|
}
|
|
83
91
|
});
|
|
84
92
|
export {
|
|
85
|
-
|
|
93
|
+
j as default
|
|
86
94
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysCard2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-7c0b794e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as n, openBlock as s, createElementBlock as o, mergeProps as u, unref as y, renderSlot as l, createElementVNode as d, toDisplayString as
|
|
1
|
+
import { defineComponent as n, openBlock as s, createElementBlock as o, mergeProps as u, unref as y, renderSlot as l, createElementVNode as d, toDisplayString as i, createCommentVNode as a, normalizeStyle as c } from "vue";
|
|
2
2
|
import { useHysRootAttrs as h } from "../../config.js";
|
|
3
3
|
const m = {
|
|
4
4
|
key: 0,
|
|
@@ -18,10 +18,10 @@ const m = {
|
|
|
18
18
|
title: {},
|
|
19
19
|
subtitle: {},
|
|
20
20
|
loading: { type: Boolean },
|
|
21
|
-
bordered: { type: Boolean },
|
|
22
|
-
shadow: {},
|
|
21
|
+
bordered: { type: Boolean, default: !0 },
|
|
22
|
+
shadow: { default: "never" },
|
|
23
23
|
bodyStyle: {},
|
|
24
|
-
size: {}
|
|
24
|
+
size: { default: "md" }
|
|
25
25
|
},
|
|
26
26
|
setup(e) {
|
|
27
27
|
const r = h();
|
|
@@ -29,17 +29,17 @@ const m = {
|
|
|
29
29
|
class: ["hys-ui-card", ["hys-ui-card-shadow-" + (e.shadow || "never"), "hys-ui-card-size-" + (e.size || "md")]],
|
|
30
30
|
style: { border: e.bordered === !1 ? "0" : void 0 }
|
|
31
31
|
}), [
|
|
32
|
-
e.title || t.$slots.header || t.$slots.action ? (s(), o("header", m, [
|
|
32
|
+
e.title || e.subtitle || t.$slots.header || t.$slots.action ? (s(), o("header", m, [
|
|
33
33
|
l(t.$slots, "header", {}, () => [
|
|
34
34
|
d("div", null, [
|
|
35
|
-
d("h3", null,
|
|
36
|
-
e.subtitle ? (s(), o("p", f,
|
|
35
|
+
d("h3", null, i(e.title), 1),
|
|
36
|
+
e.subtitle ? (s(), o("p", f, i(e.subtitle), 1)) : a("", !0)
|
|
37
37
|
])
|
|
38
38
|
], !0),
|
|
39
39
|
d("div", null, [
|
|
40
40
|
l(t.$slots, "action", {}, void 0, !0)
|
|
41
41
|
])
|
|
42
|
-
])) :
|
|
42
|
+
])) : a("", !0),
|
|
43
43
|
d("div", {
|
|
44
44
|
class: "hys-ui-card-content",
|
|
45
45
|
style: c(e.bodyStyle),
|
|
@@ -49,7 +49,7 @@ const m = {
|
|
|
49
49
|
], 12, b),
|
|
50
50
|
t.$slots.footer ? (s(), o("footer", $, [
|
|
51
51
|
l(t.$slots, "footer", {}, void 0, !0)
|
|
52
|
-
])) :
|
|
52
|
+
])) : a("", !0)
|
|
53
53
|
], 16));
|
|
54
54
|
}
|
|
55
55
|
});
|