antd-solid 0.0.21 → 0.0.23

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 (76) hide show
  1. package/css/index.css +1 -1
  2. package/dist/index.esm.js +2604 -1107
  3. package/dist/index.umd.js +1 -1
  4. package/es/Button/index.d.ts +5 -2
  5. package/es/Button/index.js +21 -8
  6. package/es/Checkbox/Group.js +2 -2
  7. package/es/Checkbox/index.js +26 -13
  8. package/es/CodeInput/index.js +3 -0
  9. package/es/Collapse/Item.js +50 -8
  10. package/es/Collapse/index.js +5 -3
  11. package/es/ColorPicker/ColorPickerInput.js +225 -210
  12. package/es/ColorPicker/ColorPickerSelect.js +61 -4
  13. package/es/ColorPicker/ColorPickerSlider.js +100 -67
  14. package/es/ColorPicker/index.js +66 -17
  15. package/es/ContextMenu/index.js +5 -1
  16. package/es/Cursor/index.d.ts +13 -2
  17. package/es/Cursor/index.js +59 -16
  18. package/es/Divider/index.js +12 -3
  19. package/es/Drawer/index.js +89 -43
  20. package/es/Dropdown/index.js +4 -2
  21. package/es/Element/index.js +2 -6
  22. package/es/Empty/PRESENTED_IMAGE_SIMPLE.js +12 -4
  23. package/es/Empty/assets/EmptySvg.js +3 -3
  24. package/es/Empty/assets/SimpleEmptySvg.js +3 -3
  25. package/es/Empty/index.js +12 -4
  26. package/es/Form/FormItem.js +76 -47
  27. package/es/Fragment/index.js +3 -1
  28. package/es/Image/index.js +31 -11
  29. package/es/Input/TextArea.js +31 -5
  30. package/es/Input/index.d.ts +5 -0
  31. package/es/Input/index.js +123 -46
  32. package/es/InputNumber/index.js +11 -4
  33. package/es/Menu/InternalMenu.js +96 -38
  34. package/es/Message/Message.js +11 -7
  35. package/es/Modal/index.js +107 -55
  36. package/es/Modal/useModal.js +14 -5
  37. package/es/Modal/warning.js +14 -5
  38. package/es/Popconfirm/index.js +36 -24
  39. package/es/Popover/index.js +20 -11
  40. package/es/Progress/Circle.js +63 -14
  41. package/es/Progress/index.js +38 -14
  42. package/es/Radio/Button.js +20 -4
  43. package/es/Radio/index.js +35 -5
  44. package/es/RangeInput/index.js +80 -24
  45. package/es/Result/index.js +27 -6
  46. package/es/Segmented/index.js +33 -13
  47. package/es/Select/index.d.ts +1 -1
  48. package/es/Select/index.js +39 -7
  49. package/es/SelectInput/index.d.ts +2 -1
  50. package/es/SelectInput/index.js +119 -51
  51. package/es/Slider/index.js +84 -11
  52. package/es/Space/index.js +2 -2
  53. package/es/Spin/index.js +26 -14
  54. package/es/Switch/index.js +6 -4
  55. package/es/Table/index.js +40 -18
  56. package/es/Tabs/index.js +195 -91
  57. package/es/Timeline/index.d.ts +1 -2
  58. package/es/Timeline/index.js +14 -4
  59. package/es/Tooltip/index.d.ts +1 -1
  60. package/es/Tooltip/index.js +40 -20
  61. package/es/Transformer/index.js +123 -59
  62. package/es/Tree/SingleLevelTree.js +191 -30
  63. package/es/TreeFor/index.js +3 -3
  64. package/es/TreeSelect/index.js +6 -4
  65. package/es/Upload/index.js +38 -4
  66. package/es/assets/svg/ColorPickUp.js +19 -6
  67. package/es/assets/svg/Crosshair.js +45 -6
  68. package/es/assets/svg/Resize.js +19 -6
  69. package/es/assets/svg/Rotate.js +14 -13
  70. package/es/assets/svg/RotateArrow.js +15 -20
  71. package/es/hooks/useClickAway.js +4 -6
  72. package/es/index.d.ts +1 -1
  73. package/es/utils/setupGlobalDrag.js +13 -4
  74. package/package.json +12 -14
  75. package/es/utils/DOMRect.d.ts +0 -22
  76. package/es/utils/DOMRect.js +0 -41
