@structured-field/widget-editor 1.0.1 → 1.1.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.
@@ -1,4 +1,4 @@
1
- var script$b = {
1
+ var script$c = {
2
2
  name: 'StringEditor',
3
3
  props: {
4
4
  schema: { type: Object, required: true },
@@ -129,6 +129,10 @@ const looseToNumber = (val) => {
129
129
  const n = parseFloat(val);
130
130
  return isNaN(n) ? val : n;
131
131
  };
132
+ const toNumber = (val) => {
133
+ const n = isString(val) ? Number(val) : NaN;
134
+ return isNaN(n) ? val : n;
135
+ };
132
136
  let _globalThis;
133
137
  const getGlobalThis = () => {
134
138
  return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
@@ -1579,44 +1583,6 @@ const toReadonly = (value) => isObject(value) ? /* @__PURE__ */ readonly(value)
1579
1583
  function isRef(r) {
1580
1584
  return r ? r["__v_isRef"] === true : false;
1581
1585
  }
1582
- // @__NO_SIDE_EFFECTS__
1583
- function ref(value) {
1584
- return createRef(value, false);
1585
- }
1586
- function createRef(rawValue, shallow) {
1587
- if (/* @__PURE__ */ isRef(rawValue)) {
1588
- return rawValue;
1589
- }
1590
- return new RefImpl(rawValue, shallow);
1591
- }
1592
- class RefImpl {
1593
- constructor(value, isShallow2) {
1594
- this.dep = new Dep();
1595
- this["__v_isRef"] = true;
1596
- this["__v_isShallow"] = false;
1597
- this._rawValue = isShallow2 ? value : toRaw(value);
1598
- this._value = isShallow2 ? value : toReactive(value);
1599
- this["__v_isShallow"] = isShallow2;
1600
- }
1601
- get value() {
1602
- {
1603
- this.dep.track();
1604
- }
1605
- return this._value;
1606
- }
1607
- set value(newValue) {
1608
- const oldValue = this._rawValue;
1609
- const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue);
1610
- newValue = useDirectValue ? newValue : toRaw(newValue);
1611
- if (hasChanged(newValue, oldValue)) {
1612
- this._rawValue = newValue;
1613
- this._value = useDirectValue ? newValue : toReactive(newValue);
1614
- {
1615
- this.dep.trigger();
1616
- }
1617
- }
1618
- }
1619
- }
1620
1586
  function unref(ref2) {
1621
1587
  return /* @__PURE__ */ isRef(ref2) ? ref2.value : ref2;
1622
1588
  }
@@ -2566,191 +2532,11 @@ function invalidatePendingSetRef(rawRef) {
2566
2532
  pendingSetRefMap.delete(rawRef);
2567
2533
  }
2568
2534
  }
2569
- const isComment = (node) => node.nodeType === 8;
2570
2535
 
2571
2536
  getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
2572
2537
  getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
2573
- function forEachElement(node, cb) {
2574
- if (isComment(node) && node.data === "[") {
2575
- let depth = 1;
2576
- let next = node.nextSibling;
2577
- while (next) {
2578
- if (next.nodeType === 1) {
2579
- const result = cb(next);
2580
- if (result === false) {
2581
- break;
2582
- }
2583
- } else if (isComment(next)) {
2584
- if (next.data === "]") {
2585
- if (--depth === 0) break;
2586
- } else if (next.data === "[") {
2587
- depth++;
2588
- }
2589
- }
2590
- next = next.nextSibling;
2591
- }
2592
- } else {
2593
- cb(node);
2594
- }
2595
- }
2596
2538
 
2597
2539
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
2598
- // @__NO_SIDE_EFFECTS__
2599
- function defineAsyncComponent(source) {
2600
- if (isFunction(source)) {
2601
- source = { loader: source };
2602
- }
2603
- const {
2604
- loader,
2605
- loadingComponent,
2606
- errorComponent,
2607
- delay = 200,
2608
- hydrate: hydrateStrategy,
2609
- timeout,
2610
- // undefined = never times out
2611
- suspensible = true,
2612
- onError: userOnError
2613
- } = source;
2614
- let pendingRequest = null;
2615
- let resolvedComp;
2616
- let retries = 0;
2617
- const retry = () => {
2618
- retries++;
2619
- pendingRequest = null;
2620
- return load();
2621
- };
2622
- const load = () => {
2623
- let thisRequest;
2624
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
2625
- err = err instanceof Error ? err : new Error(String(err));
2626
- if (userOnError) {
2627
- return new Promise((resolve, reject) => {
2628
- const userRetry = () => resolve(retry());
2629
- const userFail = () => reject(err);
2630
- userOnError(err, userRetry, userFail, retries + 1);
2631
- });
2632
- } else {
2633
- throw err;
2634
- }
2635
- }).then((comp) => {
2636
- if (thisRequest !== pendingRequest && pendingRequest) {
2637
- return pendingRequest;
2638
- }
2639
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
2640
- comp = comp.default;
2641
- }
2642
- resolvedComp = comp;
2643
- return comp;
2644
- }));
2645
- };
2646
- return defineComponent({
2647
- name: "AsyncComponentWrapper",
2648
- __asyncLoader: load,
2649
- __asyncHydrate(el, instance, hydrate) {
2650
- let patched = false;
2651
- (instance.bu || (instance.bu = [])).push(() => patched = true);
2652
- const performHydrate = () => {
2653
- if (patched) {
2654
- return;
2655
- }
2656
- hydrate();
2657
- };
2658
- const doHydrate = hydrateStrategy ? () => {
2659
- const teardown = hydrateStrategy(
2660
- performHydrate,
2661
- (cb) => forEachElement(el, cb)
2662
- );
2663
- if (teardown) {
2664
- (instance.bum || (instance.bum = [])).push(teardown);
2665
- }
2666
- } : performHydrate;
2667
- if (resolvedComp) {
2668
- doHydrate();
2669
- } else {
2670
- load().then(() => !instance.isUnmounted && doHydrate());
2671
- }
2672
- },
2673
- get __asyncResolved() {
2674
- return resolvedComp;
2675
- },
2676
- setup() {
2677
- const instance = currentInstance;
2678
- markAsyncBoundary(instance);
2679
- if (resolvedComp) {
2680
- return () => createInnerComp(resolvedComp, instance);
2681
- }
2682
- const onError = (err) => {
2683
- pendingRequest = null;
2684
- handleError(
2685
- err,
2686
- instance,
2687
- 13,
2688
- !errorComponent
2689
- );
2690
- };
2691
- if (suspensible && instance.suspense || isInSSRComponentSetup) {
2692
- return load().then((comp) => {
2693
- return () => createInnerComp(comp, instance);
2694
- }).catch((err) => {
2695
- onError(err);
2696
- return () => errorComponent ? createVNode(errorComponent, {
2697
- error: err
2698
- }) : null;
2699
- });
2700
- }
2701
- const loaded = ref(false);
2702
- const error = ref();
2703
- const delayed = ref(!!delay);
2704
- if (delay) {
2705
- setTimeout(() => {
2706
- delayed.value = false;
2707
- }, delay);
2708
- }
2709
- if (timeout != null) {
2710
- setTimeout(() => {
2711
- if (!loaded.value && !error.value) {
2712
- const err = new Error(
2713
- `Async component timed out after ${timeout}ms.`
2714
- );
2715
- onError(err);
2716
- error.value = err;
2717
- }
2718
- }, timeout);
2719
- }
2720
- load().then(() => {
2721
- loaded.value = true;
2722
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
2723
- instance.parent.update();
2724
- }
2725
- }).catch((err) => {
2726
- onError(err);
2727
- error.value = err;
2728
- });
2729
- return () => {
2730
- if (loaded.value && resolvedComp) {
2731
- return createInnerComp(resolvedComp, instance);
2732
- } else if (error.value && errorComponent) {
2733
- return createVNode(errorComponent, {
2734
- error: error.value
2735
- });
2736
- } else if (loadingComponent && !delayed.value) {
2737
- return createInnerComp(
2738
- loadingComponent,
2739
- instance
2740
- );
2741
- }
2742
- };
2743
- }
2744
- });
2745
- }
2746
- function createInnerComp(comp, parent) {
2747
- const { ref: ref2, props, children, ce } = parent.vnode;
2748
- const vnode = createVNode(comp, props, children);
2749
- vnode.ref = ref2;
2750
- vnode.ce = ce;
2751
- delete parent.vnode.ce;
2752
- return vnode;
2753
- }
2754
2540
 
2755
2541
  const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
2756
2542
  function onActivated(hook, target) {
@@ -5800,6 +5586,11 @@ function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false
5800
5586
  function createTextVNode(text = " ", flag = 0) {
5801
5587
  return createVNode(Text, null, text, flag);
5802
5588
  }
5589
+ function createStaticVNode(content, numberOfNodes) {
5590
+ const vnode = createVNode(Static, null, content);
5591
+ vnode.staticCount = numberOfNodes;
5592
+ return vnode;
5593
+ }
5803
5594
  function createCommentVNode(text = "", asBlock = false) {
5804
5595
  return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text);
5805
5596
  }
@@ -6183,32 +5974,6 @@ const computed = (getterOrOptions, debugOptions) => {
6183
5974
  return c;
6184
5975
  };
6185
5976
 
