@lm_fe/components 0.2.2

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 (100) hide show
  1. package/README.md +47 -0
  2. package/dist/keep-alive/common.d.ts +46 -0
  3. package/dist/keep-alive/components/AsyncComponent.d.ts +27 -0
  4. package/dist/keep-alive/components/Comment.d.ts +18 -0
  5. package/dist/keep-alive/components/Consumer.d.ts +20 -0
  6. package/dist/keep-alive/components/keepAlive.d.ts +4 -0
  7. package/dist/keep-alive/components/provider.d.ts +31 -0
  8. package/dist/keep-alive/contexts/IdentificationContext.d.ts +12 -0
  9. package/dist/keep-alive/contexts/KeepAliveContext.d.ts +5 -0
  10. package/dist/keep-alive/index.d.ts +7 -0
  11. package/dist/keep-alive/index.js +1901 -0
  12. package/dist/keep-alive/utils/bindLifecycle.d.ts +3 -0
  13. package/dist/keep-alive/utils/changePositionByComment.d.ts +1 -0
  14. package/dist/keep-alive/utils/createEventEmitter.d.ts +11 -0
  15. package/dist/keep-alive/utils/createStoreElement.d.ts +1 -0
  16. package/dist/keep-alive/utils/createUniqueIdentification.d.ts +8 -0
  17. package/dist/keep-alive/utils/debug.d.ts +3 -0
  18. package/dist/keep-alive/utils/getDisplayName.d.ts +2 -0
  19. package/dist/keep-alive/utils/getKeepAlive.d.ts +3 -0
  20. package/dist/keep-alive/utils/getKeyByFiberNode.d.ts +1 -0
  21. package/dist/keep-alive/utils/isRegExp.d.ts +1 -0
  22. package/dist/keep-alive/utils/keepAliveDecorator.d.ts +17 -0
  23. package/dist/keep-alive/utils/md5.d.ts +1 -0
  24. package/dist/keep-alive/utils/noop.d.ts +2 -0
  25. package/dist/keep-alive/utils/shallowEqual.d.ts +2 -0
  26. package/dist/keep-alive/utils/useKeepAliveEffect.d.ts +2 -0
  27. package/dist/keep-alive/utils/withIdentificationContextConsumer.d.ts +10 -0
  28. package/dist/keep-alive/utils/withKeepAliveContextConsumer.d.ts +10 -0
  29. package/dist/src/ArraySingle/Inner.d.ts +3 -0
  30. package/dist/src/ArraySingle/index.d.ts +2 -0
  31. package/dist/src/CaseTempleteEdit/Inner.d.ts +4 -0
  32. package/dist/src/CaseTempleteEdit/config.d.ts +20 -0
  33. package/dist/src/CaseTempleteEdit/index.d.ts +4 -0
  34. package/dist/src/CaseTempleteEdit/types.d.ts +19 -0
  35. package/dist/src/CaseTempleteEdit/utils.d.ts +2 -0
  36. package/dist/src/CaseTempleteEditEmr/Inner.d.ts +3 -0
  37. package/dist/src/CaseTempleteEditEmr/demo_text.d.ts +1 -0
  38. package/dist/src/CaseTempleteEditEmr/index.d.ts +2 -0
  39. package/dist/src/CaseTempleteEditEmr/types.d.ts +6 -0
  40. package/dist/src/CaseTempleteEditEmr/utils.d.ts +3 -0
  41. package/dist/src/ContainerDimensions/index.d.ts +10 -0
  42. package/dist/src/GlobalModal/index.d.ts +8 -0
  43. package/dist/src/GlobalModal/utils.d.ts +65 -0
  44. package/dist/src/Monaco/Inner.d.ts +12 -0
  45. package/dist/src/Monaco/index.d.ts +1 -0
  46. package/dist/src/MyAddress/Inner.d.ts +3 -0
  47. package/dist/src/MyAddress/Old/InnerOld.d.ts +3 -0
  48. package/dist/src/MyAddress/Old/index.d.ts +3 -0
  49. package/dist/src/MyAddress/Old/options.d.ts +25 -0
  50. package/dist/src/MyAddress/index.d.ts +6 -0
  51. package/dist/src/MyAddress/type.d.ts +16 -0
  52. package/dist/src/MyAddress/utils.d.ts +6 -0
  53. package/dist/src/MyImageEditor/Inner.d.ts +4 -0
  54. package/dist/src/MyImageEditor/index.d.ts +16 -0
  55. package/dist/src/MyImageEditor/init_delete_control.d.ts +1 -0
  56. package/dist/src/MyImageEditor/utils.d.ts +36 -0
  57. package/dist/src/MyInput/index.d.ts +5 -0
  58. package/dist/src/MyInput/types.d.ts +9 -0
  59. package/dist/src/MyLazyComponent/index.d.ts +6 -0
  60. package/dist/src/PDF_Frame_View/Inner.d.ts +3 -0
  61. package/dist/src/PDF_Frame_View/index.d.ts +5 -0
  62. package/dist/src/PDF_Frame_View/types.d.ts +32 -0
  63. package/dist/src/PDF_Frame_View/utils.d.ts +9 -0
  64. package/dist/src/PatientSelect/Inner.d.ts +16 -0
  65. package/dist/src/PatientSelect/index.d.ts +3 -0
  66. package/dist/src/SimpleForm/Inner.d.ts +5 -0
  67. package/dist/src/SimpleForm/components/TabForm/index.d.ts +15 -0
  68. package/dist/src/SimpleForm/components/extra/Custom.d.ts +8 -0
  69. package/dist/src/SimpleForm/components/extra/MultiInput.d.ts +6 -0
  70. package/dist/src/SimpleForm/components/extra/SimpleSelect.d.ts +6 -0
  71. package/dist/src/SimpleForm/components/extra/SwitchSelect.d.ts +4 -0
  72. package/dist/src/SimpleForm/components/index.d.ts +34 -0
  73. package/dist/src/SimpleForm/index.d.ts +17 -0
  74. package/dist/src/SimpleForm/types/help.d.ts +3 -0
  75. package/dist/src/SimpleForm/types/metaTypes.d.ts +29 -0
  76. package/dist/src/SimpleForm/types.d.ts +24 -0
  77. package/dist/src/a_chunks/index.js +550 -0
  78. package/dist/src/a_chunks/root..js +187 -0
  79. package/dist/src/a_chunks/root.2.js +318 -0
  80. package/dist/src/a_chunks/root.3.js +622 -0
  81. package/dist/src/a_chunks/root.4.js +235 -0
  82. package/dist/src/a_chunks/root.5.js +156 -0
  83. package/dist/src/a_chunks/root.6.js +310 -0
  84. package/dist/src/a_chunks/root.7.js +867 -0
  85. package/dist/src/a_chunks/root.8.js +281 -0
  86. package/dist/src/a_chunks/root.9.js +19 -0
  87. package/dist/src/a_chunks/style-inject.es.js +25 -0
  88. package/dist/src/config.d.ts +1 -0
  89. package/dist/src/hooks/index.d.ts +3 -0
  90. package/dist/src/hooks/useMchcDriverStatus.d.ts +3 -0
  91. package/dist/src/hooks/useMyEffect.d.ts +4 -0
  92. package/dist/src/hooks/use_fuck.d.ts +5 -0
  93. package/dist/src/index.d.ts +11 -0
  94. package/dist/src/index.js +10 -0
  95. package/dist/src/pack_components.d.ts +213 -0
  96. package/dist/src/style/index.d.ts +1 -0
  97. package/dist/src/utils/getInputStyle.d.ts +1 -0
  98. package/dist/src/utils/index.d.ts +1 -0
  99. package/dist/src/utils/other.d.ts +3 -0
  100. package/package.json +67 -0
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # @lm_fe/components
2
+
3
+ ## 安装
4
+
5
+ ```bash
6
+ # 查看版本信息
7
+ yarn info @lm_fe/components
8
+
9
+ # 安装核心包 @lm_fe/core 即可获得所有功能
10
+ yarn add @lm_fe/core
11
+ ```
12
+
13
+
14
+
15
+
16
+
17
+
18
+ ## 组件
19
+
20
+ ### MyAddress(兼容新旧地址组件)、MyAddressNew(新的地址组件)
21
+
22
+
23
+ ```tsx
24
+
25
+ export interface IMyAddressProps {
26
+ value?: string;
27
+ onChange?: (value: string) => void;
28
+ id?: string;
29
+ disabled?: boolean;
30
+ size?: 'large' | 'middle' | 'small';
31
+ getPopupContainer?: any;
32
+ bordered?: boolean;
33
+ // 同上按钮需要用到
34
+ form?: FormInstance
35
+ // 同上按钮配置
36
+ addressBtns?: { name: string, label: string, props: ButtonProps }[]
37
+ }
38
+
39
+ // 用法
40
+ <MyAddressNew form={form} addressBtns={[{ name: 'aa.bb', label: '同户籍地'}]} />
41
+
42
+ ```
43
+
44
+
45
+ ## License
46
+
47
+ ISC
@@ -0,0 +1,46 @@
1
+ export declare enum LIFECYCLE {
2
+ MOUNTED = 1,
3
+ UPDATING = 2,
4
+ UNMOUNTED = 3
5
+ }
6
+ export interface ICacheItem {
7
+ children: React.ReactNode;
8
+ keepAlive: boolean;
9
+ lifecycle: LIFECYCLE;
10
+ renderElement?: HTMLElement;
11
+ activated?: boolean;
12
+ ifStillActivate?: boolean;
13
+ reactivate?: () => void;
14
+ }
15
+ export interface ICache {
16
+ [key: string]: ICacheItem;
17
+ }
18
+ export interface IKeepAliveProviderImpl {
19
+ storeElement: HTMLElement;
20
+ cache: ICache;
21
+ keys: string[];
22
+ eventEmitter: any;
23
+ existed: boolean;
24
+ providerIdentification: string;
25
+ setCache: (identification: string, value: ICacheItem) => void;
26
+ removeCache: (name: string) => void;
27
+ unactivate: (identification: string) => void;
28
+ isExisted: () => boolean;
29
+ }
30
+ export interface IKeepAliveProviderProps {
31
+ include?: string | string[] | RegExp;
32
+ exclude?: string | string[] | RegExp;
33
+ max?: number;
34
+ }
35
+ export interface IKeepAliveProps {
36
+ _container?: any;
37
+ key?: string;
38
+ name?: string;
39
+ disabled?: boolean;
40
+ extra?: any;
41
+ }
42
+ export interface IKeepAliveInnerProps extends IKeepAliveProps {
43
+ _container: any;
44
+ }
45
+ export declare const keepAliveProviderTypeName = "$$KeepAliveProvider";
46
+ export declare const START_MOUNTING_DOM = "startMountingDOM";
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ interface IProps {
3
+ setMounted: (value: boolean) => void;
4
+ getMounted: () => boolean;
5
+ onUpdate: () => void;
6
+ }
7
+ interface IState {
8
+ component: any;
9
+ }
10
+ export default class AsyncComponent extends React.Component<IProps, IState> {
11
+ state: {
12
+ component: null;
13
+ };
14
+ /**
15
+ * Force update child nodes
16
+ *
17
+ * @private
18
+ * @returns
19
+ * @memberof AsyncComponent
20
+ */
21
+ private forceUpdateChildren;
22
+ componentDidMount(): void;
23
+ componentDidUpdate(): void;
24
+ shouldComponentUpdate(): boolean;
25
+ render(): null;
26
+ }
27
+ export {};
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ interface IReactCommentProps {
3
+ onLoaded: () => void;
4
+ }
5
+ declare class ReactComment extends React.PureComponent<IReactCommentProps> {
6
+ static defaultProps: {
7
+ onLoaded: () => undefined;
8
+ };
9
+ private parentNode;
10
+ private currentNode;
11
+ private commentNode;
12
+ private content;
13
+ componentDidMount(): void;
14
+ componentWillUnmount(): void;
15
+ private createComment;
16
+ render(): React.JSX.Element;
17
+ }
18
+ export default ReactComment;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ICache, ICacheItem } from '../common';
3
+ interface IConsumerProps {
4
+ children: React.ReactNode;
5
+ identification: string;
6
+ keepAlive: boolean;
7
+ cache: ICache;
8
+ setCache: (identification: string, value: ICacheItem) => void;
9
+ unactivate: (identification: string) => void;
10
+ }
11
+ declare class Consumer extends React.PureComponent<IConsumerProps> {
12
+ private renderElement;
13
+ private commentRef;
14
+ private identification;
15
+ componentDidMount(): void;
16
+ componentDidUpdate(): void;
17
+ componentWillUnmount(): void;
18
+ render(): React.JSX.Element;
19
+ }
20
+ export default Consumer;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IKeepAliveProps } from '../common';
3
+ declare const _default: React.ComponentType<IKeepAliveProps>;
4
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import { ICache, ICacheItem, IKeepAliveProviderImpl, IKeepAliveProviderProps } from '../common';
3
+ export default class KeepAliveProvider extends React.PureComponent<IKeepAliveProviderProps> implements IKeepAliveProviderImpl {
4
+ static displayName: string;
5
+ static defaultProps: {
6
+ max: number;
7
+ };
8
+ storeElement: HTMLElement;
9
+ cache: ICache;
10
+ keys: string[];
11
+ eventEmitter: {
12
+ on: (eventNames: string | string[], listener: (...args: any) => void, direction?: boolean) => void;
13
+ off: (eventNames: string | string[], listener: (...args: any) => void) => void;
14
+ emit: (eventNames: string | string[], ...args: any) => void;
15
+ clear: () => void;
16
+ listenerCount: (eventNames: string | string[]) => number;
17
+ removeAllListeners: (eventNames: string | string[]) => void;
18
+ };
19
+ existed: boolean;
20
+ private needRerender;
21
+ providerIdentification: string;
22
+ componentDidMount(): void;
23
+ componentDidUpdate(): void;
24
+ componentWillUnmount(): void;
25
+ isExisted: () => boolean;
26
+ setCache: (identification: string, value: ICacheItem) => void;
27
+ removeCache: (name: string | string[]) => void;
28
+ unactivate: (identification: string) => void;
29
+ private startMountingDOM;
30
+ render(): React.JSX.Element | null;
31
+ }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface IIdentificationContextProps {
3
+ identification: string;
4
+ eventEmitter: any;
5
+ keepAlive: boolean;
6
+ getLifecycle: () => number;
7
+ isExisted: () => boolean;
8
+ activated: boolean;
9
+ extra: any;
10
+ }
11
+ declare const WithKeepAliveContext: React.Context<IIdentificationContextProps>;
12
+ export default WithKeepAliveContext;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { IKeepAliveProviderImpl, IKeepAliveProviderProps } from '../components/Provider';
3
+ export type IKeepAliveContextProps = IKeepAliveProviderImpl & IKeepAliveProviderProps;
4
+ declare const KeepAliveContext: React.Context<any>;
5
+ export default KeepAliveContext;
@@ -0,0 +1,7 @@
1
+ import Provider from './components/provider';
2
+ import KeepAlive from './components/keepAlive';
3
+ import bindLifecycle from './utils/bindLifecycle';
4
+ import useKeepAliveEffect from './utils/useKeepAliveEffect';
5
+ import { IKeepAliveProps } from './common';
6
+ export { Provider, KeepAlive, bindLifecycle, useKeepAliveEffect, };
7
+ export { IKeepAliveProps };