UNPKG

ant-design-x-vue

Version:

Craft AI-driven interfaces effortlessly

62 lines (61 loc) 2.42 kB
import { lintWarning as a } from "./utils.mjs"; const p = (t, r, i) => { switch (t) { case "marginLeft": case "marginRight": case "paddingLeft": case "paddingRight": case "left": case "right": case "borderLeft": case "borderLeftWidth": case "borderLeftStyle": case "borderLeftColor": case "borderRight": case "borderRightWidth": case "borderRightStyle": case "borderRightColor": case "borderTopLeftRadius": case "borderTopRightRadius": case "borderBottomLeftRadius": case "borderBottomRightRadius": a( `You seem to be using non-logical property '${t}' which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`, i ); return; case "margin": case "padding": case "borderWidth": case "borderStyle": if (typeof r == "string") { const s = r.split(" ").map((n) => n.trim()); s.length === 4 && s[1] !== s[3] && a( `You seem to be using '${t}' property with different left ${t} and right ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`, i ); } return; case "clear": case "textAlign": (r === "left" || r === "right") && a( `You seem to be using non-logical value '${r}' of ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`, i ); return; case "borderRadius": typeof r == "string" && r.split("/").map((o) => o.trim()).reduce((o, l) => { if (o) return o; const e = l.split(" ").map((d) => d.trim()); return e.length >= 2 && e[0] !== e[1] || e.length === 3 && e[1] !== e[2] || e.length === 4 && e[2] !== e[3] ? !0 : o; }, !1) && a( `You seem to be using non-logical value '${r}' of ${t}, which is not compatible with RTL mode. Please use logical properties and values instead. For more information: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties.`, i ); return; } }; export { p as default };