CellDemo_en.svelte 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!-- Cell Demo -->
  2. <script>
  3. import { Cell, CellGroup, Toast } from '../../../../components';
  4. let visible = false;
  5. </script>
  6. <div class="flex flex-col space-y-8 py-8">
  7. <div>
  8. <Cell title="Basic usage" />
  9. <Cell title="There are details on the right are details on the right" detail="Zero" />
  10. <Cell title="Use for details Slot" detail="slot">
  11. <span slot="detail" class="text-primary dark:text-dark text-xs">I am a slot content</span>
  12. </Cell>
  13. <Cell title="There is no arrow on the right" right="none" />
  14. <Cell title="Click event" detail="Please click me" on:click={() => (visible = true)} />
  15. <Toast bind:visible message="You poke to me!" />
  16. <Cell title="There are details on the right without arrows" detail="Zero" right="none" />
  17. <Cell title="The right switch (click the whole line to trigger the switch)" right={{ type: 'switch' }} />
  18. <Cell title="Switch with details" detail="explain" right={{ type: 'switch' }} />
  19. <Cell title="Switch with text" right={{ type: 'switch', switch: { inside: ['😭', '😄'] } }} />
  20. <Cell title="Switch full round corner" right={{ type: 'switch', switch: { radius: 'full' } }} />
  21. <Cell title="Use on the left Icon" left={{ name: 'ri-bank-line', size: 20, theme: true, top: -2 }} />
  22. <Cell title="Use on the right side Icon" right={{ type: 'icon', name: 'ri-battery-charge-line', size: 20, theme: true }} />
  23. <Cell title="Left custom picture" left="slot">
  24. <div slot="left" class="w-6 h-6 mr-1">
  25. <img class="w-auto" src="/assets/images/icon_颁奖.png" alt="" />
  26. </div>
  27. </Cell>
  28. <Cell title="Custom pictures are all left and right" left="slot" right="slot">
  29. <div slot="left" class="w-6 h-6 mr-1">
  30. <img class="w-auto" src="/assets/images/icon_评价.png" alt="" />
  31. </div>
  32. <div slot="right" class="w-6 h-6 mr-1">
  33. <img class="w-auto" src="/assets/images/icon_美食.png" alt="" />
  34. </div>
  35. </Cell>
  36. <Cell title="Come to a big picture" left="slot">
  37. <div slot="left" class="w-10 h-10 mr-1">
  38. <img class="w-auto" src="/assets/images/icon_会员.png" alt="" />
  39. </div>
  40. </Cell>
  41. <Cell title="There is a secondary title on the left" subTitle="I am, but I am not second" />
  42. <Cell title="There are secondary title and right details" subTitle="I am, but I am not second" detail="Zero" />
  43. <Cell title="There is secondary information on the right" detail="Zero" info="Restart" />
  44. <Cell title="There are secondary content on the left and right sides" subTitle="I am, but I am not second" detail="Zero" info="Restart" />
  45. <Cell title="There are secondary content on the left and right sides" subTitle="I am, but I am not second" detail="Come again" info="Restart" />
  46. <Cell
  47. title="There are secondary content on the right and right"
  48. subTitle="Come again on the left Icon"
  49. detail="Come again"
  50. info="Restart"
  51. left={{ name: 'ri-shopping-basket-line', theme: true }}
  52. />
  53. <Cell title="Come on the picture too" left="slot" subTitle="Left custom picture" detail="Right arrow" info="There is no segmentation line at the bottom">
  54. <div slot="left" class="w-10 h-10 mr-1">
  55. <img class="w-auto" src="/assets/images/icon_火车票.png" alt="" />
  56. </div>
  57. </Cell>
  58. <Cell
  59. title="The title is long, long, long, long, long, long, long, long, long, long, long, long, long, long, and long, and automatically changed."
  60. subTitle="My secondary title is also very long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long, long."
  61. />
  62. <Cell
  63. title="The big picture on the left is a big picture, the title is super long, and it is automatically changed. Try the rest of the match."
  64. subTitle="My secondary title is also very good...Oh not long."
  65. left="slot"
  66. line={false}
  67. >
  68. <div slot="left" class="w-28 h-6 mr-1">
  69. <img class="w-auto" src="/assets/images/icon_外卖.png" alt="" />
  70. </div>
  71. </Cell>
  72. </div>
  73. <CellGroup>
  74. <Cell title="Group" mx="0" my="0" shadow="none" line radius="none" />
  75. <Cell title="Group" mx="0" my="0" shadow="none" radius="none" />
  76. </CellGroup>
  77. <CellGroup mx="0" radius="none">
  78. <Cell title="Group" detail="No horizontal spacing" mx="0" my="0" shadow="none" line radius="none" />
  79. <Cell title="Group" detail="Non rounded" mx="0" my="0" shadow="none" radius="none" />
  80. </CellGroup>
  81. <CellGroup shadow="xl" radius="2xl">
  82. <Cell title="Group" detail="Increase projection" mx="0" my="0" shadow="none" line radius="none" />
  83. <Cell title="Group" detail="Increase the corner" mx="0" my="0" shadow="none" radius="none" />
  84. </CellGroup>
  85. <div>
  86. <Cell title="Left -right distance" mx="0" radius="none" />
  87. <Cell title="Non -rounded" radius="none" />
  88. <Cell title="Basic rounded corner" radius="base" />
  89. <Cell title="Medium corner" radius="md" />
  90. <Cell title="Large rounded corner" radius="lg" />
  91. <Cell title="Increase the corner" radius="xl" />
  92. <Cell title="Larger corner" radius="2xl" />
  93. <Cell title="All -rounded corner" radius="full" />
  94. <Cell title="Increase projection" shadow="lg" />
  95. </div>
  96. <div>
  97. <Cell title="Custom text color" injClass="text-primary dark:text-dark" />
  98. <Cell title="Custom background color" injClass="!bg-purple/20 active:!bg-purple/10" line={false} />
  99. </div>
  100. <div>
  101. <Cell love title="Love version" />
  102. <Cell love title="Love version" detail="Love version" />
  103. <Cell love title="Love version" left={{ name: 'ri-hand-heart-line', theme: true }} />
  104. </div>
  105. </div>