antd-solid 0.0.3 → 0.0.5

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 (125) hide show
  1. package/dist/index.css +69 -0
  2. package/dist/index.esm.js +2369 -0
  3. package/dist/index.umd.js +1 -0
  4. package/package.json +5 -3
  5. package/.eslintignore +0 -2
  6. package/.eslintrc.cjs +0 -36
  7. package/.husky/pre-commit +0 -4
  8. package/.prettierrc +0 -11
  9. package/.vscode/settings.json +0 -13
  10. package/docs/.vitepress/components/Code.vue +0 -175
  11. package/docs/.vitepress/config.ts +0 -87
  12. package/docs/.vitepress/theme/index.css +0 -19
  13. package/docs/.vitepress/theme/index.ts +0 -12
  14. package/docs/components/button/Base.tsx +0 -21
  15. package/docs/components/button/Danger.tsx +0 -21
  16. package/docs/components/button.md +0 -35
  17. package/docs/components/collapse/Base.tsx +0 -25
  18. package/docs/components/collapse.md +0 -26
  19. package/docs/components/color-picker/Base.tsx +0 -14
  20. package/docs/components/color-picker.md +0 -26
  21. package/docs/components/compact/Base.tsx +0 -27
  22. package/docs/components/compact.md +0 -26
  23. package/docs/components/date-picker/Base.tsx +0 -15
  24. package/docs/components/date-picker.md +0 -26
  25. package/docs/components/empty/Base.tsx +0 -8
  26. package/docs/components/empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -8
  27. package/docs/components/empty.md +0 -32
  28. package/docs/components/form/Base.tsx +0 -63
  29. package/docs/components/form.md +0 -27
  30. package/docs/components/image/Base.tsx +0 -13
  31. package/docs/components/image.md +0 -26
  32. package/docs/components/input/AddonBeforeAndAfter.tsx +0 -14
  33. package/docs/components/input/Base.tsx +0 -15
  34. package/docs/components/input/Disabled.tsx +0 -19
  35. package/docs/components/input/PrefixAndSuffix.tsx +0 -14
  36. package/docs/components/input/Status.tsx +0 -25
  37. package/docs/components/input/TextArea.tsx +0 -14
  38. package/docs/components/input-number/Base.tsx +0 -15
  39. package/docs/components/input-number/MinMax.tsx +0 -17
  40. package/docs/components/input-number.md +0 -34
  41. package/docs/components/input.md +0 -57
  42. package/docs/components/modal/Base.tsx +0 -35
  43. package/docs/components/modal.md +0 -26
  44. package/docs/components/popconfirm/Base.tsx +0 -25
  45. package/docs/components/popconfirm.md +0 -26
  46. package/docs/components/popover/Base.tsx +0 -19
  47. package/docs/components/popover.md +0 -26
  48. package/docs/components/progress/Base.tsx +0 -16
  49. package/docs/components/progress.md +0 -26
  50. package/docs/components/radio/Base.tsx +0 -10
  51. package/docs/components/radio.md +0 -26
  52. package/docs/components/segmented/Base.tsx +0 -10
  53. package/docs/components/segmented/Block.tsx +0 -10
  54. package/docs/components/segmented/Disabled.tsx +0 -28
  55. package/docs/components/segmented.md +0 -38
  56. package/docs/components/select/AllowClear.tsx +0 -18
  57. package/docs/components/select/Base.tsx +0 -17
  58. package/docs/components/select.md +0 -35
  59. package/docs/components/switch/Base.tsx +0 -14
  60. package/docs/components/switch.md +0 -26
  61. package/docs/components/table/Base.tsx +0 -34
  62. package/docs/components/table.md +0 -29
  63. package/docs/components/tabs/Base.tsx +0 -25
  64. package/docs/components/tabs/Segment.tsx +0 -25
  65. package/docs/components/tabs.md +0 -33
  66. package/docs/components/tooltip/Base.tsx +0 -12
  67. package/docs/components/tooltip/Placement.tsx +0 -90
  68. package/docs/components/tooltip.md +0 -32
  69. package/docs/components/tree/Base.tsx +0 -45
  70. package/docs/components/tree.md +0 -26
  71. package/docs/index.md +0 -28
  72. package/global.d.ts +0 -9
  73. package/patches/vitepress@1.0.0-rc.4.patch +0 -60
  74. package/rollup.config.js +0 -65
  75. package/scripts/annotationNonProductionCode.js +0 -30
  76. package/scripts/cancelAnnotationNonProductionCode.js +0 -30
  77. package/src/Button.tsx +0 -125
  78. package/src/Collapse/index.tsx +0 -86
  79. package/src/ColorPicker.tsx +0 -11
  80. package/src/Compact.tsx +0 -15
  81. package/src/DatePicker.tsx +0 -12
  82. package/src/Empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -15
  83. package/src/Empty/assets/EmptySvg.tsx +0 -43
  84. package/src/Empty/assets/SimpleEmptySvg.tsx +0 -16
  85. package/src/Empty/index.tsx +0 -20
  86. package/src/Image.tsx +0 -29
  87. package/src/Input.tsx +0 -202
  88. package/src/InputNumber.test.tsx +0 -46
  89. package/src/InputNumber.tsx +0 -125
  90. package/src/Modal.tsx +0 -196
  91. package/src/Popconfirm.tsx +0 -75
  92. package/src/Popover.tsx +0 -30
  93. package/src/Progress.tsx +0 -4
  94. package/src/Radio.tsx +0 -132
  95. package/src/Result.tsx +0 -38
  96. package/src/Segmented/index.tsx +0 -95
  97. package/src/Select.tsx +0 -128
  98. package/src/Skeleton.tsx +0 -14
  99. package/src/Spin.tsx +0 -23
  100. package/src/Switch.tsx +0 -34
  101. package/src/Table.tsx +0 -53
  102. package/src/Tabs.tsx +0 -131
  103. package/src/Timeline.tsx +0 -33
  104. package/src/Tooltip.tsx +0 -355
  105. package/src/Tree.tsx +0 -246
  106. package/src/Upload.tsx +0 -10
  107. package/src/form/Form.tsx +0 -94
  108. package/src/form/FormItem.tsx +0 -139
  109. package/src/form/context.ts +0 -16
  110. package/src/form/index.ts +0 -13
  111. package/src/hooks/createControllableValue.ts +0 -68
  112. package/src/hooks/createUpdateEffect.ts +0 -16
  113. package/src/hooks/index.ts +0 -2
  114. package/src/hooks/useClickAway.ts +0 -18
  115. package/src/hooks/useSize.ts +0 -26
  116. package/src/types/index.ts +0 -5
  117. package/src/utils/EventEmitter.ts +0 -15
  118. package/src/utils/ReactToSolid.tsx +0 -38
  119. package/src/utils/SolidToReact.tsx +0 -27
  120. package/src/utils/array.ts +0 -21
  121. package/src/utils/component.tsx +0 -85
  122. package/src/utils/solid.ts +0 -53
  123. package/src/utils/zh_CN.ts +0 -236
  124. package/tsconfig.json +0 -25
  125. package/unocss.config.ts +0 -176
