k-react-vtable 1.0.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 (268) hide show
  1. package/README.md +93 -0
  2. package/cjs/components/avatar/avatar.d.ts +14 -0
  3. package/cjs/components/avatar/avatar.js +84 -0
  4. package/cjs/components/avatar/avatar.js.map +1 -0
  5. package/cjs/components/button/button.d.ts +27 -0
  6. package/cjs/components/button/button.js +107 -0
  7. package/cjs/components/button/button.js.map +1 -0
  8. package/cjs/components/checkbox/checkbox.d.ts +17 -0
  9. package/cjs/components/checkbox/checkbox.js +69 -0
  10. package/cjs/components/checkbox/checkbox.js.map +1 -0
  11. package/cjs/components/index.d.ts +7 -0
  12. package/cjs/components/index.js +24 -0
  13. package/cjs/components/index.js.map +1 -0
  14. package/cjs/components/link/link.d.ts +30 -0
  15. package/cjs/components/link/link.js +119 -0
  16. package/cjs/components/link/link.js.map +1 -0
  17. package/cjs/components/popover/popover.d.ts +14 -0
  18. package/cjs/components/popover/popover.js +283 -0
  19. package/cjs/components/popover/popover.js.map +1 -0
  20. package/cjs/components/radio/radio.d.ts +15 -0
  21. package/cjs/components/radio/radio.js +68 -0
  22. package/cjs/components/radio/radio.js.map +1 -0
  23. package/cjs/components/tag/tag.d.ts +13 -0
  24. package/cjs/components/tag/tag.js +47 -0
  25. package/cjs/components/tag/tag.js.map +1 -0
  26. package/cjs/components/vrender-components/checkbox.d.ts +4 -0
  27. package/cjs/components/vrender-components/checkbox.js +6 -0
  28. package/cjs/components/vrender-components/checkbox.js.map +1 -0
  29. package/cjs/components/vrender-components/component-creater.d.ts +1 -0
  30. package/cjs/components/vrender-components/component-creater.js +22 -0
  31. package/cjs/components/vrender-components/component-creater.js.map +1 -0
  32. package/cjs/components/vrender-components/radio.d.ts +4 -0
  33. package/cjs/components/vrender-components/radio.js +6 -0
  34. package/cjs/components/vrender-components/radio.js.map +1 -0
  35. package/cjs/components/vrender-components/tag.d.ts +4 -0
  36. package/cjs/components/vrender-components/tag.js +6 -0
  37. package/cjs/components/vrender-components/tag.js.map +1 -0
  38. package/cjs/components/vrender-components/type.d.ts +6 -0
  39. package/cjs/components/vrender-components/type.js +6 -0
  40. package/cjs/components/vrender-components/type.js.map +1 -0
  41. package/cjs/constants.d.ts +1 -0
  42. package/cjs/constants.js +6 -0
  43. package/cjs/constants.js.map +1 -0
  44. package/cjs/containers/withContainer.d.ts +8 -0
  45. package/cjs/containers/withContainer.js +63 -0
  46. package/cjs/containers/withContainer.js.map +1 -0
  47. package/cjs/context/table.d.ts +9 -0
  48. package/cjs/context/table.js +25 -0
  49. package/cjs/context/table.js.map +1 -0
  50. package/cjs/eventsUtils.d.ts +130 -0
  51. package/cjs/eventsUtils.js +93 -0
  52. package/cjs/eventsUtils.js.map +1 -0
  53. package/cjs/index.d.ts +4 -0
  54. package/cjs/index.js +22 -0
  55. package/cjs/index.js.map +1 -0
  56. package/cjs/table-components/base-component.d.ts +12 -0
  57. package/cjs/table-components/base-component.js +87 -0
  58. package/cjs/table-components/base-component.js.map +1 -0
  59. package/cjs/table-components/component/emptyTip.d.ts +20 -0
  60. package/cjs/table-components/component/emptyTip.js +10 -0
  61. package/cjs/table-components/component/emptyTip.js.map +1 -0
  62. package/cjs/table-components/component/menu.d.ts +10 -0
  63. package/cjs/table-components/component/menu.js +10 -0
  64. package/cjs/table-components/component/menu.js.map +1 -0
  65. package/cjs/table-components/component/title.d.ts +4 -0
  66. package/cjs/table-components/component/title.js +10 -0
  67. package/cjs/table-components/component/title.js.map +1 -0
  68. package/cjs/table-components/component/tooltip.d.ts +7 -0
  69. package/cjs/table-components/component/tooltip.js +10 -0
  70. package/cjs/table-components/component/tooltip.js.map +1 -0
  71. package/cjs/table-components/custom/custom-layout.d.ts +11 -0
  72. package/cjs/table-components/custom/custom-layout.js +107 -0
  73. package/cjs/table-components/custom/custom-layout.js.map +1 -0
  74. package/cjs/table-components/custom/graphic.d.ts +19 -0
  75. package/cjs/table-components/custom/graphic.js +9 -0
  76. package/cjs/table-components/custom/graphic.js.map +1 -0
  77. package/cjs/table-components/custom/reconciler.d.ts +2 -0
  78. package/cjs/table-components/custom/reconciler.js +107 -0
  79. package/cjs/table-components/custom/reconciler.js.map +1 -0
  80. package/cjs/table-components/custom/vtable-browser-env-contribution.d.ts +6 -0
  81. package/cjs/table-components/custom/vtable-browser-env-contribution.js +35 -0
  82. package/cjs/table-components/custom/vtable-browser-env-contribution.js.map +1 -0
  83. package/cjs/table-components/custom/vtable-react-attribute-plugin.d.ts +21 -0
  84. package/cjs/table-components/custom/vtable-react-attribute-plugin.js +135 -0
  85. package/cjs/table-components/custom/vtable-react-attribute-plugin.js.map +1 -0
  86. package/cjs/table-components/custom-component.d.ts +17 -0
  87. package/cjs/table-components/custom-component.js +98 -0
  88. package/cjs/table-components/custom-component.js.map +1 -0
  89. package/cjs/table-components/index.d.ts +20 -0
  90. package/cjs/table-components/index.js +130 -0
  91. package/cjs/table-components/index.js.map +1 -0
  92. package/cjs/table-components/list/list-column.d.ts +4 -0
  93. package/cjs/table-components/list/list-column.js +10 -0
  94. package/cjs/table-components/list/list-column.js.map +1 -0
  95. package/cjs/table-components/pivot/pivot-corner.d.ts +4 -0
  96. package/cjs/table-components/pivot/pivot-corner.js +10 -0
  97. package/cjs/table-components/pivot/pivot-corner.js.map +1 -0
  98. package/cjs/table-components/pivot/pivot-dimension.d.ts +6 -0
  99. package/cjs/table-components/pivot/pivot-dimension.js +11 -0
  100. package/cjs/table-components/pivot/pivot-dimension.js.map +1 -0
  101. package/cjs/table-components/pivot/pivot-header-title.d.ts +5 -0
  102. package/cjs/table-components/pivot/pivot-header-title.js +11 -0
  103. package/cjs/table-components/pivot/pivot-header-title.js.map +1 -0
  104. package/cjs/table-components/pivot/pivot-indicator.d.ts +4 -0
  105. package/cjs/table-components/pivot/pivot-indicator.js +10 -0
  106. package/cjs/table-components/pivot/pivot-indicator.js.map +1 -0
  107. package/cjs/tables/base-table.d.ts +23 -0
  108. package/cjs/tables/base-table.js +199 -0
  109. package/cjs/tables/base-table.js.map +1 -0
  110. package/cjs/tables/index.d.ts +6 -0
  111. package/cjs/tables/index.js +65 -0
  112. package/cjs/tables/index.js.map +1 -0
  113. package/cjs/tables/list-table-simple.d.ts +8 -0
  114. package/cjs/tables/list-table-simple.js +13 -0
  115. package/cjs/tables/list-table-simple.js.map +1 -0
  116. package/cjs/tables/list-table.d.ts +8 -0
  117. package/cjs/tables/list-table.js +13 -0
  118. package/cjs/tables/list-table.js.map +1 -0
  119. package/cjs/tables/pivot-chart.d.ts +13 -0
  120. package/cjs/tables/pivot-chart.js +17 -0
  121. package/cjs/tables/pivot-chart.js.map +1 -0
  122. package/cjs/tables/pivot-table-simple.d.ts +8 -0
  123. package/cjs/tables/pivot-table-simple.js +13 -0
  124. package/cjs/tables/pivot-table-simple.js.map +1 -0
  125. package/cjs/tables/pivot-table.d.ts +8 -0
  126. package/cjs/tables/pivot-table.js +13 -0
  127. package/cjs/tables/pivot-table.js.map +1 -0
  128. package/cjs/util.d.ts +8 -0
  129. package/cjs/util.js +56 -0
  130. package/cjs/util.js.map +1 -0
  131. package/cjs/vtable.d.ts +1 -0
  132. package/cjs/vtable.js +2 -0
  133. package/cjs/vtable.js.map +1 -0
  134. package/dist/react-vtable.js +7662 -0
  135. package/dist/react-vtable.min.js +10 -0
  136. package/es/components/avatar/avatar.d.ts +14 -0
  137. package/es/components/avatar/avatar.js +82 -0
  138. package/es/components/avatar/avatar.js.map +1 -0
  139. package/es/components/button/button.d.ts +27 -0
  140. package/es/components/button/button.js +84 -0
  141. package/es/components/button/button.js.map +1 -0
  142. package/es/components/checkbox/checkbox.d.ts +17 -0
  143. package/es/components/checkbox/checkbox.js +48 -0
  144. package/es/components/checkbox/checkbox.js.map +1 -0
  145. package/es/components/index.d.ts +7 -0
  146. package/es/components/index.js +14 -0
  147. package/es/components/index.js.map +1 -0
  148. package/es/components/link/link.d.ts +30 -0
  149. package/es/components/link/link.js +96 -0
  150. package/es/components/link/link.js.map +1 -0
  151. package/es/components/popover/popover.d.ts +14 -0
  152. package/es/components/popover/popover.js +260 -0
  153. package/es/components/popover/popover.js.map +1 -0
  154. package/es/components/radio/radio.d.ts +15 -0
  155. package/es/components/radio/radio.js +47 -0
  156. package/es/components/radio/radio.js.map +1 -0
  157. package/es/components/tag/tag.d.ts +13 -0
  158. package/es/components/tag/tag.js +45 -0
  159. package/es/components/tag/tag.js.map +1 -0
  160. package/es/components/vrender-components/checkbox.d.ts +4 -0
  161. package/es/components/vrender-components/checkbox.js +2 -0
  162. package/es/components/vrender-components/checkbox.js.map +1 -0
  163. package/es/components/vrender-components/component-creater.d.ts +1 -0
  164. package/es/components/vrender-components/component-creater.js +14 -0
  165. package/es/components/vrender-components/component-creater.js.map +1 -0
  166. package/es/components/vrender-components/radio.d.ts +4 -0
  167. package/es/components/vrender-components/radio.js +2 -0
  168. package/es/components/vrender-components/radio.js.map +1 -0
  169. package/es/components/vrender-components/tag.d.ts +4 -0
  170. package/es/components/vrender-components/tag.js +2 -0
  171. package/es/components/vrender-components/tag.js.map +1 -0
  172. package/es/components/vrender-components/type.d.ts +6 -0
  173. package/es/components/vrender-components/type.js +2 -0
  174. package/es/components/vrender-components/type.js.map +1 -0
  175. package/es/constants.d.ts +1 -0
  176. package/es/constants.js +2 -0
  177. package/es/constants.js.map +1 -0
  178. package/es/containers/withContainer.d.ts +8 -0
  179. package/es/containers/withContainer.js +32 -0
  180. package/es/containers/withContainer.js.map +1 -0
  181. package/es/context/table.d.ts +9 -0
  182. package/es/context/table.js +16 -0
  183. package/es/context/table.js.map +1 -0
  184. package/es/eventsUtils.d.ts +130 -0
  185. package/es/eventsUtils.js +86 -0
  186. package/es/eventsUtils.js.map +1 -0
  187. package/es/index.d.ts +4 -0
  188. package/es/index.js +8 -0
  189. package/es/index.js.map +1 -0
  190. package/es/table-components/base-component.d.ts +12 -0
  191. package/es/table-components/base-component.js +60 -0
  192. package/es/table-components/base-component.js.map +1 -0
  193. package/es/table-components/component/emptyTip.d.ts +20 -0
  194. package/es/table-components/component/emptyTip.js +4 -0
  195. package/es/table-components/component/emptyTip.js.map +1 -0
  196. package/es/table-components/component/menu.d.ts +10 -0
  197. package/es/table-components/component/menu.js +4 -0
  198. package/es/table-components/component/menu.js.map +1 -0
  199. package/es/table-components/component/title.d.ts +4 -0
  200. package/es/table-components/component/title.js +4 -0
  201. package/es/table-components/component/title.js.map +1 -0
  202. package/es/table-components/component/tooltip.d.ts +7 -0
  203. package/es/table-components/component/tooltip.js +4 -0
  204. package/es/table-components/component/tooltip.js.map +1 -0
  205. package/es/table-components/custom/custom-layout.d.ts +11 -0
  206. package/es/table-components/custom/custom-layout.js +79 -0
  207. package/es/table-components/custom/custom-layout.js.map +1 -0
  208. package/es/table-components/custom/graphic.d.ts +19 -0
  209. package/es/table-components/custom/graphic.js +22 -0
  210. package/es/table-components/custom/graphic.js.map +1 -0
  211. package/es/table-components/custom/reconciler.d.ts +2 -0
  212. package/es/table-components/custom/reconciler.js +106 -0
  213. package/es/table-components/custom/reconciler.js.map +1 -0
  214. package/es/table-components/custom/vtable-browser-env-contribution.d.ts +6 -0
  215. package/es/table-components/custom/vtable-browser-env-contribution.js +33 -0
  216. package/es/table-components/custom/vtable-browser-env-contribution.js.map +1 -0
  217. package/es/table-components/custom/vtable-react-attribute-plugin.d.ts +21 -0
  218. package/es/table-components/custom/vtable-react-attribute-plugin.js +127 -0
  219. package/es/table-components/custom/vtable-react-attribute-plugin.js.map +1 -0
  220. package/es/table-components/custom-component.d.ts +17 -0
  221. package/es/table-components/custom-component.js +67 -0
  222. package/es/table-components/custom-component.js.map +1 -0
  223. package/es/table-components/index.d.ts +20 -0
  224. package/es/table-components/index.js +26 -0
  225. package/es/table-components/index.js.map +1 -0
  226. package/es/table-components/list/list-column.d.ts +4 -0
  227. package/es/table-components/list/list-column.js +4 -0
  228. package/es/table-components/list/list-column.js.map +1 -0
  229. package/es/table-components/pivot/pivot-corner.d.ts +4 -0
  230. package/es/table-components/pivot/pivot-corner.js +4 -0
  231. package/es/table-components/pivot/pivot-corner.js.map +1 -0
  232. package/es/table-components/pivot/pivot-dimension.d.ts +6 -0
  233. package/es/table-components/pivot/pivot-dimension.js +6 -0
  234. package/es/table-components/pivot/pivot-dimension.js.map +1 -0
  235. package/es/table-components/pivot/pivot-header-title.d.ts +5 -0
  236. package/es/table-components/pivot/pivot-header-title.js +6 -0
  237. package/es/table-components/pivot/pivot-header-title.js.map +1 -0
  238. package/es/table-components/pivot/pivot-indicator.d.ts +4 -0
  239. package/es/table-components/pivot/pivot-indicator.js +4 -0
  240. package/es/table-components/pivot/pivot-indicator.js.map +1 -0
  241. package/es/tables/base-table.d.ts +23 -0
  242. package/es/tables/base-table.js +178 -0
  243. package/es/tables/base-table.js.map +1 -0
  244. package/es/tables/index.d.ts +6 -0
  245. package/es/tables/index.js +12 -0
  246. package/es/tables/index.js.map +1 -0
  247. package/es/tables/list-table-simple.d.ts +8 -0
  248. package/es/tables/list-table-simple.js +9 -0
  249. package/es/tables/list-table-simple.js.map +1 -0
  250. package/es/tables/list-table.d.ts +8 -0
  251. package/es/tables/list-table.js +9 -0
  252. package/es/tables/list-table.js.map +1 -0
  253. package/es/tables/pivot-chart.d.ts +13 -0
  254. package/es/tables/pivot-chart.js +15 -0
  255. package/es/tables/pivot-chart.js.map +1 -0
  256. package/es/tables/pivot-table-simple.d.ts +8 -0
  257. package/es/tables/pivot-table-simple.js +9 -0
  258. package/es/tables/pivot-table-simple.js.map +1 -0
  259. package/es/tables/pivot-table.d.ts +8 -0
  260. package/es/tables/pivot-table.js +9 -0
  261. package/es/tables/pivot-table.js.map +1 -0
  262. package/es/util.d.ts +8 -0
  263. package/es/util.js +35 -0
  264. package/es/util.js.map +1 -0
  265. package/es/vtable.d.ts +1 -0
  266. package/es/vtable.js +2 -0
  267. package/es/vtable.js.map +1 -0
  268. package/package.json +104 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/link/link.tsx"],"names":[],"mappings":";;;;;;;;;;;;;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link.js","sourcesContent":["import type {\n BackgroundAttributes,\n Cursor,\n IRectGraphicAttribute,\n ITextGraphicAttribute,\n Padding,\n Tag,\n TagAttributes\n} from 'k-vtable/es/vrender';\nimport { Tag as VTag } from '../vrender-components/tag';\nimport { merge } from '@visactor/vutils';\nimport React, { useEffect } from 'react';\n\ninterface LinkStateStyle {\n textStyle?: {\n hover?: Partial<ITextGraphicAttribute>;\n disabled?: Partial<ITextGraphicAttribute>;\n };\n panelStyle?: {\n hover?: Partial<IRectGraphicAttribute>;\n disabled?: Partial<IRectGraphicAttribute>;\n };\n}\n\nexport interface LinkProps {\n children?: string;\n textStyle?: Partial<ITextGraphicAttribute>;\n padding?: Padding;\n space?: number;\n panelStyle?: BackgroundAttributes;\n minWidth?: number;\n maxWidth?: number;\n visible?: boolean;\n state?: LinkStateStyle;\n disabled?: boolean;\n icon?: boolean;\n cursor?: Cursor;\n href?: string;\n onClick?: (e: Event) => void;\n}\n\nconst defaultProps: LinkProps = {\n textStyle: {\n fontSize: 14,\n fontFamily: 'sans-serif',\n fill: 'rgb(64, 128, 255)'\n },\n panelStyle: {\n visible: true,\n opacity: 0,\n fill: 'rgba(242, 243, 245, 0.5)',\n lineWidth: 1,\n cornerRadius: 2\n },\n padding: 4,\n space: 6,\n // cursor: 'pointer',\n state: {\n textStyle: {\n disabled: {\n fill: 'rgb(148, 191, 255)'\n }\n },\n panelStyle: {\n hover: {\n // visible: true\n opacity: 1\n }\n }\n }\n};\n\nfunction LinkComponent(baseProps: LinkProps, ref: React.Ref<Tag>) {\n const props: LinkProps = merge({}, defaultProps, baseProps);\n const { disabled, href, onClick } = props;\n let linkRef = React.useRef<Tag>(null);\n linkRef = ref ? (ref as React.RefObject<Tag>) : linkRef;\n\n const handleClick: React.MouseEventHandler<HTMLElement> = React.useCallback(\n (event: any): void => {\n if (disabled) {\n typeof event?.preventDefault === 'function' && event.preventDefault();\n return;\n }\n onClick && onClick(event);\n if (href) {\n // eslint-disable-next-line no-undef\n window.open(href);\n }\n },\n [disabled, href, onClick]\n );\n\n const attribute: TagAttributes = getTagAttribute(props);\n\n useEffect(() => {\n linkRef.current.addEventListener('mouseenter', () => {\n // console.log('mouseenter', linkRef.current, e.clone());\n if (!disabled) {\n linkRef.current.addState('hover', true, false);\n // linkRef.current._bgRect.addState('hover', true, false);\n // linkRef.current._textShape.addState('hover', true, false);\n linkRef.current.stage.renderNextFrame();\n }\n });\n linkRef.current.addEventListener('mouseleave', () => {\n // console.log('mouseleave', linkRef.current, e.clone());\n if (!disabled) {\n linkRef.current.removeState('hover', false);\n // linkRef.current._bgRect.removeState('hover', false);\n // linkRef.current._textShape.removeState('hover', false);\n linkRef.current.stage.renderNextFrame();\n }\n });\n }, []);\n\n useEffect(() => {\n if (disabled) {\n linkRef.current.removeState('disabled', false);\n // linkRef.current._bgRect.removeState('disabled', false);\n // linkRef.current._textShape.removeState('disabled', false);\n\n linkRef.current.addState('disabled', true, false);\n // linkRef.current._bgRect.addState('disabled', true, false);\n // linkRef.current._textShape.addState('disabled', true, false);\n // console.log('add disable');\n } else {\n linkRef.current.removeState('disabled', false);\n // linkRef.current._bgRect.removeState('disabled', false);\n // linkRef.current._textShape.removeState('disabled', false);\n // console.log('remove disable');\n }\n linkRef.current.stage.renderNextFrame();\n });\n\n return <VTag ref={linkRef} attribute={attribute} onClick={handleClick}></VTag>;\n}\n\nfunction getTagAttribute(props: LinkProps) {\n const {\n textStyle,\n padding,\n space,\n panelStyle,\n minWidth,\n maxWidth,\n visible,\n cursor,\n disabled,\n icon,\n state,\n children\n } = props;\n const attr: TagAttributes = {\n text: children,\n textStyle,\n padding,\n panel: panelStyle,\n minWidth,\n maxWidth,\n visible,\n cursor: cursor ?? disabled ? 'not-allowed' : 'pointer',\n childrenPickable: false,\n state: {\n text: {\n hover: state?.textStyle?.hover,\n disabled: state?.textStyle?.disabled\n },\n panel: {\n hover: state?.panelStyle?.hover,\n disabled: state?.panelStyle?.disabled\n }\n },\n space,\n shape: {\n visible: !!icon,\n fill: false,\n stroke: textStyle.fill,\n symbolType:\n // eslint-disable-next-line max-len\n 'M -0.2927 -15.4348 L -15.142 -0.5855 C -18.6567 2.9292 -18.6567 8.6277 -15.142 12.1424 V 12.1424 C -11.6273 15.6571 -5.9288 15.6571 -2.4141 12.1424 L 15.2636 -5.5353 C 17.6067 -7.8784 17.6067 -11.6774 15.2636 -14.0206 V -14.0206 C 12.9205 -16.3637 9.1215 -16.3637 6.7783 -14.0206 L -10.8993 3.6571 C -12.0709 4.8287 -12.0709 6.7282 -10.8993 7.8997 V 7.8997 C -9.7278 9.0713 -7.8283 9.0713 -6.6567 7.8997 L 8.1925 -6.9495'\n }\n };\n\n return attr;\n}\n\nexport const Link = React.forwardRef<Tag, LinkProps>(LinkComponent);\n\nLink.displayName = 'Link';\n"]}
@@ -0,0 +1,14 @@
1
+ import type { CSSProperties, ReactElement, ReactNode } from 'react';
2
+ import React from 'react';
3
+ type Anchor = 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';
4
+ export interface PopoverProps {
5
+ children?: ReactElement;
6
+ defaultPopupVisible?: boolean;
7
+ popupVisible?: boolean;
8
+ position?: Anchor;
9
+ content?: ReactNode;
10
+ panelStyle?: CSSProperties;
11
+ arrowStyle?: CSSProperties;
12
+ }
13
+ export declare const Popover: React.ForwardRefExoticComponent<PopoverProps & React.RefAttributes<IGroup>>;
14
+ export {};
@@ -0,0 +1,283 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
15
+ Object.defineProperty(o, "default", {
16
+ enumerable: !0,
17
+ value: v
18
+ });
19
+ } : function(o, v) {
20
+ o.default = v;
21
+ }), __importStar = this && this.__importStar || function(mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
25
+ return __setModuleDefault(result, mod), result;
26
+ };
27
+
28
+ Object.defineProperty(exports, "__esModule", {
29
+ value: !0
30
+ }), exports.Popover = void 0;
31
+
32
+ const vutils_1 = require("@visactor/vutils"), react_1 = __importStar(require("react")), table_components_1 = require("../../table-components"), defaultProps = {
33
+ defaultPopupVisible: !1,
34
+ position: "top"
35
+ }, defaultPoptipPanelStyle = {
36
+ backgroundColor: "rgb(255, 255, 255)",
37
+ boxShadow: "0 4px 10px rgba(0, 0, 0, .1)",
38
+ fontSize: "14px",
39
+ borderRadius: "4px",
40
+ lineHeight: "1.5715",
41
+ boxSizing: "border-box",
42
+ color: "rgb(78, 89, 105)",
43
+ border: "1px solid rgb(229, 230, 235)",
44
+ padding: "12px 16px"
45
+ }, Tooltip = props => {
46
+ const arrowStyle = Object.assign(Object.assign({
47
+ content: "",
48
+ height: "8px",
49
+ width: "8px",
50
+ position: "absolute",
51
+ display: "block",
52
+ boxSizing: "border-box",
53
+ transform: "rotate(45deg)",
54
+ transformOrigin: "50% 50% 0",
55
+ backgroundColor: "rgb(255, 255, 255)",
56
+ border: "1px solid rgb(229, 230, 235)"
57
+ }, getArrowStyle(props.position)), props.arrowStyle);
58
+ return props.visible ? react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement("div", {
59
+ style: (0, vutils_1.merge)({}, defaultPoptipPanelStyle, props.panelStyle)
60
+ }, props.content), react_1.default.createElement("div", {
61
+ style: arrowStyle
62
+ })) : react_1.default.createElement(react_1.default.Fragment, null);
63
+ };
64
+
65
+ function PopoverComponent(baseProps, ref) {
66
+ const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {content: content, position: position, popupVisible: popupVisible, defaultPopupVisible: defaultPopupVisible, panelStyle: panelStyle, arrowStyle: arrowStyle, children: children} = props;
67
+ let popoverRef = react_1.default.useRef(null);
68
+ popoverRef = ref || popoverRef;
69
+ const [popupOpen, setPopupOpen] = (0, react_1.useState)(!1);
70
+ (0, react_1.useEffect)((() => {
71
+ setPopupOpen(!!popupVisible), popoverRef.current.stage.renderNextFrame();
72
+ }), [ popupVisible ]), (0, react_1.useEffect)((() => {
73
+ var _a;
74
+ setPopupOpen(null !== (_a = null != popupVisible ? popupVisible : defaultPopupVisible) && void 0 !== _a && _a);
75
+ }), []);
76
+ const {transform: transform, anchorType: anchorType} = getTransform(position), groupAttribute = {
77
+ react: {
78
+ style: {
79
+ transform: transform
80
+ },
81
+ element: react_1.default.createElement(Tooltip, {
82
+ visible: popupOpen,
83
+ content: content,
84
+ position: position,
85
+ panelStyle: panelStyle,
86
+ arrowStyle: arrowStyle
87
+ }),
88
+ container: null,
89
+ visible: !0,
90
+ pointerEvents: !1,
91
+ anchorType: anchorType
92
+ }
93
+ }, groupMouseEnter = (0, react_1.useCallback)((event => {
94
+ (0, vutils_1.isValid)(popupVisible) || (setPopupOpen(!0), event.currentTarget.stage.renderNextFrame());
95
+ }), []), groupMouseLeave = (0, react_1.useCallback)((event => {
96
+ (0, vutils_1.isValid)(popupVisible) || (setPopupOpen(!1), event.currentTarget.stage.renderNextFrame());
97
+ }), []);
98
+ return react_1.default.createElement(table_components_1.Group, {
99
+ ref: popoverRef,
100
+ attribute: groupAttribute,
101
+ onMouseEnter: groupMouseEnter,
102
+ onMouseLeave: groupMouseLeave
103
+ }, children);
104
+ }
105
+
106
+ function getTransform(position) {
107
+ switch (position) {
108
+ case "top":
109
+ return {
110
+ anchorType: "top",
111
+ transform: "translate(-50%, calc(-100% - 10px))"
112
+ };
113
+
114
+ case "tl":
115
+ return {
116
+ anchorType: "top-left",
117
+ transform: "translate(0, calc(-100% - 10px))"
118
+ };
119
+
120
+ case "tr":
121
+ return {
122
+ anchorType: "top-right",
123
+ transform: "translate(-100%, calc(-100% - 10px))"
124
+ };
125
+
126
+ case "bottom":
127
+ return {
128
+ anchorType: "bottom",
129
+ transform: "translate(-50%, 10px)"
130
+ };
131
+
132
+ case "bl":
133
+ return {
134
+ anchorType: "bottom-left",
135
+ transform: "translate(0, 10px)"
136
+ };
137
+
138
+ case "br":
139
+ return {
140
+ anchorType: "bottom-right",
141
+ transform: "translate(-100%, 10px)"
142
+ };
143
+
144
+ case "left":
145
+ return {
146
+ anchorType: "left",
147
+ transform: "translate(calc(-100% - 10px), -50%)"
148
+ };
149
+
150
+ case "lt":
151
+ return {
152
+ anchorType: "top-left",
153
+ transform: "translate(calc(-100% - 10px), 0)"
154
+ };
155
+
156
+ case "lb":
157
+ return {
158
+ anchorType: "bottom-left",
159
+ transform: "translate(calc(-100% - 10px), -100%)"
160
+ };
161
+
162
+ case "right":
163
+ return {
164
+ anchorType: "right",
165
+ transform: "translate(10px, -50%)"
166
+ };
167
+
168
+ case "rt":
169
+ return {
170
+ anchorType: "top-right",
171
+ transform: "translate(10px, 0)"
172
+ };
173
+
174
+ case "rb":
175
+ return {
176
+ anchorType: "bottom-right",
177
+ transform: "translate(10px, -100%)"
178
+ };
179
+ }
180
+ }
181
+
182
+ function getArrowStyle(position) {
183
+ switch (position) {
184
+ case "top":
185
+ return {
186
+ top: "calc(100% - 5px)",
187
+ left: "calc(50% - 5px)",
188
+ borderTop: "none",
189
+ borderLeft: "none"
190
+ };
191
+
192
+ case "tl":
193
+ return {
194
+ top: "calc(100% - 4px)",
195
+ left: "14px",
196
+ borderTop: "none",
197
+ borderLeft: "none"
198
+ };
199
+
200
+ case "tr":
201
+ return {
202
+ top: "calc(100% - 4px)",
203
+ left: "calc(100% - 24px)",
204
+ borderTop: "none",
205
+ borderLeft: "none"
206
+ };
207
+
208
+ case "bottom":
209
+ return {
210
+ top: "-4px",
211
+ left: "calc(50% - 4px)",
212
+ borderRight: "none",
213
+ borderBottom: "none"
214
+ };
215
+
216
+ case "bl":
217
+ return {
218
+ top: "-4px",
219
+ left: "14px",
220
+ borderRight: "none",
221
+ borderBottom: "none"
222
+ };
223
+
224
+ case "br":
225
+ return {
226
+ top: "-4px",
227
+ left: "calc(100% - 24px)",
228
+ borderRight: "none",
229
+ borderBottom: "none"
230
+ };
231
+
232
+ case "left":
233
+ return {
234
+ top: "calc(50% - 4px)",
235
+ left: "calc(100% - 5px)",
236
+ borderLeft: "none",
237
+ borderBottom: "none"
238
+ };
239
+
240
+ case "lt":
241
+ return {
242
+ top: "14px",
243
+ left: "calc(100% - 5px)",
244
+ borderLeft: "none",
245
+ borderBottom: "none"
246
+ };
247
+
248
+ case "lb":
249
+ return {
250
+ top: "calc(100% - 24px)",
251
+ left: "calc(100% - 5px)",
252
+ borderLeft: "none",
253
+ borderBottom: "none"
254
+ };
255
+
256
+ case "right":
257
+ return {
258
+ top: "calc(50% - 4px)",
259
+ left: "-4px",
260
+ borderRight: "none",
261
+ borderTop: "none"
262
+ };
263
+
264
+ case "rt":
265
+ return {
266
+ top: "14px",
267
+ left: "-4px",
268
+ borderRight: "none",
269
+ borderTop: "none"
270
+ };
271
+
272
+ case "rb":
273
+ return {
274
+ top: "calc(100% - 24px)",
275
+ left: "-4px",
276
+ borderRight: "none",
277
+ borderTop: "none"
278
+ };
279
+ }
280
+ }
281
+
282
+ exports.Popover = react_1.default.forwardRef(PopoverComponent), exports.Popover.displayName = "Popover";
283
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/popover/popover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,6CAAkD;AAElD,+CAAgE;AAChE,6DAA+C;AAkB/C,MAAM,YAAY,GAAiB;IACjC,mBAAmB,EAAE,KAAK;IAG1B,QAAQ,EAAE,KAAK;CAChB,CAAC;AAEF,MAAM,uB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ourcesContent":["import type {\n BackgroundAttributes,\n Cursor,\n IGroup,\n IGroupGraphicAttribute,\n IRectGraphicAttribute,\n ITextGraphicAttribute,\n Padding,\n Tag,\n TagAttributes\n} from 'k-vtable/es/vrender';\nimport { Tag as VTag } from '../vrender-components/tag';\nimport type { BoundsAnchorType } from '@visactor/vutils';\nimport { isValid, merge } from '@visactor/vutils';\nimport type { CSSProperties, ReactElement, ReactNode } from 'react';\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { Group } from '../../table-components';\n\ntype Anchor = 'top' | 'tl' | 'tr' | 'bottom' | 'bl' | 'br' | 'left' | 'lt' | 'lb' | 'right' | 'rt' | 'rb';\nexport interface PopoverProps {\n children?: ReactElement;\n defaultPopupVisible?: boolean;\n // disabled?: boolean;\n // popupHoverStay?: boolean;\n popupVisible?: boolean;\n // color?: string;\n position?: Anchor;\n content?: ReactNode;\n // onVisibleChange?: (visible: boolean) => void;\n\n panelStyle?: CSSProperties;\n arrowStyle?: CSSProperties;\n}\n\nconst defaultProps: PopoverProps = {\n defaultPopupVisible: false,\n // popupHoverStay: true,\n // popupVisible: false,\n position: 'top'\n};\n\nconst defaultPoptipPanelStyle: CSSProperties = {\n backgroundColor: 'rgb(255, 255, 255)',\n boxShadow: '0 4px 10px rgba(0, 0, 0, .1)',\n fontSize: '14px',\n borderRadius: '4px',\n lineHeight: '1.5715',\n boxSizing: 'border-box',\n color: 'rgb(78, 89, 105)',\n border: '1px solid rgb(229, 230, 235)',\n padding: '12px 16px'\n};\n\nconst Tooltip = (props: {\n visible: boolean;\n content: ReactNode;\n position: Anchor;\n panelStyle?: CSSProperties;\n arrowStyle?: CSSProperties;\n}) => {\n const arrowStyle: CSSProperties = {\n content: '',\n height: '8px',\n width: '8px',\n position: 'absolute',\n display: 'block',\n boxSizing: 'border-box',\n transform: 'rotate(45deg)',\n transformOrigin: '50% 50% 0',\n backgroundColor: 'rgb(255, 255, 255)',\n border: '1px solid rgb(229, 230, 235)',\n ...getArrowStyle(props.position),\n\n ...props.arrowStyle\n };\n\n return props.visible ? (\n <>\n <div style={merge({}, defaultPoptipPanelStyle, props.panelStyle)}>{props.content}</div>\n <div style={arrowStyle}></div>\n </>\n ) : (\n <></>\n );\n};\n\nfunction PopoverComponent(baseProps: PopoverProps, ref: React.Ref<IGroup>) {\n const props: PopoverProps = merge({}, defaultProps, baseProps);\n const { content, position, popupVisible, defaultPopupVisible, panelStyle, arrowStyle, children } = props;\n let popoverRef = React.useRef<IGroup>(null);\n popoverRef = ref ? (ref as React.RefObject<IGroup>) : popoverRef;\n\n const [popupOpen, setPopupOpen] = useState(false);\n\n useEffect(() => {\n if (popupVisible) {\n setPopupOpen(true);\n } else {\n setPopupOpen(false);\n }\n popoverRef.current.stage.renderNextFrame();\n }, [popupVisible]);\n\n useEffect(() => {\n setPopupOpen(popupVisible ?? defaultPopupVisible ?? false);\n }, []);\n\n const { transform, anchorType } = getTransform(position);\n const poptipContainerStyle: CSSProperties = {\n // display: popupOpen ? 'block' : 'none',\n transform: transform\n };\n\n const groupAttribute: IGroupGraphicAttribute = {\n react: {\n // width: 100,\n // height: 100,\n style: poptipContainerStyle,\n element: (\n <Tooltip\n visible={popupOpen}\n content={content}\n position={position}\n panelStyle={panelStyle}\n arrowStyle={arrowStyle}\n />\n ),\n container: null,\n visible: true,\n pointerEvents: false,\n anchorType: anchorType\n } as IGroupGraphicAttribute['react']\n };\n\n const groupMouseEnter = useCallback((event: any) => {\n if (isValid(popupVisible)) {\n return;\n }\n setPopupOpen(true);\n event.currentTarget.stage.renderNextFrame();\n }, []);\n\n const groupMouseLeave = useCallback((event: any) => {\n if (isValid(popupVisible)) {\n return;\n }\n setPopupOpen(false);\n event.currentTarget.stage.renderNextFrame();\n }, []);\n\n return (\n <Group ref={popoverRef} attribute={groupAttribute} onMouseEnter={groupMouseEnter} onMouseLeave={groupMouseLeave}>\n {children}\n </Group>\n );\n}\n\nfunction getTransform(position: Anchor): { transform: string; anchorType: BoundsAnchorType } {\n switch (position) {\n case 'top':\n return {\n anchorType: 'top',\n transform: 'translate(-50%, calc(-100% - 10px))'\n };\n case 'tl':\n return {\n anchorType: 'top-left',\n transform: 'translate(0, calc(-100% - 10px))'\n };\n case 'tr':\n return {\n anchorType: 'top-right',\n transform: 'translate(-100%, calc(-100% - 10px))'\n };\n case 'bottom':\n return {\n anchorType: 'bottom',\n transform: 'translate(-50%, 10px)'\n };\n case 'bl':\n return {\n anchorType: 'bottom-left',\n transform: 'translate(0, 10px)'\n };\n case 'br':\n return {\n anchorType: 'bottom-right',\n transform: 'translate(-100%, 10px)'\n };\n case 'left':\n return {\n anchorType: 'left',\n transform: 'translate(calc(-100% - 10px), -50%)'\n };\n case 'lt':\n return {\n anchorType: 'top-left',\n transform: 'translate(calc(-100% - 10px), 0)'\n };\n case 'lb':\n return {\n anchorType: 'bottom-left',\n transform: 'translate(calc(-100% - 10px), -100%)'\n };\n case 'right':\n return {\n anchorType: 'right',\n transform: 'translate(10px, -50%)'\n };\n case 'rt':\n return {\n anchorType: 'top-right',\n transform: 'translate(10px, 0)'\n };\n case 'rb':\n return {\n anchorType: 'bottom-right',\n transform: 'translate(10px, -100%)'\n };\n }\n}\n\nfunction getArrowStyle(position: Anchor): CSSProperties {\n switch (position) {\n case 'top':\n return {\n top: 'calc(100% - 5px)',\n left: 'calc(50% - 5px)',\n borderTop: 'none',\n borderLeft: 'none'\n };\n case 'tl':\n return {\n top: 'calc(100% - 4px)',\n left: '14px', // 4(1/2width) + 10(offset)\n borderTop: 'none',\n borderLeft: 'none'\n };\n case 'tr':\n return {\n top: 'calc(100% - 4px)',\n left: 'calc(100% - 24px)', // 10(offset) + 10(width) + 4(1/2width)\n borderTop: 'none',\n borderLeft: 'none'\n };\n case 'bottom':\n return {\n top: '-4px',\n left: 'calc(50% - 4px)',\n borderRight: 'none',\n borderBottom: 'none'\n };\n case 'bl':\n return {\n top: '-4px',\n left: '14px', // 4(1/2width) + 10(offset)\n borderRight: 'none',\n borderBottom: 'none'\n };\n case 'br':\n return {\n top: '-4px',\n left: 'calc(100% - 24px)', // 10(offset) + 10(width) + 4(1/2width)\n borderRight: 'none',\n borderBottom: 'none'\n };\n case 'left':\n return {\n top: 'calc(50% - 4px)',\n left: 'calc(100% - 5px)',\n borderLeft: 'none',\n borderBottom: 'none'\n };\n case 'lt':\n return {\n top: '14px', // 4(1/2width) + 10(offset)\n left: 'calc(100% - 5px)',\n borderLeft: 'none',\n borderBottom: 'none'\n };\n case 'lb':\n return {\n top: 'calc(100% - 24px)', // 10(offset) + 10(width) + 4(1/2width)\n left: 'calc(100% - 5px)',\n borderLeft: 'none',\n borderBottom: 'none'\n };\n case 'right':\n return {\n top: 'calc(50% - 4px)',\n left: '-4px',\n borderRight: 'none',\n borderTop: 'none'\n };\n case 'rt':\n return {\n top: '14px', // 4(1/2width) + 10(offset)\n left: '-4px',\n borderRight: 'none',\n borderTop: 'none'\n };\n case 'rb':\n return {\n top: 'calc(100% - 24px)', // 10(offset) + 10(width) + 4(1/2width)\n left: '-4px',\n borderRight: 'none',\n borderTop: 'none'\n };\n }\n}\n\nexport const Popover = React.forwardRef<IGroup, PopoverProps>(PopoverComponent);\n\nPopover.displayName = 'Popover';\n"]}
@@ -0,0 +1,15 @@
1
+ import type { Cursor, RadioAttributes } from 'k-vtable/es/vrender';
2
+ import React from 'react';
3
+ export interface RadioProps {
4
+ children?: string;
5
+ textStyle?: RadioAttributes['text'];
6
+ circleStyle?: RadioAttributes['circle'];
7
+ checked?: boolean;
8
+ interactive?: boolean;
9
+ disabled?: boolean;
10
+ disableCursor?: Cursor;
11
+ spaceBetweenTextAndIcon?: number;
12
+ visible?: boolean;
13
+ onChange?: (checked: boolean) => void;
14
+ }
15
+ export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<VRenderRadio>>;
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
4
+ void 0 === k2 && (k2 = k);
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
7
+ enumerable: !0,
8
+ get: function() {
9
+ return m[k];
10
+ }
11
+ }), Object.defineProperty(o, k2, desc);
12
+ } : function(o, m, k, k2) {
13
+ void 0 === k2 && (k2 = k), o[k2] = m[k];
14
+ }), __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
15
+ Object.defineProperty(o, "default", {
16
+ enumerable: !0,
17
+ value: v
18
+ });
19
+ } : function(o, v) {
20
+ o.default = v;
21
+ }), __importStar = this && this.__importStar || function(mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k);
25
+ return __setModuleDefault(result, mod), result;
26
+ }, __rest = this && this.__rest || function(s, e) {
27
+ var t = {};
28
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
29
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
30
+ var i = 0;
31
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
32
+ }
33
+ return t;
34
+ };
35
+
36
+ Object.defineProperty(exports, "__esModule", {
37
+ value: !0
38
+ }), exports.Radio = void 0;
39
+
40
+ const radio_1 = require("../vrender-components/radio"), vutils_1 = require("@visactor/vutils"), react_1 = __importStar(require("react")), defaultProps = {};
41
+
42
+ function RadioComponent(baseProps, ref) {
43
+ const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {textStyle: textStyle, circleStyle: circleStyle, children: children} = props, rest = __rest(props, [ "textStyle", "circleStyle", "children" ]);
44
+ let radioRef = react_1.default.useRef(null);
45
+ radioRef = ref || radioRef;
46
+ const handleChange = (0, react_1.useCallback)((event => {
47
+ props.onChange && props.onChange(event.target.attribute.checked);
48
+ }), []);
49
+ return (0, react_1.useEffect)((() => {
50
+ var _a;
51
+ return null === (_a = radioRef.current) || void 0 === _a || _a.addEventListener("radio_checked", handleChange),
52
+ () => {
53
+ var _a;
54
+ null === (_a = radioRef.current) || void 0 === _a || _a.removeEventListener("radio_checked", handleChange);
55
+ };
56
+ }), []), react_1.default.createElement(radio_1.Radio, Object.assign({
57
+ ref: radioRef,
58
+ attribute: Object.assign({
59
+ text: Object.assign(Object.assign({}, textStyle), {
60
+ text: children
61
+ }),
62
+ circle: circleStyle
63
+ }, rest)
64
+ }, rest));
65
+ }
66
+
67
+ exports.Radio = react_1.default.forwardRef(RadioComponent), exports.Radio.displayName = "Radio";
68
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/radio/radio.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,uDAA8D;AAC9D,6CAAyC;AACzC,+CAAsD;AAetD,MAAM,YAAY,GAAe,EAAE,CAAC;AAEpC,SAAS,cAAc,CAAC,SAAqB,EAAE,GAA4B;IACzE,MAAM,KAAK,GAAe,IAAA,cAAK,EAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAC7D,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAArD,wCAA6C,CAAQ,CAAC;IAC5D,IAAI,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAe,IAAI,CAAC,CAAC;IAChD,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAE,GAAqC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAEnE,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAC,CAAC,KAA+B,EAAE,EAAE;QACnE,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnE,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,IAAA,iBAAS,EAAC,GAAG,EAAE;;QACb,MAAA,QAAQ,CAAC,OAAO,0CAAE,gBAAgB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QAClE,OAAO,GAAG,EAAE;;YACV,MAAA,QAAQ,CAAC,OAAO,0CAAE,mBAAmB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;QACvE,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BAAC,aAAM,kBACL,GAAG,EAAE,QAAQ,EACb,SAAS,kBACP,IAAI,kCACC,SAAS,KACZ,IAAI,EAAE,QAAQ,KAEhB,MAAM,EAAE,WAAW,IAChB,IAAI,KAEL,IAAI,EACA,CACX,CAAC;AACJ,CAAC;AAEY,QAAA,KAAK,GAAG,eAAK,CAAC,UAAU,CAA2B,cAAc,CAAC,CAAC;AAEhF,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","file":"radio.js","sourcesContent":["import type {\n BackgroundAttributes,\n Cursor,\n IRectGraphicAttribute,\n ITextGraphicAttribute,\n Padding,\n Radio as VRenderRadio,\n RadioAttributes\n} from 'k-vtable/es/vrender';\nimport { Radio as VRadio } from '../vrender-components/radio';\nimport { merge } from '@visactor/vutils';\nimport React, { useCallback, useEffect } from 'react';\n\nexport interface RadioProps {\n children?: string;\n textStyle?: RadioAttributes['text'];\n circleStyle?: RadioAttributes['circle'];\n checked?: boolean;\n interactive?: boolean;\n disabled?: boolean;\n disableCursor?: Cursor;\n spaceBetweenTextAndIcon?: number;\n visible?: boolean;\n onChange?: (checked: boolean) => void;\n}\n\nconst defaultProps: RadioProps = {};\n\nfunction RadioComponent(baseProps: RadioProps, ref: React.Ref<VRenderRadio>) {\n const props: RadioProps = merge({}, defaultProps, baseProps);\n const { textStyle, circleStyle, children, ...rest } = props;\n let radioRef = React.useRef<VRenderRadio>(null);\n radioRef = ref ? (ref as React.RefObject<VRenderRadio>) : radioRef;\n\n const handleChange = useCallback((event: { target: VRenderRadio }) => {\n props.onChange && props.onChange(event.target.attribute.checked);\n }, []);\n\n useEffect(() => {\n radioRef.current?.addEventListener('radio_checked', handleChange);\n return () => {\n radioRef.current?.removeEventListener('radio_checked', handleChange);\n };\n }, []);\n\n return (\n <VRadio\n ref={radioRef}\n attribute={{\n text: {\n ...textStyle,\n text: children\n },\n circle: circleStyle,\n ...rest\n }}\n {...rest} // for REACT_TO_CANOPUS_EVENTS\n ></VRadio>\n );\n}\n\nexport const Radio = React.forwardRef<VRenderRadio, RadioProps>(RadioComponent);\n\nRadio.displayName = 'Radio';\n"]}
@@ -0,0 +1,13 @@
1
+ import type { IRectGraphicAttribute, ITextGraphicAttribute, Padding, TagAttributes } from 'k-vtable/es/vrender';
2
+ import React from 'react';
3
+ export interface TagProps {
4
+ attribute?: TagAttributes;
5
+ children?: string;
6
+ textStyle?: Partial<ITextGraphicAttribute>;
7
+ panelStyle?: Partial<IRectGraphicAttribute>;
8
+ padding?: Padding;
9
+ minWidth?: number;
10
+ maxWidth?: number;
11
+ visible?: boolean;
12
+ }
13
+ export declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<VRenderTag>>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ var __rest = this && this.__rest || function(s, e) {
4
+ var t = {};
5
+ for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
6
+ if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
7
+ var i = 0;
8
+ for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
9
+ }
10
+ return t;
11
+ }, __importDefault = this && this.__importDefault || function(mod) {
12
+ return mod && mod.__esModule ? mod : {
13
+ default: mod
14
+ };
15
+ };
16
+
17
+ Object.defineProperty(exports, "__esModule", {
18
+ value: !0
19
+ }), exports.Tag = void 0;
20
+
21
+ const tag_1 = require("../vrender-components/tag"), vutils_1 = require("@visactor/vutils"), react_1 = __importDefault(require("react")), defaultProps = {
22
+ textStyle: {
23
+ fontSize: 14,
24
+ fontFamily: "sans-serif",
25
+ fill: "rgb(51, 101, 238)"
26
+ },
27
+ panelStyle: {
28
+ visible: !0,
29
+ fill: "#e6fffb",
30
+ lineWidth: 1,
31
+ cornerRadius: 4
32
+ }
33
+ };
34
+
35
+ function TagComponent(baseProps, ref) {
36
+ const props = (0, vutils_1.merge)({}, defaultProps, baseProps), {attribute: attribute, panelStyle: panelStyle, children: children} = props, rest = __rest(props, [ "attribute", "panelStyle", "children" ]);
37
+ let tagRef = react_1.default.useRef(null);
38
+ return tagRef = ref || tagRef, react_1.default.createElement(tag_1.Tag, Object.assign({
39
+ ref: tagRef,
40
+ attribute: null != attribute ? attribute : Object.assign({
41
+ text: children,
42
+ panel: panelStyle
43
+ }, rest)
44
+ }, rest));
45
+ }
46
+
47
+ exports.Tag = react_1.default.forwardRef(TagComponent), exports.Tag.displayName = "Tag";
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/tag/tag.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AASA,mDAAwD;AACxD,6CAAyC;AACzC,kDAAyC;AAazC,MAAM,YAAY,GAAa;IAC7B,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,mBAAmB;KAC1B;IAED,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,CAAC;QACZ,YAAY,EAAE,CAAC;KAChB;CACF,CAAC;AAEF,SAAS,YAAY,CAAC,SAAmB,EAAE,GAA0B;IACnE,MAAM,KAAK,GAAa,IAAA,cAAK,EAAC,EAAE,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IAC3D,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAApD,uCAA4C,CAAQ,CAAC;IAC3D,IAAI,MAAM,GAAG,eAAK,CAAC,MAAM,CAAa,IAAI,CAAC,CAAC;IAC5C,MAAM,GAAG,GAAG,CAAC,CAAC,CAAE,GAAmC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE7D,OAAO,CACL,8BAAC,SAAI,kBACH,GAAG,EAAE,MAAM,EACX,SAAS,EACP,SAAS,aAAT,SAAS,cAAT,SAAS,mBACP,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,UAAiB,IACrB,IAAI,CACR,IAEC,IAAI,EACF,CACT,CAAC;AACJ,CAAC;AAEY,QAAA,GAAG,GAAG,eAAK,CAAC,UAAU,CAAuB,YAAY,CAAC,CAAC;AAExE,WAAG,CAAC,WAAW,GAAG,KAAK,CAAC","file":"tag.js","sourcesContent":["import type {\n BackgroundAttributes,\n Cursor,\n IRectGraphicAttribute,\n ITextGraphicAttribute,\n Padding,\n Tag as VRenderTag,\n TagAttributes\n} from 'k-vtable/es/vrender';\nimport { Tag as VTag } from '../vrender-components/tag';\nimport { merge } from '@visactor/vutils';\nimport React, { useEffect } from 'react';\n\nexport interface TagProps {\n attribute?: TagAttributes;\n children?: string;\n textStyle?: Partial<ITextGraphicAttribute>;\n panelStyle?: Partial<IRectGraphicAttribute>;\n padding?: Padding;\n minWidth?: number;\n maxWidth?: number;\n visible?: boolean;\n}\n\nconst defaultProps: TagProps = {\n textStyle: {\n fontSize: 14,\n fontFamily: 'sans-serif',\n fill: 'rgb(51, 101, 238)'\n },\n // padding: [8, 10],\n panelStyle: {\n visible: true,\n fill: '#e6fffb',\n lineWidth: 1,\n cornerRadius: 4\n }\n};\n\nfunction TagComponent(baseProps: TagProps, ref: React.Ref<VRenderTag>) {\n const props: TagProps = merge({}, defaultProps, baseProps);\n const { attribute, panelStyle, children, ...rest } = props;\n let tagRef = React.useRef<VRenderTag>(null);\n tagRef = ref ? (ref as React.RefObject<VRenderTag>) : tagRef;\n\n return (\n <VTag\n ref={tagRef}\n attribute={\n attribute ?? {\n text: children,\n panel: panelStyle as any,\n ...rest\n }\n }\n {...rest} // for REACT_TO_CANOPUS_EVENTS\n ></VTag>\n );\n}\n\nexport const Tag = React.forwardRef<VRenderTag, TagProps>(TagComponent);\n\nTag.displayName = 'Tag';\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ReactElement, JSXElementConstructor } from 'react';
2
+ import type { CheckboxAttributes, CheckBox as VCheakbox } from 'k-vtable/es/vrender';
3
+ import type { GraphicProps } from './type';
4
+ export declare const Checkbox: (props: GraphicProps<CheckboxAttributes, VCheakbox>) => ReactElement<GraphicProps<CheckboxAttributes, VCheakbox>, JSXElementConstructor<GraphicProps<CheckboxAttributes, VCheakbox>>>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.Checkbox = void 0, exports.Checkbox = "checkbox";
6
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/vrender-components/checkbox.tsx"],"names":[],"mappings":";;;AAKa,QAAA,QAAQ,GAKjB,UAAiB,CAAC","file":"checkbox.js","sourcesContent":["import type { ReactElement, JSXElementConstructor } from 'react';\nimport type { CheckboxAttributes, CheckBox as VCheakbox } from 'k-vtable/es/vrender';\nimport type { GraphicProps } from './type';\n\n// component from vrender-component\nexport const Checkbox: (\n props: GraphicProps<CheckboxAttributes, VCheakbox>\n) => ReactElement<\n GraphicProps<CheckboxAttributes, VCheakbox>,\n JSXElementConstructor<GraphicProps<CheckboxAttributes, VCheakbox>>\n> = 'checkbox' as any;\n"]}
@@ -0,0 +1 @@
1
+ export declare function createVRenderComponent(type: string, props: any): any;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.createVRenderComponent = void 0;
6
+
7
+ const vrender_1 = require("k-vtable/es/vrender");
8
+
9
+ function createVRenderComponent(type, props) {
10
+ if ("tag" === type) {
11
+ return new vrender_1.Tag(props.attribute ? props.attribute : props);
12
+ }
13
+ if ("radio" === type) {
14
+ return new vrender_1.Radio(props.attribute ? props.attribute : props);
15
+ }
16
+ if ("checkbox" === type) {
17
+ return new vrender_1.CheckBox(props.attribute ? props.attribute : props);
18
+ }
19
+ }
20
+
21
+ exports.createVRenderComponent = createVRenderComponent;
22
+ //# sourceMappingURL=component-creater.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/vrender-components/component-creater.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAE3D,SAAgB,sBAAsB,CAAC,IAAY,EAAE,KAAU;IAE7D,IAAI,IAAI,KAAK,KAAK,EAAE;QAClB,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC/D,OAAO,GAAG,CAAC;KACZ;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE;QAC3B,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACnE,OAAO,KAAK,CAAC;KACd;SAAM,IAAI,IAAI,KAAK,UAAU,EAAE;QAC9B,MAAM,QAAQ,GAAG,IAAI,kBAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACzE,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAbD,wDAaC","file":"component-creater.js","sourcesContent":["import { CheckBox, Radio, Tag } from 'k-vtable/es/vrender';\n\nexport function createVRenderComponent(type: string, props: any) {\n // may have unwanted onxxx prop\n if (type === 'tag') {\n const tag = new Tag(props.attribute ? props.attribute : props);\n return tag;\n } else if (type === 'radio') {\n const radio = new Radio(props.attribute ? props.attribute : props);\n return radio;\n } else if (type === 'checkbox') {\n const checkbox = new CheckBox(props.attribute ? props.attribute : props);\n return checkbox;\n }\n return undefined;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ReactElement, JSXElementConstructor } from 'react';
2
+ import type { Radio as VRadio, RadioAttributes } from 'k-vtable/es/vrender';
3
+ import type { GraphicProps } from './type';
4
+ export declare const Radio: (props: GraphicProps<RadioAttributes, VRadio>) => ReactElement<GraphicProps<RadioAttributes, VRadio>, JSXElementConstructor<GraphicProps<RadioAttributes, VRadio>>>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.Radio = void 0, exports.Radio = "radio";
6
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/vrender-components/radio.tsx"],"names":[],"mappings":";;;AAKa,QAAA,KAAK,GAGhB,OAAc,CAAC","file":"radio.js","sourcesContent":["import type { ReactElement, JSXElementConstructor } from 'react';\nimport type { Radio as VRadio, RadioAttributes } from 'k-vtable/es/vrender';\nimport type { GraphicProps } from './type';\n\n// component from vrender-component\nexport const Radio: (\n props: GraphicProps<RadioAttributes, VRadio>\n) => ReactElement<GraphicProps<RadioAttributes, VRadio>, JSXElementConstructor<GraphicProps<RadioAttributes, VRadio>>> =\n 'radio' as any;\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ReactElement, JSXElementConstructor } from 'react';
2
+ import type { Tag as VTag, TagAttributes } from 'k-vtable/es/vrender';
3
+ import type { GraphicProps } from './type';
4
+ export declare const Tag: (props: GraphicProps<TagAttributes, VTag>) => ReactElement<GraphicProps<TagAttributes, VTag>, JSXElementConstructor<GraphicProps<TagAttributes, VTag>>>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.Tag = void 0, exports.Tag = "tag";
6
+ //# sourceMappingURL=tag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/vrender-components/tag.tsx"],"names":[],"mappings":";;;AAKa,QAAA,GAAG,GAGd,KAAY,CAAC","file":"tag.js","sourcesContent":["import type { ReactElement, JSXElementConstructor } from 'react';\nimport type { Tag as VTag, TagAttributes } from 'k-vtable/es/vrender';\nimport type { GraphicProps } from './type';\n\n// component from vrender-component\nexport const Tag: (\n props: GraphicProps<TagAttributes, VTag>\n) => ReactElement<GraphicProps<TagAttributes, VTag>, JSXElementConstructor<GraphicProps<TagAttributes, VTag>>> =\n 'tag' as any;\n"]}
@@ -0,0 +1,6 @@
1
+ import type { Ref } from 'react';
2
+ import type { IEventParamsType } from 'k-vtable/es/vrender';
3
+ export type GraphicProps<IGraphicGraphicAttribute, IGraphic> = {
4
+ attribute?: IGraphicGraphicAttribute;
5
+ ref?: Ref<IGraphic>;
6
+ } & IGraphicGraphicAttribute & IEventParamsType;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ });
6
+ //# sourceMappingURL=type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/vrender-components/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { Ref } from 'react';\nimport type { IEventParamsType } from 'k-vtable/es/vrender';\n\nexport type GraphicProps<IGraphicGraphicAttribute, IGraphic> = {\n attribute?: IGraphicGraphicAttribute;\n ref?: Ref<IGraphic>;\n} & IGraphicGraphicAttribute &\n IEventParamsType;\n"]}
@@ -0,0 +1 @@
1
+ export declare const REACT_PRIVATE_PROPS: string[];
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: !0
5
+ }), exports.REACT_PRIVATE_PROPS = void 0, exports.REACT_PRIVATE_PROPS = [ "children", "hooks", "ref" ];
6
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC","file":"constants.js","sourcesContent":["export const REACT_PRIVATE_PROPS = ['children', 'hooks', 'ref'];\n"]}