x-runtime-lib 0.9.21 → 0.9.22

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/index.js CHANGED
@@ -451,7 +451,6 @@ function It(e) {
451
451
  //#endregion
452
452
  //#region src/utils/property.ts
453
453
  function Lt(e) {
454
- if (e.ui) throw Error("property ui valid");
455
454
  if (!e.array) throw Error("property not array");
456
455
  return r(e.defaultArray);
457
456
  }
@@ -462,7 +461,7 @@ function Rt(e) {
462
461
  function zt(e, t) {
463
462
  function n(e, t) {
464
463
  if (t.ui) {
465
- if (t.ui === "runtime" || t.static) return;
464
+ if (t.static) return;
466
465
  t.array ? e[t.key] = Lt(t) : e[t.key] = Rt(t);
467
466
  } else if (t.array) e[t.key] = Lt(t);
468
467
  else for (let r of t.children) e[t.key] || (e[t.key] = {}), n(e[t.key], r);
@@ -1,3 +1,4 @@
1
+ import { Type } from 'x-essential-lib';
1
2
  import { ZItemsKey } from './items';
2
3
  import { ZTypesKey } from './types';
3
4
  type ZPropertyBranch = {
@@ -63,36 +64,29 @@ type ZPropertySelectAdaptSlot = {
63
64
  ui: 'selectAdaptSlot';
64
65
  default: string;
65
66
  } & ZPropertyBase;
66
- type ZPropertyRuntimeString = {
67
+ type ZPropertyRuntime<T extends Type> = {
67
68
  ui: 'runtime';
68
- type: 'string';
69
- default: string;
70
- } & ZPropertyBase;
71
- type ZPropertyRuntimeNumber = {
72
- ui: 'runtime';
73
- type: 'number';
74
- default: number;
75
- } & ZPropertyBase;
76
- type ZPropertyRuntimeBoolean = {
77
- ui: 'runtime';
78
- type: 'boolean';
79
- default: boolean;
80
- } & ZPropertyBase;
81
- type ZPropertyRuntimeObject = {
82
- ui: 'runtime';
83
- type: 'object';
84
- default: object;
85
- } & ZPropertyBase;
86
- type ZPropertyRuntimeArray = {
87
- ui: 'runtime';
88
- type: 'array';
89
- default: object;
90
- } & ZPropertyBase;
91
- type ZPropertyRuntimeAny = {
92
- ui: 'runtime';
93
- type: 'any';
94
- default: any;
95
- } & ZPropertyBase;
69
+ type: T;
70
+ } & ZPropertyBase & {
71
+ string: {
72
+ default: string;
73
+ };
74
+ number: {
75
+ default: number;
76
+ };
77
+ boolean: {
78
+ default: boolean;
79
+ };
80
+ object: {
81
+ default: object;
82
+ };
83
+ array: {
84
+ default: object;
85
+ };
86
+ any: {
87
+ default: unknown;
88
+ };
89
+ }[T];
96
90
  type WithArray<T extends {
97
91
  default: unknown;
98
92
  }> = (T & {
@@ -106,5 +100,5 @@ export type ZProperty = ({
106
100
  } & ZPropertyBranch) | ({
107
101
  array: true;
108
102
  defaultArray: any[];
109
- } & ZPropertyBranch) | WithArray<ZPropertyDummy> | WithArray<ZPropertyStrInput> | WithArray<ZPropertyNumInput> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyColorPicker> | WithArray<ZPropertyJsonEditor> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertySelectComp> | WithArray<ZPropertySelectSlot> | WithArray<ZPropertyStrInput> | WithArray<ZPropertySelectAdaptSlot> | ZPropertyRuntimeString | ZPropertyRuntimeNumber | ZPropertyRuntimeBoolean | ZPropertyRuntimeObject | ZPropertyRuntimeArray | ZPropertyRuntimeAny;
103
+ } & ZPropertyBranch) | WithArray<ZPropertyDummy> | WithArray<ZPropertyStrInput> | WithArray<ZPropertyNumInput> | WithArray<ZPropertySwitch> | WithArray<ZPropertySelect> | WithArray<ZPropertyColorPicker> | WithArray<ZPropertyJsonEditor> | WithArray<ZPropertyMultiTypes> | WithArray<ZPropertySelectComp> | WithArray<ZPropertySelectSlot> | WithArray<ZPropertyStrInput> | WithArray<ZPropertySelectAdaptSlot> | WithArray<ZPropertyRuntime<Type>>;
110
104
  export {};
@@ -1,5 +1,5 @@
1
1
  import { ZProperty } from '@/meta';
2
2
  import { Node } from '@/types';
3
- export declare function getPropertyDefaultArray(property: ZProperty): any[];
3
+ export declare function getPropertyDefaultArray(property: ZProperty): any[] | string[] | number[] | boolean[] | unknown[];
4
4
  export declare function getPropertyDefault(property: ZProperty): any;
5
5
  export declare function initProperties(node: Node, properties: ZProperty[]): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-runtime-lib",
3
3
  "private": false,
4
- "version": "0.9.21",
4
+ "version": "0.9.22",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- props: Record<string, any>;
3
- };
4
- declare var __VLS_1: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
12
- type __VLS_WithSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- isHovering: boolean | null;
3
- };
4
- declare var __VLS_1: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
12
- type __VLS_WithSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- props: Record<string, any>;
3
- };
4
- declare var __VLS_1: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
12
- type __VLS_WithSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- props: Record<string, any>;
3
- };
4
- declare var __VLS_1: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
12
- type __VLS_WithSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,16 +0,0 @@
1
- type __VLS_Props = {
2
- props: Record<string, any>;
3
- };
4
- declare var __VLS_1: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- };
8
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
- declare const _default: typeof __VLS_export;
11
- export default _default;
12
- type __VLS_WithSlots<T, S> = T & {
13
- new (): {
14
- $slots: S;
15
- };
16
- };
@@ -1,3 +0,0 @@
1
- export declare function useSlotProps(): {
2
- props: Record<string, any> | undefined;
3
- };
@@ -1,3 +0,0 @@
1
- export declare function useActivatorV1(): {
2
- activatorProps: Record<string, any> | undefined;
3
- };