@oneflowui/ui 0.4.2 → 0.4.3
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/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/ContextMenu/index.vue.js +7 -0
- package/dist/components/ContextMenu/index.vue2.js +91 -0
- package/dist/components/Dashboard/charts/BarChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/BarChart.vue2.js +43 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue.js +23 -0
- package/dist/components/Dashboard/charts/DoughnutChart.vue2.js +4 -0
- package/dist/components/Dashboard/charts/NumberCard.vue.js +7 -0
- package/dist/components/Dashboard/charts/NumberCard.vue2.js +41 -0
- package/dist/components/Dashboard/charts/PieChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/PieChart.vue2.js +53 -0
- package/dist/components/Dashboard/charts/TableChart.vue.js +7 -0
- package/dist/components/Dashboard/charts/TableChart.vue2.js +50 -0
- package/dist/components/Dashboard/index.vue.js +7 -0
- package/dist/components/Dashboard/index.vue2.js +104 -0
- package/dist/components/ai/AiMessageBubble.vue.js +7 -0
- package/dist/components/ai/AiMessageBubble.vue2.js +47 -0
- package/dist/components/ai/AiMessageList.vue.js +7 -0
- package/dist/components/ai/AiMessageList.vue2.js +78 -0
- package/dist/components/ai/AiSender.vue.js +7 -0
- package/dist/components/ai/AiSender.vue2.js +86 -0
- package/dist/components/ai/AiStreamingCursor.vue.js +7 -0
- package/dist/components/ai/AiStreamingCursor.vue2.js +16 -0
- package/dist/components/ai/AiThinking.vue.js +7 -0
- package/dist/components/ai/AiThinking.vue2.js +19 -0
- package/dist/components/ai/UserMessageBubble.vue.js +7 -0
- package/dist/components/ai/UserMessageBubble.vue2.js +34 -0
- package/dist/components/auxiliary/ColorPanel.vue.js +7 -0
- package/dist/components/auxiliary/ColorPanel.vue2.js +65 -0
- package/dist/components/auxiliary/FileUpload.vue.js +7 -0
- package/dist/components/auxiliary/FileUpload.vue2.js +90 -0
- package/dist/components/auxiliary/PersonPanel.vue.js +7 -0
- package/dist/components/auxiliary/PersonPanel.vue2.js +66 -0
- package/dist/components/base/Accordion.vue.js +7 -0
- package/dist/components/base/Accordion.vue2.js +78 -0
- package/dist/components/base/AddViewBtn.vue.js +7 -0
- package/dist/components/base/AddViewBtn.vue2.js +25 -0
- package/dist/components/base/Avatar.vue.js +7 -0
- package/dist/components/base/Avatar.vue2.js +72 -0
- package/dist/components/base/Badge.vue.js +7 -0
- package/dist/components/base/Badge.vue2.js +70 -0
- package/dist/components/base/ButtonGroup.vue.js +7 -0
- package/dist/components/base/ButtonGroup.vue2.js +40 -0
- package/dist/components/base/ChainItem.vue.js +7 -0
- package/dist/components/base/ChainItem.vue2.js +68 -0
- package/dist/components/base/DescBlock.vue.js +7 -0
- package/dist/components/base/DescBlock.vue2.js +13 -0
- package/dist/components/base/DropdownMenu.vue.js +7 -0
- package/dist/components/base/DropdownMenu.vue2.js +92 -0
- package/dist/components/base/EmptyState.vue.js +7 -0
- package/dist/components/base/EmptyState.vue2.js +38 -0
- package/dist/components/base/InfoCard.vue.js +7 -0
- package/dist/components/base/InfoCard.vue2.js +167 -0
- package/dist/components/base/MonitorItem.vue.js +7 -0
- package/dist/components/base/MonitorItem.vue2.js +56 -0
- package/dist/components/base/PersonaCard.vue.js +7 -0
- package/dist/components/base/PersonaCard.vue2.js +173 -0
- package/dist/components/base/ProgressBar.vue.js +7 -0
- package/dist/components/base/ProgressBar.vue2.js +49 -0
- package/dist/components/base/RangeSlider.vue.js +7 -0
- package/dist/components/base/RangeSlider.vue2.js +35 -0
- package/dist/components/base/RefTag.vue.js +7 -0
- package/dist/components/base/RefTag.vue2.js +52 -0
- package/dist/components/base/SectionBlock.vue.js +7 -0
- package/dist/components/base/SectionBlock.vue2.js +115 -0
- package/dist/components/base/SelectBadge.vue.js +7 -0
- package/dist/components/base/SelectBadge.vue2.js +81 -0
- package/dist/components/base/StatisticCard.vue.js +7 -0
- package/dist/components/base/StatisticCard.vue2.js +57 -0
- package/dist/components/base/StatusIndicator.vue.js +7 -0
- package/dist/components/base/StatusIndicator.vue2.js +54 -0
- package/dist/components/base/StatusSummary.vue.js +7 -0
- package/dist/components/base/StatusSummary.vue2.js +64 -0
- package/dist/components/base/Stepper.vue.js +7 -0
- package/dist/components/base/Stepper.vue2.js +70 -0
- package/dist/components/base/Switch.vue.js +7 -0
- package/dist/components/base/Switch.vue2.js +43 -0
- package/dist/components/base/ToolbarBtn.vue.js +7 -0
- package/dist/components/base/ToolbarBtn.vue2.js +30 -0
- package/dist/components/base/ViewModeGroup.vue.js +7 -0
- package/dist/components/base/ViewModeGroup.vue2.js +32 -0
- package/dist/components/base/ViewSwitcher.vue.js +7 -0
- package/dist/components/base/ViewSwitcher.vue2.js +73 -0
- package/dist/components/base/ViewTab.vue.js +7 -0
- package/dist/components/base/ViewTab.vue2.js +42 -0
- package/dist/components/breadcrumb/Breadcrumb.vue.js +7 -0
- package/dist/components/breadcrumb/Breadcrumb.vue2.js +52 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +7 -0
- package/dist/components/breadcrumb/BreadcrumbItem.vue2.js +35 -0
- package/dist/components/detail/CommentItem.vue.js +7 -0
- package/dist/components/detail/CommentItem.vue2.js +29 -0
- package/dist/components/detail/DetailLayout.vue.js +7 -0
- package/dist/components/detail/DetailLayout.vue2.js +118 -0
- package/dist/components/detail/PropPanel.vue.js +7 -0
- package/dist/components/detail/PropPanel.vue2.js +51 -0
- package/dist/components/detail/PropRow.vue.js +7 -0
- package/dist/components/detail/PropRow.vue2.js +51 -0
- package/dist/components/editor/BlockQuote.vue.js +7 -0
- package/dist/components/editor/BlockQuote.vue2.js +45 -0
- package/dist/components/editor/CodeBlock.vue.js +7 -0
- package/dist/components/editor/CodeBlock.vue2.js +48 -0
- package/dist/components/editor/ContentBlock.vue.js +7 -0
- package/dist/components/editor/ContentBlock.vue2.js +49 -0
- package/dist/components/editor/RefLink.vue.js +7 -0
- package/dist/components/editor/RefLink.vue2.js +37 -0
- package/dist/components/editor/RichTextEditor.vue.js +7 -0
- package/dist/components/editor/RichTextEditor.vue2.js +132 -0
- package/dist/components/field/FieldCheckbox.vue.js +7 -0
- package/dist/{FieldCheckbox-CV3QtQ4Y.js → components/field/FieldCheckbox.vue2.js} +8 -9
- package/dist/components/field/FieldDate.vue.js +7 -0
- package/dist/{FieldDate-Bljx4jb7.js → components/field/FieldDate.vue2.js} +9 -10
- package/dist/components/field/FieldDatetime.vue.js +7 -0
- package/dist/{FieldDatetime-B52GfWrK.js → components/field/FieldDatetime.vue2.js} +11 -12
- package/dist/components/field/FieldEmail.vue.js +7 -0
- package/dist/{FieldEmail-UREMoue-.js → components/field/FieldEmail.vue2.js} +12 -13
- package/dist/components/field/FieldMultiSelect.vue.js +7 -0
- package/dist/{FieldMultiSelect-Dlay1Fop.js → components/field/FieldMultiSelect.vue2.js} +32 -33
- package/dist/components/field/FieldNumber.vue.js +7 -0
- package/dist/{FieldNumber-BjhfFhs6.js → components/field/FieldNumber.vue2.js} +8 -9
- package/dist/components/field/FieldRating.vue.js +7 -0
- package/dist/components/field/FieldRating.vue2.js +31 -0
- package/dist/components/field/FieldSelect.vue.js +7 -0
- package/dist/{FieldSelect-B39Ad8VH.js → components/field/FieldSelect.vue2.js} +34 -35
- package/dist/components/field/FieldText.vue.js +7 -0
- package/dist/{FieldText-Ry7f72Ug.js → components/field/FieldText.vue2.js} +13 -14
- package/dist/components/field/FieldUrl.vue.js +7 -0
- package/dist/components/field/FieldUrl.vue2.js +33 -0
- package/dist/components/form/FormDesigner.vue.js +7 -0
- package/dist/components/form/FormDesigner.vue2.js +245 -0
- package/dist/components/gallery/GalleryCard.vue.js +7 -0
- package/dist/components/gallery/GalleryCard.vue2.js +87 -0
- package/dist/components/gallery/GalleryView.vue.js +7 -0
- package/dist/components/gallery/GalleryView.vue2.js +48 -0
- package/dist/components/kanban/KanbanBoard.vue.js +7 -0
- package/dist/components/kanban/KanbanBoard.vue2.js +86 -0
- package/dist/components/kanban/KanbanCard.vue.js +7 -0
- package/dist/components/kanban/KanbanCard.vue2.js +56 -0
- package/dist/components/kanban/KanbanColumn.vue.js +7 -0
- package/dist/components/kanban/KanbanColumn.vue2.js +103 -0
- package/dist/components/kanban/QuickAddRow.vue.js +7 -0
- package/dist/components/kanban/QuickAddRow.vue2.js +58 -0
- package/dist/components/layout/AppLayout.vue.js +7 -0
- package/dist/components/layout/AppLayout.vue2.js +98 -0
- package/dist/components/layout/Navbar.vue.js +7 -0
- package/dist/components/layout/Navbar.vue2.js +70 -0
- package/dist/components/layout/Sidebar.vue.js +7 -0
- package/dist/components/layout/Sidebar.vue2.js +88 -0
- package/dist/components/layout/StatusBar.vue.js +7 -0
- package/dist/components/layout/StatusBar.vue2.js +37 -0
- package/dist/components/mermaid/MermaidChart.vue.js +7 -0
- package/dist/components/mermaid/MermaidChart.vue2.js +75 -0
- package/dist/components/overlay/Dialog.vue.js +7 -0
- package/dist/components/overlay/Dialog.vue2.js +89 -0
- package/dist/components/overlay/Drawer.vue.js +7 -0
- package/dist/components/overlay/Drawer.vue2.js +112 -0
- package/dist/components/overlay/Modal.vue.js +7 -0
- package/dist/components/overlay/Modal.vue2.js +115 -0
- package/dist/components/overlay/SidePanel.vue.js +7 -0
- package/dist/components/overlay/SidePanel.vue2.js +137 -0
- package/dist/components/split/SplitPane.vue.js +8 -0
- package/dist/components/split/SplitPane.vue2.js +68 -0
- package/dist/components/table/DataTable.vue.js +7 -0
- package/dist/components/table/DataTable.vue2.js +234 -0
- package/dist/components/table/FieldCell.vue.js +7 -0
- package/dist/components/table/FieldCell.vue2.js +71 -0
- package/dist/components/table/NewRowBtn.vue.js +7 -0
- package/dist/components/table/NewRowBtn.vue2.js +22 -0
- package/dist/components/table/TableColumnManager.vue.js +7 -0
- package/dist/components/table/TableColumnManager.vue2.js +100 -0
- package/dist/components/table/TableDataRow.vue.js +7 -0
- package/dist/components/table/TableDataRow.vue2.js +115 -0
- package/dist/components/table/TableFilterPanel.vue.js +7 -0
- package/dist/components/table/TableFilterPanel.vue2.js +142 -0
- package/dist/components/table/TableGroupRow.vue.js +7 -0
- package/dist/components/table/TableGroupRow.vue2.js +48 -0
- package/dist/components/table/TableHeaderRow.vue.js +7 -0
- package/dist/components/table/TableHeaderRow.vue2.js +69 -0
- package/dist/components/tabs/TabPanel.vue.js +7 -0
- package/dist/components/tabs/TabPanel.vue2.js +26 -0
- package/dist/components/tabs/Tabs.vue.js +7 -0
- package/dist/components/tabs/Tabs.vue2.js +87 -0
- package/dist/components/timeline/ActivityTimeline.vue.js +7 -0
- package/dist/components/timeline/ActivityTimeline.vue2.js +104 -0
- package/dist/components/timeline/GanttRow.vue.js +7 -0
- package/dist/components/timeline/GanttRow.vue2.js +110 -0
- package/dist/components/timeline/GanttTimeline.vue.js +7 -0
- package/dist/components/timeline/GanttTimeline.vue2.js +185 -0
- package/dist/components/toast/ToastContainer.vue.js +34 -0
- package/dist/components/toast/ToastContainer.vue3.js +5 -0
- package/dist/components/toast/ToastItem.vue.js +7 -0
- package/dist/components/toast/ToastItem.vue2.js +78 -0
- package/dist/composables/useAiChat.js +103 -0
- package/dist/composables/useBadge.js +76 -0
- package/dist/composables/useBreakpoint.js +16 -0
- package/dist/composables/useInlineEdit.js +28 -0
- package/dist/composables/useMarkdown.js +69 -0
- package/dist/composables/useStream.js +80 -0
- package/dist/composables/useTable.js +115 -0
- package/dist/composables/useTableColumns.js +24 -0
- package/dist/composables/useTableData.js +16 -0
- package/dist/composables/useTableFilter.js +97 -0
- package/dist/composables/useTableGroup.js +46 -0
- package/dist/composables/useToast.js +38 -0
- package/dist/composables/useTypewriter.js +56 -0
- package/dist/composables/useVirtualList.js +117 -0
- package/dist/constants/table.js +11 -0
- package/dist/index.js +301 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +5 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +377 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +923 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +151 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +240 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +658 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +38 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +216 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +13 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +399 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +305 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +615 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +753 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +219 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +183 -0
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +1063 -0
- package/dist/style.css +1 -1
- package/dist/types/index.js +77 -0
- package/dist/utils/icon.js +15 -0
- package/package.json +13 -6
- package/dist/FieldRating-BKHUu-A1.js +0 -32
- package/dist/FieldUrl-bv0EB9sh.js +0 -34
- package/dist/index-DQph5iTq.js +0 -12936
- package/dist/oneflow-ui.js +0 -111
- package/dist/oneflow-ui.umd.cjs +0 -13
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { defineComponent as V, openBlock as o, createElementBlock as n, createElementVNode as i, createVNode as r, unref as c, Fragment as d, renderList as f, normalizeClass as _, toDisplayString as v, createTextVNode as $, createCommentVNode as p } from "vue";
|
|
2
|
+
import { X as T, Trash2 as q, Plus as z } from "lucide-vue-next";
|
|
3
|
+
const x = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-filter-panel"
|
|
6
|
+
}, B = { class: "of-filter-panel__header" }, I = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "of-filter-panel__empty"
|
|
9
|
+
}, O = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "of-filter-panel__conditions"
|
|
12
|
+
}, P = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "of-filter-condition__logic-label"
|
|
15
|
+
}, S = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "of-filter-condition__logic-group"
|
|
18
|
+
}, w = ["value", "onChange"], E = ["value"], F = ["value", "onChange"], D = ["value"], G = ["value", "onInput"], L = {
|
|
19
|
+
key: 3,
|
|
20
|
+
class: "of-filter-condition__no-value"
|
|
21
|
+
}, R = ["onClick"], X = { class: "of-filter-panel__footer" }, H = /* @__PURE__ */ V({
|
|
22
|
+
__name: "TableFilterPanel",
|
|
23
|
+
props: {
|
|
24
|
+
columns: {},
|
|
25
|
+
conditions: {},
|
|
26
|
+
logic: {},
|
|
27
|
+
visible: { type: Boolean, default: !0 }
|
|
28
|
+
},
|
|
29
|
+
emits: ["add-condition", "remove-condition", "update-condition", "update:logic", "clear", "close"],
|
|
30
|
+
setup(s, { emit: b }) {
|
|
31
|
+
const m = s, a = b, y = [
|
|
32
|
+
{ value: "contains", label: "包含" },
|
|
33
|
+
{ value: "not_contains", label: "不包含" },
|
|
34
|
+
{ value: "equals", label: "等于" },
|
|
35
|
+
{ value: "not_equals", label: "不等于" },
|
|
36
|
+
{ value: "starts_with", label: "开头是" },
|
|
37
|
+
{ value: "ends_with", label: "结尾是" },
|
|
38
|
+
{ value: "is_empty", label: "为空" },
|
|
39
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
40
|
+
];
|
|
41
|
+
function g(u) {
|
|
42
|
+
var e;
|
|
43
|
+
return (e = m.columns.find((l) => l.key === u)) == null ? void 0 : e.type;
|
|
44
|
+
}
|
|
45
|
+
function k(u) {
|
|
46
|
+
return g(u) === "number" ? [
|
|
47
|
+
{ value: "equals", label: "等于" },
|
|
48
|
+
{ value: "not_equals", label: "不等于" },
|
|
49
|
+
{ value: "gt", label: "大于" },
|
|
50
|
+
{ value: "gte", label: "大于等于" },
|
|
51
|
+
{ value: "lt", label: "小于" },
|
|
52
|
+
{ value: "lte", label: "小于等于" },
|
|
53
|
+
{ value: "is_empty", label: "为空" },
|
|
54
|
+
{ value: "is_not_empty", label: "不为空" }
|
|
55
|
+
] : y;
|
|
56
|
+
}
|
|
57
|
+
const C = ["is_empty", "is_not_empty"];
|
|
58
|
+
function h(u) {
|
|
59
|
+
return C.includes(u);
|
|
60
|
+
}
|
|
61
|
+
return (u, e) => s.visible ? (o(), n("div", x, [
|
|
62
|
+
i("div", B, [
|
|
63
|
+
e[5] || (e[5] = i("span", { class: "of-filter-panel__title" }, "筛选", -1)),
|
|
64
|
+
i("button", {
|
|
65
|
+
class: "of-filter-panel__close",
|
|
66
|
+
onClick: e[0] || (e[0] = (l) => a("close"))
|
|
67
|
+
}, [
|
|
68
|
+
r(c(T), { size: 14 })
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
s.conditions.length === 0 ? (o(), n("div", I, " 暂无筛选条件,点击下方添加 ")) : (o(), n("div", O, [
|
|
72
|
+
(o(!0), n(d, null, f(s.conditions, (l, N) => (o(), n("div", {
|
|
73
|
+
key: l.id,
|
|
74
|
+
class: "of-filter-condition"
|
|
75
|
+
}, [
|
|
76
|
+
N === 0 ? (o(), n("span", P, "当")) : (o(), n("span", S, [
|
|
77
|
+
i("button", {
|
|
78
|
+
class: _(["of-filter-condition__logic-btn", { active: s.logic === "and" }]),
|
|
79
|
+
onClick: e[1] || (e[1] = (t) => a("update:logic", "and"))
|
|
80
|
+
}, " 且 ", 2),
|
|
81
|
+
i("button", {
|
|
82
|
+
class: _(["of-filter-condition__logic-btn", { active: s.logic === "or" }]),
|
|
83
|
+
onClick: e[2] || (e[2] = (t) => a("update:logic", "or"))
|
|
84
|
+
}, " 或 ", 2)
|
|
85
|
+
])),
|
|
86
|
+
i("select", {
|
|
87
|
+
class: "of-filter-condition__select of-filter-condition__select--field",
|
|
88
|
+
value: l.field,
|
|
89
|
+
onChange: (t) => a("update-condition", l.id, { field: t.target.value })
|
|
90
|
+
}, [
|
|
91
|
+
(o(!0), n(d, null, f(s.columns, (t) => (o(), n("option", {
|
|
92
|
+
key: t.key,
|
|
93
|
+
value: t.key
|
|
94
|
+
}, v(t.label), 9, E))), 128))
|
|
95
|
+
], 40, w),
|
|
96
|
+
i("select", {
|
|
97
|
+
class: "of-filter-condition__select",
|
|
98
|
+
value: l.operator,
|
|
99
|
+
onChange: (t) => a("update-condition", l.id, {
|
|
100
|
+
operator: t.target.value
|
|
101
|
+
})
|
|
102
|
+
}, [
|
|
103
|
+
(o(!0), n(d, null, f(k(l.field), (t) => (o(), n("option", {
|
|
104
|
+
key: t.value,
|
|
105
|
+
value: t.value
|
|
106
|
+
}, v(t.label), 9, D))), 128))
|
|
107
|
+
], 40, F),
|
|
108
|
+
h(l.operator) ? (o(), n("span", L)) : (o(), n("input", {
|
|
109
|
+
key: 2,
|
|
110
|
+
class: "of-filter-condition__input",
|
|
111
|
+
value: l.value,
|
|
112
|
+
placeholder: "输入值...",
|
|
113
|
+
onInput: (t) => a("update-condition", l.id, { value: t.target.value })
|
|
114
|
+
}, null, 40, G)),
|
|
115
|
+
i("button", {
|
|
116
|
+
class: "of-filter-condition__remove",
|
|
117
|
+
onClick: (t) => a("remove-condition", l.id)
|
|
118
|
+
}, [
|
|
119
|
+
r(c(q), { size: 13 })
|
|
120
|
+
], 8, R)
|
|
121
|
+
]))), 128))
|
|
122
|
+
])),
|
|
123
|
+
i("div", X, [
|
|
124
|
+
i("button", {
|
|
125
|
+
class: "of-filter-panel__add-btn",
|
|
126
|
+
onClick: e[3] || (e[3] = (l) => a("add-condition"))
|
|
127
|
+
}, [
|
|
128
|
+
r(c(z), { size: 13 }),
|
|
129
|
+
e[6] || (e[6] = $(" 添加条件 ", -1))
|
|
130
|
+
]),
|
|
131
|
+
s.conditions.length ? (o(), n("button", {
|
|
132
|
+
key: 0,
|
|
133
|
+
class: "of-filter-panel__clear",
|
|
134
|
+
onClick: e[4] || (e[4] = (l) => a("clear"))
|
|
135
|
+
}, " 清除全部 ")) : p("", !0)
|
|
136
|
+
])
|
|
137
|
+
])) : p("", !0);
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
export {
|
|
141
|
+
H as default
|
|
142
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineComponent as m, computed as n, openBlock as o, createElementBlock as l, createCommentVNode as c, createElementVNode as u, normalizeClass as _, normalizeStyle as p, createTextVNode as f, toDisplayString as r } from "vue";
|
|
2
|
+
import { resolveBadge as y } from "../../composables/useBadge.js";
|
|
3
|
+
const v = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-table-group-row__checkbox-spacer"
|
|
6
|
+
}, w = {
|
|
7
|
+
key: 2,
|
|
8
|
+
class: "of-table-group-row__label"
|
|
9
|
+
}, k = { class: "of-table-group-row__count" }, C = /* @__PURE__ */ m({
|
|
10
|
+
name: "TableGroupRow",
|
|
11
|
+
__name: "TableGroupRow",
|
|
12
|
+
props: {
|
|
13
|
+
groupKey: {},
|
|
14
|
+
count: {},
|
|
15
|
+
collapsed: { type: Boolean, default: !1 },
|
|
16
|
+
colorMap: {},
|
|
17
|
+
selectable: { type: Boolean, default: !0 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["toggle"],
|
|
20
|
+
setup(t, { emit: d }) {
|
|
21
|
+
const a = t, g = d, e = n(() => a.colorMap ? y(a.groupKey, a.colorMap) : null), b = n(() => a.groupKey || "(空)");
|
|
22
|
+
return (i, s) => (o(), l("div", {
|
|
23
|
+
class: "of-table-group-row",
|
|
24
|
+
onClick: s[0] || (s[0] = (h) => g("toggle"))
|
|
25
|
+
}, [
|
|
26
|
+
t.selectable ? (o(), l("div", v)) : c("", !0),
|
|
27
|
+
u("span", {
|
|
28
|
+
class: _(["of-table-group-row__chevron", { "of-table-group-row__chevron--collapsed": t.collapsed }])
|
|
29
|
+
}, "▼", 2),
|
|
30
|
+
e.value ? (o(), l("span", {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "of-table-group-row__badge",
|
|
33
|
+
style: p(e.value.style)
|
|
34
|
+
}, [
|
|
35
|
+
e.value.dot ? (o(), l("span", {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "of-table-group-row__badge-dot",
|
|
38
|
+
style: p({ background: e.value.dot })
|
|
39
|
+
}, null, 4)) : c("", !0),
|
|
40
|
+
f(" " + r(e.value.label), 1)
|
|
41
|
+
], 4)) : (o(), l("span", w, r(b.value), 1)),
|
|
42
|
+
u("span", k, "(" + r(t.count) + ")", 1)
|
|
43
|
+
]));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
export {
|
|
47
|
+
C as default
|
|
48
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { defineComponent as u, openBlock as n, createElementBlock as a, createElementVNode as l, createCommentVNode as y, Fragment as k, renderList as b, normalizeStyle as v, normalizeClass as x, toDisplayString as C, createBlock as r, unref as i } from "vue";
|
|
2
|
+
import { ChevronUp as S, ChevronDown as d } from "lucide-vue-next";
|
|
3
|
+
const w = { class: "of-table-header" }, B = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "of-th of-th-checkbox"
|
|
6
|
+
}, g = ["checked", "indeterminate"], z = ["aria-sort", "onClick"], K = { class: "of-th-label" }, $ = { class: "of-th-sort-icon" }, N = /* @__PURE__ */ u({
|
|
7
|
+
__name: "TableHeaderRow",
|
|
8
|
+
props: {
|
|
9
|
+
columns: {},
|
|
10
|
+
selectable: { type: Boolean, default: !0 },
|
|
11
|
+
sortKey: { default: "" },
|
|
12
|
+
sortOrder: { default: "asc" },
|
|
13
|
+
allSelected: { type: Boolean, default: !1 },
|
|
14
|
+
indeterminate: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["sort", "select-all"],
|
|
17
|
+
setup(e, { emit: f }) {
|
|
18
|
+
const c = f;
|
|
19
|
+
function h(o) {
|
|
20
|
+
if (o.width === "fill") {
|
|
21
|
+
const s = `${o.minWidth ?? 220}px`;
|
|
22
|
+
return { flex: `1 1 ${s}`, minWidth: s };
|
|
23
|
+
}
|
|
24
|
+
return { width: `${o.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
25
|
+
}
|
|
26
|
+
function m(o) {
|
|
27
|
+
c("sort", o);
|
|
28
|
+
}
|
|
29
|
+
return (o, s) => (n(), a("div", w, [
|
|
30
|
+
e.selectable ? (n(), a("div", B, [
|
|
31
|
+
l("input", {
|
|
32
|
+
type: "checkbox",
|
|
33
|
+
class: "of-checkbox",
|
|
34
|
+
checked: e.allSelected,
|
|
35
|
+
indeterminate: e.indeterminate,
|
|
36
|
+
onChange: s[0] || (s[0] = (t) => c("select-all"))
|
|
37
|
+
}, null, 40, g)
|
|
38
|
+
])) : y("", !0),
|
|
39
|
+
(n(!0), a(k, null, b(e.columns, (t) => (n(), a("div", {
|
|
40
|
+
key: t.key,
|
|
41
|
+
role: "columnheader",
|
|
42
|
+
class: x(["of-th", { "of-th--sortable": !0, "of-th--active": e.sortKey === t.key }]),
|
|
43
|
+
style: v(h(t)),
|
|
44
|
+
"aria-sort": e.sortKey === t.key ? e.sortOrder === "asc" ? "ascending" : "descending" : "none",
|
|
45
|
+
onClick: (O) => m(t.key)
|
|
46
|
+
}, [
|
|
47
|
+
l("span", K, C(t.label), 1),
|
|
48
|
+
l("span", $, [
|
|
49
|
+
e.sortKey === t.key && e.sortOrder === "asc" ? (n(), r(i(S), {
|
|
50
|
+
key: 0,
|
|
51
|
+
size: 12,
|
|
52
|
+
class: "of-sort-icon-active"
|
|
53
|
+
})) : e.sortKey === t.key && e.sortOrder === "desc" ? (n(), r(i(d), {
|
|
54
|
+
key: 1,
|
|
55
|
+
size: 12,
|
|
56
|
+
class: "of-sort-icon-active"
|
|
57
|
+
})) : (n(), r(i(d), {
|
|
58
|
+
key: 2,
|
|
59
|
+
size: 12,
|
|
60
|
+
class: "of-sort-icon-idle"
|
|
61
|
+
}))
|
|
62
|
+
])
|
|
63
|
+
], 14, z))), 128))
|
|
64
|
+
]));
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
export {
|
|
68
|
+
N as default
|
|
69
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineComponent as o, inject as i, computed as d, withDirectives as c, openBlock as r, createElementBlock as u, renderSlot as v, vShow as m, createCommentVNode as s } from "vue";
|
|
2
|
+
const f = ["id", "aria-labelledby", "hidden"], k = /* @__PURE__ */ o({
|
|
3
|
+
__name: "TabPanel",
|
|
4
|
+
props: {
|
|
5
|
+
name: {},
|
|
6
|
+
keepAlive: { type: Boolean }
|
|
7
|
+
},
|
|
8
|
+
setup(e) {
|
|
9
|
+
const l = e, t = i("of-tabs-active"), a = d(() => (t == null ? void 0 : t.value) === l.name);
|
|
10
|
+
return (n, b) => e.keepAlive || a.value ? c((r(), u("div", {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "of-tab-panel",
|
|
13
|
+
role: "tabpanel",
|
|
14
|
+
id: `of-panel-${e.name}`,
|
|
15
|
+
"aria-labelledby": `of-tab-${e.name}`,
|
|
16
|
+
hidden: e.keepAlive && !a.value ? !0 : void 0
|
|
17
|
+
}, [
|
|
18
|
+
v(n.$slots, "default", {}, void 0, !0)
|
|
19
|
+
], 8, f)), [
|
|
20
|
+
[m, e.keepAlive ? a.value : !0]
|
|
21
|
+
]) : s("", !0);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
export {
|
|
25
|
+
k as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineComponent as h, ref as V, computed as w, provide as y, openBlock as l, createElementBlock as r, normalizeClass as m, createElementVNode as c, Fragment as D, renderList as x, createBlock as C, resolveDynamicComponent as $, unref as A, createCommentVNode as _, toDisplayString as v, renderSlot as T } from "vue";
|
|
2
|
+
import { resolveIcon as z } from "../../utils/icon.js";
|
|
3
|
+
const B = {
|
|
4
|
+
class: "of-tabs__nav",
|
|
5
|
+
role: "tablist",
|
|
6
|
+
"aria-label": "tabs"
|
|
7
|
+
}, E = ["disabled", "id", "aria-selected", "aria-controls", "aria-disabled", "tabindex", "onClick", "onKeydown"], I = { class: "of-tabs__tab-label" }, K = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "of-tabs__badge"
|
|
10
|
+
}, L = { class: "of-tabs__content" }, F = /* @__PURE__ */ h({
|
|
11
|
+
__name: "Tabs",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
14
|
+
defaultValue: {},
|
|
15
|
+
variant: {},
|
|
16
|
+
size: {},
|
|
17
|
+
tabs: {}
|
|
18
|
+
},
|
|
19
|
+
emits: ["update:modelValue", "change"],
|
|
20
|
+
setup(i, { emit: p }) {
|
|
21
|
+
var b;
|
|
22
|
+
const d = i, f = p, u = V(d.defaultValue || ((b = d.tabs[0]) == null ? void 0 : b.key) || ""), o = w({
|
|
23
|
+
get: () => d.modelValue ?? u.value,
|
|
24
|
+
set: (t) => {
|
|
25
|
+
u.value = t, f("update:modelValue", t), f("change", t);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
function s(t) {
|
|
29
|
+
o.value = t;
|
|
30
|
+
}
|
|
31
|
+
function g(t, k) {
|
|
32
|
+
const e = d.tabs.filter((a) => !a.disabled), n = e.findIndex((a) => a.key === k);
|
|
33
|
+
if (t.key === "ArrowRight" || t.key === "ArrowDown") {
|
|
34
|
+
t.preventDefault();
|
|
35
|
+
const a = e[(n + 1) % e.length];
|
|
36
|
+
a && s(a.key);
|
|
37
|
+
} else if (t.key === "ArrowLeft" || t.key === "ArrowUp") {
|
|
38
|
+
t.preventDefault();
|
|
39
|
+
const a = e[(n - 1 + e.length) % e.length];
|
|
40
|
+
a && s(a.key);
|
|
41
|
+
} else if (t.key === "Home") {
|
|
42
|
+
t.preventDefault();
|
|
43
|
+
const a = e[0];
|
|
44
|
+
a && s(a.key);
|
|
45
|
+
} else if (t.key === "End") {
|
|
46
|
+
t.preventDefault();
|
|
47
|
+
const a = e[e.length - 1];
|
|
48
|
+
a && s(a.key);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return y("of-tabs-active", o), y("of-tabs-set", s), (t, k) => (l(), r("div", {
|
|
52
|
+
class: m(["of-tabs", [`of-tabs--${i.variant || "line"}`, `of-tabs--${i.size || "md"}`]])
|
|
53
|
+
}, [
|
|
54
|
+
c("div", B, [
|
|
55
|
+
(l(!0), r(D, null, x(i.tabs, (e) => (l(), r("button", {
|
|
56
|
+
key: e.key,
|
|
57
|
+
class: m(["of-tabs__tab", {
|
|
58
|
+
"of-tabs__tab--active": o.value === e.key,
|
|
59
|
+
"of-tabs__tab--disabled": e.disabled
|
|
60
|
+
}]),
|
|
61
|
+
disabled: e.disabled,
|
|
62
|
+
role: "tab",
|
|
63
|
+
id: `of-tab-${e.key}`,
|
|
64
|
+
"aria-selected": o.value === e.key,
|
|
65
|
+
"aria-controls": `of-panel-${e.key}`,
|
|
66
|
+
"aria-disabled": e.disabled,
|
|
67
|
+
tabindex: o.value === e.key ? 0 : -1,
|
|
68
|
+
onClick: (n) => !e.disabled && s(e.key),
|
|
69
|
+
onKeydown: (n) => g(n, e.key)
|
|
70
|
+
}, [
|
|
71
|
+
e.icon ? (l(), C($(A(z)(e.icon)), {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: "of-tabs__tab-icon"
|
|
74
|
+
})) : _("", !0),
|
|
75
|
+
c("span", I, v(e.label), 1),
|
|
76
|
+
e.badge != null ? (l(), r("span", K, v(e.badge), 1)) : _("", !0)
|
|
77
|
+
], 42, E))), 128))
|
|
78
|
+
]),
|
|
79
|
+
c("div", L, [
|
|
80
|
+
T(t.$slots, "default", {}, void 0, !0)
|
|
81
|
+
])
|
|
82
|
+
], 2));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
export {
|
|
86
|
+
F as default
|
|
87
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { defineComponent as k, computed as g, openBlock as s, createElementBlock as o, Fragment as f, renderList as m, createElementVNode as e, createCommentVNode as n, normalizeStyle as u, renderSlot as h, toDisplayString as a } from "vue";
|
|
2
|
+
const b = ["aria-busy"], C = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "of-activity-timeline__skeleton",
|
|
5
|
+
"aria-hidden": "true"
|
|
6
|
+
}, N = { class: "of-activity-timeline__rail" }, $ = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "of-activity-timeline__line"
|
|
9
|
+
}, B = { class: "of-activity-timeline__rail" }, S = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "of-activity-timeline__line"
|
|
12
|
+
}, V = { class: "of-activity-timeline__content" }, w = { class: "of-activity-timeline__header" }, z = { class: "of-activity-timeline__action" }, D = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "of-activity-timeline__actor"
|
|
15
|
+
}, E = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "of-activity-timeline__detail"
|
|
18
|
+
}, M = {
|
|
19
|
+
key: 1,
|
|
20
|
+
class: "of-activity-timeline__progress"
|
|
21
|
+
}, A = { class: "of-activity-timeline__progress-track" }, F = { class: "of-activity-timeline__progress-value" }, I = {
|
|
22
|
+
key: 2,
|
|
23
|
+
class: "of-activity-timeline__time"
|
|
24
|
+
}, P = /* @__PURE__ */ k({
|
|
25
|
+
__name: "ActivityTimeline",
|
|
26
|
+
props: {
|
|
27
|
+
items: {},
|
|
28
|
+
loading: { type: Boolean, default: !1 }
|
|
29
|
+
},
|
|
30
|
+
setup(r) {
|
|
31
|
+
const p = r, d = [0, 1, 2], v = g(
|
|
32
|
+
() => p.items.map((i) => ({
|
|
33
|
+
...i,
|
|
34
|
+
status: i.status ?? "default"
|
|
35
|
+
}))
|
|
36
|
+
);
|
|
37
|
+
function y(i) {
|
|
38
|
+
return i === "done" ? "var(--of-color-success)" : i === "start" ? "var(--of-color-warning)" : "var(--of-color-info)";
|
|
39
|
+
}
|
|
40
|
+
function _(i) {
|
|
41
|
+
return typeof i != "number" || Number.isNaN(i) ? null : Math.min(100, Math.max(0, i));
|
|
42
|
+
}
|
|
43
|
+
return (i, l) => (s(), o("div", {
|
|
44
|
+
class: "of-activity-timeline",
|
|
45
|
+
"aria-busy": r.loading
|
|
46
|
+
}, [
|
|
47
|
+
r.loading ? (s(), o("div", C, [
|
|
48
|
+
(s(), o(f, null, m(d, (t) => e("div", {
|
|
49
|
+
key: t,
|
|
50
|
+
class: "of-activity-timeline__item of-activity-timeline__item--skeleton"
|
|
51
|
+
}, [
|
|
52
|
+
e("div", N, [
|
|
53
|
+
l[0] || (l[0] = e("span", { class: "of-activity-timeline__dot of-activity-timeline__dot--skeleton" }, null, -1)),
|
|
54
|
+
t < d.length - 1 ? (s(), o("span", $)) : n("", !0)
|
|
55
|
+
]),
|
|
56
|
+
l[1] || (l[1] = e("div", { class: "of-activity-timeline__content" }, [
|
|
57
|
+
e("span", { class: "of-activity-timeline__skeleton-bar of-activity-timeline__skeleton-bar--lg" }),
|
|
58
|
+
e("span", { class: "of-activity-timeline__skeleton-bar of-activity-timeline__skeleton-bar--md" }),
|
|
59
|
+
e("span", { class: "of-activity-timeline__skeleton-bar of-activity-timeline__skeleton-bar--sm" })
|
|
60
|
+
], -1))
|
|
61
|
+
])), 64))
|
|
62
|
+
])) : (s(!0), o(f, { key: 1 }, m(v.value, (t, c) => (s(), o("div", {
|
|
63
|
+
key: `${t.action}-${t.time ?? c}-${c}`,
|
|
64
|
+
class: "of-activity-timeline__item"
|
|
65
|
+
}, [
|
|
66
|
+
e("div", B, [
|
|
67
|
+
e("span", {
|
|
68
|
+
class: "of-activity-timeline__dot",
|
|
69
|
+
style: u({ backgroundColor: y(t.status) })
|
|
70
|
+
}, null, 4),
|
|
71
|
+
c < v.value.length - 1 ? (s(), o("span", S)) : n("", !0)
|
|
72
|
+
]),
|
|
73
|
+
e("div", V, [
|
|
74
|
+
h(i.$slots, "item", {
|
|
75
|
+
item: t,
|
|
76
|
+
index: c
|
|
77
|
+
}, () => [
|
|
78
|
+
e("div", w, [
|
|
79
|
+
e("span", z, a(t.action), 1),
|
|
80
|
+
t.actor ? (s(), o("span", D, a(t.actor), 1)) : n("", !0)
|
|
81
|
+
]),
|
|
82
|
+
t.detail ? (s(), o("p", E, a(t.detail), 1)) : n("", !0),
|
|
83
|
+
_(t.progress) !== null ? (s(), o("div", M, [
|
|
84
|
+
e("div", A, [
|
|
85
|
+
e("div", {
|
|
86
|
+
class: "of-activity-timeline__progress-fill",
|
|
87
|
+
style: u({
|
|
88
|
+
width: `${_(t.progress)}%`,
|
|
89
|
+
backgroundColor: y(t.status)
|
|
90
|
+
})
|
|
91
|
+
}, null, 4)
|
|
92
|
+
]),
|
|
93
|
+
e("span", F, a(_(t.progress)) + "% ", 1)
|
|
94
|
+
])) : n("", !0),
|
|
95
|
+
t.time ? (s(), o("p", I, a(t.time), 1)) : n("", !0)
|
|
96
|
+
], !0)
|
|
97
|
+
])
|
|
98
|
+
]))), 128))
|
|
99
|
+
], 8, b));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export {
|
|
103
|
+
P as default
|
|
104
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { defineComponent as W, ref as _, computed as r, openBlock as B, createElementBlock as T, createElementVNode as n, normalizeStyle as d, toDisplayString as y, normalizeClass as A } from "vue";
|
|
2
|
+
import { resolveBadge as h, mergeColorMap as M, DEFAULT_PRIORITY_MAP as z, DEFAULT_STATUS_MAP as R } from "../../composables/useBadge.js";
|
|
3
|
+
const U = { class: "gantt-row__label" }, X = { class: "gantt-row__title" }, F = { class: "gantt-row__bar-label" }, G = /* @__PURE__ */ W({
|
|
4
|
+
__name: "GanttRow",
|
|
5
|
+
props: {
|
|
6
|
+
item: {},
|
|
7
|
+
dayWidth: {},
|
|
8
|
+
offsetDays: {},
|
|
9
|
+
durationDays: {},
|
|
10
|
+
totalDays: {},
|
|
11
|
+
readonly: { type: Boolean, default: !1 },
|
|
12
|
+
priorityColorMap: {},
|
|
13
|
+
statusColorMap: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["click", "change"],
|
|
16
|
+
setup(s, { emit: b }) {
|
|
17
|
+
const t = s, u = b, l = _(!1), i = _(null);
|
|
18
|
+
let g = 0, D = 0, c = 0;
|
|
19
|
+
const C = r(() => t.totalDays * t.dayWidth), S = r(() => t.offsetDays * t.dayWidth), k = r(() => Math.max(t.durationDays, 1) * t.dayWidth), m = r(
|
|
20
|
+
() => h(
|
|
21
|
+
t.item.priority || "",
|
|
22
|
+
M(z, t.priorityColorMap)
|
|
23
|
+
)
|
|
24
|
+
), f = r(() => t.item.barColor ? { background: t.item.barColor, color: "var(--of-color-gray-800)" } : {
|
|
25
|
+
background: m.value.style.background,
|
|
26
|
+
color: m.value.style.color
|
|
27
|
+
}), x = r(() => m.value.style), $ = r(() => {
|
|
28
|
+
const e = h(
|
|
29
|
+
t.item.status || "",
|
|
30
|
+
M(R, t.statusColorMap)
|
|
31
|
+
);
|
|
32
|
+
return e.dot ?? e.style.color;
|
|
33
|
+
}), E = r(() => {
|
|
34
|
+
const e = (a) => {
|
|
35
|
+
const o = /* @__PURE__ */ new Date(`${a}T00:00:00`);
|
|
36
|
+
return `${String(o.getMonth() + 1).padStart(2, "0")}/${String(o.getDate()).padStart(2, "0")}`;
|
|
37
|
+
};
|
|
38
|
+
return `${e(t.item.startDate)} - ${e(t.item.endDate)}`;
|
|
39
|
+
});
|
|
40
|
+
function v(e, a) {
|
|
41
|
+
t.readonly || (e.preventDefault(), e.stopPropagation(), l.value = !0, i.value = a, g = e.clientX, D = t.offsetDays, c = t.durationDays, window.addEventListener("mousemove", p), window.addEventListener("mouseup", w));
|
|
42
|
+
}
|
|
43
|
+
function p(e) {
|
|
44
|
+
if (!l.value || !i.value) return;
|
|
45
|
+
const a = Math.round((e.clientX - g) / t.dayWidth);
|
|
46
|
+
if (i.value === "move") {
|
|
47
|
+
const P = Math.max(0, Math.min(D + a, t.totalDays - 1));
|
|
48
|
+
u("change", {
|
|
49
|
+
id: t.item.id,
|
|
50
|
+
offsetDays: P,
|
|
51
|
+
durationDays: c,
|
|
52
|
+
startDate: t.item.startDate,
|
|
53
|
+
endDate: t.item.endDate
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const o = Math.max(1, c + a), L = Math.max(1, t.totalDays - t.offsetDays);
|
|
58
|
+
u("change", {
|
|
59
|
+
id: t.item.id,
|
|
60
|
+
offsetDays: t.offsetDays,
|
|
61
|
+
durationDays: Math.min(o, L),
|
|
62
|
+
startDate: t.item.startDate,
|
|
63
|
+
endDate: t.item.endDate
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function w() {
|
|
67
|
+
l.value = !1, i.value = null, window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", w);
|
|
68
|
+
}
|
|
69
|
+
return (e, a) => (B(), T("div", {
|
|
70
|
+
class: "gantt-row",
|
|
71
|
+
onClick: a[2] || (a[2] = (o) => u("click", s.item))
|
|
72
|
+
}, [
|
|
73
|
+
n("div", U, [
|
|
74
|
+
n("span", {
|
|
75
|
+
class: "gantt-row__dot",
|
|
76
|
+
style: d({ backgroundColor: $.value })
|
|
77
|
+
}, null, 4),
|
|
78
|
+
n("span", X, y(s.item.title), 1),
|
|
79
|
+
n("span", {
|
|
80
|
+
class: "gantt-row__priority",
|
|
81
|
+
style: d(x.value)
|
|
82
|
+
}, y(s.item.priority), 5)
|
|
83
|
+
]),
|
|
84
|
+
n("div", {
|
|
85
|
+
class: "gantt-row__chart",
|
|
86
|
+
style: d({ width: `${C.value}px` })
|
|
87
|
+
}, [
|
|
88
|
+
n("div", {
|
|
89
|
+
class: A(["gantt-row__bar", { "gantt-row__bar--dragging": l.value }]),
|
|
90
|
+
style: d({
|
|
91
|
+
left: `${S.value}px`,
|
|
92
|
+
width: `${k.value}px`,
|
|
93
|
+
backgroundColor: f.value.background,
|
|
94
|
+
color: f.value.color
|
|
95
|
+
}),
|
|
96
|
+
onMousedown: a[1] || (a[1] = (o) => v(o, "move"))
|
|
97
|
+
}, [
|
|
98
|
+
n("span", F, y(E.value), 1),
|
|
99
|
+
n("span", {
|
|
100
|
+
class: "gantt-row__handle",
|
|
101
|
+
onMousedown: a[0] || (a[0] = (o) => v(o, "resize-end"))
|
|
102
|
+
}, null, 32)
|
|
103
|
+
], 38)
|
|
104
|
+
], 4)
|
|
105
|
+
]));
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
export {
|
|
109
|
+
G as default
|
|
110
|
+
};
|