@vipl520/dk-ui 1.0.49 → 1.0.50
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +106 -18
- package/dist/index.min.js +4 -4
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -4
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +106 -18
- package/es/style-input/index.d.ts +35 -0
- package/es/style-input/src/props.d.ts +16 -0
- package/es/style-input/src/props.mjs +18 -0
- package/es/style-input/src/props.mjs.map +1 -1
- package/es/style-input/src/style-input.vue.d.ts +35 -0
- package/es/style-input/src/style-input.vue2.mjs +73 -3
- package/es/style-input/src/style-input.vue2.mjs.map +1 -1
- package/lib/style-input/index.d.ts +35 -0
- package/lib/style-input/src/props.d.ts +16 -0
- package/lib/style-input/src/props.js +18 -0
- package/lib/style-input/src/props.js.map +1 -1
- package/lib/style-input/src/style-input.vue.d.ts +35 -0
- package/lib/style-input/src/style-input.vue2.js +72 -2
- package/lib/style-input/src/style-input.vue2.js.map +1 -1
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.js","sources":["../../../src/style-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { defaultConfig, type StyleInputConfig } from './default'\n\nexport const styleInputProps = {\n /**\n * 引入组件\n */\n components: {\n default: () => {\n return defaultConfig\n },\n type: Array as () => StyleInputConfig,\n },\n /**\n * 需要隐藏组件\n */\n hideComponents: {\n default: () => {\n return []\n },\n type: Array as () => string[],\n },\n modelValue: {\n default: () => {\n return {}\n },\n type: Object,\n },\n}\n\nexport type StyleInputProps = ExtractPropTypes<typeof styleInputProps>\n"],"names":["defaultConfig"],"mappings":";;;;AAGO,MAAM,eAAkB,GAAA;AAAA;AAAA;AAAA;AAAA,EAI7B,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAO,OAAAA,sBAAA,CAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,cAAgB,EAAA;AAAA,IACd,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
1
|
+
{"version":3,"file":"props.js","sources":["../../../src/style-input/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\nimport { defaultConfig, type StyleInputConfig } from './default'\n\nexport const styleInputProps = {\n /**\n * 引入组件\n */\n components: {\n default: () => {\n return defaultConfig\n },\n type: Array as () => StyleInputConfig,\n },\n /**\n * 需要隐藏组件\n */\n hideComponents: {\n default: () => {\n return []\n },\n type: Array as () => string[],\n },\n modelValue: {\n default: () => {\n return {}\n },\n type: Object,\n },\n isDrawer: {\n default: false,\n type: Boolean,\n },\n drawerProps: {\n default: () => {\n return {\n title: '编辑样式',\n direction: 'rtl',\n size: '400px',\n }\n },\n type: Object,\n },\n drawerText: {\n default: '编辑样式',\n type: String,\n },\n}\n\nexport type StyleInputProps = ExtractPropTypes<typeof styleInputProps>\n"],"names":["defaultConfig"],"mappings":";;;;AAGO,MAAM,eAAkB,GAAA;AAAA;AAAA;AAAA;AAAA,EAI7B,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAO,OAAAA,sBAAA,CAAA;AAAA,KACT;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA;AAAA;AAAA;AAAA,EAIA,cAAgB,EAAA;AAAA,IACd,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,KAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,KAAO,EAAA,0BAAA;AAAA,QACP,SAAW,EAAA,KAAA;AAAA,QACX,IAAM,EAAA,OAAA;AAAA,OACR,CAAA;AAAA,KACF;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,0BAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AACF;;;;"}
|
@@ -11,6 +11,22 @@ declare const _default: import("vue").DefineComponent<{
|
|
11
11
|
default: () => {};
|
12
12
|
type: ObjectConstructor;
|
13
13
|
};
|
14
|
+
isDrawer: {
|
15
|
+
default: boolean;
|
16
|
+
type: BooleanConstructor;
|
17
|
+
};
|
18
|
+
drawerProps: {
|
19
|
+
default: () => {
|
20
|
+
title: string;
|
21
|
+
direction: string;
|
22
|
+
size: string;
|
23
|
+
};
|
24
|
+
type: ObjectConstructor;
|
25
|
+
};
|
26
|
+
drawerText: {
|
27
|
+
default: string;
|
28
|
+
type: StringConstructor;
|
29
|
+
};
|
14
30
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
15
31
|
components: {
|
16
32
|
default: () => import("./default").StyleInputConfig;
|
@@ -24,11 +40,30 @@ declare const _default: import("vue").DefineComponent<{
|
|
24
40
|
default: () => {};
|
25
41
|
type: ObjectConstructor;
|
26
42
|
};
|
43
|
+
isDrawer: {
|
44
|
+
default: boolean;
|
45
|
+
type: BooleanConstructor;
|
46
|
+
};
|
47
|
+
drawerProps: {
|
48
|
+
default: () => {
|
49
|
+
title: string;
|
50
|
+
direction: string;
|
51
|
+
size: string;
|
52
|
+
};
|
53
|
+
type: ObjectConstructor;
|
54
|
+
};
|
55
|
+
drawerText: {
|
56
|
+
default: string;
|
57
|
+
type: StringConstructor;
|
58
|
+
};
|
27
59
|
}>> & {
|
28
60
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
29
61
|
}, {
|
30
62
|
modelValue: Record<string, any>;
|
31
63
|
components: import("./default").StyleInputConfig;
|
32
64
|
hideComponents: string[];
|
65
|
+
isDrawer: boolean;
|
66
|
+
drawerProps: Record<string, any>;
|
67
|
+
drawerText: string;
|
33
68
|
}, {}>;
|
34
69
|
export default _default;
|
@@ -10,6 +10,7 @@ const _hoisted_2 = {
|
|
10
10
|
key: 0,
|
11
11
|
class: "p-5px"
|
12
12
|
};
|
13
|
+
const _hoisted_3 = { key: 1 };
|
13
14
|
const __default__ = vue.defineComponent({
|
14
15
|
name: "DkStyleInput"
|
15
16
|
});
|
@@ -19,6 +20,7 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
19
20
|
emits: ["update:modelValue"],
|
20
21
|
setup(__props, { emit }) {
|
21
22
|
const props = __props;
|
23
|
+
const drawer = vue.ref(false);
|
22
24
|
const activeNames = vue.ref([0]);
|
23
25
|
const values = vue.ref({});
|
24
26
|
const loading = vue.ref(true);
|
@@ -67,9 +69,12 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
67
69
|
return (_ctx, _cache) => {
|
68
70
|
const _component_el_collapse_item = vue.resolveComponent("el-collapse-item");
|
69
71
|
const _component_el_collapse = vue.resolveComponent("el-collapse");
|
72
|
+
const _component_el_button = vue.resolveComponent("el-button");
|
73
|
+
const _component_el_drawer = vue.resolveComponent("el-drawer");
|
70
74
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
71
75
|
!loading.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
|
72
|
-
vue.
|
76
|
+
!props.isDrawer ? (vue.openBlock(), vue.createBlock(_component_el_collapse, {
|
77
|
+
key: 0,
|
73
78
|
modelValue: activeNames.value,
|
74
79
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeNames.value = $event)
|
75
80
|
}, {
|
@@ -107,7 +112,72 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
107
112
|
]),
|
108
113
|
_: 1
|
109
114
|
/* STABLE */
|
110
|
-
}, 8, ["modelValue"])
|
115
|
+
}, 8, ["modelValue"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
116
|
+
vue.createVNode(_component_el_button, {
|
117
|
+
type: "primary",
|
118
|
+
plain: "",
|
119
|
+
style: { "width": "100%" },
|
120
|
+
onClick: _cache[1] || (_cache[1] = ($event) => drawer.value = true)
|
121
|
+
}, {
|
122
|
+
default: vue.withCtx(() => [
|
123
|
+
vue.createTextVNode(
|
124
|
+
vue.toDisplayString(props.drawerText),
|
125
|
+
1
|
126
|
+
/* TEXT */
|
127
|
+
)
|
128
|
+
]),
|
129
|
+
_: 1
|
130
|
+
/* STABLE */
|
131
|
+
}),
|
132
|
+
vue.createVNode(_component_el_drawer, vue.mergeProps({
|
133
|
+
modelValue: drawer.value,
|
134
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => drawer.value = $event)
|
135
|
+
}, props.drawerProps), {
|
136
|
+
default: vue.withCtx(() => [
|
137
|
+
vue.createVNode(_component_el_collapse, {
|
138
|
+
modelValue: activeNames.value,
|
139
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeNames.value = $event)
|
140
|
+
}, {
|
141
|
+
default: vue.withCtx(() => [
|
142
|
+
(vue.openBlock(true), vue.createElementBlock(
|
143
|
+
vue.Fragment,
|
144
|
+
null,
|
145
|
+
vue.renderList(_components.value, (item, key) => {
|
146
|
+
return vue.openBlock(), vue.createBlock(_component_el_collapse_item, {
|
147
|
+
key,
|
148
|
+
title: "",
|
149
|
+
name: key
|
150
|
+
}, {
|
151
|
+
title: vue.withCtx(() => [
|
152
|
+
vue.createTextVNode(
|
153
|
+
vue.toDisplayString(item.title),
|
154
|
+
1
|
155
|
+
/* TEXT */
|
156
|
+
)
|
157
|
+
]),
|
158
|
+
default: vue.withCtx(() => [
|
159
|
+
activeNames.value.includes(key) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(item.name), vue.mergeProps({
|
160
|
+
key: 0,
|
161
|
+
modelValue: values.value[item.name],
|
162
|
+
"onUpdate:modelValue": ($event) => values.value[item.name] = $event
|
163
|
+
}, item.props, { onChange }), null, 16, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("v-if", true)
|
164
|
+
]),
|
165
|
+
_: 2
|
166
|
+
/* DYNAMIC */
|
167
|
+
}, 1032, ["name"]);
|
168
|
+
}),
|
169
|
+
128
|
170
|
+
/* KEYED_FRAGMENT */
|
171
|
+
))
|
172
|
+
]),
|
173
|
+
_: 1
|
174
|
+
/* STABLE */
|
175
|
+
}, 8, ["modelValue"])
|
176
|
+
]),
|
177
|
+
_: 1
|
178
|
+
/* STABLE */
|
179
|
+
}, 16, ["modelValue"])
|
180
|
+
]))
|
111
181
|
])) : vue.createCommentVNode("v-if", true)
|
112
182
|
]);
|
113
183
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"style-input.vue2.js","sources":["../../../src/style-input/src/style-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleInput',\n});\n</script>\n<template>\n <div class=\"dk-style-input\">\n <div v-if=\"!loading\" class=\"p-5px\">\n <el-collapse v-model=\"activeNames\">\n <el-collapse-item v-for=\"(item, key) in _components\" :key=\"key\" title=\"\" :name=\"key\">\n <template #title>\n {{ item.title }}\n </template>\n <component\n :is=\"item.name\"\n v-if=\"activeNames.includes(key)\"\n v-model=\"values[item.name]\"\n v-bind=\"item.props\"\n @change=\"onChange\"\n />\n </el-collapse-item>\n </el-collapse>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleInputProps } from './props'\nimport { onMounted, ref, watch } from 'vue'\n\n\nconst props = defineProps(styleInputProps)\nconst activeNames = ref([0])\nconst values: any = ref({})\nconst loading = ref(true)\n\nconst emit = defineEmits(['update:modelValue'])\nconst onChange = () => {\n const obj: any = {}\n Object.keys(values.value).forEach((key) => {\n Object.keys(values.value[key]).forEach((k) => {\n obj[k] = values.value[key][k]\n })\n })\n emit('update:modelValue', obj)\n}\n\nconst _components: any = ref([])\nconst init = () => {\n _components.value = props.components.filter((item: any) => {\n console.log('item.name', item.name)\n return !props.hideComponents.includes(item.name)\n })\n const obj: any = {}\n _components.value.forEach((item: any) => {\n const params = item.params\n const paramsObj: any = {}\n Object.keys(params).forEach((key) => {\n const param = params[key]\n if (props.modelValue[param]) {\n paramsObj[param] = props.modelValue[param]\n }\n })\n obj[item.name] = paramsObj\n })\n values.value = obj\n loading.value = false\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n },\n {\n deep: true,\n }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","watch","onMounted"],"mappings":"
|
1
|
+
{"version":3,"file":"style-input.vue2.js","sources":["../../../src/style-input/src/style-input.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkStyleInput',\n});\n</script>\n<template>\n <div class=\"dk-style-input\">\n <div v-if=\"!loading\" class=\"p-5px\">\n <el-collapse v-if=\"!props.isDrawer\" v-model=\"activeNames\">\n <el-collapse-item v-for=\"(item, key) in _components\" :key=\"key\" title=\"\" :name=\"key\">\n <template #title>\n {{ item.title }}\n </template>\n <component\n :is=\"item.name\"\n v-if=\"activeNames.includes(key)\"\n v-model=\"values[item.name]\"\n v-bind=\"item.props\"\n @change=\"onChange\"\n />\n </el-collapse-item>\n </el-collapse>\n <div v-else>\n <el-button type=\"primary\" plain style=\"width: 100%\" @click=\"drawer = true\">{{ props.drawerText }}</el-button>\n <el-drawer v-model=\"drawer\" v-bind=\"props.drawerProps\">\n <el-collapse v-model=\"activeNames\">\n <el-collapse-item v-for=\"(item, key) in _components\" :key=\"key\" title=\"\" :name=\"key\">\n <template #title>\n {{ item.title }}\n </template>\n <component\n :is=\"item.name\"\n v-if=\"activeNames.includes(key)\"\n v-model=\"values[item.name]\"\n v-bind=\"item.props\"\n @change=\"onChange\"\n />\n </el-collapse-item>\n </el-collapse>\n </el-drawer>\n </div>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { styleInputProps } from './props'\nimport { onMounted, ref, watch } from 'vue'\n\n\nconst props = defineProps(styleInputProps)\nconst drawer = ref(false)\nconst activeNames = ref([0])\nconst values: any = ref({})\nconst loading = ref(true)\n\nconst emit = defineEmits(['update:modelValue'])\nconst onChange = () => {\n const obj: any = {}\n Object.keys(values.value).forEach((key) => {\n Object.keys(values.value[key]).forEach((k) => {\n obj[k] = values.value[key][k]\n })\n })\n emit('update:modelValue', obj)\n}\n\nconst _components: any = ref([])\nconst init = () => {\n _components.value = props.components.filter((item: any) => {\n console.log('item.name', item.name)\n return !props.hideComponents.includes(item.name)\n })\n const obj: any = {}\n _components.value.forEach((item: any) => {\n const params = item.params\n const paramsObj: any = {}\n Object.keys(params).forEach((key) => {\n const param = params[key]\n if (props.modelValue[param]) {\n paramsObj[param] = props.modelValue[param]\n }\n })\n obj[item.name] = paramsObj\n })\n values.value = obj\n loading.value = false\n}\n\nwatch(\n () => props.modelValue,\n () => {\n init()\n },\n {\n deep: true,\n }\n)\n\nonMounted(() => {\n init()\n})\n</script>\n"],"names":["__MACROS_defineComponent","ref","watch","onMounted"],"mappings":";;;;;;;;;;;;;AAEA,MAA6B,cAAAA,mBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,cAAA;AACR,CAAC,CAAA,CAAA;;;;;;;AAgDD,IAAM,MA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