6186
- function h(type, propsOrChildren, children) {
6187
- try {
6188
- setBlockTracking(-1);
6189
- const l = arguments.length;
6190
- if (l === 2) {
6191
- if (isObject(propsOrChildren) && !isArray(propsOrChildren)) {
6192
- if (isVNode(propsOrChildren)) {
6193
- return createVNode(type, null, [propsOrChildren]);
6194
- }
6195
- return createVNode(type, propsOrChildren);
6196
- } else {
6197
- return createVNode(type, null, propsOrChildren);
6198
- }
6199
- } else {
6200
- if (l > 3) {
6201
- children = Array.prototype.slice.call(arguments, 2);
6202
- } else if (l === 3 && isVNode(children)) {
6203
- children = [children];
6204
- }
6205
- return createVNode(type, propsOrChildren, children);
6206
- }
6207
- } finally {
6208
- setBlockTracking(1);
6209
- }
6210
- }
6211
-
6212
5977
  const version = "3.5.30";
6213
5978
 
6214
5979
  /**
@@ -6671,6 +6436,437 @@ function shouldSetAsPropForVueCE(el, key) {
6671
6436
  return Array.isArray(props) ? props.some((prop) => camelize(prop) === camelKey) : Object.keys(props).some((prop) => camelize(prop) === camelKey);
6672
6437
  }
6673
6438
 
6439
+ const REMOVAL = {};
6440
+ // @__NO_SIDE_EFFECTS__
6441
+ function defineCustomElement(options, extraOptions, _createApp) {
6442
+ let Comp = defineComponent(options, extraOptions);
6443
+ if (isPlainObject(Comp)) Comp = extend({}, Comp, extraOptions);
6444
+ class VueCustomElement extends VueElement {
6445
+ constructor(initialProps) {
6446
+ super(Comp, initialProps, _createApp);
6447
+ }
6448
+ }
6449
+ VueCustomElement.def = Comp;
6450
+ return VueCustomElement;
6451
+ }
6452
+ const BaseClass = typeof HTMLElement !== "undefined" ? HTMLElement : class {
6453
+ };
6454
+ class VueElement extends BaseClass {
6455
+ constructor(_def, _props = {}, _createApp = createApp) {
6456
+ super();
6457
+ this._def = _def;
6458
+ this._props = _props;
6459
+ this._createApp = _createApp;
6460
+ this._isVueCE = true;
6461
+ /**
6462
+ * @internal
6463
+ */
6464
+ this._instance = null;
6465
+ /**
6466
+ * @internal
6467
+ */
6468
+ this._app = null;
6469
+ /**
6470
+ * @internal
6471
+ */
6472
+ this._nonce = this._def.nonce;
6473
+ this._connected = false;
6474
+ this._resolved = false;
6475
+ this._patching = false;
6476
+ this._dirty = false;
6477
+ this._numberProps = null;
6478
+ this._styleChildren = /* @__PURE__ */ new WeakSet();
6479
+ this._styleAnchors = /* @__PURE__ */ new WeakMap();
6480
+ this._ob = null;
6481
+ if (this.shadowRoot && _createApp !== createApp) {
6482
+ this._root = this.shadowRoot;
6483
+ } else {
6484
+ if (_def.shadowRoot !== false) {
6485
+ this.attachShadow(
6486
+ extend({}, _def.shadowRootOptions, {
6487
+ mode: "open"
6488
+ })
6489
+ );
6490
+ this._root = this.shadowRoot;
6491
+ } else {
6492
+ this._root = this;
6493
+ }
6494
+ }
6495
+ }
6496
+ connectedCallback() {
6497
+ if (!this.isConnected) return;
6498
+ if (!this.shadowRoot && !this._resolved) {
6499
+ this._parseSlots();
6500
+ }
6501
+ this._connected = true;
6502
+ let parent = this;
6503
+ while (parent = parent && // #12479 should check assignedSlot first to get correct parent
6504
+ (parent.assignedSlot || parent.parentNode || parent.host)) {
6505
+ if (parent instanceof VueElement) {
6506
+ this._parent = parent;
6507
+ break;
6508
+ }
6509
+ }
6510
+ if (!this._instance) {
6511
+ if (this._resolved) {
6512
+ this._mount(this._def);
6513
+ } else {
6514
+ if (parent && parent._pendingResolve) {
6515
+ this._pendingResolve = parent._pendingResolve.then(() => {
6516
+ this._pendingResolve = void 0;
6517
+ this._resolveDef();
6518
+ });
6519
+ } else {
6520
+ this._resolveDef();
6521
+ }
6522
+ }
6523
+ }
6524
+ }
6525
+ _setParent(parent = this._parent) {
6526
+ if (parent) {
6527
+ this._instance.parent = parent._instance;
6528
+ this._inheritParentContext(parent);
6529
+ }
6530
+ }
6531
+ _inheritParentContext(parent = this._parent) {
6532
+ if (parent && this._app) {
6533
+ Object.setPrototypeOf(
6534
+ this._app._context.provides,
6535
+ parent._instance.provides
6536
+ );
6537
+ }
6538
+ }
6539
+ disconnectedCallback() {
6540
+ this._connected = false;
6541
+ nextTick(() => {
6542
+ if (!this._connected) {
6543
+ if (this._ob) {
6544
+ this._ob.disconnect();
6545
+ this._ob = null;
6546
+ }
6547
+ this._app && this._app.unmount();
6548
+ if (this._instance) this._instance.ce = void 0;
6549
+ this._app = this._instance = null;
6550
+ if (this._teleportTargets) {
6551
+ this._teleportTargets.clear();
6552
+ this._teleportTargets = void 0;
6553
+ }
6554
+ }
6555
+ });
6556
+ }
6557
+ _processMutations(mutations) {
6558
+ for (const m of mutations) {
6559
+ this._setAttr(m.attributeName);
6560
+ }
6561
+ }
6562
+ /**
6563
+ * resolve inner component definition (handle possible async component)
6564
+ */
6565
+ _resolveDef() {
6566
+ if (this._pendingResolve) {
6567
+ return;
6568
+ }
6569
+ for (let i = 0; i < this.attributes.length; i++) {
6570
+ this._setAttr(this.attributes[i].name);
6571
+ }
6572
+ this._ob = new MutationObserver(this._processMutations.bind(this));
6573
+ this._ob.observe(this, { attributes: true });
6574
+ const resolve = (def, isAsync = false) => {
6575
+ this._resolved = true;
6576
+ this._pendingResolve = void 0;
6577
+ const { props, styles } = def;
6578
+ let numberProps;
6579
+ if (props && !isArray(props)) {
6580
+ for (const key in props) {
6581
+ const opt = props[key];
6582
+ if (opt === Number || opt && opt.type === Number) {
6583
+ if (key in this._props) {
6584
+ this._props[key] = toNumber(this._props[key]);
6585
+ }
6586
+ (numberProps || (numberProps = /* @__PURE__ */ Object.create(null)))[camelize(key)] = true;
6587
+ }
6588
+ }
6589
+ }
6590
+ this._numberProps = numberProps;
6591
+ this._resolveProps(def);
6592
+ if (this.shadowRoot) {
6593
+ this._applyStyles(styles);
6594
+ }
6595
+ this._mount(def);
6596
+ };
6597
+ const asyncDef = this._def.__asyncLoader;
6598
+ if (asyncDef) {
6599
+ this._pendingResolve = asyncDef().then((def) => {
6600
+ def.configureApp = this._def.configureApp;
6601
+ resolve(this._def = def, true);
6602
+ });
6603
+ } else {
6604
+ resolve(this._def);
6605
+ }
6606
+ }
6607
+ _mount(def) {
6608
+ this._app = this._createApp(def);
6609
+ this._inheritParentContext();
6610
+ if (def.configureApp) {
6611
+ def.configureApp(this._app);
6612
+ }
6613
+ this._app._ceVNode = this._createVNode();
6614
+ this._app.mount(this._root);
6615
+ const exposed = this._instance && this._instance.exposed;
6616
+ if (!exposed) return;
6617
+ for (const key in exposed) {
6618
+ if (!hasOwn(this, key)) {
6619
+ Object.defineProperty(this, key, {
6620
+ // unwrap ref to be consistent with public instance behavior
6621
+ get: () => unref(exposed[key])
6622
+ });
6623
+ }
6624
+ }
6625
+ }
6626
+ _resolveProps(def) {
6627
+ const { props } = def;
6628
+ const declaredPropKeys = isArray(props) ? props : Object.keys(props || {});
6629
+ for (const key of Object.keys(this)) {
6630
+ if (key[0] !== "_" && declaredPropKeys.includes(key)) {
6631
+ this._setProp(key, this[key]);
6632
+ }
6633
+ }
6634
+ for (const key of declaredPropKeys.map(camelize)) {
6635
+ Object.defineProperty(this, key, {
6636
+ get() {
6637
+ return this._getProp(key);
6638
+ },
6639
+ set(val) {
6640
+ this._setProp(key, val, true, !this._patching);
6641
+ }
6642
+ });
6643
+ }
6644
+ }
6645
+ _setAttr(key) {
6646
+ if (key.startsWith("data-v-")) return;
6647
+ const has = this.hasAttribute(key);
6648
+ let value = has ? this.getAttribute(key) : REMOVAL;
6649
+ const camelKey = camelize(key);
6650
+ if (has && this._numberProps && this._numberProps[camelKey]) {
6651
+ value = toNumber(value);
6652
+ }
6653
+ this._setProp(camelKey, value, false, true);
6654
+ }
6655
+ /**
6656
+ * @internal
6657
+ */
6658
+ _getProp(key) {
6659
+ return this._props[key];
6660
+ }
6661
+ /**
6662
+ * @internal
6663
+ */
6664
+ _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
6665
+ if (val !== this._props[key]) {
6666
+ this._dirty = true;
6667
+ if (val === REMOVAL) {
6668
+ delete this._props[key];
6669
+ } else {
6670
+ this._props[key] = val;
6671
+ if (key === "key" && this._app) {
6672
+ this._app._ceVNode.key = val;
6673
+ }
6674
+ }
6675
+ if (shouldUpdate && this._instance) {
6676
+ this._update();
6677
+ }
6678
+ if (shouldReflect) {
6679
+ const ob = this._ob;
6680
+ if (ob) {
6681
+ this._processMutations(ob.takeRecords());
6682
+ ob.disconnect();
6683
+ }
6684
+ if (val === true) {
6685
+ this.setAttribute(hyphenate(key), "");
6686
+ } else if (typeof val === "string" || typeof val === "number") {
6687
+ this.setAttribute(hyphenate(key), val + "");
6688
+ } else if (!val) {
6689
+ this.removeAttribute(hyphenate(key));
6690
+ }
6691
+ ob && ob.observe(this, { attributes: true });
6692
+ }
6693
+ }
6694
+ }
6695
+ _update() {
6696
+ const vnode = this._createVNode();
6697
+ if (this._app) vnode.appContext = this._app._context;
6698
+ render$d(vnode, this._root);
6699
+ }
6700
+ _createVNode() {
6701
+ const baseProps = {};
6702
+ if (!this.shadowRoot) {
6703
+ baseProps.onVnodeMounted = baseProps.onVnodeUpdated = this._renderSlots.bind(this);
6704
+ }
6705
+ const vnode = createVNode(this._def, extend(baseProps, this._props));
6706
+ if (!this._instance) {
6707
+ vnode.ce = (instance) => {
6708
+ this._instance = instance;
6709
+ instance.ce = this;
6710
+ instance.isCE = true;
6711
+ const dispatch = (event, args) => {
6712
+ this.dispatchEvent(
6713
+ new CustomEvent(
6714
+ event,
6715
+ isPlainObject(args[0]) ? extend({ detail: args }, args[0]) : { detail: args }
6716
+ )
6717
+ );
6718
+ };
6719
+ instance.emit = (event, ...args) => {
6720
+ dispatch(event, args);
6721
+ if (hyphenate(event) !== event) {
6722
+ dispatch(hyphenate(event), args);
6723
+ }
6724
+ };
6725
+ this._setParent();
6726
+ };
6727
+ }
6728
+ return vnode;
6729
+ }
6730
+ _applyStyles(styles, owner, parentComp) {
6731
+ if (!styles) return;
6732
+ if (owner) {
6733
+ if (owner === this._def || this._styleChildren.has(owner)) {
6734
+ return;
6735
+ }
6736
+ this._styleChildren.add(owner);
6737
+ }
6738
+ const nonce = this._nonce;
6739
+ const root = this.shadowRoot;
6740
+ const insertionAnchor = parentComp ? this._getStyleAnchor(parentComp) || this._getStyleAnchor(this._def) : this._getRootStyleInsertionAnchor(root);
6741
+ let last = null;
6742
+ for (let i = styles.length - 1; i >= 0; i--) {
6743
+ const s = document.createElement("style");
6744
+ if (nonce) s.setAttribute("nonce", nonce);
6745
+ s.textContent = styles[i];
6746
+ root.insertBefore(s, last || insertionAnchor);
6747
+ last = s;
6748
+ if (i === 0) {
6749
+ if (!parentComp) this._styleAnchors.set(this._def, s);
6750
+ if (owner) this._styleAnchors.set(owner, s);
6751
+ }
6752
+ }
6753
+ }
6754
+ _getStyleAnchor(comp) {
6755
+ if (!comp) {
6756
+ return null;
6757
+ }
6758
+ const anchor = this._styleAnchors.get(comp);
6759
+ if (anchor && anchor.parentNode === this.shadowRoot) {
6760
+ return anchor;
6761
+ }
6762
+ if (anchor) {
6763
+ this._styleAnchors.delete(comp);
6764
+ }
6765
+ return null;
6766
+ }
6767
+ _getRootStyleInsertionAnchor(root) {
6768
+ for (let i = 0; i < root.childNodes.length; i++) {
6769
+ const node = root.childNodes[i];
6770
+ if (!(node instanceof HTMLStyleElement)) {
6771
+ return node;
6772
+ }
6773
+ }
6774
+ return null;
6775
+ }
6776
+ /**
6777
+ * Only called when shadowRoot is false
6778
+ */
6779
+ _parseSlots() {
6780
+ const slots = this._slots = {};
6781
+ let n;
6782
+ while (n = this.firstChild) {
6783
+ const slotName = n.nodeType === 1 && n.getAttribute("slot") || "default";
6784
+ (slots[slotName] || (slots[slotName] = [])).push(n);
6785
+ this.removeChild(n);
6786
+ }
6787
+ }
6788
+ /**
6789
+ * Only called when shadowRoot is false
6790
+ */
6791
+ _renderSlots() {
6792
+ const outlets = this._getSlots();
6793
+ const scopeId = this._instance.type.__scopeId;
6794
+ for (let i = 0; i < outlets.length; i++) {
6795
+ const o = outlets[i];
6796
+ const slotName = o.getAttribute("name") || "default";
6797
+ const content = this._slots[slotName];
6798
+ const parent = o.parentNode;
6799
+ if (content) {
6800
+ for (const n of content) {
6801
+ if (scopeId && n.nodeType === 1) {
6802
+ const id = scopeId + "-s";
6803
+ const walker = document.createTreeWalker(n, 1);
6804
+ n.setAttribute(id, "");
6805
+ let child;
6806
+ while (child = walker.nextNode()) {
6807
+ child.setAttribute(id, "");
6808
+ }
6809
+ }
6810
+ parent.insertBefore(n, o);
6811
+ }
6812
+ } else {
6813
+ while (o.firstChild) parent.insertBefore(o.firstChild, o);
6814
+ }
6815
+ parent.removeChild(o);
6816
+ }
6817
+ }
6818
+ /**
6819
+ * @internal
6820
+ */
6821
+ _getSlots() {
6822
+ const roots = [this];
6823
+ if (this._teleportTargets) {
6824
+ roots.push(...this._teleportTargets);
6825
+ }
6826
+ const slots = /* @__PURE__ */ new Set();
6827
+ for (const root of roots) {
6828
+ const found = root.querySelectorAll("slot");
6829
+ for (let i = 0; i < found.length; i++) {
6830
+ slots.add(found[i]);
6831
+ }
6832
+ }
6833
+ return Array.from(slots);
6834
+ }
6835
+ /**
6836
+ * @internal
6837
+ */
6838
+ _injectChildStyle(comp, parentComp) {
6839
+ this._applyStyles(comp.styles, comp, parentComp);
6840
+ }
6841
+ /**
6842
+ * @internal
6843
+ */
6844
+ _beginPatch() {
6845
+ this._patching = true;
6846
+ this._dirty = false;
6847
+ }
6848
+ /**
6849
+ * @internal
6850
+ */
6851
+ _endPatch() {
6852
+ this._patching = false;
6853
+ if (this._dirty && this._instance) {
6854
+ this._update();
6855
+ }
6856
+ }
6857
+ /**
6858
+ * @internal
6859
+ */
6860
+ _hasShadowRoot() {
6861
+ return this._def.shadowRoot !== false;
6862
+ }
6863
+ /**
6864
+ * @internal
6865
+ */
6866
+ _removeChildStyle(comp) {
6867
+ }
6868
+ }
6869
+
6674
6870
  const getModelAssigner = (vnode) => {
6675
6871
  const fn = vnode.props["onUpdate:modelValue"] || false;
6676
6872
  return isArray(fn) ? (value) => invokeArrayFns(fn, value) : fn;
@@ -6766,6 +6962,9 @@ let renderer;
6766
6962
  function ensureRenderer() {
6767
6963
  return renderer || (renderer = createRenderer(rendererOptions));
6768
6964
  }
6965
+ const render$d = ((...args) => {
6966
+ ensureRenderer().render(...args);
6967
+ });
6769
6968
  const createApp = ((...args) => {
6770
6969
  const app = ensureRenderer().createApp(...args);
6771
6970
  const { mount } = app;
@@ -6804,14 +7003,14 @@ function normalizeContainer(container) {
6804
7003
  return container;
6805
7004
  }
6806
7005
 
6807
- const _hoisted_1$a = ["value", "placeholder"];
6808
- const _hoisted_2$8 = ["value", "placeholder"];
6809
- const _hoisted_3$7 = {
7006
+ const _hoisted_1$b = ["value", "placeholder"];
7007
+ const _hoisted_2$9 = ["value", "placeholder"];
7008
+ const _hoisted_3$8 = {
6810
7009
  key: 2,
6811
7010
  class: "errorlist"
6812
7011
  };
6813
7012
 
6814
- function render$b(_ctx, _cache, $props, $setup, $data, $options) {
7013
+ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
6815
7014
  return (openBlock(), createElementBlock("div", {
6816
7015
  class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
6817
7016
  }, [
@@ -6826,7 +7025,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6826
7025
  value: $props.modelValue,
6827
7026
  placeholder: $props.schema.placeholder || '',
6828
7027
  onInput: _cache[0] || (_cache[0] = $event => (_ctx.$emit('update:modelValue', $event.target.value)))
6829
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$a))
7028
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$b))
6830
7029
  : (openBlock(), createElementBlock("input", {
6831
7030
  key: 1,
6832
7031
  type: "text",
@@ -6834,9 +7033,9 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6834
7033
  value: $props.modelValue != null ? String($props.modelValue) : '',
6835
7034
  placeholder: $props.schema.placeholder || '',
6836
7035
  onInput: _cache[1] || (_cache[1] = $event => (_ctx.$emit('update:modelValue', $event.target.value)))
6837
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$8)),
7036
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$9)),
6838
7037
  ($options.fieldErrors.length)
6839
- ? (openBlock(), createElementBlock("ul", _hoisted_3$7, [
7038
+ ? (openBlock(), createElementBlock("ul", _hoisted_3$8, [
6840
7039
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
6841
7040
  return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
6842
7041
  }), 128 /* KEYED_FRAGMENT */))
@@ -6845,10 +7044,10 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6845
7044
  ], 2 /* CLASS */))
6846
7045
  }
6847
7046
 
6848
- script$b.render = render$b;
6849
- script$b.__file = "src/editors/StringEditor.vue";
7047
+ script$c.render = render$c;
7048
+ script$c.__file = "src/editors/StringEditor.vue";
6850
7049
 
6851
- var script$a = {
7050
+ var script$b = {
6852
7051
  name: 'NumberEditor',
6853
7052
  props: {
6854
7053
  schema: { type: Object, required: true },
@@ -6889,13 +7088,13 @@ var script$a = {
6889
7088
  },
6890
7089
  };
6891
7090
 
6892
- const _hoisted_1$9 = ["step", "min", "max", "value"];
6893
- const _hoisted_2$7 = {
7091
+ const _hoisted_1$a = ["step", "min", "max", "value"];
7092
+ const _hoisted_2$8 = {
6894
7093
  key: 0,
6895
7094
  class: "errorlist"
6896
7095
  };
6897
7096
 
6898
- function render$a(_ctx, _cache, $props, $setup, $data, $options) {
7097
+ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
6899
7098
  return (openBlock(), createElementBlock("div", {
6900
7099
  class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
6901
7100
  }, [
@@ -6910,9 +7109,9 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6910
7109
  max: $props.schema.maximum != null ? String($props.schema.maximum) : undefined,
6911
7110
  value: $props.modelValue != null ? $props.modelValue : '',
6912
7111
  onInput: _cache[0] || (_cache[0] = (...args) => ($options.onInput && $options.onInput(...args)))
6913
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$9),
7112
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$a),
6914
7113
  ($options.fieldErrors.length)
6915
- ? (openBlock(), createElementBlock("ul", _hoisted_2$7, [
7114
+ ? (openBlock(), createElementBlock("ul", _hoisted_2$8, [
6916
7115
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
6917
7116
  return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
6918
7117
  }), 128 /* KEYED_FRAGMENT */))
@@ -6921,10 +7120,10 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6921
7120
  ], 2 /* CLASS */))
6922
7121
  }
6923
7122
 
6924
- script$a.render = render$a;
6925
- script$a.__file = "src/editors/NumberEditor.vue";
7123
+ script$b.render = render$b;
7124
+ script$b.__file = "src/editors/NumberEditor.vue";
6926
7125
 
6927
- var script$9 = {
7126
+ var script$a = {
6928
7127
  name: 'BooleanEditor',
6929
7128
  props: {
6930
7129
  schema: { type: Object, required: true },
@@ -6950,28 +7149,28 @@ var script$9 = {
6950
7149
  },
6951
7150
  };
6952
7151
 
6953
- const _hoisted_1$8 = { class: "sf-checkbox-label" };
6954
- const _hoisted_2$6 = ["checked"];
6955
- const _hoisted_3$6 = {
7152
+ const _hoisted_1$9 = { class: "sf-checkbox-label" };
7153
+ const _hoisted_2$7 = ["checked"];
7154
+ const _hoisted_3$7 = {
6956
7155
  key: 0,
6957
7156
  class: "errorlist"
6958
7157
  };
6959
7158
 
6960
- function render$9(_ctx, _cache, $props, $setup, $data, $options) {
7159
+ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
6961
7160
  return (openBlock(), createElementBlock("div", {
6962
7161
  class: normalizeClass(["sf-field sf-field-boolean", { errors: $options.fieldErrors.length }])
6963
7162
  }, [
6964
- createBaseVNode("label", _hoisted_1$8, [
7163
+ createBaseVNode("label", _hoisted_1$9, [
6965
7164
  createBaseVNode("input", {
6966
7165
  type: "checkbox",
6967
7166
  class: "sf-checkbox",
6968
7167
  checked: !!$props.modelValue,
6969
7168
  onChange: _cache[0] || (_cache[0] = $event => (_ctx.$emit('update:modelValue', $event.target.checked)))
6970
- }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$6),
7169
+ }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_2$7),
6971
7170
  createTextVNode(" " + toDisplayString($options.title), 1 /* TEXT */)
6972
7171
  ]),
6973
7172
  ($options.fieldErrors.length)
6974
- ? (openBlock(), createElementBlock("ul", _hoisted_3$6, [
7173
+ ? (openBlock(), createElementBlock("ul", _hoisted_3$7, [
6975
7174
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
6976
7175
  return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
6977
7176
  }), 128 /* KEYED_FRAGMENT */))
@@ -6980,10 +7179,10 @@ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
6980
7179
  ], 2 /* CLASS */))
6981
7180
  }
6982
7181
 
6983
- script$9.render = render$9;
6984
- script$9.__file = "src/editors/BooleanEditor.vue";
7182
+ script$a.render = render$a;
7183
+ script$a.__file = "src/editors/BooleanEditor.vue";
6985
7184
 
6986
- var script$8 = {
7185
+ var script$9 = {
6987
7186
  name: 'SelectEditor',
6988
7187
  props: {
6989
7188
  schema: { type: Object, required: true },
@@ -7016,14 +7215,14 @@ var script$8 = {
7016
7215
  },
7017
7216
  };
7018
7217
 
7019
- const _hoisted_1$7 = ["value"];
7020
- const _hoisted_2$5 = ["value"];
7021
- const _hoisted_3$5 = {
7218
+ const _hoisted_1$8 = ["value"];
7219
+ const _hoisted_2$6 = ["value"];
7220
+ const _hoisted_3$6 = {
7022
7221
  key: 0,
7023
7222
  class: "errorlist"
7024
7223
  };
7025
7224
 
7026
- function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7225
+ function render$9(_ctx, _cache, $props, $setup, $data, $options) {
7027
7226
  return (openBlock(), createElementBlock("div", {
7028
7227
  class: normalizeClass(["sf-field", { errors: $options.fieldErrors.length }])
7029
7228
  }, [
@@ -7039,11 +7238,11 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7039
7238
  return (openBlock(), createElementBlock("option", {
7040
7239
  key: opt,
7041
7240
  value: String(opt)
7042
- }, toDisplayString(opt), 9 /* TEXT, PROPS */, _hoisted_2$5))
7241
+ }, toDisplayString(opt), 9 /* TEXT, PROPS */, _hoisted_2$6))
7043
7242
  }), 128 /* KEYED_FRAGMENT */))
7044
- ], 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$7),
7243
+ ], 40 /* PROPS, NEED_HYDRATION */, _hoisted_1$8),
7045
7244
  ($options.fieldErrors.length)
7046
- ? (openBlock(), createElementBlock("ul", _hoisted_3$5, [
7245
+ ? (openBlock(), createElementBlock("ul", _hoisted_3$6, [
7047
7246
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
7048
7247
  return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
7049
7248
  }), 128 /* KEYED_FRAGMENT */))
@@ -7052,10 +7251,10 @@ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7052
7251
  ], 2 /* CLASS */))
7053
7252
  }
7054
7253
 
7055
- script$8.render = render$8;
7056
- script$8.__file = "src/editors/SelectEditor.vue";
7254
+ script$9.render = render$9;
7255
+ script$9.__file = "src/editors/SelectEditor.vue";
7057
7256
 
7058
- var script$7 = {
7257
+ var script$8 = {
7059
7258
  name: 'HiddenEditor',
7060
7259
  props: {
7061
7260
  schema: { type: Object, required: true },
@@ -7083,18 +7282,117 @@ var script$7 = {
7083
7282
  },
7084
7283
  };
7085
7284
 
7086
- const _hoisted_1$6 = { style: {"display":"none"} };
7285
+ const _hoisted_1$7 = { style: {"display":"none"} };
7286
+
7287
+ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
7288
+ return (openBlock(), createElementBlock("div", _hoisted_1$7))
7289
+ }
7290
+
7291
+ script$8.render = render$8;
7292
+ script$8.__file = "src/editors/HiddenEditor.vue";
7293
+
7294
+ var script$7 = {
7295
+ name: 'SfIcon',
7296
+ props: {
7297
+ name: { type: String, required: true },
7298
+ size: { type: [Number, String], default: 14 },
7299
+ },
7300
+ };
7301
+
7302
+ const _hoisted_1$6 = ["width", "height"];
7303
+ const _hoisted_2$5 = {
7304
+ key: 4,
7305
+ points: "6 9 12 15 18 9"
7306
+ };
7307
+ const _hoisted_3$5 = {
7308
+ key: 5,
7309
+ points: "18 15 12 9 6 15"
7310
+ };
7087
7311
 
7088
7312
  function render$7(_ctx, _cache, $props, $setup, $data, $options) {
7089
- return (openBlock(), createElementBlock("div", _hoisted_1$6))
7313
+ return (openBlock(), createElementBlock("svg", {
7314
+ class: "sf-icon",
7315
+ width: $props.size,
7316
+ height: $props.size,
7317
+ viewBox: "0 0 24 24",
7318
+ fill: "none",
7319
+ stroke: "currentColor",
7320
+ "stroke-width": "2.5",
7321
+ "stroke-linecap": "round",
7322
+ "stroke-linejoin": "round"
7323
+ }, [
7324
+ ($props.name === 'plus')
7325
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7326
+ _cache[0] || (_cache[0] = createBaseVNode("line", {
7327
+ x1: "12",
7328
+ y1: "5",
7329
+ x2: "12",
7330
+ y2: "19"
7331
+ }, null, -1 /* CACHED */)),
7332
+ _cache[1] || (_cache[1] = createBaseVNode("line", {
7333
+ x1: "5",
7334
+ y1: "12",
7335
+ x2: "19",
7336
+ y2: "12"
7337
+ }, null, -1 /* CACHED */))
7338
+ ], 64 /* STABLE_FRAGMENT */))
7339
+ : ($props.name === 'times')
7340
+ ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7341
+ _cache[2] || (_cache[2] = createBaseVNode("line", {
7342
+ x1: "6",
7343
+ y1: "6",
7344
+ x2: "18",
7345
+ y2: "18"
7346
+ }, null, -1 /* CACHED */)),
7347
+ _cache[3] || (_cache[3] = createBaseVNode("line", {
7348
+ x1: "6",
7349
+ y1: "18",
7350
+ x2: "18",
7351
+ y2: "6"
7352
+ }, null, -1 /* CACHED */))
7353
+ ], 64 /* STABLE_FRAGMENT */))
7354
+ : ($props.name === 'arrow-up')
7355
+ ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
7356
+ _cache[4] || (_cache[4] = createBaseVNode("line", {
7357
+ x1: "12",
7358
+ y1: "19",
7359
+ x2: "12",
7360
+ y2: "5"
7361
+ }, null, -1 /* CACHED */)),
7362
+ _cache[5] || (_cache[5] = createBaseVNode("polyline", { points: "5 12 12 5 19 12" }, null, -1 /* CACHED */))
7363
+ ], 64 /* STABLE_FRAGMENT */))
7364
+ : ($props.name === 'arrow-down')
7365
+ ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
7366
+ _cache[6] || (_cache[6] = createBaseVNode("line", {
7367
+ x1: "12",
7368
+ y1: "5",
7369
+ x2: "12",
7370
+ y2: "19"
7371
+ }, null, -1 /* CACHED */)),
7372
+ _cache[7] || (_cache[7] = createBaseVNode("polyline", { points: "19 12 12 19 5 12" }, null, -1 /* CACHED */))
7373
+ ], 64 /* STABLE_FRAGMENT */))
7374
+ : ($props.name === 'chevron-down')
7375
+ ? (openBlock(), createElementBlock("polyline", _hoisted_2$5))
7376
+ : ($props.name === 'chevron-up')
7377
+ ? (openBlock(), createElementBlock("polyline", _hoisted_3$5))
7378
+ : ($props.name === 'grip')
7379
+ ? (openBlock(), createElementBlock(Fragment, { key: 6 }, [
7380
+ _cache[8] || (_cache[8] = createStaticVNode("<circle cx=\"9\" cy=\"7\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"7\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"9\" cy=\"12\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"12\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"9\" cy=\"17\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle><circle cx=\"15\" cy=\"17\" r=\"1\" fill=\"currentColor\" stroke=\"none\"></circle>", 6))
7381
+ ], 64 /* STABLE_FRAGMENT */))
7382
+ : createCommentVNode("v-if", true)
7383
+ ], 8 /* PROPS */, _hoisted_1$6))
7090
7384
  }
