@tellescope/react-components 1.195.0 → 1.196.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/lib/cjs/Forms/inputs.js +1 -1
- package/lib/cjs/Forms/inputs.js.map +1 -1
- package/lib/cjs/Forms/wysiwyg.d.ts +2 -1
- package/lib/cjs/Forms/wysiwyg.d.ts.map +1 -1
- package/lib/cjs/Forms/wysiwyg.js +7 -2
- package/lib/cjs/Forms/wysiwyg.js.map +1 -1
- package/lib/cjs/table.d.ts +3 -1
- package/lib/cjs/table.d.ts.map +1 -1
- package/lib/cjs/table.js +52 -3
- package/lib/cjs/table.js.map +1 -1
- package/lib/esm/Forms/inputs.js +1 -1
- package/lib/esm/Forms/inputs.js.map +1 -1
- package/lib/esm/Forms/wysiwyg.d.ts +2 -1
- package/lib/esm/Forms/wysiwyg.d.ts.map +1 -1
- package/lib/esm/Forms/wysiwyg.js +7 -2
- package/lib/esm/Forms/wysiwyg.js.map +1 -1
- package/lib/esm/table.d.ts +3 -1
- package/lib/esm/table.d.ts.map +1 -1
- package/lib/esm/table.js +52 -3
- package/lib/esm/table.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/Forms/inputs.tsx +1 -1
- package/src/Forms/wysiwyg.tsx +8 -1
- package/src/table.tsx +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/react-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.196.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"@reduxjs/toolkit": "^1.6.2",
|
|
48
48
|
"@stripe/react-stripe-js": "^2.9.0",
|
|
49
49
|
"@stripe/stripe-js": "^1.52.1",
|
|
50
|
-
"@tellescope/constants": "^1.
|
|
51
|
-
"@tellescope/sdk": "^1.
|
|
52
|
-
"@tellescope/types-client": "^1.
|
|
53
|
-
"@tellescope/types-models": "^1.
|
|
54
|
-
"@tellescope/types-utilities": "^1.
|
|
55
|
-
"@tellescope/utilities": "^1.
|
|
56
|
-
"@tellescope/validation": "^1.
|
|
50
|
+
"@tellescope/constants": "^1.196.0",
|
|
51
|
+
"@tellescope/sdk": "^1.196.0",
|
|
52
|
+
"@tellescope/types-client": "^1.196.0",
|
|
53
|
+
"@tellescope/types-models": "^1.196.0",
|
|
54
|
+
"@tellescope/types-utilities": "^1.196.0",
|
|
55
|
+
"@tellescope/utilities": "^1.196.0",
|
|
56
|
+
"@tellescope/validation": "^1.196.0",
|
|
57
57
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
58
58
|
"@typescript-eslint/parser": "^4.33.0",
|
|
59
59
|
"css-to-react-native": "^3.0.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
85
85
|
"react-native": "^0.65.0 || ^0.66.0 || ^0.67.0 || ^0.68.0 || ^0.71.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "5775521d0ee6a92be5139fb0466772d40ab4d0af",
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
}
|
package/src/Forms/inputs.tsx
CHANGED
|
@@ -3397,7 +3397,7 @@ export const ConditionsInput = ({ goToNextField, goToPreviousField, field, value
|
|
|
3397
3397
|
}
|
|
3398
3398
|
|
|
3399
3399
|
export const RichTextInput = ({ field, value, onChange }: FormInputProps<'Rich Text'>) => (
|
|
3400
|
-
<WYSIWYG initialHTML={value} onChange={v => onChange(v, field.id)} style={{ width: '100%' }} editorStyle={{ width: '100%' }} />
|
|
3400
|
+
<WYSIWYG stopEnterPropagation initialHTML={value} onChange={v => onChange(v, field.id)} style={{ width: '100%' }} editorStyle={{ width: '100%' }} />
|
|
3401
3401
|
)
|
|
3402
3402
|
|
|
3403
3403
|
export const ChargeebeeInput = ({ field, value, onChange, setCustomerId }: FormInputProps<'Chargebee'> & {
|
package/src/Forms/wysiwyg.tsx
CHANGED
|
@@ -167,11 +167,12 @@ const getToolbar = ({ hideEmoji } : { hideEmoji?: boolean }) => ({
|
|
|
167
167
|
|
|
168
168
|
|
|
169
169
|
|
|
170
|
-
export const WYSIWYG = ({ updateHtml, initialHTML: _initialHTML='', autoFocus, onChange, style, editorStyle, hideEmoji } : {
|
|
170
|
+
export const WYSIWYG = ({ stopEnterPropagation, updateHtml, initialHTML: _initialHTML='', autoFocus, onChange, style, editorStyle, hideEmoji } : {
|
|
171
171
|
initialHTML?: string, onChange: (html: string) => void, autoFocus?: boolean,
|
|
172
172
|
editorStyle?: React.CSSProperties,
|
|
173
173
|
hideEmoji?: boolean,
|
|
174
174
|
updateHtml?: string,
|
|
175
|
+
stopEnterPropagation?: boolean,
|
|
175
176
|
} & Styled) => {
|
|
176
177
|
const trimmed = _initialHTML.trim()
|
|
177
178
|
const initialHTML = (
|
|
@@ -228,6 +229,12 @@ export const WYSIWYG = ({ updateHtml, initialHTML: _initialHTML='', autoFocus, o
|
|
|
228
229
|
editorClassName="demo-editor"
|
|
229
230
|
onEditorStateChange={setEditorState}
|
|
230
231
|
toolbar={toolbar}
|
|
232
|
+
handleReturn={e => {
|
|
233
|
+
if (stopEnterPropagation) {
|
|
234
|
+
e.stopPropagation()
|
|
235
|
+
}
|
|
236
|
+
return false // not handled (allow editor to update)
|
|
237
|
+
}}
|
|
231
238
|
/>
|
|
232
239
|
</Paper>
|
|
233
240
|
)
|
package/src/table.tsx
CHANGED
|
@@ -499,6 +499,7 @@ export interface PaginationOptions<T> {
|
|
|
499
499
|
pageSize?: number;
|
|
500
500
|
initialPage?: number;
|
|
501
501
|
pageMemoryId?: string,
|
|
502
|
+
showLoadAll?: boolean,
|
|
502
503
|
}
|
|
503
504
|
export interface PaginationProps<T> extends PaginationOptions<T> {
|
|
504
505
|
items: T[];
|
|
@@ -568,6 +569,7 @@ export const usePagination = <T,>({ paginated=true, items, pageMemoryId, pageSiz
|
|
|
568
569
|
|
|
569
570
|
export interface TableFooterProps <T> extends Styled, HorizontalPadded, Partial<LoadMoreFunctions<T>>, ReturnType<typeof usePagination> {
|
|
570
571
|
loadMoreOptions?: LoadMoreOptions<T>,
|
|
572
|
+
showLoadAll?: boolean,
|
|
571
573
|
}
|
|
572
574
|
export const TableFooter = <T,>({ horizontalPadding, style, previousDisabled, nextDisabled, selectedPage, numPages, goToNext, goToPrevious } : TableFooterProps<T>) => {
|
|
573
575
|
return (
|
|
@@ -608,7 +610,7 @@ const resolve_middle_page_numbers = (selectedPage: number, numPages: number): [u
|
|
|
608
610
|
}
|
|
609
611
|
|
|
610
612
|
const FOOTER_BUTTON_SIZE = 30
|
|
611
|
-
export const TableFooterNumbered = <T,>({ horizontalPadding, loadMore, loadMoreOptions, doneLoading, style, previousDisabled, nextDisabled, selectedPage, numPages, goToNext, goToPrevious, goToPage } : TableFooterProps<T>) => {
|
|
613
|
+
export const TableFooterNumbered = <T,>({ showLoadAll, horizontalPadding, loadMore, loadMoreOptions, doneLoading, style, previousDisabled, nextDisabled, selectedPage, numPages, goToNext, goToPrevious, goToPage } : TableFooterProps<T>) => {
|
|
612
614
|
const [middleLeft, middle, middleRight] = resolve_middle_page_numbers(selectedPage, numPages)
|
|
613
615
|
|
|
614
616
|
const buttonProps = {
|
|
@@ -679,6 +681,18 @@ export const TableFooterNumbered = <T,>({ horizontalPadding, loadMore, loadMoreO
|
|
|
679
681
|
<NavigateNextIcon/>
|
|
680
682
|
</Button>
|
|
681
683
|
|
|
684
|
+
{showLoadAll &&
|
|
685
|
+
<LoadingButton variant="outlined" submitText="Load All" submittingText="Loading..."
|
|
686
|
+
style={{ width: 175, height: 32, marginLeft: 5 }}
|
|
687
|
+
disabled={doneLoading?.()}
|
|
688
|
+
onClick={async () => {
|
|
689
|
+
while (!doneLoading?.()) {
|
|
690
|
+
await loadMore?.(loadMoreOptions)
|
|
691
|
+
}
|
|
692
|
+
}}
|
|
693
|
+
/>
|
|
694
|
+
}
|
|
695
|
+
|
|
682
696
|
|
|
683
697
|
<Typography style={{ fontSize: 12, marginLeft: 'auto' }}>
|
|
684
698
|
Page {selectedPage + 1} of {numPages}
|
|
@@ -1145,7 +1159,7 @@ export const Table = <T extends Item>({
|
|
|
1145
1159
|
} />
|
|
1146
1160
|
|
|
1147
1161
|
{paginated && FooterComponent && items.length > 0 && // avoid displaying footer / unnecessary border when no items
|
|
1148
|
-
<FooterComponent doneLoading={doneLoading} loadMore={loadMore} loadMoreOptions={loadMoreOptions} {...paginationProps } {...pageOptions} horizontalPadding={horizontalPadding}/>
|
|
1162
|
+
<FooterComponent showLoadAll={pageOptions.showLoadAll} doneLoading={doneLoading} loadMore={loadMore} loadMoreOptions={loadMoreOptions} {...paginationProps } {...pageOptions} horizontalPadding={horizontalPadding}/>
|
|
1149
1163
|
}
|
|
1150
1164
|
</Flex>
|
|
1151
1165
|
)
|