@dolusoft/query-table 3.19.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cells.js +218 -0
- package/dist/cells.js.map +1 -0
- package/dist/data-table.js +1 -1
- package/dist/query-table.js +1 -1
- package/dist/{src-BTIXBmwM.js → src-Cam4kRTd.js} +5 -14
- package/dist/src-Cam4kRTd.js.map +1 -0
- package/dist/table-context-Duuqp9Jq.js +28 -0
- package/dist/table-context-Duuqp9Jq.js.map +1 -0
- package/dist/types/cells/cell-action.vue.d.ts +16 -0
- package/dist/types/cells/cell-actions.vue.d.ts +13 -0
- package/dist/types/cells/cell-badge.vue.d.ts +17 -0
- package/dist/types/cells/cell-copy.vue.d.ts +8 -0
- package/dist/types/cells/cell-preview.vue.d.ts +8 -0
- package/dist/types/cells/cell-stack.vue.d.ts +16 -0
- package/dist/types/cells/cell-value.vue.d.ts +4 -0
- package/dist/types/cells/contract.d.ts +44 -0
- package/dist/types/cells/index.d.ts +8 -0
- package/dist/types/contract.d.ts +16 -0
- package/dist/types/core/cell-labels.d.ts +10 -0
- package/dist/types/core/table-context.d.ts +2 -0
- package/dist/types/core/table-labels.d.ts +9 -0
- package/package.json +7 -3
- package/dist/src-BTIXBmwM.js.map +0 -1
package/dist/cells.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { i as cellLabelDefaults, n as tableContextKey } from "./table-context-Duuqp9Jq.js";
|
|
2
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, defineComponent, inject, openBlock, renderSlot, toDisplayString, unref, useSlots } from "vue";
|
|
3
|
+
//#region src/cells/cell-action.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _hoisted_1$6 = ["data-kind"];
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/cells/cell-action.vue
|
|
7
|
+
var cell_action_default = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "CellAction",
|
|
9
|
+
__name: "cell-action",
|
|
10
|
+
props: { kind: { default: "default" } },
|
|
11
|
+
setup(__props) {
|
|
12
|
+
return (_ctx, _cache) => {
|
|
13
|
+
return openBlock(), createElementBlock("button", {
|
|
14
|
+
type: "button",
|
|
15
|
+
class: "qt-cell-action",
|
|
16
|
+
"data-kind": __props.kind
|
|
17
|
+
}, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$6);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/cells/cell-actions.vue?vue&type=script&setup=true&lang.ts
|
|
23
|
+
var _hoisted_1$5 = { class: "qt-cell-actions" };
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/cells/cell-actions.vue
|
|
26
|
+
var cell_actions_default = /* @__PURE__ */ defineComponent({
|
|
27
|
+
name: "CellActions",
|
|
28
|
+
__name: "cell-actions",
|
|
29
|
+
setup(__props) {
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createElementBlock("span", _hoisted_1$5, [renderSlot(_ctx.$slots, "default")]);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/cells/cell-badge.vue?vue&type=script&setup=true&lang.ts
|
|
37
|
+
var _hoisted_1$4 = ["data-tone"];
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/cells/cell-badge.vue
|
|
40
|
+
var cell_badge_default = /* @__PURE__ */ defineComponent({
|
|
41
|
+
name: "CellBadge",
|
|
42
|
+
__name: "cell-badge",
|
|
43
|
+
props: {
|
|
44
|
+
text: { default: void 0 },
|
|
45
|
+
tone: { default: "neutral" }
|
|
46
|
+
},
|
|
47
|
+
setup(__props) {
|
|
48
|
+
return (_ctx, _cache) => {
|
|
49
|
+
return openBlock(), createElementBlock("span", {
|
|
50
|
+
class: "qt-cell-badge",
|
|
51
|
+
"data-tone": __props.tone
|
|
52
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [createTextVNode(toDisplayString(__props.text), 1)])], 8, _hoisted_1$4);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/core/table-labels.ts
|
|
58
|
+
/**
|
|
59
|
+
* The cell labels of the table a component sits in, read again on every
|
|
60
|
+
* call so they follow the table's `labels` prop. An entry the table leaves
|
|
61
|
+
* out, or gives as `undefined`, is the English default; outside a table
|
|
62
|
+
* every entry is (C-129). The one module of the main part the cell
|
|
63
|
+
* components import (ADR 0022, K320-6).
|
|
64
|
+
*/
|
|
65
|
+
var useCellLabels = () => {
|
|
66
|
+
const context = inject(tableContextKey, null);
|
|
67
|
+
if (!context) return () => cellLabelDefaults;
|
|
68
|
+
return () => {
|
|
69
|
+
const labels = context.labels();
|
|
70
|
+
return {
|
|
71
|
+
copyValue: labels.copyValue ?? cellLabelDefaults.copyValue,
|
|
72
|
+
previewValue: labels.previewValue ?? cellLabelDefaults.previewValue,
|
|
73
|
+
emptyValue: labels.emptyValue ?? cellLabelDefaults.emptyValue
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/cells/cell-copy.vue?vue&type=script&setup=true&lang.ts
|
|
79
|
+
var _hoisted_1$3 = { class: "qt-cell-copy" };
|
|
80
|
+
var _hoisted_2$2 = { class: "qt-cell-copy-text" };
|
|
81
|
+
var _hoisted_3$2 = ["aria-label", "title"];
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/cells/cell-copy.vue
|
|
84
|
+
var cell_copy_default = /* @__PURE__ */ defineComponent({
|
|
85
|
+
name: "CellCopy",
|
|
86
|
+
__name: "cell-copy",
|
|
87
|
+
props: { value: {} },
|
|
88
|
+
emits: ["copy"],
|
|
89
|
+
setup(__props, { emit: __emit }) {
|
|
90
|
+
const props = __props;
|
|
91
|
+
const emit = __emit;
|
|
92
|
+
const labels = useCellLabels();
|
|
93
|
+
const text = () => String(props.value);
|
|
94
|
+
const name = computed(() => labels().copyValue(text()));
|
|
95
|
+
return (_ctx, _cache) => {
|
|
96
|
+
return openBlock(), createElementBlock("span", _hoisted_1$3, [createElementVNode("code", _hoisted_2$2, toDisplayString(__props.value), 1), createElementVNode("button", {
|
|
97
|
+
type: "button",
|
|
98
|
+
class: "qt-cell-copy-button",
|
|
99
|
+
"aria-label": name.value,
|
|
100
|
+
title: name.value,
|
|
101
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("copy", text()))
|
|
102
|
+
}, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
|
|
103
|
+
class: "qt-cell-icon",
|
|
104
|
+
width: "14",
|
|
105
|
+
height: "14",
|
|
106
|
+
viewBox: "0 0 16 16",
|
|
107
|
+
fill: "none",
|
|
108
|
+
stroke: "currentColor",
|
|
109
|
+
"stroke-width": "1.5",
|
|
110
|
+
"stroke-linecap": "round",
|
|
111
|
+
"stroke-linejoin": "round",
|
|
112
|
+
"aria-hidden": "true"
|
|
113
|
+
}, [createElementVNode("rect", {
|
|
114
|
+
x: "5.5",
|
|
115
|
+
y: "5.5",
|
|
116
|
+
width: "7.5",
|
|
117
|
+
height: "7.5",
|
|
118
|
+
rx: "1.5"
|
|
119
|
+
}), createElementVNode("path", { d: "M3 10.5V4a1 1 0 0 1 1-1h6.5" })], -1)])], 8, _hoisted_3$2)]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/cells/cell-preview.vue?vue&type=script&setup=true&lang.ts
|
|
125
|
+
var _hoisted_1$2 = { class: "qt-cell-preview" };
|
|
126
|
+
var _hoisted_2$1 = { class: "qt-cell-preview-text" };
|
|
127
|
+
var _hoisted_3$1 = ["aria-label", "title"];
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/cells/cell-preview.vue
|
|
130
|
+
var cell_preview_default = /* @__PURE__ */ defineComponent({
|
|
131
|
+
name: "CellPreview",
|
|
132
|
+
__name: "cell-preview",
|
|
133
|
+
props: { text: {} },
|
|
134
|
+
emits: ["preview"],
|
|
135
|
+
setup(__props, { emit: __emit }) {
|
|
136
|
+
const props = __props;
|
|
137
|
+
const emit = __emit;
|
|
138
|
+
const labels = useCellLabels();
|
|
139
|
+
const value = () => String(props.text);
|
|
140
|
+
const name = computed(() => labels().previewValue(value()));
|
|
141
|
+
return (_ctx, _cache) => {
|
|
142
|
+
return openBlock(), createElementBlock("span", _hoisted_1$2, [createElementVNode("span", _hoisted_2$1, toDisplayString(__props.text), 1), createElementVNode("button", {
|
|
143
|
+
type: "button",
|
|
144
|
+
class: "qt-cell-preview-button",
|
|
145
|
+
"aria-label": name.value,
|
|
146
|
+
title: name.value,
|
|
147
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("preview", value()))
|
|
148
|
+
}, [..._cache[1] || (_cache[1] = [createElementVNode("svg", {
|
|
149
|
+
class: "qt-cell-icon",
|
|
150
|
+
width: "14",
|
|
151
|
+
height: "14",
|
|
152
|
+
viewBox: "0 0 16 16",
|
|
153
|
+
fill: "none",
|
|
154
|
+
stroke: "currentColor",
|
|
155
|
+
"stroke-width": "1.5",
|
|
156
|
+
"stroke-linecap": "round",
|
|
157
|
+
"stroke-linejoin": "round",
|
|
158
|
+
"aria-hidden": "true"
|
|
159
|
+
}, [createElementVNode("path", { d: "M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z" }), createElementVNode("circle", {
|
|
160
|
+
cx: "8",
|
|
161
|
+
cy: "8",
|
|
162
|
+
r: "1.75"
|
|
163
|
+
})], -1)])], 8, _hoisted_3$1)]);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/cells/cell-stack.vue?vue&type=script&setup=true&lang.ts
|
|
169
|
+
var _hoisted_1$1 = { class: "qt-cell-stack" };
|
|
170
|
+
var _hoisted_2 = { class: "qt-cell-primary" };
|
|
171
|
+
var _hoisted_3 = {
|
|
172
|
+
key: 0,
|
|
173
|
+
class: "qt-cell-secondary"
|
|
174
|
+
};
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/cells/cell-stack.vue
|
|
177
|
+
var cell_stack_default = /* @__PURE__ */ defineComponent({
|
|
178
|
+
name: "CellStack",
|
|
179
|
+
__name: "cell-stack",
|
|
180
|
+
props: {
|
|
181
|
+
primary: {},
|
|
182
|
+
secondary: {}
|
|
183
|
+
},
|
|
184
|
+
setup(__props) {
|
|
185
|
+
const props = __props;
|
|
186
|
+
const slots = useSlots();
|
|
187
|
+
const hasSecondary = () => slots.secondary !== void 0 || props.secondary !== void 0 && props.secondary !== null && props.secondary !== "";
|
|
188
|
+
return (_ctx, _cache) => {
|
|
189
|
+
return openBlock(), createElementBlock("span", _hoisted_1$1, [createElementVNode("span", _hoisted_2, [renderSlot(_ctx.$slots, "primary", {}, () => [createTextVNode(toDisplayString(__props.primary), 1)])]), hasSecondary() ? (openBlock(), createElementBlock("span", _hoisted_3, [renderSlot(_ctx.$slots, "secondary", {}, () => [createTextVNode(toDisplayString(__props.secondary), 1)])])) : createCommentVNode("", true)]);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/cells/cell-value.vue?vue&type=script&setup=true&lang.ts
|
|
195
|
+
var _hoisted_1 = {
|
|
196
|
+
key: 0,
|
|
197
|
+
class: "qt-cell-empty"
|
|
198
|
+
};
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/cells/cell-value.vue
|
|
201
|
+
var cell_value_default = /* @__PURE__ */ defineComponent({
|
|
202
|
+
name: "CellValue",
|
|
203
|
+
inheritAttrs: false,
|
|
204
|
+
__name: "cell-value",
|
|
205
|
+
props: { value: {} },
|
|
206
|
+
setup(__props) {
|
|
207
|
+
const props = __props;
|
|
208
|
+
const labels = useCellLabels();
|
|
209
|
+
const empty = () => props.value === null || props.value === void 0 || props.value === "";
|
|
210
|
+
return (_ctx, _cache) => {
|
|
211
|
+
return empty() ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(unref(labels)().emptyValue), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(String(__props.value)), 1)], 64));
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
//#endregion
|
|
216
|
+
export { cell_action_default as CellAction, cell_actions_default as CellActions, cell_badge_default as CellBadge, cell_copy_default as CellCopy, cell_preview_default as CellPreview, cell_stack_default as CellStack, cell_value_default as CellValue };
|
|
217
|
+
|
|
218
|
+
//# sourceMappingURL=cells.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cells.js","names":["_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_sfc_main","_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_sfc_main","_hoisted_1","_openBlock","_createElementBlock","_renderSlot","_createTextVNode","_toDisplayString","_sfc_main","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_sfc_main","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_sfc_main","_hoisted_1","_useSlots","_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode","_sfc_main","_openBlock","_createElementBlock","_toDisplayString","_unref","_Fragment","_createTextVNode","_sfc_main"],"sources":["../src/cells/cell-action.vue","../src/cells/cell-action.vue","../src/cells/cell-actions.vue","../src/cells/cell-actions.vue","../src/cells/cell-badge.vue","../src/cells/cell-badge.vue","../src/core/table-labels.ts","../src/cells/cell-copy.vue","../src/cells/cell-copy.vue","../src/cells/cell-preview.vue","../src/cells/cell-preview.vue","../src/cells/cell-stack.vue","../src/cells/cell-stack.vue","../src/cells/cell-value.vue","../src/cells/cell-value.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CellActionProps } from './contract'\n\n// Attributes and listeners (`onClick`, `aria-label`, `disabled`) fall\n// through to the button: the action is the consumer's.\ndefineOptions({ name: 'CellAction' })\n\nwithDefaults(defineProps<CellActionProps>(), { kind: 'default' })\n\ndefineSlots<{\n /** The button's text, the consumer's content (C-129). */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <button type=\"button\" class=\"qt-cell-action\" :data-kind=\"kind\">\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellActionProps } from './contract'\n\n// Attributes and listeners (`onClick`, `aria-label`, `disabled`) fall\n// through to the button: the action is the consumer's.\ndefineOptions({ name: 'CellAction' })\n\nwithDefaults(defineProps<CellActionProps>(), { kind: 'default' })\n\ndefineSlots<{\n /** The button's text, the consumer's content (C-129). */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <button type=\"button\" class=\"qt-cell-action\" :data-kind=\"kind\">\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ndefineOptions({ name: 'CellActions' })\n\ndefineSlots<{\n /** The `CellAction` buttons. */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <span class=\"qt-cell-actions\"><slot /></span>\n</template>\n","<script setup lang=\"ts\">\ndefineOptions({ name: 'CellActions' })\n\ndefineSlots<{\n /** The `CellAction` buttons. */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <span class=\"qt-cell-actions\"><slot /></span>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellBadgeProps } from './contract'\n\ndefineOptions({ name: 'CellBadge' })\n\nwithDefaults(defineProps<CellBadgeProps>(), {\n text: undefined,\n tone: 'neutral'\n})\n\ndefineSlots<{\n /** Replaces `text`. */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <span class=\"qt-cell-badge\" :data-tone=\"tone\"\n ><slot>{{ text }}</slot></span\n >\n</template>\n","<script setup lang=\"ts\">\nimport type { CellBadgeProps } from './contract'\n\ndefineOptions({ name: 'CellBadge' })\n\nwithDefaults(defineProps<CellBadgeProps>(), {\n text: undefined,\n tone: 'neutral'\n})\n\ndefineSlots<{\n /** Replaces `text`. */\n default?(): unknown\n}>()\n</script>\n\n<template>\n <span class=\"qt-cell-badge\" :data-tone=\"tone\"\n ><slot>{{ text }}</slot></span\n >\n</template>\n","import { inject } from 'vue'\n\nimport { cellLabelDefaults, type CellLabels } from './cell-labels'\nimport { tableContextKey } from './table-context'\n\n/**\n * The cell labels of the table a component sits in, read again on every\n * call so they follow the table's `labels` prop. An entry the table leaves\n * out, or gives as `undefined`, is the English default; outside a table\n * every entry is (C-129). The one module of the main part the cell\n * components import (ADR 0022, K320-6).\n */\nexport const useCellLabels = (): (() => CellLabels) => {\n const context = inject(tableContextKey, null)\n if (!context) {\n return () => cellLabelDefaults\n }\n return () => {\n const labels: Partial<CellLabels> = context.labels()\n return {\n copyValue: labels.copyValue ?? cellLabelDefaults.copyValue,\n previewValue: labels.previewValue ?? cellLabelDefaults.previewValue,\n emptyValue: labels.emptyValue ?? cellLabelDefaults.emptyValue\n }\n }\n}\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CellCopyProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\ndefineOptions({ name: 'CellCopy' })\n\nconst props = defineProps<CellCopyProps>()\n\nconst emit = defineEmits<{\n /** The button was pressed. Writing the clipboard is the consumer's (C-129). */\n copy: [value: string]\n}>()\n\nconst labels = useCellLabels()\nconst text = () => String(props.value)\n// One name for `aria-label` and `title`, computed once per change.\nconst name = computed(() => labels().copyValue(text()))\n</script>\n\n<template>\n <span class=\"qt-cell-copy\">\n <code class=\"qt-cell-copy-text\">{{ value }}</code>\n <button\n type=\"button\"\n class=\"qt-cell-copy-button\"\n :aria-label=\"name\"\n :title=\"name\"\n @click=\"emit('copy', text())\"\n >\n <svg\n class=\"qt-cell-icon\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect x=\"5.5\" y=\"5.5\" width=\"7.5\" height=\"7.5\" rx=\"1.5\" />\n <path d=\"M3 10.5V4a1 1 0 0 1 1-1h6.5\" />\n </svg>\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CellCopyProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\ndefineOptions({ name: 'CellCopy' })\n\nconst props = defineProps<CellCopyProps>()\n\nconst emit = defineEmits<{\n /** The button was pressed. Writing the clipboard is the consumer's (C-129). */\n copy: [value: string]\n}>()\n\nconst labels = useCellLabels()\nconst text = () => String(props.value)\n// One name for `aria-label` and `title`, computed once per change.\nconst name = computed(() => labels().copyValue(text()))\n</script>\n\n<template>\n <span class=\"qt-cell-copy\">\n <code class=\"qt-cell-copy-text\">{{ value }}</code>\n <button\n type=\"button\"\n class=\"qt-cell-copy-button\"\n :aria-label=\"name\"\n :title=\"name\"\n @click=\"emit('copy', text())\"\n >\n <svg\n class=\"qt-cell-icon\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <rect x=\"5.5\" y=\"5.5\" width=\"7.5\" height=\"7.5\" rx=\"1.5\" />\n <path d=\"M3 10.5V4a1 1 0 0 1 1-1h6.5\" />\n </svg>\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CellPreviewProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\ndefineOptions({ name: 'CellPreview' })\n\nconst props = defineProps<CellPreviewProps>()\n\nconst emit = defineEmits<{\n /** The button was pressed. Showing the preview is the consumer's (C-129). */\n preview: [text: string]\n}>()\n\nconst labels = useCellLabels()\nconst value = () => String(props.text)\n// One name for `aria-label` and `title`, computed once per change.\nconst name = computed(() => labels().previewValue(value()))\n</script>\n\n<template>\n <span class=\"qt-cell-preview\">\n <span class=\"qt-cell-preview-text\">{{ text }}</span>\n <button\n type=\"button\"\n class=\"qt-cell-preview-button\"\n :aria-label=\"name\"\n :title=\"name\"\n @click=\"emit('preview', value())\"\n >\n <svg\n class=\"qt-cell-icon\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z\"\n />\n <circle cx=\"8\" cy=\"8\" r=\"1.75\" />\n </svg>\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\nimport type { CellPreviewProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\ndefineOptions({ name: 'CellPreview' })\n\nconst props = defineProps<CellPreviewProps>()\n\nconst emit = defineEmits<{\n /** The button was pressed. Showing the preview is the consumer's (C-129). */\n preview: [text: string]\n}>()\n\nconst labels = useCellLabels()\nconst value = () => String(props.text)\n// One name for `aria-label` and `title`, computed once per change.\nconst name = computed(() => labels().previewValue(value()))\n</script>\n\n<template>\n <span class=\"qt-cell-preview\">\n <span class=\"qt-cell-preview-text\">{{ text }}</span>\n <button\n type=\"button\"\n class=\"qt-cell-preview-button\"\n :aria-label=\"name\"\n :title=\"name\"\n @click=\"emit('preview', value())\"\n >\n <svg\n class=\"qt-cell-icon\"\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M1.5 8S4 3.5 8 3.5 14.5 8 14.5 8 12 12.5 8 12.5 1.5 8 1.5 8Z\"\n />\n <circle cx=\"8\" cy=\"8\" r=\"1.75\" />\n </svg>\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellStackProps } from './contract'\n\ndefineOptions({ name: 'CellStack' })\n\nconst props = defineProps<CellStackProps>()\n\nconst slots = defineSlots<{\n /** Replaces `primary`. */\n primary?(): unknown\n /** Replaces `secondary`. */\n secondary?(): unknown\n}>()\n\nconst hasSecondary = () =>\n slots.secondary !== undefined ||\n (props.secondary !== undefined &&\n props.secondary !== null &&\n props.secondary !== '')\n</script>\n\n<template>\n <span class=\"qt-cell-stack\">\n <span class=\"qt-cell-primary\"\n ><slot name=\"primary\">{{ primary }}</slot></span\n >\n <span v-if=\"hasSecondary()\" class=\"qt-cell-secondary\"\n ><slot name=\"secondary\">{{ secondary }}</slot></span\n >\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellStackProps } from './contract'\n\ndefineOptions({ name: 'CellStack' })\n\nconst props = defineProps<CellStackProps>()\n\nconst slots = defineSlots<{\n /** Replaces `primary`. */\n primary?(): unknown\n /** Replaces `secondary`. */\n secondary?(): unknown\n}>()\n\nconst hasSecondary = () =>\n slots.secondary !== undefined ||\n (props.secondary !== undefined &&\n props.secondary !== null &&\n props.secondary !== '')\n</script>\n\n<template>\n <span class=\"qt-cell-stack\">\n <span class=\"qt-cell-primary\"\n ><slot name=\"primary\">{{ primary }}</slot></span\n >\n <span v-if=\"hasSecondary()\" class=\"qt-cell-secondary\"\n ><slot name=\"secondary\">{{ secondary }}</slot></span\n >\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellValueProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\n// A value is drawn as bare text, which cannot carry an attribute, so\n// CellValue takes none, whether the value is empty or not (C-128): the same\n// markup for every row, and no warning for an attribute dropped.\ndefineOptions({ name: 'CellValue', inheritAttrs: false })\n\nconst props = defineProps<CellValueProps>()\n\nconst labels = useCellLabels()\nconst empty = () =>\n props.value === null || props.value === undefined || props.value === ''\n</script>\n\n<template>\n <span v-if=\"empty()\" class=\"qt-cell-empty\">{{ labels().emptyValue }}</span>\n <template v-else>{{ String(value) }}</template>\n</template>\n","<script setup lang=\"ts\">\nimport type { CellValueProps } from './contract'\nimport { useCellLabels } from '../core/table-labels'\n\n// A value is drawn as bare text, which cannot carry an attribute, so\n// CellValue takes none, whether the value is empty or not (C-128): the same\n// markup for every row, and no warning for an attribute dropped.\ndefineOptions({ name: 'CellValue', inheritAttrs: false })\n\nconst props = defineProps<CellValueProps>()\n\nconst labels = useCellLabels()\nconst empty = () =>\n props.value === null || props.value === undefined || props.value === ''\n</script>\n\n<template>\n <span v-if=\"empty()\" class=\"qt-cell-empty\">{{ labels().emptyValue }}</span>\n <template v-else>{{ String(value) }}</template>\n</template>\n"],"mappings":";;;;;;;;;;;;GAgBE,OAAAC,UAAA,GAAAC,mBAES,UAAA;IAFD,MAAK;IAAS,OAAM;IAAkB,aAAW,QAAA;GACvDC,GAAAA,CAAAA,WAAQ,KAAA,QAAA,SAAA,CAAA,GAAA,GAAA,YAAA;;;;;;;;;;;;;;GEPV,OAAAG,UAAA,GAAAC,mBAA6C,QAA7CF,cAA6C,CAAfG,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;GEOtC,OAAAG,UAAA,GAAAC,mBAEC,QAAA;IAFK,OAAM;IAAiB,aAAW,QAAA;GACrCC,GAAAA,CAAAA,WAAuB,KAAA,QAAA,WAAA,CAAA,SAAA,CAAdC,gBAAAC,gBAAA,QAAA,IAAI,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,YAAA;;;;;;;;;;;;;AENlB,IAAa,sBAA0C;CACrD,MAAM,UAAU,OAAO,iBAAiB,IAAI;CAC5C,IAAI,CAAC,SACH,aAAa;CAEf,aAAa;EACX,MAAM,SAA8B,QAAQ,OAAO;EACnD,OAAO;GACL,WAAW,OAAO,aAAa,kBAAkB;GACjD,cAAc,OAAO,gBAAgB,kBAAkB;GACvD,YAAY,OAAO,cAAc,kBAAk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AAG,UAAU,GAAA,CAAA,MACjEH,UAAA,GAAAC,mBAA+CG,UAAA,EAAA,KAAA,EAAA,GAAA,CAA3BC,gBAAAH,gBAAA,OAAO,QAAA,KAAK,CAAA,GAAA,CAAA,CAAA,GAAA,EAAA"}
|
package/dist/data-table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as query_table_default } from "./src-
|
|
1
|
+
import { r as query_table_default } from "./src-Cam4kRTd.js";
|
|
2
2
|
import { t as useLocalQuery } from "./local-DDJEp4Nn.js";
|
|
3
3
|
import { camelize, computed, createBlock, createSlots, defineComponent, getCurrentInstance, guardReactiveProps, mergeProps, normalizeProps, openBlock, renderList, renderSlot, shallowRef, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
4
4
|
import { columnTypeOf, sameQuery } from "@dolusoft/query-protocol";
|
package/dist/query-table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as useQueryTable, n as parseFilterInput, r as query_table_default, t as src_default } from "./src-
|
|
1
|
+
import { i as useQueryTable, n as parseFilterInput, r as query_table_default, t as src_default } from "./src-Cam4kRTd.js";
|
|
2
2
|
export { query_table_default as QueryTable, src_default as default, parseFilterInput, useQueryTable };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as cellLabelDefaults, r as useTableContext, t as provideTableContext } from "./table-context-Duuqp9Jq.js";
|
|
2
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createStaticVNode, createTextVNode, createVNode, defineComponent, effectScope, getCurrentInstance, getCurrentScope, guardReactiveProps, h, mergeProps, nextTick, normalizeProps, normalizeStyle, onActivated, onBeforeUnmount, onBeforeUpdate, onDeactivated, onMounted, onScopeDispose, openBlock, renderList, renderSlot, shallowRef, toDisplayString, toHandlers, toValue, unref, useSlots, watch, watchEffect, withCtx, withKeys, withModifiers } from "vue";
|
|
2
3
|
import { cloneQuery, columnTypeOf, columnTypeOf as columnTypeOf$1, conditionArity, conditionLabel, conditionOptions, isCursorQuery, parseFilterInput, rulesOf, sameQuery, searchOf } from "@dolusoft/query-protocol";
|
|
3
4
|
import { createRowChangeTracker } from "@dolusoft/query-table-core/row-changes";
|
|
4
5
|
import { dispose, filterInputFeature, projectServerQuery, serverQueryFeature } from "@dolusoft/query-table-core";
|
|
@@ -265,7 +266,8 @@ var defaultLabels = {
|
|
|
265
266
|
boolTrue: "True",
|
|
266
267
|
boolFalse: "False",
|
|
267
268
|
selectRow: "Select row",
|
|
268
|
-
selectAllRows: "Select all rows"
|
|
269
|
+
selectAllRows: "Select all rows",
|
|
270
|
+
...cellLabelDefaults
|
|
269
271
|
};
|
|
270
272
|
var resolveLabels = (labels) => ({
|
|
271
273
|
...defaultLabels,
|
|
@@ -274,17 +276,6 @@ var resolveLabels = (labels) => ({
|
|
|
274
276
|
/** The name of a column in a label: its `title`, else its `field`. */
|
|
275
277
|
var columnName = (column) => column.title || column.field;
|
|
276
278
|
//#endregion
|
|
277
|
-
//#region src/core/table-context.ts
|
|
278
|
-
var tableContextKey = Symbol("query-table");
|
|
279
|
-
var provideTableContext = (context) => {
|
|
280
|
-
provide(tableContextKey, context);
|
|
281
|
-
};
|
|
282
|
-
var useTableContext = () => {
|
|
283
|
-
const context = inject(tableContextKey);
|
|
284
|
-
if (!context) throw new Error("Header parts must be rendered inside a QueryTable");
|
|
285
|
-
return context;
|
|
286
|
-
};
|
|
287
|
-
//#endregion
|
|
288
279
|
//#region src/filter/focus-filter.ts
|
|
289
280
|
var focusable = "input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
290
281
|
/**
|
|
@@ -4925,4 +4916,4 @@ var src_default = query_table_default;
|
|
|
4925
4916
|
//#endregion
|
|
4926
4917
|
export { useQueryTable as i, parseFilterInput$1 as n, query_table_default as r, src_default as t };
|
|
4927
4918
|
|
|
4928
|
-
//# sourceMappingURL=src-
|
|
4919
|
+
//# sourceMappingURL=src-Cam4kRTd.js.map
|