7091
7385
 
7092
7386
  script$7.render = render$7;
7093
- script$7.__file = "src/editors/HiddenEditor.vue";
7387
+ script$7.__file = "src/editors/SfIcon.vue";
7094
7388
 
7095
7389
  var script$6 = {
7096
7390
  name: 'ObjectEditor',
7097
- components: { SchemaEditor: defineAsyncComponent(() => Promise.resolve().then(function () { return SchemaEditor; })) },
7391
+ beforeCreate() {
7392
+ if (!this.$options.components) this.$options.components = {};
7393
+ this.$options.components.SchemaEditor = script$1;
7394
+ this.$options.components.SfIcon = script$7;
7395
+ },
7098
7396
  props: {
7099
7397
  schema: { type: Object, required: true },
7100
7398
  modelValue: { default: () => ({}) },
@@ -7102,6 +7400,11 @@ var script$6 = {
7102
7400
  form: { type: Object, required: true },
7103
7401
  },
7104
7402
  emits: ['update:modelValue'],
7403
+ data() {
7404
+ return {
7405
+ collapsed: false,
7406
+ };
7407
+ },
7105
7408
  computed: {
7106
7409
  isRoot() {
7107
7410
  return this.path.length === 0;
@@ -7109,12 +7412,30 @@ var script$6 = {
7109
7412
  title() {
7110
7413
  return this.schema.title || this.humanize(this.path[this.path.length - 1]) || '';
7111
7414
  },
7415
+ summary() {
7416
+ const val = this.modelValue || {};
7417
+ const parts = [];
7418
+ for (const key of Object.keys(this.schema.properties || {})) {
7419
+ if (parts.length >= 3) break;
7420
+ const v = val[key];
7421
+ if (v !== null && v !== undefined && v !== '' && typeof v !== 'object') {
7422
+ parts.push(String(v));
7423
+ }
7424
+ }
7425
+ return parts.join(' · ');
7426
+ },
7112
7427
  },
7113
7428
  methods: {
7114
7429
  humanize(str) {
7115
7430
  if (!str) return '';
7116
7431
  return str.replace(/_/g, ' ').replace(/([a-z])([A-Z])/g, '$1 $2').replace(/^./, s => s.toUpperCase());
7117
7432
  },
7433
+ collapse() {
7434
+ this.collapsed = true;
7435
+ },
7436
+ expand() {
7437
+ this.collapsed = false;
7438
+ },
7118
7439
  onChildChange(key, value) {
7119
7440
  const newVal = { ...(this.modelValue || {}), [key]: value };
7120
7441
  this.$emit('update:modelValue', newVal);
@@ -7127,15 +7448,18 @@ const _hoisted_1$5 = {
7127
7448
  class: "sf-object sf-object-root"
7128
7449
  };
7129
7450
  const _hoisted_2$4 = { class: "sf-object-fields" };
7130
- const _hoisted_3$4 = {
7131
- key: 1,
7132
- class: "sf-object"
7451
+ const _hoisted_3$4 = { class: "sf-object-title" };
7452
+ const _hoisted_4$3 = ["aria-label"];
7453
+ const _hoisted_5$3 = { class: "sf-object-title-text" };
7454
+ const _hoisted_6$3 = {
7455
+ key: 0,
7456
+ class: "sf-object-summary"
7133
7457
  };
7134
- const _hoisted_4$3 = { class: "sf-object-title" };
7135
- const _hoisted_5$3 = { class: "sf-object-fields" };
7458
+ const _hoisted_7$2 = { class: "sf-object-fields" };
7136
7459
 
7137
7460
  function render$6(_ctx, _cache, $props, $setup, $data, $options) {
7138
7461
  const _component_SchemaEditor = resolveComponent("SchemaEditor");
7462
+ const _component_SfIcon = resolveComponent("SfIcon");
7139
7463
 
7140
7464
  return ($options.isRoot)
7141
7465
  ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
@@ -7152,9 +7476,28 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
7152
7476
  }), 128 /* KEYED_FRAGMENT */))
7153
7477
  ])
7154
7478
  ]))