package/es/Input/index.js CHANGED
@@ -1,8 +1,9 @@
1
- import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape, ssrElement, mergeProps } from 'solid-js/web';
1
+ import { delegateEvents, createComponent, spread, mergeProps, insert, use, template } from 'solid-js/web';
2
2
  import { isNil, omit } from 'lodash-es';
3
3
  import { useContext, splitProps, onMount, createMemo, Show } from 'solid-js';
4
4
  import cs from 'classnames';
5
5
  import createControllableValue from '../hooks/createControllableValue.js';
6
+ import { setRef } from '../utils/solid.js';
6
7
  import Element from '../Element/index.js';
7
8
  import TextArea from './TextArea.js';
8
9
  import useComponentSize from '../hooks/useComponentSize.js';
@@ -10,12 +11,10 @@ import './index.scss.js';
10
11
  import useFocus from '../hooks/useFocus.js';
11
12
  import CompactContext from '../Compact/context.js';
12
13
 
13
- var _tmpl$ = ["<div", ">", "</div>"],
14
- _tmpl$2 = ["<div", " class=\"mr-4px\">", "</div>"],
15
- _tmpl$3 = ["<span", " class=\"ml-4px i-ant-design:close-circle-filled cursor-pointer text-[var(--ant-color-text-quaternary)] hover:text-[var(--ant-color-text-tertiary)] active:text-[var(--ant-color-text)]\"></span>"],
16
- _tmpl$4 = ["<div", " class=\"ml-4px\">", "</div>"],
17
- _tmpl$5 = ["<div", " class=\"[display:var(--actions-display)] absolute top-0 bottom-0 right-0 h-[calc(100%-2px)] translate-y-1px -translate-x-1px\">", "</div>"],
18
- _tmpl$6 = ["<div", "><!--$-->", "<!--/-->", "<!--$-->", "<!--/--><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"];
14
+ var _tmpl$ = /*#__PURE__*/template(`<div>`),
15
+ _tmpl$2 = /*#__PURE__*/template(`<span class="ml-4px i-ant-design:close-circle-filled cursor-pointer text-[var(--ant-color-text-quaternary)] hover:text-[var(--ant-color-text-tertiary)] active:text-[var(--ant-color-text)]">`),
16
+ _tmpl$3 = /*#__PURE__*/template(`<div class="[display:var(--actions-display)] absolute top-0 bottom-0 right-0 h-[calc(100%-2px)] translate-y-1px -translate-x-1px">`),
17
+ _tmpl$4 = /*#__PURE__*/template(`<div><input>`);
19
18
  const statusClassDict = {
20
19
  default: (disabled, foucs) => {
21
20
  if (disabled) {
@@ -54,8 +53,11 @@ function CommonInput(props) {
54
53
  let inputRef;
55
54
  const foucs = useFocus(() => inputRef);
56
55
  onMount(() => {
57
- if (props.autoFocus) ;
56
+ if (props.autoFocus) {
57
+ inputRef?.focus();
58
+ }
58
59
  });
60
+ const isControlled = () => Object.keys(props).includes('value');
59
61
  const [value, setValue] = createControllableValue(props, {
60
62
  trigger: null
61
63
  });
@@ -100,49 +102,123 @@ function CommonInput(props) {
100
102
  return !isNil(addonBefore());
101
103
  },
102
104
  get children() {
103
- return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(cs('ant-input-addon', 'shrink-0 flex justify-center items-center px-11px bg-[rgba(0,0,0,.02)] [border:1px_solid_var(--ant-color-border)] border-r-0'), true), false), escape(addonBefore()));
104
- }
105
- }), ssr(_tmpl$6, ssrHydrationKey() + ssrAttribute("class", escape(cs('ant-input-affix-wrapper', 'flex items-center w-full relative p:hover-child[input]:border-[--ant-color-primary] bg-[--ant-color-bg-container] p-[--ant-input-padding] border-1px border-solid', ['[--actions-display:none]', !props.disabled && 'hover:[--actions-display:block]'], statusClassDict[props.status ?? 'default'](!!props.disabled, foucs())), true), false), escape(createComponent(Show, {
106
- get when() {
107
- return !isNil(prefix());
108
- },
109
- get children() {
110
- return ssr(_tmpl$2, ssrHydrationKey(), escape(prefix()));
111
- }
112
- })), ssrElement("input", mergeProps(inputProps, {
113
- get ["class"]() {
114
- return cs('w-full h-full [font-size:var(--ant-input-font-size)] [outline:none] placeholder-text-[var(--ant-color-text-placeholder)] bg-transparent', props.disabled && 'color-[var(--ant-color-text-disabled)] cursor-not-allowed', props.class);
115
- },
116
- get value() {
117
- return value() ?? '';
118
- }
119
- }), undefined, false), escape(createComponent(Show, {
120
- get when() {
121
- return showClearBtn();
122
- },
123
- get children() {
124
- return ssr(_tmpl$3, ssrHydrationKey());
125
- }
126
- })), escape(createComponent(Show, {
127
- get when() {
128
- return !isNil(suffix());
129
- },
130
- get children() {
131
- return ssr(_tmpl$4, ssrHydrationKey(), escape(suffix()));
132
- }
133
- })), escape(createComponent(Show, {
134
- get when() {
135
- return !isNil(actions());
136
- },
137
- get children() {
138
- return ssr(_tmpl$5, ssrHydrationKey(), escape(actions()));
105
+ var _el$ = _tmpl$();
106
+ spread(_el$, mergeProps(() => props.addonBeforeHTMLAttributes, {
107
+ get ["class"]() {
108
+ return cs(props.addonBeforeHTMLAttributes?.class, 'ant-input-addon ant-input-addon-before', 'shrink-0 flex justify-center items-center px-11px bg-[rgba(0,0,0,.02)] [border:1px_solid_var(--ant-color-border)] border-r-0');
109
+ }
110
+ }), false, true);
111
+ insert(_el$, addonBefore);
112
+ return _el$;
139
113
  }
140
- }))), createComponent(Show, {
114
+ }), (() => {
115
+ var _el$2 = _tmpl$4(),
116
+ _el$4 = _el$2.firstChild;
117
+ spread(_el$2, mergeProps(() => props.affixWrapperHTMLAttributes, {
118
+ get ["class"]() {
119
+ return cs(props.affixWrapperHTMLAttributes?.class, 'ant-input-affix-wrapper', 'flex items-center w-full relative p:hover-child[input]:border-[--ant-color-primary] bg-[--ant-color-bg-container] p-[--ant-input-padding] border-1px border-solid', ['[--actions-display:none]', !props.disabled && 'hover:[--actions-display:block]'], statusClassDict[props.status ?? 'default'](!!props.disabled, foucs()));
120
+ }
121
+ }), false, true);
122
+ insert(_el$2, createComponent(Show, {
123
+ get when() {
124
+ return !isNil(prefix());
125
+ },
126
+ get children() {
127
+ var _el$3 = _tmpl$();
128
+ spread(_el$3, mergeProps(() => props.prefixHTMLAttributes, {
129
+ get ["class"]() {
130
+ return cs(props.prefixHTMLAttributes?.class, 'mr-4px');
131
+ }
132
+ }), false, true);
133
+ insert(_el$3, prefix);
134
+ return _el$3;
135
+ }
136
+ }), _el$4);
137
+ use(el => {
138
+ setRef(props, el);
139
+ inputRef = el;
140
+ }, _el$4);
141
+ spread(_el$4, mergeProps(inputProps, {
142
+ get ["class"]() {
143
+ return cs('w-full h-full [font-size:var(--ant-input-font-size)] [outline:none] placeholder-text-[var(--ant-color-text-placeholder)] bg-transparent', props.disabled && 'color-[var(--ant-color-text-disabled)] cursor-not-allowed', props.class);
144
+ },
145
+ get value() {
146
+ return value() ?? '';
147
+ },
148
+ "onInput": e => {
149
+ setValue(e.target.value);
150
+ try {
151
+ props.onChange?.(e);
152
+ } finally {
153
+ if (isControlled() && e.target.value !== props.value) {
154
+ e.target.value = props.value ?? '';
155
+ }
156
+ }
157
+ },
158
+ "onKeyDown": e => {
159
+ if (e.key === 'Enter') {
160
+ props.onPressEnter?.(e);
161
+ }
162
+ props.onKeyDown?.(e);
163
+ }
164
+ }), false, false);
165
+ insert(_el$2, createComponent(Show, {
166
+ get when() {
167
+ return showClearBtn();
168
+ },
169
+ get children() {
170
+ var _el$5 = _tmpl$2();
171
+ _el$5.$$click = e => {
172
+ e.stopPropagation();
173
+ inputRef.value = '';
174
+ const inputEvent = new InputEvent('input', {
175
+ bubbles: true
176
+ });
177
+ inputRef.dispatchEvent(inputEvent);
178
+ inputRef?.focus();
179
+ };
180
+ return _el$5;
181
+ }
182
+ }), null);
183
+ insert(_el$2, createComponent(Show, {
184
+ get when() {
185
+ return !isNil(suffix());
186
+ },
187
+ get children() {
188
+ var _el$6 = _tmpl$();
189
+ spread(_el$6, mergeProps(() => props.suffixHTMLAttributes, {
190
+ get ["class"]() {
191
+ return cs(props.suffixHTMLAttributes?.class, 'ml-4px');
192
+ }
193
+ }), false, true);
194
+ insert(_el$6, suffix);
195
+ return _el$6;
196
+ }
197
+ }), null);
198
+ insert(_el$2, createComponent(Show, {
199
+ get when() {
200
+ return !isNil(actions());
201
+ },
202
+ get children() {
203
+ var _el$7 = _tmpl$3();
204
+ insert(_el$7, actions);
205
+ return _el$7;
206
+ }
207
+ }), null);
208
+ return _el$2;
209
+ })(), createComponent(Show, {
141
210
  get when() {
142
211
  return !isNil(addonAfter());
143
212
  },
144
213
  get children() {
145
- return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(cs('ant-input-addon', 'shrink-0 flex justify-center items-center px-11px bg-[rgba(0,0,0,.02)] [border:1px_solid_var(--ant-color-border)] border-l-0'), true), false), escape(addonAfter()));
214
+ var _el$8 = _tmpl$();
215
+ spread(_el$8, mergeProps(() => props.addonAfterHTMLAttributes, {
216
+ get ["class"]() {
217
+ return cs(props.addonAfterHTMLAttributes?.class, 'ant-input-addon ant-input-addon-after', 'shrink-0 flex justify-center items-center px-11px bg-[rgba(0,0,0,.02)] [border:1px_solid_var(--ant-color-border)] border-l-0');
218
+ }
219
+ }), false, true);
220
+ insert(_el$8, addonAfter);
221
+ return _el$8;
146
222
  }
