ll-plus 2.9.2 → 2.9.3
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/select/index.d.ts +2 -11
- package/es/components/select/src/select.d.ts +2 -5
- package/es/components/select/src/select.vue.d.ts +2 -11
- package/es/components/upload-image/index.d.ts +1 -0
- package/es/components/upload-image/src/upload-image.vue.d.ts +1 -0
- package/es/index.mjs +1 -1
- package/es/packages/components/index.mjs +1 -1
- package/es/packages/components/select/index.mjs +1 -1
- package/es/packages/components/select/src/select.mjs +1 -7
- package/es/packages/components/select/src/select.mjs.map +1 -1
- package/es/packages/components/select/src/select.vue2.mjs +4 -9
- package/es/packages/components/select/src/select.vue2.mjs.map +1 -1
- package/es/packages/components/upload-image/src/upload-image.vue2.mjs +22 -2
- package/es/packages/components/upload-image/src/upload-image.vue2.mjs.map +1 -1
- package/index.full.js +45 -36
- package/index.full.min.js +24 -24
- package/index.full.min.js.map +1 -1
- package/index.full.min.mjs +25 -25
- package/index.full.min.mjs.map +1 -1
- package/index.full.mjs +46 -36
- package/lib/components/select/index.d.ts +2 -11
- package/lib/components/select/src/select.d.ts +2 -5
- package/lib/components/select/src/select.vue.d.ts +2 -11
- package/lib/components/upload-image/index.d.ts +1 -0
- package/lib/components/upload-image/src/upload-image.vue.d.ts +1 -0
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/packages/components/index.js +0 -1
- package/lib/packages/components/index.js.map +1 -1
- package/lib/packages/components/select/index.js +0 -1
- package/lib/packages/components/select/index.js.map +1 -1
- package/lib/packages/components/select/src/select.js +0 -7
- package/lib/packages/components/select/src/select.js.map +1 -1
- package/lib/packages/components/select/src/select.vue2.js +4 -9
- package/lib/packages/components/select/src/select.vue2.js.map +1 -1
- package/lib/packages/components/upload-image/src/upload-image.vue2.js +22 -2
- package/lib/packages/components/upload-image/src/upload-image.vue2.js.map +1 -1
- package/package.json +1 -1
- package/theme-chalk/css/form.css +1 -1
- package/theme-chalk/css/index.css +1 -1
- package/theme-chalk/css/table.css +1 -1
- package/theme-chalk/css/tabs-simple.css +1 -1
- package/types/packages/components/select/index.d.ts +2 -11
- package/types/packages/components/select/src/select.d.ts +2 -5
- package/types/packages/components/select/src/select.vue.d.ts +2 -11
- package/types/packages/components/upload-image/index.d.ts +1 -0
- package/types/packages/components/upload-image/src/upload-image.vue.d.ts +1 -0
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import Select from './src/select.vue';
|
|
2
2
|
import SelectOption from './src/select-option.vue';
|
|
3
3
|
import SelectOptGroup from './src/select-opt-group.vue';
|
|
4
|
-
export declare const LlSelect: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
5
|
-
allowClear: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
6
|
-
}, {
|
|
7
|
-
props: import("@vue/shared").LooseRequired<{
|
|
8
|
-
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
9
|
-
} & {}>;
|
|
4
|
+
export declare const LlSelect: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
10
5
|
bem: {
|
|
11
6
|
b: (blockSuffix?: string) => string;
|
|
12
7
|
e: (element?: string) => string;
|
|
@@ -801,11 +796,7 @@ export declare const LlSelect: import("ll-plus/es/utils").SFCWithInstall<import(
|
|
|
801
796
|
readonly OptGroup: import("ant-design-vue/es/vc-select/OptGroup").OptionGroupFC;
|
|
802
797
|
readonly SECRET_COMBOBOX_MODE_DO_NOT_USE: "SECRET_COMBOBOX_MODE_DO_NOT_USE";
|
|
803
798
|
};
|
|
804
|
-
},
|
|
805
|
-
allowClear: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
806
|
-
}>>, {
|
|
807
|
-
allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
808
|
-
}, {}>>;
|
|
799
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>>;
|
|
809
800
|
export declare const LlSelectOption: import("ll-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
810
801
|
class: StringConstructor;
|
|
811
802
|
disabled: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, boolean, boolean>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import type { SelectProps as AntSelectProps } from 'ant-design-vue';
|
|
3
|
-
import type Select from './select.vue';
|
|
4
|
-
import type SelectOption from './select-option.vue';
|
|
5
3
|
import type SelectOptGroup from './select-opt-group.vue';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
4
|
+
import type SelectOption from './select-option.vue';
|
|
5
|
+
import type Select from './select.vue';
|
|
9
6
|
export declare const selectOptionProps: {
|
|
10
7
|
class: StringConstructor;
|
|
11
8
|
disabled: import("ll-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, boolean, boolean>;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
allowClear: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
3
|
-
}, {
|
|
4
|
-
props: import("@vue/shared").LooseRequired<{
|
|
5
|
-
readonly allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
6
|
-
} & {}>;
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {
|
|
7
2
|
bem: {
|
|
8
3
|
b: (blockSuffix?: string) => string;
|
|
9
4
|
e: (element?: string) => string;
|
|
@@ -798,9 +793,5 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
798
793
|
readonly OptGroup: import("ant-design-vue/es/vc-select/OptGroup").OptionGroupFC;
|
|
799
794
|
readonly SECRET_COMBOBOX_MODE_DO_NOT_USE: "SECRET_COMBOBOX_MODE_DO_NOT_USE";
|
|
800
795
|
};
|
|
801
|
-
},
|
|
802
|
-
allowClear: import("ll-plus/es/utils").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
803
|
-
}>>, {
|
|
804
|
-
allowClear: import("ll-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
805
|
-
}, {}>;
|
|
796
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
806
797
|
export default _default;
|
|
@@ -76,6 +76,7 @@ export declare const LlUploadImage: import("ll-plus/es/utils").SFCWithInstall<im
|
|
|
76
76
|
customRequest: (options: import("ant-design-vue/es/vc-upload/interface").UploadRequestOption<any>) => void;
|
|
77
77
|
handleRemoveImage: () => Promise<void>;
|
|
78
78
|
setValue: () => void;
|
|
79
|
+
addDataToDatabase: (data: any) => Promise<void>;
|
|
79
80
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
81
|
readonly change: (value: string | string[]) => boolean;
|
|
81
82
|
readonly 'update:value': (value: string | string[]) => boolean;
|
|
@@ -77,6 +77,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
77
77
|
customRequest: (options: import("ant-design-vue/es/vc-upload/interface").UploadRequestOption<any>) => void;
|
|
78
78
|
handleRemoveImage: () => Promise<void>;
|
|
79
79
|
setValue: () => void;
|
|
80
|
+
addDataToDatabase: (data: any) => Promise<void>;
|
|
80
81
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
81
82
|
readonly change: (value: string | string[]) => boolean;
|
|
82
83
|
readonly 'update:value': (value: string | string[]) => boolean;
|
package/es/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ export { LlRadio, LlRadioButton, LlRadioGroup } from './packages/components/radi
|
|
|
104
104
|
export { FALLBACK_IMAGE, defaultEditorConfig, defaultToolbarConfig, richTextEditorEmits, richTextEditorProps } from './packages/components/rich-text-editor/src/rich-text-editor.mjs';
|
|
105
105
|
export { LlRichTextEditor } from './packages/components/rich-text-editor/index.mjs';
|
|
106
106
|
export { LlSegmented } from './packages/components/segmented/index.mjs';
|
|
107
|
-
export { selectOptGroupProps, selectOptionProps
|
|
107
|
+
export { selectOptGroupProps, selectOptionProps } from './packages/components/select/src/select.mjs';
|
|
108
108
|
export { LlSelect, LlSelectOptGroup, LlSelectOption } from './packages/components/select/index.mjs';
|
|
109
109
|
export { LEFT_SELECT_MIN_WIDTH, selectGroupData, selectGroupEmits, selectGroupFormType, selectGroupProps } from './packages/components/select-group/src/select-group.mjs';
|
|
110
110
|
export { LlSelectGroup } from './packages/components/select-group/index.mjs';
|
|
@@ -117,7 +117,7 @@ export { operateIconEmits, operateIconProps } from './operate-icon/src/operate-i
|
|
|
117
117
|
export { OperateTreeEmits, operateTreeEmits, operateTreeProps } from './operate-tree/src/operate-tree.mjs';
|
|
118
118
|
export { qrcodeProps, qrcodeType } from './qrcode/src/qrcode.mjs';
|
|
119
119
|
export { FALLBACK_IMAGE, defaultEditorConfig, defaultToolbarConfig, richTextEditorEmits, richTextEditorProps } from './rich-text-editor/src/rich-text-editor.mjs';
|
|
120
|
-
export { selectOptGroupProps, selectOptionProps
|
|
120
|
+
export { selectOptGroupProps, selectOptionProps } from './select/src/select.mjs';
|
|
121
121
|
export { LEFT_SELECT_MIN_WIDTH, selectGroupData, selectGroupEmits, selectGroupFormType, selectGroupProps } from './select-group/src/select-group.mjs';
|
|
122
122
|
export { ImenuSwitchType, menuSwitchRadioList, tableHeaderSearchEmits, tableHeaderSearchProps } from './table/src/config/header-search.mjs';
|
|
123
123
|
export { mainTableEmits, mainTableProps, tableContentType } from './table/src/config/main-table.mjs';
|
|
@@ -2,7 +2,7 @@ import '../../utils/index.mjs';
|
|
|
2
2
|
import Select from './src/select.vue.mjs';
|
|
3
3
|
import SelectOption from './src/select-option.vue.mjs';
|
|
4
4
|
import SelectOptGroup from './src/select-opt-group.vue.mjs';
|
|
5
|
-
export { selectOptGroupProps, selectOptionProps
|
|
5
|
+
export { selectOptGroupProps, selectOptionProps } from './src/select.mjs';
|
|
6
6
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
@@ -2,12 +2,6 @@ import '../../../utils/index.mjs';
|
|
|
2
2
|
import { buildProps, definePropType } from '../../../utils/props/runtime.mjs';
|
|
3
3
|
|
|
4
4
|
"use strict";
|
|
5
|
-
const selectProps = buildProps({
|
|
6
|
-
allowClear: {
|
|
7
|
-
type: Boolean,
|
|
8
|
-
default: true
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
5
|
const selectOptionProps = buildProps({
|
|
12
6
|
class: String,
|
|
13
7
|
disabled: {
|
|
@@ -28,5 +22,5 @@ const selectOptGroupProps = buildProps({
|
|
|
28
22
|
}
|
|
29
23
|
});
|
|
30
24
|
|
|
31
|
-
export { selectOptGroupProps, selectOptionProps
|
|
25
|
+
export { selectOptGroupProps, selectOptionProps };
|
|
32
26
|
//# sourceMappingURL=select.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.mjs","sources":["../../../../../../packages/components/select/src/select.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nimport type { SelectProps as AntSelectProps } from 'ant-design-vue'\nimport type
|
|
1
|
+
{"version":3,"file":"select.mjs","sources":["../../../../../../packages/components/select/src/select.ts"],"sourcesContent":["import { buildProps, definePropType } from '@ll-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\n\nimport type { SelectProps as AntSelectProps } from 'ant-design-vue'\nimport type SelectOptGroup from './select-opt-group.vue'\nimport type SelectOption from './select-option.vue'\nimport type Select from './select.vue'\n\nexport const selectOptionProps = buildProps({\n class: String,\n disabled: {\n type: String,\n default: false\n },\n key: String,\n title: String,\n value: {\n type: definePropType<string | number>([String, Number])\n }\n})\n\nexport const selectOptGroupProps = buildProps({\n key: String,\n label: {\n type: String,\n default: ''\n }\n})\n\n// props\nexport type SelectProps = AntSelectProps\n\nexport type SelctOptionProps = ExtractPropTypes<typeof selectOptionProps>\n\nexport type SelectOptGroupGroupProps = ExtractPropTypes<\n typeof selectOptGroupProps\n>\n\n// instance\nexport type SelectInstance = InstanceType<typeof Select>\n\nexport type SelectOptionInstance = InstanceType<typeof SelectOption>\n\nexport type SelectOptGroupInstance = InstanceType<typeof SelectOptGroup>\n"],"names":[],"mappings":";;;;AASO,MAAM,oBAAoB,UAAW,CAAA;AAAA,EAC1C,KAAO,EAAA,MAAA;AAAA,EACP,QAAU,EAAA;AAAA,IACR,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,GACX;AAAA,EACA,GAAK,EAAA,MAAA;AAAA,EACL,KAAO,EAAA,MAAA;AAAA,EACP,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,cAAA,CAAgC,CAAC,MAAA,EAAQ,MAAM,CAAC,CAAA;AAAA,GACxD;AACF,CAAC,EAAA;AAEM,MAAM,sBAAsB,UAAW,CAAA;AAAA,EAC5C,GAAK,EAAA,MAAA;AAAA,EACL,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,MAAA;AAAA,IACN,OAAS,EAAA,EAAA;AAAA,GACX;AACF,CAAC;;;;"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { defineComponent, useAttrs, ref, openBlock, createBlock, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
|
-
import { Select } from 'ant-design-vue';
|
|
3
2
|
import '../../../utils/index.mjs';
|
|
4
|
-
import {
|
|
3
|
+
import { Select } from 'ant-design-vue';
|
|
5
4
|
import { createNamespace } from '../../../utils/create-namespace.mjs';
|
|
6
5
|
|
|
7
6
|
"use strict";
|
|
8
7
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
8
|
...{ name: "LlSelect" },
|
|
10
9
|
__name: "select",
|
|
11
|
-
props: selectProps,
|
|
12
10
|
setup(__props, { expose: __expose }) {
|
|
13
|
-
const props = __props;
|
|
14
11
|
const bem = createNamespace("select");
|
|
15
12
|
const attrs = useAttrs();
|
|
16
13
|
const selectRef = ref();
|
|
@@ -21,12 +18,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
21
18
|
focus
|
|
22
19
|
});
|
|
23
20
|
return (_ctx, _cache) => {
|
|
24
|
-
return openBlock(), createBlock(unref(Select), mergeProps({
|
|
25
|
-
class: unref(bem).b()
|
|
26
|
-
}, unref(attrs), {
|
|
21
|
+
return openBlock(), createBlock(unref(Select), mergeProps(unref(attrs), {
|
|
27
22
|
ref_key: "selectRef",
|
|
28
23
|
ref: selectRef,
|
|
29
|
-
|
|
24
|
+
class: unref(bem).b()
|
|
30
25
|
}), createSlots({
|
|
31
26
|
_: 2
|
|
32
27
|
/* DYNAMIC */
|
|
@@ -39,7 +34,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
34
|
])
|
|
40
35
|
};
|
|
41
36
|
})
|
|
42
|
-
]), 1040, ["class"
|
|
37
|
+
]), 1040, ["class"]);
|
|
43
38
|
};
|
|
44
39
|
}
|
|
45
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.vue2.mjs","sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <Select
|
|
1
|
+
{"version":3,"file":"select.vue2.mjs","sources":["../../../../../../packages/components/select/src/select.vue"],"sourcesContent":["<template>\n <Select v-bind=\"attrs\" ref=\"selectRef\" :class=\"bem.b()\">\n <template v-for=\"item in Object.keys($slots)\" :key=\"item\" #[item]=\"data\">\n <slot :name=\"item\" v-bind=\"data || {}\"></slot>\n </template>\n </Select>\n</template>\n\n<script setup lang=\"ts\">\nimport { createNamespace } from '@ll-plus/utils'\nimport { Select } from 'ant-design-vue'\nimport { ref, useAttrs } from 'vue'\n\ndefineOptions({ name: 'LlSelect' })\n\nconst bem = createNamespace('select')\n\nconst attrs = useAttrs()\n\nconst selectRef = ref()\nconst focus = () => {\n selectRef.value.focus()\n}\ndefineExpose({\n focus\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;AAeA,IAAM,MAAA,GAAA,GAAM,gBAAgB,QAAQ,CAAA,CAAA;AAEpC,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAA,MAAM,YAAY,GAAI,EAAA,CAAA;AACtB,IAAA,MAAM,QAAQ,MAAM;AAClB,MAAA,SAAA,CAAU,MAAM,KAAM,EAAA,CAAA;AAAA,KACxB,CAAA;AACA,IAAa,QAAA,CAAA;AAAA,MACX,KAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -73,6 +73,25 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
73
73
|
emits("change", value);
|
|
74
74
|
formItemContext.onFieldChange();
|
|
75
75
|
};
|
|
76
|
+
const addDataToDatabase = async (data) => {
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetch("http://your-database-api-endpoint", {
|
|
79
|
+
method: "POST",
|
|
80
|
+
headers: {
|
|
81
|
+
"Content-Type": "application/json"
|
|
82
|
+
},
|
|
83
|
+
body: JSON.stringify(data)
|
|
84
|
+
});
|
|
85
|
+
if (!response.ok) {
|
|
86
|
+
throw new Error("Failed to add data to the database");
|
|
87
|
+
}
|
|
88
|
+
const result = await response.json();
|
|
89
|
+
console.log("Data added successfully:", result);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error("Error adding data to the database:", error);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
addDataToDatabase({ key: "value" });
|
|
76
95
|
watch(
|
|
77
96
|
() => props.value,
|
|
78
97
|
(newVal) => {
|
|
@@ -92,9 +111,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
111
|
);
|
|
93
112
|
return (_ctx, _cache) => {
|
|
94
113
|
const _component_ll_icon = resolveComponent("ll-icon");
|
|
95
|
-
const
|
|
114
|
+
const _component_ll_image = resolveComponent("ll-image");
|
|
96
115
|
const _component_a_spin = resolveComponent("a-spin");
|
|
97
116
|
const _component_a_upload = resolveComponent("a-upload");
|
|
117
|
+
const _component_a_image = resolveComponent("a-image");
|
|
98
118
|
const _component_a_image_preview_group = resolveComponent("a-image-preview-group");
|
|
99
119
|
return openBlock(), createElementBlock(
|
|
100
120
|
"div",
|
|
@@ -127,7 +147,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
127
147
|
spinning: props.imgLoading
|
|
128
148
|
}, {
|
|
129
149
|
default: withCtx(() => [
|
|
130
|
-
innerValue.value.length > 0 ? (openBlock(), createBlock(
|
|
150
|
+
innerValue.value.length > 0 ? (openBlock(), createBlock(_component_ll_image, {
|
|
131
151
|
key: 0,
|
|
132
152
|
preview: { visible: false },
|
|
133
153
|
width: 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-image.vue2.mjs","sources":["../../../../../../packages/components/upload-image/src/upload-image.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <div :class=\"bem.m('preview-box')\">\n <a-upload\n v-model:fileList=\"fileList\"\n v-bind=\"getBindValue\"\n :accept=\"props.accept\"\n :show-upload-list=\"false\"\n :max-count=\"props.maxCount\"\n :multiple=\"computedMultiple\"\n :before-upload=\"beforeUpload\"\n :custom-request=\"customRequest\"\n :class=\"bem.m('upload')\"\n list-type=\"picture-card\"\n >\n <a-spin size=\"small\" :spinning=\"props.imgLoading\">\n <a-image\n v-if=\"innerValue.length > 0\"\n :preview=\"{ visible: false }\"\n :width=\"100\"\n :height=\"100\"\n :src=\"innerValue[0]\"\n :style=\"{\n objectFit: 'contain'\n }\"\n >\n <template #previewMask>\n <div :class=\"bem.m('preview-mask')\">\n <a href=\"javascript:;\" @click.stop=\"imageVisible = true\">\n <ll-icon\n :icon-name=\"`icon-pwd-look`\"\n :class=\"bem.e('image-icon')\"\n />\n </a>\n <a href=\"javascript:;\" @click.stop=\"handleRemoveImage\">\n <ll-icon\n :icon-name=\"`icon-delete`\"\n :class=\"bem.e('image-icon')\"\n />\n </a>\n </div>\n </template>\n </a-image>\n <ll-icon v-else :icon-name=\"props.iconName\" style=\"font-size: 30px\" />\n </a-spin>\n </a-upload>\n <p :class=\"bem.e('tip')\">{{ computedTip }}</p>\n </div>\n\n <div style=\"display: none\">\n <a-image-preview-group\n :preview=\"{\n visible: imageVisible,\n onVisibleChange: (vis: boolean) => (imageVisible = vis)\n }\"\n >\n <a-image v-for=\"item in innerValue\" :key=\"item\" :src=\"item\" />\n </a-image-preview-group>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, useAttrs, computed } from 'vue'\nimport { omit } from 'lodash-es'\nimport { createNamespace, formatFileSize, fileToBase64 } from '@ll-plus/utils'\nimport { uploadImageProps, uploadImageEmits } from './upload-image'\nimport { message, Form } from 'ant-design-vue'\n\nimport type {\n UploadProps,\n FileType\n} from 'ant-design-vue/es/upload/interface.d.ts'\n\n//1.Init props/emits/bem/attrs\n\ndefineOptions({ name: 'LlUploadImage' })\n\nconst props = defineProps(uploadImageProps)\n\nconst emits = defineEmits(uploadImageEmits)\n\nconst bem = createNamespace('upload-image')\n\nconst attrs = useAttrs()\n\nconst fileList = ref([])\n\nconst imageVisible = ref(false)\n\nconst innerValue = ref<string[]>(\n Array.isArray(props.value)\n ? [...props.value]\n : props.value\n ? [props.value]\n : []\n)\n\nconst formItemContext = Form.useInjectFormItemContext()\n\nconst computedAccept = computed(() => {\n return props.accept\n ? props.accept\n .split(',')\n .map(e => e.replace('.', ''))\n .join(',')\n : props.accept\n})\n\nconst computedTip = computed(() => {\n return typeof props.tip === 'string'\n ? props.tip\n : props.tip\n ? `支持${computedAccept.value}格式,不超过${formatFileSize(\n props.imgSize\n )}。`\n : ''\n})\n\nconst computedMultiple = computed(() => props.maxCount > 1)\n\nconst getBindValue = computed(() => ({\n ...omit({ ...attrs }, [...Object.keys(uploadImageProps)])\n}))\n\nconst beforeUpload = async (file: FileType, FileList: FileType[]) => {\n const fileType = file.type.toLowerCase().replace('image/', '')\n const isType = fileType === 'svg+xml' ? true : props.accept.includes(fileType)\n const isSize = file.size <= props.imgSize\n if (!isType) {\n message.error(`${file.name} 需要为${computedAccept.value}格式。`)\n return false\n }\n if (!isSize) {\n message.error(`${file.name} 文件不得大于${formatFileSize(props.imgSize)}。`)\n return false\n }\n return isType && isSize && props.beforeUpload?.(file, FileList)\n}\n\nconst customRequest: UploadProps['customRequest'] = async (res: any) => {\n const fileUrl = (await fileToBase64(res.file)) as string\n if (props.useBase64) {\n props.maxCount === 1\n ? (innerValue.value = [fileUrl])\n : innerValue.value.push(fileUrl)\n }\n try {\n props.customRequest?.(res, fileUrl)\n } catch (error) {\n innerValue.value.splice(innerValue.value.length - 1, 1)\n message.error('上传失败')\n }\n}\n\nconst handleRemoveImage = async () => {\n const index = innerValue.value.length - 1\n innerValue.value.splice(index, 1)\n\n setValue()\n}\n\nconst setValue = () => {\n const value =\n props.maxCount === 1\n ? innerValue.value.length\n ? innerValue.value[0]\n : ''\n : innerValue.value\n emits('update:value', value)\n emits('change', value)\n formItemContext.onFieldChange()\n}\n\nwatch(\n () => props.value,\n newVal => {\n if (newVal !== innerValue.value) {\n innerValue.value = Array.isArray(newVal)\n ? [...newVal]\n : newVal\n ? [newVal]\n : []\n }\n }\n)\n\nwatch(\n innerValue,\n () => {\n setValue()\n },\n {\n deep: true\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8EA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAM,gBA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,OACF;AAAA,KACF,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,UAAA;AAAA,MACA,MAAM;AACJ,QAAS,QAAA,EAAA,CAAA;AAAA,OACX;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"upload-image.vue2.mjs","sources":["../../../../../../packages/components/upload-image/src/upload-image.vue"],"sourcesContent":["<template>\n <div :class=\"bem.b()\">\n <div :class=\"bem.m('preview-box')\">\n <a-upload\n v-model:fileList=\"fileList\"\n v-bind=\"getBindValue\"\n :accept=\"props.accept\"\n :show-upload-list=\"false\"\n :max-count=\"props.maxCount\"\n :multiple=\"computedMultiple\"\n :before-upload=\"beforeUpload\"\n :custom-request=\"customRequest\"\n :class=\"bem.m('upload')\"\n list-type=\"picture-card\"\n >\n <a-spin size=\"small\" :spinning=\"props.imgLoading\">\n <ll-image\n v-if=\"innerValue.length > 0\"\n :preview=\"{ visible: false }\"\n :width=\"100\"\n :height=\"100\"\n :src=\"innerValue[0]\"\n :style=\"{\n objectFit: 'contain'\n }\"\n >\n <template #previewMask>\n <div :class=\"bem.m('preview-mask')\">\n <a href=\"javascript:;\" @click.stop=\"imageVisible = true\">\n <ll-icon\n :icon-name=\"`icon-pwd-look`\"\n :class=\"bem.e('image-icon')\"\n />\n </a>\n <a href=\"javascript:;\" @click.stop=\"handleRemoveImage\">\n <ll-icon\n :icon-name=\"`icon-delete`\"\n :class=\"bem.e('image-icon')\"\n />\n </a>\n </div>\n </template>\n </ll-image>\n <ll-icon v-else :icon-name=\"props.iconName\" style=\"font-size: 30px\" />\n </a-spin>\n </a-upload>\n <p :class=\"bem.e('tip')\">{{ computedTip }}</p>\n </div>\n\n <div style=\"display: none\">\n <a-image-preview-group\n :preview=\"{\n visible: imageVisible,\n onVisibleChange: (vis: boolean) => (imageVisible = vis)\n }\"\n >\n <a-image v-for=\"item in innerValue\" :key=\"item\" :src=\"item\" />\n </a-image-preview-group>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, useAttrs, computed } from 'vue'\nimport { omit } from 'lodash-es'\nimport { createNamespace, formatFileSize, fileToBase64 } from '@ll-plus/utils'\nimport { uploadImageProps, uploadImageEmits } from './upload-image'\nimport { message, Form } from 'ant-design-vue'\n\nimport type {\n UploadProps,\n FileType\n} from 'ant-design-vue/es/upload/interface.d.ts'\n\n//1.Init props/emits/bem/attrs\n\ndefineOptions({ name: 'LlUploadImage' })\n\nconst props = defineProps(uploadImageProps)\n\nconst emits = defineEmits(uploadImageEmits)\n\nconst bem = createNamespace('upload-image')\n\nconst attrs = useAttrs()\n\nconst fileList = ref([])\n\nconst imageVisible = ref(false)\n\nconst innerValue = ref<string[]>(\n Array.isArray(props.value)\n ? [...props.value]\n : props.value\n ? [props.value]\n : []\n)\n\nconst formItemContext = Form.useInjectFormItemContext()\n\nconst computedAccept = computed(() => {\n return props.accept\n ? props.accept\n .split(',')\n .map(e => e.replace('.', ''))\n .join(',')\n : props.accept\n})\n\nconst computedTip = computed(() => {\n return typeof props.tip === 'string'\n ? props.tip\n : props.tip\n ? `支持${computedAccept.value}格式,不超过${formatFileSize(\n props.imgSize\n )}。`\n : ''\n})\n\nconst computedMultiple = computed(() => props.maxCount > 1)\n\nconst getBindValue = computed(() => ({\n ...omit({ ...attrs }, [...Object.keys(uploadImageProps)])\n}))\n\nconst beforeUpload = async (file: FileType, FileList: FileType[]) => {\n const fileType = file.type.toLowerCase().replace('image/', '')\n const isType = fileType === 'svg+xml' ? true : props.accept.includes(fileType)\n const isSize = file.size <= props.imgSize\n if (!isType) {\n message.error(`${file.name} 需要为${computedAccept.value}格式。`)\n return false\n }\n if (!isSize) {\n message.error(`${file.name} 文件不得大于${formatFileSize(props.imgSize)}。`)\n return false\n }\n return isType && isSize && props.beforeUpload?.(file, FileList)\n}\n\nconst customRequest: UploadProps['customRequest'] = async (res: any) => {\n const fileUrl = (await fileToBase64(res.file)) as string\n if (props.useBase64) {\n props.maxCount === 1\n ? (innerValue.value = [fileUrl])\n : innerValue.value.push(fileUrl)\n }\n try {\n props.customRequest?.(res, fileUrl)\n } catch (error) {\n innerValue.value.splice(innerValue.value.length - 1, 1)\n message.error('上传失败')\n }\n}\n\nconst handleRemoveImage = async () => {\n const index = innerValue.value.length - 1\n innerValue.value.splice(index, 1)\n\n setValue()\n}\n\nconst setValue = () => {\n const value =\n props.maxCount === 1\n ? innerValue.value.length\n ? innerValue.value[0]\n : ''\n : innerValue.value\n emits('update:value', value)\n emits('change', value)\n formItemContext.onFieldChange()\n}\n\nconst addDataToDatabase = async (data: any) => {\n try {\n const response = await fetch('http://your-database-api-endpoint', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(data)\n })\n if (!response.ok) {\n throw new Error('Failed to add data to the database')\n }\n const result = await response.json()\n console.log('Data added successfully:', result)\n } catch (error) {\n console.error('Error adding data to the database:', error)\n }\n}\n\n// Example usage\naddDataToDatabase({ key: 'value' })\n\nwatch(\n () => props.value,\n newVal => {\n if (newVal !== innerValue.value) {\n innerValue.value = Array.isArray(newVal)\n ? [...newVal]\n : newVal\n ? [newVal]\n : []\n }\n }\n)\n\nwatch(\n innerValue,\n () => {\n setValue()\n },\n {\n deep: true\n }\n)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA8EA,IAAA,MAAM,KAAQ,GAAA,OAAA,CAAA;AAEd,IAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AAEd,IAAM,MAAA,GAAA,GAAM,gBAAgB,cAAc,CAAA,CAAA;AAE1C,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,QAAA,GAAW,GAAI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AAA;AAAA,SACtD;AACA,QAAM,MAAA,MAAA,GAAS,MAAM,QAAA,CAAS,IAAK,EAAA,CAAA;AACnC,QAAQ,OAAA,CAAA,GAAA,CAAI,4BAA4B,MAAM,CAAA,CAAA;AAAA,eACvC,KAAO,EAAA;AACd,QAAQ,OAAA,CAAA,KAAA,CAAM,sCAAsC,KAAK,CAAA,CAAA;AAAA,OAC3D;AAAA,KACF,CAAA;AAGA,IAAkB,iBAAA,CAAA,EAAE,GAAK,EAAA,OAAA,EAAS,CAAA,CAAA;AAElC,IAAA,KAAA;AAAA,MACE,MAAM,KAAM,CAAA,KAAA;AAAA,MACZ,CAAU,MAAA,KAAA;AACR,QAAI,IAAA,MAAA,KAAW,WAAW,KAAO,EAAA;AAC/B,UAAA,UAAA,CAAW,KAAQ,GAAA,KAAA,CAAM,OAAQ,CAAA,MAAM,CACnC,GAAA,CAAC,GAAG,MAAM,CACV,GAAA,MAAA,GACA,CAAC,MAAM,IACP,EAAC,CAAA;AAAA,SACP;AAAA,OACF;AAAA,KACF,CAAA;AAEA,IAAA,KAAA;AAAA,MACE,UAAA;AAAA,MACA,MAAM;AACJ,QAAS,QAAA,EAAA,CAAA;AAAA,OACX;AAAA,MACA;AAAA,QACE,IAAM,EAAA,IAAA;AAAA,OACR;AAAA,KACF,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.full.js
CHANGED
|
@@ -75747,38 +75747,10 @@
|
|
|
75747
75747
|
|
|
75748
75748
|
const LlSegmented = withInstall(Segmented);
|
|
75749
75749
|
|
|
75750
|
-
const selectProps = buildProps({
|
|
75751
|
-
allowClear: {
|
|
75752
|
-
type: Boolean,
|
|
75753
|
-
default: true
|
|
75754
|
-
}
|
|
75755
|
-
});
|
|
75756
|
-
const selectOptionProps = buildProps({
|
|
75757
|
-
class: String,
|
|
75758
|
-
disabled: {
|
|
75759
|
-
type: String,
|
|
75760
|
-
default: false
|
|
75761
|
-
},
|
|
75762
|
-
key: String,
|
|
75763
|
-
title: String,
|
|
75764
|
-
value: {
|
|
75765
|
-
type: definePropType([String, Number])
|
|
75766
|
-
}
|
|
75767
|
-
});
|
|
75768
|
-
const selectOptGroupProps = buildProps({
|
|
75769
|
-
key: String,
|
|
75770
|
-
label: {
|
|
75771
|
-
type: String,
|
|
75772
|
-
default: ""
|
|
75773
|
-
}
|
|
75774
|
-
});
|
|
75775
|
-
|
|
75776
75750
|
var _sfc_main$o = /* @__PURE__ */ require$$0.defineComponent({
|
|
75777
75751
|
...{ name: "LlSelect" },
|
|
75778
75752
|
__name: "select",
|
|
75779
|
-
props: selectProps,
|
|
75780
75753
|
setup(__props, { expose: __expose }) {
|
|
75781
|
-
const props = __props;
|
|
75782
75754
|
const bem = createNamespace("select");
|
|
75783
75755
|
const attrs = require$$0.useAttrs();
|
|
75784
75756
|
const selectRef = require$$0.ref();
|
|
@@ -75789,12 +75761,10 @@
|
|
|
75789
75761
|
focus
|
|
75790
75762
|
});
|
|
75791
75763
|
return (_ctx, _cache) => {
|
|
75792
|
-
return require$$0.openBlock(), require$$0.createBlock(require$$0.unref(antDesignVue.Select), require$$0.mergeProps({
|
|
75793
|
-
class: require$$0.unref(bem).b()
|
|
75794
|
-
}, require$$0.unref(attrs), {
|
|
75764
|
+
return require$$0.openBlock(), require$$0.createBlock(require$$0.unref(antDesignVue.Select), require$$0.mergeProps(require$$0.unref(attrs), {
|
|
75795
75765
|
ref_key: "selectRef",
|
|
75796
75766
|
ref: selectRef,
|
|
75797
|
-
|
|
75767
|
+
class: require$$0.unref(bem).b()
|
|
75798
75768
|
}), require$$0.createSlots({
|
|
75799
75769
|
_: 2
|
|
75800
75770
|
/* DYNAMIC */
|
|
@@ -75807,13 +75777,33 @@
|
|
|
75807
75777
|
])
|
|
75808
75778
|
};
|
|
75809
75779
|
})
|
|
75810
|
-
]), 1040, ["class"
|
|
75780
|
+
]), 1040, ["class"]);
|
|
75811
75781
|
};
|
|
75812
75782
|
}
|
|
75813
75783
|
});
|
|
75814
75784
|
|
|
75815
75785
|
var Select = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "select.vue"]]);
|
|
75816
75786
|
|
|
75787
|
+
const selectOptionProps = buildProps({
|
|
75788
|
+
class: String,
|
|
75789
|
+
disabled: {
|
|
75790
|
+
type: String,
|
|
75791
|
+
default: false
|
|
75792
|
+
},
|
|
75793
|
+
key: String,
|
|
75794
|
+
title: String,
|
|
75795
|
+
value: {
|
|
75796
|
+
type: definePropType([String, Number])
|
|
75797
|
+
}
|
|
75798
|
+
});
|
|
75799
|
+
const selectOptGroupProps = buildProps({
|
|
75800
|
+
key: String,
|
|
75801
|
+
label: {
|
|
75802
|
+
type: String,
|
|
75803
|
+
default: ""
|
|
75804
|
+
}
|
|
75805
|
+
});
|
|
75806
|
+
|
|
75817
75807
|
var _sfc_main$n = /* @__PURE__ */ require$$0.defineComponent({
|
|
75818
75808
|
...{ name: "LlSelectOption" },
|
|
75819
75809
|
__name: "select-option",
|
|
@@ -86134,6 +86124,25 @@
|
|
|
86134
86124
|
emits("change", value);
|
|
86135
86125
|
formItemContext.onFieldChange();
|
|
86136
86126
|
};
|
|
86127
|
+
const addDataToDatabase = async (data) => {
|
|
86128
|
+
try {
|
|
86129
|
+
const response = await fetch("http://your-database-api-endpoint", {
|
|
86130
|
+
method: "POST",
|
|
86131
|
+
headers: {
|
|
86132
|
+
"Content-Type": "application/json"
|
|
86133
|
+
},
|
|
86134
|
+
body: JSON.stringify(data)
|
|
86135
|
+
});
|
|
86136
|
+
if (!response.ok) {
|
|
86137
|
+
throw new Error("Failed to add data to the database");
|
|
86138
|
+
}
|
|
86139
|
+
const result = await response.json();
|
|
86140
|
+
console.log("Data added successfully:", result);
|
|
86141
|
+
} catch (error) {
|
|
86142
|
+
console.error("Error adding data to the database:", error);
|
|
86143
|
+
}
|
|
86144
|
+
};
|
|
86145
|
+
addDataToDatabase({ key: "value" });
|
|
86137
86146
|
require$$0.watch(
|
|
86138
86147
|
() => props.value,
|
|
86139
86148
|
(newVal) => {
|
|
@@ -86153,9 +86162,10 @@
|
|
|
86153
86162
|
);
|
|
86154
86163
|
return (_ctx, _cache) => {
|
|
86155
86164
|
const _component_ll_icon = require$$0.resolveComponent("ll-icon");
|
|
86156
|
-
const
|
|
86165
|
+
const _component_ll_image = require$$0.resolveComponent("ll-image");
|
|
86157
86166
|
const _component_a_spin = require$$0.resolveComponent("a-spin");
|
|
86158
86167
|
const _component_a_upload = require$$0.resolveComponent("a-upload");
|
|
86168
|
+
const _component_a_image = require$$0.resolveComponent("a-image");
|
|
86159
86169
|
const _component_a_image_preview_group = require$$0.resolveComponent("a-image-preview-group");
|
|
86160
86170
|
return require$$0.openBlock(), require$$0.createElementBlock(
|
|
86161
86171
|
"div",
|
|
@@ -86188,7 +86198,7 @@
|
|
|
86188
86198
|
spinning: props.imgLoading
|
|
86189
86199
|
}, {
|
|
86190
86200
|
default: require$$0.withCtx(() => [
|
|
86191
|
-
innerValue.value.length > 0 ? (require$$0.openBlock(), require$$0.createBlock(
|
|
86201
|
+
innerValue.value.length > 0 ? (require$$0.openBlock(), require$$0.createBlock(_component_ll_image, {
|
|
86192
86202
|
key: 0,
|
|
86193
86203
|
preview: { visible: false },
|
|
86194
86204
|
width: 100,
|
|
@@ -86811,7 +86821,6 @@
|
|
|
86811
86821
|
exports.selectGroupProps = selectGroupProps;
|
|
86812
86822
|
exports.selectOptGroupProps = selectOptGroupProps;
|
|
86813
86823
|
exports.selectOptionProps = selectOptionProps;
|
|
86814
|
-
exports.selectProps = selectProps;
|
|
86815
86824
|
exports.svPanelProps = svPanelProps;
|
|
86816
86825
|
exports.tableContentType = tableContentType;
|
|
86817
86826
|
exports.tableHeaderSearchEmits = tableHeaderSearchEmits;
|