7155
- : (openBlock(), createElementBlock("fieldset", _hoisted_3$4, [
7156
- createBaseVNode("legend", _hoisted_4$3, toDisplayString($options.title), 1 /* TEXT */),
7157
- createBaseVNode("div", _hoisted_5$3, [
7479
+ : (openBlock(), createElementBlock("fieldset", {
7480
+ key: 1,
7481
+ class: normalizeClass(["sf-object", { 'sf-object-collapsed': $data.collapsed }])
7482
+ }, [
7483
+ createBaseVNode("legend", _hoisted_3$4, [
7484
+ createBaseVNode("button", {
7485
+ type: "button",
7486
+ class: "sf-collapse-btn",
7487
+ "aria-label": $data.collapsed ? 'Expand' : 'Collapse',
7488
+ onClick: _cache[0] || (_cache[0] = $event => ($data.collapsed = !$data.collapsed))
7489
+ }, [
7490
+ createVNode(_component_SfIcon, {
7491
+ name: $data.collapsed ? 'chevron-down' : 'chevron-up',
7492
+ size: 12
7493
+ }, null, 8 /* PROPS */, ["name"])
7494
+ ], 8 /* PROPS */, _hoisted_4$3),
7495
+ createBaseVNode("span", _hoisted_5$3, toDisplayString($options.title), 1 /* TEXT */),
7496
+ ($data.collapsed && $options.summary)
7497
+ ? (openBlock(), createElementBlock("span", _hoisted_6$3, toDisplayString($options.summary), 1 /* TEXT */))
7498
+ : createCommentVNode("v-if", true)
7499
+ ]),
7500
+ withDirectives(createBaseVNode("div", _hoisted_7$2, [
7158
7501
  (openBlock(true), createElementBlock(Fragment, null, renderList(($props.schema.properties || {}), (propSchema, key) => {
7159
7502
  return (openBlock(), createBlock(_component_SchemaEditor, {
7160
7503
  key: key,
@@ -7165,8 +7508,10 @@ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
7165
7508
  "onUpdate:modelValue": $event => ($options.onChildChange(key, $event))
7166
7509
  }, null, 8 /* PROPS */, ["schema", "model-value", "path", "form", "onUpdate:modelValue"]))
7167
7510
  }), 128 /* KEYED_FRAGMENT */))
7511
+ ], 512 /* NEED_PATCH */), [
7512
+ [vShow, !$data.collapsed]
7168
7513
  ])
7169
- ]))
7514
+ ], 2 /* CLASS */))
7170
7515
  }
7171
7516
 
7172
7517
  script$6.render = render$6;
@@ -7215,7 +7560,11 @@ let keyCounter = 0;
7215
7560
 
7216
7561
  var script$5 = {
7217
7562
  name: 'ArrayEditor',
7218
- components: { SchemaEditor: defineAsyncComponent(() => Promise.resolve().then(function () { return SchemaEditor; })) },
7563
+ beforeCreate() {
7564
+ if (!this.$options.components) this.$options.components = {};
7565
+ this.$options.components.SchemaEditor = script$1;
7566
+ this.$options.components.SfIcon = script$7;
7567
+ },
7219
7568
  props: {
7220
7569
  schema: { type: Object, required: true },
7221
7570
  modelValue: { default: () => [] },
@@ -7227,6 +7576,9 @@ var script$5 = {
7227
7576
  const arr = Array.isArray(this.modelValue) ? this.modelValue : [];
7228
7577
  return {
7229
7578
  items: arr.map(v => ({ _key: keyCounter++, value: v })),
7579
+ dragSourceIndex: null,
7580
+ dragOverIndex: null,
7581
+ allCollapsed: false,
7230
7582
  };
7231
7583
  },
7232
7584
  computed: {
@@ -7267,6 +7619,44 @@ var script$5 = {
7267
7619
  this.items[index].value = value;
7268
7620
  this.emitValue();
7269
7621
  },
7622
+ onDragStart(index, event) {
7623
+ this.dragSourceIndex = index;
7624
+ event.dataTransfer.effectAllowed = 'move';
7625
+ event.dataTransfer.setData('text/plain', String(index));
7626
+ },
7627
+ onDragOver(index) {
7628
+ if (this.dragSourceIndex !== null && index !== this.dragSourceIndex) {
7629
+ this.dragOverIndex = index;
7630
+ }
7631
+ },
7632
+ onDragLeave(index) {
7633
+ if (this.dragOverIndex === index) {
7634
+ this.dragOverIndex = null;
7635
+ }
7636
+ },
7637
+ onDrop(index) {
7638
+ if (this.dragSourceIndex === null || this.dragSourceIndex === index) return;
7639
+ const moved = this.items.splice(this.dragSourceIndex, 1)[0];
7640
+ this.items.splice(index, 0, moved);
7641
+ this.dragSourceIndex = null;
7642
+ this.dragOverIndex = null;
7643
+ this.emitValue();
7644
+ },
7645
+ onDragEnd() {
7646
+ this.dragSourceIndex = null;
7647
+ this.dragOverIndex = null;
7648
+ },
7649
+ toggleCollapseAll() {
7650
+ this.allCollapsed = !this.allCollapsed;
7651
+ const editors = this.$refs.itemEditors;
7652
+ if (!editors) return;
7653
+ const list = Array.isArray(editors) ? editors : [editors];
7654
+ if (this.allCollapsed) {
7655
+ list.forEach(editor => editor?.collapseAll?.());
7656
+ } else {
7657
+ list.forEach(editor => editor?.expandAll?.());
7658
+ }
7659
+ },
7270
7660
  emitValue() {
7271
7661
  this.$emit('update:modelValue', this.items.map(i => i.value));
7272
7662
  },
@@ -7276,20 +7666,28 @@ var script$5 = {
7276
7666
  const _hoisted_1$4 = { class: "sf-array-header" };
7277
7667
  const _hoisted_2$3 = { class: "sf-label" };
7278
7668
  const _hoisted_3$3 = { class: "sf-array-count" };
7279
- const _hoisted_4$2 = { class: "sf-array-items" };
7280
- const _hoisted_5$2 = { class: "sf-array-item-header" };
7281
- const _hoisted_6$2 = { class: "sf-array-item-index" };
7282
- const _hoisted_7$1 = { class: "sf-array-item-actions" };
7283
- const _hoisted_8$1 = ["onClick"];
7284
- const _hoisted_9$1 = ["onClick"];
7285
- const _hoisted_10$1 = ["onClick"];
7286
- const _hoisted_11 = { class: "sf-array-item-body" };
7287
- const _hoisted_12 = {
7669
+ const _hoisted_4$2 = ["title"];
7670
+ const _hoisted_5$2 = { class: "sf-array-items" };
7671
+ const _hoisted_6$2 = ["onDragstart", "onDragover", "onDragleave", "onDrop"];
7672
+ const _hoisted_7$1 = { class: "sf-array-item-header" };
7673
+ const _hoisted_8$1 = { class: "sf-array-item-left" };
7674
+ const _hoisted_9$1 = {
7675
+ class: "sf-drag-handle",
7676
+ title: "Drag to reorder"
7677
+ };
7678
+ const _hoisted_10$1 = { class: "sf-array-item-index" };
7679
+ const _hoisted_11 = { class: "sf-array-item-actions" };
7680
+ const _hoisted_12 = ["onClick"];
7681
+ const _hoisted_13 = ["onClick"];
7682
+ const _hoisted_14 = ["onClick"];
7683
+ const _hoisted_15 = ["onDrop"];
7684
+ const _hoisted_16 = {
7288
7685
  key: 0,
7289
7686
  class: "errorlist"
7290
7687
  };
7291
7688
 
7292
7689
  function render$5(_ctx, _cache, $props, $setup, $data, $options) {
7690
+ const _component_SfIcon = resolveComponent("SfIcon");
7293
7691
  const _component_SchemaEditor = resolveComponent("SchemaEditor");
7294
7692
 
7295
7693
  return (openBlock(), createElementBlock("div", {
@@ -7302,60 +7700,89 @@ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
7302
7700
  type: "button",
7303
7701
  class: "sf-btn sf-btn-add",
7304
7702
  onClick: _cache[0] || (_cache[0] = $event => ($options.addItem()))
7305
- }, [...(_cache[1] || (_cache[1] = [
7306
- createBaseVNode("i", { class: "fas fa-plus" }, null, -1 /* CACHED */),
7307
- createTextVNode(" Add ", -1 /* CACHED */)
7308
- ]))])
7703
+ }, [
7704
+ createVNode(_component_SfIcon, { name: "plus" }),
7705
+ _cache[4] || (_cache[4] = createTextVNode(" Add ", -1 /* CACHED */))
7706
+ ]),
7707
+ ($data.items.length)
7708
+ ? (openBlock(), createElementBlock("span", {
7709
+ key: 0,
7710
+ class: "sf-array-collapse-toggle",
7711
+ title: $data.allCollapsed ? 'Expand all' : 'Collapse all',
7712
+ onClick: _cache[1] || (_cache[1] = (...args) => ($options.toggleCollapseAll && $options.toggleCollapseAll(...args)))
7713
+ }, [
7714
+ createVNode(_component_SfIcon, {
7715
+ name: $data.allCollapsed ? 'chevron-down' : 'chevron-up'
7716
+ }, null, 8 /* PROPS */, ["name"])
7717
+ ], 8 /* PROPS */, _hoisted_4$2))
7718
+ : createCommentVNode("v-if", true)
7309
7719
  ]),
7310
- createBaseVNode("div", _hoisted_4$2, [
7720
+ createBaseVNode("div", _hoisted_5$2, [
7311
7721
  (openBlock(true), createElementBlock(Fragment, null, renderList($data.items, (item, index) => {
7312
7722
  return (openBlock(), createElementBlock("div", {
7313
7723
  key: item._key,
7314
- class: "sf-array-item"
7724
+ class: normalizeClass(["sf-array-item", { 'sf-drag-over': $data.dragOverIndex === index, 'sf-dragging': $data.dragSourceIndex === index }]),
7725
+ draggable: "true",
7726
+ onDragstart: $event => ($options.onDragStart(index, $event)),
7727
+ onDragover: withModifiers($event => ($options.onDragOver(index)), ["prevent"]),
7728
+ onDragleave: $event => ($options.onDragLeave(index)),
7729
+ onDrop: withModifiers($event => ($options.onDrop(index)), ["prevent"]),
7730
+ onDragend: _cache[3] || (_cache[3] = (...args) => ($options.onDragEnd && $options.onDragEnd(...args)))
7315
7731
  }, [
7316
- createBaseVNode("div", _hoisted_5$2, [
7317
- createBaseVNode("span", _hoisted_6$2, "#" + toDisplayString(index + 1), 1 /* TEXT */),
7318
- createBaseVNode("div", _hoisted_7$1, [
7732
+ createBaseVNode("div", _hoisted_7$1, [
7733
+ createBaseVNode("div", _hoisted_8$1, [
7734
+ createBaseVNode("span", _hoisted_9$1, [
7735
+ createVNode(_component_SfIcon, { name: "grip" })
7736
+ ]),
7737
+ createBaseVNode("span", _hoisted_10$1, "#" + toDisplayString(index + 1), 1 /* TEXT */)
7738
+ ]),
7739
+ createBaseVNode("div", _hoisted_11, [
7319
7740
  (index > 0)
7320
7741
  ? (openBlock(), createElementBlock("button", {
7321
7742
  key: 0,
7322
7743
  type: "button",
7323
7744
  class: "sf-btn sf-btn-sm",
7324
7745
  onClick: $event => ($options.moveItem(index, -1))
7325
- }, [...(_cache[2] || (_cache[2] = [
7326
- createBaseVNode("i", { class: "fas fa-arrow-up" }, null, -1 /* CACHED */)
7327
- ]))], 8 /* PROPS */, _hoisted_8$1))
7746
+ }, [
7747
+ createVNode(_component_SfIcon, { name: "arrow-up" })
7748
+ ], 8 /* PROPS */, _hoisted_12))
7328
7749
  : createCommentVNode("v-if", true),
7329
7750
  createBaseVNode("button", {
7330
7751
  type: "button",
7331
7752
  class: "sf-btn sf-btn-sm",
7332
7753
  onClick: $event => ($options.moveItem(index, 1))
7333
- }, [...(_cache[3] || (_cache[3] = [
7334
- createBaseVNode("i", { class: "fas fa-arrow-down" }, null, -1 /* CACHED */)
7335
- ]))], 8 /* PROPS */, _hoisted_9$1),
7754
+ }, [
7755
+ createVNode(_component_SfIcon, { name: "arrow-down" })
7756
+ ], 8 /* PROPS */, _hoisted_13),
7336
7757
  createBaseVNode("button", {
7337
7758
  type: "button",
7338
7759
  class: "sf-btn sf-btn-sm sf-btn-danger",
7339
7760
  onClick: $event => ($options.removeItem(index))
7340
- }, [...(_cache[4] || (_cache[4] = [
7341
- createBaseVNode("i", { class: "fas fa-times" }, null, -1 /* CACHED */)
7342
- ]))], 8 /* PROPS */, _hoisted_10$1)
7761
+ }, [
7762
+ createVNode(_component_SfIcon, { name: "times" })
7763
+ ], 8 /* PROPS */, _hoisted_14)
7343
7764
  ])
7344
7765
  ]),
7345
- createBaseVNode("div", _hoisted_11, [
7766
+ createBaseVNode("div", {
7767
+ class: "sf-array-item-body",
7768
+ onDragover: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
7769
+ onDrop: withModifiers($event => ($options.onDrop(index)), ["prevent"])
7770
+ }, [
7346
7771
  createVNode(_component_SchemaEditor, {
7772
+ ref_for: true,
7773
+ ref: "itemEditors",
7347
7774
  schema: $options.itemSchema,
7348
7775
  "model-value": item.value,
7349
7776
  path: [...$props.path, String(index)],
7350
7777
  form: $props.form,
7351
7778
  "onUpdate:modelValue": $event => ($options.onItemChange(index, $event))
7352
7779
  }, null, 8 /* PROPS */, ["schema", "model-value", "path", "form", "onUpdate:modelValue"])
7353
- ])
7354
- ]))
7780
+ ], 40 /* PROPS, NEED_HYDRATION */, _hoisted_15)
7781
+ ], 42 /* CLASS, PROPS, NEED_HYDRATION */, _hoisted_6$2))
7355
7782
  }), 128 /* KEYED_FRAGMENT */))
7356
7783
  ]),
