Files
klz-cables.com/.pnpm-store/v10/files/9c/296522e0a07029f5002a256aa9016197ef56ba026b2685b31e814865cc4f1371125b6e0440ff0d0b44db9656e8602cfa96e960665e348ba57b7e944fb21ccf
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

24 lines
1.2 KiB
Plaintext

'use client';
export const fieldBaseClass = 'field-type';
/**
* Determines whether a field should be displayed as right-to-left (RTL) based on its configuration, payload's localization configuration and the adming user's currently enabled locale.
* @returns Whether the field should be displayed as RTL.
*/
export function isFieldRTL({
fieldLocalized,
fieldRTL,
locale,
localizationConfig
}) {
const hasMultipleLocales = locale && localizationConfig && localizationConfig.locales && localizationConfig.locales.length > 1;
const isCurrentLocaleDefaultLocale = locale?.code === localizationConfig?.defaultLocale;
return fieldRTL !== false && locale?.rtl === true && (fieldLocalized || !fieldLocalized && !hasMultipleLocales ||
// If there is only one locale which is also rtl, that field is rtl too
!fieldLocalized && isCurrentLocaleDefaultLocale) ||
// If the current locale is the default locale, but the field is not localized, that field is rtl too
fieldRTL === true // If fieldRTL is true. This should be useful for when no localization is set at all in the payload config, but you still want fields to be rtl.
;
}
//# sourceMappingURL=index.js.map