@oneflowui/ui 0.4.3 → 0.5.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.
Files changed (158) hide show
  1. package/README.en.md +1 -1
  2. package/README.md +70 -0
  3. package/dist/assets/tableWorker-CTsbCPPP.js +1 -0
  4. package/dist/components/ContextMenu/index.vue.d.ts +2 -1
  5. package/dist/components/ContextMenu/index.vue.js +2 -2
  6. package/dist/components/ContextMenu/index.vue2.js +37 -36
  7. package/dist/components/base/DropdownMenu.vue.js +2 -2
  8. package/dist/components/base/DropdownMenu.vue2.js +38 -39
  9. package/dist/components/base/MonitorItem.vue.d.ts +1 -1
  10. package/dist/components/base/PersonaCard.vue.d.ts +2 -1
  11. package/dist/components/base/PersonaCard.vue.js +3 -3
  12. package/dist/components/base/PersonaCard.vue2.js +51 -39
  13. package/dist/components/base/RefTag.vue.d.ts +2 -2
  14. package/dist/components/base/RefTag.vue.js +3 -3
  15. package/dist/components/base/SearchHighlight.vue.d.ts +6 -0
  16. package/dist/components/base/SearchHighlight.vue.js +7 -0
  17. package/dist/components/base/SearchHighlight.vue2.js +21 -0
  18. package/dist/components/base/ToolbarBtn.vue.d.ts +2 -1
  19. package/dist/components/base/ToolbarBtn.vue.js +1 -1
  20. package/dist/components/base/ViewModeGroup.vue.d.ts +2 -1
  21. package/dist/components/base/ViewModeGroup.vue.js +3 -3
  22. package/dist/components/base/ViewSwitcher.vue.d.ts +2 -1
  23. package/dist/components/base/ViewSwitcher.vue.js +2 -2
  24. package/dist/components/base/index.d.ts +1 -0
  25. package/dist/components/database/DatabaseView.vue.d.ts +171 -0
  26. package/dist/components/database/DatabaseView.vue.js +7 -0
  27. package/dist/components/database/DatabaseView.vue2.js +774 -0
  28. package/dist/components/database/index.d.ts +2 -0
  29. package/dist/components/field/FieldAttachment.vue.d.ts +17 -0
  30. package/dist/components/field/FieldAttachment.vue.js +7 -0
  31. package/dist/components/field/FieldAttachment.vue2.js +69 -0
  32. package/dist/components/field/FieldAutoNumber.vue.d.ts +7 -0
  33. package/dist/components/field/FieldAutoNumber.vue.js +7 -0
  34. package/dist/components/field/FieldAutoNumber.vue2.js +15 -0
  35. package/dist/components/field/FieldCreator.vue.d.ts +7 -0
  36. package/dist/components/field/FieldCreator.vue.js +7 -0
  37. package/dist/components/field/FieldCreator.vue2.js +24 -0
  38. package/dist/components/field/FieldCurrency.vue.d.ts +17 -0
  39. package/dist/components/field/FieldCurrency.vue.js +7 -0
  40. package/dist/components/field/FieldCurrency.vue2.js +42 -0
  41. package/dist/components/field/FieldDate.vue.js +2 -2
  42. package/dist/components/field/FieldDate.vue2.js +13 -10
  43. package/dist/components/field/FieldDatetime.vue.js +1 -1
  44. package/dist/components/field/FieldMarkdownPreview.vue.d.ts +13 -0
  45. package/dist/components/field/FieldMarkdownPreview.vue.js +7 -0
  46. package/dist/components/field/FieldMarkdownPreview.vue2.js +37 -0
  47. package/dist/components/field/FieldMultiSelect.vue.js +2 -2
  48. package/dist/components/field/FieldPhone.vue.d.ts +17 -0
  49. package/dist/components/field/FieldPhone.vue.js +7 -0
  50. package/dist/components/field/FieldPhone.vue2.js +34 -0
  51. package/dist/components/field/FieldProgress.vue.d.ts +15 -0
  52. package/dist/components/field/FieldProgress.vue.js +7 -0
  53. package/dist/components/field/FieldProgress.vue2.js +40 -0
  54. package/dist/components/field/FieldRelation.vue.d.ts +17 -0
  55. package/dist/components/field/FieldRelation.vue.js +7 -0
  56. package/dist/components/field/FieldRelation.vue2.js +67 -0
  57. package/dist/components/field/FieldRichText.vue.d.ts +17 -0
  58. package/dist/components/field/FieldRichText.vue.js +7 -0
  59. package/dist/components/field/FieldRichText.vue2.js +65 -0
  60. package/dist/components/field/FieldSelect.vue.js +1 -1
  61. package/dist/components/field/FieldSelect.vue2.js +43 -42
  62. package/dist/components/form/FormDesigner.vue.js +2 -2
  63. package/dist/components/form/FormDesigner.vue2.js +62 -52
  64. package/dist/components/gallery/GalleryCard.vue.js +2 -2
  65. package/dist/components/gallery/GalleryView.vue.d.ts +6 -2
  66. package/dist/components/gallery/GalleryView.vue.js +2 -2
  67. package/dist/components/gallery/GalleryView.vue2.js +30 -20
  68. package/dist/components/kanban/KanbanBoard.vue.d.ts +5 -1
  69. package/dist/components/kanban/KanbanBoard.vue.js +4 -4
  70. package/dist/components/kanban/KanbanBoard.vue2.js +81 -48
  71. package/dist/components/layout/AppLayout.vue.js +2 -2
  72. package/dist/components/layout/AppLayout.vue2.js +46 -62
  73. package/dist/components/overlay/Drawer.vue.js +1 -1
  74. package/dist/components/overlay/Drawer.vue2.js +52 -68
  75. package/dist/components/overlay/Modal.vue.js +1 -1
  76. package/dist/components/overlay/Modal.vue2.js +52 -68
  77. package/dist/components/overlay/SidePanel.vue.js +2 -2
  78. package/dist/components/overlay/SidePanel.vue2.js +64 -80
  79. package/dist/components/table/ColumnHeaderMenu.vue.d.ts +33 -0
  80. package/dist/components/table/ColumnHeaderMenu.vue.js +7 -0
  81. package/dist/components/table/ColumnHeaderMenu.vue2.js +153 -0
  82. package/dist/components/table/DataTable.vue.d.ts +116 -25
  83. package/dist/components/table/DataTable.vue.js +4 -4
  84. package/dist/components/table/DataTable.vue2.js +775 -188
  85. package/dist/components/table/DetailSheet.vue.d.ts +43 -0
  86. package/dist/components/table/DetailSheet.vue.js +7 -0
  87. package/dist/components/table/DetailSheet.vue2.js +140 -0
  88. package/dist/components/table/FieldCell.vue.d.ts +1 -1
  89. package/dist/components/table/FieldCell.vue.js +1 -1
  90. package/dist/components/table/FieldCell.vue2.js +59 -44
  91. package/dist/components/table/FieldTypePicker.vue.d.ts +15 -0
  92. package/dist/components/table/FieldTypePicker.vue.js +7 -0
  93. package/dist/components/table/FieldTypePicker.vue2.js +92 -0
  94. package/dist/components/table/MobileListView.vue.d.ts +24 -0
  95. package/dist/components/table/MobileListView.vue.js +7 -0
  96. package/dist/components/table/MobileListView.vue2.js +90 -0
  97. package/dist/components/table/TableGroupRow.vue.d.ts +5 -0
  98. package/dist/components/table/TableGroupRow.vue.js +2 -2
  99. package/dist/components/table/TableGroupRow.vue2.js +33 -23
  100. package/dist/components/table/TableHeaderRow.vue.d.ts +16 -0
  101. package/dist/components/table/TableHeaderRow.vue.js +2 -2
  102. package/dist/components/table/TableHeaderRow.vue2.js +54 -33
  103. package/dist/components/table/TableToolbar.vue.d.ts +118 -0
  104. package/dist/components/table/TableToolbar.vue.js +7 -0
  105. package/dist/components/table/TableToolbar.vue2.js +273 -0
  106. package/dist/components/table/index.d.ts +5 -0
  107. package/dist/components/timeline/GanttTimeline.vue.js +1 -1
  108. package/dist/components/timeline/GanttTimeline.vue2.js +128 -127
  109. package/dist/components/toast/ToastItem.vue.js +3 -3
  110. package/dist/composables/index.d.ts +21 -0
  111. package/dist/composables/useBreakpoint.d.ts +2 -1
  112. package/dist/composables/useBreakpoint.js +14 -12
  113. package/dist/composables/useColumnResize.d.ts +19 -0
  114. package/dist/composables/useColumnResize.js +58 -0
  115. package/dist/composables/useDatabaseView.d.ts +138 -0
  116. package/dist/composables/useDatabaseView.js +388 -0
  117. package/dist/composables/useDraftRows.d.ts +33 -0
  118. package/dist/composables/useDraftRows.js +103 -0
  119. package/dist/composables/useFixedColumns.d.ts +25 -0
  120. package/dist/composables/useFixedColumns.js +61 -0
  121. package/dist/composables/useFocusTrap.d.ts +10 -0
  122. package/dist/composables/useFocusTrap.js +37 -0
  123. package/dist/composables/useInlineEdit.js +3 -3
  124. package/dist/composables/useKeyboardNavigation.d.ts +45 -0
  125. package/dist/composables/useKeyboardNavigation.js +140 -0
  126. package/dist/composables/useRowDrag.d.ts +32 -0
  127. package/dist/composables/useRowDrag.js +85 -0
  128. package/dist/composables/useSchemaEngine.d.ts +31 -0
  129. package/dist/composables/useSchemaEngine.js +129 -0
  130. package/dist/composables/useSearch.d.ts +30 -0
  131. package/dist/composables/useSearch.js +59 -0
  132. package/dist/composables/useSupabaseProvider.d.ts +70 -0
  133. package/dist/composables/useSupabaseProvider.js +126 -0
  134. package/dist/composables/useTable.d.ts +3 -0
  135. package/dist/composables/useTable.js +103 -83
  136. package/dist/composables/useTableGroup.d.ts +14 -1
  137. package/dist/composables/useTableGroup.js +57 -33
  138. package/dist/composables/useViewPersistence.d.ts +98 -0
  139. package/dist/composables/useViewPersistence.js +141 -0
  140. package/dist/composables/useVirtualList.d.ts +4 -1
  141. package/dist/composables/useVirtualList.js +108 -85
  142. package/dist/composables/useWorkerSort.d.ts +14 -0
  143. package/dist/composables/useWorkerSort.js +61 -0
  144. package/dist/index.d.ts +32 -4
  145. package/dist/index.js +274 -221
  146. package/dist/style.css +1 -1
  147. package/dist/tests/database-view.integration.spec.d.ts +1 -0
  148. package/dist/types/index.d.ts +63 -2
  149. package/dist/types/index.js +23 -6
  150. package/dist/types/table-internal.d.ts +64 -0
  151. package/dist/utils/aggregation.d.ts +5 -0
  152. package/dist/utils/aggregation.js +38 -0
  153. package/dist/utils/supabaseAdapter.d.ts +48 -0
  154. package/dist/utils/supabaseAdapter.js +76 -0
  155. package/dist/utils/supabaseSchema.d.ts +81 -0
  156. package/dist/utils/supabaseSchema.js +202 -0
  157. package/dist/workers/tableWorker.d.ts +31 -0
  158. package/package.json +17 -17