147
223
  })];
148
224
  }
@@ -152,5 +228,6 @@ const Input = props => {
152
228
  return createComponent(CommonInput, mergeProps(() => omit(props, ['actions'])));
153
229
  };
154
230
  Input.TextArea = TextArea;
231
+ delegateEvents(["click"]);
155
232
 
156
233
  export { CommonInput, Input as default, statusClassDict };
@@ -1,13 +1,12 @@
1
- import { createComponent, mergeProps as mergeProps$1, ssr, ssrHydrationKey, ssrAttribute, escape } from 'solid-js/web';
1
+ import { delegateEvents, createComponent, mergeProps as mergeProps$1, memo, template } from 'solid-js/web';
2
2
  import { mergeProps, splitProps, createSignal, untrack, createMemo, createRenderEffect, on } from 'solid-js';
3
3
  import { isNumber, isNil, clamp, floor } from 'lodash-es';
4
4
  import NP from 'number-precision';
5
5
  import { CommonInput } from '../Input/index.js';
6
6
  import { dispatchEventHandlerUnion } from '../utils/solid.js';
7
7
 
8
- var _tmpl$ = ["<div", " class=\"flex flex-col h-full w-[--ant-input-number-handle-width] [border-left:1px_solid_var(--ant-color-border)] bg-[--ant-color-bg-container]\"><div", "><div class=\"i-ant-design:up-outlined\"></div></div><div class=\"", "\"><div class=\"i-ant-design:down-outlined\"></div></div></div>"];
8
+ var _tmpl$ = /*#__PURE__*/template(`<div class="flex flex-col h-full w-[--ant-input-number-handle-width] [border-left:1px_solid_var(--ant-color-border)] bg-[--ant-color-bg-container]"><div class="text-12px flex justify-center items-center h-1/2 cursor-pointer opacity-70 hover:h-100% hover:text-[var(--ant-color-primary)] transition-color transition-height transition-duration-500"><div class=i-ant-design:up-outlined></div></div><div class="[border-top:1px_solid_var(--ant-color-border)] text-12px flex justify-center items-center h-1/2 cursor-pointer opacity-70 hover:h-100% hover:text-[var(--ant-color-primary)] transition-color transition-height transition-duration-500"><div class=i-ant-design:down-outlined>`);
9
9
  const isEmptyValue = value => isNil(value) || value === '';
