orion-design 0.1.4 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (350) hide show
  1. package/README.md +5 -0
  2. package/dist/Throne/index.d.ts +18 -0
  3. package/dist/Throne/index.js +20 -0
  4. package/dist/Throne/index.js.map +1 -0
  5. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  6. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  7. package/dist/components/Button/Button.vue.d.ts +2 -0
  8. package/dist/components/Button/index.d.ts +2 -0
  9. package/dist/components/Button/index.js +27 -0
  10. package/dist/components/Button/index.js.map +1 -0
  11. package/dist/components/Flex/Col.d.ts +4 -4
  12. package/dist/components/Flex/Item.d.ts +4 -4
  13. package/dist/components/Flex/Row.d.ts +4 -4
  14. package/dist/components/Flex/index.d.ts +4 -4
  15. package/dist/components/Flex/index.js +95 -127
  16. package/dist/components/Flex/index.js.map +1 -0
  17. package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
  18. package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
  19. package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
  20. package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  21. package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
  22. package/dist/components/Form/ButtonGroup/index.js +2 -0
  23. package/dist/components/Form/ButtonGroup/index.js.map +1 -0
  24. package/dist/components/Form/Checkbox/Checkbox.d.ts +10 -0
  25. package/dist/components/Form/Checkbox/Checkbox.js +2 -0
  26. package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
  27. package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
  28. package/dist/components/Form/Checkbox/index.d.ts +1 -0
  29. package/dist/components/Form/Checkbox/index.js +2 -0
  30. package/dist/components/Form/Checkbox/index.js.map +1 -0
  31. package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
  32. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
  33. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
  34. package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
  35. package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
  36. package/dist/components/Form/CheckboxGroup/index.js +2 -0
  37. package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
  38. package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
  39. package/dist/components/Form/DateInput/DateInput.js +2 -0
  40. package/dist/components/Form/DateInput/DateInput.js.map +1 -0
  41. package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
  42. package/dist/components/Form/DateInput/index.d.ts +1 -0
  43. package/dist/components/Form/DateInput/index.js +2 -0
  44. package/dist/components/Form/DateInput/index.js.map +1 -0
  45. package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
  46. package/dist/components/Form/FileInput/FileInput.js +2 -0
  47. package/dist/components/Form/FileInput/FileInput.js.map +1 -0
  48. package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
  49. package/dist/components/Form/FileInput/index.d.ts +1 -0
  50. package/dist/components/Form/FileInput/index.js +2 -0
  51. package/dist/components/Form/FileInput/index.js.map +1 -0
  52. package/dist/components/Form/Form.d.ts +21 -0
  53. package/dist/components/Form/Form.js +5 -0
  54. package/dist/components/Form/Form.js.map +1 -0
  55. package/dist/components/Form/Form.vue.d.ts +465 -0
  56. package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
  57. package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
  58. package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
  59. package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
  60. package/dist/components/Form/MultiSelect/index.d.ts +1 -0
  61. package/dist/components/Form/MultiSelect/index.js +2 -0
  62. package/dist/components/Form/MultiSelect/index.js.map +1 -0
  63. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +13 -0
  64. package/dist/components/Form/PasswordInput/PasswordInput.js +2 -0
  65. package/dist/components/Form/PasswordInput/PasswordInput.js.map +1 -0
  66. package/dist/components/Form/PasswordInput/PasswordInput.vue.d.ts +3 -0
  67. package/dist/components/Form/PasswordInput/index.d.ts +1 -0
  68. package/dist/components/Form/PasswordInput/index.js +2 -0
  69. package/dist/components/Form/PasswordInput/index.js.map +1 -0
  70. package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
  71. package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
  72. package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
  73. package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
  74. package/dist/components/Form/RadioGroup/index.d.ts +1 -0
  75. package/dist/components/Form/RadioGroup/index.js +2 -0
  76. package/dist/components/Form/RadioGroup/index.js.map +1 -0
  77. package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
  78. package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
  79. package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
  80. package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
  81. package/dist/components/Form/SingleSelect/index.d.ts +1 -0
  82. package/dist/components/Form/SingleSelect/index.js +2 -0
  83. package/dist/components/Form/SingleSelect/index.js.map +1 -0
  84. package/dist/components/Form/StringInput/StringInput.d.ts +13 -0
  85. package/dist/components/Form/StringInput/StringInput.js +2 -0
  86. package/dist/components/Form/StringInput/StringInput.js.map +1 -0
  87. package/dist/components/Form/StringInput/StringInput.vue.d.ts +3 -0
  88. package/dist/components/Form/StringInput/index.d.ts +1 -0
  89. package/dist/components/Form/StringInput/index.js +2 -0
  90. package/dist/components/Form/StringInput/index.js.map +1 -0
  91. package/dist/components/Form/Switch/Switch.d.ts +10 -0
  92. package/dist/components/Form/Switch/Switch.js +2 -0
  93. package/dist/components/Form/Switch/Switch.js.map +1 -0
  94. package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
  95. package/dist/components/Form/Switch/index.d.ts +1 -0
  96. package/dist/components/Form/Switch/index.js +2 -0
  97. package/dist/components/Form/Switch/index.js.map +1 -0
  98. package/dist/components/Form/Textarea/Textarea.d.ts +14 -0
  99. package/dist/components/Form/Textarea/Textarea.js +2 -0
  100. package/dist/components/Form/Textarea/Textarea.js.map +1 -0
  101. package/dist/components/Form/Textarea/Textarea.vue.d.ts +3 -0
  102. package/dist/components/Form/Textarea/index.d.ts +1 -0
  103. package/dist/components/Form/Textarea/index.js +2 -0
  104. package/dist/components/Form/Textarea/index.js.map +1 -0
  105. package/dist/components/Form/hooks/useForm.d.ts +7 -0
  106. package/dist/components/Form/hooks/useForm.js +44 -0
  107. package/dist/components/Form/hooks/useForm.js.map +1 -0
  108. package/dist/components/Form/index.d.ts +301 -0
  109. package/dist/components/Form/index.js +660 -0
  110. package/dist/components/Form/index.js.map +1 -0
  111. package/dist/components/Form/utils/index.d.ts +8 -0
  112. package/dist/components/Form/utils/index.js +26 -0
  113. package/dist/components/Form/utils/index.js.map +1 -0
  114. package/dist/components/Modal/index.d.ts +1 -14
  115. package/dist/components/Modal/useModal.d.ts +1 -1
  116. package/dist/components/Modal/useModal.js +7 -7
  117. package/dist/components/Modal/useModal.js.map +1 -0
  118. package/dist/components/Pagetable/Pagetable.d.ts +91 -0
  119. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
  120. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
  121. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +101 -0
  122. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
  123. package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
  124. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
  125. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
  126. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
  127. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +75 -0
  128. package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
  129. package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
  130. package/dist/components/Pagetable/hooks/useColumns.js +96 -0
  131. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
  132. package/dist/components/Pagetable/index.d.ts +85 -0
  133. package/dist/components/Pagetable/index.js +521 -0
  134. package/dist/components/Pagetable/index.js.map +1 -0
  135. package/dist/components/Pagetable/interface.d.ts +10 -0
  136. package/dist/components/Pagetable/interface.js +2 -0
  137. package/dist/components/Pagetable/interface.js.map +1 -0
  138. package/dist/components/Pagetable/utils/index.d.ts +15 -0
  139. package/dist/components/Pagetable/utils/index.js +169 -0
  140. package/dist/components/Pagetable/utils/index.js.map +1 -0
  141. package/dist/components/Space/index.d.ts +12 -12
  142. package/dist/components/_util/arrays.d.ts +5 -0
  143. package/dist/components/_util/arrays.js +8 -0
  144. package/dist/components/_util/arrays.js.map +1 -0
  145. package/dist/components/_util/browser.d.ts +3 -0
  146. package/dist/components/_util/browser.js +9 -0
  147. package/dist/components/_util/browser.js.map +1 -0
  148. package/dist/components/_util/classNames.js +20 -27
  149. package/dist/components/_util/classNames.js.map +1 -0
  150. package/dist/components/_util/dom/aria.d.ts +30 -0
  151. package/dist/components/_util/dom/aria.js +46 -0
  152. package/dist/components/_util/dom/aria.js.map +1 -0
  153. package/dist/components/_util/dom/element.d.ts +3 -0
  154. package/dist/components/_util/dom/element.js +18 -0
  155. package/dist/components/_util/dom/element.js.map +1 -0
  156. package/dist/components/_util/dom/event.d.ts +6 -0
  157. package/dist/components/_util/dom/event.js +10 -0
  158. package/dist/components/_util/dom/event.js.map +1 -0
  159. package/dist/components/_util/dom/index.d.ts +6 -0
  160. package/dist/components/_util/dom/index.js +39 -0
  161. package/dist/components/_util/dom/index.js.map +1 -0
  162. package/dist/components/_util/dom/position.d.ts +7 -0
  163. package/dist/components/_util/dom/position.js +30 -0
  164. package/dist/components/_util/dom/position.js.map +1 -0
  165. package/dist/components/_util/dom/scroll.d.ts +11 -0
  166. package/dist/components/_util/dom/scroll.js +78 -0
  167. package/dist/components/_util/dom/scroll.js.map +1 -0
  168. package/dist/components/_util/dom/style.d.ts +9 -0
  169. package/dist/components/_util/dom/style.js +58 -0
  170. package/dist/components/_util/dom/style.js.map +1 -0
  171. package/dist/components/_util/easings.d.ts +1 -0
  172. package/dist/components/_util/easings.js +8 -0
  173. package/dist/components/_util/easings.js.map +1 -0
  174. package/dist/components/_util/error.d.ts +3 -0
  175. package/dist/components/_util/error.js +22 -0
  176. package/dist/components/_util/error.js.map +1 -0
  177. package/dist/components/_util/functions.d.ts +1 -0
  178. package/dist/components/_util/functions.js +6 -0
  179. package/dist/components/_util/functions.js.map +1 -0
  180. package/dist/components/_util/i18n.d.ts +1 -0
  181. package/dist/components/_util/i18n.js +5 -0
  182. package/dist/components/_util/i18n.js.map +1 -0
  183. package/dist/components/_util/index.d.ts +15 -0
  184. package/dist/components/_util/index.js +140 -0
  185. package/dist/components/_util/index.js.map +1 -0
  186. package/dist/components/_util/isValid.js +4 -4
  187. package/dist/components/_util/isValid.js.map +1 -0
  188. package/dist/components/_util/objects.d.ts +8 -0
  189. package/dist/components/_util/objects.js +17 -0
  190. package/dist/components/_util/objects.js.map +1 -0
  191. package/dist/components/_util/props-util/index.d.ts +4 -4
  192. package/dist/components/_util/props-util/index.js +23 -50
  193. package/dist/components/_util/props-util/index.js.map +1 -0
  194. package/dist/components/_util/props-util/initDefaultProps.d.ts +2 -2
  195. package/dist/components/_util/props-util/initDefaultProps.js +13 -24
  196. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -0
  197. package/dist/components/_util/raf.d.ts +2 -0
  198. package/dist/components/_util/raf.js +7 -0
  199. package/dist/components/_util/raf.js.map +1 -0
  200. package/dist/components/_util/rand.d.ts +12 -0
  201. package/dist/components/_util/rand.js +6 -0
  202. package/dist/components/_util/rand.js.map +1 -0
  203. package/dist/components/_util/strings.d.ts +6 -0
  204. package/dist/components/_util/strings.js +11 -0
  205. package/dist/components/_util/strings.js.map +1 -0
  206. package/dist/components/_util/throttleByRaf.d.ts +4 -0
  207. package/dist/components/_util/throttleByRaf.js +16 -0
  208. package/dist/components/_util/throttleByRaf.js.map +1 -0
  209. package/dist/components/_util/type.d.ts +5 -1
  210. package/dist/components/_util/type.js +52 -65
  211. package/dist/components/_util/type.js.map +1 -0
  212. package/dist/components/_util/types.d.ts +10 -0
  213. package/dist/components/_util/types.js +25 -0
  214. package/dist/components/_util/types.js.map +1 -0
  215. package/dist/components/_util/typescript.d.ts +12 -0
  216. package/dist/components/_util/typescript.js +5 -0
  217. package/dist/components/_util/typescript.js.map +1 -0
  218. package/dist/components/_util/util.d.ts +1 -1
  219. package/dist/components/_util/util.js +46 -74
  220. package/dist/components/_util/util.js.map +1 -0
  221. package/dist/components/_util/vue/global-node.d.ts +3 -0
  222. package/dist/components/_util/vue/global-node.js +21 -0
  223. package/dist/components/_util/vue/global-node.js.map +1 -0
  224. package/dist/components/_util/vue/icon.d.ts +23 -0
  225. package/dist/components/_util/vue/icon.js +154 -0
  226. package/dist/components/_util/vue/icon.js.map +1 -0
  227. package/dist/components/_util/vue/index.d.ts +9 -0
  228. package/dist/components/_util/vue/index.js +44 -0
  229. package/dist/components/_util/vue/index.js.map +1 -0
  230. package/dist/components/_util/vue/install.d.ts +6 -0
  231. package/dist/components/_util/vue/install.js +21 -0
  232. package/dist/components/_util/vue/install.js.map +1 -0
  233. package/dist/components/_util/vue/props/index.d.ts +3 -0
  234. package/dist/components/_util/vue/props/index.js +9 -0
  235. package/dist/components/_util/vue/props/index.js.map +1 -0
  236. package/dist/components/_util/vue/props/runtime.d.ts +29 -0
  237. package/dist/components/_util/vue/props/runtime.js +37 -0
  238. package/dist/components/_util/vue/props/runtime.js.map +1 -0
  239. package/dist/components/_util/vue/props/types.d.ts +120 -0
  240. package/dist/components/_util/vue/props/types.js +2 -0
  241. package/dist/components/_util/vue/props/types.js.map +1 -0
  242. package/dist/components/_util/vue/props/util.d.ts +8 -0
  243. package/dist/components/_util/vue/props/util.js +2 -0
  244. package/dist/components/_util/vue/props/util.js.map +1 -0
  245. package/dist/components/_util/vue/refs.d.ts +3 -0
  246. package/dist/components/_util/vue/refs.js +12 -0
  247. package/dist/components/_util/vue/refs.js.map +1 -0
  248. package/dist/components/_util/vue/size.d.ts +2 -0
  249. package/dist/components/_util/vue/size.js +6 -0
  250. package/dist/components/_util/vue/size.js.map +1 -0
  251. package/dist/components/_util/vue/typescript.d.ts +5 -0
  252. package/dist/components/_util/vue/typescript.js +2 -0
  253. package/dist/components/_util/vue/typescript.js.map +1 -0
  254. package/dist/components/_util/vue/validator.d.ts +3 -0
  255. package/dist/components/_util/vue/validator.js +7 -0
  256. package/dist/components/_util/vue/validator.js.map +1 -0
  257. package/dist/components/_util/vue/vnode.d.ts +50 -0
  258. package/dist/components/_util/vue/vnode.js +68 -0
  259. package/dist/components/_util/vue/vnode.js.map +1 -0
  260. package/dist/components/_util/vue-types/index.d.ts +3 -3
  261. package/dist/components/_util/vue-types/index.js +275 -417
  262. package/dist/components/_util/vue-types/index.js.map +1 -0
  263. package/dist/components/components.d.ts +4 -0
  264. package/dist/components/components.js +19 -12
  265. package/dist/components/components.js.map +1 -0
  266. package/dist/components/index.d.ts +1 -1
  267. package/dist/components/index.js +26 -24
  268. package/dist/components/index.js.map +1 -0
  269. package/dist/components-CutWiB7Q.js +68 -0
  270. package/dist/components-CutWiB7Q.js.map +1 -0
  271. package/dist/error/OrionError.js +7 -12
  272. package/dist/error/OrionError.js.map +1 -0
  273. package/dist/functions-DzLqXvGt.js +33 -0
  274. package/dist/functions-DzLqXvGt.js.map +1 -0
  275. package/dist/index-BbsXWo7C.js +44 -0
  276. package/dist/index-BbsXWo7C.js.map +1 -0
  277. package/dist/index-C8JNJPWW.js +8 -0
  278. package/dist/index-C8JNJPWW.js.map +1 -0
  279. package/dist/index.css +1 -44
  280. package/dist/index.d.ts +2 -1
  281. package/dist/index.js +27 -14
  282. package/dist/index.js.map +1 -0
  283. package/dist/print/LodopFuncs.js +48 -111
  284. package/dist/print/LodopFuncs.js.map +1 -0
  285. package/dist/print/index.d.ts +2 -2
  286. package/dist/print/index.js +111 -220
  287. package/dist/print/index.js.map +1 -0
  288. package/dist/request/ErrorHandlerChain.js +17 -15
  289. package/dist/request/ErrorHandlerChain.js.map +1 -0
  290. package/dist/request/RequestFilterChain.d.ts +1 -1
  291. package/dist/request/RequestFilterChain.js +16 -14
  292. package/dist/request/RequestFilterChain.js.map +1 -0
  293. package/dist/request/ResponseParserChain.d.ts +1 -1
  294. package/dist/request/ResponseParserChain.js +17 -15
  295. package/dist/request/ResponseParserChain.js.map +1 -0
  296. package/dist/request/disivion/DateSerializer.js +25 -46
  297. package/dist/request/disivion/DateSerializer.js.map +1 -0
  298. package/dist/request/disivion/DivisionErrorHandler.d.ts +1 -1
  299. package/dist/request/disivion/DivisionErrorHandler.js +30 -52
  300. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -0
  301. package/dist/request/disivion/DivisionResponseParser.d.ts +2 -2
  302. package/dist/request/disivion/DivisionResponseParser.js +13 -25
  303. package/dist/request/disivion/DivisionResponseParser.js.map +1 -0
  304. package/dist/request/disivion/index.d.ts +3 -3
  305. package/dist/request/disivion/index.js +230 -480
  306. package/dist/request/disivion/index.js.map +1 -0
  307. package/dist/request/error/BizExceptionResponseError.d.ts +2 -2
  308. package/dist/request/error/BizExceptionResponseError.js +8 -15
  309. package/dist/request/error/BizExceptionResponseError.js.map +1 -0
  310. package/dist/request/error/ExceptionResponseError.d.ts +2 -2
  311. package/dist/request/error/ExceptionResponseError.js +8 -15
  312. package/dist/request/error/ExceptionResponseError.js.map +1 -0
  313. package/dist/request/error/ResponseError.d.ts +1 -1
  314. package/dist/request/error/ResponseError.js +7 -14
  315. package/dist/request/error/ResponseError.js.map +1 -0
  316. package/dist/request/error/SessionExceptionResponseError.d.ts +2 -2
  317. package/dist/request/error/SessionExceptionResponseError.js +8 -15
  318. package/dist/request/error/SessionExceptionResponseError.js.map +1 -0
  319. package/dist/request/index.js +11 -17
  320. package/dist/request/index.js.map +1 -0
  321. package/dist/style/index.d.ts +0 -3
  322. package/dist/style/index.js +1 -0
  323. package/dist/style/index.js.map +1 -0
  324. package/dist/utils/DateUtil.js +36 -50
  325. package/dist/utils/DateUtil.js.map +1 -0
  326. package/dist/utils/NumberUtil.js +9 -8
  327. package/dist/utils/NumberUtil.js.map +1 -0
  328. package/dist/utils/cloneDeep.js +5 -1
  329. package/dist/utils/cloneDeep.js.map +1 -0
  330. package/dist/utils/delay.js +6 -4
  331. package/dist/utils/delay.js.map +1 -0
  332. package/dist/utils/functions.d.ts +1 -0
  333. package/dist/utils/functions.js +6 -0
  334. package/dist/utils/functions.js.map +1 -0
  335. package/dist/utils/index.js +15 -9
  336. package/dist/utils/index.js.map +1 -0
  337. package/dist/utils/md5.js +120 -245
  338. package/dist/utils/md5.js.map +1 -0
  339. package/dist/utils/uuid.js +28 -58
  340. package/dist/utils/uuid.js.map +1 -0
  341. package/dist/version/index.d.ts +1 -1
  342. package/dist/version/index.js +5 -6
  343. package/dist/version/index.js.map +1 -0
  344. package/dist/version/version.d.ts +1 -1
  345. package/dist/version/version.js +5 -3
  346. package/dist/version/version.js.map +1 -0
  347. package/dist/vite.svg +1 -0
  348. package/global.d.ts +6 -0
  349. package/package.json +53 -63
  350. package/dist/components-BTX5S_6V.js +0 -128
