@opentiny/vue-renderless 3.11.7 → 3.12.0

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 (340) hide show
  1. package/anchor/index.js +13 -6
  2. package/anchor/vue.js +1 -1
  3. package/breadcrumb/index.js +6 -1
  4. package/breadcrumb-item/index.js +8 -1
  5. package/calendar-bar/index.js +295 -68
  6. package/calendar-bar/vue.js +82 -8
  7. package/calendar-view/index.js +2 -2
  8. package/card/index.js +4 -4
  9. package/card/vue.js +2 -3
  10. package/card-group/vue.js +3 -7
  11. package/carousel/index.js +26 -27
  12. package/carousel/vue.js +41 -46
  13. package/carousel-item/index.js +9 -6
  14. package/carousel-item/vue.js +4 -4
  15. package/cascader-mobile/index.js +5 -1
  16. package/cascader-mobile/vue.js +2 -1
  17. package/cascader-panel/index.js +6 -2
  18. package/cascader-view/index.js +363 -0
  19. package/cascader-view/vue.js +130 -0
  20. package/chart-core/deps/constants.js +27 -0
  21. package/chart-core/deps/numerify.js +27 -28
  22. package/chart-core/index.js +122 -31
  23. package/chart-core/vue.js +12 -8
  24. package/chart-radar/index.js +2 -2
  25. package/checkbox-button/vue.js +8 -1
  26. package/checkbox-group/vue.js +4 -5
  27. package/col/index.js +5 -9
  28. package/col/vue.js +4 -3
  29. package/collapse-item/index.js +14 -2
  30. package/color-picker/index.js +24 -34
  31. package/color-picker/utils/color.js +7 -1
  32. package/color-picker/vue.js +39 -26
  33. package/color-select-panel/alpha-select/vue.js +5 -8
  34. package/color-select-panel/hue-select/index.js +4 -2
  35. package/color-select-panel/hue-select/vue.js +11 -10
  36. package/color-select-panel/index.js +29 -17
  37. package/color-select-panel/utils/color.js +5 -0
  38. package/color-select-panel/vue.js +16 -7
  39. package/column-list-item/index.js +19 -5
  40. package/column-list-item/vue.js +16 -14
  41. package/common/bigInt.js +1 -1
  42. package/common/deps/dom.js +37 -5
  43. package/common/deps/repeat-click.js +3 -2
  44. package/common/deps/touch-emulator.js +95 -0
  45. package/common/deps/touch.js +12 -11
  46. package/common/deps/useEventListener.js +47 -0
  47. package/common/deps/useTouch.js +68 -0
  48. package/common/deps/vue-popper.js +3 -4
  49. package/common/index.js +1 -1
  50. package/common/runtime.js +1 -1
  51. package/common/string.js +20 -9
  52. package/date-picker/index.js +24 -4
  53. package/date-picker-mobile/index.js +5 -1
  54. package/file-upload/index.js +148 -50
  55. package/file-upload/vue.js +24 -6
  56. package/filter/index.js +2 -1
  57. package/filter/vue.js +1 -1
  58. package/form-item/index.js +24 -21
  59. package/form-item/vue.js +14 -12
  60. package/grid/plugins/export.js +0 -8
  61. package/grid/utils/common.js +13 -16
  62. package/image-viewer/index.js +1 -1
  63. package/ip-address/index.js +6 -3
  64. package/menu/index.js +127 -0
  65. package/menu/vue.js +90 -0
  66. package/menu-node/index.js +12 -0
  67. package/menu-node/vue.js +42 -0
  68. package/modal/index.js +6 -0
  69. package/modal/vue.js +3 -1
  70. package/numeric/index.js +18 -2
  71. package/numeric/vue.js +11 -7
  72. package/package.json +1 -1
  73. package/popconfirm/index.js +15 -6
  74. package/popconfirm/vue.js +5 -4
  75. package/pull-refresh-mobile-first/index.js +243 -0
  76. package/pull-refresh-mobile-first/vue.js +116 -0
  77. package/qr-code/index.js +54 -0
  78. package/qr-code/vue.js +31 -0
  79. package/radio/index.js +9 -7
  80. package/radio/vue.js +4 -4
  81. package/radio-button/index.js +2 -2
  82. package/radio-button/vue.js +2 -2
  83. package/radio-group/vue.js +1 -0
  84. package/rich-text-edtior/index.js +18 -38
  85. package/rich-text-edtior/vue.js +52 -63
  86. package/select/index.js +6 -6
  87. package/select/vue.js +1 -1
  88. package/slide-bar/index.js +6 -6
  89. package/slide-bar/vue.js +5 -5
  90. package/slider/index.js +47 -14
  91. package/slider/vue.js +25 -6
  92. package/slider-button/index.js +5 -1
  93. package/slider-button/vue.js +1 -0
  94. package/slider-button-group/index.js +15 -0
  95. package/slider-button-group/vue.js +8 -11
  96. package/standard-list-item/index.js +9 -3
  97. package/standard-list-item/vue.js +3 -2
  98. package/switch/index.js +11 -9
  99. package/switch/vue.js +1 -1
  100. package/tab-bar/index.js +1 -1
  101. package/tab-bar/vue.js +2 -1
  102. package/tab-nav/index.js +31 -31
  103. package/tab-nav/vue.js +13 -12
  104. package/tabs/vue.js +3 -1
  105. package/tabs-mf/index.js +14 -9
  106. package/tabs-mf/vue-bar.js +3 -2
  107. package/tabs-mf/vue-nav-item.js +2 -1
  108. package/tabs-mf/vue-nav.js +18 -2
  109. package/tabs-mf/vue.js +3 -1
  110. package/tag/index.js +1 -1
  111. package/toast/index.js +7 -0
  112. package/toast/vue.js +19 -0
  113. package/transfer/index.js +2 -2
  114. package/transfer/vue.js +1 -1
  115. package/tree-node/index.js +1 -1
  116. package/types/{action-menu.type.d.mts → action-menu.type.d.ts} +3 -3
  117. package/types/{alert.type.d.mts → alert.type.d.ts} +2 -1
  118. package/types/{anchor.type.d.mts → anchor.type.d.ts} +3 -3
  119. package/types/{badge.type.d.mts → badge.type.d.ts} +1 -1
  120. package/types/{breadcrumb-item.type.d.mts → breadcrumb-item.type.d.ts} +1 -1
  121. package/types/{breadcrumb.type.d.mts → breadcrumb.type.d.ts} +1 -1
  122. package/types/{button-group.type.d.mts → button-group.type.d.ts} +1 -1
  123. package/types/{button.type.d.mts → button.type.d.ts} +1 -1
  124. package/types/{cascader-menu.type.d.mts → cascader-menu.type.d.ts} +4 -4
  125. package/types/{cascader-node.type.d.mts → cascader-node.type.d.ts} +4 -4
  126. package/types/{cascader-panel.type.d.mts → cascader-panel.type.d.ts} +6 -6
  127. package/types/{checkbox.type.d.mts → checkbox.type.d.ts} +2 -1
  128. package/types/{collapse-item.type.d.mts → collapse-item.type.d.ts} +1 -1
  129. package/types/{collapse.type.d.mts → collapse.type.d.ts} +1 -1
  130. package/types/{color-picker.type.d.mts → color-picker.type.d.ts} +2 -2
  131. package/types/{color-select-panel.type.d.mts → color-select-panel.type.d.ts} +2 -2
  132. package/types/{date-picker.type.d.mts → date-picker.type.d.ts} +5 -1
  133. package/types/{dialog-box.type.d.mts → dialog-box.type.d.ts} +9 -9
  134. package/types/{dropdown-item.type-77f0c8c5.d.ts → dropdown-item.type-bf83e929.d.ts} +4 -4
  135. package/types/{dropdown-item.type.d.mts → dropdown-item.type.d.ts} +3 -3
  136. package/types/{dropdown-menu.type.d.mts → dropdown-menu.type.d.ts} +3 -3
  137. package/types/{dropdown.type.d.mts → dropdown.type.d.ts} +1 -1
  138. package/types/{file-upload.type.d.mts → file-upload.type.d.ts} +2 -2
  139. package/types/{floatbar.type.d.mts → floatbar.type.d.ts} +7 -7
  140. package/types/{form-item.type.d.mts → form-item.type.d.ts} +2 -2
  141. package/types/{form.type-1e2e9272.d.ts → form.type-d0fd42f3.d.ts} +20 -7
  142. package/types/{form.type.d.mts → form.type.d.ts} +2 -2
  143. package/types/{image.type.d.mts → image.type.d.ts} +1 -1
  144. package/types/{input.type.d.mts → input.type.d.ts} +10 -2
  145. package/types/{link.type.d.mts → link.type.d.ts} +1 -1
  146. package/types/{loading.type.d.mts → loading.type.d.ts} +1 -1
  147. package/types/{milestone.type.d.mts → milestone.type.d.ts} +1 -1
  148. package/types/{modal.type.d.mts → modal.type.d.ts} +18 -19
  149. package/types/{nav-menu.type.d.mts → nav-menu.type.d.ts} +1 -1
  150. package/types/{numeric.type.d.mts → numeric.type.d.ts} +9 -3
  151. package/types/{picker.type.d.mts → picker.type.d.ts} +5 -1
  152. package/types/{popeditor.type.d.mts → popeditor.type.d.ts} +1 -1
  153. package/types/{popover.type.d.mts → popover.type.d.ts} +1 -1
  154. package/types/{progress.type.d.mts → progress.type.d.ts} +1 -1
  155. package/types/{radio-button.type.d.mts → radio-button.type.d.ts} +3 -3
  156. package/types/{radio-group.type.d.mts → radio-group.type.d.ts} +5 -1
  157. package/types/{radio.type.d.mts → radio.type.d.ts} +2 -2
  158. package/types/{search.type.d.mts → search.type.d.ts} +1 -1
  159. package/types/{shared.type.d.mts → shared.type.d.ts} +7 -7
  160. package/types/{slider.type.d.mts → slider.type.d.ts} +1 -1
  161. package/types/{steps.type.d.mts → steps.type.d.ts} +6 -1
  162. package/types/{switch.type.d.mts → switch.type.d.ts} +5 -1
  163. package/types/{tab-bar.type.d.mts → tab-bar.type.d.ts} +3 -2
  164. package/types/{tab-item.type.d.mts → tab-item.type.d.ts} +2 -2
  165. package/types/{tab-nav.type.d.mts → tab-nav.type.d.ts} +13 -12
  166. package/types/{tabs.type.d.mts → tabs.type.d.ts} +6 -4
  167. package/types/{tag.type.d.mts → tag.type.d.ts} +1 -1
  168. package/types/{time-line.type-5f76ecc2.d.ts → time-line.type-d7daa669.d.ts} +1 -1
  169. package/types/{time-line.type.d.mts → time-line.type.d.ts} +2 -2
  170. package/types/{timeline-item.type.d.mts → timeline-item.type.d.ts} +2 -2
  171. package/types/toast.type.d.ts +63 -0
  172. package/types/{tooltip.type.d.mts → tooltip.type.d.ts} +2 -9
  173. package/types/{upload-dragger.type.d.mts → upload-dragger.type.d.ts} +2 -2
  174. package/types/{upload-list.type-b934f279.d.ts → upload-list.type-343e8c11.d.ts} +45 -7
  175. package/types/{upload-list.type.d.mts → upload-list.type.d.ts} +2 -2
  176. package/types/{upload.type.d.mts → upload.type.d.ts} +2 -2
  177. package/types/watermark.type.d.ts +33 -0
  178. package/types/{wizard.type.d.mts → wizard.type.d.ts} +1 -1
  179. package/upload/index.js +1 -1
  180. package/upload-list/index.js +3 -2
  181. package/upload-list/vue.js +12 -2
  182. package/watermark/index.js +202 -0
  183. package/watermark/vue.js +27 -0
  184. package/wizard/index.js +5 -5
  185. package/card-group/index.js +0 -16
  186. package/color-picker/alpha-select/index.js +0 -20
  187. package/color-picker/alpha-select/vue.js +0 -60
  188. package/color-picker/color-select/index.js +0 -69
  189. package/color-picker/color-select/vue.js +0 -57
  190. package/color-picker/utils/use-drag.js +0 -38
  191. /package/types/{action-sheet.type.d.mts → action-sheet.type.d.ts} +0 -0
  192. /package/types/{amount.type.d.mts → amount.type.d.ts} +0 -0
  193. /package/types/{area.type.d.mts → area.type.d.ts} +0 -0
  194. /package/types/{autocomplete.type.d.mts → autocomplete.type.d.ts} +0 -0
  195. /package/types/{autonavi-map.type.d.mts → autonavi-map.type.d.ts} +0 -0
  196. /package/types/{avatar.type.d.mts → avatar.type.d.ts} +0 -0
  197. /package/types/{baidu-map.type.d.mts → baidu-map.type.d.ts} +0 -0
  198. /package/types/{bulletin-board.type.d.mts → bulletin-board.type.d.ts} +0 -0
  199. /package/types/{calendar-bar.type.d.mts → calendar-bar.type.d.ts} +0 -0
  200. /package/types/{calendar.type.d.mts → calendar.type.d.ts} +0 -0
  201. /package/types/{card-group.type.d.mts → card-group.type.d.ts} +0 -0
  202. /package/types/{card-template.type.d.mts → card-template.type.d.ts} +0 -0
  203. /package/types/{card.type.d.mts → card.type.d.ts} +0 -0
  204. /package/types/{carousel-item.type.d.mts → carousel-item.type.d.ts} +0 -0
  205. /package/types/{carousel.type.d.mts → carousel.type.d.ts} +0 -0
  206. /package/types/{cascader-mobile.type.d.mts → cascader-mobile.type.d.ts} +0 -0
  207. /package/types/{cascader-select.type.d.mts → cascader-select.type.d.ts} +0 -0
  208. /package/types/{cascader.type.d.mts → cascader.type.d.ts} +0 -0
  209. /package/types/{cell.type.d.mts → cell.type.d.ts} +0 -0
  210. /package/types/{chart-bar.type.d.mts → chart-bar.type.d.ts} +0 -0
  211. /package/types/{chart-boxplot.type.d.mts → chart-boxplot.type.d.ts} +0 -0
  212. /package/types/{chart-candle.type.d.mts → chart-candle.type.d.ts} +0 -0
  213. /package/types/{chart-core.type.d.mts → chart-core.type.d.ts} +0 -0
  214. /package/types/{chart-funnel.type.d.mts → chart-funnel.type.d.ts} +0 -0
  215. /package/types/{chart-gauge.type.d.mts → chart-gauge.type.d.ts} +0 -0
  216. /package/types/{chart-graph.type.d.mts → chart-graph.type.d.ts} +0 -0
  217. /package/types/{chart-heatmap.type.d.mts → chart-heatmap.type.d.ts} +0 -0
  218. /package/types/{chart-line.type.d.mts → chart-line.type.d.ts} +0 -0
  219. /package/types/{chart-liquidfill.type.d.mts → chart-liquidfill.type.d.ts} +0 -0
  220. /package/types/{chart-map.type.d.mts → chart-map.type.d.ts} +0 -0
  221. /package/types/{chart-pie.type.d.mts → chart-pie.type.d.ts} +0 -0
  222. /package/types/{chart-radar.type.d.mts → chart-radar.type.d.ts} +0 -0
  223. /package/types/{chart-sankey.type.d.mts → chart-sankey.type.d.ts} +0 -0
  224. /package/types/{chart-scatter.type.d.mts → chart-scatter.type.d.ts} +0 -0
  225. /package/types/{chart-sunburst.type.d.mts → chart-sunburst.type.d.ts} +0 -0
  226. /package/types/{chart-tree.type.d.mts → chart-tree.type.d.ts} +0 -0
  227. /package/types/{chart-waterfall.type.d.mts → chart-waterfall.type.d.ts} +0 -0
  228. /package/types/{chart-wordcloud.type.d.mts → chart-wordcloud.type.d.ts} +0 -0
  229. /package/types/{checkbox-button.type.d.mts → checkbox-button.type.d.ts} +0 -0
  230. /package/types/{checkbox-group.type.d.mts → checkbox-group.type.d.ts} +0 -0
  231. /package/types/{col.type.d.mts → col.type.d.ts} +0 -0
  232. /package/types/{column-list-group.type.d.mts → column-list-group.type.d.ts} +0 -0
  233. /package/types/{column-list-item.type.d.mts → column-list-item.type.d.ts} +0 -0
  234. /package/types/{common.type.d.mts → common.type.d.ts} +0 -0
  235. /package/types/{company.type.d.mts → company.type.d.ts} +0 -0
  236. /package/types/{container.type.d.mts → container.type.d.ts} +0 -0
  237. /package/types/{country.type.d.mts → country.type.d.ts} +0 -0
  238. /package/types/{credit-card-form.type.d.mts → credit-card-form.type.d.ts} +0 -0
  239. /package/types/{credit-card.type.d.mts → credit-card.type.d.ts} +0 -0
  240. /package/types/{crop.type.d.mts → crop.type.d.ts} +0 -0
  241. /package/types/{currency.type.d.mts → currency.type.d.ts} +0 -0
  242. /package/types/{date-panel.type.d.mts → date-panel.type.d.ts} +0 -0
  243. /package/types/{date-picker-mobile.type.d.mts → date-picker-mobile.type.d.ts} +0 -0
  244. /package/types/{date-range.type.d.mts → date-range.type.d.ts} +0 -0
  245. /package/types/{date-table.type.d.mts → date-table.type.d.ts} +0 -0
  246. /package/types/{dept.type.d.mts → dept.type.d.ts} +0 -0
  247. /package/types/{detail-page.type.d.mts → detail-page.type.d.ts} +0 -0
  248. /package/types/{dialog-select.type.d.mts → dialog-select.type.d.ts} +0 -0
  249. /package/types/{drawer.type.d.mts → drawer.type.d.ts} +0 -0
  250. /package/types/{drop-roles.type.d.mts → drop-roles.type.d.ts} +0 -0
  251. /package/types/{drop-times.type.d.mts → drop-times.type.d.ts} +0 -0
  252. /package/types/{dynamic-scroller-item.type.d.mts → dynamic-scroller-item.type.d.ts} +0 -0
  253. /package/types/{dynamic-scroller.type.d.mts → dynamic-scroller.type.d.ts} +0 -0
  254. /package/types/{espace.type.d.mts → espace.type.d.ts} +0 -0
  255. /package/types/{exception.type.d.mts → exception.type.d.ts} +0 -0
  256. /package/types/{fall-menu.type.d.mts → fall-menu.type.d.ts} +0 -0
  257. /package/types/{filter-bar.type.d.mts → filter-bar.type.d.ts} +0 -0
  258. /package/types/{filter-box.type.d.mts → filter-box.type.d.ts} +0 -0
  259. /package/types/{filter-panel.type.d.mts → filter-panel.type.d.ts} +0 -0
  260. /package/types/{filter.type.d.mts → filter.type.d.ts} +0 -0
  261. /package/types/{floating-button.type.d.mts → floating-button.type.d.ts} +0 -0
  262. /package/types/{flowchart.type.d.mts → flowchart.type.d.ts} +0 -0
  263. /package/types/{fullscreen.type.d.mts → fullscreen.type.d.ts} +0 -0
  264. /package/types/{grid.type.d.mts → grid.type.d.ts} +0 -0
  265. /package/types/{guide.type.d.mts → guide.type.d.ts} +0 -0
  266. /package/types/{hrapprover.type.d.mts → hrapprover.type.d.ts} +0 -0
  267. /package/types/{image-viewer.type.d.mts → image-viewer.type.d.ts} +0 -0
  268. /package/types/{index-bar-anchor.type.d.mts → index-bar-anchor.type.d.ts} +0 -0
  269. /package/types/{index-bar.type.d.mts → index-bar.type.d.ts} +0 -0
  270. /package/types/{ip-address.type.d.mts → ip-address.type.d.ts} +0 -0
  271. /package/types/{layout.type.d.mts → layout.type.d.ts} +0 -0
  272. /package/types/{link-menu.type.d.mts → link-menu.type.d.ts} +0 -0
  273. /package/types/{list.type.d.mts → list.type.d.ts} +0 -0
  274. /package/types/{locales.type.d.mts → locales.type.d.ts} +0 -0
  275. /package/types/{logon-user.type.d.mts → logon-user.type.d.ts} +0 -0
  276. /package/types/{logout.type.d.mts → logout.type.d.ts} +0 -0
  277. /package/types/{mini-picker.type.d.mts → mini-picker.type.d.ts} +0 -0
  278. /package/types/{month-range.type.d.mts → month-range.type.d.ts} +0 -0
  279. /package/types/{month-table.type.d.mts → month-table.type.d.ts} +0 -0
  280. /package/types/{multi-select.type.d.mts → multi-select.type.d.ts} +0 -0
  281. /package/types/{notify.type.d.mts → notify.type.d.ts} +0 -0
  282. /package/types/{option-group.type.d.mts → option-group.type.d.ts} +0 -0
  283. /package/types/{option.type.d.mts → option.type.d.ts} +0 -0
  284. /package/types/{pager-item.type.d.mts → pager-item.type.d.ts} +0 -0
  285. /package/types/{pager.type.d.mts → pager.type.d.ts} +0 -0
  286. /package/types/{panel.type.d.mts → panel.type.d.ts} +0 -0
  287. /package/types/{picker-column.type.d.mts → picker-column.type.d.ts} +0 -0
  288. /package/types/{pop-upload.type.d.mts → pop-upload.type.d.ts} +0 -0
  289. /package/types/{popconfirm.type.d.mts → popconfirm.type.d.ts} +0 -0
  290. /package/types/{popup.type.d.mts → popup.type.d.ts} +0 -0
  291. /package/types/{pull-refresh.type.d.mts → pull-refresh.type.d.ts} +0 -0
  292. /package/types/{query-builder.type.d.mts → query-builder.type.d.ts} +0 -0
  293. /package/types/{rate.type.d.mts → rate.type.d.ts} +0 -0
  294. /package/types/{record.type.d.mts → record.type.d.ts} +0 -0
  295. /package/types/{recycle-scroller.type.d.mts → recycle-scroller.type.d.ts} +0 -0
  296. /package/types/{river.type.d.mts → river.type.d.ts} +0 -0
  297. /package/types/{roles.type.d.mts → roles.type.d.ts} +0 -0
  298. /package/types/{row.type.d.mts → row.type.d.ts} +0 -0
  299. /package/types/{scroll-text.type.d.mts → scroll-text.type.d.ts} +0 -0
  300. /package/types/{scrollbar.type.d.mts → scrollbar.type.d.ts} +0 -0
  301. /package/types/{select-dropdown.type.d.mts → select-dropdown.type.d.ts} +0 -0
  302. /package/types/{select-mobile.type.d.mts → select-mobile.type.d.ts} +0 -0
  303. /package/types/{select-view.type.d.mts → select-view.type.d.ts} +0 -0
  304. /package/types/{select.type.d.mts → select.type.d.ts} +0 -0
  305. /package/types/{selected-box.type.d.mts → selected-box.type.d.ts} +0 -0
  306. /package/types/{slide-bar.type.d.mts → slide-bar.type.d.ts} +0 -0
  307. /package/types/{slider-button-group.type.d.mts → slider-button-group.type.d.ts} +0 -0
  308. /package/types/{slider-button.type.d.mts → slider-button.type.d.ts} +0 -0
  309. /package/types/{split.type.d.mts → split.type.d.ts} +0 -0
  310. /package/types/{standard-list-item.type.d.mts → standard-list-item.type.d.ts} +0 -0
  311. /package/types/{tab-dropdown.type.d.mts → tab-dropdown.type.d.ts} +0 -0
  312. /package/types/{tab-item-mf.type.d.mts → tab-item-mf.type.d.ts} +0 -0
  313. /package/types/{tabbar-item.type.d.mts → tabbar-item.type.d.ts} +0 -0
  314. /package/types/{tabbar.type.d.mts → tabbar.type.d.ts} +0 -0
  315. /package/types/{table.type.d.mts → table.type.d.ts} +0 -0
  316. /package/types/{tabs-mf.type.d.mts → tabs-mf.type.d.ts} +0 -0
  317. /package/types/{tag-group.type.d.mts → tag-group.type.d.ts} +0 -0
  318. /package/types/{tall-storage.type.d.mts → tall-storage.type.d.ts} +0 -0
  319. /package/types/{text-popup.type.d.mts → text-popup.type.d.ts} +0 -0
  320. /package/types/{time-panel.type.d.mts → time-panel.type.d.ts} +0 -0
  321. /package/types/{time-picker-mobile.type.d.mts → time-picker-mobile.type.d.ts} +0 -0
  322. /package/types/{time-range.type.d.mts → time-range.type.d.ts} +0 -0
  323. /package/types/{time-spinner.type.d.mts → time-spinner.type.d.ts} +0 -0
  324. /package/types/{time.type.d.mts → time.type.d.ts} +0 -0
  325. /package/types/{toggle-menu.type.d.mts → toggle-menu.type.d.ts} +0 -0
  326. /package/types/{top-box.type.d.mts → top-box.type.d.ts} +0 -0
  327. /package/types/{transfer-panel.type.d.mts → transfer-panel.type.d.ts} +0 -0
  328. /package/types/{transfer.type.d.mts → transfer.type.d.ts} +0 -0
  329. /package/types/{tree-menu.type.d.mts → tree-menu.type.d.ts} +0 -0
  330. /package/types/{tree-node.type.d.mts → tree-node.type.d.ts} +0 -0
  331. /package/types/{tree.type.d.mts → tree.type.d.ts} +0 -0
  332. /package/types/{user-account.type.d.mts → user-account.type.d.ts} +0 -0
  333. /package/types/{user-contact.type.d.mts → user-contact.type.d.ts} +0 -0
  334. /package/types/{user-head-group.type.d.mts → user-head-group.type.d.ts} +0 -0
  335. /package/types/{user-head.type.d.mts → user-head.type.d.ts} +0 -0
  336. /package/types/{user-link.type.d.mts → user-link.type.d.ts} +0 -0
  337. /package/types/{user.type.d.mts → user.type.d.ts} +0 -0
  338. /package/types/{wheel.type.d.mts → wheel.type.d.ts} +0 -0
  339. /package/types/{year-range.type.d.mts → year-range.type.d.ts} +0 -0
  340. /package/types/{year-table.type.d.mts → year-table.type.d.ts} +0 -0
