antd-solid 0.0.11 → 0.0.13
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.
- package/css/index.css +10 -73
- package/dist/index.esm.js +7802 -2378
- package/dist/index.umd.js +1 -1
- package/es/Alert/index.d.ts +10 -0
- package/es/Alert/index.js +26 -0
- package/es/Button/index.d.ts +32 -0
- package/es/Button/index.js +123 -0
- package/es/Button/index.scss.js +6 -0
- package/es/Checkbox/Group.d.ts +19 -0
- package/es/Checkbox/Group.js +49 -0
- package/es/Checkbox/index.d.ts +15 -0
- package/es/Checkbox/index.js +60 -0
- package/es/CodeInput/index.d.ts +18 -0
- package/es/CodeInput/index.js +72 -0
- package/es/Collapse/Item.d.ts +46 -0
- package/es/Collapse/Item.js +130 -0
- package/es/Collapse/context.d.ts +5 -0
- package/es/Collapse/context.js +8 -0
- package/es/Collapse/index.d.ts +25 -10
- package/es/Collapse/index.js +95 -74
- package/es/Collapse/utils.d.ts +8 -0
- package/es/Collapse/utils.js +35 -0
- package/es/ColorPicker/ColorPickerInput.d.ts +3 -0
- package/es/ColorPicker/ColorPickerInput.js +250 -0
- package/es/ColorPicker/ColorPickerSelect.d.ts +3 -0
- package/es/ColorPicker/ColorPickerSelect.js +71 -0
- package/es/ColorPicker/ColorPickerSlider.d.ts +3 -0
- package/es/ColorPicker/ColorPickerSlider.js +115 -0
- package/es/ColorPicker/color.d.ts +24 -0
- package/es/ColorPicker/color.js +63 -0
- package/es/ColorPicker/context.d.ts +9 -0
- package/es/ColorPicker/context.js +5 -0
- package/es/ColorPicker/index.d.ts +31 -0
- package/es/ColorPicker/index.js +139 -0
- package/es/Command/context.d.ts +9 -0
- package/es/Command/context.js +11 -0
- package/es/Command/createCommand.d.ts +17 -0
- package/es/Command/createCommand.js +112 -0
- package/es/Command/index.d.ts +7 -0
- package/es/Command/index.js +9 -0
- package/es/Command/useCommandProps.d.ts +13 -0
- package/es/Command/useCommandProps.js +28 -0
- package/es/Compact/CompactContextIsolator.d.ts +3 -0
- package/es/Compact/CompactContextIsolator.js +15 -0
- package/es/Compact/context.d.ts +4 -0
- package/es/Compact/context.js +7 -0
- package/es/Compact/index.d.ts +14 -0
- package/es/Compact/index.js +32 -0
- package/es/Compact/index.scss.js +6 -0
- package/es/ConfigProvider/context.d.ts +11 -0
- package/es/ConfigProvider/context.js +15 -0
- package/es/ConfigProvider/dark/colorAlgorithm.d.ts +2 -0
- package/es/ConfigProvider/dark/colorAlgorithm.js +9 -0
- package/es/ConfigProvider/dark/colors.d.ts +3 -0
- package/es/ConfigProvider/dark/colors.js +47 -0
- package/es/ConfigProvider/dark/index.d.ts +2 -0
- package/es/ConfigProvider/dark/index.js +11 -0
- package/es/ConfigProvider/index.d.ts +32 -0
- package/es/ConfigProvider/index.js +44 -0
- package/es/ConfigProvider/light/colorAlgorithm.d.ts +2 -0
- package/es/ConfigProvider/light/colorAlgorithm.js +9 -0
- package/es/ConfigProvider/light/colors.d.ts +3 -0
- package/es/ConfigProvider/light/colors.js +45 -0
- package/es/ConfigProvider/light/index.d.ts +2 -0
- package/es/ConfigProvider/light/index.js +11 -0
- package/es/ConfigProvider/seed.d.ts +3 -0
- package/es/ConfigProvider/seed.js +22 -0
- package/es/ConfigProvider/types/index.d.ts +594 -0
- package/es/ConfigProvider/types/index.js +1 -0
- package/es/ConfigProvider/utils/genColorMapToken.d.ts +7 -0
- package/es/ConfigProvider/utils/genColorMapToken.js +85 -0
- package/es/ConfigProvider/utils/getAlphaColor.d.ts +2 -0
- package/es/ConfigProvider/utils/getAlphaColor.js +44 -0
- package/es/ConfigProvider/utils/index.d.ts +3 -0
- package/es/ConfigProvider/utils/index.js +181 -0
- package/es/ContextMenu/index.d.ts +8 -0
- package/es/ContextMenu/index.js +99 -0
- package/es/Cursor/index.d.ts +6 -0
- package/es/Cursor/index.js +71 -0
- package/es/DelayShow/index.d.ts +16 -0
- package/es/DelayShow/index.js +27 -0
- package/es/Divider/index.d.ts +17 -0
- package/es/Divider/index.js +71 -0
- package/es/Drawer/index.d.ts +20 -16
- package/es/Drawer/index.js +162 -112
- package/es/Drawer/index.scss.js +1 -1
- package/es/Dropdown/index.d.ts +16 -0
- package/es/Dropdown/index.js +47 -0
- package/es/Element/index.d.ts +10 -0
- package/es/Element/index.js +42 -0
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.d.ts +2 -1
- package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +25 -9
- package/es/Empty/assets/EmptySvg.js +1 -1
- package/es/Empty/assets/SimpleEmptySvg.js +1 -1
- package/es/Empty/index.d.ts +9 -3
- package/es/Empty/index.js +24 -9
- package/es/Form/Form.d.ts +8 -5
- package/es/Form/Form.js +50 -34
- package/es/Form/FormItem.d.ts +10 -5
- package/es/Form/FormItem.js +121 -104
- package/es/Form/context.d.ts +9 -9
- package/es/Form/context.js +4 -2
- package/es/Fragment/index.d.ts +4 -0
- package/es/Fragment/index.js +7 -0
- package/es/Image/index.d.ts +10 -0
- package/es/Image/index.js +37 -0
- package/es/Input/TextArea.d.ts +23 -0
- package/es/Input/TextArea.js +84 -0
- package/es/Input/index.d.ts +44 -0
- package/es/Input/index.js +213 -0
- package/es/Input/index.scss.js +6 -0
- package/es/InputNumber/index.d.ts +30 -0
- package/es/InputNumber/index.js +122 -0
- package/es/{InputNumber.test.js → InputNumber/index.test.js} +2 -1
- package/es/Menu/InternalMenu.d.ts +22 -0
- package/es/Menu/InternalMenu.js +196 -0
- package/es/Menu/index.d.ts +75 -0
- package/es/Menu/index.js +64 -0
- package/es/Message/Message.d.ts +9 -0
- package/es/Message/Message.js +34 -0
- package/es/Message/index.d.ts +12 -0
- package/es/Message/index.js +80 -0
- package/es/Message/index.scss.js +6 -0
- package/es/Message/useMessage.d.ts +6 -0
- package/es/Message/useMessage.js +54 -0
- package/es/Modal/index.d.ts +73 -0
- package/es/Modal/index.js +237 -0
- package/es/Modal/index.scss.js +6 -0
- package/es/Modal/useModal.d.ts +5 -0
- package/es/Modal/useModal.js +51 -0
- package/es/Modal/warning.d.ts +5 -0
- package/es/Modal/warning.js +43 -0
- package/es/{Popconfirm.d.ts → Popconfirm/index.d.ts} +2 -2
- package/es/Popconfirm/index.js +62 -0
- package/es/{Popover.d.ts → Popover/index.d.ts} +2 -2
- package/es/{Popover.js → Popover/index.js} +7 -12
- package/es/Progress/Circle.d.ts +16 -0
- package/es/Progress/Circle.js +122 -0
- package/es/Progress/index.d.ts +6 -4
- package/es/Progress/index.js +75 -60
- package/es/Radio/Button.d.ts +7 -0
- package/es/Radio/Button.js +72 -0
- package/es/Radio/Group.d.ts +18 -0
- package/es/Radio/Group.js +57 -0
- package/es/Radio/index.d.ts +14 -0
- package/es/Radio/index.js +68 -0
- package/es/RangeInput/index.d.ts +23 -0
- package/es/RangeInput/index.js +208 -0
- package/es/Result/index.js +49 -0
- package/es/Segmented/index.d.ts +10 -7
- package/es/Segmented/index.js +54 -53
- package/es/Select/index.d.ts +17 -0
- package/es/Select/index.js +75 -0
- package/es/SelectInput/index.d.ts +39 -0
- package/es/SelectInput/index.js +245 -0
- package/es/Slider/index.d.ts +47 -0
- package/es/Slider/index.js +177 -0
- package/es/Space/index.d.ts +13 -0
- package/es/Space/index.js +16 -0
- package/es/Spin/index.d.ts +19 -0
- package/es/Spin/index.js +82 -0
- package/es/{Switch.d.ts → Switch/index.d.ts} +9 -0
- package/es/Switch/index.js +41 -0
- package/es/{Table.d.ts → Table/index.d.ts} +6 -2
- package/es/Table/index.js +71 -0
- package/es/Tabs/index.d.ts +49 -0
- package/es/Tabs/index.js +256 -0
- package/es/Timeline/index.js +31 -0
- package/es/Tooltip/context.d.ts +5 -0
- package/es/Tooltip/context.js +5 -0
- package/es/Tooltip/index.d.ts +64 -0
- package/es/Tooltip/index.js +499 -0
- package/es/Transformer/index.d.ts +88 -0
- package/es/Transformer/index.js +882 -0
- package/es/Tree/SingleLevelTree.d.ts +28 -0
- package/es/Tree/SingleLevelTree.js +299 -0
- package/es/Tree/index.d.ts +83 -0
- package/es/Tree/index.js +197 -0
- package/es/TreeFor/index.d.ts +31 -0
- package/es/TreeFor/index.js +80 -0
- package/es/TreeSelect/index.d.ts +26 -0
- package/es/TreeSelect/index.js +98 -0
- package/es/Upload/index.d.ts +64 -0
- package/es/Upload/index.js +112 -0
- package/es/assets/svg/ColorPickUp.d.ts +4 -0
- package/es/assets/svg/ColorPickUp.js +25 -0
- package/es/assets/svg/Crosshair.d.ts +7 -0
- package/es/assets/svg/Crosshair.js +51 -0
- package/es/assets/svg/Resize.d.ts +4 -0
- package/es/assets/svg/Resize.js +25 -0
- package/es/assets/svg/Rotate.d.ts +4 -0
- package/es/assets/svg/Rotate.js +20 -0
- package/es/assets/svg/RotateArrow.d.ts +4 -0
- package/es/assets/svg/RotateArrow.js +21 -0
- package/es/assets/svg/common.d.ts +2 -0
- package/es/assets/svg/common.js +9 -0
- package/es/hooks/createControllableValue.d.ts +1 -1
- package/es/hooks/createControllableValue.js +16 -17
- package/es/hooks/createTransition.d.ts +6 -2
- package/es/hooks/createTransition.js +12 -8
- package/es/hooks/useClickAway.d.ts +1 -1
- package/es/hooks/useClickAway.js +4 -3
- package/es/hooks/useComponentSize.d.ts +3 -0
- package/es/hooks/useComponentSize.js +12 -0
- package/es/hooks/useCounter.d.ts +12 -0
- package/es/hooks/useCounter.js +30 -0
- package/es/hooks/useFocus.d.ts +2 -0
- package/es/hooks/useFocus.js +24 -0
- package/es/hooks/useHover.d.ts +2 -0
- package/es/hooks/useHover.js +33 -0
- package/es/hooks/useLocale.d.ts +1 -0
- package/es/hooks/useLocale.js +11 -0
- package/es/hooks/useMouse.d.ts +1 -0
- package/es/hooks/useMouse.js +18 -0
- package/es/hooks/useScroll.d.ts +2 -0
- package/es/hooks/useScroll.js +29 -0
- package/es/hooks/useSize.d.ts +8 -2
- package/es/hooks/useSize.js +25 -13
- package/es/hooks/useVirtualList.d.ts +14 -0
- package/es/hooks/useVirtualList.js +45 -0
- package/es/index.d.ts +59 -8
- package/es/index.js +53 -23
- package/es/locale/en_US.d.ts +3 -0
- package/es/locale/en_US.js +9 -0
- package/es/locale/index.d.ts +5 -0
- package/es/locale/index.js +1 -0
- package/es/locale/zh_CN.d.ts +3 -0
- package/es/locale/zh_CN.js +9 -0
- package/es/types/index.d.ts +11 -2
- package/es/utils/animation.d.ts +6 -0
- package/es/utils/animation.js +20 -0
- package/es/utils/array.d.ts +2 -1
- package/es/utils/array.js +5 -1
- package/es/utils/domPoint.d.ts +7 -0
- package/es/utils/domPoint.js +11 -0
- package/es/utils/math.d.ts +17 -0
- package/es/utils/math.js +25 -0
- package/es/utils/number.d.ts +1 -0
- package/es/utils/number.js +14 -0
- package/es/utils/setupGlobalDrag.d.ts +10 -0
- package/es/utils/setupGlobalDrag.js +38 -0
- package/es/utils/solid.d.ts +2 -2
- package/es/utils/solid.js +7 -8
- package/package.json +10 -11
- package/es/Button.d.ts +0 -19
- package/es/Button.js +0 -73
- package/es/ColorPicker.d.ts +0 -8
- package/es/ColorPicker.js +0 -6
- package/es/Compact.d.ts +0 -12
- package/es/Compact.js +0 -17
- package/es/DatePicker.d.ts +0 -19
- package/es/DatePicker.js +0 -9
- package/es/Image.d.ts +0 -9
- package/es/Image.js +0 -22
- package/es/Input.d.ts +0 -29
- package/es/Input.js +0 -144
- package/es/InputNumber.d.ts +0 -11
- package/es/InputNumber.js +0 -92
- package/es/Modal.d.ts +0 -48
- package/es/Modal.js +0 -209
- package/es/Popconfirm.js +0 -64
- package/es/Radio.d.ts +0 -27
- package/es/Radio.js +0 -93
- package/es/Result.js +0 -29
- package/es/Select.d.ts +0 -16
- package/es/Select.js +0 -113
- package/es/Skeleton.d.ts +0 -9
- package/es/Skeleton.js +0 -9
- package/es/Spin.d.ts +0 -9
- package/es/Spin.js +0 -22
- package/es/Switch.js +0 -30
- package/es/Table.js +0 -57
- package/es/Tabs.d.ts +0 -17
- package/es/Tabs.js +0 -117
- package/es/Timeline.js +0 -30
- package/es/Tooltip.d.ts +0 -34
- package/es/Tooltip.js +0 -302
- package/es/Tree.d.ts +0 -28
- package/es/Tree.js +0 -198
- package/es/Upload.d.ts +0 -11
- package/es/Upload.js +0 -6
- package/es/hooks/createUpdateEffect.d.ts +0 -5
- package/es/hooks/createUpdateEffect.js +0 -12
- package/es/utils/EventEmitter.d.ts +0 -7
- package/es/utils/EventEmitter.js +0 -13
- package/es/utils/ReactToSolid.d.ts +0 -8
- package/es/utils/ReactToSolid.js +0 -30
- package/es/utils/SolidToReact.d.ts +0 -8
- package/es/utils/SolidToReact.js +0 -23
- package/es/utils/component.d.ts +0 -31
- package/es/utils/component.js +0 -68
- package/es/utils/zh_CN.d.ts +0 -2
- package/es/utils/zh_CN.js +0 -236
- package/src/Button.tsx +0 -128
- package/src/Collapse/index.tsx +0 -86
- package/src/ColorPicker.tsx +0 -11
- package/src/Compact.tsx +0 -15
- package/src/DatePicker.tsx +0 -30
- package/src/Drawer/index.scss +0 -53
- package/src/Drawer/index.tsx +0 -212
- package/src/Empty/PRESENTED_IMAGE_SIMPLE.tsx +0 -15
- package/src/Empty/assets/EmptySvg.tsx +0 -43
- package/src/Empty/assets/SimpleEmptySvg.tsx +0 -16
- package/src/Empty/index.tsx +0 -20
- package/src/Form/Form.tsx +0 -94
- package/src/Form/FormItem.tsx +0 -141
- package/src/Form/context.ts +0 -16
- package/src/Form/index.ts +0 -13
- package/src/Image.tsx +0 -29
- package/src/Input.tsx +0 -202
- package/src/InputNumber.test.tsx +0 -46
- package/src/InputNumber.tsx +0 -125
- package/src/Modal.tsx +0 -220
- package/src/Popconfirm.tsx +0 -75
- package/src/Popover.tsx +0 -30
- package/src/Progress/index.tsx +0 -73
- package/src/Radio.tsx +0 -142
- package/src/Result.tsx +0 -38
- package/src/Segmented/index.tsx +0 -95
- package/src/Select.tsx +0 -128
- package/src/Skeleton.tsx +0 -14
- package/src/Spin.tsx +0 -23
- package/src/Switch.tsx +0 -34
- package/src/Table.tsx +0 -53
- package/src/Tabs.tsx +0 -131
- package/src/Timeline.tsx +0 -33
- package/src/Tooltip.tsx +0 -340
- package/src/Tree.tsx +0 -246
- package/src/Upload.tsx +0 -10
- package/src/hooks/createControllableValue.ts +0 -68
- package/src/hooks/createTransition.ts +0 -52
- package/src/hooks/createUpdateEffect.ts +0 -16
- package/src/hooks/index.ts +0 -2
- package/src/hooks/useClickAway.ts +0 -18
- package/src/hooks/useSize.ts +0 -26
- package/src/index.ts +0 -47
- package/src/types/index.ts +0 -5
- package/src/utils/EventEmitter.ts +0 -15
- package/src/utils/ReactToSolid.tsx +0 -38
- package/src/utils/SolidToReact.tsx +0 -27
- package/src/utils/array.ts +0 -21
- package/src/utils/component.tsx +0 -85
- package/src/utils/solid.ts +0 -61
- package/src/utils/zh_CN.ts +0 -236
- /package/es/{InputNumber.test.d.ts → InputNumber/index.test.d.ts} +0 -0
- /package/es/{Result.d.ts → Result/index.d.ts} +0 -0
- /package/es/{Timeline.d.ts → Timeline/index.d.ts} +0 -0
package/es/Drawer/index.js
CHANGED
|
@@ -1,31 +1,52 @@
|
|
|
1
|
-
import { delegateEvents, createComponent,
|
|
2
|
-
import { mergeProps,
|
|
1
|
+
import { delegateEvents, createComponent, Dynamic, effect, className, insert, Portal, template } from 'solid-js/web';
|
|
2
|
+
import { mergeProps, createEffect, onCleanup, createMemo, Show } from 'solid-js';
|
|
3
3
|
import cs from 'classnames';
|
|
4
|
-
import Button from '../Button.js';
|
|
5
|
-
import { setRef } from '../utils/solid.js';
|
|
6
4
|
import { Transition } from 'solid-transition-group';
|
|
5
|
+
import Button from '../Button/index.js';
|
|
7
6
|
import './index.scss.js';
|
|
8
7
|
import createTransition from '../hooks/createTransition.js';
|
|
8
|
+
import Element from '../Element/index.js';
|
|
9
|
+
import DelayShow from '../DelayShow/index.js';
|
|
10
|
+
import createControllableValue from '../hooks/createControllableValue.js';
|
|
11
|
+
import { unwrapStringOrJSXElement } from '../utils/solid.js';
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
_tmpl$2 = /*#__PURE__*/template(`<
|
|
13
|
+
var _tmpl$ = /*#__PURE__*/template(`<div aria-label=mask>`),
|
|
14
|
+
_tmpl$2 = /*#__PURE__*/template(`<span class=i-ant-design:close-outlined>`),
|
|
15
|
+
_tmpl$3 = /*#__PURE__*/template(`<div class="w-full text-[var(--ant-color-text)] text-size-[var(--ant-font-size-lg)] [font-weight:var(--ant-font-weight-strong)] leading-[var(--ant-line-height-lg)]">`),
|
|
16
|
+
_tmpl$4 = /*#__PURE__*/template(`<div class=shrink-0>`),
|
|
17
|
+
_tmpl$5 = /*#__PURE__*/template(`<div><div class="px-[var(--ant-padding-lg)] py-[var(--ant-padding)] flex items-center [border-bottom:var(--ant-line-width)_solid_var(--ant-color-split)] empty:hidden"></div><div class="p-[--ant-drawer-body-padding] overflow-auto">`);
|
|
12
18
|
const Drawer = _props => {
|
|
13
19
|
const props = mergeProps({
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
size: '378px',
|
|
21
|
+
mask: true,
|
|
16
22
|
maskClosable: true,
|
|
23
|
+
closeIcon: true,
|
|
24
|
+
destroyOnClose: false,
|
|
25
|
+
closeOnEsc: true,
|
|
17
26
|
placement: 'right',
|
|
18
27
|
getContainer: document.body
|
|
19
28
|
}, _props);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const [open] = createControllableValue(props, {
|
|
30
|
+
defaultValuePropName: 'defaultOpen',
|
|
31
|
+
valuePropName: 'open',
|
|
32
|
+
trigger: null
|
|
33
|
+
});
|
|
34
|
+
createEffect(() => {
|
|
35
|
+
if (!open()) return;
|
|
36
|
+
const originOverflow = document.body.style.overflow;
|
|
37
|
+
document.body.style.overflow = 'hidden';
|
|
38
|
+
if (!props.closeOnEsc) return;
|
|
39
|
+
const onKeyup = e => {
|
|
40
|
+
if (e.key === 'Escape') {
|
|
41
|
+
props.onClose?.();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
document.addEventListener('keyup', onKeyup);
|
|
45
|
+
onCleanup(() => {
|
|
46
|
+
document.body.style.overflow = originOverflow;
|
|
47
|
+
document.removeEventListener('keyup', onKeyup);
|
|
48
|
+
});
|
|
49
|
+
});
|
|
29
50
|
const container = createMemo(() => {
|
|
30
51
|
if (typeof props.getContainer === 'function') {
|
|
31
52
|
return props.getContainer();
|
|
@@ -36,124 +57,153 @@ const Drawer = _props => {
|
|
|
36
57
|
return undefined;
|
|
37
58
|
});
|
|
38
59
|
const isBody = createMemo(() => container() === document.body);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
untrack(() => {
|
|
44
|
-
if (!isBody()) return;
|
|
45
|
-
const originOverflow = document.body.style.overflow;
|
|
46
|
-
document.body.style.overflow = 'hidden';
|
|
47
|
-
const onKeyup = e => {
|
|
48
|
-
if (e.key === 'Escape') {
|
|
49
|
-
instance.close();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
document.addEventListener('keyup', onKeyup);
|
|
53
|
-
cleanup = () => {
|
|
54
|
-
document.body.style.overflow = originOverflow;
|
|
55
|
-
document.removeEventListener('keyup', onKeyup);
|
|
56
|
-
};
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
close() {
|
|
60
|
-
untrack(() => {
|
|
61
|
-
if (props.destroyOnClose) {
|
|
62
|
-
setOpen(false);
|
|
63
|
-
} else {
|
|
64
|
-
setHide(true);
|
|
65
|
-
}
|
|
66
|
-
cleanup?.();
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
setRef(props, instance);
|
|
71
|
-
let drawer;
|
|
72
|
-
createTransition(() => drawer, () => !hide(), 'ant-drawer-fade');
|
|
60
|
+
let drawerRef;
|
|
61
|
+
createTransition(() => drawerRef, open, {
|
|
62
|
+
name: 'ant-drawer-fade'
|
|
63
|
+
});
|
|
73
64
|
const direction = createMemo(() => ['top', 'bottom'].includes(props.placement) ? 'vertical' : 'horizontal');
|
|
65
|
+
const title = createMemo(() => unwrapStringOrJSXElement(props.title));
|
|
66
|
+
const extra = createMemo(() => unwrapStringOrJSXElement(props.extra));
|
|
74
67
|
const children = createComponent(Transition, {
|
|
75
68
|
name: "ant-drawer-fade",
|
|
69
|
+
onEnter: (el, done) => {
|
|
70
|
+
el.animate([], {
|
|
71
|
+
duration: 300
|
|
72
|
+
}).finished.finally(done);
|
|
73
|
+
},
|
|
74
|
+
onExit: (el, done) => {
|
|
75
|
+
el.animate([], {
|
|
76
|
+
duration: 300
|
|
77
|
+
}).finished.finally(done);
|
|
78
|
+
},
|
|
76
79
|
get children() {
|
|
77
|
-
return createComponent(
|
|
80
|
+
return createComponent(Dynamic, {
|
|
81
|
+
get component() {
|
|
82
|
+
return props.destroyOnClose ? Show : DelayShow;
|
|
83
|
+
},
|
|
78
84
|
get when() {
|
|
79
85
|
return open();
|
|
80
86
|
},
|
|
81
87
|
get children() {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
typeof _ref$ === "function" ? use(_ref$, _el$) : drawer = _el$;
|
|
96
|
-
_el$2.$$click = e => {
|
|
97
|
-
e.stopPropagation();
|
|
98
|
-
};
|
|
99
|
-
insert(_el$4, createComponent(Show, {
|
|
100
|
-
get when() {
|
|
101
|
-
return props.closeIcon !== false;
|
|
88
|
+
return createComponent(Element, {
|
|
89
|
+
ref(r$) {
|
|
90
|
+
var _ref$ = drawerRef;
|
|
91
|
+
typeof _ref$ === "function" ? _ref$(r$) : drawerRef = r$;
|
|
92
|
+
},
|
|
93
|
+
get ["class"]() {
|
|
94
|
+
return cs(props.class, '[font-size:var(--ant-font-size)] text-[var(--ant-color-text)] leading-[var(--ant-line-height)]', 'inset-0 z-1000', isBody() ? 'fixed' : 'absolute');
|
|
95
|
+
},
|
|
96
|
+
get style() {
|
|
97
|
+
return {
|
|
98
|
+
'--ant-drawer-body-padding': 'var(--ant-padding-lg)',
|
|
99
|
+
...props.style
|
|
100
|
+
};
|
|
102
101
|
},
|
|
103
102
|
get children() {
|
|
104
|
-
return createComponent(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
"class": "ant-mr-[var(--ant-margin-sm)] ant-text-size-[var(--ant-font-size-lg)] ant-h-[var(--ant-font-size-lg)] ant-leading-[var(--ant-font-size-lg)] hover:!ant-bg-transparent !ant-text-[var(--ant-color-icon)] hover:!ant-text-[var(--ant-color-icon-hover)]",
|
|
108
|
-
onClick: () => {
|
|
109
|
-
instance?.close();
|
|
103
|
+
return [createComponent(Show, {
|
|
104
|
+
get when() {
|
|
105
|
+
return props.mask;
|
|
110
106
|
},
|
|
111
107
|
get children() {
|
|
112
|
-
|
|
108
|
+
var _el$ = _tmpl$();
|
|
109
|
+
_el$.$$click = () => {
|
|
110
|
+
if (props.maskClosable) {
|
|
111
|
+
props.onClose?.();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
effect(() => className(_el$, cs('ant-drawer-mask', 'absolute inset-0 bg-[--ant-color-bg-mask]')));
|
|
115
|
+
return _el$;
|
|
113
116
|
}
|
|
114
|
-
})
|
|
117
|
+
}), (() => {
|
|
118
|
+
var _el$2 = _tmpl$5(),
|
|
119
|
+
_el$3 = _el$2.firstChild,
|
|
120
|
+
_el$7 = _el$3.nextSibling;
|
|
121
|
+
_el$2.$$click = e => {
|
|
122
|
+
e.stopPropagation();
|
|
123
|
+
};
|
|
124
|
+
insert(_el$3, createComponent(Show, {
|
|
125
|
+
get when() {
|
|
126
|
+
return props.closeIcon;
|
|
127
|
+
},
|
|
128
|
+
get children() {
|
|
129
|
+
return createComponent(Button, {
|
|
130
|
+
type: "text",
|
|
131
|
+
size: "small",
|
|
132
|
+
"class": "shrink-0 mr-[var(--ant-margin-sm)] text-size-[var(--ant-font-size-lg)] h-[var(--ant-font-size-lg)] leading-[var(--ant-font-size-lg)] hover:!bg-transparent !text-[var(--ant-color-icon)] hover:!text-[var(--ant-color-icon-hover)] !p-0",
|
|
133
|
+
onClick: () => {
|
|
134
|
+
props.onClose?.();
|
|
135
|
+
},
|
|
136
|
+
get children() {
|
|
137
|
+
return _tmpl$2();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}), null);
|
|
142
|
+
insert(_el$3, createComponent(Show, {
|
|
143
|
+
get when() {
|
|
144
|
+
return title();
|
|
145
|
+
},
|
|
146
|
+
get children() {
|
|
147
|
+
var _el$5 = _tmpl$3();
|
|
148
|
+
insert(_el$5, title);
|
|
149
|
+
return _el$5;
|
|
150
|
+
}
|
|
151
|
+
}), null);
|
|
152
|
+
insert(_el$3, createComponent(Show, {
|
|
153
|
+
get when() {
|
|
154
|
+
return extra();
|
|
155
|
+
},
|
|
156
|
+
get children() {
|
|
157
|
+
var _el$6 = _tmpl$4();
|
|
158
|
+
insert(_el$6, extra);
|
|
159
|
+
return _el$6;
|
|
160
|
+
}
|
|
161
|
+
}), null);
|
|
162
|
+
insert(_el$7, () => props.children);
|
|
163
|
+
effect(_p$ => {
|
|
164
|
+
var _v$ = cs('ant-drawer-content', {
|
|
165
|
+
left: 'ant-drawer-content-left',
|
|
166
|
+
right: 'ant-drawer-content-right',
|
|
167
|
+
top: 'ant-drawer-content-top',
|
|
168
|
+
bottom: 'ant-drawer-content-bottom'
|
|
169
|
+
}[props.placement], 'absolute bg-[--ant-color-bg-container-secondary] grid [grid-template-rows:auto_1fr]'),
|
|
170
|
+
_v$2 = direction() === 'horizontal' ? props.size : undefined,
|
|
171
|
+
_v$3 = direction() === 'vertical' ? props.size : undefined;
|
|
172
|
+
_v$ !== _p$.e && className(_el$2, _p$.e = _v$);
|
|
173
|
+
_v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$2.style.setProperty("width", _v$2) : _el$2.style.removeProperty("width"));
|
|
174
|
+
_v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$2.style.setProperty("height", _v$3) : _el$2.style.removeProperty("height"));
|
|
175
|
+
return _p$;
|
|
176
|
+
}, {
|
|
177
|
+
e: undefined,
|
|
178
|
+
t: undefined,
|
|
179
|
+
a: undefined
|
|
180
|
+
});
|
|
181
|
+
return _el$2;
|
|
182
|
+
})()];
|
|
115
183
|
}
|
|
116
|
-
}), _el$6);
|
|
117
|
-
insert(_el$6, () => props.title);
|
|
118
|
-
insert(_el$7, () => props.extra);
|
|
119
|
-
insert(_el$8, () => props.children);
|
|
120
|
-
effect(_p$ => {
|
|
121
|
-
const _v$ = cs('ant-inset-0 ant-bg-[rgba(0,0,0,.45)] ant-z-1000', isBody() ? 'ant-fixed' : 'ant-absolute'),
|
|
122
|
-
_v$2 = cs('ant-drawer-content', {
|
|
123
|
-
left: 'ant-drawer-content-left',
|
|
124
|
-
right: 'ant-drawer-content-right',
|
|
125
|
-
top: 'ant-drawer-content-top',
|
|
126
|
-
bottom: 'ant-drawer-content-bottom'
|
|
127
|
-
}[props.placement], 'ant-absolute ant-bg-white ant-grid ant-[grid-template-rows:auto_1fr]'),
|
|
128
|
-
_v$3 = direction() === 'horizontal' ? props.width : undefined,
|
|
129
|
-
_v$4 = direction() === 'vertical' ? props.height : undefined;
|
|
130
|
-
_v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
|
|
131
|
-
_v$2 !== _p$._v$2 && className(_el$2, _p$._v$2 = _v$2);
|
|
132
|
-
_v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$2.style.setProperty("width", _v$3) : _el$2.style.removeProperty("width"));
|
|
133
|
-
_v$4 !== _p$._v$4 && ((_p$._v$4 = _v$4) != null ? _el$2.style.setProperty("height", _v$4) : _el$2.style.removeProperty("height"));
|
|
134
|
-
return _p$;
|
|
135
|
-
}, {
|
|
136
|
-
_v$: undefined,
|
|
137
|
-
_v$2: undefined,
|
|
138
|
-
_v$3: undefined,
|
|
139
|
-
_v$4: undefined
|
|
140
184
|
});
|
|
141
|
-
return _el$;
|
|
142
185
|
}
|
|
143
186
|
});
|
|
144
187
|
}
|
|
145
188
|
});
|
|
146
|
-
return createComponent(
|
|
189
|
+
return createComponent(DelayShow, {
|
|
147
190
|
get when() {
|
|
148
|
-
return
|
|
191
|
+
return open();
|
|
149
192
|
},
|
|
150
|
-
fallback: children,
|
|
151
193
|
get children() {
|
|
152
|
-
return createComponent(
|
|
153
|
-
get
|
|
154
|
-
return
|
|
194
|
+
return createComponent(Show, {
|
|
195
|
+
get when() {
|
|
196
|
+
return props.getContainer !== false;
|
|
155
197
|
},
|
|
156
|
-
|
|
198
|
+
fallback: children,
|
|
199
|
+
get children() {
|
|
200
|
+
return createComponent(Portal, {
|
|
201
|
+
get mount() {
|
|
202
|
+
return container();
|
|
203
|
+
},
|
|
204
|
+
children: children
|
|
205
|
+
});
|
|
206
|
+
}
|
|
157
207
|
});
|
|
158
208
|
}
|
|
159
209
|
});
|
package/es/Drawer/index.scss.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../node_modules/.pnpm/style-inject@0.3.0/node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".ant-drawer-content-right {\n top: 0;\n bottom: 0;\n right: 0;\n}\n\n.ant-drawer-content-left {\n top: 0;\n bottom: 0;\n left: 0;\n}\n\n.ant-drawer-content-top {\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-content-bottom {\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-fade-enter-active,\n.ant-drawer-fade-exit-active {\n transition: opacity 0.3s;\n}\n.ant-drawer-fade-enter-active .ant-drawer-content,\n.ant-drawer-fade-exit-active .ant-drawer-content {\n transition: transform 0.3s;\n}\n\n.ant-drawer-fade-enter,\n.ant-drawer-fade-exit-to {\n opacity: 0;\n}\n.ant-drawer-fade-enter .ant-drawer-content-right,\n.ant-drawer-fade-exit-to .ant-drawer-content-right {\n transform: translateX(100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-left,\n.ant-drawer-fade-exit-to .ant-drawer-content-left {\n transform: translateX(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-top,\n.ant-drawer-fade-exit-to .ant-drawer-content-top {\n transform: translateY(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-bottom,\n.ant-drawer-fade-exit-to .ant-drawer-content-bottom {\n transform: translateY(100%);\n}";
|
|
3
|
+
var css_248z = ".ant-drawer-content-right {\n top: 0;\n bottom: 0;\n right: 0;\n}\n\n.ant-drawer-content-left {\n top: 0;\n bottom: 0;\n left: 0;\n}\n\n.ant-drawer-content-top {\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-content-bottom {\n bottom: 0;\n left: 0;\n right: 0;\n}\n\n.ant-drawer-fade-enter-active .ant-drawer-mask,\n.ant-drawer-fade-exit-active .ant-drawer-mask {\n transition: opacity 0.3s;\n}\n.ant-drawer-fade-enter-active .ant-drawer-content,\n.ant-drawer-fade-exit-active .ant-drawer-content {\n transition: transform 0.3s;\n}\n\n.ant-drawer-fade-enter .ant-drawer-mask,\n.ant-drawer-fade-exit-to .ant-drawer-mask {\n opacity: 0;\n}\n.ant-drawer-fade-enter .ant-drawer-content-right,\n.ant-drawer-fade-exit-to .ant-drawer-content-right {\n transform: translateX(100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-left,\n.ant-drawer-fade-exit-to .ant-drawer-content-left {\n transform: translateX(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-top,\n.ant-drawer-fade-exit-to .ant-drawer-content-top {\n transform: translateY(-100%);\n}\n.ant-drawer-fade-enter .ant-drawer-content-bottom,\n.ant-drawer-fade-exit-to .ant-drawer-content-bottom {\n transform: translateY(100%);\n}";
|
|
4
4
|
styleInject(css_248z);
|
|
5
5
|
|
|
6
6
|
export { css_248z as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Component } from 'solid-js';
|
|
2
|
+
import { type PopoverProps } from '../Popover';
|
|
3
|
+
import { type MenuProps } from '../Menu';
|
|
4
|
+
export interface DropdownProps extends Omit<PopoverProps, 'placement'> {
|
|
5
|
+
/**
|
|
6
|
+
* 菜单配置项
|
|
7
|
+
*/
|
|
8
|
+
menu: MenuProps;
|
|
9
|
+
/**
|
|
10
|
+
* 菜单弹出位置
|
|
11
|
+
* 默认 'bottomLeft'
|
|
12
|
+
*/
|
|
13
|
+
placement?: 'top' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight';
|
|
14
|
+
}
|
|
15
|
+
declare const Dropdown: Component<DropdownProps>;
|
|
16
|
+
export default Dropdown;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
2
|
+
import { mergeProps, splitProps, children } from 'solid-js';
|
|
3
|
+
import Popover from '../Popover/index.js';
|
|
4
|
+
import Menu from '../Menu/index.js';
|
|
5
|
+
import 'lodash-es';
|
|
6
|
+
import useSize from '../hooks/useSize.js';
|
|
7
|
+
|
|
8
|
+
const Dropdown = _props => {
|
|
9
|
+
const props = mergeProps({
|
|
10
|
+
placement: 'bottomLeft'
|
|
11
|
+
}, _props);
|
|
12
|
+
const [, popoverProps] = splitProps(props, ['menu']);
|
|
13
|
+
const resolvedChildren = children(() => _props.children);
|
|
14
|
+
const size = useSize(() => {
|
|
15
|
+
const _children = resolvedChildren();
|
|
16
|
+
return _children instanceof HTMLElement ? _children : undefined;
|
|
17
|
+
}, 'offset');
|
|
18
|
+
return createComponent(Popover, mergeProps$1({
|
|
19
|
+
get arrow() {
|
|
20
|
+
return props.arrow ?? false;
|
|
21
|
+
},
|
|
22
|
+
content: close => createComponent(Menu, mergeProps$1({
|
|
23
|
+
selectable: false
|
|
24
|
+
}, () => props.menu, {
|
|
25
|
+
get style() {
|
|
26
|
+
return {
|
|
27
|
+
'--ant-menu-item-height': '32px',
|
|
28
|
+
'min-width': `${size()?.width ?? 0}px`,
|
|
29
|
+
...props.menu.style
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
onClick: info => {
|
|
33
|
+
close();
|
|
34
|
+
props.menu?.onClick?.(info);
|
|
35
|
+
}
|
|
36
|
+
})),
|
|
37
|
+
contentStyle: {
|
|
38
|
+
padding: 0
|
|
39
|
+
}
|
|
40
|
+
}, popoverProps, {
|
|
41
|
+
get children() {
|
|
42
|
+
return resolvedChildren();
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { Dropdown as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX, type ParentProps } from 'solid-js';
|
|
2
|
+
import { type StyleProps } from '../types';
|
|
3
|
+
export type ElementProps<T = JSX.HTMLAttributes<HTMLDivElement>> = T & StyleProps & ParentProps & {
|
|
4
|
+
/**
|
|
5
|
+
* 默认 'div'
|
|
6
|
+
*/
|
|
7
|
+
tag?: string;
|
|
8
|
+
};
|
|
9
|
+
declare function Element<T = JSX.HTMLAttributes<HTMLDivElement>>(_props: ElementProps<T>): JSX.Element;
|
|
10
|
+
export default Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createComponent, Dynamic, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
2
|
+
import { mergeProps, useContext, onMount } from 'solid-js';
|
|
3
|
+
import cs from 'classnames';
|
|
4
|
+
import ConfigProviderContext from '../ConfigProvider/context.js';
|
|
5
|
+
|
|
6
|
+
function Element(_props) {
|
|
7
|
+
const props = mergeProps({
|
|
8
|
+
tag: 'div'
|
|
9
|
+
}, _props);
|
|
10
|
+
const {
|
|
11
|
+
theme,
|
|
12
|
+
cssVariablesClass,
|
|
13
|
+
cssVariables
|
|
14
|
+
} = useContext(ConfigProviderContext);
|
|
15
|
+
onMount(() => {
|
|
16
|
+
let styleTag = document.head.querySelector(`[data-token-hash=${cssVariablesClass}]`);
|
|
17
|
+
if (styleTag) return;
|
|
18
|
+
styleTag = document.createElement('style');
|
|
19
|
+
styleTag.setAttribute('type', 'text/css');
|
|
20
|
+
styleTag.setAttribute('data-token-hash', cssVariablesClass);
|
|
21
|
+
const cssVariablesStr = Object.entries(cssVariables()).map(([key, value]) => `${key}: ${value};`).join('\n');
|
|
22
|
+
styleTag.innerHTML = `
|
|
23
|
+
.${cssVariablesClass} {
|
|
24
|
+
${theme() === 'dark' ? 'color-scheme: dark;' : ''}
|
|
25
|
+
|
|
26
|
+
${cssVariablesStr}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
document.head.appendChild(styleTag);
|
|
30
|
+
});
|
|
31
|
+
return createComponent(Dynamic, mergeProps$1({
|
|
32
|
+
get component() {
|
|
33
|
+
return props.tag;
|
|
34
|
+
}
|
|
35
|
+
}, props, {
|
|
36
|
+
get ["class"]() {
|
|
37
|
+
return cs(cssVariablesClass, props.class);
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { Element as default };
|
|
@@ -1,14 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, insert, template } from 'solid-js/web';
|
|
2
|
+
import cs from 'classnames';
|
|
2
3
|
import EmptySvg from './assets/SimpleEmptySvg.js';
|
|
4
|
+
import Element from '../Element/index.js';
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/template(`<div class="mb-[var(--ant-margin-xs)] flex justify-center">`),
|
|
7
|
+
_tmpl$2 = /*#__PURE__*/template(`<div class="text-[var(--ant-color-text-description)] text-center">`);
|
|
8
|
+
const PRESENTED_IMAGE_SIMPLE = props => {
|
|
9
|
+
return createComponent(Element, {
|
|
10
|
+
get ["class"]() {
|
|
11
|
+
return cs('my-[var(--ant-margin-xl)] mx-[var(--ant-margin-xs)]', props.class);
|
|
12
|
+
},
|
|
13
|
+
get style() {
|
|
14
|
+
return props.style;
|
|
15
|
+
},
|
|
16
|
+
get children() {
|
|
17
|
+
return [(() => {
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
insert(_el$, createComponent(EmptySvg, {}));
|
|
20
|
+
return _el$;
|
|
21
|
+
})(), (() => {
|
|
22
|
+
var _el$2 = _tmpl$2();
|
|
23
|
+
insert(_el$2, () => props.description ?? '暂无数据');
|
|
24
|
+
return _el$2;
|
|
25
|
+
})()];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
12
28
|
};
|
|
13
29
|
|
|
14
30
|
export { PRESENTED_IMAGE_SIMPLE as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { template } from 'solid-js/web';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _tmpl$ = /*#__PURE__*/template(`<svg width=184 height=100 viewBox="0 0 184 152"xmlns=http://www.w3.org/2000/svg><g fill=none fill-rule=evenodd><g transform="translate(24 31.67)"><ellipse fill-opacity=.8 fill=#F5F5F7 cx=67.797 cy=106.89 rx=67.797 ry=12.668></ellipse><path 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"fill=#AEB8C2></path><path 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"fill=url(#linearGradient-1) transform=translate(13.56)></path><path 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"fill=#F5F5F7></path><path 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"fill=#DCE0E6></path></g><path 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"fill=#DCE0E6></path><g transform="translate(149.65 15.383)"fill=#FFF><ellipse cx=20.654 cy=3.167 rx=2.849 ry=2.815></ellipse><path d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z">`);
|
|
4
4
|
const EmptySvg = () => _tmpl$();
|
|
5
5
|
|
|
6
6
|
export { EmptySvg as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { template } from 'solid-js/web';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
var _tmpl$ = /*#__PURE__*/template(`<svg width=64 height=41 viewBox="0 0 64 41"xmlns=http://www.w3.org/2000/svg><g transform="translate(0 1)"fill=none fill-rule=evenodd><ellipse fill=#f5f5f5 cx=32 cy=33 rx=32 ry=7></ellipse><g fill-rule=nonzero stroke=#d9d9d9><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"></path><path 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"fill=#fafafa>`);
|
|
4
4
|
const EmptySvg = () => _tmpl$();
|
|
5
5
|
|
|
6
6
|
export { EmptySvg as default };
|
package/es/Empty/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { type Component } from 'solid-js';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type JSXElement, type Component, type JSX } from 'solid-js';
|
|
2
|
+
import PRESENTED_IMAGE_SIMPLE from './PRESENTED_IMAGE_SIMPLE';
|
|
3
|
+
export interface EmptyProps {
|
|
4
|
+
description?: JSXElement;
|
|
5
|
+
class?: string;
|
|
6
|
+
style?: JSX.CSSProperties;
|
|
7
|
+
}
|
|
8
|
+
declare const Empty: Component<EmptyProps> & {
|
|
9
|
+
PRESENTED_IMAGE_SIMPLE: typeof PRESENTED_IMAGE_SIMPLE;
|
|
4
10
|
};
|
|
5
11
|
export default Empty;
|
package/es/Empty/index.js
CHANGED
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent, insert, template } from 'solid-js/web';
|
|
2
2
|
import PRESENTED_IMAGE_SIMPLE from './PRESENTED_IMAGE_SIMPLE.js';
|
|
3
3
|
import EmptySvg from './assets/EmptySvg.js';
|
|
4
|
+
import Element from '../Element/index.js';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
var _tmpl$ = /*#__PURE__*/template(`<div class="mb-[var(--ant-margin-xs)] flex justify-center">`),
|
|
7
|
+
_tmpl$2 = /*#__PURE__*/template(`<div class="text-[var(--ant-color-text)] text-center">`);
|
|
8
|
+
const Empty = props => {
|
|
9
|
+
return createComponent(Element, {
|
|
10
|
+
get ["class"]() {
|
|
11
|
+
return props.class;
|
|
12
|
+
},
|
|
13
|
+
get style() {
|
|
14
|
+
return props.style;
|
|
15
|
+
},
|
|
16
|
+
get children() {
|
|
17
|
+
return [(() => {
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
insert(_el$, createComponent(EmptySvg, {}));
|
|
20
|
+
return _el$;
|
|
21
|
+
})(), (() => {
|
|
22
|
+
var _el$2 = _tmpl$2();
|
|
23
|
+
insert(_el$2, () => props.description ?? '暂无数据');
|
|
24
|
+
return _el$2;
|
|
25
|
+
})()];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
13
28
|
};
|
|
14
29
|
Empty.PRESENTED_IMAGE_SIMPLE = PRESENTED_IMAGE_SIMPLE;
|
|
15
30
|
|
package/es/Form/Form.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { type JSXElement, type Ref } from 'solid-js';
|
|
2
|
-
import { set } from 'lodash-es';
|
|
1
|
+
import { type JSX, type JSXElement, type Ref } from 'solid-js';
|
|
2
|
+
import { get, set } from 'lodash-es';
|
|
3
|
+
import { type StyleProps } from '../types';
|
|
3
4
|
export interface FormInstance<T extends {} = {}> {
|
|
4
5
|
validateFields: () => Promise<T>;
|
|
6
|
+
getFieldValue: (name: Parameters<typeof get>[1]) => any;
|
|
5
7
|
setFieldValue: (name: Parameters<typeof set>[1], value: any) => void;
|
|
8
|
+
removeFieldValue: (name: Parameters<typeof set>[1]) => void;
|
|
6
9
|
}
|
|
7
|
-
export interface FormProps<T extends {} = {}> {
|
|
10
|
+
export interface FormProps<T extends {} = {}> extends StyleProps {
|
|
8
11
|
ref?: Ref<FormInstance<T>>;
|
|
9
12
|
/**
|
|
10
13
|
* 表单布局
|
|
@@ -12,7 +15,7 @@ export interface FormProps<T extends {} = {}> {
|
|
|
12
15
|
*/
|
|
13
16
|
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
14
17
|
children: JSXElement;
|
|
15
|
-
initialValues?: T
|
|
18
|
+
initialValues?: Partial<T>;
|
|
16
19
|
}
|
|
17
|
-
declare function Form<T extends {} = {}>(_props: FormProps<T>):
|
|
20
|
+
declare function Form<T extends {} = {}>(_props: FormProps<T>): JSX.Element;
|
|
18
21
|
export default Form;
|