Skip to content

Commit eb0f681

Browse files
authored
Merge pull request #118 from Kartore/feat/expressions-filter
Expressions系UI実装
2 parents 2f76a31 + bf93ec8 commit eb0f681

File tree

465 files changed

+8589
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

465 files changed

+8589
-64
lines changed

src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import { NavigationPanel } from '~/components/editor/NavigationPanel/NavigationP
1010
import type { onChangeType } from '~/components/editor/PropertiesPanel/LayerPropertiesPanel/utils/LayerUtil/LayerUtil.ts';
1111
import { replaceLayerData } from '~/components/editor/PropertiesPanel/LayerPropertiesPanel/utils/LayerUtil/LayerUtil.ts';
1212
import { PropertiesPanel } from '~/components/editor/PropertiesPanel/PropertiesPanel.tsx';
13-
import { osmLiberty } from '~/samples/osm-liberty.ts';
13+
import { osmLibertyMigrated } from '~/samples/osm-liberty.ts';
1414

1515
function App() {
1616
const [mapStyle, setMapStyle] = useLocalStorage<StyleSpecification>(
1717
'kartore:style',
18-
osmLiberty,
18+
osmLibertyMigrated,
1919
{}
2020
);
2121

22-
const [selectedLayerId, setSelectedLayerId] = useState<string>(mapStyle.layers[0].id);
22+
const [selectedLayerId, setSelectedLayerId] = useState<string>(mapStyle.layers[4].id);
2323
const selectedLayer =
2424
mapStyle.layers.find((layer) => layer.id === selectedLayerId) ?? mapStyle.layers[0];
2525
const handleChangeLayerOrder = (layer: LayerSpecification[]) => {

src/components/common/BoxRadioGroup/BoxRadioGroup.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { describe } from 'vitest';
2-
import { render } from '@testing-library/react';
31
import { composeStories } from '@storybook/react';
2+
import { render } from '@testing-library/react';
3+
import { describe } from 'vitest';
44

55
import * as Stories from './BoxRadioGroup.stories';
66

src/components/common/ColorField/ColorPicker/EyeDropperButton/EyeDropperButton.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
13
import { EyeDropperButton } from '.';
2-
import { Meta, StoryObj } from '@storybook/react';
34

45
const meta = {
56
component: EyeDropperButton,

src/components/common/ColorField/ColorPicker/EyeDropperButton/EyeDropperButton.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { describe } from 'vitest';
2-
import { render } from '@testing-library/react';
31
import { composeStories } from '@storybook/react';
2+
import { render } from '@testing-library/react';
3+
import { describe } from 'vitest';
44

55
import * as Stories from './EyeDropperButton.stories';
66

src/components/common/ComboBox/ComboBox.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
13
import { ComboBox } from '.';
2-
import { Meta, StoryObj } from '@storybook/react';
34

45
const meta = {
56
component: ComboBox,

src/components/common/ComboBox/ComboBox.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { describe } from 'vitest';
2-
import { render } from '@testing-library/react';
31
import { composeStories } from '@storybook/react';
2+
import { render } from '@testing-library/react';
3+
import { describe } from 'vitest';
44

55
import * as Stories from './ComboBox.stories';
66

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { Meta, StoryObj } from '@storybook/react';
2+
3+
import { FilterInputField } from '.';
4+
5+
const meta = {
6+
component: FilterInputField,
7+
} satisfies Meta<typeof FilterInputField>;
8+
9+
export default meta;
10+
11+
type Story = StoryObj<typeof meta>;
12+
13+
export const Default: Story = {
14+
args: {},
15+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { composeStories } from '@storybook/react';
2+
import { render } from '@testing-library/react';
3+
import { describe } from 'vitest';
4+
5+
import * as Stories from './FilterInputField.stories';
6+
7+
const { Default } = composeStories(Stories);
8+
9+
describe('Component: FilterInputField', () => {
10+
describe('Snapshot', () => {
11+
it('Default', () => {
12+
const { asFragment } = render(<Default />);
13+
expect(asFragment()).toMatchSnapshot();
14+
});
15+
});
16+
});
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { ComponentProps, FC } from 'react';
2+
3+
import type { ExpressionFilterSpecification } from '@maplibre/maplibre-gl-style-spec';
4+
5+
import { ExpressionInputField } from '~/components/common/FilterInputField/expressions';
6+
7+
export type FilterInputFieldProps = {
8+
value?: ExpressionFilterSpecification;
9+
onChange?: (value: ExpressionFilterSpecification) => void;
10+
} & Omit<ComponentProps<'div'>, 'onChange'>;
11+
12+
export const FilterInputField: FC<FilterInputFieldProps> = ({
13+
className,
14+
children,
15+
value,
16+
onChange,
17+
...props
18+
}) => {
19+
if (!value) {
20+
return null;
21+
}
22+
if (value === true) {
23+
return null;
24+
}
25+
return (
26+
<ExpressionInputField className={'text-sm'} value={value} onChange={onChange} {...props}>
27+
{children}
28+
</ExpressionInputField>
29+
);
30+
};
31+
32+
FilterInputField.displayName = 'FilterInputField';

0 commit comments

Comments
 (0)