@performant-software/semantic-components 1.0.25 → 1.0.26-beta.0
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/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AssociatedDropdown.js +4 -2
- package/src/components/EmbeddedList.js +4 -0
- package/src/components/FileUploadModal.js +9 -0
- package/src/components/ListTable.js +4 -0
- package/src/index.js +2 -0
- package/types/components/AssociatedDropdown.js.flow +4 -2
- package/types/components/EmbeddedList.js.flow +4 -0
- package/types/components/FileUploadModal.js.flow +9 -0
- package/types/components/ListTable.js.flow +4 -0
- package/types/index.js.flow +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@performant-software/semantic-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26-beta.0",
|
|
4
4
|
"description": "A package of shared components based on the Semantic UI Framework.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build": "webpack --mode production && flow-copy-source -v src types"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@performant-software/shared-components": "^1.0.
|
|
15
|
+
"@performant-software/shared-components": "^1.0.26-beta.0",
|
|
16
16
|
"@react-google-maps/api": "^2.8.1",
|
|
17
17
|
"axios": "^0.26.1",
|
|
18
18
|
"i18next": "^19.4.4",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Timer } from '@performant-software/shared-components';
|
|
4
|
-
import React, { Component } from 'react';
|
|
4
|
+
import React, { Component, type ComponentType } from 'react';
|
|
5
5
|
import { Button, Dropdown, Message } from 'semantic-ui-react';
|
|
6
6
|
import _ from 'underscore';
|
|
7
7
|
import EditModal from './EditModal';
|
|
@@ -18,8 +18,9 @@ type Option = {
|
|
|
18
18
|
type Props = {
|
|
19
19
|
className?: string,
|
|
20
20
|
collectionName: string,
|
|
21
|
+
header?: ComponentType<any>,
|
|
21
22
|
modal?: {
|
|
22
|
-
component:
|
|
23
|
+
component: ComponentType<any>,
|
|
23
24
|
props: any,
|
|
24
25
|
onSave: (item: any) => Promise<any>,
|
|
25
26
|
state: any
|
|
@@ -181,6 +182,7 @@ class AssociatedDropdown extends Component<Props, State> {
|
|
|
181
182
|
<Dropdown
|
|
182
183
|
className={`inline-dropdown ${this.props.className || ''}`}
|
|
183
184
|
disabled={this.state.loading}
|
|
185
|
+
header={this.props.header}
|
|
184
186
|
loading={this.state.loading}
|
|
185
187
|
onBlur={this.onBlur.bind(this)}
|
|
186
188
|
onChange={this.onOptionSelection.bind(this)}
|
|
@@ -48,6 +48,11 @@ type Props = {
|
|
|
48
48
|
*/
|
|
49
49
|
onClose: () => void,
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Callback fired when the upload has completed.
|
|
53
|
+
*/
|
|
54
|
+
onComplete: () => void,
|
|
55
|
+
|
|
51
56
|
/**
|
|
52
57
|
* Callback fired when the save button is clicked. See <code>strategy</code> prop.
|
|
53
58
|
*/
|
|
@@ -151,6 +156,10 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
|
|
|
151
156
|
const onComplete = useCallback(() => {
|
|
152
157
|
setUploading(false);
|
|
153
158
|
|
|
159
|
+
if (props.onComplete) {
|
|
160
|
+
props.onComplete();
|
|
161
|
+
}
|
|
162
|
+
|
|
154
163
|
if (props.closeOnComplete) {
|
|
155
164
|
props.onClose();
|
|
156
165
|
}
|
package/src/index.js
CHANGED
|
@@ -109,8 +109,10 @@ export { default as BatchEdit } from './hooks/BatchEdit';
|
|
|
109
109
|
|
|
110
110
|
// Types
|
|
111
111
|
export type { EditPageProps } from './components/EditPage';
|
|
112
|
+
export type { Props as EmbeddedListProps } from './components/EmbeddedList';
|
|
112
113
|
export type { FileUploadProps } from './components/FileUploadModal';
|
|
113
114
|
export type { Props as ListProps } from './components/List';
|
|
115
|
+
export type { Props as ListTableProps } from './components/ListTable';
|
|
114
116
|
export type { BatchEditProps } from './hooks/BatchEdit';
|
|
115
117
|
|
|
116
118
|
// Constants
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
|
|
3
3
|
import { Timer } from '@performant-software/shared-components';
|
|
4
|
-
import React, { Component } from 'react';
|
|
4
|
+
import React, { Component, type ComponentType } from 'react';
|
|
5
5
|
import { Button, Dropdown, Message } from 'semantic-ui-react';
|
|
6
6
|
import _ from 'underscore';
|
|
7
7
|
import EditModal from './EditModal';
|
|
@@ -18,8 +18,9 @@ type Option = {
|
|
|
18
18
|
type Props = {
|
|
19
19
|
className?: string,
|
|
20
20
|
collectionName: string,
|
|
21
|
+
header?: ComponentType<any>,
|
|
21
22
|
modal?: {
|
|
22
|
-
component:
|
|
23
|
+
component: ComponentType<any>,
|
|
23
24
|
props: any,
|
|
24
25
|
onSave: (item: any) => Promise<any>,
|
|
25
26
|
state: any
|
|
@@ -181,6 +182,7 @@ class AssociatedDropdown extends Component<Props, State> {
|
|
|
181
182
|
<Dropdown
|
|
182
183
|
className={`inline-dropdown ${this.props.className || ''}`}
|
|
183
184
|
disabled={this.state.loading}
|
|
185
|
+
header={this.props.header}
|
|
184
186
|
loading={this.state.loading}
|
|
185
187
|
onBlur={this.onBlur.bind(this)}
|
|
186
188
|
onChange={this.onOptionSelection.bind(this)}
|
|
@@ -48,6 +48,11 @@ type Props = {
|
|
|
48
48
|
*/
|
|
49
49
|
onClose: () => void,
|
|
50
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Callback fired when the upload has completed.
|
|
53
|
+
*/
|
|
54
|
+
onComplete: () => void,
|
|
55
|
+
|
|
51
56
|
/**
|
|
52
57
|
* Callback fired when the save button is clicked. See <code>strategy</code> prop.
|
|
53
58
|
*/
|
|
@@ -151,6 +156,10 @@ const FileUploadModal: ComponentType<any> = (props: Props) => {
|
|
|
151
156
|
const onComplete = useCallback(() => {
|
|
152
157
|
setUploading(false);
|
|
153
158
|
|
|
159
|
+
if (props.onComplete) {
|
|
160
|
+
props.onComplete();
|
|
161
|
+
}
|
|
162
|
+
|
|
154
163
|
if (props.closeOnComplete) {
|
|
155
164
|
props.onClose();
|
|
156
165
|
}
|
package/types/index.js.flow
CHANGED
|
@@ -109,8 +109,10 @@ export { default as BatchEdit } from './hooks/BatchEdit';
|
|
|
109
109
|
|
|
110
110
|
// Types
|
|
111
111
|
export type { EditPageProps } from './components/EditPage';
|
|
112
|
+
export type { Props as EmbeddedListProps } from './components/EmbeddedList';
|
|
112
113
|
export type { FileUploadProps } from './components/FileUploadModal';
|
|
113
114
|
export type { Props as ListProps } from './components/List';
|
|
115
|
+
export type { Props as ListTableProps } from './components/ListTable';
|
|
114
116
|
export type { BatchEditProps } from './hooks/BatchEdit';
|
|
115
117
|
|
|
116
118
|
// Constants
|