10
- const actionBtnClass = 'text-12px flex justify-center items-center h-1/2 cursor-pointer opacity-70 hover:h-100% hover:text-[var(--ant-color-primary)] transition-color transition-height transition-duration-500';
11
10
  const InputNumber = _props => {
12
11
  const props = mergeProps({
13
12
  min: -Infinity,
@@ -76,7 +75,14 @@ const InputNumber = _props => {
76
75
  };
77
76
  },
78
77
  get actions() {
79
- return props.controls ? ssr(_tmpl$, ssrHydrationKey(), ssrAttribute("class", escape(actionBtnClass, true), false), `[border-top:1px_solid_var(--ant-color-border)] ${escape(actionBtnClass, true)}`) : undefined;
78
+ return memo(() => !!props.controls)() ? (() => {
79
+ var _el$ = _tmpl$(),
80
+ _el$2 = _el$.firstChild,
81
+ _el$3 = _el$2.nextSibling;
82
+ _el$2.$$click = up;
83
+ _el$3.$$click = down;
84
+ return _el$;
85
+ })() : undefined;
80
86
  },
81
87
  get value() {
82
88
  return `${(focusing() ? value() : displayValue()) ?? ''}`;
@@ -111,5 +117,6 @@ const InputNumber = _props => {
111
117
  }
112
118
  }));
