antd-solid 0.0.6 → 0.0.8

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 (147) hide show
  1. package/dist/index.esm.js +2356 -0
  2. package/dist/index.umd.js +1 -0
  3. package/es/Button.d.ts +19 -0
  4. package/es/Button.js +73 -0
  5. package/es/Collapse/index.d.ts +16 -0
  6. package/es/Collapse/index.js +87 -0
  7. package/es/ColorPicker.d.ts +8 -0
  8. package/es/ColorPicker.js +6 -0
  9. package/es/Compact.d.ts +12 -0
  10. package/es/Compact.js +17 -0
  11. package/es/DatePicker.d.ts +19 -0
  12. package/es/DatePicker.js +9 -0
  13. package/es/Empty/PRESENTED_IMAGE_SIMPLE.d.ts +3 -0
  14. package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +14 -0
  15. package/es/Empty/assets/EmptySvg.d.ts +2 -0
  16. package/es/Empty/assets/EmptySvg.js +6 -0
  17. package/es/Empty/assets/SimpleEmptySvg.d.ts +2 -0
  18. package/es/Empty/assets/SimpleEmptySvg.js +6 -0
  19. package/es/Empty/index.d.ts +5 -0
  20. package/es/Empty/index.js +16 -0
  21. package/es/Image.d.ts +9 -0
  22. package/es/Image.js +22 -0
  23. package/es/Input.d.ts +29 -0
  24. package/es/Input.js +144 -0
  25. package/es/InputNumber.d.ts +11 -0
  26. package/es/InputNumber.js +92 -0
  27. package/es/InputNumber.test.d.ts +1 -0
  28. package/es/InputNumber.test.js +42 -0
  29. package/es/Modal.d.ts +47 -0
  30. package/es/Modal.js +195 -0
  31. package/es/Popconfirm.d.ts +21 -0
  32. package/es/Popconfirm.js +64 -0
  33. package/es/Popover.d.ts +7 -0
  34. package/es/Popover.js +36 -0
  35. package/es/Progress.d.ts +7 -0
  36. package/es/Progress.js +6 -0
  37. package/es/Radio.d.ts +27 -0
  38. package/es/Radio.js +89 -0
  39. package/es/Result.d.ts +10 -0
  40. package/es/Result.js +29 -0
  41. package/es/Segmented/index.d.ts +21 -0
  42. package/es/Segmented/index.js +72 -0
  43. package/es/Select.d.ts +16 -0
  44. package/es/Select.js +113 -0
  45. package/es/Skeleton.d.ts +9 -0
  46. package/es/Skeleton.js +9 -0
  47. package/es/Spin.d.ts +9 -0
  48. package/es/Spin.js +22 -0
  49. package/es/Switch.d.ts +8 -0
  50. package/es/Switch.js +30 -0
  51. package/es/Table.d.ts +11 -0
  52. package/es/Table.js +57 -0
  53. package/es/Tabs.d.ts +17 -0
  54. package/es/Tabs.js +117 -0
  55. package/es/Timeline.d.ts +13 -0
  56. package/es/Timeline.js +30 -0
  57. package/es/Tooltip.d.ts +34 -0
  58. package/es/Tooltip.js +302 -0
  59. package/es/Tree.d.ts +28 -0
  60. package/es/Tree.js +198 -0
  61. package/es/Upload.d.ts +11 -0
  62. package/es/Upload.js +6 -0
  63. package/es/form/Form.d.ts +18 -0
  64. package/es/form/Form.js +70 -0
  65. package/es/form/FormItem.d.ts +19 -0
  66. package/es/form/FormItem.js +141 -0
  67. package/es/form/context.d.ts +12 -0
  68. package/es/form/context.js +5 -0
  69. package/es/form/index.d.ts +8 -0
  70. package/es/form/index.js +7 -0
  71. package/es/hooks/createControllableValue.d.ts +16 -0
  72. package/es/hooks/createControllableValue.js +41 -0
  73. package/es/hooks/createUpdateEffect.d.ts +5 -0
  74. package/es/hooks/createUpdateEffect.js +12 -0
  75. package/es/hooks/index.d.ts +2 -0
  76. package/es/hooks/index.js +2 -0
  77. package/es/hooks/useClickAway.d.ts +2 -0
  78. package/es/hooks/useClickAway.js +17 -0
  79. package/es/hooks/useSize.d.ts +5 -0
  80. package/es/hooks/useSize.js +22 -0
  81. package/es/index.d.ts +42 -0
  82. package/es/index.js +29 -0
  83. package/es/types/index.d.ts +3 -0
  84. package/es/types/index.js +1 -0
  85. package/es/utils/EventEmitter.d.ts +7 -0
  86. package/es/utils/EventEmitter.js +13 -0
  87. package/es/utils/ReactToSolid.d.ts +8 -0
  88. package/es/utils/ReactToSolid.js +30 -0
  89. package/es/utils/SolidToReact.d.ts +8 -0
  90. package/es/utils/SolidToReact.js +23 -0
  91. package/es/utils/array.d.ts +15 -0
  92. package/es/utils/array.js +19 -0
  93. package/es/utils/component.d.ts +31 -0
  94. package/es/utils/component.js +68 -0
  95. package/es/utils/solid.d.ts +15 -0
  96. package/es/utils/solid.js +32 -0
  97. package/es/utils/zh_CN.d.ts +2 -0
  98. package/{src/utils/zh_CN.ts → es/utils/zh_CN.js} +34 -34
  99. package/package.json +7 -6
  100. package/src/Button.tsx +0 -125
  101. package/src/Collapse/index.tsx +0 -86
  102. package/src/ColorPicker.tsx +0 -11
  103. package/src/Compact.tsx +0 -15
  104. package/src/DatePicker.tsx +0 -22
  105. package/src/Empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -15
  106. package/src/Empty/assets/EmptySvg.tsx +0 -43
  107. package/src/Empty/assets/SimpleEmptySvg.tsx +0 -16
  108. package/src/Empty/index.tsx +0 -20
  109. package/src/Image.tsx +0 -29
  110. package/src/Input.tsx +0 -202
  111. package/src/InputNumber.test.tsx +0 -46
  112. package/src/InputNumber.tsx +0 -125
  113. package/src/Modal.tsx +0 -196
  114. package/src/Popconfirm.tsx +0 -75
  115. package/src/Popover.tsx +0 -30
  116. package/src/Progress.tsx +0 -4
  117. package/src/Radio.tsx +0 -132
  118. package/src/Result.tsx +0 -38
  119. package/src/Segmented/index.tsx +0 -95
  120. package/src/Select.tsx +0 -128
  121. package/src/Skeleton.tsx +0 -14
  122. package/src/Spin.tsx +0 -23
  123. package/src/Switch.tsx +0 -34
  124. package/src/Table.tsx +0 -53
  125. package/src/Tabs.tsx +0 -131
  126. package/src/Timeline.tsx +0 -33
  127. package/src/Tooltip.tsx +0 -355
  128. package/src/Tree.tsx +0 -246
  129. package/src/Upload.tsx +0 -10
  130. package/src/form/Form.tsx +0 -94
  131. package/src/form/FormItem.tsx +0 -139
  132. package/src/form/context.ts +0 -16
  133. package/src/form/index.ts +0 -13
  134. package/src/hooks/createControllableValue.ts +0 -68
  135. package/src/hooks/createUpdateEffect.ts +0 -16
  136. package/src/hooks/index.ts +0 -2
  137. package/src/hooks/useClickAway.ts +0 -18
  138. package/src/hooks/useSize.ts +0 -26
  139. package/src/index.ts +0 -44
  140. package/src/types/index.ts +0 -5
  141. package/src/utils/EventEmitter.ts +0 -15
  142. package/src/utils/ReactToSolid.tsx +0 -38
  143. package/src/utils/SolidToReact.tsx +0 -27
  144. package/src/utils/array.ts +0 -21
  145. package/src/utils/component.tsx +0 -85
  146. package/src/utils/solid.ts +0 -53
  147. /package/{dist → css}/index.css +0 -0
