@tenoxui/moxie 0.1.0 → 0.3.0
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/README.md +427 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -9
- package/dist/index.es.js +205 -249
- package/dist/index.es.js.map +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/index.d.ts +3 -38
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
@@ -1,25 +1,22 @@
|
|
1
|
-
import type { Config,
|
1
|
+
import type { Config, ProcessedStyle } from './types';
|
2
2
|
export * from './types';
|
3
|
-
export { Config, TenoxUIConfig };
|
4
3
|
export declare class TenoxUI {
|
5
4
|
private property;
|
6
5
|
private values;
|
7
6
|
private classes;
|
8
7
|
private aliases;
|
9
|
-
|
10
|
-
constructor({ property, values, classes, aliases, breakpoints }?: Config);
|
8
|
+
constructor({ property, values, classes, aliases }?: Config);
|
11
9
|
toKebabCase(str: string): string;
|
12
10
|
escapeCSSSelector(str: string): string;
|
13
11
|
private getAllClassNames;
|
14
12
|
private getTypePrefixes;
|
15
13
|
private generateClassNameRegEx;
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
processShorthand(type: string | undefined, value: string | undefined, unit: string | undefined, prefix: string | undefined, secondValue?: string | undefined, secondUnit?: string | undefined): ProcessedStyle | null;
|
14
|
+
parse(className: string, safelist?: string[]): (string | undefined)[] | null;
|
15
|
+
processValue(value: string, unit: string, group: string): string;
|
16
|
+
processShorthand(type: string | undefined, value: string | undefined, unit: string | undefined, prefix: string | undefined, secondValue?: string | undefined, secondUnit?: string | undefined, isHyphen?: boolean): ProcessedStyle | null;
|
20
17
|
private parseValuePattern;
|
21
18
|
private getParentClass;
|
22
|
-
processCustomClass(className: string | undefined, value?: string | undefined, unit?: string | undefined, prefix?: string | undefined, secValue?: string | undefined, secUnit?: string | undefined): ProcessedStyle | null;
|
19
|
+
processCustomClass(className: string | undefined, value?: string | undefined, unit?: string | undefined, prefix?: string | undefined, secValue?: string | undefined, secUnit?: string | undefined, isHyphen?: boolean): ProcessedStyle | null;
|
23
20
|
processAlias(className: string, prefix?: string): ProcessedStyle | null;
|
24
21
|
process(classNames: string | string[]): ProcessedStyle[];
|
25
22
|
}
|
package/dist/index.es.js
CHANGED
@@ -1,327 +1,283 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
var j = Object.defineProperty;
|
2
|
+
var R = Object.getOwnPropertySymbols;
|
3
|
+
var z = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
4
|
+
var V = (P, s, e) => s in P ? j(P, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : P[s] = e, W = (P, s) => {
|
5
|
+
for (var e in s || (s = {}))
|
6
|
+
z.call(s, e) && V(P, e, s[e]);
|
7
|
+
if (R)
|
8
|
+
for (var e of R(s))
|
9
|
+
S.call(s, e) && V(P, e, s[e]);
|
10
|
+
return P;
|
11
|
+
};
|
12
|
+
class _ {
|
13
|
+
constructor({ property: s = {}, values: e = {}, classes: t = {}, aliases: n = {} } = {}) {
|
14
|
+
this.property = W({
|
15
|
+
moxie: ({ key: r }) => r
|
16
|
+
}, s), this.values = e, this.classes = t, this.aliases = n;
|
10
17
|
}
|
11
|
-
toKebabCase(
|
12
|
-
if (/^(webkit|moz|ms|o)[A-Z]/.test(
|
13
|
-
const
|
14
|
-
if (
|
15
|
-
const t =
|
16
|
-
return `-${t}${
|
18
|
+
toKebabCase(s) {
|
19
|
+
if (/^(webkit|moz|ms|o)[A-Z]/.test(s)) {
|
20
|
+
const e = s.match(/^(webkit|moz|ms|o)/);
|
21
|
+
if (e) {
|
22
|
+
const t = e[0];
|
23
|
+
return `-${t}${s.slice(t.length).replace(/[A-Z]/g, (n) => `-${n.toLowerCase()}`)}`;
|
17
24
|
}
|
18
25
|
}
|
19
|
-
return
|
26
|
+
return s.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
20
27
|
}
|
21
|
-
escapeCSSSelector(
|
22
|
-
return
|
28
|
+
escapeCSSSelector(s) {
|
29
|
+
return s.replace(/([ #{}.:;?%&,@+*~'"!^$[\]()=>|/])/g, "\\$1");
|
23
30
|
}
|
24
|
-
getAllClassNames(
|
25
|
-
if (!
|
26
|
-
const
|
27
|
-
return Object.entries(
|
28
|
-
|
29
|
-
|
31
|
+
getAllClassNames(s) {
|
32
|
+
if (!s) return [];
|
33
|
+
const e = /* @__PURE__ */ new Set();
|
34
|
+
return Object.entries(s).forEach(([t, n]) => {
|
35
|
+
n && typeof n == "object" && Object.keys(n).forEach((r) => {
|
36
|
+
e.add(r);
|
30
37
|
});
|
31
|
-
}), Array.from(
|
38
|
+
}), Array.from(e);
|
32
39
|
}
|
33
|
-
getTypePrefixes() {
|
34
|
-
const e = this.property,
|
35
|
-
if (!
|
36
|
-
return
|
37
|
-
const
|
38
|
-
return [...
|
40
|
+
getTypePrefixes(s = []) {
|
41
|
+
const e = this.property, t = this.classes, n = Object.keys(e);
|
42
|
+
if (!t)
|
43
|
+
return [...n, ...s].sort((i, l) => l.length - i.length).join("|");
|
44
|
+
const c = [...this.getAllClassNames(t)];
|
45
|
+
return [...n, ...c, ...s].sort((i, l) => l.length - i.length).join("|");
|
39
46
|
}
|
40
|
-
generateClassNameRegEx() {
|
41
|
-
const e = this.getTypePrefixes()
|
47
|
+
generateClassNameRegEx(s) {
|
48
|
+
const e = this.getTypePrefixes(s), t = "\\[[^\\]]+\\]", n = "\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)", r = "\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}", c = "(?:([a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+(?:-" + t + ")|" + // Direct bracket, parenthesis, or brace content
|
49
|
+
t + "|" + n + "|" + r + "):)?", i = `(${e}|\\[[^\\]]+\\])`, l = "(?:-)?", h = "(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + // Hex colors
|
50
|
+
t + "|" + // Bracket content
|
51
|
+
r + "|" + // Curly brace content
|
52
|
+
n + "|(?:\\$[^\\s\\/]+))", f = "([a-zA-Z%]*)", a = "(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|" + t + "|" + r + "|" + n + "|(?:\\$[^\\s\\/]+))([a-zA-Z%]*))?";
|
42
53
|
return new RegExp(
|
43
|
-
|
44
|
-
`(?:([a-zA-Z0-9-]+|\\[[^\\]]+\\]|\\([^()]*(?:\\([^()]*\\)[^()]*)*\\)|\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\}):)?(${e}|\\[[^\\]]+\\])-(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|(?:\\[[^\\]]+\\])|(?:\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\})|(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\))|(?:\\$[^\\s]+))([a-zA-Z%]*)(?:\\/(-?(?:\\d+(?:\\.\\d+)?)|(?:[a-zA-Z0-9_]+(?:-[a-zA-Z0-9_]+)*(?:-[a-zA-Z0-9_]+)*)|(?:#[0-9a-fA-F]+)|(?:\\[[^\\]]+\\])|(?:\\{[^{}]*(?:\\{[^{}]*\\}[^{}]*)*\\})|(?:\\([^()]*(?:\\([^()]*\\)[^()]*)*\\))|(?:\\$[^\\s]+))([a-zA-Z%]*))?`
|
54
|
+
c + i + l + h + f + a
|
45
55
|
);
|
46
56
|
}
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
return [
|
55
|
-
a,
|
56
|
-
//? as its name. e.g. hover, md, focus
|
57
|
-
r,
|
58
|
-
//? compute css properties or variables that will styled. e.g. [color]-, [--red,background]-, bg-,
|
59
|
-
l || "",
|
60
|
-
//? parsed css value from the class name. e.g. red, space-between, 64, 100
|
61
|
-
i || "",
|
62
|
-
//? is optional if the value is numbers. e.g. px, rem, %
|
63
|
-
// same as value and unit, parsed after the '/' character
|
64
|
-
u,
|
65
|
-
o
|
66
|
-
];
|
67
|
-
}
|
68
|
-
generateMediaQuery(e, s, t) {
|
69
|
-
const { name: a, min: r, max: l } = e;
|
70
|
-
let i = "screen and ";
|
71
|
-
return r !== void 0 && l !== void 0 ? i += `(min-width: ${r}px) and (max-width: ${l}px)` : r !== void 0 ? i += `(min-width: ${r}px)` : l !== void 0 && (i += `(max-width: ${l}px)`), {
|
72
|
-
mediaKey: `@media ${i}`,
|
73
|
-
ruleSet: `.${a}\\:${s} { ${t} }`
|
74
|
-
};
|
57
|
+
parse(s, e) {
|
58
|
+
if (Object.values(this.classes).some((p) => p == null ? void 0 : p[s]))
|
59
|
+
return [void 0, s, "", "", void 0, void 0];
|
60
|
+
const t = this.generateClassNameRegEx(e), n = (s + "-dummy").match(t);
|
61
|
+
if (!n) return null;
|
62
|
+
const [, r, c, i, l, h, f] = n, a = i === "dummy" ? "" : i.replace("-dummy", "");
|
63
|
+
return [r, c, a, l || "", h, f];
|
75
64
|
}
|
76
65
|
// unique value parser
|
77
|
-
processValue(
|
66
|
+
processValue(s, e, t) {
|
78
67
|
if (!s) return "";
|
79
|
-
const
|
80
|
-
const
|
81
|
-
return typeof
|
68
|
+
const n = (r) => r.replace(/\{([^}]+)\}/g, (c, i) => {
|
69
|
+
const l = this.values, h = l !== null ? typeof l[t] == "object" ? l[t][i] : l[i] : void 0;
|
70
|
+
return typeof h == "string" ? h : c;
|
82
71
|
});
|
83
|
-
if (typeof this.values == "object" && this.values !== null && (this.values[
|
84
|
-
return typeof this.values[
|
72
|
+
if (typeof this.values == "object" && this.values !== null && (this.values[t] && typeof this.values[t] == "object" && this.values[t][s] || this.values[s]))
|
73
|
+
return typeof this.values[t] == "object" && this.values[t] !== null ? this.values[t][s] : this.values[s];
|
85
74
|
if (s.startsWith("$"))
|
86
75
|
return `var(--${s.slice(1)})`;
|
87
76
|
if (s.startsWith("[") && s.endsWith("]") || s.startsWith("(") && s.endsWith(")")) {
|
88
77
|
const r = s.slice(1, -1).replace(/_/g, " ");
|
89
|
-
return r.includes("{") ?
|
78
|
+
return r.includes("{") ? n(r) : r.startsWith("--") ? `var(${r})` : r;
|
90
79
|
}
|
91
|
-
return s + (
|
80
|
+
return s + (e || "");
|
92
81
|
}
|
93
|
-
processShorthand(
|
94
|
-
const
|
95
|
-
let
|
96
|
-
const
|
97
|
-
|
98
|
-
let
|
99
|
-
|
100
|
-
const
|
101
|
-
if (
|
102
|
-
const
|
103
|
-
const
|
104
|
-
return `${typeof
|
82
|
+
processShorthand(s = "", e = "", t = "", n, r = "", c = "", i = !0) {
|
83
|
+
const l = this.property[s], h = /^(?:\(|\[)([^:]+):(.+)(?:\)|\])$/;
|
84
|
+
let f = null, a = e || "";
|
85
|
+
const p = a.match(h);
|
86
|
+
p && (f = p[1].trim(), a = p[2].trim());
|
87
|
+
let o;
|
88
|
+
e.includes(f + ":") ? o = e.startsWith("(") ? `(${a})` : `[${a}]` : o = e;
|
89
|
+
const u = this.processValue(o, t, s), m = this.processValue(r, c, s);
|
90
|
+
if (s.startsWith("[") && s.endsWith("]")) {
|
91
|
+
const d = s.slice(1, -1).split(",").map((y) => y.trim()).map((y) => {
|
92
|
+
const $ = this.property[y] || y;
|
93
|
+
return `${typeof $ == "string" && $.startsWith("--") ? String($) : this.toKebabCase(String($))}: ${u}`;
|
105
94
|
}).join("; ");
|
106
95
|
return {
|
107
|
-
className: `${`[${
|
108
|
-
cssRules:
|
96
|
+
className: `${`[${s.slice(1, -1)}]${i ? "-" : ""}${e}${t}`}`,
|
97
|
+
cssRules: d,
|
109
98
|
// return css rules directly
|
110
99
|
value: null,
|
111
100
|
// and set value to null to prevent value duplication
|
112
|
-
prefix:
|
101
|
+
prefix: n
|
113
102
|
};
|
114
103
|
}
|
115
|
-
if (
|
116
|
-
if (typeof
|
117
|
-
const
|
118
|
-
value: t ?
|
119
|
-
unit: t,
|
120
|
-
secondValue: l ? r : $,
|
121
|
-
secondUnit: l,
|
122
|
-
key: o
|
123
|
-
}) : i.property, p = i.value;
|
124
|
-
let d;
|
125
|
-
typeof p == "function" ? d = p({
|
126
|
-
value: t ? s : h,
|
104
|
+
if (l) {
|
105
|
+
if (typeof l == "object" && "property" in l && "value" in l) {
|
106
|
+
const d = typeof l.property == "function" ? l.property({
|
107
|
+
value: t ? e : u,
|
127
108
|
unit: t,
|
128
|
-
secondValue:
|
129
|
-
secondUnit:
|
130
|
-
key:
|
131
|
-
|
132
|
-
|
133
|
-
|
109
|
+
secondValue: c ? r : m,
|
110
|
+
secondUnit: c,
|
111
|
+
key: f
|
112
|
+
}) : l.property, y = l.value;
|
113
|
+
let $;
|
114
|
+
if (typeof y == "function")
|
115
|
+
$ = y({
|
116
|
+
value: t ? e : u,
|
117
|
+
unit: t,
|
118
|
+
secondValue: c ? r : m,
|
119
|
+
secondUnit: c,
|
120
|
+
key: f,
|
121
|
+
property: d
|
122
|
+
});
|
123
|
+
else if (y && typeof y == "string") {
|
124
|
+
const C = l.group || s, A = this.processValue(o, t, C);
|
125
|
+
console.log(o), $ = this.values[o] || this.values[C][o] || o.includes("{") || y.includes("{") ? this.parseValuePattern(C, y, A, "", m, "") : u;
|
126
|
+
} else $ = null;
|
134
127
|
return {
|
135
|
-
className: i
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
cssRules: Array.isArray(y) || typeof y == "string" && y.includes(":") ? y : this.toKebabCase(String(y)),
|
140
|
-
value: p === null ? null : s.startsWith("[") ? h : d,
|
141
|
-
prefix: a
|
128
|
+
className: `${s}${e ? `${i && i ? "-" : ""}${e}${t}` : ""}${r ? `/${r}${c}` : ""}`,
|
129
|
+
cssRules: Array.isArray(d) || typeof d == "string" && d.includes(":") ? d : this.toKebabCase(String(d)),
|
130
|
+
value: y === null ? null : e.startsWith("[") ? u : $,
|
131
|
+
prefix: n
|
142
132
|
};
|
143
133
|
}
|
144
|
-
const
|
145
|
-
value: t ?
|
134
|
+
const g = typeof l == "function" ? l({
|
135
|
+
value: t ? e : u,
|
146
136
|
unit: t,
|
147
|
-
secondValue:
|
148
|
-
secondUnit:
|
149
|
-
key:
|
150
|
-
}) :
|
137
|
+
secondValue: c ? r : m,
|
138
|
+
secondUnit: c,
|
139
|
+
key: f
|
140
|
+
}) : l;
|
151
141
|
return {
|
152
|
-
className: `${
|
153
|
-
cssRules: Array.isArray(
|
154
|
-
value: typeof
|
155
|
-
prefix:
|
142
|
+
className: `${s}${e ? (i ? "-" : "") + e + t : ""}`,
|
143
|
+
cssRules: Array.isArray(l) ? g : typeof g == "string" && g.startsWith("value:") ? g.slice(6) : this.toKebabCase(String(g)),
|
144
|
+
value: typeof g == "string" && g.startsWith("value:") ? null : u,
|
145
|
+
prefix: n
|
156
146
|
};
|
157
147
|
}
|
158
148
|
return null;
|
159
149
|
}
|
160
|
-
parseValuePattern(
|
161
|
-
if (!
|
162
|
-
return
|
163
|
-
const [i,
|
164
|
-
if (
|
165
|
-
let
|
166
|
-
if (t && (
|
167
|
-
const
|
168
|
-
if (
|
169
|
-
r ?
|
170
|
-
else if (
|
171
|
-
const
|
172
|
-
let
|
173
|
-
!
|
150
|
+
parseValuePattern(s, e, t, n, r, c) {
|
151
|
+
if (!e.includes("{0}") && !e.includes("{1") && !e.includes("||"))
|
152
|
+
return e;
|
153
|
+
const [i, l] = e.split("||").map((a) => a.trim()), h = this.processValue(t, n, s), f = this.processValue(r, c, s);
|
154
|
+
if (e.includes("{0}") && e.includes("{1") || e.includes("{1")) {
|
155
|
+
let a = i;
|
156
|
+
if (t && (a = a.replace("{0}", h)), e.includes("{1")) {
|
157
|
+
const p = a.match(/{1([^}]*)}/);
|
158
|
+
if (e.includes("{1}"))
|
159
|
+
r ? a = r.startsWith("[") ? f : a.replace("{1}", f) : a = l;
|
160
|
+
else if (p) {
|
161
|
+
const o = p[0], u = p[1].trim();
|
162
|
+
let m = f;
|
163
|
+
!m && u.includes("|") ? m = u.split("|")[1].trim() : m || (m = ""), a = t.startsWith("[") ? h : a.replace(o, m);
|
174
164
|
}
|
175
165
|
}
|
176
|
-
return t ?
|
166
|
+
return t ? a : l || i;
|
177
167
|
} else
|
178
|
-
return t ? t.startsWith("[") ?
|
168
|
+
return t ? t.startsWith("[") ? h : i.replace("{0}", h) : l || i;
|
179
169
|
}
|
180
|
-
getParentClass(
|
170
|
+
getParentClass(s) {
|
181
171
|
return Object.keys(this.classes).filter(
|
182
|
-
(
|
183
|
-
this.classes[
|
184
|
-
|
172
|
+
(e) => Object.prototype.hasOwnProperty.call(
|
173
|
+
this.classes[e],
|
174
|
+
s
|
185
175
|
)
|
186
176
|
);
|
187
177
|
}
|
188
|
-
processCustomClass(
|
189
|
-
if (!
|
190
|
-
const
|
191
|
-
if (
|
192
|
-
const
|
193
|
-
const
|
194
|
-
if (!
|
195
|
-
const
|
196
|
-
e,
|
197
|
-
m[e] || "",
|
178
|
+
processCustomClass(s, e = "", t = "", n = "", r = "", c = "", i = !0) {
|
179
|
+
if (!s) return null;
|
180
|
+
const l = this.getParentClass(s);
|
181
|
+
if (l.length > 0) {
|
182
|
+
const h = l.map((p) => {
|
183
|
+
const o = this.classes[p];
|
184
|
+
if (!o) return "";
|
185
|
+
const u = this.parseValuePattern(
|
198
186
|
s,
|
187
|
+
o[s] || "",
|
188
|
+
e,
|
199
189
|
t,
|
200
190
|
r,
|
201
|
-
|
191
|
+
c
|
202
192
|
);
|
203
|
-
return `${this.toKebabCase(String(
|
204
|
-
}).filter(Boolean).join("; "),
|
193
|
+
return `${this.toKebabCase(String(p))}: ${u}`;
|
194
|
+
}).filter(Boolean).join("; "), f = s.slice(-(e + t).length), a = `${s}${e ? `${i ? "-" : ""}${e}${t}` : ""}${r ? `/${r}${c}` : ""}`;
|
205
195
|
return {
|
206
|
-
className:
|
207
|
-
cssRules:
|
196
|
+
className: e === f ? s : a,
|
197
|
+
cssRules: h,
|
208
198
|
value: null,
|
209
|
-
prefix:
|
199
|
+
prefix: n
|
210
200
|
};
|
211
201
|
}
|
212
202
|
return null;
|
213
203
|
}
|
214
|
-
processAlias(
|
215
|
-
const t = this.aliases[
|
204
|
+
processAlias(s, e = "") {
|
205
|
+
const t = this.aliases[s];
|
216
206
|
if (!t) return null;
|
217
|
-
const
|
218
|
-
return
|
219
|
-
const [i,
|
220
|
-
if (!
|
221
|
-
const [
|
222
|
-
if (
|
223
|
-
const { cssRules:
|
224
|
-
r.push(
|
207
|
+
const n = t.split(" "), r = [];
|
208
|
+
return n.forEach((c) => {
|
209
|
+
const [i, l] = c.split(":"), h = l || i, f = l ? i : void 0, a = this.parse(c), p = a || [f, h, "", ""];
|
210
|
+
if (!p) return;
|
211
|
+
const [o, u, m, g, d, y] = p, $ = this.processShorthand(u, m, g, void 0, d, y), x = this.processCustomClass(u, m, g, o, d, y);
|
212
|
+
if (x) {
|
213
|
+
const { cssRules: C } = x;
|
214
|
+
r.push(C);
|
225
215
|
return;
|
226
216
|
}
|
227
|
-
if (
|
228
|
-
const
|
229
|
-
Array.isArray(
|
230
|
-
r.push(`${this.toKebabCase(
|
231
|
-
}) : r.push(`${
|
217
|
+
if ($) {
|
218
|
+
const C = $.value !== null ? `: ${$.value}` : "";
|
219
|
+
Array.isArray($.cssRules) ? $.cssRules.forEach((A) => {
|
220
|
+
r.push(`${this.toKebabCase(A)}${C}`);
|
221
|
+
}) : r.push(`${$.cssRules}${C}`);
|
232
222
|
}
|
233
223
|
}), {
|
234
|
-
className:
|
224
|
+
className: s,
|
235
225
|
cssRules: r.join("; "),
|
236
226
|
value: null,
|
237
|
-
prefix:
|
227
|
+
prefix: e
|
238
228
|
};
|
239
229
|
}
|
240
|
-
process(
|
241
|
-
const
|
242
|
-
return
|
243
|
-
if (!
|
244
|
-
const [r,
|
245
|
-
if (
|
246
|
-
const { className:
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
t.push({
|
254
|
-
className: b,
|
255
|
-
cssRules: v,
|
256
|
-
value: null,
|
257
|
-
prefix: null
|
258
|
-
});
|
259
|
-
} else
|
260
|
-
t.push({
|
261
|
-
className: g,
|
262
|
-
cssRules: x,
|
263
|
-
value: null,
|
264
|
-
prefix: u
|
265
|
-
});
|
230
|
+
process(s) {
|
231
|
+
const e = Array.isArray(s) ? s : s.split(/\s+/), t = [];
|
232
|
+
return e.forEach((n) => {
|
233
|
+
if (!n) return this;
|
234
|
+
const [r, c] = n.split(":"), i = c || r, l = c ? r : void 0, h = this.processAlias(i, l);
|
235
|
+
if (h) {
|
236
|
+
const { className: A, cssRules: b } = h;
|
237
|
+
t.push({
|
238
|
+
className: A,
|
239
|
+
cssRules: b,
|
240
|
+
value: null,
|
241
|
+
prefix: l
|
242
|
+
});
|
266
243
|
return;
|
267
244
|
}
|
268
|
-
const
|
269
|
-
if (!
|
270
|
-
const [
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
h,
|
245
|
+
const f = this.parse(n), a = f || [l, i, "", ""];
|
246
|
+
if (!a) return this;
|
247
|
+
const [p, o, u, m, g, d] = a, y = !n.includes((o || "") + (u || "")), $ = this.getParentClass(`${o}${y ? "-" : ""}${u}`).length > 0 ? `${o}${y ? "-" : ""}${u}` : o, x = this.processCustomClass(
|
248
|
+
$,
|
249
|
+
u,
|
250
|
+
m,
|
275
251
|
p,
|
276
|
-
|
252
|
+
g,
|
253
|
+
d,
|
254
|
+
y
|
277
255
|
);
|
278
|
-
if (
|
279
|
-
const { className:
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
t.push({
|
287
|
-
className: v,
|
288
|
-
cssRules: R,
|
289
|
-
value: null,
|
290
|
-
prefix: null
|
291
|
-
});
|
292
|
-
} else
|
293
|
-
t.push({
|
294
|
-
className: g,
|
295
|
-
cssRules: x,
|
296
|
-
value: null,
|
297
|
-
prefix: b
|
298
|
-
});
|
256
|
+
if (x) {
|
257
|
+
const { className: A, cssRules: b, prefix: v } = x;
|
258
|
+
t.push({
|
259
|
+
className: A,
|
260
|
+
cssRules: b,
|
261
|
+
value: null,
|
262
|
+
prefix: v
|
263
|
+
});
|
299
264
|
return;
|
300
265
|
}
|
301
|
-
const
|
302
|
-
if (
|
303
|
-
const { className:
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
prefix: null
|
311
|
-
});
|
312
|
-
} else
|
313
|
-
t.push({
|
314
|
-
className: R,
|
315
|
-
cssRules: x,
|
316
|
-
value: b,
|
317
|
-
prefix: v
|
318
|
-
});
|
266
|
+
const C = this.processShorthand(o, u, m, p, g, d, y);
|
267
|
+
if (C) {
|
268
|
+
const { className: A, cssRules: b, value: v, prefix: Z } = C;
|
269
|
+
t.push({
|
270
|
+
className: A,
|
271
|
+
cssRules: b,
|
272
|
+
value: v,
|
273
|
+
prefix: Z
|
274
|
+
});
|
319
275
|
}
|
320
276
|
}), t;
|
321
277
|
}
|
322
278
|
}
|
323
279
|
export {
|
324
|
-
|
325
|
-
|
280
|
+
_ as TenoxUI,
|
281
|
+
_ as default
|
326
282
|
};
|
327
283
|
//# sourceMappingURL=index.es.js.map
|