morya-ui 0.3.0 → 0.3.2

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.
Files changed (309) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/dist/Button-dMqRmoYa.js +222 -0
  3. package/dist/{Card-Dsmnzong.js → Card-B1CB9Trm.js} +3 -5
  4. package/dist/Empty-C5tndBOm.js +147 -0
  5. package/dist/Icon-od9Ob-Ay.js +393 -0
  6. package/dist/Loading-BSsRs6v9.js +420 -0
  7. package/dist/Pagination-CqpC5EAs.js +166 -0
  8. package/dist/Select-CKGrSoaC.js +572 -0
  9. package/dist/Skeleton-DCYdXAH2.js +59 -0
  10. package/dist/accordion/style.css +20 -71
  11. package/dist/auto-complete/index.js +118 -120
  12. package/dist/auto-complete/style.css +24 -88
  13. package/dist/avatar/index.js +1 -1
  14. package/dist/avatar/style.css +10 -67
  15. package/dist/badge/style.css +10 -68
  16. package/dist/block-ui/style.css +10 -68
  17. package/dist/breadcrumb/style.css +10 -61
  18. package/dist/button/index.js +1 -1
  19. package/dist/button/style.css +72 -78
  20. package/dist/card/index.js +1 -1
  21. package/dist/card/style.css +30 -67
  22. package/dist/carousel/index.js +72 -64
  23. package/dist/carousel/style.css +36 -82
  24. package/dist/cascade-select/index.js +1 -1
  25. package/dist/cascade-select/style.css +24 -81
  26. package/dist/checkbox/style.css +10 -61
  27. package/dist/chip/index.js +1 -1
  28. package/dist/chip/style.css +10 -67
  29. package/dist/command-menu/index.js +37 -39
  30. package/dist/command-menu/style.css +10 -75
  31. package/dist/components/Accordion/styles.css +10 -10
  32. package/dist/components/AutoComplete/AutoComplete.vue.d.ts.map +1 -1
  33. package/dist/components/AutoComplete/styles.css +0 -7
  34. package/dist/components/Badge/styles.css +0 -7
  35. package/dist/components/BlockUI/styles.css +0 -7
  36. package/dist/components/Button/Button.vue.d.ts +2 -0
  37. package/dist/components/Button/Button.vue.d.ts.map +1 -1
  38. package/dist/components/Button/styles.css +62 -11
  39. package/dist/components/Button/types.d.ts +4 -0
  40. package/dist/components/Button/types.d.ts.map +1 -1
  41. package/dist/components/Card/Card.vue.d.ts +2 -2
  42. package/dist/components/Card/Card.vue.d.ts.map +1 -1
  43. package/dist/components/Card/index.d.ts +1 -1
  44. package/dist/components/Card/index.d.ts.map +1 -1
  45. package/dist/components/Card/styles.css +20 -6
  46. package/dist/components/Card/types.d.ts +4 -2
  47. package/dist/components/Card/types.d.ts.map +1 -1
  48. package/dist/components/Carousel/Carousel.vue.d.ts.map +1 -1
  49. package/dist/components/Carousel/styles.css +26 -15
  50. package/dist/components/CommandMenu/CommandMenu.vue.d.ts.map +1 -1
  51. package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +2 -2
  52. package/dist/components/DataView/DataView.vue.d.ts +7 -7
  53. package/dist/components/DataView/DataView.vue.d.ts.map +1 -1
  54. package/dist/components/DataView/styles.css +0 -20
  55. package/dist/components/Dialog/styles.css +3 -46
  56. package/dist/components/Dock/styles.css +0 -10
  57. package/dist/components/Drawer/styles.css +2 -51
  58. package/dist/components/Dropdown/Dropdown.vue.d.ts +2 -2
  59. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  60. package/dist/components/Dropdown/DropdownNodes.vue.d.ts +8 -9
  61. package/dist/components/Dropdown/DropdownNodes.vue.d.ts.map +1 -1
  62. package/dist/components/Dropdown/styles.css +24 -5
  63. package/dist/components/Fieldset/styles.css +0 -7
  64. package/dist/components/FileUpload/FileUpload.vue.d.ts.map +1 -1
  65. package/dist/components/FileUpload/fileUtils.d.ts +8 -0
  66. package/dist/components/FileUpload/fileUtils.d.ts.map +1 -0
  67. package/dist/components/Gallery/styles.css +0 -8
  68. package/dist/components/Icon/Icon.vue.d.ts.map +1 -1
  69. package/dist/components/Icon/icon-categories.d.ts.map +1 -1
  70. package/dist/components/Icon/icons-types.d.ts +4 -2
  71. package/dist/components/Icon/icons-types.d.ts.map +1 -1
  72. package/dist/components/Icon/icons.d.ts +250 -561
  73. package/dist/components/Icon/icons.d.ts.map +1 -1
  74. package/dist/components/Icon/index.d.ts +2 -2
  75. package/dist/components/Icon/index.d.ts.map +1 -1
  76. package/dist/components/Icon/styles.css +0 -6
  77. package/dist/components/Knob/styles.css +0 -6
  78. package/dist/components/Layout/styles.css +5 -14
  79. package/dist/components/Listbox/Listbox.vue.d.ts.map +1 -1
  80. package/dist/components/Loading/styles.css +0 -16
  81. package/dist/components/Menu/Menu.vue.d.ts.map +1 -1
  82. package/dist/components/Menu/styles.css +6 -7
  83. package/dist/components/Menubar/Menubar.vue.d.ts.map +1 -1
  84. package/dist/components/Menubar/styles.css +4 -0
  85. package/dist/components/Message/styles.css +0 -13
  86. package/dist/components/Page/PageContent.vue.d.ts +2 -1
  87. package/dist/components/Page/PageContent.vue.d.ts.map +1 -1
  88. package/dist/components/Page/PageFilterChips.vue.d.ts +16 -0
  89. package/dist/components/Page/PageFilterChips.vue.d.ts.map +1 -0
  90. package/dist/components/Page/PageFilters.vue.d.ts +15 -3
  91. package/dist/components/Page/PageFilters.vue.d.ts.map +1 -1
  92. package/dist/components/Page/PageHeader.vue.d.ts +8 -4
  93. package/dist/components/Page/PageHeader.vue.d.ts.map +1 -1
  94. package/dist/components/Page/PagePlaceholder.vue.d.ts +6 -2
  95. package/dist/components/Page/PagePlaceholder.vue.d.ts.map +1 -1
  96. package/dist/components/Page/PageSection.vue.d.ts +8 -2
  97. package/dist/components/Page/PageSection.vue.d.ts.map +1 -1
  98. package/dist/components/Page/PageStat.vue.d.ts +8 -3
  99. package/dist/components/Page/PageStat.vue.d.ts.map +1 -1
  100. package/dist/components/Page/index.d.ts +2 -1
  101. package/dist/components/Page/index.d.ts.map +1 -1
  102. package/dist/components/Page/styles.css +239 -44
  103. package/dist/components/Page/types.d.ts +40 -0
  104. package/dist/components/Page/types.d.ts.map +1 -1
  105. package/dist/components/Pagination/Pagination.vue.d.ts.map +1 -1
  106. package/dist/components/Pagination/styles.css +7 -10
  107. package/dist/components/Pagination/types.d.ts +1 -1
  108. package/dist/components/Pagination/types.d.ts.map +1 -1
  109. package/dist/components/Panel/styles.css +0 -7
  110. package/dist/components/Popover/styles.css +20 -17
  111. package/dist/components/ProgressBar/styles.css +0 -9
  112. package/dist/components/ProgressSpinner/styles.css +0 -7
  113. package/dist/components/ScrollTop/styles.css +0 -7
  114. package/dist/components/Scrollbar/Scrollbar.vue.d.ts +1 -1
  115. package/dist/components/Scrollbar/styles.css +0 -8
  116. package/dist/components/Select/Select.vue.d.ts +10 -8
  117. package/dist/components/Select/Select.vue.d.ts.map +1 -1
  118. package/dist/components/Select/selectOptions.d.ts +46 -0
  119. package/dist/components/Select/selectOptions.d.ts.map +1 -0
  120. package/dist/components/Select/styles.css +35 -8
  121. package/dist/components/Select/types.d.ts +11 -1
  122. package/dist/components/Select/types.d.ts.map +1 -1
  123. package/dist/components/Sidebar/styles.css +0 -6
  124. package/dist/components/Skeleton/styles.css +0 -6
  125. package/dist/components/Slider/styles.css +9 -0
  126. package/dist/components/SplitButton/styles.css +5 -0
  127. package/dist/components/Status/styles.css +0 -7
  128. package/dist/components/Switch/styles.css +0 -7
  129. package/dist/components/Table/Table.vue.d.ts +26 -26
  130. package/dist/components/Table/Table.vue.d.ts.map +1 -1
  131. package/dist/components/Table/TableLoadingLine.vue.d.ts.map +1 -1
  132. package/dist/components/Table/hooks/useExpandableRow.d.ts.map +1 -1
  133. package/dist/components/Table/hooks/useTotalItems.d.ts.map +1 -1
  134. package/dist/components/Table/styles.css +61 -44
  135. package/dist/components/Table/tableQuery.d.ts +30 -0
  136. package/dist/components/Table/tableQuery.d.ts.map +1 -0
  137. package/dist/components/Tree/Tree.vue.d.ts.map +1 -1
  138. package/dist/components/Tree/treeQuery.d.ts +31 -0
  139. package/dist/components/Tree/treeQuery.d.ts.map +1 -0
  140. package/dist/components/TreeSelect/TreeSelect.vue.d.ts.map +1 -1
  141. package/dist/components/TreeSelect/styles.css +1 -1
  142. package/dist/config-provider/index.js +1 -1
  143. package/dist/config-provider/style.css +72 -72
  144. package/dist/confirm-dialog/index.js +2 -2
  145. package/dist/confirm-dialog/style.css +75 -124
  146. package/dist/confirm-popup/index.js +2 -2
  147. package/dist/confirm-popup/style.css +72 -78
  148. package/dist/context-menu/index.js +2 -2
  149. package/dist/context-menu/style.css +10 -75
  150. package/dist/data-view/index.js +47 -47
  151. package/dist/data-view/style.css +393 -174
  152. package/dist/data-view/style.js +1 -1
  153. package/dist/date-picker/index.js +1 -1
  154. package/dist/date-picker/style.css +10 -67
  155. package/dist/dialog/index.js +2 -2
  156. package/dist/dialog/style.css +75 -124
  157. package/dist/divider/style.css +10 -61
  158. package/dist/dock/index.js +2 -2
  159. package/dist/dock/style.css +10 -77
  160. package/dist/drawer/index.js +1 -1
  161. package/dist/drawer/style.css +12 -118
  162. package/dist/dropdown/index.js +110 -91
  163. package/dist/dropdown/style.css +34 -80
  164. package/dist/empty/index.js +5 -150
  165. package/dist/empty/style.css +10 -67
  166. package/dist/fieldset/index.js +1 -1
  167. package/dist/fieldset/style.css +10 -74
  168. package/dist/file-upload/index.js +148 -146
  169. package/dist/file-upload/style.css +10 -67
  170. package/dist/filterByQuery-Bczaxzih.js +17 -0
  171. package/dist/flex/style.css +10 -61
  172. package/dist/float-label/style.css +10 -61
  173. package/dist/fluid/style.css +10 -61
  174. package/dist/form/style.css +10 -61
  175. package/dist/gallery/index.js +1 -1
  176. package/dist/gallery/style.css +10 -83
  177. package/dist/grid/style.css +10 -61
  178. package/dist/icon/index.js +93 -39
  179. package/dist/icon/style.css +10 -67
  180. package/dist/icon-COrt_N8A.js +18 -0
  181. package/dist/icon-field/style.css +10 -61
  182. package/dist/index.d.ts +3 -2
  183. package/dist/index.d.ts.map +1 -1
  184. package/dist/index.js +5400 -5145
  185. package/dist/inplace/style.css +10 -61
  186. package/dist/input/index.js +1 -1
  187. package/dist/input/style.css +10 -67
  188. package/dist/input-color/style.css +10 -61
  189. package/dist/input-group/style.css +10 -61
  190. package/dist/input-number/index.js +1 -1
  191. package/dist/input-number/style.css +10 -67
  192. package/dist/input-otp/style.css +10 -61
  193. package/dist/input-password/index.js +1 -1
  194. package/dist/input-password/style.css +10 -67
  195. package/dist/input-tags/index.js +1 -1
  196. package/dist/input-tags/style.css +10 -67
  197. package/dist/knob/style.css +10 -67
  198. package/dist/label/style.css +10 -61
  199. package/dist/layout/index.js +1 -1
  200. package/dist/layout/style.css +15 -89
  201. package/dist/listbox/index.js +30 -32
  202. package/dist/listbox/style.css +10 -69
  203. package/dist/loading/index.js +32 -446
  204. package/dist/loading/style.css +10 -77
  205. package/dist/mega-menu/index.js +2 -2
  206. package/dist/mega-menu/style.css +10 -67
  207. package/dist/menu/index.js +265 -255
  208. package/dist/menu/style.css +36 -99
  209. package/dist/menubar/index.js +6 -3
  210. package/dist/menubar/style.css +14 -75
  211. package/dist/message/index.js +1 -1
  212. package/dist/message/style.css +10 -80
  213. package/dist/meter-group/style.css +10 -61
  214. package/dist/order-list/index.js +1 -1
  215. package/dist/order-list/style.css +10 -67
  216. package/dist/page/index.js +229 -70
  217. package/dist/page/style.css +1186 -113
  218. package/dist/page/style.js +3 -0
  219. package/dist/pagination/index.js +1 -1
  220. package/dist/pagination/style.css +210 -77
  221. package/dist/pagination/style.js +1 -0
  222. package/dist/panel/index.js +1 -1
  223. package/dist/panel/style.css +10 -74
  224. package/dist/pick-list/index.js +1 -1
  225. package/dist/pick-list/style.css +10 -67
  226. package/dist/popover/style.css +30 -78
  227. package/dist/progress-bar/style.css +10 -70
  228. package/dist/progress-spinner/index.js +105 -2
  229. package/dist/progress-spinner/style.css +10 -68
  230. package/dist/radio/style.css +10 -61
  231. package/dist/rating/index.js +1 -1
  232. package/dist/rating/style.css +10 -67
  233. package/dist/resolver-map.d.ts.map +1 -1
  234. package/dist/resolver.js +1 -0
  235. package/dist/result/index.js +1 -1
  236. package/dist/result/style.css +10 -67
  237. package/dist/scroll-top/index.js +1 -1
  238. package/dist/scroll-top/style.css +10 -82
  239. package/dist/scrollbar/style.css +10 -69
  240. package/dist/select/index.js +2 -478
  241. package/dist/select/style.css +59 -89
  242. package/dist/select-button/style.css +10 -61
  243. package/dist/shared/config.d.ts +2 -2
  244. package/dist/shared/filterByQuery.d.ts +14 -0
  245. package/dist/shared/filterByQuery.d.ts.map +1 -0
  246. package/dist/shared/menu/expand.d.ts +38 -0
  247. package/dist/shared/menu/expand.d.ts.map +1 -0
  248. package/dist/shared/menu/icon.d.ts.map +1 -1
  249. package/dist/shared/menu/index.d.ts +2 -0
  250. package/dist/shared/menu/index.d.ts.map +1 -1
  251. package/dist/shared/styles/select-overlay.css +14 -6
  252. package/dist/sidebar/index.js +2 -2
  253. package/dist/sidebar/style.css +10 -73
  254. package/dist/skeleton/index.js +2 -59
  255. package/dist/skeleton/style.css +10 -67
  256. package/dist/slider/style.css +19 -61
  257. package/dist/space/style.css +10 -61
  258. package/dist/speed-dial/index.js +2 -2
  259. package/dist/speed-dial/style.css +10 -67
  260. package/dist/split-button/index.js +1 -1
  261. package/dist/split-button/style.css +77 -78
  262. package/dist/splitter/style.css +10 -61
  263. package/dist/status/index.js +1 -1
  264. package/dist/status/style.css +10 -74
  265. package/dist/stepper/index.js +1 -1
  266. package/dist/stepper/style.css +10 -67
  267. package/dist/styles/base.css +5 -50
  268. package/dist/styles.css +1 -1
  269. package/dist/switch/style.css +10 -68
  270. package/dist/table/index.js +409 -373
  271. package/dist/table/style.css +457 -215
  272. package/dist/table/style.js +1 -1
  273. package/dist/tabs/index.js +1 -1
  274. package/dist/tabs/style.css +10 -75
  275. package/dist/tag/index.js +1 -1
  276. package/dist/tag/style.css +10 -67
  277. package/dist/terminal/style.css +10 -61
  278. package/dist/textarea/index.js +1 -1
  279. package/dist/textarea/style.css +10 -67
  280. package/dist/theme/styles.css +5 -11
  281. package/dist/theme/useMotion.d.ts +5 -1
  282. package/dist/theme/useMotion.d.ts.map +1 -1
  283. package/dist/tiered-menu/index.js +1 -1
  284. package/dist/tiered-menu/style.css +10 -75
  285. package/dist/timeline/index.js +1 -1
  286. package/dist/timeline/style.css +10 -75
  287. package/dist/toast/index.js +1 -1
  288. package/dist/toast/style.css +10 -67
  289. package/dist/toggle-button/index.js +2 -2
  290. package/dist/toggle-button/style.css +10 -67
  291. package/dist/toolbar/style.css +10 -61
  292. package/dist/tooltip/style.css +10 -61
  293. package/dist/tree/index.js +159 -173
  294. package/dist/tree/style.css +10 -67
  295. package/dist/tree-select/index.js +200 -213
  296. package/dist/tree-select/style.css +25 -82
  297. package/dist/tree-table/index.js +1 -1
  298. package/dist/tree-table/style.css +10 -67
  299. package/dist/treeQuery-CnHkyYOA.js +107 -0
  300. package/dist/virtual-scroller/style.css +10 -69
  301. package/package.json +1 -1
  302. package/dist/Button-B5X_R4Md.js +0 -156
  303. package/dist/Icon-lcN1rS87.js +0 -610
  304. package/dist/Pagination-CVrH8Ypi.js +0 -158
  305. package/dist/ProgressSpinner-BeWVF6Jv.js +0 -105
  306. package/dist/checkStrategy-CZzuUKDI.js +0 -63
  307. package/dist/components/Icon/icons-tabler.d.ts +0 -77
  308. package/dist/components/Icon/icons-tabler.d.ts.map +0 -1
  309. package/dist/icon-DWXkh-RM.js +0 -27