113
119
  };
120
+ delegateEvents(["click"]);
114
121
 
115
122
  export { InputNumber as default };
@@ -1,4 +1,4 @@
1
- import { createComponent, ssr, ssrHydrationKey, ssrAttribute, escape, ssrStyle, mergeProps } from 'solid-js/web';
1
+ import { delegateEvents, createComponent, insert, mergeProps, effect, className, style, template } from 'solid-js/web';
2
2
  import { For, createMemo, Show, Switch, Match } from 'solid-js';
3
3
  import { isEmpty } from 'lodash-es';
4
4
  import cs from 'classnames';
@@ -6,13 +6,12 @@ import Popover from '../Popover/index.js';
6
6
  import { unwrapStringOrJSXElement } from '../utils/solid.js';
7
7
  import DelayShow from '../DelayShow/index.js';
8
8
 
9
- var _tmpl$ = ["<div", " class=\"h-1px bg-[var(--ant-color-split)] my-[var(--ant-margin-xxs)]\"></div>"],
10
- _tmpl$2 = ["<div", "><div", " style=\"", "\"><!--$-->", "<!--/--><!--$-->", "<!--/--></div></div>"],
11
- _tmpl$3 = ["<div", " style=\"", "\">", "</div>"],
12
- _tmpl$4 = ["<div", "><!--$-->", "<!--/--><!--$-->", "<!--/--></div>"],
13
- _tmpl$5 = ["<span", " class=\"i-ant-design:right-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2\"></span>"],
14
- _tmpl$6 = ["<span", " class=\"i-ant-design:up-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2\"></span>"],
15
- _tmpl$7 = ["<span", " class=\"i-ant-design:down-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2\"></span>"];
9
+ var _tmpl$ = /*#__PURE__*/template(`<div class="h-1px bg-[var(--ant-color-split)] my-[var(--ant-margin-xxs)]">`),
10
+ _tmpl$2 = /*#__PURE__*/template(`<div><div>`),
11
+ _tmpl$3 = /*#__PURE__*/template(`<div>`),
12
+ _tmpl$4 = /*#__PURE__*/template(`<span class="i-ant-design:right-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2">`),
13
+ _tmpl$5 = /*#__PURE__*/template(`<span class="i-ant-design:up-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2">`),
14
+ _tmpl$6 = /*#__PURE__*/template(`<span class="i-ant-design:down-outlined w-0.7em absolute top-1/2 right-[var(--ant-padding)] translate-y--1/2">`);
16
15
  function isMenuDividerType(value) {
17
16
  return value.type === 'divider';
18
17
  }
