ant-design-x-vue 1.2.2 → 1.2.4

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.
@@ -1,22 +1,22 @@
1
- import { defineComponent as $, mergeDefaults as q, toRef as T, useSlots as V, computed as d, useTemplateRef as F, ref as X, watch as B, createVNode as i, Fragment as M } from "vue";
2
- import k from "../_util/hooks/use-x-component-config.mjs";
3
- import z from "../x-provider/hooks/use-x-provider-context.mjs";
1
+ import { defineComponent as $, mergeDefaults as q, toRef as T, useSlots as V, computed as f, useTemplateRef as F, watch as X, createVNode as i, Fragment as B } from "vue";
2
+ import M from "../_util/hooks/use-x-component-config.mjs";
3
+ import k from "../x-provider/hooks/use-x-provider-context.mjs";
4
4
  import "../x-provider/context.mjs";
5
5
  import "ant-design-vue";
6
- import G from "./PlaceholderUploader.mjs";
6
+ import z from "./PlaceholderUploader.mjs";
7
7
  import L from "./DropArea.mjs";
8
- import H from "./SilentUploader.mjs";
9
- import { _ as J } from "./FileList/FileList2.mjs";
10
- import { AttachmentContextProvider as K } from "./context.mjs";
11
- import Q from "./style/index.mjs";
12
- import W from "../_util/hooks/use-state.mjs";
13
- function Y(e, f) {
8
+ import G from "./SilentUploader.mjs";
9
+ import { _ as H } from "./FileList/FileList2.mjs";
10
+ import { AttachmentContextProvider as J } from "./context.mjs";
11
+ import K from "./style/index.mjs";
12
+ import Q from "../_util/hooks/use-state.mjs";
13
+ function W(e, m) {
14
14
  const s = /* @__PURE__ */ Object.create(null);
15
15
  for (const r in e)
16
- f.includes(r) || Object.defineProperty(s, r, { enumerable: !0, get: () => e[r] });
16
+ m.includes(r) || Object.defineProperty(s, r, { enumerable: !0, get: () => e[r] });
17
17
  return s;
18
18
  }
19
- function Z(e) {
19
+ function Y(e) {
20
20
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
21
21
  }
22
22
  var x = { exports: {} };
@@ -26,14 +26,14 @@ var x = { exports: {} };
26
26
  http://jedwatson.github.io/classnames
27
27
  */
28
28
  var j;
29
- function _() {
29
+ function Z() {
30
30
  return j || (j = 1, function(e) {
31
31
  (function() {
32
- var f = {}.hasOwnProperty;
32
+ var m = {}.hasOwnProperty;
33
33
  function s() {
34
34
  for (var l = "", t = 0; t < arguments.length; t++) {
35
35
  var o = arguments[t];
36
- o && (l = v(l, r(o)));
36
+ o && (l = d(l, r(o)));
37
37
  }
38
38
  return l;
39
39
  }
@@ -48,18 +48,18 @@ function _() {
48
48
  return l.toString();
49
49
  var t = "";
50
50
  for (var o in l)
51
- f.call(l, o) && l[o] && (t = v(t, o));
51
+ m.call(l, o) && l[o] && (t = d(t, o));
52
52
  return t;
53
53
  }
54
- function v(l, t) {
54
+ function d(l, t) {
55
55
  return t ? l ? l + " " + t : l + t : l;
56
56
  }
57
57
  e.exports ? (s.default = s, e.exports = s) : window.classNames = s;
58
58
  })();
59
59
  }(x)), x.exports;
60
60
  }
61
- var ee = _();
62
- const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
61
+ var _ = Z();
62
+ const c = /* @__PURE__ */ Y(_), fe = /* @__PURE__ */ $({
63
63
  name: "AXAttachments",
64
64
  __name: "Attachments",
65
65
  props: q({
@@ -130,71 +130,70 @@ const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
130
130
  styles: () => ({})
131
131
  }),
132
132
  setup(e, {
133
- expose: f
133
+ expose: m
134
134
  }) {
135
- const s = Y(e, ["prefixCls", "rootClassName", "rootStyle", "className", "style", "items", "children", "getDropContainer", "placeholder", "onChange", "onRemove", "overflow", "imageProps", "disabled", "classNames", "styles"]);
135
+ const s = W(e, ["prefixCls", "rootClassName", "rootStyle", "className", "style", "items", "children", "getDropContainer", "placeholder", "onChange", "onRemove", "overflow", "imageProps", "disabled", "classNames", "styles"]);
136
136
  T(e, "prefixCls");
137
137
  const r = V(), {
138
- getPrefixCls: v,
138
+ getPrefixCls: d,
139
139
  direction: l
140
- } = z(), t = v("attachment", e.prefixCls), o = k("attachments"), C = d(() => o.value.classNames), y = d(() => o.value.styles), w = F("attachments-container"), R = X(null), O = F("placeholder-uploader"), [I, A, E] = Q(t), p = d(() => m(A.value, E)), [h, S] = W(e.items);
141
- B(() => e.items, () => {
142
- S(e.items);
140
+ } = k(), t = d("attachment", e.prefixCls), o = M("attachments"), C = f(() => o.value.classNames), y = f(() => o.value.styles), w = F("attachments-container"), O = F("placeholder-uploader"), [I, A, E] = K(t), p = f(() => c(A.value, E)), [v, R] = Q(e.items);
141
+ X(() => e.items, () => {
142
+ R(e.items);
143
143
  });
144
- const P = (a) => {
145
- var n;
146
- S(a.fileList), (n = e.onChange) == null || n.call(e, a);
147
- }, g = d(() => ({
144
+ const S = (n) => {
145
+ var a;
146
+ R(n.fileList), (a = e.onChange) == null || a.call(e, n);
147
+ }, g = f(() => ({
148
148
  ...s,
149
- fileList: h.value,
150
- onChange: P
151
- })), U = (a) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(a) : e.onRemove).then((n) => {
152
- if (n === !1)
149
+ fileList: v.value,
150
+ onChange: S
151
+ })), U = (n) => Promise.resolve(typeof e.onRemove == "function" ? e.onRemove(n) : e.onRemove).then((a) => {
152
+ if (a === !1)
153
153
  return;
154
- const u = h.value.filter((c) => c.uid !== a.uid);
155
- P({
154
+ const u = v.value.filter((h) => h.uid !== n.uid);
155
+ S({
156
156
  file: {
157
- ...a,
157
+ ...n,
158
158
  status: "removed"
159
159
  },
160
160
  fileList: u
161
161
  });
162
- }), N = (a, n, u) => {
163
- u && (u.value = O.value);
164
- const c = r.placeholder ? r.placeholder({
165
- type: a
166
- }) : typeof e.placeholder == "function" ? e.placeholder(a) : e.placeholder;
167
- return i(G, {
168
- placeholder: c,
162
+ }), N = (n, a) => {
163
+ const u = r.placeholder ? r.placeholder({
164
+ type: n
165
+ }) : typeof e.placeholder == "function" ? e.placeholder(n) : e.placeholder;
166
+ return i(z, {
167
+ placeholder: u,
169
168
  upload: g.value,
170
169
  prefixCls: t,
171
- className: m(C.value.placeholder, e.classNames.placeholder),
170
+ className: c(C.value.placeholder, e.classNames.placeholder),
172
171
  style: {
173
172
  ...y.value.placeholder,
174
173
  ...e.styles.placeholder,
175
- ...n == null ? void 0 : n.style
174
+ ...a == null ? void 0 : a.style
176
175
  },
177
- ref: "placeholder-uploader"
176
+ ref: n === "inline" ? "placeholder-uploader" : void 0
178
177
  }, null);
179
- }, b = d(() => h.value.length > 0);
180
- return f({
178
+ }, P = f(() => v.value.length > 0);
179
+ return m({
181
180
  nativeElement: w.value,
182
- upload: (a) => {
183
- var u, c;
184
- const n = (c = (u = R.value.nativeElement).querySelector) == null ? void 0 : c.call(u, 'input[type="file"]');
185
- if (n) {
181
+ upload: (n) => {
182
+ var u, h, b;
183
+ const a = (b = (u = O.value) == null ? void 0 : (h = u.nativeElement).querySelector) == null ? void 0 : b.call(h, 'input[type="file"]');
184
+ if (a) {
186
185
  const D = new DataTransfer();
187
- D.items.add(a), n.files = D.files, n.dispatchEvent(new Event("change", {
186
+ D.items.add(n), a.files = D.files, a.dispatchEvent(new Event("change", {
188
187
  bubbles: !0
189
188
  }));
190
189
  }
191
190
  }
192
- }), () => I(i(K, {
191
+ }), () => I(i(J, {
193
192
  value: {
194
193
  disabled: e.disabled
195
194
  }
196
195
  }, {
197
- default: () => [e.children ? i(M, null, [i(H, {
196
+ default: () => [e.children ? i(B, null, [i(G, {
198
197
  upload: g.value,
199
198
  rootClassName: e.rootClassName,
200
199
  ref: "attachments-upload",
@@ -202,10 +201,10 @@ const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
202
201
  }, null), i(L, {
203
202
  getDropContainer: e.getDropContainer,
204
203
  prefixCls: t,
205
- className: m(p.value, e.rootClassName),
204
+ className: c(p.value, e.rootClassName),
206
205
  children: N("drop")
207
206
  }, null)]) : i("div", {
208
- class: m(t, p.value, {
207
+ class: c(t, p.value, {
209
208
  [`${t}-rtl`]: l.value === "rtl"
210
209
  }, e.className, e.rootClassName),
211
210
  style: {
@@ -214,31 +213,31 @@ const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
214
213
  },
215
214
  dir: l.value || "ltr",
216
215
  ref: "attachments-container"
217
- }, [i(J, {
216
+ }, [i(H, {
218
217
  prefixCls: t,
219
- items: h.value,
218
+ items: v.value,
220
219
  onRemove: U,
221
220
  overflow: e.overflow,
222
221
  upload: g.value,
223
- listClassName: m(C.value.list, e.classNames.list),
222
+ listClassName: c(C.value.list, e.classNames.list),
224
223
  listStyle: {
225
224
  ...y.value.list,
226
225
  ...e.styles.list,
227
- ...!b.value && {
226
+ ...!P.value && {
228
227
  display: "none"
229
228
  }
230
229
  },
231
- itemClassName: m(C.value.item, e.classNames.item),
230
+ itemClassName: c(C.value.item, e.classNames.item),
232
231
  itemStyle: {
233
232
  ...y.value.item,
234
233
  ...e.styles.item
235
234
  },
236
235
  imageProps: e.imageProps
237
- }, null), N("inline", b.value ? {
236
+ }, null), N("inline", P.value ? {
238
237
  style: {
239
238
  display: "none"
240
239
  }
241
- } : {}, R), i(L, {
240
+ } : {}), i(L, {
242
241
  getDropContainer: e.getDropContainer || (() => w.value),
243
242
  prefixCls: t,
244
243
  className: p.value,
@@ -248,7 +247,7 @@ const m = /* @__PURE__ */ Z(ee), de = /* @__PURE__ */ $({
248
247
  }
249
248
  });
250
249
  export {
251
- de as _,
252
- Y as a,
253
- m as c
250
+ fe as _,
251
+ W as a,
252
+ c
254
253
  };
@@ -7,7 +7,7 @@ import { computed as e, unref as v } from "vue";
7
7
  import "../_util/cssinjs/transformers/legacyLogicalProperties.mjs";
8
8
  import { theme as l } from "ant-design-vue";
9
9
  import { ignore as g, unitless as x } from "./patch-antd.mjs";
10
- import L from "ant-design-vue/es/theme/util/alias";
10
+ import L from "ant-design-vue/es/theme/util/alias.js";
11
11
  import S from "../version/version.mjs";
12
12
  const D = X(l.defaultAlgorithm), y = {
13
13
  screenXS: !0,
@@ -1,4 +1,4 @@
1
- import { useConfigContextInject as i } from "ant-design-vue/es/config-provider/context";
1
+ import { useConfigContextInject as i } from "ant-design-vue/es/config-provider/context.js";
2
2
  const f = "ant";
3
3
  function c() {
4
4
  const { getPrefixCls: e, direction: t, csp: n, iconPrefixCls: o, theme: r } = i();
@@ -1,5 +1,5 @@
1
- "use strict";const t=require("vue"),A=require("../_util/hooks/use-x-component-config.js"),I=require("../x-provider/hooks/use-x-provider-context.js");require("../x-provider/context.js");require("ant-design-vue");const E=require("./PlaceholderUploader.js"),b=require("./DropArea.js"),T=require("./SilentUploader.js"),k=require("./FileList/FileList2.js"),X=require("./context.js"),$=require("./style/index.js"),B=require("../_util/hooks/use-state.js");function D(e,m){const o=Object.create(null);for(const u in e)m.includes(u)||Object.defineProperty(o,u,{enumerable:!0,get:()=>e[u]});return o}function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={exports:{}};/*!
1
+ "use strict";const t=require("vue"),A=require("../_util/hooks/use-x-component-config.js"),I=require("../x-provider/hooks/use-x-provider-context.js");require("../x-provider/context.js");require("ant-design-vue");const E=require("./PlaceholderUploader.js"),b=require("./DropArea.js"),T=require("./SilentUploader.js"),k=require("./FileList/FileList2.js"),X=require("./context.js"),$=require("./style/index.js"),B=require("../_util/hooks/use-state.js");function D(e,d){const o=Object.create(null);for(const u in e)d.includes(u)||Object.defineProperty(o,u,{enumerable:!0,get:()=>e[u]});return o}function M(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
5
- */var F;function z(){return F||(F=1,function(e){(function(){var m={}.hasOwnProperty;function o(){for(var l="",n=0;n<arguments.length;n++){var r=arguments[n];r&&(l=f(l,u(r)))}return l}function u(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return o.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var n="";for(var r in l)m.call(l,r)&&l[r]&&(n=f(n,r));return n}function f(l,n){return n?l?l+" "+n:l+n:l}e.exports?(o.default=o,e.exports=o):window.classNames=o})()}(g)),g.exports}var G=z();const c=M(G),H=t.defineComponent({name:"AXAttachments",__name:"Attachments",props:t.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null,imageProps:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:m}){const o=D(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","onRemove","overflow","imageProps","disabled","classNames","styles"]);t.toRef(e,"prefixCls");const u=t.useSlots(),{getPrefixCls:f,direction:l}=I.default(),n=f("attachment",e.prefixCls),r=A.default("attachments"),v=t.computed(()=>r.value.classNames),y=t.computed(()=>r.value.styles),x=t.useTemplateRef("attachments-container"),P=t.ref(null),L=t.useTemplateRef("placeholder-uploader"),[V,j,O]=$.default(n),C=t.computed(()=>c(j.value,O)),[h,R]=B.default(e.items);t.watch(()=>e.items,()=>{R(e.items)});const w=s=>{var a;R(s.fileList),(a=e.onChange)==null||a.call(e,s)},p=t.computed(()=>({...o,fileList:h.value,onChange:w})),U=s=>Promise.resolve(typeof e.onRemove=="function"?e.onRemove(s):e.onRemove).then(a=>{if(a===!1)return;const i=h.value.filter(d=>d.uid!==s.uid);w({file:{...s,status:"removed"},fileList:i})}),N=(s,a,i)=>{i&&(i.value=L.value);const d=u.placeholder?u.placeholder({type:s}):typeof e.placeholder=="function"?e.placeholder(s):e.placeholder;return t.createVNode(E.default,{placeholder:d,upload:p.value,prefixCls:n,className:c(v.value.placeholder,e.classNames.placeholder),style:{...y.value.placeholder,...e.styles.placeholder,...a==null?void 0:a.style},ref:"placeholder-uploader"},null)},S=t.computed(()=>h.value.length>0);return m({nativeElement:x.value,upload:s=>{var i,d;const a=(d=(i=P.value.nativeElement).querySelector)==null?void 0:d.call(i,'input[type="file"]');if(a){const q=new DataTransfer;q.items.add(s),a.files=q.files,a.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>V(t.createVNode(X.AttachmentContextProvider,{value:{disabled:e.disabled}},{default:()=>[e.children?t.createVNode(t.Fragment,null,[t.createVNode(T.default,{upload:p.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),t.createVNode(b.default,{getDropContainer:e.getDropContainer,prefixCls:n,className:c(C.value,e.rootClassName),children:N("drop")},null)]):t.createVNode("div",{class:c(n,C.value,{[`${n}-rtl`]:l.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:l.value||"ltr",ref:"attachments-container"},[t.createVNode(k._sfc_main,{prefixCls:n,items:h.value,onRemove:U,overflow:e.overflow,upload:p.value,listClassName:c(v.value.list,e.classNames.list),listStyle:{...y.value.list,...e.styles.list,...!S.value&&{display:"none"}},itemClassName:c(v.value.item,e.classNames.item),itemStyle:{...y.value.item,...e.styles.item},imageProps:e.imageProps},null),N("inline",S.value?{style:{display:"none"}}:{},P),t.createVNode(b.default,{getDropContainer:e.getDropContainer||(()=>x.value),prefixCls:n,className:C.value,children:N("drop")},null)])]}))}});exports._sfc_main=H;exports.classnames=c;exports.createPropsRestProxy=D;
5
+ */var F;function z(){return F||(F=1,function(e){(function(){var d={}.hasOwnProperty;function o(){for(var l="",n=0;n<arguments.length;n++){var r=arguments[n];r&&(l=m(l,u(r)))}return l}function u(l){if(typeof l=="string"||typeof l=="number")return l;if(typeof l!="object")return"";if(Array.isArray(l))return o.apply(null,l);if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]"))return l.toString();var n="";for(var r in l)d.call(l,r)&&l[r]&&(n=m(n,r));return n}function m(l,n){return n?l?l+" "+n:l+n:l}e.exports?(o.default=o,e.exports=o):window.classNames=o})()}(g)),g.exports}var G=z();const i=M(G),H=t.defineComponent({name:"AXAttachments",__name:"Attachments",props:t.mergeDefaults({capture:null,type:null,name:null,defaultFileList:null,action:null,directory:null,data:null,method:null,headers:null,showUploadList:null,multiple:null,accept:null,beforeUpload:null,onChange:{type:Function},"onUpdate:fileList":null,onDrop:null,listType:null,onPreview:null,onDownload:null,onReject:null,onRemove:null,remove:null,supportServerRender:null,disabled:{type:Boolean},prefixCls:null,customRequest:null,withCredentials:null,openFileDialogOnClick:null,locale:null,id:null,previewFile:null,transformFile:null,iconRender:null,isImageUrl:null,progress:null,itemRender:null,maxCount:null,height:null,removeIcon:null,downloadIcon:null,previewIcon:null,rootClassName:null,rootStyle:null,style:null,className:null,classNames:null,styles:null,children:null,placeholder:{type:Function},getDropContainer:{type:Function},items:null,overflow:null,imageProps:null},{items:()=>[],classNames:()=>({}),styles:()=>({})}),setup(e,{expose:d}){const o=D(e,["prefixCls","rootClassName","rootStyle","className","style","items","children","getDropContainer","placeholder","onChange","onRemove","overflow","imageProps","disabled","classNames","styles"]);t.toRef(e,"prefixCls");const u=t.useSlots(),{getPrefixCls:m,direction:l}=I.default(),n=m("attachment",e.prefixCls),r=A.default("attachments"),v=t.computed(()=>r.value.classNames),C=t.computed(()=>r.value.styles),x=t.useTemplateRef("attachments-container"),L=t.useTemplateRef("placeholder-uploader"),[V,j,O]=$.default(n),y=t.computed(()=>i(j.value,O)),[f,P]=B.default(e.items);t.watch(()=>e.items,()=>{P(e.items)});const R=a=>{var s;P(a.fileList),(s=e.onChange)==null||s.call(e,a)},p=t.computed(()=>({...o,fileList:f.value,onChange:R})),U=a=>Promise.resolve(typeof e.onRemove=="function"?e.onRemove(a):e.onRemove).then(s=>{if(s===!1)return;const c=f.value.filter(h=>h.uid!==a.uid);R({file:{...a,status:"removed"},fileList:c})}),N=(a,s)=>{const c=u.placeholder?u.placeholder({type:a}):typeof e.placeholder=="function"?e.placeholder(a):e.placeholder;return t.createVNode(E.default,{placeholder:c,upload:p.value,prefixCls:n,className:i(v.value.placeholder,e.classNames.placeholder),style:{...C.value.placeholder,...e.styles.placeholder,...s==null?void 0:s.style},ref:a==="inline"?"placeholder-uploader":void 0},null)},w=t.computed(()=>f.value.length>0);return d({nativeElement:x.value,upload:a=>{var c,h,S;const s=(S=(c=L.value)==null?void 0:(h=c.nativeElement).querySelector)==null?void 0:S.call(h,'input[type="file"]');if(s){const q=new DataTransfer;q.items.add(a),s.files=q.files,s.dispatchEvent(new Event("change",{bubbles:!0}))}}}),()=>V(t.createVNode(X.AttachmentContextProvider,{value:{disabled:e.disabled}},{default:()=>[e.children?t.createVNode(t.Fragment,null,[t.createVNode(T.default,{upload:p.value,rootClassName:e.rootClassName,ref:"attachments-upload",children:e.children},null),t.createVNode(b.default,{getDropContainer:e.getDropContainer,prefixCls:n,className:i(y.value,e.rootClassName),children:N("drop")},null)]):t.createVNode("div",{class:i(n,y.value,{[`${n}-rtl`]:l.value==="rtl"},e.className,e.rootClassName),style:{...e.rootStyle,...e.style},dir:l.value||"ltr",ref:"attachments-container"},[t.createVNode(k._sfc_main,{prefixCls:n,items:f.value,onRemove:U,overflow:e.overflow,upload:p.value,listClassName:i(v.value.list,e.classNames.list),listStyle:{...C.value.list,...e.styles.list,...!w.value&&{display:"none"}},itemClassName:i(v.value.item,e.classNames.item),itemStyle:{...C.value.item,...e.styles.item},imageProps:e.imageProps},null),N("inline",w.value?{style:{display:"none"}}:{}),t.createVNode(b.default,{getDropContainer:e.getDropContainer||(()=>x.value),prefixCls:n,className:y.value,children:N("drop")},null)])]}))}});exports._sfc_main=H;exports.classnames=i;exports.createPropsRestProxy=D;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("../_util/cssinjs/hooks/useCacheToken.tsx2.js");require("../_util/cssinjs/StyleContext.js");const g=require("../_util/cssinjs/theme/createTheme.js");require("../_util/warning.js");require("../_util/cssinjs/theme/ThemeCache.js");const e=require("vue");require("../_util/cssinjs/transformers/legacyLogicalProperties.js");const l=require("ant-design-vue"),v=require("./patch-antd.js"),q=require("ant-design-vue/es/theme/util/alias"),X=require("../version/version.js"),S=g.default(l.theme.defaultAlgorithm),x={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},k=(s,u,c)=>{const r=c.getDerivativeToken(s),{override:d,...t}=u;let n={...r,override:d};return n=q(n),t&&Object.entries(t).forEach(([i,a])=>{const{theme:o,...m}=a;let h=m;o&&(h=k({...n,...m},{override:m},o)),n[i]=h}),n};function T(){const{token:s,hashId:u,theme:c}=l.theme.useToken(),r=e.computed(()=>({token:s.value,hashed:u.value,theme:c.value})),{override:d,cssVar:t}=e.unref(r),n=e.computed(()=>r.value.token),i=e.computed(()=>r.value.hashed),a=e.computed(()=>r.value.theme??S),o=f.useCacheToken(e.computed(()=>a.value),e.computed(()=>[l.theme.defaultSeed,n.value]),e.computed(()=>({salt:`${X.default}-${i.value||""}`,override:d,getComputedToken:k,cssVar:t&&{prefix:t.prefix,key:t.key,unitless:v.unitless,ignore:v.ignore,preserve:x}}))),[m,h,p]=e.unref(o),M=e.computed(()=>o.value[0]),_=e.computed(()=>i.value?o.value[1]:"");return[a,p,_,M,t]}function L(){const[s,u,c]=T();return{theme:s,token:u,hashId:c}}exports.default=L;exports.getComputedToken=k;exports.useInternalToken=T;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("../_util/cssinjs/hooks/useCacheToken.tsx2.js");require("../_util/cssinjs/StyleContext.js");const g=require("../_util/cssinjs/theme/createTheme.js");require("../_util/warning.js");require("../_util/cssinjs/theme/ThemeCache.js");const e=require("vue");require("../_util/cssinjs/transformers/legacyLogicalProperties.js");const l=require("ant-design-vue"),v=require("./patch-antd.js"),q=require("ant-design-vue/es/theme/util/alias.js"),X=require("../version/version.js"),S=g.default(l.theme.defaultAlgorithm),x={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},k=(s,u,c)=>{const r=c.getDerivativeToken(s),{override:d,...t}=u;let n={...r,override:d};return n=q(n),t&&Object.entries(t).forEach(([i,a])=>{const{theme:o,...m}=a;let h=m;o&&(h=k({...n,...m},{override:m},o)),n[i]=h}),n};function T(){const{token:s,hashId:u,theme:c}=l.theme.useToken(),r=e.computed(()=>({token:s.value,hashed:u.value,theme:c.value})),{override:d,cssVar:t}=e.unref(r),n=e.computed(()=>r.value.token),i=e.computed(()=>r.value.hashed),a=e.computed(()=>r.value.theme??S),o=f.useCacheToken(e.computed(()=>a.value),e.computed(()=>[l.theme.defaultSeed,n.value]),e.computed(()=>({salt:`${X.default}-${i.value||""}`,override:d,getComputedToken:k,cssVar:t&&{prefix:t.prefix,key:t.key,unitless:v.unitless,ignore:v.ignore,preserve:x}}))),[m,h,p]=e.unref(o),M=e.computed(()=>o.value[0]),_=e.computed(()=>i.value?o.value[1]:"");return[a,p,_,M,t]}function L(){const[s,u,c]=T();return{theme:s,token:u,hashId:c}}exports.default=L;exports.getComputedToken=k;exports.useInternalToken=T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("ant-design-vue/es/config-provider/context"),s="ant";function u(){const{getPrefixCls:e,direction:t,csp:n,iconPrefixCls:o,theme:r}=i.useConfigContextInject();return{theme:r,getPrefixCls:e,direction:t,csp:n,iconPrefixCls:o}}exports.default=u;exports.defaultPrefixCls=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("ant-design-vue/es/config-provider/context.js"),s="ant";function u(){const{getPrefixCls:e,direction:t,csp:n,iconPrefixCls:o,theme:r}=i.useConfigContextInject();return{theme:r,getPrefixCls:e,direction:t,csp:n,iconPrefixCls:o}}exports.default=u;exports.defaultPrefixCls=s;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ant-design-x-vue",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Craft AI-driven interfaces effortlessly",
5
5
  "keywords": [
6
6
  "AI",
@@ -13,7 +13,7 @@
13
13
  "vue"
14
14
  ],
15
15
  "scripts": {
16
- "build": "npm run build:es && npm run build:umd && npm run build:resolver",
16
+ "build": "run-p build:es build:umd build:resolver",
17
17
  "build:es": "vite build && vue-tsc --project ./tsconfig.build.json",
18
18
  "build:umd": "vite build --config ./vite.config.umd.mts && vue-tsc --project ./tsconfig.build.json",
19
19
  "build:resolver": "tsc resolver/index.ts --outDir resolver-dist --declaration",
@@ -120,6 +120,7 @@
120
120
  "lint-staged": "^13.0.3",
121
121
  "markdown-it": "^14.1.0",
122
122
  "markdown-it-container": "^4.0.0",
123
+ "npm-run-all2": "^8.0.3",
123
124
  "prettier": "^2.7.1",
124
125
  "prettier-plugin-organize-imports": "^3.0.0",
125
126
  "prettier-plugin-packagejson": "^2.2.18",
@@ -0,0 +1,9 @@
1
+ export * from './x-provider';
2
+ export * from './bubble';
3
+ export * from './conversations';
4
+ export * from './welcome';
5
+ export * from './prompts';
6
+ export * from './suggestion';
7
+ export * from './sender';
8
+ export * from './attachments';
9
+ export * from './thought-chain';
@@ -0,0 +1,4 @@
1
+ export * from './x-stream';
2
+ export * from './x-request';
3
+ export * from './use-x-agent';
4
+ export * from './use-x-chat';
@@ -1,11 +1,12 @@
1
- import { type MaybeRefOrGetter } from 'vue';
1
+ import { type MaybeRefOrGetter, type ComputedRef, type Ref } from 'vue';
2
2
  export type ControlledSpeechConfig = {
3
3
  recording?: boolean;
4
4
  onRecordingChange: (recording: boolean) => void;
5
5
  };
6
6
  export type AllowSpeech = boolean | ControlledSpeechConfig;
7
- export default function useSpeech(onSpeech: (transcript: string) => void, allowSpeech?: MaybeRefOrGetter<AllowSpeech>): {
8
- speechPermission: import("vue").ComputedRef<boolean>;
7
+ export type UseSpeechReturn = {
8
+ speechPermission: ComputedRef<boolean>;
9
9
  triggerSpeech: (forceBreak: boolean) => void;
10
- recording: import("vue").Ref<boolean, boolean>;
10
+ recording: Ref<boolean>;
11
11
  };
12
+ export default function useSpeech(onSpeech: (transcript: string) => void, allowSpeech?: MaybeRefOrGetter<AllowSpeech>): UseSpeechReturn;