@@ -1,10 +1,10 @@
1
1
  import { i as e } from "../useComponentAttrs-e-5QAjdw.js";
2
- import { t } from "../Icon-lcN1rS87.js";
2
+ import { t } from "../Icon-od9Ob-Ay.js";
3
3
  import { n } from "../locale-Bzm2nbEp.js";
4
4
  import "./style.js";
5
- import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as te, watch as ne } from "vue";
5
+ import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as ee, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as te, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useAttrs as ne, watch as re } from "vue";
6
6
  //#region src/components/FileUpload/ajax.ts
7
- function re(e) {
7
+ function ie(e) {
8
8
  let t = new XMLHttpRequest(), n = new FormData();
9
9
  n.append(e.filename, e.file, e.file.name);
10
10
  for (let [t, r] of Object.entries(e.data)) n.append(t, r);
@@ -25,53 +25,68 @@ function re(e) {
25
25
  return t.send(n), t;
26
26
  }
27
27
  //#endregion
28
+ //#region src/components/FileUpload/fileUtils.ts
29
+ function ae(e, t) {
30
+ let n = t?.trim();
31
+ return !n || n.split(",").some((t) => {
32
+ let n = t.trim().toLowerCase();
33
+ return n ? n.startsWith(".") ? e.name.toLowerCase().endsWith(n) : n.endsWith("/*") ? e.type.toLowerCase().startsWith(n.slice(0, -1)) : e.type.toLowerCase() === n : !1;
34
+ });
35
+ }
36
+ function y(e) {
37
+ return e.type?.startsWith("image/") ? !0 : /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i.test(e.name);
38
+ }
39
+ function oe(e = 0) {
40
+ return e < 1024 ? `${e} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : `${(e / 1048576).toFixed(1)} MB`;
41
+ }
42
+ //#endregion
28
43
  //#region src/components/FileUpload/FileUpload.vue?vue&type=script&setup=true&lang.ts
29
- var ie = [
44
+ var se = [
30
45
  "multiple",
31
46
  "accept",
32
47
  "disabled",
33
48
  "webkitdirectory"
34
- ], ae = ["aria-disabled", "aria-label"], oe = { class: "m-fileupload__text" }, se = ["disabled"], ce = ["disabled"], le = {
49
+ ], ce = ["aria-disabled", "aria-label"], le = { class: "m-fileupload__text" }, ue = ["disabled"], de = ["disabled"], fe = {
35
50
  key: 3,
36
51
  class: "m-fileupload__tip"
37
- }, ue = {
52
+ }, pe = {
38
53
  key: 4,
39
54
  class: "m-fileupload__list"
40
- }, de = { class: "m-fileupload__file-body" }, fe = [
55
+ }, me = { class: "m-fileupload__file-body" }, he = [
41
56
  "src",
42
57
  "alt",
43
58
  "onClick"
44
- ], pe = { class: "m-fileupload__name" }, me = {
59
+ ], ge = { class: "m-fileupload__name" }, _e = {
45
60
  key: 1,
46
61
  class: "m-fileupload__size"
47
- }, he = {
62
+ }, ve = {
48
63
  key: 2,
49
64
  class: "m-fileupload__status"
50
- }, ge = { class: "m-fileupload__actions" }, _e = ["aria-label", "onClick"], ve = ["aria-label", "onClick"], ye = [
65
+ }, ye = { class: "m-fileupload__actions" }, be = ["aria-label", "onClick"], xe = ["aria-label", "onClick"], Se = [
51
66
  "aria-label",
52
67
  "disabled",
53
68
  "onClick"
54
- ], be = ["aria-valuenow"], xe = [
69
+ ], Ce = ["aria-valuenow"], we = [
55
70
  "src",
56
71
  "alt",
57
72
  "onClick"
58
- ], Se = {
73
+ ], Te = {
59
74
  key: 1,
60
75
  class: "m-fileupload__card-name"
61
- }, Ce = {
76
+ }, Ee = {
62
77
  key: 2,
63
78
  class: "m-fileupload__card-progress"
64
- }, we = {
79
+ }, De = {
65
80
  key: 3,
66
81
  class: "m-fileupload__card-mask"
67
- }, Te = ["aria-label", "onClick"], Ee = ["aria-label", "onClick"], De = [
82
+ }, Oe = ["aria-label", "onClick"], ke = ["aria-label", "onClick"], Ae = [
68
83
  "aria-label",
69
84
  "disabled",
70
85
  "onClick"
71
- ], Oe = ["aria-label"], ke = {
86
+ ], je = ["aria-label"], b = {
72
87
  key: 6,
73
88
  class: "m-fileupload__toolbar"
74
- }, b = /* @__PURE__ */ l({
89
+ }, x = /* @__PURE__ */ l({
75
90
  inheritAttrs: !1,
76
91
  __name: "FileUpload",
77
92
  props: {
@@ -133,49 +148,36 @@ var ie = [
133
148
  "error",
134
149
  "abort"
135
150
  ],
136
- setup(l, { expose: b, emit: Ae }) {
137
- let x = l, S = Ae, C = te(), { rootAttrs: je, controlAttrs: Me } = e(C, () => x.pt, { controlKey: "input" }), w = 0, T = h(null), E = h([]), D = h(!1), O = /* @__PURE__ */ new Map(), k = n(), A = i(() => x.chooseLabel ?? k.value.chooseFile), j = i(() => x.listType === "picture-card"), M = i(() => x.listType === "picture" || j.value), N = i(() => !!(x.action || x.httpRequest)), Ne = i(() => x.autoUpload && N.value), Pe = i(() => x.showFileList && E.value.length > 0 && !j.value), P = i(() => !j.value), F = i(() => !x.disabled && (x.limit == null || E.value.length < x.limit)), Fe = i(() => N.value && !x.autoUpload && E.value.some((e) => e.status === "ready" || e.status === "fail")), Ie = i(() => E.value.length > 0 && x.showFileList), Le = i(() => [
151
+ setup(l, { expose: x, emit: S }) {
152
+ let C = l, w = S, Me = ne(), { rootAttrs: Ne, controlAttrs: Pe } = e(Me, () => C.pt, { controlKey: "input" }), T = 0, E = m(null), D = m([]), O = m(!1), k = /* @__PURE__ */ new Map(), A = n(), j = i(() => C.chooseLabel ?? A.value.chooseFile), M = i(() => C.listType === "picture-card"), N = i(() => C.listType === "picture" || M.value), P = i(() => !!(C.action || C.httpRequest)), Fe = i(() => C.autoUpload && P.value), Ie = i(() => C.showFileList && D.value.length > 0 && !M.value), F = i(() => !M.value), I = i(() => !C.disabled && (C.limit == null || D.value.length < C.limit)), Le = i(() => P.value && !C.autoUpload && D.value.some((e) => e.status === "ready" || e.status === "fail")), Re = i(() => D.value.length > 0 && C.showFileList), ze = i(() => [
138
153
  "m-fileupload",
139
- `m-fileupload--${x.mode}`,
140
- `m-fileupload--${x.listType}`,
154
+ `m-fileupload--${C.mode}`,
155
+ `m-fileupload--${C.listType}`,
141
156
  {
142
- "m-fileupload--disabled": x.disabled,
143
- "m-fileupload--drag": x.drag
157
+ "m-fileupload--disabled": C.disabled,
158
+ "m-fileupload--drag": C.drag
144
159
  }
145
160
  ]);
146
- ne(() => x.fileList, (e) => {
147
- e && (E.value = e.map((e) => ({
161
+ re(() => C.fileList, (e) => {
162
+ e && (D.value = e.map((e) => ({
148
163
  ...e,
149
164
  status: e.status ?? "success",
150
165
  percentage: e.percentage ?? (e.status && e.status !== "success" ? 0 : 100),
151
- uid: e.uid || I()
166
+ uid: e.uid || L()
152
167
  })));
153
168
  }, { immediate: !0 });
154
- function I() {
155
- return w += 1, `m-upload-${Date.now()}-${w}`;
156
- }
157
- function L(e) {
158
- E.value = e, S("update:fileList", e);
159
- }
160
- function R(e, t) {
161
- S("change", e, t);
162
- }
163
- function Re(e) {
164
- let t = x.accept?.trim();
165
- return !t || t.split(",").some((t) => {
166
- let n = t.trim().toLowerCase();
167
- return n ? n.startsWith(".") ? e.name.toLowerCase().endsWith(n) : n.endsWith("/*") ? e.type.toLowerCase().startsWith(n.slice(0, -1)) : e.type.toLowerCase() === n : !1;
168
- });
169
+ function L() {
170
+ return T += 1, `m-upload-${Date.now()}-${T}`;
169
171
  }
170
- function z(e) {
171
- return e.type?.startsWith("image/") ? !0 : /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i.test(e.name);
172
+ function R(e) {
173
+ D.value = e, w("update:fileList", e);
172
174
  }
173
- function ze(e = 0) {
174
- return e < 1024 ? `${e} B` : e < 1048576 ? `${Math.round(e / 1024)} KB` : `${(e / 1048576).toFixed(1)} MB`;
175
+ function z(e, t) {
176
+ w("change", e, t);
175
177
  }
176
178
  function Be(e) {
177
179
  return {
178
- uid: I(),
180
+ uid: L(),
179
181
  name: e.name,
180
182
  size: e.size,
181
183
  type: e.type,
@@ -189,94 +191,94 @@ var ie = [
189
191
  e.url?.startsWith("blob:") && URL.revokeObjectURL(e.url);
190
192
  }
191
193
  async function V(e) {
192
- if (x.disabled) return;
194
+ if (C.disabled) return;
193
195
  let t = [];
194
- for (let n of e) if (Re(n)) {
195
- if (x.maxSize != null && n.size > x.maxSize) {
196
- S("exceed-size", n);
196
+ for (let n of e) if (ae(n, C.accept)) {
197
+ if (C.maxSize != null && n.size > C.maxSize) {
198
+ w("exceed-size", n);
197
199
  continue;
198
200
  }
199
201
  t.push(n);
200
202
  }
201
- let n = x.multiple ? t : t.slice(0, 1);
203
+ let n = C.multiple ? t : t.slice(0, 1);
202
204
  if (!n.length) return;
203
- let r = x.multiple ? E.value : [];
204
- if (x.limit != null && r.length + n.length > x.limit) {
205
- S("exceed", n);
205
+ let r = C.multiple ? D.value : [];
206
+ if (C.limit != null && r.length + n.length > C.limit) {
207
+ w("exceed", n);
206
208
  return;
207
209
  }
208
- x.multiple || E.value.forEach(B);
210
+ C.multiple || D.value.forEach(B);
209
211
  let i = [];
210
212
  for (let e of n) {
211
213
  let t = Be(e);
212
- if (x.beforeUpload && await x.beforeUpload(e, t) === !1) {
214
+ if (C.beforeUpload && await C.beforeUpload(e, t) === !1) {
213
215
  B(t);
214
216
  continue;
215
217
  }
216
218
  i.push(t);
217
219
  }
218
220
  if (!i.length) return;
219
- let a = x.multiple ? [...r, ...i] : i;
220
- L(a), S("select", i.map((e) => e.raw).filter(Boolean));
221
- for (let e of i) R(e, a), Ne.value && J(e);
221
+ let a = C.multiple ? [...r, ...i] : i;
222
+ R(a), w("select", i.map((e) => e.raw).filter(Boolean));
223
+ for (let e of i) z(e, a), Fe.value && J(e);
222
224
  }
223
225
  function H() {
224
- F.value && T.value?.click();
226
+ I.value && E.value?.click();
225
227
  }
226
228
  function Ve(e) {
227
229
  let t = e.target;
228
230
  V(Array.from(t.files ?? [])), t.value = "";
229
231
  }
230
232
  function U(e) {
231
- x.disabled || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"), D.value = !0);
233
+ C.disabled || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "copy"), O.value = !0);
232
234
  }
233
235
  function W(e) {
234
236
  let t = e.currentTarget, n = e.relatedTarget;
235
- t && n && t.contains(n) || (D.value = !1);
237
+ t && n && t.contains(n) || (O.value = !1);
236
238
  }
237
239
  function G(e) {
238
- x.disabled || (e.preventDefault(), D.value = !1, V(Array.from(e.dataTransfer?.files ?? [])));
240
+ C.disabled || (e.preventDefault(), O.value = !1, V(Array.from(e.dataTransfer?.files ?? [])));
239
241
  }
240
242
  function K(e) {
241
243
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), H());
242
244
  }
243
245
  function q(e, t) {
244
- let n = E.value.find((t) => t.uid === e), r = E.value.map((n) => n.uid === e ? {
246
+ let n = D.value.find((t) => t.uid === e), r = D.value.map((n) => n.uid === e ? {
245
247
  ...n,
246
248
  ...t
247
249
  } : n), i = r.find((t) => t.uid === e);
248
- L(r), i && n && t.status != null && t.status !== n.status && R(i, r);
250
+ R(r), i && n && t.status != null && t.status !== n.status && z(i, r);
249
251
  }
250
252
  function He(e, t) {
251
- let n = typeof x.data == "function" ? x.data() : x.data ?? {};
253
+ let n = typeof C.data == "function" ? C.data() : C.data ?? {};
252
254
  return {
253
- action: x.action ?? "",
254
- method: x.method ?? "post",
255
+ action: C.action ?? "",
256
+ method: C.method ?? "post",
255
257
  file: t,
256
- filename: x.name ?? "file",
258
+ filename: C.name ?? "file",
257
259
  data: n,
258
- headers: x.headers ?? {},
259
- withCredentials: x.withCredentials,
260
+ headers: C.headers ?? {},
261
+ withCredentials: C.withCredentials,
260
262
  onProgress: (t) => {
261
263
  q(e.uid, {
262
264
  percentage: t,
263
265
  status: "uploading"
264
266
  });
265
- let n = E.value.find((t) => t.uid === e.uid);
266
- n && S("progress", n, t);
267
+ let n = D.value.find((t) => t.uid === e.uid);
268
+ n && w("progress", n, t);
267
269
  },
268
270
  onSuccess: (t) => {
269
- O.delete(e.uid), q(e.uid, {
271
+ k.delete(e.uid), q(e.uid, {
270
272
  status: "success",
271
273
  percentage: 100,
272
274
  response: t,
273
275
  error: void 0
274
276
  });
275
- let n = E.value.find((t) => t.uid === e.uid);
276
- n && S("success", n, t);
277
+ let n = D.value.find((t) => t.uid === e.uid);
278
+ n && w("success", n, t);
277
279
  },
278
280
  onError: (t) => {
279
- if (O.delete(e.uid), t.message === "aborted") {
281
+ if (k.delete(e.uid), t.message === "aborted") {
280
282
  q(e.uid, {
281
283
  status: "ready",
282
284
  percentage: 0
@@ -287,24 +289,24 @@ var ie = [
287
289
  status: "fail",
288
290
  error: t.message
289
291
  });
290
- let n = E.value.find((t) => t.uid === e.uid);
291
- n && S("error", n, t);
292
+ let n = D.value.find((t) => t.uid === e.uid);
293
+ n && w("error", n, t);
292
294
  }
293
295
  };
294
296
  }
295
297
  async function J(e) {
296
298
  let t = e.raw;
297
- if (!t || x.disabled || !N.value) return;
299
+ if (!t || C.disabled || !P.value) return;
298
300
  q(e.uid, {
299
301
  status: "uploading",
300
302
  percentage: e.percentage ?? 0,
301
303
  error: void 0
302
304
  });
303
305
  let n = He(e, t);
304
- if (x.httpRequest) {
306
+ if (C.httpRequest) {
305
307
  try {
306
- let t = x.httpRequest(n);
307
- if (t instanceof XMLHttpRequest) O.set(e.uid, t);
308
+ let t = C.httpRequest(n);
309
+ if (t instanceof XMLHttpRequest) k.set(e.uid, t);
308
310
  else if (t && typeof t.then == "function") {
309
311
  let e = await t;
310
312
  n.onSuccess(e);
@@ -314,121 +316,121 @@ var ie = [
314
316
  }
315
317
  return;
316
318
  }
317
- O.set(e.uid, re(n));
319
+ k.set(e.uid, ie(n));
318
320
  }
319
321
  function Y() {
320
- for (let e of E.value) (e.status === "ready" || e.status === "fail") && J(e);
322
+ for (let e of D.value) (e.status === "ready" || e.status === "fail") && J(e);
321
323
  }
322
324
  function X(e) {
323
- let t = e ? [e.uid] : [...O.keys()];
324
- for (let e of t) O.get(e)?.abort(), O.delete(e);
325
- S("abort", e);
325
+ let t = e ? [e.uid] : [...k.keys()];
326
+ for (let e of t) k.get(e)?.abort(), k.delete(e);
327
+ w("abort", e);
326
328
  }
327
329
  async function Z(e) {
328
- x.disabled || x.beforeRemove && await x.beforeRemove(e, E.value) === !1 || (X(e), B(e), L(E.value.filter((t) => t.uid !== e.uid)), S("remove", e));
330
+ C.disabled || C.beforeRemove && await C.beforeRemove(e, D.value) === !1 || (X(e), B(e), R(D.value.filter((t) => t.uid !== e.uid)), w("remove", e));
329
331
  }
330
332
  function Q(e) {
331
- S("preview", e);
333
+ w("preview", e);
332
334
  }
333
335
  function $() {
334
- X(), E.value.forEach(B), L([]);
336
+ X(), D.value.forEach(B), R([]);
335
337
  }
336
- return p(() => {
337
- X(), E.value.forEach(B);
338
- }), b({
338
+ return te(() => {
339
+ X(), D.value.forEach(B);
340
+ }), x({
339
341
  openPicker: H,
340
342
  submit: Y,
341
343
  abort: X,
342
344
  clear: $,
343
345
  clearFiles: $
344
- }), (e, n) => (m(), o("div", u(y(je), { class: Le.value }), [
346
+ }), (e, n) => (p(), o("div", u(v(Ne), { class: ze.value }), [
345
347
  s("input", u({
346
348
  ref_key: "inputRef",
347
- ref: T,
349
+ ref: E,
348
350
  class: "m-fileupload__input",
349
351
  type: "file",
350
352
  multiple: l.multiple || l.directory,
351
353
  accept: l.accept,
352
354
  disabled: l.disabled,
353
355
  webkitdirectory: l.directory || void 0
354
- }, y(Me), { onChange: Ve }), null, 16, ie),
355
- l.drag && P.value ? (m(), o("div", {
356
+ }, v(Pe), { onChange: Ve }), null, 16, se),
357
+ l.drag && F.value ? (p(), o("div", {
356
358
  key: 0,
357
- class: d(["m-fileupload__dragger", { "m-fileupload__dragger--over": D.value }]),
359
+ class: d(["m-fileupload__dragger", { "m-fileupload__dragger--over": O.value }]),
358
360
  role: "button",
359
361
  tabindex: "0",
360
362
  "aria-disabled": l.disabled || void 0,
361
- "aria-label": A.value,
363
+ "aria-label": j.value,
362
364
  onClick: H,
363
365
  onKeydown: K,
364
366
  onDragenter: U,
365
367
  onDragover: U,
366
368
  onDragleave: W,
367
369
  onDrop: G
368
- }, [_(e.$slots, "default", {}, () => [c(t, {
370
+ }, [g(e.$slots, "default", {}, () => [c(t, {
369
371
  class: "m-fileupload__icon",
370
372
  name: "upload"
371
- }), s("p", oe, [ee(v(y(k).dropFileHere) + " ", 1), s("em", null, v(y(k).clickToUpload), 1)])])], 42, ae)) : P.value && e.$slots.trigger ? (m(), o("button", {
373
+ }), s("p", le, [ee(_(v(A).dropFileHere) + " ", 1), s("em", null, _(v(A).clickToUpload), 1)])])], 42, ce)) : F.value && e.$slots.trigger ? (p(), o("button", {
372
374
  key: 1,
373
375
  type: "button",
374
376
  class: "m-fileupload__choose m-fileupload__choose--slot",
375
- disabled: l.disabled || !F.value,
377
+ disabled: l.disabled || !I.value,
376
378
  onClick: H
377
- }, [_(e.$slots, "trigger")], 8, se)) : P.value ? (m(), o("button", {
379
+ }, [g(e.$slots, "trigger")], 8, ue)) : F.value ? (p(), o("button", {
378
380
  key: 2,
379
381
  type: "button",
380
382
  class: "m-fileupload__choose",
381
- disabled: l.disabled || !F.value,
383
+ disabled: l.disabled || !I.value,
382
384
  onClick: H
383
- }, v(A.value), 9, ce)) : a("", !0),
384
- e.$slots.tip ? (m(), o("div", le, [_(e.$slots, "tip")])) : a("", !0),
385
- Pe.value && !j.value ? (m(), o("ul", ue, [(m(!0), o(r, null, g(E.value, (n) => (m(), o("li", {
385
+ }, _(j.value), 9, de)) : a("", !0),
386
+ e.$slots.tip ? (p(), o("div", fe, [g(e.$slots, "tip")])) : a("", !0),
387
+ Ie.value && !M.value ? (p(), o("ul", pe, [(p(!0), o(r, null, h(D.value, (n) => (p(), o("li", {
386
388
  key: n.uid,
387
- class: d(["m-fileupload__file", [`m-fileupload__file--${n.status}`, { "m-fileupload__file--picture": M.value }]])
388
- }, [_(e.$slots, "file", { file: n }, () => [s("div", de, [
389
- M.value && n.url && z(n) ? (m(), o("img", {
389
+ class: d(["m-fileupload__file", [`m-fileupload__file--${n.status}`, { "m-fileupload__file--picture": N.value }]])
390
+ }, [g(e.$slots, "file", { file: n }, () => [s("div", me, [
391
+ N.value && n.url && v(y)(n) ? (p(), o("img", {
390
392
  key: 0,
391
393
  class: "m-fileupload__thumb",
392
394
  src: n.url,
393
395
  alt: n.name,
394
396
  onClick: (e) => Q(n)
395
- }, null, 8, fe)) : a("", !0),
396
- s("span", pe, v(n.name), 1),
397
- n.size == null ? a("", !0) : (m(), o("span", me, v(ze(n.size)), 1)),
398
- n.status === "fail" ? (m(), o("span", he, v(n.error || y(k).uploadFailed), 1)) : a("", !0),
399
- s("span", ge, [
400
- n.url && z(n) ? (m(), o("button", {
397
+ }, null, 8, he)) : a("", !0),
398
+ s("span", ge, _(n.name), 1),
399
+ n.size == null ? a("", !0) : (p(), o("span", _e, _(v(oe)(n.size)), 1)),
400
+ n.status === "fail" ? (p(), o("span", ve, _(n.error || v(A).uploadFailed), 1)) : a("", !0),
401
+ s("span", ye, [
402
+ n.url && v(y)(n) ? (p(), o("button", {
401
403
  key: 0,
402
404
  type: "button",
403
405
  class: "m-fileupload__action",
404
- "aria-label": y(k).previewFile,
406
+ "aria-label": v(A).previewFile,
405
407
  onClick: (e) => Q(n)
406
408
  }, [c(t, {
407
409
  name: "eye",
408
410
  size: "sm"
409
- })], 8, _e)) : a("", !0),
410
- n.status === "fail" ? (m(), o("button", {
411
+ })], 8, be)) : a("", !0),
412
+ n.status === "fail" ? (p(), o("button", {
411
413
  key: 1,
412
414
  type: "button",
413
415
  class: "m-fileupload__action",
414
- "aria-label": y(k).retryUpload,
416
+ "aria-label": v(A).retryUpload,
415
417
  onClick: (e) => J(n)
416
418
  }, [c(t, {
417
419
  name: "refresh",
418
420
  size: "sm"
419
- })], 8, ve)) : a("", !0),
421
+ })], 8, xe)) : a("", !0),
420
422
  s("button", {
421
423
  type: "button",
422
424
  class: "m-fileupload__action",
423
- "aria-label": y(k).removeFile,
425
+ "aria-label": v(A).removeFile,
424
426
  disabled: l.disabled,
425
427
  onClick: (e) => Z(n)
426
428
  }, [c(t, {
427
429
  name: "trash",
428
430
  size: "sm"
429
- })], 8, ye)
431
+ })], 8, Se)
430
432
  ])
431
- ]), n.status === "uploading" ? (m(), o("div", {
433
+ ]), n.status === "uploading" ? (p(), o("div", {
432
434
  key: 0,
433
435
  class: "m-fileupload__progress",
434
436
  role: "progressbar",
@@ -436,73 +438,73 @@ var ie = [
436
438
  "aria-valuemax": 100,
437
439
  "aria-valuenow": Math.round(n.percentage ?? 0),
438
440
  style: f({ width: `${n.percentage ?? 0}%` })
439
- }, null, 12, be)) : a("", !0)])], 2))), 128))])) : a("", !0),
440
- j.value ? (m(), o("div", {
441
+ }, null, 12, Ce)) : a("", !0)])], 2))), 128))])) : a("", !0),
442
+ M.value ? (p(), o("div", {
441
443
  key: 5,
442
- class: d(["m-fileupload__cards", { "m-fileupload__cards--over": D.value }]),
444
+ class: d(["m-fileupload__cards", { "m-fileupload__cards--over": O.value }]),
443
445
  onDragenter: U,
444
446
  onDragover: U,
445
447
  onDragleave: W,
446
448
  onDrop: G
447
- }, [(m(!0), o(r, null, g(l.showFileList ? E.value : [], (n) => (m(), o("div", {
449
+ }, [(p(!0), o(r, null, h(l.showFileList ? D.value : [], (n) => (p(), o("div", {
448
450
  key: n.uid,
449
451
  class: d(["m-fileupload__card", `m-fileupload__card--${n.status}`])
450
- }, [_(e.$slots, "file", { file: n }, () => [n.url && z(n) ? (m(), o("img", {
452
+ }, [g(e.$slots, "file", { file: n }, () => [n.url && v(y)(n) ? (p(), o("img", {
451
453
  key: 0,
452
454
  class: "m-fileupload__card-image",
453
455
  src: n.url,
454
456
  alt: n.name,
455
457
  onClick: (e) => Q(n)
456
- }, null, 8, xe)) : (m(), o("span", Se, v(n.name), 1)), n.status === "uploading" ? (m(), o("div", Ce, v(Math.round(n.percentage ?? 0)) + "% ", 1)) : (m(), o("div", we, [
457
- n.url && z(n) ? (m(), o("button", {
458
+ }, null, 8, we)) : (p(), o("span", Te, _(n.name), 1)), n.status === "uploading" ? (p(), o("div", Ee, _(Math.round(n.percentage ?? 0)) + "% ", 1)) : (p(), o("div", De, [
459
+ n.url && v(y)(n) ? (p(), o("button", {
458
460
  key: 0,
459
461
  type: "button",
460
462
  class: "m-fileupload__action",
461
- "aria-label": y(k).previewFile,
463
+ "aria-label": v(A).previewFile,
462
464
  onClick: (e) => Q(n)
463
465
  }, [c(t, {
464
466
  name: "eye",
465
467
  size: "sm"
466
- })], 8, Te)) : a("", !0),
467
- n.status === "fail" ? (m(), o("button", {
468
+ })], 8, Oe)) : a("", !0),
469
+ n.status === "fail" ? (p(), o("button", {
468
470
  key: 1,
469
471
  type: "button",
470
472
  class: "m-fileupload__action",
471
- "aria-label": y(k).retryUpload,
473
+ "aria-label": v(A).retryUpload,
472
474
  onClick: (e) => J(n)
473
475
  }, [c(t, {
474
476
  name: "refresh",
475
477
  size: "sm"
476
- })], 8, Ee)) : a("", !0),
478
+ })], 8, ke)) : a("", !0),
477
479
  s("button", {
478
480
  type: "button",
479
481
  class: "m-fileupload__action",
480
- "aria-label": y(k).removeFile,
482
+ "aria-label": v(A).removeFile,
481
483
  disabled: l.disabled,
482
484
  onClick: (e) => Z(n)
483
485
  }, [c(t, {
484
486
  name: "trash",
485
487
  size: "sm"
486
- })], 8, De)
487
- ]))])], 2))), 128)), F.value ? (m(), o("button", {
488
+ })], 8, Ae)
489
+ ]))])], 2))), 128)), I.value ? (p(), o("button", {
488
490
  key: 0,
489
491
  type: "button",
490
492
  class: "m-fileupload__card m-fileupload__card--add",
491
- "aria-label": y(k).addFile,
493
+ "aria-label": v(A).addFile,
492
494
  onClick: H
493
- }, [c(t, { name: "plus" })], 8, Oe)) : a("", !0)], 34)) : a("", !0),
494
- Ie.value ? (m(), o("div", ke, [Fe.value ? (m(), o("button", {
495
+ }, [c(t, { name: "plus" })], 8, je)) : a("", !0)], 34)) : a("", !0),
496
+ Re.value ? (p(), o("div", b, [Le.value ? (p(), o("button", {
495
497
  key: 0,
496
498
  type: "button",
497
499
  class: "m-fileupload__choose",
498
500
  onClick: Y
499
- }, v(y(k).uploadFile), 1)) : a("", !0), s("button", {
501
+ }, _(v(A).uploadFile), 1)) : a("", !0), s("button", {
500
502
  type: "button",
501
503
  class: "m-fileupload__clear",
502
504
  onClick: $
503
- }, v(y(k).clear), 1)])) : a("", !0)
505
+ }, _(v(A).clear), 1)])) : a("", !0)
504
506
  ], 16));
505
507
  }
506
508
  });
507
509
  //#endregion
508
- export { b as MFileUpload };
510
+ export { x as MFileUpload };