7357
7784
  ($options.fieldErrors.length)
7358
- ? (openBlock(), createElementBlock("ul", _hoisted_12, [
7785
+ ? (openBlock(), createElementBlock("ul", _hoisted_16, [
7359
7786
  (openBlock(true), createElementBlock(Fragment, null, renderList($options.fieldErrors, (err, i) => {
7360
7787
  return (openBlock(), createElementBlock("li", { key: i }, toDisplayString(err), 1 /* TEXT */))
7361
7788
  }), 128 /* KEYED_FRAGMENT */))
@@ -7369,7 +7796,11 @@ script$5.__file = "src/editors/ArrayEditor.vue";
7369
7796
 
7370
7797
  var script$4 = {
7371
7798
  name: 'NullableEditor',
7372
- components: { SchemaEditor: defineAsyncComponent(() => Promise.resolve().then(function () { return SchemaEditor; })) },
7799
+ beforeCreate() {
7800
+ if (!this.$options.components) this.$options.components = {};
7801
+ this.$options.components.SchemaEditor = script$1;
7802
+ this.$options.components.SfIcon = script$7;
7803
+ },
7373
7804
  props: {
7374
7805
  schema: { type: Object, required: true },
7375
7806
  modelValue: { default: null },
@@ -7436,6 +7867,7 @@ const _hoisted_3$2 = {
7436
7867
  };
7437
7868
 
7438
7869
  function render$4(_ctx, _cache, $props, $setup, $data, $options) {
7870
+ const _component_SfIcon = resolveComponent("SfIcon");
7439
7871
  const _component_SchemaEditor = resolveComponent("SchemaEditor");
7440
7872
 
7441
7873
  return (openBlock(), createElementBlock("div", {
@@ -7452,12 +7884,12 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
7452
7884
  }, [
7453
7885
  ($data.isNull)
7454
7886
  ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
7455
- _cache[2] || (_cache[2] = createBaseVNode("i", { class: "fas fa-plus" }, null, -1 /* CACHED */)),
7456
- _cache[3] || (_cache[3] = createTextVNode(" Add ", -1 /* CACHED */))
7887
+ createVNode(_component_SfIcon, { name: "plus" }),
7888
+ _cache[2] || (_cache[2] = createTextVNode(" Add ", -1 /* CACHED */))
7457
7889
  ], 64 /* STABLE_FRAGMENT */))
7458
7890
  : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
7459
- _cache[4] || (_cache[4] = createBaseVNode("i", { class: "fas fa-times" }, null, -1 /* CACHED */)),
7460
- _cache[5] || (_cache[5] = createTextVNode(" Remove ", -1 /* CACHED */))
7891
+ createVNode(_component_SfIcon, { name: "times" }),
7892
+ _cache[3] || (_cache[3] = createTextVNode(" Remove ", -1 /* CACHED */))
7461
7893
  ], 64 /* STABLE_FRAGMENT */))
7462
7894
  ], 2 /* CLASS */)
7463
7895
  ]),
@@ -7488,7 +7920,10 @@ script$4.__file = "src/editors/NullableEditor.vue";
7488
7920
 
7489
7921
  var script$3 = {
7490
7922
  name: 'UnionEditor',
7491
- components: { SchemaEditor: defineAsyncComponent(() => Promise.resolve().then(function () { return SchemaEditor; })) },
7923
+ beforeCreate() {
7924
+ if (!this.$options.components) this.$options.components = {};
7925
+ this.$options.components.SchemaEditor = script$1;
7926
+ },
7492
7927
  props: {
7493
7928
  schema: { type: Object, required: true },
7494
7929
  modelValue: { default: null },
@@ -7588,6 +8023,7 @@ script$3.__file = "src/editors/UnionEditor.vue";
7588
8023
 
7589
8024
  var script$2 = {
7590
8025
  name: 'RelationEditor',
8026
+ components: { SfIcon: script$7 },
7591
8027
  props: {
7592
8028
  schema: { type: Object, required: true },
7593
8029
  modelValue: { default: null },
@@ -7639,8 +8075,8 @@ var script$2 = {
7639
8075
  return this.form.getErrorsForPath(this.path);
7640
8076
  },
7641
8077
  filteredResults() {
7642
- const selectedIds = new Set(this.selected.map(s => `${s.id}-${s.model || ''}`));
7643
- return this.searchResults.filter(item => !selectedIds.has(`${item.id}-${item.model || ''}`));
8078
+ const selectedIds = new Set(this.selected.map(item => this.itemKey(item)));
8079
+ return this.searchResults.filter(item => !selectedIds.has(this.itemKey(item)));
7644
8080
  },
7645
8081
  },
7646
8082
  created() {
@@ -7771,6 +8207,8 @@ const _hoisted_10 = {
7771
8207
  };
7772
8208
 
7773
8209
  function render$2(_ctx, _cache, $props, $setup, $data, $options) {
8210
+ const _component_SfIcon = resolveComponent("SfIcon");
8211
+
7774
8212
  return (openBlock(), createElementBlock("div", {
7775
8213
  class: normalizeClass(["sf-field sf-relation", { errors: $options.fieldErrors.length }]),
7776
8214
  ref: "root"
@@ -7794,9 +8232,9 @@ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
7794
8232
  type: "button",
7795
8233
  class: "sf-relation-tag-remove",
7796
8234
  onClick: withModifiers($event => ($options.removeItem(item)), ["stop"])
7797
- }, [...(_cache[5] || (_cache[5] = [
7798
- createBaseVNode("i", { class: "fas fa-times" }, null, -1 /* CACHED */)
7799
- ]))], 8 /* PROPS */, _hoisted_4))
8235
+ }, [
8236
+ createVNode(_component_SfIcon, { name: "times" })
8237
+ ], 8 /* PROPS */, _hoisted_4))
7800
8238
  : createCommentVNode("v-if", true)
7801
8239
  ]))
7802
8240
  }), 128 /* KEYED_FRAGMENT */))