package/es/index.d.ts ADDED
@@ -0,0 +1,42 @@
1
+ export { default as Button } from './Button';
2
+ export { default as Input } from './Input';
3
+ export type { InputProps } from './Input';
4
+ export { default as InputNumber } from './InputNumber';
5
+ export type { InputNumberProps } from './InputNumber';
6
+ export { default as Timeline } from './Timeline';
7
+ export { default as Modal } from './Modal';
8
+ export type { ModalInstance } from './Modal';
9
+ export { default as DatePicker } from './DatePicker';
10
+ export { default as Select } from './Select';
11
+ export { default as Tree } from './Tree';
12
+ export type { TreeProps } from './Tree';
13
+ export { default as Popover } from './Popover';
14
+ export { default as Tooltip } from './Tooltip';
15
+ export { default as ColorPicker } from './ColorPicker';
16
+ export type { ColorPickerProps } from './ColorPicker';
17
+ export { default as Result } from './Result';
18
+ export { default as Progress } from './Progress';
19
+ export { default as Tabs } from './Tabs';
20
+ export type { TabsProps, Tab } from './Tabs';
21
+ export { default as Popconfirm } from './Popconfirm';
22
+ export { default as Upload } from './Upload';
23
+ export type { UploadProps, UploadFile } from './Upload';
24
+ export { default as Radio } from './Radio';
25
+ export type { RadioProps, RadioGroupProps } from './Radio';
26
+ export { default as Form } from './form';
27
+ export type { FormInstance, FormProps, FormItemProps, FormItemComponentProps } from './form';
28
+ export { default as Switch } from './Switch';
29
+ export type { SwitchProps } from './Switch';
30
+ export { default as Skeleton } from './Skeleton';
31
+ export { default as Spin } from './Spin';
32
+ export { default as Image } from './Image';
33
+ export { default as Table } from './Table';
34
+ export type { TableProps, TableColumn } from './Table';
35
+ export { default as Compact } from './Compact';
36
+ export type { CollapseProps, CollapseItem } from './Collapse';
37
+ export { default as Collapse } from './Collapse';
38
+ export { default as Empty } from './Empty';
39
+ export type { SegmentedProps } from './Segmented';
40
+ export { default as Segmented } from './Segmented';
41
+ export { default as createControllableValue } from './hooks/createControllableValue';
42
+ export { message } from 'antd';
package/es/index.js ADDED
@@ -0,0 +1,29 @@
1
+ export { default as Button } from './Button.js';
2
+ export { default as Input } from './Input.js';
3
+ export { default as InputNumber } from './InputNumber.js';
4
+ export { default as Timeline } from './Timeline.js';
5
+ export { default as Modal } from './Modal.js';
6
+ export { default as DatePicker } from './DatePicker.js';
7
+ export { default as Select } from './Select.js';
8
+ export { default as Tree } from './Tree.js';
9
+ export { default as Popover } from './Popover.js';
10
+ export { default as Tooltip } from './Tooltip.js';
11
+ export { default as ColorPicker } from './ColorPicker.js';
12
+ export { default as Result } from './Result.js';
13
+ export { default as Progress } from './Progress.js';
14
+ export { default as Tabs } from './Tabs.js';
15
+ export { default as Popconfirm } from './Popconfirm.js';
16
+ export { default as Upload } from './Upload.js';
17
+ export { default as Radio } from './Radio.js';
18
+ export { default as Form } from './form/index.js';
19
+ export { default as Switch } from './Switch.js';
20
+ export { default as Skeleton } from './Skeleton.js';
21
+ export { default as Spin } from './Spin.js';
22
+ export { default as Image } from './Image.js';
23
+ export { default as Table } from './Table.js';
24
+ export { default as Compact } from './Compact.js';
25
+ export { default as Collapse } from './Collapse/index.js';
26
+ export { default as Empty } from './Empty/index.js';
27
+ export { default as Segmented } from './Segmented/index.js';
28
+ export { default as createControllableValue } from './hooks/createControllableValue.js';
29
+ export { message } from 'antd';
@@ -0,0 +1,3 @@
1
+ import { type JSXElement } from 'solid-js';
2
+ export type Key = string | number;
3
+ export type StringOrJSXElement = string | number | undefined | null | (() => JSXElement);
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,7 @@
1
+ type Subscription<T> = (val: T) => void;
2
+ export default class EventEmitter<T> {
3
+ private readonly subscriptions;
4
+ emit: (val: T) => void;
5
+ subscription: (callback: Subscription<T>) => void;
6
+ }
7
+ export {};
@@ -0,0 +1,13 @@
1
+ class EventEmitter {
2
+ subscriptions = new Set();
3
+ emit = val => {
4
+ for (const subscription of this.subscriptions) {
5
+ subscription(val);
6
+ }
7
+ };
8
+ subscription = callback => {
9
+ this.subscriptions.add(callback);
10
+ };
11
+ }
12
+
13
+ export { EventEmitter as default };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface ReactToSolidProps<P extends {} = {}> {
3
+ component: React.FunctionComponent<P> | React.ComponentClass<P>;
4
+ props: P;
5
+ container?: Element;
6
+ }
7
+ declare function ReactToSolid<P extends {} = {}>(props: ReactToSolidProps<P>): import("solid-js").JSX.Element;
8
+ export default ReactToSolid;
@@ -0,0 +1,30 @@
1
+ import { template } from 'solid-js/web';
2
+ import React from 'react';
3
+ import { createRoot } from 'react-dom/client';
4
+ import { createMemo, onMount, onCleanup, createEffect } from 'solid-js';
5
+
6
+ const _tmpl$ = /*#__PURE__*/template(`<div role="ReactToSolid">`);
7
+ function ReactToSolid(props) {
8
+ let root;
9
+ const rootEle = createMemo(() => props.container ?? _tmpl$());
10
+ onMount(() => {
11
+ root = createRoot(rootEle());
12
+ onCleanup(() => {
13
+ root.unmount();
14
+ });
15
+ });
16
+ createEffect(() => {
17
+ root.render(React.createElement(props.component, {
18
+ ...props.props
19
+ }));
20
+ });
21
+ // if (import.meta.env.SSR) {
22
+ // // eslint-disable-next-line solid/reactivity
23
+ // const node = React.createElement(props.component, { ...props.props })
24
+ // // eslint-disable-next-line solid/components-return-once, solid/no-innerhtml
25
+ // return <div innerHTML={renderToString(node)} />
26
+ // }
27
+ return rootEle;
28
+ }
29
+
30
+ export { ReactToSolid as default };
@@ -0,0 +1,8 @@
1
+ import { type FunctionComponent, type ReactElement } from 'react';
2
+ import { type JSX } from 'solid-js';
3
+ export interface SolidToReactProps {
4
+ children?: JSX.Element;
5
+ container?: ReactElement;
6
+ }
7
+ declare const SolidToReact: FunctionComponent<SolidToReactProps>;
8
+ export default SolidToReact;
@@ -0,0 +1,23 @@
1
+ import React, { useRef, useEffect } from 'react';
2
+ import { render } from 'solid-js/web';
3
+
4
+ const SolidToReact = ({
5
+ children,
6
+ container
7
+ }) => {
8
+ const ref = useRef();
9
+ useEffect(() => render(() => children, ref.current), []);
10
+ // if (import.meta.env.SSR) {
11
+ // return React.createElement('div', {
12
+ // dangerouslySetInnerHTML: { __html: renderToString(() => children) },
13
+ // })
14
+ // }
15
+ return container ? React.cloneElement(container, {
16
+ ref
17
+ }) : React.createElement('div', {
18
+ ref,
19
+ role: 'SolidToReact'
20
+ });
21
+ };
22
+
23
+ export { SolidToReact as default };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 如果传入一个非数组字段,则将其转化为数组
3
+ * @param value
4
+ * @returns
5
+ */
6
+ export declare function toArray<T>(value: T | T[]): T[];
7
+ export interface StandardNode {
8
+ children?: this[];
9
+ }
10
+ /**
11
+ * 将数组中每个对象的 children 拍扁后返回
12
+ * @param nodes
13
+ * @returns
14
+ */
15
+ export declare function flatChildren<T extends StandardNode = StandardNode>(nodes: T[] | undefined): T[];
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 如果传入一个非数组字段,则将其转化为数组
3
+ * @param value
4
+ * @returns
5
+ */
6
+ function toArray(value) {
7
+ return Array.isArray(value) ? value : [value];
8
+ }
9
+ /**
10
+ * 将数组中每个对象的 children 拍扁后返回
11
+ * @param nodes
12
+ * @returns
13
+ */
14
+ function flatChildren(nodes) {
15
+ if (!nodes) return [];
16
+ return nodes.flatMap(node => [node, ...flatChildren(node.children)]);
17
+ }
18
+
19
+ export { flatChildren, toArray };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { type Component, type JSXElement } from 'solid-js';
3
+ import { type ConfigProviderProps } from 'antd/es/config-provider';
4
+ /**
5
+ * 将组件 props 中的 className 替换为 class
6
+ * @param C
7
+ * @returns
8
+ */
9
+ export declare function replaceClassName<T extends {
10
+ className?: string;
11
+ }, Target extends Omit<T, 'className'> & {
12
+ class?: string;
13
+ }>(C: Component<T>): Component<Target>;
14
+ /**
15
+ * 将组件 props 中的 children 替换为 JSXElement
16
+ * @param C
17
+ * @returns
18
+ */
19
+ export declare function replaceChildren<T extends {
20
+ children?: React.ReactNode;
21
+ }, Target extends Omit<T, 'children'> & {
22
+ children?: JSXElement;
23
+ }>(C: Component<T>): Component<Target>;
24
+ export declare function reactToSolidComponent<P extends {} = {}>(component: React.FunctionComponent<P> | React.ComponentClass<P>, container?: Element | (() => Element)): (props: P) => import("solid-js").JSX.Element;
25
+ /**
26
+ * 返回被 ConfigProvider 包裹后的 component
27
+ * @param component
28
+ * @param configProviderProps
29
+ * @returns
30
+ */
31
+ export declare function configProvider<P extends {} = {}>(component: React.FunctionComponent<P> | React.ComponentClass<P>, configProviderProps?: ConfigProviderProps): (props: P) => React.FunctionComponentElement<ConfigProviderProps>;
@@ -0,0 +1,68 @@
1
+ import { createComponent, mergeProps } from 'solid-js/web';
2
+ import React from 'react';
3
+ import { createMemo } from 'solid-js';
4
+ import { omit } from 'lodash-es';
5
+ import { solidToReact } from './solid.js';
6
+ import ReactToSolid from './ReactToSolid.js';
7
+ import { ConfigProvider } from 'antd';
8
+ import zhCN from './zh_CN.js';
9
+
10
+ /**
11
+ * 将组件 props 中的 className 替换为 class
12
+ * @param C
13
+ * @returns
14
+ */
15
+ function replaceClassName(C) {
16
+ return function (_props) {
17
+ const props = createMemo(() => {
18
+ return {
19
+ ...omit(_props, 'class'),
20
+ className: _props.class
21
+ };
22
+ });
23
+ return createComponent(C, mergeProps(props));
24
+ };
25
+ }
26
+ /**
27
+ * 将组件 props 中的 children 替换为 JSXElement
28
+ * @param C
29
+ * @returns
30
+ */
31
+ function replaceChildren(C) {
32
+ return function (_props) {
33
+ const props = createMemo(() => {
34
+ return {
35
+ ..._props,
36
+ children: solidToReact(_props.children)
37
+ };
38
+ });
39
+ return createComponent(C, mergeProps(props));
40
+ };
41
+ }
42
+ function reactToSolidComponent(component, container) {
43
+ return function (props) {
44
+ return createComponent(ReactToSolid, {
45
+ component: component,
46
+ props: props,
47
+ get container() {
48
+ return typeof container === 'function' ? container() : container;
49
+ }
50
+ });
51
+ };
52
+ }
53
+ /**
54
+ * 返回被 ConfigProvider 包裹后的 component
55
+ * @param component
56
+ * @param configProviderProps
57
+ * @returns
58
+ */
59
+ function configProvider(component, configProviderProps) {
60
+ return function (props) {
61
+ return React.createElement(ConfigProvider, {
62
+ locale: zhCN,
63
+ ...configProviderProps
64
+ }, React.createElement(component, props));
65
+ };
66
+ }
67
+
68
+ export { configProvider, reactToSolidComponent, replaceChildren, replaceClassName };
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type JSXElement, type JSX } from 'solid-js';
3
+ import { type StringOrJSXElement } from '../types';
4
+ /**
5
+ * 判断 JSXElement 是否是基础类型
6
+ * @param value JSXElement
7
+ * @returns
8
+ */
9
+ export declare function isBaseType(value: JSXElement): value is string | number | boolean | null | undefined;
10
+ export declare function solidToReact(children: JSXElement): number | boolean | (string & {}) | React.FunctionComponentElement<import("./SolidToReact").SolidToReactProps> | null | undefined;
11
+ export declare function dispatchEventHandlerUnion<T, E extends Event>(handler: JSX.EventHandlerUnion<T, E> | undefined, e: E & {
12
+ currentTarget: T;
13
+ target: Element;
14
+ }): void;
15
+ export declare function unwrapStringOrJSXElement(value: StringOrJSXElement): JSXElement;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+ import { isNil } from 'lodash-es';
3
+ import SolidToReact from './SolidToReact.js';
4
+
5
+ /**
6
+ * 判断 JSXElement 是否是基础类型
7
+ * @param value JSXElement
8
+ * @returns
9
+ */
10
+ function isBaseType(value) {
11
+ return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null || value === undefined;
12
+ }
13
+ function solidToReact(children) {
14
+ return isBaseType(children) ? children : React.createElement(SolidToReact, {
15
+ children
16
+ });
17
+ }
18
+ function dispatchEventHandlerUnion(handler, e) {
19
+ if (isNil(handler)) {
20
+ return;
21
+ }
22
+ if (typeof handler === 'function') {
23
+ handler(e);
24
+ return;
25
+ }
26
+ handler[0](handler[1], e);
27
+ }
28
+ function unwrapStringOrJSXElement(value) {
29
+ return typeof value === 'function' ? value() : value;
30
+ }
31
+
32
+ export { dispatchEventHandlerUnion, isBaseType, solidToReact, unwrapStringOrJSXElement };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("antd/es/locale").Locale | undefined;
2
+ export default _default;
@@ -1,6 +1,4 @@
1
- import { type ConfigProviderProps } from 'antd/es/config-provider'
2
-
3
- export default {
1
+ var zhCN = {
4
2
  locale: 'zh-cn',
5
3
  Pagination: {
6
4
  items_per_page: '条/页',
@@ -13,7 +11,7 @@ export default {
13
11
  next_5: '向后 5 页',
14
12
  prev_3: '向前 3 页',
15
13
  next_3: '向后 3 页',
16
- page_size: '页码',
14
+ page_size: '页码'
17
15
  },
18
16
  DatePicker: {
19
17
  lang: {
@@ -52,16 +50,16 @@ export default {
52
50
  previousDecade: '上一年代',
53
51
  nextDecade: '下一年代',
54
52
  previousCentury: '上一世纪',
55
- nextCentury: '下一世纪',
53
+ nextCentury: '下一世纪'
56
54
  },
57
55
  timePickerLocale: {
58
56
  placeholder: '请选择时间',
59
- rangePlaceholder: ['开始时间', '结束时间'],
60
- },
57
+ rangePlaceholder: ['开始时间', '结束时间']
58
+ }
61
59
  },
62
60
  TimePicker: {
63
61
  placeholder: '请选择时间',
64
- rangePlaceholder: ['开始时间', '结束时间'],
62
+ rangePlaceholder: ['开始时间', '结束时间']
65
63
  },
66
64
  Calendar: {
67
65
  lang: {
@@ -100,15 +98,15 @@ export default {
100
98
  previousDecade: '上一年代',
101
99
  nextDecade: '下一年代',
102
100
  previousCentury: '上一世纪',
103
- nextCentury: '下一世纪',
101
+ nextCentury: '下一世纪'
104
102
  },
105
103
  timePickerLocale: {
106
104
  placeholder: '请选择时间',
107
- rangePlaceholder: ['开始时间', '结束时间'],
108
- },
105
+ rangePlaceholder: ['开始时间', '结束时间']
106
+ }
109
107
  },
110
108
  global: {
111
- placeholder: '请选择',
109
+ placeholder: '请选择'
112
110
  },
113
111
  Table: {
114
112
  filterTitle: '筛选',
@@ -126,21 +124,21 @@ export default {
126
124
  collapse: '关闭行',
127
125
  triggerDesc: '点击降序',
128
126
  triggerAsc: '点击升序',
129
- cancelSort: '取消排序',
127
+ cancelSort: '取消排序'
130
128
  },
131
129
  Modal: {
132
130
  okText: '确定',
133
131
  cancelText: '取消',
134
- justOkText: '知道了',
132
+ justOkText: '知道了'
135
133
  },
136
134
  Tour: {
137
135
  Next: '下一步',
138
136
  Previous: '上一步',
139
- Finish: '结束导览',
137
+ Finish: '结束导览'
140
138
  },
141
139
  Popconfirm: {
142
140
  cancelText: '取消',
143
- okText: '确定',
141
+ okText: '确定'
144
142
  },
145
143
  Transfer: {
146
144
  titles: ['', ''],
@@ -152,29 +150,29 @@ export default {
152
150
  removeCurrent: '删除当页',
153
151
  selectAll: '全选所有',
154
152
  removeAll: '删除全部',
155
- selectInvert: '反选当页',
153
+ selectInvert: '反选当页'
156
154
  },
157
155
  Upload: {
158
156
  uploading: '文件上传中',
159
157
  removeFile: '删除文件',
160
158
  uploadError: '上传错误',
161
159
  previewFile: '预览文件',
162
- downloadFile: '下载文件',
160
+ downloadFile: '下载文件'
163
161
  },
164
162
  Empty: {
165
- description: '暂无数据',
163
+ description: '暂无数据'
166
164
  },
167
165
  Icon: {
168
- icon: '图标',
166
+ icon: '图标'
169
167
  },
170
168
  Text: {
171
169
  edit: '编辑',
172
170
  copy: '复制',
173
171
  copied: '复制成功',
174
- expand: '展开',
172
+ expand: '展开'
175
173
  },
176
174
  PageHeader: {
177
- back: '返回',
175
+ back: '返回'
178
176
  },
179
177
  Form: {
180
178
  optional: '(可选)',
@@ -186,7 +184,7 @@ export default {
186
184
  date: {
187
185
  format: '${label}日期格式无效',
188
186
  parse: '${label}不能转换为日期',
189
- invalid: '${label}是一个无效日期',
187
+ invalid: '${label}是一个无效日期'
190
188
  },
191
189
  types: {
192
190
  string: '${label}不是一个有效的${type}',
@@ -201,36 +199,38 @@ export default {
201
199
  regexp: '${label}不是一个有效的${type}',
202
200
  email: '${label}不是一个有效的${type}',
203
201
  url: '${label}不是一个有效的${type}',
204
- hex: '${label}不是一个有效的${type}',
202
+ hex: '${label}不是一个有效的${type}'
205
203
  },
206
204
  string: {
207
205
  len: '${label}须为${len}个字符',
208
206
  min: '${label}最少${min}个字符',
209
207
  max: '${label}最多${max}个字符',
210
- range: '${label}须在${min}-${max}字符之间',
208
+ range: '${label}须在${min}-${max}字符之间'
211
209
  },
212
210
  number: {
213
211
  len: '${label}必须等于${len}',
214
212
  min: '${label}最小值为${min}',
215
213
  max: '${label}最大值为${max}',
216
- range: '${label}须在${min}-${max}之间',
214
+ range: '${label}须在${min}-${max}之间'
217
215
  },
218
216
  array: {
219
217
  len: '须为${len}个${label}',
220
218
  min: '最少${min}个${label}',
221
219
  max: '最多${max}个${label}',
222
- range: '${label}数量须在${min}-${max}之间',
220
+ range: '${label}数量须在${min}-${max}之间'
223
221
  },
224
222
  pattern: {
225
- mismatch: '${label}与模式不匹配${pattern}',
226
- },
227
- },
223
+ mismatch: '${label}与模式不匹配${pattern}'
224
+ }
225
+ }
228
226
  },
229
227
  Image: {
230
- preview: '预览',
228
+ preview: '预览'
231
229
  },
232
230
  QRCode: {
233
231
  expired: '二维码过期',
234
- refresh: '点击刷新',
235
- },
236
- } as ConfigProviderProps['locale']
232
+ refresh: '点击刷新'
233
+ }
234
+ };
235
+
236
+ export { zhCN as default };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "antd-solid",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "",
5
- "main": "src/index.ts",
6
- "types": "src/index.ts",
5
+ "main": "es/index.js",
6
+ "types": "es/index.d.ts",
7
7
  "type": "module",
8
8
  "devDependencies": {
9
9
  "@iconify-json/ant-design": "^1.1.5",
@@ -67,14 +67,15 @@
67
67
  },
68
68
  "files": [
69
69
  "dist",
70
- "src"
70
+ "es",
71
+ "css"
71
72
  ],
72
73
  "scripts": {
73
74
  "docs:dev": "vitepress dev docs",
74
75
  "docs:build": "node scripts/annotationNonProductionCode && vitepress build docs && node scripts/cancelAnnotationNonProductionCode",
75
76
  "docs:preview": "vitepress preview docs",
76
- "build": "rm -rf dist && NODE_ENV=production && npx rollup -c && npm run build:unocss",
77
- "build:unocss": "npx unocss './src/**' -o dist/index.css -m",
77
+ "build": "rm -rf dist && rm -rf es && rm -rf css && NODE_ENV=production && npx rollup -c && npm run build:unocss",
78
+ "build:unocss": "npx unocss './src/**' -o css/index.css -m",
78
79
  "test": "vitest"
79
80
  }
80
81
  }