From ab668d74eb717ca9d3c3a5d234d6690598e14457 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Date: Wed, 19 May 2021 11:16:30 -0700 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Delete=20key-value=20row?= =?UTF-8?q?=20and=20other=20tweaks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Delete the recently introduced key-value class for rows, for they key-value lookalike, when editing we want to use 3 colums on the table rather than 2. Some style's tweaks to simplify --- .../components/rose/table/index.stories.mdx | 77 ++++++++----- .../styles/rose/components/table/_table.scss | 23 +--- .../rose/tests/dummy/app/templates/index.hbs | 109 +++++++----------- 3 files changed, 99 insertions(+), 110 deletions(-) diff --git a/addons/rose/addon/components/rose/table/index.stories.mdx b/addons/rose/addon/components/rose/table/index.stories.mdx index 7c91f0de4..444419be4 100644 --- a/addons/rose/addon/components/rose/table/index.stories.mdx +++ b/addons/rose/addon/components/rose/table/index.stories.mdx @@ -6,9 +6,7 @@ import { boolean, select } from '@storybook/addon-knobs'; # Table -A table component to display data in structure of rows and columns. It supports `header`, `body` and `footer` optional definitions. Each definition allows for a table `row` to be defined with either a `cell` or `headerCell` table element. Rows can be visually hidden, styled for a key/value visualization, cells can be shrinked to its content with, and center/right cell alignment is supported. - -Row `key/value` style should be applied per row. +A table component to display data in structure of rows and columns. It supports `header`, `body` and `footer` optional definitions. Each definition allows for a table `row` to be defined with either a `cell` or `headerCell` table element. Rows can be visually hidden, and cells can be shrinked to its content with, and center/right cell alignment is supported. Cell shrink should be applied to all the cells in a row. Otherwise the bigger cell with shrink applied will determinate the width of the row. @@ -108,48 +106,71 @@ Cell shrink should be applied to all the cells in a row. Otherwise the bigger ce {{ template: hbs` - + - - Key - Value + + Key + Value - - Key - Value - - - Key - Value - - - Key - Value - - + Key - Add + + Remove + - + + Key + + + + Choose an option + Value 1 + Value 2 + Value 3 + + + + + Add + + + Key - Remove + + Add + + + + Key + + + + + Add + - - - Footer + + + Footer @@ -158,8 +179,8 @@ Cell shrink should be applied to all the cells in a row. Otherwise the bigger ce style: select( 'style', { - 'default': '', - 'key-value': 'key-value' + 'condensed': 'condensed', + 'default': '' } ) } diff --git a/addons/rose/addon/styles/rose/components/table/_table.scss b/addons/rose/addon/styles/rose/components/table/_table.scss index a3c3bfcdc..f9b7b9daf 100644 --- a/addons/rose/addon/styles/rose/components/table/_table.scss +++ b/addons/rose/addon/styles/rose/components/table/_table.scss @@ -10,15 +10,12 @@ text-align: left; } - .rose-table-row-key-value { - td:nth-child(2) { - display: flex; - input { - width: 100%; - margin-right: sizing.rems(s); - } - button { margin-right: 0; } - } + // This styles are add to stop the input to apply extra margin (default on forms) + .rose-form-input-field, + .rose-form-select, + .rose-form-input { + margin: 0; + width: 100%; } .rose-table-cell, @@ -58,14 +55,6 @@ margin-bottom: 0; } - .rose-table-cell { - .rose-form-input-field { - margin: 0; - width: inherit; - vertical-align: inherit; - } - } - &.rose-table-condensed { .rose-table-cell { @include type.type(s); diff --git a/addons/rose/tests/dummy/app/templates/index.hbs b/addons/rose/tests/dummy/app/templates/index.hbs index f162f9948..e82d02286 100644 --- a/addons/rose/tests/dummy/app/templates/index.hbs +++ b/addons/rose/tests/dummy/app/templates/index.hbs @@ -75,49 +75,72 @@ -

Condensed Table Key/Value Lookalike

+

Condensed Table Key/Value Lookalike (edit mode)

Key - Value + Value - - Key - Value - - - Key - Value - - - Key - Value - - + Key - - Remove + + + Remove + - + + Key + + + + Choose an option + Value 1 + Value 2 + Value 3 + + + + + Add + + + Key - - Add + + + Add + + + + Key + + + + + Add + - Footer + Footer @@ -147,50 +170,6 @@ -

Key/Value

- - - Key - Value - - - Key - Value - - - Key - Value - - - - - - Key - - - - - - Add - - - - - - - - Key - - - - - - Remove - - - - -

Table