@adapttable/element-plus 0.4.1 → 0.6.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/README.md +10 -7
- package/dist/{ElementFilterSurface-CiOApO3l.js → ElementFilterField-C8EJjVB_.js} +169 -149
- package/dist/ElementFilterField-C8EJjVB_.js.map +1 -0
- package/dist/{ElementFilterSurface-CUgNfyWW.cjs → ElementFilterField-Dfzy-Yk4.cjs} +175 -143
- package/dist/ElementFilterField-Dfzy-Yk4.cjs.map +1 -0
- package/dist/{ElementRowActions-CUlFbY6s.js → ElementRowActions-CUdXemC-.js} +2 -2
- package/dist/ElementRowActions-CUdXemC-.js.map +1 -0
- package/dist/{ElementRowActions-ClYC3Ssq.cjs → ElementRowActions-XyX2PAWL.cjs} +2 -2
- package/dist/ElementRowActions-XyX2PAWL.cjs.map +1 -0
- package/dist/assistant.cjs +309 -5
- package/dist/assistant.cjs.map +1 -0
- package/dist/assistant.js +305 -1
- package/dist/assistant.js.map +1 -0
- package/dist/batch-editing.cjs +1 -1
- package/dist/batch-editing.d.cts +1 -1
- package/dist/batch-editing.d.ts +1 -1
- package/dist/batch-editing.js +1 -1
- package/dist/cell-navigation-DJ-_1Mjr.cjs.map +1 -1
- package/dist/cell-navigation-arDY86xD.js.map +1 -1
- package/dist/cell-navigation.d.cts +1 -1
- package/dist/cell-navigation.d.cts.map +1 -1
- package/dist/cell-navigation.d.ts +1 -1
- package/dist/cell-navigation.d.ts.map +1 -1
- package/dist/column-layout.cjs +24 -0
- package/dist/column-layout.cjs.map +1 -0
- package/dist/column-layout.d.cts +12 -0
- package/dist/column-layout.d.cts.map +1 -0
- package/dist/column-layout.d.ts +12 -0
- package/dist/column-layout.d.ts.map +1 -0
- package/dist/column-layout.js +22 -0
- package/dist/column-layout.js.map +1 -0
- package/dist/{column-menu-jNw7kuxp.cjs → column-menu-CqyYtohz.cjs} +3 -3
- package/dist/{column-menu-jNw7kuxp.cjs.map → column-menu-CqyYtohz.cjs.map} +1 -1
- package/dist/{column-menu-BUxMPyJI.js → column-menu-CwTWnahc.js} +3 -3
- package/dist/{column-menu-BUxMPyJI.js.map → column-menu-CwTWnahc.js.map} +1 -1
- package/dist/column-menu.cjs +1 -1
- package/dist/column-menu.d.cts +34 -2
- package/dist/column-menu.d.cts.map +1 -0
- package/dist/column-menu.d.ts +34 -2
- package/dist/column-menu.d.ts.map +1 -0
- package/dist/column-menu.js +1 -1
- package/dist/{editing-DHjzbw-I.js → editing-BlpYR839.js} +19 -5
- package/dist/{editing-DHjzbw-I.js.map → editing-BlpYR839.js.map} +1 -1
- package/dist/{editing-Bhw_4VG8.cjs → editing-CSqZENeW.cjs} +23 -3
- package/dist/editing-CSqZENeW.cjs.map +1 -0
- package/dist/{editing-BnLdNDlo.d.ts → editing-CU4pOLjr.d.ts} +10 -2
- package/dist/{editing-BnLdNDlo.d.ts.map → editing-CU4pOLjr.d.ts.map} +1 -1
- package/dist/{editing-Cg6ZNvSa.d.cts → editing-DJrjZjpu.d.cts} +10 -2
- package/dist/{editing-Cg6ZNvSa.d.cts.map → editing-DJrjZjpu.d.cts.map} +1 -1
- package/dist/editing.cjs +4 -13
- package/dist/editing.d.cts +2 -2
- package/dist/editing.d.ts +2 -2
- package/dist/editing.js +2 -2
- package/dist/export-kuOvIoQg.js +10 -0
- package/dist/export-kuOvIoQg.js.map +1 -0
- package/dist/{export-csv.cjs → export-x-Ow8SY5.cjs} +7 -3
- package/dist/export-x-Ow8SY5.cjs.map +1 -0
- package/dist/export.cjs +2 -2
- package/dist/export.d.cts +9 -2
- package/dist/export.d.cts.map +1 -0
- package/dist/export.d.ts +9 -2
- package/dist/export.d.ts.map +1 -0
- package/dist/export.js +1 -1
- package/dist/filtering.cjs +22 -0
- package/dist/filtering.cjs.map +1 -0
- package/dist/filtering.d.cts +13 -0
- package/dist/filtering.d.cts.map +1 -0
- package/dist/filtering.d.ts +13 -0
- package/dist/filtering.d.ts.map +1 -0
- package/dist/filtering.js +21 -0
- package/dist/filtering.js.map +1 -0
- package/dist/{filters-87q6jAVU.js → filters-CIQ1uMZw.js} +64 -8
- package/dist/filters-CIQ1uMZw.js.map +1 -0
- package/dist/{filters-bdHAQnex.cjs → filters-CYQFsZ_f.cjs} +106 -8
- package/dist/filters-CYQFsZ_f.cjs.map +1 -0
- package/dist/filters.cjs +11 -4
- package/dist/filters.d.cts +77 -2
- package/dist/filters.d.cts.map +1 -0
- package/dist/filters.d.ts +77 -2
- package/dist/filters.d.ts.map +1 -0
- package/dist/filters.js +3 -3
- package/dist/grouping-panel.cjs +145 -3
- package/dist/grouping-panel.cjs.map +1 -0
- package/dist/grouping-panel.js +145 -2
- package/dist/grouping-panel.js.map +1 -0
- package/dist/{header-filters-DUZI1x70.js → header-filters-B2veND8x.js} +2 -2
- package/dist/{header-filters-DUZI1x70.js.map → header-filters-B2veND8x.js.map} +1 -1
- package/dist/{header-filters-Cu7t_2IW.cjs → header-filters-COkO6tD4.cjs} +4 -4
- package/dist/{header-filters-Cu7t_2IW.cjs.map → header-filters-COkO6tD4.cjs.map} +1 -1
- package/dist/header-filters.cjs +1 -1
- package/dist/header-filters.d.cts +23 -2
- package/dist/header-filters.d.cts.map +1 -0
- package/dist/header-filters.d.ts +23 -2
- package/dist/header-filters.d.ts.map +1 -0
- package/dist/header-filters.js +1 -1
- package/dist/index.cjs +2 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -26
- package/dist/index.js.map +1 -1
- package/dist/preset.cjs +8 -9
- package/dist/preset.cjs.map +1 -1
- package/dist/preset.js +7 -8
- package/dist/preset.js.map +1 -1
- package/dist/row-actions.cjs +1 -1
- package/dist/row-actions.d.cts +7 -2
- package/dist/row-actions.d.cts.map +1 -0
- package/dist/row-actions.d.ts +7 -2
- package/dist/row-actions.d.ts.map +1 -0
- package/dist/row-actions.js +1 -1
- package/dist/row-pinning.cjs +1 -1
- package/dist/row-pinning.d.cts +8 -2
- package/dist/row-pinning.d.cts.map +1 -0
- package/dist/row-pinning.d.ts +8 -2
- package/dist/row-pinning.d.ts.map +1 -0
- package/dist/row-pinning.js +1 -1
- package/dist/row-reorder.cjs +155 -2
- package/dist/row-reorder.cjs.map +1 -0
- package/dist/row-reorder.d.cts +2 -1
- package/dist/row-reorder.d.cts.map +1 -1
- package/dist/row-reorder.d.ts +2 -1
- package/dist/row-reorder.d.ts.map +1 -1
- package/dist/row-reorder.js +156 -1
- package/dist/row-reorder.js.map +1 -0
- package/dist/rows.d.cts +2 -2
- package/dist/rows.d.ts +2 -2
- package/dist/selection.cjs +8 -0
- package/dist/selection.d.cts +2 -0
- package/dist/selection.d.ts +2 -0
- package/dist/selection.js +2 -0
- package/dist/styles.css +57 -57
- package/package.json +33 -23
- package/dist/ElementFilterSurface-CUgNfyWW.cjs.map +0 -1
- package/dist/ElementFilterSurface-CiOApO3l.js.map +0 -1
- package/dist/ElementRowActions-CUlFbY6s.js.map +0 -1
- package/dist/ElementRowActions-ClYC3Ssq.cjs.map +0 -1
- package/dist/assistant-D4l4OdXN.cjs +0 -329
- package/dist/assistant-D4l4OdXN.cjs.map +0 -1
- package/dist/assistant-DRDxJajO.js +0 -306
- package/dist/assistant-DRDxJajO.js.map +0 -1
- package/dist/column-menu-CAkx6AjR.d.ts +0 -33
- package/dist/column-menu-CAkx6AjR.d.ts.map +0 -1
- package/dist/column-menu-DsL_xeEM.d.cts +0 -33
- package/dist/column-menu-DsL_xeEM.d.cts.map +0 -1
- package/dist/editing-Bhw_4VG8.cjs.map +0 -1
- package/dist/export-csv-DRDjZuQj.d.cts +0 -9
- package/dist/export-csv-DRDjZuQj.d.cts.map +0 -1
- package/dist/export-csv-VyICO_s0.d.ts +0 -9
- package/dist/export-csv-VyICO_s0.d.ts.map +0 -1
- package/dist/export-csv.cjs.map +0 -1
- package/dist/export-csv.d.cts +0 -2
- package/dist/export-csv.d.ts +0 -2
- package/dist/export-csv.js +0 -10
- package/dist/export-csv.js.map +0 -1
- package/dist/features.cjs +0 -213
- package/dist/features.d.cts +0 -36
- package/dist/features.d.ts +0 -36
- package/dist/features.js +0 -32
- package/dist/filters-87q6jAVU.js.map +0 -1
- package/dist/filters-BySwxJJ0.d.cts +0 -52
- package/dist/filters-BySwxJJ0.d.cts.map +0 -1
- package/dist/filters-bdHAQnex.cjs.map +0 -1
- package/dist/filters-iRpu_mXa.d.ts +0 -52
- package/dist/filters-iRpu_mXa.d.ts.map +0 -1
- package/dist/grouping-panel-B7j8sSpT.js +0 -146
- package/dist/grouping-panel-B7j8sSpT.js.map +0 -1
- package/dist/grouping-panel-B_ibl915.cjs +0 -150
- package/dist/grouping-panel-B_ibl915.cjs.map +0 -1
- package/dist/header-filters-B2B5RqQS.d.ts +0 -24
- package/dist/header-filters-B2B5RqQS.d.ts.map +0 -1
- package/dist/header-filters-hGm_7LFO.d.cts +0 -24
- package/dist/header-filters-hGm_7LFO.d.cts.map +0 -1
- package/dist/row-actions-VRa4T6oF.d.cts +0 -7
- package/dist/row-actions-VRa4T6oF.d.cts.map +0 -1
- package/dist/row-actions-VRa4T6oF.d.ts +0 -7
- package/dist/row-actions-VRa4T6oF.d.ts.map +0 -1
- package/dist/row-pinning-B0WfYDZD.d.ts +0 -8
- package/dist/row-pinning-B0WfYDZD.d.ts.map +0 -1
- package/dist/row-pinning-LzBZmZcZ.d.cts +0 -8
- package/dist/row-pinning-LzBZmZcZ.d.cts.map +0 -1
- package/dist/row-reorder-BYwX3CBP.js +0 -157
- package/dist/row-reorder-BYwX3CBP.js.map +0 -1
- package/dist/row-reorder-MSR2yDN6.cjs +0 -161
- package/dist/row-reorder-MSR2yDN6.cjs.map +0 -1
|
@@ -2,9 +2,9 @@ import { n as useClassNames } from "./classNamesContext-18Wbxy4F.js";
|
|
|
2
2
|
import { t as elementButton } from "./button-DwB4UxI2.js";
|
|
3
3
|
import { t as _sfc_main } from "./ElementInput-Cn9hpa9j.js";
|
|
4
4
|
import { t as _sfc_main$1 } from "./ElementSelect-BxFmnPpv.js";
|
|
5
|
-
import {
|
|
5
|
+
import { a as ElementFilterSurface, i as _sfc_main$2, n as _sfc_main$3 } from "./ElementFilterField-C8EJjVB_.js";
|
|
6
6
|
import { createVNode, defineComponent, h } from "vue";
|
|
7
|
-
import { ACTIVE_FILTER_CHIPS, FilterChipsChrome, FilterPanelChrome, FilterTreeChrome,
|
|
7
|
+
import { ACTIVE_FILTER_CHIPS, FILTERS_PANEL, FilterChipsChrome, FilterPanelChrome, FilterTreeChrome, booleanFieldPart, extendFeature, filterViewKey, filterWidgetComponent, multiSelectFieldPart, rangeFieldPart, selectFieldPart, slotRender, textFieldPart, useFeatureState, useFilterTreeModel, withProps } from "@adapttable/vue/adapter";
|
|
8
8
|
import { ElCollapse, ElCollapseItem, ElFormItem, ElIcon, ElTag, ElText } from "element-plus";
|
|
9
9
|
import { filterTypes, filters } from "@adapttable/vue/features";
|
|
10
10
|
//#region src/filters/ElementFilterChips.ts
|
|
@@ -119,7 +119,8 @@ const ElementFilterTree = /* @__PURE__ */ withProps(function ElementFilterTree(p
|
|
|
119
119
|
}, treeProps);
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/filters/ElementFiltersPanel.ts
|
|
122
|
-
function useElementFiltersPanel() {
|
|
122
|
+
function useElementFiltersPanel(props) {
|
|
123
|
+
const widgets = props.widgets;
|
|
123
124
|
const names = useClassNames();
|
|
124
125
|
const model = useFeatureState(filterViewKey());
|
|
125
126
|
const controls = {
|
|
@@ -160,7 +161,7 @@ function useElementFiltersPanel() {
|
|
|
160
161
|
disabled: control.disabled,
|
|
161
162
|
onClick: control.onClick
|
|
162
163
|
}, control.label),
|
|
163
|
-
Field: (field) => h(
|
|
164
|
+
Field: (field) => h(filterWidgetComponent(field.def, field.registry, widgets), {
|
|
164
165
|
...field,
|
|
165
166
|
classNames: names.value
|
|
166
167
|
}),
|
|
@@ -186,14 +187,69 @@ function useElementFiltersPanel() {
|
|
|
186
187
|
}
|
|
187
188
|
const ElementFiltersPanel = defineComponent({
|
|
188
189
|
name: "ElementFiltersPanel",
|
|
190
|
+
props: {
|
|
191
|
+
/** The widgets the panel draws its fields with. */
|
|
192
|
+
widgets: {
|
|
193
|
+
type: Array,
|
|
194
|
+
required: true
|
|
195
|
+
} },
|
|
189
196
|
setup: useElementFiltersPanel
|
|
190
197
|
});
|
|
191
198
|
//#endregion
|
|
199
|
+
//#region src/filters/widgets.ts
|
|
200
|
+
/** A field drawn by one shared field part. */
|
|
201
|
+
function basicWidget(part) {
|
|
202
|
+
const render = (props) => h(_sfc_main$2, {
|
|
203
|
+
...props,
|
|
204
|
+
parts: [part]
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
kinds: part.kinds,
|
|
208
|
+
render
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const ChecklistField = (props) => h(_sfc_main$3, { ...props });
|
|
212
|
+
/** The Element Plus text filter: its operator and its value. @public */
|
|
213
|
+
const textFilterWidget = /* @__PURE__ */ basicWidget(textFieldPart);
|
|
214
|
+
/** The Element Plus yes/no filter. @public */
|
|
215
|
+
const booleanFilterWidget = /* @__PURE__ */ basicWidget(booleanFieldPart);
|
|
216
|
+
/** The Element Plus single-choice filter. @public */
|
|
217
|
+
const selectFilterWidget = /* @__PURE__ */ basicWidget(selectFieldPart);
|
|
218
|
+
/** The Element Plus multiple-choice filter. @public */
|
|
219
|
+
const multiSelectFilterWidget = /* @__PURE__ */ basicWidget(multiSelectFieldPart);
|
|
220
|
+
/** The Element Plus searchable checklist filter. @public */
|
|
221
|
+
const checklistFilterWidget = {
|
|
222
|
+
kinds: ["checklist"],
|
|
223
|
+
render: ChecklistField
|
|
224
|
+
};
|
|
225
|
+
/** The Element Plus operator-first number and date range filter. @public */
|
|
226
|
+
const rangeFilterWidget = /* @__PURE__ */ basicWidget(rangeFieldPart);
|
|
227
|
+
/** Every built-in widget: what the automatic filters form draws. */
|
|
228
|
+
const FILTER_WIDGETS = [
|
|
229
|
+
textFilterWidget,
|
|
230
|
+
booleanFilterWidget,
|
|
231
|
+
selectFilterWidget,
|
|
232
|
+
multiSelectFilterWidget,
|
|
233
|
+
checklistFilterWidget,
|
|
234
|
+
rangeFilterWidget
|
|
235
|
+
];
|
|
236
|
+
//#endregion
|
|
192
237
|
//#region src/filters.ts
|
|
193
|
-
|
|
194
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Declarative filters whose fields are drawn with only the given widgets, so
|
|
240
|
+
* the widgets a table never shows stay out of its bundle. A filter whose
|
|
241
|
+
* widget is missing throws when its field draws.
|
|
242
|
+
*
|
|
243
|
+
* @param widgets - The widgets to draw fields with, such as `textFilterWidget`.
|
|
244
|
+
*
|
|
245
|
+
* @public
|
|
246
|
+
*/
|
|
247
|
+
function filtersWith(widgets) {
|
|
248
|
+
return (defs = [], options = {}) => extendFeature(filters(defs, options), [slotRender(FILTERS_PANEL, () => h(ElementFiltersPanel, { widgets })), slotRender(ACTIVE_FILTER_CHIPS, (props) => h(ElementFilterChips, { ...props }))]);
|
|
195
249
|
}
|
|
250
|
+
/** Declarative filters with this kit's chip strip, panel and every widget. @public */
|
|
251
|
+
const filters$1 = /* @__PURE__ */ filtersWith(FILTER_WIDGETS);
|
|
196
252
|
//#endregion
|
|
197
|
-
export { filters$1 as n,
|
|
253
|
+
export { checklistFilterWidget as a, selectFilterWidget as c, booleanFilterWidget as i, textFilterWidget as l, filters$1 as n, multiSelectFilterWidget as o, filtersWith as r, rangeFilterWidget as s, filterTypes as t, ElementFilterTree as u };
|
|
198
254
|
|
|
199
|
-
//# sourceMappingURL=filters-
|
|
255
|
+
//# sourceMappingURL=filters-CIQ1uMZw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-CIQ1uMZw.js","names":["ElementSelect","ElementInput","ElementBasicFilterField","ElementChecklistField","bindingFilters","filters"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters/widgets.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) =>\n elementButton({ ...attrs, text: true, size: \"small\" }, \"×\"),\n Clear: ({ attrs, label }) =>\n elementButton({ ...attrs, text: true, size: \"small\" }, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport const ElementFilterTree = /* @__PURE__ */ withProps(\n function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n ) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n },\n treeProps\n);\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n type FilterWidget,\n filterWidgetComponent,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nfunction useElementFiltersPanel(props: {\n readonly widgets: readonly FilterWidget[];\n}) {\n const widgets = props.widgets;\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(filterWidgetComponent(field.def, field.registry, widgets), {\n ...field,\n classNames: names.value,\n }),\n Tree: (tree) => h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) => h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n}\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n props: {\n /** The widgets the panel draws its fields with. */\n widgets: {\n type: Array as PropType<readonly FilterWidget[]>,\n required: true,\n },\n },\n setup: useElementFiltersPanel,\n});\n","import {\n booleanFieldPart,\n type DataTableClassNames,\n type FilterFieldOptions,\n type FilterFieldPart,\n type FilterWidget,\n multiSelectFieldPart,\n rangeFieldPart,\n selectFieldPart,\n textFieldPart,\n} from \"@adapttable/vue/adapter\";\nimport { type FunctionalComponent, h } from \"vue\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport ElementChecklistField from \"./ElementChecklistField.vue\";\n\n/** A field drawn by one shared field part. */\nfunction basicWidget(part: FilterFieldPart): FilterWidget {\n const render: FunctionalComponent<\n FilterFieldOptions<unknown> & { classNames?: DataTableClassNames }\n > = (props) =>\n h(ElementBasicFilterField<unknown>, { ...props, parts: [part] });\n return { kinds: part.kinds, render };\n}\n\nconst ChecklistField: FunctionalComponent<\n FilterFieldOptions<unknown> & { classNames?: DataTableClassNames }\n> = (props) => h(ElementChecklistField<unknown>, { ...props });\n\n/** The Element Plus text filter: its operator and its value. @public */\nexport const textFilterWidget = /* @__PURE__ */ basicWidget(textFieldPart);\n/** The Element Plus yes/no filter. @public */\nexport const booleanFilterWidget =\n /* @__PURE__ */ basicWidget(booleanFieldPart);\n/** The Element Plus single-choice filter. @public */\nexport const selectFilterWidget = /* @__PURE__ */ basicWidget(selectFieldPart);\n/** The Element Plus multiple-choice filter. @public */\nexport const multiSelectFilterWidget =\n /* @__PURE__ */ basicWidget(multiSelectFieldPart);\n/** The Element Plus searchable checklist filter. @public */\nexport const checklistFilterWidget: FilterWidget = {\n kinds: [\"checklist\"],\n render: ChecklistField,\n};\n/** The Element Plus operator-first number and date range filter. @public */\nexport const rangeFilterWidget = /* @__PURE__ */ basicWidget(rangeFieldPart);\n\n/** Every built-in widget: what the automatic filters form draws. */\nexport const FILTER_WIDGETS: readonly FilterWidget[] = [\n textFilterWidget,\n booleanFilterWidget,\n selectFilterWidget,\n multiSelectFilterWidget,\n checklistFilterWidget,\n rangeFilterWidget,\n];\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n type AdapterFiltersFeature,\n extendFeature,\n FILTERS_PANEL,\n type FilterWidget,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\nimport { FILTER_WIDGETS } from \"./filters/widgets\";\n\n/**\n * Declarative filters whose fields are drawn with only the given widgets, so\n * the widgets a table never shows stay out of its bundle. A filter whose\n * widget is missing throws when its field draws.\n *\n * @param widgets - The widgets to draw fields with, such as `textFilterWidget`.\n *\n * @public\n */\nexport function filtersWith(\n widgets: readonly FilterWidget[]\n): AdapterFiltersFeature {\n return <TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n ): TableFeature<TRow> =>\n extendFeature(bindingFilters(defs, options), [\n slotRender(FILTERS_PANEL, () => h(ElementFiltersPanel, { widgets })),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\n/** Declarative filters with this kit's chip strip, panel and every widget. @public */\nexport const filters = /* @__PURE__ */ filtersWith(FILTER_WIDGETS);\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport {\n booleanFilterWidget,\n checklistFilterWidget,\n multiSelectFilterWidget,\n rangeFilterWidget,\n selectFilterWidget,\n textFilterWidget,\n} from \"./filters/widgets\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n AdapterFiltersFeature,\n FilterWidget,\n} from \"@adapttable/vue/adapter\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;;AASA,MAAa,qBAAqB,iBAC/B,UAAsC;CACrC,MAAM,QAAQ,cAAc;CAC5B,aACE,kBAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YACT,cAAc;IAAE,GAAG;IAAO,MAAM;IAAM,MAAM;GAAQ,GAAG,GAAG;GAC5D,QAAQ,EAAE,OAAO,YACf,cAAc;IAAE,GAAG;IAAO,MAAM;IAAM,MAAM;GAAQ,GAAG,KAAK;EAChE;CACF,CAAC;AACL,GACA;CACE,MAAM;CACN,OAAO;EACL,OAAO,EAAE,MAAM,MAAuD;EACtE,QAAQ,EACN,MAAM,OACR;EACA,YAAY,EACV,MAAM,SACR;CACF;AACF,CACF;;;ACVA,MAAM,WAAwC;CAC5C,SAAS,YACP,EACE,YACA;EAAE,OAAO,QAAQ;EAAgB,wBAAwB;CAAe,GACxE;EACE,aACE,EACE,QACA;GACE,OAAO,QAAQ;GACf,wBAAwB;EAC1B,GACA,EAAE,eAAe,QAAQ,MAAM,CACjC;EACF,eACE,EAAEA,aAAe;GACf,OAAO,QAAQ;GACf,SAAS,QAAQ;GACjB,OAAO,QAAQ;GACf,cAAc,QAAQ;GACtB,wBAAwB,QAA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AAM,MAAM;EACjC,CAAC;CACL;CACA,aACE,MAAM,QACF,kBAAkB;EAChB,OAAO,MAAM;EACb;EACA,YAAY,MAAM;CACpB,CAAC,IACD;AACR;AAEA,MAAa,sBAAsB,gBAAgB;CACjD,MAAM;CACN,OAAO;;AAEL,SAAS;EACP,MAAM;EACN,UAAU;CACZ,EACF;CACA,OAAO;AACT,CAAC;;;;ACjGD,SAAS,YAAY,MAAqC;CACxD,MAAM,UAED,UACH,EAAEC,aAAkC;EAAE,GAAG;EAAO,OAAO,CAAC,IAAI;CAAE,CAAC;CACjE,OAAO;EAAE,OAAO,KAAK;EAAO;CAAO;AACrC;AAEA,MAAM,kBAED,UAAU,EAAEC,aAAgC,EAAE,GAAG,MAAM,CAAC;;AAG7D,MAAa,mBAAmC,4BAAY,aAAa;;AAEzE,MAAa,sBACK,4BAAY,gBAAgB;;AAE9C,MAAa,qBAAqC,4BAAY,eAAe;;AAE7E,MAAa,0BACK,4BAAY,oBAAoB;;AAElD,MAAa,wBAAsC;CACjD,OAAO,CAAC,WAAW;CACnB,QAAQ;AACV;;AAEA,MAAa,oBAAoC,4BAAY,cAAc;;AAG3E,MAAa,iBAA0C;CACrD;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;;;;;;AC3BA,SAAgB,YACd,SACuB;CACvB,QACE,OAAmC,CAAC,GACpC,UAA0B,CAAC,MAE3B,cAAcC,QAAe,MAAM,OAAO,GAAG,CAC3C,WAAW,qBAAqB,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC,GACnE,WAAW,sBAAsB,UAC/B,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,CACpC,CACF,CAAC;AACL;;AAGA,MAAaC,YAA0B,4BAAY,cAAc"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_button = require("./button-BFjBL9m3.cjs");
|
|
2
2
|
const require_ElementInput = require("./ElementInput-BF97xXSC.cjs");
|
|
3
3
|
const require_ElementSelect = require("./ElementSelect-1UwtGCCr.cjs");
|
|
4
|
-
const
|
|
4
|
+
const require_ElementFilterField = require("./ElementFilterField-Dfzy-Yk4.cjs");
|
|
5
5
|
let vue = require("vue");
|
|
6
6
|
let _adapttable_vue_adapter = require("@adapttable/vue/adapter");
|
|
7
7
|
let element_plus = require("element-plus");
|
|
@@ -118,7 +118,8 @@ const ElementFilterTree = /* @__PURE__ */ (0, _adapttable_vue_adapter.withProps)
|
|
|
118
118
|
}, treeProps);
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/filters/ElementFiltersPanel.ts
|
|
121
|
-
function useElementFiltersPanel() {
|
|
121
|
+
function useElementFiltersPanel(props) {
|
|
122
|
+
const widgets = props.widgets;
|
|
122
123
|
const names = (0, _adapttable_vue_adapter.useDataTableClassNames)();
|
|
123
124
|
const model = (0, _adapttable_vue_adapter.useFeatureState)((0, _adapttable_vue_adapter.filterViewKey)());
|
|
124
125
|
const controls = {
|
|
@@ -159,7 +160,7 @@ function useElementFiltersPanel() {
|
|
|
159
160
|
disabled: control.disabled,
|
|
160
161
|
onClick: control.onClick
|
|
161
162
|
}, control.label),
|
|
162
|
-
Field: (field) => (0, vue.h)(
|
|
163
|
+
Field: (field) => (0, vue.h)((0, _adapttable_vue_adapter.filterWidgetComponent)(field.def, field.registry, widgets), {
|
|
163
164
|
...field,
|
|
164
165
|
classNames: names.value
|
|
165
166
|
}),
|
|
@@ -167,11 +168,11 @@ function useElementFiltersPanel() {
|
|
|
167
168
|
...tree,
|
|
168
169
|
classNames: names.value
|
|
169
170
|
}),
|
|
170
|
-
Popover: (surface) => (0, vue.h)(
|
|
171
|
+
Popover: (surface) => (0, vue.h)(require_ElementFilterField.ElementFilterSurface, {
|
|
171
172
|
...surface,
|
|
172
173
|
modal: false
|
|
173
174
|
}),
|
|
174
|
-
Drawer: (surface) => (0, vue.h)(
|
|
175
|
+
Drawer: (surface) => (0, vue.h)(require_ElementFilterField.ElementFilterSurface, {
|
|
175
176
|
...surface,
|
|
176
177
|
modal: true,
|
|
177
178
|
backdropClassName: names.value.filtersBackdrop
|
|
@@ -185,13 +186,68 @@ function useElementFiltersPanel() {
|
|
|
185
186
|
}
|
|
186
187
|
const ElementFiltersPanel = (0, vue.defineComponent)({
|
|
187
188
|
name: "ElementFiltersPanel",
|
|
189
|
+
props: {
|
|
190
|
+
/** The widgets the panel draws its fields with. */
|
|
191
|
+
widgets: {
|
|
192
|
+
type: Array,
|
|
193
|
+
required: true
|
|
194
|
+
} },
|
|
188
195
|
setup: useElementFiltersPanel
|
|
189
196
|
});
|
|
190
197
|
//#endregion
|
|
198
|
+
//#region src/filters/widgets.ts
|
|
199
|
+
/** A field drawn by one shared field part. */
|
|
200
|
+
function basicWidget(part) {
|
|
201
|
+
const render = (props) => (0, vue.h)(require_ElementFilterField._sfc_main$2, {
|
|
202
|
+
...props,
|
|
203
|
+
parts: [part]
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
kinds: part.kinds,
|
|
207
|
+
render
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const ChecklistField = (props) => (0, vue.h)(require_ElementFilterField._sfc_main$1, { ...props });
|
|
211
|
+
/** The Element Plus text filter: its operator and its value. @public */
|
|
212
|
+
const textFilterWidget = /* @__PURE__ */ basicWidget(_adapttable_vue_adapter.textFieldPart);
|
|
213
|
+
/** The Element Plus yes/no filter. @public */
|
|
214
|
+
const booleanFilterWidget = /* @__PURE__ */ basicWidget(_adapttable_vue_adapter.booleanFieldPart);
|
|
215
|
+
/** The Element Plus single-choice filter. @public */
|
|
216
|
+
const selectFilterWidget = /* @__PURE__ */ basicWidget(_adapttable_vue_adapter.selectFieldPart);
|
|
217
|
+
/** The Element Plus multiple-choice filter. @public */
|
|
218
|
+
const multiSelectFilterWidget = /* @__PURE__ */ basicWidget(_adapttable_vue_adapter.multiSelectFieldPart);
|
|
219
|
+
/** The Element Plus searchable checklist filter. @public */
|
|
220
|
+
const checklistFilterWidget = {
|
|
221
|
+
kinds: ["checklist"],
|
|
222
|
+
render: ChecklistField
|
|
223
|
+
};
|
|
224
|
+
/** The Element Plus operator-first number and date range filter. @public */
|
|
225
|
+
const rangeFilterWidget = /* @__PURE__ */ basicWidget(_adapttable_vue_adapter.rangeFieldPart);
|
|
226
|
+
/** Every built-in widget: what the automatic filters form draws. */
|
|
227
|
+
const FILTER_WIDGETS = [
|
|
228
|
+
textFilterWidget,
|
|
229
|
+
booleanFilterWidget,
|
|
230
|
+
selectFilterWidget,
|
|
231
|
+
multiSelectFilterWidget,
|
|
232
|
+
checklistFilterWidget,
|
|
233
|
+
rangeFilterWidget
|
|
234
|
+
];
|
|
235
|
+
//#endregion
|
|
191
236
|
//#region src/filters.ts
|
|
192
|
-
|
|
193
|
-
|
|
237
|
+
/**
|
|
238
|
+
* Declarative filters whose fields are drawn with only the given widgets, so
|
|
239
|
+
* the widgets a table never shows stay out of its bundle. A filter whose
|
|
240
|
+
* widget is missing throws when its field draws.
|
|
241
|
+
*
|
|
242
|
+
* @param widgets - The widgets to draw fields with, such as `textFilterWidget`.
|
|
243
|
+
*
|
|
244
|
+
* @public
|
|
245
|
+
*/
|
|
246
|
+
function filtersWith(widgets) {
|
|
247
|
+
return (defs = [], options = {}) => (0, _adapttable_vue_adapter.extendFeature)((0, _adapttable_vue_features.filters)(defs, options), [(0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.FILTERS_PANEL, () => (0, vue.h)(ElementFiltersPanel, { widgets })), (0, _adapttable_vue_adapter.slotRender)(_adapttable_vue_adapter.ACTIVE_FILTER_CHIPS, (props) => (0, vue.h)(ElementFilterChips, { ...props }))]);
|
|
194
248
|
}
|
|
249
|
+
/** Declarative filters with this kit's chip strip, panel and every widget. @public */
|
|
250
|
+
const filters = /* @__PURE__ */ filtersWith(FILTER_WIDGETS);
|
|
195
251
|
//#endregion
|
|
196
252
|
Object.defineProperty(exports, "ElementFilterTree", {
|
|
197
253
|
enumerable: true,
|
|
@@ -199,11 +255,53 @@ Object.defineProperty(exports, "ElementFilterTree", {
|
|
|
199
255
|
return ElementFilterTree;
|
|
200
256
|
}
|
|
201
257
|
});
|
|
258
|
+
Object.defineProperty(exports, "booleanFilterWidget", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function() {
|
|
261
|
+
return booleanFilterWidget;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "checklistFilterWidget", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function() {
|
|
267
|
+
return checklistFilterWidget;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
202
270
|
Object.defineProperty(exports, "filters", {
|
|
203
271
|
enumerable: true,
|
|
204
272
|
get: function() {
|
|
205
273
|
return filters;
|
|
206
274
|
}
|
|
207
275
|
});
|
|
276
|
+
Object.defineProperty(exports, "filtersWith", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function() {
|
|
279
|
+
return filtersWith;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, "multiSelectFilterWidget", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function() {
|
|
285
|
+
return multiSelectFilterWidget;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "rangeFilterWidget", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function() {
|
|
291
|
+
return rangeFilterWidget;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, "selectFilterWidget", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function() {
|
|
297
|
+
return selectFilterWidget;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
Object.defineProperty(exports, "textFilterWidget", {
|
|
301
|
+
enumerable: true,
|
|
302
|
+
get: function() {
|
|
303
|
+
return textFilterWidget;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
208
306
|
|
|
209
|
-
//# sourceMappingURL=filters-
|
|
307
|
+
//# sourceMappingURL=filters-CYQFsZ_f.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-CYQFsZ_f.cjs","names":["defineComponent","useClassNames","FilterChipsChrome","elementButton","h","ElFormItem","ElText","ElementSelect","ElementInput","elementButton","ElCollapse","ElCollapseItem","defineComponent","useFilterTreeModel","FilterTreeChrome","createVNode","useClassNames","useFeatureState","filterViewKey","elementButton","h","ElIcon","ElTag","filterWidgetComponent","ElementFilterSurface","FilterPanelChrome","defineComponent","h","ElementBasicFilterField","ElementChecklistField","textFieldPart","booleanFieldPart","selectFieldPart","multiSelectFieldPart","rangeFieldPart","extendFeature","bindingFilters","slotRender","FILTERS_PANEL","h","ACTIVE_FILTER_CHIPS"],"sources":["../src/filters/ElementFilterChips.ts","../src/filters/ElementFilterTree.ts","../src/filters/ElementFiltersPanel.ts","../src/filters/widgets.ts","../src/filters.ts"],"sourcesContent":["import {\n type ActiveFilterChipsSlotProps,\n FilterChipsChrome,\n} from \"@adapttable/vue/adapter\";\nimport { defineComponent, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\n\nexport const ElementFilterChips = defineComponent(\n (props: ActiveFilterChipsSlotProps) => {\n const names = useClassNames();\n return () =>\n FilterChipsChrome({\n ...props,\n classNames: names.value,\n slots: {\n Remove: ({ attrs }) =>\n elementButton({ ...attrs, text: true, size: \"small\" }, \"×\"),\n Clear: ({ attrs, label }) =>\n elementButton({ ...attrs, text: true, size: \"small\" }, label),\n },\n });\n },\n {\n name: \"ElementFilterChips\",\n props: {\n chips: { type: Array as PropType<ActiveFilterChipsSlotProps[\"chips\"]> },\n labels: {\n type: Object as PropType<ActiveFilterChipsSlotProps[\"labels\"]>,\n },\n onClearAll: {\n type: Function as PropType<ActiveFilterChipsSlotProps[\"onClearAll\"]>,\n },\n },\n }\n);\n","import {\n type FilterTreeBuilderProps,\n FilterTreeChrome,\n type FilterTreeSlots,\n useFilterTreeModel,\n withProps,\n} from \"@adapttable/vue/adapter\";\nimport {\n type CollapseModelValue,\n ElCollapse,\n ElCollapseItem,\n ElFormItem,\n ElText,\n} from \"element-plus\";\nimport {\n createVNode,\n defineComponent,\n h,\n type SetupContext,\n type VNodeChild,\n} from \"vue\";\n\nimport { elementButton } from \"../controls/button\";\nimport ElementInput from \"../controls/ElementInput.vue\";\nimport ElementSelect from \"../controls/ElementSelect.vue\";\n\nconst controls: FilterTreeSlots<VNodeChild> = {\n Select: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementSelect, {\n value: control.value,\n options: control.options,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": control.part,\n onChange: control.onChange,\n }),\n }\n ),\n Input: (control) =>\n h(\n ElFormItem,\n { class: control.fieldClassName, \"data-adapttable-part\": \"filter-field\" },\n {\n label: () =>\n h(\n ElText,\n {\n class: control.labelClassName,\n \"data-adapttable-part\": \"filter-label\",\n },\n { default: () => control.label }\n ),\n default: () =>\n h(ElementInput, {\n value: control.value,\n type: control.type,\n class: control.className,\n \"aria-label\": control.label,\n \"data-adapttable-part\": \"filter-input\",\n onChange: control.onChange,\n }),\n }\n ),\n Button: (control) =>\n elementButton(\n {\n class: control.className,\n \"data-adapttable-part\": control.part,\n onClick: control.onClick,\n },\n control.label\n ),\n Disclosure: (control) =>\n h(\n ElCollapse,\n {\n modelValue: control.expanded ? [\"query\"] : [],\n class: control.className,\n \"data-adapttable-part\": \"filter-tree\",\n \"onUpdate:modelValue\": (value: CollapseModelValue) =>\n control.onExpandedChange(\n Array.isArray(value) && value.includes(\"query\")\n ),\n },\n {\n default: () =>\n h(\n ElCollapseItem,\n { name: \"query\" },\n {\n title: () =>\n h(\n ElText,\n {\n class: control.summaryClassName,\n \"data-adapttable-part\": \"filter-tree-summary\",\n },\n { default: () => control.label }\n ),\n default: () => control.children,\n }\n ),\n }\n ),\n};\n\nconst treeProps = {\n defs: null,\n source: null,\n labels: null,\n registry: null,\n classNames: null,\n defaultExpanded: { type: Boolean, default: undefined },\n} satisfies Record<keyof FilterTreeBuilderProps<unknown>, unknown>;\n\nconst ElementFilterTreePresentation = defineComponent(\n (props: FilterTreeBuilderProps<unknown>) => {\n const model = useFilterTreeModel(() => props);\n return () => FilterTreeChrome({ model: model.value, controls });\n },\n {\n name: \"ElementFilterTreePresentation\",\n props: treeProps,\n }\n);\n\n/** Preserve the canonical row contract without exposing versioned instance helpers. */\nexport const ElementFilterTree = /* @__PURE__ */ withProps(\n function ElementFilterTree<TRow>(\n props: FilterTreeBuilderProps<TRow>,\n context: Pick<SetupContext, \"attrs\">\n ) {\n return createVNode(ElementFilterTreePresentation, {\n ...context.attrs,\n ...props,\n });\n },\n treeProps\n);\n","import {\n FilterPanelChrome,\n type FilterPanelSlots,\n filterViewKey,\n type FilterWidget,\n filterWidgetComponent,\n useFeatureState,\n} from \"@adapttable/vue/adapter\";\nimport { ElIcon, ElTag } from \"element-plus\";\nimport { defineComponent, h, type PropType } from \"vue\";\n\nimport { useClassNames } from \"../classNamesContext\";\nimport { elementButton } from \"../controls/button\";\nimport { ElementFilterSurface } from \"./ElementFilterSurface\";\nimport { ElementFilterTree } from \"./ElementFilterTree\";\n\nfunction useElementFiltersPanel(props: {\n readonly widgets: readonly FilterWidget[];\n}) {\n const widgets = props.widgets;\n const names = useClassNames();\n const model = useFeatureState(filterViewKey<unknown>());\n const controls: FilterPanelSlots<unknown> = {\n Trigger: (control) =>\n elementButton(\n {\n ...control.attrs,\n ref: control.triggerRef,\n class: names.value.filtersButton,\n onPointerdown: control.onPointerDown,\n onClick: control.onClick,\n },\n [\n h(\n ElIcon,\n {\n \"data-adapttable-part\": \"filters-icon\",\n class: names.value.filtersIcon,\n \"aria-hidden\": \"true\",\n },\n {\n default: () =>\n h(\"svg\", { viewBox: \"0 0 24 24\", focusable: \"false\" }, [\n h(\"path\", {\n d: \"M3 4h18l-7 8v7l-4 2v-9z\",\n fill: \"none\",\n stroke: \"currentColor\",\n }),\n ]),\n }\n ),\n control.label,\n control.count\n ? h(\n ElTag,\n {\n \"data-adapttable-part\": \"filters-count\",\n class: names.value.filtersCount,\n size: \"small\",\n round: true,\n },\n { default: () => control.count }\n )\n : null,\n ]\n ),\n Button: (control) =>\n elementButton(\n {\n \"data-adapttable-part\": control.part,\n class: {\n \"filters-clear\": names.value.filtersClear,\n \"filters-close\": names.value.filtersClose,\n \"filters-done\": names.value.filtersDone,\n }[control.part],\n disabled: control.disabled,\n onClick: control.onClick,\n },\n control.label\n ),\n Field: (field) =>\n h(filterWidgetComponent(field.def, field.registry, widgets), {\n ...field,\n classNames: names.value,\n }),\n Tree: (tree) => h(ElementFilterTree, { ...tree, classNames: names.value }),\n Popover: (surface) => h(ElementFilterSurface, { ...surface, modal: false }),\n Drawer: (surface) =>\n h(ElementFilterSurface, {\n ...surface,\n modal: true,\n backdropClassName: names.value.filtersBackdrop,\n }),\n };\n return () =>\n model.value\n ? FilterPanelChrome({\n model: model.value,\n controls,\n classNames: names.value,\n })\n : null;\n}\n\nexport const ElementFiltersPanel = defineComponent({\n name: \"ElementFiltersPanel\",\n props: {\n /** The widgets the panel draws its fields with. */\n widgets: {\n type: Array as PropType<readonly FilterWidget[]>,\n required: true,\n },\n },\n setup: useElementFiltersPanel,\n});\n","import {\n booleanFieldPart,\n type DataTableClassNames,\n type FilterFieldOptions,\n type FilterFieldPart,\n type FilterWidget,\n multiSelectFieldPart,\n rangeFieldPart,\n selectFieldPart,\n textFieldPart,\n} from \"@adapttable/vue/adapter\";\nimport { type FunctionalComponent, h } from \"vue\";\n\nimport ElementBasicFilterField from \"./ElementBasicFilterField.vue\";\nimport ElementChecklistField from \"./ElementChecklistField.vue\";\n\n/** A field drawn by one shared field part. */\nfunction basicWidget(part: FilterFieldPart): FilterWidget {\n const render: FunctionalComponent<\n FilterFieldOptions<unknown> & { classNames?: DataTableClassNames }\n > = (props) =>\n h(ElementBasicFilterField<unknown>, { ...props, parts: [part] });\n return { kinds: part.kinds, render };\n}\n\nconst ChecklistField: FunctionalComponent<\n FilterFieldOptions<unknown> & { classNames?: DataTableClassNames }\n> = (props) => h(ElementChecklistField<unknown>, { ...props });\n\n/** The Element Plus text filter: its operator and its value. @public */\nexport const textFilterWidget = /* @__PURE__ */ basicWidget(textFieldPart);\n/** The Element Plus yes/no filter. @public */\nexport const booleanFilterWidget =\n /* @__PURE__ */ basicWidget(booleanFieldPart);\n/** The Element Plus single-choice filter. @public */\nexport const selectFilterWidget = /* @__PURE__ */ basicWidget(selectFieldPart);\n/** The Element Plus multiple-choice filter. @public */\nexport const multiSelectFilterWidget =\n /* @__PURE__ */ basicWidget(multiSelectFieldPart);\n/** The Element Plus searchable checklist filter. @public */\nexport const checklistFilterWidget: FilterWidget = {\n kinds: [\"checklist\"],\n render: ChecklistField,\n};\n/** The Element Plus operator-first number and date range filter. @public */\nexport const rangeFilterWidget = /* @__PURE__ */ basicWidget(rangeFieldPart);\n\n/** Every built-in widget: what the automatic filters form draws. */\nexport const FILTER_WIDGETS: readonly FilterWidget[] = [\n textFilterWidget,\n booleanFilterWidget,\n selectFilterWidget,\n multiSelectFilterWidget,\n checklistFilterWidget,\n rangeFilterWidget,\n];\n","import type { FilterDef, TableFeature } from \"@adapttable/vue\";\nimport {\n ACTIVE_FILTER_CHIPS,\n type AdapterFiltersFeature,\n extendFeature,\n FILTERS_PANEL,\n type FilterWidget,\n slotRender,\n} from \"@adapttable/vue/adapter\";\nimport {\n filters as bindingFilters,\n type FiltersOptions,\n} from \"@adapttable/vue/features\";\nimport { h } from \"vue\";\n\nimport { ElementFilterChips } from \"./filters/ElementFilterChips\";\nimport { ElementFiltersPanel } from \"./filters/ElementFiltersPanel\";\nimport { FILTER_WIDGETS } from \"./filters/widgets\";\n\n/**\n * Declarative filters whose fields are drawn with only the given widgets, so\n * the widgets a table never shows stay out of its bundle. A filter whose\n * widget is missing throws when its field draws.\n *\n * @param widgets - The widgets to draw fields with, such as `textFilterWidget`.\n *\n * @public\n */\nexport function filtersWith(\n widgets: readonly FilterWidget[]\n): AdapterFiltersFeature {\n return <TRow>(\n defs: readonly FilterDef<TRow>[] = [],\n options: FiltersOptions = {}\n ): TableFeature<TRow> =>\n extendFeature(bindingFilters(defs, options), [\n slotRender(FILTERS_PANEL, () => h(ElementFiltersPanel, { widgets })),\n slotRender(ACTIVE_FILTER_CHIPS, (props) =>\n h(ElementFilterChips, { ...props })\n ),\n ]);\n}\n\n/** Declarative filters with this kit's chip strip, panel and every widget. @public */\nexport const filters = /* @__PURE__ */ filtersWith(FILTER_WIDGETS);\n\nexport { ElementChecklistFilter as ChecklistFilter } from \"./filters/ElementChecklistFilter\";\nexport { default as FilterField } from \"./filters/ElementFilterField.vue\";\nexport { ElementFilterTree as FilterTreeBuilder } from \"./filters/ElementFilterTree\";\nexport {\n booleanFilterWidget,\n checklistFilterWidget,\n multiSelectFilterWidget,\n rangeFilterWidget,\n selectFilterWidget,\n textFilterWidget,\n} from \"./filters/widgets\";\nexport type { FilterDef, FilterOption, FilterTypeSpec } from \"@adapttable/vue\";\nexport type {\n AdapterFiltersFeature,\n FilterWidget,\n} from \"@adapttable/vue/adapter\";\nexport type {\n ChecklistFilterProps,\n FilterFieldOptions,\n FilterTreeBuilderProps,\n} from \"@adapttable/vue/adapter\";\nexport type { FiltersOptions } from \"@adapttable/vue/features\";\nexport { filterTypes } from \"@adapttable/vue/features\";\n"],"mappings":";;;;;;;;;AASA,MAAa,sBAAA,GAAqBA,IAAAA,gBAAAA,EAC/B,UAAsC;CACrC,MAAM,SAAA,GAAQC,wBAAAA,uBAAAA,CAAc;CAC5B,cAAA,GACEC,wBAAAA,kBAAAA,CAAkB;EAChB,GAAG;EACH,YAAY,MAAM;EAClB,OAAO;GACL,SAAS,EAAE,YACTC,eAAAA,cAAc;IAAE,GAAG;IAAO,MAAM;IAAM,MAAM;GAAQ,GAAG,GAAG;GAC5D,QAA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F,wBAAAA,WAAAA,CAAWG,wBAAAA,sBAAsB,WAAA,GAC/BD,IAAAA,EAAAA,CAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC,CACpC,CACF,CAAC;AACL;;AAGA,MAAa,UAA0B,4BAAY,cAAc"}
|
package/dist/filters.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_filters = require("./filters-
|
|
3
|
-
const
|
|
2
|
+
const require_filters = require("./filters-CYQFsZ_f.cjs");
|
|
3
|
+
const require_ElementFilterField = require("./ElementFilterField-Dfzy-Yk4.cjs");
|
|
4
4
|
let _adapttable_vue_features = require("@adapttable/vue/features");
|
|
5
|
-
exports.ChecklistFilter =
|
|
6
|
-
exports.FilterField =
|
|
5
|
+
exports.ChecklistFilter = require_ElementFilterField.ElementChecklistFilter;
|
|
6
|
+
exports.FilterField = require_ElementFilterField._sfc_main;
|
|
7
7
|
exports.FilterTreeBuilder = require_filters.ElementFilterTree;
|
|
8
|
+
exports.booleanFilterWidget = require_filters.booleanFilterWidget;
|
|
9
|
+
exports.checklistFilterWidget = require_filters.checklistFilterWidget;
|
|
8
10
|
Object.defineProperty(exports, "filterTypes", {
|
|
9
11
|
enumerable: true,
|
|
10
12
|
get: function() {
|
|
@@ -12,3 +14,8 @@ Object.defineProperty(exports, "filterTypes", {
|
|
|
12
14
|
}
|
|
13
15
|
});
|
|
14
16
|
exports.filters = require_filters.filters;
|
|
17
|
+
exports.filtersWith = require_filters.filtersWith;
|
|
18
|
+
exports.multiSelectFilterWidget = require_filters.multiSelectFilterWidget;
|
|
19
|
+
exports.rangeFilterWidget = require_filters.rangeFilterWidget;
|
|
20
|
+
exports.selectFilterWidget = require_filters.selectFilterWidget;
|
|
21
|
+
exports.textFilterWidget = require_filters.textFilterWidget;
|
package/dist/filters.d.cts
CHANGED
|
@@ -1,2 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { FilterDef, FilterOption, FilterTypeSpec } from "@adapttable/vue";
|
|
2
|
+
import { AdapterFiltersFeature, AdapterFiltersFeature as AdapterFiltersFeature$1, ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, DataTableClassNames, FilterFieldOptions, FilterFieldOptions as FilterFieldOptions$1, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1, FilterWidget, FilterWidget as FilterWidget$1 } from "@adapttable/vue/adapter";
|
|
3
|
+
import { FiltersOptions, filterTypes } from "@adapttable/vue/features";
|
|
4
|
+
import { SetupContext } from "vue";
|
|
5
|
+
//#region src/filters/ElementChecklistFilter.d.ts
|
|
6
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
7
|
+
declare const ElementChecklistFilter: (<TRow>(props: ChecklistFilterProps$1<TRow>, context: Pick<SetupContext, "attrs">) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}>) & {
|
|
10
|
+
props: string[];
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/filters/ElementFilterField.vue.d.ts
|
|
14
|
+
declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
15
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<FilterFieldOptions$1<TRow> & {
|
|
16
|
+
classNames?: DataTableClassNames;
|
|
17
|
+
}> & (typeof globalThis extends {
|
|
18
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
19
|
+
} ? P : {});
|
|
20
|
+
expose: (exposed: {}) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
slots: {};
|
|
23
|
+
emit: {};
|
|
24
|
+
}>) => import("vue").VNode & {
|
|
25
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
26
|
+
};
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/filters/ElementFilterTree.d.ts
|
|
31
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
32
|
+
declare const ElementFilterTree: (<TRow>(props: FilterTreeBuilderProps$1<TRow>, context: Pick<SetupContext, "attrs">) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>) & {
|
|
35
|
+
props: {
|
|
36
|
+
defs: null;
|
|
37
|
+
source: null;
|
|
38
|
+
labels: null;
|
|
39
|
+
registry: null;
|
|
40
|
+
classNames: null;
|
|
41
|
+
defaultExpanded: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/filters/widgets.d.ts
|
|
49
|
+
/** The Element Plus text filter: its operator and its value. @public */
|
|
50
|
+
declare const textFilterWidget: FilterWidget$1;
|
|
51
|
+
/** The Element Plus yes/no filter. @public */
|
|
52
|
+
declare const booleanFilterWidget: FilterWidget$1;
|
|
53
|
+
/** The Element Plus single-choice filter. @public */
|
|
54
|
+
declare const selectFilterWidget: FilterWidget$1;
|
|
55
|
+
/** The Element Plus multiple-choice filter. @public */
|
|
56
|
+
declare const multiSelectFilterWidget: FilterWidget$1;
|
|
57
|
+
/** The Element Plus searchable checklist filter. @public */
|
|
58
|
+
declare const checklistFilterWidget: FilterWidget$1;
|
|
59
|
+
/** The Element Plus operator-first number and date range filter. @public */
|
|
60
|
+
declare const rangeFilterWidget: FilterWidget$1;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/filters.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* Declarative filters whose fields are drawn with only the given widgets, so
|
|
65
|
+
* the widgets a table never shows stay out of its bundle. A filter whose
|
|
66
|
+
* widget is missing throws when its field draws.
|
|
67
|
+
*
|
|
68
|
+
* @param widgets - The widgets to draw fields with, such as `textFilterWidget`.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
declare function filtersWith(widgets: readonly FilterWidget$1[]): AdapterFiltersFeature$1;
|
|
73
|
+
/** Declarative filters with this kit's chip strip, panel and every widget. @public */
|
|
74
|
+
declare const filters: AdapterFiltersFeature$1;
|
|
75
|
+
//#endregion
|
|
76
|
+
export { type AdapterFiltersFeature, ElementChecklistFilter as ChecklistFilter, type ChecklistFilterProps, type FilterDef, _default as FilterField, type FilterFieldOptions, type FilterOption, ElementFilterTree as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FilterWidget, type FiltersOptions, booleanFilterWidget, checklistFilterWidget, filterTypes, filters, filtersWith, multiSelectFilterWidget, rangeFilterWidget, selectFilterWidget, textFilterWidget };
|
|
77
|
+
//# sourceMappingURL=filters.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.cts","names":[],"sources":["../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterTree.ts","../src/filters/widgets.ts","../src/filters.ts"],"mappings":";;;;;;cA+Ea,0BACqB,MAAI,OAC3B,uBAAqB,OAAK,SACxB,KAAK,yCAAsB,oBAAA,4BAAA;;;;;;;cCzClC,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,oBAAmB,qBAAA;IAjDM,aAAA;eAiDwB;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;cCoCvF,qBACgB,MAAI,OACtB,yBAAuB,OAAK,SAC1B,KAAK,yCAAsB,oBAAA,4BAAA;;;;;;;;;;;;;;;;;;cClH3B,kBAAgB;;cAEhB,qBAAmB;;cAGnB,oBAAkB;;cAElB,yBAAuB;;cAGvB,uBAAuB;;cAKvB,mBAAiB;;;;;;;;;;;;iBCjBd,YACd,kBAAkB,mBACjB;;cAcU,SAAO"}
|
package/dist/filters.d.ts
CHANGED
|
@@ -1,2 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { SetupContext } from "vue";
|
|
2
|
+
import { AdapterFiltersFeature, AdapterFiltersFeature as AdapterFiltersFeature$1, ChecklistFilterProps, ChecklistFilterProps as ChecklistFilterProps$1, DataTableClassNames, FilterFieldOptions, FilterFieldOptions as FilterFieldOptions$1, FilterTreeBuilderProps, FilterTreeBuilderProps as FilterTreeBuilderProps$1, FilterWidget, FilterWidget as FilterWidget$1 } from "@adapttable/vue/adapter";
|
|
3
|
+
import { FiltersOptions, filterTypes } from "@adapttable/vue/features";
|
|
4
|
+
import { FilterDef, FilterOption, FilterTypeSpec } from "@adapttable/vue";
|
|
5
|
+
//#region src/filters/ElementChecklistFilter.d.ts
|
|
6
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
7
|
+
declare const ElementChecklistFilter: (<TRow>(props: ChecklistFilterProps$1<TRow>, context: Pick<SetupContext, "attrs">) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}>) & {
|
|
10
|
+
props: string[];
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/filters/ElementFilterField.vue.d.ts
|
|
14
|
+
declare const __VLS_export: <TRow>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
15
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<FilterFieldOptions$1<TRow> & {
|
|
16
|
+
classNames?: DataTableClassNames;
|
|
17
|
+
}> & (typeof globalThis extends {
|
|
18
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
19
|
+
} ? P : {});
|
|
20
|
+
expose: (exposed: {}) => void;
|
|
21
|
+
attrs: any;
|
|
22
|
+
slots: {};
|
|
23
|
+
emit: {};
|
|
24
|
+
}>) => import("vue").VNode & {
|
|
25
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
26
|
+
};
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/filters/ElementFilterTree.d.ts
|
|
31
|
+
/** Preserve the canonical row contract without exposing versioned instance helpers. */
|
|
32
|
+
declare const ElementFilterTree: (<TRow>(props: FilterTreeBuilderProps$1<TRow>, context: Pick<SetupContext, "attrs">) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}>) & {
|
|
35
|
+
props: {
|
|
36
|
+
defs: null;
|
|
37
|
+
source: null;
|
|
38
|
+
labels: null;
|
|
39
|
+
registry: null;
|
|
40
|
+
classNames: null;
|
|
41
|
+
defaultExpanded: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/filters/widgets.d.ts
|
|
49
|
+
/** The Element Plus text filter: its operator and its value. @public */
|
|
50
|
+
declare const textFilterWidget: FilterWidget$1;
|
|
51
|
+
/** The Element Plus yes/no filter. @public */
|
|
52
|
+
declare const booleanFilterWidget: FilterWidget$1;
|
|
53
|
+
/** The Element Plus single-choice filter. @public */
|
|
54
|
+
declare const selectFilterWidget: FilterWidget$1;
|
|
55
|
+
/** The Element Plus multiple-choice filter. @public */
|
|
56
|
+
declare const multiSelectFilterWidget: FilterWidget$1;
|
|
57
|
+
/** The Element Plus searchable checklist filter. @public */
|
|
58
|
+
declare const checklistFilterWidget: FilterWidget$1;
|
|
59
|
+
/** The Element Plus operator-first number and date range filter. @public */
|
|
60
|
+
declare const rangeFilterWidget: FilterWidget$1;
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/filters.d.ts
|
|
63
|
+
/**
|
|
64
|
+
* Declarative filters whose fields are drawn with only the given widgets, so
|
|
65
|
+
* the widgets a table never shows stay out of its bundle. A filter whose
|
|
66
|
+
* widget is missing throws when its field draws.
|
|
67
|
+
*
|
|
68
|
+
* @param widgets - The widgets to draw fields with, such as `textFilterWidget`.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
declare function filtersWith(widgets: readonly FilterWidget$1[]): AdapterFiltersFeature$1;
|
|
73
|
+
/** Declarative filters with this kit's chip strip, panel and every widget. @public */
|
|
74
|
+
declare const filters: AdapterFiltersFeature$1;
|
|
75
|
+
//#endregion
|
|
76
|
+
export { type AdapterFiltersFeature, ElementChecklistFilter as ChecklistFilter, type ChecklistFilterProps, type FilterDef, _default as FilterField, type FilterFieldOptions, type FilterOption, ElementFilterTree as FilterTreeBuilder, type FilterTreeBuilderProps, type FilterTypeSpec, type FilterWidget, type FiltersOptions, booleanFilterWidget, checklistFilterWidget, filterTypes, filters, filtersWith, multiSelectFilterWidget, rangeFilterWidget, selectFilterWidget, textFilterWidget };
|
|
77
|
+
//# sourceMappingURL=filters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.d.ts","names":[],"sources":["../src/filters/ElementChecklistFilter.ts","../src/filters/ElementFilterField.vue","../src/filters/ElementFilterTree.ts","../src/filters/widgets.ts","../src/filters.ts"],"mappings":";;;;;;cA+Ea,0BACqB,MAAI,OAC3B,uBAAqB,OAAK,SACxB,KAAK,yCAAsB,oBAAA,4BAAA;;;;;;;cCzClC,eAAiB,MACtB,aAAa,YAAY,eAAe,wBACxC,YAAY,oBAAoB,KAAK,YAAY,eAAe,6CAChE,gBAAgB,YAAY,eAAe,yBAC3C,cAAA;EAmDO,qBAAc,cAAc,oBAAmB,qBAAA;IAjDM,aAAA;eAiDwB;IAAqB,4BAA4B;MAAM;EACnI,SAAC;EACF;EACA;EACD;qBAGmB;EAAU,QAAQ,YAAY,eAAe;;cAClD,iBAAO;KACvB,oBAAoB,MAAM,mBAAmB,WAAW,IAAI,EAAE,WAAW,WAAW,KAAK,IAAI,EAAE;;;;cCoCvF,qBACgB,MAAI,OACtB,yBAAuB,OAAK,SAC1B,KAAK,yCAAsB,oBAAA,4BAAA;;;;;;;;;;;;;;;;;;cClH3B,kBAAgB;;cAEhB,qBAAmB;;cAGnB,oBAAkB;;cAElB,yBAAuB;;cAGvB,uBAAuB;;cAKvB,mBAAiB;;;;;;;;;;;;iBCjBd,YACd,kBAAkB,mBACjB;;cAcU,SAAO"}
|
package/dist/filters.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as filters, r as
|
|
2
|
-
import {
|
|
3
|
-
export { ElementChecklistFilter as ChecklistFilter, _sfc_main as FilterField, ElementFilterTree as FilterTreeBuilder, filterTypes, filters };
|
|
1
|
+
import { a as checklistFilterWidget, c as selectFilterWidget, i as booleanFilterWidget, l as textFilterWidget, n as filters, o as multiSelectFilterWidget, r as filtersWith, s as rangeFilterWidget, t as filterTypes, u as ElementFilterTree } from "./filters-CIQ1uMZw.js";
|
|
2
|
+
import { r as ElementChecklistFilter, t as _sfc_main } from "./ElementFilterField-C8EJjVB_.js";
|
|
3
|
+
export { ElementChecklistFilter as ChecklistFilter, _sfc_main as FilterField, ElementFilterTree as FilterTreeBuilder, booleanFilterWidget, checklistFilterWidget, filterTypes, filters, filtersWith, multiSelectFilterWidget, rangeFilterWidget, selectFilterWidget, textFilterWidget };
|