@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
85 lines (84 loc) • 2.03 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { base as o, forms as t, sizeMap as m, orientationMap as $ } from "./json-classes.mjs";
const n = `${o.prefix}-${t.form}`, c = `${o.prefix}-${t.form}-${t.field}`, a = {
form: {
main: n,
size: {
prefix: `${n}-`,
small: `${n}-${m.small}`,
medium: `${n}-${m.medium}`,
large: `${n}-${m.large}`
},
orientation: {
horizontal: `${n}-${$.horizontal}`,
vertical: `${n}-${$.vertical}`
}
},
formLayout: {
main: `${o.prefix}-${t.form}-layout ${o.prefix}-d-grid`
},
fieldset: {
main: `${o.prefix}-${t.form}-${t.fieldset}`
},
legend: {
main: `${o.prefix}-${t.form}-${t.legend}`
},
field: {
main: c,
isRtl: `${o.prefix}-${o.rtl}`
},
separator: {
main: `${o.prefix}-${t.form}-${t.separator}`
}
}, u = {
form: (r) => {
var l;
const { size: e, orientation: i, c: f = a } = r, s = f.form;
return {
[s.main]: !0,
[s.size[e]]: s.size[e],
[((l = s.size) == null ? void 0 : l.prefix) || ""]: e && !s.size[e],
[s.orientation[i]]: s.orientation[i]
};
},
formLayout: (r) => {
const { c: e = a } = r;
return {
[e.formLayout.main]: !0
};
},
fieldset: (r) => {
const { c: e = a } = r;
return {
[e.fieldset.main]: !0
};
},
legend: (r) => {
const { c: e = a } = r;
return {
[e.legend.main]: !0
};
},
field: (r) => {
const { isRtl: e, c: i = a } = r, f = i.field;
return {
[f.main]: !0,
[f.isRtl]: e
};
},
separator: (r) => {
const { c: e = a } = r;
return {
[e.separator.main]: !0
};
}
};
export {
u as uForm
};