@@ -22,18 +21,54 @@ function InternalMenu(props) {
22
21
  return props.items;
23
22
  },
24
23
  children: item => {
25
- if (isMenuDividerType(item)) return ssr(_tmpl$, ssrHydrationKey());
24
+ if (isMenuDividerType(item)) return _tmpl$();
26
25
  const keyPath = createMemo(() => [...(props.parentKeys ?? []), item.key]);
27
26
  const expanded = createMemo(() => props.expandedKeys?.includes(item.key));
28
27
  const hasChildren = createMemo(() => !isEmpty(item.children));
29
- const getLabel = options => ssr(_tmpl$2, ssrHydrationKey() + ssrAttribute("class", escape(cs(item.disabled && 'cursor-not-allowed'), true), false), ssrAttribute("class", escape(cs('relative rounded-[var(--ant-border-radius-lg)] cursor-pointer flex items-center m-[--ant-menu-item-margin] min-h-[--ant-menu-item-height]', item.disabled ? 'text-[--ant-color-text-disabled]' : props.selectedKeys.includes(item.key) ? 'bg-[--ant-control-item-bg-active] text-[--ant-color-primary]' : 'text-[--ant-color-text] hover:bg-[var(--ant-color-bg-text-hover)]', !hasChildren() ? ['px-[--ant-padding-sm]', props.selectable && 'active:bg-[var(--ant-control-item-bg-active)]'] : 'pl-[var(--ant-padding)] pr-[calc(var(--ant-padding)+0.7em+var(--ant-margin-xs))]', item.disabled && 'pointer-events-none'), true), false), "padding-left:" + (props.mode === 'inline' ? `calc(${escape(keyPath().length, true)} * var(--ant-padding))` : escape(undefined, true)), escape(unwrapStringOrJSXElement(item.label)), escape(createComponent(Show, {
30
- get when() {
31
- return hasChildren();
32
- },
33
- get children() {
34
- return options?.expandIcon;
35
- }
36
- })));
28
+ const getLabel = options => (() => {
29
+ var _el$2 = _tmpl$2(),
30
+ _el$3 = _el$2.firstChild;
31
+ _el$3.$$click = () => {
32
+ options?.onClick?.();
33
+ if (!hasChildren()) {
34
+ const info = {
35
+ key: item.key,
36
+ keyPath: keyPath()
37
+ };
38
+ item.onClick?.(info);
39
+ props.onClick?.(info);
40
+ if (props.selectable) {
41
+ props.onSelect?.({
42
+ ...info,
43
+ selectedKeys: [item.key]
44
+ });
45
+ }
46
+ }
47
+ };
48
+ insert(_el$3, () => unwrapStringOrJSXElement(item.label), null);
49
+ insert(_el$3, createComponent(Show, {
50
+ get when() {
51
+ return hasChildren();
52
+ },
53
+ get children() {
54
+ return options?.expandIcon;
55
+ }
56
+ }), null);
57
+ effect(_p$ => {
58
+ var _v$ = cs(item.disabled && 'cursor-not-allowed'),
59
+ _v$2 = cs('relative rounded-[var(--ant-border-radius-lg)] cursor-pointer flex items-center m-[--ant-menu-item-margin] min-h-[--ant-menu-item-height]', item.disabled ? 'text-[--ant-color-text-disabled]' : props.selectedKeys.includes(item.key) ? 'bg-[--ant-control-item-bg-active] text-[--ant-color-primary]' : 'text-[--ant-color-text] hover:bg-[var(--ant-color-bg-text-hover)]', !hasChildren() ? ['px-[--ant-padding-sm]', props.selectable && 'active:bg-[var(--ant-control-item-bg-active)]'] : 'pl-[var(--ant-padding)] pr-[calc(var(--ant-padding)+0.7em+var(--ant-margin-xs))]', item.disabled && 'pointer-events-none'),
60
+ _v$3 = props.mode === 'inline' ? `calc(${keyPath().length} * var(--ant-padding))` : undefined;
61
+ _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
62
+ _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
63
+ _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$3.style.setProperty("padding-left", _v$3) : _el$3.style.removeProperty("padding-left"));
64
+ return _p$;
65
+ }, {
66
+ e: undefined,
67
+ t: undefined,
68
+ a: undefined
69
+ });
70
+ return _el$2;
71
+ })();
37
72
  return createComponent(Show, {
38
73
  get when() {
39
74
  return hasChildren();
@@ -64,24 +99,40 @@ function InternalMenu(props) {
64
99
  },
65
100
  placement: "rightTop",
66
101
  arrow: false,
67
- content: () => ssr(_tmpl$3, ssrHydrationKey() + ssrAttribute("class", escape(props.class, true), false), ssrStyle(props.style), escape(createComponent(InternalMenu, mergeProps(props, {
68
- get items() {
69
- return item.children;
70
- },
71
- get parentKeys() {
72
- return keyPath();
73
- },
74
- onClick: info => {
75
- props.onExpandedKeysChange([]);
76
- props.onClick?.(info);
102
+ content: () => (() => {
103
+ var _el$6 = _tmpl$3();
104
+ insert(_el$6, createComponent(InternalMenu, mergeProps(props, {
105
+ get items() {
106
+ return item.children;
107
+ },
108
+ get parentKeys() {
109
+ return keyPath();
110
+ },
111
+ onClick: info => {
112
+ props.onExpandedKeysChange([]);
113
+ props.onClick?.(info);
114
+ }
115
+ })));
116
+ effect(_p$ => {
117
+ var _v$4 = props.class,
118
+ _v$5 = props.style;
119
+ _v$4 !== _p$.e && className(_el$6, _p$.e = _v$4);
120
+ _p$.t = style(_el$6, _v$5, _p$.t);
121
+ return _p$;
122
+ }, {
123
+ e: undefined,
124
+ t: undefined
125
+ });
126
+ return _el$6;
127
+ })(),
128
+ contentHTMLAttributes: {
129
+ style: {
130
+ padding: 0
77
131
  }
78
- })))),
79
- contentStyle: {
80
- padding: 0
81
132
  },
82
133
  get children() {
83
134
  return getLabel({
84
- expandIcon: ssr(_tmpl$5, ssrHydrationKey())
135
+ expandIcon: _tmpl$4()
85
136
  });
86
137
  }
87
138
  });
@@ -91,7 +142,8 @@ function InternalMenu(props) {
91
142
  return props.mode === 'inline';
92
143
  },
93
144
  get children() {
94
- return ssr(_tmpl$4, ssrHydrationKey(), escape(getLabel({
145
+ var _el$4 = _tmpl$3();
146
+ insert(_el$4, () => getLabel({
95
147
  onClick() {
96
148
  if (hasChildren()) {
97
149
  if (expanded()) {
@@ -106,27 +158,32 @@ function InternalMenu(props) {
106
158
  return expanded();
107
159
  },
108
160
  get fallback() {
109
- return ssr(_tmpl$7, ssrHydrationKey());
161
+ return _tmpl$6();
110
162
  },
111
163
  get children() {
112
- return ssr(_tmpl$6, ssrHydrationKey());
164
+ return _tmpl$5();
113
165
  }
114
166
  })
115
- })), escape(createComponent(DelayShow, {
167
+ }), null);
168
+ insert(_el$4, createComponent(DelayShow, {
116
169
  get when() {
117
170
  return expanded();
118
171
  },
119
172
  get children() {
120
- return ssr(_tmpl$3, ssrHydrationKey(), "display:" + (expanded() ? "block" : "none"), escape(createComponent(InternalMenu, mergeProps(props, {
173
+ var _el$5 = _tmpl$3();
174
+ insert(_el$5, createComponent(InternalMenu, mergeProps(props, {
121
175
  get items() {
122
176
  return item.children;
123
177
  },
124
178
  get parentKeys() {
125
179
  return keyPath();
126
180
  }
127
- }))));
181
+ })));
182
+ effect(() => (expanded() ? 'block' : 'none') != null ? _el$5.style.setProperty("display", expanded() ? 'block' : 'none') : _el$5.style.removeProperty("display"));
183
+ return _el$5;
128
184
  }
129
- })));
185
+ }), null);
186
+ return _el$4;
130
187
  }
131
188
  })];
132
189
  }
