@welldot/vue 0.2.0 → 0.2.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/grid/cells/GridUnitEditor.d.ts +2 -0
- package/dist/grid/cells/GridUnitEditor.d.ts.map +1 -1
- package/dist/grid/cells/GridUnitEditor.js.map +1 -1
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/grid/cells/GridUnitEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/grid/useWellGridColumns.d.ts +21 -0
- package/dist/grid/useWellGridColumns.d.ts.map +1 -1
- package/dist/grid/useWellGridColumns.js +91 -86
- package/dist/grid/useWellGridColumns.js.map +1 -1
- package/package.json +7 -7
|
@@ -4,6 +4,8 @@ type __VLS_Props = {
|
|
|
4
4
|
save: (value: unknown, preventFocus?: boolean) => void;
|
|
5
5
|
close: (focusNext?: boolean) => void;
|
|
6
6
|
unitType: DisplayUnitType;
|
|
7
|
+
/** `val` is the key typed to open the editor, already in display units. */
|
|
8
|
+
entered?: boolean;
|
|
7
9
|
};
|
|
8
10
|
declare const __VLS_export: 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>;
|
|
9
11
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridUnitEditor.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridUnitEditor.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridUnitEditor.d.ts","sourceRoot":"","sources":["../../../src/grid/cells/GridUnitEditor.vue"],"names":[],"mappings":"AAmGA,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,gCAAgC,CAAC;AAExC,KAAK,WAAW,GAAG;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,QAAQ,EAAE,eAAe,CAAC;IAC1B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAiHF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridUnitEditor.js","names":[],"sources":["../../../src/grid/cells/GridUnitEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue';\nimport WellInputNumber from '../../components/WellInputNumber.vue';\nimport {\n isDisplayedValue,\n useWellUnits,\n type DisplayUnitType,\n} from '../../composables/useWellUnits';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n unitType: DisplayUnitType;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst { toDisplay, toCanonical } = useWellUnits(() => props.unitType);\n\n/** Matches the `max-fraction-digits` of the input below. */\nconst MAX_FRACTION_DIGITS = 4;\n\nconst numRef = ref<{ $el: HTMLElement } | null>(null);\n\nconst raw =\n props.val !== undefined && props.val !== null && props.val !== ''\n ? Number(props.val)\n : null;\n\n/** Display value the editor opened with (null for an empty cell). */\nconst initialDisplay
|
|
1
|
+
{"version":3,"file":"GridUnitEditor.js","names":[],"sources":["../../../src/grid/cells/GridUnitEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue';\nimport WellInputNumber from '../../components/WellInputNumber.vue';\nimport {\n isDisplayedValue,\n useWellUnits,\n type DisplayUnitType,\n} from '../../composables/useWellUnits';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n unitType: DisplayUnitType;\n /** `val` is the key typed to open the editor, already in display units. */\n entered?: boolean;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst { toDisplay, toCanonical } = useWellUnits(() => props.unitType);\n\n/** Matches the `max-fraction-digits` of the input below. */\nconst MAX_FRACTION_DIGITS = 4;\n\nconst numRef = ref<{ $el: HTMLElement } | null>(null);\n\nconst raw =\n props.val !== undefined && props.val !== null && props.val !== ''\n ? Number(props.val)\n : null;\n\nconst opened = raw != null && !isNaN(raw) ? raw : null;\n\n/** Display value the editor opened with (null for an empty cell). */\nconst initialDisplay =\n opened != null && !props.entered ? toDisplay(opened) : null;\nconst localValue = ref<number | null>(props.entered ? opened : initialDisplay);\n\nonMounted(() =>\n nextTick(() => {\n const el = numRef.value?.$el;\n (el?.querySelector('input') as HTMLInputElement | null)?.focus();\n }),\n);\n\nlet lastKeyWasEnter = false;\n\nfunction onKeydownCapture(e: KeyboardEvent) {\n lastKeyWasEnter = e.key === 'Enter';\n}\n\nfunction commit() {\n if (localValue.value === null) return;\n // `InputNumber` emits its rounded text on blur/Enter: an untouched edit\n // closes without saving, so the exact canonical value is kept.\n if (isDisplayedValue(localValue.value, initialDisplay, MAX_FRACTION_DIGITS)) {\n props.close(lastKeyWasEnter);\n return;\n }\n props.save(toCanonical(localValue.value), !lastKeyWasEnter);\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.stopPropagation();\n commit();\n } else if (e.key === 'Escape') {\n e.stopPropagation();\n props.close();\n }\n}\n\nfunction update(value: number | null) {\n localValue.value = value;\n commit();\n}\n</script>\n\n<template>\n <div class=\"contents\" @keydown.capture=\"onKeydownCapture\">\n <WellInputNumber\n ref=\"numRef\"\n :model-value=\"localValue\"\n :max-fraction-digits=\"MAX_FRACTION_DIGITS\"\n :pt=\"{\n root: 'well-cell-input-number',\n pcInput: { root: 'well-cell-input well-cell-input-number text-right' },\n }\"\n @update:model-value=\"update\"\n @keydown=\"onKeydown\"\n />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -9,46 +9,47 @@ var u = 4, d = /* @__PURE__ */ a({
|
|
|
9
9
|
val: {},
|
|
10
10
|
save: { type: Function },
|
|
11
11
|
close: { type: Function },
|
|
12
|
-
unitType: {}
|
|
12
|
+
unitType: {},
|
|
13
|
+
entered: { type: Boolean }
|
|
13
14
|
},
|
|
14
15
|
setup(a) {
|
|
15
|
-
let d = a, { toDisplay: f, toCanonical: p } = t(() => d.unitType), m = l(null), h = d.val !== void 0 && d.val !== null && d.val !== "" ? Number(d.val) : null, g = h != null && !isNaN(h) ? f(
|
|
16
|
+
let d = a, { toDisplay: f, toCanonical: p } = t(() => d.unitType), m = l(null), h = d.val !== void 0 && d.val !== null && d.val !== "" ? Number(d.val) : null, g = h != null && !isNaN(h) ? h : null, _ = g != null && !d.entered ? f(g) : null, v = l(d.entered ? g : _);
|
|
16
17
|
s(() => o(() => {
|
|
17
18
|
((m.value?.$el)?.querySelector("input"))?.focus();
|
|
18
19
|
}));
|
|
19
|
-
let
|
|
20
|
-
function
|
|
21
|
-
|
|
20
|
+
let y = !1;
|
|
21
|
+
function b(e) {
|
|
22
|
+
y = e.key === "Enter";
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
if (
|
|
25
|
-
if (e(
|
|
26
|
-
d.close(
|
|
24
|
+
function x() {
|
|
25
|
+
if (v.value !== null) {
|
|
26
|
+
if (e(v.value, _, u)) {
|
|
27
|
+
d.close(y);
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
d.save(p(
|
|
30
|
+
d.save(p(v.value), !y);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
function x(e) {
|
|
33
|
-
e.key === "Enter" ? (e.stopPropagation(), b()) : e.key === "Escape" && (e.stopPropagation(), d.close());
|
|
34
|
-
}
|
|
35
33
|
function S(e) {
|
|
36
|
-
|
|
34
|
+
e.key === "Enter" ? (e.stopPropagation(), x()) : e.key === "Escape" && (e.stopPropagation(), d.close());
|
|
35
|
+
}
|
|
36
|
+
function C(e) {
|
|
37
|
+
v.value = e, x();
|
|
37
38
|
}
|
|
38
39
|
return (e, t) => (c(), r("div", {
|
|
39
40
|
class: "contents",
|
|
40
|
-
onKeydownCapture:
|
|
41
|
+
onKeydownCapture: b
|
|
41
42
|
}, [i(n, {
|
|
42
43
|
ref_key: "numRef",
|
|
43
44
|
ref: m,
|
|
44
|
-
"model-value":
|
|
45
|
+
"model-value": v.value,
|
|
45
46
|
"max-fraction-digits": u,
|
|
46
47
|
pt: {
|
|
47
48
|
root: "well-cell-input-number",
|
|
48
49
|
pcInput: { root: "well-cell-input well-cell-input-number text-right" }
|
|
49
50
|
},
|
|
50
|
-
"onUpdate:modelValue":
|
|
51
|
-
onKeydown:
|
|
51
|
+
"onUpdate:modelValue": C,
|
|
52
|
+
onKeydown: S
|
|
52
53
|
}, null, 8, ["model-value"])], 32));
|
|
53
54
|
}
|
|
54
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridUnitEditor.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridUnitEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue';\nimport WellInputNumber from '../../components/WellInputNumber.vue';\nimport {\n isDisplayedValue,\n useWellUnits,\n type DisplayUnitType,\n} from '../../composables/useWellUnits';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n unitType: DisplayUnitType;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst { toDisplay, toCanonical } = useWellUnits(() => props.unitType);\n\n/** Matches the `max-fraction-digits` of the input below. */\nconst MAX_FRACTION_DIGITS = 4;\n\nconst numRef = ref<{ $el: HTMLElement } | null>(null);\n\nconst raw =\n props.val !== undefined && props.val !== null && props.val !== ''\n ? Number(props.val)\n : null;\n\n/** Display value the editor opened with (null for an empty cell). */\nconst initialDisplay
|
|
1
|
+
{"version":3,"file":"GridUnitEditor.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/grid/cells/GridUnitEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { nextTick, onMounted, ref } from 'vue';\nimport WellInputNumber from '../../components/WellInputNumber.vue';\nimport {\n isDisplayedValue,\n useWellUnits,\n type DisplayUnitType,\n} from '../../composables/useWellUnits';\n\nconst props = defineProps<{\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n unitType: DisplayUnitType;\n /** `val` is the key typed to open the editor, already in display units. */\n entered?: boolean;\n}>();\n\ndefineOptions({ inheritAttrs: false });\n\nconst { toDisplay, toCanonical } = useWellUnits(() => props.unitType);\n\n/** Matches the `max-fraction-digits` of the input below. */\nconst MAX_FRACTION_DIGITS = 4;\n\nconst numRef = ref<{ $el: HTMLElement } | null>(null);\n\nconst raw =\n props.val !== undefined && props.val !== null && props.val !== ''\n ? Number(props.val)\n : null;\n\nconst opened = raw != null && !isNaN(raw) ? raw : null;\n\n/** Display value the editor opened with (null for an empty cell). */\nconst initialDisplay =\n opened != null && !props.entered ? toDisplay(opened) : null;\nconst localValue = ref<number | null>(props.entered ? opened : initialDisplay);\n\nonMounted(() =>\n nextTick(() => {\n const el = numRef.value?.$el;\n (el?.querySelector('input') as HTMLInputElement | null)?.focus();\n }),\n);\n\nlet lastKeyWasEnter = false;\n\nfunction onKeydownCapture(e: KeyboardEvent) {\n lastKeyWasEnter = e.key === 'Enter';\n}\n\nfunction commit() {\n if (localValue.value === null) return;\n // `InputNumber` emits its rounded text on blur/Enter: an untouched edit\n // closes without saving, so the exact canonical value is kept.\n if (isDisplayedValue(localValue.value, initialDisplay, MAX_FRACTION_DIGITS)) {\n props.close(lastKeyWasEnter);\n return;\n }\n props.save(toCanonical(localValue.value), !lastKeyWasEnter);\n}\n\nfunction onKeydown(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n e.stopPropagation();\n commit();\n } else if (e.key === 'Escape') {\n e.stopPropagation();\n props.close();\n }\n}\n\nfunction update(value: number | null) {\n localValue.value = value;\n commit();\n}\n</script>\n\n<template>\n <div class=\"contents\" @keydown.capture=\"onKeydownCapture\">\n <WellInputNumber\n ref=\"numRef\"\n :model-value=\"localValue\"\n :max-fraction-digits=\"MAX_FRACTION_DIGITS\"\n :pt=\"{\n root: 'well-cell-input-number',\n pcInput: { root: 'well-cell-input well-cell-input-number text-right' },\n }\"\n @update:model-value=\"update\"\n @keydown=\"onKeydown\"\n />\n </div>\n</template>\n"],"mappings":";;;;AAuBA,IAAM,IAAsB;;;;;;;;;;;EAd5B,IAAM,IAAQ,GAWR,EAAE,cAAW,mBAAgB,QAAmB,EAAM,SAAS,EAK/D,IAAS,EAAiC,KAAK,EAE/C,IACJ,EAAM,QAAQ,KAAA,KAAa,EAAM,QAAQ,QAAQ,EAAM,QAAQ,KAC3D,OAAO,EAAM,IAAG,GAChB,MAEA,IAAS,KAAO,QAAQ,CAAC,MAAM,EAAI,GAAG,IAAM,MAG5C,IACJ,KAAU,QAAQ,CAAC,EAAM,UAAU,EAAU,EAAO,GAAG,MACnD,IAAa,EAAmB,EAAM,UAAU,IAAS,EAAe;AAE9E,UACE,QAAe;AAEb,KADW,EAAO,OAAO,MACpB,cAAc,QAAQ,GAA8B,OAAO;IAChE,CACH;EAED,IAAI,IAAkB;EAEtB,SAAS,EAAiB,GAAkB;AAC1C,OAAkB,EAAE,QAAQ;;EAG9B,SAAS,IAAS;AACZ,SAAW,UAAU,MAGzB;QAAI,EAAiB,EAAW,OAAO,GAAgB,EAAoB,EAAE;AAC3E,OAAM,MAAM,EAAgB;AAC5B;;AAEF,MAAM,KAAK,EAAY,EAAW,MAAM,EAAE,CAAC,EAAgB;;;EAG7D,SAAS,EAAU,GAAkB;AACnC,GAAI,EAAE,QAAQ,WACZ,EAAE,iBAAiB,EACnB,GAAQ,IACC,EAAE,QAAQ,aACnB,EAAE,iBAAiB,EACnB,EAAM,OAAO;;EAIjB,SAAS,EAAO,GAAsB;AAEpC,GADA,EAAW,QAAQ,GACnB,GAAQ;;yBAKR,EAYM,OAAA;GAZD,OAAM;GAA6B;MACtC,EAUE,GAAA;YATI;GAAJ,KAAI;GACH,eAAa,EAAA;GACb,uBAAqB;GACrB,IAAI;;;IAGJ;GACA,uBAAoB;GACX"}
|
|
@@ -3,6 +3,27 @@ import { BasePlugin } from '@revolist/vue3-datagrid';
|
|
|
3
3
|
import { LanguageTextInput } from '@welldot/core';
|
|
4
4
|
import { MaybeRefOrGetter } from 'vue';
|
|
5
5
|
import { WellDataGridComponents, WellDataGridLabels, WellGridColumn } from './types';
|
|
6
|
+
/** Props RevoGrid hands to every editor (`EditorType`). */
|
|
7
|
+
export interface GridEditorProps {
|
|
8
|
+
val?: unknown;
|
|
9
|
+
save: (value: unknown, preventFocus?: boolean) => void;
|
|
10
|
+
close: (focusNext?: boolean) => void;
|
|
11
|
+
/** Cell data model; `column.column` is the `ColumnRegular`. */
|
|
12
|
+
column?: {
|
|
13
|
+
column?: {
|
|
14
|
+
editorProps?: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/** Row model of the edited cell. */
|
|
18
|
+
model?: Record<string, unknown>;
|
|
19
|
+
/** Key of the edited cell on `model`. */
|
|
20
|
+
prop?: string | number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Whether `val` is the key the user typed to open the editor rather than
|
|
24
|
+
* the cell's stored value (RevoGrid passes `editCell.val || modelValue`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function isEnteredValue(p: GridEditorProps): boolean;
|
|
6
27
|
export interface UseWellGridColumnsOptions {
|
|
7
28
|
columns: MaybeRefOrGetter<WellGridColumn[]>;
|
|
8
29
|
onDelete: (rowIndex: number, model: Record<string, unknown>) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWellGridColumns.d.ts","sourceRoot":"","sources":["../../src/grid/useWellGridColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,OAAO,EACP,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EAGX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAC;AA4Bb,OAAO,KAAK,EAEV,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EAEf,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"useWellGridColumns.d.ts","sourceRoot":"","sources":["../../src/grid/useWellGridColumns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EACb,OAAO,EACP,qBAAqB,EAEtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EAGX,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,KAAK,CAAC;AA4Bb,OAAO,KAAK,EAEV,sBAAsB,EACtB,kBAAkB,EAClB,cAAc,EAEf,MAAM,SAAS,CAAC;AAqDjB,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,+DAA+D;IAC/D,MAAM,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE;YAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;SAAE,CAAA;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ells/GridColorCell.js";
|
|
6
6
|
import o from "./cells/GridColorPickerEditor.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { useUnitSuffix as
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { useCellTemplate as
|
|
7
|
+
import s from "./cells/GridComboEditor.js";
|
|
8
|
+
import c from "./cells/GridDeleteCell.js";
|
|
9
|
+
import l from "./cells/GridDragCell.js";
|
|
10
|
+
import ee from "./cells/GridFormattedCell.js";
|
|
11
|
+
import te from "./cells/GridHeaderCell.js";
|
|
12
|
+
import ne from "./cells/GridNumberEditor.js";
|
|
13
|
+
import re from "./cells/GridSelectButtonCell.js";
|
|
14
|
+
import u from "./cells/GridSelectCell.js";
|
|
15
|
+
import d from "./cells/GridSelectEditor.js";
|
|
16
|
+
import f from "./cells/GridTextEditor.js";
|
|
17
|
+
import p from "./cells/GridTextureSelectCell.js";
|
|
18
|
+
import m from "./cells/GridTextureSelectEditor.js";
|
|
19
|
+
import { useUnitSuffix as h } from "./composables/useUnitSuffix.js";
|
|
20
|
+
import g from "./cells/GridUnitCell.js";
|
|
21
|
+
import _ from "./cells/GridUnitEditor.js";
|
|
22
|
+
import { useCellTemplate as v } from "./composables/useCellTemplate.js";
|
|
23
23
|
import y from "./parts/WellGridDeleteButton.js";
|
|
24
24
|
import { computed as b, defineComponent as x, h as S, ref as C, toValue as w } from "vue";
|
|
25
|
-
import { BasePlugin as
|
|
25
|
+
import { BasePlugin as ie, VGridVueEditor as T } from "@revolist/vue3-datagrid";
|
|
26
26
|
//#region src/grid/useWellGridColumns.ts
|
|
27
|
-
function
|
|
27
|
+
function E(e) {
|
|
28
28
|
return e.type === "texture" ? "texture" : e.type === "select" ? "select" : e.type === "select-button" ? "select-button" : e.type === "combo" ? "combo" : e.type === "color" ? "color" : e.type === "checkbox" ? "checkbox" : e.unitType ? "unit" : e.formatter ? "formatted" : e.type === "number" ? "number" : "text";
|
|
29
29
|
}
|
|
30
30
|
var D = [
|
|
@@ -37,40 +37,45 @@ var D = [
|
|
|
37
37
|
"val",
|
|
38
38
|
"save",
|
|
39
39
|
"close",
|
|
40
|
-
"column"
|
|
40
|
+
"column",
|
|
41
|
+
"model",
|
|
42
|
+
"prop"
|
|
41
43
|
];
|
|
42
|
-
function k(e
|
|
43
|
-
return
|
|
44
|
+
function k(e) {
|
|
45
|
+
return e.prop != null && e.val !== e.model?.[e.prop];
|
|
46
|
+
}
|
|
47
|
+
function A(e, t) {
|
|
48
|
+
return T(x((n) => () => S(e, {
|
|
44
49
|
val: n.val,
|
|
45
50
|
save: n.save,
|
|
46
51
|
close: n.close,
|
|
47
52
|
...n.column?.column?.editorProps,
|
|
48
|
-
...t?.()
|
|
53
|
+
...t?.(n)
|
|
49
54
|
}), {
|
|
50
55
|
inheritAttrs: !1,
|
|
51
56
|
props: O
|
|
52
57
|
}));
|
|
53
58
|
}
|
|
54
|
-
var
|
|
59
|
+
var j = x((e) => (e.close(), () => null), {
|
|
55
60
|
inheritAttrs: !1,
|
|
56
61
|
props: O
|
|
57
62
|
});
|
|
58
|
-
function
|
|
59
|
-
let { onDelete: S, onChange: O, enableDrag:
|
|
60
|
-
noop:
|
|
61
|
-
text:
|
|
62
|
-
number:
|
|
63
|
-
color:
|
|
64
|
-
unit: k(
|
|
65
|
-
select:
|
|
66
|
-
combo:
|
|
67
|
-
texture:
|
|
68
|
-
placeholder:
|
|
69
|
-
showPending:
|
|
63
|
+
function M(x) {
|
|
64
|
+
let { onDelete: S, onChange: O, enableDrag: M = !0, enableDelete: N = !0 } = x, P = b(() => w(x.columns)), F = b(() => w(x.labels) ?? {}), I = b(() => w(x.components) ?? {}), L = t(), R = n(), z = v(), B = Object.fromEntries(D.map((e) => [e, h(e)])), V = {
|
|
65
|
+
noop: T(j),
|
|
66
|
+
text: T(f),
|
|
67
|
+
number: T(ne),
|
|
68
|
+
color: T(o),
|
|
69
|
+
unit: A(_, (e) => ({ entered: k(e) })),
|
|
70
|
+
select: A(d),
|
|
71
|
+
combo: A(s, () => ({ hint: F.value.comboHint })),
|
|
72
|
+
texture: A(m, () => ({
|
|
73
|
+
placeholder: F.value.texturePlaceholder,
|
|
74
|
+
showPending: F.value.showPendingTextures
|
|
70
75
|
}))
|
|
71
|
-
},
|
|
76
|
+
}, ae = z(te), H = b(() => P.value.find((e) => e.stretch) ?? null), U = b(() => H.value?.prop ?? null), W = b(() => U.value === null), G = b(() => {
|
|
72
77
|
let e = [];
|
|
73
|
-
return
|
|
78
|
+
return M && e.push(class extends ie {
|
|
74
79
|
constructor(e, t) {
|
|
75
80
|
super(e, t), this.addEventListener("rowdragstart", (e) => {
|
|
76
81
|
let t = e.detail.model?.name;
|
|
@@ -85,27 +90,27 @@ function j(x) {
|
|
|
85
90
|
editor: "unit",
|
|
86
91
|
numeric: !0,
|
|
87
92
|
editorProps: ({ col: e }) => ({ unitType: e.unitType }),
|
|
88
|
-
cellTemplate: ({ col: e }) =>
|
|
93
|
+
cellTemplate: ({ col: e }) => z(g, { unitType: e.unitType })
|
|
89
94
|
},
|
|
90
95
|
color: {
|
|
91
96
|
editor: "color",
|
|
92
|
-
cellTemplate: () =>
|
|
97
|
+
cellTemplate: () => z(a)
|
|
93
98
|
},
|
|
94
99
|
select: {
|
|
95
100
|
editor: "select",
|
|
96
101
|
editorProps: ({ options: e }) => ({ options: e }),
|
|
97
|
-
cellTemplate: ({ options: e }) =>
|
|
102
|
+
cellTemplate: ({ options: e }) => z(u, { options: e })
|
|
98
103
|
},
|
|
99
104
|
combo: {
|
|
100
105
|
editor: "combo",
|
|
101
106
|
editorProps: ({ options: e }) => ({ options: e }),
|
|
102
|
-
cellTemplate: ({ options: e }) =>
|
|
107
|
+
cellTemplate: ({ options: e }) => z(u, { options: e })
|
|
103
108
|
},
|
|
104
|
-
formatted: { cellTemplate: ({ col: e }) =>
|
|
109
|
+
formatted: { cellTemplate: ({ col: e }) => z(ee, { formatter: e.formatter }) },
|
|
105
110
|
checkbox: {
|
|
106
111
|
editor: "noop",
|
|
107
112
|
cellProperties: K,
|
|
108
|
-
cellTemplate: ({ col: e }) =>
|
|
113
|
+
cellTemplate: ({ col: e }) => z(i, {
|
|
109
114
|
prop: e.prop,
|
|
110
115
|
onToggle: (e, t, n) => O(e, t, n)
|
|
111
116
|
})
|
|
@@ -113,7 +118,7 @@ function j(x) {
|
|
|
113
118
|
"select-button": {
|
|
114
119
|
editor: "noop",
|
|
115
120
|
cellProperties: K,
|
|
116
|
-
cellTemplate: ({ col: e, options: t }) =>
|
|
121
|
+
cellTemplate: ({ col: e, options: t }) => z(re, {
|
|
117
122
|
prop: e.prop,
|
|
118
123
|
options: t,
|
|
119
124
|
onChange: (e, t, n) => O(e, t, n)
|
|
@@ -121,21 +126,21 @@ function j(x) {
|
|
|
121
126
|
},
|
|
122
127
|
texture: {
|
|
123
128
|
editor: "texture",
|
|
124
|
-
cellTemplate: () =>
|
|
129
|
+
cellTemplate: () => z(p)
|
|
125
130
|
}
|
|
126
131
|
};
|
|
127
132
|
function J(e) {
|
|
128
133
|
return e.map((e) => ({
|
|
129
134
|
value: e.value,
|
|
130
|
-
label:
|
|
135
|
+
label: R(e.label) ?? e.value,
|
|
131
136
|
...e.deprecated && { deprecated: !0 }
|
|
132
137
|
}));
|
|
133
138
|
}
|
|
134
|
-
function
|
|
135
|
-
let t = q[
|
|
139
|
+
function oe(e) {
|
|
140
|
+
let t = q[E(e)], n = {
|
|
136
141
|
col: e,
|
|
137
142
|
options: "options" in e ? J(e.options) : void 0
|
|
138
|
-
}, r =
|
|
143
|
+
}, r = R(e.label) ?? "", i = e.unitType ? B[e.unitType].value : null, a = e.readonly ?? !1, o = R(e.info);
|
|
139
144
|
return {
|
|
140
145
|
prop: e.prop,
|
|
141
146
|
name: i ? `${r} (${i})` : r,
|
|
@@ -149,16 +154,16 @@ function j(x) {
|
|
|
149
154
|
cellTemplate: t.cellTemplate?.(n),
|
|
150
155
|
...o && {
|
|
151
156
|
info: o,
|
|
152
|
-
infoHighlight:
|
|
153
|
-
infoLabel:
|
|
154
|
-
columnTemplate:
|
|
157
|
+
infoHighlight: R(e.infoHighlight),
|
|
158
|
+
infoLabel: R(F.value.columnInfo),
|
|
159
|
+
columnTemplate: ae
|
|
155
160
|
}
|
|
156
161
|
};
|
|
157
162
|
}
|
|
158
|
-
let
|
|
163
|
+
let se = b(() => {
|
|
159
164
|
let t = [];
|
|
160
|
-
if (
|
|
161
|
-
let n = e("dragHandle",
|
|
165
|
+
if (M) {
|
|
166
|
+
let n = e("dragHandle", I.value.dragHandle, void 0, L);
|
|
162
167
|
t.push({
|
|
163
168
|
prop: "_drag",
|
|
164
169
|
name: "",
|
|
@@ -166,77 +171,77 @@ function j(x) {
|
|
|
166
171
|
pin: "colPinStart",
|
|
167
172
|
rowDrag: !0,
|
|
168
173
|
cellProperties: () => ({ class: "well-grid-drag-cell" }),
|
|
169
|
-
...n && { cellTemplate:
|
|
174
|
+
...n && { cellTemplate: z(l, { part: n }) }
|
|
170
175
|
});
|
|
171
176
|
}
|
|
172
|
-
return t.push(...
|
|
177
|
+
return t.push(...P.value.map(oe)), N && t.push({
|
|
173
178
|
prop: "_delete",
|
|
174
179
|
name: "",
|
|
175
180
|
size: 40,
|
|
176
181
|
readonly: !0,
|
|
177
182
|
pin: "colPinEnd",
|
|
178
183
|
cellProperties: () => ({ class: "well-grid-delete-cell" }),
|
|
179
|
-
cellTemplate:
|
|
180
|
-
part: e("deleteButton",
|
|
181
|
-
label:
|
|
184
|
+
cellTemplate: z(c, {
|
|
185
|
+
part: e("deleteButton", I.value.deleteButton, y, L),
|
|
186
|
+
label: R(w(x.deleteLabel)),
|
|
182
187
|
requestDelete: S
|
|
183
188
|
})
|
|
184
189
|
}), t;
|
|
185
190
|
});
|
|
186
|
-
function
|
|
187
|
-
return
|
|
191
|
+
function Y(e, t) {
|
|
192
|
+
return P.value.find((t) => t.prop === e)?.type === "checkbox" && typeof t == "string" ? t === "true" || t === "1" || t.toLowerCase() === "yes" : t;
|
|
188
193
|
}
|
|
189
|
-
let
|
|
190
|
-
function
|
|
194
|
+
let X = C(null), Z = C(null), Q = !1;
|
|
195
|
+
function ce(e) {
|
|
191
196
|
let { rowIndex: t, colIndex: n, column: r } = e.detail;
|
|
192
|
-
|
|
197
|
+
Z.value = r ? {
|
|
193
198
|
rowIndex: t,
|
|
194
199
|
colIndex: n,
|
|
195
200
|
prop: String(r.prop)
|
|
196
|
-
} : null,
|
|
201
|
+
} : null, Q = !0;
|
|
197
202
|
}
|
|
198
|
-
function
|
|
199
|
-
|
|
203
|
+
function le() {
|
|
204
|
+
Q = !1;
|
|
200
205
|
}
|
|
201
|
-
function
|
|
202
|
-
if (
|
|
203
|
-
|
|
206
|
+
function $(e) {
|
|
207
|
+
if (Q) {
|
|
208
|
+
Q = !1;
|
|
204
209
|
return;
|
|
205
210
|
}
|
|
206
|
-
let t =
|
|
211
|
+
let t = Z.value;
|
|
207
212
|
if (!t) return;
|
|
208
213
|
let n = e.target.closest("[data-rgrow][data-rgcol]");
|
|
209
214
|
if (!n || Number(n.dataset.rgrow) !== t.rowIndex || Number(n.dataset.rgcol) !== t.colIndex) return;
|
|
210
|
-
let r =
|
|
211
|
-
!r || r.readonly || (
|
|
215
|
+
let r = P.value.find((e) => e.prop === t.prop);
|
|
216
|
+
!r || r.readonly || (X.value?.querySelector("revo-grid"))?.setCellEdit(t.rowIndex, t.prop);
|
|
212
217
|
}
|
|
213
|
-
function
|
|
218
|
+
function ue(e) {
|
|
214
219
|
let t = e.detail;
|
|
215
220
|
if ("rowIndex" in t) {
|
|
216
221
|
let { rowIndex: e, prop: n, val: r } = t;
|
|
217
|
-
O(e, String(n),
|
|
222
|
+
O(e, String(n), Y(String(n), r));
|
|
218
223
|
return;
|
|
219
224
|
}
|
|
220
225
|
let n = t.data;
|
|
221
226
|
if (n) for (let [e, t] of Object.entries(n)) {
|
|
222
227
|
let n = Number(e);
|
|
223
|
-
for (let [e, r] of Object.entries(t)) O(n, e,
|
|
228
|
+
for (let [e, r] of Object.entries(t)) O(n, e, Y(e, r));
|
|
224
229
|
}
|
|
225
230
|
}
|
|
226
231
|
return {
|
|
227
|
-
gridEditors:
|
|
228
|
-
revoColumns:
|
|
232
|
+
gridEditors: V,
|
|
233
|
+
revoColumns: se,
|
|
229
234
|
gridStretch: W,
|
|
230
235
|
plugins: G,
|
|
231
|
-
coerceCellValue:
|
|
232
|
-
handleAfterEdit:
|
|
233
|
-
gridContainerRef:
|
|
234
|
-
handleAfterFocus:
|
|
235
|
-
handleGridMousedown:
|
|
236
|
-
handleGridClick:
|
|
236
|
+
coerceCellValue: Y,
|
|
237
|
+
handleAfterEdit: ue,
|
|
238
|
+
gridContainerRef: X,
|
|
239
|
+
handleAfterFocus: ce,
|
|
240
|
+
handleGridMousedown: le,
|
|
241
|
+
handleGridClick: $
|
|
237
242
|
};
|
|
238
243
|
}
|
|
239
244
|
//#endregion
|
|
240
|
-
export {
|
|
245
|
+
export { M as useWellGridColumns };
|
|
241
246
|
|
|
242
247
|
//# sourceMappingURL=useWellGridColumns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWellGridColumns.js","names":[],"sources":["../../src/grid/useWellGridColumns.ts"],"sourcesContent":["import type {\n AfterEditEvent,\n BeforeSaveDataDetails,\n ColumnRegular,\n Editors,\n FocusAfterRenderEvent,\n GridPlugin,\n} from '@revolist/revogrid';\nimport {\n BasePlugin,\n VGridVueEditor,\n type PluginProviders,\n} from '@revolist/vue3-datagrid';\nimport type { LanguageTextInput } from '@welldot/core';\nimport {\n computed,\n defineComponent,\n h,\n ref,\n toValue,\n type Component,\n type MaybeRefOrGetter,\n} from 'vue';\nimport { useWellText } from '../composables/useWellText';\nimport type { DisplayUnitType } from '../composables/useWellUnits';\nimport { resolvePart, useWelldotConfig } from '../config';\nimport GridCheckboxCell from './cells/GridCheckboxCell.vue';\nimport GridColorCell from './cells/GridColorCell.vue';\nimport GridColorPickerEditor from './cells/GridColorPickerEditor.vue';\nimport GridComboEditor from './cells/GridComboEditor.vue';\nimport GridDeleteCell from './cells/GridDeleteCell.vue';\nimport GridDragCell from './cells/GridDragCell.vue';\nimport GridFormattedCell from './cells/GridFormattedCell.vue';\nimport GridHeaderCell from './cells/GridHeaderCell.vue';\nimport GridNumberEditor from './cells/GridNumberEditor.vue';\nimport GridSelectButtonCell from './cells/GridSelectButtonCell.vue';\nimport GridSelectCell from './cells/GridSelectCell.vue';\nimport GridSelectEditor from './cells/GridSelectEditor.vue';\nimport GridTextEditor from './cells/GridTextEditor.vue';\nimport GridTextureSelectCell from './cells/GridTextureSelectCell.vue';\nimport GridTextureSelectEditor from './cells/GridTextureSelectEditor.vue';\nimport GridUnitCell from './cells/GridUnitCell.vue';\nimport GridUnitEditor from './cells/GridUnitEditor.vue';\nimport { columnStretchPlugin } from './columnStretchPlugin';\nimport {\n useCellTemplate,\n type GridVueTemplate,\n} from './composables/useCellTemplate';\nimport { useUnitSuffix } from './composables/useUnitSuffix';\nimport WellGridDeleteButton from './parts/WellGridDeleteButton.vue';\nimport type {\n ResolvedGridOption,\n WellDataGridComponents,\n WellDataGridLabels,\n WellGridColumn,\n WellGridOption,\n} from './types';\n\n// ─── Column kinds ──────────────────────────────────────────────────────────\n// Declares how each column \"kind\" renders and edits.\n// `resolveColumnKind` decides which kind a column declaration maps to.\n\ntype ColumnKind =\n | 'text'\n | 'number'\n | 'unit'\n | 'color'\n | 'select'\n | 'select-button'\n | 'combo'\n | 'formatted'\n | 'checkbox'\n | 'texture';\n\n/** What a kind needs from one column, with its text already resolved. */\ninterface ResolvedColumn {\n col: WellGridColumn;\n options?: ResolvedGridOption[];\n}\n\ninterface ColumnKindDef {\n editor?: string;\n numeric?: boolean;\n cellProperties?: ColumnRegular['cellProperties'];\n cellTemplate?: (c: ResolvedColumn) => GridVueTemplate;\n /** Per-column props handed to the editor (read from `column.editorProps`). */\n editorProps?: (c: ResolvedColumn) => Record<string, unknown>;\n}\n\nfunction resolveColumnKind(col: WellGridColumn): ColumnKind {\n if (col.type === 'texture') return 'texture';\n if (col.type === 'select') return 'select';\n if (col.type === 'select-button') return 'select-button';\n if (col.type === 'combo') return 'combo';\n if (col.type === 'color') return 'color';\n if (col.type === 'checkbox') return 'checkbox';\n if (col.unitType) return 'unit';\n if (col.formatter) return 'formatted';\n return col.type === 'number' ? 'number' : 'text';\n}\n\nconst UNIT_TYPES: readonly DisplayUnitType[] = [\n 'length',\n 'diameter',\n 'flow',\n 'power',\n 'volume',\n];\n\n/** Props RevoGrid hands to every editor (`EditorType`). */\ninterface GridEditorProps {\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n /** Cell data model; `column.column` is the `ColumnRegular`. */\n column?: { column?: { editorProps?: Record<string, unknown> } };\n}\n\n/* eslint-disable vue/one-component-per-file -- tiny render-function editor\n adapters, not SFCs */\n\nconst EDITOR_PROP_KEYS: Array<keyof GridEditorProps> = [\n 'val',\n 'save',\n 'close',\n 'column',\n];\n\n/**\n * Editor that forwards `val`/`save`/`close` plus the column's\n * `editorProps` (and optional grid-wide props) to `component`. Lets one\n * editor per kind — registered once in setup — serve every column.\n */\nfunction columnEditor(\n component: Component,\n extraProps?: () => Record<string, unknown>,\n) {\n return VGridVueEditor(\n defineComponent(\n (p: GridEditorProps) => () =>\n h(component, {\n val: p.val,\n save: p.save,\n close: p.close,\n ...p.column?.column?.editorProps,\n ...extraProps?.(),\n }),\n { inheritAttrs: false, props: EDITOR_PROP_KEYS },\n ),\n );\n}\n\nconst NoopEditor = defineComponent(\n (p: GridEditorProps) => {\n p.close();\n return () => null;\n },\n { inheritAttrs: false, props: EDITOR_PROP_KEYS },\n);\n\n/* eslint-enable vue/one-component-per-file */\n\nexport interface UseWellGridColumnsOptions {\n columns: MaybeRefOrGetter<WellGridColumn[]>;\n onDelete: (rowIndex: number, model: Record<string, unknown>) => void;\n onChange: (rowIndex: number, prop: string, value: unknown) => void;\n /** Include the pinned-start drag-handle column (default true) */\n enableDrag?: boolean;\n /** Include the pinned-end delete-row column (default true) */\n enableDelete?: boolean;\n /** Label handed to the delete-button part (its aria-label by default). */\n deleteLabel?: MaybeRefOrGetter<LanguageTextInput>;\n /** Grid-internal text (texture editor, header info trigger). */\n labels?: MaybeRefOrGetter<WellDataGridLabels | undefined>;\n /** Part overrides; `addButton` is rendered by `WellDataGrid` itself. */\n components?: MaybeRefOrGetter<WellDataGridComponents | undefined>;\n}\n\n/**\n * Editor registry, column-kind resolution and RevoGrid column builder for a\n * well feature grid. **Call it in `setup`**: cell templates and editors are\n * bound to the calling component's app context there (see\n * `useCellTemplate`), which is what lets cells reach `createWelldot` and\n * PrimeVue.\n */\nexport function useWellGridColumns(options: UseWellGridColumnsOptions) {\n const {\n onDelete,\n onChange,\n enableDrag = true,\n enableDelete = true,\n } = options;\n const cols = computed(() => toValue(options.columns));\n const labels = computed(() => toValue(options.labels) ?? {});\n const parts = computed(() => toValue(options.components) ?? {});\n\n const config = useWelldotConfig();\n const text = useWellText();\n const cellTemplate = useCellTemplate();\n const suffixes = Object.fromEntries(\n UNIT_TYPES.map(type => [type, useUnitSuffix(type)]),\n ) as Record<DisplayUnitType, ReturnType<typeof useUnitSuffix>>;\n\n // ─── Editors ───────────────────────────────────────────────────────────────\n // Created once, here in setup: `VGridVueEditor` captures the current\n // instance's app context when called. Per-column data (unit type, options)\n // travels on the column as `editorProps`.\n\n const gridEditors: Editors = {\n noop: VGridVueEditor(NoopEditor),\n text: VGridVueEditor(GridTextEditor),\n number: VGridVueEditor(GridNumberEditor),\n color: VGridVueEditor(GridColorPickerEditor),\n unit: columnEditor(GridUnitEditor),\n select: columnEditor(GridSelectEditor),\n combo: columnEditor(GridComboEditor, () => ({\n hint: labels.value.comboHint,\n })),\n texture: columnEditor(GridTextureSelectEditor, () => ({\n placeholder: labels.value.texturePlaceholder,\n showPending: labels.value.showPendingTextures,\n })),\n };\n\n const headerTemplate = cellTemplate(GridHeaderCell);\n\n const stretchCol = computed(() => cols.value.find(c => c.stretch) ?? null);\n const stretchProp = computed(() => stretchCol.value?.prop ?? null);\n const gridStretch = computed(() => stretchProp.value === null);\n\n const plugins = computed(() => {\n const list: GridPlugin[] = [];\n if (enableDrag) {\n list.push(\n class HRPlugin extends BasePlugin {\n constructor(r: HTMLRevoGridElement, p: PluginProviders) {\n super(r, p);\n this.addEventListener('rowdragstart', e => {\n const name = e.detail.model?.['name'];\n if (typeof name === 'string' && name) {\n e.detail.text = name;\n }\n });\n }\n },\n );\n }\n if (stretchProp.value !== null) {\n list.push(\n columnStretchPlugin(stretchProp.value, stretchCol.value?.minSize),\n );\n }\n return list;\n });\n\n const checkboxCellProperties = () => ({ class: 'well-grid-checkbox-cell' });\n\n const columnKinds: Record<ColumnKind, ColumnKindDef> = {\n text: {},\n number: { numeric: true },\n unit: {\n editor: 'unit',\n numeric: true,\n editorProps: ({ col }) => ({ unitType: col.unitType }),\n cellTemplate: ({ col }) =>\n cellTemplate(GridUnitCell, { unitType: col.unitType }),\n },\n color: {\n editor: 'color',\n cellTemplate: () => cellTemplate(GridColorCell),\n },\n select: {\n editor: 'select',\n editorProps: ({ options }) => ({ options }),\n cellTemplate: ({ options }) => cellTemplate(GridSelectCell, { options }),\n },\n combo: {\n editor: 'combo',\n editorProps: ({ options }) => ({ options }),\n // GridSelectCell already falls back to the raw value when it isn't\n // one of the suggested options, which is exactly what free text needs.\n cellTemplate: ({ options }) => cellTemplate(GridSelectCell, { options }),\n },\n formatted: {\n cellTemplate: ({ col }) =>\n cellTemplate(GridFormattedCell, { formatter: col.formatter }),\n },\n checkbox: {\n editor: 'noop',\n cellProperties: checkboxCellProperties,\n cellTemplate: ({ col }) =>\n cellTemplate(GridCheckboxCell, {\n prop: col.prop,\n onToggle: (rowIndex: number, prop: string, value: boolean) =>\n onChange(rowIndex, prop, value),\n }),\n },\n 'select-button': {\n editor: 'noop',\n cellProperties: checkboxCellProperties,\n cellTemplate: ({ col, options }) =>\n cellTemplate(GridSelectButtonCell, {\n prop: col.prop,\n options,\n onChange: (rowIndex: number, prop: string, value: unknown) =>\n onChange(rowIndex, prop, value),\n }),\n },\n texture: {\n editor: 'texture',\n cellTemplate: () => cellTemplate(GridTextureSelectCell),\n },\n };\n\n function resolveOptions(\n list: readonly WellGridOption[],\n ): ResolvedGridOption[] {\n return list.map(o => ({\n value: o.value,\n label: text(o.label) ?? o.value,\n ...(o.deprecated && { deprecated: true }),\n }));\n }\n\n function buildColumn(col: WellGridColumn): ColumnRegular {\n const kind = columnKinds[resolveColumnKind(col)];\n const resolved: ResolvedColumn = {\n col,\n options: 'options' in col ? resolveOptions(col.options) : undefined,\n };\n const label = text(col.label) ?? '';\n const unit = col.unitType ? suffixes[col.unitType].value : null;\n const readonly = col.readonly ?? false;\n const info = text(col.info);\n\n return {\n prop: col.prop,\n name: unit ? `${label} (${unit})` : label,\n autoSize: !col.size && !col.stretch,\n size: col.size,\n readonly,\n editor: readonly\n ? undefined\n : (kind.editor ??\n col.editor ??\n (col.type === 'number' ? 'number' : 'text')),\n editorProps: kind.editorProps?.(resolved),\n pin: col.pin,\n cellProperties:\n kind.cellProperties ??\n (kind.numeric ? () => ({ class: 'num' }) : undefined),\n cellTemplate: kind.cellTemplate?.(resolved),\n ...(info && {\n info,\n infoHighlight: text(col.infoHighlight),\n infoLabel: text(labels.value.columnInfo),\n columnTemplate: headerTemplate,\n }),\n };\n }\n\n const revoColumns = computed<ColumnRegular[]>(() => {\n const result: ColumnRegular[] = [];\n if (enableDrag) {\n const dragHandle = resolvePart(\n 'dragHandle',\n parts.value.dragHandle,\n undefined,\n config,\n );\n result.push({\n prop: '_drag',\n name: '',\n size: 30,\n pin: 'colPinStart',\n rowDrag: true,\n cellProperties: () => ({ class: 'well-grid-drag-cell' }),\n // Without an override RevoGrid draws its own handle (styled by\n // grid.css). A template replaces it, so GridDragCell re-emits the\n // drag start RevoGrid's handle would have emitted.\n ...(dragHandle && {\n cellTemplate: cellTemplate(GridDragCell, { part: dragHandle }),\n }),\n });\n }\n result.push(...cols.value.map(buildColumn));\n if (enableDelete) {\n result.push({\n prop: '_delete',\n name: '',\n size: 40,\n readonly: true,\n pin: 'colPinEnd',\n cellProperties: () => ({ class: 'well-grid-delete-cell' }),\n cellTemplate: cellTemplate(GridDeleteCell, {\n part: resolvePart(\n 'deleteButton',\n parts.value.deleteButton,\n WellGridDeleteButton,\n config,\n ),\n label: text(toValue(options.deleteLabel)),\n requestDelete: onDelete,\n }),\n });\n }\n return result;\n });\n\n function coerceCellValue(prop: string, val: unknown): unknown {\n const col = cols.value.find(c => c.prop === prop);\n if (col?.type === 'checkbox' && typeof val === 'string') {\n return val === 'true' || val === '1' || val.toLowerCase() === 'yes';\n }\n return val;\n }\n\n // ─── Click-on-focused-cell → enter edit mode ───────────────────────────────\n // `afterfocus` only fires when focus moves to a new cell. A click that\n // triggers such a focus change is suppressed; a second click on the cell\n // that's already focused enters edit mode for it.\n\n const gridContainerRef = ref<HTMLElement | null>(null);\n const focusedCell = ref<{\n rowIndex: number;\n colIndex: number;\n prop: string;\n } | null>(null);\n let suppressNextClick = false;\n\n function handleAfterFocus(event: CustomEvent<FocusAfterRenderEvent>) {\n const { rowIndex, colIndex, column } = event.detail;\n focusedCell.value = column\n ? { rowIndex, colIndex, prop: String(column.prop) }\n : null;\n suppressNextClick = true;\n }\n\n function handleGridMousedown() {\n suppressNextClick = false;\n }\n\n function handleGridClick(event: MouseEvent) {\n if (suppressNextClick) {\n suppressNextClick = false;\n return;\n }\n const cell = focusedCell.value;\n if (!cell) return;\n\n const target = (event.target as HTMLElement).closest<HTMLElement>(\n '[data-rgrow][data-rgcol]',\n );\n if (!target) return;\n if (\n Number(target.dataset.rgrow) !== cell.rowIndex ||\n Number(target.dataset.rgcol) !== cell.colIndex\n ) {\n return;\n }\n\n const col = cols.value.find(c => c.prop === cell.prop);\n if (!col || col.readonly) return;\n\n const gridEl = gridContainerRef.value?.querySelector('revo-grid') as\n | HTMLRevoGridElement\n | undefined;\n gridEl?.setCellEdit(cell.rowIndex, cell.prop);\n }\n\n function handleAfterEdit(event: CustomEvent<AfterEditEvent>) {\n const detail = event.detail as Record<string, unknown>;\n\n // Single-cell edit: detail has rowIndex + prop + val\n if ('rowIndex' in detail) {\n const { rowIndex, prop, val } =\n detail as unknown as BeforeSaveDataDetails;\n onChange(rowIndex, String(prop), coerceCellValue(String(prop), val));\n return;\n }\n\n // Block edit (paste, range clear, etc.): detail has data keyed by row index\n const blockData = detail.data as\n | Record<string, Record<string, unknown>>\n | undefined;\n if (!blockData) return;\n\n for (const [rowKey, rowData] of Object.entries(blockData)) {\n const rowIndex = Number(rowKey);\n for (const [prop, val] of Object.entries(rowData)) {\n onChange(rowIndex, prop, coerceCellValue(prop, val));\n }\n }\n }\n\n return {\n gridEditors,\n revoColumns,\n gridStretch,\n plugins,\n coerceCellValue,\n handleAfterEdit,\n gridContainerRef,\n handleAfterFocus,\n handleGridMousedown,\n handleGridClick,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAS,GAAkB,GAAiC;AAS1D,QARI,EAAI,SAAS,YAAkB,YAC/B,EAAI,SAAS,WAAiB,WAC9B,EAAI,SAAS,kBAAwB,kBACrC,EAAI,SAAS,UAAgB,UAC7B,EAAI,SAAS,UAAgB,UAC7B,EAAI,SAAS,aAAmB,aAChC,EAAI,WAAiB,SACrB,EAAI,YAAkB,cACnB,EAAI,SAAS,WAAW,WAAW;;AAG5C,IAAM,IAAyC;CAC7C;CACA;CACA;CACA;CACA;CACD,EAcK,IAAiD;CACrD;CACA;CACA;CACA;CACD;AAOD,SAAS,EACP,GACA,GACA;AACA,QAAO,EACL,GACG,YACC,EAAE,GAAW;EACX,KAAK,EAAE;EACP,MAAM,EAAE;EACR,OAAO,EAAE;EACT,GAAG,EAAE,QAAQ,QAAQ;EACrB,GAAG,KAAc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AAS,GAAgB,GAAoC;EAC3D,IAAM,IAAS,EAAM;AAGrB,MAAI,cAAc,GAAQ;GACxB,IAAM,EAAE,aAAU,SAAM,WACtB;AACF,KAAS,GAAU,OAAO,EAAK,EAAE,EAAgB,OAAO,EAAK,EAAE,EAAI,CAAC;AACpE;;EAIF,IAAM,IAAY,EAAO;AAGpB,QAEL,MAAK,IAAM,CAAC,GAAQ,MAAY,OAAO,QAAQ,EAAU,EAAE;GACzD,IAAM,IAAW,OAAO,EAAO;AAC/B,QAAK,IAAM,CAAC,GAAM,MAAQ,OAAO,QAAQ,EAAQ,CAC/C,GAAS,GAAU,GAAM,EAAgB,GAAM,EAAI,CAAC;;;AAK1D,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
1
|
+
{"version":3,"file":"useWellGridColumns.js","names":[],"sources":["../../src/grid/useWellGridColumns.ts"],"sourcesContent":["import type {\n AfterEditEvent,\n BeforeSaveDataDetails,\n ColumnRegular,\n Editors,\n FocusAfterRenderEvent,\n GridPlugin,\n} from '@revolist/revogrid';\nimport {\n BasePlugin,\n VGridVueEditor,\n type PluginProviders,\n} from '@revolist/vue3-datagrid';\nimport type { LanguageTextInput } from '@welldot/core';\nimport {\n computed,\n defineComponent,\n h,\n ref,\n toValue,\n type Component,\n type MaybeRefOrGetter,\n} from 'vue';\nimport { useWellText } from '../composables/useWellText';\nimport type { DisplayUnitType } from '../composables/useWellUnits';\nimport { resolvePart, useWelldotConfig } from '../config';\nimport GridCheckboxCell from './cells/GridCheckboxCell.vue';\nimport GridColorCell from './cells/GridColorCell.vue';\nimport GridColorPickerEditor from './cells/GridColorPickerEditor.vue';\nimport GridComboEditor from './cells/GridComboEditor.vue';\nimport GridDeleteCell from './cells/GridDeleteCell.vue';\nimport GridDragCell from './cells/GridDragCell.vue';\nimport GridFormattedCell from './cells/GridFormattedCell.vue';\nimport GridHeaderCell from './cells/GridHeaderCell.vue';\nimport GridNumberEditor from './cells/GridNumberEditor.vue';\nimport GridSelectButtonCell from './cells/GridSelectButtonCell.vue';\nimport GridSelectCell from './cells/GridSelectCell.vue';\nimport GridSelectEditor from './cells/GridSelectEditor.vue';\nimport GridTextEditor from './cells/GridTextEditor.vue';\nimport GridTextureSelectCell from './cells/GridTextureSelectCell.vue';\nimport GridTextureSelectEditor from './cells/GridTextureSelectEditor.vue';\nimport GridUnitCell from './cells/GridUnitCell.vue';\nimport GridUnitEditor from './cells/GridUnitEditor.vue';\nimport { columnStretchPlugin } from './columnStretchPlugin';\nimport {\n useCellTemplate,\n type GridVueTemplate,\n} from './composables/useCellTemplate';\nimport { useUnitSuffix } from './composables/useUnitSuffix';\nimport WellGridDeleteButton from './parts/WellGridDeleteButton.vue';\nimport type {\n ResolvedGridOption,\n WellDataGridComponents,\n WellDataGridLabels,\n WellGridColumn,\n WellGridOption,\n} from './types';\n\n// ─── Column kinds ──────────────────────────────────────────────────────────\n// Declares how each column \"kind\" renders and edits.\n// `resolveColumnKind` decides which kind a column declaration maps to.\n\ntype ColumnKind =\n | 'text'\n | 'number'\n | 'unit'\n | 'color'\n | 'select'\n | 'select-button'\n | 'combo'\n | 'formatted'\n | 'checkbox'\n | 'texture';\n\n/** What a kind needs from one column, with its text already resolved. */\ninterface ResolvedColumn {\n col: WellGridColumn;\n options?: ResolvedGridOption[];\n}\n\ninterface ColumnKindDef {\n editor?: string;\n numeric?: boolean;\n cellProperties?: ColumnRegular['cellProperties'];\n cellTemplate?: (c: ResolvedColumn) => GridVueTemplate;\n /** Per-column props handed to the editor (read from `column.editorProps`). */\n editorProps?: (c: ResolvedColumn) => Record<string, unknown>;\n}\n\nfunction resolveColumnKind(col: WellGridColumn): ColumnKind {\n if (col.type === 'texture') return 'texture';\n if (col.type === 'select') return 'select';\n if (col.type === 'select-button') return 'select-button';\n if (col.type === 'combo') return 'combo';\n if (col.type === 'color') return 'color';\n if (col.type === 'checkbox') return 'checkbox';\n if (col.unitType) return 'unit';\n if (col.formatter) return 'formatted';\n return col.type === 'number' ? 'number' : 'text';\n}\n\nconst UNIT_TYPES: readonly DisplayUnitType[] = [\n 'length',\n 'diameter',\n 'flow',\n 'power',\n 'volume',\n];\n\n/** Props RevoGrid hands to every editor (`EditorType`). */\nexport interface GridEditorProps {\n val?: unknown;\n save: (value: unknown, preventFocus?: boolean) => void;\n close: (focusNext?: boolean) => void;\n /** Cell data model; `column.column` is the `ColumnRegular`. */\n column?: { column?: { editorProps?: Record<string, unknown> } };\n /** Row model of the edited cell. */\n model?: Record<string, unknown>;\n /** Key of the edited cell on `model`. */\n prop?: string | number;\n}\n\n/* eslint-disable vue/one-component-per-file -- tiny render-function editor\n adapters, not SFCs */\n\nconst EDITOR_PROP_KEYS: Array<keyof GridEditorProps> = [\n 'val',\n 'save',\n 'close',\n 'column',\n 'model',\n 'prop',\n];\n\n/**\n * Whether `val` is the key the user typed to open the editor rather than\n * the cell's stored value (RevoGrid passes `editCell.val || modelValue`).\n */\nexport function isEnteredValue(p: GridEditorProps): boolean {\n return p.prop != null && p.val !== p.model?.[p.prop];\n}\n\n/**\n * Editor that forwards `val`/`save`/`close` plus the column's\n * `editorProps` (and optional grid-wide props) to `component`. Lets one\n * editor per kind — registered once in setup — serve every column.\n */\nfunction columnEditor(\n component: Component,\n extraProps?: (p: GridEditorProps) => Record<string, unknown>,\n) {\n return VGridVueEditor(\n defineComponent(\n (p: GridEditorProps) => () =>\n h(component, {\n val: p.val,\n save: p.save,\n close: p.close,\n ...p.column?.column?.editorProps,\n ...extraProps?.(p),\n }),\n { inheritAttrs: false, props: EDITOR_PROP_KEYS },\n ),\n );\n}\n\nconst NoopEditor = defineComponent(\n (p: GridEditorProps) => {\n p.close();\n return () => null;\n },\n { inheritAttrs: false, props: EDITOR_PROP_KEYS },\n);\n\n/* eslint-enable vue/one-component-per-file */\n\nexport interface UseWellGridColumnsOptions {\n columns: MaybeRefOrGetter<WellGridColumn[]>;\n onDelete: (rowIndex: number, model: Record<string, unknown>) => void;\n onChange: (rowIndex: number, prop: string, value: unknown) => void;\n /** Include the pinned-start drag-handle column (default true) */\n enableDrag?: boolean;\n /** Include the pinned-end delete-row column (default true) */\n enableDelete?: boolean;\n /** Label handed to the delete-button part (its aria-label by default). */\n deleteLabel?: MaybeRefOrGetter<LanguageTextInput>;\n /** Grid-internal text (texture editor, header info trigger). */\n labels?: MaybeRefOrGetter<WellDataGridLabels | undefined>;\n /** Part overrides; `addButton` is rendered by `WellDataGrid` itself. */\n components?: MaybeRefOrGetter<WellDataGridComponents | undefined>;\n}\n\n/**\n * Editor registry, column-kind resolution and RevoGrid column builder for a\n * well feature grid. **Call it in `setup`**: cell templates and editors are\n * bound to the calling component's app context there (see\n * `useCellTemplate`), which is what lets cells reach `createWelldot` and\n * PrimeVue.\n */\nexport function useWellGridColumns(options: UseWellGridColumnsOptions) {\n const {\n onDelete,\n onChange,\n enableDrag = true,\n enableDelete = true,\n } = options;\n const cols = computed(() => toValue(options.columns));\n const labels = computed(() => toValue(options.labels) ?? {});\n const parts = computed(() => toValue(options.components) ?? {});\n\n const config = useWelldotConfig();\n const text = useWellText();\n const cellTemplate = useCellTemplate();\n const suffixes = Object.fromEntries(\n UNIT_TYPES.map(type => [type, useUnitSuffix(type)]),\n ) as Record<DisplayUnitType, ReturnType<typeof useUnitSuffix>>;\n\n // ─── Editors ───────────────────────────────────────────────────────────────\n // Created once, here in setup: `VGridVueEditor` captures the current\n // instance's app context when called. Per-column data (unit type, options)\n // travels on the column as `editorProps`.\n\n const gridEditors: Editors = {\n noop: VGridVueEditor(NoopEditor),\n text: VGridVueEditor(GridTextEditor),\n number: VGridVueEditor(GridNumberEditor),\n color: VGridVueEditor(GridColorPickerEditor),\n unit: columnEditor(GridUnitEditor, p => ({\n entered: isEnteredValue(p),\n })),\n select: columnEditor(GridSelectEditor),\n combo: columnEditor(GridComboEditor, () => ({\n hint: labels.value.comboHint,\n })),\n texture: columnEditor(GridTextureSelectEditor, () => ({\n placeholder: labels.value.texturePlaceholder,\n showPending: labels.value.showPendingTextures,\n })),\n };\n\n const headerTemplate = cellTemplate(GridHeaderCell);\n\n const stretchCol = computed(() => cols.value.find(c => c.stretch) ?? null);\n const stretchProp = computed(() => stretchCol.value?.prop ?? null);\n const gridStretch = computed(() => stretchProp.value === null);\n\n const plugins = computed(() => {\n const list: GridPlugin[] = [];\n if (enableDrag) {\n list.push(\n class HRPlugin extends BasePlugin {\n constructor(r: HTMLRevoGridElement, p: PluginProviders) {\n super(r, p);\n this.addEventListener('rowdragstart', e => {\n const name = e.detail.model?.['name'];\n if (typeof name === 'string' && name) {\n e.detail.text = name;\n }\n });\n }\n },\n );\n }\n if (stretchProp.value !== null) {\n list.push(\n columnStretchPlugin(stretchProp.value, stretchCol.value?.minSize),\n );\n }\n return list;\n });\n\n const checkboxCellProperties = () => ({ class: 'well-grid-checkbox-cell' });\n\n const columnKinds: Record<ColumnKind, ColumnKindDef> = {\n text: {},\n number: { numeric: true },\n unit: {\n editor: 'unit',\n numeric: true,\n editorProps: ({ col }) => ({ unitType: col.unitType }),\n cellTemplate: ({ col }) =>\n cellTemplate(GridUnitCell, { unitType: col.unitType }),\n },\n color: {\n editor: 'color',\n cellTemplate: () => cellTemplate(GridColorCell),\n },\n select: {\n editor: 'select',\n editorProps: ({ options }) => ({ options }),\n cellTemplate: ({ options }) => cellTemplate(GridSelectCell, { options }),\n },\n combo: {\n editor: 'combo',\n editorProps: ({ options }) => ({ options }),\n // GridSelectCell already falls back to the raw value when it isn't\n // one of the suggested options, which is exactly what free text needs.\n cellTemplate: ({ options }) => cellTemplate(GridSelectCell, { options }),\n },\n formatted: {\n cellTemplate: ({ col }) =>\n cellTemplate(GridFormattedCell, { formatter: col.formatter }),\n },\n checkbox: {\n editor: 'noop',\n cellProperties: checkboxCellProperties,\n cellTemplate: ({ col }) =>\n cellTemplate(GridCheckboxCell, {\n prop: col.prop,\n onToggle: (rowIndex: number, prop: string, value: boolean) =>\n onChange(rowIndex, prop, value),\n }),\n },\n 'select-button': {\n editor: 'noop',\n cellProperties: checkboxCellProperties,\n cellTemplate: ({ col, options }) =>\n cellTemplate(GridSelectButtonCell, {\n prop: col.prop,\n options,\n onChange: (rowIndex: number, prop: string, value: unknown) =>\n onChange(rowIndex, prop, value),\n }),\n },\n texture: {\n editor: 'texture',\n cellTemplate: () => cellTemplate(GridTextureSelectCell),\n },\n };\n\n function resolveOptions(\n list: readonly WellGridOption[],\n ): ResolvedGridOption[] {\n return list.map(o => ({\n value: o.value,\n label: text(o.label) ?? o.value,\n ...(o.deprecated && { deprecated: true }),\n }));\n }\n\n function buildColumn(col: WellGridColumn): ColumnRegular {\n const kind = columnKinds[resolveColumnKind(col)];\n const resolved: ResolvedColumn = {\n col,\n options: 'options' in col ? resolveOptions(col.options) : undefined,\n };\n const label = text(col.label) ?? '';\n const unit = col.unitType ? suffixes[col.unitType].value : null;\n const readonly = col.readonly ?? false;\n const info = text(col.info);\n\n return {\n prop: col.prop,\n name: unit ? `${label} (${unit})` : label,\n autoSize: !col.size && !col.stretch,\n size: col.size,\n readonly,\n editor: readonly\n ? undefined\n : (kind.editor ??\n col.editor ??\n (col.type === 'number' ? 'number' : 'text')),\n editorProps: kind.editorProps?.(resolved),\n pin: col.pin,\n cellProperties:\n kind.cellProperties ??\n (kind.numeric ? () => ({ class: 'num' }) : undefined),\n cellTemplate: kind.cellTemplate?.(resolved),\n ...(info && {\n info,\n infoHighlight: text(col.infoHighlight),\n infoLabel: text(labels.value.columnInfo),\n columnTemplate: headerTemplate,\n }),\n };\n }\n\n const revoColumns = computed<ColumnRegular[]>(() => {\n const result: ColumnRegular[] = [];\n if (enableDrag) {\n const dragHandle = resolvePart(\n 'dragHandle',\n parts.value.dragHandle,\n undefined,\n config,\n );\n result.push({\n prop: '_drag',\n name: '',\n size: 30,\n pin: 'colPinStart',\n rowDrag: true,\n cellProperties: () => ({ class: 'well-grid-drag-cell' }),\n // Without an override RevoGrid draws its own handle (styled by\n // grid.css). A template replaces it, so GridDragCell re-emits the\n // drag start RevoGrid's handle would have emitted.\n ...(dragHandle && {\n cellTemplate: cellTemplate(GridDragCell, { part: dragHandle }),\n }),\n });\n }\n result.push(...cols.value.map(buildColumn));\n if (enableDelete) {\n result.push({\n prop: '_delete',\n name: '',\n size: 40,\n readonly: true,\n pin: 'colPinEnd',\n cellProperties: () => ({ class: 'well-grid-delete-cell' }),\n cellTemplate: cellTemplate(GridDeleteCell, {\n part: resolvePart(\n 'deleteButton',\n parts.value.deleteButton,\n WellGridDeleteButton,\n config,\n ),\n label: text(toValue(options.deleteLabel)),\n requestDelete: onDelete,\n }),\n });\n }\n return result;\n });\n\n function coerceCellValue(prop: string, val: unknown): unknown {\n const col = cols.value.find(c => c.prop === prop);\n if (col?.type === 'checkbox' && typeof val === 'string') {\n return val === 'true' || val === '1' || val.toLowerCase() === 'yes';\n }\n return val;\n }\n\n // ─── Click-on-focused-cell → enter edit mode ───────────────────────────────\n // `afterfocus` only fires when focus moves to a new cell. A click that\n // triggers such a focus change is suppressed; a second click on the cell\n // that's already focused enters edit mode for it.\n\n const gridContainerRef = ref<HTMLElement | null>(null);\n const focusedCell = ref<{\n rowIndex: number;\n colIndex: number;\n prop: string;\n } | null>(null);\n let suppressNextClick = false;\n\n function handleAfterFocus(event: CustomEvent<FocusAfterRenderEvent>) {\n const { rowIndex, colIndex, column } = event.detail;\n focusedCell.value = column\n ? { rowIndex, colIndex, prop: String(column.prop) }\n : null;\n suppressNextClick = true;\n }\n\n function handleGridMousedown() {\n suppressNextClick = false;\n }\n\n function handleGridClick(event: MouseEvent) {\n if (suppressNextClick) {\n suppressNextClick = false;\n return;\n }\n const cell = focusedCell.value;\n if (!cell) return;\n\n const target = (event.target as HTMLElement).closest<HTMLElement>(\n '[data-rgrow][data-rgcol]',\n );\n if (!target) return;\n if (\n Number(target.dataset.rgrow) !== cell.rowIndex ||\n Number(target.dataset.rgcol) !== cell.colIndex\n ) {\n return;\n }\n\n const col = cols.value.find(c => c.prop === cell.prop);\n if (!col || col.readonly) return;\n\n const gridEl = gridContainerRef.value?.querySelector('revo-grid') as\n | HTMLRevoGridElement\n | undefined;\n gridEl?.setCellEdit(cell.rowIndex, cell.prop);\n }\n\n function handleAfterEdit(event: CustomEvent<AfterEditEvent>) {\n const detail = event.detail as Record<string, unknown>;\n\n // Single-cell edit: detail has rowIndex + prop + val\n if ('rowIndex' in detail) {\n const { rowIndex, prop, val } =\n detail as unknown as BeforeSaveDataDetails;\n onChange(rowIndex, String(prop), coerceCellValue(String(prop), val));\n return;\n }\n\n // Block edit (paste, range clear, etc.): detail has data keyed by row index\n const blockData = detail.data as\n | Record<string, Record<string, unknown>>\n | undefined;\n if (!blockData) return;\n\n for (const [rowKey, rowData] of Object.entries(blockData)) {\n const rowIndex = Number(rowKey);\n for (const [prop, val] of Object.entries(rowData)) {\n onChange(rowIndex, prop, coerceCellValue(prop, val));\n }\n }\n }\n\n return {\n gridEditors,\n revoColumns,\n gridStretch,\n plugins,\n coerceCellValue,\n handleAfterEdit,\n gridContainerRef,\n handleAfterFocus,\n handleGridMousedown,\n handleGridClick,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAS,EAAkB,GAAiC;AAS1D,QARI,EAAI,SAAS,YAAkB,YAC/B,EAAI,SAAS,WAAiB,WAC9B,EAAI,SAAS,kBAAwB,kBACrC,EAAI,SAAS,UAAgB,UAC7B,EAAI,SAAS,UAAgB,UAC7B,EAAI,SAAS,aAAmB,aAChC,EAAI,WAAiB,SACrB,EAAI,YAAkB,cACnB,EAAI,SAAS,WAAW,WAAW;;AAG5C,IAAM,IAAyC;CAC7C;CACA;CACA;CACA;CACA;CACD,EAkBK,IAAiD;CACrD;CACA;CACA;CACA;CACA;CACA;CACD;AAMD,SAAgB,EAAe,GAA6B;AAC1D,QAAO,EAAE,QAAQ,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;;AAQjD,SAAS,EACP,GACA,GACA;AACA,QAAO,EACL,GACG,YACC,EAAE,GAAW;EACX,KAAK,EAAE;EAC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AK,EAAE,SAAS,EAAK,KAAK;AAClD,GAAC,KAAO,EAAI,aAED,EAAiB,OAAO,cAAc,YAAY,GAGzD,YAAY,EAAK,UAAU,EAAK,KAAK;;CAG/C,SAAS,GAAgB,GAAoC;EAC3D,IAAM,IAAS,EAAM;AAGrB,MAAI,cAAc,GAAQ;GACxB,IAAM,EAAE,aAAU,SAAM,WACtB;AACF,KAAS,GAAU,OAAO,EAAK,EAAE,EAAgB,OAAO,EAAK,EAAE,EAAI,CAAC;AACpE;;EAIF,IAAM,IAAY,EAAO;AAGpB,QAEL,MAAK,IAAM,CAAC,GAAQ,MAAY,OAAO,QAAQ,EAAU,EAAE;GACzD,IAAM,IAAW,OAAO,EAAO;AAC/B,QAAK,IAAM,CAAC,GAAM,MAAQ,OAAO,QAAQ,EAAQ,CAC/C,GAAS,GAAU,GAAM,EAAgB,GAAM,EAAI,CAAC;;;AAK1D,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@welldot/vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Vue 3 + PrimeVue base components, theme and composables for .well water well editors",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"primevue": "^4.5.0",
|
|
79
79
|
"vue": "^3.5.0",
|
|
80
80
|
"vue-color": "^3.3.0",
|
|
81
|
-
"@welldot/
|
|
82
|
-
"@welldot/
|
|
83
|
-
"@welldot/
|
|
81
|
+
"@welldot/core": "^0.7.0",
|
|
82
|
+
"@welldot/render": "^0.4.3",
|
|
83
|
+
"@welldot/utils": "^0.5.2"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@nuxt/kit": {
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"vue": "3.5.34",
|
|
125
125
|
"vue-color": "^3.3.3",
|
|
126
126
|
"vue-eslint-parser": "^10.4.0",
|
|
127
|
-
"@welldot/core": "0.
|
|
127
|
+
"@welldot/core": "0.7.0",
|
|
128
128
|
"@welldot/lint": "0.0.1",
|
|
129
|
-
"@welldot/
|
|
130
|
-
"@welldot/
|
|
129
|
+
"@welldot/render": "0.4.3",
|
|
130
|
+
"@welldot/utils": "0.5.2"
|
|
131
131
|
},
|
|
132
132
|
"scripts": {
|
|
133
133
|
"build": "vite build",
|