@wavemaker-ai/react-codegen 1.0.0-rc.647647 → 1.0.0-rc.647655
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/dist/transpiler/index.d.mts +10 -1
- package/dist/transpiler/index.mjs +292 -33
- package/dist/transpiler/index.mjs.map +1 -1
- package/dist/transpiler/wm-styles.css +31 -30
- package/package-lock.json +19 -30
- package/package.json +1 -1
- package/src/app.generator.js +13 -1
- package/src/app.generator.js.map +1 -1
- package/src/transpile/components/container/wizardaction.transformer.js +26 -25
- package/src/transpile/components/container/wizardaction.transformer.js.map +1 -1
- package/src/transpile/components/data/live-filter-field.transformer.js +5 -4
- package/src/transpile/components/data/live-filter-field.transformer.js.map +1 -1
- package/src/transpile/components/data/table/table-row.transformer.js +3 -1
- package/src/transpile/components/data/table/table-row.transformer.js.map +1 -1
- package/src/transpile/components/data/table/utils.js +70 -0
- package/src/transpile/components/data/table/utils.js.map +1 -1
- package/src/transpile/components/page/build-partial-markup.js +12 -1
- package/src/transpile/components/page/build-partial-markup.js.map +1 -1
- package/src/transpile/property/property-parser.js +1 -0
- package/src/transpile/property/property-parser.js.map +1 -1
- package/src/transpile/transpiler.js +5 -1
- package/src/transpile/transpiler.js.map +1 -1
- package/src/transpile/widget-inline-style-constants.js +5 -2
- package/src/transpile/widget-inline-style-constants.js.map +1 -1
- package/src/transpile/widget-inline-style-processor.js +7 -4
- package/src/transpile/widget-inline-style-processor.js.map +1 -1
- package/src/utils.browser.js +92 -42
- package/src/utils.browser.js.map +1 -1
- package/src/utils.js +5 -158
- package/src/utils.js.map +1 -1
- package/templates/project/app/autoLayout.css +31 -30
- package/templates/project/package.json +4 -4
|
@@ -65,4 +65,13 @@ declare function serializeVariablesToCode(result: TranspiledVariableDefinitions,
|
|
|
65
65
|
*/
|
|
66
66
|
declare function transformMarkup(markup: string, options?: TransformMarkupOptions): TranspiledOutput;
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
type CssScopeType = "page" | "partial" | "prefab";
|
|
69
|
+
interface CssScopeOptions {
|
|
70
|
+
scopeType: CssScopeType;
|
|
71
|
+
name: string;
|
|
72
|
+
}
|
|
73
|
+
declare const buildCssScopeClass: (scopeType: CssScopeType, name: string) => string;
|
|
74
|
+
declare const scopeCssUnderWmApp: (cssContent: string, scopeOptions?: CssScopeOptions) => string;
|
|
75
|
+
declare const fixURLPathAndScope: (file_content: string, basePath?: string, isAppCss?: boolean, scopeOptions?: CssScopeOptions) => string;
|
|
76
|
+
|
|
77
|
+
export { type CssScopeOptions, type CssScopeType, type TransformMarkupOptions, type TranspiledOutput, type TranspiledVariableDefinitions, buildCssScopeClass, fixURLPathAndScope, scopeCssUnderWmApp, serializeVariablesToCode, transform as transformEx, transformMarkup, _default as transformVariable, transpileVariableDefinitions };
|
|
@@ -39249,6 +39249,22 @@ var addOptionalChaining = (bindPath, options = {}) => {
|
|
|
39249
39249
|
}
|
|
39250
39250
|
return result;
|
|
39251
39251
|
};
|
|
39252
|
+
var fixURLPath = (file_content, basePath, isAppCss) => {
|
|
39253
|
+
let updatedContent = file_content.replace(
|
|
39254
|
+
/url\((['"]?)resources/g,
|
|
39255
|
+
`url($1${basePath || ""}/resources`
|
|
39256
|
+
);
|
|
39257
|
+
if (isAppCss) {
|
|
39258
|
+
updatedContent = updatedContent.replace(
|
|
39259
|
+
/url\((['"])(?!\/|http|data:)([^'"]+)\1\)/g,
|
|
39260
|
+
(match, quote, url) => {
|
|
39261
|
+
const fixedUrl = url.startsWith("/") ? url : `/${url}`;
|
|
39262
|
+
return `url(${quote}${fixedUrl}${quote})`;
|
|
39263
|
+
}
|
|
39264
|
+
);
|
|
39265
|
+
}
|
|
39266
|
+
return updatedContent;
|
|
39267
|
+
};
|
|
39252
39268
|
var transformAppLocale = (exp) => {
|
|
39253
39269
|
if (exp.startsWith("fragment?.Prefab") || exp.startsWith("fragment.Prefab")) {
|
|
39254
39270
|
exp = exp.replace("fragment?.Prefab", "fragment");
|
|
@@ -39287,6 +39303,168 @@ var modifyExpression = (exp) => {
|
|
|
39287
39303
|
return addOptionalChaining(exp);
|
|
39288
39304
|
}
|
|
39289
39305
|
};
|
|
39306
|
+
var DISABLE_SCOPING_MARKER = "/*DISABLE_SCOPING*/";
|
|
39307
|
+
var buildCssScopeClass = (scopeType, name) => {
|
|
39308
|
+
const lowerName = name.toLowerCase();
|
|
39309
|
+
switch (scopeType) {
|
|
39310
|
+
case "page":
|
|
39311
|
+
return `app-page-${lowerName}`;
|
|
39312
|
+
case "partial":
|
|
39313
|
+
return `app-partial-${lowerName}`;
|
|
39314
|
+
case "prefab":
|
|
39315
|
+
return `app-prefab-${lowerName}`;
|
|
39316
|
+
}
|
|
39317
|
+
};
|
|
39318
|
+
var removeLeadingCssBlockComments = (rule) => {
|
|
39319
|
+
let idx = 0;
|
|
39320
|
+
const len = rule.length;
|
|
39321
|
+
let prefix = "";
|
|
39322
|
+
while (idx < len) {
|
|
39323
|
+
const wsStart = idx;
|
|
39324
|
+
while (idx < len && /\s/.test(rule.charAt(idx))) {
|
|
39325
|
+
idx++;
|
|
39326
|
+
}
|
|
39327
|
+
prefix += rule.slice(wsStart, idx);
|
|
39328
|
+
if (idx > len - 2 || rule.charAt(idx) !== "/" || rule.charAt(idx + 1) !== "*") {
|
|
39329
|
+
break;
|
|
39330
|
+
}
|
|
39331
|
+
const commentStart = idx;
|
|
39332
|
+
idx += 2;
|
|
39333
|
+
let closed = false;
|
|
39334
|
+
while (idx < len - 1) {
|
|
39335
|
+
if (rule.charAt(idx) === "*" && rule.charAt(idx + 1) === "/") {
|
|
39336
|
+
idx += 2;
|
|
39337
|
+
closed = true;
|
|
39338
|
+
break;
|
|
39339
|
+
}
|
|
39340
|
+
idx++;
|
|
39341
|
+
}
|
|
39342
|
+
if (!closed) {
|
|
39343
|
+
return { prefix: "", rest: rule };
|
|
39344
|
+
}
|
|
39345
|
+
prefix += rule.slice(commentStart, idx);
|
|
39346
|
+
}
|
|
39347
|
+
return { prefix, rest: rule.slice(idx) };
|
|
39348
|
+
};
|
|
39349
|
+
var scopeSingleSelector = (selector, scopeClass) => {
|
|
39350
|
+
const sel = selector.trim();
|
|
39351
|
+
if (!sel) {
|
|
39352
|
+
return sel;
|
|
39353
|
+
}
|
|
39354
|
+
if (sel.startsWith(":")) {
|
|
39355
|
+
return sel;
|
|
39356
|
+
}
|
|
39357
|
+
const wmAppIndex = sel.search(/\.wm-app\b/);
|
|
39358
|
+
if (wmAppIndex !== -1) {
|
|
39359
|
+
if (sel.includes(`.${scopeClass}`)) {
|
|
39360
|
+
return sel;
|
|
39361
|
+
}
|
|
39362
|
+
return sel.replace(/\.wm-app\b/, `.wm-app .${scopeClass}`);
|
|
39363
|
+
}
|
|
39364
|
+
return `.wm-app .${scopeClass} ${sel}`;
|
|
39365
|
+
};
|
|
39366
|
+
var splitCssIntoRules = (cssContent) => {
|
|
39367
|
+
const rules = [];
|
|
39368
|
+
let currentRule = "";
|
|
39369
|
+
let inComment = false;
|
|
39370
|
+
let inString = false;
|
|
39371
|
+
let stringChar = "";
|
|
39372
|
+
let braceLevel = 0;
|
|
39373
|
+
for (let i = 0; i < cssContent.length; i++) {
|
|
39374
|
+
const char = cssContent[i];
|
|
39375
|
+
const nextChar = cssContent[i + 1];
|
|
39376
|
+
if (!inString && char === "/" && nextChar === "*") {
|
|
39377
|
+
inComment = true;
|
|
39378
|
+
currentRule += char;
|
|
39379
|
+
continue;
|
|
39380
|
+
}
|
|
39381
|
+
if (inComment && char === "*" && nextChar === "/") {
|
|
39382
|
+
inComment = false;
|
|
39383
|
+
currentRule += char;
|
|
39384
|
+
continue;
|
|
39385
|
+
}
|
|
39386
|
+
if (inComment) {
|
|
39387
|
+
currentRule += char;
|
|
39388
|
+
continue;
|
|
39389
|
+
}
|
|
39390
|
+
if (!inString && (char === '"' || char === "'")) {
|
|
39391
|
+
inString = true;
|
|
39392
|
+
stringChar = char;
|
|
39393
|
+
currentRule += char;
|
|
39394
|
+
continue;
|
|
39395
|
+
}
|
|
39396
|
+
if (inString && char === stringChar && cssContent[i - 1] !== "\\") {
|
|
39397
|
+
inString = false;
|
|
39398
|
+
stringChar = "";
|
|
39399
|
+
currentRule += char;
|
|
39400
|
+
continue;
|
|
39401
|
+
}
|
|
39402
|
+
if (inString) {
|
|
39403
|
+
currentRule += char;
|
|
39404
|
+
continue;
|
|
39405
|
+
}
|
|
39406
|
+
if (char === "{") {
|
|
39407
|
+
braceLevel++;
|
|
39408
|
+
currentRule += char;
|
|
39409
|
+
} else if (char === "}") {
|
|
39410
|
+
braceLevel--;
|
|
39411
|
+
currentRule += char;
|
|
39412
|
+
if (braceLevel === 0) {
|
|
39413
|
+
rules.push(currentRule.trim());
|
|
39414
|
+
currentRule = "";
|
|
39415
|
+
}
|
|
39416
|
+
} else {
|
|
39417
|
+
currentRule += char;
|
|
39418
|
+
}
|
|
39419
|
+
}
|
|
39420
|
+
if (currentRule.trim()) {
|
|
39421
|
+
rules.push(currentRule.trim());
|
|
39422
|
+
}
|
|
39423
|
+
return rules;
|
|
39424
|
+
};
|
|
39425
|
+
var scopeCssUnderWmApp = (cssContent, scopeOptions) => {
|
|
39426
|
+
if (!cssContent || cssContent.trim() === "") {
|
|
39427
|
+
return cssContent;
|
|
39428
|
+
}
|
|
39429
|
+
if (!scopeOptions) {
|
|
39430
|
+
return cssContent;
|
|
39431
|
+
}
|
|
39432
|
+
if (cssContent.trimStart().startsWith(DISABLE_SCOPING_MARKER)) {
|
|
39433
|
+
return cssContent;
|
|
39434
|
+
}
|
|
39435
|
+
const scopeClass = buildCssScopeClass(scopeOptions.scopeType, scopeOptions.name);
|
|
39436
|
+
const rules = splitCssIntoRules(cssContent);
|
|
39437
|
+
const processedRules = rules.map((rule) => {
|
|
39438
|
+
if (!rule) {
|
|
39439
|
+
return rule;
|
|
39440
|
+
}
|
|
39441
|
+
const { prefix, rest } = removeLeadingCssBlockComments(rule);
|
|
39442
|
+
const body = rest;
|
|
39443
|
+
if (!body.trim()) {
|
|
39444
|
+
return rule;
|
|
39445
|
+
}
|
|
39446
|
+
if (body.startsWith("@import") || body.startsWith("@charset")) {
|
|
39447
|
+
return rule;
|
|
39448
|
+
}
|
|
39449
|
+
if (body.startsWith("@")) {
|
|
39450
|
+
return rule;
|
|
39451
|
+
}
|
|
39452
|
+
const openBraceIndex = body.indexOf("{");
|
|
39453
|
+
if (openBraceIndex === -1) {
|
|
39454
|
+
return rule;
|
|
39455
|
+
}
|
|
39456
|
+
const selector = body.substring(0, openBraceIndex).trim();
|
|
39457
|
+
const declarations = body.substring(openBraceIndex);
|
|
39458
|
+
const selectors = selector.split(",").map((s) => s.trim());
|
|
39459
|
+
const scopedSelectors = selectors.map((sel) => scopeSingleSelector(sel, scopeClass));
|
|
39460
|
+
return `${prefix}${scopedSelectors.join(", ")} ${declarations}`;
|
|
39461
|
+
});
|
|
39462
|
+
return processedRules.join("\n");
|
|
39463
|
+
};
|
|
39464
|
+
var fixURLPathAndScope = (file_content, basePath, isAppCss, scopeOptions) => {
|
|
39465
|
+
const urlFixed = fixURLPath(file_content, basePath, isAppCss);
|
|
39466
|
+
return scopeCssUnderWmApp(urlFixed, scopeOptions);
|
|
39467
|
+
};
|
|
39290
39468
|
var htmlElements = [
|
|
39291
39469
|
"header",
|
|
39292
39470
|
"footer",
|
|
@@ -40933,6 +41111,7 @@ var PARSER_MAP = /* @__PURE__ */ new Map([
|
|
|
40933
41111
|
["wm-progress-circle", /* @__PURE__ */ new Map([["datavalue", NUMERIC_PARSER]])],
|
|
40934
41112
|
["wm-video", /* @__PURE__ */ new Map([["controls", BOOLEAN_PARSER]])],
|
|
40935
41113
|
["wm-chips", /* @__PURE__ */ new Map([["searchable", BOOLEAN_PARSER]])],
|
|
41114
|
+
["wm-table-row", /* @__PURE__ */ new Map([["columnwidth", UNIT_PARSER]])],
|
|
40936
41115
|
[
|
|
40937
41116
|
"wm-table",
|
|
40938
41117
|
/* @__PURE__ */ new Map([
|
|
@@ -41066,6 +41245,7 @@ var ALIGNMENT_MATRIX = {
|
|
|
41066
41245
|
center: { justifyContent: "space-between", alignItems: "center" },
|
|
41067
41246
|
end: { justifyContent: "space-between", alignItems: "flex-end" }
|
|
41068
41247
|
};
|
|
41248
|
+
var AUTOLAYOUT_CLASS_PREFIX = "wm-";
|
|
41069
41249
|
var CSS_PROP_PREFIX = {
|
|
41070
41250
|
display: "d",
|
|
41071
41251
|
"flex-direction": "fd",
|
|
@@ -41206,7 +41386,7 @@ var AUTOLAYOUT_WIDGET_TAGS = /* @__PURE__ */ new Set([
|
|
|
41206
41386
|
"wm-page-content"
|
|
41207
41387
|
]);
|
|
41208
41388
|
var STYLE_OVERLAPPING_LAYOUT_ATTRS = ["overflow", "zindex", "clipcontent"];
|
|
41209
|
-
var
|
|
41389
|
+
var PREDEFINED_CLASS_SUFFIXES = [
|
|
41210
41390
|
"d-flex",
|
|
41211
41391
|
"fd-row",
|
|
41212
41392
|
"fd-column",
|
|
@@ -41238,6 +41418,9 @@ var PREDEFINED_CLASS_NAMES = [
|
|
|
41238
41418
|
"pos-sticky",
|
|
41239
41419
|
"pos-fixed"
|
|
41240
41420
|
];
|
|
41421
|
+
var PREDEFINED_CLASS_NAMES = PREDEFINED_CLASS_SUFFIXES.map(
|
|
41422
|
+
(cls) => `${AUTOLAYOUT_CLASS_PREFIX}${cls}`
|
|
41423
|
+
);
|
|
41241
41424
|
|
|
41242
41425
|
// src/transpile/style/split-css-shorthand.ts
|
|
41243
41426
|
function splitCssShorthandOnSpaces(value) {
|
|
@@ -41288,7 +41471,10 @@ function splitCssShorthandOnSpaces(value) {
|
|
|
41288
41471
|
|
|
41289
41472
|
// src/transpile/widget-inline-style-processor.ts
|
|
41290
41473
|
var isBind = (v) => !!(v && (v.startsWith("bind:") || v.startsWith("{")));
|
|
41291
|
-
var hasValidDir = (v) =>
|
|
41474
|
+
var hasValidDir = (v) => {
|
|
41475
|
+
const d = v == null ? void 0 : v.trim();
|
|
41476
|
+
return d === "row" || d === "column";
|
|
41477
|
+
};
|
|
41292
41478
|
var isAuto = (v) => v === "auto";
|
|
41293
41479
|
var normalizeGap = (v) => v != null && v !== "" && !isAuto(v) ? v : null;
|
|
41294
41480
|
function parseDimensionValue(value, element) {
|
|
@@ -41342,7 +41528,7 @@ function sanitizeValue(value) {
|
|
|
41342
41528
|
}
|
|
41343
41529
|
function cssToClassName(property, value) {
|
|
41344
41530
|
const prefix = CSS_PROP_PREFIX[property] || property.replace(/-/g, "");
|
|
41345
|
-
return `${prefix}-${sanitizeValue(value)}`;
|
|
41531
|
+
return `${AUTOLAYOUT_CLASS_PREFIX}${prefix}-${sanitizeValue(value)}`;
|
|
41346
41532
|
}
|
|
41347
41533
|
function stripBalancedOuterParens(expr) {
|
|
41348
41534
|
let e = expr;
|
|
@@ -41478,7 +41664,7 @@ function computeLayoutCssProperties(props) {
|
|
|
41478
41664
|
var _a;
|
|
41479
41665
|
const css = {};
|
|
41480
41666
|
if (hasValidDir(props.direction)) {
|
|
41481
|
-
const direction = props.direction;
|
|
41667
|
+
const direction = props.direction.trim();
|
|
41482
41668
|
const hasAlignment = !!props.alignment;
|
|
41483
41669
|
const alignment = props.alignment || "top-left";
|
|
41484
41670
|
const wrap2 = direction === "column" ? false : (_a = props.wrap) != null ? _a : false;
|
|
@@ -41632,7 +41818,7 @@ var AutolayoutCodegen = class {
|
|
|
41632
41818
|
if (tagName === "wm-list") return null;
|
|
41633
41819
|
const parent = element.parentNode;
|
|
41634
41820
|
const dir = ((_c = parent == null ? void 0 : parent.getAttribute) == null ? void 0 : _c.call(parent, "direction")) || null;
|
|
41635
|
-
return dir && hasValidDir(dir) ? dir : null;
|
|
41821
|
+
return dir && hasValidDir(dir) ? dir.trim() : null;
|
|
41636
41822
|
}
|
|
41637
41823
|
// Collect flex props for a single dimension, axis-aware to avoid cross-axis conflicts.
|
|
41638
41824
|
collectSizeFlexProps(element, key, val, flexProps) {
|
|
@@ -41935,6 +42121,65 @@ function convertActionToClickHandler(actionAttr, tableName, liveTableName) {
|
|
|
41935
42121
|
${converted.join("\n ")}
|
|
41936
42122
|
}}`;
|
|
41937
42123
|
}
|
|
42124
|
+
function isRowBoundExpression(value) {
|
|
42125
|
+
if (!value || typeof value !== "string") return false;
|
|
42126
|
+
const exp = value.startsWith("bind:") ? value.substring(5).trim() : value;
|
|
42127
|
+
return /fragment\??\.row/.test(exp) || /\brow\./.test(exp) || /\brow\[/.test(exp);
|
|
42128
|
+
}
|
|
42129
|
+
function transformTableRowPropExpression(expression) {
|
|
42130
|
+
if (!expression) return "";
|
|
42131
|
+
let transformed = expression.replace(/fragment\??\.row/g, "row");
|
|
42132
|
+
transformed = transformed.replace(/\brow\./g, "row?.");
|
|
42133
|
+
transformed = transformed.replace(/\brow\[/g, "row?.[");
|
|
42134
|
+
transformed = addOptionalChaining(transformed);
|
|
42135
|
+
transformed = transformed.replace(/row\?\?\./g, "row?.");
|
|
42136
|
+
transformed = transformed.replace(/(\w+)\?\.\s*\(/g, "$1(");
|
|
42137
|
+
return transformed;
|
|
42138
|
+
}
|
|
42139
|
+
function transformTableRowCurrentItemExpression(expression) {
|
|
42140
|
+
if (!expression) return "";
|
|
42141
|
+
const raw = expression.startsWith("bind:") ? expression.substring(5).trim() : expression;
|
|
42142
|
+
let transformed = raw.replace(/fragment\??\.row/g, "currentItem");
|
|
42143
|
+
transformed = transformed.replace(/\brow\./g, "currentItem?.");
|
|
42144
|
+
transformed = transformed.replace(/\brow\[/g, "currentItem?.[");
|
|
42145
|
+
transformed = addOptionalChaining(transformed);
|
|
42146
|
+
transformed = transformed.replace(/currentItem\?\?\./g, "currentItem?.");
|
|
42147
|
+
transformed = transformed.replace(/(\w+)\?\.\s*\(/g, "$1(");
|
|
42148
|
+
return transformed;
|
|
42149
|
+
}
|
|
42150
|
+
var TABLE_ROW_PROPS_SKIP_ATTRS = /* @__PURE__ */ new Set([
|
|
42151
|
+
"name",
|
|
42152
|
+
"class",
|
|
42153
|
+
"className",
|
|
42154
|
+
"content",
|
|
42155
|
+
"widget-type",
|
|
42156
|
+
"display-name",
|
|
42157
|
+
"displayName",
|
|
42158
|
+
"rowType",
|
|
42159
|
+
"is-table-row",
|
|
42160
|
+
"data-widget-id",
|
|
42161
|
+
"styles",
|
|
42162
|
+
"style"
|
|
42163
|
+
]);
|
|
42164
|
+
function buildTableRowProps(element) {
|
|
42165
|
+
const parts = [];
|
|
42166
|
+
const toRemove = [];
|
|
42167
|
+
for (const name of Object.keys(element.attributes)) {
|
|
42168
|
+
if (TABLE_ROW_PROPS_SKIP_ATTRS.has(name)) continue;
|
|
42169
|
+
const value = element.attributes[name];
|
|
42170
|
+
if (!isRowBoundExpression(value)) continue;
|
|
42171
|
+
const exp = transformTableRowPropExpression(value.substring(5).trim());
|
|
42172
|
+
if (name === "show") {
|
|
42173
|
+
parts.push(`show: (${exp} || false)`);
|
|
42174
|
+
} else {
|
|
42175
|
+
parts.push(`${name}: ${exp}`);
|
|
42176
|
+
}
|
|
42177
|
+
toRemove.push(name);
|
|
42178
|
+
}
|
|
42179
|
+
toRemove.forEach((attr) => element.removeAttribute(attr));
|
|
42180
|
+
if (parts.length === 0) return "";
|
|
42181
|
+
return `tableRowProps={(row: any) => ({${parts.join(", ")}})}`;
|
|
42182
|
+
}
|
|
41938
42183
|
function transformTableColumnClassExpression(expression) {
|
|
41939
42184
|
if (!expression) return "";
|
|
41940
42185
|
let transformed = expression.replace(/fragment\??\.row/g, "rowData");
|
|
@@ -43447,6 +43692,8 @@ function buildPartialMarkup(element, context, componentName) {
|
|
|
43447
43692
|
}
|
|
43448
43693
|
const watch = [];
|
|
43449
43694
|
const typedParams = /* @__PURE__ */ new Set();
|
|
43695
|
+
const rowBoundParamParts = [];
|
|
43696
|
+
const isTableRow = element.hasAttribute("is-table-row");
|
|
43450
43697
|
element.childNodes.filter((node) => isHTMLElement(node) && node.tagName === "WM-PARAM").forEach((node) => {
|
|
43451
43698
|
const e = node;
|
|
43452
43699
|
const name2 = e.getAttribute("name") || "";
|
|
@@ -43458,7 +43705,11 @@ function buildPartialMarkup(element, context, componentName) {
|
|
|
43458
43705
|
value = `bind:${match[0]}`;
|
|
43459
43706
|
}
|
|
43460
43707
|
}
|
|
43461
|
-
|
|
43708
|
+
if (isTableRow && isRowBoundExpression(value)) {
|
|
43709
|
+
rowBoundParamParts.push(`${name2}={${transformTableRowCurrentItemExpression(value)}}`);
|
|
43710
|
+
} else {
|
|
43711
|
+
params[name2] = value;
|
|
43712
|
+
}
|
|
43462
43713
|
if (type && ["string", "boolean", "number"].includes(type)) {
|
|
43463
43714
|
typedParams.add(name2);
|
|
43464
43715
|
}
|
|
@@ -43477,6 +43728,9 @@ function buildPartialMarkup(element, context, componentName) {
|
|
|
43477
43728
|
context,
|
|
43478
43729
|
typeAwareInfer
|
|
43479
43730
|
);
|
|
43731
|
+
if (rowBoundParamParts.length > 0) {
|
|
43732
|
+
paramStr += ` ${rowBoundParamParts.join(" ")}`;
|
|
43733
|
+
}
|
|
43480
43734
|
paramStr += ` content={props.content}`;
|
|
43481
43735
|
if (context.isPartOfPrefab) {
|
|
43482
43736
|
paramStr += " prefab={fragment.prefab}";
|
|
@@ -46186,8 +46440,7 @@ function getNearestWizardName(element) {
|
|
|
46186
46440
|
}
|
|
46187
46441
|
function prefixWizardApiReferences(root, wizardRefName) {
|
|
46188
46442
|
const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
46189
|
-
const
|
|
46190
|
-
// primary actions
|
|
46443
|
+
const wizardActionApiNames = [
|
|
46191
46444
|
"done",
|
|
46192
46445
|
"next",
|
|
46193
46446
|
"previous",
|
|
@@ -46199,8 +46452,9 @@ function prefixWizardApiReferences(root, wizardRefName) {
|
|
|
46199
46452
|
"disableDone",
|
|
46200
46453
|
"hasNextStep",
|
|
46201
46454
|
"hasPreviousStep",
|
|
46202
|
-
"hasNoNextStep"
|
|
46203
|
-
|
|
46455
|
+
"hasNoNextStep"
|
|
46456
|
+
];
|
|
46457
|
+
const wizardConfigApiNames = [
|
|
46204
46458
|
"cancelable",
|
|
46205
46459
|
"skippable",
|
|
46206
46460
|
"nextbtnlabel",
|
|
@@ -46209,33 +46463,36 @@ function prefixWizardApiReferences(root, wizardRefName) {
|
|
|
46209
46463
|
"cancelbtnlabel",
|
|
46210
46464
|
"actionsalignment"
|
|
46211
46465
|
];
|
|
46212
|
-
const
|
|
46213
|
-
const
|
|
46214
|
-
const
|
|
46215
|
-
const
|
|
46466
|
+
const actionApiPart = wizardActionApiNames.map(escapeRe).join("|");
|
|
46467
|
+
const configApiPart = wizardConfigApiNames.map(escapeRe).join("|");
|
|
46468
|
+
const reActionOptional = new RegExp(`fragment\\?\\.(${actionApiPart})\\b`, "g");
|
|
46469
|
+
const reActionPlain = new RegExp(`fragment\\.(${actionApiPart})\\b`, "g");
|
|
46470
|
+
const reActionBind = new RegExp(`bind:fragment\\.(${actionApiPart})\\b`, "g");
|
|
46471
|
+
const reConfigOptional = new RegExp(`fragment\\?\\.(${configApiPart})\\b`, "g");
|
|
46472
|
+
const reConfigPlain = new RegExp(`fragment\\.(${configApiPart})\\b`, "g");
|
|
46473
|
+
const reConfigBind = new RegExp(`bind:fragment\\.(${configApiPart})\\b`, "g");
|
|
46216
46474
|
const rewrite = (val) => {
|
|
46217
46475
|
if (!val) return val;
|
|
46218
46476
|
let v = val;
|
|
46219
|
-
v = v.replace(
|
|
46220
|
-
v = v.replace(
|
|
46221
|
-
v = v.replace(
|
|
46222
|
-
|
|
46477
|
+
v = v.replace(reActionBind, "bind:actions?.$1");
|
|
46478
|
+
v = v.replace(reActionOptional, "actions?.$1");
|
|
46479
|
+
v = v.replace(reActionPlain, "actions.$1");
|
|
46480
|
+
v = v.replace(reConfigBind, `bind:fragment?.Widgets?.${wizardRefName}?.$1`);
|
|
46481
|
+
v = v.replace(reConfigOptional, `fragment?.Widgets?.${wizardRefName}?.$1`);
|
|
46482
|
+
v = v.replace(reConfigPlain, `fragment?.Widgets?.${wizardRefName}?.$1`);
|
|
46483
|
+
const actionsPathRe = /(actions)\.([a-zA-Z_$][\w$]*)\(/g;
|
|
46484
|
+
v = v.replace(actionsPathRe, (_m, base, method2) => {
|
|
46485
|
+
return `${base}?.${method2}?.(`;
|
|
46486
|
+
});
|
|
46487
|
+
const widgetPathRe = new RegExp(
|
|
46223
46488
|
`(fragment\\?\\.Widgets\\?\\.${escapeRe(wizardRefName)})\\.([a-zA-Z_$][\\w$]*)\\(`,
|
|
46224
46489
|
"g"
|
|
46225
46490
|
);
|
|
46226
|
-
v = v.replace(
|
|
46491
|
+
v = v.replace(widgetPathRe, (_m, base, method2) => {
|
|
46227
46492
|
return `${base}?.${method2}?.(`;
|
|
46228
46493
|
});
|
|
46229
46494
|
const method = v.split("?.");
|
|
46230
|
-
if (method && method[3] && [
|
|
46231
|
-
"cancelable",
|
|
46232
|
-
"skippable",
|
|
46233
|
-
"nextbtnlabel",
|
|
46234
|
-
"previousbtnlabel",
|
|
46235
|
-
"donebtnlabel",
|
|
46236
|
-
"cancelbtnlabel",
|
|
46237
|
-
"actionsalignment"
|
|
46238
|
-
].includes(method[3])) {
|
|
46495
|
+
if (method && method[3] && wizardConfigApiNames.includes(method[3])) {
|
|
46239
46496
|
return v.slice(0, v.lastIndexOf("?"));
|
|
46240
46497
|
}
|
|
46241
46498
|
return v;
|
|
@@ -46549,7 +46806,8 @@ var table_row_transformer_default = {
|
|
|
46549
46806
|
partial = partialAttr;
|
|
46550
46807
|
element.removeAttribute("is-table-row");
|
|
46551
46808
|
}
|
|
46552
|
-
|
|
46809
|
+
const tableRowProps = buildTableRowProps(element);
|
|
46810
|
+
return `<WmTableRow listener={fragment} widgetType="${widgetType}" ${transformAttrs(element, context)} ${tableRowProps} ${partial}`;
|
|
46553
46811
|
},
|
|
46554
46812
|
post: (element, context) => "/>",
|
|
46555
46813
|
imports: (element, context) => imports91.concat(getPartialImports(element, context))
|
|
@@ -46742,7 +47000,7 @@ var extractField2 = (element, context, filterElement) => {
|
|
|
46742
47000
|
getAttribute(filterElement, "filterdata"),
|
|
46743
47001
|
false
|
|
46744
47002
|
);
|
|
46745
|
-
if (
|
|
47003
|
+
if (isRange) {
|
|
46746
47004
|
const maxField = getFilterWidgetTemplate(
|
|
46747
47005
|
widgetType,
|
|
46748
47006
|
widgetName,
|
|
@@ -46780,8 +47038,9 @@ var getFilterWidgetTemplate = (widgetType, widgetName, element, filterDataVariab
|
|
|
46780
47038
|
if (onTap) {
|
|
46781
47039
|
element.removeAttribute("on-tap");
|
|
46782
47040
|
}
|
|
46783
|
-
const
|
|
46784
|
-
|
|
47041
|
+
const placeholderAttr = isMaxWidget ? "maxplaceholder" : "placeholder";
|
|
47042
|
+
const placeholder = getAttribute(element, placeholderAttr);
|
|
47043
|
+
if (placeholder && !isMaxWidget) {
|
|
46785
47044
|
element.removeAttribute("placeholder");
|
|
46786
47045
|
}
|
|
46787
47046
|
const filterfieldName = getAttribute(element, "name");
|
|
@@ -47977,6 +48236,6 @@ he/he.js:
|
|
|
47977
48236
|
*)
|
|
47978
48237
|
*/
|
|
47979
48238
|
|
|
47980
|
-
export { serializeVariablesToCode, bind_ex_transformer_default as transformEx, transformMarkup, variable_transformer_default as transformVariable, transpileVariableDefinitions };
|
|
48239
|
+
export { buildCssScopeClass, fixURLPathAndScope, scopeCssUnderWmApp, serializeVariablesToCode, bind_ex_transformer_default as transformEx, transformMarkup, variable_transformer_default as transformVariable, transpileVariableDefinitions };
|
|
47981
48240
|
//# sourceMappingURL=index.mjs.map
|
|
47982
48241
|
//# sourceMappingURL=index.mjs.map
|