@@ -0,0 +1,363 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import TreeStore from "../common/deps/tree-model/tree-store";
3
+ const close = ({ state, emit }) => () => {
4
+ state.search.show = false;
5
+ emit("update:visible", false);
6
+ emit("close", false);
7
+ };
8
+ const syncCheckStatus = ({ state, api }) => (value) => {
9
+ value && state.store.setDefaultCheckedKey(value);
10
+ state.checkList = api.getCheckedNodes();
11
+ };
12
+ const watchModelValue = ({ props, state, emit }) => () => {
13
+ const { textSplit } = props;
14
+ emit("update:text", state.checkLabels.join(textSplit));
15
+ };
16
+ const watchVisible = ({ emit, state, props, api }) => (visible) => {
17
+ const { modelValue } = props;
18
+ if (visible) {
19
+ api.watchModelValue(modelValue);
20
+ api.initTreeStore();
21
+ api.searchBoxToggle(false);
22
+ }
23
+ emit("update:visible", visible);
24
+ setTimeout(() => {
25
+ state.toggle = visible;
26
+ }, 0);
27
+ };
28
+ const hasChildren = (option) => option && !option.isLeaf;
29
+ const selectOption = ({ emit, state, api }) => (option, deep = true) => {
30
+ const isAdd = !option.checked || option.indeterminate;
31
+ if (option.disabled) {
32
+ return;
33
+ }
34
+ state.store.setChecked(option, isAdd, deep);
35
+ state.checkList = api.getCheckedNodes();
36
+ emit("click", option, isAdd);
37
+ };
38
+ const nodeExpand = ({ emit, state, props, api }) => (option) => {
39
+ if (option.isLeaf) {
40
+ return;
41
+ }
42
+ const { valueField } = props;
43
+ const { lazy, load } = api.getNodeConfig();
44
+ const { navList, level, waitLoadCheckList } = state;
45
+ const len = navList.length;
46
+ const appendNavList = () => {
47
+ const isSame = level < len && navList[level] === option;
48
+ if (hasChildren(option)) {
49
+ state.level += 1;
50
+ if (!isSame) {
51
+ state.navList = [...navList.slice(0, level), option];
52
+ }
53
+ }
54
+ option.expand();
55
+ emit("node-expand", option);
56
+ };
57
+ if (load && lazy && (option.selfWaitLoad || !option.loaded && !option.isLeaf)) {
58
+ state.loading = true;
59
+ option.loading = true;
60
+ load(option, (nodes) => {
61
+ let index, node;
62
+ state.loading = false;
63
+ option.loading = false;
64
+ option.loaded = true;
65
+ nodes.map((data) => {
66
+ index = -1;
67
+ state.store.append(data, option.data);
68
+ waitLoadCheckList.some((item, i) => {
69
+ if (item.data[valueField] === data[valueField]) {
70
+ index = i;
71
+ return true;
72
+ }
73
+ return false;
74
+ });
75
+ node = state.store.getNode(data);
76
+ if (index !== -1 && node) {
77
+ state.waitLoadCheckList.splice(index, 1);
78
+ }
79
+ });
80
+ option.checked && !state.store.checkStrictly && option.setChecked(true, !state.store.checkStrictly);
81
+ state.checkList = api.getCheckedNodes();
82
+ appendNavList();
83
+ });
84
+ } else {
85
+ appendNavList();
86
+ }
87
+ };
88
+ const confirm = ({ emit, state, props }) => () => {
89
+ const { emitPath, valueField } = props;
90
+ let value;
91
+ let data = [];
92
+ state.computedCheckList.forEach((node) => {
93
+ if (node.waitLoad) {
94
+ value = emitPath ? node.rawValue : node.data[valueField];
95
+ } else {
96
+ value = emitPath ? node.getPathData(valueField) : node.data[valueField];
97
+ }
98
+ data.push(value);
99
+ });
100
+ state.search.show = false;
101
+ emit("confirm", state);
102
+ emit("update:visible", false);
103
+ emit("update:modelValue", data);
104
+ };
105
+ const loopSearchOption = ({ state, props, api }) => (param) => {
106
+ const { options, prefixText = "", textSplit = "/", checkStrictly } = param || {};
107
+ const { valueField, textField, childrenField } = props;
108
+ const { input } = state.search;
109
+ const list = [];
110
+ options.forEach((item) => {
111
+ const text = item[textField];
112
+ const textNavStr = prefixText ? prefixText + textSplit + text : text;
113
+ const value = item[valueField];
114
+ const childNodes = item[childrenField];
115
+ const len = childNodes && childNodes.length;
116
+ if ((checkStrictly || !checkStrictly && !len) && text.includes(input)) {
117
+ list.push({
118
+ [valueField]: value,
119
+ [textField]: textNavStr
120
+ });
121
+ }
122
+ if (len) {
123
+ const arr = api.loopSearchOption({
124
+ options: childNodes,
125
+ prefixText: textNavStr,
126
+ textSplit,
127
+ checkStrictly
128
+ });
129
+ list.push(...arr);
130
+ }
131
+ });
132
+ return list;
133
+ };
134
+ const filterOptionsHandler = ({ state, props }) => (list) => {
135
+ const { valueField } = props;
136
+ state.search.loaded = true;
137
+ state.search.filterOptions = list.map((item) => {
138
+ return {
139
+ data: item,
140
+ node: state.store.getNode(item[valueField])
141
+ };
142
+ });
143
+ };
144
+ const searchMethod = ({ state, props, api }) => () => {
145
+ const { searchConfig } = props;
146
+ const { input, options } = state.search;
147
+ let list = [];
148
+ const { checkStrictly } = api.getNodeConfig();
149
+ if (searchConfig && searchConfig.searchMethod) {
150
+ list = searchConfig.searchMethod({ input, options, state }) || [];
151
+ } else if (input) {
152
+ list = api.loopSearchOption({ options, checkStrictly });
153
+ }
154
+ if (typeof list.then === "function") {
155
+ list.then((data) => api.filterOptionsHandler(data));
156
+ } else {
157
+ api.filterOptionsHandler(list);
158
+ }
159
+ };
160
+ const searchBoxToggle = ({ state, props, api }) => (bool) => {
161
+ const { searchConfig = {} } = props;
162
+ const { lazy } = api.getNodeConfig();
163
+ state.search.show = bool;
164
+ state.search.loaded = false;
165
+ if (bool) {
166
+ state.search.options = !lazy && searchConfig.options && searchConfig.options.length ? searchConfig.options : state.store.getAllData();
167
+ } else {
168
+ state.search.input = "";
169
+ state.search.filterOptions = [];
170
+ }
171
+ };
172
+ const isSelected = ({ state }) => (option) => {
173
+ const { navList } = state;
174
+ return navList.includes(option);
175
+ };
176
+ const created = ({ api }) => () => {
177
+ api.initTreeStore();
178
+ };
179
+ const setLevel = ({ state, api }) => (level, option) => {
180
+ if (!api.disabledNavOption(level, option)) {
181
+ state.level = level;
182
+ }
183
+ };
184
+ const searchSelectHandler = ({ emit, api }) => (option) => {
185
+ api.selectOption(option);
186
+ emit("search-click", option);
187
+ };
188
+ const renderSearchOption = ({ state }) => (text) => {
189
+ return (text || "").split(state.search.input);
190
+ };
191
+ const loadData = ({ props, state }) => (data) => {
192
+ props.visible && state.store.setData(data);
193
+ };
194
+ const computedNavListHandler = ({ state, props, t }) => () => {
195
+ const { textField } = props;
196
+ return [{ data: { [textField]: t("ui.base.all") } }, ...state.navList];
197
+ };
198
+ const disabledNavOption = ({ state }) => (level, option) => {
199
+ const node = state.navList[level];
200
+ return option.selfWaitLoad && (!node || !node.childNodes.length);
201
+ };
202
+ const getNodeConfig = ({ constants, props }) => () => {
203
+ const { nodeConfig, valueField, childrenField } = props;
204
+ return Object.assign({ nodeKey: valueField, children: childrenField }, constants.defaultNodeConfig, nodeConfig);
205
+ };
206
+ const initTreeStore = ({ props, state, api }) => () => {
207
+ const { data, valueField, textField, visible, modelValue } = props;
208
+ const {
209
+ lazy,
210
+ nodeKey,
211
+ load,
212
+ children,
213
+ afterLoad,
214
+ isLeaf,
215
+ currentNodeKey,
216
+ checkStrictly,
217
+ checkDescendants,
218
+ defaultExpandedKeys,
219
+ defaultCheckedKeys,
220
+ defaultExpandAll,
221
+ autoExpandParent,
222
+ filterNodeMethod
223
+ } = api.getNodeConfig();
224
+ if (!visible) {
225
+ return;
226
+ }
227
+ const defaultValue = (defaultCheckedKeys || modelValue).map((data2) => {
228
+ if (Array.isArray(data2)) {
229
+ data2 = data2[data2.length - 1];
230
+ }
231
+ return data2;
232
+ });
233
+ if (state.store) {
234
+ api.syncCheckStatus(defaultValue);
235
+ return;
236
+ }
237
+ state.store = new TreeStore({
238
+ data,
239
+ lazy,
240
+ load,
241
+ key: nodeKey,
242
+ props: {
243
+ label: textField,
244
+ children,
245
+ isLeaf
246
+ },
247
+ afterLoad: () => {
248
+ state.rootData = state.root.childNodes || [];
249
+ api.syncCheckStatus();
250
+ afterLoad && afterLoad();
251
+ },
252
+ checkStrictly,
253
+ currentNodeKey,
254
+ checkDescendants,
255
+ defaultExpandedKeys,
256
+ defaultCheckedKeys: defaultValue,
257
+ defaultExpandAll,
258
+ autoExpandParent,
259
+ filterNodeMethod
260
+ });
261
+ state.root = state.store.root;
262
+ if (!lazy) {
263
+ state.rootData = state.root.childNodes || [];
264
+ api.syncCheckStatus();
265
+ } else {
266
+ state.waitLoadCheckList = defaultValue.map((item, index) => {
267
+ return {
268
+ data: {
269
+ [textField]: item,
270
+ [valueField]: item
271
+ },
272
+ rawValue: (defaultCheckedKeys || modelValue)[index],
273
+ waitLoad: true
274
+ };
275
+ });
276
+ }
277
+ };
278
+ const clean = ({ state }) => () => {
279
+ const { options, waitLoadList } = state.selected;
280
+ state.selected.removeList = [...waitLoadList, ...options];
281
+ state.selected.options = [];
282
+ state.selected.waitLoadList = [];
283
+ };
284
+ const getCheckedNodes = ({ state }) => () => {
285
+ return state.store.getCheckedNodes(!state.store.checkStrictly, false, true);
286
+ };
287
+ const toggleCheckList = ({ state, props, api }) => (show) => {
288
+ const { valueField } = props;
289
+ if (!state.computedCheckList.length) {
290
+ return;
291
+ }
292
+ state.selected.show = show;
293
+ if (show) {
294
+ state.selected.options = state.checkList.slice();
295
+ state.selected.waitLoadList = state.waitLoadCheckList.slice();
296
+ } else {
297
+ let index;
298
+ state.selected.removeList.forEach((option) => {
299
+ if (option.waitLoad) {
300
+ index = state.store.defaultCheckedKeys.indexOf(option.data[valueField]);
301
+ if (index !== -1) {
302
+ state.store.defaultCheckedKeys.splice(index, 1);
303
+ }
304
+ } else {
305
+ state.store.setChecked(option, false, false);
306
+ }
307
+ });
308
+ state.checkList = api.getCheckedNodes();
309
+ state.selected.removeList = [];
310
+ state.waitLoadCheckList = state.selected.waitLoadList.slice();
311
+ }
312
+ };
313
+ const removeOption = ({ state }) => (option) => {
314
+ const { options, waitLoadList } = state.selected;
315
+ let index;
316
+ if ((index = options.indexOf(option)) > -1) {
317
+ state.selected.options.splice(index, 1);
318
+ state.selected.removeList.push(option);
319
+ } else if ((index = waitLoadList.indexOf(option)) > -1) {
320
+ state.selected.waitLoadList.splice(index, 1);
321
+ state.selected.removeList.push(option);
322
+ }
323
+ };
324
+ const computedSelectedListHandler = ({ state }) => () => {
325
+ const { options, waitLoadList } = state.selected;
326
+ return [...waitLoadList, ...options];
327
+ };
328
+ const inputKeyword = ({ state, api }) => () => {
329
+ const { search } = state;
330
+ const show = !!search.input;
331
+ if (search.show !== show) {
332
+ api.searchBoxToggle(show);
333
+ }
334
+ };
335
+ export {
336
+ clean,
337
+ close,
338
+ computedNavListHandler,
339
+ computedSelectedListHandler,
340
+ confirm,
341
+ created,
342
+ disabledNavOption,
343
+ filterOptionsHandler,
344
+ getCheckedNodes,
345
+ getNodeConfig,
346
+ initTreeStore,
347
+ inputKeyword,
348
+ isSelected,
349
+ loadData,
350
+ loopSearchOption,
351
+ nodeExpand,
352
+ removeOption,
353
+ renderSearchOption,
354
+ searchBoxToggle,
355
+ searchMethod,
356
+ searchSelectHandler,
357
+ selectOption,
358
+ setLevel,
359
+ syncCheckStatus,
360
+ toggleCheckList,
361
+ watchModelValue,
362
+ watchVisible
363
+ };
@@ -0,0 +1,130 @@
1
+ import "../chunk-G2ADBYYC.js";
2
+ import {
3
+ close,
4
+ confirm,
5
+ watchVisible,
6
+ selectOption,
7
+ searchMethod,
8
+ searchSelectHandler,
9
+ loopSearchOption,
10
+ searchBoxToggle,
11
+ filterOptionsHandler,
12
+ watchModelValue,
13
+ setLevel,
14
+ created,
15
+ clean,
16
+ loadData,
17
+ isSelected,
18
+ getNodeConfig,
19
+ initTreeStore,
20
+ disabledNavOption,
21
+ renderSearchOption,
22
+ computedNavListHandler,
23
+ computedSelectedListHandler,
24
+ nodeExpand,
25
+ inputKeyword,
26
+ removeOption,
27
+ getCheckedNodes,
28
+ toggleCheckList,
29
+ syncCheckStatus
30
+ } from "./index";
31
+ const api = [
32
+ "state",
33
+ "close",
34
+ "clean",
35
+ "confirm",
36
+ "setLevel",
37
+ "loadData",
38
+ "nodeExpand",
39
+ "selectOption",
40
+ "searchMethod",
41
+ "searchBoxToggle",
42
+ "searchSelectHandler",
43
+ "renderSearchOption",
44
+ "disabledNavOption",
45
+ "toggleCheckList",
46
+ "inputKeyword",
47
+ "removeOption",
48
+ "getCheckedNodes",
49
+ "isSelected"
50
+ ];
51
+ const renderless = (props, { computed, reactive, watch }, { t, emit, constants }) => {
52
+ const api2 = {};
53
+ const state = reactive({
54
+ toggle: false,
55
+ loading: false,
56
+ root: null,
57
+ store: null,
58
+ checkList: [],
59
+ level: 0,
60
+ rootData: [],
61
+ navList: [],
62
+ waitLoadCheckList: [],
63
+ search: {
64
+ loaded: false,
65
+ show: false,
66
+ input: "",
67
+ filterOptions: [],
68
+ options: []
69
+ },
70
+ selected: {
71
+ removeList: [],
72
+ options: [],
73
+ show: false,
74
+ waitLoadList: []
75
+ },
76
+ options: computed(() => {
77
+ let data;
78
+ let list = [state.rootData];
79
+ state.navList.map((option) => {
80
+ data = option.childNodes;
81
+ data && data.length && list.push(data);
82
+ });
83
+ return list;
84
+ }),
85
+ computedNavList: computed(() => api2.computedNavListHandler()),
86
+ computedCheckList: computed(() => [...state.waitLoadCheckList, ...state.checkList]),
87
+ computedSelectedList: computed(() => api2.computedSelectedListHandler()),
88
+ checkIds: computed(() => state.computedSelectedList.map((option) => option.data[props.valueField])),
89
+ checkLabels: computed(() => state.computedSelectedList.map((option) => option.data[props.textField]))
90
+ });
91
+ Object.assign(api2, {
92
+ state,
93
+ created: created({ api: api2 }),
94
+ close: close({ state, emit }),
95
+ clean: clean({ state, props }),
96
+ setLevel: setLevel({ state, api: api2 }),
97
+ loadData: loadData({ state, props }),
98
+ confirm: confirm({ state, emit, props, api: api2 }),
99
+ selectOption: selectOption({ emit, state, api: api2 }),
100
+ searchMethod: searchMethod({ state, props, api: api2 }),
101
+ initTreeStore: initTreeStore({ props, state, api: api2 }),
102
+ searchBoxToggle: searchBoxToggle({ state, props, api: api2 }),
103
+ syncCheckStatus: syncCheckStatus({ state, props, api: api2 }),
104
+ getNodeConfig: getNodeConfig({ state, constants, props }),
105
+ watchVisible: watchVisible({ emit, state, props, api: api2 }),
106
+ watchModelValue: watchModelValue({ props, state, emit }),
107
+ loopSearchOption: loopSearchOption({ state, api: api2, props }),
108
+ filterOptionsHandler: filterOptionsHandler({ state, props }),
109
+ searchSelectHandler: searchSelectHandler({ state, emit, api: api2, props }),
110
+ renderSearchOption: renderSearchOption({ props, state, api: api2 }),
111
+ computedNavListHandler: computedNavListHandler({ props, state, api: api2, t }),
112
+ computedSelectedListHandler: computedSelectedListHandler({ state }),
113
+ disabledNavOption: disabledNavOption({ state }),
114
+ inputKeyword: inputKeyword({ state, api: api2 }),
115
+ removeOption: removeOption({ state, api: api2 }),
116
+ isSelected: isSelected({ state, api: api2, props }),
117
+ nodeExpand: nodeExpand({ emit, state, props, api: api2 }),
118
+ toggleCheckList: toggleCheckList({ state, props, api: api2 }),
119
+ getCheckedNodes: getCheckedNodes({ state, api: api2 })
120
+ });
121
+ api2.created();
122
+ watch(() => props.data, api2.loadData, { deep: true });
123
+ watch(() => props.modelValue, api2.watchModelValue, { immediate: true, deep: true });
124
+ watch(() => props.visible, api2.watchVisible);
125
+ return api2;
126
+ };
127
+ export {
128
+ api,
129
+ renderless
130
+ };
@@ -42,6 +42,31 @@ const SAAS_DEFAULT_COLORS_18 = [
42
42
  "#daa61b",
43
43
  "#efb9e3"
44
44
  ];
