@dou-ui/sheet 0.0.0-stage → 0.1.0-alpha.1
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/LICENSE +21 -0
- package/README.md +10 -2
- package/dist/cell-types.js +20 -0
- package/dist/cell-types.js.map +1 -0
- package/dist/code/code-formula-bar.js +6 -0
- package/dist/code/code-formula-bar.js.map +1 -0
- package/dist/code/code-formula-bar.vue_vue_type_script_setup_true_lang.js +192 -0
- package/dist/code/code-formula-bar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/code/index.js +12 -0
- package/dist/code/index.js.map +1 -0
- package/dist/code/language.js +51 -0
- package/dist/code/language.js.map +1 -0
- package/dist/code/style.d.ts +1 -0
- package/dist/code/style.js +2 -0
- package/dist/collaboration/anchor.js +143 -0
- package/dist/collaboration/anchor.js.map +1 -0
- package/dist/collaboration/index.js +770 -0
- package/dist/collaboration/index.js.map +1 -0
- package/dist/collaboration/peers.js +87 -0
- package/dist/collaboration/peers.js.map +1 -0
- package/dist/collaboration/shared.js +450 -0
- package/dist/collaboration/shared.js.map +1 -0
- package/dist/components/cell-panel.js +6 -0
- package/dist/components/cell-panel.js.map +1 -0
- package/dist/components/cell-panel.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/components/cell-panel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/cell-renders.js +40 -0
- package/dist/components/cell-renders.js.map +1 -0
- package/dist/components/date-panel.js +6 -0
- package/dist/components/date-panel.js.map +1 -0
- package/dist/components/date-panel.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/date-panel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/filter-panel.js +6 -0
- package/dist/components/filter-panel.js.map +1 -0
- package/dist/components/filter-panel.vue_vue_type_script_setup_true_lang.js +259 -0
- package/dist/components/filter-panel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/format-dialog.js +6 -0
- package/dist/components/format-dialog.js.map +1 -0
- package/dist/components/format-dialog.vue_vue_type_script_setup_true_lang.js +432 -0
- package/dist/components/format-dialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/format-list.js +6 -0
- package/dist/components/format-list.js.map +1 -0
- package/dist/components/format-list.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/components/format-list.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/format-presets.js +97 -0
- package/dist/components/format-presets.js.map +1 -0
- package/dist/components/option-panel.js +6 -0
- package/dist/components/option-panel.js.map +1 -0
- package/dist/components/option-panel.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/components/option-panel.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-comment.js +6 -0
- package/dist/components/sheet-comment.js.map +1 -0
- package/dist/components/sheet-comment.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/components/sheet-comment.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-formula-bar.js +6 -0
- package/dist/components/sheet-formula-bar.js.map +1 -0
- package/dist/components/sheet-formula-bar.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/components/sheet-formula-bar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-link.js +6 -0
- package/dist/components/sheet-link.js.map +1 -0
- package/dist/components/sheet-link.vue_vue_type_script_setup_true_lang.js +249 -0
- package/dist/components/sheet-link.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-menu.js +6 -0
- package/dist/components/sheet-menu.js.map +1 -0
- package/dist/components/sheet-menu.vue_vue_type_script_setup_true_lang.js +115 -0
- package/dist/components/sheet-menu.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-name-box.js +6 -0
- package/dist/components/sheet-name-box.js.map +1 -0
- package/dist/components/sheet-name-box.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/components/sheet-name-box.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-note.js +6 -0
- package/dist/components/sheet-note.js.map +1 -0
- package/dist/components/sheet-note.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/sheet-note.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-outline.js +6 -0
- package/dist/components/sheet-outline.js.map +1 -0
- package/dist/components/sheet-outline.vue_vue_type_script_setup_true_lang.js +237 -0
- package/dist/components/sheet-outline.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-tabs.js +6 -0
- package/dist/components/sheet-tabs.js.map +1 -0
- package/dist/components/sheet-tabs.vue_vue_type_script_setup_true_lang.js +487 -0
- package/dist/components/sheet-tabs.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/sheet-toolbar.js +6 -0
- package/dist/components/sheet-toolbar.js.map +1 -0
- package/dist/components/sheet-toolbar.vue_vue_type_script_setup_true_lang.js +1562 -0
- package/dist/components/sheet-toolbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/components/validation-dialog.js +6 -0
- package/dist/components/validation-dialog.js.map +1 -0
- package/dist/components/validation-dialog.vue_vue_type_script_setup_true_lang.js +370 -0
- package/dist/components/validation-dialog.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/context.js +12 -0
- package/dist/context.js.map +1 -0
- package/dist/core/address.js +256 -0
- package/dist/core/address.js.map +1 -0
- package/dist/core/axis.js +72 -0
- package/dist/core/axis.js.map +1 -0
- package/dist/core/cell-type.js +30 -0
- package/dist/core/cell-type.js.map +1 -0
- package/dist/core/clipboard.js +141 -0
- package/dist/core/clipboard.js.map +1 -0
- package/dist/core/commands.js +63 -0
- package/dist/core/commands.js.map +1 -0
- package/dist/core/comments.js +74 -0
- package/dist/core/comments.js.map +1 -0
- package/dist/core/conditional.js +362 -0
- package/dist/core/conditional.js.map +1 -0
- package/dist/core/csv.js +191 -0
- package/dist/core/csv.js.map +1 -0
- package/dist/core/data.js +118 -0
- package/dist/core/data.js.map +1 -0
- package/dist/core/document.js +187 -0
- package/dist/core/document.js.map +1 -0
- package/dist/core/extension.js +60 -0
- package/dist/core/extension.js.map +1 -0
- package/dist/core/file.js +336 -0
- package/dist/core/file.js.map +1 -0
- package/dist/core/fill.js +153 -0
- package/dist/core/fill.js.map +1 -0
- package/dist/core/find.js +42 -0
- package/dist/core/find.js.map +1 -0
- package/dist/core/format.js +404 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/group.js +134 -0
- package/dist/core/group.js.map +1 -0
- package/dist/core/history.js +68 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/index.js +17 -0
- package/dist/core/link.js +34 -0
- package/dist/core/link.js.map +1 -0
- package/dist/core/merge.js +105 -0
- package/dist/core/merge.js.map +1 -0
- package/dist/core/model.js +48 -0
- package/dist/core/model.js.map +1 -0
- package/dist/core/nav.js +44 -0
- package/dist/core/nav.js.map +1 -0
- package/dist/core/paint.js +106 -0
- package/dist/core/paint.js.map +1 -0
- package/dist/core/plain-cell-types.js +54 -0
- package/dist/core/plain-cell-types.js.map +1 -0
- package/dist/core/protect.js +246 -0
- package/dist/core/protect.js.map +1 -0
- package/dist/core/selection.js +37 -0
- package/dist/core/selection.js.map +1 -0
- package/dist/core/transaction.js +1582 -0
- package/dist/core/transaction.js.map +1 -0
- package/dist/core/validation.js +135 -0
- package/dist/core/validation.js.map +1 -0
- package/dist/core/versions.js +161 -0
- package/dist/core/versions.js.map +1 -0
- package/dist/export/color.js +36 -0
- package/dist/export/color.js.map +1 -0
- package/dist/export/draw.js +316 -0
- package/dist/export/draw.js.map +1 -0
- package/dist/export/index.js +390 -0
- package/dist/export/index.js.map +1 -0
- package/dist/formula/edit.js +210 -0
- package/dist/formula/edit.js.map +1 -0
- package/dist/formula/engine.js +526 -0
- package/dist/formula/engine.js.map +1 -0
- package/dist/formula/error.js +39 -0
- package/dist/formula/error.js.map +1 -0
- package/dist/formula/functions.js +1493 -0
- package/dist/formula/functions.js.map +1 -0
- package/dist/formula/help.js +408 -0
- package/dist/formula/help.js.map +1 -0
- package/dist/formula/index.js +7 -0
- package/dist/formula/parse.js +369 -0
- package/dist/formula/parse.js.map +1 -0
- package/dist/formula/values.js +123 -0
- package/dist/formula/values.js.map +1 -0
- package/dist/formulas.js +30 -0
- package/dist/formulas.js.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/locale.js +1312 -0
- package/dist/locale.js.map +1 -0
- package/dist/sheet.js +6 -0
- package/dist/sheet.js.map +1 -0
- package/dist/sheet.vue_vue_type_script_setup_true_lang.js +7166 -0
- package/dist/sheet.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/style.d.ts +1 -0
- package/dist/style.js +17 -0
- package/dist/types/cell-types.d.ts +2 -0
- package/dist/types/code/code-formula-bar.vue.d.ts +3 -0
- package/dist/types/code/index.d.ts +12 -0
- package/dist/types/code/language.d.ts +13 -0
- package/dist/types/collaboration/anchor.d.ts +65 -0
- package/dist/types/collaboration/index.d.ts +59 -0
- package/dist/types/collaboration/peers.d.ts +21 -0
- package/dist/types/collaboration/shared.d.ts +75 -0
- package/dist/types/components/cell-panel.vue.d.ts +20 -0
- package/dist/types/components/cell-renders.d.ts +9 -0
- package/dist/types/components/date-panel.vue.d.ts +9 -0
- package/dist/types/components/filter-panel.vue.d.ts +21 -0
- package/dist/types/components/format-dialog.vue.d.ts +24 -0
- package/dist/types/components/format-list.vue.d.ts +25 -0
- package/dist/types/components/format-presets.d.ts +30 -0
- package/dist/types/components/option-panel.vue.d.ts +13 -0
- package/dist/types/components/sheet-comment.vue.d.ts +29 -0
- package/dist/types/components/sheet-formula-bar.vue.d.ts +3 -0
- package/dist/types/components/sheet-link.vue.d.ts +32 -0
- package/dist/types/components/sheet-menu.vue.d.ts +20 -0
- package/dist/types/components/sheet-name-box.vue.d.ts +3 -0
- package/dist/types/components/sheet-note.vue.d.ts +22 -0
- package/dist/types/components/sheet-outline.vue.d.ts +36 -0
- package/dist/types/components/sheet-tabs.vue.d.ts +9 -0
- package/dist/types/components/sheet-toolbar.vue.d.ts +11 -0
- package/dist/types/components/validation-dialog.vue.d.ts +25 -0
- package/dist/types/context.d.ts +189 -0
- package/dist/types/core/address.d.ts +109 -0
- package/dist/types/core/axis.d.ts +23 -0
- package/dist/types/core/cell-type.d.ts +157 -0
- package/dist/types/core/clipboard.d.ts +48 -0
- package/dist/types/core/commands.d.ts +76 -0
- package/dist/types/core/comments.d.ts +22 -0
- package/dist/types/core/conditional.d.ts +114 -0
- package/dist/types/core/csv.d.ts +93 -0
- package/dist/types/core/data.d.ts +26 -0
- package/dist/types/core/document.d.ts +49 -0
- package/dist/types/core/extension.d.ts +177 -0
- package/dist/types/core/file.d.ts +301 -0
- package/dist/types/core/fill.d.ts +23 -0
- package/dist/types/core/find.d.ts +39 -0
- package/dist/types/core/format.d.ts +47 -0
- package/dist/types/core/group.d.ts +76 -0
- package/dist/types/core/history.d.ts +27 -0
- package/dist/types/core/index.d.ts +33 -0
- package/dist/types/core/link.d.ts +14 -0
- package/dist/types/core/merge.d.ts +26 -0
- package/dist/types/core/model.d.ts +363 -0
- package/dist/types/core/nav.d.ts +15 -0
- package/dist/types/core/paint.d.ts +19 -0
- package/dist/types/core/plain-cell-types.d.ts +6 -0
- package/dist/types/core/protect.d.ts +34 -0
- package/dist/types/core/selection.d.ts +25 -0
- package/dist/types/core/transaction.d.ts +470 -0
- package/dist/types/core/validation.d.ts +55 -0
- package/dist/types/core/versions.d.ts +38 -0
- package/dist/types/export/color.d.ts +7 -0
- package/dist/types/export/draw.d.ts +98 -0
- package/dist/types/export/index.d.ts +47 -0
- package/dist/types/formula/edit.d.ts +62 -0
- package/dist/types/formula/engine.d.ts +99 -0
- package/dist/types/formula/error.d.ts +30 -0
- package/dist/types/formula/functions.d.ts +62 -0
- package/dist/types/formula/help.d.ts +12 -0
- package/dist/types/formula/index.d.ts +13 -0
- package/dist/types/formula/parse.d.ts +92 -0
- package/dist/types/formula/values.d.ts +65 -0
- package/dist/types/formulas.d.ts +32 -0
- package/dist/types/index.d.ts +225 -0
- package/dist/types/locale.d.ts +531 -0
- package/dist/types/sheet.vue.d.ts +60 -0
- package/dist/types/types.d.ts +498 -0
- package/dist/types/use-comments.d.ts +47 -0
- package/dist/types/use-messages.d.ts +7 -0
- package/dist/use-comments.js +130 -0
- package/dist/use-comments.js.map +1 -0
- package/dist/use-messages.js +29 -0
- package/dist/use-messages.js.map +1 -0
- package/package.json +93 -4
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ruleRangeText } from "../core/conditional.js";
|
|
2
|
+
import { format } from "../locale.js";
|
|
3
|
+
import { formatSample } from "./format-presets.js";
|
|
4
|
+
import { DouButton, DouDialog, DouTooltip } from "dou-ui";
|
|
5
|
+
import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeModels, normalizeClass, normalizeStyle, openBlock, renderList, toDisplayString, unref, useId, useModel, withCtx } from "vue";
|
|
6
|
+
import { ArrowDownIcon, ArrowUpIcon, PencilIcon, TrashIcon } from "@dou-ui/icons";
|
|
7
|
+
// src/components/format-list.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var _hoisted_1 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "dou-sheet-formats__empty"
|
|
11
|
+
};
|
|
12
|
+
var _hoisted_2 = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "dou-sheet-formats"
|
|
15
|
+
};
|
|
16
|
+
var _hoisted_3 = { class: "dou-sheet-formats__what" };
|
|
17
|
+
var _hoisted_4 = ["id"];
|
|
18
|
+
var _hoisted_5 = { class: "dou-sheet-formats__range" };
|
|
19
|
+
var _hoisted_6 = { class: "dou-sheet-formats__actions" };
|
|
20
|
+
var format_list_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
21
|
+
__name: "format-list",
|
|
22
|
+
props: /*@__PURE__*/ mergeModels({
|
|
23
|
+
formats: {},
|
|
24
|
+
styles: {},
|
|
25
|
+
messages: {}
|
|
26
|
+
}, {
|
|
27
|
+
"open": {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
"openModifiers": {}
|
|
32
|
+
}),
|
|
33
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
34
|
+
"change",
|
|
35
|
+
"edit",
|
|
36
|
+
"closed"
|
|
37
|
+
], ["update:open"]),
|
|
38
|
+
setup(__props, { emit: __emit }) {
|
|
39
|
+
const props = __props;
|
|
40
|
+
const open = useModel(__props, "open");
|
|
41
|
+
const emit = __emit;
|
|
42
|
+
const m = computed(() => props.messages.formats);
|
|
43
|
+
const uid = useId();
|
|
44
|
+
const text = (value) => typeof value === "string" ? `“${value}”` : String(value ?? "");
|
|
45
|
+
/** What a format checks, in words. */
|
|
46
|
+
function describe(f) {
|
|
47
|
+
const d = m.value.describe;
|
|
48
|
+
if ("when" in f) {
|
|
49
|
+
const { op, value, to } = f.when;
|
|
50
|
+
return format(op === "between" || op === "notBetween" ? d.between : d.when, {
|
|
51
|
+
op: props.messages.ops[op],
|
|
52
|
+
value: text(value),
|
|
53
|
+
to: text(to)
|
|
54
|
+
}).trim();
|
|
55
|
+
}
|
|
56
|
+
if ("formula" in f) return format(d.formula, { formula: f.formula });
|
|
57
|
+
if ("top" in f && f.top != null) return format(f.percent ? d.topPercent : d.top, { count: f.top });
|
|
58
|
+
if ("bottom" in f && f.bottom != null) return format(f.percent ? d.bottomPercent : d.bottom, { count: f.bottom });
|
|
59
|
+
if ("average" in f) return f.average === "above" ? d.above : d.below;
|
|
60
|
+
if ("duplicates" in f) return d.repeated;
|
|
61
|
+
if ("unique" in f) return d.unique;
|
|
62
|
+
if ("scale" in f) return d.scale;
|
|
63
|
+
return d.bar;
|
|
64
|
+
}
|
|
65
|
+
const sample = (f) => formatSample(f, props.styles);
|
|
66
|
+
function move(index, by) {
|
|
67
|
+
const list = [...props.formats];
|
|
68
|
+
const [item] = list.splice(index, 1);
|
|
69
|
+
list.splice(index + by, 0, item);
|
|
70
|
+
emit("change", list);
|
|
71
|
+
}
|
|
72
|
+
function remove(index) {
|
|
73
|
+
emit("change", props.formats.filter((_, i) => i !== index));
|
|
74
|
+
}
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return openBlock(), createBlock(unref(DouDialog), {
|
|
77
|
+
open: open.value,
|
|
78
|
+
"onUpdate:open": _cache[0] || (_cache[0] = ($event) => open.value = $event),
|
|
79
|
+
title: m.value.title,
|
|
80
|
+
width: 520,
|
|
81
|
+
onClosed: _cache[1] || (_cache[1] = ($event) => emit("closed"))
|
|
82
|
+
}, {
|
|
83
|
+
footer: withCtx(({ close }) => [createVNode(unref(DouButton), {
|
|
84
|
+
variant: "outline",
|
|
85
|
+
onClick: close
|
|
86
|
+
}, {
|
|
87
|
+
default: withCtx(() => [createTextVNode(toDisplayString(m.value.close), 1)]),
|
|
88
|
+
_: 2
|
|
89
|
+
}, 1032, ["onClick"])]),
|
|
90
|
+
default: withCtx(() => [!__props.formats.length ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(m.value.empty), 1)) : (openBlock(), createElementBlock("ol", _hoisted_2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.formats, (f, i) => {
|
|
91
|
+
return openBlock(), createElementBlock("li", {
|
|
92
|
+
key: i,
|
|
93
|
+
class: "dou-sheet-formats__item"
|
|
94
|
+
}, [
|
|
95
|
+
createElementVNode("span", {
|
|
96
|
+
class: normalizeClass(["dou-sheet-format__sample", sample(f).cls]),
|
|
97
|
+
style: normalizeStyle(sample(f).css),
|
|
98
|
+
"aria-hidden": "true"
|
|
99
|
+
}, "123", 6),
|
|
100
|
+
createElementVNode("span", _hoisted_3, [createElementVNode("span", {
|
|
101
|
+
id: `${unref(uid)}-${i}`,
|
|
102
|
+
class: "dou-sheet-formats__rule"
|
|
103
|
+
}, toDisplayString(describe(f)), 9, _hoisted_4), createElementVNode("span", _hoisted_5, toDisplayString(unref(ruleRangeText)(f.range)), 1)]),
|
|
104
|
+
createElementVNode("span", _hoisted_6, [
|
|
105
|
+
createVNode(unref(DouTooltip), { content: m.value.edit }, {
|
|
106
|
+
default: withCtx(() => [createVNode(unref(DouButton), {
|
|
107
|
+
variant: "ghost",
|
|
108
|
+
size: "sm",
|
|
109
|
+
"aria-label": m.value.edit,
|
|
110
|
+
"aria-describedby": `${unref(uid)}-${i}`,
|
|
111
|
+
onClick: ($event) => emit("edit", i)
|
|
112
|
+
}, {
|
|
113
|
+
default: withCtx(() => [createVNode(unref(PencilIcon))]),
|
|
114
|
+
_: 1
|
|
115
|
+
}, 8, [
|
|
116
|
+
"aria-label",
|
|
117
|
+
"aria-describedby",
|
|
118
|
+
"onClick"
|
|
119
|
+
])]),
|
|
120
|
+
_: 2
|
|
121
|
+
}, 1032, ["content"]),
|
|
122
|
+
createVNode(unref(DouTooltip), { content: m.value.moveUp }, {
|
|
123
|
+
default: withCtx(() => [createVNode(unref(DouButton), {
|
|
124
|
+
variant: "ghost",
|
|
125
|
+
size: "sm",
|
|
126
|
+
"aria-label": m.value.moveUp,
|
|
127
|
+
"aria-describedby": `${unref(uid)}-${i}`,
|
|
128
|
+
disabled: i === 0,
|
|
129
|
+
onClick: ($event) => move(i, -1)
|
|
130
|
+
}, {
|
|
131
|
+
default: withCtx(() => [createVNode(unref(ArrowUpIcon))]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 8, [
|
|
134
|
+
"aria-label",
|
|
135
|
+
"aria-describedby",
|
|
136
|
+
"disabled",
|
|
137
|
+
"onClick"
|
|
138
|
+
])]),
|
|
139
|
+
_: 2
|
|
140
|
+
}, 1032, ["content"]),
|
|
141
|
+
createVNode(unref(DouTooltip), { content: m.value.moveDown }, {
|
|
142
|
+
default: withCtx(() => [createVNode(unref(DouButton), {
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
size: "sm",
|
|
145
|
+
"aria-label": m.value.moveDown,
|
|
146
|
+
"aria-describedby": `${unref(uid)}-${i}`,
|
|
147
|
+
disabled: i === __props.formats.length - 1,
|
|
148
|
+
onClick: ($event) => move(i, 1)
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => [createVNode(unref(ArrowDownIcon))]),
|
|
151
|
+
_: 1
|
|
152
|
+
}, 8, [
|
|
153
|
+
"aria-label",
|
|
154
|
+
"aria-describedby",
|
|
155
|
+
"disabled",
|
|
156
|
+
"onClick"
|
|
157
|
+
])]),
|
|
158
|
+
_: 2
|
|
159
|
+
}, 1032, ["content"]),
|
|
160
|
+
createVNode(unref(DouTooltip), { content: m.value.remove }, {
|
|
161
|
+
default: withCtx(() => [createVNode(unref(DouButton), {
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "sm",
|
|
164
|
+
"aria-label": m.value.remove,
|
|
165
|
+
"aria-describedby": `${unref(uid)}-${i}`,
|
|
166
|
+
onClick: ($event) => remove(i)
|
|
167
|
+
}, {
|
|
168
|
+
default: withCtx(() => [createVNode(unref(TrashIcon))]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, [
|
|
171
|
+
"aria-label",
|
|
172
|
+
"aria-describedby",
|
|
173
|
+
"onClick"
|
|
174
|
+
])]),
|
|
175
|
+
_: 2
|
|
176
|
+
}, 1032, ["content"])
|
|
177
|
+
])
|
|
178
|
+
]);
|
|
179
|
+
}), 128))]))]),
|
|
180
|
+
_: 1
|
|
181
|
+
}, 8, ["open", "title"]);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
export { format_list_vue_vue_type_script_setup_true_lang_default as default };
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=format-list.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-list.vue_vue_type_script_setup_true_lang.js","names":["_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createTextVNode","_toDisplayString","_createElementBlock","_Fragment","_renderList","_createElementVNode","_normalizeClass","_normalizeStyle"],"sources":["../../src/components/format-list.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ArrowDownIcon, ArrowUpIcon, PencilIcon, TrashIcon } from '@dou-ui/icons'\nimport { DouButton, DouDialog, DouTooltip } from 'dou-ui'\nimport { computed, useId } from 'vue'\nimport { ruleRangeText } from '../core/conditional'\nimport type { SheetConditionalFormat, SheetStyle, SheetValue } from '../core/model'\nimport { format, type SheetMessages } from '../locale'\nimport { formatSample } from './format-presets'\n\n/*\n * The conditional formats of the sheet shown, in the order they apply:\n * what each checks, its cells and how they look, to edit, reorder or delete.\n */\n\nconst props = defineProps<{\n formats: readonly SheetConditionalFormat[]\n /** The workbook's named styles, for formats that name one. */\n styles: Record<string, SheetStyle> | undefined\n messages: SheetMessages\n}>()\nconst open = defineModel<boolean>('open', { required: true })\nconst emit = defineEmits<{\n change: [formats: SheetConditionalFormat[]]\n /** Asks to edit the format at `index`. */\n edit: [index: number]\n closed: []\n}>()\n\nconst m = computed(() => props.messages.formats)\nconst uid = useId()\n\nconst text = (value: SheetValue | undefined) =>\n typeof value === 'string' ? `“${value}”` : String(value ?? '')\n\n/** What a format checks, in words. */\nfunction describe(f: SheetConditionalFormat) {\n const d = m.value.describe\n if ('when' in f) {\n const { op, value, to } = f.when\n const between = op === 'between' || op === 'notBetween'\n return format(between ? d.between : d.when, {\n op: props.messages.ops[op],\n value: text(value),\n to: text(to),\n }).trim()\n }\n if ('formula' in f) return format(d.formula, { formula: f.formula })\n if ('top' in f && f.top != null) return format(f.percent ? d.topPercent : d.top, { count: f.top })\n if ('bottom' in f && f.bottom != null)\n return format(f.percent ? d.bottomPercent : d.bottom, { count: f.bottom })\n if ('average' in f) return f.average === 'above' ? d.above : d.below\n if ('duplicates' in f) return d.repeated\n if ('unique' in f) return d.unique\n if ('scale' in f) return d.scale\n return d.bar\n}\n\nconst sample = (f: SheetConditionalFormat) => formatSample(f, props.styles)\n\nfunction move(index: number, by: number) {\n const list = [...props.formats]\n const [item] = list.splice(index, 1)\n list.splice(index + by, 0, item!)\n emit('change', list)\n}\nfunction remove(index: number) {\n emit(\n 'change',\n props.formats.filter((_, i) => i !== index),\n )\n}\n</script>\n\n<template>\n <DouDialog v-model:open=\"open\" :title=\"m.title\" :width=\"520\" @closed=\"emit('closed')\">\n <p v-if=\"!formats.length\" class=\"dou-sheet-formats__empty\">{{ m.empty }}</p>\n <ol v-else class=\"dou-sheet-formats\">\n <li v-for=\"(f, i) in formats\" :key=\"i\" class=\"dou-sheet-formats__item\">\n <span\n class=\"dou-sheet-format__sample\"\n :class=\"sample(f).cls\"\n :style=\"sample(f).css\"\n aria-hidden=\"true\"\n >123</span\n >\n <span class=\"dou-sheet-formats__what\">\n <span :id=\"`${uid}-${i}`\" class=\"dou-sheet-formats__rule\">{{ describe(f) }}</span>\n <span class=\"dou-sheet-formats__range\">{{ ruleRangeText(f.range) }}</span>\n </span>\n <span class=\"dou-sheet-formats__actions\">\n <DouTooltip :content=\"m.edit\">\n <DouButton\n variant=\"ghost\"\n size=\"sm\"\n :aria-label=\"m.edit\"\n :aria-describedby=\"`${uid}-${i}`\"\n @click=\"emit('edit', i)\"\n >\n <PencilIcon />\n </DouButton>\n </DouTooltip>\n <DouTooltip :content=\"m.moveUp\">\n <DouButton\n variant=\"ghost\"\n size=\"sm\"\n :aria-label=\"m.moveUp\"\n :aria-describedby=\"`${uid}-${i}`\"\n :disabled=\"i === 0\"\n @click=\"move(i, -1)\"\n >\n <ArrowUpIcon />\n </DouButton>\n </DouTooltip>\n <DouTooltip :content=\"m.moveDown\">\n <DouButton\n variant=\"ghost\"\n size=\"sm\"\n :aria-label=\"m.moveDown\"\n :aria-describedby=\"`${uid}-${i}`\"\n :disabled=\"i === formats.length - 1\"\n @click=\"move(i, 1)\"\n >\n <ArrowDownIcon />\n </DouButton>\n </DouTooltip>\n <DouTooltip :content=\"m.remove\">\n <DouButton\n variant=\"ghost\"\n size=\"sm\"\n :aria-label=\"m.remove\"\n :aria-describedby=\"`${uid}-${i}`\"\n @click=\"remove(i)\"\n >\n <TrashIcon />\n </DouButton>\n </DouTooltip>\n </span>\n </li>\n </ol>\n <template #footer=\"{ close }\">\n <DouButton variant=\"outline\" @click=\"close\">{{ m.close }}</DouButton>\n </template>\n </DouDialog>\n</template>\n"],"mappings":"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"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { barColor, fillColor } from "../core/conditional.js";
|
|
2
|
+
// src/components/format-presets.ts
|
|
3
|
+
var TONES = [
|
|
4
|
+
"neutral",
|
|
5
|
+
"primary",
|
|
6
|
+
"success",
|
|
7
|
+
"warning",
|
|
8
|
+
"danger"
|
|
9
|
+
];
|
|
10
|
+
var LOOKS = {
|
|
11
|
+
danger: {
|
|
12
|
+
fill: "danger",
|
|
13
|
+
tone: "danger"
|
|
14
|
+
},
|
|
15
|
+
warning: {
|
|
16
|
+
fill: "warning",
|
|
17
|
+
tone: "warning"
|
|
18
|
+
},
|
|
19
|
+
success: {
|
|
20
|
+
fill: "success",
|
|
21
|
+
tone: "success"
|
|
22
|
+
},
|
|
23
|
+
dangerText: { tone: "danger" },
|
|
24
|
+
bold: { bold: true },
|
|
25
|
+
neutral: { fill: "neutral" }
|
|
26
|
+
};
|
|
27
|
+
var SCALES = {
|
|
28
|
+
rag: [
|
|
29
|
+
"danger",
|
|
30
|
+
"warning",
|
|
31
|
+
"success"
|
|
32
|
+
],
|
|
33
|
+
gar: [
|
|
34
|
+
"success",
|
|
35
|
+
"warning",
|
|
36
|
+
"danger"
|
|
37
|
+
],
|
|
38
|
+
diverging: [
|
|
39
|
+
"danger",
|
|
40
|
+
"neutral",
|
|
41
|
+
"success"
|
|
42
|
+
],
|
|
43
|
+
blue: ["neutral", "primary"]
|
|
44
|
+
};
|
|
45
|
+
/** The message key of a tone's name. */
|
|
46
|
+
var toneKey = (tone) => `tone${tone[0].toUpperCase()}${tone.slice(1)}`;
|
|
47
|
+
var scaleSwatch = (colors) => `linear-gradient(to right, ${colors.map(fillColor).join(", ")})`;
|
|
48
|
+
/** A data bar color as a chip; it fills its box so it sits centered like the scale swatches. */
|
|
49
|
+
var barSwatch = (color) => `linear-gradient(${barColor(color)}, ${barColor(color)})`;
|
|
50
|
+
/** Whether two styles set the same parts the same way. */
|
|
51
|
+
function sameStyle(a, b) {
|
|
52
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
53
|
+
for (const key of keys) if ((a[key] ?? void 0) !== (b[key] ?? void 0)) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
/** The preset a style is, if any. */
|
|
57
|
+
function lookName(style) {
|
|
58
|
+
return Object.keys(LOOKS).find((name) => sameStyle(LOOKS[name], style));
|
|
59
|
+
}
|
|
60
|
+
/** The preset some scale colors are, if any. */
|
|
61
|
+
function scaleName(colors) {
|
|
62
|
+
return Object.keys(SCALES).find((name) => SCALES[name].length === colors.length && SCALES[name].every((c, i) => c === colors[i]));
|
|
63
|
+
}
|
|
64
|
+
/** How a sample `123` of a look shows: its classes and inline style. */
|
|
65
|
+
function styleSample(style) {
|
|
66
|
+
if (!style) return {
|
|
67
|
+
cls: [],
|
|
68
|
+
css: ""
|
|
69
|
+
};
|
|
70
|
+
let css = "";
|
|
71
|
+
if (style.color) css += `color:${style.color};`;
|
|
72
|
+
if (style.background) css += `background-color:${style.background};`;
|
|
73
|
+
return {
|
|
74
|
+
cls: [
|
|
75
|
+
!style.color && style.tone ? `is-tone-${style.tone}` : "",
|
|
76
|
+
!style.background && style.fill ? `is-fill-${style.fill}` : "",
|
|
77
|
+
style.bold ? "is-bold" : "",
|
|
78
|
+
style.italic ? "is-italic" : ""
|
|
79
|
+
].filter(Boolean),
|
|
80
|
+
css
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** How the sample of a format shows. */
|
|
84
|
+
function formatSample(f, styles) {
|
|
85
|
+
if ("scale" in f) return {
|
|
86
|
+
cls: [],
|
|
87
|
+
css: `background-image:${scaleSwatch(f.scale)}`
|
|
88
|
+
};
|
|
89
|
+
if ("bar" in f) return {
|
|
90
|
+
cls: ["is-cell-bar"],
|
|
91
|
+
css: `background-image:linear-gradient(to right, ${barColor(f.bar === true ? "neutral" : f.bar)} 70%, transparent 70%)`
|
|
92
|
+
};
|
|
93
|
+
return styleSample(typeof f.style === "string" ? styles?.[f.style] : f.style);
|
|
94
|
+
}
|
|
95
|
+
export { LOOKS, SCALES, TONES, barSwatch, formatSample, lookName, sameStyle, scaleName, scaleSwatch, styleSample, toneKey };
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=format-presets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-presets.js","names":[],"sources":["../../src/components/format-presets.ts"],"sourcesContent":["import type { Tone } from 'dou-ui'\nimport { barColor, fillColor } from '../core/conditional'\nimport type { SheetColor, SheetConditionalFormat, SheetStyle } from '../core/model'\nimport type { SheetMessages } from '../locale'\n\n/*\n * What the toolbar's menus and the conditional format dialogs offer: the\n * looks, scales and bar colors, and how a sample of each is drawn.\n */\n\nexport const TONES: Tone[] = ['neutral', 'primary', 'success', 'warning', 'danger']\n\nexport type SheetLookName = keyof SheetMessages['formats']['looks']\n\nexport const LOOKS: Record<SheetLookName, SheetStyle> = {\n danger: { fill: 'danger', tone: 'danger' },\n warning: { fill: 'warning', tone: 'warning' },\n success: { fill: 'success', tone: 'success' },\n dangerText: { tone: 'danger' },\n bold: { bold: true },\n neutral: { fill: 'neutral' },\n}\n\nexport type SheetScaleName = keyof SheetMessages['formats']['scales']\nexport type SheetScaleColors = [SheetColor, SheetColor] | [SheetColor, SheetColor, SheetColor]\n\nexport const SCALES: Record<SheetScaleName, SheetScaleColors> = {\n rag: ['danger', 'warning', 'success'],\n gar: ['success', 'warning', 'danger'],\n diverging: ['danger', 'neutral', 'success'],\n blue: ['neutral', 'primary'],\n}\n\n/** The message key of a tone's name. */\nexport const toneKey = (tone: Tone) =>\n `tone${tone[0]!.toUpperCase()}${tone.slice(1)}` as `tone${Capitalize<Tone>}`\n\nexport const scaleSwatch = (colors: readonly SheetColor[]) =>\n `linear-gradient(to right, ${colors.map(fillColor).join(', ')})`\n/** A data bar color as a chip; it fills its box so it sits centered like the scale swatches. */\nexport const barSwatch = (color: SheetColor) =>\n `linear-gradient(${barColor(color)}, ${barColor(color)})`\n\n/** Whether two styles set the same parts the same way. */\nexport function sameStyle(a: SheetStyle, b: SheetStyle) {\n const keys = new Set([...Object.keys(a), ...Object.keys(b)]) as Set<keyof SheetStyle>\n for (const key of keys) if ((a[key] ?? undefined) !== (b[key] ?? undefined)) return false\n return true\n}\n\n/** The preset a style is, if any. */\nexport function lookName(style: SheetStyle): SheetLookName | undefined {\n return (Object.keys(LOOKS) as SheetLookName[]).find((name) => sameStyle(LOOKS[name], style))\n}\n\n/** The preset some scale colors are, if any. */\nexport function scaleName(colors: readonly SheetColor[]): SheetScaleName | undefined {\n return (Object.keys(SCALES) as SheetScaleName[]).find(\n (name) =>\n SCALES[name].length === colors.length && SCALES[name].every((c, i) => c === colors[i]),\n )\n}\n\n/** How a sample `123` of a look shows: its classes and inline style. */\nexport function styleSample(style: SheetStyle | undefined): { cls: string[]; css: string } {\n if (!style) return { cls: [], css: '' }\n let css = ''\n if (style.color) css += `color:${style.color};`\n if (style.background) css += `background-color:${style.background};`\n return {\n cls: [\n !style.color && style.tone ? `is-tone-${style.tone}` : '',\n !style.background && style.fill ? `is-fill-${style.fill}` : '',\n style.bold ? 'is-bold' : '',\n style.italic ? 'is-italic' : '',\n ].filter(Boolean),\n css,\n }\n}\n\n/** How the sample of a format shows. */\nexport function formatSample(\n f: SheetConditionalFormat,\n styles: Record<string, SheetStyle> | undefined,\n): { cls: string[]; css: string } {\n if ('scale' in f) return { cls: [], css: `background-image:${scaleSwatch(f.scale)}` }\n if ('bar' in f) {\n // like the bar on a cell: from the start, behind the number\n const color = barColor(f.bar === true ? 'neutral' : f.bar)\n return {\n cls: ['is-cell-bar'],\n css: `background-image:linear-gradient(to right, ${color} 70%, transparent 70%)`,\n }\n }\n return styleSample(typeof f.style === 'string' ? styles?.[f.style] : f.style)\n}\n"],"mappings":";;AAUA,IAAa,QAAgB;CAAC;CAAW;CAAW;CAAW;CAAW;AAAQ;AAIlF,IAAa,QAA2C;CACtD,QAAQ;EAAE,MAAM;EAAU,MAAM;CAAS;CACzC,SAAS;EAAE,MAAM;EAAW,MAAM;CAAU;CAC5C,SAAS;EAAE,MAAM;EAAW,MAAM;CAAU;CAC5C,YAAY,EAAE,MAAM,SAAS;CAC7B,MAAM,EAAE,MAAM,KAAK;CACnB,SAAS,EAAE,MAAM,UAAU;AAC7B;AAKA,IAAa,SAAmD;CAC9D,KAAK;EAAC;EAAU;EAAW;CAAS;CACpC,KAAK;EAAC;EAAW;EAAW;CAAQ;CACpC,WAAW;EAAC;EAAU;EAAW;CAAS;CAC1C,MAAM,CAAC,WAAW,SAAS;AAC7B;;AAGA,IAAa,WAAW,SACtB,OAAO,KAAK,EAAE,CAAE,YAAY,IAAI,KAAK,MAAM,CAAC;AAE9C,IAAa,eAAe,WAC1B,6BAA6B,OAAO,IAAI,SAAS,CAAC,CAAC,KAAK,IAAI,EAAE;;AAEhE,IAAa,aAAa,UACxB,mBAAmB,SAAS,KAAK,EAAE,IAAI,SAAS,KAAK,EAAE;;AAGzD,SAAgB,UAAU,GAAe,GAAe;CACtD,MAAM,uBAAO,IAAI,IAAI,CAAC,GAAG,OAAO,KAAK,CAAC,GAAG,GAAG,OAAO,KAAK,CAAC,CAAC,CAAC;CAC3D,KAAK,MAAM,OAAO,MAAM,KAAK,EAAE,QAAQ,KAAA,QAAgB,EAAE,QAAQ,KAAA,IAAY,OAAO;CACpF,OAAO;AACT;;AAGA,SAAgB,SAAS,OAA8C;CACrE,OAAQ,OAAO,KAAK,KAAK,CAAC,CAAqB,MAAM,SAAS,UAAU,MAAM,OAAO,KAAK,CAAC;AAC7F;;AAGA,SAAgB,UAAU,QAA2D;CACnF,OAAQ,OAAO,KAAK,MAAM,CAAC,CAAsB,MAC9C,SACC,OAAO,KAAK,CAAC,WAAW,OAAO,UAAU,OAAO,KAAK,CAAC,OAAO,GAAG,MAAM,MAAM,OAAO,EAAE,CACzF;AACF;;AAGA,SAAgB,YAAY,OAA+D;CACzF,IAAI,CAAC,OAAO,OAAO;EAAE,KAAK,CAAC;EAAG,KAAK;CAAG;CACtC,IAAI,MAAM;CACV,IAAI,MAAM,OAAO,OAAO,SAAS,MAAM,MAAM;CAC7C,IAAI,MAAM,YAAY,OAAO,oBAAoB,MAAM,WAAW;CAClE,OAAO;EACL,KAAK;GACH,CAAC,MAAM,SAAS,MAAM,OAAO,WAAW,MAAM,SAAS;GACvD,CAAC,MAAM,cAAc,MAAM,OAAO,WAAW,MAAM,SAAS;GAC5D,MAAM,OAAO,YAAY;GACzB,MAAM,SAAS,cAAc;EAC/B,CAAC,CAAC,OAAO,OAAO;EAChB;CACF;AACF;;AAGA,SAAgB,aACd,GACA,QACgC;CAChC,IAAI,WAAW,GAAG,OAAO;EAAE,KAAK,CAAC;EAAG,KAAK,oBAAoB,YAAY,EAAE,KAAK;CAAI;CACpF,IAAI,SAAS,GAGX,OAAO;EACL,KAAK,CAAC,aAAa;EACnB,KAAK,8CAHO,SAAS,EAAE,QAAQ,OAAO,YAAY,EAAE,GAGD,EAAM;CAC3D;CAEF,OAAO,YAAY,OAAO,EAAE,UAAU,WAAW,SAAS,EAAE,SAAS,EAAE,KAAK;AAC9E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import option_panel_vue_vue_type_script_setup_true_lang_default from "./option-panel.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
// src/components/option-panel.vue
|
|
3
|
+
var option_panel_default = option_panel_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
export { option_panel_default as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=option-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-panel.js","names":["_sfc_main"],"sources":["../../src/components/option-panel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CheckIcon } from '@dou-ui/icons'\nimport { computed, nextTick, shallowRef, useId, watch } from 'vue'\nimport { optionOf, type SheetCellPanelProps } from '../core/cell-type'\nimport { formatValue, inputText } from '../core/format'\nimport type { SheetValue } from '../core/model'\nimport { useSheet } from '../context'\n\nconst props = defineProps<SheetCellPanelProps>()\nconst emit = defineEmits<{ pick: [value: SheetValue] }>()\nconst { messages } = useSheet()\nconst id = `dou-sheet-options-${useId()}`\n\nconst all = computed(() =>\n (props.setup.options ?? []).map((option) => {\n const { value, tone } = optionOf(option)\n return { value, tone, label: formatValue(value) }\n }),\n)\n/** The options that start with (or contain) what was typed; all of them until something is. */\nconst options = computed(() => {\n const query = props.typed ? props.text.trim().toLowerCase() : ''\n if (!query) return all.value\n const starts = all.value.filter((o) => o.label.toLowerCase().startsWith(query))\n const contains = all.value.filter(\n (o) => !starts.includes(o) && o.label.toLowerCase().includes(query),\n )\n return [...starts, ...contains]\n})\n\nconst active = shallowRef(-1)\nwatch(\n options,\n (list) => {\n const current = list.findIndex((o) => o.value === props.value)\n active.value = props.typed ? (list.length ? 0 : -1) : current\n },\n { immediate: true },\n)\nwatch(active, (index) => {\n void nextTick(() =>\n document.getElementById(`${id}-${index}`)?.scrollIntoView({ block: 'nearest' }),\n )\n})\n\nfunction onKey(event: KeyboardEvent) {\n const count = options.value.length\n if (!count || event.altKey || event.ctrlKey || event.metaKey) return false\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n const step = event.key === 'ArrowDown' ? 1 : -1\n active.value =\n active.value < 0 ? (step > 0 ? 0 : count - 1) : (active.value + step + count) % count\n return true\n }\n case 'Enter':\n case 'Tab': {\n const option = options.value[active.value]\n // with nothing picked, Enter writes what was typed\n if (!option || (!props.typed && option.value === props.value)) return false\n emit('pick', option.value)\n return true\n }\n default:\n return false\n }\n}\n\ndefineExpose({\n onKey,\n activeId: computed(() => (active.value >= 0 ? `${id}-${active.value}` : null)),\n})\n</script>\n\n<template>\n <div :id=\"id\" class=\"dou-sheet__options\" role=\"listbox\" :aria-label=\"messages.options\">\n <div\n v-for=\"(option, index) in options\"\n :id=\"`${id}-${index}`\"\n :key=\"inputText(option.value)\"\n role=\"option\"\n class=\"dou-dropdown__item dou-sheet__option\"\n :class=\"{ 'is-active': index === active }\"\n :aria-selected=\"option.value === value\"\n @pointermove=\"active = index\"\n @click=\"emit('pick', option.value)\"\n >\n <span v-if=\"setup.plain\" class=\"dou-sheet__option-text\">{{ option.label }}</span>\n <span\n v-else\n class=\"dou-tag dou-tag--soft dou-sheet__tag\"\n :class=\"option.tone && option.tone !== 'neutral' ? `dou-tag--${option.tone}` : 'is-neutral'\"\n >{{ option.label }}</span\n >\n <CheckIcon v-if=\"option.value === value\" class=\"dou-sheet__option-check\" />\n </div>\n <div v-if=\"!options.length\" class=\"dou-sheet__options-empty\">{{ messages.noOptions }}</div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { formatValue, inputText } from "../core/format.js";
|
|
2
|
+
import { optionOf } from "../core/cell-type.js";
|
|
3
|
+
import { useSheet } from "../context.js";
|
|
4
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, defineComponent, nextTick, normalizeClass, openBlock, renderList, shallowRef, toDisplayString, unref, useId, watch } from "vue";
|
|
5
|
+
import { CheckIcon } from "@dou-ui/icons";
|
|
6
|
+
// src/components/option-panel.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var _hoisted_1 = ["aria-label"];
|
|
8
|
+
var _hoisted_2 = [
|
|
9
|
+
"id",
|
|
10
|
+
"aria-selected",
|
|
11
|
+
"onPointermove",
|
|
12
|
+
"onClick"
|
|
13
|
+
];
|
|
14
|
+
var _hoisted_3 = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "dou-sheet__option-text"
|
|
17
|
+
};
|
|
18
|
+
var _hoisted_4 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "dou-sheet__options-empty"
|
|
21
|
+
};
|
|
22
|
+
var option_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
23
|
+
__name: "option-panel",
|
|
24
|
+
props: {
|
|
25
|
+
value: { type: [
|
|
26
|
+
String,
|
|
27
|
+
Number,
|
|
28
|
+
Boolean,
|
|
29
|
+
null
|
|
30
|
+
] },
|
|
31
|
+
text: {},
|
|
32
|
+
typed: { type: Boolean },
|
|
33
|
+
setup: {}
|
|
34
|
+
},
|
|
35
|
+
emits: ["pick"],
|
|
36
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
37
|
+
const props = __props;
|
|
38
|
+
const emit = __emit;
|
|
39
|
+
const { messages } = useSheet();
|
|
40
|
+
const id = `dou-sheet-options-${useId()}`;
|
|
41
|
+
const all = computed(() => (props.setup.options ?? []).map((option) => {
|
|
42
|
+
const { value, tone } = optionOf(option);
|
|
43
|
+
return {
|
|
44
|
+
value,
|
|
45
|
+
tone,
|
|
46
|
+
label: formatValue(value)
|
|
47
|
+
};
|
|
48
|
+
}));
|
|
49
|
+
/** The options that start with (or contain) what was typed; all of them until something is. */
|
|
50
|
+
const options = computed(() => {
|
|
51
|
+
const query = props.typed ? props.text.trim().toLowerCase() : "";
|
|
52
|
+
if (!query) return all.value;
|
|
53
|
+
const starts = all.value.filter((o) => o.label.toLowerCase().startsWith(query));
|
|
54
|
+
const contains = all.value.filter((o) => !starts.includes(o) && o.label.toLowerCase().includes(query));
|
|
55
|
+
return [...starts, ...contains];
|
|
56
|
+
});
|
|
57
|
+
const active = shallowRef(-1);
|
|
58
|
+
watch(options, (list) => {
|
|
59
|
+
const current = list.findIndex((o) => o.value === props.value);
|
|
60
|
+
active.value = props.typed ? list.length ? 0 : -1 : current;
|
|
61
|
+
}, { immediate: true });
|
|
62
|
+
watch(active, (index) => {
|
|
63
|
+
nextTick(() => document.getElementById(`${id}-${index}`)?.scrollIntoView({ block: "nearest" }));
|
|
64
|
+
});
|
|
65
|
+
function onKey(event) {
|
|
66
|
+
const count = options.value.length;
|
|
67
|
+
if (!count || event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
68
|
+
switch (event.key) {
|
|
69
|
+
case "ArrowDown":
|
|
70
|
+
case "ArrowUp": {
|
|
71
|
+
const step = event.key === "ArrowDown" ? 1 : -1;
|
|
72
|
+
active.value = active.value < 0 ? step > 0 ? 0 : count - 1 : (active.value + step + count) % count;
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
case "Enter":
|
|
76
|
+
case "Tab": {
|
|
77
|
+
const option = options.value[active.value];
|
|
78
|
+
if (!option || !props.typed && option.value === props.value) return false;
|
|
79
|
+
emit("pick", option.value);
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
default: return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
__expose({
|
|
86
|
+
onKey,
|
|
87
|
+
activeId: computed(() => active.value >= 0 ? `${id}-${active.value}` : null)
|
|
88
|
+
});
|
|
89
|
+
return (_ctx, _cache) => {
|
|
90
|
+
return openBlock(), createElementBlock("div", {
|
|
91
|
+
id,
|
|
92
|
+
class: "dou-sheet__options",
|
|
93
|
+
role: "listbox",
|
|
94
|
+
"aria-label": unref(messages).options
|
|
95
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option, index) => {
|
|
96
|
+
return openBlock(), createElementBlock("div", {
|
|
97
|
+
id: `${id}-${index}`,
|
|
98
|
+
key: unref(inputText)(option.value),
|
|
99
|
+
role: "option",
|
|
100
|
+
class: normalizeClass(["dou-dropdown__item dou-sheet__option", { "is-active": index === active.value }]),
|
|
101
|
+
"aria-selected": option.value === __props.value,
|
|
102
|
+
onPointermove: ($event) => active.value = index,
|
|
103
|
+
onClick: ($event) => emit("pick", option.value)
|
|
104
|
+
}, [__props.setup.plain ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(option.label), 1)) : (openBlock(), createElementBlock("span", {
|
|
105
|
+
key: 1,
|
|
106
|
+
class: normalizeClass(["dou-tag dou-tag--soft dou-sheet__tag", option.tone && option.tone !== "neutral" ? `dou-tag--${option.tone}` : "is-neutral"])
|
|
107
|
+
}, toDisplayString(option.label), 3)), option.value === __props.value ? (openBlock(), createBlock(unref(CheckIcon), {
|
|
108
|
+
key: 2,
|
|
109
|
+
class: "dou-sheet__option-check"
|
|
110
|
+
})) : createCommentVNode("", true)], 42, _hoisted_2);
|
|
111
|
+
}), 128)), !options.value.length ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(unref(messages).noOptions), 1)) : createCommentVNode("", true)], 8, _hoisted_1);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export { option_panel_vue_vue_type_script_setup_true_lang_default as default };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=option-panel.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-panel.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createElementBlock","_unref","_Fragment","_renderList","_normalizeClass","_toDisplayString","_createBlock","_createCommentVNode"],"sources":["../../src/components/option-panel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { CheckIcon } from '@dou-ui/icons'\nimport { computed, nextTick, shallowRef, useId, watch } from 'vue'\nimport { optionOf, type SheetCellPanelProps } from '../core/cell-type'\nimport { formatValue, inputText } from '../core/format'\nimport type { SheetValue } from '../core/model'\nimport { useSheet } from '../context'\n\nconst props = defineProps<SheetCellPanelProps>()\nconst emit = defineEmits<{ pick: [value: SheetValue] }>()\nconst { messages } = useSheet()\nconst id = `dou-sheet-options-${useId()}`\n\nconst all = computed(() =>\n (props.setup.options ?? []).map((option) => {\n const { value, tone } = optionOf(option)\n return { value, tone, label: formatValue(value) }\n }),\n)\n/** The options that start with (or contain) what was typed; all of them until something is. */\nconst options = computed(() => {\n const query = props.typed ? props.text.trim().toLowerCase() : ''\n if (!query) return all.value\n const starts = all.value.filter((o) => o.label.toLowerCase().startsWith(query))\n const contains = all.value.filter(\n (o) => !starts.includes(o) && o.label.toLowerCase().includes(query),\n )\n return [...starts, ...contains]\n})\n\nconst active = shallowRef(-1)\nwatch(\n options,\n (list) => {\n const current = list.findIndex((o) => o.value === props.value)\n active.value = props.typed ? (list.length ? 0 : -1) : current\n },\n { immediate: true },\n)\nwatch(active, (index) => {\n void nextTick(() =>\n document.getElementById(`${id}-${index}`)?.scrollIntoView({ block: 'nearest' }),\n )\n})\n\nfunction onKey(event: KeyboardEvent) {\n const count = options.value.length\n if (!count || event.altKey || event.ctrlKey || event.metaKey) return false\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp': {\n const step = event.key === 'ArrowDown' ? 1 : -1\n active.value =\n active.value < 0 ? (step > 0 ? 0 : count - 1) : (active.value + step + count) % count\n return true\n }\n case 'Enter':\n case 'Tab': {\n const option = options.value[active.value]\n // with nothing picked, Enter writes what was typed\n if (!option || (!props.typed && option.value === props.value)) return false\n emit('pick', option.value)\n return true\n }\n default:\n return false\n }\n}\n\ndefineExpose({\n onKey,\n activeId: computed(() => (active.value >= 0 ? `${id}-${active.value}` : null)),\n})\n</script>\n\n<template>\n <div :id=\"id\" class=\"dou-sheet__options\" role=\"listbox\" :aria-label=\"messages.options\">\n <div\n v-for=\"(option, index) in options\"\n :id=\"`${id}-${index}`\"\n :key=\"inputText(option.value)\"\n role=\"option\"\n class=\"dou-dropdown__item dou-sheet__option\"\n :class=\"{ 'is-active': index === active }\"\n :aria-selected=\"option.value === value\"\n @pointermove=\"active = index\"\n @click=\"emit('pick', option.value)\"\n >\n <span v-if=\"setup.plain\" class=\"dou-sheet__option-text\">{{ option.label }}</span>\n <span\n v-else\n class=\"dou-tag dou-tag--soft dou-sheet__tag\"\n :class=\"option.tone && option.tone !== 'neutral' ? `dou-tag--${option.tone}` : 'is-neutral'\"\n >{{ option.label }}</span\n >\n <CheckIcon v-if=\"option.value === value\" class=\"dou-sheet__option-check\" />\n </div>\n <div v-if=\"!options.length\" class=\"dou-sheet__options-empty\">{{ messages.noOptions }}</div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQA,MAAM,QAAQ;EACd,MAAM,OAAO;EACb,MAAM,EAAE,aAAa,SAAS;EAC9B,MAAM,KAAK,qBAAqB,MAAM;EAEtC,MAAM,MAAM,gBACT,MAAM,MAAM,WAAW,CAAC,EAAA,CAAG,KAAK,WAAW;GAC1C,MAAM,EAAE,OAAO,SAAS,SAAS,MAAM;GACvC,OAAO;IAAE;IAAO;IAAM,OAAO,YAAY,KAAK;GAAE;EAClD,CAAC,CACH;;EAEA,MAAM,UAAU,eAAe;GAC7B,MAAM,QAAQ,MAAM,QAAQ,MAAM,KAAK,KAAK,CAAC,CAAC,YAAY,IAAI;GAC9D,IAAI,CAAC,OAAO,OAAO,IAAI;GACvB,MAAM,SAAS,IAAI,MAAM,QAAQ,MAAM,EAAE,MAAM,YAAY,CAAC,CAAC,WAAW,KAAK,CAAC;GAC9E,MAAM,WAAW,IAAI,MAAM,QACxB,MAAM,CAAC,OAAO,SAAS,CAAC,KAAK,EAAE,MAAM,YAAY,CAAC,CAAC,SAAS,KAAK,CACpE;GACA,OAAO,CAAC,GAAG,QAAQ,GAAG,QAAQ;EAChC,CAAC;EAED,MAAM,SAAS,WAAW,EAAE;EAC5B,MACE,UACC,SAAS;GACR,MAAM,UAAU,KAAK,WAAW,MAAM,EAAE,UAAU,MAAM,KAAK;GAC7D,OAAO,QAAQ,MAAM,QAAS,KAAK,SAAS,IAAI,KAAM;EACxD,GACA,EAAE,WAAW,KAAK,CACpB;EACA,MAAM,SAAS,UAAU;GACvB,eACE,SAAS,eAAe,GAAG,GAAG,GAAG,OAAO,CAAC,EAAE,eAAe,EAAE,OAAO,UAAU,CAAC,CAChF;EACF,CAAC;EAED,SAAS,MAAM,OAAsB;GACnC,MAAM,QAAQ,QAAQ,MAAM;GAC5B,IAAI,CAAC,SAAS,MAAM,UAAU,MAAM,WAAW,MAAM,SAAS,OAAO;GACrE,QAAQ,MAAM,KAAd;IACE,KAAK;IACL,KAAK,WAAW;KACd,MAAM,OAAO,MAAM,QAAQ,cAAc,IAAI;KAC7C,OAAO,QACL,OAAO,QAAQ,IAAK,OAAO,IAAI,IAAI,QAAQ,KAAM,OAAO,QAAQ,OAAO,SAAS;KAClF,OAAO;IACT;IACA,KAAK;IACL,KAAK,OAAO;KACV,MAAM,SAAS,QAAQ,MAAM,OAAO;KAEpC,IAAI,CAAC,UAAW,CAAC,MAAM,SAAS,OAAO,UAAU,MAAM,OAAQ,OAAO;KACtE,KAAK,QAAQ,OAAO,KAAK;KACzB,OAAO;IACT;IACA,SACE,OAAO;GACX;EACF;EAEA,SAAa;GACX;GACA,UAAU,eAAgB,OAAO,SAAS,IAAI,GAAG,GAAG,GAAG,OAAO,UAAU,IAAK;EAC/E,CAAC;;GAIC,OAAAA,UAAA,GAAAC,mBAsBM,OAAA;IAtBI;IAAI,OAAM;IAAqB,MAAK;IAAW,cAAYC,MAAA,QAAA,CAAQ,CAAC;G,KAC5EF,UAAA,IAAA,GAAAC,mBAmBME,UAAA,MAAAC,WAlBsB,QAAA,QAAlB,QAAQ,UAAK;IADvB,OAAAJ,UAAA,GAAAC,mBAmBM,OAAA;KAjBH,IAAE,GAAK,GAAE,GAAI;KACb,KAAKC,MAAA,SAAA,CAAS,CAAC,OAAO,KAAK;KAC5B,MAAK;KACL,OAAKG,eAAA,CAAC,wCAAsC,EAAA,aACrB,UAAU,OAAA,MAAM,CAAA,CAAA;KACtC,iBAAe,OAAO,UAAU,QAAA;KAChC,gBAAW,WAAE,OAAA,QAAS;KACtB,UAAK,WAAE,KAAI,QAAS,OAAO,KAAK;I,IAErB,QAAA,MAAM,SAAlBL,UAAA,GAAAC,mBAAiF,QAAjF,YAAiFK,gBAAtB,OAAO,KAAK,GAAA,CAAA,MACvEN,UAAA,GAAAC,mBAKC,QAAA;;KAHC,OAAKI,eAAA,CAAC,wCACE,OAAO,QAAQ,OAAO,SAAI,YAAA,YAA6B,OAAO,SAAI,YAAA,CAAA;IACtE,GAAAC,gBAAA,OAAO,KAAK,GAAA,CAAA,IAED,OAAO,UAAU,QAAA,SAAlCN,UAAA,GAAAO,YAA2EL,MAAA,SAAA,GAAA;;KAAlC,OAAM;;G,WAErC,CAAA,QAAA,MAAQ,UAApBF,UAAA,GAAAC,mBAA2F,OAA3F,YAA2FK,gBAA3BJ,MAAA,QAAA,CAAQ,CAAC,SAAS,GAAA,CAAA,K"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import sheet_comment_vue_vue_type_script_setup_true_lang_default from "./sheet-comment.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
// src/components/sheet-comment.vue
|
|
3
|
+
var sheet_comment_default = sheet_comment_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
export { sheet_comment_default as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=sheet-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-comment.js","names":["_sfc_main"],"sources":["../../src/components/sheet-comment.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n DouCommentThread,\n useFloating,\n useLayer,\n useZIndex,\n type CommentAction,\n type CommentAuthor,\n type CommentThread,\n type VirtualElement,\n} from 'dou-ui'\nimport { nextTick, shallowRef, watch } from 'vue'\n\n/*\n * The thread about a cell, beside the cell: opened by a click on the cell,\n * `Mod+Alt+M`, the menu or `v-model:active-comment`; or empty while a new\n * thread's first comment is being written.\n */\n\nconst props = defineProps<{\n /** The cell it is about. */\n anchor: VirtualElement\n /** The thread; `null` to write the first comment. */\n thread: CommentThread | null\n author?: CommentAuthor\n readonly: boolean\n label: string\n /** Bumped to put the cursor in the reply box. */\n focusRequest: number\n /** The last request the cursor was put there for; a card opened for a newer one takes it. */\n focusHandled: number\n /** What belongs to the grid: a press there is the grid's, not outside the card. */\n grid: () => HTMLElement | null\n}>()\n\nconst emit = defineEmits<{\n action: [action: CommentAction]\n /** Escape, the cancel button, or a press outside. `refocus` asks for the grid's focus back. */\n close: [refocus: boolean]\n /** The request the cursor was put in the reply box for. */\n focused: [request: number]\n}>()\n\nconst panel = shallowRef<HTMLElement | null>(null)\nconst threadView = shallowRef<InstanceType<typeof DouCommentThread> | null>(null)\n\n/**\n * Beside the cell, or under it (above when there's no room below) on a\n * screen too narrow for the card on either side, so it never covers the\n * cell it is about.\n */\nfunction side(): 'right-start' | 'bottom-start' {\n if (typeof window === 'undefined') return 'right-start'\n const anchor = props.anchor.getBoundingClientRect()\n const width = panel.value?.offsetWidth ?? 340\n const room = Math.max(window.innerWidth - anchor.right, anchor.left)\n return room >= width + 6 ? 'right-start' : 'bottom-start'\n}\n\nconst { style, placement } = useFloating(() => props.anchor, panel, {\n open: true,\n placement: side,\n offset: 6,\n})\nconst zIndex = useZIndex().next()\n\n/** Focus was in the card, or went nowhere when what held it went away. */\nconst focusLost = () => {\n const el = document.activeElement\n return !el || el === document.body || !!panel.value?.contains(el)\n}\n\n// a layer: Escape goes to a menu opened from it first, and a press on such\n// a menu isn't outside. A press on the grid is the grid's: it opens the\n// thread of the cell pressed, or closes the card.\nuseLayer({\n open: true,\n elements: () => [panel.value, props.grid()],\n onEscape: () => emit('close', focusLost()),\n onOutside: () => emit('close', false),\n})\n\n// asked to (the keyboard shortcut, a thread just started): the reply box,\n// also when the card opens for the request\nwatch(\n () => props.focusRequest,\n async (request) => {\n if (request <= props.focusHandled) return\n emit('focused', request)\n await nextTick()\n threadView.value?.focus()\n },\n { flush: 'post', immediate: true },\n)\n\ndefineExpose({ panel })\n</script>\n\n<template>\n <Transition name=\"dou-floating\" appear>\n <div\n ref=\"panel\"\n class=\"dou-floating dou-sheet-comment\"\n role=\"dialog\"\n :aria-label=\"label\"\n :style=\"[style, { zIndex }]\"\n :data-placement=\"placement\"\n @pointerdown.stop\n @contextmenu.stop\n @wheel.stop\n >\n <DouCommentThread\n ref=\"threadView\"\n :key=\"thread?.id ?? 'new'\"\n :thread=\"thread\"\n :author=\"author\"\n :readonly=\"readonly\"\n :autofocus=\"!thread\"\n @action=\"emit('action', $event)\"\n @cancel=\"emit('close', true)\"\n />\n </div>\n </Transition>\n</template>\n"],"mappings":""}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { DouCommentThread, useFloating, useLayer, useZIndex } from "dou-ui";
|
|
2
|
+
import { Transition, createBlock, createElementVNode, defineComponent, nextTick, normalizeStyle, openBlock, shallowRef, unref, watch, withCtx, withModifiers } from "vue";
|
|
3
|
+
// src/components/sheet-comment.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _hoisted_1 = ["aria-label", "data-placement"];
|
|
5
|
+
var sheet_comment_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
6
|
+
__name: "sheet-comment",
|
|
7
|
+
props: {
|
|
8
|
+
anchor: {},
|
|
9
|
+
thread: {},
|
|
10
|
+
author: {},
|
|
11
|
+
readonly: { type: Boolean },
|
|
12
|
+
label: {},
|
|
13
|
+
focusRequest: {},
|
|
14
|
+
focusHandled: {},
|
|
15
|
+
grid: { type: Function }
|
|
16
|
+
},
|
|
17
|
+
emits: [
|
|
18
|
+
"action",
|
|
19
|
+
"close",
|
|
20
|
+
"focused"
|
|
21
|
+
],
|
|
22
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const panel = shallowRef(null);
|
|
26
|
+
const threadView = shallowRef(null);
|
|
27
|
+
/**
|
|
28
|
+
* Beside the cell, or under it (above when there's no room below) on a
|
|
29
|
+
* screen too narrow for the card on either side, so it never covers the
|
|
30
|
+
* cell it is about.
|
|
31
|
+
*/
|
|
32
|
+
function side() {
|
|
33
|
+
if (typeof window === "undefined") return "right-start";
|
|
34
|
+
const anchor = props.anchor.getBoundingClientRect();
|
|
35
|
+
const width = panel.value?.offsetWidth ?? 340;
|
|
36
|
+
return Math.max(window.innerWidth - anchor.right, anchor.left) >= width + 6 ? "right-start" : "bottom-start";
|
|
37
|
+
}
|
|
38
|
+
const { style, placement } = useFloating(() => props.anchor, panel, {
|
|
39
|
+
open: true,
|
|
40
|
+
placement: side,
|
|
41
|
+
offset: 6
|
|
42
|
+
});
|
|
43
|
+
const zIndex = useZIndex().next();
|
|
44
|
+
/** Focus was in the card, or went nowhere when what held it went away. */
|
|
45
|
+
const focusLost = () => {
|
|
46
|
+
const el = document.activeElement;
|
|
47
|
+
return !el || el === document.body || !!panel.value?.contains(el);
|
|
48
|
+
};
|
|
49
|
+
useLayer({
|
|
50
|
+
open: true,
|
|
51
|
+
elements: () => [panel.value, props.grid()],
|
|
52
|
+
onEscape: () => emit("close", focusLost()),
|
|
53
|
+
onOutside: () => emit("close", false)
|
|
54
|
+
});
|
|
55
|
+
watch(() => props.focusRequest, async (request) => {
|
|
56
|
+
if (request <= props.focusHandled) return;
|
|
57
|
+
emit("focused", request);
|
|
58
|
+
await nextTick();
|
|
59
|
+
threadView.value?.focus();
|
|
60
|
+
}, {
|
|
61
|
+
flush: "post",
|
|
62
|
+
immediate: true
|
|
63
|
+
});
|
|
64
|
+
__expose({ panel });
|
|
65
|
+
return (_ctx, _cache) => {
|
|
66
|
+
return openBlock(), createBlock(Transition, {
|
|
67
|
+
name: "dou-floating",
|
|
68
|
+
appear: ""
|
|
69
|
+
}, {
|
|
70
|
+
default: withCtx(() => [createElementVNode("div", {
|
|
71
|
+
ref_key: "panel",
|
|
72
|
+
ref: panel,
|
|
73
|
+
class: "dou-floating dou-sheet-comment",
|
|
74
|
+
role: "dialog",
|
|
75
|
+
"aria-label": __props.label,
|
|
76
|
+
style: normalizeStyle([unref(style), { zIndex: unref(zIndex) }]),
|
|
77
|
+
"data-placement": unref(placement),
|
|
78
|
+
onPointerdown: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"])),
|
|
79
|
+
onContextmenu: _cache[3] || (_cache[3] = withModifiers(() => {}, ["stop"])),
|
|
80
|
+
onWheel: _cache[4] || (_cache[4] = withModifiers(() => {}, ["stop"]))
|
|
81
|
+
}, [(openBlock(), createBlock(unref(DouCommentThread), {
|
|
82
|
+
ref_key: "threadView",
|
|
83
|
+
ref: threadView,
|
|
84
|
+
key: __props.thread?.id ?? "new",
|
|
85
|
+
thread: __props.thread,
|
|
86
|
+
author: __props.author,
|
|
87
|
+
readonly: __props.readonly,
|
|
88
|
+
autofocus: !__props.thread,
|
|
89
|
+
onAction: _cache[0] || (_cache[0] = ($event) => emit("action", $event)),
|
|
90
|
+
onCancel: _cache[1] || (_cache[1] = ($event) => emit("close", true))
|
|
91
|
+
}, null, 8, [
|
|
92
|
+
"thread",
|
|
93
|
+
"author",
|
|
94
|
+
"readonly",
|
|
95
|
+
"autofocus"
|
|
96
|
+
]))], 44, _hoisted_1)]),
|
|
97
|
+
_: 1
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
export { sheet_comment_vue_vue_type_script_setup_true_lang_default as default };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=sheet-comment.vue_vue_type_script_setup_true_lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-comment.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","_Transition","_withCtx","_createElementVNode","_normalizeStyle","_unref","_withModifiers"],"sources":["../../src/components/sheet-comment.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n DouCommentThread,\n useFloating,\n useLayer,\n useZIndex,\n type CommentAction,\n type CommentAuthor,\n type CommentThread,\n type VirtualElement,\n} from 'dou-ui'\nimport { nextTick, shallowRef, watch } from 'vue'\n\n/*\n * The thread about a cell, beside the cell: opened by a click on the cell,\n * `Mod+Alt+M`, the menu or `v-model:active-comment`; or empty while a new\n * thread's first comment is being written.\n */\n\nconst props = defineProps<{\n /** The cell it is about. */\n anchor: VirtualElement\n /** The thread; `null` to write the first comment. */\n thread: CommentThread | null\n author?: CommentAuthor\n readonly: boolean\n label: string\n /** Bumped to put the cursor in the reply box. */\n focusRequest: number\n /** The last request the cursor was put there for; a card opened for a newer one takes it. */\n focusHandled: number\n /** What belongs to the grid: a press there is the grid's, not outside the card. */\n grid: () => HTMLElement | null\n}>()\n\nconst emit = defineEmits<{\n action: [action: CommentAction]\n /** Escape, the cancel button, or a press outside. `refocus` asks for the grid's focus back. */\n close: [refocus: boolean]\n /** The request the cursor was put in the reply box for. */\n focused: [request: number]\n}>()\n\nconst panel = shallowRef<HTMLElement | null>(null)\nconst threadView = shallowRef<InstanceType<typeof DouCommentThread> | null>(null)\n\n/**\n * Beside the cell, or under it (above when there's no room below) on a\n * screen too narrow for the card on either side, so it never covers the\n * cell it is about.\n */\nfunction side(): 'right-start' | 'bottom-start' {\n if (typeof window === 'undefined') return 'right-start'\n const anchor = props.anchor.getBoundingClientRect()\n const width = panel.value?.offsetWidth ?? 340\n const room = Math.max(window.innerWidth - anchor.right, anchor.left)\n return room >= width + 6 ? 'right-start' : 'bottom-start'\n}\n\nconst { style, placement } = useFloating(() => props.anchor, panel, {\n open: true,\n placement: side,\n offset: 6,\n})\nconst zIndex = useZIndex().next()\n\n/** Focus was in the card, or went nowhere when what held it went away. */\nconst focusLost = () => {\n const el = document.activeElement\n return !el || el === document.body || !!panel.value?.contains(el)\n}\n\n// a layer: Escape goes to a menu opened from it first, and a press on such\n// a menu isn't outside. A press on the grid is the grid's: it opens the\n// thread of the cell pressed, or closes the card.\nuseLayer({\n open: true,\n elements: () => [panel.value, props.grid()],\n onEscape: () => emit('close', focusLost()),\n onOutside: () => emit('close', false),\n})\n\n// asked to (the keyboard shortcut, a thread just started): the reply box,\n// also when the card opens for the request\nwatch(\n () => props.focusRequest,\n async (request) => {\n if (request <= props.focusHandled) return\n emit('focused', request)\n await nextTick()\n threadView.value?.focus()\n },\n { flush: 'post', immediate: true },\n)\n\ndefineExpose({ panel })\n</script>\n\n<template>\n <Transition name=\"dou-floating\" appear>\n <div\n ref=\"panel\"\n class=\"dou-floating dou-sheet-comment\"\n role=\"dialog\"\n :aria-label=\"label\"\n :style=\"[style, { zIndex }]\"\n :data-placement=\"placement\"\n @pointerdown.stop\n @contextmenu.stop\n @wheel.stop\n >\n <DouCommentThread\n ref=\"threadView\"\n :key=\"thread?.id ?? 'new'\"\n :thread=\"thread\"\n :author=\"author\"\n :readonly=\"readonly\"\n :autofocus=\"!thread\"\n @action=\"emit('action', $event)\"\n @cancel=\"emit('close', true)\"\n />\n </div>\n </Transition>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAmBA,MAAM,QAAQ;EAgBd,MAAM,OAAO;EAQb,MAAM,QAAQ,WAA+B,IAAI;EACjD,MAAM,aAAa,WAAyD,IAAI;;;;;;EAOhF,SAAS,OAAuC;GAC9C,IAAI,OAAO,WAAW,aAAa,OAAO;GAC1C,MAAM,SAAS,MAAM,OAAO,sBAAsB;GAClD,MAAM,QAAQ,MAAM,OAAO,eAAe;GAE1C,OADa,KAAK,IAAI,OAAO,aAAa,OAAO,OAAO,OAAO,IACxD,KAAQ,QAAQ,IAAI,gBAAgB;EAC7C;EAEA,MAAM,EAAE,OAAO,cAAc,kBAAkB,MAAM,QAAQ,OAAO;GAClE,MAAM;GACN,WAAW;GACX,QAAQ;EACV,CAAC;EACD,MAAM,SAAS,UAAU,CAAC,CAAC,KAAK;;EAGhC,MAAM,kBAAkB;GACtB,MAAM,KAAK,SAAS;GACpB,OAAO,CAAC,MAAM,OAAO,SAAS,QAAQ,CAAC,CAAC,MAAM,OAAO,SAAS,EAAE;EAClE;EAKA,SAAS;GACP,MAAM;GACN,gBAAgB,CAAC,MAAM,OAAO,MAAM,KAAK,CAAC;GAC1C,gBAAgB,KAAK,SAAS,UAAU,CAAC;GACzC,iBAAiB,KAAK,SAAS,KAAK;EACtC,CAAC;EAID,YACQ,MAAM,cACZ,OAAO,YAAY;GACjB,IAAI,WAAW,MAAM,cAAc;GACnC,KAAK,WAAW,OAAO;GACvB,MAAM,SAAS;GACf,WAAW,OAAO,MAAM;EAC1B,GACA;GAAE,OAAO;GAAQ,WAAW;EAAK,CACnC;EAEA,SAAa,EAAE,MAAM,CAAC;;GAIpB,OAAAA,UAAA,GAAAC,YAuBaC,YAAA;IAvBD,MAAK;IAAe,QAAA;;IAC9B,SAAAC,cAqBM,CArBNC,mBAqBM,OAAA;KApBA,SAAA;KAAJ,KAAI;KACJ,OAAM;KACN,MAAK;KACJ,cAAY,QAAA;KACZ,OAAKC,eAAA,CAAGC,MAAA,KAAA,GAAK,EAAA,QAAIA,MAAA,MAAA,EAAM,CAAA,CAAA;KACvB,kBAAgBA,MAAA,SAAA;KAChB,eAAW,OAAA,OAAA,OAAA,KAAAC,oBAAZ,CAAA,GAAiB,CAAA,MAAA,CAAA;KAChB,eAAW,OAAA,OAAA,OAAA,KAAAA,oBAAZ,CAAA,GAAiB,CAAA,MAAA,CAAA;KAChB,SAAK,OAAA,OAAA,OAAA,KAAAA,oBAAN,CAAA,GAAW,CAAA,MAAA,CAAA;I,KAEXP,UAAA,GAAAC,YASEK,MAAA,gBAAA,GAAA;KARI,SAAA;KAAJ,KAAI;KACH,KAAK,QAAA,QAAQ,MAAE;KACf,QAAQ,QAAA;KACR,QAAQ,QAAA;KACR,UAAU,QAAA;KACV,WAAS,CAAG,QAAA;KACZ,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,UAAW,MAAM;KAC7B,UAAM,OAAA,OAAA,OAAA,MAAA,WAAE,KAAI,SAAA,IAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import sheet_formula_bar_vue_vue_type_script_setup_true_lang_default from "./sheet-formula-bar.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
// src/components/sheet-formula-bar.vue
|
|
3
|
+
var sheet_formula_bar_default = sheet_formula_bar_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
export { sheet_formula_bar_default as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=sheet-formula-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sheet-formula-bar.js","names":["_sfc_main"],"sources":["../../src/components/sheet-formula-bar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { FunctionIcon } from '@dou-ui/icons'\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue'\nimport { useSheet } from '../context'\nimport SheetNameBox from './sheet-name-box.vue'\nimport { formulaParts, formulaReferences, partClass } from '../formula/edit'\n\ndefineOptions({ name: 'DouSheetFormulaBar' })\n\nconst sheet = useSheet()\nconst { editor, messages: m } = sheet\n\nconst input = useTemplateRef<HTMLTextAreaElement>('input')\nconst mirror = useTemplateRef<HTMLElement>('mirror')\n\n// The formula box: what the active cell holds, edited along with the cell ----------------------\n\nconst editingHere = computed(() => !!editor.cell.value)\nconst text = computed(() =>\n editingHere.value ? editor.text.value : editor.textAt(sheet.active.value),\n)\nconst marks = computed(() => (editingHere.value ? formulaReferences(text.value) : []))\n/** A formula is shown in its colors, under the box's clear text. */\nconst isFormula = computed(() => text.value.startsWith('='))\nconst parts = computed(() => (isFormula.value ? formulaParts(text.value, marks.value) : []))\n\n/** As many lines as the text has, up to five; more scroll. */\nconst lines = computed(() => Math.min(5, text.value.split('\\n').length))\n\nlet composing = false\nconst setComposing = (value: boolean) => (composing = value)\n\nfunction onInput(event: Event) {\n const el = event.target as HTMLTextAreaElement\n if (!editor.input(el.value, el.selectionStart)) el.value = text.value\n syncMirror()\n}\n\nfunction onKey(event: KeyboardEvent) {\n if (composing || event.isComposing) return\n if (editingHere.value) {\n // Enter, Tab and Escape finish the edit as in the cell; completion and pointing too\n if (editor.key(event) && !editor.cell.value) sheet.focus()\n return\n }\n if (event.key === 'Escape' || event.key === 'Enter') {\n event.preventDefault()\n sheet.focus()\n }\n}\n\nfunction syncCaret() {\n const el = input.value\n if (el && editingHere.value) editor.moveCaret(el.selectionStart)\n syncMirror()\n}\n\nfunction syncMirror() {\n const el = input.value\n const shown = mirror.value\n if (!el || !shown) return\n shown.scrollLeft = el.scrollLeft\n shown.scrollTop = el.scrollTop\n}\n\nfunction onBlur(event: FocusEvent) {\n // a press on a cell finished the edit already; going elsewhere saves it, as leaving the cell does\n const next = event.relatedTarget as Element | null\n if (!editor.cell.value || !document.hasFocus()) return\n if (next?.closest('.dou-sheet__input, .dou-sheet__assist')) return\n editor.commit()\n}\n\nwatch(text, () => void nextTick(syncMirror))\n\nlet detach: (() => void) | undefined\nonMounted(() => {\n if (input.value) detach = editor.attach(input.value)\n})\nonBeforeUnmount(() => detach?.())\n</script>\n\n<template>\n <div class=\"dou-sheet-formula-bar\">\n <SheetNameBox />\n <span class=\"dou-sheet-formula-bar__mark\" aria-hidden=\"true\"><FunctionIcon /></span>\n <div class=\"dou-sheet-formula-bar__box\" :style=\"`--dou-sheet-bar-lines:${lines}`\">\n <div v-if=\"isFormula\" ref=\"mirror\" class=\"dou-sheet-formula-bar__mirror\" aria-hidden=\"true\">\n <span v-for=\"(part, i) in parts\" :key=\"i\" :class=\"partClass(part)\">{{ part.text }}</span>\n </div>\n <textarea\n ref=\"input\"\n class=\"dou-sheet-formula-bar__input\"\n :class=\"{ 'is-formula': isFormula }\"\n :value=\"text\"\n :aria-label=\"m.formulaBox\"\n :aria-autocomplete=\"editingHere ? 'list' : undefined\"\n :aria-controls=\"editingHere ? editor.helpId : undefined\"\n :readonly=\"sheet.readonly.value\"\n rows=\"1\"\n autocomplete=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n @input=\"onInput\"\n @keydown=\"onKey\"\n @keyup=\"syncCaret\"\n @click=\"syncCaret\"\n @select=\"syncCaret\"\n @scroll=\"syncMirror\"\n @compositionstart=\"setComposing(true)\"\n @compositionend=\"setComposing(false)\"\n @blur=\"onBlur\"\n />\n </div>\n </div>\n</template>\n"],"mappings":""}
|