@ainias42/react-bootstrap-mobile 0.1.8 → 0.1.10

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.
@@ -40,4 +40,27 @@ $breakpoints: $grid-breakpoints;
40
40
  }
41
41
  }
42
42
  }
43
+
44
+ @media print {
45
+ @for $i from 1 through $columns {
46
+ .item-print-#{$i} {
47
+ grid-column: auto / span $i;
48
+ }
49
+ }
50
+
51
+ // Start with `1` because `0` is and invalid value.
52
+ // Ends with `$columns - 1` because offsetting by the width of an entire row isn't possible.
53
+ @for $i from 1 through ($columns - 1) {
54
+ .start-print-#{$i} {
55
+ grid-column-start: $i;
56
+ }
57
+ }
58
+
59
+ // Add classes for reordering
60
+ @for $i from -10 through 10 {
61
+ .order-print-#{$i} {
62
+ order: $i;
63
+ }
64
+ }
65
+ }
43
66
  }
@@ -32,15 +32,11 @@ export const List = withMemo(function List<ItemType>({
32
32
 
33
33
  // Callbacks
34
34
  const renderItemInner = useCallback<ComponentType<ListChildComponentProps>>(
35
- ({ index, style: itemStyle }) => {
36
- return renderItem(items[index], itemStyle, index);
37
- },
35
+ ({ index, style: itemStyle }) => renderItem(items[index], itemStyle, index),
38
36
  [items, renderItem]
39
37
  );
40
38
 
41
- const setHeight = useCallback<SizeCalculatorProps['onSize']>((_, height) => {
42
- setItemHeight(height);
43
- }, []);
39
+ const setHeight = useCallback<SizeCalculatorProps['onSize']>((_, height) => setItemHeight(height), []);
44
40
 
45
41
  // Effects
46
42
 
@@ -68,17 +64,19 @@ export const List = withMemo(function List<ItemType>({
68
64
  )}
69
65
  </SizeCalculator>
70
66
  )}
71
- <FixedSizeList
72
- height={height}
73
- itemCount={items.length}
74
- width={width}
75
- itemSize={itemHeight}
76
- style={style}
77
- className={className}
78
- itemData={items}
79
- >
80
- {renderItemInner}
81
- </FixedSizeList>
67
+ {height !== undefined && width !== undefined && (
68
+ <FixedSizeList
69
+ height={height}
70
+ itemCount={items.length}
71
+ width={width}
72
+ itemSize={itemHeight}
73
+ style={style}
74
+ className={className}
75
+ itemData={items}
76
+ >
77
+ {renderItemInner}
78
+ </FixedSizeList>
79
+ )}
82
80
  </>
83
81
  );
84
82
  }}
@@ -1,10 +1,10 @@
1
1
  import { CSSProperties, ReactNode } from 'react';
2
2
  import { Recursive } from '../TypeHelpers';
3
3
 
4
- type Child = Recursive<JSX.Element | undefined | null | Child[]> | false;
4
+ export type RbmChildWithoutString = Recursive<JSX.Element | undefined | null | RbmChildWithoutString[]> | false;
5
5
  export type WithNoStringProps =
6
6
  | {
7
- children?: Child;
7
+ children?: RbmChildWithoutString;
8
8
  __allowChildren?: 'html';
9
9
  }
10
10
  | {
@@ -14,7 +14,7 @@ export type WithNoStringProps =
14
14
 
15
15
  export type WithNoStringAndChildrenProps =
16
16
  | {
17
- children: Child;
17
+ children: RbmChildWithoutString;
18
18
  __allowChildren?: 'html';
19
19
  }
20
20
  | {
package/webpack.config.js CHANGED
@@ -23,7 +23,7 @@ const banner = `
23
23
  module.exports = (env) => {
24
24
  return {
25
25
  mode: env.production ? 'production' : 'development',
26
- // devtool: 'source-map',
26
+ devtool: env.production ? 'source-map' : 'eval-source-map',
27
27
  entry: './bootstrapReactMobile.ts',
28
28
  output: {
29
29
  filename: 'bootstrapReactMobile.js',