@atscript/vue-table 0.1.58
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 +24 -0
- package/dist/as-action-form-dialog.cjs +221 -0
- package/dist/as-action-form-dialog.d.cts +6 -0
- package/dist/as-action-form-dialog.d.mts +7 -0
- package/dist/as-action-form-dialog.mjs +221 -0
- package/dist/as-action-menu-content-CXsdPn42.mjs +104 -0
- package/dist/as-action-menu-content-CyUfBrWH.cjs +109 -0
- package/dist/as-cell-array-CXeZzZqt.cjs +69 -0
- package/dist/as-cell-array-DOQKR6t5.mjs +64 -0
- package/dist/as-cell-array.cjs +3 -0
- package/dist/as-cell-array.d.cts +2 -0
- package/dist/as-cell-array.d.mts +2 -0
- package/dist/as-cell-array.mjs +3 -0
- package/dist/as-cell-array.vue-DZGM2VHh.d.mts +12 -0
- package/dist/as-cell-array.vue-pFs5GcCR.d.cts +12 -0
- package/dist/as-cell-date-CTrvxS1h.cjs +78 -0
- package/dist/as-cell-date-Cq49RHmL.mjs +73 -0
- package/dist/as-cell-date.cjs +3 -0
- package/dist/as-cell-date.d.cts +2 -0
- package/dist/as-cell-date.d.mts +2 -0
- package/dist/as-cell-date.mjs +3 -0
- package/dist/as-cell-date.vue-BBSps2B2.d.cts +12 -0
- package/dist/as-cell-date.vue-Zlt4mHWb.d.mts +12 -0
- package/dist/as-cell-json-BynWIs1d.mjs +37 -0
- package/dist/as-cell-json-DvHvQ6IL.cjs +42 -0
- package/dist/as-cell-json-popover-BWdNs1YU.cjs +70 -0
- package/dist/as-cell-json-popover-DUq25I0L.mjs +65 -0
- package/dist/as-cell-json.cjs +3 -0
- package/dist/as-cell-json.d.cts +2 -0
- package/dist/as-cell-json.d.mts +2 -0
- package/dist/as-cell-json.mjs +3 -0
- package/dist/as-cell-json.vue-C6wg4ARZ.d.cts +12 -0
- package/dist/as-cell-json.vue-CESWuCer.d.mts +12 -0
- package/dist/as-cell-number-0_WrSCzu.cjs +76 -0
- package/dist/as-cell-number-Bc1C97Vg.mjs +71 -0
- package/dist/as-cell-number.cjs +3 -0
- package/dist/as-cell-number.d.cts +2 -0
- package/dist/as-cell-number.d.mts +2 -0
- package/dist/as-cell-number.mjs +3 -0
- package/dist/as-cell-number.vue-1Oq7nVI3.d.mts +12 -0
- package/dist/as-cell-number.vue-CJ2K5zeM.d.cts +12 -0
- package/dist/as-cell-union-C1w3B38J.mjs +88 -0
- package/dist/as-cell-union-CFAI0utz.cjs +93 -0
- package/dist/as-cell-union.cjs +4 -0
- package/dist/as-cell-union.d.cts +2 -0
- package/dist/as-cell-union.d.mts +2 -0
- package/dist/as-cell-union.mjs +4 -0
- package/dist/as-cell-union.vue-CslPM_c2.d.cts +12 -0
- package/dist/as-cell-union.vue-NnDmQZOA.d.mts +12 -0
- package/dist/as-column-menu-CH9Htz0Q.cjs +220 -0
- package/dist/as-column-menu-DCfhorMP.mjs +215 -0
- package/dist/as-column-menu.cjs +2 -0
- package/dist/as-column-menu.d.cts +2 -0
- package/dist/as-column-menu.d.mts +2 -0
- package/dist/as-column-menu.mjs +2 -0
- package/dist/as-column-menu.vue-C9e6wJ3z.d.mts +47 -0
- package/dist/as-column-menu.vue-o0qFdzoL.d.cts +47 -0
- package/dist/as-config-dialog-d2k7_l0U.cjs +699 -0
- package/dist/as-config-dialog-vRklaKbi.mjs +688 -0
- package/dist/as-config-dialog.cjs +3 -0
- package/dist/as-config-dialog.d.cts +2 -0
- package/dist/as-config-dialog.d.mts +2 -0
- package/dist/as-config-dialog.mjs +3 -0
- package/dist/as-config-dialog.vue-C6Q62xF5.d.mts +7 -0
- package/dist/as-config-dialog.vue-DvvJi3xx.d.cts +7 -0
- package/dist/as-confirm-dialog-BLh3Ju4-.mjs +52 -0
- package/dist/as-confirm-dialog-BgpIEE2z.cjs +57 -0
- package/dist/as-confirm-dialog.cjs +3 -0
- package/dist/as-confirm-dialog.d.cts +2 -0
- package/dist/as-confirm-dialog.d.mts +2 -0
- package/dist/as-confirm-dialog.mjs +3 -0
- package/dist/as-confirm-dialog.vue-CXxLpzbu.d.cts +7 -0
- package/dist/as-confirm-dialog.vue-pas8jGhv.d.mts +7 -0
- package/dist/as-filter-dialog-C0HMpUPT.mjs +610 -0
- package/dist/as-filter-dialog-DcGvIV3h.cjs +621 -0
- package/dist/as-filter-dialog.cjs +15 -0
- package/dist/as-filter-dialog.d.cts +2 -0
- package/dist/as-filter-dialog.d.mts +2 -0
- package/dist/as-filter-dialog.mjs +15 -0
- package/dist/as-filter-dialog.vue-BV2J8PgZ.d.cts +7 -0
- package/dist/as-filter-dialog.vue-RDZjp4gJ.d.mts +7 -0
- package/dist/as-filter-field-B_tYzvvl.cjs +984 -0
- package/dist/as-filter-field-Bqvu2ASN.mjs +943 -0
- package/dist/as-filter-field.cjs +9 -0
- package/dist/as-filter-field.d.cts +2 -0
- package/dist/as-filter-field.d.mts +2 -0
- package/dist/as-filter-field.mjs +9 -0
- package/dist/as-filter-field.vue-ByQ8xIGq.d.cts +11 -0
- package/dist/as-filter-field.vue-QY8wi5S5.d.mts +11 -0
- package/dist/as-filter-input--nr72iwX.cjs +106 -0
- package/dist/as-filter-input-P1i0CW2-.mjs +101 -0
- package/dist/as-filter-input.cjs +2 -0
- package/dist/as-filter-input.d.cts +2 -0
- package/dist/as-filter-input.d.mts +2 -0
- package/dist/as-filter-input.mjs +2 -0
- package/dist/as-filter-input.vue-CBQ71eNg.d.mts +18 -0
- package/dist/as-filter-input.vue-CS4nOk_Q.d.cts +18 -0
- package/dist/as-filters-Bxa9ZEMm.mjs +44 -0
- package/dist/as-filters-xRT2qv56.cjs +49 -0
- package/dist/as-filters.cjs +10 -0
- package/dist/as-filters.d.cts +2 -0
- package/dist/as-filters.d.mts +2 -0
- package/dist/as-filters.mjs +10 -0
- package/dist/as-filters.vue-BsMgYUcX.d.mts +10 -0
- package/dist/as-filters.vue-fv-tRL2H.d.cts +10 -0
- package/dist/as-preset-dialog-BaTfwMnh.cjs +569 -0
- package/dist/as-preset-dialog-BdDRgwf_.mjs +564 -0
- package/dist/as-preset-dialog.cjs +4 -0
- package/dist/as-preset-dialog.d.cts +2 -0
- package/dist/as-preset-dialog.d.mts +2 -0
- package/dist/as-preset-dialog.mjs +4 -0
- package/dist/as-preset-dialog.vue-Bzv-ON9W.d.mts +7 -0
- package/dist/as-preset-dialog.vue-DP9fy00Y.d.cts +7 -0
- package/dist/as-preset-picker-BQbNEiy9.mjs +427 -0
- package/dist/as-preset-picker-Ce3crTQy.cjs +432 -0
- package/dist/as-preset-picker.cjs +4 -0
- package/dist/as-preset-picker.d.cts +2 -0
- package/dist/as-preset-picker.d.mts +2 -0
- package/dist/as-preset-picker.mjs +4 -0
- package/dist/as-preset-picker.vue-CTBk6leV.d.mts +7 -0
- package/dist/as-preset-picker.vue-DfXS3pGl.d.cts +7 -0
- package/dist/as-row-actions-B6Kob6gt.cjs +120 -0
- package/dist/as-row-actions-CeWBBGqh.mjs +115 -0
- package/dist/as-row-actions.cjs +4 -0
- package/dist/as-row-actions.d.cts +2 -0
- package/dist/as-row-actions.d.mts +2 -0
- package/dist/as-row-actions.mjs +4 -0
- package/dist/as-row-actions.vue-BPaQfGev.d.mts +11 -0
- package/dist/as-row-actions.vue-Bvcc2tUN.d.cts +11 -0
- package/dist/as-table-Cnw2fOqZ.mjs +204 -0
- package/dist/as-table-DlDFxdXI.cjs +209 -0
- package/dist/as-table-actions-BK1Thy2G.cjs +142 -0
- package/dist/as-table-actions-BpMiNFni.mjs +137 -0
- package/dist/as-table-actions.cjs +4 -0
- package/dist/as-table-actions.d.cts +2 -0
- package/dist/as-table-actions.d.mts +2 -0
- package/dist/as-table-actions.mjs +4 -0
- package/dist/as-table-actions.vue-B7Q-JA3z.d.cts +47 -0
- package/dist/as-table-actions.vue-Bs1Jl1ep.d.mts +47 -0
- package/dist/as-table-base-D0k4k7k_.mjs +646 -0
- package/dist/as-table-base-VIz-B_6_.cjs +651 -0
- package/dist/as-table-cell-value-B1CiJYFn.mjs +26 -0
- package/dist/as-table-cell-value-CuxRtFn9.cjs +31 -0
- package/dist/as-table-cell-value.cjs +3 -0
- package/dist/as-table-cell-value.d.cts +2 -0
- package/dist/as-table-cell-value.d.mts +2 -0
- package/dist/as-table-cell-value.mjs +3 -0
- package/dist/as-table-cell-value.vue-BgFDv2JQ.d.cts +12 -0
- package/dist/as-table-cell-value.vue-BuPCQ8YA.d.mts +12 -0
- package/dist/as-table-header-cell-C3zeZUZo.cjs +117 -0
- package/dist/as-table-header-cell-CBn_ioCe.mjs +112 -0
- package/dist/as-table-header-cell.cjs +3 -0
- package/dist/as-table-header-cell.d.cts +2 -0
- package/dist/as-table-header-cell.d.mts +2 -0
- package/dist/as-table-header-cell.mjs +3 -0
- package/dist/as-table-header-cell.vue-Bc_DSsGY.d.cts +31 -0
- package/dist/as-table-header-cell.vue-DNMOHfek.d.mts +31 -0
- package/dist/as-table-root-Br6WcGRo.cjs +263 -0
- package/dist/as-table-root-gG7pTIdD.mjs +258 -0
- package/dist/as-table-root.cjs +28 -0
- package/dist/as-table-root.d.cts +2 -0
- package/dist/as-table-root.d.mts +2 -0
- package/dist/as-table-root.mjs +28 -0
- package/dist/as-table-root.vue-5_OhVwse.d.mts +2258 -0
- package/dist/as-table-root.vue-CSqEtIll.d.cts +2258 -0
- package/dist/as-table-status-BjRGGuhC.mjs +683 -0
- package/dist/as-table-status-DWYoJIMC.cjs +724 -0
- package/dist/as-table.cjs +10 -0
- package/dist/as-table.d.cts +2 -0
- package/dist/as-table.d.mts +2 -0
- package/dist/as-table.mjs +10 -0
- package/dist/as-table.vue-BTYg-e3Z.d.mts +81 -0
- package/dist/as-table.vue-wdRARLIe.d.cts +81 -0
- package/dist/as-window-table-CKIfo3M_.mjs +709 -0
- package/dist/as-window-table-DE7_NyEP.cjs +714 -0
- package/dist/as-window-table.cjs +9 -0
- package/dist/as-window-table.d.cts +2 -0
- package/dist/as-window-table.d.mts +2 -0
- package/dist/as-window-table.mjs +9 -0
- package/dist/as-window-table.vue-Bf8xGC9M.d.mts +86 -0
- package/dist/as-window-table.vue-CA8qsrz4.d.cts +86 -0
- package/dist/format-cell-B2xMDYO9.mjs +27 -0
- package/dist/format-cell-D4mqaN0E.cjs +32 -0
- package/dist/get-cell-value-CZSVfDLg.cjs +19 -0
- package/dist/get-cell-value-DiH84HKL.mjs +14 -0
- package/dist/index.cjs +598 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.mjs +505 -0
- package/dist/preset-aspect-display-BYeiSgcc.mjs +43 -0
- package/dist/preset-aspect-display-y8aal_EF.cjs +72 -0
- package/dist/types-BvvXN72P.d.mts +531 -0
- package/dist/types-CNMmF6W2.d.cts +531 -0
- package/dist/use-cell-locale-1uQaFTLQ.mjs +23 -0
- package/dist/use-cell-locale-B480_QYK.cjs +34 -0
- package/dist/use-table-column-handlers-CGYAY2xH.cjs +65 -0
- package/dist/use-table-column-handlers-t6xi1yCE.mjs +54 -0
- package/dist/use-table-state-C4JbonEZ.mjs +1822 -0
- package/dist/use-table-state-MU-vuzui.cjs +1917 -0
- package/package.json +195 -0
- package/styles.d.ts +2 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
require("./use-table-state-MU-vuzui.cjs");
|
|
2
|
+
require("./as-table-status-DWYoJIMC.cjs");
|
|
3
|
+
const require_as_filter_field = require("./as-filter-field-B_tYzvvl.cjs");
|
|
4
|
+
require("./format-cell-D4mqaN0E.cjs");
|
|
5
|
+
require("./as-column-menu-CH9Htz0Q.cjs");
|
|
6
|
+
require("./as-table-cell-value-CuxRtFn9.cjs");
|
|
7
|
+
require("./as-table-header-cell-C3zeZUZo.cjs");
|
|
8
|
+
require("./as-table-base-VIz-B_6_.cjs");
|
|
9
|
+
module.exports = require_as_filter_field.as_filter_field_default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./use-table-state-C4JbonEZ.mjs";
|
|
2
|
+
import "./as-table-status-BjRGGuhC.mjs";
|
|
3
|
+
import { t as as_filter_field_default } from "./as-filter-field-Bqvu2ASN.mjs";
|
|
4
|
+
import "./format-cell-B2xMDYO9.mjs";
|
|
5
|
+
import "./as-column-menu-DCfhorMP.mjs";
|
|
6
|
+
import "./as-table-cell-value-B1CiJYFn.mjs";
|
|
7
|
+
import "./as-table-header-cell-CBn_ioCe.mjs";
|
|
8
|
+
import "./as-table-base-D0k4k7k_.mjs";
|
|
9
|
+
export { as_filter_field_default as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { ColumnDef } from "@atscript/ui";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-filter-field.vue.d.ts
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
column: ColumnDef;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { _default as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ColumnDef } from "@atscript/ui";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
|
|
4
|
+
//#region src/components/defaults/as-filter-field.vue.d.ts
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
column: ColumnDef;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { _default as t };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let _atscript_ui_table = require("@atscript/ui-table");
|
|
3
|
+
//#region src/components/defaults/as-filter-input.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "as-filter-input-disabled",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_2 = ["value"];
|
|
10
|
+
const _hoisted_3 = { class: "as-filter-input-range" };
|
|
11
|
+
const _hoisted_4 = ["type", "value"];
|
|
12
|
+
const _hoisted_5 = ["type", "value"];
|
|
13
|
+
const _hoisted_6 = [
|
|
14
|
+
"type",
|
|
15
|
+
"value",
|
|
16
|
+
"placeholder"
|
|
17
|
+
];
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/defaults/as-filter-input.vue
|
|
20
|
+
var as_filter_input_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
21
|
+
__name: "as-filter-input",
|
|
22
|
+
props: {
|
|
23
|
+
column: {
|
|
24
|
+
type: Object,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
condition: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
filterType: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
emits: ["update:condition"],
|
|
37
|
+
setup(__props, { emit: __emit }) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const emit = __emit;
|
|
40
|
+
const needsInput = (0, vue.computed)(() => !_atscript_ui_table.NULL_OPS.has(props.condition.type));
|
|
41
|
+
const isBetween = (0, vue.computed)(() => (0, _atscript_ui_table.hasSecondValue)(props.condition.type));
|
|
42
|
+
function updateValue(index, raw) {
|
|
43
|
+
const value = [...props.condition.value];
|
|
44
|
+
value[index] = props.filterType === "number" ? Number(raw) : raw;
|
|
45
|
+
emit("update:condition", {
|
|
46
|
+
...props.condition,
|
|
47
|
+
value
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function onBoolSelect(val) {
|
|
51
|
+
const boolVal = val === "true";
|
|
52
|
+
emit("update:condition", {
|
|
53
|
+
...props.condition,
|
|
54
|
+
value: [boolVal]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const inputType = (0, vue.computed)(() => {
|
|
58
|
+
if (props.filterType === "number") return "number";
|
|
59
|
+
if (props.filterType === "date") return "date";
|
|
60
|
+
return "text";
|
|
61
|
+
});
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createCommentVNode)(" Null/notNull: render a plain layer-1 box the size of a filter input, no text. "), !needsInput.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1)) : __props.filterType === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createCommentVNode)(" Boolean select "), (0, vue.createElementVNode)("select", {
|
|
64
|
+
class: "as-filter-input as-filter-select",
|
|
65
|
+
value: String(__props.condition.value[0] ?? ""),
|
|
66
|
+
onChange: _cache[0] || (_cache[0] = ($event) => onBoolSelect($event.target.value))
|
|
67
|
+
}, [..._cache[4] || (_cache[4] = [
|
|
68
|
+
(0, vue.createElementVNode)("option", {
|
|
69
|
+
value: "",
|
|
70
|
+
disabled: ""
|
|
71
|
+
}, "Select...", -1),
|
|
72
|
+
(0, vue.createElementVNode)("option", { value: "true" }, "true", -1),
|
|
73
|
+
(0, vue.createElementVNode)("option", { value: "false" }, "false", -1)
|
|
74
|
+
])], 40, _hoisted_2)], 2112)) : isBetween.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.createCommentVNode)(" Between: two inputs "), (0, vue.createElementVNode)("div", _hoisted_3, [
|
|
75
|
+
(0, vue.createElementVNode)("input", {
|
|
76
|
+
class: "as-filter-input",
|
|
77
|
+
type: inputType.value,
|
|
78
|
+
value: __props.condition.value[0] ?? "",
|
|
79
|
+
placeholder: "From",
|
|
80
|
+
onInput: _cache[1] || (_cache[1] = ($event) => updateValue(0, $event.target.value))
|
|
81
|
+
}, null, 40, _hoisted_4),
|
|
82
|
+
_cache[5] || (_cache[5] = (0, vue.createElementVNode)("span", { class: "as-filter-input-range-sep" }, "–", -1)),
|
|
83
|
+
(0, vue.createElementVNode)("input", {
|
|
84
|
+
class: "as-filter-input",
|
|
85
|
+
type: inputType.value,
|
|
86
|
+
value: __props.condition.value[1] ?? "",
|
|
87
|
+
placeholder: "To",
|
|
88
|
+
onInput: _cache[2] || (_cache[2] = ($event) => updateValue(1, $event.target.value))
|
|
89
|
+
}, null, 40, _hoisted_5)
|
|
90
|
+
])], 2112)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [(0, vue.createCommentVNode)(" Default: single input "), (0, vue.createElementVNode)("input", {
|
|
91
|
+
class: "as-filter-input",
|
|
92
|
+
type: inputType.value,
|
|
93
|
+
value: __props.condition.value[0] ?? "",
|
|
94
|
+
placeholder: __props.filterType === "date" ? "" : "Value...",
|
|
95
|
+
onInput: _cache[3] || (_cache[3] = ($event) => updateValue(0, $event.target.value))
|
|
96
|
+
}, null, 40, _hoisted_6)], 2112))], 2112);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
//#endregion
|
|
101
|
+
Object.defineProperty(exports, "as_filter_input_default", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return as_filter_input_default;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Fragment, computed, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock } from "vue";
|
|
2
|
+
import { NULL_OPS, hasSecondValue } from "@atscript/ui-table";
|
|
3
|
+
//#region src/components/defaults/as-filter-input.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "as-filter-input-disabled",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_2 = ["value"];
|
|
10
|
+
const _hoisted_3 = { class: "as-filter-input-range" };
|
|
11
|
+
const _hoisted_4 = ["type", "value"];
|
|
12
|
+
const _hoisted_5 = ["type", "value"];
|
|
13
|
+
const _hoisted_6 = [
|
|
14
|
+
"type",
|
|
15
|
+
"value",
|
|
16
|
+
"placeholder"
|
|
17
|
+
];
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/components/defaults/as-filter-input.vue
|
|
20
|
+
var as_filter_input_default = /* @__PURE__ */ defineComponent({
|
|
21
|
+
__name: "as-filter-input",
|
|
22
|
+
props: {
|
|
23
|
+
column: {
|
|
24
|
+
type: Object,
|
|
25
|
+
required: true
|
|
26
|
+
},
|
|
27
|
+
condition: {
|
|
28
|
+
type: Object,
|
|
29
|
+
required: true
|
|
30
|
+
},
|
|
31
|
+
filterType: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
emits: ["update:condition"],
|
|
37
|
+
setup(__props, { emit: __emit }) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const emit = __emit;
|
|
40
|
+
const needsInput = computed(() => !NULL_OPS.has(props.condition.type));
|
|
41
|
+
const isBetween = computed(() => hasSecondValue(props.condition.type));
|
|
42
|
+
function updateValue(index, raw) {
|
|
43
|
+
const value = [...props.condition.value];
|
|
44
|
+
value[index] = props.filterType === "number" ? Number(raw) : raw;
|
|
45
|
+
emit("update:condition", {
|
|
46
|
+
...props.condition,
|
|
47
|
+
value
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function onBoolSelect(val) {
|
|
51
|
+
const boolVal = val === "true";
|
|
52
|
+
emit("update:condition", {
|
|
53
|
+
...props.condition,
|
|
54
|
+
value: [boolVal]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const inputType = computed(() => {
|
|
58
|
+
if (props.filterType === "number") return "number";
|
|
59
|
+
if (props.filterType === "date") return "date";
|
|
60
|
+
return "text";
|
|
61
|
+
});
|
|
62
|
+
return (_ctx, _cache) => {
|
|
63
|
+
return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" Null/notNull: render a plain layer-1 box the size of a filter input, no text. "), !needsInput.value ? (openBlock(), createElementBlock("div", _hoisted_1)) : __props.filterType === "boolean" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createCommentVNode(" Boolean select "), createElementVNode("select", {
|
|
64
|
+
class: "as-filter-input as-filter-select",
|
|
65
|
+
value: String(__props.condition.value[0] ?? ""),
|
|
66
|
+
onChange: _cache[0] || (_cache[0] = ($event) => onBoolSelect($event.target.value))
|
|
67
|
+
}, [..._cache[4] || (_cache[4] = [
|
|
68
|
+
createElementVNode("option", {
|
|
69
|
+
value: "",
|
|
70
|
+
disabled: ""
|
|
71
|
+
}, "Select...", -1),
|
|
72
|
+
createElementVNode("option", { value: "true" }, "true", -1),
|
|
73
|
+
createElementVNode("option", { value: "false" }, "false", -1)
|
|
74
|
+
])], 40, _hoisted_2)], 2112)) : isBetween.value ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [createCommentVNode(" Between: two inputs "), createElementVNode("div", _hoisted_3, [
|
|
75
|
+
createElementVNode("input", {
|
|
76
|
+
class: "as-filter-input",
|
|
77
|
+
type: inputType.value,
|
|
78
|
+
value: __props.condition.value[0] ?? "",
|
|
79
|
+
placeholder: "From",
|
|
80
|
+
onInput: _cache[1] || (_cache[1] = ($event) => updateValue(0, $event.target.value))
|
|
81
|
+
}, null, 40, _hoisted_4),
|
|
82
|
+
_cache[5] || (_cache[5] = createElementVNode("span", { class: "as-filter-input-range-sep" }, "–", -1)),
|
|
83
|
+
createElementVNode("input", {
|
|
84
|
+
class: "as-filter-input",
|
|
85
|
+
type: inputType.value,
|
|
86
|
+
value: __props.condition.value[1] ?? "",
|
|
87
|
+
placeholder: "To",
|
|
88
|
+
onInput: _cache[2] || (_cache[2] = ($event) => updateValue(1, $event.target.value))
|
|
89
|
+
}, null, 40, _hoisted_5)
|
|
90
|
+
])], 2112)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createCommentVNode(" Default: single input "), createElementVNode("input", {
|
|
91
|
+
class: "as-filter-input",
|
|
92
|
+
type: inputType.value,
|
|
93
|
+
value: __props.condition.value[0] ?? "",
|
|
94
|
+
placeholder: __props.filterType === "date" ? "" : "Value...",
|
|
95
|
+
onInput: _cache[3] || (_cache[3] = ($event) => updateValue(0, $event.target.value))
|
|
96
|
+
}, null, 40, _hoisted_6)], 2112))], 2112);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
//#endregion
|
|
101
|
+
export { as_filter_input_default as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ColumnDef } from "@atscript/ui";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
import { ColumnFilterType, FilterCondition } from "@atscript/ui-table";
|
|
4
|
+
|
|
5
|
+
//#region src/components/defaults/as-filter-input.vue.d.ts
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
column: ColumnDef;
|
|
8
|
+
condition: FilterCondition;
|
|
9
|
+
filterType: ColumnFilterType;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:condition": (condition: FilterCondition) => any;
|
|
13
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:condition"?: ((condition: FilterCondition) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { _default as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { ColumnDef } from "@atscript/ui";
|
|
3
|
+
import { ColumnFilterType, FilterCondition } from "@atscript/ui-table";
|
|
4
|
+
|
|
5
|
+
//#region src/components/defaults/as-filter-input.vue.d.ts
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
column: ColumnDef;
|
|
8
|
+
condition: FilterCondition;
|
|
9
|
+
filterType: ColumnFilterType;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:condition": (condition: FilterCondition) => any;
|
|
13
|
+
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:condition"?: ((condition: FilterCondition) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { _default as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { a as useTableContext } from "./use-table-state-C4JbonEZ.mjs";
|
|
2
|
+
import { t as as_filter_field_default } from "./as-filter-field-Bqvu2ASN.mjs";
|
|
3
|
+
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList } from "vue";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/components/as-filters.vue
|
|
6
|
+
var as_filters_default = /* @__PURE__ */ defineComponent({
|
|
7
|
+
__name: "as-filters",
|
|
8
|
+
props: { filterFields: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: false
|
|
11
|
+
} },
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const { state } = useTableContext();
|
|
15
|
+
const columnMap = computed(() => {
|
|
16
|
+
const tableDef = state.tableDef.value;
|
|
17
|
+
if (!tableDef) return /* @__PURE__ */ new Map();
|
|
18
|
+
const map = /* @__PURE__ */ new Map();
|
|
19
|
+
for (const col of tableDef.columns) map.set(col.path, col);
|
|
20
|
+
return map;
|
|
21
|
+
});
|
|
22
|
+
const activeColumns = computed(() => {
|
|
23
|
+
const fields = props.filterFields ?? state.filterFields.value;
|
|
24
|
+
const map = columnMap.value;
|
|
25
|
+
if (map.size === 0) return [];
|
|
26
|
+
const result = [];
|
|
27
|
+
for (const path of fields) {
|
|
28
|
+
const col = map.get(path);
|
|
29
|
+
if (col) result.push(col);
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(activeColumns.value, (col) => {
|
|
35
|
+
return openBlock(), createBlock(as_filter_field_default, mergeProps({
|
|
36
|
+
key: col.path,
|
|
37
|
+
column: col
|
|
38
|
+
}, { ref_for: true }, _ctx.$attrs), null, 16, ["column"]);
|
|
39
|
+
}), 128);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { as_filters_default as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const require_use_table_state = require("./use-table-state-MU-vuzui.cjs");
|
|
2
|
+
const require_as_filter_field = require("./as-filter-field-B_tYzvvl.cjs");
|
|
3
|
+
let vue = require("vue");
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/components/as-filters.vue
|
|
6
|
+
var as_filters_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
7
|
+
__name: "as-filters",
|
|
8
|
+
props: { filterFields: {
|
|
9
|
+
type: Array,
|
|
10
|
+
required: false
|
|
11
|
+
} },
|
|
12
|
+
setup(__props) {
|
|
13
|
+
const props = __props;
|
|
14
|
+
const { state } = require_use_table_state.useTableContext();
|
|
15
|
+
const columnMap = (0, vue.computed)(() => {
|
|
16
|
+
const tableDef = state.tableDef.value;
|
|
17
|
+
if (!tableDef) return /* @__PURE__ */ new Map();
|
|
18
|
+
const map = /* @__PURE__ */ new Map();
|
|
19
|
+
for (const col of tableDef.columns) map.set(col.path, col);
|
|
20
|
+
return map;
|
|
21
|
+
});
|
|
22
|
+
const activeColumns = (0, vue.computed)(() => {
|
|
23
|
+
const fields = props.filterFields ?? state.filterFields.value;
|
|
24
|
+
const map = columnMap.value;
|
|
25
|
+
if (map.size === 0) return [];
|
|
26
|
+
const result = [];
|
|
27
|
+
for (const path of fields) {
|
|
28
|
+
const col = map.get(path);
|
|
29
|
+
if (col) result.push(col);
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return (0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(activeColumns.value, (col) => {
|
|
35
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(require_as_filter_field.as_filter_field_default, (0, vue.mergeProps)({
|
|
36
|
+
key: col.path,
|
|
37
|
+
column: col
|
|
38
|
+
}, { ref_for: true }, _ctx.$attrs), null, 16, ["column"]);
|
|
39
|
+
}), 128);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
Object.defineProperty(exports, "as_filters_default", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function() {
|
|
47
|
+
return as_filters_default;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
require("./use-table-state-MU-vuzui.cjs");
|
|
2
|
+
require("./as-table-status-DWYoJIMC.cjs");
|
|
3
|
+
require("./as-filter-field-B_tYzvvl.cjs");
|
|
4
|
+
require("./format-cell-D4mqaN0E.cjs");
|
|
5
|
+
require("./as-column-menu-CH9Htz0Q.cjs");
|
|
6
|
+
require("./as-table-cell-value-CuxRtFn9.cjs");
|
|
7
|
+
require("./as-table-header-cell-C3zeZUZo.cjs");
|
|
8
|
+
require("./as-table-base-VIz-B_6_.cjs");
|
|
9
|
+
const require_as_filters = require("./as-filters-xRT2qv56.cjs");
|
|
10
|
+
module.exports = require_as_filters.as_filters_default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "./use-table-state-C4JbonEZ.mjs";
|
|
2
|
+
import "./as-table-status-BjRGGuhC.mjs";
|
|
3
|
+
import "./as-filter-field-Bqvu2ASN.mjs";
|
|
4
|
+
import "./format-cell-B2xMDYO9.mjs";
|
|
5
|
+
import "./as-column-menu-DCfhorMP.mjs";
|
|
6
|
+
import "./as-table-cell-value-B1CiJYFn.mjs";
|
|
7
|
+
import "./as-table-header-cell-CBn_ioCe.mjs";
|
|
8
|
+
import "./as-table-base-D0k4k7k_.mjs";
|
|
9
|
+
import { t as as_filters_default } from "./as-filters-Bxa9ZEMm.mjs";
|
|
10
|
+
export { as_filters_default as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/components/as-filters.vue.d.ts
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
filterFields?: string[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { _default as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
|
|
3
|
+
//#region src/components/as-filters.vue.d.ts
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
filterFields?: string[];
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { _default as t };
|