@mirai/ui 1.0.133 → 1.0.134
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.
- package/build/components/Table/Table.ColumnFilter.js +154 -0
- package/build/components/Table/Table.ColumnFilter.js.map +1 -0
- package/build/components/Table/Table.Filter.js +57 -0
- package/build/components/Table/Table.Filter.js.map +1 -0
- package/build/components/Table/Table.Row.js +18 -8
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.js +54 -21
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.module.css +46 -4
- package/build/components/Table/Table.stories.js +12 -1
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/Table.stories.module.css +2 -2
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +2579 -705
- package/build/components/Table/helpers/select.js +47 -22
- package/build/components/Table/helpers/select.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js +1 -1
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +2 -6
- package/package.json +1 -1
|
@@ -139,6 +139,17 @@ var dataSource = [{
|
|
|
139
139
|
Story.storyName = 'Table';
|
|
140
140
|
Story.args = (_Story$args = {
|
|
141
141
|
dataSource: dataSource,
|
|
142
|
+
filter: [{
|
|
143
|
+
field: 'email',
|
|
144
|
+
value: '@mirai.com'
|
|
145
|
+
}, {
|
|
146
|
+
field: 'email',
|
|
147
|
+
value: '@soyjavi.com'
|
|
148
|
+
}, {
|
|
149
|
+
field: 'year',
|
|
150
|
+
min: 2020,
|
|
151
|
+
max: 2023
|
|
152
|
+
}],
|
|
142
153
|
inline: true,
|
|
143
154
|
schema: {
|
|
144
155
|
username: {
|
|
@@ -175,7 +186,7 @@ Story.args = (_Story$args = {
|
|
|
175
186
|
}, _defineProperty(_Story$args, 'data-testid', 'test-story'), _defineProperty(_Story$args, "style", {
|
|
176
187
|
height: '128px !important;',
|
|
177
188
|
width: 128,
|
|
178
|
-
background: '
|
|
189
|
+
background: 'green'
|
|
179
190
|
}), _Story$args);
|
|
180
191
|
Story.argTypes = {};
|
|
181
192
|
//# sourceMappingURL=Table.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.stories.js","names":["title","Story","props","useState","selected","setSelected","search","setSearch","useEffect","handleScroll","others","console","log","handlePress","handleSelect","style","table","dataSource","username","email","year","tags","map","language","tag","languages","action","twitter","undefined","bio","storyName","args","inline","schema","label","type","height","width","background","argTypes"],"sources":["../../../src/components/Table/Table.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputText, Text } from '../../';\nimport { Table } from './Table';\nimport style from './Table.stories.module.css';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [selected, setSelected] = useState();\n const [search, setSearch] = useState();\n\n useEffect(() => {\n setSearch(props.search);\n }, [props.search]);\n\n const handleScroll = (...others) => console.log('<Table>::onScroll', ...others);\n\n const handlePress = (...others) => console.log('<Table>::onPress', ...others);\n\n const handleSelect = (...others) => {\n console.log('<Table>::onSelect', ...others);\n setSelected(...others);\n };\n\n return (\n <>\n <InputText name=\"search\" placeholder=\"search...\" type=\"search\" value={search} onChange={setSearch} />\n\n <Table\n {...props}\n search={search}\n selected={selected}\n onPress={handlePress}\n onScroll={handleScroll}\n onSelect={handleSelect}\n className={style.table}\n />\n </>\n );\n};\n\nconst dataSource = [\n {\n username: 'jose',\n email: 'jose@mirai.com',\n year: 1,\n tags: ['es', 'en', 'ja'].map((language) => (\n <Text key={language} bold small className={style.tag}>\n {language}\n </Text>\n )),\n languages: ['spanish', 'english', 'japanese'],\n action: null,\n },\n { username: 'mario/1', email: 'mario.1@mirai.com', tags: null, year: 2005 },\n { username: 'carlos', email: 'carlos@mirai.com', tags: null, year: 2012 },\n {\n username: 'svet',\n email: 'svet@mirai.com',\n tags: ['en'].map((language) => (\n <Text key={language} bold small className={style.tag}>\n {language}\n </Text>\n )),\n languages: ['english'],\n year: 2021,\n twitter: undefined,\n action: <Button small>Click Me</Button>,\n },\n {\n username: 'javi',\n email: 'hi@soyjavi.com',\n tags: null,\n year: 2022,\n twitter: 'soyjavi',\n bio: \"Hi, I'm Javi. For as long as I can remember, I have always loved build software and helping people through it. I strive to design simple, clean, and beautiful products in the hope that they will make a difference in the world.\",\n },\n { username: 'victor', email: 'victor@mirai.com', tags: null, year: 2021 },\n { username: 'mario/2', email: 'mario.2@mirai.com', tags: null, year: 2022 },\n];\n\nStory.storyName = 'Table';\n\nStory.args = {\n dataSource,\n inline: true,\n schema: {\n username: { label: 'User Name', type: 'text' },\n email: { label: 'Email' },\n tags: { label: 'Tags', type: 'component' },\n languages: { label: 'Languages (hidden)', type: 'hidden' },\n year: { label: 'Year', type: 'number' },\n twitter: { label: 'Twitter' },\n bio: { label: 'Biography' },\n action: { label: 'Action', type: 'component' },\n },\n search: '',\n // inherited properties\n ['data-testid']: 'test-story',\n style: { height: '128px !important;', width: 128, background: '
|
|
1
|
+
{"version":3,"file":"Table.stories.js","names":["title","Story","props","useState","selected","setSelected","search","setSearch","useEffect","handleScroll","others","console","log","handlePress","handleSelect","style","table","dataSource","username","email","year","tags","map","language","tag","languages","action","twitter","undefined","bio","storyName","args","filter","field","value","min","max","inline","schema","label","type","height","width","background","argTypes"],"sources":["../../../src/components/Table/Table.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputText, Text } from '../../';\nimport { Table } from './Table';\nimport style from './Table.stories.module.css';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [selected, setSelected] = useState();\n const [search, setSearch] = useState();\n\n useEffect(() => {\n setSearch(props.search);\n }, [props.search]);\n\n const handleScroll = (...others) => console.log('<Table>::onScroll', ...others);\n\n const handlePress = (...others) => console.log('<Table>::onPress', ...others);\n\n const handleSelect = (...others) => {\n console.log('<Table>::onSelect', ...others);\n setSelected(...others);\n };\n\n return (\n <>\n <InputText name=\"search\" placeholder=\"search...\" type=\"search\" value={search} onChange={setSearch} />\n\n <Table\n {...props}\n search={search}\n selected={selected}\n onPress={handlePress}\n onScroll={handleScroll}\n onSelect={handleSelect}\n className={style.table}\n />\n </>\n );\n};\n\nconst dataSource = [\n {\n username: 'jose',\n email: 'jose@mirai.com',\n year: 1,\n tags: ['es', 'en', 'ja'].map((language) => (\n <Text key={language} bold small className={style.tag}>\n {language}\n </Text>\n )),\n languages: ['spanish', 'english', 'japanese'],\n action: null,\n },\n { username: 'mario/1', email: 'mario.1@mirai.com', tags: null, year: 2005 },\n { username: 'carlos', email: 'carlos@mirai.com', tags: null, year: 2012 },\n {\n username: 'svet',\n email: 'svet@mirai.com',\n tags: ['en'].map((language) => (\n <Text key={language} bold small className={style.tag}>\n {language}\n </Text>\n )),\n languages: ['english'],\n year: 2021,\n twitter: undefined,\n action: <Button small>Click Me</Button>,\n },\n {\n username: 'javi',\n email: 'hi@soyjavi.com',\n tags: null,\n year: 2022,\n twitter: 'soyjavi',\n bio: \"Hi, I'm Javi. For as long as I can remember, I have always loved build software and helping people through it. I strive to design simple, clean, and beautiful products in the hope that they will make a difference in the world.\",\n },\n { username: 'victor', email: 'victor@mirai.com', tags: null, year: 2021 },\n { username: 'mario/2', email: 'mario.2@mirai.com', tags: null, year: 2022 },\n];\n\nStory.storyName = 'Table';\n\nStory.args = {\n dataSource,\n filter: [\n { field: 'email', value: '@mirai.com' },\n { field: 'email', value: '@soyjavi.com' },\n { field: 'year', min: 2020, max: 2023 },\n ],\n inline: true,\n schema: {\n username: { label: 'User Name', type: 'text' },\n email: { label: 'Email' },\n tags: { label: 'Tags', type: 'component' },\n languages: { label: 'Languages (hidden)', type: 'hidden' },\n year: { label: 'Year', type: 'number' },\n twitter: { label: 'Twitter' },\n bio: { label: 'Biography' },\n action: { label: 'Action', type: 'component' },\n },\n search: '',\n // inherited properties\n ['data-testid']: 'test-story',\n style: { height: '128px !important;', width: 128, background: 'green' },\n};\n\nStory.argTypes = {};\n"],"m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