@oneflowui/ui 0.5.0 → 0.5.2
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/components/Dashboard/charts/BarChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/BarChart.vue2.js +11 -8
- package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
- package/dist/components/Dashboard/charts/PieChart.vue2.js +8 -5
- package/dist/components/Dashboard/index.vue.js +1 -1
- package/dist/components/Dashboard/index.vue2.js +20 -25
- package/dist/components/editor/RichTextEditor.vue2.js +1 -1
- package/dist/components/table/DataTable.vue.js +1 -1
- package/dist/components/table/DataTable.vue2.js +134 -135
- package/dist/components/table/FieldCell.vue.js +2 -2
- package/dist/components/table/FieldCell.vue2.js +16 -15
- package/dist/composables/useMarkdown.js +23 -23
- package/dist/composables/useWorkerSort.js +30 -29
- package/dist/index.d.ts +1 -5
- package/dist/index.js +250 -350
- package/dist/plugin.d.ts +5 -0
- package/dist/plugin.js +197 -0
- package/dist/style.css +1 -1
- package/dist/utils/echarts.d.ts +2 -0
- package/dist/utils/icon.d.ts +0 -5
- package/dist/utils/icon.js +72 -11
- package/dist/workers/tableWorkerSource.js +79 -0
- package/package.json +2 -3
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/assets/tableWorker-CTsbCPPP.js +0 -1
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +0 -5
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +0 -377
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +0 -923
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +0 -151
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +0 -240
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +0 -658
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +0 -38
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +0 -216
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +0 -13
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +0 -399
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +0 -305
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +0 -615
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +0 -753
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +0 -219
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +0 -183
- package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +0 -1063
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { marked as o } from "marked";
|
|
2
|
-
import e from "
|
|
3
|
-
import l from "
|
|
4
|
-
import p from "
|
|
5
|
-
import u from "
|
|
6
|
-
import n from "
|
|
7
|
-
import j from "
|
|
8
|
-
import w from "
|
|
9
|
-
import c from "
|
|
10
|
-
import k from "
|
|
11
|
-
import f from "
|
|
12
|
-
import L from "
|
|
13
|
-
import $ from "
|
|
14
|
-
import q from "
|
|
15
|
-
import B from "
|
|
16
|
-
import
|
|
17
|
-
e.registerLanguage("plaintext",
|
|
18
|
-
e.registerLanguage("text",
|
|
19
|
-
e.registerLanguage("txt",
|
|
2
|
+
import e from "highlight.js/lib/core";
|
|
3
|
+
import l from "highlight.js/lib/languages/javascript";
|
|
4
|
+
import p from "highlight.js/lib/languages/typescript";
|
|
5
|
+
import u from "highlight.js/lib/languages/python";
|
|
6
|
+
import n from "highlight.js/lib/languages/bash";
|
|
7
|
+
import j from "highlight.js/lib/languages/json";
|
|
8
|
+
import w from "highlight.js/lib/languages/sql";
|
|
9
|
+
import c from "highlight.js/lib/languages/xml";
|
|
10
|
+
import k from "highlight.js/lib/languages/css";
|
|
11
|
+
import f from "highlight.js/lib/languages/markdown";
|
|
12
|
+
import L from "highlight.js/lib/languages/yaml";
|
|
13
|
+
import $ from "highlight.js/lib/languages/java";
|
|
14
|
+
import q from "highlight.js/lib/languages/go";
|
|
15
|
+
import B from "highlight.js/lib/languages/rust";
|
|
16
|
+
import s from "highlight.js/lib/languages/plaintext";
|
|
17
|
+
e.registerLanguage("plaintext", s);
|
|
18
|
+
e.registerLanguage("text", s);
|
|
19
|
+
e.registerLanguage("txt", s);
|
|
20
20
|
e.registerLanguage("javascript", l);
|
|
21
21
|
e.registerLanguage("js", l);
|
|
22
22
|
e.registerLanguage("typescript", p);
|
|
@@ -38,9 +38,9 @@ e.registerLanguage("yml", L);
|
|
|
38
38
|
e.registerLanguage("java", $);
|
|
39
39
|
e.registerLanguage("go", q);
|
|
40
40
|
e.registerLanguage("rust", B);
|
|
41
|
-
function Q(
|
|
42
|
-
const { showCopyButton:
|
|
43
|
-
|
|
41
|
+
function Q(d = {}) {
|
|
42
|
+
const { showCopyButton: h = !1, t: y = (r) => r } = d, i = new o.Renderer();
|
|
43
|
+
i.code = function(r, x) {
|
|
44
44
|
const m = typeof r == "object" ? r.text || "" : r, t = typeof r == "object" ? r.lang || "" : x || "", a = t && e.getLanguage(t) ? t : "plaintext";
|
|
45
45
|
let g = "";
|
|
46
46
|
try {
|
|
@@ -48,7 +48,7 @@ function Q(h = {}) {
|
|
|
48
48
|
} catch {
|
|
49
49
|
g = e.highlight(m, { language: "plaintext" }).value;
|
|
50
50
|
}
|
|
51
|
-
const v =
|
|
51
|
+
const v = h ? `<button onclick="navigator.clipboard.writeText(this.parentElement.nextElementSibling.innerText)" class="of-markdown-copy-btn">${y("common.copy")}</button>` : "";
|
|
52
52
|
return `<div class="of-code-block-wrapper">
|
|
53
53
|
<div class="of-code-block-header">
|
|
54
54
|
<span class="of-code-block-lang">${a}</span>
|
|
@@ -56,7 +56,7 @@ function Q(h = {}) {
|
|
|
56
56
|
</div>
|
|
57
57
|
<pre class="of-code-block-pre"><code class="hljs language-${a}">${g}</code></pre>
|
|
58
58
|
</div>`;
|
|
59
|
-
}, o.use({ renderer:
|
|
59
|
+
}, o.use({ renderer: i });
|
|
60
60
|
function b(r) {
|
|
61
61
|
return o.parse(r);
|
|
62
62
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { ref as y, onUnmounted as L, readonly as b } from "vue";
|
|
2
|
+
import S from "../workers/tableWorkerSource.js";
|
|
3
|
+
const h = 5e3;
|
|
4
|
+
function d(p = {}) {
|
|
5
|
+
const i = y(!1);
|
|
6
|
+
let n = null, a = null;
|
|
7
|
+
function c() {
|
|
7
8
|
if (n) return n;
|
|
8
9
|
try {
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
), {
|
|
10
|
+
return a = URL.createObjectURL(
|
|
11
|
+
new Blob([S], {
|
|
12
|
+
type: "text/javascript;charset=utf-8"
|
|
13
|
+
})
|
|
14
|
+
), n = new Worker(a, {
|
|
14
15
|
type: "module"
|
|
15
16
|
}), n;
|
|
16
17
|
} catch {
|
|
@@ -19,41 +20,41 @@ function d(c = {}) {
|
|
|
19
20
|
}
|
|
20
21
|
function m(e) {
|
|
21
22
|
var s;
|
|
22
|
-
return ((s =
|
|
23
|
+
return ((s = p.enabled) == null ? void 0 : s.value) === !1 ? !1 : e >= h;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function v(e, s, f) {
|
|
25
26
|
if (!m(e.length))
|
|
26
27
|
return Promise.resolve(
|
|
27
|
-
[...e].sort((o,
|
|
28
|
-
const r = o[s],
|
|
29
|
-
return r == null &&
|
|
28
|
+
[...e].sort((o, l) => {
|
|
29
|
+
const r = o[s], u = l[s];
|
|
30
|
+
return r == null && u == null ? 0 : r == null ? 1 : u == null ? -1 : typeof r == "number" && typeof u == "number" ? f === "asc" ? r - u : u - r : f === "asc" ? String(r).localeCompare(String(u)) : String(u).localeCompare(String(r));
|
|
30
31
|
})
|
|
31
32
|
);
|
|
32
|
-
const t =
|
|
33
|
+
const t = c();
|
|
33
34
|
return t ? (i.value = !0, new Promise((o) => {
|
|
34
|
-
const
|
|
35
|
-
t.removeEventListener("message",
|
|
35
|
+
const l = (r) => {
|
|
36
|
+
t.removeEventListener("message", l), i.value = !1, r.data.type === "sort-result" ? o(r.data.data) : o([...e]);
|
|
36
37
|
};
|
|
37
|
-
t.addEventListener("message",
|
|
38
|
+
t.addEventListener("message", l), t.postMessage({ type: "sort", data: e, field: s, order: f });
|
|
38
39
|
})) : Promise.resolve([...e]);
|
|
39
40
|
}
|
|
40
|
-
function g(e, s,
|
|
41
|
+
function g(e, s, f = "and") {
|
|
41
42
|
if (!m(e.length))
|
|
42
43
|
return Promise.resolve(e);
|
|
43
|
-
const t =
|
|
44
|
+
const t = c();
|
|
44
45
|
return t ? (i.value = !0, new Promise((o) => {
|
|
45
|
-
const
|
|
46
|
-
t.removeEventListener("message",
|
|
46
|
+
const l = (r) => {
|
|
47
|
+
t.removeEventListener("message", l), i.value = !1, r.data.type === "filter-result" ? o(r.data.data) : o(e);
|
|
47
48
|
};
|
|
48
|
-
t.addEventListener("message",
|
|
49
|
+
t.addEventListener("message", l), t.postMessage({ type: "filter", data: e, conditions: s, logic: f });
|
|
49
50
|
})) : Promise.resolve(e);
|
|
50
51
|
}
|
|
51
|
-
return
|
|
52
|
-
n == null || n.terminate(), n = null;
|
|
52
|
+
return L(() => {
|
|
53
|
+
n == null || n.terminate(), n = null, a && (URL.revokeObjectURL(a), a = null);
|
|
53
54
|
}), {
|
|
54
|
-
requestSort:
|
|
55
|
+
requestSort: v,
|
|
55
56
|
requestFilter: g,
|
|
56
|
-
processing:
|
|
57
|
+
processing: b(i)
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
60
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
1
|
export { ViewTab, ToolbarBtn, AddViewBtn, Badge, RangeSlider, ProgressBar, ButtonGroup, EmptyState, StatisticCard, DropdownMenu, StatusIndicator, Switch, Stepper, Accordion, Avatar, RefTag, DescBlock, ViewModeGroup, ViewSwitcher, SelectBadge, ChainItem, SectionBlock, MonitorItem, StatusSummary, InfoCard, PersonaCard, SearchHighlight, } from './components/base';
|
|
3
2
|
export type { ButtonOption, EmptyStateAction, MenuItem, StepItem, StepperProps, StepStatus, AvatarProps, RefTagProps, ViewModeOption, ViewModeGroupProps, ViewSwitcherTab, ViewSwitcherProps, SelectBadgeProps, ChainItemProps, SectionBlockProps, MonitorItemProps, StatusSummaryProps, StatusSummaryItem, InfoCardProps, PersonaCardProps, } from './components/base';
|
|
4
3
|
export { AppLayout, Navbar, Sidebar, StatusBar } from './components/layout';
|
|
@@ -72,7 +71,4 @@ export { useDatabaseView } from './composables/useDatabaseView';
|
|
|
72
71
|
export type { DatabaseViewMode, DatabaseViewFetchParams, DatabaseViewFetchResult, DatabaseViewProvider, DatabaseSchemaEvent, DatabaseViewActions, UseDatabaseViewOptions, UseDatabaseViewResult, } from './composables/useDatabaseView';
|
|
73
72
|
export { useSearch } from './composables/useSearch';
|
|
74
73
|
export type { UseSearchOptions, SearchHighlight as SearchHighlightSegment, } from './composables/useSearch';
|
|
75
|
-
export
|
|
76
|
-
install(app: App): void;
|
|
77
|
-
};
|
|
78
|
-
export default OneflowUI;
|
|
74
|
+
export { OneflowUI, default } from './plugin';
|