@xanui/core 1.2.18 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/getProps.js +7 -17
- package/css/getProps.js.map +1 -1
- package/css/getProps.mjs +7 -17
- package/css/getProps.mjs.map +1 -1
- package/package.json +1 -1
package/css/getProps.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use strict';Object.defineProperty(exports,'__esModule',{value:true});const getProps = (prop, value, _css) => {
|
|
2
|
-
let important;
|
|
3
2
|
if (typeof value === 'string') {
|
|
4
3
|
const split = value.split("!");
|
|
5
|
-
|
|
4
|
+
split[1] ? "!important" : "";
|
|
6
5
|
value = split[0];
|
|
7
6
|
}
|
|
8
7
|
if (prop === 'disabled') {
|
|
@@ -24,22 +23,13 @@
|
|
|
24
23
|
}
|
|
25
24
|
if (prop === "spacing" && typeof value === "number") {
|
|
26
25
|
const val = value * 8;
|
|
27
|
-
const isFlex = (_css === null || _css === void 0 ? void 0 : _css.flexBox) ||
|
|
28
|
-
(_css === null || _css === void 0 ? void 0 : _css.flexRow) ||
|
|
29
|
-
(_css === null || _css === void 0 ? void 0 : _css.flexColumn) ||
|
|
30
|
-
(_css === null || _css === void 0 ? void 0 : _css.display) === "flex";
|
|
31
|
-
if (isFlex) {
|
|
32
|
-
const isColumn = (_css === null || _css === void 0 ? void 0 : _css.flexColumn) === true;
|
|
33
|
-
return Object.assign(Object.assign({}, (isColumn
|
|
34
|
-
? { marginTop: `-${val}px${important || ""}` }
|
|
35
|
-
: { marginLeft: `-${val}px${important || ""}` })), { "& > *": isColumn
|
|
36
|
-
? { marginTop: `${val}px${important || ""}` }
|
|
37
|
-
: { marginLeft: `${val}px${important || ""}` } });
|
|
38
|
-
}
|
|
39
|
-
// non-flex fallback (safe & predictable)
|
|
40
26
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
marginLeft: `-${val}px`,
|
|
28
|
+
marginTop: `-${val}px`,
|
|
29
|
+
width: `calc(100% + ${val}px)`,
|
|
30
|
+
"& > *": {
|
|
31
|
+
paddingLeft: `${val}px`,
|
|
32
|
+
paddingTop: `${val}px`,
|
|
43
33
|
},
|
|
44
34
|
};
|
|
45
35
|
}
|
package/css/getProps.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n
|
|
1
|
+
{"version":3,"file":"getProps.js","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: `calc(100% + ${val}px)`,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"divider.primary\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":"sEAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,mBAAmB;AAC3B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,KAAK,EAAE,CAAA,sBAAA,CAAwB;AAC/B,gBAAA,WAAW,EAAE,CAAA,2BAAA,CAA6B;aAC7C;YAED,IAAK,IAAY,CAAC,OAAO,IAAK,IAAY,CAAC,OAAO,KAAK,aAAa,EAAE;AAClE,gBAAA,CAAC,CAAC,OAAO,GAAG,CAAA,yBAAA,CAA2B;YAC3C;AACA,YAAA,OAAO,CAAC;QACZ;AACA,QAAA,OAAO,EAAE;IACb;IAGA,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjD,QAAA,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;QAErB,OAAO;YACH,UAAU,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACvB,SAAS,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACtB,KAAK,EAAE,CAAA,YAAA,EAAe,GAAG,CAAA,GAAA,CAAK;AAE9B,YAAA,OAAO,EAAE;gBACL,WAAW,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;gBACvB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ"}
|
package/css/getProps.mjs
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const getProps = (prop, value, _css) => {
|
|
2
|
-
let important;
|
|
3
2
|
if (typeof value === 'string') {
|
|
4
3
|
const split = value.split("!");
|
|
5
|
-
|
|
4
|
+
split[1] ? "!important" : "";
|
|
6
5
|
value = split[0];
|
|
7
6
|
}
|
|
8
7
|
if (prop === 'disabled') {
|
|
@@ -24,22 +23,13 @@ const getProps = (prop, value, _css) => {
|
|
|
24
23
|
}
|
|
25
24
|
if (prop === "spacing" && typeof value === "number") {
|
|
26
25
|
const val = value * 8;
|
|
27
|
-
const isFlex = (_css === null || _css === void 0 ? void 0 : _css.flexBox) ||
|
|
28
|
-
(_css === null || _css === void 0 ? void 0 : _css.flexRow) ||
|
|
29
|
-
(_css === null || _css === void 0 ? void 0 : _css.flexColumn) ||
|
|
30
|
-
(_css === null || _css === void 0 ? void 0 : _css.display) === "flex";
|
|
31
|
-
if (isFlex) {
|
|
32
|
-
const isColumn = (_css === null || _css === void 0 ? void 0 : _css.flexColumn) === true;
|
|
33
|
-
return Object.assign(Object.assign({}, (isColumn
|
|
34
|
-
? { marginTop: `-${val}px${important || ""}` }
|
|
35
|
-
: { marginLeft: `-${val}px${important || ""}` })), { "& > *": isColumn
|
|
36
|
-
? { marginTop: `${val}px${important || ""}` }
|
|
37
|
-
: { marginLeft: `${val}px${important || ""}` } });
|
|
38
|
-
}
|
|
39
|
-
// non-flex fallback (safe & predictable)
|
|
40
26
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
marginLeft: `-${val}px`,
|
|
28
|
+
marginTop: `-${val}px`,
|
|
29
|
+
width: `calc(100% + ${val}px)`,
|
|
30
|
+
"& > *": {
|
|
31
|
+
paddingLeft: `${val}px`,
|
|
32
|
+
paddingTop: `${val}px`,
|
|
43
33
|
},
|
|
44
34
|
};
|
|
45
35
|
}
|
package/css/getProps.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getProps.mjs","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n
|
|
1
|
+
{"version":3,"file":"getProps.mjs","sources":["../../src/css/getProps.ts"],"sourcesContent":["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n let c: any = {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \"0.5!important\",\n color: `text.primary!important`,\n borderColor: `divider.secondary!important`,\n }\n\n if ((_css as any).bgcolor && (_css as any).bgcolor !== 'transparent') {\n c.bgcolor = `divider.primary!important`\n }\n return c\n }\n return {}\n }\n\n\n if (prop === \"spacing\" && typeof value === \"number\") {\n const val = value * 8;\n\n return {\n marginLeft: `-${val}px`,\n marginTop: `-${val}px`,\n width: `calc(100% + ${val}px)`,\n\n \"& > *\": {\n paddingLeft: `${val}px`,\n paddingTop: `${val}px`,\n },\n } as any;\n }\n\n\n\n // if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n // const keys: any = Object.keys(_css)\n // let p: any = {\n // [`${prop}Width`]: value + 'px' + (important || \"\"),\n // }\n // // if (!keys.includes(`${prop}Color`)) {\n // // p[`${prop}Color`] = \"divider.primary\"\n // // }\n // if (!keys.includes(`${prop}Style`)) {\n // p[`${prop}Style`] = \"solid\"\n // }\n // return p\n // }\n}\n\nexport default getProps"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,IAAc,KAAI;AAE7D,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;AAC9B,QAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE;AACxC,QAAA,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC;IACpB;AAEA,IAAA,IAAI,IAAI,KAAK,UAAU,EAAE;AACrB,QAAA,IAAK,KAAa,KAAK,IAAI,EAAE;AACzB,YAAA,IAAI,CAAC,GAAQ;AACT,gBAAA,aAAa,EAAE,gBAAgB;AAC/B,gBAAA,MAAM,EAAE,mBAAmB;AAC3B,gBAAA,UAAU,EAAE,gBAAgB;AAC5B,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,KAAK,EAAE,CAAA,sBAAA,CAAwB;AAC/B,gBAAA,WAAW,EAAE,CAAA,2BAAA,CAA6B;aAC7C;YAED,IAAK,IAAY,CAAC,OAAO,IAAK,IAAY,CAAC,OAAO,KAAK,aAAa,EAAE;AAClE,gBAAA,CAAC,CAAC,OAAO,GAAG,CAAA,yBAAA,CAA2B;YAC3C;AACA,YAAA,OAAO,CAAC;QACZ;AACA,QAAA,OAAO,EAAE;IACb;IAGA,IAAI,IAAI,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACjD,QAAA,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC;QAErB,OAAO;YACH,UAAU,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACvB,SAAS,EAAE,CAAA,CAAA,EAAI,GAAG,CAAA,EAAA,CAAI;YACtB,KAAK,EAAE,CAAA,YAAA,EAAe,GAAG,CAAA,GAAA,CAAK;AAE9B,YAAA,OAAO,EAAE;gBACL,WAAW,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;gBACvB,UAAU,EAAE,CAAA,EAAG,GAAG,CAAA,EAAA,CAAI;AACzB,aAAA;SACG;IACZ;;;;;;;;;;;;;;AAiBJ"}
|