From 3d8c267b79bed4f72fe7744f6524dfb71ecc6df0 Mon Sep 17 00:00:00 2001 From: DarkPhoenix2704 Date: Tue, 5 Mar 2024 12:05:46 +0000 Subject: [PATCH] feat(nc-gui): new field icons --- .../assets/nc-icons/cell-attachment.svg | 3 + .../nc-gui/assets/nc-icons/cell-barcode.svg | 3 + .../nc-gui/assets/nc-icons/cell-checkbox.svg | 4 + .../nc-gui/assets/nc-icons/cell-currency.svg | 4 + packages/nc-gui/assets/nc-icons/cell-date.svg | 6 ++ .../nc-gui/assets/nc-icons/cell-datetime.svg | 8 ++ packages/nc-gui/assets/nc-icons/cell-db.svg | 5 ++ .../nc-gui/assets/nc-icons/cell-decimal.svg | 7 ++ .../nc-gui/assets/nc-icons/cell-duration.svg | 7 ++ .../nc-gui/assets/nc-icons/cell-email.svg | 4 + .../nc-gui/assets/nc-icons/cell-formula.svg | 8 ++ .../nc-gui/assets/nc-icons/cell-geometry.svg | 7 ++ packages/nc-gui/assets/nc-icons/cell-json.svg | 8 ++ packages/nc-gui/assets/nc-icons/cell-link.svg | 7 ++ .../nc-gui/assets/nc-icons/cell-longtext.svg | 8 ++ .../nc-gui/assets/nc-icons/cell-lookup.svg | 9 +++ .../assets/nc-icons/cell-multiselect.svg | 8 ++ .../nc-gui/assets/nc-icons/cell-number.svg | 6 ++ .../assets/nc-icons/cell-percentage.svg | 5 ++ .../nc-gui/assets/nc-icons/cell-phone.svg | 3 + .../nc-gui/assets/nc-icons/cell-qrcode.svg | 10 +++ .../nc-gui/assets/nc-icons/cell-rating.svg | 3 + .../nc-gui/assets/nc-icons/cell-rollup.svg | 3 + .../nc-gui/assets/nc-icons/cell-select.svg | 4 + packages/nc-gui/assets/nc-icons/cell-text.svg | 5 ++ packages/nc-gui/assets/nc-icons/cell-time.svg | 4 + packages/nc-gui/assets/nc-icons/cell-url.svg | 4 + packages/nc-gui/assets/nc-icons/cell-user.svg | 4 + .../nc-gui/assets/nc-icons/system-date.svg | 7 ++ .../nc-gui/assets/nc-icons/system-key.svg | 4 + .../nc-gui/assets/nc-icons/system-text.svg | 6 ++ .../nc-gui/assets/nc-icons/system-user.svg | 5 ++ .../smartsheet/column/EditOrAdd.vue | 2 +- .../components/smartsheet/header/CellIcon.ts | 52 ++++++------- .../smartsheet/header/VirtualCellIcon.ts | 32 ++++---- packages/nc-gui/utils/columnUtils.ts | 76 +++++++++---------- packages/nc-gui/utils/iconUtils.ts | 66 ++++++++++++++++ 37 files changed, 325 insertions(+), 82 deletions(-) create mode 100644 packages/nc-gui/assets/nc-icons/cell-attachment.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-barcode.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-checkbox.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-currency.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-date.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-datetime.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-db.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-decimal.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-duration.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-email.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-formula.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-geometry.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-json.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-link.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-longtext.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-lookup.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-multiselect.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-number.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-percentage.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-phone.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-qrcode.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-rating.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-rollup.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-select.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-text.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-time.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-url.svg create mode 100644 packages/nc-gui/assets/nc-icons/cell-user.svg create mode 100644 packages/nc-gui/assets/nc-icons/system-date.svg create mode 100644 packages/nc-gui/assets/nc-icons/system-key.svg create mode 100644 packages/nc-gui/assets/nc-icons/system-text.svg create mode 100644 packages/nc-gui/assets/nc-icons/system-user.svg diff --git a/packages/nc-gui/assets/nc-icons/cell-attachment.svg b/packages/nc-gui/assets/nc-icons/cell-attachment.svg new file mode 100644 index 0000000000..0d14c80304 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-attachment.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-barcode.svg b/packages/nc-gui/assets/nc-icons/cell-barcode.svg new file mode 100644 index 0000000000..e1736db956 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-barcode.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-checkbox.svg b/packages/nc-gui/assets/nc-icons/cell-checkbox.svg new file mode 100644 index 0000000000..c7dfdfb14f --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-checkbox.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-currency.svg b/packages/nc-gui/assets/nc-icons/cell-currency.svg new file mode 100644 index 0000000000..f4886aee03 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-currency.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-date.svg b/packages/nc-gui/assets/nc-icons/cell-date.svg new file mode 100644 index 0000000000..c5df544962 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-date.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-datetime.svg b/packages/nc-gui/assets/nc-icons/cell-datetime.svg new file mode 100644 index 0000000000..859720d9e8 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-datetime.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-db.svg b/packages/nc-gui/assets/nc-icons/cell-db.svg new file mode 100644 index 0000000000..53d8ccc922 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-db.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-decimal.svg b/packages/nc-gui/assets/nc-icons/cell-decimal.svg new file mode 100644 index 0000000000..4d5db110a1 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-decimal.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-duration.svg b/packages/nc-gui/assets/nc-icons/cell-duration.svg new file mode 100644 index 0000000000..d8e5fe8372 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-duration.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-email.svg b/packages/nc-gui/assets/nc-icons/cell-email.svg new file mode 100644 index 0000000000..1bf0267b34 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-email.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-formula.svg b/packages/nc-gui/assets/nc-icons/cell-formula.svg new file mode 100644 index 0000000000..169d829606 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-formula.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-geometry.svg b/packages/nc-gui/assets/nc-icons/cell-geometry.svg new file mode 100644 index 0000000000..4126148ebf --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-geometry.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-json.svg b/packages/nc-gui/assets/nc-icons/cell-json.svg new file mode 100644 index 0000000000..c613327dfc --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-json.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-link.svg b/packages/nc-gui/assets/nc-icons/cell-link.svg new file mode 100644 index 0000000000..c2427ff00e --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-link.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-longtext.svg b/packages/nc-gui/assets/nc-icons/cell-longtext.svg new file mode 100644 index 0000000000..bfdb92ae92 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-longtext.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-lookup.svg b/packages/nc-gui/assets/nc-icons/cell-lookup.svg new file mode 100644 index 0000000000..d77c7e1a69 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-lookup.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-multiselect.svg b/packages/nc-gui/assets/nc-icons/cell-multiselect.svg new file mode 100644 index 0000000000..c1eaf56f58 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-multiselect.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-number.svg b/packages/nc-gui/assets/nc-icons/cell-number.svg new file mode 100644 index 0000000000..04a8149bbd --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-number.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-percentage.svg b/packages/nc-gui/assets/nc-icons/cell-percentage.svg new file mode 100644 index 0000000000..bd53dc96c5 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-percentage.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-phone.svg b/packages/nc-gui/assets/nc-icons/cell-phone.svg new file mode 100644 index 0000000000..cebfd82713 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-qrcode.svg b/packages/nc-gui/assets/nc-icons/cell-qrcode.svg new file mode 100644 index 0000000000..4e10fc7aac --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-qrcode.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-rating.svg b/packages/nc-gui/assets/nc-icons/cell-rating.svg new file mode 100644 index 0000000000..e52116a748 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-rating.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-rollup.svg b/packages/nc-gui/assets/nc-icons/cell-rollup.svg new file mode 100644 index 0000000000..6730c17e5d --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-rollup.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-select.svg b/packages/nc-gui/assets/nc-icons/cell-select.svg new file mode 100644 index 0000000000..a19b1801e6 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-select.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-text.svg b/packages/nc-gui/assets/nc-icons/cell-text.svg new file mode 100644 index 0000000000..9af97b17a4 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-text.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-time.svg b/packages/nc-gui/assets/nc-icons/cell-time.svg new file mode 100644 index 0000000000..8df7a2cda8 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-time.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-url.svg b/packages/nc-gui/assets/nc-icons/cell-url.svg new file mode 100644 index 0000000000..781af1c05c --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-url.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/cell-user.svg b/packages/nc-gui/assets/nc-icons/cell-user.svg new file mode 100644 index 0000000000..60f73b5442 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/cell-user.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/system-date.svg b/packages/nc-gui/assets/nc-icons/system-date.svg new file mode 100644 index 0000000000..0b894b1d7c --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/system-date.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/system-key.svg b/packages/nc-gui/assets/nc-icons/system-key.svg new file mode 100644 index 0000000000..cca2ff1d07 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/system-key.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/nc-gui/assets/nc-icons/system-text.svg b/packages/nc-gui/assets/nc-icons/system-text.svg new file mode 100644 index 0000000000..81f3e3e566 --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/system-text.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/nc-gui/assets/nc-icons/system-user.svg b/packages/nc-gui/assets/nc-icons/system-user.svg new file mode 100644 index 0000000000..83703faa3c --- /dev/null +++ b/packages/nc-gui/assets/nc-icons/system-user.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue index 1475665a7a..dfba038b27 100644 --- a/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue +++ b/packages/nc-gui/components/smartsheet/column/EditOrAdd.vue @@ -309,7 +309,7 @@ if (props.fromTableExplorer) {
- +
{{ opt.name }}
({{ $t('general.deprecated') }}) { if (isPrimaryKey(column)) { - return iconMap.key + return iconMap.cellSystemKey } else if (isSpecificDBType(column)) { - return iconMap.specificDbType + return iconMap.cellDb } else if (isJSON(column)) { - return iconMap.json + return iconMap.cellJson } else if (isDate(column, abstractType)) { - return iconMap.calendar + return iconMap.cellDate } else if (isDateTime(column, abstractType)) { - return iconMap.datetime + return iconMap.cellDatetime } else if (isGeoData(column)) { return iconMap.geoData } else if (isSet(column)) { - return iconMap.multiSelect + return iconMap.cellMultiSelect } else if (isSingleSelect(column)) { - return iconMap.singleSelect + return iconMap.cellSingleSelect } else if (isBoolean(column, abstractType)) { - return iconMap.boolean + return iconMap.cellCheckbox } else if (isTextArea(column)) { - return iconMap.longText + return iconMap.cellLongText } else if (isEmail(column)) { - return iconMap.email + return iconMap.cellEmail } else if (isYear(column, abstractType)) { - return iconMap.calendar + return iconMap.cellDate } else if (isTime(column, abstractType)) { - return iconMap.clock + return iconMap.cellTime } else if (isRating(column)) { - return iconMap.rating + return iconMap.cellRating } else if (isAttachment(column)) { - return iconMap.image + return iconMap.cellAttachment } else if (isDecimal(column)) { - return iconMap.decimal + return iconMap.cellDecimal } else if (isPhoneNumber(column)) { - return iconMap.phone + return iconMap.cellPhone } else if (isURL(column)) { - return iconMap.web + return iconMap.cellUrl } else if (isCurrency(column)) { - return iconMap.currency + return iconMap.cellCurrency } else if (isDuration(column)) { - return iconMap.duration + return iconMap.cellDuration } else if (isPercent(column)) { - return iconMap.percent + return iconMap.cellPercent } else if (isGeometry(column)) { - return iconMap.calculator + return iconMap.cellGeometry } else if (isUser(column)) { if ((column.meta as { is_multi?: boolean; notify?: boolean })?.is_multi) { - return iconMap.phUsers + return iconMap.cellUser } - return iconMap.phUser + return iconMap.cellUser } else if (isInt(column, abstractType) || isFloat(column, abstractType)) { - return iconMap.number + return iconMap.cellNumber } else if (isString(column, abstractType)) { - return iconMap.text + return iconMap.cellText } else { - return iconMap.generic + return iconMap.cellSystemText } } diff --git a/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts b/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts index 6b547e1801..66e509dd59 100644 --- a/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts +++ b/packages/nc-gui/components/smartsheet/header/VirtualCellIcon.ts @@ -1,7 +1,7 @@ import type { PropType } from '@vue/runtime-core' import type { ColumnType, LinkToAnotherRecordType, LookupType, RollupType } from 'nocodb-sdk' -import type { Ref } from 'vue' import { RelationTypes, UITypes } from 'nocodb-sdk' +import type { Ref } from 'vue' import { ColumnInj, MetaInj, @@ -33,44 +33,44 @@ const renderIcon = (column: ColumnType, relationColumn?: ColumnType) => { } break case UITypes.SpecificDBType: - return { icon: iconMap.specificDbType, color: 'text-grey' } + return { icon: iconMap.cellDb, color: 'text-grey' } case UITypes.Formula: - return { icon: iconMap.formula, color: 'text-grey' } + return { icon: iconMap.cellFormula, color: 'text-grey' } case UITypes.QrCode: - return { icon: iconMap.qrCode, color: 'text-grey' } + return { icon: iconMap.cellQrCode, color: 'text-grey' } case UITypes.Barcode: - return { icon: iconMap.barCode, color: 'text-grey' } + return { icon: iconMap.cellBarcode, color: 'text-grey' } case UITypes.Lookup: switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { case RelationTypes.MANY_TO_MANY: - return { icon: iconMap.lookup, color: 'text-pink-500' } + return { icon: iconMap.cellLookup, color: 'text-pink-500' } case RelationTypes.HAS_MANY: - return { icon: iconMap.lookup, color: 'text-orange-500' } + return { icon: iconMap.cellLookup, color: 'text-orange-500' } case RelationTypes.BELONGS_TO: - return { icon: iconMap.lookup, color: 'text-blue-500' } + return { icon: iconMap.cellLookup, color: 'text-blue-500' } } - return { icon: iconMap.lookup, color: 'text-grey' } + return { icon: iconMap.cellLookup, color: 'text-grey' } case UITypes.Rollup: switch ((relationColumn?.colOptions as LinkToAnotherRecordType)?.type) { case RelationTypes.MANY_TO_MANY: - return { icon: iconMap.rollup, color: 'text-pink-500' } + return { icon: iconMap.cellRollup, color: 'text-pink-500' } case RelationTypes.HAS_MANY: - return { icon: iconMap.rollup, color: 'text-orange-500' } + return { icon: iconMap.cellRollup, color: 'text-orange-500' } case RelationTypes.BELONGS_TO: - return { icon: iconMap.rollup, color: 'text-blue-500' } + return { icon: iconMap.cellRollup, color: 'text-blue-500' } } - return { icon: iconMap.rollup, color: 'text-grey' } + return { icon: iconMap.cellRollup, color: 'text-grey' } case UITypes.Count: return { icon: CountIcon, color: 'text-grey' } case UITypes.CreatedTime: case UITypes.LastModifiedTime: - return { icon: iconMap.datetime, color: 'text-grey' } + return { icon: iconMap.cellSystemDate, color: 'text-grey' } case UITypes.CreatedBy: case UITypes.LastModifiedBy: - return { icon: iconMap.phUser, color: 'text-grey' } + return { icon: iconMap.cellSystemUser, color: 'text-grey' } } - return { icon: iconMap.generic, color: 'text-grey' } + return { icon: iconMap.cellSystemText, color: 'text-grey' } } export default defineComponent({ diff --git a/packages/nc-gui/utils/columnUtils.ts b/packages/nc-gui/utils/columnUtils.ts index 316056a332..2be05db81d 100644 --- a/packages/nc-gui/utils/columnUtils.ts +++ b/packages/nc-gui/utils/columnUtils.ts @@ -1,125 +1,123 @@ import type { ColumnType, LinkToAnotherRecordType } from 'nocodb-sdk' import { RelationTypes, UITypes } from 'nocodb-sdk' import { iconMap } from '#imports' -import LinkVariant from '~icons/mdi/link-variant' -import ID from '~icons/mdi/identifier' const uiTypes = [ { name: UITypes.Links, - icon: iconMap.link, + icon: iconMap.cellLinks, virtual: 1, }, { name: UITypes.LinkToAnotherRecord, - icon: iconMap.link, + icon: iconMap.cellLinks, virtual: 1, deprecated: 1, }, { name: UITypes.Lookup, - icon: iconMap.lookup, + icon: iconMap.cellLookup, virtual: 1, }, { name: UITypes.SingleLineText, - icon: iconMap.text, + icon: iconMap.cellText, }, { name: UITypes.LongText, - icon: iconMap.longText, + icon: iconMap.cellLongText, }, { name: UITypes.Number, - icon: iconMap.number, + icon: iconMap.cellNumber, }, { name: UITypes.Decimal, - icon: iconMap.decimal, + icon: iconMap.cellDecimal, }, { name: UITypes.Attachment, - icon: iconMap.image, + icon: iconMap.cellAttachment, }, { name: UITypes.Checkbox, - icon: iconMap.boolean, + icon: iconMap.cellCheckbox, }, { name: UITypes.MultiSelect, - icon: iconMap.multiSelect, + icon: iconMap.cellMultiSelect, }, { name: UITypes.SingleSelect, - icon: iconMap.singleSelect, + icon: iconMap.cellSingleSelect, }, { name: UITypes.Date, - icon: iconMap.calendar, + icon: iconMap.cellDate, }, { name: UITypes.Year, - icon: iconMap.calendar, + icon: iconMap.cellDate, }, { name: UITypes.Time, - icon: iconMap.clock, + icon: iconMap.cellTime, }, { name: UITypes.PhoneNumber, - icon: iconMap.phone, + icon: iconMap.cellPhone, }, { name: UITypes.Email, - icon: iconMap.email, + icon: iconMap.cellEmail, }, { name: UITypes.URL, - icon: iconMap.web, + icon: iconMap.cellUrl, }, { name: UITypes.Currency, - icon: iconMap.currency, + icon: iconMap.cellCurrency, }, { name: UITypes.Percent, - icon: iconMap.percent, + icon: iconMap.cellPercent, }, { name: UITypes.Duration, - icon: iconMap.duration, + icon: iconMap.cellDuration, }, { name: UITypes.Rating, - icon: iconMap.rating, + icon: iconMap.cellRating, }, { name: UITypes.Formula, - icon: iconMap.formula, + icon: iconMap.cellFormula, virtual: 1, }, { name: UITypes.Rollup, - icon: iconMap.rollup, + icon: iconMap.cellRollup, virtual: 1, }, { name: UITypes.DateTime, - icon: iconMap.datetime, + icon: iconMap.cellDatetime, }, { name: UITypes.QrCode, - icon: iconMap.qrCode, + icon: iconMap.cellQrCode, virtual: 1, }, { name: UITypes.Barcode, - icon: iconMap.barCode, + icon: iconMap.cellBarcode, virtual: 1, }, { name: UITypes.Geometry, - icon: iconMap.calculator, + icon: iconMap.cellGeometry, }, { @@ -128,31 +126,31 @@ const uiTypes = [ }, { name: UITypes.JSON, - icon: iconMap.json, + icon: iconMap.cellJson, }, { name: UITypes.SpecificDBType, - icon: iconMap.specificDbType, + icon: iconMap.cellDb, }, { name: UITypes.User, - icon: iconMap.phUser, + icon: iconMap.cellUser, }, { name: UITypes.CreatedTime, - icon: iconMap.datetime, + icon: iconMap.cellSystemDate, }, { name: UITypes.LastModifiedTime, - icon: iconMap.datetime, + icon: iconMap.cellSystemDate, }, { name: UITypes.CreatedBy, - icon: iconMap.phUser, + icon: iconMap.cellSystemUser, }, { name: UITypes.LastModifiedBy, - icon: iconMap.phUser, + icon: iconMap.cellSystemUser, }, ] @@ -162,15 +160,15 @@ const getUIDTIcon = (uidt: UITypes | string) => { ...uiTypes, { name: UITypes.CreatedTime, - icon: iconMap.calendar, + icon: iconMap.cellSystemDate, }, { name: UITypes.ID, - icon: ID, + icon: iconMap.cellSystemKey, }, { name: UITypes.ForeignKey, - icon: LinkVariant, + icon: iconMap.cellLinks, }, ].find((t) => t.name === uidt) || {} ).icon diff --git a/packages/nc-gui/utils/iconUtils.ts b/packages/nc-gui/utils/iconUtils.ts index 41a6cafcdb..484e6a937c 100644 --- a/packages/nc-gui/utils/iconUtils.ts +++ b/packages/nc-gui/utils/iconUtils.ts @@ -130,6 +130,39 @@ import NcUnderline from '~icons/nc-icons/underline' import NcCrop from '~icons/nc-icons/crop' import NcLink from '~icons/nc-icons/link' +import NcCellBarcode from '~icons/nc-icons/cell-barcode' +import NcCellCheckbox from '~icons/nc-icons/cell-checkbox' +import NcCellDate from '~icons/nc-icons/cell-date' +import NcCellEmail from '~icons/nc-icons/cell-email' +import NcCellFormula from '~icons/nc-icons/cell-formula' +import NcCellCurrency from '~icons/nc-icons/cell-currency' +import NcCellDatetime from '~icons/nc-icons/cell-datetime' +import NcCellDb from '~icons/nc-icons/cell-db' +import NcCellDecimal from '~icons/nc-icons/cell-decimal' +import NcCellDuration from '~icons/nc-icons/cell-duration' +import NcCellGeometry from '~icons/nc-icons/cell-geometry' +import NcCellJson from '~icons/nc-icons/cell-json' +import NcCellLinks from '~icons/nc-icons/cell-link' +import NcCellLongText from '~icons/nc-icons/cell-longtext' +import NcCellLookup from '~icons/nc-icons/cell-lookup' +import NcCellMultiSelect from '~icons/nc-icons/cell-multiselect' +import NcCellNumber from '~icons/nc-icons/cell-number' +import NcCellPercent from '~icons/nc-icons/cell-percentage' +import NcCellPhone from '~icons/nc-icons/cell-phone' +import NcCellQrCode from '~icons/nc-icons/cell-qrcode' +import NcCellRating from '~icons/nc-icons/cell-rating' +import NcCellRollup from '~icons/nc-icons/cell-rollup' +import NcCellSingleSelect from '~icons/nc-icons/cell-select' +import NcCellText from '~icons/nc-icons/cell-text' +import NcCellTime from '~icons/nc-icons/cell-time' +import NcCellUrl from '~icons/nc-icons/cell-url' +import NcCellUser from '~icons/nc-icons/cell-user' +import NcCellSystemDate from '~icons/nc-icons/system-date' +import NcCellSystemKey from '~icons/nc-icons/system-key' +import NcCellSystemUser from '~icons/nc-icons/system-user' +import NcCellSystemText from '~icons/nc-icons/system-text' +import NcCellAttachment from '~icons/nc-icons/cell-attachment' + // keep it for reference // todo: remove it after all icons are migrated /* export const iconMapOld = { @@ -278,6 +311,39 @@ import NcLink from '~icons/nc-icons/link' } as const */ export const iconMap = { + cellBarcode: NcCellBarcode, + cellCheckbox: NcCellCheckbox, + cellDate: NcCellDate, + cellEmail: NcCellEmail, + cellFormula: NcCellFormula, + cellCurrency: NcCellCurrency, + cellDatetime: NcCellDatetime, + cellDb: NcCellDb, + cellDecimal: NcCellDecimal, + cellDuration: NcCellDuration, + cellGeometry: NcCellGeometry, + cellJson: NcCellJson, + cellLinks: NcCellLinks, + cellLongText: NcCellLongText, + cellLookup: NcCellLookup, + cellMultiSelect: NcCellMultiSelect, + cellNumber: NcCellNumber, + cellPercent: NcCellPercent, + cellPhone: NcCellPhone, + cellQrCode: NcCellQrCode, + cellRating: NcCellRating, + cellRollup: NcCellRollup, + cellSingleSelect: NcCellSingleSelect, + cellText: NcCellText, + cellTime: NcCellTime, + cellUrl: NcCellUrl, + cellUser: NcCellUser, + cellSystemDate: NcCellSystemDate, + cellSystemKey: NcCellSystemKey, + cellSystemUser: NcCellSystemUser, + cellSystemText: NcCellSystemText, + cellAttachment: NcCellAttachment, + sort: Sort, group: Group, filter: Filter,