45
+ const _SAAS_DEFAULT_COLORS1 = ["#2070F3", "#55CCD9", "#715AF8", "#8AC8F3", "#EB74DF", "#87C859", "#D19F00"];
46
+ const _SAAS_DEFAULT_COLORS2 = ["#36C18D", "#CB8EFB", "#ED448A", "#F7C45C", "#E7434A", "#2A8290", "#EE8DDB"];
47
+ const _SAAS_DEFAULT_COLORS3 = ["#278661", "#4FA700", "#5CACFF", "#9185F0", "#B62BF7", "#26616B", "#F46465"];
48
+ const _SAAS_DEFAULT_COLORS4 = ["#5531EB", "#FCDBAA", "#112857", "#E61866", "#B98C1D", "#D41DBC", "#87D5E5"];
49
+ const SAAS_DEFAULT_COLORS = _SAAS_DEFAULT_COLORS1.concat(_SAAS_DEFAULT_COLORS2).concat(_SAAS_DEFAULT_COLORS3).concat(_SAAS_DEFAULT_COLORS4);
50
+ const SAAS_DEFAULT_SAME_COLORS = {
51
+ blue: [
52
+ { color: "#2E94FF", idx: 3 },
53
+ { color: "#8BC3FF", idx: 5 },
54
+ { color: "#1F55B5", idx: 1 },
55
+ { color: "#2070F3", idx: 2 },
56
+ { color: "#5CACFF", idx: 4 },
57
+ { color: "#B9DBFF", idx: 6 },
58
+ { color: "#1B3F86", idx: 0 }
59
+ ],
60
+ green: [
61
+ { color: "#00A874", idx: 3 },
62
+ { color: "#82DBB1", idx: 5 },
63
+ { color: "#236549", idx: 1 },
64
+ { color: "#278661", idx: 2 },
65
+ { color: "#50C291", idx: 4 },
66
+ { color: "#AFEDCE", idx: 6 },
67
+ { color: "#1D4A37", idx: 0 }
68
+ ]
69
+ };
45
70
  const DEFAULT_CONFIG = {
46
71
  tooltip: {
47
72
  backgroundColor: "#fff",
@@ -95,8 +120,10 @@ export {
95
120
  ECHARTS_SETTINGS,
96
121
  HEAT_BMAP_COLOR,
97
122
  HEAT_MAP_COLOR,
123
+ SAAS_DEFAULT_COLORS,
98
124
  SAAS_DEFAULT_COLORS_10,
99
125
  SAAS_DEFAULT_COLORS_18,
126
+ SAAS_DEFAULT_SAME_COLORS,
100
127
  STATIC_PROPS,
101
128
  itemContent,
102
129
  itemLabel,
@@ -4,8 +4,6 @@ let abbrLabel = { th: "k", mi: "m", bi: "b", tr: "t" };
4
4
  let DEFAULT_OPTIONS = { zeroFormat: null, nullFormat: null, defaultFormat: "0,0", scalePercentBy100: true, abbrLabel };
5
5
  let [TRILLION, BILLION, MILLION, THOUSAND] = [1e12, 1e9, 1e6, 1e3];
6
6
  const numIsNaN = (value) => typeof value === "number" && isNaN(value);
7
- let options = {};
8
- let formats = {};
9
7
  function getBoundedPrecision(value, maxDecimals, optionals) {
10
8
  let splitValue = value.toString().split("e-");
11
9
  let exponent = splitValue.length === 2 ? Number(splitValue[1]) : 0;
@@ -38,13 +36,13 @@ function judgForFunc(num, abs, abbrForce) {
38
36
  return flag;
39
37
  }
40
38
  const negativeSigned = function({ format: format3, value }) {
41
- return ~format3.indexOf("+") ? format3.indexOf("+") : value < 0 ? format3.indexOf("-") : -1;
39
+ return format3.includes("+") ? format3.indexOf("+") : value < 0 ? format3.indexOf("-") : -1;
42
40
  };
43
41
  const updateAbbrV = function(params) {
44
42
  let { abbr, abbrForce, format: format3, value, abs } = params;
45
43
  abbrForce = format3.match(/a(k|m|b|t)?/);
46
44
  abbrForce = abbrForce ? abbrForce[1] : false;
47
- if (~format3.indexOf(" a")) {
45
+ if (format3.includes(" a")) {
48
46
  abbr = " ";
49
47
  }
50
48
  format3 = format3.replace(new RegExp(abbr + "a[kmbt]?"), "");
@@ -68,7 +66,7 @@ const handlePrecision = function(params) {
68
66
  let number = value.toString().split(".")[0];
69
67
  let precision = format3.split(".")[1];
70
68
  if (precision) {
71
- if (~precision.indexOf("[")) {
69
+ if (precision.includes("[")) {
72
70
  precision = precision.replace("]", "");
73
71
  precision = precision.split("[");
74
72
  params.decimal = toFixed(value, precision[0].length + precision[1].length, roundingFunction, precision[1].length);
@@ -76,7 +74,7 @@ const handlePrecision = function(params) {
76
74
  params.decimal = toFixed(value, precision.length, roundingFunction);
77
75
  }
78
76
  number = params.decimal.split(".")[0];
79
- params.decimal = ~params.decimal.indexOf(".") ? "." + params.decimal.split(".")[1] : "";
77
+ params.decimal = params.decimal.includes(".") ? "." + params.decimal.split(".")[1] : "";
80
78
  if (params.optDec && Number(params.decimal.slice(1)) === 0) {
81
79
  params.decimal = "";
82
80
  }
@@ -93,7 +91,7 @@ function formatNumber(params) {
93
91
  number = String(Number(number) / 1e3);
94
92
  params.abbr = ABBR.million;
95
93
  }
96
- if (~number.indexOf("-")) {
94
+ if (number.includes("-")) {
97
95
  number = number.slice(1);
98
96
  params.neg = true;
99
97
  }
@@ -138,17 +136,17 @@ function numberToFormat(options2, value, format3, roundingFunction) {
138
136
  value: value || 0,
139
137
  roundingFunction
140
138
  };
141
- if (~format3.indexOf("(")) {
139
+ if (format3.includes("(")) {
142
140
  params.negFlag = true;
143
141
  params.format = format3.replace(/[(|)]/g, "");
144
- } else if (~params.format.indexOf("+") || ~params.format.indexOf("-")) {
142
+ } else if (params.format.includes("+") || params.format.includes("-")) {
145
143
  params.signed = negativeSigned(params);
146
144
  params.format = format3.replace(/[+|-]/g, "");
147
145
  }
148
- if (~params.format.indexOf("a")) {
146
+ if (params.format.includes("a")) {
149
147
  updateAbbrV(params);
150
148
  }
151
- if (~params.format.indexOf("[.]")) {
149
+ if (params.format.includes("[.]")) {
152
150
  params.optDec = true;
153
151
  params.format = format3.replace("[.]", ".");
154
152
  }
@@ -163,14 +161,14 @@ function extend(target, sub) {
163
161
  let numerifyPercent = {
164
162
  regexp: /%/,
165
163
  format: function format(value, formatType, roundingFunction, numerify2) {
166
- let space = ~formatType.indexOf(" %") ? " " : "";
164
+ let space = formatType.includes(" %") ? " " : "";
167
165
  let outStr = void 0;
168
166
  if (numerify2.options.scalePercentBy100) {
169
167
  value = value * 100;
170
168
  }
171
169
  formatType = formatType.replace(/\s?%/, "");
172
170
  outStr = numerify2._numberToFormat(value, formatType, roundingFunction);
173
- if (~outStr.indexOf(")")) {
171
+ if (outStr.includes(")")) {
174
172
  outStr = outStr.split("");
175
173
  outStr.splice(-1, 0, space + "%");
176
174
  outStr = outStr.join("");
@@ -180,8 +178,9 @@ let numerifyPercent = {
180
178
  return outStr;
181
179
  }
182
180
  };
181
+ let options = {};
182
+ let formats = {};
183
183
  extend(options, DEFAULT_OPTIONS);
184
- let numerify;
185
184
  function format2(value, formatType, roundingFunc) {
186
185
  let { zeroFormat, nullFormat, defaultFormat } = options;
187
186
  formatType = formatType || defaultFormat;
@@ -203,7 +202,19 @@ function format2(value, formatType, roundingFunc) {
203
202
  }
204
203
  return output;
205
204
  }
206
- numerify = function(input, formatType, roundingFunc) {
205
+ const _register = (name, format3) => {
206
+ formats[name] = format3;
207
+ };
208
+ const _unregister = (name) => {
209
+ formats[name] = null;
210
+ };
211
+ const _setOptions = (opts) => {
212
+ extend(options, opts);
213
+ };
214
+ const _reset = () => {
215
+ extend(options, DEFAULT_OPTIONS);
216
+ };
217
+ function numerify(input, formatType, roundingFunc) {
207
218
  let { zeroFormat, nullFormat } = options;
208
219
  let value = Number(input) || null;
209
220
  if (typeof input === "undefined" || input === 0) {
@@ -219,19 +230,7 @@ numerify = function(input, formatType, roundingFunc) {
219
230
  }
220
231
  }
221
232
  return format2(value, formatType, roundingFunc);
222
- };
223
- const _register = (name, format3) => {
224
- formats[name] = format3;
225
- };
226
- const _unregister = (name) => {
227
- formats[name] = null;
228
- };
229
- const _setOptions = (opts) => {
230
- extend(options, opts);
231
- };
232
- const _reset = () => {
233
- extend(options, DEFAULT_OPTIONS);
234
- };
233
+ }
235
234
  numerify.options = options;
236
235
  numerify._numberToFormat = numberToFormat.bind(null, options);
237
236
  numerify.register = _register;