@jsswift/ui 1.0.45 → 1.0.46
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/min-ui.js +4 -4
- package/dist/ui.js +10561 -14120
- package/dist/ui.min.js +4 -4
- package/package.json +2 -2
- package/src/01-foundation-helpers.js +0 -402
- package/src/10-primitives-layout.js +14 -1013
- package/src/20-display-content.js +484 -718
- package/src/21-list-content.js +246 -341
- package/src/22-banner-content.js +3 -116
- package/src/23-tooltip.js +276 -326
- package/src/31-form-advanced.js +2638 -3003
- package/src/40-navigation.js +1262 -1454
- package/src/41-tab-panel.js +896 -1090
- package/src/50-feedback.js +999 -1209
- package/src/60-shell-app.js +5 -265
- package/src/61-form-service.js +304 -386
- package/src/70-dialog.js +209 -277
- package/src/71-menu-overlays.js +1175 -1400
- package/src/80-data.js +433 -503
- package/src/modules.json +59 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsswift/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.46",
|
|
4
4
|
"description": "JSswift UI layer built on top of @jsswift/core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"src"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@jsswift/core": "^1.0.
|
|
41
|
+
"@jsswift/core": "^1.0.46"
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -351,408 +351,6 @@ UI.AppShell
|
|
|
351
351
|
UI.Parallax
|
|
352
352
|
*/
|
|
353
353
|
|
|
354
|
-
const META_PROP_DESCRIPTIONS = {
|
|
355
|
-
actions: "Content rendered in the action area, typically in a footer or trailing region.",
|
|
356
|
-
active: "Marks the item as active/selected and applies active styling/ARIA when relevant.",
|
|
357
|
-
align: "Alignment of content along the cross axis (e.g. left/center/right).",
|
|
358
|
-
allowCustom: "Allows values not present in the options list.",
|
|
359
|
-
allowCustomValue: "Accepts free-form values in addition to predefined options.",
|
|
360
|
-
aside: "Content or configuration for the aside/secondary region.",
|
|
361
|
-
auto: "Enables automatic sizing or layout behavior instead of fixed sizing.",
|
|
362
|
-
autocomplete: "Native autocomplete attribute for input elements.",
|
|
363
|
-
backdrop: "Whether to render a backdrop overlay behind the component.",
|
|
364
|
-
bgClass: "Additional CSS classes applied to the background layer.",
|
|
365
|
-
bgPosition: "CSS background-position value for the background image/layer.",
|
|
366
|
-
bgSize: "CSS background-size value for the background image/layer.",
|
|
367
|
-
cardClass: "Additional CSS classes applied to the card container.",
|
|
368
|
-
checked: "Checked state for toggleable controls (controlled).",
|
|
369
|
-
class: "Additional CSS classes applied to the component root element.",
|
|
370
|
-
clearable: "Shows a clear action to reset the current value.",
|
|
371
|
-
clickable: "Enables pointer/hover styles and click handling on the component.",
|
|
372
|
-
closeOnEsc: "Closes the component when the Escape key is pressed.",
|
|
373
|
-
closeOnOutside: "Closes the component when clicking outside its bounds.",
|
|
374
|
-
closeOnSelect: "Closes the menu/popover after selecting an item.",
|
|
375
|
-
color: "Semantic color name used to style the component.",
|
|
376
|
-
cols: "Number of columns for grid layouts.",
|
|
377
|
-
columns: "Column definitions for table-like components.",
|
|
378
|
-
content: "Main content node(s) or render function for the component body.",
|
|
379
|
-
contentClass: "Additional CSS classes applied to the content container.",
|
|
380
|
-
control: "Custom control element or render function for the input area.",
|
|
381
|
-
children: "Default child content (nodes, arrays, or render function).",
|
|
382
|
-
delay: "Delay in milliseconds before showing or hiding.",
|
|
383
|
-
dense: "Uses compact spacing and sizing.",
|
|
384
|
-
disabled: "Disables interaction and applies disabled styling/ARIA.",
|
|
385
|
-
divider: "Shows dividers between items or sections.",
|
|
386
|
-
drawer: "Content or configuration for the drawer region.",
|
|
387
|
-
drawerBreakpoint: "Viewport width where the drawer switches behavior (overlay vs persistent).",
|
|
388
|
-
drawerCloseIcon: "Icon used for the drawer close control.",
|
|
389
|
-
drawerOpen: "Controls whether the drawer is open (controlled).",
|
|
390
|
-
drawerOpenIcon: "Icon used for the drawer open control.",
|
|
391
|
-
drawerStateKey: "Storage key used to persist drawer open state.",
|
|
392
|
-
drawerWidth: "Drawer width (number interpreted as px or CSS length).",
|
|
393
|
-
elevated: "Applies elevated shadow/raised styling.",
|
|
394
|
-
emptyText: "Text shown when there is no data to display.",
|
|
395
|
-
error: "Error state or message displayed with the component.",
|
|
396
|
-
escClose: "Alias for close-on-escape behavior.",
|
|
397
|
-
filterPlaceholder: "Placeholder text for the filter/search input.",
|
|
398
|
-
filterable: "Enables filtering UI for option lists.",
|
|
399
|
-
flat: "Removes elevation/border for a flat look.",
|
|
400
|
-
footer: "Footer content node(s) or render function.",
|
|
401
|
-
form: "HTML form attribute to associate controls with a form.",
|
|
402
|
-
gap: "Gap/spacing between child elements.",
|
|
403
|
-
getValue: "Function to extract a value from an item object.",
|
|
404
|
-
groupCloseIcon: "Icon used to collapse grouped items.",
|
|
405
|
-
groupOpenIcon: "Icon used to expand grouped items.",
|
|
406
|
-
header: "Header content node(s) or render function.",
|
|
407
|
-
height: "Explicit height (number interpreted as px or CSS length).",
|
|
408
|
-
hint: "Helper text shown near the control.",
|
|
409
|
-
icon: "Icon name or node rendered with the component.",
|
|
410
|
-
iconRight: "Icon name or node rendered on the right side of the component.",
|
|
411
|
-
iconAlign: "Position of the icon relative to the label.",
|
|
412
|
-
initialSort: "Initial sort configuration for table data.",
|
|
413
|
-
inputmode: "Native inputmode attribute hint for virtual keyboards.",
|
|
414
|
-
items: "Array of items or nodes to render.",
|
|
415
|
-
justify: "Justification of items along the main axis.",
|
|
416
|
-
label: "Label text or node for the component.",
|
|
417
|
-
left: "Content or configuration for the left region.",
|
|
418
|
-
lg: "Column span at large breakpoint.",
|
|
419
|
-
loading: "Shows loading state and disables interactions where appropriate.",
|
|
420
|
-
loadingText: "Text displayed while loading.",
|
|
421
|
-
lockScroll: "Prevents body scroll while an overlay is open.",
|
|
422
|
-
max: "Maximum value for range-based controls.",
|
|
423
|
-
md: "Column span at medium breakpoint.",
|
|
424
|
-
message: "Message text shown in banners/alerts.",
|
|
425
|
-
min: "Minimum value for range-based controls.",
|
|
426
|
-
mobile: "Responsive overrides applied at the base/mobile viewport.",
|
|
427
|
-
model: "Two-way bound value (alias to value in some components).",
|
|
428
|
-
multi: "Enables multi-selection behavior.",
|
|
429
|
-
multiple: "Allows selecting multiple values.",
|
|
430
|
-
name: "HTML name attribute for form submission.",
|
|
431
|
-
noDrawer: "Disables rendering of the drawer region.",
|
|
432
|
-
note: "Secondary note text.",
|
|
433
|
-
number: "Forces numeric input/formatting where supported.",
|
|
434
|
-
offset: "General offset for positioning.",
|
|
435
|
-
offsetX: "Horizontal offset for overlay placement in pixels.",
|
|
436
|
-
offsetY: "Vertical offset for overlay placement in pixels.",
|
|
437
|
-
onBlur: "Callback fired when the control loses focus.",
|
|
438
|
-
onChange: "Callback fired when the value or selection changes.",
|
|
439
|
-
onClear: "Callback fired when the clear action is used.",
|
|
440
|
-
onClose: "Callback fired when the component closes.",
|
|
441
|
-
onFocus: "Callback fired when the control gains focus.",
|
|
442
|
-
onInput: "Callback fired on input events or while typing.",
|
|
443
|
-
onOpen: "Callback fired when the component opens.",
|
|
444
|
-
onRemove: "Callback fired when an item is removed.",
|
|
445
|
-
onSubmit: "Callback fired when a form is submitted.",
|
|
446
|
-
open: "Controls open/visible state (controlled).",
|
|
447
|
-
options: "Array of selectable options or option groups.",
|
|
448
|
-
outline: "Uses outlined visual style.",
|
|
449
|
-
overlay: "Renders content in an overlay layer or portal.",
|
|
450
|
-
overlayClose: "Closes the overlay when the backdrop is clicked.",
|
|
451
|
-
page: "Current page index (1-based unless documented otherwise).",
|
|
452
|
-
pageSize: "Number of items per page.",
|
|
453
|
-
padding: "Padding applied to the component root element.",
|
|
454
|
-
persistent: "Prevents closing via outside click or Escape.",
|
|
455
|
-
pc: "Responsive overrides applied from the desktop breakpoint upward.",
|
|
456
|
-
placeholder: "Placeholder text for inputs.",
|
|
457
|
-
placement: "Overlay placement relative to the target/anchor.",
|
|
458
|
-
prefix: "Content rendered before the main control.",
|
|
459
|
-
readonly: "Prevents editing while keeping focus and selection.",
|
|
460
|
-
removable: "Shows a remove affordance for chips/items.",
|
|
461
|
-
right: "Content or configuration for the right region.",
|
|
462
|
-
rowKey: "Key or function used to derive unique row IDs.",
|
|
463
|
-
rows: "Row data array for table-like components.",
|
|
464
|
-
margin: "Margin applied to the component root element.",
|
|
465
|
-
maxHeight: "Maximum height constraint (number interpreted as px or CSS length).",
|
|
466
|
-
maxWidth: "Maximum width constraint (number interpreted as px or CSS length).",
|
|
467
|
-
minHeight: "Minimum height constraint (number interpreted as px or CSS length).",
|
|
468
|
-
minWidth: "Minimum width constraint (number interpreted as px or CSS length).",
|
|
469
|
-
radius: "Border radius token or CSS length applied to the component.",
|
|
470
|
-
borderRadius: "Border radius token or CSS length applied to the component.",
|
|
471
|
-
separator: "Separator string/node between items.",
|
|
472
|
-
shortcode: "Keyboard shortcut string, object, or array bound to the component action.",
|
|
473
|
-
showShortcode: "Displays the configured keyboard shortcut badge when the component supports it.",
|
|
474
|
-
showLabel: "Whether to render the label text.",
|
|
475
|
-
size: "Size token, number, or CSS length for sizing.",
|
|
476
|
-
slots: "Named slots map for render overrides.",
|
|
477
|
-
sm: "Column span at small breakpoint.",
|
|
478
|
-
span: "Column span within a grid.",
|
|
479
|
-
speed: "Animation speed or duration in milliseconds.",
|
|
480
|
-
square: "Use square corners instead of rounded.",
|
|
481
|
-
src: "Image source URL.",
|
|
482
|
-
startTop: "Starting scroll offset for parallax effects.",
|
|
483
|
-
stateKey: "Storage key used to persist component state.",
|
|
484
|
-
step: "Step increment for numeric controls.",
|
|
485
|
-
sticky: "Makes the component sticky within its container.",
|
|
486
|
-
stickyAside: "Keeps the aside region sticky during scroll.",
|
|
487
|
-
stickyFooter: "Keeps the footer region sticky during scroll.",
|
|
488
|
-
stickyHeader: "Keeps the header region sticky during scroll.",
|
|
489
|
-
striped: "Applies striped row styling.",
|
|
490
|
-
style: "Inline styles applied to the component root element.",
|
|
491
|
-
subtitle: "Subtitle text or node.",
|
|
492
|
-
success: "Marks the component with success state styling.",
|
|
493
|
-
suffix: "Content rendered after the main control.",
|
|
494
|
-
tableClass: "Additional CSS classes applied to the table element.",
|
|
495
|
-
tablet: "Responsive overrides applied from the tablet breakpoint upward.",
|
|
496
|
-
tabs: "Tab definitions array.",
|
|
497
|
-
tagPage: "Query parameter name used to read/write the current page.",
|
|
498
|
-
target: "Target element or anchor used for positioning.",
|
|
499
|
-
text: "Text content for simple components.",
|
|
500
|
-
thickness: "Stroke/line thickness for progress indicators.",
|
|
501
|
-
title: "Title text or node.",
|
|
502
|
-
to: "Navigation target/route to open on click.",
|
|
503
|
-
topLabel: "Label displayed above the control.",
|
|
504
|
-
trapFocus: "Keeps focus trapped inside the dialog/popover.",
|
|
505
|
-
type: "Variant or native input type.",
|
|
506
|
-
value: "Current value (controlled).",
|
|
507
|
-
vertical: "Vertical orientation instead of horizontal.",
|
|
508
|
-
warning: "Marks the component with warning state styling.",
|
|
509
|
-
width: "Explicit width (number interpreted as px or CSS length).",
|
|
510
|
-
wrap: "Allows children to wrap to new lines.",
|
|
511
|
-
wrapClass: "Additional CSS classes applied to the outer wrapper.",
|
|
512
|
-
zIndex: "z-index for overlay stacking.",
|
|
513
|
-
shadow: "Shadow token or CSS box-shadow string applied to the component.",
|
|
514
|
-
};
|
|
515
|
-
|
|
516
|
-
const META_SLOT_DESCRIPTIONS = {
|
|
517
|
-
actions: "Slot for action buttons or links.",
|
|
518
|
-
arrow: "Slot for the tooltip/popover arrow element.",
|
|
519
|
-
aside: "Slot for aside/secondary content.",
|
|
520
|
-
center: "Slot for centered content within a toolbar/row.",
|
|
521
|
-
clear: "Slot for the clear control/content.",
|
|
522
|
-
content: "Slot for the main body content.",
|
|
523
|
-
control: "Slot for custom control/input rendering.",
|
|
524
|
-
default: "Primary content for the component.",
|
|
525
|
-
drawer: "Slot for drawer content.",
|
|
526
|
-
empty: "Slot for empty-state content.",
|
|
527
|
-
errorMessage: "Slot for custom error message rendering.",
|
|
528
|
-
filter: "Slot for custom filter/search UI.",
|
|
529
|
-
footer: "Slot for footer content.",
|
|
530
|
-
group: "Slot for grouped content container.",
|
|
531
|
-
groupLabel: "Slot for group label content.",
|
|
532
|
-
header: "Slot for header content.",
|
|
533
|
-
hint: "Slot for helper/hint text.",
|
|
534
|
-
icon: "Slot for icon content.",
|
|
535
|
-
iconRight: "Slot for right-aligned icon content.",
|
|
536
|
-
input: "Slot for custom input element/content.",
|
|
537
|
-
item: "Slot for custom item rendering.",
|
|
538
|
-
itemLabel: "Slot for item label rendering.",
|
|
539
|
-
label: "Slot for label content.",
|
|
540
|
-
left: "Slot for left-aligned content.",
|
|
541
|
-
loading: "Slot for loading state content.",
|
|
542
|
-
message: "Slot for message/alert content.",
|
|
543
|
-
next: "Slot for the next-page control.",
|
|
544
|
-
note: "Slot for note/secondary text.",
|
|
545
|
-
option: "Slot for custom option rendering.",
|
|
546
|
-
page: "Slot for page indicator/content.",
|
|
547
|
-
prefix: "Slot for prefix content.",
|
|
548
|
-
prev: "Slot for the previous-page control.",
|
|
549
|
-
right: "Slot for right-aligned content.",
|
|
550
|
-
separator: "Slot for separator rendering between items.",
|
|
551
|
-
star: "Slot for custom star icon/content in rating.",
|
|
552
|
-
subtitle: "Slot for subtitle content.",
|
|
553
|
-
success: "Slot for success message/content.",
|
|
554
|
-
suffix: "Slot for suffix content.",
|
|
555
|
-
tab: "Slot for custom tab label/content.",
|
|
556
|
-
target: "Slot for custom target/anchor element.",
|
|
557
|
-
title: "Slot for title content.",
|
|
558
|
-
topLabel: "Slot for top label content.",
|
|
559
|
-
warning: "Slot for warning message/content."
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
const META_PROP_DEFAULTS = {
|
|
563
|
-
dense: false,
|
|
564
|
-
disabled: false,
|
|
565
|
-
readonly: false,
|
|
566
|
-
outline: false,
|
|
567
|
-
clickable: false,
|
|
568
|
-
flat: false,
|
|
569
|
-
elevated: false
|
|
570
|
-
};
|
|
571
|
-
const DEFAULT_SIZE = [...JSswift.uiSizes];
|
|
572
|
-
const DEFAULT_COLOR = [...JSswift.uiColors];
|
|
573
|
-
const META_PROP_VALUES = {
|
|
574
|
-
size: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
575
|
-
color: DEFAULT_COLOR,
|
|
576
|
-
padding: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
577
|
-
margin: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
578
|
-
width: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
579
|
-
minWidth: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
580
|
-
maxWidth: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
581
|
-
height: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
582
|
-
minHeight: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
583
|
-
maxHeight: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
584
|
-
iconAlign: ["left", "right", "before", "after"],
|
|
585
|
-
align: ["left", "center", "right"],
|
|
586
|
-
justify: ["start", "center", "end", "space-between", "space-around", "space-evenly"],
|
|
587
|
-
placement: ["top", "bottom", "left", "right", "top-start", "top-end", "bottom-start", "bottom-end"],
|
|
588
|
-
type: DEFAULT_COLOR,
|
|
589
|
-
shadow: ["none", ...DEFAULT_SIZE],
|
|
590
|
-
outline: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
591
|
-
borderRadius: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
592
|
-
radius: ["number", "CSS units", ...DEFAULT_SIZE],
|
|
593
|
-
icon: ["#name_tabler", "name_material", "class"],
|
|
594
|
-
iconRight: ["#name_tabler", "name_material", "class"]
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
const META_PROP_CATEGORIES = {
|
|
598
|
-
class: "style",
|
|
599
|
-
style: "style",
|
|
600
|
-
size: "style",
|
|
601
|
-
color: "style",
|
|
602
|
-
outline: "style",
|
|
603
|
-
shadow: "style",
|
|
604
|
-
borderRadius: "style",
|
|
605
|
-
radius: "style",
|
|
606
|
-
padding: "layout",
|
|
607
|
-
margin: "layout",
|
|
608
|
-
width: "layout",
|
|
609
|
-
minWidth: "layout",
|
|
610
|
-
maxWidth: "layout",
|
|
611
|
-
height: "layout",
|
|
612
|
-
minHeight: "layout",
|
|
613
|
-
maxHeight: "layout",
|
|
614
|
-
mobile: "layout",
|
|
615
|
-
tablet: "layout",
|
|
616
|
-
pc: "layout",
|
|
617
|
-
dense: "layout",
|
|
618
|
-
flat: "style",
|
|
619
|
-
elevated: "style",
|
|
620
|
-
clickable: "behavior",
|
|
621
|
-
disabled: "state",
|
|
622
|
-
readonly: "state",
|
|
623
|
-
loading: "state",
|
|
624
|
-
active: "state",
|
|
625
|
-
error: "state",
|
|
626
|
-
success: "state",
|
|
627
|
-
warning: "state",
|
|
628
|
-
note: "state",
|
|
629
|
-
hint: "state",
|
|
630
|
-
value: "data",
|
|
631
|
-
model: "data",
|
|
632
|
-
items: "data",
|
|
633
|
-
options: "data",
|
|
634
|
-
rows: "data",
|
|
635
|
-
columns: "data",
|
|
636
|
-
onClick: "events",
|
|
637
|
-
onChange: "events",
|
|
638
|
-
onInput: "events",
|
|
639
|
-
onFocus: "events",
|
|
640
|
-
onBlur: "events",
|
|
641
|
-
onSubmit: "events"
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
const normalizeMetaType = (value) => {
|
|
645
|
-
if (typeof value === "string") return value;
|
|
646
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return "unknown";
|
|
647
|
-
return value.type || value.signature || value.value || "unknown";
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
const fallbackMetaDescription = (name, kind) => {
|
|
651
|
-
if (kind === "slot") {
|
|
652
|
-
return `Slot content for "${name}". Accepts nodes, arrays, or render functions.`;
|
|
653
|
-
}
|
|
654
|
-
return `Component configuration for "${name}". When not handled internally, it is forwarded to the root element.`;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
const normalizeMetaFields = (fields, descriptions, kind) => {
|
|
658
|
-
if (!fields || typeof fields !== "object") return fields;
|
|
659
|
-
const out = {};
|
|
660
|
-
for (const [name, value] of Object.entries(fields)) {
|
|
661
|
-
const description = descriptions[name] || fallbackMetaDescription(name, kind);
|
|
662
|
-
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
663
|
-
const type = normalizeMetaType(value);
|
|
664
|
-
out[name] = {
|
|
665
|
-
...value,
|
|
666
|
-
type,
|
|
667
|
-
description: value.description || description,
|
|
668
|
-
default: Object.prototype.hasOwnProperty.call(value, "default") ? value.default : (META_PROP_DEFAULTS[name] ?? null),
|
|
669
|
-
values: value.values || META_PROP_VALUES[name] || null,
|
|
670
|
-
category: value.category || META_PROP_CATEGORIES[name] || (kind === "slot" ? "slot" : "general")
|
|
671
|
-
};
|
|
672
|
-
} else {
|
|
673
|
-
const type = normalizeMetaType(value);
|
|
674
|
-
out[name] = {
|
|
675
|
-
type,
|
|
676
|
-
description,
|
|
677
|
-
default: META_PROP_DEFAULTS[name] ?? null,
|
|
678
|
-
values: META_PROP_VALUES[name] || null,
|
|
679
|
-
category: META_PROP_CATEGORIES[name] || (kind === "slot" ? "slot" : "general")
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
return out;
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
const normalizeMetaEntry = (componentName, meta) => {
|
|
687
|
-
if (!meta || typeof meta !== "object") return meta;
|
|
688
|
-
if (!meta.props || typeof meta.props !== "object" || Array.isArray(meta.props)) {
|
|
689
|
-
meta.props = meta.props && typeof meta.props === "object" && !Array.isArray(meta.props) ? meta.props : {};
|
|
690
|
-
}
|
|
691
|
-
if (!Object.prototype.hasOwnProperty.call(meta.props, "children")) {
|
|
692
|
-
meta.props.children = "Node|Array|Function";
|
|
693
|
-
}
|
|
694
|
-
const commonProps = {
|
|
695
|
-
size: meta.props.size || "string|number",
|
|
696
|
-
color: meta.props.color || "string",
|
|
697
|
-
outline: meta.props.outline || "boolean",
|
|
698
|
-
clickable: meta.props.clickable || "boolean",
|
|
699
|
-
padding: meta.props.padding || "string|number",
|
|
700
|
-
margin: meta.props.margin || "string|number",
|
|
701
|
-
width: meta.props.width || "string|number",
|
|
702
|
-
minWidth: meta.props.minWidth || "string|number",
|
|
703
|
-
maxWidth: meta.props.maxWidth || "string|number",
|
|
704
|
-
height: meta.props.height || "string|number",
|
|
705
|
-
minHeight: meta.props.minHeight || "string|number",
|
|
706
|
-
maxHeight: meta.props.maxHeight || "string|number",
|
|
707
|
-
radius: meta.props.radius || "string|number",
|
|
708
|
-
borderRadius: meta.props.borderRadius || "string|number",
|
|
709
|
-
shadow: meta.props.shadow || "string|boolean",
|
|
710
|
-
mobile: meta.props.mobile || "object",
|
|
711
|
-
tablet: meta.props.tablet || "object",
|
|
712
|
-
pc: meta.props.pc || "object",
|
|
713
|
-
class: meta.props.class || "string",
|
|
714
|
-
style: meta.props.style || "object"
|
|
715
|
-
};
|
|
716
|
-
meta.props = { ...commonProps, ...meta.props };
|
|
717
|
-
if (meta.props.icon && !meta.props.iconRight) {
|
|
718
|
-
meta.props.iconRight = meta.props.icon;
|
|
719
|
-
}
|
|
720
|
-
if (meta.props) meta.props = normalizeMetaFields(meta.props, META_PROP_DESCRIPTIONS, "prop");
|
|
721
|
-
if (meta.slots) meta.slots = normalizeMetaFields(meta.slots, META_SLOT_DESCRIPTIONS, "slot");
|
|
722
|
-
if (meta.slots && meta.slots.icon && !meta.slots.iconRight) {
|
|
723
|
-
meta.slots.iconRight = { type: meta.slots.icon?.type || "Node|Array|Function", description: "Slot for right-aligned icon content." };
|
|
724
|
-
}
|
|
725
|
-
if (!meta.description) {
|
|
726
|
-
meta.description = `${componentName} component meta definition.`;
|
|
727
|
-
}
|
|
728
|
-
return meta;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
const ensureMetaProxy = () => {
|
|
732
|
-
if (app.ui._metaProxyInstalled) return;
|
|
733
|
-
app.ui._metaProxyInstalled = true;
|
|
734
|
-
const target = app.ui.meta || {};
|
|
735
|
-
for (const key of Object.keys(target)) {
|
|
736
|
-
normalizeMetaEntry(key, target[key]);
|
|
737
|
-
}
|
|
738
|
-
const proxy = new Proxy(target, {
|
|
739
|
-
set(obj, prop, value) {
|
|
740
|
-
if (typeof prop === "symbol") {
|
|
741
|
-
obj[prop] = value;
|
|
742
|
-
return true;
|
|
743
|
-
}
|
|
744
|
-
obj[prop] = normalizeMetaEntry(prop, value);
|
|
745
|
-
return true;
|
|
746
|
-
}
|
|
747
|
-
});
|
|
748
|
-
app.ui.meta = proxy;
|
|
749
|
-
UI.meta = proxy;
|
|
750
|
-
};
|
|
751
|
-
|
|
752
|
-
if (app.isDev?.()) {
|
|
753
|
-
ensureMetaProxy();
|
|
754
|
-
}
|
|
755
|
-
|
|
756
354
|
function flattenSlotValue(value) {
|
|
757
355
|
if (!value) return null;
|
|
758
356
|
if (!Array.isArray(value)) return value;
|