Skip to content

Commit

Permalink
fix(property-selector, filter-picker): fix style (#1534)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin committed Nov 26, 2021
1 parent fc7f46d commit 5318764
Show file tree
Hide file tree
Showing 13 changed files with 1,166 additions and 275 deletions.
4 changes: 2 additions & 2 deletions src/legacy/base-picker/style/index.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import '../../../stylesheet/index.less';

@picker-prefix-cls-legacy: ~'@{component-prefix}-base-picker-legacy';
@base-picker-prefix-cls-legacy: ~'@{component-prefix}-base-picker-legacy';

.@{picker-prefix-cls-legacy} {
.@{base-picker-prefix-cls-legacy} {
position: relative;
width: 360px;
height: fit-content;
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/filter-picker/FilterPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const FilterPicker = (props: FilterPickerProps) => {
disabled,
} = props;

const localeTextObject: typeof defaultLocaleTextObject = useLocale('FilterPicker-legacy');
const localeTextObject: typeof defaultLocaleTextObject = useLocale('FilterPicker');
const textObject = useMemo(() => ({ ...defaultLocaleTextObject, ...localeTextObject }), [localeTextObject]);

const [localVisible, setLocalVisible] = useState(false);
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/filter-picker/style/index.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.filter-picker-legacy_icon {
.filter-picker_icon {
display: flex;
flex-direction: row;
align-items: center;
Expand All @@ -7,6 +7,6 @@
background: #f7f8fc;
border-radius: 4px;
}
.filter-picker-legacy_icon:hover {
.filter-picker_icon:hover {
box-shadow: 0 0 3px #ccc;
}
2 changes: 1 addition & 1 deletion src/legacy/property-selector/PropertyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function PropertyCard(props: PropertyCardProps) {
const res = await fetchData?.(nodeData);
return res;
}, [nodeData]);
const prefixCls = usePrefixCls('property-picker');
const prefixCls = usePrefixCls('property-picker-legacy');
const propCardPrefixCls = `${prefixCls}-card`;
const valueType = ValueTypeMap[data?.valueType ? data?.valueType?.toLowerCase() : ''] || null;
return (
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/property-selector/PropertyPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const PropertyPicker: React.FC<PropertyPickerProps> = (props: PropertyPickerProp

const [currentValue, setCurrentValue] = useState<PropertyValue | undefined>(initialValue);

const prefixCls = usePrefixCls('property-picker');
const prefixCls = usePrefixCls('property-picker-legacy');

const [detailVisible, setDetailVisible] = useState(false);
const debounceSetDetailVisible = useDebounceFn((visible: boolean) => {
Expand Down
256 changes: 0 additions & 256 deletions src/legacy/property-selector/PropertySelector.stories.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/legacy/property-selector/PropertySelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const PropertySelector: React.FC<PropertySelectorProps> = (props) => {
const inputText = useMemo(() => currentValue?.name || currentValue?.label, [currentValue]);
const inputValueRef = useRef<HTMLSpanElement | null>(null);

const clsPrifx = usePrefixCls('property-selector');
const clsPrifx = usePrefixCls('property-selector-legacy');
const selectorCls = classNames(clsPrifx, className);
function handleDropDownVisibleChange(show: boolean) {
onDropdownVisibleChange?.(show);
Expand Down
4 changes: 2 additions & 2 deletions src/legacy/property-selector/components/list/style/index.less
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@import '../../../../../stylesheet/index.less';

@list-prefix-cls-legacy: ~'@{component-prefix}-list-property-selector';
@list-property-selector-prefix-cls-legacy: ~'@{component-prefix}-list-property-selector';

.@{list-prefix-cls-legacy} {
.@{list-property-selector-prefix-cls-legacy} {
margin: 0;
padding: 0;
list-style-type: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
import React from 'react';
import { Meta, Story } from '@storybook/react/types-6-0';
import _ from 'lodash';
import PropertyCard from './PropertyCard';
import { PropertyCardProps } from './interfaces';
import PropertyCard from '../PropertyCard';
import { PropertyCardProps } from '../interfaces';
import '../style/index';

export default {
title: 'Pro/PropertyCard',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import React from 'react';
import { Meta, Story } from '@storybook/react/types-6-0';
import _ from 'lodash';
import PropertyPicker from './PropertyPicker';
import { PropertyPickerProps } from './interfaces';
import './style/index.less';
import PropertyPicker from '../PropertyPicker';
import { PropertyPickerProps } from '../interfaces';
import '../style/index';
import insightDimensions from './insightDimensions';

export default {
title: 'Pro/PropertyPicker',
Expand All @@ -27,6 +28,7 @@ const Template: Story<PropertyPickerProps> = (args) => (
export const Default = Template.bind({});
Default.args = {
disabledValues: ['b'],
dataSource: insightDimensions,
// placeholder: '请选择...',
onChange: (v: any) => {
console.log('onchange', v);
Expand Down

1 comment on commit 5318764

@vercel
Copy link

@vercel vercel bot commented on 5318764 Nov 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.