@silver-formily/element-plus 1.0.1 → 2.0.1
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 -21
- package/README.md +35 -35
- package/esm/__builtins__/configs/index.mjs.map +1 -1
- package/esm/__builtins__/shared/hooks.mjs.map +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.d.ts +1 -2
- package/esm/__builtins__/shared/transform-component.mjs +1 -1
- package/esm/__builtins__/shared/transform-component.mjs.map +1 -1
- package/esm/__builtins__/shared/utils.mjs +1 -1
- package/esm/__builtins__/shared/utils.mjs.map +1 -1
- package/esm/array-base/index.mjs +39 -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 +29 -33
- package/esm/array-base/utils.mjs.map +1 -1
- package/esm/array-cards/array-cards.d.ts +1 -1
- package/esm/array-cards/index.d.ts +3 -3
- package/esm/array-cards/index.mjs +23 -25
- package/esm/array-cards/index.mjs.map +1 -1
- package/esm/array-collapse/array-collapse.d.ts +2 -2
- package/esm/array-collapse/index.d.ts +3 -3
- package/esm/array-collapse/index.mjs +87 -88
- package/esm/array-collapse/index.mjs.map +1 -1
- package/esm/array-collapse/utils.mjs +2 -8
- package/esm/array-collapse/utils.mjs.map +1 -1
- package/esm/array-items/index.mjs +29 -32
- package/esm/array-items/index.mjs.map +1 -1
- package/esm/array-list-tabs/array-list-tabs.d.ts +3 -3
- package/esm/array-list-tabs/index.d.ts +6 -6
- package/esm/array-list-tabs/index.mjs +88 -86
- package/esm/array-list-tabs/index.mjs.map +1 -1
- package/esm/array-list-tabs/utils.mjs +5 -11
- package/esm/array-list-tabs/utils.mjs.map +1 -1
- package/esm/array-table/array-table.d.ts +1 -1
- package/esm/array-table/index.d.ts +3 -3
- package/esm/array-table/index.mjs +48 -50
- package/esm/array-table/index.mjs.map +1 -1
- package/esm/array-table/types.d.ts +1 -1
- package/esm/array-table/utils.mjs +12 -18
- package/esm/array-table/utils.mjs.map +1 -1
- package/esm/array-tabs/index.mjs +26 -28
- package/esm/array-tabs/index.mjs.map +1 -1
- package/esm/cascader/cascader.d.ts +1 -6
- package/esm/cascader/index.d.ts +3 -16
- package/esm/cascader/index.mjs +26 -32
- package/esm/cascader/index.mjs.map +1 -1
- package/esm/checkbox/checkbox-group.d.ts +2 -15
- package/esm/checkbox/index.d.ts +3 -28
- package/esm/checkbox/index.mjs +33 -45
- package/esm/checkbox/index.mjs.map +1 -1
- package/esm/date-picker/index.d.ts +442 -1
- package/esm/date-picker/index.mjs +9 -18
- package/esm/date-picker/index.mjs.map +1 -1
- package/esm/editable/index.mjs +34 -36
- package/esm/editable/index.mjs.map +1 -1
- package/esm/form/form.mjs +7 -7
- package/esm/form/form.mjs.map +1 -1
- package/esm/form-button-group/index.mjs +20 -23
- package/esm/form-button-group/index.mjs.map +1 -1
- package/esm/form-button-group/utils.mjs +2 -8
- package/esm/form-button-group/utils.mjs.map +1 -1
- package/esm/form-collapse/index.mjs +31 -32
- package/esm/form-collapse/index.mjs.map +1 -1
- package/esm/form-collapse/utils.mjs.map +1 -1
- package/esm/form-dialog/index.mjs +18 -18
- package/esm/form-dialog/index.mjs.map +1 -1
- package/esm/form-drawer/index.mjs +17 -17
- package/esm/form-drawer/index.mjs.map +1 -1
- package/esm/form-grid/hooks.mjs.map +1 -1
- package/esm/form-grid/index.mjs +20 -23
- package/esm/form-grid/index.mjs.map +1 -1
- package/esm/form-item/index.mjs +30 -32
- 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 +11 -14
- package/esm/form-layout/form-layout.mjs.map +1 -1
- package/esm/form-layout/utils.mjs +19 -24
- package/esm/form-layout/utils.mjs.map +1 -1
- package/esm/form-step/index.mjs +22 -24
- package/esm/form-step/index.mjs.map +1 -1
- package/esm/form-step/utils.mjs.map +1 -1
- package/esm/form-tab/form-tab.d.ts +2 -2
- package/esm/form-tab/hooks.mjs +1 -1
- package/esm/form-tab/hooks.mjs.map +1 -1
- package/esm/form-tab/index.d.ts +5 -5
- package/esm/form-tab/index.mjs +28 -29
- package/esm/form-tab/index.mjs.map +1 -1
- package/esm/form-tab/types.d.ts +1 -1
- package/esm/form-tab/utils.mjs.map +1 -1
- package/esm/index.mjs +58 -58
- package/esm/input/index.d.ts +6 -38
- package/esm/input/index.mjs +36 -48
- package/esm/input/index.mjs.map +1 -1
- package/esm/input/input.d.ts +1 -8
- package/esm/input-number/index.d.ts +215 -1
- package/esm/input-number/index.mjs +8 -17
- package/esm/input-number/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 +1 -1
- package/esm/pagination/pagination.mjs.map +1 -1
- package/esm/password/index.d.ts +6 -38
- package/esm/password/index.mjs +1 -1
- package/esm/password/index.mjs.map +1 -1
- package/esm/preview-text/cascader.d.ts +1 -1
- package/esm/preview-text/date-picker.d.ts +1 -1
- package/esm/preview-text/index.d.ts +13 -13
- package/esm/preview-text/index.mjs +115 -118
- package/esm/preview-text/index.mjs.map +1 -1
- package/esm/preview-text/input.d.ts +1 -1
- package/esm/preview-text/select.d.ts +1 -1
- package/esm/preview-text/time-picker.d.ts +1 -1
- package/esm/preview-text/tree.d.ts +1 -1
- package/esm/preview-text/utils.mjs.map +1 -1
- package/esm/radio/index.d.ts +3 -25
- package/esm/radio/index.mjs +34 -44
- package/esm/radio/index.mjs.map +1 -1
- package/esm/radio/radio-group.d.ts +2 -13
- package/esm/reset/index.mjs +1 -1
- package/esm/reset/index.mjs.map +1 -1
- package/esm/select/index.d.ts +3 -16
- package/esm/select/index.mjs +62 -70
- package/esm/select/index.mjs.map +1 -1
- package/esm/select/select.d.ts +1 -6
- package/esm/select-table/index.d.ts +5 -5
- package/esm/select-table/index.mjs +78 -81
- package/esm/select-table/index.mjs.map +1 -1
- package/esm/select-table/select-table.d.ts +2 -2
- package/esm/select-table/types.d.ts +1 -1
- package/esm/submit/index.mjs +1 -1
- package/esm/submit/index.mjs.map +1 -1
- package/esm/switch/index.d.ts +260 -1
- package/esm/switch/index.mjs +5 -11
- package/esm/switch/index.mjs.map +1 -1
- package/esm/time-picker/index.d.ts +442 -1
- package/esm/time-picker/index.mjs +8 -15
- package/esm/time-picker/index.mjs.map +1 -1
- package/esm/time-select/index.d.ts +124 -1
- package/esm/time-select/index.mjs +10 -17
- package/esm/time-select/index.mjs.map +1 -1
- package/esm/transfer/index.mjs +5 -5
- package/esm/transfer/index.mjs.map +1 -1
- package/esm/tree/index.d.ts +5 -5
- package/esm/tree/index.mjs +42 -45
- package/esm/tree/index.mjs.map +1 -1
- package/esm/tree/tree.d.ts +2 -2
- package/esm/tree/types.d.ts +1 -1
- package/esm/tree/utils.mjs.map +1 -1
- package/esm/tree-select/index.d.ts +3 -19
- package/esm/tree-select/index.mjs +22 -32
- package/esm/tree-select/index.mjs.map +1 -1
- package/esm/tree-select/tree-select.d.ts +1 -8
- package/esm/upload/index.d.ts +5 -5
- package/esm/upload/index.mjs +14 -16
- package/esm/upload/index.mjs.map +1 -1
- package/esm/upload/upload.d.ts +2 -2
- package/esm/vendor/sizes.mjs.map +1 -1
- package/package.json +114 -116
|
@@ -1 +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","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/array-tabs/array-tabs.vue","../../src/array-tabs/index.ts"],"sourcesContent":["<script lang=\"ts\" setup>\r\nimport type { ArrayField } from '@formily/core'\r\nimport type { TabPaneName } from 'element-plus'\r\nimport { reaction } from '@formily/reactive'\r\nimport { isEqual, isFn } from '@formily/shared'\r\nimport { RecursionField, useField, useFieldSchema } from '@silver-formily/vue'\r\nimport { ElBadge, ElTabPane, ElTabs } from 'element-plus'\r\nimport { onUnmounted, ref } from 'vue'\r\nimport { useCleanAttrs } from '../__builtins__'\r\nimport { stylePrefix } from '../__builtins__/configs'\r\nimport { getArrayItemSchema } from '../array-base/utils'\r\n\r\ndefineOptions({\r\n name: 'FArrayTabs',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst fieldRef = useField<ArrayField>()\r\nconst schemaRef = useFieldSchema()\r\n\r\nconst prefixCls = `${stylePrefix}-array-tabs`\r\nconst activeKey = ref<TabPaneName>('tab-0')\r\n\r\nconst field = fieldRef.value\r\n/* istanbul ignore else -- @preserve */\r\nif (field.value.length === 0) {\r\n field.value.push(null)\r\n}\r\nconst schema = schemaRef.value\r\nfunction getTabTitle(index: number) {\r\n return `${field.title || 'Untitled'} ${index + 1}`\r\n}\r\n\r\nconst errorCountList = ref([])\r\nconst dispose = reaction(() => {\r\n return field.value.map((item, index) => {\r\n const panelErrors = field.form.queryFeedbacks({\r\n type: 'error',\r\n address: `${field.address.concat(index)}.**`,\r\n })\r\n return panelErrors.length\r\n })\r\n}, (newVal) => {\r\n errorCountList.value = newVal\r\n}, {\r\n equals: isEqual,\r\n})\r\nonUnmounted(() => {\r\n dispose()\r\n})\r\nconst { props: elTabProps } = useCleanAttrs(['value', 'modelValue', 'onUpdate:modelValue'])\r\n</script>\r\n\r\n<template>\r\n <ElTabs\r\n v-bind=\"elTabProps\"\r\n :model-value=\"activeKey\"\r\n :class=\"prefixCls\"\r\n type=\"card\"\r\n :addable=\"true\"\r\n @tab-remove=\"(target) => {\r\n const index = target.toString().match(/tab-(\\d+)/)?.[1]\r\n field.remove(Number(index))\r\n if (activeKey === target) {\r\n activeKey = `tab-${Number(index) - 1}`\r\n }\r\n\r\n if (isFn($attrs['tab-remove'])) {\r\n $attrs['tab-remove'](target)\r\n }\r\n }\"\r\n @tab-add=\"() => {\r\n const id = field.value.length\r\n field.value.push(null)\r\n activeKey = `tab-${id}`\r\n if (isFn($attrs['tab-add'])) {\r\n $attrs['tab-add']()\r\n }\r\n }\"\r\n @change=\"() => {}\"\r\n >\r\n <ElTabPane\r\n v-for=\"(item, index) of field.value\"\r\n :key=\"`tab-${index}`\"\r\n :closable=\"index !== 0\"\r\n :name=\"`tab-${index}`\"\r\n >\r\n <template #default>\r\n <RecursionField\r\n :schema=\"getArrayItemSchema(schema, index)\"\r\n :name=\"index\"\r\n />\r\n </template>\r\n <template #label>\r\n <span v-if=\"errorCountList[index] > 0\">\r\n <ElBadge\r\n :class=\"[`${prefixCls}-errors-badge`]\"\r\n :value=\"errorCountList[index]\"\r\n >\r\n {{ getTabTitle(index) }}\r\n </ElBadge>\r\n </span>\r\n <span v-else>\r\n {{ getTabTitle(index) }}\r\n </span>\r\n </template>\r\n </ElTabPane>\r\n </ElTabs>\r\n</template>\r\n","import FArrayTabs from './array-tabs.vue'\r\nimport './style.scss'\r\n\r\nexport const ArrayTabs = FArrayTabs\r\n\r\nexport default ArrayTabs\r\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","isFn","$attrs","_cache","id","_openBlock","_createElementBlock","_Fragment","ElTabPane","_createVNode","RecursionField","getArrayItemSchema","_hoisted_1","ElBadge","_createTextVNode","_toDisplayString","_hoisted_2","ArrayTabs","FArrayTabs"],"mappings":"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"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CascaderOption } from 'element-plus';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
value?: any;
|
|
4
3
|
options?: CascaderOption[];
|
|
5
4
|
};
|
|
6
5
|
declare function __VLS_template(): {
|
|
@@ -16,11 +15,7 @@ declare function __VLS_template(): {
|
|
|
16
15
|
rootEl: any;
|
|
17
16
|
};
|
|
18
17
|
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>;
|
|
18
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
19
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
20
|
export default _default;
|
|
26
21
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
package/esm/cascader/index.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
export declare const Cascader: {
|
|
2
2
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
3
|
-
value?: any;
|
|
4
3
|
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, {
|
|
4
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
10
5
|
P: {};
|
|
11
6
|
B: {};
|
|
12
7
|
D: {};
|
|
@@ -14,22 +9,14 @@ export declare const Cascader: {
|
|
|
14
9
|
M: {};
|
|
15
10
|
Defaults: {};
|
|
16
11
|
}, Readonly<{
|
|
17
|
-
value?: any;
|
|
18
12
|
options?: import('element-plus').CascaderOption[];
|
|
19
|
-
}> & Readonly<{
|
|
20
|
-
onChange?: (value: any) => any;
|
|
21
|
-
}>, {}, {}, {}, {}, {}>;
|
|
13
|
+
}> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
22
14
|
__isFragment?: never;
|
|
23
15
|
__isTeleport?: never;
|
|
24
16
|
__isSuspense?: never;
|
|
25
17
|
} & import('vue').ComponentOptionsBase<Readonly<{
|
|
26
|
-
value?: any;
|
|
27
18
|
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 () => {
|
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
33
20
|
$slots: {
|
|
34
21
|
default?(_: {
|
|
35
22
|
node: any;
|
package/esm/cascader/index.mjs
CHANGED
|
@@ -1,54 +1,48 @@
|
|
|
1
|
-
import { observer as
|
|
2
|
-
import { connect as c, mapProps as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { useCleanAttrs as S } from "../__builtins__/shared/utils.mjs";
|
|
10
|
-
const b = /* @__PURE__ */ v({
|
|
1
|
+
import { observer as i } from "@formily/reactive-vue";
|
|
2
|
+
import { connect as c, mapProps as d } from "@silver-formily/vue";
|
|
3
|
+
import { PreviewText as l } from "../preview-text/index.mjs";
|
|
4
|
+
import { defineComponent as f, createBlock as u, openBlock as C, unref as o, mergeProps as y, createSlots as P, withCtx as r, renderSlot as t } from "vue";
|
|
5
|
+
import { ElCascader as k } from "element-plus";
|
|
6
|
+
import { useCleanAttrs as v } from "../__builtins__/shared/utils.mjs";
|
|
7
|
+
import { mapReadPretty as $ } from "../__builtins__/shared/transform-component.mjs";
|
|
8
|
+
const h = /* @__PURE__ */ f({
|
|
11
9
|
name: "FCascader",
|
|
12
10
|
inheritAttrs: !1,
|
|
13
11
|
__name: "cascader",
|
|
14
12
|
props: {
|
|
15
|
-
value: null,
|
|
16
13
|
options: null
|
|
17
14
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"model-value": t.value,
|
|
24
|
-
"onUpdate:modelValue": r[0] || (r[0] = (o) => l("change", o))
|
|
25
|
-
}), k({ _: 2 }, [
|
|
15
|
+
setup(s) {
|
|
16
|
+
const a = s, { props: p } = v();
|
|
17
|
+
return (e, S) => (C(), u(o(k), y(o(p), {
|
|
18
|
+
options: a.options
|
|
19
|
+
}), P({ _: 2 }, [
|
|
26
20
|
e.$slots.default ? {
|
|
27
21
|
name: "default",
|
|
28
|
-
fn:
|
|
29
|
-
|
|
30
|
-
node:
|
|
31
|
-
data:
|
|
22
|
+
fn: r(({ node: n, data: m }) => [
|
|
23
|
+
t(e.$slots, "default", {
|
|
24
|
+
node: n,
|
|
25
|
+
data: m
|
|
32
26
|
})
|
|
33
27
|
]),
|
|
34
28
|
key: "0"
|
|
35
29
|
} : void 0,
|
|
36
30
|
e.$slots.empty ? {
|
|
37
31
|
name: "empty",
|
|
38
|
-
fn:
|
|
39
|
-
|
|
32
|
+
fn: r(() => [
|
|
33
|
+
t(e.$slots, "empty")
|
|
40
34
|
]),
|
|
41
35
|
key: "1"
|
|
42
36
|
} : void 0
|
|
43
|
-
]), 1040, ["options"
|
|
37
|
+
]), 1040, ["options"]));
|
|
44
38
|
}
|
|
45
|
-
}),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
}), F = c(
|
|
40
|
+
i(h),
|
|
41
|
+
d({ dataSource: "options", disabled: !0 }),
|
|
42
|
+
$(l.Cascader)
|
|
49
43
|
);
|
|
50
44
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
F as Cascader,
|
|
46
|
+
F as default
|
|
53
47
|
};
|
|
54
48
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +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
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/cascader/cascader.vue","../../src/cascader/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CascaderOption } from 'element-plus'\r\nimport { ElCascader } from 'element-plus'\r\nimport { useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCascader',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\n options: null\n})\r\n\r\nconst { props: cascaderProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCascader\r\n v-bind=\"cascaderProps\"\r\n :options=\"props.options\"\r\n >\r\n <template v-if=\"$slots.default\" #default=\"{ node, data }\">\r\n <slot :node=\"node\" :data=\"data\" />\r\n </template>\r\n <template v-if=\"$slots.empty\" #empty>\r\n <slot name=\"empty\" />\r\n </template>\r\n </ElCascader>\r\n</template>\r\n","import { observer } from '@formily/reactive-vue'\r\nimport { connect, mapProps } from '@silver-formily/vue'\r\nimport { mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FCascader from './cascader.vue'\r\n\r\nexport const Cascader = connect(\r\n observer(FCascader),\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Cascader),\r\n)\r\n\r\nexport default Cascader\r\n"],"names":["props","__props","cascaderProps","useCleanAttrs","_createBlock","_unref","ElCascader","_mergeProps","$slots","node","data","_renderSlot","_ctx","Cascader","connect","observer","FCascader","mapProps","mapReadPretty","PreviewText"],"mappings":";;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAIR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;2BAI/BC,EAUaC,EAAAC,CAAA,GAVbC,EAUaF,EAAAH,CAAA,GATU;AAAA,MACpB,SAASF,EAAM;AAAA,IAAA;MAEAQ,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;;;;;ICpBdC,IAAWC;AAAA,EACtBC,EAASC,CAAS;AAAA,EAClBC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AACpC;"}
|
|
@@ -15,10 +15,6 @@ declare function __VLS_template(): {
|
|
|
15
15
|
};
|
|
16
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
17
|
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
18
|
-
value: {
|
|
19
|
-
type: PropType<Array<any>>;
|
|
20
|
-
default: () => any[];
|
|
21
|
-
};
|
|
22
18
|
options: {
|
|
23
19
|
type: PropType<Array<CheckboxProps>>;
|
|
24
20
|
default: () => any[];
|
|
@@ -27,13 +23,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
27
23
|
type: PropType<"default" | "button">;
|
|
28
24
|
default: string;
|
|
29
25
|
};
|
|
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
|
-
};
|
|
26
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
37
27
|
options: {
|
|
38
28
|
type: PropType<Array<CheckboxProps>>;
|
|
39
29
|
default: () => any[];
|
|
@@ -42,10 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
42
32
|
type: PropType<"default" | "button">;
|
|
43
33
|
default: string;
|
|
44
34
|
};
|
|
45
|
-
}>> & Readonly<{
|
|
46
|
-
onChange?: (...args: any[]) => any;
|
|
47
|
-
}>, {
|
|
48
|
-
value: any[];
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
49
36
|
options: CheckboxProps[];
|
|
50
37
|
optionType: "button" | "default";
|
|
51
38
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/esm/checkbox/index.d.ts
CHANGED
|
@@ -694,10 +694,6 @@ export declare const Checkbox: {
|
|
|
694
694
|
} & {
|
|
695
695
|
Group: {
|
|
696
696
|
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
697
|
-
value: {
|
|
698
|
-
type: import('vue').PropType<Array<any>>;
|
|
699
|
-
default: () => any[];
|
|
700
|
-
};
|
|
701
697
|
options: {
|
|
702
698
|
type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
|
|
703
699
|
default: () => any[];
|
|
@@ -706,12 +702,7 @@ export declare const Checkbox: {
|
|
|
706
702
|
type: import('vue').PropType<"default" | "button">;
|
|
707
703
|
default: string;
|
|
708
704
|
};
|
|
709
|
-
}>> & Readonly<{
|
|
710
|
-
onChange?: (...args: any[]) => any;
|
|
711
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
712
|
-
change: (...args: any[]) => void;
|
|
713
|
-
}, import('vue').PublicProps, {
|
|
714
|
-
value: any[];
|
|
705
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
|
|
715
706
|
options: import('element-plus').CheckboxProps[];
|
|
716
707
|
optionType: "button" | "default";
|
|
717
708
|
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
@@ -722,10 +713,6 @@ export declare const Checkbox: {
|
|
|
722
713
|
M: {};
|
|
723
714
|
Defaults: {};
|
|
724
715
|
}, Readonly<import('vue').ExtractPropTypes<{
|
|
725
|
-
value: {
|
|
726
|
-
type: import('vue').PropType<Array<any>>;
|
|
727
|
-
default: () => any[];
|
|
728
|
-
};
|
|
729
716
|
options: {
|
|
730
717
|
type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
|
|
731
718
|
default: () => any[];
|
|
@@ -734,10 +721,7 @@ export declare const Checkbox: {
|
|
|
734
721
|
type: import('vue').PropType<"default" | "button">;
|
|
735
722
|
default: string;
|
|
736
723
|
};
|
|
737
|
-
}>> & Readonly<{
|
|
738
|
-
onChange?: (...args: any[]) => any;
|
|
739
|
-
}>, {}, {}, {}, {}, {
|
|
740
|
-
value: any[];
|
|
724
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {
|
|
741
725
|
options: import('element-plus').CheckboxProps[];
|
|
742
726
|
optionType: "button" | "default";
|
|
743
727
|
}>;
|
|
@@ -745,10 +729,6 @@ export declare const Checkbox: {
|
|
|
745
729
|
__isTeleport?: never;
|
|
746
730
|
__isSuspense?: never;
|
|
747
731
|
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
748
|
-
value: {
|
|
749
|
-
type: import('vue').PropType<Array<any>>;
|
|
750
|
-
default: () => any[];
|
|
751
|
-
};
|
|
752
732
|
options: {
|
|
753
733
|
type: import('vue').PropType<Array<import('element-plus').CheckboxProps>>;
|
|
754
734
|
default: () => any[];
|
|
@@ -757,12 +737,7 @@ export declare const Checkbox: {
|
|
|
757
737
|
type: import('vue').PropType<"default" | "button">;
|
|
758
738
|
default: string;
|
|
759
739
|
};
|
|
760
|
-
}>> & Readonly<{
|
|
761
|
-
onChange?: (...args: any[]) => any;
|
|
762
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
763
|
-
change: (...args: any[]) => void;
|
|
764
|
-
}, string, {
|
|
765
|
-
value: any[];
|
|
740
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
|
|
766
741
|
options: import('element-plus').CheckboxProps[];
|
|
767
742
|
optionType: "button" | "default";
|
|
768
743
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
package/esm/checkbox/index.mjs
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import { connect as
|
|
2
|
-
import { ElCheckboxButton as
|
|
3
|
-
import {
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import "@formily/core";
|
|
11
|
-
import "@formily/reactive-vue";
|
|
12
|
-
const H = /* @__PURE__ */ G({
|
|
1
|
+
import { connect as _, mapProps as y } from "@silver-formily/vue";
|
|
2
|
+
import { ElCheckboxButton as S, ElCheckbox as h, ElCheckboxGroup as g, version as E } from "element-plus";
|
|
3
|
+
import { PreviewText as T } from "../preview-text/index.mjs";
|
|
4
|
+
import { defineComponent as A, computed as c, useSlots as B, createBlock as a, openBlock as o, unref as p, normalizeProps as G, guardReactiveProps as w, withCtx as l, createElementBlock as m, Fragment as i, renderList as f, resolveDynamicComponent as b, mergeProps as d, createTextVNode as D, toDisplayString as F, renderSlot as I } from "vue";
|
|
5
|
+
import { isPlainObj as k } from "@formily/shared";
|
|
6
|
+
import { lt as L } from "../__builtins__/shared/simple-version-compare.mjs";
|
|
7
|
+
import { useCleanAttrs as N, composeExport as O } from "../__builtins__/shared/utils.mjs";
|
|
8
|
+
import { mapReadPretty as R } from "../__builtins__/shared/transform-component.mjs";
|
|
9
|
+
const j = /* @__PURE__ */ A({
|
|
13
10
|
name: "FCheckboxGroup",
|
|
14
11
|
inheritAttrs: !1,
|
|
15
12
|
__name: "checkbox-group",
|
|
16
13
|
props: {
|
|
17
|
-
value: {
|
|
18
|
-
type: Array,
|
|
19
|
-
default: () => []
|
|
20
|
-
},
|
|
21
14
|
options: {
|
|
22
15
|
type: Array,
|
|
23
16
|
default: () => []
|
|
@@ -27,57 +20,52 @@ const H = /* @__PURE__ */ G({
|
|
|
27
20
|
default: "default"
|
|
28
21
|
}
|
|
29
22
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (!y(e))
|
|
23
|
+
setup(x) {
|
|
24
|
+
const n = x, s = c(() => n.optionType === "button" ? S : h), C = L(E, "2.6.0"), u = c(() => n.options.map((e) => {
|
|
25
|
+
if (!k(e))
|
|
34
26
|
return {
|
|
35
27
|
label: e,
|
|
36
28
|
value: e
|
|
37
29
|
};
|
|
38
30
|
/* istanbul ignore if -- @preserve */
|
|
39
|
-
return
|
|
31
|
+
return C ? {
|
|
40
32
|
...e,
|
|
41
33
|
label: e.value
|
|
42
34
|
} : e;
|
|
43
|
-
})),
|
|
44
|
-
return (e,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
a(P).option ? (l(!0), f(d, { key: 1 }, b(m.value, (t, r) => (l(), n(k(s.value), u({ key: r }, { ref_for: !0 }, t), {
|
|
50
|
-
default: p(() => [
|
|
51
|
-
F(e.$slots, "option", { option: t })
|
|
35
|
+
})), v = B(), { props: P } = N();
|
|
36
|
+
return (e, V) => (o(), a(p(g), G(w(p(P))), {
|
|
37
|
+
default: l(() => [
|
|
38
|
+
p(v).option ? (o(!0), m(i, { key: 1 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
|
|
39
|
+
default: l(() => [
|
|
40
|
+
I(e.$slots, "option", { option: t })
|
|
52
41
|
]),
|
|
53
42
|
_: 2
|
|
54
|
-
}, 1040))), 128)) : (
|
|
55
|
-
default:
|
|
56
|
-
|
|
43
|
+
}, 1040))), 128)) : (o(!0), m(i, { key: 0 }, f(u.value, (t, r) => (o(), a(b(s.value), d({ key: r }, { ref_for: !0 }, t), {
|
|
44
|
+
default: l(() => [
|
|
45
|
+
D(F(p(k)(n.options[r]) ? n.options[r]?.label : t.label), 1)
|
|
57
46
|
]),
|
|
58
47
|
_: 2
|
|
59
48
|
}, 1040))), 128))
|
|
60
49
|
]),
|
|
61
50
|
_: 3
|
|
62
|
-
}, 16
|
|
51
|
+
}, 16));
|
|
63
52
|
}
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
53
|
+
}), z = _(
|
|
54
|
+
j,
|
|
55
|
+
y({ dataSource: "options", disabled: !0 }),
|
|
56
|
+
R(T.Select, {
|
|
68
57
|
multiple: !0
|
|
69
58
|
})
|
|
70
|
-
),
|
|
59
|
+
), H = _(
|
|
71
60
|
h,
|
|
72
|
-
|
|
73
|
-
value: "modelValue",
|
|
61
|
+
y({
|
|
74
62
|
disabled: !0
|
|
75
63
|
})
|
|
76
|
-
),
|
|
77
|
-
Group:
|
|
64
|
+
), X = O(H, {
|
|
65
|
+
Group: z
|
|
78
66
|
});
|
|
79
67
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
68
|
+
X as Checkbox,
|
|
69
|
+
X as default
|
|
82
70
|
};
|
|
83
71
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { CheckboxProps } from 'element-plus'\nimport type { PropType } from 'vue'\nimport { isPlainObj } from '@formily/shared'\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\nimport { computed, useSlots } from 'vue'\nimport { lt, useCleanAttrs } from '../__builtins__'\n\ndefineOptions({\n name: 'FCheckboxGroup',\n inheritAttrs: false,\n})\n\nconst props = defineProps({\
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/checkbox/checkbox-group.vue","../../src/checkbox/index.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { CheckboxProps } from 'element-plus'\r\nimport type { PropType } from 'vue'\r\nimport { isPlainObj } from '@formily/shared'\r\nimport { ElCheckbox, ElCheckboxButton, ElCheckboxGroup, version } from 'element-plus'\r\nimport { computed, useSlots } from 'vue'\r\nimport { lt, useCleanAttrs } from '../__builtins__'\r\n\r\ndefineOptions({\r\n name: 'FCheckboxGroup',\r\n inheritAttrs: false,\r\n})\r\n\r\nconst props = defineProps({\r\n options: {\r\n type: Array as PropType<Array<CheckboxProps>>,\r\n default: () => [],\r\n },\r\n optionType: {\r\n type: String as PropType<'default' | 'button'>,\r\n default: 'default',\r\n },\r\n})\r\n\r\nconst OptionType = computed(() => {\r\n return props.optionType === 'button' ? ElCheckboxButton : ElCheckbox\r\n})\r\nconst IS_LESS_THAN_2_6_0 = lt(version, '2.6.0')\r\nconst compatiableProps = computed(() => {\r\n return props.options.map((option) => {\r\n if (!isPlainObj(option)) {\r\n return {\r\n label: option,\r\n value: option,\r\n }\r\n }\r\n /* istanbul ignore if -- @preserve */\r\n if (IS_LESS_THAN_2_6_0) {\r\n return {\r\n ...option,\r\n label: option.value,\r\n }\r\n }\r\n return option\r\n })\r\n})\r\n\r\nconst slots = useSlots()\r\nconst { props: checkboxProps } = useCleanAttrs()\r\n</script>\r\n\r\n<template>\r\n <ElCheckboxGroup v-bind=\"checkboxProps\">\r\n <template v-if=\"!slots.option\">\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n {{ isPlainObj(props.options[index]) ? props.options[index]?.label : option.label }}\r\n </component>\r\n </template>\r\n <template v-else>\r\n <component :is=\"OptionType\" v-for=\"(option, index) of compatiableProps\" :key=\"index\" v-bind=\"option\">\r\n <slot name=\"option\" :option=\"option\" />\r\n </component>\r\n </template>\r\n </ElCheckboxGroup>\r\n</template>\r\n","import { connect, mapProps } from '@silver-formily/vue'\r\nimport { ElCheckbox } from 'element-plus'\r\nimport { composeExport, mapReadPretty } from '../__builtins__'\r\nimport { PreviewText } from '../preview-text'\r\nimport FCheckboxGroup from './checkbox-group.vue'\r\n\r\nconst CheckboxGroup = connect(\r\n FCheckboxGroup,\r\n mapProps({ dataSource: 'options', disabled: true }),\r\n mapReadPretty(PreviewText.Select, {\r\n multiple: true,\r\n }),\r\n)\r\n\r\nconst InnerCheckbox = connect(\r\n ElCheckbox,\r\n mapProps({\r\n disabled: true,\r\n }),\r\n)\r\n\r\nexport const Checkbox = composeExport(InnerCheckbox, {\r\n Group: CheckboxGroup,\r\n})\r\n\r\nexport default Checkbox\r\n"],"names":["props","__props","OptionType","computed","ElCheckboxButton","ElCheckbox","IS_LESS_THAN_2_6_0","lt","version","compatiableProps","option","isPlainObj","slots","useSlots","checkboxProps","useCleanAttrs","_openBlock","_createBlock","_unref","_createElementBlock","_Fragment","_renderList","index","_resolveDynamicComponent","_mergeProps","_renderSlot","_ctx","_createTextVNode","_toDisplayString","CheckboxGroup","connect","FCheckboxGroup","mapProps","mapReadPretty","PreviewText","InnerCheckbox","Checkbox","composeExport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAaA,UAAMA,IAAQC,GAWRC,IAAaC,EAAS,MACnBH,EAAM,eAAe,WAAWI,IAAmBC,CAC3D,GACKC,IAAqBC,EAAGC,GAAS,OAAO,GACxCC,IAAmBN,EAAS,MACzBH,EAAM,QAAQ,IAAI,CAACU,MAAW;AACnC,UAAI,CAACC,EAAWD,CAAM;AACpB,eAAO;AAAA,UACL,OAAOA;AAAA,UACP,OAAOA;AAAA,QAAA;AAAA,MAEX;AAEA,aAAIJ,IACK;AAAA,QACL,GAAGI;AAAA,QACH,OAAOA,EAAO;AAAA,MAAA,IAGXA;AAAA,IACT,CAAC,CACF,GAEKE,IAAQC,EAAA,GACR,EAAE,OAAOC,EAAA,IAAkBC,EAAA;sBAI/BC,EAAA,GAAAC,EAWkBC,UAXOA,EAAAJ,CAAA,CAAa,CAAA,GAAA;AAAA,iBACpC,MAIW;AAAA,QAJMI,EAAAN,CAAA,EAAM,UAMrBI,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAuC;AAAA,YAAvCe,EAAuCC,EAAA,QAAA,UAAA,EAAlB,QAAAhB,GAAc;AAAA,UAAA;;6BANrCM,EAAA,EAAA,GAAAG,EAEYC,GAAA,EAAA,KAAA,KAAAC,EAF0CZ,EAAA,OAAgB,CAAlCC,GAAQY,YAA5CL,EAEYM,EAFIrB,OAAU,GAA1BsB,EAEY,EAF6D,KAAKF,KAAK,EAAA,SAAA,GAAA,GAAUZ,CAAM,GAAA;AAAA,qBACjG,MAAmF;AAAA,YAAhFiB,EAAAC,EAAAV,EAAAP,CAAA,EAAWX,EAAM,QAAQsB,CAAK,CAAA,IAAKtB,EAAM,QAAQsB,CAAK,GAAG,QAAQZ,EAAO,KAAK,GAAA,CAAA;AAAA,UAAA;;;;;;;ICjDlFmB,IAAgBC;AAAA,EACpBC;AAAAA,EACAC,EAAS,EAAE,YAAY,WAAW,UAAU,IAAM;AAAA,EAClDC,EAAcC,EAAY,QAAQ;AAAA,IAChC,UAAU;AAAA,EAAA,CACX;AACH,GAEMC,IAAgBL;AAAA,EACpBzB;AAAA,EACA2B,EAAS;AAAA,IACP,UAAU;AAAA,EAAA,CACX;AACH,GAEaI,IAAWC,EAAcF,GAAe;AAAA,EACnD,OAAON;AACT,CAAC;"}
|