hys-ui 0.0.0-stage → 0.1.0
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 +10 -0
- package/LICENSE +21 -0
- package/README.md +83 -2
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/HysAccordion/HysAccordion.vue.js +7 -0
- package/dist/components/HysAccordion/HysAccordion2.vue.js +65 -0
- package/dist/components/HysAlert/HysAlert.vue.js +56 -0
- package/dist/components/HysAlert/HysAlert2.vue.js +4 -0
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +40 -0
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +4 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +37 -0
- package/dist/components/HysAvatar/HysAvatar2.vue.js +4 -0
- package/dist/components/HysBadge/HysBadge.vue.js +7 -0
- package/dist/components/HysBadge/HysBadge2.vue.js +43 -0
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +40 -0
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +4 -0
- package/dist/components/HysButton/HysButton.vue.js +7 -0
- package/dist/components/HysButton/HysButton2.vue.js +106 -0
- package/dist/components/HysCalendar/HysCalendar.vue.js +86 -0
- package/dist/components/HysCalendar/HysCalendar2.vue.js +4 -0
- package/dist/components/HysCalendarNavigation/HysCalendarNavigation.vue.js +132 -0
- package/dist/components/HysCalendarNavigation/HysCalendarNavigation2.vue.js +4 -0
- package/dist/components/HysCard/HysCard.vue.js +7 -0
- package/dist/components/HysCard/HysCard2.vue.js +58 -0
- package/dist/components/HysCascader/HysCascader.vue.js +184 -0
- package/dist/components/HysCascader/HysCascader2.vue.js +4 -0
- package/dist/components/HysChart/HysChart.vue.js +51 -0
- package/dist/components/HysChart/HysChart2.vue.js +4 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +41 -0
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +4 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +231 -0
- package/dist/components/HysColorTokenEditor/HysColorTokenEditor.vue.js +33 -0
- package/dist/components/HysColorTokenEditor/HysColorTokenEditor2.vue.js +4 -0
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +104 -0
- package/dist/components/HysCommandPalette/HysCommandPalette2.vue.js +4 -0
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +44 -0
- package/dist/components/HysCommentEditor/HysCommentEditor2.vue.js +4 -0
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +91 -0
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +4 -0
- package/dist/components/HysCronEditor/HysCronEditor.vue.js +37 -0
- package/dist/components/HysCronEditor/HysCronEditor2.vue.js +4 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +7 -0
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +800 -0
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +149 -0
- package/dist/components/HysDatePicker/HysDatePicker2.vue.js +4 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +168 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker2.vue.js +4 -0
- package/dist/components/HysDiffViewer/HysDiffViewer.vue.js +28 -0
- package/dist/components/HysDiffViewer/HysDiffViewer2.vue.js +4 -0
- package/dist/components/HysDivider/HysDivider.vue.js +7 -0
- package/dist/components/HysDivider/HysDivider2.vue.js +28 -0
- package/dist/components/HysDrawer/HysDrawer.vue.js +7 -0
- package/dist/components/HysDrawer/HysDrawer2.vue.js +101 -0
- package/dist/components/HysEmpty/HysEmpty.vue.js +43 -0
- package/dist/components/HysEmpty/HysEmpty2.vue.js +4 -0
- package/dist/components/HysFileManager/HysFileManager.vue.js +65 -0
- package/dist/components/HysFileManager/HysFileManager2.vue.js +4 -0
- package/dist/components/HysForm/HysForm.vue.js +7 -0
- package/dist/components/HysForm/HysForm2.vue.js +123 -0
- package/dist/components/HysFormItem/HysFormItem.vue.js +71 -0
- package/dist/components/HysFormItem/HysFormItem2.vue.js +4 -0
- package/dist/components/HysGantt/HysGantt.vue.js +266 -0
- package/dist/components/HysGantt/HysGantt2.vue.js +4 -0
- package/dist/components/HysInput/HysInput.vue.js +7 -0
- package/dist/components/HysInput/HysInput2.vue.js +158 -0
- package/dist/components/HysJsonEditor/HysJsonEditor.vue.js +49 -0
- package/dist/components/HysJsonEditor/HysJsonEditor2.vue.js +4 -0
- package/dist/components/HysKanban/HysKanban.vue.js +54 -0
- package/dist/components/HysKanban/HysKanban2.vue.js +4 -0
- package/dist/components/HysMention/HysMention.vue.js +7 -0
- package/dist/components/HysMention/HysMention2.vue.js +165 -0
- package/dist/components/HysModal/HysModal.vue.js +7 -0
- package/dist/components/HysModal/HysModal2.vue.js +101 -0
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +61 -0
- package/dist/components/HysNotificationCenter/HysNotificationCenter2.vue.js +4 -0
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +7 -0
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +89 -0
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +56 -0
- package/dist/components/HysOrgTree/HysOrgTree2.vue.js +4 -0
- package/dist/components/HysPagination/HysPagination.vue.js +7 -0
- package/dist/components/HysPagination/HysPagination2.vue.js +213 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +43 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +4 -0
- package/dist/components/HysPopover/HysPopover.vue.js +93 -0
- package/dist/components/HysPopover/HysPopover2.vue.js +4 -0
- package/dist/components/HysProgress/HysProgress.vue.js +7 -0
- package/dist/components/HysProgress/HysProgress2.vue.js +74 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +42 -0
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +4 -0
- package/dist/components/HysRating/HysRating.vue.js +7 -0
- package/dist/components/HysRating/HysRating2.vue.js +85 -0
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +48 -0
- package/dist/components/HysResizablePanel/HysResizablePanel2.vue.js +4 -0
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +7 -0
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +121 -0
- package/dist/components/HysSearch/HysSearch.vue.js +72 -0
- package/dist/components/HysSearch/HysSearch2.vue.js +4 -0
- package/dist/components/HysSegmented/HysSegmented.vue.js +60 -0
- package/dist/components/HysSegmented/HysSegmented2.vue.js +4 -0
- package/dist/components/HysSelect/HysSelect.vue.js +7 -0
- package/dist/components/HysSelect/HysSelect2.vue.js +201 -0
- package/dist/components/HysShortcutHelp/HysShortcutHelp.vue.js +23 -0
- package/dist/components/HysShortcutHelp/HysShortcutHelp2.vue.js +4 -0
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +7 -0
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +43 -0
- package/dist/components/HysSlider/HysSlider.vue.js +7 -0
- package/dist/components/HysSlider/HysSlider2.vue.js +77 -0
- package/dist/components/HysSortableList/HysSortableList.vue.js +7 -0
- package/dist/components/HysSortableList/HysSortableList2.vue.js +145 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +65 -0
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +4 -0
- package/dist/components/HysSteps/HysSteps.vue.js +7 -0
- package/dist/components/HysSteps/HysSteps2.vue.js +53 -0
- package/dist/components/HysSwitch/HysSwitch.vue.js +7 -0
- package/dist/components/HysSwitch/HysSwitch2.vue.js +56 -0
- package/dist/components/HysTable/HysTable.vue.js +7 -0
- package/dist/components/HysTable/HysTable2.vue.js +105 -0
- package/dist/components/HysTabs/HysTabs.vue.js +7 -0
- package/dist/components/HysTabs/HysTabs2.vue.js +81 -0
- package/dist/components/HysTagInput/HysTagInput.vue.js +83 -0
- package/dist/components/HysTagInput/HysTagInput2.vue.js +4 -0
- package/dist/components/HysTextarea/HysTextarea.vue.js +80 -0
- package/dist/components/HysTextarea/HysTextarea2.vue.js +4 -0
- package/dist/components/HysTimeline/HysTimeline.vue.js +7 -0
- package/dist/components/HysTimeline/HysTimeline2.vue.js +36 -0
- package/dist/components/HysToast/HysToast.vue.js +7 -0
- package/dist/components/HysToast/HysToast2.vue.js +57 -0
- package/dist/components/HysTooltip/HysTooltip.vue.js +66 -0
- package/dist/components/HysTooltip/HysTooltip2.vue.js +4 -0
- package/dist/components/HysTour/HysTour.vue.js +81 -0
- package/dist/components/HysTour/HysTour2.vue.js +4 -0
- package/dist/components/HysTransfer/HysTransfer.vue.js +209 -0
- package/dist/components/HysTransfer/HysTransfer2.vue.js +4 -0
- package/dist/components/HysTree/HysTree.vue.js +8 -0
- package/dist/components/HysTree/HysTree2.vue.js +360 -0
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +131 -0
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +4 -0
- package/dist/components/HysUpload/HysUpload.vue.js +7 -0
- package/dist/components/HysUpload/HysUpload2.vue.js +128 -0
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +96 -0
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +4 -0
- package/dist/composables/formContext.js +5 -0
- package/dist/composables/overlayManager.js +25 -0
- package/dist/composables/useDialog.js +56 -0
- package/dist/composables/useFloating.js +82 -0
- package/dist/config.js +21 -0
- package/dist/index.js +143 -0
- package/dist/motion/useMotion.js +15 -0
- package/dist/style.css +1 -0
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +48 -0
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +35 -0
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +11 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +32 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +33 -0
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +30 -0
- package/dist/types/components/HysButton/HysButton.vue.d.ts +61 -0
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +36 -0
- package/dist/types/components/HysCalendarNavigation/HysCalendarNavigation.vue.d.ts +24 -0
- package/dist/types/components/HysCard/HysCard.vue.d.ts +30 -0
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +46 -0
- package/dist/types/components/HysChart/HysChart.vue.d.ts +14 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +32 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +14 -0
- package/dist/types/components/HysColorTokenEditor/HysColorTokenEditor.vue.d.ts +10 -0
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +15 -0
- package/dist/types/components/HysCommentEditor/HysCommentEditor.vue.d.ts +18 -0
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +37 -0
- package/dist/types/components/HysCronEditor/HysCronEditor.vue.d.ts +10 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +125 -0
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +17 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +17 -0
- package/dist/types/components/HysDiffViewer/HysDiffViewer.vue.d.ts +7 -0
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +24 -0
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +51 -0
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +29 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +22 -0
- package/dist/types/components/HysForm/HysForm.vue.d.ts +54 -0
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +27 -0
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +39 -0
- package/dist/types/components/HysInput/HysInput.vue.d.ts +63 -0
- package/dist/types/components/HysJsonEditor/HysJsonEditor.vue.d.ts +10 -0
- package/dist/types/components/HysKanban/HysKanban.vue.d.ts +20 -0
- package/dist/types/components/HysMention/HysMention.vue.d.ts +54 -0
- package/dist/types/components/HysModal/HysModal.vue.d.ts +51 -0
- package/dist/types/components/HysNotificationCenter/HysNotificationCenter.vue.d.ts +24 -0
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +36 -0
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +22 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +45 -0
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +12 -0
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -0
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +34 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +21 -0
- package/dist/types/components/HysRating/HysRating.vue.d.ts +36 -0
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +31 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +27 -0
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +32 -0
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +39 -0
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +61 -0
- package/dist/types/components/HysShortcutHelp/HysShortcutHelp.vue.d.ts +9 -0
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +29 -0
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +31 -0
- package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +29 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +33 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +20 -0
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +20 -0
- package/dist/types/components/HysTable/HysTable.vue.d.ts +55 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +48 -0
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +44 -0
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +43 -0
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +35 -0
- package/dist/types/components/HysToast/HysToast.vue.d.ts +19 -0
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +33 -0
- package/dist/types/components/HysTour/HysTour.vue.d.ts +27 -0
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +33 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +100 -0
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +41 -0
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +70 -0
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +45 -0
- package/dist/types/composables/formContext.d.ts +24 -0
- package/dist/types/composables/overlayManager.d.ts +8 -0
- package/dist/types/composables/useDialog.d.ts +4 -0
- package/dist/types/composables/useFloating.d.ts +23 -0
- package/dist/types/composables/useRovingFocus.d.ts +7 -0
- package/dist/types/config.d.ts +15 -0
- package/dist/types/index.d.ts +90 -0
- package/dist/types/motion/useMotion.d.ts +3 -0
- package/package.json +21 -4
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { defineComponent as A, ref as v, computed as w, openBlock as s, createElementBlock as i, mergeProps as R, unref as b, createElementVNode as l, createVNode as D, toDisplayString as u, Fragment as f, renderList as M, renderSlot as z, nextTick as U } from "vue";
|
|
2
|
+
import { useHysRootAttrs as B } from "../../config.js";
|
|
3
|
+
import { ChevronLeft as E, ChevronRight as F } from "lucide-vue-next";
|
|
4
|
+
const H = { class: "hys-ui-pf-calendar-heading" }, L = ["aria-label"], P = {
|
|
5
|
+
class: "hys-ui-pf-calendar-period-title",
|
|
6
|
+
"aria-live": "polite"
|
|
7
|
+
}, V = ["aria-label", "title", "aria-pressed"], j = ["aria-label"], G = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hys-ui-pf-calendar-periods",
|
|
10
|
+
role: "group",
|
|
11
|
+
"aria-label": "年份选择"
|
|
12
|
+
}, I = ["aria-pressed", "disabled", "onClick"], J = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "hys-ui-pf-calendar-periods",
|
|
15
|
+
role: "group",
|
|
16
|
+
"aria-label": "月份选择"
|
|
17
|
+
}, K = ["aria-pressed", "disabled", "onClick"], X = /* @__PURE__ */ A({
|
|
18
|
+
__name: "HysCalendarNavigation",
|
|
19
|
+
props: {
|
|
20
|
+
month: {},
|
|
21
|
+
min: {},
|
|
22
|
+
max: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:month"],
|
|
25
|
+
setup(m, { emit: S }) {
|
|
26
|
+
const x = B(), o = m, p = S, n = v("days"), c = v(), r = w(() => o.month.getUTCFullYear()), d = v(Math.floor(r.value / 12) * 12), $ = w(() => Array.from({ length: 12 }, (e, t) => d.value + t));
|
|
27
|
+
function C(e) {
|
|
28
|
+
return (!o.min || e >= Number(o.min.slice(0, 4))) && (!o.max || e <= Number(o.max.slice(0, 4)));
|
|
29
|
+
}
|
|
30
|
+
function k(e) {
|
|
31
|
+
const t = String(r.value).padStart(4, "0") + "-" + String(e + 1).padStart(2, "0");
|
|
32
|
+
return (!o.min || t >= o.min.slice(0, 7)) && (!o.max || t <= o.max.slice(0, 7));
|
|
33
|
+
}
|
|
34
|
+
async function g() {
|
|
35
|
+
var t, a, h;
|
|
36
|
+
await U(), (h = ((t = c.value) == null ? void 0 : t.querySelector('.hys-ui-pf-calendar-periods button[aria-pressed="true"]:not(:disabled)')) || ((a = c.value) == null ? void 0 : a.querySelector(".hys-ui-pf-calendar-periods button:not(:disabled)"))) == null || h.focus();
|
|
37
|
+
}
|
|
38
|
+
function N() {
|
|
39
|
+
d.value = Math.floor(r.value / 12) * 12, n.value = "years", g();
|
|
40
|
+
}
|
|
41
|
+
function _() {
|
|
42
|
+
n.value = "months", g();
|
|
43
|
+
}
|
|
44
|
+
function T(e) {
|
|
45
|
+
if (n.value === "years") {
|
|
46
|
+
d.value += e * 12;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const t = n.value === "months" ? new Date(Date.UTC(r.value + e, o.month.getUTCMonth(), 1)) : new Date(Date.UTC(r.value, o.month.getUTCMonth() + e, 1));
|
|
50
|
+
p("update:month", t);
|
|
51
|
+
}
|
|
52
|
+
function Y(e) {
|
|
53
|
+
C(e) && (p("update:month", new Date(Date.UTC(e, o.month.getUTCMonth(), 1))), _());
|
|
54
|
+
}
|
|
55
|
+
async function y() {
|
|
56
|
+
var e, t;
|
|
57
|
+
n.value = "days", await U(), (t = (e = c.value) == null ? void 0 : e.querySelector("[data-date]:not(:disabled)")) == null || t.focus();
|
|
58
|
+
}
|
|
59
|
+
function q(e) {
|
|
60
|
+
k(e) && (p("update:month", new Date(Date.UTC(r.value, e, 1))), y());
|
|
61
|
+
}
|
|
62
|
+
return (e, t) => (s(), i("div", R(b(x), {
|
|
63
|
+
ref_key: "root",
|
|
64
|
+
ref: c
|
|
65
|
+
}), [
|
|
66
|
+
l("div", H, [
|
|
67
|
+
l("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
"aria-label": n.value === "years" ? "上一组年份" : n.value === "months" ? "上一年" : "上个月",
|
|
70
|
+
onClick: t[0] || (t[0] = (a) => T(-1))
|
|
71
|
+
}, [
|
|
72
|
+
D(b(E), {
|
|
73
|
+
size: 16,
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
})
|
|
76
|
+
], 8, L),
|
|
77
|
+
l("div", P, [
|
|
78
|
+
n.value === "years" ? (s(), i("button", {
|
|
79
|
+
key: 0,
|
|
80
|
+
type: "button",
|
|
81
|
+
"aria-label": "返回日期",
|
|
82
|
+
title: "返回日期面板",
|
|
83
|
+
onClick: y
|
|
84
|
+
}, u(d.value) + " — " + u(d.value + 11), 1)) : (s(), i(f, { key: 1 }, [
|
|
85
|
+
l("button", {
|
|
86
|
+
type: "button",
|
|
87
|
+
"aria-label": "选择年份",
|
|
88
|
+
onClick: N
|
|
89
|
+
}, u(r.value) + "年", 1),
|
|
90
|
+
l("button", {
|
|
91
|
+
type: "button",
|
|
92
|
+
"aria-label": n.value === "months" ? "返回日期" : "选择月份",
|
|
93
|
+
title: n.value === "months" ? "返回日期面板" : "选择月份",
|
|
94
|
+
"aria-pressed": n.value === "months",
|
|
95
|
+
onClick: t[1] || (t[1] = (a) => n.value === "months" ? y() : _())
|
|
96
|
+
}, u(m.month.getUTCMonth() + 1) + "月", 9, V)
|
|
97
|
+
], 64))
|
|
98
|
+
]),
|
|
99
|
+
l("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
"aria-label": n.value === "years" ? "下一组年份" : n.value === "months" ? "下一年" : "下个月",
|
|
102
|
+
onClick: t[2] || (t[2] = (a) => T(1))
|
|
103
|
+
}, [
|
|
104
|
+
D(b(F), {
|
|
105
|
+
size: 16,
|
|
106
|
+
"aria-hidden": "true"
|
|
107
|
+
})
|
|
108
|
+
], 8, j)
|
|
109
|
+
]),
|
|
110
|
+
n.value === "years" ? (s(), i("div", G, [
|
|
111
|
+
(s(!0), i(f, null, M($.value, (a) => (s(), i("button", {
|
|
112
|
+
key: a,
|
|
113
|
+
type: "button",
|
|
114
|
+
"aria-pressed": a === r.value,
|
|
115
|
+
disabled: !C(a),
|
|
116
|
+
onClick: (h) => Y(a)
|
|
117
|
+
}, u(a) + "年", 9, I))), 128))
|
|
118
|
+
])) : n.value === "months" ? (s(), i("div", J, [
|
|
119
|
+
(s(), i(f, null, M(12, (a) => l("button", {
|
|
120
|
+
key: a,
|
|
121
|
+
type: "button",
|
|
122
|
+
"aria-pressed": a - 1 === m.month.getUTCMonth(),
|
|
123
|
+
disabled: !k(a - 1),
|
|
124
|
+
onClick: (h) => q(a - 1)
|
|
125
|
+
}, u(a) + "月", 9, K)), 64))
|
|
126
|
+
])) : z(e.$slots, "default", {}, void 0, void 0, 2)
|
|
127
|
+
], 16));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export {
|
|
131
|
+
X as default
|
|
132
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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 a, createCommentVNode as i, normalizeStyle as c } from "vue";
|
|
2
|
+
import { useHysRootAttrs as h } from "../../config.js";
|
|
3
|
+
const m = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "hys-ui-card-head"
|
|
6
|
+
}, f = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "hys-ui-muted hys-ui-small"
|
|
9
|
+
}, b = ["aria-busy"], v = {
|
|
10
|
+
key: 0,
|
|
11
|
+
role: "status"
|
|
12
|
+
}, $ = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "hys-ui-card-foot"
|
|
15
|
+
}, z = /* @__PURE__ */ n({
|
|
16
|
+
__name: "HysCard",
|
|
17
|
+
props: {
|
|
18
|
+
title: {},
|
|
19
|
+
subtitle: {},
|
|
20
|
+
loading: { type: Boolean },
|
|
21
|
+
bordered: { type: Boolean },
|
|
22
|
+
shadow: {},
|
|
23
|
+
bodyStyle: {},
|
|
24
|
+
size: {}
|
|
25
|
+
},
|
|
26
|
+
setup(e) {
|
|
27
|
+
const r = h();
|
|
28
|
+
return (t, k) => (s(), o("section", u(y(r), {
|
|
29
|
+
class: ["hys-ui-card", ["hys-ui-card-shadow-" + (e.shadow || "never"), "hys-ui-card-size-" + (e.size || "md")]],
|
|
30
|
+
style: { border: e.bordered === !1 ? "0" : void 0 }
|
|
31
|
+
}), [
|
|
32
|
+
e.title || t.$slots.header || t.$slots.action ? (s(), o("header", m, [
|
|
33
|
+
l(t.$slots, "header", {}, () => [
|
|
34
|
+
d("div", null, [
|
|
35
|
+
d("h3", null, a(e.title), 1),
|
|
36
|
+
e.subtitle ? (s(), o("p", f, a(e.subtitle), 1)) : i("", !0)
|
|
37
|
+
])
|
|
38
|
+
], !0),
|
|
39
|
+
d("div", null, [
|
|
40
|
+
l(t.$slots, "action", {}, void 0, !0)
|
|
41
|
+
])
|
|
42
|
+
])) : i("", !0),
|
|
43
|
+
d("div", {
|
|
44
|
+
class: "hys-ui-card-content",
|
|
45
|
+
style: c(e.bodyStyle),
|
|
46
|
+
"aria-busy": e.loading
|
|
47
|
+
}, [
|
|
48
|
+
e.loading ? (s(), o("div", v, "加载中…")) : l(t.$slots, "default", {}, void 0, !0, 1)
|
|
49
|
+
], 12, b),
|
|
50
|
+
t.$slots.footer ? (s(), o("footer", $, [
|
|
51
|
+
l(t.$slots, "footer", {}, void 0, !0)
|
|
52
|
+
])) : i("", !0)
|
|
53
|
+
], 16));
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
export {
|
|
57
|
+
z as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { defineComponent as K, ref as g, watch as V, computed as x, openBlock as n, createElementBlock as u, mergeProps as q, unref as i, createElementVNode as L, toDisplayString as B, createVNode as M, createBlock as S, Teleport as P, withDirectives as W, vModelText as G, createCommentVNode as m, Fragment as D, renderList as E, renderSlot as I, createTextVNode as J } from "vue";
|
|
2
|
+
import { ChevronDown as Q, ChevronRight as X, Check as Y } from "lucide-vue-next";
|
|
3
|
+
import { useHysRootAttrs as Z } from "../../config.js";
|
|
4
|
+
import { useFloating as ee } from "../../composables/useFloating.js";
|
|
5
|
+
const le = ["disabled", "aria-expanded"], te = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "hys-ui-v4-scroll"
|
|
8
|
+
}, oe = ["onClick"], ae = { key: 0 }, re = {
|
|
9
|
+
key: 2,
|
|
10
|
+
class: "hys-ui-v4-columns"
|
|
11
|
+
}, ne = ["aria-label"], se = ["disabled", "aria-current", "onClick"], pe = /* @__PURE__ */ K({
|
|
12
|
+
__name: "HysCascader",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {},
|
|
15
|
+
options: {},
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
clearable: { type: Boolean },
|
|
18
|
+
filterable: { type: Boolean },
|
|
19
|
+
changeOnSelect: { type: Boolean },
|
|
20
|
+
showAllLevels: { type: Boolean, default: !0 },
|
|
21
|
+
separator: { default: " / " },
|
|
22
|
+
placeholder: { default: "选择分类" }
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue", "change", "clear"],
|
|
25
|
+
setup(y, { emit: H }) {
|
|
26
|
+
const r = y, w = H, $ = Z(), O = g(), C = g(), f = g(""), d = g([...r.modelValue]), { open: k, style: N, show: z, close: p } = ee(O, C, { matchWidth: !0 });
|
|
27
|
+
V(() => r.modelValue, (e) => d.value = [...e]), V(k, (e) => {
|
|
28
|
+
e && (d.value = [...r.modelValue], f.value = "");
|
|
29
|
+
}), V(() => r.disabled, (e) => {
|
|
30
|
+
e && p();
|
|
31
|
+
});
|
|
32
|
+
const T = x(() => {
|
|
33
|
+
var t;
|
|
34
|
+
const e = [r.options];
|
|
35
|
+
let l = r.options;
|
|
36
|
+
for (const o of d.value) {
|
|
37
|
+
const a = l.find((c) => c.value === o);
|
|
38
|
+
if (!((t = a == null ? void 0 : a.children) != null && t.length)) break;
|
|
39
|
+
l = a.children, e.push(l);
|
|
40
|
+
}
|
|
41
|
+
return e;
|
|
42
|
+
});
|
|
43
|
+
function A(e) {
|
|
44
|
+
w("update:modelValue", e), w("change", e);
|
|
45
|
+
}
|
|
46
|
+
function U(e, l) {
|
|
47
|
+
var t, o;
|
|
48
|
+
e.disabled || r.disabled || (d.value = [...d.value.slice(0, l), e.value], (r.changeOnSelect || !((t = e.children) != null && t.length)) && A(d.value), (o = e.children) != null && o.length || p(!0));
|
|
49
|
+
}
|
|
50
|
+
const _ = x(() => {
|
|
51
|
+
let e = r.options;
|
|
52
|
+
const l = r.modelValue.map((t) => {
|
|
53
|
+
const o = e.find((a) => a.value === t);
|
|
54
|
+
return e = (o == null ? void 0 : o.children) || [], (o == null ? void 0 : o.label) || t;
|
|
55
|
+
});
|
|
56
|
+
return r.showAllLevels ? l.join(r.separator) : l.at(-1);
|
|
57
|
+
}), R = x(() => {
|
|
58
|
+
const e = [];
|
|
59
|
+
function l(t, o = [], a = [], c = !1) {
|
|
60
|
+
var h;
|
|
61
|
+
for (const s of t) {
|
|
62
|
+
const v = c || s.disabled, b = [...o, s.label], j = [...a, s.value];
|
|
63
|
+
!v && (!((h = s.children) != null && h.length) || r.changeOnSelect) && b.join(r.separator).toLocaleLowerCase().includes(f.value.toLocaleLowerCase()) && e.push({ label: b.join(r.separator), path: j }), s.children && l(s.children, b, j, v);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return l(r.options), e;
|
|
67
|
+
});
|
|
68
|
+
function F(e) {
|
|
69
|
+
var o, a, c, h;
|
|
70
|
+
if (e.key === "Escape") {
|
|
71
|
+
e.preventDefault(), p(!0);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const l = document.activeElement, t = l == null ? void 0 : l.closest(".hys-ui-v4-level");
|
|
75
|
+
if (["ArrowUp", "ArrowDown", "Home", "End"].includes(e.key) && t) {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
const s = Array.from(t.querySelectorAll("button:not(:disabled)")), v = s.indexOf(l), b = e.key === "Home" ? 0 : e.key === "End" ? s.length - 1 : (v + (e.key === "ArrowUp" ? -1 : 1) + s.length) % s.length;
|
|
78
|
+
(o = s[b]) == null || o.focus();
|
|
79
|
+
} else if (["ArrowLeft", "ArrowRight"].includes(e.key)) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
const s = Array.from(((a = C.value) == null ? void 0 : a.querySelectorAll(".hys-ui-v4-level")) || []), v = s.indexOf(t);
|
|
82
|
+
(h = (c = s[v + (e.key === "ArrowRight" ? 1 : -1)]) == null ? void 0 : c.querySelector("button:not(:disabled)")) == null || h.focus();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return (e, l) => (n(), u("div", q(i($), { class: "hys-ui-v4-relative" }), [
|
|
86
|
+
L("button", {
|
|
87
|
+
ref_key: "trigger",
|
|
88
|
+
ref: O,
|
|
89
|
+
class: "hys-ui-v4-control hys-ui-pf-select-trigger",
|
|
90
|
+
type: "button",
|
|
91
|
+
disabled: y.disabled,
|
|
92
|
+
"aria-expanded": i(k),
|
|
93
|
+
"aria-haspopup": "dialog",
|
|
94
|
+
onClick: l[0] || (l[0] = (t) => i(k) ? i(p)() : i(z)())
|
|
95
|
+
}, [
|
|
96
|
+
L("span", null, B(_.value || y.placeholder), 1),
|
|
97
|
+
M(i(Q), {
|
|
98
|
+
size: 16,
|
|
99
|
+
class: "hys-ui-pf-select-chevron"
|
|
100
|
+
})
|
|
101
|
+
], 8, le),
|
|
102
|
+
(n(), S(P, { to: "body" }, [
|
|
103
|
+
i(k) ? (n(), u("div", q({
|
|
104
|
+
key: 0,
|
|
105
|
+
ref_key: "panel",
|
|
106
|
+
ref: C
|
|
107
|
+
}, i($), {
|
|
108
|
+
class: "hys-ui-v4-menu hys-ui-pf-select-menu",
|
|
109
|
+
style: i(N),
|
|
110
|
+
role: "dialog",
|
|
111
|
+
"aria-label": "级联选择",
|
|
112
|
+
onKeydown: F
|
|
113
|
+
}), [
|
|
114
|
+
y.filterable ? W((n(), u("input", {
|
|
115
|
+
key: 0,
|
|
116
|
+
"onUpdate:modelValue": l[1] || (l[1] = (t) => f.value = t),
|
|
117
|
+
class: "hys-ui-v4-control",
|
|
118
|
+
placeholder: "搜索分类",
|
|
119
|
+
"aria-label": "搜索分类"
|
|
120
|
+
}, null, 512)), [
|
|
121
|
+
[G, f.value]
|
|
122
|
+
]) : m("", !0),
|
|
123
|
+
f.value ? (n(), u("div", te, [
|
|
124
|
+
(n(!0), u(D, null, E(R.value, (t) => (n(), u("button", {
|
|
125
|
+
key: t.path.join("/"),
|
|
126
|
+
type: "button",
|
|
127
|
+
class: "hys-ui-v4-option",
|
|
128
|
+
onClick: (o) => {
|
|
129
|
+
A(t.path), i(p)(!0);
|
|
130
|
+
}
|
|
131
|
+
}, B(t.label), 9, oe))), 128)),
|
|
132
|
+
R.value.length ? m("", !0) : (n(), u("p", ae, "无匹配分类"))
|
|
133
|
+
])) : (n(), u("div", re, [
|
|
134
|
+
(n(!0), u(D, null, E(T.value, (t, o) => (n(), u("div", {
|
|
135
|
+
key: o,
|
|
136
|
+
class: "hys-ui-v4-scroll hys-ui-v4-level",
|
|
137
|
+
role: "group",
|
|
138
|
+
"aria-label": "第" + (o + 1) + "级"
|
|
139
|
+
}, [
|
|
140
|
+
(n(!0), u(D, null, E(t, (a) => {
|
|
141
|
+
var c;
|
|
142
|
+
return n(), u("button", {
|
|
143
|
+
key: a.value,
|
|
144
|
+
type: "button",
|
|
145
|
+
class: "hys-ui-v4-option",
|
|
146
|
+
disabled: a.disabled,
|
|
147
|
+
"aria-current": d.value[o] === a.value ? "true" : void 0,
|
|
148
|
+
onClick: (h) => U(a, o)
|
|
149
|
+
}, [
|
|
150
|
+
I(e.$slots, "option", { node: a }, () => [
|
|
151
|
+
J(B(a.label), 1)
|
|
152
|
+
]),
|
|
153
|
+
(c = a.children) != null && c.length ? (n(), S(i(X), {
|
|
154
|
+
key: 0,
|
|
155
|
+
size: 15
|
|
156
|
+
})) : d.value[o] === a.value ? (n(), S(i(Y), {
|
|
157
|
+
key: 1,
|
|
158
|
+
size: 15
|
|
159
|
+
})) : m("", !0)
|
|
160
|
+
], 8, se);
|
|
161
|
+
}), 128))
|
|
162
|
+
], 8, ne))), 128))
|
|
163
|
+
])),
|
|
164
|
+
y.clearable && y.modelValue.length ? (n(), u("button", {
|
|
165
|
+
key: 3,
|
|
166
|
+
type: "button",
|
|
167
|
+
class: "hys-ui-v4-option",
|
|
168
|
+
onClick: l[2] || (l[2] = (t) => {
|
|
169
|
+
A([]), w("clear"), i(p)(!0);
|
|
170
|
+
})
|
|
171
|
+
}, "清空选择")) : m("", !0),
|
|
172
|
+
L("button", {
|
|
173
|
+
type: "button",
|
|
174
|
+
class: "hys-ui-v4-option",
|
|
175
|
+
onClick: l[3] || (l[3] = (t) => i(p)(!0))
|
|
176
|
+
}, "关闭")
|
|
177
|
+
], 16)) : m("", !0)
|
|
178
|
+
]))
|
|
179
|
+
], 16));
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
export {
|
|
183
|
+
pe as default
|
|
184
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as y, computed as u, openBlock as a, createElementBlock as l, mergeProps as p, unref as v, normalizeStyle as i, Fragment as d, renderList as g, createElementVNode as o, toDisplayString as f } from "vue";
|
|
2
|
+
import { useHysRootAttrs as b } from "../../config.js";
|
|
3
|
+
const k = ["aria-label"], x = ["title"], w = ["points"], R = /* @__PURE__ */ y({
|
|
4
|
+
__name: "HysChart",
|
|
5
|
+
props: {
|
|
6
|
+
data: {},
|
|
7
|
+
type: { default: "bar" },
|
|
8
|
+
height: { default: 220 }
|
|
9
|
+
},
|
|
10
|
+
setup(t) {
|
|
11
|
+
const c = b(), s = t, r = u(() => Math.max(1, ...s.data.map((n) => n.value))), m = u(() => s.data.map((n, h) => `${(h + 0.5) / Math.max(1, s.data.length) * 100},${100 - n.value / r.value * 90}`).join(" "));
|
|
12
|
+
return (n, h) => (a(), l("div", p(v(c), {
|
|
13
|
+
class: "hys-ui-ent-panel",
|
|
14
|
+
role: "img",
|
|
15
|
+
"aria-label": t.data.map((e) => e.label + ": " + e.value).join(", ")
|
|
16
|
+
}), [
|
|
17
|
+
t.type === "bar" ? (a(), l("div", {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "hys-ui-ent-chart",
|
|
20
|
+
style: i({ height: t.height + "px" })
|
|
21
|
+
}, [
|
|
22
|
+
(a(!0), l(d, null, g(t.data, (e) => (a(), l("div", {
|
|
23
|
+
key: e.label,
|
|
24
|
+
class: "hys-ui-ent-chart-item"
|
|
25
|
+
}, [
|
|
26
|
+
o("span", {
|
|
27
|
+
style: i({ height: e.value / r.value * 90 + "%" }),
|
|
28
|
+
title: e.label + ": " + e.value
|
|
29
|
+
}, null, 12, x),
|
|
30
|
+
o("small", null, f(e.label), 1)
|
|
31
|
+
]))), 128))
|
|
32
|
+
], 4)) : (a(), l("svg", {
|
|
33
|
+
key: 1,
|
|
34
|
+
viewBox: "0 0 100 110",
|
|
35
|
+
preserveAspectRatio: "none",
|
|
36
|
+
style: i({ width: "100%", height: t.height + "px" })
|
|
37
|
+
}, [
|
|
38
|
+
o("polyline", {
|
|
39
|
+
points: m.value,
|
|
40
|
+
fill: "none",
|
|
41
|
+
stroke: "var(--hys-ui-primary,var(--hys-ui-theme-primary,#3674e9))",
|
|
42
|
+
"stroke-width": "2",
|
|
43
|
+
"vector-effect": "non-scaling-stroke"
|
|
44
|
+
}, null, 8, w)
|
|
45
|
+
], 4))
|
|
46
|
+
], 16, k));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
R as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { defineComponent as m, openBlock as n, createElementBlock as d, mergeProps as c, unref as u, createElementVNode as s, toDisplayString as b, createCommentVNode as h, renderSlot as y } from "vue";
|
|
2
|
+
import { useHysRootAttrs as k } from "../../config.js";
|
|
3
|
+
const f = ["name", "value", "required", "aria-label", "indeterminate", "aria-checked", "checked", "disabled"], g = { key: 0 }, q = /* @__PURE__ */ m({
|
|
4
|
+
__name: "HysCheckbox",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: { type: Boolean },
|
|
7
|
+
label: {},
|
|
8
|
+
disabled: { type: Boolean },
|
|
9
|
+
ariaLabel: {},
|
|
10
|
+
readonly: { type: Boolean },
|
|
11
|
+
name: {},
|
|
12
|
+
value: {},
|
|
13
|
+
required: { type: Boolean },
|
|
14
|
+
indeterminate: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
emits: ["update:modelValue", "change"],
|
|
17
|
+
setup(e, { emit: i }) {
|
|
18
|
+
const o = k(), a = i;
|
|
19
|
+
return (r, t) => (n(), d("label", c(u(o), { class: "hys-ui-check-label" }), [
|
|
20
|
+
s("input", {
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
name: e.name,
|
|
23
|
+
value: e.value,
|
|
24
|
+
required: e.required,
|
|
25
|
+
"aria-label": e.ariaLabel,
|
|
26
|
+
indeterminate: e.indeterminate,
|
|
27
|
+
"aria-checked": e.indeterminate ? "mixed" : e.modelValue,
|
|
28
|
+
checked: e.modelValue,
|
|
29
|
+
disabled: e.disabled || e.readonly,
|
|
30
|
+
onChange: t[0] || (t[0] = (l) => {
|
|
31
|
+
a("update:modelValue", l.target.checked), a("change", l.target.checked);
|
|
32
|
+
})
|
|
33
|
+
}, null, 40, f),
|
|
34
|
+
e.label ? (n(), d("span", g, b(e.label), 1)) : h("", !0),
|
|
35
|
+
y(r.$slots, "default")
|
|
36
|
+
], 16));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export {
|
|
40
|
+
q as default
|
|
41
|
+
};
|