@gisce/react-ooui 0.2.0 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/widgets/containers/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,IAAI,aAAa,EAAiB,MAAM,aAAa,CAAC;AAYxE,aAAK,KAAK,GAAG;IACX,SAAS,EAAE,aAAa,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,KAAK,KAAG,MAAM,YA4EvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../../src/widgets/containers/Container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,IAAI,aAAa,EAAiB,MAAM,aAAa,CAAC;AAYxE,aAAK,KAAK,GAAG;IACX,SAAS,EAAE,aAAa,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,QAAA,MAAM,SAAS,UAAW,KAAK,KAAG,MAAM,YA+EvC,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -39,15 +39,16 @@ var Container = function (props) {
39
39
  row: rowWithoutInvisibleFields,
40
40
  numberOfColumns: columns,
41
41
  });
42
- var rowWithEmptiesToFit = containerHelper_1.fillRowWithEmptiesToFit({
43
- row: rowWithExpandedItems,
44
- numberOfColumns: columns,
45
- mustFillWithEmpties: responsiveBehaviour,
46
- });
42
+ var rowWithEmptiesToFit;
47
43
  if (i === 0) {
44
+ rowWithEmptiesToFit = containerHelper_1.fillRowWithEmptiesToFit({
45
+ row: rowWithExpandedItems,
46
+ numberOfColumns: columns,
47
+ mustFillWithEmpties: responsiveBehaviour,
48
+ });
48
49
  firstRow = firstRow.concat(rowWithEmptiesToFit);
49
50
  }
50
- return rowWithEmptiesToFit.map(function (item, j) {
51
+ return (i === 0 ? rowWithEmptiesToFit : rowWithExpandedItems).map(function (item, j) {
51
52
  // We check if we have any label+field inside the container.
52
53
  // In this scenario, we must format the grid accordingly
53
54
  // Otherwise, the grid will divide uniformly
@@ -1 +1 @@
1
- {"version":3,"file":"Container.js","sourceRoot":"","sources":["../../../src/widgets/containers/Container.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,oCAAwE;AACxE,yDAA4D;AAE5D,6DAOmC;AAOnC,IAAM,SAAS,GAAG,UAAC,KAAY;IACrB,IAAA,SAAS,GAA0B,KAAK,UAA/B,EAAE,mBAAmB,GAAK,KAAK,oBAAV,CAAW;IACzC,IAAA,IAAI,GAAK,SAAS,KAAd,CAAe;IACrB,IAAA,OAAO,GAAK,SAAS,QAAd,CAAe;IAE5B,gDAAgD;IAChD,qDAAqD;IACrD,8BAA8B;IAC9B,IAAM,iBAAiB,GAAG,sCAAoB,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,iBAAiB,GAAG,OAAO,EAAE;QAC/B,OAAO,GAAG,iBAAiB,CAAC;KAC7B;IAED,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,QAAQ,GAAa,EAAE,CAAC;IAE5B,IAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,UAAC,GAAa,EAAE,CAAC;QACxC,IAAM,yBAAyB,GAAG,GAAG,CAAC,MAAM,CAAC,UAAC,MAAM;YAClD,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,IAAM,oBAAoB,GAAG,uCAAqB,CAAC;YACjD,GAAG,EAAE,yBAAyB;YAC9B,eAAe,EAAE,OAAO;SACzB,CAAC,CAAC;QAEH,IAAM,mBAAmB,GAAG,yCAAuB,CAAC;YAClD,GAAG,EAAE,oBAAoB;YACz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
2
  "name": "@gisce/react-ooui",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist",
@@ -46,7 +46,6 @@ const testArch = `<form><notebook name="notebook"><page string="Corbes">
46
46
  <field name="name" string="Última corba"/>
47
47
  <field name="surname" string="Format"/>
48
48
  </group>
49
- <group colspan="2"></group>
50
49
  </group>
51
50
  </page></notebook>
52
51
  </form>`;
@@ -42,41 +42,44 @@ const Container = (props: Props): React.ReactElement => {
42
42
  numberOfColumns: columns,
43
43
  });
44
44
 
45
- const rowWithEmptiesToFit = fillRowWithEmptiesToFit({
46
- row: rowWithExpandedItems,
47
- numberOfColumns: columns,
48
- mustFillWithEmpties: responsiveBehaviour,
49
- });
50
-
45
+ let rowWithEmptiesToFit;
51
46
  if (i === 0) {
47
+ rowWithEmptiesToFit = fillRowWithEmptiesToFit({
48
+ row: rowWithExpandedItems,
49
+ numberOfColumns: columns,
50
+ mustFillWithEmpties: responsiveBehaviour,
51
+ });
52
+
52
53
  firstRow = firstRow.concat(rowWithEmptiesToFit);
53
54
  }
54
55
 
55
- return rowWithEmptiesToFit.map((item: Widget, j: number) => {
56
- // We check if we have any label+field inside the container.
57
- // In this scenario, we must format the grid accordingly
58
- // Otherwise, the grid will divide uniformly
59
- if (item instanceof Label && (item as Label).fieldForLabel) {
60
- fieldInRows = true;
61
- }
56
+ return (i === 0 ? rowWithEmptiesToFit : rowWithExpandedItems).map(
57
+ (item: Widget, j: number) => {
58
+ // We check if we have any label+field inside the container.
59
+ // In this scenario, we must format the grid accordingly
60
+ // Otherwise, the grid will divide uniformly
61
+ if (item instanceof Label && (item as Label).fieldForLabel) {
62
+ fieldInRows = true;
63
+ }
62
64
 
63
- const itemRowIndex = row.indexOf(item);
65
+ const itemRowIndex = row.indexOf(item);
64
66
 
65
- return (
66
- <div
67
- key={`${i.toString()}-${itemRowIndex.toString()}`}
68
- style={{
69
- ...getSpanStyleForItem({ item, responsiveBehaviour }),
70
- minWidth: 0,
71
- }}
72
- >
73
- {createReactWidget({
74
- ooui: item,
75
- responsiveBehaviour,
76
- })}
77
- </div>
78
- );
79
- });
67
+ return (
68
+ <div
69
+ key={`${i.toString()}-${itemRowIndex.toString()}`}
70
+ style={{
71
+ ...getSpanStyleForItem({ item, responsiveBehaviour }),
72
+ minWidth: 0,
73
+ }}
74
+ >
75
+ {createReactWidget({
76
+ ooui: item,
77
+ responsiveBehaviour,
78
+ })}
79
+ </div>
80
+ );
81
+ }
82
+ );
80
83
  });
81
84
 
82
85
  const templateColumns =