Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): column icon color issue

Ramesh Mane9bcfa73f0e25
diff --git a/packages/nc-gui/components/smartsheet/header/CellIcon.ts b/packages/nc-gui/components/smartsheet/header/CellIcon.ts
index 47d92de2c9..7bf655d13b 100644
--- a/packages/nc-gui/components/smartsheet/header/CellIcon.ts
+++ b/packages/nc-gui/components/smartsheet/header/CellIcon.ts
@@ -70,9 +70,16 @@ export default defineComponent({
type: Object as PropType<ColumnType>,
required: false,
},
+ /**
+ * Windicss color class
+ */
+ color: {
+ type: String,
+ required: false,
+ },
},
setup(props) {
- const columnMeta = toRef(props, 'columnMeta')
+ const { columnMeta, color: defaultColor } = toRefs(props)
const injectedColumn = inject(ColumnInj, columnMeta)
@@ -90,7 +97,7 @@ export default defineComponent({
if (!column.value && !columnMeta.value) return null
return h(renderIcon((columnMeta.value ?? column.value)!, abstractType.value), {
- class: 'text-inherit mx-1 nc-cell-icon',
+ class: `${defaultColor.value || 'text-inherit'} mx-1 nc-cell-icon`,
})
}
},
diff --git a/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts b/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts
index 3b67110127..beafdb2209 100644
--- a/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts
+++ b/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts
@@ -21,20 +21,20 @@ export const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {
}
break
case UITypes.SpecificDBType:
- return { icon: iconMap.cellDb, color: 'text-grey' }
+ return { icon: iconMap.cellDb }
case UITypes.Formula:
- return { icon: iconMap.cellFormula, color: 'text-grey' }
+ return { icon: iconMap.cellFormula }
case UITypes.Button:
switch ((column.colOptions as LinkToAnotherRecordType)?.type) {
case ButtonActionsType.Ai:
- return { icon: iconMap.cellAiButton, color: 'text-grey' }
+ return { icon: iconMap.cellAiButton }
default:
- return { icon: iconMap.cellButton, color: 'text-grey' }
+ return { icon: iconMap.cellButton }
}
case UITypes.QrCode:
- return { icon: iconMap.cellQrCode, color: 'text-grey' }
+ return { icon: iconMap.cellQrCode }
case UITypes.Barcode:
- return { icon: iconMap.cellBarcode, color: 'text-grey' }
+ return { icon: iconMap.cellBarcode }
case UITypes.Lookup:
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) {
case RelationTypes.MANY_TO_MANY:
@@ -46,7 +46,7 @@ export const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {
case RelationTypes.ONE_TO_ONE:
return { icon: iconMap.cellLookup, color: 'text-purple-500', hex: '#7D26CD' }
}
- return { icon: iconMap.cellLookup, color: 'text-grey' }
+ return { icon: iconMap.cellLookup }
case UITypes.Rollup:
switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) {
case RelationTypes.MANY_TO_MANY:
@@ -58,18 +58,18 @@ export const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => {
case RelationTypes.ONE_TO_ONE:
return { icon: iconMap.cellRollup, color: 'text-purple-500', hex: '#7D26CD' }
}
- return { icon: iconMap.cellRollup, color: 'text-grey' }
+ return { icon: iconMap.cellRollup }
case UITypes.Count:
- return { icon: CountIcon, color: 'text-grey' }
+ return { icon: CountIcon }
case UITypes.CreatedTime:
case UITypes.LastModifiedTime:
- return { icon: iconMap.cellSystemDate, color: 'text-grey' }
+ return { icon: iconMap.cellSystemDate }
case UITypes.CreatedBy:
case UITypes.LastModifiedBy:
- return { icon: iconMap.cellSystemUser, color: 'text-grey' }
+ return { icon: iconMap.cellSystemUser }
}
- return { icon: iconMap.cellSystemText, color: 'text-grey' }
+ return { icon: iconMap.cellSystemText }
}
export default defineComponent({
@@ -79,9 +79,16 @@ export default defineComponent({
type: Object as PropType<ColumnType>,
required: false,
},
+ /**
+ * Windicss color class
+ */
+ color: {
+ type: String,
+ required: false,
+ },
},
setup(props) {
- const columnMeta = toRef(props, 'columnMeta')
+ const { columnMeta, color: defaultColor } = toRefs(props)
const injectedColumn = inject(ColumnInj, columnMeta) as Ref<ColumnType & { colOptions: LookupType | RollupType }>
@@ -104,7 +111,7 @@ export default defineComponent({
const { icon: Icon, color } = renderIcon(column.value, relationColumn)
- return h(Icon, { class: `${color || 'text-grey'} mx-1 nc-virtual-cell-icon` })
+ return h(Icon, { class: `${color || defaultColor.value || 'text-inherit'} mx-1 nc-virtual-cell-icon` })
}
},
})
diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
index b238e2fc15..13800b40c3 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
@@ -617,7 +617,8 @@ const onAddColumnDropdownVisibilityChange = () => {
<component
:is="getIcon(metaColumnById[option.value])"
v-if="option.value"
- class="!w-3.5 !h-3.5 !text-gray-700 !ml-0"
+ class="!w-3.5 !h-3.5 !ml-0"
+ color="text-nc-content-gray-subtle"
/>
<NcTooltip class="flex-1 max-w-[calc(100%_-_20px)] truncate" show-on-truncate-only>
@@ -771,7 +772,8 @@ const onAddColumnDropdownVisibilityChange = () => {
>
<component
:is="getIcon(metaColumnById[field.fk_column_id])"
- class="!w-3.5 !h-3.5 !text-gray-600"
+ class="!w-3.5 !h-3.5"
+ color="text-nc-content-gray-subtle2"
@click.stop
/>
diff --git a/packages/nc-gui/windi.config.ts b/packages/nc-gui/windi.config.ts
index 9c7578ab05..a70b3d8ea9 100644
--- a/packages/nc-gui/windi.config.ts
+++ b/packages/nc-gui/windi.config.ts
@@ -32,6 +32,7 @@ export default defineConfig({
'../**/*.{vue,html,jsx,tsx,css,scss}',
'../extensions/**/*.md',
'../composables/useColumnFilteredOrSorted.ts',
+ '../components/smartsheet/header/*.ts',
'../components/smartsheet/grid/canvas/cells/*.ts',
'../components/smartsheet/grid/canvas/cells/**/*.ts',
'../utils/cssUtils.ts',
@@ -40,6 +41,7 @@ export default defineConfig({
'**/*.{vue,html,jsx,tsx,css,scss}',
'extensions/**/*.md',
'composables/useColumnFilteredOrSorted.ts',
+ 'components/smartsheet/header/*.ts',
'components/smartsheet/grid/canvas/cells/*.ts',
'components/smartsheet/grid/canvas/cells/**/*.ts',
'utils/cssUtils.ts',