@@ -1,45 +0,0 @@
1
- import { type Component } from 'solid-js'
2
- import { Tree } from 'antd-solid'
3
-
4
- const Index: Component = () => {
5
- const treeData = [
6
- {
7
- title: 'parent 1',
8
- key: '0-0',
9
- children: [
10
- {
11
- title: 'parent 1-0',
12
- key: '0-0-0',
13
- disabled: true,
14
- children: [
15
- {
16
- title: 'leaf',
17
- key: '0-0-0-0',
18
- disableCheckbox: true,
19
- },
20
- {
21
- title: 'leaf',
22
- key: '0-0-0-1',
23
- },
24
- ],
25
- },
26
- {
27
- title: 'parent 1-1',
28
- key: '0-0-1',
29
- children: [{ title: <span style={{ color: '#1677ff' }}>sss</span>, key: '0-0-1-0' }],
30
- },
31
- ],
32
- },
33
- ];
34
-
35
- return (
36
- <Tree
37
- blockNode
38
- titleRender={node => node.title}
39
- children={node => node.children as any}
40
- treeData={treeData}
41
- />
42
- )
43
- }
44
-
45
- export default Index
@@ -1,26 +0,0 @@
1
- ---
2
- outline: deep
3
- ---
4
-
5
- # Tree 树形控件 {#title}
6
-
7
- 多层次的结构列表。
8
-
9
- ## 代码演示
10
-
11
- ### 基本
12
-
13
- 最简单的用法,展示可勾选,可选中,禁用,默认展开等功能。
14
-
15
- <Code path="tree/Base" />
16
-
17
- ## API
18
-
19
- ### Tree
20
-
21
- <div class="vp-table">
22
-
23
- | 参数 | 说明 | 类型 | 默认值
24
- | ----------- | ----------- | ----------- | ----------- |
25
-
26
- </div>
package/docs/index.md DELETED
@@ -1,28 +0,0 @@
1
- ---
2
- # https://vitepress.dev/reference/default-theme-home-page
3
- layout: home
4
-
5
- hero:
6
- name: "Antd-solid"
7
- text: "UI 库"
8
- tagline: Ant Design 的 solid 版本
9
- image:
10
- src: https://gw.alipayobjects.com/zos/rmsportal/rlpTLlbMzTNYuZGGCVYM.png
11
- alt: Antd-solid
12
- actions:
13
- - theme: brand
14
- text: 开始使用
15
- link: /components/button
16
- # - theme: alt
17
- # text: API Examples
18
- # link: /api-examples
19
-
20
- features:
21
- - title: 支持 solid
22
- details: Ant Design 的 solid 版本
23
- - title: 定制主题,随心所欲
24
- details: 使用 css 变量,让你定制主题更简单
25
- - title: 组件丰富,选用自如
26
- details: 大量实用组件满足你的需求,灵活定制与拓展
27
- ---
28
-
package/global.d.ts DELETED
@@ -1,9 +0,0 @@
1
- declare module '*.svg' {
2
- const content: string;
3
- export default content;
4
- }
5
-
6
- declare module '*.svg?raw' {
7
- const content: string;
8
- export default content;
9
- }
@@ -1,60 +0,0 @@
1
- diff --git a/dist/client/theme-default/styles/components/vp-doc.css b/dist/client/theme-default/styles/components/vp-doc.css
2
- index 12c5bf2d6a69f0d63c34b636985984b4ddb067db..fae415af1cf2800f435bab6fa1cb81ee07f95ef3 100644
3
- --- a/dist/client/theme-default/styles/components/vp-doc.css
4
- +++ b/dist/client/theme-default/styles/components/vp-doc.css
5
- @@ -151,29 +151,30 @@
6
- * Table
7
- * -------------------------------------------------------------------------- */
8
-
9
- -.vp-doc table {
10
- - display: block;
11
- +.vp-table table {
12
- + width: 100%;
13
- + display: table;
14
- border-collapse: collapse;
15
- margin: 20px 0;
16
- overflow-x: auto;
17
- }
18
-
19
- -.vp-doc tr {
20
- +.vp-table tr {
21
- border-top: 1px solid var(--vp-c-divider);
22
- transition: background-color 0.5s;
23
- }
24
-
25
- -.vp-doc tr:nth-child(2n) {
26
- +.vp-table tr:nth-child(2n) {
27
- background-color: var(--vp-c-bg-soft);
28
- }
29
-
30
- -.vp-doc th,
31
- -.vp-doc td {
32
- +.vp-table th,
33
- +.vp-table td {
34
- border: 1px solid var(--vp-c-divider);
35
- padding: 8px 16px;
36
- }
37
-
38
- -.vp-doc th {
39
- +.vp-table th {
40
- text-align: left;
41
- font-size: 14px;
42
- font-weight: 600;
43
- @@ -181,7 +182,7 @@
44
- background-color: var(--vp-c-bg-soft);
45
- }
46
-
47
- -.vp-doc td {
48
- +.vp-table td {
49
- font-size: 14px;
50
- }
51
-
52
- @@ -189,7 +190,7 @@
53
- * Decorational elements
54
- * -------------------------------------------------------------------------- */
55
-
56
- -.vp-doc hr {
57
- +.vp-table hr {
58
- margin: 16px 0;
59
- border: none;
60
- border-top: 1px solid var(--vp-c-divider);
package/rollup.config.js DELETED
@@ -1,65 +0,0 @@
1
- import ts from "rollup-plugin-typescript2"
2
- import commonjs from "@rollup/plugin-commonjs"
3
- import { babel } from "@rollup/plugin-babel"
4
- import { nodeResolve } from '@rollup/plugin-node-resolve'
5
- import terser from '@rollup/plugin-terser'
6
- import cleanup from 'rollup-plugin-cleanup'
7
-
8
- export default [
9
- {
10
- input: "src/index.ts",
11
- output: {
12
- file: "dist/index.esm.js",
13
- },
14
- plugins: [
15
- ts({
16
- tsconfig: "./tsconfig.json",
17
- // include: "src/**/*.ts+(|x)",
18
- exclude: ["**/*.test.[ts|tsx]"],
19
- }),
20
- babel({
21
- extensions: [".js", ".ts", ".jsx", ".tsx"],
22
- presets: ["babel-preset-solid"],
23
- }),
24
- commonjs(),
25
- ],
26
- external: ["uno.css"],
27
- },
28
- {
29
- input: "src/index.ts",
30
- output: {
31
- name: 'AntdSolid',
32
- file: "dist/index.umd.js",
33
- format: 'umd',
34
- globals: {
35
- 'solid-js': 'SolidJs',
36
- 'solid-js/web': 'SolidJsWeb',
37
- antd: 'Antd',
38
- react: 'React',
39
- 'react-dom/client': 'ReactDOM',
40
- 'nanoid': 'Nanoid',
41
- 'classnames': 'Classnames',
42
- 'lodash-es': 'Lodash',
43
- },
44
- },
45
- context: 'window',
46
- plugins: [
47
- ts({
48
- tsconfig: "./tsconfig.json",
49
- // include: "src/**/*.ts+(|x)",
50
- exclude: ["**/*.test.[ts|tsx]"],
51
- }),
52
- babel({
53
- extensions: [".js", ".ts", ".jsx", ".tsx"],
54
- presets: ["babel-preset-solid"],
55
- }),
56
- nodeResolve({
57
- browser: true,
58
- }),
59
- commonjs(),
60
- terser(),
61
- cleanup(),
62
- ],
63
- external: ["uno.css", 'solid-js', 'solid-js/web', 'react', 'react-dom/client', 'antd', 'nanoid', 'lodash-es', 'classnames'],
64
- }
65
- ]
@@ -1,30 +0,0 @@
1
- /**
2
- * 注释 Code 组件中的 Non-production 代码
3
- */
4
- import path from 'path'
5
- import fs from 'fs'
6
-
7
- const codeComponentPath = path.resolve('docs/.vitepress/components/Code.vue')
8
-
9
- fs.readFile(codeComponentPath, 'utf8', (err, data) => {
10
- if (err) {
11
- console.error(err)
12
- return
13
- }
14
-
15
- const reg = /(\/\/ Non-production code start\n)([\s\S]*)(\n.*\/\/ Non-production code end)/
16
- const match = data.match(reg)
17
- const annotation = match[2]
18
- .split('\n')
19
- .map(s => `// ${s}`)
20
- .join('\n')
21
- const newData = data.replace(reg, `$1${annotation}$3`)
22
-
23
- fs.writeFile(codeComponentPath, newData, err => {
24
- if (err) {
25
- console.error(err)
26
- return
27
- }
28
- })
29
- })
30
- console.log('codeComponentPathpath', codeComponentPath)
@@ -1,30 +0,0 @@
1
- /**
2
- * 取消注释 Code 组件中的 Non-production 代码
3
- */
4
- import path from 'path'
5
- import fs from 'fs'
6
-
7
- const codeComponentPath = path.resolve('docs/.vitepress/components/Code.vue')
8
-
9
- fs.readFile(codeComponentPath, 'utf8', (err, data) => {
10
- if (err) {
11
- console.error(err)
12
- return
13
- }
14
-
15
- const reg = /(\/\/ Non-production code start\n)([\s\S]*)(\n.*\/\/ Non-production code end)/
16
- const match = data.match(reg)
17
- const annotation = match[2]
18
- .split('\n')
19
- .map(s => s.replace('// ', ''))
20
- .join('\n')
21
- const newData = data.replace(reg, `$1${annotation}$3`)
22
-
23
- fs.writeFile(codeComponentPath, newData, err => {
24
- if (err) {
25
- console.error(err)
26
- return
27
- }
28
- })
29
- })
30
- console.log('codeComponentPathpath', codeComponentPath)
package/src/Button.tsx DELETED
@@ -1,125 +0,0 @@
1
- import {
2
- type Component,
3
- mergeProps,
4
- type ParentProps,
5
- type JSX,
6
- Show,
7
- createSignal,
8
- createMemo,
9
- } from 'solid-js'
10
- import cs from 'classnames'
11
-
12
- interface ButtonProps extends ParentProps, JSX.CustomAttributes<HTMLButtonElement> {
13
- type?: 'default' | 'primary' | 'dashed' | 'text' | 'link'
14
- onClick?: ((e: MouseEvent) => void) | ((e: MouseEvent) => Promise<unknown>)
15
- /**
16
- * 默认: middle
17
- * plain: 没有多余的 padding 和高度等
18
- */
19
- size?: 'large' | 'middle' | 'small' | 'plain'
20
- class?: string
21
- style?: JSX.CSSProperties
22
- loading?: boolean
23
- /**
24
- * 设置危险按钮
25
- */
26
- danger?: boolean
27
- }
28
-
29
- const sizeClassMap = {
30
- large: 'ant-px-15px ant-py-6px ant-h-40px ant-rounded-8px',
31
- middle: 'ant-px-15px ant-py-4px ant-h-32px ant-rounded-6px',
32
- small: 'ant-px-7px ant-h-24px ant-rounded-4px',
33
- plain: 'ant-p-0',
34
- } as const
35
-
36
- const typeClassMap = {
37
- default: (danger: boolean) =>
38
- cs(
39
- 'ant-bg-white',
40
- danger
41
- ? 'ant-[border:1px_solid_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]'
42
- : 'ant-[border:1px_solid_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]',
43
- ),
44
- primary: (danger: boolean) =>
45
- cs(
46
- 'ant-border-none ant-text-white',
47
- danger
48
- ? 'ant-bg-[var(--ant-color-error)] hover:ant-bg-[var(--light-error-color)] active:ant-bg-[var(--dark-error-color)]'
49
- : 'ant-bg-[var(--primary-color)] hover:ant-bg-[var(--light-primary-color)] active:ant-bg-[var(--dark-primary-color)]',
50
- ),
51
- dashed: (danger: boolean) =>
52
- cs(
53
- ' ant-bg-white',
54
- danger
55
- ? 'ant-[border:1px_dashed_var(--ant-color-error)] ant-text-[var(--ant-color-error)] hover:ant-[border-color:var(--light-error-color)] hover:ant-text-[var(--light-error-color)] active:ant-[border-color:var(--dark-error-color)] active:ant-text-[var(--dark-error-color)]'
56
- : 'ant-[border:1px_dashed_var(--ant-color-border)] ant-text-[var(--dark-color)] hover:ant-[border-color:var(--light-primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-[border-color:var(--dark-primary-color)] active:ant-text-[var(--dark-primary-color)]',
57
- ),
58
- text: (danger: boolean) =>
59
- cs(
60
- 'ant-border-none ant-bg-transparent',
61
- danger
62
- ? 'ant-text-[var(--ant-color-error)] hover:ant-bg-[var(--error-bg-color)] active:ant-bg-[var(--error-bg-color)]'
63
- : 'ant-text-[var(--dark-color)] hover:ant-bg-[rgba(0,0,0,0.06)] active:ant-bg-[rgba(0,0,0,.15)]',
64
- ),
65
- link: (danger: boolean) =>
66
- cs(
67
- 'ant-border-none ant-bg-transparent',
68
- danger
69
- ? 'ant-text-[var(--ant-color-error)] hover:ant-text-[var(--light-error-color)] active:ant-text-[var(--dark-error-color)]'
70
- : 'ant-text-[var(--primary-color)] hover:ant-text-[var(--light-primary-color)] active:ant-text-[var(--dark-primary-color)]',
71
- ),
72
- } as const
73
-
74
- const Button: Component<ButtonProps> = props => {
75
- const mergedProps = mergeProps({ type: 'default', size: 'middle' } as ButtonProps, props)
76
- const [innerLoading, setLoading] = createSignal(false)
77
- const loading = createMemo(() => props.loading ?? innerLoading())
78
-
79
- return (
80
- <button
81
- ref={mergedProps.ref}
82
- class={cs(
83
- 'ant-relative ant-cursor-pointer',
84
- mergedProps.class,
85
- sizeClassMap[mergedProps.size!],
86
- typeClassMap[mergedProps.type!](props.danger ?? false),
87
- loading() && 'ant-opacity-65',
88
- 'ant-[--color:--light-primary-color]'
89
- )}
90
- style={mergedProps.style}
91
- onClick={e => {
92
- const res = mergedProps.onClick?.(e)
93
- if (res instanceof Promise) {
94
- setLoading(true)
95
- res.finally(() => setLoading(false))
96
- }
97
-
98
- if (
99
- mergedProps.type === 'default' ||
100
- mergedProps.type === 'primary' ||
101
- mergedProps.type === 'dashed'
102
- ) {
103
- const div = document.createElement('div')
104
- div.className = cs(
105
- props.danger ? 'ant-[--color:var(--light-error-color)]' : 'ant-[--color:var(--light-primary-color)]',
106
- 'ant-absolute ant-inset-0 ant-rounded-inherit ant-[background:radial-gradient(var(--color),rgba(0,0,0,0))] ant-z--1 ant-keyframes-button-border[inset:0px][inset:-6px] ant-[animation:button-border_ease-out_0.3s]',
107
- )
108
- const onAnimationEnd = () => {
109
- div.remove()
110
- div.removeEventListener('animationend', onAnimationEnd)
111
- }
112
- div.addEventListener('animationend', onAnimationEnd)
113
- e.currentTarget.insertBefore(div, e.currentTarget.childNodes[0])
114
- }
115
- }}
116
- >
117
- <Show when={loading()}>
118
- <span class="i-ant-design:loading ant-[vertical-align:-0.125em] keyframes-spin ant-[animation:spin_1s_linear_infinite] ant-mr-8px" />
119
- </Show>
120
- <span>{mergedProps.children}</span>
121
- </button>
122
- )
123
- }
124
-
125
- export default Button
@@ -1,86 +0,0 @@
1
- import { type JSX, type JSXElement, type Component, For, Show } from 'solid-js'
2
- import cs from 'classnames'
3
- import { Transition } from 'solid-transition-group'
4
- import { type Key } from '../types'
5
- import createControllableValue from '../hooks/createControllableValue'
6
-
7
- export interface CollapseItem {
8
- key: Key
9
- label: JSXElement
10
- children: JSXElement
11
- }
12
-
13
- export interface CollapseProps {
14
- class?: string
15
- defaultActiveKey?: Key[]
16
- activeKey?: Key[]
17
- items: CollapseItem[]
18
- style?: JSX.CSSProperties
19
- }
20
-
21
- const Collapse: Component<CollapseProps> = props => {
22
- const [activeKey, setActiveKey] = createControllableValue<Key[]>(props, {
23
- defaultValuePropName: 'defaultActiveKey',
24
- valuePropName: 'activeKey',
25
- defaultValue: [],
26
- })
27
-
28
- return (
29
- <div
30
- class={cs(
31
- 'ant-rounded-[var(--ant-border-radius-lg)] ant-[border:1px_solid_var(--ant-color-border)] ant-border-b-0',
32
- props.class,
33
- )}
34
- style={props.style}
35
- >
36
- <For each={props.items}>
37
- {item => (
38
- <div class="ant-[border-bottom:1px_solid_var(--ant-color-border)] first:ant-rounded-t-[var(--ant-border-radius-lg)] last:ant-rounded-b-[var(--ant-border-radius-lg)] ant-cursor-pointer">
39
- <div
40
- class="ant-bg-[var(--ant-collapse-header-bg)] ant-text-[var(--ant-color-text-heading)] ant-p-[var(--ant-collapse-header-padding)]"
41
- onClick={() => {
42
- setActiveKey(keys => {
43
- if (keys.includes(item.key)) {
44
- return keys.filter(key => key !== item.key)
45
- }
46
- return [...keys, item.key]
47
- })
48
- }}
49
- >
50
- <span
51
- class={cs(
52
- 'i-ant-design:right-outlined',
53
- 'ant-mr-[var(--ant-margin-sm)] ant-duration-.3s',
54
- activeKey().includes(item.key) && 'ant-rotate-[90deg]',
55
- )}
56
- />
57
- {item.label}
58
- </div>
59
- <Transition
60
- onEnter={(el, done) => {
61
- el.animate([{ height: '0px' }, { height: `${el.scrollHeight}px` }], {
62
- duration: 300,
63
- }).finished.finally(done)
64
- }}
65
- onExit={(el, done) => {
66
- el.animate([{ height: `${el.scrollHeight}px` }, { height: '0px' }], {
67
- duration: 300,
68
- }).finished.finally(done)
69
- }}
70
- >
71
- <Show when={activeKey().includes(item.key)}>
72
- <div class="ant-overflow-hidden">
73
- <div class="ant-p-[var(--ant-padding-sm)] ant-[border-top:1px_solid_var(--ant-color-border)]">
74
- {item.children}
75
- </div>
76
- </div>
77
- </Show>
78
- </Transition>
79
- </div>
80
- )}
81
- </For>
82
- </div>
83
- )
84
- }
85
-
86
- export default Collapse
@@ -1,11 +0,0 @@
1
- import { ColorPicker } from 'antd'
2
- import { type Color } from 'antd/es/color-picker'
3
- import { reactToSolidComponent } from './utils/component'
4
-
5
- export interface ColorPickerProps {
6
- defaultValue?: string | Color
7
- value?: string | Color
8
- onChange?: (value: Color, hex: string) => void
9
- }
10
-
11
- export default reactToSolidComponent(ColorPicker)
package/src/Compact.tsx DELETED
@@ -1,15 +0,0 @@
1
- import { type ParentProps } from 'solid-js'
2
-
3
- interface CompactProps extends ParentProps {}
4
-
5
- function Compact(props: CompactProps) {
6
- return <div class="ant-compact ant-flex">{props.children}</div>
7
- }
8
-
9
- Compact.compactItemClass = 'p[.ant-compact]:ant-ml--1px'
10
- Compact.compactItemRounded0Class = 'p[.ant-compact>*]:ant-rounded-0'
11
- Compact.compactItemRoundedLeftClass = 'p[.ant-compact>:first-child]:ant-rounded-l-6px'
12
- Compact.compactItemRoundedRightClass = 'p[.ant-compact>:last-child]:ant-rounded-r-6px'
13
- Compact.compactItemZIndexClass = 'p[.ant-compact>*]:focus:ant-z-10 p[.ant-compact>*]:focus-within:ant-z-10'
14
-
15
- export default Compact
@@ -1,12 +0,0 @@
1
- import { DatePicker as DatePickerAntd } from 'antd'
2
- import { reactToSolidComponent, replaceClassName } from './utils/component'
3
-
4
- const RangePicker = replaceClassName(reactToSolidComponent(DatePickerAntd.RangePicker))
5
-
6
- const _DatePicker = replaceClassName(reactToSolidComponent(DatePickerAntd))
7
- const DatePicker = _DatePicker as typeof _DatePicker & {
8
- RangePicker: typeof RangePicker
9
- }
10
- DatePicker.RangePicker = RangePicker
11
-
12
- export default DatePicker
@@ -1,15 +0,0 @@
1
- import { type Component } from 'solid-js'
2
- import SimpleEmptySvg from './assets/SimpleEmptySvg'
3
-
4
- const PRESENTED_IMAGE_SIMPLE: Component = () => {
5
- return (
6
- <div class='ant-my-[var(--ant-margin-xl)] ant-mx-[var(--ant-margin-xs)]'>
7
- <div class="ant-mb-[var(--ant-margin-xs)] ant-flex ant-justify-center">
8
- <SimpleEmptySvg />
9
- </div>
10
- <div class="ant-text-[var(--ant-color-text-disabled)] ant-text-center">暂无数据</div>
11
- </div>
12
- )
13
- }
14
-
15
- export default PRESENTED_IMAGE_SIMPLE
@@ -1,43 +0,0 @@
1
- const EmptySvg = () => (
2
- <svg width="184" height="100" viewBox="0 0 184 152" xmlns="http://www.w3.org/2000/svg">
3
- <g fill="none" fill-rule="evenodd">
4
- <g transform="translate(24 31.67)">
5
- <ellipse
6
- fill-opacity=".8"
7
- fill="#F5F5F7"
8
- cx="67.797"
9
- cy="106.89"
10
- rx="67.797"
11
- ry="12.668"
12
- />
13
- <path
14
- d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"
15
- fill="#AEB8C2"
16
- />
17
- <path
18
- d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z"
19
- fill="url(#linearGradient-1)"
20
- transform="translate(13.56)"
21
- />
22
- <path
23
- d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"
24
- fill="#F5F5F7"
25
- />
26
- <path
27
- d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"
28
- fill="#DCE0E6"
29
- />
30
- </g>
31
- <path
32
- d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"
33
- fill="#DCE0E6"
34
- />
35
- <g transform="translate(149.65 15.383)" fill="#FFF">
36
- <ellipse cx="20.654" cy="3.167" rx="2.849" ry="2.815" />
37
- <path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" />
38
- </g>
39
- </g>
40
- </svg>
41
- )
42
-
43
- export default EmptySvg
@@ -1,16 +0,0 @@
1
- const EmptySvg = () => (
2
- <svg width="64" height="41" viewBox="0 0 64 41" xmlns="http://www.w3.org/2000/svg">
3
- <g transform="translate(0 1)" fill="none" fill-rule="evenodd">
4
- <ellipse fill="#f5f5f5" cx="32" cy="33" rx="32" ry="7" />
5
- <g fill-rule="nonzero" stroke="#d9d9d9">
6
- <path d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" />
7
- <path
8
- d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
9
- fill="#fafafa"
10
- />
11
- </g>
12
- </g>
13
- </svg>
14
- )
15
-
16
- export default EmptySvg
@@ -1,20 +0,0 @@
1
- import { type Component } from 'solid-js'
2
- import PRESENTED_IMAGE_SIMPLE from './PRESENTED_IMAGE_SIMPLE'
3
- import EmptySvg from './assets/EmptySvg'
4
-
5
- const Empty: Component & {
6
- PRESENTED_IMAGE_SIMPLE: Component
7
- } = () => {
8
- return (
9
- <div>
10
- <div class='ant-mb-[var(--ant-margin-xs)] ant-flex ant-justify-center'>
11
- <EmptySvg />
12
- </div>
13
- <div class='ant-text-[var(--ant-color-text)] ant-text-center'>暂无数据</div>
14
- </div>
15
- )
16
- }
17
-
18
- Empty.PRESENTED_IMAGE_SIMPLE = PRESENTED_IMAGE_SIMPLE
19
-
20
- export default Empty