@vunk/plus 1.6.7 → 1.6.8

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.
@@ -1334,4 +1334,4 @@ var SendOutlined = function SendOutlined(props, context) {
1334
1334
  SendOutlined.displayName = 'SendOutlined';
1335
1335
  SendOutlined.inheritAttrs = false;
1336
1336
 
1337
- export { AudioMutedOutlined as A, CloseOutlined as C, LinkOutlined as L, SendOutlined as S, AudioOutlined as a, CloudUploadOutlined as b };
1337
+ export { AudioMutedOutlined as A, CloseOutlined as C, LinkOutlined as L, SendOutlined as S, CloudUploadOutlined as a, AudioOutlined as b };
@@ -108,7 +108,7 @@ var _sfc_main = defineComponent({
108
108
  }
109
109
  },
110
110
  emits: {
111
- load: (e) => e
111
+ load: null
112
112
  },
113
113
  setup(props, { slots, emit }) {
114
114
  const request = (info, event) => {
@@ -2,14 +2,6 @@
2
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  }
5
- /* .vk-sender .ant-sender-content{
6
- display: grid;
7
- grid-template-columns: auto 1fr;
8
- }
9
- .vk-sender .ant-sender-actions-list {
10
- margin-top: 1em;
11
- grid-column: 1 / -1;
12
- } */
13
5
  .vk-sender .ant-sender-prefix {
14
6
  align-self: start;
15
7
  }
@@ -1,11 +1,10 @@
1
- import { defineComponent, resolveComponent, createBlock, openBlock, withCtx, withDirectives, createElementVNode, mergeProps, toDisplayString, createVNode, renderSlot, vShow, computed, ref, nextTick, createSlots, createCommentVNode } from 'vue';
1
+ import { defineComponent, createBlock, openBlock, unref, withCtx, withDirectives, createElementVNode, mergeProps, toDisplayString, createVNode, renderSlot, vShow, useSlots, computed, ref, createSlots, createCommentVNode, nextTick } from 'vue';
2
2
  import { useModelComputed, useDeferred } from '@vunk/core/composables';
3
3
  import { Button } from 'ant-design-vue';
4
- import { Attachments, Sender } from 'ant-design-x-vue';
4
+ import { Sender, Attachments } from 'ant-design-x-vue';
5
5
  import { noop } from '@vunk/shared/function';
6
6
  import { ElCollapseTransition } from 'element-plus';
7
- import { C as CloseOutlined, L as LinkOutlined, b as CloudUploadOutlined, S as SendOutlined } from '../SendOutlined.mjs';
8
- import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
7
+ import { C as CloseOutlined, L as LinkOutlined, a as CloudUploadOutlined, S as SendOutlined } from '../SendOutlined.mjs';
9
8
 
10
9
  const props = {
11
10
  /**
@@ -55,14 +54,21 @@ const emits = {
55
54
  "cancel": null
56
55
  };
57
56
 
58
- var _sfc_main$1 = /* @__PURE__ */ defineComponent({
59
- name: "AXSenderHeader",
60
- components: {
61
- ElCollapseTransition,
62
- AntButton: Button,
63
- CloseOutlined
57
+ const _hoisted_1 = {
58
+ class: "ant-sender-header-header"
59
+ };
60
+ const _hoisted_2 = {
61
+ class: "ant-sender-header-header-title"
62
+ };
63
+ const _hoisted_3 = {
64
+ class: "ant-sender-header-header-close"
65
+ };
66
+ var _sfc_main$1 = /* @__PURE__ */defineComponent({
67
+ ...{
68
+ name: "AXSenderHeader",
69
+ inheritAttrs: false
64
70
  },
65
- inheritAttrs: false,
71
+ __name: "SenderHeader",
66
72
  props: {
67
73
  modelValue: {
68
74
  type: Boolean,
@@ -80,91 +86,51 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
80
86
  emits: {
81
87
  "update:modelValue": null
82
88
  },
83
- setup() {
84
- return {};
89
+ setup(__props) {
90
+ return (_ctx, _cache) => {
91
+ return openBlock(), createBlock(unref(ElCollapseTransition), null, {
92
+ default: withCtx(() => [withDirectives(createElementVNode("div", mergeProps({
93
+ class: "ant-sender-header"
94
+ }, _ctx.$attrs), [createElementVNode("div", _hoisted_1, [createElementVNode("div", _hoisted_2, toDisplayString(__props.title), 1
95
+ /* TEXT */), createElementVNode("div", _hoisted_3, [createVNode(unref(Button), {
96
+ type: "text",
97
+ size: "small",
98
+ onClick: _cache[0] || (_cache[0] = $event => _ctx.$emit("update:modelValue", false))
99
+ }, {
100
+ icon: withCtx(() => [createVNode(unref(CloseOutlined))]),
101
+ _: 1
102
+ /* STABLE */
103
+ })])]), createElementVNode("div", {
104
+ ref: __props.contentRef,
105
+ class: "ant-sender-header-content"
106
+ }, [renderSlot(_ctx.$slots, "default")], 512
107
+ /* NEED_PATCH */)], 16
108
+ /* FULL_PROPS */), [[vShow, __props.modelValue]])]),
109
+ _: 3
110
+ /* FORWARDED */
111
+ });
112
+ };
85
113
  }
86
114
  });
87
115
 
88
- const _hoisted_1 = { class: "ant-sender-header-header" };
89
- const _hoisted_2 = { class: "ant-sender-header-header-title" };
90
- const _hoisted_3 = { class: "ant-sender-header-header-close" };
91
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
92
- const _component_CloseOutlined = resolveComponent("CloseOutlined");
93
- const _component_AntButton = resolveComponent("AntButton");
94
- const _component_ElCollapseTransition = resolveComponent("ElCollapseTransition");
95
- return openBlock(), createBlock(_component_ElCollapseTransition, null, {
96
- default: withCtx(() => [
97
- withDirectives(createElementVNode(
98
- "div",
99
- mergeProps({ class: "ant-sender-header" }, _ctx.$attrs),
100
- [
101
- createElementVNode("div", _hoisted_1, [
102
- createElementVNode(
103
- "div",
104
- _hoisted_2,
105
- toDisplayString(_ctx.title),
106
- 1
107
- /* TEXT */
108
- ),
109
- createElementVNode("div", _hoisted_3, [
110
- createVNode(_component_AntButton, {
111
- type: "text",
112
- size: "small",
113
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:modelValue", false))
114
- }, {
115
- icon: withCtx(() => [
116
- createVNode(_component_CloseOutlined)
117
- ]),
118
- _: 1
119
- /* STABLE */
120
- })
121
- ])
122
- ]),
123
- createElementVNode(
124
- "div",
125
- {
126
- ref: _ctx.contentRef,
127
- class: "ant-sender-header-content"
128
- },
129
- [
130
- renderSlot(_ctx.$slots, "default")
131
- ],
132
- 512
133
- /* NEED_PATCH */
134
- )
135
- ],
136
- 16
137
- /* FULL_PROPS */
138
- ), [
139
- [vShow, _ctx.modelValue]
140
- ])
141
- ]),
142
- _: 3
143
- /* FORWARDED */
144
- });
145
- }
146
- var SenderHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
147
-
148
- var _sfc_main = /* @__PURE__ */ defineComponent({
149
- name: "VkSender",
150
- components: {
151
- Sender,
152
- LinkOutlined,
153
- AntButton: Button,
154
- Attachments,
155
- SenderHeader
116
+ var _sfc_main = /* @__PURE__ */defineComponent({
117
+ ...{
118
+ name: "VkSender"
156
119
  },
157
- props,
120
+ __name: "index",
121
+ props: props,
158
122
  emits,
159
- setup(props2, {
160
- emit,
161
- slots
123
+ setup(__props, {
124
+ emit: __emit
162
125
  }) {
163
- const hasAttachments = computed(() => props2.modules.includes("Attachments"));
126
+ const props = __props;
127
+ const emit = __emit;
128
+ const slots = useSlots();
129
+ const hasAttachments = computed(() => props.modules.includes("Attachments"));
164
130
  const loading = useModelComputed({
165
131
  key: "loading",
166
132
  default: false
167
- }, props2, emit);
133
+ }, props, emit);
168
134
  const headerOpen = ref(false);
169
135
  const actionsRender = (_, info) => {
170
136
  const {
@@ -178,7 +144,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
178
144
  return createVNode(SendButton, {
179
145
  "type": "text",
180
146
  "icon": createVNode(SendOutlined, null, null),
181
- "disabled": props2.sendDisabled
147
+ "disabled": props.sendDisabled
182
148
  }, null);
183
149
  };
184
150
  const sendAction = () => loading.value ? loadingRender() : sendRender();
@@ -206,10 +172,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
206
172
  const theFileList = useModelComputed({
207
173
  key: "fileList",
208
174
  default: []
209
- }, props2, emit);
175
+ }, props, emit);
210
176
  const attachmentsRef = ref();
211
177
  const attachmentWrapDef = useDeferred();
212
- const handlePasteFile = async file => {
178
+ const attachmentWrapResolve = attachmentWrapDef.resolve;
179
+ async function handlePasteFile(file) {
213
180
  headerOpen.value = true;
214
181
  const attachmentWrap = await attachmentWrapDef.promise;
215
182
  await nextTick();
@@ -222,98 +189,69 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
222
189
  bubbles: true
223
190
  }));
224
191
  }
225
- };
226
- const handleChange = e => {
192
+ }
193
+ function handleChange(e) {
227
194
  theFileList.value = e.fileList;
228
- };
229
- return {
230
- hasAttachments,
231
- actionsRender,
232
- headerOpen,
233
- attachmentsPlaceholder,
234
- handlePasteFile,
235
- attachmentsRef,
236
- theFileList,
237
- handleChange,
238
- attachmentWrapResolve: attachmentWrapDef.resolve
195
+ }
196
+ return (_ctx, _cache) => {
197
+ return openBlock(), createBlock(unref(Sender), {
198
+ class: "vk-sender",
199
+ value: _ctx.modelValue,
200
+ loading: unref(loading),
201
+ "allow-speech": true,
202
+ actions: actionsRender,
203
+ "on-submit": e => {
204
+ !_ctx.sendDisabled && _ctx.$emit("submit", e);
205
+ },
206
+ "on-cancel": () => _ctx.$emit("cancel"),
207
+ "onUpdate:value": _cache[2] || (_cache[2] = $event => _ctx.$emit("update:modelValue", $event)),
208
+ onPasteFile: handlePasteFile
209
+ }, createSlots({
210
+ header: withCtx(() => [hasAttachments.value ? (openBlock(), createBlock(_sfc_main$1, {
211
+ key: 0,
212
+ modelValue: headerOpen.value,
213
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => headerOpen.value = $event),
214
+ title: "\u9644\u4EF6",
215
+ "content-ref": unref(attachmentWrapResolve)
216
+ }, {
217
+ default: withCtx(() => [createVNode(unref(Attachments), {
218
+ ref_key: "attachmentsRef",
219
+ ref: attachmentsRef,
220
+ "file-list": unref(theFileList),
221
+ placeholder: attachmentsPlaceholder,
222
+ action: _ctx.action,
223
+ multiple: "",
224
+ onChange: handleChange
225
+ }, null, 8, ["file-list", "action"])]),
226
+ _: 1
227
+ /* STABLE */
228
+ }, 8, ["modelValue", "content-ref"])) : createCommentVNode("v-if", true)]),
229
+ prefix: withCtx(() => [hasAttachments.value ? (openBlock(), createBlock(unref(Button), {
230
+ key: 0,
231
+ type: "text",
232
+ onClick: _cache[1] || (_cache[1] = $event => headerOpen.value = !headerOpen.value)
233
+ }, {
234
+ icon: withCtx(() => [createVNode(unref(LinkOutlined))]),
235
+ _: 1
236
+ /* STABLE */
237
+ })) : createCommentVNode("v-if", true)]),
238
+ _: 2
239
+ /* DYNAMIC */
240
+ }, [_ctx.$slots.footer ? {
241
+ name: "footer",
242
+ fn: withCtx(() => [renderSlot(_ctx.$slots, "footer")]),
243
+ key: "0"
244
+ } : void 0]), 1032, ["value", "loading", "on-submit", "on-cancel"]);
239
245
  };
240
246
  }
241
247
  });
242
248
 
243
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
244
- const _component_Attachments = resolveComponent("Attachments");
245
- const _component_SenderHeader = resolveComponent("SenderHeader");
246
- const _component_LinkOutlined = resolveComponent("LinkOutlined");
247
- const _component_AntButton = resolveComponent("AntButton");
248
- const _component_Sender = resolveComponent("Sender");
249
- return openBlock(), createBlock(_component_Sender, {
250
- class: "vk-sender",
251
- value: _ctx.modelValue,
252
- loading: _ctx.loading,
253
- "allow-speech": true,
254
- actions: _ctx.actionsRender,
255
- "on-submit": (e) => {
256
- !_ctx.sendDisabled && _ctx.$emit("submit", e);
257
- },
258
- "on-cancel": () => _ctx.$emit("cancel"),
259
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:modelValue", $event)),
260
- onPasteFile: _ctx.handlePasteFile
261
- }, createSlots({
262
- header: withCtx(() => [
263
- _ctx.hasAttachments ? (openBlock(), createBlock(_component_SenderHeader, {
264
- key: 0,
265
- modelValue: _ctx.headerOpen,
266
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.headerOpen = $event),
267
- title: "\u9644\u4EF6",
268
- "content-ref": _ctx.attachmentWrapResolve
269
- }, {
270
- default: withCtx(() => [
271
- createVNode(_component_Attachments, {
272
- ref: "attachmentsRef",
273
- "file-list": _ctx.theFileList,
274
- placeholder: _ctx.attachmentsPlaceholder,
275
- action: _ctx.action,
276
- multiple: "",
277
- onChange: _ctx.handleChange
278
- }, null, 8, ["file-list", "placeholder", "action", "onChange"])
279
- ]),
280
- _: 1
281
- /* STABLE */
282
- }, 8, ["modelValue", "content-ref"])) : createCommentVNode("v-if", true)
283
- ]),
284
- prefix: withCtx(() => [
285
- _ctx.hasAttachments ? (openBlock(), createBlock(_component_AntButton, {
286
- key: 0,
287
- type: "text",
288
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.headerOpen = !_ctx.headerOpen)
289
- }, {
290
- icon: withCtx(() => [
291
- createVNode(_component_LinkOutlined)
292
- ]),
293
- _: 1
294
- /* STABLE */
295
- })) : createCommentVNode("v-if", true)
296
- ]),
297
- _: 2
298
- /* DYNAMIC */
299
- }, [
300
- _ctx.$slots.footer ? {
301
- name: "footer",
302
- fn: withCtx(() => [
303
- renderSlot(_ctx.$slots, "footer")
304
- ]),
305
- key: "0"
306
- } : void 0
307
- ]), 1032, ["value", "loading", "actions", "on-submit", "on-cancel", "onPasteFile"]);
308
- }
309
- var VkSender = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
310
-
311
249
  var types = /*#__PURE__*/Object.freeze({
312
250
  __proto__: null
313
251
  });
314
252
 
315
- VkSender.install = (app) => {
316
- app.component(VkSender.name || "VkSender", VkSender);
253
+ _sfc_main.install = (app) => {
254
+ app.component(_sfc_main.name || "VkSender", _sfc_main);
317
255
  };
318
256
 
319
- export { VkSender, types as __VkSender, VkSender as default };
257
+ export { _sfc_main as VkSender, types as __VkSender, _sfc_main as default };
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, createVNode, createTextVNode } from 'vue';
2
2
  import { useRecorder } from '@vunk/plus/composables/recorder';
3
3
  import { Button } from 'ant-design-vue';
4
- import { A as AudioMutedOutlined, a as AudioOutlined } from '../SendOutlined.mjs';
4
+ import { A as AudioMutedOutlined, b as AudioOutlined } from '../SendOutlined.mjs';
5
5
 
6
6
  const props = {
7
7
  disabled: {
package/index.css CHANGED
@@ -135,14 +135,6 @@
135
135
  display: flex;
136
136
  justify-content: space-between;
137
137
  }
138
- /* .vk-sender .ant-sender-content{
139
- display: grid;
140
- grid-template-columns: auto 1fr;
141
- }
142
- .vk-sender .ant-sender-actions-list {
143
- margin-top: 1em;
144
- grid-column: 1 / -1;
145
- } */
146
138
  .vk-sender .ant-sender-prefix {
147
139
  align-self: start;
148
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/plus",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "license": "ISC",