Loading package.json +1 −1 Original line number Diff line number Diff line { "name": "@d.malygin/UI_storybook", "version": "1.0.19", "version": "1.0.20", "type": "module", "scripts": { "dev": "vite", Loading src/common/interfaces/componentsProp.ts +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ export interface ITableColumn { export interface ITableColumnOptions extends ICheckboxProps, ITagProps, Omit<ITagProps, 'background' | 'value'>, ISelectProps, IRatingProps, IProgressBarProps, Loading src/components/Table/components/TableCell.vue +3 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ import Rating from '../../Rating/Rating.vue'; import ProgressBar from '../../ProgressBar/ProgressBar.vue'; import Knob from '../../Knob/Knob.vue'; import type { TThemeColor } from '../../../common/interfaces/common'; import type { ITagProps } from '@interfaces/componentsProps'; interface IProps { item: unknown; Loading Loading @@ -60,7 +61,7 @@ defineEmits(['updateData']); /> <Tag v-if="types[columnIndex] === 'tag'" v-bind="column.options" v-bind="column.options as ITagProps" :value="item as string" @update="$emit('updateData', $event, rowIndex, columnIndex)" /> Loading @@ -68,9 +69,8 @@ defineEmits(['updateData']); v-else-if="types[columnIndex] === 'select'" noBorder noSelectedBackground v-bind="filterSelectProps(column.options)" v-bind="filterSelectProps(column.options, theme)" width="150px" :theme="theme" :selected="item as string" @update="$emit('updateData', $event, rowIndex, columnIndex)" /> Loading src/components/Table/helpers.ts +5 −4 Original line number Diff line number Diff line import type { ITableColumn, TTableColumnType } from '../../common/interfaces/componentsProp'; import type { TSize } from '../../common/interfaces/common'; import type { TSize, TThemeColor } from '../../common/interfaces/common'; import type { ICheckboxProps, ISelectProps } from '../../common/interfaces/componentsProps'; export const calcRows = ( Loading Loading @@ -90,10 +90,11 @@ export const filterCheckboxProps = (props: ICheckboxProps | undefined) => { return res; }; export const filterSelectProps = (props: ISelectProps | undefined) => { if (!props || !props.options) export const filterSelectProps = (props: ISelectProps | undefined, theme: TThemeColor) => { if (!props || !props.options || !props.theme) return { options: [{ value: 'One' }, { value: 'Two' }], options: props?.options ?? [{ value: 'One' }, { value: 'Two' }], theme: props?.theme ?? theme, }; return props; }; Loading
package.json +1 −1 Original line number Diff line number Diff line { "name": "@d.malygin/UI_storybook", "version": "1.0.19", "version": "1.0.20", "type": "module", "scripts": { "dev": "vite", Loading
src/common/interfaces/componentsProp.ts +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ export interface ITableColumn { export interface ITableColumnOptions extends ICheckboxProps, ITagProps, Omit<ITagProps, 'background' | 'value'>, ISelectProps, IRatingProps, IProgressBarProps, Loading
src/components/Table/components/TableCell.vue +3 −3 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ import Rating from '../../Rating/Rating.vue'; import ProgressBar from '../../ProgressBar/ProgressBar.vue'; import Knob from '../../Knob/Knob.vue'; import type { TThemeColor } from '../../../common/interfaces/common'; import type { ITagProps } from '@interfaces/componentsProps'; interface IProps { item: unknown; Loading Loading @@ -60,7 +61,7 @@ defineEmits(['updateData']); /> <Tag v-if="types[columnIndex] === 'tag'" v-bind="column.options" v-bind="column.options as ITagProps" :value="item as string" @update="$emit('updateData', $event, rowIndex, columnIndex)" /> Loading @@ -68,9 +69,8 @@ defineEmits(['updateData']); v-else-if="types[columnIndex] === 'select'" noBorder noSelectedBackground v-bind="filterSelectProps(column.options)" v-bind="filterSelectProps(column.options, theme)" width="150px" :theme="theme" :selected="item as string" @update="$emit('updateData', $event, rowIndex, columnIndex)" /> Loading
src/components/Table/helpers.ts +5 −4 Original line number Diff line number Diff line import type { ITableColumn, TTableColumnType } from '../../common/interfaces/componentsProp'; import type { TSize } from '../../common/interfaces/common'; import type { TSize, TThemeColor } from '../../common/interfaces/common'; import type { ICheckboxProps, ISelectProps } from '../../common/interfaces/componentsProps'; export const calcRows = ( Loading Loading @@ -90,10 +90,11 @@ export const filterCheckboxProps = (props: ICheckboxProps | undefined) => { return res; }; export const filterSelectProps = (props: ISelectProps | undefined) => { if (!props || !props.options) export const filterSelectProps = (props: ISelectProps | undefined, theme: TThemeColor) => { if (!props || !props.options || !props.theme) return { options: [{ value: 'One' }, { value: 'Two' }], options: props?.options ?? [{ value: 'One' }, { value: 'Two' }], theme: props?.theme ?? theme, }; return props; };