index.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import { DraggerLayout } from '../App';
  3. import './index.css';
  4. var Words = [{ content: 'Sorry I just can not move in any circumstances', img: 'http://pic.sc.chinaz.com/files/pic/pic9/201303/xpic10472.jpg', static: true }, { content: 'Those who dare to fail miserably can achieve greatly.', img: 'https://img00.deviantart.net/1163/i/2013/059/d/7/irish_views_by_ssquared_photography-d5wjnsk.jpg' }, { content: 'You miss 100 percent of the shots you never take.', img: 'http://www.landsendhotel.co.uk/uploads/gallery/gallery/coastal_scenery_seascapes_6.jpg' }, { content: 'Those who believe in telekinetics, raise my hand.', img: 'https://tctechcrunch2011.files.wordpress.com/2017/10/26099344353_18cd6fabb8_k.jpg?w=738' }, { content: 'I’d rather live with a good question than a bad answer.', img: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVa26cLzh6PYUwY4LMpwbHyDHFmWi_w2JuqDzeOdm1IIEbBZO0Vg' }];
  5. var Cell = function Cell(_ref) {
  6. var item = _ref.item;
  7. return React.createElement(
  8. 'div',
  9. { className: 'layout-Cell ' + (item.static ? "static" : ""), style: { background: item.static ? "#e8e8e8" : "" } },
  10. React.createElement('img', { src: item.img, style: { width: 45, height: 45 }, draggable: false, alt: 'card' }),
  11. React.createElement(
  12. 'div',
  13. { style: { paddingLeft: 12, color: '#595959' } },
  14. item.content
  15. )
  16. );
  17. };
  18. export var SortedTableWithStatic = function SortedTableWithStatic() {
  19. return React.createElement(
  20. 'div',
  21. { style: { display: 'flex', justifyContent: 'center' } },
  22. React.createElement(
  23. 'div',
  24. null,
  25. React.createElement(
  26. 'h1',
  27. { style: { textAlign: 'center' } },
  28. 'Static Header Table Demo'
  29. ),
  30. React.createElement(
  31. DraggerLayout,
  32. { width: 800, col: 1, rowHeight: 60, margin: [2, 2], className: 'normal-layout' },
  33. Words.map(function (el, index) {
  34. return React.createElement(Cell, { item: el, key: index, 'data-set': { GridX: 0, GridY: 0, w: 1, h: 1, static: index === 0 ? true : false } });
  35. })
  36. )
  37. )
  38. );
  39. };
  40. ;
  41. var _temp = function () {
  42. if (typeof __REACT_HOT_LOADER__ === 'undefined') {
  43. return;
  44. }
  45. __REACT_HOT_LOADER__.register(Words, 'Words', 'app/src/StaticHeader/index.js');
  46. __REACT_HOT_LOADER__.register(Cell, 'Cell', 'app/src/StaticHeader/index.js');
  47. __REACT_HOT_LOADER__.register(SortedTableWithStatic, 'SortedTableWithStatic', 'app/src/StaticHeader/index.js');
  48. }();
  49. ;