@@ -136,5 +193,6 @@ function InternalMenu(props) {
136
193
  }
137
194
  });
138
195
  }
196
+ delegateEvents(["click"]);
139
197
 
140
198
  export { InternalMenu as default };
@@ -1,12 +1,12 @@
1
- import { createComponent, ssr, ssrHydrationKey, escape } from 'solid-js/web';
1
+ import { createComponent, memo, insert, template } from 'solid-js/web';
2
2
  import { onMount } from 'solid-js';
3
3
  import Element from '../Element/index.js';
4
4
 
5
- var _tmpl$ = ["<div", ">", "</div>"],
6
- _tmpl$2 = ["<span", " class=\"i-ant-design:info-circle-filled text-[--ant-color-primary] text-18px\"></span>"],
7
- _tmpl$3 = ["<span", " class=\"i-ant-design:check-circle-filled text-[--ant-color-success] text-18px\"></span>"],
8
- _tmpl$4 = ["<span", " class=\"i-ant-design:close-circle-filled text-[--ant-color-error] text-18px\"></span>"],
9
- _tmpl$5 = ["<span", " class=\"i-ant-design:exclamation-circle-filled text-[--ant-color-warning] text-18px\"></span>"];
5
+ var _tmpl$ = /*#__PURE__*/template(`<div>`),
6
+ _tmpl$2 = /*#__PURE__*/template(`<span class="i-ant-design:info-circle-filled text-[--ant-color-primary] text-18px">`),
7
+ _tmpl$3 = /*#__PURE__*/template(`<span class="i-ant-design:check-circle-filled text-[--ant-color-success] text-18px">`),
8
+ _tmpl$4 = /*#__PURE__*/template(`<span class="i-ant-design:close-circle-filled text-[--ant-color-error] text-18px">`),
9
+ _tmpl$5 = /*#__PURE__*/template(`<span class="i-ant-design:exclamation-circle-filled text-[--ant-color-warning] text-18px">`);
10
10
  const Message = props => {
11
11
  onMount(() => {
12
12
  const duration = props.duration ?? 3;
@@ -22,7 +22,11 @@ const Message = props => {
22
22
  '--ant-message-content-padding': '9px 12px'
23
23
  },
24
24
  get children() {
25
- return [props.type === 'info' && ssr(_tmpl$2, ssrHydrationKey()), props.type === 'success' && ssr(_tmpl$3, ssrHydrationKey()), props.type === 'error' && ssr(_tmpl$4, ssrHydrationKey()), props.type === 'warning' && ssr(_tmpl$5, ssrHydrationKey()), ssr(_tmpl$, ssrHydrationKey(), escape(props.content))];
25
+ return [memo(() => memo(() => props.type === 'info')() && _tmpl$2()), memo(() => memo(() => props.type === 'success')() && _tmpl$3()), memo(() => memo(() => props.type === 'error')() && _tmpl$4()), memo(() => memo(() => props.type === 'warning')() && _tmpl$5()), (() => {
26
+ var _el$ = _tmpl$();
27
+ insert(_el$, () => props.content);
28
+ return _el$;
29
+ })()];
26
30
  }
27
31
  });
28
32
  };