@@ -0,0 +1,11 @@
1
+ export declare const isScroll: (el: HTMLElement, isVertical?: boolean) => boolean;
2
+ export declare const getScrollContainer: (el: HTMLElement, isVertical?: boolean) => Window | HTMLElement | undefined;
3
+ export declare const getScrollBarWidth: (namespace: string) => number;
4
+ /**
5
+ * Scroll with in the container element, positioning the **selected** element at the top
6
+ * of the container
7
+ */
8
+ export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
9
+ export declare function animateScrollTo(container: HTMLElement | Window, from: number, to: number, duration: number, callback?: unknown): () => void;
10
+ export declare const getScrollElement: (target: HTMLElement, container: HTMLElement | Window) => HTMLElement;
11
+ export declare const getScrollTop: (container: HTMLElement | Window) => number;
@@ -0,0 +1,78 @@
1
+ import { easeInOutCubic as w } from "../easings.js";
2
+ import { isWindow as u } from "../types.js";
3
+ import { rAF as h, cAF as a } from "../raf.js";
4
+ import { getStyle as T } from "./style.js";
5
+ import { i as p } from "../../../index-C8JNJPWW.js";
6
+ const v = (o, t) => {
7
+ if (!p) return !1;
8
+ const l = {
9
+ undefined: "overflow",
10
+ true: "overflow-y",
11
+ false: "overflow-x"
12
+ }[String(t)], e = T(o, l);
13
+ return ["scroll", "auto", "overlay"].some((r) => e.includes(r));
14
+ }, b = (o, t) => {
15
+ if (!p) return;
16
+ let l = o;
17
+ for (; l; ) {
18
+ if ([window, document, document.documentElement].includes(l))
19
+ return window;
20
+ if (v(l, t)) return l;
21
+ l = l.parentNode;
22
+ }
23
+ return l;
24
+ };
25
+ let f;
26
+ const x = (o) => {
27
+ var s;
28
+ if (!p) return 0;
29
+ if (f !== void 0) return f;
30
+ const t = document.createElement("div");
31
+ t.className = `${o}-scrollbar__wrap`, t.style.visibility = "hidden", t.style.width = "100px", t.style.position = "absolute", t.style.top = "-9999px", document.body.appendChild(t);
32
+ const l = t.offsetWidth;
33
+ t.style.overflow = "scroll";
34
+ const e = document.createElement("div");
35
+ e.style.width = "100%", t.appendChild(e);
36
+ const r = e.offsetWidth;
37
+ return (s = t.parentNode) == null || s.removeChild(t), f = l - r, f;
38
+ };
39
+ function E(o, t) {
40
+ if (!p) return;
41
+ if (!t) {
42
+ o.scrollTop = 0;
43
+ return;
44
+ }
45
+ const l = [];
46
+ let e = t.offsetParent;
47
+ for (; e !== null && o !== e && o.contains(e); )
48
+ l.push(e), e = e.offsetParent;
49
+ const r = t.offsetTop + l.reduce((m, i) => m + i.offsetTop, 0), s = r + t.offsetHeight, n = o.scrollTop, c = n + o.clientHeight;
50
+ r < n ? o.scrollTop = r : s > c && (o.scrollTop = s - o.clientHeight);
51
+ }
52
+ function N(o, t, l, e, r) {
53
+ const s = Date.now();
54
+ let n;
55
+ const c = () => {
56
+ const i = Date.now() - s, d = w(
57
+ i > e ? e : i,
58
+ t,
59
+ l,
60
+ e
61
+ );
62
+ u(o) ? o.scrollTo(window.pageXOffset, d) : o.scrollTop = d, i < e ? n = h(c) : typeof r == "function" && r();
63
+ };
64
+ return c(), () => {
65
+ n && a(n);
66
+ };
67
+ }
68
+ const B = (o, t) => u(t) ? o.ownerDocument.documentElement : t, D = (o) => u(o) ? window.scrollY : o.scrollTop;
69
+ export {
70
+ N as animateScrollTo,
71
+ x as getScrollBarWidth,
72
+ b as getScrollContainer,
73
+ B as getScrollElement,
74
+ D as getScrollTop,
75
+ v as isScroll,
76
+ E as scrollIntoView
77
+ };
78
+ //# sourceMappingURL=scroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll.js","sources":["../../../../src/components/_util/dom/scroll.ts"],"sourcesContent":["import { isClient } from '../browser'\r\nimport { easeInOutCubic } from '../easings'\r\nimport { isWindow } from '../types'\r\nimport { cAF, rAF } from '../raf'\r\nimport { getStyle } from './style'\r\n\r\nexport const isScroll = (el: HTMLElement, isVertical?: boolean): boolean => {\r\n if (!isClient) return false\r\n\r\n const key = (\r\n {\r\n undefined: 'overflow',\r\n true: 'overflow-y',\r\n false: 'overflow-x',\r\n } as const\r\n )[String(isVertical)]!\r\n const overflow = getStyle(el, key)\r\n return ['scroll', 'auto', 'overlay'].some((s) => overflow.includes(s))\r\n}\r\n\r\nexport const getScrollContainer = (\r\n el: HTMLElement,\r\n isVertical?: boolean\r\n): Window | HTMLElement | undefined => {\r\n if (!isClient) return\r\n\r\n let parent: HTMLElement = el\r\n while (parent) {\r\n if ([window, document, document.documentElement].includes(parent))\r\n return window\r\n\r\n if (isScroll(parent, isVertical)) return parent\r\n\r\n parent = parent.parentNode as HTMLElement\r\n }\r\n\r\n return parent\r\n}\r\n\r\nlet scrollBarWidth: number\r\nexport const getScrollBarWidth = (namespace: string): number => {\r\n if (!isClient) return 0\r\n if (scrollBarWidth !== undefined) return scrollBarWidth\r\n\r\n const outer = document.createElement('div')\r\n outer.className = `${namespace}-scrollbar__wrap`\r\n outer.style.visibility = 'hidden'\r\n outer.style.width = '100px'\r\n outer.style.position = 'absolute'\r\n outer.style.top = '-9999px'\r\n document.body.appendChild(outer)\r\n\r\n const widthNoScroll = outer.offsetWidth\r\n outer.style.overflow = 'scroll'\r\n\r\n const inner = document.createElement('div')\r\n inner.style.width = '100%'\r\n outer.appendChild(inner)\r\n\r\n const widthWithScroll = inner.offsetWidth\r\n outer.parentNode?.removeChild(outer)\r\n scrollBarWidth = widthNoScroll - widthWithScroll\r\n\r\n return scrollBarWidth\r\n}\r\n\r\n/**\r\n * Scroll with in the container element, positioning the **selected** element at the top\r\n * of the container\r\n */\r\nexport function scrollIntoView(\r\n container: HTMLElement,\r\n selected: HTMLElement\r\n): void {\r\n if (!isClient) return\r\n\r\n if (!selected) {\r\n container.scrollTop = 0\r\n return\r\n }\r\n\r\n const offsetParents: HTMLElement[] = []\r\n let pointer = selected.offsetParent\r\n while (\r\n pointer !== null &&\r\n container !== pointer &&\r\n container.contains(pointer)\r\n ) {\r\n offsetParents.push(pointer as HTMLElement)\r\n pointer = (pointer as HTMLElement).offsetParent\r\n }\r\n const top =\r\n selected.offsetTop +\r\n offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0)\r\n const bottom = top + selected.offsetHeight\r\n const viewRectTop = container.scrollTop\r\n const viewRectBottom = viewRectTop + container.clientHeight\r\n\r\n if (top < viewRectTop) {\r\n container.scrollTop = top\r\n } else if (bottom > viewRectBottom) {\r\n container.scrollTop = bottom - container.clientHeight\r\n }\r\n}\r\n\r\nexport function animateScrollTo(\r\n container: HTMLElement | Window,\r\n from: number,\r\n to: number,\r\n duration: number,\r\n callback?: unknown\r\n) {\r\n const startTime = Date.now()\r\n\r\n let handle: number | undefined\r\n const scroll = () => {\r\n const timestamp = Date.now()\r\n const time = timestamp - startTime\r\n const nextScrollTop = easeInOutCubic(\r\n time > duration ? duration : time,\r\n from,\r\n to,\r\n duration\r\n )\r\n\r\n if (isWindow(container)) {\r\n container.scrollTo(window.pageXOffset, nextScrollTop)\r\n } else {\r\n container.scrollTop = nextScrollTop\r\n }\r\n if (time < duration) {\r\n handle = rAF(scroll)\r\n } else if (typeof callback === 'function') {\r\n callback()\r\n }\r\n }\r\n\r\n scroll()\r\n\r\n return () => {\r\n handle && cAF(handle)\r\n }\r\n}\r\n\r\nexport const getScrollElement = (\r\n target: HTMLElement,\r\n container: HTMLElement | Window\r\n) => {\r\n if (isWindow(container)) {\r\n return target.ownerDocument.documentElement\r\n }\r\n return container\r\n}\r\n\r\nexport const getScrollTop = (container: HTMLElement | Window) => {\r\n if (isWindow(container)) {\r\n return window.scrollY\r\n }\r\n return container.scrollTop\r\n}\r\n"],"names":["isScroll","el","isVertical","isClient","key","overflow","getStyle","s","getScrollContainer","parent","scrollBarWidth","getScrollBarWidth","namespace","outer","widthNoScroll","inner","widthWithScroll","_a","scrollIntoView","container","selected","offsetParents","pointer","top","prev","curr","bottom","viewRectTop","viewRectBottom","animateScrollTo","from","to","duration","callback","startTime","handle","scroll","time","nextScrollTop","easeInOutCubic","isWindow","rAF","cAF","getScrollElement","target","getScrollTop"],"mappings":";;;;;AAMa,MAAAA,IAAW,CAACC,GAAiBC,MAAkC;AACtE,MAAA,CAACC,EAAiB,QAAA;AAEtB,QAAMC,IACJ;AAAA,IACE,WAAW;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,EAAA,EAET,OAAOF,CAAU,CAAC,GACdG,IAAWC,EAASL,GAAIG,CAAG;AAC1B,SAAA,CAAC,UAAU,QAAQ,SAAS,EAAE,KAAK,CAACG,MAAMF,EAAS,SAASE,CAAC,CAAC;AACvE,GAEaC,IAAqB,CAChCP,GACAC,MACqC;AACrC,MAAI,CAACC,EAAU;AAEf,MAAIM,IAAsBR;AAC1B,SAAOQ,KAAQ;AACb,QAAI,CAAC,QAAQ,UAAU,SAAS,eAAe,EAAE,SAASA,CAAM;AACvD,aAAA;AAET,QAAIT,EAASS,GAAQP,CAAU,EAAU,QAAAO;AAEzC,IAAAA,IAASA,EAAO;AAAA,EAClB;AAEO,SAAAA;AACT;AAEA,IAAIC;AACS,MAAAC,IAAoB,CAACC,MAA8B;;AAC1D,MAAA,CAACT,EAAiB,QAAA;AAClB,MAAAO,MAAmB,OAAkB,QAAAA;AAEnC,QAAAG,IAAQ,SAAS,cAAc,KAAK;AACpC,EAAAA,EAAA,YAAY,GAAGD,CAAS,oBAC9BC,EAAM,MAAM,aAAa,UACzBA,EAAM,MAAM,QAAQ,SACpBA,EAAM,MAAM,WAAW,YACvBA,EAAM,MAAM,MAAM,WACT,SAAA,KAAK,YAAYA,CAAK;AAE/B,QAAMC,IAAgBD,EAAM;AAC5B,EAAAA,EAAM,MAAM,WAAW;AAEjB,QAAAE,IAAQ,SAAS,cAAc,KAAK;AAC1C,EAAAA,EAAM,MAAM,QAAQ,QACpBF,EAAM,YAAYE,CAAK;AAEvB,QAAMC,IAAkBD,EAAM;AACxB,UAAAE,IAAAJ,EAAA,eAAA,QAAAI,EAAY,YAAYJ,IAC9BH,IAAiBI,IAAgBE,GAE1BN;AACT;AAMgB,SAAAQ,EACdC,GACAC,GACM;AACN,MAAI,CAACjB,EAAU;AAEf,MAAI,CAACiB,GAAU;AACb,IAAAD,EAAU,YAAY;AACtB;AAAA,EACF;AAEA,QAAME,IAA+B,CAAA;AACrC,MAAIC,IAAUF,EAAS;AACvB,SACEE,MAAY,QACZH,MAAcG,KACdH,EAAU,SAASG,CAAO;AAE1B,IAAAD,EAAc,KAAKC,CAAsB,GACzCA,IAAWA,EAAwB;AAE/B,QAAAC,IACJH,EAAS,YACTC,EAAc,OAAO,CAACG,GAAMC,MAASD,IAAOC,EAAK,WAAW,CAAC,GACzDC,IAASH,IAAMH,EAAS,cACxBO,IAAcR,EAAU,WACxBS,IAAiBD,IAAcR,EAAU;AAE/C,EAAII,IAAMI,IACRR,EAAU,YAAYI,IACbG,IAASE,MACRT,EAAA,YAAYO,IAASP,EAAU;AAE7C;AAEO,SAASU,EACdV,GACAW,GACAC,GACAC,GACAC,GACA;AACM,QAAAC,IAAY,KAAK;AAEnB,MAAAC;AACJ,QAAMC,IAAS,MAAM;AAEnB,UAAMC,IADY,KAAK,QACEH,GACnBI,IAAgBC;AAAA,MACpBF,IAAOL,IAAWA,IAAWK;AAAA,MAC7BP;AAAA,MACAC;AAAA,MACAC;AAAA,IAAA;AAGE,IAAAQ,EAASrB,CAAS,IACVA,EAAA,SAAS,OAAO,aAAamB,CAAa,IAEpDnB,EAAU,YAAYmB,GAEpBD,IAAOL,IACTG,IAASM,EAAIL,CAAM,IACV,OAAOH,KAAa,cACpBA;EACX;AAGK,SAAAG,KAEA,MAAM;AACX,IAAAD,KAAUO,EAAIP,CAAM;AAAA,EAAA;AAExB;AAEa,MAAAQ,IAAmB,CAC9BC,GACAzB,MAEIqB,EAASrB,CAAS,IACbyB,EAAO,cAAc,kBAEvBzB,GAGI0B,IAAe,CAAC1B,MACvBqB,EAASrB,CAAS,IACb,OAAO,UAETA,EAAU;"}
@@ -0,0 +1,9 @@
1
+ import { CSSProperties } from 'vue';
2
+ export declare const classNameToArray: (cls?: string) => string[];
3
+ export declare const hasClass: (el: Element, cls: string) => boolean;
4
+ export declare const addClass: (el: Element, cls: string) => void;
5
+ export declare const removeClass: (el: Element, cls: string) => void;
6
+ export declare const getStyle: (element: HTMLElement, styleName: keyof CSSProperties) => string;
7
+ export declare const setStyle: (element: HTMLElement, styleName: CSSProperties | keyof CSSProperties, value?: string | number) => void;
8
+ export declare const removeStyle: (element: HTMLElement, style: CSSProperties | keyof CSSProperties) => void;
9
+ export declare function addUnit(value?: string | number, defaultUnit?: string): string | undefined;
@@ -0,0 +1,58 @@
1
+ import { isNumber as u, isStringNumber as d } from "../types.js";
2
+ import { c as f, d as c, e as m } from "../../../functions-DzLqXvGt.js";
3
+ import { entriesOf as p, keysOf as b } from "../objects.js";
4
+ import { debugWarn as g } from "../error.js";
5
+ import { i as l } from "../../../index-C8JNJPWW.js";
6
+ const y = "utils/dom/style", e = (r = "") => r.split(" ").filter((t) => !!t.trim()), w = (r, t) => {
7
+ if (!r || !t) return !1;
8
+ if (t.includes(" ")) throw new Error("className should not contain space.");
9
+ return r.classList.contains(t);
10
+ }, L = (r, t) => {
11
+ !r || !t.trim() || r.classList.add(...e(t));
12
+ }, x = (r, t) => {
13
+ !r || !t.trim() || r.classList.remove(...e(t));
14
+ }, $ = (r, t) => {
15
+ var i;
16
+ if (!l || !r || !t) return "";
17
+ let s = f(t);
18
+ s === "float" && (s = "cssFloat");
19
+ try {
20
+ const o = r.style[s];
21
+ if (o) return o;
22
+ const n = (i = document.defaultView) == null ? void 0 : i.getComputedStyle(r, "");
23
+ return n ? n[s] : "";
24
+ } catch {
25
+ return r.style[s];
26
+ }
27
+ }, a = (r, t, s) => {
28
+ if (!(!r || !t))
29
+ if (c(t))
30
+ p(t).forEach(
31
+ ([i, o]) => a(r, i, o)
32
+ );
33
+ else {
34
+ const i = f(t);
35
+ r.style[i] = s;
36
+ }
37
+ }, S = (r, t) => {
38
+ !r || !t || (c(t) ? b(t).forEach((s) => S(r, s)) : a(r, t, ""));
39
+ };
40
+ function j(r, t = "px") {
41
+ if (!r) return "";
42
+ if (u(r) || d(r))
43
+ return `${r}${t}`;
44
+ if (m(r))
45
+ return r;
46
+ g(y, "binding value must be a string or number");
47
+ }
48
+ export {
49
+ L as addClass,
50
+ j as addUnit,
51
+ e as classNameToArray,
52
+ $ as getStyle,
53
+ w as hasClass,
54
+ x as removeClass,
55
+ S as removeStyle,
56
+ a as setStyle
57
+ };
58
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sources":["../../../../src/components/_util/dom/style.ts"],"sourcesContent":["import { isNumber, isObject, isString, isStringNumber } from '../types'\r\nimport { isClient } from '../browser'\r\nimport { camelize } from '../strings'\r\nimport { entriesOf, keysOf } from '../objects'\r\nimport { debugWarn } from '../error'\r\nimport type { CSSProperties } from 'vue'\r\n\r\nconst SCOPE = 'utils/dom/style'\r\n\r\nexport const classNameToArray = (cls = '') =>\r\n cls.split(' ').filter((item) => !!item.trim())\r\n\r\nexport const hasClass = (el: Element, cls: string): boolean => {\r\n if (!el || !cls) return false\r\n if (cls.includes(' ')) throw new Error('className should not contain space.')\r\n return el.classList.contains(cls)\r\n}\r\n\r\nexport const addClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.add(...classNameToArray(cls))\r\n}\r\n\r\nexport const removeClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.remove(...classNameToArray(cls))\r\n}\r\n\r\nexport const getStyle = (\r\n element: HTMLElement,\r\n styleName: keyof CSSProperties\r\n): string => {\r\n if (!isClient || !element || !styleName) return ''\r\n\r\n let key = camelize(styleName)\r\n if (key === 'float') key = 'cssFloat'\r\n try {\r\n const style = (element.style as any)[key]\r\n if (style) return style\r\n const computed: any = document.defaultView?.getComputedStyle(element, '')\r\n return computed ? computed[key] : ''\r\n } catch {\r\n return (element.style as any)[key]\r\n }\r\n}\r\n\r\nexport const setStyle = (\r\n element: HTMLElement,\r\n styleName: CSSProperties | keyof CSSProperties,\r\n value?: string | number\r\n) => {\r\n if (!element || !styleName) return\r\n\r\n if (isObject(styleName)) {\r\n entriesOf(styleName).forEach(([prop, value]) =>\r\n setStyle(element, prop, value)\r\n )\r\n } else {\r\n const key: any = camelize(styleName)\r\n element.style[key] = value as any\r\n }\r\n}\r\n\r\nexport const removeStyle = (\r\n element: HTMLElement,\r\n style: CSSProperties | keyof CSSProperties\r\n) => {\r\n if (!element || !style) return\r\n\r\n if (isObject(style)) {\r\n keysOf(style).forEach((prop) => removeStyle(element, prop))\r\n } else {\r\n setStyle(element, style, '')\r\n }\r\n}\r\n\r\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\r\n if (!value) return ''\r\n if (isNumber(value) || isStringNumber(value)) {\r\n return `${value}${defaultUnit}`\r\n } else if (isString(value)) {\r\n return value\r\n }\r\n debugWarn(SCOPE, 'binding value must be a string or number')\r\n}\r\n"],"names":["SCOPE","classNameToArray","cls","item","hasClass","el","addClass","removeClass","getStyle","element","styleName","isClient","key","camelize","style","computed","_a","setStyle","value","isObject","entriesOf","prop","removeStyle","keysOf","addUnit","defaultUnit","isNumber","isStringNumber","isString","debugWarn"],"mappings":";;;;;AAOA,MAAMA,IAAQ,mBAEDC,IAAmB,CAACC,IAAM,OACrCA,EAAI,MAAM,GAAG,EAAE,OAAO,CAACC,MAAS,CAAC,CAACA,EAAK,MAAM,GAElCC,IAAW,CAACC,GAAaH,MAAyB;AAC7D,MAAI,CAACG,KAAM,CAACH,EAAY,QAAA;AACxB,MAAIA,EAAI,SAAS,GAAG,EAAS,OAAA,IAAI,MAAM,qCAAqC;AACrE,SAAAG,EAAG,UAAU,SAASH,CAAG;AAClC,GAEaI,IAAW,CAACD,GAAaH,MAAgB;AACpD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,IAAI,GAAGJ,EAAiBC,CAAG,CAAC;AAC3C,GAEaK,IAAc,CAACF,GAAaH,MAAgB;AACvD,EAAI,CAACG,KAAM,CAACH,EAAI,KAAQ,KACxBG,EAAG,UAAU,OAAO,GAAGJ,EAAiBC,CAAG,CAAC;AAC9C,GAEaM,IAAW,CACtBC,GACAC,MACW;;AACX,MAAI,CAACC,KAAY,CAACF,KAAW,CAACC,EAAkB,QAAA;AAE5C,MAAAE,IAAMC,EAASH,CAAS;AACxB,EAAAE,MAAQ,YAAeA,IAAA;AACvB,MAAA;AACI,UAAAE,IAASL,EAAQ,MAAcG,CAAG;AACxC,QAAIE,EAAc,QAAAA;AAClB,UAAMC,KAAgBC,IAAA,SAAS,gBAAT,gBAAAA,EAAsB,iBAAiBP,GAAS;AAC/D,WAAAM,IAAWA,EAASH,CAAG,IAAI;AAAA,EAAA,QAC5B;AACE,WAAAH,EAAQ,MAAcG,CAAG;AAAA,EACnC;AACF,GAEaK,IAAW,CACtBR,GACAC,GACAQ,MACG;AACC,MAAA,GAACT,KAAW,CAACC;AAEb,QAAAS,EAAST,CAAS;AACpB,MAAAU,EAAUV,CAAS,EAAE;AAAA,QAAQ,CAAC,CAACW,GAAMH,CAAK,MACxCD,EAASR,GAASY,GAAMH,CAAK;AAAA,MAAA;AAAA,SAE1B;AACC,YAAAN,IAAWC,EAASH,CAAS;AAC3B,MAAAD,EAAA,MAAMG,CAAG,IAAIM;AAAA,IACvB;AACF,GAEaI,IAAc,CACzBb,GACAK,MACG;AACC,EAAA,CAACL,KAAW,CAACK,MAEbK,EAASL,CAAK,IACTS,EAAAT,CAAK,EAAE,QAAQ,CAACO,MAASC,EAAYb,GAASY,CAAI,CAAC,IAEjDJ,EAAAR,GAASK,GAAO,EAAE;AAE/B;AAEgB,SAAAU,EAAQN,GAAyBO,IAAc,MAAM;AAC/D,MAAA,CAACP,EAAc,QAAA;AACnB,MAAIQ,EAASR,CAAK,KAAKS,EAAeT,CAAK;AAClC,WAAA,GAAGA,CAAK,GAAGO,CAAW;AAC/B,MAAWG,EAASV,CAAK;AAChB,WAAAA;AAET,EAAAW,EAAU7B,GAAO,0CAA0C;AAC7D;"}
@@ -0,0 +1 @@
1
+ export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
@@ -0,0 +1,8 @@
1
+ function i(n, c, r, u) {
2
+ const e = r - c;
3
+ return n /= u / 2, n < 1 ? e / 2 * n * n * n + c : e / 2 * ((n -= 2) * n * n + 2) + c;
4
+ }
5
+ export {
6
+ i as easeInOutCubic
7
+ };
8
+ //# sourceMappingURL=easings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"easings.js","sources":["../../../src/components/_util/easings.ts"],"sourcesContent":["export function easeInOutCubic(t: number, b: number, c: number, d: number) {\r\n const cc = c - b\r\n t /= d / 2\r\n if (t < 1) {\r\n return (cc / 2) * t * t * t + b\r\n }\r\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\r\n}\r\n"],"names":["easeInOutCubic","t","b","c","d","cc"],"mappings":"AAAO,SAASA,EAAeC,GAAWC,GAAWC,GAAWC,GAAW;AACzE,QAAMC,IAAKF,IAAID;AAEf,SADAD,KAAKG,IAAI,GACLH,IAAI,IACEI,IAAK,IAAKJ,IAAIA,IAAIA,IAAIC,IAExBG,IAAK,MAAOJ,KAAK,KAAKA,IAAIA,IAAI,KAAKC;AAC7C;"}
@@ -0,0 +1,3 @@
1
+ export declare function throwError(scope: string, m: string): never;
2
+ export declare function debugWarn(err: Error): void;
3
+ export declare function debugWarn(scope: string, message: string): void;
@@ -0,0 +1,22 @@
1
+ import { e } from "../../functions-DzLqXvGt.js";
2
+ import "lodash-es";
3
+ import "vue";
4
+ class n extends Error {
5
+ constructor(o) {
6
+ super(o), this.name = "ElementPlusError";
7
+ }
8
+ }
9
+ function E(r, o) {
10
+ throw new n(`[${r}] ${o}`);
11
+ }
12
+ function c(r, o) {
13
+ if (process.env.NODE_ENV !== "production") {
14
+ const t = e(r) ? new n(`[${r}] ${o}`) : r;
15
+ console.warn(t);
16
+ }
17
+ }
18
+ export {
19
+ c as debugWarn,
20
+ E as throwError
21
+ };
22
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sources":["../../../src/components/_util/error.ts"],"sourcesContent":["import { isString } from './types'\r\n\r\nclass ElementPlusError extends Error {\r\n constructor(m: string) {\r\n super(m)\r\n this.name = 'ElementPlusError'\r\n }\r\n}\r\n\r\nexport function throwError(scope: string, m: string): never {\r\n throw new ElementPlusError(`[${scope}] ${m}`)\r\n}\r\n\r\nexport function debugWarn(err: Error): void\r\nexport function debugWarn(scope: string, message: string): void\r\nexport function debugWarn(scope: string | Error, message?: string): void {\r\n if (process.env.NODE_ENV !== 'production') {\r\n const error: Error = isString(scope)\r\n ? new ElementPlusError(`[${scope}] ${message}`)\r\n : scope\r\n // eslint-disable-next-line no-console\r\n console.warn(error)\r\n }\r\n}\r\n"],"names":["ElementPlusError","m","throwError","scope","debugWarn","message","error","isString"],"mappings":";;;AAEA,MAAMA,UAAyB,MAAM;AAAA,EACnC,YAAYC,GAAW;AACrB,UAAMA,CAAC,GACP,KAAK,OAAO;AAAA,EACd;AACF;AAEgB,SAAAC,EAAWC,GAAeF,GAAkB;AAC1D,QAAM,IAAID,EAAiB,IAAIG,CAAK,KAAKF,CAAC,EAAE;AAC9C;AAIgB,SAAAG,EAAUD,GAAuBE,GAAwB;AACnE,MAAA,QAAQ,IAAI,aAAa,cAAc;AACnC,UAAAC,IAAeC,EAASJ,CAAK,IAC/B,IAAIH,EAAiB,IAAIG,CAAK,KAAKE,CAAO,EAAE,IAC5CF;AAEJ,YAAQ,KAAKG,CAAK;AAAA,EACpB;AACF;"}
@@ -0,0 +1 @@
1
+ export { NOOP, toRawType } from '@vue/shared';
@@ -0,0 +1,6 @@
1
+ import { N as t, t as e } from "../../functions-DzLqXvGt.js";
2
+ export {
3
+ t as NOOP,
4
+ e as toRawType
5
+ };
6
+ //# sourceMappingURL=functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1 @@
1
+ export declare const isKorean: (text: string) => boolean;
@@ -0,0 +1,5 @@
1
+ const u = (t) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(t);
2
+ export {
3
+ u as isKorean
4
+ };
5
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sources":["../../../src/components/_util/i18n.ts"],"sourcesContent":["export const isKorean = (text: string) =>\r\n /([\\uAC00-\\uD7AF\\u3130-\\u318F])+/gi.test(text)\r\n"],"names":["isKorean","text"],"mappings":"AAAO,MAAMA,IAAW,CAACC,MACvB,oCAAoC,KAAKA,CAAI;"}
@@ -0,0 +1,15 @@
1
+ export * from './dom';
2
+ export * from './vue';
3
+ export * from './arrays';
4
+ export * from './browser';
5
+ export * from './error';
6
+ export * from './functions';
7
+ export * from './i18n';
8
+ export * from './objects';
9
+ export * from './raf';
10
+ export * from './rand';
11
+ export * from './strings';
12
+ export * from './types';
13
+ export * from './typescript';
14
+ export * from './throttleByRaf';
15
+ export * from './easings';
@@ -0,0 +1,140 @@
1
+ import { attemptFocus as r, focusNode as t, getSibling as s, isFocusable as a, isLeaf as i, isVisible as l, obtainAllFocusableElements as n, triggerEvent as p } from "./dom/aria.js";
2
+ import { composeEventHandlers as f, whenMouse as c } from "./dom/event.js";
3
+ import { getClientXY as x, getOffsetTop as g, getOffsetTopDistance as b, isInContainer as y } from "./dom/position.js";
4
+ import { animateScrollTo as C, getScrollBarWidth as h, getScrollContainer as S, getScrollElement as N, getScrollTop as P, isScroll as T, scrollIntoView as O } from "./dom/scroll.js";
5
+ import { addClass as I, addUnit as w, classNameToArray as E, getStyle as A, hasClass as V, removeClass as v, removeStyle as k, setStyle as z } from "./dom/style.js";
6
+ import { getElement as B } from "./dom/element.js";
7
+ import { changeGlobalNodesTarget as j, createGlobalNode as G, removeGlobalNode as M } from "./vue/global-node.js";
8
+ import { CloseComponents as K, TypeComponents as U, TypeComponentsMap as q, ValidateComponentsMap as H, iconPropType as L } from "./vue/icon.js";
9
+ import { withInstall as Y, withInstallDirective as J, withInstallFunction as Q, withNoopInstall as Z } from "./vue/install.js";
10
+ import { buildProp as $, buildProps as ee, definePropType as oe, epPropKey as re, isEpProp as te } from "./vue/props/runtime.js";
11
+ import { composeRefs as ae } from "./vue/refs.js";
12
+ import { getComponentSize as le } from "./vue/size.js";
13
+ import { isValidComponentSize as pe, isValidDatePickType as me } from "./vue/validator.js";
14
+ import { PatchFlags as ce, ensureOnlyChild as de, flattedChildren as xe, getFirstValidNode as ge, getNormalizedProps as be, isComment as ye, isFragment as ue, isTemplate as Ce, isText as he, isValidElementNode as Se, renderBlock as Ne, renderIf as Pe } from "./vue/vnode.js";
15
+ import { castArray as Oe, unique as Fe } from "./arrays.js";
16
+ import { isFirefox as we } from "./browser.js";
17
+ import { debugWarn as Ae, throwError as Ve } from "./error.js";
18
+ import { N as ke, c as ze, h as Re, a as Be, i as De, f as je, b as Ge, d as Me, k as We, g as Ke, e as Ue, j as qe, a as He, t as Le } from "../../functions-DzLqXvGt.js";
19
+ import { isKorean as Ye } from "./i18n.js";
20
+ import { entriesOf as Qe, getProp as Ze, keysOf as _e } from "./objects.js";
21
+ import { cAF as eo, rAF as oo } from "./raf.js";
22
+ import { generateId as to, getRandomInt as so } from "./rand.js";
23
+ import { capitalize as io, escapeStringRegexp as lo } from "./strings.js";
24
+ import { isBoolean as po, isElement as mo, isEmpty as fo, isNumber as co, isPropAbsent as xo, isStringNumber as go, isUndefined as bo, isWindow as yo } from "./types.js";
25
+ import { mutable as Co } from "./typescript.js";
26
+ import { throttleByRaf as So } from "./throttleByRaf.js";
27
+ import { easeInOutCubic as Po } from "./easings.js";
28
+ import { castArray as Oo } from "lodash-es";
29
+ import { i as Io, a as wo } from "../../index-C8JNJPWW.js";
30
+ import { isVNode as Ao } from "vue";
31
+ export {
32
+ K as CloseComponents,
33
+ ke as NOOP,
34
+ ce as PatchFlags,
35
+ U as TypeComponents,
36
+ q as TypeComponentsMap,
37
+ H as ValidateComponentsMap,
38
+ I as addClass,
39
+ w as addUnit,
40
+ C as animateScrollTo,
41
+ r as attemptFocus,
42
+ $ as buildProp,
43
+ ee as buildProps,
44
+ eo as cAF,
45
+ ze as camelize,
46
+ io as capitalize,
47
+ Oe as castArray,
48
+ j as changeGlobalNodesTarget,
49
+ E as classNameToArray,
50
+ f as composeEventHandlers,
51
+ ae as composeRefs,
52
+ G as createGlobalNode,
53
+ Ae as debugWarn,
54
+ oe as definePropType,
55
+ Po as easeInOutCubic,
56
+ Oo as ensureArray,
57
+ de as ensureOnlyChild,
58
+ Qe as entriesOf,
59
+ re as epPropKey,
60
+ lo as escapeStringRegexp,
61
+ xe as flattedChildren,
62
+ t as focusNode,
63
+ to as generateId,
64
+ x as getClientXY,
65
+ le as getComponentSize,
66
+ B as getElement,
67
+ ge as getFirstValidNode,
68
+ be as getNormalizedProps,
69
+ g as getOffsetTop,
70
+ b as getOffsetTopDistance,
71
+ Ze as getProp,
72
+ so as getRandomInt,
73
+ h as getScrollBarWidth,
74
+ S as getScrollContainer,
75
+ N as getScrollElement,
76
+ P as getScrollTop,
77
+ s as getSibling,
78
+ A as getStyle,
79
+ V as hasClass,
80
+ Re as hasOwn,
81
+ Be as hyphenate,
82
+ L as iconPropType,
83
+ De as isArray,
84
+ po as isBoolean,
85
+ Io as isClient,
86
+ ye as isComment,
87
+ je as isDate,
88
+ mo as isElement,
89
+ fo as isEmpty,
90
+ te as isEpProp,
91
+ we as isFirefox,
92
+ a as isFocusable,
93
+ ue as isFragment,
94
+ Ge as isFunction,
95
+ wo as isIOS,
96
+ y as isInContainer,
97
+ Ye as isKorean,
98
+ i as isLeaf,
99
+ co as isNumber,
100
+ Me as isObject,
101
+ We as isPlainObject,
102
+ Ke as isPromise,
103
+ xo as isPropAbsent,
104
+ T as isScroll,
105
+ Ue as isString,
106
+ go as isStringNumber,
107
+ qe as isSymbol,
108
+ Ce as isTemplate,
109
+ he as isText,
110
+ bo as isUndefined,
111
+ Ao as isVNode,
112
+ pe as isValidComponentSize,
113
+ me as isValidDatePickType,
114
+ Se as isValidElementNode,
115
+ l as isVisible,
116
+ yo as isWindow,
117
+ He as kebabCase,
118
+ _e as keysOf,
119
+ Co as mutable,
120
+ n as obtainAllFocusableElements,
121
+ oo as rAF,
122
+ v as removeClass,
123
+ M as removeGlobalNode,
124
+ k as removeStyle,
125
+ Ne as renderBlock,
126
+ Pe as renderIf,
127
+ O as scrollIntoView,
128
+ z as setStyle,
129
+ So as throttleByRaf,
130
+ Ve as throwError,
131
+ Le as toRawType,
132
+ p as triggerEvent,
133
+ Fe as unique,
134
+ c as whenMouse,
135
+ Y as withInstall,
136
+ J as withInstallDirective,
137
+ Q as withInstallFunction,
138
+ Z as withNoopInstall
139
+ };
140
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- const isValid = value => {
2
- return value !== undefined && value !== null && value !== '';
1
+ const d = (t) => t != null && t !== "";
2
+ export {
3
+ d as default
3
4
  };
4
-
5
- export { isValid as default };
5
+ //# sourceMappingURL=isValid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isValid.js","sources":["../../../src/components/_util/isValid.ts"],"sourcesContent":["const isValid = (value: any): boolean => {\r\n return value !== undefined && value !== null && value !== ''\r\n}\r\nexport default isValid\r\n"],"names":["isValid","value"],"mappings":"AAAM,MAAAA,IAAU,CAACC,MACeA,KAAU,QAAQA,MAAU;"}
@@ -0,0 +1,8 @@
1
+ import { Entries } from 'type-fest';
2
+ import { Arrayable } from '.';
3
+ export declare const keysOf: <T>(arr: T) => Array<keyof T>;
4
+ export declare const entriesOf: <T>(arr: T) => Entries<T>;
5
+ export { hasOwn } from '@vue/shared';
6
+ export declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
7
+ value: T;
8
+ };
@@ -0,0 +1,17 @@
1
+ import { get as n, set as o } from "lodash-es";
2
+ import { h as i } from "../../functions-DzLqXvGt.js";
3
+ const O = (e) => Object.keys(e), f = (e) => Object.entries(e), u = (e, t, r) => ({
4
+ get value() {
5
+ return n(e, t, r);
6
+ },
7
+ set value(s) {
8
+ o(e, t, s);
9
+ }
10
+ });
11
+ export {
12
+ f as entriesOf,
13
+ u as getProp,
14
+ i as hasOwn,
15
+ O as keysOf
16
+ };
17
+ //# sourceMappingURL=objects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"objects.js","sources":["../../../src/components/_util/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\r\nimport type { Entries } from 'type-fest'\r\nimport type { Arrayable } from '.'\r\n\r\nexport const keysOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>\r\nexport const entriesOf = <T>(arr: T) => Object.entries(arr) as Entries<T>\r\nexport { hasOwn } from '@vue/shared'\r\n\r\nexport const getProp = <T = any>(\r\n obj: Record<string, any>,\r\n path: Arrayable<string>,\r\n defaultValue?: any\r\n): { value: T } => {\r\n return {\r\n get value() {\r\n return get(obj, path, defaultValue)\r\n },\r\n set value(val: any) {\r\n set(obj, path, val)\r\n },\r\n }\r\n}\r\n"],"names":["keysOf","arr","entriesOf","getProp","obj","path","defaultValue","get","val","set"],"mappings":";;AAIO,MAAMA,IAAS,CAAIC,MAAW,OAAO,KAAKA,CAAG,GACvCC,IAAY,CAAID,MAAW,OAAO,QAAQA,CAAG,GAG7CE,IAAU,CACrBC,GACAC,GACAC,OAEO;AAAA,EACL,IAAI,QAAQ;AACH,WAAAC,EAAIH,GAAKC,GAAMC,CAAY;AAAA,EACpC;AAAA,EACA,IAAI,MAAME,GAAU;AACd,IAAAC,EAAAL,GAAKC,GAAMG,CAAG;AAAA,EACpB;AAAA;"}
@@ -1,6 +1,6 @@
1
- import initDefaultProps from './initDefaultProps';
1
+ import { default as initDefaultProps } from './initDefaultProps';
2
2
  export declare const skipFlattenKey: unique symbol;
3
- export declare const flattenChildren: (children?: any[], filterEmpty?: boolean) => any[];
4
- export declare function filterEmpty(children?: any[]): any[];
5
- export declare function isEmptyElement(c: any): boolean;
3
+ export declare const flattenChildren: (children?: never[], filterEmpty?: boolean) => never[];
4
+ export declare function filterEmpty(children?: never[]): never[];
5
+ export declare function isEmptyElement(c: any): any;
6
6
  export { initDefaultProps };
@@ -1,53 +1,26 @@
1
- import { Fragment, isVNode, Comment, Text } from 'vue';
2
- import isValid from '../isValid.js';
3
- export { default as initDefaultProps } from './initDefaultProps.js';
4
-
5
- const skipFlattenKey = Symbol('skipFlatten');
6
- const flattenChildren = (children = [], filterEmpty = true) => {
7
- const temp = Array.isArray(children) ? children : [children];
8
- const res = [];
9
- temp.forEach(child => {
10
- if (Array.isArray(child)) {
11
- res.push(...flattenChildren(child, filterEmpty));
12
- // @ts-ignore
13
- } else if (child && child.type === Fragment) {
14
- // @ts-ignore
15
- if (child.key === skipFlattenKey) {
16
- res.push(child);
17
- } else {
18
- // @ts-ignore
19
- res.push(...flattenChildren(child.children, filterEmpty));
20
- }
21
- } else if (child && isVNode(child)) {
22
- if (filterEmpty && !isEmptyElement(child)) {
23
- res.push(child);
24
- } else if (!filterEmpty) {
25
- res.push(child);
26
- }
27
- } else if (isValid(child)) {
28
- res.push(child);
29
- }
30
- });
31
- return res;
1
+ import { Fragment as p, isVNode as u, Comment as a, Text as y } from "vue";
2
+ import m from "../isValid.js";
3
+ import { default as C } from "./initDefaultProps.js";
4
+ const i = Symbol("skipFlatten"), o = (r = [], s = !0) => {
5
+ const t = Array.isArray(r) ? r : [r], n = [];
6
+ return t.forEach((e) => {
7
+ Array.isArray(e) ? n.push(...o(e, s)) : e && e.type === p ? e.key === i ? n.push(e) : n.push(...o(e.children, s)) : e && u(e) ? s && !f(e) ? n.push(e) : s || n.push(e) : m(e) && n.push(e);
8
+ }), n;
32
9
  };
33
- function filterEmpty(children = []) {
34
- const res = [];
35
- children.forEach(child => {
36
- if (Array.isArray(child)) {
37
- // @ts-ignore
38
- res.push(...child);
39
- // @ts-ignore
40
- } else if (child?.type === Fragment) {
41
- // @ts-ignore
42
- res.push(...filterEmpty(child.children));
43
- } else {
44
- res.push(child);
45
- }
46
- });
47
- return res.filter(c => !isEmptyElement(c));
10
+ function A(r = []) {
11
+ const s = [];
12
+ return r.forEach((t) => {
13
+ Array.isArray(t) ? s.push(...t) : (t == null ? void 0 : t.type) === p ? s.push(...A(t.children)) : s.push(t);
14
+ }), s.filter((t) => !f(t));
48
15
  }
49
- function isEmptyElement(c) {
50
- return c && (c.type === Comment || c.type === Fragment && c.children.length === 0 || c.type === Text && c.children.trim() === '');
16
+ function f(r) {
17
+ return r && (r.type === a || r.type === p && r.children.length === 0 || r.type === y && r.children.trim() === "");
51
18
  }
52
-
53
- export { filterEmpty, flattenChildren, isEmptyElement, skipFlattenKey };
19
+ export {
20
+ A as filterEmpty,
21
+ o as flattenChildren,
22
+ C as initDefaultProps,
23
+ f as isEmptyElement,
24
+ i as skipFlattenKey
25
+ };
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/_util/props-util/index.ts"],"sourcesContent":["import { isVNode, Fragment, Comment, Text } from 'vue'\r\nimport isValid from '../isValid'\r\nimport initDefaultProps from './initDefaultProps'\r\n\r\nexport const skipFlattenKey = Symbol('skipFlatten')\r\n\r\nexport const flattenChildren = (children = [], filterEmpty = true) => {\r\n const temp = Array.isArray(children) ? children : [children]\r\n const res = []\r\n temp.forEach((child) => {\r\n if (Array.isArray(child)) {\r\n res.push(...flattenChildren(child, filterEmpty))\r\n // @ts-ignore\r\n } else if (child && child.type === Fragment) {\r\n // @ts-ignore\r\n if (child.key === skipFlattenKey) {\r\n res.push(child)\r\n } else {\r\n // @ts-ignore\r\n res.push(...flattenChildren(child.children, filterEmpty))\r\n }\r\n } else if (child && isVNode(child)) {\r\n if (filterEmpty && !isEmptyElement(child)) {\r\n res.push(child)\r\n } else if (!filterEmpty) {\r\n res.push(child)\r\n }\r\n } else if (isValid(child)) {\r\n res.push(child)\r\n }\r\n })\r\n return res\r\n}\r\n\r\nexport function filterEmpty(children = []) {\r\n const res = []\r\n children.forEach((child) => {\r\n if (Array.isArray(child)) {\r\n // @ts-ignore\r\n res.push(...child)\r\n // @ts-ignore\r\n } else if (child?.type === Fragment) {\r\n // @ts-ignore\r\n res.push(...filterEmpty(child.children))\r\n } else {\r\n res.push(child)\r\n }\r\n })\r\n return res.filter((c) => !isEmptyElement(c))\r\n}\r\n\r\nexport function isEmptyElement(c: any) {\r\n return c && (c.type === Comment || (c.type === Fragment && c.children.length === 0) || (c.type === Text && c.children.trim() === ''))\r\n}\r\n\r\nexport { initDefaultProps }\r\n"],"names":["skipFlattenKey","flattenChildren","children","filterEmpty","temp","res","child","Fragment","isVNode","isEmptyElement","isValid","c","Comment","Text"],"mappings":";;;AAIa,MAAAA,IAAiB,OAAO,aAAa,GAErCC,IAAkB,CAACC,IAAW,IAAIC,IAAc,OAAS;AACpE,QAAMC,IAAO,MAAM,QAAQF,CAAQ,IAAIA,IAAW,CAACA,CAAQ,GACrDG,IAAM,CAAA;AACP,SAAAD,EAAA,QAAQ,CAACE,MAAU;AAClB,IAAA,MAAM,QAAQA,CAAK,IACrBD,EAAI,KAAK,GAAGJ,EAAgBK,GAAOH,CAAW,CAAC,IAEtCG,KAASA,EAAM,SAASC,IAE7BD,EAAM,QAAQN,IAChBK,EAAI,KAAKC,CAAK,IAGdD,EAAI,KAAK,GAAGJ,EAAgBK,EAAM,UAAUH,CAAW,CAAC,IAEjDG,KAASE,EAAQF,CAAK,IAC3BH,KAAe,CAACM,EAAeH,CAAK,IACtCD,EAAI,KAAKC,CAAK,IACJH,KACVE,EAAI,KAAKC,CAAK,IAEPI,EAAQJ,CAAK,KACtBD,EAAI,KAAKC,CAAK;AAAA,EAChB,CACD,GACMD;AACT;AAEgB,SAAAF,EAAYD,IAAW,IAAI;AACzC,QAAMG,IAAM,CAAA;AACH,SAAAH,EAAA,QAAQ,CAACI,MAAU;AACtB,IAAA,MAAM,QAAQA,CAAK,IAEjBD,EAAA,KAAK,GAAGC,CAAK,KAERA,KAAA,gBAAAA,EAAO,UAASC,IAEzBF,EAAI,KAAK,GAAGF,EAAYG,EAAM,QAAQ,CAAC,IAEvCD,EAAI,KAAKC,CAAK;AAAA,EAChB,CACD,GACMD,EAAI,OAAO,CAACM,MAAM,CAACF,EAAeE,CAAC,CAAC;AAC7C;AAEO,SAASF,EAAeE,GAAQ;AACrC,SAAOA,MAAMA,EAAE,SAASC,KAAYD,EAAE,SAASJ,KAAYI,EAAE,SAAS,WAAW,KAAOA,EAAE,SAASE,KAAQF,EAAE,SAAS,WAAW;AACnI;"}
@@ -1,5 +1,5 @@
1
- import type { PropType } from 'vue';
2
- import type { VueTypeValidableDef, VueTypeDef } from 'vue-types';
1
+ import { PropType } from 'vue';
2
+ import { VueTypeValidableDef, VueTypeDef } from 'vue-types';
3
3
  declare const initDefaultProps: <T>(types: T, defaultProps: { [K in keyof T]?: T[K] extends VueTypeValidableDef<infer U> ? U : T[K] extends VueTypeDef<infer U> ? U : T[K] extends {
4
4
  type: PropType<infer U>;
5
5
  } ? U : any; }) => T;
@@ -1,25 +1,14 @@
1
- const initDefaultProps = (types, defaultProps) => {
2
- const propTypes = {
3
- ...types
4
- };
5
- Object.keys(defaultProps).forEach(k => {
6
- const prop = propTypes[k];
7
- if (prop) {
8
- if (prop.type || prop.default) {
9
- prop.default = defaultProps[k];
10
- } else if (prop.def) {
11
- prop.def(defaultProps[k]);
12
- } else {
13
- propTypes[k] = {
14
- type: prop,
15
- default: defaultProps[k]
16
- };
17
- }
18
- } else {
19
- throw new Error(`not have ${k} prop`);
20
- }
21
- });
22
- return propTypes;
1
+ const p = (f, o) => {
2
+ const r = { ...f };
3
+ return Object.keys(o).forEach((t) => {
4
+ const e = r[t];
5
+ if (e)
6
+ e.type || e.default ? e.default = o[t] : e.def ? e.def(o[t]) : r[t] = { type: e, default: o[t] };
7
+ else
8
+ throw new Error(`not have ${t} prop`);
9
+ }), r;
23
10
  };
24
-
25
- export { initDefaultProps as default };
11
+ export {
12
+ p as default
13
+ };
14
+ //# sourceMappingURL=initDefaultProps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initDefaultProps.js","sources":["../../../../src/components/_util/props-util/initDefaultProps.ts"],"sourcesContent":["import type { PropType } from 'vue'\r\nimport type { VueTypeValidableDef, VueTypeDef } from 'vue-types'\r\n\r\nconst initDefaultProps = <T>(\r\n types: T,\r\n defaultProps: {\r\n [K in keyof T]?: T[K] extends VueTypeValidableDef<infer U> ? U : T[K] extends VueTypeDef<infer U> ? U : T[K] extends { type: PropType<infer U> } ? U : any\r\n }\r\n): T => {\r\n const propTypes: T = { ...types }\r\n Object.keys(defaultProps).forEach((k) => {\r\n const prop = propTypes[k] as VueTypeValidableDef\r\n if (prop) {\r\n if (prop.type || prop.default) {\r\n prop.default = defaultProps[k]\r\n } else if (prop.def) {\r\n prop.def(defaultProps[k])\r\n } else {\r\n propTypes[k] = { type: prop, default: defaultProps[k] }\r\n }\r\n } else {\r\n throw new Error(`not have ${k} prop`)\r\n }\r\n })\r\n return propTypes\r\n}\r\n\r\nexport default initDefaultProps\r\n"],"names":["initDefaultProps","types","defaultProps","propTypes","k","prop"],"mappings":"AAGM,MAAAA,IAAmB,CACvBC,GACAC,MAGM;AACA,QAAAC,IAAe,EAAE,GAAGF;AAC1B,gBAAO,KAAKC,CAAY,EAAE,QAAQ,CAACE,MAAM;AACjC,UAAAC,IAAOF,EAAUC,CAAC;AACxB,QAAIC;AACE,MAAAA,EAAK,QAAQA,EAAK,UACfA,EAAA,UAAUH,EAAaE,CAAC,IACpBC,EAAK,MACTA,EAAA,IAAIH,EAAaE,CAAC,CAAC,IAEdD,EAAAC,CAAC,IAAI,EAAE,MAAMC,GAAM,SAASH,EAAaE,CAAC;;AAGtD,YAAM,IAAI,MAAM,YAAYA,CAAC,OAAO;AAAA,EACtC,CACD,GACMD;AACT;"}
@@ -0,0 +1,2 @@
1
+ export declare const rAF: (fn: () => void) => number;
2
+ export declare const cAF: (handle: number) => void;