@@ -7861,11 +8299,11 @@ const MAX_DEPTH = 12;
7861
8299
  var script$1 = {
7862
8300
  name: 'SchemaEditor',
7863
8301
  components: {
7864
- StringEditor: script$b,
7865
- NumberEditor: script$a,
7866
- BooleanEditor: script$9,
7867
- SelectEditor: script$8,
7868
- HiddenEditor: script$7,
8302
+ StringEditor: script$c,
8303
+ NumberEditor: script$b,
8304
+ BooleanEditor: script$a,
8305
+ SelectEditor: script$9,
8306
+ HiddenEditor: script$8,
7869
8307
  ObjectEditor: script$6,
7870
8308
  ArrayEditor: script$5,
7871
8309
  NullableEditor: script$4,
@@ -7879,6 +8317,18 @@ var script$1 = {
7879
8317
  form: { type: Object, required: true },
7880
8318
  },
7881
8319
  emits: ['update:modelValue'],
8320
+ methods: {
8321
+ collapseAll() {
8322
+ const editor = this.$refs.editor;
8323
+ if (editor?.collapse) editor.collapse();
8324
+ if (editor?.collapseAll) editor.collapseAll();
8325
+ },
8326
+ expandAll() {
8327
+ const editor = this.$refs.editor;
8328
+ if (editor?.expand) editor.expand();
8329
+ if (editor?.expandAll) editor.expandAll();
8330
+ },
8331
+ },
7882
8332
  computed: {
7883
8333
  editorComponent() {
7884
8334
  const schema = this.schema;
@@ -7903,6 +8353,7 @@ var script$1 = {
7903
8353
 
7904
8354
  function render$1(_ctx, _cache, $props, $setup, $data, $options) {
7905
8355
  return (openBlock(), createBlock(resolveDynamicComponent($options.editorComponent), {
8356
+ ref: "editor",
7906
8357
  schema: $props.schema,
7907
8358
  "model-value": $props.modelValue,
7908
8359
  path: $props.path,
@@ -7914,11 +8365,6 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
7914
8365
  script$1.render = render$1;
7915
8366
  script$1.__file = "src/editors/SchemaEditor.vue";
7916
8367
 
7917
- var SchemaEditor = /*#__PURE__*/Object.freeze({
7918
- __proto__: null,
7919
- default: script$1
7920
- });
7921
-
7922
8368
  var script = {
7923
8369
  name: 'SchemaForm',
7924
8370
  components: { SchemaEditor: script$1 },
@@ -7928,6 +8374,7 @@ var script = {
7928
8374
  errors: { type: Object, default: () => ({}) },
7929
8375
  },
7930
8376
  emits: ['change'],
8377
+ expose: ['getValue'],
7931
8378
  data() {
7932
8379
  const parsedSchema = typeof this.schema === 'string' ? JSON.parse(this.schema) : this.schema;
7933
8380
  const defs = parsedSchema.$defs || parsedSchema.definitions || {};
@@ -8066,137 +8513,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
8066
8513
  script.render = render;
8067
8514
  script.__file = "src/SchemaForm.vue";
8068
8515
 
8069
- class SchemaFormElement extends HTMLElement {
8070
- constructor() {
8071
- super();
8072
- this._formRef = ref(null);
8073
- this._props = reactive({
8074
- schema: {},
8075
- initialData: undefined,
8076
- errors: {},
8077
- });
8078
- this._app = null;
8079
- this._mountPoint = null;
8080
- }
8081
-
8082
- connectedCallback() {
8083
- this._mountPoint = document.createElement('div');
8084
- this.appendChild(this._mountPoint);
8085
-
8086
- // Read from attributes if properties haven't been set programmatically
8087
- if (!this._propsSet) {
8088
- const schemaAttr = this.getAttribute('schema');
8089
- const dataAttr = this.getAttribute('initial-data');
8090
- if (schemaAttr) this._props.schema = JSON.parse(schemaAttr);
8091
- if (dataAttr) this._props.initialData = JSON.parse(dataAttr);
8092
- }
8093
-
8094
- const formRef = this._formRef;
8095
- const props = this._props;
8096
-
8097
- this._app = createApp({
8098
- render: () => h(script, {
8099
- ref: formRef,
8100
- schema: props.schema,
8101
- initialData: props.initialData,
8102
- errors: props.errors,
8103
- onChange: (val) => {
8104
- this.dispatchEvent(new CustomEvent('change', { detail: val, bubbles: true }));
8105
- },
8106
- }),
8107
- });
8108
-
8109
- this._app.mount(this._mountPoint);
8110
- }
8111
-
8112
- disconnectedCallback() {
8113
- if (this._app) {
8114
- this._app.unmount();
8115
- this._app = null;
8116
- }
8117
- this._mountPoint = null;
8118
- }
8119
-
8120
- // --- Property API ---
8121
-
8122
- get schema() {
8123
- return this._props.schema;
8124
- }
8125
-
8126
- set schema(val) {
8127
- this._propsSet = true;
8128
- this._props.schema = typeof val === 'string' ? JSON.parse(val) : val;
8129
- this._rerender();
8130
- }
8131
-
8132
- get initialData() {
8133
- return this._props.initialData;
8134
- }
8135
-
8136
- set initialData(val) {
8137
- this._propsSet = true;
8138
- this._props.initialData = typeof val === 'string' ? JSON.parse(val) : val;
8139
- this._rerender();
8140
- }
8141
-
8142
- get errors() {
8143
- return this._props.errors;
8144
- }
8145
-
8146
- set errors(val) {
8147
- this._propsSet = true;
8148
- this._props.errors = typeof val === 'string' ? JSON.parse(val) : (val || {});
8149
- this._rerender();
8150
- }
8151
-
8152
- // --- Attribute reflection ---
8153
-
8154
- static get observedAttributes() {
8155
- return ['schema', 'initial-data', 'errors'];
8156
- }
8157
-
8158
- attributeChangedCallback(name, oldVal, newVal) {
8159
- if (oldVal === newVal || this._propsSet) return;
8160
- if (name === 'schema') {
8161
- this._props.schema = newVal ? JSON.parse(newVal) : {};
8162
- } else if (name === 'initial-data') {
8163
- this._props.initialData = newVal ? JSON.parse(newVal) : undefined;
8164
- } else if (name === 'errors') {
8165
- this._props.errors = newVal ? JSON.parse(newVal) : {};
8166
- }
8167
- this._rerender();
8168
- }
8169
-
8170
- // --- Public methods ---
8171
-
8172
- getValue() {
8173
- return this._formRef.value?.getValue?.() ?? null;
8174
- }
8175
-
8176
- // --- Internal ---
8177
-
8178
- _rerender() {
8179
- if (!this._app) return;
8180
- this._app.unmount();
8181
- this._mountPoint.innerHTML = '';
8182
- const formRef = this._formRef;
8183
- const props = this._props;
8184
-
8185
- this._app = createApp({
8186
- render: () => h(script, {
8187
- ref: formRef,
8188
- schema: props.schema,
8189
- initialData: props.initialData,
8190
- errors: props.errors,
8191
- onChange: (val) => {
8192
- this.dispatchEvent(new CustomEvent('change', { detail: val, bubbles: true }));
8193
- },
8194
- }),
8195
- });
8196
-
8197
- this._app.mount(this._mountPoint);
8198
- }
8199
- }
8516
+ const SchemaFormElement = defineCustomElement({
8517
+ ...script,
8518
+ shadowRoot: false,
8519
+ });
8200
8520
 
8201
8521
  function registerCustomElement(tagName = 'schema-form') {
8202
8522
  if (!customElements.get(tagName)) {
@@ -8204,5 +8524,5 @@ function registerCustomElement(tagName = 'schema-form') {
8204
8524
  }
8205
8525
  }
8206
8526
 
8207
- export { script$5 as ArrayEditor, script$9 as BooleanEditor, script$7 as HiddenEditor, script$4 as NullableEditor, script$a as NumberEditor, script$6 as ObjectEditor, script$2 as RelationEditor, script$1 as SchemaEditor, script as SchemaForm, SchemaFormElement, script$8 as SelectEditor, script$b as StringEditor, script$3 as UnionEditor, registerCustomElement };
8527
+ export { script$5 as ArrayEditor, script$a as BooleanEditor, script$8 as HiddenEditor, script$4 as NullableEditor, script$b as NumberEditor, script$6 as ObjectEditor, script$2 as RelationEditor, script$1 as SchemaEditor, script as SchemaForm, SchemaFormElement, script$9 as SelectEditor, script$c as StringEditor, script$3 as UnionEditor, registerCustomElement };
8208
8528
  //# sourceMappingURL=structured-widget-editor.esm.js.map