@open-condo/ui 1.22.0 → 1.23.1
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/dist/components/Modal/index.d.ts +6 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/useModal.d.ts +20 -0
- package/dist/components/Modal/useModal.d.ts.map +1 -0
- package/dist/components/_utils/hooks/usePatchElement.d.ts +6 -0
- package/dist/components/_utils/hooks/usePatchElement.d.ts.map +1 -0
- package/dist/index.js +219 -2
- package/dist/style-vars/variables.css +1 -1
- package/dist/style-vars/variables.less +1 -1
- package/dist/styles.css +1 -0
- package/dist/styles.min.css +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { Modal } from './modal';
|
|
1
|
+
import { Modal as ModalComponent } from './modal';
|
|
2
|
+
import { useModal } from './useModal';
|
|
2
3
|
import './style.less';
|
|
4
|
+
declare type CompoundedModal = typeof ModalComponent & {
|
|
5
|
+
useModal: typeof useModal;
|
|
6
|
+
};
|
|
7
|
+
declare const Modal: CompoundedModal;
|
|
3
8
|
export type { ModalProps } from './modal';
|
|
4
9
|
export { Modal };
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,MAAM,SAAS,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,cAAc,CAAA;AAErB,aAAK,eAAe,GAAG,OAAO,cAAc,GAAG;IAC3C,QAAQ,EAAE,OAAO,QAAQ,CAAA;CAC5B,CAAA;AAED,QAAA,MAAM,KAAK,EAAE,eAAmD,CAAA;AAKhE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Original antd implementation: https://github.com/ant-design/ant-design/tree/4.x-stable/components/modal/useModal
|
|
3
|
+
* Replaced info / warn dialogs with simpler Modal component using onCancel prop
|
|
4
|
+
* Also added a bit more type safety and proper hook deps
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { ModalProps } from './modal';
|
|
8
|
+
declare type AnyArgs = Array<any>;
|
|
9
|
+
declare type ModalConfig = Omit<ModalProps, 'open'> & {
|
|
10
|
+
onCancel?: (...args: AnyArgs) => any;
|
|
11
|
+
};
|
|
12
|
+
declare type UpdateModalFunc = (newConfig: ModalConfig) => void;
|
|
13
|
+
declare type DestroyModalFunc = () => void;
|
|
14
|
+
declare type ShowModalFunc = (config: ModalConfig) => {
|
|
15
|
+
update: UpdateModalFunc;
|
|
16
|
+
destroy: DestroyModalFunc;
|
|
17
|
+
};
|
|
18
|
+
export declare function useModal(): [ShowModalFunc, React.ReactElement];
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=useModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useModal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/useModal.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAwE,MAAM,OAAO,CAAA;AAM5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,aAAK,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;AAEzB,aAAK,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG;IAC1C,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,KAAK,GAAG,CAAA;CACvC,CAAA;AA8DD,aAAK,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,KAAK,IAAI,CAAA;AACvD,aAAK,gBAAgB,GAAG,MAAM,IAAI,CAAA;AAClC,aAAK,aAAa,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAEpG,wBAAgB,QAAQ,IAAK,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC,CA8D/D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Elements = Array<React.ReactElement>;
|
|
3
|
+
declare type Patcher = (el: React.ReactElement) => (() => void);
|
|
4
|
+
export declare function usePatchElement(): [Elements, Patcher];
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=usePatchElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePatchElement.d.ts","sourceRoot":"","sources":["../../../../src/components/_utils/hooks/usePatchElement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAEpD,aAAK,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;AACzC,aAAK,OAAO,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,YAAY,KAAK,CAAC,MAAM,IAAI,CAAC,CAAA;AAEvD,wBAAgB,eAAe,IAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAYtD"}
|