hys-ui 0.1.0 → 0.2.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 +137 -1
- package/README.md +18 -6
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +268 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- 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 +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- 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 +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- 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 +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +859 -164
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- 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 +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- 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 +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +97 -78
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -1,266 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
role: "group",
|
|
6
|
-
"aria-label": "时间刻度"
|
|
7
|
-
}, re = ["aria-pressed", "onClick"], ue = { class: "hys-ui-pg-hint" }, de = { class: "hys-ui-pg-body" }, ce = ["onClick", "onKeydown"], he = ["title"], ve = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "hys-ui-pg-empty"
|
|
10
|
-
}, ye = { class: "hys-ui-pg-months" }, ge = { class: "hys-ui-pg-days" }, pe = ["aria-label", "title", "onClick", "onKeydown", "onPointerdown"], me = { class: "hys-ui-pg-bar-title" }, fe = ["onPointerdown"], we = ["onPointerdown"], be = ["width", "height"], ke = ["d"], xe = { class: "hys-ui-pg-footer" }, $e = { key: 0 }, j = 864e5, De = /* @__PURE__ */ te({
|
|
11
|
-
__name: "HysGantt",
|
|
12
|
-
props: {
|
|
13
|
-
items: {},
|
|
14
|
-
modelValue: {},
|
|
15
|
-
scale: { default: "day" },
|
|
16
|
-
editable: { type: Boolean, default: !1 },
|
|
17
|
-
rowHeight: { default: 46 },
|
|
18
|
-
labelWidth: { default: 270 }
|
|
19
|
-
},
|
|
20
|
-
emits: ["update:modelValue", "update:items", "change", "open"],
|
|
21
|
-
setup(d, { emit: q }) {
|
|
22
|
-
const J = se(), v = d, b = q, p = A(v.scale);
|
|
23
|
-
z(() => v.scale, (t) => p.value = t);
|
|
24
|
-
const P = A(v.modelValue ?? null);
|
|
25
|
-
z(() => v.modelValue, (t) => P.value = t ?? null);
|
|
26
|
-
const E = A(null), _ = /* @__PURE__ */ new Date();
|
|
27
|
-
_.setHours(0, 0, 0, 0);
|
|
28
|
-
function M(t) {
|
|
29
|
-
if (!/^\d{4}-\d{2}-\d{2}$/.test(t)) return null;
|
|
30
|
-
const [n, e, l] = t.split("-").map(Number), a = new Date(n, e - 1, l);
|
|
31
|
-
return a.getFullYear() === n && a.getMonth() === e - 1 && a.getDate() === l ? a : null;
|
|
32
|
-
}
|
|
33
|
-
function c(t) {
|
|
34
|
-
return Math.round((Date.UTC(t.getFullYear(), t.getMonth(), t.getDate()) - Date.UTC(1970, 0, 1)) / j);
|
|
35
|
-
}
|
|
36
|
-
function S(t) {
|
|
37
|
-
return new Date(t * j);
|
|
38
|
-
}
|
|
39
|
-
function V(t) {
|
|
40
|
-
return S(t).toISOString().slice(0, 10);
|
|
41
|
-
}
|
|
42
|
-
const h = m(() => v.items.map((t) => {
|
|
43
|
-
const n = M(t.start), e = M(t.end);
|
|
44
|
-
return !n || !e || c(e) < c(n) ? null : { ...t, s: c(n), e: c(e), progress: Math.min(100, Math.max(0, t.progress ?? 0)) };
|
|
45
|
-
}).filter((t) => t !== null)), u = m(() => p.value === "day" ? 36 : p.value === "week" ? 17 : p.value === "month" ? 7 : 36), f = m(() => {
|
|
46
|
-
const t = h.value.flatMap((e) => [e.s, e.e]), n = c(_);
|
|
47
|
-
return { start: Math.min(n - 7, ...t) - 7, end: Math.max(n + 21, ...t) + 14 };
|
|
48
|
-
}), I = m(() => f.value.end - f.value.start + 1), L = m(() => I.value * u.value), U = m(() => Array.from({ length: I.value }, (t, n) => f.value.start + n)), Q = m(() => {
|
|
49
|
-
const t = [];
|
|
50
|
-
for (let n = 0; n < U.value.length; n++) {
|
|
51
|
-
const e = S(U.value[n]), l = `${e.getUTCFullYear()}-${e.getUTCMonth()}`, a = t[t.length - 1];
|
|
52
|
-
(a == null ? void 0 : a.key) === l ? a.width += u.value : t.push({ key: l, label: `${e.getUTCFullYear()}年${e.getUTCMonth() + 1}月`, left: n * u.value, width: u.value });
|
|
53
|
-
}
|
|
54
|
-
return t;
|
|
55
|
-
}), R = m(() => new Map(h.value.map((t, n) => [String(t.id), { x: (t.s - f.value.start) * u.value, w: (t.e - t.s + 1) * u.value, y: n * v.rowHeight + v.rowHeight / 2 }]))), X = m(() => h.value.flatMap((t) => (t.dependencies ?? []).flatMap((n) => {
|
|
56
|
-
const e = R.value.get(String(n)), l = R.value.get(String(t.id));
|
|
57
|
-
return !e || !l || String(n) === String(t.id) ? [] : [{ id: `${n}-${t.id}`, path: `M ${e.x + e.w} ${e.y} H ${e.x + e.w + 9} V ${l.y} H ${l.x}` }];
|
|
58
|
-
})));
|
|
59
|
-
function F(t) {
|
|
60
|
-
P.value = t.id, b("update:modelValue", t.id), b("open", t);
|
|
61
|
-
}
|
|
62
|
-
function G() {
|
|
63
|
-
const t = E.value;
|
|
64
|
-
t && (t.scrollLeft = Math.max(0, (c(_) - f.value.start) * u.value - t.clientWidth / 3));
|
|
65
|
-
}
|
|
66
|
-
z(p, () => ne(G));
|
|
67
|
-
const w = A(null);
|
|
68
|
-
function K(t, n, e) {
|
|
69
|
-
!v.editable || n.disabled || t.button !== 0 || (t.preventDefault(), t.stopPropagation(), t.currentTarget.setPointerCapture(t.pointerId), w.value = { id: n.id, type: e, x: t.clientX, original: { ...n }, days: 0 }, P.value = n.id, b("update:modelValue", n.id));
|
|
70
|
-
}
|
|
71
|
-
function Y(t) {
|
|
72
|
-
w.value && (w.value.days = Math.round((t.clientX - w.value.x) / u.value));
|
|
73
|
-
}
|
|
74
|
-
function C(t) {
|
|
75
|
-
const n = w.value;
|
|
76
|
-
if (!n || (w.value = null, t.type === "pointercancel" || !n.days)) return;
|
|
77
|
-
const e = M(n.original.start), l = M(n.original.end);
|
|
78
|
-
if (!e || !l) return;
|
|
79
|
-
let a = c(e), i = c(l);
|
|
80
|
-
n.type === "move" ? (a += n.days, i += n.days) : n.type === "start" ? a = Math.min(i, a + n.days) : i = Math.max(a, i + n.days);
|
|
81
|
-
const N = { ...n.original, start: V(a), end: V(i) };
|
|
82
|
-
b("update:items", v.items.map((O) => String(O.id) === String(N.id) ? N : O)), b("change", N);
|
|
83
|
-
}
|
|
84
|
-
function Z(t) {
|
|
85
|
-
const n = w.value;
|
|
86
|
-
if (!n || String(n.id) !== String(t.id)) return { s: t.s, e: t.e };
|
|
87
|
-
const e = n.days;
|
|
88
|
-
return n.type === "move" ? { s: t.s + e, e: t.e + e } : n.type === "start" ? { s: Math.min(t.e, t.s + e), e: t.e } : { s: t.s, e: Math.max(t.s, t.e + e) };
|
|
89
|
-
}
|
|
90
|
-
function ee(t) {
|
|
91
|
-
const n = Z(t);
|
|
92
|
-
return { left: `${(n.s - f.value.start) * u.value}px`, width: `${Math.max(u.value, (n.e - n.s + 1) * u.value)}px`, background: t.color || "var(--hys-ui-primary,var(--hys-ui-theme-primary, #4776ed))" };
|
|
93
|
-
}
|
|
94
|
-
function W(t, n) {
|
|
95
|
-
if (!v.editable || t.disabled) return;
|
|
96
|
-
const e = M(t.start), l = M(t.end);
|
|
97
|
-
if (!e || !l) return;
|
|
98
|
-
const a = { ...t, start: V(c(e) + n), end: V(c(l) + n) };
|
|
99
|
-
b("update:items", v.items.map((i) => String(i.id) === String(t.id) ? a : i)), b("change", a);
|
|
100
|
-
}
|
|
101
|
-
return (t, n) => (o(), r("section", le(B(J), {
|
|
102
|
-
class: "hys-ui-pg-gantt",
|
|
103
|
-
"aria-label": "项目甘特图"
|
|
104
|
-
}), [
|
|
105
|
-
s("div", ie, [
|
|
106
|
-
s("div", oe, [
|
|
107
|
-
(o(), r(k, null, x(["day", "week", "month"], (e) => s("button", {
|
|
108
|
-
key: e,
|
|
109
|
-
type: "button",
|
|
110
|
-
"aria-pressed": p.value === e,
|
|
111
|
-
class: T({ "hys-ui-active": p.value === e }),
|
|
112
|
-
onClick: (l) => p.value = e
|
|
113
|
-
}, y(e === "day" ? "日" : e === "week" ? "周" : "月"), 11, re)), 64))
|
|
114
|
-
]),
|
|
115
|
-
s("button", {
|
|
116
|
-
class: "hys-ui-pg-today",
|
|
117
|
-
type: "button",
|
|
118
|
-
onClick: G
|
|
119
|
-
}, "定位今天"),
|
|
120
|
-
s("span", ue, y(d.editable ? "拖动任务条调整排期 · Alt + 左/右方向键微调日期" : "点击任务查看详情"), 1)
|
|
121
|
-
]),
|
|
122
|
-
s("div", de, [
|
|
123
|
-
s("div", {
|
|
124
|
-
class: "hys-ui-pg-labels",
|
|
125
|
-
style: g({ width: d.labelWidth + "px", minWidth: d.labelWidth + "px" })
|
|
126
|
-
}, [
|
|
127
|
-
n[0] || (n[0] = s("div", { class: "hys-ui-pg-label-head" }, "任务 / 负责人", -1)),
|
|
128
|
-
(o(!0), r(k, null, x(h.value, (e) => (o(), r("button", {
|
|
129
|
-
type: "button",
|
|
130
|
-
key: e.id,
|
|
131
|
-
class: T(["hys-ui-pg-task-label", { "hys-ui-selected": P.value === e.id }]),
|
|
132
|
-
style: g({ height: d.rowHeight + "px" }),
|
|
133
|
-
onClick: (l) => F(e),
|
|
134
|
-
onKeydown: [
|
|
135
|
-
D($((l) => W(e, -1), ["alt", "prevent"]), ["left"]),
|
|
136
|
-
D($((l) => W(e, 1), ["alt", "prevent"]), ["right"])
|
|
137
|
-
]
|
|
138
|
-
}, [
|
|
139
|
-
s("strong", {
|
|
140
|
-
title: e.title
|
|
141
|
-
}, y(e.title), 9, he),
|
|
142
|
-
s("small", null, y(e.owner || "未分配") + " · " + y(e.status || "待办"), 1)
|
|
143
|
-
], 46, ce))), 128)),
|
|
144
|
-
h.value.length ? H("", !0) : (o(), r("div", ve, "暂无有效排期任务"))
|
|
145
|
-
], 4),
|
|
146
|
-
s("div", {
|
|
147
|
-
ref_key: "scroller",
|
|
148
|
-
ref: E,
|
|
149
|
-
class: "hys-ui-pg-scroll",
|
|
150
|
-
tabindex: "0",
|
|
151
|
-
"aria-label": "可横向滚动的甘特图时间轴"
|
|
152
|
-
}, [
|
|
153
|
-
s("div", {
|
|
154
|
-
class: "hys-ui-pg-canvas",
|
|
155
|
-
style: g({ width: L.value + "px" })
|
|
156
|
-
}, [
|
|
157
|
-
s("div", ye, [
|
|
158
|
-
(o(!0), r(k, null, x(Q.value, (e) => (o(), r("span", {
|
|
159
|
-
key: e.key,
|
|
160
|
-
style: g({ left: e.left + "px", width: e.width + "px" })
|
|
161
|
-
}, y(e.label), 5))), 128))
|
|
162
|
-
]),
|
|
163
|
-
s("div", ge, [
|
|
164
|
-
(o(!0), r(k, null, x(U.value, (e) => (o(), r("span", {
|
|
165
|
-
key: e,
|
|
166
|
-
class: T({ "hys-ui-weekend": [0, 6].includes(S(e).getUTCDay()), "hys-ui-today": e === c(B(_)) }),
|
|
167
|
-
style: g({ width: u.value + "px" })
|
|
168
|
-
}, y(p.value === "month" ? "" : S(e).getUTCDate()), 7))), 128))
|
|
169
|
-
]),
|
|
170
|
-
s("div", {
|
|
171
|
-
class: "hys-ui-pg-grid",
|
|
172
|
-
style: g({ height: h.value.length * d.rowHeight + "px" })
|
|
173
|
-
}, [
|
|
174
|
-
(o(!0), r(k, null, x(U.value, (e) => (o(), r("div", {
|
|
175
|
-
key: e,
|
|
176
|
-
class: T(["hys-ui-pg-day-column", { "hys-ui-weekend": [0, 6].includes(S(e).getUTCDay()) }]),
|
|
177
|
-
style: g({ left: (e - f.value.start) * u.value + "px", width: u.value + "px" })
|
|
178
|
-
}, null, 6))), 128)),
|
|
179
|
-
s("div", {
|
|
180
|
-
class: "hys-ui-pg-today-line",
|
|
181
|
-
style: g({ left: (c(B(_)) - f.value.start) * u.value + u.value / 2 + "px" })
|
|
182
|
-
}, null, 4),
|
|
183
|
-
(o(!0), r(k, null, x(h.value, (e, l) => {
|
|
184
|
-
var a;
|
|
185
|
-
return o(), r("div", {
|
|
186
|
-
key: e.id,
|
|
187
|
-
class: "hys-ui-pg-row",
|
|
188
|
-
style: g({ top: l * d.rowHeight + "px", height: d.rowHeight + "px" })
|
|
189
|
-
}, [
|
|
190
|
-
s("div", {
|
|
191
|
-
class: T(["hys-ui-pg-bar", { "hys-ui-selected": P.value === e.id, "hys-ui-dragging": ((a = w.value) == null ? void 0 : a.id) === e.id, "hys-ui-disabled": e.disabled }]),
|
|
192
|
-
style: g(ee(e)),
|
|
193
|
-
role: "button",
|
|
194
|
-
tabindex: "0",
|
|
195
|
-
"aria-label": `${e.title},${e.start} 至 ${e.end},完成 ${e.progress}%`,
|
|
196
|
-
title: `${e.title}
|
|
197
|
-
${e.start} → ${e.end}
|
|
198
|
-
完成 ${e.progress}%`,
|
|
199
|
-
onClick: (i) => F(e),
|
|
200
|
-
onKeydown: [
|
|
201
|
-
D((i) => F(e), ["enter"]),
|
|
202
|
-
D($((i) => F(e), ["prevent"]), ["space"]),
|
|
203
|
-
D($((i) => W(e, -1), ["alt", "prevent"]), ["left"]),
|
|
204
|
-
D($((i) => W(e, 1), ["alt", "prevent"]), ["right"])
|
|
205
|
-
],
|
|
206
|
-
onPointerdown: (i) => K(i, e, "move"),
|
|
207
|
-
onPointermove: Y,
|
|
208
|
-
onPointerup: C,
|
|
209
|
-
onPointercancel: C
|
|
210
|
-
}, [
|
|
211
|
-
s("div", {
|
|
212
|
-
class: "hys-ui-pg-progress",
|
|
213
|
-
style: g({ width: e.progress + "%" })
|
|
214
|
-
}, null, 4),
|
|
215
|
-
s("span", me, y(e.progress) + "%", 1),
|
|
216
|
-
d.editable && !e.disabled ? (o(), r("span", {
|
|
217
|
-
key: 0,
|
|
218
|
-
class: "hys-ui-pg-handle hys-ui-start",
|
|
219
|
-
title: "调整开始日期",
|
|
220
|
-
onPointerdown: $((i) => K(i, e, "start"), ["stop"]),
|
|
221
|
-
onPointermove: Y,
|
|
222
|
-
onPointerup: C,
|
|
223
|
-
onPointercancel: C
|
|
224
|
-
}, null, 40, fe)) : H("", !0),
|
|
225
|
-
d.editable && !e.disabled ? (o(), r("span", {
|
|
226
|
-
key: 1,
|
|
227
|
-
class: "hys-ui-pg-handle hys-ui-end",
|
|
228
|
-
title: "调整结束日期",
|
|
229
|
-
onPointerdown: $((i) => K(i, e, "end"), ["stop"]),
|
|
230
|
-
onPointermove: Y,
|
|
231
|
-
onPointerup: C,
|
|
232
|
-
onPointercancel: C
|
|
233
|
-
}, null, 40, we)) : H("", !0)
|
|
234
|
-
], 46, pe)
|
|
235
|
-
], 4);
|
|
236
|
-
}), 128)),
|
|
237
|
-
X.value.length ? (o(), r("svg", {
|
|
238
|
-
key: 0,
|
|
239
|
-
class: "hys-ui-pg-dependencies",
|
|
240
|
-
width: L.value,
|
|
241
|
-
height: h.value.length * d.rowHeight,
|
|
242
|
-
"aria-hidden": "true"
|
|
243
|
-
}, [
|
|
244
|
-
(o(!0), r(k, null, x(X.value, (e) => (o(), r("path", {
|
|
245
|
-
key: e.id,
|
|
246
|
-
d: e.path,
|
|
247
|
-
fill: "none",
|
|
248
|
-
stroke: "currentColor",
|
|
249
|
-
"stroke-width": "1.5",
|
|
250
|
-
"stroke-dasharray": "4 3"
|
|
251
|
-
}, null, 8, ke))), 128))
|
|
252
|
-
], 8, be)) : H("", !0)
|
|
253
|
-
], 4)
|
|
254
|
-
], 4)
|
|
255
|
-
], 512)
|
|
256
|
-
]),
|
|
257
|
-
s("div", xe, [
|
|
258
|
-
ae(y(h.value.length) + " 项任务 · " + y(h.value.filter((e) => e.status === "已完成").length) + " 项已完成 ", 1),
|
|
259
|
-
h.value.length !== d.items.length ? (o(), r("span", $e, "· " + y(d.items.length - h.value.length) + " 项日期无效已隐藏", 1)) : H("", !0)
|
|
260
|
-
])
|
|
261
|
-
], 16));
|
|
262
|
-
}
|
|
263
|
-
});
|
|
1
|
+
import t from "./HysGantt2.vue.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-316ac1a0"]]);
|
|
264
5
|
export {
|
|
265
|
-
|
|
6
|
+
p as default
|
|
266
7
|
};
|