@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
@@ -0,0 +1,2 @@
1
+ export { default as DatabaseView } from './DatabaseView.vue';
2
+ export type { DatabaseViewActions, DatabaseViewSchemaEvent, DatabaseViewViewTab, DatabaseViewProps, } from './DatabaseView.vue';
@@ -0,0 +1,17 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
15
+ fileInputRef: HTMLInputElement;
16
+ }, HTMLDivElement>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import t from "./FieldAttachment.vue2.js";
2
+ /* empty css */
3
+ import o from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-0ff65ea8"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as _, ref as m, openBlock as a, createElementBlock as o, Fragment as k, renderList as b, createElementVNode as i, toDisplayString as C, createCommentVNode as A } from "vue";
2
+ const F = {
3
+ key: 0,
4
+ class: "of-field-attachment-list"
5
+ }, N = { class: "of-field-attachment-name" }, x = ["onClick"], E = /* @__PURE__ */ _({
6
+ __name: "FieldAttachment",
7
+ props: {
8
+ value: { type: [String, Number, Boolean, Array, null] },
9
+ field: {}
10
+ },
11
+ emits: ["commit", "cancel", "tabNext"],
12
+ setup(p, { emit: d }) {
13
+ const n = p, c = d, t = m(
14
+ Array.isArray(n.value) ? n.value.filter((e) => typeof e == "string") : typeof n.value == "string" && n.value ? [n.value] : []
15
+ ), u = m(null);
16
+ function v() {
17
+ var e;
18
+ (e = u.value) == null || e.click();
19
+ }
20
+ function y(e) {
21
+ var l;
22
+ const s = e.target;
23
+ if (!((l = s.files) != null && l.length)) return;
24
+ const r = Array.from(s.files).map((f) => f.name);
25
+ t.value = [...t.value, ...r], c("commit", t.value.length > 0 ? t.value : null);
26
+ }
27
+ function h(e) {
28
+ t.value.splice(e, 1), c("commit", t.value.length > 0 ? [...t.value] : null);
29
+ }
30
+ function g(e) {
31
+ e.key === "Escape" && (e.preventDefault(), c("cancel"));
32
+ }
33
+ return (e, s) => (a(), o("div", {
34
+ class: "of-field-attachment",
35
+ tabindex: "0",
36
+ onKeydown: g
37
+ }, [
38
+ t.value.length > 0 ? (a(), o("div", F, [
39
+ (a(!0), o(k, null, b(t.value, (r, l) => (a(), o("div", {
40
+ key: l,
41
+ class: "of-field-attachment-item"
42
+ }, [
43
+ i("span", N, C(r), 1),
44
+ i("button", {
45
+ type: "button",
46
+ class: "of-field-attachment-remove",
47
+ onClick: (f) => h(l)
48
+ }, "×", 8, x)
49
+ ]))), 128))
50
+ ])) : A("", !0),
51
+ i("button", {
52
+ type: "button",
53
+ class: "of-field-attachment-add",
54
+ onClick: v
55
+ }, "+ 添加附件"),
56
+ i("input", {
57
+ ref_key: "fileInputRef",
58
+ ref: u,
59
+ type: "file",
60
+ multiple: "",
61
+ style: { display: "none" },
62
+ onChange: y
63
+ }, null, 544)
64
+ ], 32));
65
+ }
66
+ });
67
+ export {
68
+ E as default
69
+ };
@@ -0,0 +1,7 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldAutoNumber.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-17556fd1"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,15 @@
1
+ import { defineComponent as r, openBlock as l, createElementBlock as i, toDisplayString as a, unref as p } from "vue";
2
+ const u = { class: "of-field-auto-number" }, d = /* @__PURE__ */ r({
3
+ __name: "FieldAutoNumber",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ setup(n) {
9
+ const e = n, t = e.field.type === "auto_number" && "prefix" in e.field ? e.field.prefix ?? "" : "", o = e.value != null ? `${t}${e.value}` : "";
10
+ return (s, f) => (l(), i("span", u, a(p(o)), 1));
11
+ }
12
+ });
13
+ export {
14
+ d as default
15
+ };
@@ -0,0 +1,7 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldCreator.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-18c4089c"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,24 @@
1
+ import { defineComponent as i, unref as t, openBlock as a, createElementBlock as s, createElementVNode as r, toDisplayString as n } from "vue";
2
+ const p = {
3
+ key: 0,
4
+ class: "of-field-creator"
5
+ }, d = { class: "of-field-creator-avatar" }, f = { class: "of-field-creator-name" }, _ = {
6
+ key: 1,
7
+ class: "of-field-creator-empty"
8
+ }, h = /* @__PURE__ */ i({
9
+ __name: "FieldCreator",
10
+ props: {
11
+ value: { type: [String, Number, Boolean, Array, null] },
12
+ field: {}
13
+ },
14
+ setup(c) {
15
+ const o = c, e = typeof o.value == "string" ? o.value : "", l = e.charAt(0).toUpperCase();
16
+ return (m, u) => t(e) ? (a(), s("div", p, [
17
+ r("span", d, n(t(l)), 1),
18
+ r("span", f, n(t(e)), 1)
19
+ ])) : (a(), s("span", _, "—"));
20
+ }
21
+ });
22
+ export {
23
+ h as default
24
+ };
@@ -0,0 +1,17 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
15
+ inputRef: HTMLInputElement;
16
+ }, HTMLDivElement>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldCurrency.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-bc4bce47"]]);
5
+ export {
6
+ m as default
7
+ };
@@ -0,0 +1,42 @@
1
+ import { defineComponent as p, ref as c, onMounted as y, nextTick as v, openBlock as N, createElementBlock as b, createElementVNode as a, toDisplayString as k, unref as x, withDirectives as _, vModelText as C } from "vue";
2
+ const D = { class: "of-field-currency" }, g = { class: "of-field-currency-symbol" }, E = /* @__PURE__ */ p({
3
+ __name: "FieldCurrency",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ emits: ["commit", "cancel", "tabNext"],
9
+ setup(s, { emit: f }) {
10
+ const n = s, l = f, u = c(null), o = c(n.value === null || n.value === void 0 ? "" : String(n.value)), m = n.field.type === "currency" && "currencyCode" in n.field && n.field.currencyCode === "CNY" ? "¥" : "$";
11
+ y(() => v(() => {
12
+ var e;
13
+ return (e = u.value) == null ? void 0 : e.focus();
14
+ }));
15
+ function r() {
16
+ if (o.value === "") return null;
17
+ const e = o.value.replace(/[^0-9.-]/g, ""), t = Number(e);
18
+ return Number.isNaN(t) ? null : t;
19
+ }
20
+ function d(e) {
21
+ e.key === "Enter" && (e.preventDefault(), l("commit", r())), e.key === "Escape" && (e.preventDefault(), l("cancel")), e.key === "Tab" && (e.preventDefault(), l("commit", r()), l("tabNext"));
22
+ }
23
+ return (e, t) => (N(), b("div", D, [
24
+ a("span", g, k(x(m)), 1),
25
+ _(a("input", {
26
+ ref_key: "inputRef",
27
+ ref: u,
28
+ class: "of-field-input",
29
+ type: "text",
30
+ inputmode: "decimal",
31
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => o.value = i),
32
+ onKeydown: d,
33
+ onBlur: t[1] || (t[1] = (i) => l("commit", r()))
34
+ }, null, 544), [
35
+ [C, o.value]
36
+ ])
37
+ ]));
38
+ }
39
+ });
40
+ export {
41
+ E as default
42
+ };
@@ -1,7 +1,7 @@
1
1
  import o from "./FieldDate.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e0c4ed7c"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-53830361"]]);
