@silver-formily/element-plus 3.0.0 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +32 -32
- package/README.md +32 -32
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/index.mjs +18 -18
- package/esm/__builtins__/shared/loading.mjs +1 -1
- package/esm/__builtins__/shared/loading.mjs.map +1 -1
- package/esm/__builtins__/shared/simple-version-compare.mjs.map +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/use-enter-submit.mjs +57 -16
- package/esm/__builtins__/shared/use-enter-submit.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +45 -42
- package/esm/array-base/index.mjs.map +1 -1
- package/esm/array-base/symbols.mjs.map +1 -1
- package/esm/array-base/utils.mjs +36 -31
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/index.mjs +34 -32
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/index.mjs +29 -28
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +8 -2
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +34 -31
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/index.mjs +51 -50
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +11 -5
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/index.mjs +47 -46
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/utils.mjs +18 -12
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +27 -27
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/autocomplete/index.mjs +21 -18
- package/esm/autocomplete/index.mjs.map +1 -1
- package/esm/cascader/index.mjs +18 -15
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/index.mjs +19 -16
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/color-picker/index.mjs +9 -6
- package/esm/color-picker/index.mjs.map +1 -1
- package/esm/color-picker-panel/index.mjs +9 -6
- package/esm/color-picker-panel/index.mjs.map +1 -1
- package/esm/date-picker/index.mjs +14 -11
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/date-picker/utils.mjs.map +1 -1
- package/esm/date-picker-panel/index.mjs +14 -11
- package/esm/date-picker-panel/index.mjs.map +1 -1
- package/esm/editable/index.mjs +34 -32
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form/form.mjs +6 -6
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +17 -14
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +8 -2
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +20 -18
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/index.d.ts +1 -1
- package/esm/form-dialog/index.mjs +22 -22
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-dialog/types.d.ts +13 -5
- package/esm/form-drawer/index.d.ts +1 -1
- package/esm/form-drawer/index.mjs +21 -21
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-drawer/types.d.ts +13 -5
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +20 -18
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.mjs +54 -53
- package/esm/form-item/index.mjs.map +1 -1
- package/esm/form-item/utils.mjs.map +1 -1
- package/esm/form-layout/form-layout.mjs +13 -10
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +29 -27
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.mjs +22 -21
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.mjs +72 -72
- package/esm/input/index.mjs +25 -22
- package/esm/input/index.mjs.map +1 -1
- package/esm/input-number/index.mjs +11 -8
- package/esm/input-number/index.mjs.map +1 -1
- package/esm/input-tag/index.mjs +16 -13
- package/esm/input-tag/index.mjs.map +1 -1
- package/esm/mention/index.mjs +20 -17
- package/esm/mention/index.mjs.map +1 -1
- package/esm/pagination/components/jumper.mjs.map +1 -1
- package/esm/pagination/components/next.mjs.map +1 -1
- package/esm/pagination/components/pager.mjs.map +1 -1
- package/esm/pagination/components/prev.mjs.map +1 -1
- package/esm/pagination/components/total.mjs.map +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/index.mjs +30 -27
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/query-form/default-components.mjs.map +1 -1
- package/esm/query-form/hooks.mjs.map +1 -1
- package/esm/query-form/index.mjs +142 -140
- package/esm/query-form/index.mjs.map +1 -1
- package/esm/query-form-item/index.mjs +17 -15
- package/esm/query-form-item/index.mjs.map +1 -1
- package/esm/radio/index.mjs +28 -25
- package/esm/radio/index.mjs.map +1 -1
- package/esm/rate/index.mjs +13 -10
- package/esm/rate/index.mjs.map +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/segmented/index.mjs +15 -12
- package/esm/segmented/index.mjs.map +1 -1
- package/esm/select/index.mjs +22 -19
- package/esm/select/index.mjs.map +1 -1
- package/esm/select-table/index.mjs +15 -12
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/shared/overlay-elements.mjs.map +1 -1
- package/esm/slider/index.mjs +13 -10
- package/esm/slider/index.mjs.map +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.mjs +9 -6
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +8 -8
- package/esm/time-select/index.mjs +9 -6
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.mjs +31 -28
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.mjs +17 -14
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/upload/index.mjs +36 -37
- package/esm/upload/index.mjs.map +1 -1
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +12 -11
package/README.en-US.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# Silver Formily Element Plus
|
|
2
|
-
|
|
3
|
-
[](https://codecov.io/gh/hezhengxu2018/silver-formily-element-plus)
|
|
4
|
-
|
|
5
|
-
English | [简体中文](README.md)
|
|
6
|
-
|
|
7
|
-
Formily bindings for Element Plus, focused on consistent UI behavior, flexible configuration, and richer form scenarios.
|
|
8
|
-
|
|
9
|
-
## Documentation
|
|
10
|
-
|
|
11
|
-
https://element-plus.silver-formily.org/
|
|
12
|
-
|
|
13
|
-
## Features
|
|
14
|
-
|
|
15
|
-
- 💡 Unified component style
|
|
16
|
-
- 🔌 Flexible dependencies (Formily + Element Plus as peerDependencies)
|
|
17
|
-
- 🔑 Complete form components plus scenario components
|
|
18
|
-
- ♿️ Better accessibility with enhanced FormItem
|
|
19
|
-
- ✅ Comprehensive testing for new components
|
|
20
|
-
- 📝 Vue template syntax based for readability and performance
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add @silver-formily/element-plus
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
This package relies on peer dependencies such as Formily, Element Plus, Vue, and @silver-formily/vue. Refer to the documentation or package.json for compatible versions and setup details.
|
|
29
|
-
|
|
30
|
-
## License
|
|
31
|
-
|
|
32
|
-
MIT
|
|
1
|
+
# Silver Formily Element Plus
|
|
2
|
+
|
|
3
|
+
[](https://codecov.io/gh/hezhengxu2018/silver-formily-element-plus)
|
|
4
|
+
|
|
5
|
+
English | [简体中文](README.md)
|
|
6
|
+
|
|
7
|
+
Formily bindings for Element Plus, focused on consistent UI behavior, flexible configuration, and richer form scenarios.
|
|
8
|
+
|
|
9
|
+
## Documentation
|
|
10
|
+
|
|
11
|
+
https://element-plus.silver-formily.org/
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- 💡 Unified component style
|
|
16
|
+
- 🔌 Flexible dependencies (Formily + Element Plus as peerDependencies)
|
|
17
|
+
- 🔑 Complete form components plus scenario components
|
|
18
|
+
- ♿️ Better accessibility with enhanced FormItem
|
|
19
|
+
- ✅ Comprehensive testing for new components
|
|
20
|
+
- 📝 Vue template syntax based for readability and performance
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add @silver-formily/element-plus
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This package relies on peer dependencies such as Formily, Element Plus, Vue, and @silver-formily/vue. Refer to the documentation or package.json for compatible versions and setup details.
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# Silver Formily Element Plus
|
|
2
|
-
|
|
3
|
-
[](https://codecov.io/gh/hezhengxu2018/silver-formily-element-plus)
|
|
4
|
-
|
|
5
|
-
简体中文 | [English](README.en-US.md)
|
|
6
|
-
|
|
7
|
-
基于 Element Plus 的 Formily 组件库封装,提供一致的组件风格、灵活的配置能力以及更丰富的表单场景。
|
|
8
|
-
|
|
9
|
-
## 文档
|
|
10
|
-
|
|
11
|
-
https://element-plus.silver-formily.org/
|
|
12
|
-
|
|
13
|
-
## 特性
|
|
14
|
-
|
|
15
|
-
- 💡 统一的组件风格
|
|
16
|
-
- 🔌 灵活的依赖策略(Formily 与 Element Plus 作为 peerDependencies)
|
|
17
|
-
- 🔑 完整的表单组件与扩展场景组件
|
|
18
|
-
- ♿️ 更好的无障碍支持与 FormItem 体验
|
|
19
|
-
- ✅ 新组件具备完善测试保障
|
|
20
|
-
- 📝 基于 Vue 模板语法,易读且性能友好
|
|
21
|
-
|
|
22
|
-
## 安装
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
pnpm add @silver-formily/element-plus
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
本包依赖 Formily、Element Plus、Vue、@silver-formily/vue 等 peerDependencies。请查看文档或 package.json 获取兼容版本与配置说明。
|
|
29
|
-
|
|
30
|
-
## 开源协议
|
|
31
|
-
|
|
32
|
-
MIT
|
|
1
|
+
# Silver Formily Element Plus
|
|
2
|
+
|
|
3
|
+
[](https://codecov.io/gh/hezhengxu2018/silver-formily-element-plus)
|
|
4
|
+
|
|
5
|
+
简体中文 | [English](README.en-US.md)
|
|
6
|
+
|
|
7
|
+
基于 Element Plus 的 Formily 组件库封装,提供一致的组件风格、灵活的配置能力以及更丰富的表单场景。
|
|
8
|
+
|
|
9
|
+
## 文档
|
|
10
|
+
|
|
11
|
+
https://element-plus.silver-formily.org/
|
|
12
|
+
|
|
13
|
+
## 特性
|
|
14
|
+
|
|
15
|
+
- 💡 统一的组件风格
|
|
16
|
+
- 🔌 灵活的依赖策略(Formily 与 Element Plus 作为 peerDependencies)
|
|
17
|
+
- 🔑 完整的表单组件与扩展场景组件
|
|
18
|
+
- ♿️ 更好的无障碍支持与 FormItem 体验
|
|
19
|
+
- ✅ 新组件具备完善测试保障
|
|
20
|
+
- 📝 基于 Vue 模板语法,易读且性能友好
|
|
21
|
+
|
|
22
|
+
## 安装
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm add @silver-formily/element-plus
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
本包依赖 Formily、Element Plus、Vue、@silver-formily/vue 等 peerDependencies。请查看文档或 package.json 获取兼容版本与配置说明。
|
|
29
|
+
|
|
30
|
+
## 开源协议
|
|
31
|
+
|
|
32
|
+
MIT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/__builtins__/configs/index.ts"],"sourcesContent":["export const stylePrefix = 'formily-element-plus'\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/__builtins__/configs/index.ts"],"sourcesContent":["export const stylePrefix = 'formily-element-plus'\n"],"names":["stylePrefix"],"mappings":"AAAO,MAAMA,IAAc;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { stylePrefix as r } from "./configs/index.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { getTransitionDuration as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { loadElConfigProvider as i } from "./shared/load-config-provider.mjs";
|
|
3
|
+
import { getTransitionDuration as p, loading as m, useDebonceSubmitting as s } from "./shared/loading.mjs";
|
|
4
|
+
import { lt as l, quickVersionCompare as f } from "./shared/simple-version-compare.mjs";
|
|
5
|
+
import { mapReadPretty as d } from "./shared/transform-component.mjs";
|
|
6
|
+
import { compatibleUnderlineProp as c, composeExport as g, hasSlotContent as C, isVnodeEmpty as P, isVueOptions as b, useCleanAttrs as y } from "./shared/utils.mjs";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
c as compatibleUnderlineProp,
|
|
9
|
+
g as composeExport,
|
|
10
|
+
p as getTransitionDuration,
|
|
11
|
+
C as hasSlotContent,
|
|
12
|
+
P as isVnodeEmpty,
|
|
13
|
+
b as isVueOptions,
|
|
14
|
+
i as loadElConfigProvider,
|
|
15
|
+
m as loading,
|
|
16
|
+
l as lt,
|
|
17
|
+
d as mapReadPretty,
|
|
18
|
+
f as quickVersionCompare,
|
|
19
19
|
r as stylePrefix,
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
y as useCleanAttrs,
|
|
21
|
+
s as useDebonceSubmitting
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.mjs","sources":["../../../src/__builtins__/shared/loading.ts"],"sourcesContent":["import type { Form } from '@formily/core'\
|
|
1
|
+
{"version":3,"file":"loading.mjs","sources":["../../../src/__builtins__/shared/loading.ts"],"sourcesContent":["import type { Form } from '@formily/core'\nimport { reactionWatch } from '@silver-formily/reactive-vue'\nimport { useDebounceFn } from '@vueuse/core'\nimport { ElLoading } from 'element-plus'\nimport { ref } from 'vue'\n\nexport async function loading(loadingText = 'Loading...', processor: () => Promise<any>) {\n let loadingInstance\n const loading = setTimeout(() => {\n loadingInstance = ElLoading.service({\n text: loadingText,\n background: 'transparent',\n })\n }, 100)\n try {\n return await processor()\n }\n finally {\n loadingInstance?.close()\n clearTimeout(loading)\n }\n}\n\n/**\n * 获取当前element-plus的过渡时长并转换为毫秒\n * @param cssVarName CSS 变量名,默认为 '--el-transition-duration'\n * @param defaultValue 默认值(毫秒),默认为 200\n * @returns 过渡时长(毫秒)\n */\nexport function getTransitionDuration(cssVarName = '--el-transition-duration', defaultValue = 200): number {\n const cssVar = getComputedStyle(document.documentElement)\n .getPropertyValue(cssVarName)\n .trim()\n if (!cssVar) {\n return defaultValue\n }\n const durationMatch = cssVar.match(/^([\\d.]+)\\s*(s|ms)?$/)\n if (!durationMatch) {\n return defaultValue\n }\n\n const value = Number.parseFloat(durationMatch[1])\n const unit = durationMatch[2] || 'ms'\n\n switch (unit) {\n case 's': {\n return value * 1000\n }\n case 'ms': {\n return value\n }\n }\n}\n\nexport function useDebonceSubmitting(form: Form) {\n const internalSubmitting = ref(false)\n const transitionDuration = getTransitionDuration()\n\n const setSubmittingFalse = useDebounceFn(() => {\n internalSubmitting.value = false\n }, () => transitionDuration)\n\n reactionWatch(() => form.submitting, (val) => {\n if (val === false) {\n setSubmittingFalse()\n }\n else {\n internalSubmitting.value = val\n }\n })\n\n return {\n internalSubmitting,\n }\n}\n"],"names":["loading","loadingText","processor","loadingInstance","ElLoading","getTransitionDuration","cssVarName","defaultValue","cssVar","durationMatch","value","useDebonceSubmitting","form","internalSubmitting","ref","transitionDuration","setSubmittingFalse","useDebounceFn","reactionWatch","val"],"mappings":";;;;AAMA,eAAsBA,EAAQC,IAAc,cAAcC,GAA+B;AACvF,MAAIC;AACJ,QAAMH,IAAU,WAAW,MAAM;AAC/B,IAAAG,IAAkBC,EAAU,QAAQ;AAAA,MAClC,MAAMH;AAAA,MACN,YAAY;AAAA,IAAA,CACb;AAAA,EACH,GAAG,GAAG;AACN,MAAI;AACF,WAAO,MAAMC,EAAA;AAAA,EACf,UAAA;AAEE,IAAAC,GAAiB,MAAA,GACjB,aAAaH,CAAO;AAAA,EACtB;AACF;AAQO,SAASK,EAAsBC,IAAa,4BAA4BC,IAAe,KAAa;AACzG,QAAMC,IAAS,iBAAiB,SAAS,eAAe,EACrD,iBAAiBF,CAAU,EAC3B,KAAA;AACH,MAAI,CAACE;AACH,WAAOD;AAET,QAAME,IAAgBD,EAAO,MAAM,sBAAsB;AACzD,MAAI,CAACC;AACH,WAAOF;AAGT,QAAMG,IAAQ,OAAO,WAAWD,EAAc,CAAC,CAAC;AAGhD,UAFaA,EAAc,CAAC,KAAK,MAEzB;AAAA,IACN,KAAK;AACH,aAAOC,IAAQ;AAAA,IAEjB,KAAK;AACH,aAAOA;AAAA,EACT;AAEJ;AAEO,SAASC,EAAqBC,GAAY;AAC/C,QAAMC,IAAqBC,EAAI,EAAK,GAC9BC,IAAqBV,EAAA,GAErBW,IAAqBC,EAAc,MAAM;AAC7C,IAAAJ,EAAmB,QAAQ;AAAA,EAC7B,GAAG,MAAME,CAAkB;AAE3B,SAAAG,EAAc,MAAMN,EAAK,YAAY,CAACO,MAAQ;AAC5C,IAAIA,MAAQ,KACVH,EAAA,IAGAH,EAAmB,QAAQM;AAAA,EAE/B,CAAC,GAEM;AAAA,IACL,oBAAAN;AAAA,EAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-version-compare.mjs","sources":["../../../src/__builtins__/shared/simple-version-compare.ts"],"sourcesContent":["function normalizeVersion(v: string) {\
|
|
1
|
+
{"version":3,"file":"simple-version-compare.mjs","sources":["../../../src/__builtins__/shared/simple-version-compare.ts"],"sourcesContent":["function normalizeVersion(v: string) {\n return v.split('.').map((n) => {\n const num = Number.parseInt(n, 10)\n return Number.isNaN(num) ? '0'.padStart(10, '0') : num.toString().padStart(10, '0')\n }).join('.')\n}\n\nexport function quickVersionCompare(v1: string, v2: string): number {\n const nv1 = normalizeVersion(v1)\n const nv2 = normalizeVersion(v2)\n return nv1 > nv2 ? 1 : (nv1 < nv2 ? -1 : 0)\n}\n\nexport function lt(v1: string, v2: string): boolean {\n return quickVersionCompare(v1, v2) < 0\n}\n"],"names":["normalizeVersion","v","n","num","quickVersionCompare","v1","v2","nv1","nv2","lt"],"mappings":"AAAA,SAASA,EAAiBC,GAAW;AACnC,SAAOA,EAAE,MAAM,GAAG,EAAE,IAAI,CAACC,MAAM;AAC7B,UAAMC,IAAM,OAAO,SAASD,GAAG,EAAE;AACjC,WAAO,OAAO,MAAMC,CAAG,IAAI,IAAI,SAAS,IAAI,GAAG,IAAIA,EAAI,SAAA,EAAW,SAAS,IAAI,GAAG;AAAA,EACpF,CAAC,EAAE,KAAK,GAAG;AACb;AAEO,SAASC,EAAoBC,GAAYC,GAAoB;AAClE,QAAMC,IAAMP,EAAiBK,CAAE,GACzBG,IAAMR,EAAiBM,CAAE;AAC/B,SAAOC,IAAMC,IAAM,IAAKD,IAAMC,IAAM,KAAK;AAC3C;AAEO,SAASC,EAAGJ,GAAYC,GAAqB;AAClD,SAAOF,EAAoBC,GAAIC,CAAE,IAAI;AACvC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform-component.mjs","sources":["../../../src/__builtins__/shared/transform-component.ts"],"sourcesContent":["import type { IComponentMapper } from '@silver-formily/vue'\
|
|
1
|
+
{"version":3,"file":"transform-component.mjs","sources":["../../../src/__builtins__/shared/transform-component.ts"],"sourcesContent":["import type { IComponentMapper } from '@silver-formily/vue'\nimport type { Component } from 'vue'\nimport { isVoidField } from '@formily/core'\nimport { observer } from '@silver-formily/reactive-vue'\nimport { useField } from '@silver-formily/vue'\nimport { defineComponent, h } from 'vue'\n\n// fork from https://github.com/alibaba/formily/blob/7c64c671252adf85471ac5aabfddbaf4fc537354/packages/vue/src/shared/connect.ts#L65\nexport function mapReadPretty(\n component: Component,\n readPrettyProps?: Record<string, any>,\n): IComponentMapper {\n const mapper = (target: Component) => {\n return observer(\n defineComponent({\n name: target.name ? `Read${target.name}` : `ReadComponent`,\n setup(props, { attrs, slots, listeners }: Record<string, any>) {\n const fieldRef = useField()\n return () => {\n const field = fieldRef.value\n const isEditableReadPretty = !!field?.data?.readPretty\n return h(\n field && !isVoidField(field) && (field.pattern === 'readPretty' || isEditableReadPretty)\n ? component\n : target,\n {\n attrs: {\n ...readPrettyProps,\n ...attrs,\n },\n on: listeners,\n },\n slots,\n )\n }\n },\n }),\n )\n }\n\n return mapper as unknown as IComponentMapper\n}\n"],"names":["mapReadPretty","component","readPrettyProps","target","observer","defineComponent","props","attrs","slots","listeners","fieldRef","useField","field","isEditableReadPretty","h","isVoidField"],"mappings":";;;;AAQO,SAASA,EACdC,GACAC,GACkB;AA6BlB,SA5Be,CAACC,MACPC;AAAA,IACLC,EAAgB;AAAA,MACd,MAAMF,EAAO,OAAO,OAAOA,EAAO,IAAI,KAAK;AAAA,MAC3C,MAAMG,GAAO,EAAE,OAAAC,GAAO,OAAAC,GAAO,WAAAC,KAAkC;AAC7D,cAAMC,IAAWC,EAAA;AACjB,eAAO,MAAM;AACX,gBAAMC,IAAQF,EAAS,OACjBG,IAAuB,CAAC,CAACD,GAAO,MAAM;AAC5C,iBAAOE;AAAA,YACLF,KAAS,CAACG,EAAYH,CAAK,MAAMA,EAAM,YAAY,gBAAgBC,KAC/DZ,IACAE;AAAA,YACJ;AAAA,cACE,OAAO;AAAA,gBACL,GAAGD;AAAA,gBACH,GAAGK;AAAA,cAAA;AAAA,cAEL,IAAIE;AAAA,YAAA;AAAA,YAEND;AAAA,UAAA;AAAA,QAEJ;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA;AAKP;"}
|
|
@@ -1,25 +1,66 @@
|
|
|
1
1
|
import { useEventListener as d } from "@vueuse/core";
|
|
2
|
-
import { computed as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
import { computed as b, watch as h, onBeforeUnmount as w } from "vue";
|
|
3
|
+
const c = globalThis.window === void 0 ? void 0 : globalThis, y = /* @__PURE__ */ new Set([
|
|
4
|
+
"text",
|
|
5
|
+
"search",
|
|
6
|
+
"email",
|
|
7
|
+
"password",
|
|
8
|
+
"tel",
|
|
9
|
+
"url",
|
|
10
|
+
"number"
|
|
11
|
+
]), E = [
|
|
12
|
+
"button",
|
|
13
|
+
"a[href]",
|
|
14
|
+
"select",
|
|
15
|
+
"summary",
|
|
16
|
+
"[role=button]",
|
|
17
|
+
"[role=link]",
|
|
18
|
+
"[role=checkbox]",
|
|
19
|
+
"[role=radio]",
|
|
20
|
+
"[role=switch]",
|
|
21
|
+
"[role=tab]",
|
|
22
|
+
"[role=menuitem]",
|
|
23
|
+
"[role=option]",
|
|
24
|
+
"[role=combobox]",
|
|
25
|
+
"[role=listbox]"
|
|
26
|
+
].join(",");
|
|
27
|
+
function x(t) {
|
|
28
|
+
const o = t?.closest("input");
|
|
29
|
+
if (!o)
|
|
30
|
+
return !1;
|
|
31
|
+
const u = (o.getAttribute("type") ?? "text").toLowerCase();
|
|
32
|
+
return y.has(u);
|
|
33
|
+
}
|
|
34
|
+
function S(t) {
|
|
35
|
+
if (!t || x(t))
|
|
36
|
+
return !1;
|
|
37
|
+
if (t.closest(E))
|
|
38
|
+
return !0;
|
|
39
|
+
const o = t.ownerDocument?.activeElement;
|
|
40
|
+
return o instanceof HTMLElement ? o !== t.ownerDocument.body && o !== t.ownerDocument.documentElement && o === t : !1;
|
|
41
|
+
}
|
|
42
|
+
function L({ visible: t, resolve: o, submitting: u, getContainer: f, enabled: i = !0 }) {
|
|
43
|
+
let r = null;
|
|
44
|
+
const l = b(() => typeof i == "boolean" ? i : i?.value ?? !0), m = (e) => {
|
|
45
|
+
if (e.isComposing || e.shiftKey || e.altKey || e.ctrlKey || e.metaKey || !t.value || !l.value || u.value || e.defaultPrevented)
|
|
46
|
+
return !0;
|
|
47
|
+
const n = f();
|
|
48
|
+
if (!n || !(e.target instanceof Node) || !n.contains(e.target))
|
|
8
49
|
return !0;
|
|
9
|
-
const
|
|
10
|
-
return !!(
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
|
|
50
|
+
const a = e.target;
|
|
51
|
+
return !!(a?.closest("textarea,[contenteditable=true]") || S(a));
|
|
52
|
+
}, p = (e) => {
|
|
53
|
+
e.key !== "Enter" || m(e) || (e.preventDefault(), o());
|
|
54
|
+
}, s = (e) => {
|
|
55
|
+
r && (r(), r = null), e && c && (r = d(c, "keydown", p, {
|
|
15
56
|
passive: !1
|
|
16
57
|
}));
|
|
17
58
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, { immediate: !0 }),
|
|
59
|
+
h([t, l], ([e, n]) => {
|
|
60
|
+
s(e && n);
|
|
61
|
+
}, { immediate: !0 }), w(() => s(!1));
|
|
21
62
|
}
|
|
22
63
|
export {
|
|
23
|
-
|
|
64
|
+
L as useEnterSubmit
|
|
24
65
|
};
|
|
25
66
|
//# sourceMappingURL=use-enter-submit.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-enter-submit.mjs","sources":["../../../src/__builtins__/shared/use-enter-submit.ts"],"sourcesContent":["import type { Ref } from 'vue'\
|
|
1
|
+
{"version":3,"file":"use-enter-submit.mjs","sources":["../../../src/__builtins__/shared/use-enter-submit.ts"],"sourcesContent":["import type { Ref } from 'vue'\nimport { useEventListener } from '@vueuse/core'\nimport { computed, onBeforeUnmount, watch } from 'vue'\n\nexport interface UseEnterSubmitOptions {\n visible: Ref<boolean>\n resolve: () => void\n submitting: Ref<boolean>\n getContainer: () => HTMLElement | null\n enabled?: Ref<boolean> | boolean\n}\n\nconst runtimeWindow = globalThis.window === undefined ? undefined : globalThis\nconst submitOnEnterInputTypes = new Set([\n 'text',\n 'search',\n 'email',\n 'password',\n 'tel',\n 'url',\n 'number',\n])\nconst defaultEnterBehaviorSelector = [\n 'button',\n 'a[href]',\n 'select',\n 'summary',\n '[role=button]',\n '[role=link]',\n '[role=checkbox]',\n '[role=radio]',\n '[role=switch]',\n '[role=tab]',\n '[role=menuitem]',\n '[role=option]',\n '[role=combobox]',\n '[role=listbox]',\n].join(',')\n\nfunction shouldSubmitOnEnter(target: HTMLElement | null) {\n const input = target?.closest('input') as HTMLInputElement | null\n if (!input)\n return false\n\n const inputType = (input.getAttribute('type') ?? 'text').toLowerCase()\n return submitOnEnterInputTypes.has(inputType)\n}\n\nfunction shouldRespectDefaultEnterBehavior(target: HTMLElement | null) {\n if (!target || shouldSubmitOnEnter(target))\n return false\n\n if (target.closest(defaultEnterBehaviorSelector))\n return true\n\n const activeElement = target.ownerDocument?.activeElement\n if (!(activeElement instanceof HTMLElement))\n return false\n\n return activeElement !== target.ownerDocument.body\n && activeElement !== target.ownerDocument.documentElement\n && activeElement === target\n}\n\nexport function useEnterSubmit({ visible, resolve, submitting, getContainer, enabled = true }: UseEnterSubmitOptions) {\n let stopListener: (() => void) | null = null\n const enabledRef = computed(() => {\n if (typeof enabled === 'boolean')\n return enabled\n\n return enabled?.value ?? true\n })\n\n const shouldSkipSubmit = (event: KeyboardEvent) => {\n if (\n event.isComposing\n || event.shiftKey\n || event.altKey\n || event.ctrlKey\n || event.metaKey\n || !visible.value\n || !enabledRef.value\n || submitting.value\n || event.defaultPrevented\n ) {\n return true\n }\n\n const container = getContainer()\n if (!container || !(event.target instanceof Node) || !container.contains(event.target))\n return true\n\n const target = event.target as HTMLElement | null\n if (target?.closest('textarea,[contenteditable=true]'))\n return true\n if (shouldRespectDefaultEnterBehavior(target))\n return true\n\n return false\n }\n\n const handleEnterSubmit = (event: KeyboardEvent) => {\n if (event.key !== 'Enter' || shouldSkipSubmit(event))\n return\n\n event.preventDefault()\n resolve()\n }\n\n const toggleListener = (shouldListen: boolean) => {\n if (stopListener) {\n stopListener()\n stopListener = null\n }\n\n if (shouldListen && runtimeWindow) {\n stopListener = useEventListener(runtimeWindow, 'keydown', handleEnterSubmit, {\n passive: false,\n })\n }\n }\n\n watch([visible, enabledRef], ([visibleValue, enabledValue]) => {\n toggleListener(visibleValue && enabledValue)\n }, { immediate: true })\n\n onBeforeUnmount(() => toggleListener(false))\n}\n"],"names":["runtimeWindow","submitOnEnterInputTypes","defaultEnterBehaviorSelector","shouldSubmitOnEnter","target","input","inputType","shouldRespectDefaultEnterBehavior","activeElement","useEnterSubmit","visible","resolve","submitting","getContainer","enabled","stopListener","enabledRef","computed","shouldSkipSubmit","event","container","handleEnterSubmit","toggleListener","shouldListen","useEventListener","watch","visibleValue","enabledValue","onBeforeUnmount"],"mappings":";;AAYA,MAAMA,IAAgB,WAAW,WAAW,SAAY,SAAY,YAC9DC,wBAA8B,IAAI;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GACKC,IAA+B;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAEV,SAASC,EAAoBC,GAA4B;AACvD,QAAMC,IAAQD,GAAQ,QAAQ,OAAO;AACrC,MAAI,CAACC;AACH,WAAO;AAET,QAAMC,KAAaD,EAAM,aAAa,MAAM,KAAK,QAAQ,YAAA;AACzD,SAAOJ,EAAwB,IAAIK,CAAS;AAC9C;AAEA,SAASC,EAAkCH,GAA4B;AACrE,MAAI,CAACA,KAAUD,EAAoBC,CAAM;AACvC,WAAO;AAET,MAAIA,EAAO,QAAQF,CAA4B;AAC7C,WAAO;AAET,QAAMM,IAAgBJ,EAAO,eAAe;AAC5C,SAAMI,aAAyB,cAGxBA,MAAkBJ,EAAO,cAAc,QACzCI,MAAkBJ,EAAO,cAAc,mBACvCI,MAAkBJ,IAJd;AAKX;AAEO,SAASK,EAAe,EAAE,SAAAC,GAAS,SAAAC,GAAS,YAAAC,GAAY,cAAAC,GAAc,SAAAC,IAAU,MAA+B;AACpH,MAAIC,IAAoC;AACxC,QAAMC,IAAaC,EAAS,MACtB,OAAOH,KAAY,YACdA,IAEFA,GAAS,SAAS,EAC1B,GAEKI,IAAmB,CAACC,MAAyB;AACjD,QACEA,EAAM,eACHA,EAAM,YACNA,EAAM,UACNA,EAAM,WACNA,EAAM,WACN,CAACT,EAAQ,SACT,CAACM,EAAW,SACZJ,EAAW,SACXO,EAAM;AAET,aAAO;AAGT,UAAMC,IAAYP,EAAA;AAClB,QAAI,CAACO,KAAa,EAAED,EAAM,kBAAkB,SAAS,CAACC,EAAU,SAASD,EAAM,MAAM;AACnF,aAAO;AAET,UAAMf,IAASe,EAAM;AAGrB,WAFI,GAAAf,GAAQ,QAAQ,iCAAiC,KAEjDG,EAAkCH,CAAM;AAAA,EAI9C,GAEMiB,IAAoB,CAACF,MAAyB;AAClD,IAAIA,EAAM,QAAQ,WAAWD,EAAiBC,CAAK,MAGnDA,EAAM,eAAA,GACNR,EAAA;AAAA,EACF,GAEMW,IAAiB,CAACC,MAA0B;AAChD,IAAIR,MACFA,EAAA,GACAA,IAAe,OAGbQ,KAAgBvB,MAClBe,IAAeS,EAAiBxB,GAAe,WAAWqB,GAAmB;AAAA,MAC3E,SAAS;AAAA,IAAA,CACV;AAAA,EAEL;AAEA,EAAAI,EAAM,CAACf,GAASM,CAAU,GAAG,CAAC,CAACU,GAAcC,CAAY,MAAM;AAC7D,IAAAL,EAAeI,KAAgBC,CAAY;AAAA,EAC7C,GAAG,EAAE,WAAW,IAAM,GAEtBC,EAAgB,MAAMN,EAAe,EAAK,CAAC;AAC7C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../../src/__builtins__/shared/utils.ts"],"sourcesContent":["import type { Component, ComputedRef, Slot, VNode } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { useAttrs, version } from 'element-plus'\nimport { omit } from 'lodash-es'\nimport { Comment, computed, Fragment, Text } from 'vue'\nimport { lt } from './simple-version-compare'\n\nexport function useCleanAttrs(removeAttrsList: string[] = []): {\n props: ComputedRef<Record<string, any>>\n} {\n const attrs = useAttrs()\n const props = computed(() => {\n const DEFAULT_REMOVE_ATTRS = ['value', 'onChange', 'attrs', 'on', 'readOnly']\n if (isPlainObj(attrs.value.attrs)) {\n return omit({ ...attrs.value, ...attrs.value.attrs }, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n }\n return omit(attrs.value, DEFAULT_REMOVE_ATTRS.concat(removeAttrsList))\n })\n return {\n props,\n }\n}\n\nexport function isVueOptions(options: any): options is Component {\n return (\n options\n && (typeof options.template === 'string'\n || typeof options.render === 'function')\n )\n}\n\nexport function composeExport<T0 extends object, T1 extends object>(\n s0: T0,\n s1: T1,\n): T0 & T1 {\n return Object.assign(s0, s1)\n}\n\n// Adapted from https://github.com/vuejs/vue-next/blob/ca17162e377e0a0bf3fae9d92d0fdcb32084a9fe/packages/runtime-core/src/helpers/renderSlot.ts#L77\n/* istanbul ignore next -- @preserve */\nexport function isVnodeEmpty(vnodes: Array<VNode>) {\n return vnodes.every((node: VNode) => {\n if (node.type === Comment) {\n return true\n }\n\n if (node.type === Text && typeof node.children === 'string' && !node.children.trim()) {\n return true\n }\n\n if (\n node.type === Fragment\n && isVnodeEmpty(node.children as Array<VNode>)\n ) {\n return true\n }\n\n return false\n })\n}\n\nexport function hasSlotContent(slot: Slot<any> | undefined) {\n if (!slot) {\n return false\n }\n return !isVnodeEmpty(slot())\n}\n\nexport function compatibleUnderlineProp() {\n /* istanbul ignore next -- @preserve */\n return lt(version, '2.9.9') ? false : 'never'\n}\n"],"names":["useCleanAttrs","removeAttrsList","attrs","useAttrs","computed","DEFAULT_REMOVE_ATTRS","isPlainObj","omit","isVueOptions","options","composeExport","s0","s1","isVnodeEmpty","vnodes","node","Comment","Text","Fragment","hasSlotContent","slot","compatibleUnderlineProp","lt","version"],"mappings":";;;;;AAOO,SAASA,EAAcC,IAA4B,IAExD;AACA,QAAMC,IAAQC,EAAA;AAQd,SAAO;AAAA,IACL,OARYC,EAAS,MAAM;AAC3B,YAAMC,IAAuB,CAAC,SAAS,YAAY,SAAS,MAAM,UAAU;AAC5E,aAAIC,EAAWJ,EAAM,MAAM,KAAK,IACvBK,EAAK,EAAE,GAAGL,EAAM,OAAO,GAAGA,EAAM,MAAM,MAAA,GAASG,EAAqB,OAAOJ,CAAe,CAAC,IAE7FM,EAAKL,EAAM,OAAOG,EAAqB,OAAOJ,CAAe,CAAC;AAAA,IACvE,CAAC;AAAA,EAEC;AAEJ;AAEO,SAASO,EAAaC,GAAoC;AAC/D,SACEA,MACI,OAAOA,EAAQ,YAAa,YAC3B,OAAOA,EAAQ,UAAW;AAEnC;AAEO,SAASC,EACdC,GACAC,GACS;AACT,SAAO,OAAO,OAAOD,GAAIC,CAAE;AAC7B;AAIO,SAASC,EAAaC,GAAsB;AACjD,SAAOA,EAAO,MAAM,CAACC,MACf,GAAAA,EAAK,SAASC,KAIdD,EAAK,SAASE,KAAQ,OAAOF,EAAK,YAAa,YAAY,CAACA,EAAK,SAAS,KAAA,KAK5EA,EAAK,SAASG,KACXL,EAAaE,EAAK,QAAwB,EAMhD;AACH;AAEO,SAASI,EAAeC,GAA6B;AAC1D,SAAKA,IAGE,CAACP,EAAaO,GAAM,IAFlB;AAGX;AAEO,SAASC,IAA0B;AAExC,SAAOC,EAAGC,GAAS,OAAO,IAAI,KAAQ;AACxC;"}
|
package/esm/array-base/index.mjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { ElLink as m } from "element-plus";
|
|
2
|
+
import "@silver-formily/reactive-vue";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { defineComponent as o, unref as a, openBlock as i, createBlock as f, normalizeClass as c, withCtx as h, createTextVNode as _, toDisplayString as v, createCommentVNode as y, createElementBlock as C, renderSlot as u, provide as M, useAttrs as w, withModifiers as $ } from "vue";
|
|
5
|
+
import "@formily/core";
|
|
6
|
+
import { useField as B, useFieldSchema as D } from "@silver-formily/vue";
|
|
7
|
+
import { compatibleUnderlineProp as b, composeExport as I } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { Plus as R, ArrowDown as S, ArrowUp as U, Delete as V, Rank as z } from "@element-plus/icons-vue";
|
|
9
|
+
import { useArray as p, prefixCls as d, getDefaultValue as g, useIndex as k, useRecord as E, useKey as F } from "./utils.mjs";
|
|
7
10
|
import { ArrayBaseSymbol as H, ItemSymbol as N } from "./symbols.mjs";
|
|
8
11
|
import { isArr as x } from "@formily/shared";
|
|
9
12
|
import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
@@ -17,34 +20,34 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
17
20
|
setup(n) {
|
|
18
21
|
const r = n, t = B(), e = p();
|
|
19
22
|
function l() {
|
|
20
|
-
const s =
|
|
23
|
+
const s = g(r.defaultValue, e?.schema.value);
|
|
21
24
|
r.method === "unshift" ? (e?.field?.value.unshift(s), e.attrs?.add?.(0)) : (e?.field?.value.push(s), e.attrs?.add?.(e?.field?.value?.value?.length - 1));
|
|
22
25
|
}
|
|
23
|
-
return (s, A) => a(e).field.value.pattern === "editable" ? (i(),
|
|
26
|
+
return (s, A) => a(e).field.value.pattern === "editable" ? (i(), f(a(m), {
|
|
24
27
|
key: 0,
|
|
25
28
|
class: c(`${a(d)}-addition`),
|
|
26
|
-
icon: a(
|
|
27
|
-
underline: a(
|
|
29
|
+
icon: a(R),
|
|
30
|
+
underline: a(b)(),
|
|
28
31
|
role: "button",
|
|
29
32
|
"aria-label": "添加条目",
|
|
30
33
|
onClick: l
|
|
31
34
|
}, {
|
|
32
35
|
default: h(() => [
|
|
33
|
-
|
|
36
|
+
_(v(a(t).title || r.title), 1)
|
|
34
37
|
]),
|
|
35
38
|
_: 1
|
|
36
|
-
}, 8, ["class", "icon", "underline"])) :
|
|
39
|
+
}, 8, ["class", "icon", "underline"])) : y("", !0);
|
|
37
40
|
}
|
|
38
41
|
}), K = /* @__PURE__ */ o({
|
|
39
42
|
name: "ArrayBaseIndex",
|
|
40
43
|
__name: "array-base-index",
|
|
41
44
|
setup(n) {
|
|
42
|
-
const r =
|
|
45
|
+
const r = k();
|
|
43
46
|
return (t, e) => (i(), C("span", {
|
|
44
47
|
class: c(`${a(d)}-index`)
|
|
45
48
|
}, [
|
|
46
49
|
u(t.$slots, "default", { index: a(r) }, () => [
|
|
47
|
-
|
|
50
|
+
_(" #" + v(a(r) + 1) + ". ", 1)
|
|
48
51
|
])
|
|
49
52
|
], 2));
|
|
50
53
|
}
|
|
@@ -57,7 +60,7 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
57
60
|
keyMap: {}
|
|
58
61
|
},
|
|
59
62
|
setup(n) {
|
|
60
|
-
const r = n, t = B(), e =
|
|
63
|
+
const r = n, t = B(), e = D();
|
|
61
64
|
return M(H, {
|
|
62
65
|
field: t,
|
|
63
66
|
schema: e,
|
|
@@ -83,7 +86,7 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
83
86
|
title: {}
|
|
84
87
|
},
|
|
85
88
|
setup(n) {
|
|
86
|
-
const r = n, t =
|
|
89
|
+
const r = n, t = k(), e = p();
|
|
87
90
|
function l() {
|
|
88
91
|
x(e?.keyMap) && e.keyMap.splice(
|
|
89
92
|
t.value + 1,
|
|
@@ -91,23 +94,23 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
91
94
|
e.keyMap.splice(t.value, 1)[0]
|
|
92
95
|
), e?.field.value.moveDown(t.value), e?.attrs?.moveDown?.(t.value);
|
|
93
96
|
}
|
|
94
|
-
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(),
|
|
97
|
+
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(), f(a(m), {
|
|
95
98
|
key: 0,
|
|
96
99
|
class: c(`${a(d)}-move-down`),
|
|
97
100
|
size: "small",
|
|
98
|
-
icon: a(
|
|
99
|
-
underline: a(
|
|
101
|
+
icon: a(S),
|
|
102
|
+
underline: a(b)(),
|
|
100
103
|
role: "button",
|
|
101
104
|
"aria-label": "下移条目",
|
|
102
105
|
onClick: $(l, ["stop"])
|
|
103
106
|
}, {
|
|
104
107
|
default: h(() => [
|
|
105
108
|
u(s.$slots, "default", {}, () => [
|
|
106
|
-
|
|
109
|
+
_(v(r.title), 1)
|
|
107
110
|
])
|
|
108
111
|
]),
|
|
109
112
|
_: 3
|
|
110
|
-
}, 8, ["class", "icon", "underline"])) :
|
|
113
|
+
}, 8, ["class", "icon", "underline"])) : y("", !0);
|
|
111
114
|
}
|
|
112
115
|
}), q = /* @__PURE__ */ o({
|
|
113
116
|
name: "ArrayBaseMoveUp",
|
|
@@ -116,7 +119,7 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
116
119
|
title: {}
|
|
117
120
|
},
|
|
118
121
|
setup(n) {
|
|
119
|
-
const r = n, t =
|
|
122
|
+
const r = n, t = k(), e = p();
|
|
120
123
|
function l() {
|
|
121
124
|
x(e?.keyMap) && e.keyMap.splice(
|
|
122
125
|
t.value - 1,
|
|
@@ -124,23 +127,23 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
124
127
|
e.keyMap.splice(t.value, 1)[0]
|
|
125
128
|
), e?.field.value.moveUp(t.value), e?.attrs?.moveUp?.(t.value);
|
|
126
129
|
}
|
|
127
|
-
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(),
|
|
130
|
+
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(), f(a(m), {
|
|
128
131
|
key: 0,
|
|
129
132
|
class: c(`${a(d)}-move-up`),
|
|
130
133
|
size: "small",
|
|
131
|
-
icon: a(
|
|
132
|
-
underline: a(
|
|
134
|
+
icon: a(U),
|
|
135
|
+
underline: a(b)(),
|
|
133
136
|
role: "button",
|
|
134
137
|
"aria-label": "上移条目",
|
|
135
138
|
onClick: $(l, ["stop"])
|
|
136
139
|
}, {
|
|
137
140
|
default: h(() => [
|
|
138
141
|
u(s.$slots, "default", {}, () => [
|
|
139
|
-
|
|
142
|
+
_(v(r.title), 1)
|
|
140
143
|
])
|
|
141
144
|
]),
|
|
142
145
|
_: 3
|
|
143
|
-
}, 8, ["class", "icon", "underline"])) :
|
|
146
|
+
}, 8, ["class", "icon", "underline"])) : y("", !0);
|
|
144
147
|
}
|
|
145
148
|
}), G = /* @__PURE__ */ o({
|
|
146
149
|
name: "ArrayBaseRemove",
|
|
@@ -149,45 +152,45 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
149
152
|
title: {}
|
|
150
153
|
},
|
|
151
154
|
setup(n) {
|
|
152
|
-
const r = n, t =
|
|
155
|
+
const r = n, t = k(), e = p();
|
|
153
156
|
function l() {
|
|
154
157
|
x(e?.keyMap) && e?.keyMap?.splice(t.value, 1), e?.field.value.remove(t.value), e?.attrs?.remove?.(t.value);
|
|
155
158
|
}
|
|
156
|
-
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(),
|
|
159
|
+
return (s, A) => a(e)?.field.value.pattern === "editable" ? (i(), f(a(m), {
|
|
157
160
|
key: 0,
|
|
158
161
|
class: c(`${a(d)}-remove`),
|
|
159
162
|
size: "small",
|
|
160
|
-
icon: a(
|
|
161
|
-
underline: a(
|
|
163
|
+
icon: a(V),
|
|
164
|
+
underline: a(b)(),
|
|
162
165
|
role: "button",
|
|
163
166
|
"aria-label": "移除条目",
|
|
164
167
|
onClick: $(l, ["stop"])
|
|
165
168
|
}, {
|
|
166
169
|
default: h(() => [
|
|
167
170
|
u(s.$slots, "default", {}, () => [
|
|
168
|
-
|
|
171
|
+
_(v(r.title), 1)
|
|
169
172
|
])
|
|
170
173
|
]),
|
|
171
174
|
_: 3
|
|
172
|
-
}, 8, ["class", "icon", "underline"])) :
|
|
175
|
+
}, 8, ["class", "icon", "underline"])) : y("", !0);
|
|
173
176
|
}
|
|
174
177
|
}), J = /* @__PURE__ */ o({
|
|
175
178
|
name: "ArrayBaseSortHandle",
|
|
176
179
|
__name: "array-base-sort-handle",
|
|
177
180
|
setup(n) {
|
|
178
181
|
const r = p();
|
|
179
|
-
return (t, e) => a(r).field.value?.pattern === "editable" ? (i(),
|
|
182
|
+
return (t, e) => a(r).field.value?.pattern === "editable" ? (i(), f(a(m), {
|
|
180
183
|
key: 0,
|
|
181
184
|
class: c(`${a(d)}-sort-handle`),
|
|
182
185
|
size: "small",
|
|
183
|
-
icon: a(
|
|
184
|
-
underline: a(
|
|
186
|
+
icon: a(z),
|
|
187
|
+
underline: a(b)(),
|
|
185
188
|
role: "button",
|
|
186
189
|
"aria-label": "拖拽排序",
|
|
187
190
|
"aria-dropeffect": "move"
|
|
188
|
-
}, null, 8, ["class", "icon", "underline"])) :
|
|
191
|
+
}, null, 8, ["class", "icon", "underline"])) : y("", !0);
|
|
189
192
|
}
|
|
190
|
-
}),
|
|
193
|
+
}), se = I(L, {
|
|
191
194
|
Index: K,
|
|
192
195
|
Item: T,
|
|
193
196
|
SortHandle: J,
|
|
@@ -196,11 +199,11 @@ import '../styles/array-base/index.css';const P = /* @__PURE__ */ o({
|
|
|
196
199
|
MoveDown: j,
|
|
197
200
|
MoveUp: q,
|
|
198
201
|
useArray: p,
|
|
199
|
-
useIndex:
|
|
200
|
-
useKey:
|
|
201
|
-
useRecord:
|
|
202
|
+
useIndex: k,
|
|
203
|
+
useKey: F,
|
|
204
|
+
useRecord: E
|
|
202
205
|
});
|
|
203
206
|
export {
|
|
204
|
-
|
|
207
|
+
se as ArrayBase
|
|
205
208
|
};
|
|
206
209
|
//# sourceMappingURL=index.mjs.map
|