ll-plus 2.2.12 → 2.2.14
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/es/components/checkbox/src/checkbox-group.vue2.mjs +3 -2
- package/es/components/checkbox/src/checkbox-group.vue2.mjs.map +1 -1
- package/es/components/key-value/index.d.ts +6 -6
- package/es/components/key-value/src/components/key-value-item.vue.d.ts +1 -1
- package/es/components/key-value/src/components/key-value-item.vue2.mjs +5 -5
- package/es/components/key-value/src/components/key-value-item.vue2.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value-item.d.ts +1 -1
- package/es/components/key-value/src/config/key-value-item.mjs.map +1 -1
- package/es/components/key-value/src/config/key-value.d.ts +2 -2
- package/es/components/key-value/src/config/key-value.mjs +2 -2
- package/es/components/key-value/src/config/key-value.mjs.map +1 -1
- package/es/components/key-value/src/key-value.vue.d.ts +6 -6
- package/es/components/key-value/src/key-value.vue2.mjs +13 -6
- package/es/components/key-value/src/key-value.vue2.mjs.map +1 -1
- package/index.full.js +23 -15
- package/index.full.min.js +2 -2
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +2 -2
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +23 -15
- package/lib/components/checkbox/src/checkbox-group.vue2.js +3 -2
- package/lib/components/checkbox/src/checkbox-group.vue2.js.map +1 -1
- package/lib/components/key-value/index.d.ts +6 -6
- package/lib/components/key-value/src/components/key-value-item.vue.d.ts +1 -1
- package/lib/components/key-value/src/components/key-value-item.vue2.js +5 -5
- package/lib/components/key-value/src/components/key-value-item.vue2.js.map +1 -1
- package/lib/components/key-value/src/config/key-value-item.d.ts +1 -1
- package/lib/components/key-value/src/config/key-value-item.js.map +1 -1
- package/lib/components/key-value/src/config/key-value.d.ts +2 -2
- package/lib/components/key-value/src/config/key-value.js +2 -2
- package/lib/components/key-value/src/config/key-value.js.map +1 -1
- package/lib/components/key-value/src/key-value.vue.d.ts +6 -6
- package/lib/components/key-value/src/key-value.vue2.js +13 -6
- package/lib/components/key-value/src/key-value.vue2.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/css/checkbox.css +1 -1
- package/theme-chalk/css/index.css +1 -1
- package/types/packages/components/key-value/index.d.ts +6 -6
- package/types/packages/components/key-value/src/components/key-value-item.vue.d.ts +1 -1
- package/types/packages/components/key-value/src/config/key-value-item.d.ts +1 -1
- package/types/packages/components/key-value/src/config/key-value.d.ts +2 -2
- package/types/packages/components/key-value/src/key-value.vue.d.ts +6 -6
|
@@ -30,7 +30,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
renderList(props.options, (item, idx) => {
|
|
31
31
|
return openBlock(), createBlock(unref(Col), mergeProps({ ref_for: true }, item.colOptions, {
|
|
32
32
|
key: idx,
|
|
33
|
-
span: item.span || 24
|
|
33
|
+
span: item.span || 24,
|
|
34
|
+
class: unref(bem).e("item")
|
|
34
35
|
}), {
|
|
35
36
|
default: withCtx(() => [
|
|
36
37
|
createVNode(
|
|
@@ -55,7 +56,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
55
56
|
]),
|
|
56
57
|
_: 2
|
|
57
58
|
/* DYNAMIC */
|
|
58
|
-
}, 1040, ["span"]);
|
|
59
|
+
}, 1040, ["span", "class"]);
|
|
59
60
|
}),
|
|
60
61
|
128
|
|
61
62
|
/* KEYED_FRAGMENT */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox-group.vue2.mjs","sources":["../../../../../packages/components/checkbox/src/checkbox-group.vue"],"sourcesContent":["<template>\n <CheckboxGroup :class=\"bem.b()\" v-bind=\"attrs\">\n <Row v-bind=\"props.rowOptions\">\n <Col\n v-for=\"(item, idx) in props.options\"\n v-bind=\"item.colOptions\"\n :key=\"idx\"\n :span=\"item.span || 24\"\n >\n <checkbox v-bind=\"item\">\n <slot v-bind=\"item\">\n {{ item.label }}\n </slot>\n </checkbox>\n </Col>\n </Row>\n </CheckboxGroup>\n</template>\n\n<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Row, Col, CheckboxGroup } from 'ant-design-vue'\nimport { checkboxGroupProps } from './checkbox'\nimport Checkbox from './checkbox.vue'\n\nimport { createNamespace } from '@ll-plus/utils'\n\ndefineOptions({ name: 'LlCheckboxGroup' })\n\nconst props = defineProps(checkboxGroupProps)\n\nconst bem = createNamespace('checkbox-group')\n\nconst attrs = useAttrs()\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"checkbox-group.vue2.mjs","sources":["../../../../../packages/components/checkbox/src/checkbox-group.vue"],"sourcesContent":["<template>\n <CheckboxGroup :class=\"bem.b()\" v-bind=\"attrs\">\n <Row v-bind=\"props.rowOptions\">\n <Col\n v-for=\"(item, idx) in props.options\"\n v-bind=\"item.colOptions\"\n :key=\"idx\"\n :span=\"item.span || 24\"\n :class=\"bem.e('item')\"\n >\n <checkbox v-bind=\"item\">\n <slot v-bind=\"item\">\n {{ item.label }}\n </slot>\n </checkbox>\n </Col>\n </Row>\n </CheckboxGroup>\n</template>\n\n<script setup lang=\"ts\">\nimport { useAttrs } from 'vue'\nimport { Row, Col, CheckboxGroup } from 'ant-design-vue'\nimport { checkboxGroupProps } from './checkbox'\nimport Checkbox from './checkbox.vue'\n\nimport { createNamespace } from '@ll-plus/utils'\n\ndefineOptions({ name: 'LlCheckboxGroup' })\n\nconst props = defineProps(checkboxGroupProps)\n\nconst bem = createNamespace('checkbox-group')\n\nconst attrs = useAttrs()\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;AA8BA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAM,gBAAgB,gBAAgB,CAAA,CAAA;AAE5C,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -9,7 +9,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
9
9
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
10
10
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
11
11
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
12
|
-
readonly
|
|
12
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
13
13
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
14
14
|
(): any;
|
|
15
15
|
new (): any;
|
|
@@ -37,13 +37,13 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
37
37
|
}, boolean>;
|
|
38
38
|
}, {
|
|
39
39
|
props: import("@vue/shared").LooseRequired<{
|
|
40
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
41
40
|
readonly value: import("./src/config").KeyValueItem[];
|
|
42
41
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
43
42
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
44
43
|
readonly keyLabel: string;
|
|
45
44
|
readonly valueLabel: string;
|
|
46
45
|
readonly addText: string;
|
|
46
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
47
47
|
readonly keyType: any;
|
|
48
48
|
readonly keyTypes: import("./src/config").KeyType[];
|
|
49
49
|
readonly valueType: any;
|
|
@@ -64,7 +64,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
64
64
|
};
|
|
65
65
|
innerValue: import("vue").Ref<{
|
|
66
66
|
key: string | null;
|
|
67
|
-
value:
|
|
67
|
+
value: any;
|
|
68
68
|
}[]>;
|
|
69
69
|
keyValueItems: import("vue").Ref<any[]>;
|
|
70
70
|
keyValueTypeDict: import("vue").ComputedRef<{}>;
|
|
@@ -103,7 +103,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
103
103
|
};
|
|
104
104
|
innerValue: import("vue").Ref<{
|
|
105
105
|
key: string | null;
|
|
106
|
-
value:
|
|
106
|
+
value: any;
|
|
107
107
|
}>;
|
|
108
108
|
getKeyType: import("vue").ComputedRef<any>;
|
|
109
109
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -383,7 +383,7 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
383
383
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
384
384
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
385
385
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
386
|
-
readonly
|
|
386
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
387
387
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
388
388
|
(): any;
|
|
389
389
|
new (): any;
|
|
@@ -414,13 +414,13 @@ export declare const LlKeyValue: import("ll-plus/es/utils").SFCWithInstall<impor
|
|
|
414
414
|
"onUpdate:value"?: ((value: import("./src/config").KeyValueItem[]) => any) | undefined;
|
|
415
415
|
onAdd?: (() => any) | undefined;
|
|
416
416
|
}, {
|
|
417
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
418
417
|
readonly value: import("./src/config").KeyValueItem[];
|
|
419
418
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
420
419
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
421
420
|
readonly keyLabel: string;
|
|
422
421
|
readonly valueLabel: string;
|
|
423
422
|
readonly addText: string;
|
|
423
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
424
424
|
readonly keyType: any;
|
|
425
425
|
readonly keyTypes: import("./src/config").KeyType[];
|
|
426
426
|
readonly valueType: any;
|
|
@@ -30,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
30
30
|
};
|
|
31
31
|
innerValue: import("vue").Ref<{
|
|
32
32
|
key: string | null;
|
|
33
|
-
value:
|
|
33
|
+
value: any;
|
|
34
34
|
}>;
|
|
35
35
|
getKeyType: import("vue").ComputedRef<any>;
|
|
36
36
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -75,7 +75,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
75
|
class: normalizeClass(unref(bem).e("item"))
|
|
76
76
|
},
|
|
77
77
|
[
|
|
78
|
-
unref(attrs)
|
|
78
|
+
unref(attrs)["key-value-type"] !== "single" ? (openBlock(), createElementBlock(
|
|
79
79
|
"div",
|
|
80
80
|
{
|
|
81
81
|
key: 0,
|
|
@@ -103,8 +103,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
103
|
onChange: handleChange
|
|
104
104
|
}, null, 8, ["value", "options", "disabled"])) : (openBlock(), createBlock(resolveDynamicComponent(`ll-${getKeyType.value.type}`), mergeProps({
|
|
105
105
|
key: 1,
|
|
106
|
-
value: innerValue.value["
|
|
107
|
-
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["
|
|
106
|
+
value: innerValue.value["key"],
|
|
107
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["key"] = $event),
|
|
108
108
|
disabled: unref(attrs).disabled
|
|
109
109
|
}, getKeyType.value, {
|
|
110
110
|
style: { "width": "100%" },
|
|
@@ -131,7 +131,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
131
131
|
2
|
|
132
132
|
/* CLASS */
|
|
133
133
|
)) : createCommentVNode("v-if", true),
|
|
134
|
-
unref(attrs)
|
|
134
|
+
unref(attrs)["key-value-type"] !== "single" ? (openBlock(), createElementBlock(
|
|
135
135
|
"div",
|
|
136
136
|
{
|
|
137
137
|
key: 1,
|
|
@@ -211,7 +211,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
211
211
|
},
|
|
212
212
|
[
|
|
213
213
|
createVNode(_component_ll_button, {
|
|
214
|
-
type: "
|
|
214
|
+
type: "link",
|
|
215
215
|
disabled: unref(attrs).disabled
|
|
216
216
|
}, {
|
|
217
217
|
default: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"form\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div
|
|
1
|
+
{"version":3,"file":"key-value-item.vue2.mjs","sources":["../../../../../../packages/components/key-value/src/components/key-value-item.vue"],"sourcesContent":["<template>\n <ll-form\n ref=\"form\"\n :form-columns=\"formColumns\"\n :form-data=\"props.value\"\n :form-options=\"formOptions\"\n >\n <template #formItem=\"{ item }\">\n <template v-if=\"item.key === 'other'\">\n <div :class=\"bem.e('item')\">\n <div\n v-if=\"attrs['key-value-type'] !== 'single'\"\n :class=\"bem.m('left')\"\n >\n <ll-form-item\n :label=\"attrs['key-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rules=\"getKeyType.role\"\n name=\"key\"\n >\n <slot name=\"key\">\n <ll-select\n v-if=\"!isEmpty(attrs['key-types'])\"\n v-model:value=\"innerValue['key']\"\n :options=\"attrs['key-types']\"\n :disabled=\"attrs.disabled\"\n placeholder=\"请选择\"\n allow-clear\n @change=\"handleChange\"\n />\n <component\n :is=\"`ll-${getKeyType.type}`\"\n v-else\n v-model:value=\"innerValue['key']\"\n :disabled=\"attrs.disabled\"\n v-bind=\"getKeyType\"\n style=\"width: 100%\"\n @change=\"handleChange\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"key\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <div\n v-if=\"attrs['key-value-type'] !== 'single'\"\n :class=\"bem.m('separator')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label'] ? '26px' : '0px'\n }\"\n >\n <slot name=\"separator\">~</slot>\n </div>\n\n <div :class=\"bem.m('right')\">\n <ll-form-item\n :label=\"attrs['value-label']\"\n :label-col=\"{\n span: 24\n }\"\n :rule=\"getValueType.rule || {}\"\n name=\"value\"\n >\n <slot name=\"value-warapper\" v-bind=\"getValueType\">\n <component\n :is=\"`ll-${getValueType.type}`\"\n v-model:value=\"innerValue['value']\"\n :disabled=\"attrs.disabled\"\n style=\"width: 100%\"\n v-bind=\"getValueType\"\n >\n <template\n v-for=\"_item in Object.keys($slots)\"\n :key=\"_item\"\n #[_item]=\"data\"\n >\n <slot\n :name=\"_item\"\n v-bind=\"data || {}\"\n content=\"value\"\n ></slot>\n </template>\n </component>\n </slot>\n </ll-form-item>\n </div>\n\n <a-popconfirm\n title=\"你确定要移除?\"\n ok-text=\"确认\"\n cancel-text=\"取消\"\n placement=\"topRight\"\n :overlay-class-name=\"bem.m('popconfirm')\"\n @confirm=\"handleDelete\"\n >\n <div\n v-if=\"props.showDelete\"\n :class=\"bem.m('delete')\"\n :style=\"{\n 'margin-top':\n !!attrs['key-label'] || !!attrs['value-label']\n ? '26px'\n : '0px'\n }\"\n >\n <ll-button type=\"link\" :disabled=\"attrs.disabled\">\n <slot name=\"delete-icon\">\n <ll-icon icon-name=\"icon-remove\" class=\"delete\" />\n </slot>\n </ll-button>\n </div>\n </a-popconfirm>\n </div>\n </template>\n </template>\n </ll-form>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, useAttrs, watch } from 'vue'\nimport { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport {\n typeRules,\n keyValueItemProps,\n keyValueItemEmits,\n formColumns,\n formOptions\n} from '../config'\nimport { type FormColumn } from '@ll-plus/components'\n\ndefineOptions({\n name: 'LlKeyValueItem'\n})\n\nconst props = defineProps(keyValueItemProps)\nconst emits = defineEmits(keyValueItemEmits)\n\nconst attrs = useAttrs()\nconst bem = createNamespace('key-value')\nconst innerValue = ref(props.value)\n\nconst getKeyType = computed<FormColumn>(() => {\n const option = attrs['key-type'] || {\n type: 'input',\n placeholder: '请输入',\n rule: typeRules || []\n }\n return option\n})\nconst getValueType = computed<FormColumn>(() => {\n let option = attrs['value-type'] || {\n type: 'input',\n placeholder: '请输入',\n rule: []\n }\n if (innerValue.value['key'] && !isEmpty(props.keyValueTypeDict)) {\n option = props.keyValueTypeDict[innerValue.value['key']]\n }\n return option\n})\n\nconst handleDelete = () => {\n emits('delete')\n}\n\nconst handleChange = () => {\n innerValue.value['value'] = ''\n}\n\nwatch(\n innerValue,\n val => {\n emits('update:value', val)\n emits('change')\n },\n {\n deep: true\n }\n)\n</script>\n\n<style scoped></style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAqJA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AACvB,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;AACvC,IAAM,MAAA,UAAA,GAAa,GAAI,CAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAElC,IAAM,MAAA,UAAA,GAAa,SAAqB,MAAM;AAC5C,MAAM,MAAA,MAAA,GAAS,KAAM,CAAA,UAAU,CAAK,IAAA;AAAA,QAClC,IAAM,EAAA,OAAA;AAAA,QACN,WAAa,EAAA,oBAAA;AAAA,QACb,IAAA,EAAM,aAAa,EAAC;AAAA,OACtB,CAAA;AACA,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AACD,IAAM,MAAA,YAAA,GAAe,SAAqB,MAAM;AAC9C,MAAI,IAAA,MAAA,GAAS,KAAM,CAAA,YAAY,CAAK,IAAA;AAAA,QAClC,IAAM,EAAA,OAAA;AAAA,QACN,WAAa,EAAA,oBAAA;AAAA,QACb,MAAM,EAAC;AAAA,OACT,CAAA;AACA,MAAI,IAAA,UAAA,CAAW,MAAM,KAAK,CAAA,IAAK,CAAC,OAAQ,CAAA,KAAA,CAAM,gBAAgB,CAAG,EAAA;AAC/D,QAAA,MAAA,GAAS,KAAM,CAAA,gBAAA,CAAiB,UAAW,CAAA,KAAA,CAAM,KAAK,CAAC,CAAA,CAAA;AAAA,OACzD;AACA,MAAO,OAAA,MAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,MAAM,eAAe,MAAM;AACzB,MAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAAA,KAChB,CAAA;AAEA,IAAA,MAAM,eAAe,MAAM;AACzB,MAAW,UAAA,CAAA,KAAA,CAAM,OAAO,CAAI,GAAA,EAAA,CAAA;AAAA,KAC9B,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,UAAA;AAAA,MACA,CAAO,GAAA,KAAA;AACL,QAAA,KAAA,CAAM,gBAAgB,GAAG,CAAA,CAAA;AACzB,QAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAAA,OAChB;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -235,7 +235,7 @@ export declare const formColumns: {
|
|
|
235
235
|
}[];
|
|
236
236
|
export interface KeyValueItem {
|
|
237
237
|
key: string | null;
|
|
238
|
-
value:
|
|
238
|
+
value: any | null;
|
|
239
239
|
}
|
|
240
240
|
export declare const keyValueItemProps: {
|
|
241
241
|
readonly value: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => KeyValueItem) | (() => KeyValueItem) | ((new (...args: any[]) => KeyValueItem) | (() => KeyValueItem))[], unknown, unknown, () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value-item.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\n\nexport const typeRules = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any) => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\nexport const formOptions = {\n layout: 'horizontal',\n labelAlign: 'left'\n} as FormProps\n\nexport const formColumns = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\nexport interface KeyValueItem {\n key: string | null\n value:
|
|
1
|
+
{"version":3,"file":"key-value-item.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\nimport type { FormProps } from 'ant-design-vue'\n\nexport const typeRules = [\n {\n trigger: ['blur', 'change'],\n message: '此字段是必需的',\n validator: async (_rule: any, value: any) => {\n if (!value) {\n return Promise.reject(new Error('此字段是必需的'))\n } else {\n return Promise.resolve()\n }\n }\n }\n]\nexport const formOptions = {\n layout: 'horizontal',\n labelAlign: 'left'\n} as FormProps\n\nexport const formColumns = [\n {\n key: 'other',\n labelCol: {\n span: 24\n }\n }\n]\n\nexport interface KeyValueItem {\n key: string | null\n value: any | null\n}\n \nexport const keyValueItemProps = buildProps({\n value: {\n type: definePropType<KeyValueItem>(Object),\n default: () => ({\n key: '',\n value: ''\n })\n },\n keyValueTypeDict: {\n type: Object,\n default: () => ({})\n },\n showDelete: {\n type: Boolean,\n default: true\n }\n} as const)\n\nexport const keyValueItemEmits = {\n delete: () => true,\n change: () => true,\n 'update:value': (value: KeyValueItem) => !!value\n}\n"],"names":[],"mappings":";;;;AAGO,MAAM,SAAY,GAAA;AAAA,EACvB;AAAA,IACE,OAAA,EAAS,CAAC,MAAA,EAAQ,QAAQ,CAAA;AAAA,IAC1B,OAAS,EAAA,4CAAA;AAAA,IACT,SAAA,EAAW,OAAO,KAAA,EAAY,KAAe,KAAA;AAC3C,MAAA,IAAI,CAAC,KAAO,EAAA;AACV,QAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,4CAAS,CAAC,CAAA,CAAA;AAAA,OACrC,MAAA;AACL,QAAA,OAAO,QAAQ,OAAQ,EAAA,CAAA;AAAA,OACzB;AAAA,KACF;AAAA,GACF;AACF,EAAA;AACO,MAAM,WAAc,GAAA;AAAA,EACzB,MAAQ,EAAA,YAAA;AAAA,EACR,UAAY,EAAA,MAAA;AACd,EAAA;AAEO,MAAM,WAAc,GAAA;AAAA,EACzB;AAAA,IACE,GAAK,EAAA,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,EAAA;AAAA,KACR;AAAA,GACF;AACF,EAAA;AAOO,MAAM,oBAAoB,UAAW,CAAA;AAAA,EAC1C,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA6B,MAAM,CAAA;AAAA,IACzC,SAAS,OAAO;AAAA,MACd,GAAK,EAAA,EAAA;AAAA,MACL,KAAO,EAAA,EAAA;AAAA,KACT,CAAA;AAAA,GACF;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,IAAM,EAAA,MAAA;AAAA,IACN,OAAA,EAAS,OAAO,EAAC,CAAA;AAAA,GACnB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,IAAA;AAAA,GACX;AACF,CAAU,EAAA;AAEH,MAAM,iBAAoB,GAAA;AAAA,EAC/B,QAAQ,MAAM,IAAA;AAAA,EACd,QAAQ,MAAM,IAAA;AAAA,EACd,cAAgB,EAAA,CAAC,KAAwB,KAAA,CAAC,CAAC,KAAA;AAC7C;;;;"}
|
|
@@ -7,7 +7,7 @@ export interface KeyType {
|
|
|
7
7
|
value: string;
|
|
8
8
|
option: FormColumn;
|
|
9
9
|
}
|
|
10
|
-
type
|
|
10
|
+
type KeyValueType = 'single' | 'doubt';
|
|
11
11
|
export declare const getKeyValueItem: () => {
|
|
12
12
|
key: null;
|
|
13
13
|
value: null;
|
|
@@ -22,7 +22,7 @@ export declare const keyValueProps: {
|
|
|
22
22
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
23
23
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
24
24
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
25
|
-
readonly
|
|
25
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => KeyValueType) | ((new (...args: any[]) => "single" | "doubt") | (() => KeyValueType))[], unknown, unknown, "doubt", boolean>;
|
|
26
26
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
27
27
|
(): any;
|
|
28
28
|
new (): any;
|
|
@@ -31,7 +31,7 @@ const keyValueProps = buildProps({
|
|
|
31
31
|
type: String,
|
|
32
32
|
default: "\u6DFB\u52A0"
|
|
33
33
|
},
|
|
34
|
-
|
|
34
|
+
keyValueType: {
|
|
35
35
|
type: definePropType(String),
|
|
36
36
|
default: "doubt"
|
|
37
37
|
},
|
|
@@ -39,7 +39,7 @@ const keyValueProps = buildProps({
|
|
|
39
39
|
type: definePropType(Object),
|
|
40
40
|
default: () => ({
|
|
41
41
|
type: "input",
|
|
42
|
-
placeholder: "\u8BF7\u8F93\
|
|
42
|
+
placeholder: "\u8BF7\u8F93\u5165value"
|
|
43
43
|
})
|
|
44
44
|
},
|
|
45
45
|
keyTypes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { KeyValueItem } from './key-value-item'\nimport type KeyValue from '../key-value.vue'\n\nexport interface KeyType {\n label: string\n value: string\n option: FormColumn\n}\n\ntype
|
|
1
|
+
{"version":3,"file":"key-value.mjs","sources":["../../../../../../packages/components/key-value/src/config/key-value.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport { type FormColumn } from '@ll-plus/components'\nimport type { KeyValueItem } from './key-value-item'\nimport type KeyValue from '../key-value.vue'\n\nexport interface KeyType {\n label: string\n value: string\n option: FormColumn\n}\n\ntype KeyValueType = 'single' | 'doubt'\n\nexport const getKeyValueItem = () => ({\n key: null,\n value: null\n})\n\nexport const keyValueProps = buildProps({\n value: {\n type: definePropType<KeyValueItem[]>(Array),\n default: () => [{ key: '', value: '' }]\n },\n loading: {\n type: Boolean,\n default: false\n },\n disabled: {\n type: Boolean,\n default: false\n },\n keyLabel: {\n type: String,\n default: ''\n },\n valueLabel: {\n type: String,\n default: ''\n },\n addText: {\n type: String,\n default: '添加'\n },\n keyValueType: {\n type: definePropType<KeyValueType>(String),\n default: 'doubt'\n },\n keyType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入value'\n })\n },\n keyTypes: {\n type: definePropType<KeyType[]>(Array),\n default: () => []\n },\n valueType: {\n type: definePropType<FormColumn>(Object),\n default: () => ({\n type: 'input',\n placeholder: '请输入key'\n })\n }\n} as const)\n\nexport const keyValueEmits = {\n change: (value: KeyValueItem[]) => !!value,\n add: () => true,\n 'update:value': (value: KeyValueItem[]) => !!value\n}\n\n// props\nexport type KeyValueProps = ExtractPropTypes<typeof keyValueProps>\n// emits\nexport type KeyValueEmits = typeof keyValueEmits\n// instance\nexport type KeyValueInstance = InstanceType<typeof KeyValue>\n"],"names":[],"mappings":";;;;AAeO,MAAM,kBAAkB,OAAO;AAAA,EACpC,GAAK,EAAA,IAAA;AAAA,EACL,KAAO,EAAA,IAAA;AACT,CAAA,EAAA;AAEO,MAAM,gBAAgB,UAAW,CAAA;AAAA,EACtC,KAAO,EAAA;AAAA,IACL,IAAA,EAAM,eAA+B,KAAK,CAAA;AAAA,IAC1C,OAAA,EAAS,MAAM,CAAC,EAAE,KAAK,EAAI,EAAA,KAAA,EAAO,IAAI,CAAA;AAAA,GACxC;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,UAAY,EAAA;AAAA,IACV,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,cAAA;AAAA,GACX;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAA,EAAM,eAA6B,MAAM,CAAA;AAAA,IACzC,OAAS,EAAA,OAAA;AAAA,GACX;AAAA,EACA,OAAS,EAAA;AAAA,IACP,IAAA,EAAM,eAA2B,MAAM,CAAA;AAAA,IACvC,SAAS,OAAO;AAAA,MACd,IAAM,EAAA,OAAA;AAAA,MACN,WAAa,EAAA,yBAAA;AAAA,KACf,CAAA;AAAA,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,IAAA,EAAM,eAA0B,KAAK,CAAA;AAAA,IACrC,OAAA,EAAS,MAAM,EAAC;AAAA,GAClB;AAAA,EACA,SAAW,EAAA;AAAA,IACT,IAAA,EAAM,eAA2B,MAAM,CAAA;AAAA,IACvC,SAAS,OAAO;AAAA,MACd,IAAM,EAAA,OAAA;AAAA,MACN,WAAa,EAAA,uBAAA;AAAA,KACf,CAAA;AAAA,GACF;AACF,CAAU,EAAA;AAEH,MAAM,aAAgB,GAAA;AAAA,EAC3B,MAAQ,EAAA,CAAC,KAA0B,KAAA,CAAC,CAAC,KAAA;AAAA,EACrC,KAAK,MAAM,IAAA;AAAA,EACX,cAAgB,EAAA,CAAC,KAA0B,KAAA,CAAC,CAAC,KAAA;AAC/C;;;;"}
|
|
@@ -8,7 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
9
9
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
10
10
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
11
|
-
readonly
|
|
11
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
12
12
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
13
13
|
(): any;
|
|
14
14
|
new (): any;
|
|
@@ -36,13 +36,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
36
36
|
}, boolean>;
|
|
37
37
|
}, {
|
|
38
38
|
props: import("@vue/shared").LooseRequired<{
|
|
39
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
40
39
|
readonly value: import("./config").KeyValueItem[];
|
|
41
40
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
42
41
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
43
42
|
readonly keyLabel: string;
|
|
44
43
|
readonly valueLabel: string;
|
|
45
44
|
readonly addText: string;
|
|
45
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
46
46
|
readonly keyType: any;
|
|
47
47
|
readonly keyTypes: import("./config").KeyType[];
|
|
48
48
|
readonly valueType: any;
|
|
@@ -63,7 +63,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
63
63
|
};
|
|
64
64
|
innerValue: import("vue").Ref<{
|
|
65
65
|
key: string | null;
|
|
66
|
-
value:
|
|
66
|
+
value: any;
|
|
67
67
|
}[]>;
|
|
68
68
|
keyValueItems: import("vue").Ref<any[]>;
|
|
69
69
|
keyValueTypeDict: import("vue").ComputedRef<{}>;
|
|
@@ -102,7 +102,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
102
102
|
};
|
|
103
103
|
innerValue: import("vue").Ref<{
|
|
104
104
|
key: string | null;
|
|
105
|
-
value:
|
|
105
|
+
value: any;
|
|
106
106
|
}>;
|
|
107
107
|
getKeyType: import("vue").ComputedRef<any>;
|
|
108
108
|
getValueType: import("vue").ComputedRef<any>;
|
|
@@ -382,7 +382,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
382
382
|
readonly keyLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
383
383
|
readonly valueLabel: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
384
384
|
readonly addText: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "添加", boolean>;
|
|
385
|
-
readonly
|
|
385
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown, "doubt", boolean>;
|
|
386
386
|
readonly keyType: import("ll-plus/es/utils").EpPropFinalized<(new (...args: any[]) => any) | (() => any) | {
|
|
387
387
|
(): any;
|
|
388
388
|
new (): any;
|
|
@@ -413,13 +413,13 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
413
413
|
"onUpdate:value"?: ((value: import("./config").KeyValueItem[]) => any) | undefined;
|
|
414
414
|
onAdd?: (() => any) | undefined;
|
|
415
415
|
}, {
|
|
416
|
-
readonly type: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
417
416
|
readonly value: import("./config").KeyValueItem[];
|
|
418
417
|
readonly disabled: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
419
418
|
readonly loading: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
420
419
|
readonly keyLabel: string;
|
|
421
420
|
readonly valueLabel: string;
|
|
422
421
|
readonly addText: string;
|
|
422
|
+
readonly keyValueType: import("ll-plus/es/utils").EpPropMergeType<(new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt") | ((new (...args: any[]) => "single" | "doubt") | (() => "single" | "doubt"))[], unknown, unknown>;
|
|
423
423
|
readonly keyType: any;
|
|
424
424
|
readonly keyTypes: import("./config").KeyType[];
|
|
425
425
|
readonly valueType: any;
|
|
@@ -37,9 +37,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
emits("change", innerValue.value);
|
|
38
38
|
emits("update:value", innerValue.value);
|
|
39
39
|
};
|
|
40
|
-
watch(
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
watch(
|
|
41
|
+
() => props.value,
|
|
42
|
+
(n) => {
|
|
43
|
+
innerValue.value = n && n.length > 0 ? n : [{ key: null, value: null }];
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
immediate: true
|
|
47
|
+
}
|
|
48
|
+
);
|
|
43
49
|
return (_ctx, _cache) => {
|
|
44
50
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
45
51
|
const _component_ll_button = resolveComponent("ll-button");
|
|
@@ -62,12 +68,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
62
68
|
key: idx,
|
|
63
69
|
ref_for: true,
|
|
64
70
|
ref: (el) => keyValueItems.value[idx] = el,
|
|
65
|
-
value:
|
|
71
|
+
value: innerValue.value[idx],
|
|
72
|
+
"onUpdate:value": ($event) => innerValue.value[idx] = $event,
|
|
66
73
|
"key-label": props.keyLabel,
|
|
67
74
|
"value-label": props.valueLabel,
|
|
68
75
|
"key-value-type-dict": keyValueTypeDict.value,
|
|
69
76
|
"show-delete": idx > 0,
|
|
70
|
-
type: props.
|
|
77
|
+
"key-value-type": props.keyValueType,
|
|
71
78
|
"key-type": props.keyType,
|
|
72
79
|
"key-types": props.keyTypes,
|
|
73
80
|
"value-type": props.valueType,
|
|
@@ -86,7 +93,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
86
93
|
])
|
|
87
94
|
};
|
|
88
95
|
})
|
|
89
|
-
]), 1032, ["value", "key-label", "value-label", "key-value-type-dict", "show-delete", "type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
96
|
+
]), 1032, ["value", "onUpdate:value", "key-label", "value-label", "key-value-type-dict", "show-delete", "key-value-type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
90
97
|
}),
|
|
91
98
|
128
|
|
92
99
|
/* KEYED_FRAGMENT */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-value.vue2.mjs","sources":["../../../../../packages/components/key-value/src/key-value.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <key-value-item\n v-for=\"(_item, idx) in innerValue\"\n :key=\"idx\"\n :ref=\"el => (keyValueItems[idx] = el)\"\n :value=\"
|
|
1
|
+
{"version":3,"file":"key-value.vue2.mjs","sources":["../../../../../packages/components/key-value/src/key-value.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <a-spin :spinning=\"props.loading\">\n <key-value-item\n v-for=\"(_item, idx) in innerValue\"\n :key=\"idx\"\n :ref=\"el => (keyValueItems[idx] = el)\"\n v-model:value=\"innerValue[idx]\"\n :key-label=\"props.keyLabel\"\n :value-label=\"props.valueLabel\"\n :key-value-type-dict=\"keyValueTypeDict\"\n :show-delete=\"idx > 0\"\n :key-value-type=\"props.keyValueType\"\n :key-type=\"props.keyType\"\n :key-types=\"props.keyTypes\"\n :value-type=\"props.valueType\"\n :disabled=\"props.disabled\"\n @delete=\"handleDelete(idx)\"\n @change=\"handleChange\"\n >\n <template\n v-for=\"item in Object.keys($slots)\"\n :key=\"item\"\n #[item]=\"data\"\n >\n <slot :name=\"item\" v-bind=\"data || {}\" :index=\"idx\"></slot>\n </template>\n </key-value-item>\n <ll-button\n :class=\"bem.e('add')\"\n :loading=\"loading\"\n :disabled=\"props.disabled\"\n @click=\"handleAddItem\"\n >\n <div :class=\"bem.e('plus')\">\n <ll-icon\n v-if=\"!loading\"\n icon-name=\"icon-add\"\n :class=\"bem.e('icon-add')\"\n />\n {{ props.addText }}\n </div>\n </ll-button>\n </a-spin>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed, watch } from 'vue'\n// import { isEmpty } from 'lodash-es'\nimport { createNamespace } from '@ll-plus/utils'\nimport {\n keyValueProps,\n keyValueEmits,\n getKeyValueItem\n // type KeyValueItem\n} from './config'\nimport keyValueItem from './components/key-value-item.vue'\ndefineOptions({ name: 'LlKeyValue' })\nconst props = defineProps(keyValueProps)\nconst emits = defineEmits(keyValueEmits)\nconst bem = createNamespace('key-value')\nconst innerValue = ref(\n props.value && props.value.length > 0\n ? props.value\n : [{ key: null, value: null }]\n)\nconst keyValueItems = ref<any[]>([])\n\nconst keyValueTypeDict = computed(() => {\n const obj = {}\n props.keyTypes.map(e => {\n obj[e.value] = e.option\n })\n return obj\n})\n\n// const getValueType = computed(() => {\n// let type = 'object'\n// if (!isEmpty(props.value)) {\n// if (Array.isArray(props.value)) {\n// type = `${type}-${\n// typeof props.value[0] === 'object' ? 'object' : 'string'\n// }`\n// }\n// }\n// return type\n// })\n\n// const getKeyValueType = computed(() => {\n// return props.keyValueType\n// ? props.keyValueType\n// : props.keyValueType === 'array-string'\n// ? 'single'\n// : 'doubt'\n// })\n\nconst handleAddItem = () => {\n innerValue.value.push(getKeyValueItem())\n emits('add')\n}\n\nconst handleDelete = (idx: number) => {\n innerValue.value.splice(idx, 1)\n}\n\nconst handleChange = () => {\n // let value: any = null\n // switch (getValueType.value) {\n // case 'object':\n // value = {}\n // innerValue.value.map(e => {\n // console.log({ e })\n // if (e.key) {\n // value[e.key] = e.value\n // } else {\n // value[`${new Date().getTime()}-empty-key`] = e.value\n // }\n // })\n\n // break\n // case 'array-string':\n // value = []\n // innerValue.value.map(e => {\n // if (e.value) {\n // value.push(e.value)\n // }\n // })\n // break\n // default:\n // value = innerValue.value\n // break\n // }\n\n emits('change', innerValue.value)\n emits('update:value', innerValue.value)\n}\n\nwatch(\n () => props.value,\n n => {\n // let arr = [] as KeyValueItem[]\n // console.log(getValueType.value)\n // switch (getValueType.value) {\n // case 'object':\n // for (const i in n) {\n // arr.push({ key: i, value: n[i] })\n // }\n // break\n // case 'array-string':\n // arr = n.map(e => {\n // return { key: null, value: e }\n // })\n // break\n // default:\n // arr = [...n]\n // break\n // }\n\n innerValue.value = n && n.length > 0 ? n : [{ key: null, value: null }]\n },\n {\n immediate: true\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;AA2DA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AACd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,IAAM,MAAA,GAAA,GAAM,gBAAgB,WAAW,CAAA,CAAA;AACvC,IAAA,MAAM,UAAa,GAAA,GAAA;AAAA,MACjB,KAAM,CAAA,KAAA,IAAS,KAAM,CAAA,KAAA,CAAM,SAAS,CAChC,GAAA,KAAA,CAAM,KACN,GAAA,CAAC,EAAE,GAAA,EAAK,IAAM,EAAA,KAAA,EAAO,MAAM,CAAA;AAAA,KACjC,CAAA;AACA,IAAM,MAAA,aAAA,GAAgB,GAAW,CAAA,EAAE,CAAA,CAAA;AAEnC,IAAM,MAAA,gBAAA,GAAmB,SAAS,MAAM;AACtC,MAAA,MAAM,MAAM,EAAC,CAAA;AACb,MAAM,KAAA,CAAA,QAAA,CAAS,IAAI,CAAK,CAAA,KAAA;AACtB,QAAI,GAAA,CAAA,CAAA,CAAE,KAAK,CAAA,GAAI,CAAE,CAAA,MAAA,CAAA;AAAA,OAClB,CAAA,CAAA;AACD,MAAO,OAAA,GAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAsBD,IAAA,MAAM,gBAAgB,MAAM;AAC1B,MAAW,UAAA,CAAA,KAAA,CAAM,IAAK,CAAA,eAAA,EAAiB,CAAA,CAAA;AACvC,MAAA,KAAA,CAAM,KAAK,CAAA,CAAA;AAAA,KACb,CAAA;AAEA,IAAM,MAAA,YAAA,GAAe,CAAC,GAAgB,KAAA;AACpC,MAAW,UAAA,CAAA,KAAA,CAAM,MAAO,CAAA,GAAA,EAAK,CAAC,CAAA,CAAA;AAAA,KAChC,CAAA;AAEA,IAAA,MAAM,eAAe,MAAM;AA4BzB,MAAM,KAAA,CAAA,QAAA,EAAU,WAAW,KAAK,CAAA,CAAA;AAChC,MAAM,KAAA,CAAA,cAAA,EAAgB,WAAW,KAAK,CAAA,CAAA;AAAA,KACxC,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAK,CAAA,KAAA;AAmBH,QAAA,UAAA,CAAW,KAAQ,GAAA,CAAA,IAAK,CAAE,CAAA,MAAA,GAAS,CAAI,GAAA,CAAA,GAAI,CAAC,EAAE,GAAK,EAAA,IAAA,EAAM,KAAO,EAAA,IAAA,EAAM,CAAA,CAAA;AAAA,OACxE;AAAA,MACA;AAAA,QACE,SAAW,EAAA,IAAA;AAAA,OACb;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.full.js
CHANGED
|
@@ -4967,7 +4967,8 @@
|
|
|
4967
4967
|
require$$0.renderList(props.options, (item, idx) => {
|
|
4968
4968
|
return require$$0.openBlock(), require$$0.createBlock(require$$0.unref(antDesignVue.Col), require$$0.mergeProps({ ref_for: true }, item.colOptions, {
|
|
4969
4969
|
key: idx,
|
|
4970
|
-
span: item.span || 24
|
|
4970
|
+
span: item.span || 24,
|
|
4971
|
+
class: require$$0.unref(bem).e("item")
|
|
4971
4972
|
}), {
|
|
4972
4973
|
default: require$$0.withCtx(() => [
|
|
4973
4974
|
require$$0.createVNode(
|
|
@@ -4992,7 +4993,7 @@
|
|
|
4992
4993
|
]),
|
|
4993
4994
|
_: 2
|
|
4994
4995
|
/* DYNAMIC */
|
|
4995
|
-
}, 1040, ["span"]);
|
|
4996
|
+
}, 1040, ["span", "class"]);
|
|
4996
4997
|
}),
|
|
4997
4998
|
128
|
|
4998
4999
|
/* KEYED_FRAGMENT */
|
|
@@ -58082,7 +58083,7 @@
|
|
|
58082
58083
|
type: String,
|
|
58083
58084
|
default: "\u6DFB\u52A0"
|
|
58084
58085
|
},
|
|
58085
|
-
|
|
58086
|
+
keyValueType: {
|
|
58086
58087
|
type: definePropType(String),
|
|
58087
58088
|
default: "doubt"
|
|
58088
58089
|
},
|
|
@@ -58090,7 +58091,7 @@
|
|
|
58090
58091
|
type: definePropType(Object),
|
|
58091
58092
|
default: () => ({
|
|
58092
58093
|
type: "input",
|
|
58093
|
-
placeholder: "\u8BF7\u8F93\
|
|
58094
|
+
placeholder: "\u8BF7\u8F93\u5165value"
|
|
58094
58095
|
})
|
|
58095
58096
|
},
|
|
58096
58097
|
keyTypes: {
|
|
@@ -58228,7 +58229,7 @@
|
|
|
58228
58229
|
class: require$$0.normalizeClass(require$$0.unref(bem).e("item"))
|
|
58229
58230
|
},
|
|
58230
58231
|
[
|
|
58231
|
-
require$$0.unref(attrs)
|
|
58232
|
+
require$$0.unref(attrs)["key-value-type"] !== "single" ? (require$$0.openBlock(), require$$0.createElementBlock(
|
|
58232
58233
|
"div",
|
|
58233
58234
|
{
|
|
58234
58235
|
key: 0,
|
|
@@ -58256,8 +58257,8 @@
|
|
|
58256
58257
|
onChange: handleChange
|
|
58257
58258
|
}, null, 8, ["value", "options", "disabled"])) : (require$$0.openBlock(), require$$0.createBlock(require$$0.resolveDynamicComponent(`ll-${getKeyType.value.type}`), require$$0.mergeProps({
|
|
58258
58259
|
key: 1,
|
|
58259
|
-
value: innerValue.value["
|
|
58260
|
-
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["
|
|
58260
|
+
value: innerValue.value["key"],
|
|
58261
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => innerValue.value["key"] = $event),
|
|
58261
58262
|
disabled: require$$0.unref(attrs).disabled
|
|
58262
58263
|
}, getKeyType.value, {
|
|
58263
58264
|
style: { "width": "100%" },
|
|
@@ -58284,7 +58285,7 @@
|
|
|
58284
58285
|
2
|
|
58285
58286
|
/* CLASS */
|
|
58286
58287
|
)) : require$$0.createCommentVNode("v-if", true),
|
|
58287
|
-
require$$0.unref(attrs)
|
|
58288
|
+
require$$0.unref(attrs)["key-value-type"] !== "single" ? (require$$0.openBlock(), require$$0.createElementBlock(
|
|
58288
58289
|
"div",
|
|
58289
58290
|
{
|
|
58290
58291
|
key: 1,
|
|
@@ -58364,7 +58365,7 @@
|
|
|
58364
58365
|
},
|
|
58365
58366
|
[
|
|
58366
58367
|
require$$0.createVNode(_component_ll_button, {
|
|
58367
|
-
type: "
|
|
58368
|
+
type: "link",
|
|
58368
58369
|
disabled: require$$0.unref(attrs).disabled
|
|
58369
58370
|
}, {
|
|
58370
58371
|
default: require$$0.withCtx(() => [
|
|
@@ -58431,9 +58432,15 @@
|
|
|
58431
58432
|
emits("change", innerValue.value);
|
|
58432
58433
|
emits("update:value", innerValue.value);
|
|
58433
58434
|
};
|
|
58434
|
-
require$$0.watch(
|
|
58435
|
-
|
|
58436
|
-
|
|
58435
|
+
require$$0.watch(
|
|
58436
|
+
() => props.value,
|
|
58437
|
+
(n) => {
|
|
58438
|
+
innerValue.value = n && n.length > 0 ? n : [{ key: null, value: null }];
|
|
58439
|
+
},
|
|
58440
|
+
{
|
|
58441
|
+
immediate: true
|
|
58442
|
+
}
|
|
58443
|
+
);
|
|
58437
58444
|
return (_ctx, _cache) => {
|
|
58438
58445
|
const _component_ll_icon = require$$0.resolveComponent("ll-icon");
|
|
58439
58446
|
const _component_ll_button = require$$0.resolveComponent("ll-button");
|
|
@@ -58456,12 +58463,13 @@
|
|
|
58456
58463
|
key: idx,
|
|
58457
58464
|
ref_for: true,
|
|
58458
58465
|
ref: (el) => keyValueItems.value[idx] = el,
|
|
58459
|
-
value:
|
|
58466
|
+
value: innerValue.value[idx],
|
|
58467
|
+
"onUpdate:value": ($event) => innerValue.value[idx] = $event,
|
|
58460
58468
|
"key-label": props.keyLabel,
|
|
58461
58469
|
"value-label": props.valueLabel,
|
|
58462
58470
|
"key-value-type-dict": keyValueTypeDict.value,
|
|
58463
58471
|
"show-delete": idx > 0,
|
|
58464
|
-
type: props.
|
|
58472
|
+
"key-value-type": props.keyValueType,
|
|
58465
58473
|
"key-type": props.keyType,
|
|
58466
58474
|
"key-types": props.keyTypes,
|
|
58467
58475
|
"value-type": props.valueType,
|
|
@@ -58480,7 +58488,7 @@
|
|
|
58480
58488
|
])
|
|
58481
58489
|
};
|
|
58482
58490
|
})
|
|
58483
|
-
]), 1032, ["value", "key-label", "value-label", "key-value-type-dict", "show-delete", "type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
58491
|
+
]), 1032, ["value", "onUpdate:value", "key-label", "value-label", "key-value-type-dict", "show-delete", "key-value-type", "key-type", "key-types", "value-type", "disabled", "onDelete"]);
|
|
58484
58492
|
}),
|
|
58485
58493
|
128
|
|
58486
58494
|
/* KEYED_FRAGMENT */
|