5
5
  export {
6
- c as default
6
+ m as default
7
7
  };
@@ -1,33 +1,36 @@
1
- import { defineComponent as c, ref as a, onMounted as m, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as k } from "vue";
2
- const D = /* @__PURE__ */ c({
1
+ import { defineComponent as m, ref as i, onMounted as c, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as k, vModelText as y } from "vue";
2
+ import { useBreakpoint as x } from "../../composables/useBreakpoint.js";
3
+ const b = /* @__PURE__ */ m({
3
4
  __name: "FieldDate",
4
5
  props: {
5
6
  value: { type: [String, Number, Boolean, Array, null] },
6
7
  field: {}
7
8
  },
8
9
  emits: ["commit", "cancel", "tabNext"],
9
- setup(i, { emit: r }) {
10
- const f = i, t = r, o = a(null), n = a(String(f.value ?? ""));
11
- m(() => s(() => {
10
+ setup(a, { emit: r }) {
11
+ const p = a, t = r;
12
+ x();
13
+ const o = i(null), n = i(String(p.value ?? ""));
14
+ c(() => s(() => {
12
15
  var e;
13
16
  return (e = o.value) == null ? void 0 : e.focus();
14
17
  }));
15
- function p(e) {
18
+ function f(e) {
16
19
  e.key === "Enter" && (e.preventDefault(), t("commit", n.value || null)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", n.value || null), t("tabNext"));
17
20
  }
18
- return (e, l) => v((d(), y("input", {
21
+ return (e, l) => v((d(), k("input", {
19
22
  ref_key: "inputRef",
20
23
  ref: o,
21
24
  "onUpdate:modelValue": l[0] || (l[0] = (u) => n.value = u),
22
25
  class: "of-field-input",
23
26
  type: "date",
24
- onKeydown: p,
27
+ onKeydown: f,
25
28
  onBlur: l[1] || (l[1] = (u) => t("commit", n.value || null))
26
29
  }, null, 544)), [
27
- [k, n.value]
30
+ [y, n.value]
28
31
  ]);
29
32
  }
30
33
  });
31
34
  export {
32
- D as default
35
+ b as default
33
36
  };
@@ -1,7 +1,7 @@
1
1
  import t from "./FieldDatetime.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-80796d5b"]]);
4
+ const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-86258ef1"]]);
5
5
  export {
6
6
  a as default
7
7
  };
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ /** markdown 原文 */
3
+ content: string;
4
+ /** 最大显示行数,默认 2 */
5
+ maxLines?: number;
6
+ /** 是否展开显示完整内容 */
7
+ expanded?: boolean;
8
+ };
9
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
+ expanded: boolean;
11
+ maxLines: number;
12
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
13
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldMarkdownPreview.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const i = /* @__PURE__ */ r(o, [["__scopeId", "data-v-767b8c61"]]);
5
+ export {
6
+ i as default
7
+ };
@@ -0,0 +1,37 @@
1
+ import { defineComponent as p, computed as a, openBlock as t, createElementBlock as r, normalizeClass as m, normalizeStyle as f, toDisplayString as u, createCommentVNode as g } from "vue";
2
+ import { useMarkdown as w } from "../../composables/useMarkdown.js";
3
+ const v = ["innerHTML"], k = {
4
+ key: 2,
5
+ class: "of-field-md-preview__more"
6
+ }, M = /* @__PURE__ */ p({
7
+ __name: "FieldMarkdownPreview",
8
+ props: {
9
+ content: {},
10
+ maxLines: { default: 2 },
11
+ expanded: { type: Boolean, default: !1 }
12
+ },
13
+ setup(n) {
14
+ const e = n, { renderMarkdown: o } = w(), c = a(() => e.content ? i(e.content) : "—"), d = a(() => e.content ? o(e.content) : ""), s = a(() => e.content ? e.content.length > 100 || e.content.includes(`
15
+ `) : !1);
16
+ function i(l) {
17
+ return l.replace(/^#{1,6}\s+/gm, "").replace(/\*{1,3}(.*?)\*{1,3}/g, "$1").replace(/_{1,3}(.*?)_{1,3}/g, "$1").replace(/```[\s\S]*?```/g, "[代码]").replace(/`([^`]+)`/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/!\[([^\]]*)\]\([^)]+\)/g, "[图片]").replace(/^[\s]*[-*+]\s+/gm, "").replace(/^[\s]*\d+\.\s+/gm, "").replace(/^>\s+/gm, "").replace(/^---+$/gm, "").replace(/\n{2,}/g, " — ").replace(/\n/g, " ").trim();
18
+ }
19
+ return (l, x) => (t(), r("div", {
20
+ class: m(["of-field-md-preview", { "of-field-md-preview--expanded": n.expanded }])
21
+ }, [
22
+ n.expanded ? (t(), r("div", {
23
+ key: 1,
24
+ class: "of-field-md-preview__full of-markdown",
25
+ innerHTML: d.value
26
+ }, null, 8, v)) : (t(), r("span", {
27
+ key: 0,
28
+ class: "of-field-md-preview__text",
29
+ style: f({ "-webkit-line-clamp": n.maxLines })
30
+ }, u(c.value), 5)),
31
+ !n.expanded && s.value ? (t(), r("span", k, "...")) : g("", !0)
32
+ ], 2));
33
+ }
34
+ });
35
+ export {
36
+ M as default
37
+ };
@@ -1,7 +1,7 @@
1
1
  import t from "./FieldMultiSelect.vue2.js";
2
2
  /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
- const a = /* @__PURE__ */ o(t, [["__scopeId", "data-v-ca07bc35"]]);
4
+ const i = /* @__PURE__ */ o(t, [["__scopeId", "data-v-b204fd88"]]);
5
5
  export {
6
- a as default
6
+ i as default
7
7
  };
@@ -0,0 +1,17 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
15
+ inputRef: HTMLInputElement;
16
+ }, HTMLInputElement>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldPhone.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-16fe679a"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,34 @@
1
+ import { defineComponent as c, ref as i, onMounted as m, nextTick as s, withDirectives as v, openBlock as d, createElementBlock as y, vModelText as k } from "vue";
2
+ const b = /* @__PURE__ */ c({
3
+ __name: "FieldPhone",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ emits: ["commit", "cancel", "tabNext"],
9
+ setup(r, { emit: p }) {
10
+ const o = r, t = p, u = i(null), l = i(typeof o.value == "string" ? o.value : "");
11
+ m(() => s(() => {
12
+ var e;
13
+ return (e = u.value) == null ? void 0 : e.focus();
14
+ }));
15
+ function f(e) {
16
+ e.key === "Enter" && (e.preventDefault(), t("commit", l.value || null)), e.key === "Escape" && (e.preventDefault(), t("cancel")), e.key === "Tab" && (e.preventDefault(), t("commit", l.value || null), t("tabNext"));
17
+ }
18
+ return (e, n) => v((d(), y("input", {
19
+ ref_key: "inputRef",
20
+ ref: u,
21
+ class: "of-field-input",
22
+ type: "tel",
23
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => l.value = a),
24
+ placeholder: "输入电话号码",
25
+ onKeydown: f,
26
+ onBlur: n[1] || (n[1] = (a) => t("commit", l.value || null))
27
+ }, null, 544)), [
28
+ [k, l.value]
29
+ ]);
30
+ }
31
+ });
32
+ export {
33
+ b as default
34
+ };
@@ -0,0 +1,15 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
15
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldProgress.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a4750422"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,40 @@
1
+ import { defineComponent as d, ref as p, openBlock as g, createElementBlock as v, createElementVNode as o, normalizeStyle as _, unref as l, toDisplayString as y } from "vue";
2
+ const x = { class: "of-field-progress" }, h = { class: "of-field-progress-bar" }, b = ["min", "max", "value"], N = { class: "of-field-progress-label" }, C = /* @__PURE__ */ d({
3
+ __name: "FieldProgress",
4
+ props: {
5
+ value: { type: [String, Number, Boolean, Array, null] },
6
+ field: {}
7
+ },
8
+ emits: ["commit", "cancel", "tabNext"],
9
+ setup(r, { emit: c }) {
10
+ const e = r, m = c, s = e.field.type === "progress" && "min" in e.field ? e.field.min ?? 0 : 0, n = e.field.type === "progress" && "max" in e.field ? e.field.max ?? 100 : 100, t = p(typeof e.value == "number" ? e.value : 0);
11
+ function f(i) {
12
+ const a = i.target;
13
+ t.value = Number(a.value);
14
+ }
15
+ function u() {
16
+ m("commit", t.value);
17
+ }
18
+ return (i, a) => (g(), v("div", x, [
19
+ o("div", h, [
20
+ o("div", {
21
+ class: "of-field-progress-fill",
22
+ style: _({ width: `${(t.value - l(s)) / (l(n) - l(s)) * 100}%` })
23
+ }, null, 4)
24
+ ]),
25
+ o("input", {
26
+ class: "of-field-progress-slider",
27
+ type: "range",
28
+ min: l(s),
29
+ max: l(n),
30
+ value: t.value,
31
+ onInput: f,
32
+ onChange: u
33
+ }, null, 40, b),
34
+ o("span", N, y(t.value) + "%", 1)
35
+ ]));
36
+ }
37
+ });
38
+ export {
39
+ C as default
40
+ };
@@ -0,0 +1,17 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
15
+ inputRef: HTMLInputElement;
16
+ }, HTMLDivElement>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldRelation.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-7af66606"]]);
5
+ export {
6
+ f as default
7
+ };
@@ -0,0 +1,67 @@
1
+ import { defineComponent as x, ref as i, computed as _, onMounted as b, nextTick as N, openBlock as r, createElementBlock as u, withDirectives as V, createElementVNode as f, vModelText as h, Fragment as D, renderList as C, createTextVNode as E, toDisplayString as M, createCommentVNode as T } from "vue";
2
+ const A = {
3
+ key: 0,
4
+ class: "of-field-relation-tags"
5
+ }, B = ["onClick"], w = /* @__PURE__ */ x({
6
+ __name: "FieldRelation",
7
+ props: {
8
+ value: { type: [String, Number, Boolean, Array, null] },
9
+ field: {}
10
+ },
11
+ emits: ["commit", "cancel", "tabNext"],
12
+ setup(m, { emit: d }) {
13
+ const n = m, a = d, c = i(null), v = i(""), y = i(!1), t = i(
14
+ Array.isArray(n.value) ? n.value.filter((e) => typeof e == "string") : typeof n.value == "string" && n.value ? [n.value] : []
15
+ ), p = _(() => n.field.type !== "relation" ? !1 : n.field.relationMode === "many_to_many");
16
+ b(() => N(() => {
17
+ var e;
18
+ return (e = c.value) == null ? void 0 : e.focus();
19
+ }));
20
+ function g(e) {
21
+ if (p.value) {
22
+ const l = t.value.indexOf(e);
23
+ l >= 0 ? t.value.splice(l, 1) : t.value.push(e);
24
+ } else
25
+ t.value = [e], s();
26
+ }
27
+ function s() {
28
+ p.value ? a("commit", t.value.length > 0 ? t.value : null) : a("commit", t.value[0] ?? null);
29
+ }
30
+ function k(e) {
31
+ e.key === "Escape" && (e.preventDefault(), a("cancel")), e.key === "Enter" && (e.preventDefault(), s()), e.key === "Tab" && (e.preventDefault(), s(), a("tabNext"));
32
+ }
33
+ return (e, l) => (r(), u("div", {
34
+ class: "of-field-relation",
35
+ onKeydown: k
36
+ }, [
37
+ V(f("input", {
38
+ ref_key: "inputRef",
39
+ ref: c,
40
+ class: "of-field-relation-search",
41
+ type: "text",
42
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => v.value = o),
43
+ placeholder: "搜索关联记录...",
44
+ onFocus: l[1] || (l[1] = (o) => y.value = !0)
45
+ }, null, 544), [
46
+ [h, v.value]
47
+ ]),
48
+ t.value.length > 0 ? (r(), u("div", A, [
49
+ (r(!0), u(D, null, C(t.value, (o) => (r(), u("span", {
50
+ key: o,
51
+ class: "of-field-relation-tag"
52
+ }, [
53
+ E(M(o) + " ", 1),
54
+ f("button", {
55
+ type: "button",
56
+ class: "of-field-relation-tag-remove",
57
+ onClick: (F) => g(o)
58
+ }, " × ", 8, B)
59
+ ]))), 128))
60
+ ])) : T("", !0),
61
+ l[2] || (l[2] = f("div", { class: "of-field-relation-hint" }, "关联记录选择器(需由消费方通过 slot 提供数据源)", -1))
62
+ ], 32));
63
+ }
64
+ });
65
+ export {
66
+ w as default
67
+ };
@@ -0,0 +1,17 @@
1
+ import { CellValue, FieldDef } from '../table/FieldCell.vue';
2
+ type __VLS_Props = {
3
+ value?: CellValue;
4
+ field: FieldDef;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ cancel: () => any;
8
+ commit: (value: CellValue) => any;
9
+ tabNext: () => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ onCancel?: (() => any) | undefined;
12
+ onCommit?: ((value: CellValue) => any) | undefined;
13
+ onTabNext?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
15
+ editorRef: HTMLDivElement;
16
+ }, HTMLDivElement>;
17
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import o from "./FieldRichText.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b9f87e2f"]]);
5
+ export {
6
+ i as default
7
+ };