@silver-formily/element-plus 0.0.1-alpha.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/LICENSE +21 -0
- package/README.md +31 -0
- package/esm/__builtins__/configs/index.d.ts +1 -0
- package/esm/__builtins__/configs/index.mjs +5 -0
- package/esm/__builtins__/configs/index.mjs.map +1 -0
- package/esm/__builtins__/index.d.ts +2 -0
- package/esm/__builtins__/index.mjs +27 -0
- package/esm/__builtins__/index.mjs.map +1 -0
- package/esm/__builtins__/shared/hooks.d.ts +7 -0
- package/esm/__builtins__/shared/hooks.mjs +59 -0
- package/esm/__builtins__/shared/hooks.mjs.map +1 -0
- package/esm/__builtins__/shared/index.d.ts +7 -0
- package/esm/__builtins__/shared/index.mjs +25 -0
- package/esm/__builtins__/shared/index.mjs.map +1 -0
- package/esm/__builtins__/shared/load-config-provider.d.ts +2 -0
- package/esm/__builtins__/shared/load-config-provider.mjs +13 -0
- package/esm/__builtins__/shared/load-config-provider.mjs.map +1 -0
- package/esm/__builtins__/shared/loading.d.ts +12 -0
- package/esm/__builtins__/shared/loading.mjs +49 -0
- package/esm/__builtins__/shared/loading.mjs.map +1 -0
- package/esm/__builtins__/shared/simple-version-compare.d.ts +2 -0
- package/esm/__builtins__/shared/simple-version-compare.mjs +18 -0
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -0
- package/esm/__builtins__/shared/transform-component.d.ts +8 -0
- package/esm/__builtins__/shared/transform-component.mjs +50 -0
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -0
- package/esm/__builtins__/shared/types.d.ts +2 -0
- package/esm/__builtins__/shared/types.mjs +2 -0
- package/esm/__builtins__/shared/types.mjs.map +1 -0
- package/esm/__builtins__/shared/utils.d.ts +8 -0
- package/esm/__builtins__/shared/utils.mjs +34 -0
- package/esm/__builtins__/shared/utils.mjs.map +1 -0
- package/esm/array-base/array-base-addition.d.ts +5 -0
- package/esm/array-base/array-base-index.d.ts +19 -0
- package/esm/array-base/array-base-inner.d.ts +18 -0
- package/esm/array-base/array-base-item.d.ts +18 -0
- package/esm/array-base/array-base-move-down.d.ts +18 -0
- package/esm/array-base/array-base-move-up.d.ts +18 -0
- package/esm/array-base/array-base-remove.d.ts +18 -0
- package/esm/array-base/array-base-sort-handle.d.ts +2 -0
- package/esm/array-base/index.d.ts +114 -0
- package/esm/array-base/index.mjs +225 -0
- package/esm/array-base/index.mjs.map +1 -0
- package/esm/array-base/symbols.d.ts +4 -0
- package/esm/array-base/symbols.mjs +6 -0
- package/esm/array-base/symbols.mjs.map +1 -0
- package/esm/array-base/types.d.ts +28 -0
- package/esm/array-base/types.mjs +2 -0
- package/esm/array-base/types.mjs.map +1 -0
- package/esm/array-base/utils.d.ts +18 -0
- package/esm/array-base/utils.mjs +88 -0
- package/esm/array-base/utils.mjs.map +1 -0
- package/esm/array-cards/array-cards.d.ts +13 -0
- package/esm/array-cards/index.d.ts +122 -0
- package/esm/array-cards/index.mjs +119 -0
- package/esm/array-cards/index.mjs.map +1 -0
- package/esm/array-collapse/array-collapse-item.d.ts +18 -0
- package/esm/array-collapse/array-collapse.d.ts +16 -0
- package/esm/array-collapse/index.d.ts +134 -0
- package/esm/array-collapse/index.mjs +180 -0
- package/esm/array-collapse/index.mjs.map +1 -0
- package/esm/array-collapse/utils.d.ts +1 -0
- package/esm/array-collapse/utils.mjs +12 -0
- package/esm/array-collapse/utils.mjs.map +1 -0
- package/esm/array-items/array-items-item.d.ts +30 -0
- package/esm/array-items/array-items.d.ts +2 -0
- package/esm/array-items/index.d.ts +130 -0
- package/esm/array-items/index.mjs +105 -0
- package/esm/array-items/index.mjs.map +1 -0
- package/esm/array-list-tabs/array-list-tabs.d.ts +31 -0
- package/esm/array-list-tabs/index.d.ts +83 -0
- package/esm/array-list-tabs/index.mjs +183 -0
- package/esm/array-list-tabs/index.mjs.map +1 -0
- package/esm/array-list-tabs/utils.d.ts +3 -0
- package/esm/array-list-tabs/utils.mjs +16 -0
- package/esm/array-list-tabs/utils.mjs.map +1 -0
- package/esm/array-table/index.mjs +230 -0
- package/esm/array-table/index.mjs.map +1 -0
- package/esm/array-table/types.d.ts +6 -0
- package/esm/array-table/types.mjs +2 -0
- package/esm/array-table/types.mjs.map +1 -0
- package/esm/array-table/utils.d.ts +5 -0
- package/esm/array-table/utils.mjs +26 -0
- package/esm/array-table/utils.mjs.map +1 -0
- package/esm/array-tabs/array-tabs.d.ts +2 -0
- package/esm/array-tabs/index.d.ts +2 -0
- package/esm/array-tabs/index.mjs +88 -0
- package/esm/array-tabs/index.mjs.map +1 -0
- package/esm/cascader/cascader.d.ts +30 -0
- package/esm/cascader/index.d.ts +41 -0
- package/esm/cascader/index.mjs +54 -0
- package/esm/cascader/index.mjs.map +1 -0
- package/esm/checkbox/checkbox-group.d.ts +58 -0
- package/esm/checkbox/index.d.ts +716 -0
- package/esm/checkbox/index.mjs +86 -0
- package/esm/checkbox/index.mjs.map +1 -0
- package/esm/date-picker/index.d.ts +2 -0
- package/esm/date-picker/index.mjs +57 -0
- package/esm/date-picker/index.mjs.map +1 -0
- package/esm/editable/editable-popover.d.ts +25 -0
- package/esm/editable/editable.d.ts +187 -0
- package/esm/editable/index.d.ts +147 -0
- package/esm/editable/index.mjs +231 -0
- package/esm/editable/index.mjs.map +1 -0
- package/esm/form/form.d.ts +46 -0
- package/esm/form/form.mjs +77 -0
- package/esm/form/form.mjs.map +1 -0
- package/esm/form/index.d.ts +1 -0
- package/esm/form/index.mjs +6 -0
- package/esm/form/index.mjs.map +1 -0
- package/esm/form-button-group/form-button-group-sticky.d.ts +17 -0
- package/esm/form-button-group/form-button-group.d.ts +48 -0
- package/esm/form-button-group/index.d.ts +87 -0
- package/esm/form-button-group/index.mjs +90 -0
- package/esm/form-button-group/index.mjs.map +1 -0
- package/esm/form-button-group/utils.d.ts +1 -0
- package/esm/form-button-group/utils.mjs +12 -0
- package/esm/form-button-group/utils.mjs.map +1 -0
- package/esm/form-collapse/form-collapse.d.ts +18 -0
- package/esm/form-collapse/index.d.ts +45 -0
- package/esm/form-collapse/index.mjs +103 -0
- package/esm/form-collapse/index.mjs.map +1 -0
- package/esm/form-collapse/utils.d.ts +31 -0
- package/esm/form-collapse/utils.mjs +54 -0
- package/esm/form-collapse/utils.mjs.map +1 -0
- package/esm/form-dialog/dialog-content.d.ts +60 -0
- package/esm/form-dialog/index.d.ts +4 -0
- package/esm/form-dialog/index.mjs +209 -0
- package/esm/form-dialog/index.mjs.map +1 -0
- package/esm/form-dialog/types.d.ts +32 -0
- package/esm/form-dialog/types.mjs +2 -0
- package/esm/form-dialog/types.mjs.map +1 -0
- package/esm/form-drawer/drawer-content.d.ts +60 -0
- package/esm/form-drawer/index.d.ts +4 -0
- package/esm/form-drawer/index.mjs +203 -0
- package/esm/form-drawer/index.mjs.map +1 -0
- package/esm/form-drawer/types.d.ts +32 -0
- package/esm/form-drawer/types.mjs +2 -0
- package/esm/form-drawer/types.mjs.map +1 -0
- package/esm/form-grid/form-grid-column.d.ts +29 -0
- package/esm/form-grid/form-grid.d.ts +101 -0
- package/esm/form-grid/hooks.d.ts +4 -0
- package/esm/form-grid/hooks.mjs +7 -0
- package/esm/form-grid/hooks.mjs.map +1 -0
- package/esm/form-grid/index.d.ts +182 -0
- package/esm/form-grid/index.mjs +106 -0
- package/esm/form-grid/index.mjs.map +1 -0
- package/esm/form-item/form-item.d.ts +18 -0
- package/esm/form-item/index.d.ts +70 -0
- package/esm/form-item/index.mjs +346 -0
- package/esm/form-item/index.mjs.map +1 -0
- package/esm/form-item/types.d.ts +25 -0
- package/esm/form-item/types.mjs +2 -0
- package/esm/form-item/types.mjs.map +1 -0
- package/esm/form-item/utils.d.ts +3 -0
- package/esm/form-item/utils.mjs +18 -0
- package/esm/form-item/utils.mjs.map +1 -0
- package/esm/form-layout/form-layout.d.ts +32 -0
- package/esm/form-layout/form-layout.mjs +86 -0
- package/esm/form-layout/form-layout.mjs.map +1 -0
- package/esm/form-layout/index.d.ts +1 -0
- package/esm/form-layout/index.mjs +6 -0
- package/esm/form-layout/index.mjs.map +1 -0
- package/esm/form-layout/types.d.ts +43 -0
- package/esm/form-layout/types.mjs +2 -0
- package/esm/form-layout/types.mjs.map +1 -0
- package/esm/form-layout/utils.d.ts +57 -0
- package/esm/form-layout/utils.mjs +109 -0
- package/esm/form-layout/utils.mjs.map +1 -0
- package/esm/form-step/form-step-pane.d.ts +2 -0
- package/esm/form-step/form-step.d.ts +5 -0
- package/esm/form-step/index.d.ts +24 -0
- package/esm/form-step/index.mjs +96 -0
- package/esm/form-step/index.mjs.map +1 -0
- package/esm/form-step/types.d.ts +21 -0
- package/esm/form-step/types.mjs +2 -0
- package/esm/form-step/types.mjs.map +1 -0
- package/esm/form-step/utils.d.ts +11 -0
- package/esm/form-step/utils.mjs +66 -0
- package/esm/form-step/utils.mjs.map +1 -0
- package/esm/form-tab/form-tab.d.ts +7 -0
- package/esm/form-tab/hooks.d.ts +7 -0
- package/esm/form-tab/hooks.mjs +32 -0
- package/esm/form-tab/hooks.mjs.map +1 -0
- package/esm/form-tab/index.d.ts +28 -0
- package/esm/form-tab/index.mjs +80 -0
- package/esm/form-tab/index.mjs.map +1 -0
- package/esm/form-tab/types.d.ts +12 -0
- package/esm/form-tab/types.mjs +2 -0
- package/esm/form-tab/types.mjs.map +1 -0
- package/esm/form-tab/utils.d.ts +4 -0
- package/esm/form-tab/utils.mjs +14 -0
- package/esm/form-tab/utils.mjs.map +1 -0
- package/esm/index.d.ts +37 -0
- package/esm/index.mjs +81 -0
- package/esm/index.mjs.map +1 -0
- package/esm/input/index.d.ts +84 -0
- package/esm/input/index.mjs +77 -0
- package/esm/input/index.mjs.map +1 -0
- package/esm/input/input.d.ts +32 -0
- package/esm/input-number/index.d.ts +4 -0
- package/esm/input-number/index.mjs +30 -0
- package/esm/input-number/index.mjs.map +1 -0
- package/esm/pagination/components/jumper.d.ts +16 -0
- package/esm/pagination/components/jumper.mjs +12 -0
- package/esm/pagination/components/jumper.mjs.map +1 -0
- package/esm/pagination/components/next.d.ts +42 -0
- package/esm/pagination/components/next.mjs +23 -0
- package/esm/pagination/components/next.mjs.map +1 -0
- package/esm/pagination/components/pager.d.ts +42 -0
- package/esm/pagination/components/pager.mjs +23 -0
- package/esm/pagination/components/pager.mjs.map +1 -0
- package/esm/pagination/components/prev.d.ts +39 -0
- package/esm/pagination/components/prev.mjs +22 -0
- package/esm/pagination/components/prev.mjs.map +1 -0
- package/esm/pagination/components/sizes.d.ts +56 -0
- package/esm/pagination/components/sizes.mjs +7 -0
- package/esm/pagination/components/sizes.mjs.map +1 -0
- package/esm/pagination/components/total.d.ts +8 -0
- package/esm/pagination/components/total.mjs +11 -0
- package/esm/pagination/components/total.mjs.map +1 -0
- package/esm/pagination/pagination.d.ts +128 -0
- package/esm/pagination/pagination.mjs +631 -0
- package/esm/pagination/pagination.mjs.map +1 -0
- package/esm/password/index.d.ts +86 -0
- package/esm/password/index.mjs +14 -0
- package/esm/password/index.mjs.map +1 -0
- package/esm/preview-text/cascader.d.ts +5 -0
- package/esm/preview-text/date-picker.d.ts +5 -0
- package/esm/preview-text/index.d.ts +102 -0
- package/esm/preview-text/index.mjs +321 -0
- package/esm/preview-text/index.mjs.map +1 -0
- package/esm/preview-text/input.d.ts +28 -0
- package/esm/preview-text/preview.d.ts +18 -0
- package/esm/preview-text/select.d.ts +5 -0
- package/esm/preview-text/time-picker.d.ts +5 -0
- package/esm/preview-text/tree.d.ts +22 -0
- package/esm/preview-text/utils.d.ts +14 -0
- package/esm/preview-text/utils.mjs +16 -0
- package/esm/preview-text/utils.mjs.map +1 -0
- package/esm/radio/index.d.ts +634 -0
- package/esm/radio/index.mjs +80 -0
- package/esm/radio/index.mjs.map +1 -0
- package/esm/radio/radio-group.d.ts +44 -0
- package/esm/reset/index.d.ts +63 -0
- package/esm/reset/index.mjs +48 -0
- package/esm/reset/index.mjs.map +1 -0
- package/esm/reset/reset.d.ts +45 -0
- package/esm/select/index.d.ts +142 -0
- package/esm/select/index.mjs +132 -0
- package/esm/select/index.mjs.map +1 -0
- package/esm/select/select.d.ts +50 -0
- package/esm/select-table/index.mjs +204 -0
- package/esm/select-table/index.mjs.map +1 -0
- package/esm/select-table/types.d.ts +14 -0
- package/esm/select-table/types.mjs +2 -0
- package/esm/select-table/types.mjs.map +1 -0
- package/esm/space/index.d.ts +1 -0
- package/esm/space/index.mjs +6 -0
- package/esm/space/index.mjs.map +1 -0
- package/esm/styles/array-base/index.css +1 -0
- package/esm/styles/array-cards/index.css +1 -0
- package/esm/styles/array-collapse/index.css +1 -0
- package/esm/styles/array-items/index.css +1 -0
- package/esm/styles/array-list-tabs/index.css +1 -0
- package/esm/styles/array-table/index.css +1 -0
- package/esm/styles/array-tabs/index.css +1 -0
- package/esm/styles/editable/index.css +1 -0
- package/esm/styles/form-button-group/index.css +1 -0
- package/esm/styles/form-collapse/index.css +1 -0
- package/esm/styles/form-grid/index.css +1 -0
- package/esm/styles/form-item/index.css +1 -0
- package/esm/styles/form-tab/index.css +1 -0
- package/esm/styles/preview-text/index.css +1 -0
- package/esm/styles/radio/index.css +1 -0
- package/esm/styles/select-table/index.css +1 -0
- package/esm/submit/index.d.ts +48 -0
- package/esm/submit/index.mjs +47 -0
- package/esm/submit/index.mjs.map +1 -0
- package/esm/submit/submit.d.ts +36 -0
- package/esm/switch/index.d.ts +4 -0
- package/esm/switch/index.mjs +19 -0
- package/esm/switch/index.mjs.map +1 -0
- package/esm/time-picker/index.d.ts +4 -0
- package/esm/time-picker/index.mjs +21 -0
- package/esm/time-picker/index.mjs.map +1 -0
- package/esm/time-select/index.d.ts +2 -0
- package/esm/time-select/index.mjs +21 -0
- package/esm/time-select/index.mjs.map +1 -0
- package/esm/transfer/index.d.ts +1509 -0
- package/esm/transfer/index.mjs +11 -0
- package/esm/transfer/index.mjs.map +1 -0
- package/esm/tree/index.d.ts +42 -0
- package/esm/tree/index.mjs +105 -0
- package/esm/tree/index.mjs.map +1 -0
- package/esm/tree/tree.d.ts +20 -0
- package/esm/tree/types.d.ts +13 -0
- package/esm/tree/types.mjs +2 -0
- package/esm/tree/types.mjs.map +1 -0
- package/esm/tree/utils.d.ts +45 -0
- package/esm/tree/utils.mjs +161 -0
- package/esm/tree/utils.mjs.map +1 -0
- package/esm/tree-select/index.d.ts +32 -0
- package/esm/tree-select/index.mjs +51 -0
- package/esm/tree-select/index.mjs.map +1 -0
- package/esm/tree-select/tree-select.d.ts +17 -0
- package/esm/upload/index.d.ts +889 -0
- package/esm/upload/index.mjs +185 -0
- package/esm/upload/index.mjs.map +1 -0
- package/esm/upload/upload.d.ts +1613 -0
- package/esm/vendor/icon.mjs +11 -0
- package/esm/vendor/icon.mjs.map +1 -0
- package/esm/vendor/lodash.mjs +1400 -0
- package/esm/vendor/lodash.mjs.map +1 -0
- package/esm/vendor/runtime.mjs +29 -0
- package/esm/vendor/runtime.mjs.map +1 -0
- package/esm/vendor/shared.esm-bundler.mjs +14 -0
- package/esm/vendor/shared.esm-bundler.mjs.map +1 -0
- package/esm/vendor/sizes.mjs +27 -0
- package/esm/vendor/sizes.mjs.map +1 -0
- package/esm/vendor/types.mjs +19 -0
- package/esm/vendor/types.mjs.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { stylePrefix as i } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "element-plus";
|
|
4
|
+
import "@formily/reactive";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import "@formily/reactive-vue";
|
|
7
|
+
import "@formily/vue";
|
|
8
|
+
const u = `${i}-array-list-tabs`;
|
|
9
|
+
function l(r, t) {
|
|
10
|
+
return r.type !== "void" ? r.name === t : r.properties ? t in r.properties : !1;
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
l as isTabTitleComponent,
|
|
14
|
+
u as prefixCls
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/array-list-tabs/utils.ts"],"sourcesContent":["import type { ISchema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\n\nexport const prefixCls = `${stylePrefix}-array-list-tabs`\n\nexport function isTabTitleComponent(schema: ISchema, tabTitleField: string) {\n if (schema.type !== 'void') {\n return schema.name === tabTitleField\n }\n if (schema.properties) {\n return tabTitleField in schema.properties\n }\n return false\n}\n"],"names":["prefixCls","stylePrefix","isTabTitleComponent","schema","tabTitleField"],"mappings":";;;;;;;AAGO,MAAMA,IAAY,GAAGC,CAAW;AAEhC,SAASC,EAAoBC,GAAiBC,GAAuB;AAC1E,SAAID,EAAO,SAAS,SACXA,EAAO,SAASC,IAErBD,EAAO,aACFC,KAAiBD,EAAO,aAE1B;AACT;"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { defineComponent as W, computed as B, ref as g, watch as ee, createElementBlock as f, openBlock as n, normalizeClass as N, unref as t, createBlock as i, withCtx as v, createVNode as re, createCommentVNode as A, withDirectives as ae, mergeProps as b, Fragment as k, renderList as _, resolveDynamicComponent as te, createElementVNode as ne, createTextVNode as oe, toDisplayString as le, nextTick as se } from "vue";
|
|
2
|
+
import { ElTable as ue, ElTableColumn as ie, vLoading as pe } from "element-plus";
|
|
3
|
+
import { reaction as ce, autorun as de, observable as S } from "@formily/reactive";
|
|
4
|
+
import "@formily/core";
|
|
5
|
+
import "@formily/reactive-vue";
|
|
6
|
+
import { useField as me, useFieldSchema as fe, RecursionField as R } from "@formily/vue";
|
|
7
|
+
import { useCleanAttrs as ve, composeExport as ye } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { ArrayBase as s } from "../array-base/index.mjs";
|
|
9
|
+
import { isEqual as ge, isArr as w } from "@formily/shared";
|
|
10
|
+
import { VueDraggable as be } from "vue-draggable-plus";
|
|
11
|
+
import { stylePrefix as ke } from "../__builtins__/configs/index.mjs";
|
|
12
|
+
import { isAdditionComponent as xe } from "../array-base/utils.mjs";
|
|
13
|
+
import he from "../pagination/pagination.mjs";
|
|
14
|
+
import { isColumnComponent as U, prefixCls as E, isTableComponent as Pe, hasRequiredProperty as Ce } from "./utils.mjs";
|
|
15
|
+
import { o as Te } from "../vendor/lodash.mjs";
|
|
16
|
+
import '../styles/array-table/index.css';const Ae = { key: 1 }, _e = /* @__PURE__ */ W({
|
|
17
|
+
name: "FArrayTable",
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
__name: "array-table",
|
|
20
|
+
props: {
|
|
21
|
+
value: { default: () => [] },
|
|
22
|
+
pagination: { type: Boolean, default: !0 },
|
|
23
|
+
paginationProps: null
|
|
24
|
+
},
|
|
25
|
+
setup(V) {
|
|
26
|
+
var F, M;
|
|
27
|
+
const c = V, { props: $ } = ve(), H = B(() => Te(c.paginationProps, ["pageSize", "currentPage"])), x = me(), u = x.value, h = fe(), { getKey: P, keyMap: K } = s.useKey(h.value), I = g();
|
|
28
|
+
function q(e) {
|
|
29
|
+
return Pe(e) ? L(e) : e.properties ? Object.values(e.properties).flatMap((a) => q(a)) : [];
|
|
30
|
+
}
|
|
31
|
+
function L(e) {
|
|
32
|
+
var l, o;
|
|
33
|
+
const a = ((l = e["x-component-props"]) == null ? void 0 : l.prop) || e.name;
|
|
34
|
+
/* istanbul ignore if -- @preserve */
|
|
35
|
+
if (!a)
|
|
36
|
+
return [];
|
|
37
|
+
const r = x.value.query(x.value.address.concat(a)).take();
|
|
38
|
+
return [{
|
|
39
|
+
name: a,
|
|
40
|
+
display: (r == null ? void 0 : r.display) || e["x-display"],
|
|
41
|
+
required: Ce(e),
|
|
42
|
+
field: r,
|
|
43
|
+
fieldProps: (r == null ? void 0 : r.props) || e.toFieldProps(),
|
|
44
|
+
schema: e,
|
|
45
|
+
columnProps: ((o = r == null ? void 0 : r.component) == null ? void 0 : o[1]) || e["x-component-props"] || {}
|
|
46
|
+
}];
|
|
47
|
+
}
|
|
48
|
+
const C = g(0);
|
|
49
|
+
ce(() => {
|
|
50
|
+
const e = u.path.entire;
|
|
51
|
+
return u.query(`${e}.*`).map((a) => ({
|
|
52
|
+
name: a.component[0],
|
|
53
|
+
visible: a.visible
|
|
54
|
+
})).filter((a) => a.name.includes("Column"));
|
|
55
|
+
}, async () => {
|
|
56
|
+
C.value++;
|
|
57
|
+
}, { equals: ge });
|
|
58
|
+
const y = g([]), d = g(((F = c.paginationProps) == null ? void 0 : F.pageSize) ?? 10), p = g(((M = c.paginationProps) == null ? void 0 : M.currentPage) ?? 1);
|
|
59
|
+
function z() {
|
|
60
|
+
if (!w(u.value)) {
|
|
61
|
+
y.value = [];
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (c.pagination === !1) {
|
|
65
|
+
y.value = [...u.value];
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
y.value = u.value.slice((p.value - 1) * d.value, p.value * d.value);
|
|
69
|
+
}
|
|
70
|
+
ee([d, p], z), de(z);
|
|
71
|
+
const T = S.computed(() => {
|
|
72
|
+
const e = h.value.items;
|
|
73
|
+
return (w(e) ? e : [e]).reduce((r, l) => {
|
|
74
|
+
const o = q(l);
|
|
75
|
+
return r.concat(o);
|
|
76
|
+
}, []).filter((r) => r.display !== "none");
|
|
77
|
+
}), j = S.computed(() => T.value.map((e, a) => ({ source: e, index: a })).filter(({ source: e }) => e.display === "visible" && U(e.schema)).map(({ source: e, index: a }) => {
|
|
78
|
+
const { name: r, columnProps: l, required: o, field: m } = e, { title: Q, asterisk: X, ...Y } = l, Z = {
|
|
79
|
+
label: Q,
|
|
80
|
+
...Y,
|
|
81
|
+
prop: r
|
|
82
|
+
};
|
|
83
|
+
return {
|
|
84
|
+
key: a,
|
|
85
|
+
props: Z,
|
|
86
|
+
field: m,
|
|
87
|
+
asterisk: X ?? o
|
|
88
|
+
};
|
|
89
|
+
})), G = S.computed(() => T.value.filter((e) => e.display !== "none" && U(e.schema))), D = B(() => (p.value - 1) * d.value);
|
|
90
|
+
async function J() {
|
|
91
|
+
var e;
|
|
92
|
+
if (c.pagination === !1) {
|
|
93
|
+
await se();
|
|
94
|
+
const a = (e = I.value) == null ? void 0 : e.$el.querySelector(".el-scrollbar__wrap");
|
|
95
|
+
a == null || a.scrollTo({
|
|
96
|
+
top: a.scrollHeight,
|
|
97
|
+
behavior: "smooth"
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!w(u.value)) {
|
|
102
|
+
p.value = 1;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
p.value = Math.ceil(u.value.length / d.value);
|
|
106
|
+
}
|
|
107
|
+
async function O(e) {
|
|
108
|
+
const { oldIndex: a, newIndex: r } = e;
|
|
109
|
+
await u.move(a, r), C.value++;
|
|
110
|
+
}
|
|
111
|
+
return (e, a) => (n(), f("div", {
|
|
112
|
+
class: N(t(E))
|
|
113
|
+
}, [
|
|
114
|
+
(n(), i(t(s), {
|
|
115
|
+
key: C.value,
|
|
116
|
+
"key-map": t(K),
|
|
117
|
+
add: J
|
|
118
|
+
}, {
|
|
119
|
+
default: v(() => [
|
|
120
|
+
re(t(be), {
|
|
121
|
+
"model-value": y.value,
|
|
122
|
+
target: "tbody",
|
|
123
|
+
handle: `.${t(ke)}-array-base-sort-handle`,
|
|
124
|
+
animation: 150,
|
|
125
|
+
onEnd: O
|
|
126
|
+
}, {
|
|
127
|
+
default: v(() => [
|
|
128
|
+
ae((n(), i(t(ue), b({
|
|
129
|
+
ref_key: "elTableRef",
|
|
130
|
+
ref: I,
|
|
131
|
+
"row-key": t(P),
|
|
132
|
+
data: y.value
|
|
133
|
+
}, t($)), {
|
|
134
|
+
default: v(() => [
|
|
135
|
+
(n(!0), f(k, null, _(t(j).value, (r, l) => (n(), i(t(ie), b({
|
|
136
|
+
key: r.key,
|
|
137
|
+
ref_for: !0
|
|
138
|
+
}, r.props), {
|
|
139
|
+
default: v(({ row: o, $index: m }) => [
|
|
140
|
+
(n(), i(t(s).Item, {
|
|
141
|
+
key: t(P)(o),
|
|
142
|
+
index: m + D.value,
|
|
143
|
+
record: o
|
|
144
|
+
}, {
|
|
145
|
+
default: v(() => [
|
|
146
|
+
(n(), i(t(R), {
|
|
147
|
+
key: `${t(P)(o)}`,
|
|
148
|
+
schema: t(T).value[l].schema,
|
|
149
|
+
name: m + D.value,
|
|
150
|
+
"only-render-properties": ""
|
|
151
|
+
}, null, 8, ["schema", "name"]))
|
|
152
|
+
]),
|
|
153
|
+
_: 2
|
|
154
|
+
}, 1032, ["index", "record"]))
|
|
155
|
+
]),
|
|
156
|
+
header: v(({ column: o }) => {
|
|
157
|
+
var m;
|
|
158
|
+
return [
|
|
159
|
+
(m = r.field.content) != null && m.header ? (n(), i(te(r.field.content.header), b({
|
|
160
|
+
key: 0,
|
|
161
|
+
ref_for: !0
|
|
162
|
+
}, { ...o, field: t(u) }), null, 16)) : r.asterisk ? (n(), f("span", Ae, [
|
|
163
|
+
ne("span", {
|
|
164
|
+
class: N(`${t(E)}-asterisk`)
|
|
165
|
+
}, "*", 2),
|
|
166
|
+
oe(" " + le(o.label), 1)
|
|
167
|
+
])) : A("", !0)
|
|
168
|
+
];
|
|
169
|
+
}),
|
|
170
|
+
_: 2
|
|
171
|
+
}, 1040))), 128))
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}, 16, ["row-key", "data"])), [
|
|
175
|
+
[t(pe), t(u).loading]
|
|
176
|
+
])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 8, ["model-value", "handle"]),
|
|
180
|
+
(n(!0), f(k, null, _(t(G).value, (r, l) => (n(), i(t(R), {
|
|
181
|
+
key: l,
|
|
182
|
+
name: r.name,
|
|
183
|
+
schema: r.schema,
|
|
184
|
+
"only-render-self": !0
|
|
185
|
+
}, null, 8, ["name", "schema"]))), 128)),
|
|
186
|
+
c.pagination ? (n(), i(t(he), b({
|
|
187
|
+
key: 0,
|
|
188
|
+
"current-page": p.value,
|
|
189
|
+
"onUpdate:currentPage": a[0] || (a[0] = (r) => p.value = r),
|
|
190
|
+
"page-size": d.value,
|
|
191
|
+
"onUpdate:pageSize": a[1] || (a[1] = (r) => d.value = r),
|
|
192
|
+
class: `${t(E)}-pagination`,
|
|
193
|
+
background: "",
|
|
194
|
+
layout: "total, sizes, prev, pager, next",
|
|
195
|
+
total: c.value.length
|
|
196
|
+
}, H.value), null, 16, ["current-page", "page-size", "class", "total"])) : A("", !0),
|
|
197
|
+
(n(!0), f(k, null, _(t(h).properties, (r, l) => (n(), f(k, { key: l }, [
|
|
198
|
+
t(xe)(r) ? (n(), i(t(R), {
|
|
199
|
+
key: 0,
|
|
200
|
+
schema: r,
|
|
201
|
+
name: "addition"
|
|
202
|
+
}, null, 8, ["schema"])) : A("", !0)
|
|
203
|
+
], 64))), 128))
|
|
204
|
+
]),
|
|
205
|
+
_: 1
|
|
206
|
+
}, 8, ["key-map"]))
|
|
207
|
+
], 2));
|
|
208
|
+
}
|
|
209
|
+
}), Se = {
|
|
210
|
+
name: "FArrayTableColumn",
|
|
211
|
+
render() {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}, Ke = ye(_e, {
|
|
215
|
+
Column: Se,
|
|
216
|
+
Index: s.Index,
|
|
217
|
+
SortHandle: s.SortHandle,
|
|
218
|
+
Addition: s.Addition,
|
|
219
|
+
Remove: s.Remove,
|
|
220
|
+
MoveDown: s.MoveDown,
|
|
221
|
+
MoveUp: s.MoveUp,
|
|
222
|
+
useArray: s.useArray,
|
|
223
|
+
useIndex: s.useIndex,
|
|
224
|
+
useRecord: s.useRecord
|
|
225
|
+
});
|
|
226
|
+
export {
|
|
227
|
+
Ke as ArrayTable,
|
|
228
|
+
Ke as default
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-table/array-table.vue","../../src/array-table/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ArrayField } from '@formily/core'\nimport type { Schema } from '@formily/vue'\nimport type { TableInstance } from 'element-plus'\nimport type { IArrayTableProps } from './types'\nimport { autorun, observable, reaction } from '@formily/reactive'\nimport { isArr, isEqual } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport { ElTable, ElTableColumn, vLoading } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { computed, nextTick, ref, watch } from 'vue'\nimport { VueDraggable } from 'vue-draggable-plus'\nimport { stylePrefix, useCleanAttrs } from '../__builtins__'\nimport { ArrayBase } from '../array-base'\nimport { isAdditionComponent } from '../array-base/utils'\nimport ElPagination from '../pagination/pagination'\nimport { hasRequiredProperty, isColumnComponent, isTableComponent, prefixCls } from './utils'\n\ndefineOptions({\n name: 'FArrayTable',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: { default: () => [] },\n pagination: { type: Boolean, default: true },\n paginationProps: null\n})\nconst { props: elTableProps } = useCleanAttrs()\nconst paginationProps = computed(() => omit(props.paginationProps, ['pageSize', 'currentPage']))\nconst fieldRef = useField<ArrayField>()\nconst field = fieldRef.value\nconst schemaRef = useFieldSchema()\nconst { getKey, keyMap } = ArrayBase.useKey(schemaRef.value)\n\nconst elTableRef = ref<TableInstance>()\n\nfunction extractTableSources(schema: Schema): any[] {\n if (isTableComponent(schema)) {\n return createTableSource(schema)\n }\n return schema.properties\n ? Object.values(schema.properties).flatMap(element => extractTableSources(element))\n : []\n}\n\nfunction createTableSource(schema: Schema): any[] {\n const propName = schema['x-component-props']?.prop || schema.name\n /* istanbul ignore if -- @preserve */\n if (!propName)\n return []\n\n const field = fieldRef.value.query(fieldRef.value.address.concat(propName)).take()\n\n return [{\n name: propName,\n display: field?.display || schema['x-display'],\n required: hasRequiredProperty(schema),\n field,\n fieldProps: field?.props || schema.toFieldProps(),\n schema,\n columnProps: (field?.component as any[])?.[1] || schema['x-component-props'] || {},\n }]\n}\n\nconst triggerUpdateKey = ref(0)\nreaction(() => {\n const path = field.path.entire\n return field.query(`${path}.*`).map((item) => {\n return {\n name: item.component[0],\n visible: item.visible,\n }\n }).filter(item => item.name.includes('Column'))\n}, async () => {\n triggerUpdateKey.value++\n}, { equals: isEqual })\n\nconst dataSource = ref([])\nconst pageSize = ref(props.paginationProps?.pageSize ?? 10)\nconst currentPage = ref(props.paginationProps?.currentPage ?? 1)\n\nfunction updateDataSource() {\n if (!isArr(field.value)) {\n dataSource.value = []\n return\n }\n if (props.pagination === false) {\n dataSource.value = [...field.value]\n return\n }\n dataSource.value = field.value.slice((currentPage.value - 1) * pageSize.value, (currentPage.value) * pageSize.value)\n}\nwatch([pageSize, currentPage], updateDataSource)\nautorun(updateDataSource)\n\nconst sources = observable.computed(() => {\n const schema = schemaRef.value.items\n const items = isArr(schema) ? schema : [schema]\n return items.reduce((columns, schema) => {\n const item = extractTableSources(schema)\n return columns.concat(item)\n }, []).filter(item => item.display !== 'none')\n})\n\nconst columns = observable.computed(() => {\n return sources.value\n .map((source, index) => ({ source, index }))\n .filter(({ source }) => source.display === 'visible' && isColumnComponent(source.schema))\n .map(({ source, index: key }) => {\n const { name, columnProps, required, field } = source\n const { title, asterisk, ...restProps } = columnProps\n const props = {\n label: title,\n ...restProps,\n prop: name,\n }\n return {\n key,\n props,\n field,\n asterisk: asterisk ?? required,\n }\n })\n})\n\nconst stateManagerColumns = observable.computed(() => {\n return sources.value.filter((column) => {\n return column.display !== 'none' && isColumnComponent(column.schema)\n })\n})\n\nconst baseIndex = computed(() => {\n return (currentPage.value - 1) * pageSize.value\n})\n\nasync function onAddItemClick() {\n if (props.pagination === false) {\n await nextTick()\n const scrollWarpDOM = elTableRef.value?.$el.querySelector('.el-scrollbar__wrap')\n scrollWarpDOM?.scrollTo({\n top: scrollWarpDOM.scrollHeight,\n behavior: 'smooth',\n })\n return\n }\n if (!isArr(field.value)) {\n currentPage.value = 1\n return\n }\n currentPage.value = Math.ceil(field.value.length / pageSize.value)\n}\n\nasync function handleDragEnd(evt: { oldIndex: number, newIndex: number }) {\n const { oldIndex, newIndex } = evt\n await field.move(oldIndex, newIndex)\n triggerUpdateKey.value++\n}\n</script>\n\n<template>\n <div :class=\"prefixCls\">\n <ArrayBase :key=\"triggerUpdateKey\" :key-map=\"keyMap\" :add=\"onAddItemClick\">\n <VueDraggable\n :model-value=\"dataSource\"\n target=\"tbody\"\n :handle=\"`.${stylePrefix}-array-base-sort-handle`\"\n :animation=\"150\"\n @end=\"handleDragEnd\"\n >\n <ElTable ref=\"elTableRef\" v-loading=\"field.loading\" :row-key=\"getKey\" :data=\"dataSource\" v-bind=\"elTableProps\">\n <template v-for=\"(column, colIndex) of columns.value\" :key=\"column.key\">\n <ElTableColumn v-bind=\"column.props\">\n <template #default=\"{ row, $index }\">\n <ArrayBase.Item :key=\"getKey(row)\" :index=\"$index + baseIndex\" :record=\"row\">\n <RecursionField\n :key=\"`${getKey(row)}`\"\n :schema=\"sources.value[colIndex].schema\"\n :name=\"$index + baseIndex\"\n only-render-properties\n />\n </ArrayBase.Item>\n </template>\n <template #header=\"{ column: col }\">\n <template v-if=\"column.field.content?.header\">\n <component :is=\"column.field.content.header\" v-bind=\"{ ...col, field }\" />\n </template>\n <span v-else-if=\"column.asterisk\">\n <span :class=\"`${prefixCls}-asterisk`\">*</span>\n {{ col.label }}\n </span>\n </template>\n </ElTableColumn>\n </template>\n </ElTable>\n </VueDraggable>\n\n <!-- 状态管理器 -->\n <template v-for=\"(column, key) of stateManagerColumns.value\" :key=\"key\">\n <RecursionField :name=\"column.name\" :schema=\"column.schema\" :only-render-self=\"true\" />\n </template>\n <ElPagination\n v-if=\"props.pagination\"\n v-model:current-page=\"currentPage\"\n v-model:page-size=\"pageSize\"\n :class=\"`${prefixCls}-pagination`\"\n background\n layout=\"total, sizes, prev, pager, next\"\n :total=\"props.value.length\"\n v-bind=\"paginationProps\"\n />\n <template v-for=\"(itemSchema, key) of schemaRef.properties\" :key=\"key\">\n <RecursionField v-if=\"isAdditionComponent(itemSchema)\" :schema=\"itemSchema\" name=\"addition\" />\n </template>\n </ArrayBase>\n </div>\n</template>\n","import type { Component } from 'vue'\nimport { composeExport } from '../__builtins__/shared'\nimport { ArrayBase } from '../array-base'\nimport ArrayTableInner from './array-table.vue'\nimport './style.scss'\n\nconst ArrayTableColumn: Component = {\n name: 'FArrayTableColumn',\n render() {\n return null\n },\n}\n\nexport const ArrayTable = composeExport(ArrayTableInner, {\n Column: ArrayTableColumn,\n Index: ArrayBase.Index,\n SortHandle: ArrayBase.SortHandle,\n Addition: ArrayBase.Addition,\n Remove: ArrayBase.Remove,\n MoveDown: ArrayBase.MoveDown,\n MoveUp: ArrayBase.MoveUp,\n useArray: ArrayBase.useArray,\n useIndex: ArrayBase.useIndex,\n useRecord: ArrayBase.useRecord,\n})\n\nexport default ArrayTable\n"],"names":["props","__props","elTableProps","useCleanAttrs","paginationProps","computed","omit","fieldRef","useField","field","schemaRef","useFieldSchema","getKey","keyMap","ArrayBase","elTableRef","ref","extractTableSources","schema","isTableComponent","createTableSource","element","propName","_a","hasRequiredProperty","triggerUpdateKey","reaction","path","item","isEqual","dataSource","pageSize","currentPage","_b","updateDataSource","isArr","watch","autorun","sources","observable","columns","source","index","isColumnComponent","key","name","columnProps","required","title","asterisk","restProps","stateManagerColumns","column","baseIndex","onAddItemClick","nextTick","scrollWarpDOM","handleDragEnd","evt","oldIndex","newIndex","_createElementBlock","_unref","prefixCls","_createBlock","_createVNode","VueDraggable","stylePrefix","_withDirectives","_openBlock","_mergeProps","_Fragment","colIndex","_withCtx","row","$index","RecursionField","col","_resolveDynamicComponent","_hoisted_1","_createElementVNode","_toDisplayString","vLoading","$event","itemSchema","isAdditionComponent","ArrayTableColumn","ArrayTable","composeExport","ArrayTableInner"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuBA,UAAMA,IAAQC,GAKR,EAAE,OAAOC,EAAA,IAAiBC,GAAA,GAC1BC,IAAkBC,EAAS,MAAMC,GAAKN,EAAM,iBAAiB,CAAC,YAAY,aAAa,CAAC,CAAC,GACzFO,IAAWC,GAAA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AA,YAC7CkB,EAAAuB,EAAA,EAAoBD,CAAU,UAApDpB,EAA8FF,EAAAc,CAAA,GAAA;AAAA;cAAtC,QAAQQ;AAAA,cAAY,MAAK;AAAA,YAAA;;;;;;;IC9MnFE,KAA8B;AAAA,EAClC,MAAM;AAAA,EACN,SAAS;AACP,WAAO;AAAA,EACT;AACF,GAEaC,KAAaC,GAAcC,IAAiB;AAAA,EACvD,QAAQH;AAAA,EACR,OAAOxE,EAAU;AAAA,EACjB,YAAYA,EAAU;AAAA,EACtB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,QAAQA,EAAU;AAAA,EAClB,UAAUA,EAAU;AAAA,EACpB,UAAUA,EAAU;AAAA,EACpB,WAAWA,EAAU;AACvB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Schema } from '@formily/json-schema';
|
|
2
|
+
export declare const prefixCls = "formily-element-plus-array-table";
|
|
3
|
+
export declare function isColumnComponent(schema: Schema): boolean;
|
|
4
|
+
export declare function isTableComponent(schema: Schema): boolean;
|
|
5
|
+
export declare function hasRequiredProperty(schema: Schema): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { stylePrefix as n } from "../__builtins__/configs/index.mjs";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "element-plus";
|
|
4
|
+
import "@formily/reactive";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import "@formily/reactive-vue";
|
|
7
|
+
import "@formily/vue";
|
|
8
|
+
import { isOperationComponent as e, isAdditionComponent as i } from "../array-base/utils.mjs";
|
|
9
|
+
const x = `${n}-array-table`;
|
|
10
|
+
function p(o) {
|
|
11
|
+
var r;
|
|
12
|
+
return ((r = o["x-component"]) == null ? void 0 : r.indexOf("Column")) > -1;
|
|
13
|
+
}
|
|
14
|
+
function c(o) {
|
|
15
|
+
return p(o) || e(o) || i(o);
|
|
16
|
+
}
|
|
17
|
+
function y(o) {
|
|
18
|
+
return o.reduceProperties((r, t) => r || !!t.required, !1);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
y as hasRequiredProperty,
|
|
22
|
+
p as isColumnComponent,
|
|
23
|
+
c as isTableComponent,
|
|
24
|
+
x as prefixCls
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/array-table/utils.ts"],"sourcesContent":["import type { Schema } from '@formily/json-schema'\nimport { stylePrefix } from '../__builtins__'\nimport { isAdditionComponent, isOperationComponent } from '../array-base/utils'\n\nexport const prefixCls = `${stylePrefix}-array-table`\n\nexport function isColumnComponent(schema: Schema) {\n return schema['x-component']?.indexOf('Column') > -1\n}\n\nexport function isTableComponent(schema: Schema): boolean {\n return isColumnComponent(schema) || isOperationComponent(schema) || isAdditionComponent(schema)\n}\n\nexport function hasRequiredProperty(schema: Schema): boolean {\n return schema.reduceProperties((hasRequired, property) =>\n hasRequired || !!property.required, false)\n}\n"],"names":["prefixCls","stylePrefix","isColumnComponent","schema","_a","isTableComponent","isOperationComponent","isAdditionComponent","hasRequiredProperty","hasRequired","property"],"mappings":";;;;;;;;AAIO,MAAMA,IAAY,GAAGC,CAAW;AAEhC,SAASC,EAAkBC,GAAgB;;AAChD,WAAOC,IAAAD,EAAO,aAAa,MAApB,gBAAAC,EAAuB,QAAQ,aAAY;AACpD;AAEO,SAASC,EAAiBF,GAAyB;AACxD,SAAOD,EAAkBC,CAAM,KAAKG,EAAqBH,CAAM,KAAKI,EAAoBJ,CAAM;AAChG;AAEO,SAASK,EAAoBL,GAAyB;AAC3D,SAAOA,EAAO,iBAAiB,CAACM,GAAaC,MAC3CD,KAAe,CAAC,CAACC,EAAS,UAAU,EAAK;AAC7C;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ArrayTabs: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default ArrayTabs;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineComponent as E, ref as f, onUnmounted as F, createBlock as b, openBlock as l, unref as e, mergeProps as _, withCtx as u, createElementBlock as i, Fragment as A, renderList as B, createVNode as v, normalizeClass as N, createTextVNode as P, toDisplayString as h } from "vue";
|
|
2
|
+
import { reaction as R } from "@formily/reactive";
|
|
3
|
+
import { isEqual as S, isFn as y } from "@formily/shared";
|
|
4
|
+
import { useField as q, useFieldSchema as L, RecursionField as U } from "@formily/vue";
|
|
5
|
+
import { ElTabs as V, ElTabPane as w, ElBadge as z } from "element-plus";
|
|
6
|
+
import { stylePrefix as D } from "../__builtins__/configs/index.mjs";
|
|
7
|
+
import "@formily/core";
|
|
8
|
+
import "@formily/reactive-vue";
|
|
9
|
+
import { useCleanAttrs as I } from "../__builtins__/shared/utils.mjs";
|
|
10
|
+
import { getArrayItemSchema as K } from "../array-base/utils.mjs";
|
|
11
|
+
import '../styles/array-tabs/index.css';const j = { key: 0 }, G = { key: 1 }, H = /* @__PURE__ */ E({
|
|
12
|
+
name: "FArrayTabs",
|
|
13
|
+
inheritAttrs: !1,
|
|
14
|
+
__name: "array-tabs",
|
|
15
|
+
setup(J) {
|
|
16
|
+
const $ = q(), g = L(), c = `${D}-array-tabs`, n = f("tab-0"), t = $.value;
|
|
17
|
+
/* istanbul ignore else -- @preserve */
|
|
18
|
+
t.value.length === 0 && t.value.push(null);
|
|
19
|
+
const T = g.value;
|
|
20
|
+
function p(r) {
|
|
21
|
+
return `${t.title || "Untitled"} ${r + 1}`;
|
|
22
|
+
}
|
|
23
|
+
const m = f([]), k = R(() => t.value.map((r, s) => t.form.queryFeedbacks({
|
|
24
|
+
type: "error",
|
|
25
|
+
address: `${t.address.concat(s)}.**`
|
|
26
|
+
}).length), (r) => {
|
|
27
|
+
m.value = r;
|
|
28
|
+
}, {
|
|
29
|
+
equals: S
|
|
30
|
+
});
|
|
31
|
+
F(() => {
|
|
32
|
+
k();
|
|
33
|
+
});
|
|
34
|
+
const { props: C } = I(["value"]);
|
|
35
|
+
return (r, s) => (l(), b(e(V), _(e(C), {
|
|
36
|
+
"model-value": n.value,
|
|
37
|
+
class: c,
|
|
38
|
+
type: "card",
|
|
39
|
+
addable: !0,
|
|
40
|
+
onTabRemove: s[0] || (s[0] = (o) => {
|
|
41
|
+
var d;
|
|
42
|
+
const a = (d = o.toString().match(/tab-(\d+)/)) == null ? void 0 : d[1];
|
|
43
|
+
e(t).remove(Number(a)), n.value === o && (n.value = `tab-${Number(a) - 1}`), e(y)(r.$attrs["tab-remove"]) && r.$attrs["tab-remove"](o);
|
|
44
|
+
}),
|
|
45
|
+
onTabAdd: s[1] || (s[1] = () => {
|
|
46
|
+
const o = e(t).value.length;
|
|
47
|
+
e(t).value.push(null), n.value = `tab-${o}`, e(y)(r.$attrs["tab-add"]) && r.$attrs["tab-add"]();
|
|
48
|
+
}),
|
|
49
|
+
onChange: () => {
|
|
50
|
+
}
|
|
51
|
+
}), {
|
|
52
|
+
default: u(() => [
|
|
53
|
+
(l(!0), i(A, null, B(e(t).value, (o, a) => (l(), b(e(w), {
|
|
54
|
+
key: `tab-${a}`,
|
|
55
|
+
closable: a !== 0,
|
|
56
|
+
name: `tab-${a}`
|
|
57
|
+
}, {
|
|
58
|
+
default: u(() => [
|
|
59
|
+
v(e(U), {
|
|
60
|
+
schema: e(K)(e(T), a),
|
|
61
|
+
name: a
|
|
62
|
+
}, null, 8, ["schema", "name"])
|
|
63
|
+
]),
|
|
64
|
+
label: u(() => [
|
|
65
|
+
m.value[a] > 0 ? (l(), i("span", j, [
|
|
66
|
+
v(e(z), {
|
|
67
|
+
class: N([`${c}-errors-badge`]),
|
|
68
|
+
value: m.value[a]
|
|
69
|
+
}, {
|
|
70
|
+
default: u(() => [
|
|
71
|
+
P(h(p(a)), 1)
|
|
72
|
+
]),
|
|
73
|
+
_: 2
|
|
74
|
+
}, 1032, ["class", "value"])
|
|
75
|
+
])) : (l(), i("span", G, h(p(a)), 1))
|
|
76
|
+
]),
|
|
77
|
+
_: 2
|
|
78
|
+
}, 1032, ["closable", "name"]))), 128))
|
|
79
|
+
]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 16, ["model-value"]));
|
|
82
|
+
}
|
|
83
|
+
}), te = H;
|
|
84
|
+
export {
|
|
85
|
+
te as ArrayTabs,
|
|
86
|
+
te as default
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { ArrayField } from '@formily/core'\nimport type { TabPaneName } from 'element-plus'\nimport { reaction } from '@formily/reactive'\nimport { isEqual, isFn } from '@formily/shared'\nimport { RecursionField, useField, useFieldSchema } from '@formily/vue'\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\nimport { onUnmounted, ref } from 'vue'\nimport { useCleanAttrs } from '../__builtins__'\nimport { stylePrefix } from '../__builtins__/configs'\nimport { getArrayItemSchema } from '../array-base/utils'\n\ndefineOptions({\n name: 'FArrayTabs',\n inheritAttrs: false,\n})\n\nconst fieldRef = useField<ArrayField>()\nconst schemaRef = useFieldSchema()\n\nconst prefixCls = `${stylePrefix}-array-tabs`\nconst activeKey = ref<TabPaneName>('tab-0')\n\nconst field = fieldRef.value\n/* istanbul ignore else -- @preserve */\nif (field.value.length === 0) {\n field.value.push(null)\n}\nconst schema = schemaRef.value\nfunction getTabTitle(index: number) {\n return `${field.title || 'Untitled'} ${index + 1}`\n}\n\nconst errorCountList = ref([])\nconst dispose = reaction(() => {\n return field.value.map((item, index) => {\n const panelErrors = field.form.queryFeedbacks({\n type: 'error',\n address: `${field.address.concat(index)}.**`,\n })\n return panelErrors.length\n })\n}, (newVal) => {\n errorCountList.value = newVal\n}, {\n equals: isEqual,\n})\nonUnmounted(() => {\n dispose()\n})\nconst { props: elTabProps } = useCleanAttrs(['value'])\n</script>\n\n<template>\n <ElTabs\n v-bind=\"elTabProps\"\n :model-value=\"activeKey\"\n :class=\"prefixCls\"\n type=\"card\"\n :addable=\"true\"\n @tab-remove=\"(target) => {\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\n field.remove(Number(index))\n if (activeKey === target) {\n activeKey = `tab-${Number(index) - 1}`\n }\n\n if (isFn($attrs['tab-remove'])) {\n $attrs['tab-remove'](target)\n }\n }\"\n @tab-add=\"() => {\n const id = field.value.length\n field.value.push(null)\n activeKey = `tab-${id}`\n if (isFn($attrs['tab-add'])) {\n $attrs['tab-add']()\n }\n }\"\n @change=\"() => {}\"\n >\n <ElTabPane\n v-for=\"(item, index) of field.value\"\n :key=\"`tab-${index}`\"\n :closable=\"index !== 0\"\n :name=\"`tab-${index}`\"\n >\n <template #default>\n <RecursionField\n :schema=\"getArrayItemSchema(schema, index)\"\n :name=\"index\"\n />\n </template>\n <template #label>\n <span v-if=\"errorCountList[index] > 0\">\n <ElBadge\n :class=\"[`${prefixCls}-errors-badge`]\"\n :value=\"errorCountList[index]\"\n >\n {{ getTabTitle(index) }}\n </ElBadge>\n </span>\n <span v-else>\n {{ getTabTitle(index) }}\n </span>\n </template>\n </ElTabPane>\n </ElTabs>\n</template>\n","import FArrayTabs from './array-tabs.vue'\nimport './style.scss'\n\nexport const ArrayTabs = FArrayTabs\n\nexport default ArrayTabs\n"],"names":["fieldRef","useField","schemaRef","useFieldSchema","prefixCls","stylePrefix","activeKey","ref","field","schema","getTabTitle","index","errorCountList","dispose","reaction","item","newVal","isEqual","onUnmounted","elTabProps","useCleanAttrs","_createBlock","_unref","ElTabs","_mergeProps","target","_a","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":";;;;;;;;;;;;;;;AAiBA,UAAMA,IAAWC,EAAA,GACXC,IAAYC,EAAA,GAEZC,IAAY,GAAGC,CAAW,eAC1BC,IAAYC,EAAiB,OAAO,GAEpCC,IAAQR,EAAS;AAAA,IAAA;AAEvB,IAAIQ,EAAM,MAAM,WAAW,KACzBA,EAAM,MAAM,KAAK,IAAI;AAEvB,UAAMC,IAASP,EAAU;AACzB,aAASQ,EAAYC,GAAe;AAClC,aAAO,GAAGH,EAAM,SAAS,UAAU,IAAIG,IAAQ,CAAC;AAAA,IAClD;AAEA,UAAMC,IAAiBL,EAAI,EAAE,GACvBM,IAAUC,EAAS,MAChBN,EAAM,MAAM,IAAI,CAACO,GAAMJ,MACRH,EAAM,KAAK,eAAe;AAAA,MAC5C,MAAM;AAAA,MACN,SAAS,GAAGA,EAAM,QAAQ,OAAOG,CAAK,CAAC;AAAA,IAAA,CACxC,EACkB,MACpB,GACA,CAACK,MAAW;AACb,MAAAJ,EAAe,QAAQI;AAAA,IACzB,GAAG;AAAA,MACD,QAAQC;AAAA,IAAA,CACT;AACD,IAAAC,EAAY,MAAM;AAChB,MAAAL,EAAA;AAAA,IACF,CAAC;AACD,UAAM,EAAE,OAAOM,EAAA,IAAeC,EAAc,CAAC,OAAO,CAAC;2BAInDC,EAqDSC,EAAAC,CAAA,GArDTC,EAqDSF,EAAAH,CAA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,EAAAiB,CAAA,GAAA;AAAA,gBAJP,aAAWnC,CAAS,eAAA,CAAA;AAAA,gBACpB,OAAOQ,EAAA,MAAeD,CAAK;AAAA,cAAA;2BAE5B,MAAwB;AAAA,kBAArB6B,EAAAC,EAAA/B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,gBAAA;;;wBAGxBqB,EAEO,QAAAU,GAAAD,EADF/B,EAAYC,CAAK,CAAA,GAAA,CAAA;AAAA,UAAA;;;;;;;ICpGjBgC,KAAYC;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CascaderOption } from 'element-plus';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value?: any;
|
|
4
|
+
options?: CascaderOption[];
|
|
5
|
+
};
|
|
6
|
+
declare function __VLS_template(): {
|
|
7
|
+
attrs: Partial<{}>;
|
|
8
|
+
slots: {
|
|
9
|
+
default?(_: {
|
|
10
|
+
node: any;
|
|
11
|
+
data: any;
|
|
12
|
+
}): any;
|
|
13
|
+
empty?(_: {}): any;
|
|
14
|
+
};
|
|
15
|
+
refs: {};
|
|
16
|
+
rootEl: any;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
19
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
|
+
change: (value: any) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
22
|
+
onChange?: (value: any) => any;
|
|
23
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const Cascader: {
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
+
value?: any;
|
|
4
|
+
options?: import('element-plus').CascaderOption[];
|
|
5
|
+
}> & Readonly<{
|
|
6
|
+
onChange?: (value: any) => any;
|
|
7
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
|
+
change: (value: any) => any;
|
|
9
|
+
}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
10
|
+
P: {};
|
|
11
|
+
B: {};
|
|
12
|
+
D: {};
|
|
13
|
+
C: {};
|
|
14
|
+
M: {};
|
|
15
|
+
Defaults: {};
|
|
16
|
+
}, Readonly<{
|
|
17
|
+
value?: any;
|
|
18
|
+
options?: import('element-plus').CascaderOption[];
|
|
19
|
+
}> & Readonly<{
|
|
20
|
+
onChange?: (value: any) => any;
|
|
21
|
+
}>, {}, {}, {}, {}, {}>;
|
|
22
|
+
__isFragment?: never;
|
|
23
|
+
__isTeleport?: never;
|
|
24
|
+
__isSuspense?: never;
|
|
25
|
+
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
26
|
+
value?: any;
|
|
27
|
+
options?: import('element-plus').CascaderOption[];
|
|
28
|
+
}> & Readonly<{
|
|
29
|
+
onChange?: (value: any) => any;
|
|
30
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
31
|
+
change: (value: any) => any;
|
|
32
|
+
}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
33
|
+
$slots: {
|
|
34
|
+
default?(_: {
|
|
35
|
+
node: any;
|
|
36
|
+
data: any;
|
|
37
|
+
}): any;
|
|
38
|
+
empty?(_: {}): any;
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
export default Cascader;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { observer as u } from "@formily/reactive-vue";
|
|
2
|
+
import { connect as c, mapProps as f } from "@formily/vue";
|
|
3
|
+
import { defineComponent as v, createBlock as C, openBlock as y, unref as a, mergeProps as P, createSlots as k, withCtx as s, renderSlot as m } from "vue";
|
|
4
|
+
import { ElCascader as $ } from "element-plus";
|
|
5
|
+
import "@formily/reactive";
|
|
6
|
+
import { mapReadPretty as g } from "../__builtins__/shared/transform-component.mjs";
|
|
7
|
+
import { PreviewText as h } from "../preview-text/index.mjs";
|
|
8
|
+
import "@formily/core";
|
|
9
|
+
import { useCleanAttrs as S } from "../__builtins__/shared/utils.mjs";
|
|
10
|
+
const b = /* @__PURE__ */ v({
|
|
11
|
+
name: "FCascader",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
__name: "cascader",
|
|
14
|
+
props: {
|
|
15
|
+
value: null,
|
|
16
|
+
options: null
|
|
17
|
+
},
|
|
18
|
+
emits: ["change"],
|
|
19
|
+
setup(n, { emit: p }) {
|
|
20
|
+
const t = n, l = p, { props: i } = S();
|
|
21
|
+
return (e, r) => (y(), C(a($), P(a(i), {
|
|
22
|
+
options: t.options,
|
|
23
|
+
"model-value": t.value,
|
|
24
|
+
"onUpdate:modelValue": r[0] || (r[0] = (o) => l("change", o))
|
|
25
|
+
}), k({ _: 2 }, [
|
|
26
|
+
e.$slots.default ? {
|
|
27
|
+
name: "default",
|
|
28
|
+
fn: s(({ node: o, data: d }) => [
|
|
29
|
+
m(e.$slots, "default", {
|
|
30
|
+
node: o,
|
|
31
|
+
data: d
|
|
32
|
+
})
|
|
33
|
+
]),
|
|
34
|
+
key: "0"
|
|
35
|
+
} : void 0,
|
|
36
|
+
e.$slots.empty ? {
|
|
37
|
+
name: "empty",
|
|
38
|
+
fn: s(() => [
|
|
39
|
+
m(e.$slots, "empty")
|
|
40
|
+
]),
|
|
41
|
+
key: "1"
|
|
42
|
+
} : void 0
|
|
43
|
+
]), 1040, ["options", "model-value"]));
|
|
44
|
+
}
|
|
45
|
+
}), _ = c(
|
|
46
|
+
u(b),
|
|
47
|
+
f({ dataSource: "options", value: "modelValue", disabled: !0 }),
|
|
48
|
+
g(h.Cascader)
|
|
49
|
+
);
|
|
50
|
+
export {
|
|
51
|
+
_ as Cascader,
|
|
52
|
+
_ as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CascaderOption } from 'element-plus'\nimport { ElCascader } from 'element-plus'\nimport { useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCascader',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\n value: null,\n options: null\n})\n\nconst emit = defineEmits([\"change\"])\n\nconst { props: cascaderProps } = useCleanAttrs()\n</script>\n\n<template>\n <ElCascader\n v-bind=\"cascaderProps\"\n :options=\"props.options\"\n :model-value=\"props.value\"\n @update:model-value=\"value => emit('change', value)\"\n >\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\n <slot :node=\"node\" :data=\"data\" />\n </template>\n <template v-if=\"$slots.empty\" #empty>\n <slot name=\"empty\" />\n </template>\n </ElCascader>\n</template>\n","import { observer } from '@formily/reactive-vue'\nimport { connect, mapProps } from '@formily/vue'\nimport { mapReadPretty } from '../__builtins__'\nimport { PreviewText } from '../preview-text'\nimport FCascader from './cascader.vue'\n\nexport const Cascader = connect(\n observer(FCascader),\n mapProps({ dataSource: 'options', value: 'modelValue', disabled: true }),\n mapReadPretty(PreviewText.Cascader),\n)\n\nexport default Cascader\n"],"names":["props","__props","emit","__emit","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","_cache","value","$slots","node","data","_renderSlot","_ctx","Cascader","connect","observer","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAKRC,IAAOC,GAEP,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAYaC,EAAAC,CAAA,GAZbC,EAYaF,EAAAH,CAAA,GAXU;AAAA,MACpB,SAASJ,EAAM;AAAA,MACf,eAAaA,EAAM;AAAA,MACnB,uBAAkBU,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAE,CAAAC,MAAST,YAAeS,CAAK;AAAA,IAAA;MAElCC,EAAAA,OAAO;cAAU;AAAA,cAC/B,CAAkC,EADQ,MAAAC,GAAM,MAAAC,QAAI;AAAA,UACpDC,EAAkCC,EAAA,QAAA,WAAA;AAAA,YAA3B,MAAAH;AAAA,YAAa,MAAAC;AAAA,UAAA;;;;MAENF,EAAAA,OAAO;cAAQ;AAAA,cAC7B,MAAqB;AAAA,UAArBG,EAAqBC,EAAA,QAAA,OAAA;AAAA,QAAA;;;;;ICzBdC,IAAWC;AAAA,EACtBC,EAASC,CAAS;AAAA,EAClBC,EAAS,EAAE,YAAY,WAAW,OAAO,cAAc,UAAU,IAAM;AAAA,EACvEC,EAAcC,EAAY,QAAQ;AACpC;"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CheckboxProps } from 'element-plus';
|
|
2
|
+
import { PropType } from 'vue';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: {
|
|
6
|
+
option?(_: {
|
|
7
|
+
option: CheckboxProps | {
|
|
8
|
+
label: never;
|
|
9
|
+
value: never;
|
|
10
|
+
};
|
|
11
|
+
}): any;
|
|
12
|
+
};
|
|
13
|
+
refs: {};
|
|
14
|
+
rootEl: any;
|
|
15
|
+
};
|
|
16
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
18
|
+
value: {
|
|
19
|
+
type: PropType<Array<any>>;
|
|
20
|
+
default: () => any[];
|
|
21
|
+
};
|
|
22
|
+
options: {
|
|
23
|
+
type: PropType<Array<CheckboxProps>>;
|
|
24
|
+
default: () => any[];
|
|
25
|
+
};
|
|
26
|
+
optionType: {
|
|
27
|
+
type: PropType<"default" | "button">;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
31
|
+
change: (...args: any[]) => void;
|
|
32
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
33
|
+
value: {
|
|
34
|
+
type: PropType<Array<any>>;
|
|
35
|
+
default: () => any[];
|
|
36
|
+
};
|
|
37
|
+
options: {
|
|
38
|
+
type: PropType<Array<CheckboxProps>>;
|
|
39
|
+
default: () => any[];
|
|
40
|
+
};
|
|
41
|
+
optionType: {
|
|
42
|
+
type: PropType<"default" | "button">;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
}>> & Readonly<{
|
|
46
|
+
onChange?: (...args: any[]) => any;
|
|
47
|
+
}>, {
|
|
48
|
+
value: any[];
|
|
49
|
+
options: CheckboxProps[];
|
|
50
|
+
optionType: "button" | "default";
|
|
51
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
52
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|