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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plain-design",
3
- "version": "1.0.0-beta.20",
3
+ "version": "1.0.0-beta.22",
4
4
  "description": "",
5
5
  "main": "dist/plain-design.min.js",
6
6
  "module": "dist/plain-design.commonjs.min.js",
@@ -1,15 +1,7 @@
1
1
  import Plain from './index';
2
- // @ts-ignore
3
- import allIcons from 'plain-icons/dist/icons.js';
2
+ import {installAllIcon} from "./utils/installAllIcons";
4
3
 
5
- // @ts-ignore
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>(), // 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>(), // 计算根节点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>(), // 触发打开suggestion的动作
16
- onTriggerCloseSuggestion: createHooks<() => void>(), // 触发打开suggestion的动作
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
 
@@ -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);
@@ -14,7 +14,7 @@ export const EditProps = {
14
14
  multiple: { type: Boolean }, // 是否多选
15
15
  } as const;
16
16
 
17
- interface EditProvideData {
17
+ export interface EditProvideData {
18
18
  disabled: boolean | null,
19
19
  readonly: boolean | null,
20
20
  loading: boolean | null,
@@ -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,