@@ -1,18 +1,19 @@
1
- import { defineComponent as C, ref as V, watch as x, nextTick as B, onUnmounted as _, openBlock as l, createBlock as g, Teleport as z, createVNode as b, Transition as L, withCtx as $, createElementBlock as n, withModifiers as D, normalizeStyle as h, createElementVNode as k, normalizeClass as S, renderSlot as f, toDisplayString as T, unref as A, createCommentVNode as d } from "vue";
2
- import { X as I } from "lucide-vue-next";
3
- const M = ["aria-label"], N = {
1
+ import { defineComponent as b, watch as w, onUnmounted as p, openBlock as o, createBlock as C, Teleport as V, createVNode as r, Transition as B, withCtx as _, createElementBlock as l, withModifiers as z, normalizeStyle as c, createElementVNode as m, normalizeClass as E, renderSlot as s, toDisplayString as T, unref as $, createCommentVNode as a } from "vue";
2
+ import { X as x } from "lucide-vue-next";
3
+ import { useFocusTrap as I } from "../../composables/useFocusTrap.js";
4
+ const L = ["aria-label"], M = {
4
5
  key: 0,
5
6
  class: "of-modal__header"
6
- }, K = {
7
+ }, N = {
7
8
  key: 0,
8
9
  class: "of-modal__title"
9
10
  }, R = {
10
11
  key: 1,
11
12
  class: "of-modal__title-placeholder"
12
- }, q = { class: "of-modal__body" }, F = {
13
+ }, S = { class: "of-modal__body" }, g = {
13
14
  key: 1,
14
15
  class: "of-modal__footer"
15
- }, X = /* @__PURE__ */ C({
16
+ }, U = /* @__PURE__ */ b({
16
17
  inheritAttrs: !1,
17
18
  __name: "Modal",
18
19
  props: {
@@ -25,85 +26,68 @@ const M = ["aria-label"], N = {
25
26
  zIndex: { default: 1e3 }
26
27
  },
27
28
  emits: ["update:modelValue"],
28
- setup(t, { emit: w }) {
29
- const i = t, E = w, s = V(null);
30
- let a = null;
31
- function m() {
32
- return s.value ? Array.from(
33
- s.value.querySelectorAll(
34
- 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), a[href]'
35
- )
36
- ).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
29
+ setup(e, { emit: f }) {
30
+ const d = e, u = f, {
31
+ containerRef: y,
32
+ activate: h,
33
+ deactivate: k
34
+ } = I();
35
+ function n() {
36
+ u("update:modelValue", !1);
37
37
  }
38
- function r(e) {
39
- if (e.key !== "Tab") return;
40
- const o = m();
41
- if (o.length === 0) {
42
- e.preventDefault();
43
- return;
44
- }
45
- const y = o[0], v = o[o.length - 1];
46
- e.shiftKey ? document.activeElement === y && (e.preventDefault(), v.focus()) : document.activeElement === v && (e.preventDefault(), y.focus());
47
- }
48
- function u() {
49
- E("update:modelValue", !1);
50
- }
51
- function p() {
52
- i.maskClosable && u();
38
+ function v() {
39
+ d.maskClosable && n();
53
40
  }
54
- function c(e) {
55
- e.key === "Escape" && i.modelValue && u();
41
+ function i(t) {
42
+ t.key === "Escape" && d.modelValue && n();
56
43
  }
57
- return x(
58
- () => i.modelValue,
59
- (e) => {
60
- typeof document > "u" || (e ? (document.body.style.overflow = "hidden", a = document.activeElement, document.addEventListener("keydown", c), B(() => {
61
- const o = m();
62
- o.length && o[0].focus(), document.addEventListener("keydown", r);
63
- })) : (document.body.style.overflow = "", document.removeEventListener("keydown", c), document.removeEventListener("keydown", r), a == null || a.focus(), a = null));
44
+ return w(
45
+ () => d.modelValue,
46
+ (t) => {
47
+ typeof document > "u" || (t ? (document.body.style.overflow = "hidden", document.addEventListener("keydown", i), h()) : (document.body.style.overflow = "", document.removeEventListener("keydown", i), k()));
64
48
  }
65
- ), _(() => {
66
- typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", c), document.removeEventListener("keydown", r));
67
- }), (e, o) => (l(), g(z, { to: "body" }, [
68
- b(L, { name: "of-modal" }, {
69
- default: $(() => [
70
- t.modelValue ? (l(), n("div", {
49
+ ), p(() => {
50
+ typeof document > "u" || (document.body.style.overflow = "", document.removeEventListener("keydown", i));
51
+ }), (t, A) => (o(), C(V, { to: "body" }, [
52
+ r(B, { name: "of-modal" }, {
53
+ default: _(() => [
54
+ e.modelValue ? (o(), l("div", {
71
55
  key: 0,
72
56
  class: "of-modal-backdrop",
73
- style: h({ zIndex: t.zIndex }),
74
- onClick: D(p, ["self"])
57
+ style: c({ zIndex: e.zIndex }),
58
+ onClick: z(v, ["self"])
75
59
  }, [
76
- k("div", {
60
+ m("div", {
77
61
  ref_key: "modalRef",
78
- ref: s,
79
- class: S(["of-modal", { "of-modal--centered": t.centered }]),
80
- style: h({ width: t.width, maxWidth: "90vw" }),
62
+ ref: y,
63
+ class: E(["of-modal", { "of-modal--centered": e.centered }]),
64
+ style: c({ width: e.width, maxWidth: "90vw" }),
81
65
  role: "dialog",
82
66
  "aria-modal": "true",
83
- "aria-label": t.title
67
+ "aria-label": e.title
84
68
  }, [
85
- e.$slots.header || t.title || t.closable ? (l(), n("div", N, [
86
- f(e.$slots, "header", {}, () => [
87
- t.title ? (l(), n("h3", K, T(t.title), 1)) : (l(), n("div", R))
69
+ t.$slots.header || e.title || e.closable ? (o(), l("div", M, [
70
+ s(t.$slots, "header", {}, () => [
71
+ e.title ? (o(), l("h3", N, T(e.title), 1)) : (o(), l("div", R))
88
72
  ], !0),
89
- t.closable ? (l(), n("button", {
73
+ e.closable ? (o(), l("button", {
90
74
  key: 0,
91
75
  class: "of-modal__close",
92
- onClick: u,
76
+ onClick: n,
93
77
  "aria-label": "关闭",
94
78
  type: "button"
95
79
  }, [
96
- b(A(I), { size: 18 })
97
- ])) : d("", !0)
98
- ])) : d("", !0),
99
- k("div", q, [
100
- f(e.$slots, "default", {}, void 0, !0)
80
+ r($(x), { size: 18 })
81
+ ])) : a("", !0)
82
+ ])) : a("", !0),
83
+ m("div", S, [
84
+ s(t.$slots, "default", {}, void 0, !0)
101
85
  ]),
102
- e.$slots.footer ? (l(), n("div", F, [
103
- f(e.$slots, "footer", {}, void 0, !0)
104
- ])) : d("", !0)
105
- ], 14, M)
106
- ], 4)) : d("", !0)
86
+ t.$slots.footer ? (o(), l("div", g, [
87
+ s(t.$slots, "footer", {}, void 0, !0)
88
+ ])) : a("", !0)
89
+ ], 14, L)
90
+ ], 4)) : a("", !0)
107
91
  ]),
108
92
  _: 3
109
93
  })
@@ -111,5 +95,5 @@ const M = ["aria-label"], N = {
111
95
  }
112
96
  });
113
97
  export {
114
- X as default
98
+ U as default
115
99
  };
@@ -1,7 +1,7 @@
1
1
  import o from "./SidePanel.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a021fd10"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-45ffc40d"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,24 +1,25 @@
1
- import { defineComponent as g, computed as S, ref as $, onMounted as B, watch as D, nextTick as L, onBeforeUnmount as z, openBlock as l, createBlock as P, Teleport as N, createElementBlock as o, Fragment as R, normalizeStyle as b, renderSlot as i, toDisplayString as k, createVNode as w, unref as p, createCommentVNode as d, createElementVNode as E, withDirectives as T, vShow as A } from "vue";
2
- import { X as _ } from "lucide-vue-next";
3
- const F = ["aria-label"], K = {
1
+ import { defineComponent as _, computed as V, onMounted as C, watch as $, onBeforeUnmount as B, openBlock as t, createBlock as S, Teleport as E, createElementBlock as l, Fragment as g, normalizeStyle as u, renderSlot as d, toDisplayString as f, createVNode as m, unref as y, createCommentVNode as a, createElementVNode as h, withDirectives as z, vShow as P } from "vue";
2
+ import { X as k } from "lucide-vue-next";
3
+ import { useFocusTrap as R } from "../../composables/useFocusTrap.js";
4
+ const T = ["aria-label"], N = {
4
5
  key: 0,
5
6
  class: "of-side-panel__header"
6
- }, q = {
7
+ }, D = {
7
8
  key: 0,
8
9
  class: "of-side-panel__title"
9
- }, x = {
10
+ }, F = {
10
11
  key: 1,
11
12
  class: "of-side-panel__title-placeholder"
12
- }, M = { class: "of-side-panel__body" }, U = ["aria-label"], X = {
13
+ }, L = { class: "of-side-panel__body" }, K = ["aria-label"], M = {
13
14
  key: 0,
14
15
  class: "of-side-panel__header"
15
- }, j = {
16
+ }, U = {
16
17
  key: 0,
17
18
  class: "of-side-panel__title"
18
- }, G = {
19
+ }, X = {
19
20
  key: 1,
20
21
  class: "of-side-panel__title-placeholder"
21
- }, H = { class: "of-side-panel__body" }, O = /* @__PURE__ */ g({
22
+ }, j = { class: "of-side-panel__body" }, I = /* @__PURE__ */ _({
22
23
  __name: "SidePanel",
23
24
  props: {
24
25
  modelValue: { type: Boolean },
@@ -28,110 +29,93 @@ const F = ["aria-label"], K = {
28
29
  mode: { default: "persistent" }
29
30
  },
30
31
  emits: ["update:modelValue"],
31
- setup(t, { emit: V }) {
32
- const u = t, C = V, f = S(() => ({
33
- width: `${u.width}px`
34
- })), s = $(null);
35
- let a = null;
36
- function m() {
37
- return s.value ? Array.from(
38
- s.value.querySelectorAll(
39
- 'button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), a[href]'
40
- )
41
- ).filter((e) => !e.closest('[aria-hidden="true"]')) : [];
32
+ setup(e, { emit: v }) {
33
+ const i = e, w = v, n = V(() => ({
34
+ width: `${i.width}px`
35
+ })), {
36
+ containerRef: r,
37
+ activate: b,
38
+ deactivate: p
39
+ } = R();
40
+ function c(o) {
41
+ o.key === "Escape" && i.modelValue && s();
42
42
  }
43
- function r(e) {
44
- if (e.key !== "Tab") return;
45
- const n = m();
46
- if (n.length === 0) {
47
- e.preventDefault();
48
- return;
43
+ C(() => {
44
+ typeof document > "u" || document.addEventListener("keydown", c);
45
+ }), $(
46
+ () => i.modelValue,
47
+ (o) => {
48
+ typeof document > "u" || (document.body.style.overflow = o ? "hidden" : "", o ? b() : p());
49
49
  }
50
- const h = n[0], v = n[n.length - 1];
51
- e.shiftKey ? document.activeElement === h && (e.preventDefault(), v.focus()) : document.activeElement === v && (e.preventDefault(), h.focus());
52
- }
53
- function y(e) {
54
- e.key === "Escape" && u.modelValue && c();
55
- }
56
- B(() => {
57
- typeof document > "u" || document.addEventListener("keydown", y);
58
- }), D(
59
- () => u.modelValue,
60
- (e) => {
61
- typeof document > "u" || (document.body.style.overflow = e ? "hidden" : "", e ? (a = document.activeElement, L(() => {
62
- const n = m();
63
- n.length && n[0].focus(), document.addEventListener("keydown", r);
64
- })) : (document.removeEventListener("keydown", r), a == null || a.focus(), a = null));
65
- }
66
- ), z(() => {
67
- typeof document > "u" || (document.removeEventListener("keydown", y), document.removeEventListener("keydown", r), document.body.style.overflow = "");
50
+ ), B(() => {
51
+ typeof document > "u" || (document.removeEventListener("keydown", c), document.body.style.overflow = "");
68
52
  });
69
- function c() {
70
- C("update:modelValue", !1);
53
+ function s() {
54
+ w("update:modelValue", !1);
71
55
  }
72
- return (e, n) => (l(), P(N, { to: "body" }, [
73
- t.mode === "lazy" ? (l(), o(R, { key: 0 }, [
74
- t.modelValue ? (l(), o("aside", {
56
+ return (o, q) => (t(), S(E, { to: "body" }, [
57
+ e.mode === "lazy" ? (t(), l(g, { key: 0 }, [
58
+ e.modelValue ? (t(), l("aside", {
75
59
  key: 0,
76
60
  ref_key: "sidePanelRef",
77
- ref: s,
61
+ ref: r,
78
62
  class: "of-side-panel",
79
- style: b(f.value),
63
+ style: u(n.value),
80
64
  role: "dialog",
81
65
  "aria-modal": "true",
82
- "aria-label": t.title
66
+ "aria-label": e.title
83
67
  }, [
84
- e.$slots.header || t.title || t.showClose ? (l(), o("div", K, [
85
- i(e.$slots, "header", {}, () => [
86
- t.title ? (l(), o("h3", q, k(t.title), 1)) : (l(), o("div", x))
68
+ o.$slots.header || e.title || e.showClose ? (t(), l("div", N, [
69
+ d(o.$slots, "header", {}, () => [
70
+ e.title ? (t(), l("h3", D, f(e.title), 1)) : (t(), l("div", F))
87
71
  ], !0),
88
- t.showClose ? (l(), o("button", {
72
+ e.showClose ? (t(), l("button", {
89
73
  key: 0,
90
74
  class: "of-side-panel__close",
91
75
  type: "button",
92
76
  "aria-label": "关闭",
93
- onClick: c
77
+ onClick: s
94
78
  }, [
95
- w(p(_), { size: 18 })
96
- ])) : d("", !0)
97
- ])) : d("", !0),
98
- E("div", M, [
99
- i(e.$slots, "default", {}, void 0, !0)
79
+ m(y(k), { size: 18 })
80
+ ])) : a("", !0)
81
+ ])) : a("", !0),
82
+ h("div", L, [
83
+ d(o.$slots, "default", {}, void 0, !0)
100
84
  ])
101
- ], 12, F)) : d("", !0)
102
- ], 64)) : T((l(), o("aside", {
85
+ ], 12, T)) : a("", !0)
86
+ ], 64)) : z((t(), l("aside", {
103
87
  key: 1,
104
88
  ref_key: "sidePanelRef",
105
- ref: s,
89
+ ref: r,
106
90
  class: "of-side-panel",
107
- style: b(f.value),
91
+ style: u(n.value),
108
92
  role: "dialog",
109
93
  "aria-modal": "true",
110
- "aria-label": t.title
94
+ "aria-label": e.title
111
95
  }, [
112
- e.$slots.header || t.title || t.showClose ? (l(), o("div", X, [
113
- i(e.$slots, "header", {}, () => [
114
- t.title ? (l(), o("h3", j, k(t.title), 1)) : (l(), o("div", G))
96
+ o.$slots.header || e.title || e.showClose ? (t(), l("div", M, [
97
+ d(o.$slots, "header", {}, () => [
98
+ e.title ? (t(), l("h3", U, f(e.title), 1)) : (t(), l("div", X))
115
99
  ], !0),
116
- t.showClose ? (l(), o("button", {
100
+ e.showClose ? (t(), l("button", {
117
101
  key: 0,
118
102
  class: "of-side-panel__close",
119
103
  type: "button",
120
104
  "aria-label": "关闭",
121
- onClick: c
105
+ onClick: s
122
106
  }, [
123
- w(p(_), { size: 18 })
124
- ])) : d("", !0)
125
- ])) : d("", !0),
126
- E("div", H, [
127
- i(e.$slots, "default", {}, void 0, !0)
107
+ m(y(k), { size: 18 })
108
+ ])) : a("", !0)
109
+ ])) : a("", !0),
110
+ h("div", j, [
111
+ d(o.$slots, "default", {}, void 0, !0)
128
112
  ])
129
- ], 12, U)), [
130
- [A, t.modelValue]
113
+ ], 12, K)), [
114
+ [P, e.modelValue]
131
115
  ])
132
116
  ]));
133
117
  }
134
118
  });
135
119
  export {
136
- O as default
120
+ I as default
137
121
  };
@@ -0,0 +1,33 @@
1
+ import { FieldType } from '../../types';
2
+ type __VLS_Props = {
3
+ colKey: string;
4
+ colLabel: string;
5
+ fieldType?: FieldType;
6
+ sortOrder?: "asc" | "desc" | null;
7
+ visible: boolean;
8
+ x: number;
9
+ y: number;
10
+ deletable?: boolean;
11
+ };
12
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ sort: (colKey: string, direction: "asc" | "desc") => any;
14
+ delete: (colKey: string) => any;
15
+ close: () => any;
16
+ rename: (colKey: string, newName: string) => any;
17
+ "change-type": (colKey: string, newType: FieldType) => any;
18
+ hide: (colKey: string) => any;
19
+ duplicate: (colKey: string) => any;
20
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
21
+ onSort?: ((colKey: string, direction: "asc" | "desc") => any) | undefined;
22
+ onDelete?: ((colKey: string) => any) | undefined;
23
+ onClose?: (() => any) | undefined;
24
+ onRename?: ((colKey: string, newName: string) => any) | undefined;
25
+ "onChange-type"?: ((colKey: string, newType: FieldType) => any) | undefined;
26
+ onHide?: ((colKey: string) => any) | undefined;
27
+ onDuplicate?: ((colKey: string) => any) | undefined;
28
+ }>, {
29
+ deletable: boolean;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
31
+ renameInput: HTMLInputElement;
32
+ }, any>;
33
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./ColumnHeaderMenu.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f6210323"]]);
5
+ export {
6
+ a as default
7
+ };
@@ -0,0 +1,153 @@
1
+ import { defineComponent as $, ref as y, computed as p, onMounted as w, nextTick as z, openBlock as a, createBlock as B, Teleport as L, createElementBlock as d, withModifiers as E, createElementVNode as l, normalizeStyle as S, withKeys as v, toDisplayString as N, createVNode as u, createCommentVNode as c, unref as r, Fragment as A } from "vue";
2
+ import { ArrowUp as D, ArrowDown as M, EyeOff as P, Copy as V, Trash2 as F } from "lucide-vue-next";
3
+ import I from "./FieldTypePicker.vue.js";
4
+ const O = { class: "of-col-menu__section" }, H = ["value"], R = { class: "of-col-menu__item-value" }, U = {
5
+ key: 0,
6
+ class: "of-col-menu__sub"
7
+ }, G = /* @__PURE__ */ $({
8
+ __name: "ColumnHeaderMenu",
9
+ props: {
10
+ colKey: {},
11
+ colLabel: {},
12
+ fieldType: {},
13
+ sortOrder: {},
14
+ visible: { type: Boolean },
15
+ x: {},
16
+ y: {},
17
+ deletable: { type: Boolean, default: !0 }
18
+ },
19
+ emits: ["close", "rename", "change-type", "sort", "hide", "delete", "duplicate"],
20
+ setup(s, { emit: b }) {
21
+ const i = s, t = b, f = y(null), m = y(!1), k = {
22
+ text: "文本",
23
+ number: "数字",
24
+ select: "单选",
25
+ multi_select: "多选",
26
+ date: "日期",
27
+ datetime: "日期时间",
28
+ checkbox: "复选框",
29
+ url: "链接",
30
+ email: "邮箱",
31
+ phone: "电话",
32
+ rating: "评分",
33
+ currency: "货币",
34
+ richtext: "富文本",
35
+ auto_number: "自动编号",
36
+ creator: "创建者",
37
+ progress: "进度",
38
+ relation: "关联",
39
+ attachment: "附件",
40
+ formula: "公式",
41
+ user: "用户"
42
+ }, C = p(() => k[i.fieldType ?? ""] ?? i.fieldType ?? "");
43
+ w(() => z(() => {
44
+ var o;
45
+ return (o = f.value) == null ? void 0 : o.select();
46
+ }));
47
+ function T(o) {
48
+ const n = o.target.value.trim();
49
+ n && n !== i.colLabel && t("rename", i.colKey, n), t("close");
50
+ }
51
+ function x(o) {
52
+ t("change-type", i.colKey, o), m.value = !1, t("close");
53
+ }
54
+ function K() {
55
+ t("delete", i.colKey), t("close");
56
+ }
57
+ const g = p(() => {
58
+ const o = {};
59
+ return o.left = `${i.x}px`, o.top = `${i.y}px`, o;
60
+ });
61
+ return (o, e) => (a(), B(L, { to: "body" }, [
62
+ s.visible ? (a(), d("div", {
63
+ key: 0,
64
+ class: "of-col-menu-overlay",
65
+ onClick: e[6] || (e[6] = E((n) => t("close"), ["self"]))
66
+ }, [
67
+ l("div", {
68
+ class: "of-col-menu",
69
+ style: S(g.value)
70
+ }, [
71
+ l("div", O, [
72
+ l("input", {
73
+ ref_key: "renameInput",
74
+ ref: f,
75
+ class: "of-col-menu__rename-input",
76
+ value: s.colLabel,
77
+ placeholder: "字段名称",
78
+ onKeydown: [
79
+ v(T, ["enter"]),
80
+ e[0] || (e[0] = v((n) => t("close"), ["escape"]))
81
+ ]
82
+ }, null, 40, H)
83
+ ]),
84
+ e[14] || (e[14] = l("div", { class: "of-col-menu__divider" }, null, -1)),
85
+ l("button", {
86
+ class: "of-col-menu__item",
87
+ onClick: e[1] || (e[1] = (n) => m.value = !m.value)
88
+ }, [
89
+ e[7] || (e[7] = l("span", null, "字段类型", -1)),
90
+ l("span", R, N(C.value), 1)
91
+ ]),
92
+ m.value ? (a(), d("div", U, [
93
+ u(I, {
94
+ "current-type": s.fieldType,
95
+ onSelect: x
96
+ }, null, 8, ["current-type"])
97
+ ])) : c("", !0),
98
+ e[15] || (e[15] = l("div", { class: "of-col-menu__divider" }, null, -1)),
99
+ l("button", {
100
+ class: "of-col-menu__item",
101
+ onClick: e[2] || (e[2] = (n) => {
102
+ t("sort", s.colKey, "asc"), t("close");
103
+ })
104
+ }, [
105
+ u(r(D), { size: 14 }),
106
+ e[8] || (e[8] = l("span", null, "升序排序", -1))
107
+ ]),
108
+ l("button", {
109
+ class: "of-col-menu__item",
110
+ onClick: e[3] || (e[3] = (n) => {
111
+ t("sort", s.colKey, "desc"), t("close");
112
+ })
113
+ }, [
114
+ u(r(M), { size: 14 }),
115
+ e[9] || (e[9] = l("span", null, "降序排序", -1))
116
+ ]),
117
+ e[16] || (e[16] = l("div", { class: "of-col-menu__divider" }, null, -1)),
118
+ l("button", {
119
+ class: "of-col-menu__item",
120
+ onClick: e[4] || (e[4] = (n) => {
121
+ t("hide", s.colKey), t("close");
122
+ })
123
+ }, [
124
+ u(r(P), { size: 14 }),
125
+ e[10] || (e[10] = l("span", null, "隐藏列", -1))
126
+ ]),
127
+ l("button", {
128
+ class: "of-col-menu__item",
129
+ onClick: e[5] || (e[5] = (n) => {
130
+ t("duplicate", s.colKey), t("close");
131
+ })
132
+ }, [
133
+ u(r(V), { size: 14 }),
134
+ e[11] || (e[11] = l("span", null, "复制列", -1))
135
+ ]),
136
+ s.deletable ? (a(), d(A, { key: 1 }, [
137
+ e[13] || (e[13] = l("div", { class: "of-col-menu__divider" }, null, -1)),
138
+ l("button", {
139
+ class: "of-col-menu__item of-col-menu__item--danger",
140
+ onClick: K
141
+ }, [
142
+ u(r(F), { size: 14 }),
143
+ e[12] || (e[12] = l("span", null, "删除列", -1))
144
+ ])
145
+ ], 64)) : c("", !0)
146
+ ], 4)
147
+ ])) : c("", !0)
148
+ ]));
149
+ }
150
+ });
151
+ export {
152
+ G as default
153
+ };