@piying/view-core 2.7.4 → 2.7.6

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.
@@ -1574,6 +1574,7 @@ class FormBuilder {
1574
1574
  const outputs = asyncObjectSignal(field.outputs);
1575
1575
  const attributes = asyncObjectSignal(field.attributes);
1576
1576
  const events = asyncObjectSignal(field.events);
1577
+ const slots = asyncObjectSignal(field.slots);
1577
1578
  const formConfig$ = signal(field.formConfig ?? {});
1578
1579
  const renderConfig = signal(field.renderConfig ?? {});
1579
1580
  let control;
@@ -1645,8 +1646,11 @@ class FormBuilder {
1645
1646
  get attributes() {
1646
1647
  return resolvedConfig.define?.().attributes;
1647
1648
  },
1649
+ get slots() {
1650
+ return resolvedConfig.define?.().slots;
1651
+ },
1648
1652
  define: define
1649
- ? signal({ type: define, inputs, outputs, attributes, events })
1653
+ ? signal({ type: define, inputs, outputs, attributes, events, slots })
1650
1654
  : undefined,
1651
1655
  wrappers: this.#wrapperToSignal(field.wrappers, injector),
1652
1656
  injector: injector,
@@ -1882,6 +1886,7 @@ class FormBuilder {
1882
1886
  inputs: asyncObjectSignal(item.inputs),
1883
1887
  outputs: asyncObjectSignal(item.outputs),
1884
1888
  events: asyncObjectSignal(item.events),
1889
+ slots: asyncObjectSignal(item.slots),
1885
1890
  }, {
1886
1891
  pipe: pipe(map((item) => {
1887
1892
  const defaultWrapperConfig = this.#findConfig.findWrapperComponent(item.type);
@@ -2273,6 +2278,13 @@ const __actions = {
2273
2278
  remove: createRemovePropertyFn('events'),
2274
2279
  mapAsync: createMapAsyncPropertyFn('events'),
2275
2280
  },
2281
+ slots: {
2282
+ patch: createSetOrPatchPropertyFn('slots', true),
2283
+ set: createSetOrPatchPropertyFn('slots'),
2284
+ patchAsync: createPatchAsyncPropertyFn('slots'),
2285
+ remove: createRemovePropertyFn('slots'),
2286
+ mapAsync: createMapAsyncPropertyFn('slots'),
2287
+ },
2276
2288
  props: {
2277
2289
  patch: createSetOrPatchPropertyFn('props', true),
2278
2290
  set: createSetOrPatchPropertyFn('props'),
@@ -2297,6 +2309,7 @@ function createSetOrPatchWrappersFn(isPatch) {
2297
2309
  outputs: {},
2298
2310
  attributes: {},
2299
2311
  events: {},
2312
+ slots: {},
2300
2313
  };
2301
2314
  rawField.wrappers.push(define);
2302
2315
  defaultActions.forEach((item) => {
@@ -2321,6 +2334,7 @@ function createSetOrPatchWrappersFn(isPatch) {
2321
2334
  outputs: wrapperItem.outputs ?? {},
2322
2335
  attributes: wrapperItem.attributes ?? {},
2323
2336
  events: wrapperItem.events ?? {},
2337
+ slots: wrapperItem.slots ?? {},
2324
2338
  });
2325
2339
  }
2326
2340
  });
@@ -2363,6 +2377,7 @@ function patchAsyncWrapper(type, actions, options) {
2363
2377
  events: asyncObjectSignal({}),
2364
2378
  inputs: asyncObjectSignal({}),
2365
2379
  outputs: asyncObjectSignal({}),
2380
+ slots: asyncObjectSignal({}),
2366
2381
  }, {
2367
2382
  pipe: pipe(map((item) => {
2368
2383
  const defaultWrapperConfig = findConfig.findWrapperComponent(item.type);
@@ -2383,6 +2398,7 @@ function patchAsyncWrapper(type, actions, options) {
2383
2398
  outputs: {},
2384
2399
  attributes: {},
2385
2400
  events: {},
2401
+ slots: {},
2386
2402
  };
2387
2403
  item.value(tempField, undefined, {
2388
2404
  [CustomDataSymbol]: (rawField, field) => {
@@ -2396,6 +2412,7 @@ function patchAsyncWrapper(type, actions, options) {
2396
2412
  setSubInitValue('outputs', initData, tempField);
2397
2413
  setSubInitValue('attributes', initData, tempField);
2398
2414
  setSubInitValue('events', initData, tempField);
2415
+ setSubInitValue('slots', initData, tempField);
2399
2416
  tempField.hooks?.allFieldsResolved?.(field);
2400
2417
  }
2401
2418
  },
@@ -2418,6 +2435,7 @@ function changeAsyncWrapper(indexFn, actions) {
2418
2435
  outputs: {},
2419
2436
  attributes: {},
2420
2437
  events: {},
2438
+ slots: {},
2421
2439
  };
2422
2440
  item.value(tempField, undefined, {
2423
2441
  [CustomDataSymbol]: (rawField, field) => {
@@ -2431,6 +2449,7 @@ function changeAsyncWrapper(indexFn, actions) {
2431
2449
  setSubInitValue('outputs', initData, tempField);
2432
2450
  setSubInitValue('attributes', initData, tempField);
2433
2451
  setSubInitValue('events', initData, tempField);
2452
+ setSubInitValue('slots', initData, tempField);
2434
2453
  tempField.hooks?.allFieldsResolved?.(field);
2435
2454
  }
2436
2455
  },
@@ -2614,6 +2633,7 @@ class CoreSchemaHandle extends BaseSchemaHandle {
2614
2633
  outputs = {};
2615
2634
  attributes = {};
2616
2635
  events = {};
2636
+ slots = {};
2617
2637
  wrappers = [];
2618
2638
  props = {};
2619
2639
  alias;