plain-design 1.0.0-beta.20 → 1.0.0-beta.22
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/plain-design.commonjs.min.js +1 -1
- package/dist/plain-design.min.js +1 -1
- package/dist/report.html +2 -2
- package/package.json +1 -1
- package/src/packages/build.ts +2 -10
- package/src/packages/components/Input/uses/useInputHooks.tsx +11 -11
- package/src/packages/entry.tsx +4 -1
- package/src/packages/uses/useEdit.ts +1 -1
- package/src/packages/uses/useStyle.tsx +1 -1
package/package.json
CHANGED
package/src/packages/build.ts
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
import Plain from './index';
|
2
|
-
|
3
|
-
import allIcons from 'plain-icons/dist/icons.js';
|
2
|
+
import {installAllIcon} from "./utils/installAllIcons";
|
4
3
|
|
5
|
-
|
6
|
-
Plain.Icon.PlainIcon.use.options.props.getIcon.default = (icon: string) => {
|
7
|
-
const iconMeta = (allIcons as any)[icon];
|
8
|
-
if (!iconMeta) {
|
9
|
-
throw new Error(`getIcon: can't find icon match ${icon}`);
|
10
|
-
}
|
11
|
-
return iconMeta;
|
12
|
-
};
|
4
|
+
installAllIcon();
|
13
5
|
|
14
6
|
export * from './index';
|
15
7
|
export default Plain;
|
@@ -3,18 +3,18 @@ import {iSelectOptionProps} from "../../Select/select.utils";
|
|
3
3
|
|
4
4
|
export function useInputHooks() {
|
5
5
|
return {
|
6
|
-
onRenderDefault: createSyncHooks<(content: RenderNode) => void>(), // 渲染默认插槽
|
7
|
-
onRenderSuffix: createSyncHooks<(content: RenderNode) => void>(), // 渲染suffix插槽
|
8
|
-
onRefInput: createHooks<(el: HTMLInputElement | null) => void>(),
|
9
|
-
onRefWrapper: createHooks<(el: HTMLElement | null) => void>(),
|
10
|
-
onInputKeydown: createHooks<(e: iKeyboardEvent) => void>(),
|
11
|
-
onInput: createHooks<(val: any) => void>(),
|
12
|
-
onClasses: createSyncHooks<(val: any[]) => void>(), // 计算根节点classes
|
6
|
+
onRenderDefault: createSyncHooks<(content: RenderNode) => void>(true), // 渲染默认插槽
|
7
|
+
onRenderSuffix: createSyncHooks<(content: RenderNode) => void>(true), // 渲染suffix插槽
|
8
|
+
onRefInput: createHooks<(el: HTMLInputElement | null) => void>(), // input dom对象引用
|
9
|
+
onRefWrapper: createHooks<(el: HTMLElement | null) => void>(), // 容器节点dom对象引用
|
10
|
+
onInputKeydown: createHooks<(e: iKeyboardEvent) => void>(), // input触发按键事件
|
11
|
+
onInput: createHooks<(val: any) => void>(), // input的输入动作
|
12
|
+
onClasses: createSyncHooks<(val: any[]) => void>(true), // 计算根节点classes
|
13
13
|
onSuggestion: createHooks<(data: { val: string, optionProps: iSelectOptionProps }) => void>(),// 点击了某个推荐选项
|
14
|
-
onTagChange: createHooks<() => void>(),
|
15
|
-
onTriggerOpenSuggestion: createHooks<() => void>(),
|
16
|
-
onTriggerCloseSuggestion: createHooks<() => void>(),
|
17
|
-
onGetSuggestionIsShow: createSyncHooks<(flag: boolean) => void>(), // suggestion 面板是否已经打开
|
14
|
+
onTagChange: createHooks<() => void>(), // 多值输入的时候的变化动作
|
15
|
+
onTriggerOpenSuggestion: createHooks<() => void>(), // 触发打开suggestion的动作
|
16
|
+
onTriggerCloseSuggestion: createHooks<() => void>(), // 触发打开suggestion的动作
|
17
|
+
onGetSuggestionIsShow: createSyncHooks<(flag: boolean) => void>(true), // suggestion 面板是否已经打开
|
18
18
|
};
|
19
19
|
}
|
20
20
|
|
package/src/packages/entry.tsx
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import {setComponentPrefix} from "plain-design-composition";
|
2
|
-
import {createProvider} from "./utils/createProvider";
|
3
2
|
|
4
3
|
export {Application} from "./components/Application";
|
5
4
|
export type {iApplicationConfiguration} from './components/Application/utils/application.utils';
|
@@ -196,5 +195,9 @@ export {useWatchAutoClear} from './components/useWatchAutoClear';
|
|
196
195
|
export {nextPopupId} from './components/nextPopupId';
|
197
196
|
export {createProvider} from './components/createProvider';
|
198
197
|
export {usePopupManager} from './components/usePopupManager';
|
198
|
+
export {useEdit, EditProps, EDIT_PROVIDER} from './uses/useEdit';
|
199
|
+
export type {tEditComputed, tEditControl, EditProvideData} from './uses/useEdit';
|
200
|
+
export {useStyle, StyleProps, ThemeShape, ThemeSize, ThemeStatus} from './uses/useStyle';
|
201
|
+
export type {tStyleComputed, UseStyleProvideData} from './uses/useStyle';
|
199
202
|
|
200
203
|
setComponentPrefix(globalComponentPrefix);
|
@@ -19,7 +19,7 @@ export const StyleProps = {
|
|
19
19
|
status: { type: String as PropType<typeof ThemeStatus.TYPE> }, // 'secondary', 'primary', 'success', 'warn', 'error'
|
20
20
|
} as const;
|
21
21
|
|
22
|
-
interface UseStyleProvideData {
|
22
|
+
export interface UseStyleProvideData {
|
23
23
|
shape: typeof ThemeShape.TYPE,
|
24
24
|
size: typeof ThemeSize.TYPE,
|
25
25
|
status?: typeof ThemeStatus.TYPE,
|