@sepveneto/dnde-core 0.3.0 → 0.4.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.
@@ -112,19 +112,6 @@ var RootNode = class {
112
112
  this.data = (info == null ? void 0 : info.props) || {};
113
113
  this.style = (info == null ? void 0 : info.style) || {};
114
114
  }
115
- validate(only = false) {
116
- return __async(this, null, function* () {
117
- if (only || !this.list) {
118
- return;
119
- }
120
- for (const item of this.list) {
121
- const invalid = yield item.validate();
122
- if (invalid) {
123
- return invalid;
124
- }
125
- }
126
- });
127
- }
128
115
  };
129
116
 
130
117
  export {
@@ -60,6 +60,15 @@ var schema = {
60
60
  rules: normalizeRules(config)
61
61
  };
62
62
  },
63
+ color(config) {
64
+ return {
65
+ label: config.label,
66
+ key: config.key,
67
+ type: "colorPicker",
68
+ attrs: config.attrs,
69
+ rules: normalizeRules(config)
70
+ };
71
+ },
63
72
  custom(config) {
64
73
  return {
65
74
  label: config.label,
@@ -40,6 +40,24 @@ var widget = {
40
40
  name,
41
41
  list
42
42
  };
43
+ },
44
+ widget(name, list) {
45
+ return {
46
+ type: 0 /* WIDGET */,
47
+ name,
48
+ list
49
+ };
50
+ },
51
+ root(config) {
52
+ return this.create({
53
+ name: config.name || "\u9875\u9762",
54
+ type: "page",
55
+ config: { visible: false },
56
+ defaultData: config.defaultData,
57
+ defaultStyle: config.defaultStyle,
58
+ attributes: config.attributes,
59
+ stylesheet: config.stylesheet
60
+ });
43
61
  }
44
62
  };
45
63
 
@@ -168,19 +168,6 @@ var RootNode = class {
168
168
  this.data = (info == null ? void 0 : info.props) || {};
169
169
  this.style = (info == null ? void 0 : info.style) || {};
170
170
  }
171
- validate(only = false) {
172
- return __async(this, null, function* () {
173
- if (only || !this.list) {
174
- return;
175
- }
176
- for (const item of this.list) {
177
- const invalid = yield item.validate();
178
- if (invalid) {
179
- return invalid;
180
- }
181
- }
182
- });
183
- }
184
171
  };
185
172
  // Annotate the CommonJS export names for ESM import in node:
186
173
  0 && (module.exports = {
@@ -48,7 +48,6 @@ declare class RootNode {
48
48
  style?: Node['style'];
49
49
  list?: Node['list'];
50
50
  });
51
- validate(only?: boolean): Promise<any>;
52
51
  }
53
52
 
54
53
  export { Node, RootNode };
@@ -48,7 +48,6 @@ declare class RootNode {
48
48
  style?: Node['style'];
49
49
  list?: Node['list'];
50
50
  });
51
- validate(only?: boolean): Promise<any>;
52
51
  }
53
52
 
54
53
  export { Node, RootNode };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Node,
3
3
  RootNode
4
- } from "../chunk-QWT3TZVQ.js";
4
+ } from "../chunk-N5D6Y2DY.js";
5
5
  import "../chunk-6FNC3XMI.js";
6
6
  export {
7
7
  Node,
@@ -251,19 +251,6 @@ var RootNode = class {
251
251
  this.data = (info == null ? void 0 : info.props) || {};
252
252
  this.style = (info == null ? void 0 : info.style) || {};
253
253
  }
254
- validate(only = false) {
255
- return __async(this, null, function* () {
256
- if (only || !this.list) {
257
- return;
258
- }
259
- for (const item of this.list) {
260
- const invalid = yield item.validate();
261
- if (invalid) {
262
- return invalid;
263
- }
264
- }
265
- });
266
- }
267
254
  };
268
255
  // Annotate the CommonJS export names for ESM import in node:
269
256
  0 && (module.exports = {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  Node,
6
6
  RootNode
7
- } from "../chunk-QWT3TZVQ.js";
7
+ } from "../chunk-N5D6Y2DY.js";
8
8
  import {
9
9
  Widget
10
10
  } from "../chunk-KHPFRVKB.js";
@@ -123,6 +123,15 @@ var schema = {
123
123
  rules: normalizeRules(config)
124
124
  };
125
125
  },
126
+ color(config) {
127
+ return {
128
+ label: config.label,
129
+ key: config.key,
130
+ type: "colorPicker",
131
+ attrs: config.attrs,
132
+ rules: normalizeRules(config)
133
+ };
134
+ },
126
135
  custom(config) {
127
136
  return {
128
137
  label: config.label,
@@ -201,6 +210,24 @@ var widget = {
201
210
  name,
202
211
  list
203
212
  };
213
+ },
214
+ widget(name, list) {
215
+ return {
216
+ type: 0 /* WIDGET */,
217
+ name,
218
+ list
219
+ };
220
+ },
221
+ root(config) {
222
+ return this.create({
223
+ name: config.name || "\u9875\u9762",
224
+ type: "page",
225
+ config: { visible: false },
226
+ defaultData: config.defaultData,
227
+ defaultStyle: config.defaultStyle,
228
+ attributes: config.attributes,
229
+ stylesheet: config.stylesheet
230
+ });
204
231
  }
205
232
  };
206
233
  // Annotate the CommonJS export names for ESM import in node:
@@ -4,11 +4,11 @@ import {
4
4
  } from "../chunk-W776G2UQ.js";
5
5
  import {
6
6
  schema
7
- } from "../chunk-KTDOAEEU.js";
7
+ } from "../chunk-SIPKDBVZ.js";
8
8
  import {
9
9
  widget,
10
10
  widgetType
11
- } from "../chunk-VY2Z4X4S.js";
11
+ } from "../chunk-VRAKS4JU.js";
12
12
  import "../chunk-XJ2IJHKH.js";
13
13
  import "../chunk-6FNC3XMI.js";
14
14
  export {
@@ -87,6 +87,15 @@ var schema = {
87
87
  rules: normalizeRules(config)
88
88
  };
89
89
  },
90
+ color(config) {
91
+ return {
92
+ label: config.label,
93
+ key: config.key,
94
+ type: "colorPicker",
95
+ attrs: config.attrs,
96
+ rules: normalizeRules(config)
97
+ };
98
+ },
90
99
  custom(config) {
91
100
  return {
92
101
  label: config.label,
@@ -1,4 +1,4 @@
1
- import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance } from 'element-plus';
1
+ import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance, ColorPickerInstance } from 'element-plus';
2
2
  import { j as SchemaItem } from '../Widget-BXpoxMwR.cjs';
3
3
  import 'vue';
4
4
  import 'async-validator';
@@ -31,6 +31,9 @@ declare const schema: {
31
31
  time(config: BaseConfig & {
32
32
  attrs?: Partial<DatePickerInstance["$props"]>;
33
33
  }): SchemaItem;
34
+ color(config: BaseConfig & {
35
+ attrs?: ColorPickerInstance["$props"];
36
+ }): SchemaItem;
34
37
  custom(config: BaseConfig & {
35
38
  attrs?: Record<string, any>;
36
39
  type: string;
@@ -1,4 +1,4 @@
1
- import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance } from 'element-plus';
1
+ import { InputInstance, InputNumberInstance, SelectInstance, ElOption, SwitchInstance, ImageInstance, DatePickerInstance, ColorPickerInstance } from 'element-plus';
2
2
  import { j as SchemaItem } from '../Widget-BXpoxMwR.js';
3
3
  import 'vue';
4
4
  import 'async-validator';
@@ -31,6 +31,9 @@ declare const schema: {
31
31
  time(config: BaseConfig & {
32
32
  attrs?: Partial<DatePickerInstance["$props"]>;
33
33
  }): SchemaItem;
34
+ color(config: BaseConfig & {
35
+ attrs?: ColorPickerInstance["$props"];
36
+ }): SchemaItem;
34
37
  custom(config: BaseConfig & {
35
38
  attrs?: Record<string, any>;
36
39
  type: string;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  schema
3
- } from "../chunk-KTDOAEEU.js";
3
+ } from "../chunk-SIPKDBVZ.js";
4
4
  import "../chunk-XJ2IJHKH.js";
5
5
  import "../chunk-6FNC3XMI.js";
6
6
  export {
@@ -65,6 +65,24 @@ var widget = {
65
65
  name,
66
66
  list
67
67
  };
68
+ },
69
+ widget(name, list) {
70
+ return {
71
+ type: 0 /* WIDGET */,
72
+ name,
73
+ list
74
+ };
75
+ },
76
+ root(config) {
77
+ return this.create({
78
+ name: config.name || "\u9875\u9762",
79
+ type: "page",
80
+ config: { visible: false },
81
+ defaultData: config.defaultData,
82
+ defaultStyle: config.defaultStyle,
83
+ attributes: config.attributes,
84
+ stylesheet: config.stylesheet
85
+ });
68
86
  }
69
87
  };
70
88
  // Annotate the CommonJS export names for ESM import in node:
@@ -18,6 +18,13 @@ interface CWidget {
18
18
  attributes?: SchemaItem[];
19
19
  stylesheet?: SchemaItem[];
20
20
  }
21
+ interface RootWidget {
22
+ name?: IWidget['_name'];
23
+ defaultData?: IWidget['data'];
24
+ defaultStyle?: IWidget['style'];
25
+ attributes?: SchemaItem[];
26
+ stylesheet?: SchemaItem[];
27
+ }
21
28
  interface ColumnContainerWidget {
22
29
  name?: IWidget['_name'];
23
30
  icon?: IWidget['_icon'];
@@ -50,6 +57,28 @@ declare const widget: {
50
57
  name: string;
51
58
  list: Base[];
52
59
  };
60
+ widget(name: string, list: IWidget[]): {
61
+ type: widgetType;
62
+ name: string;
63
+ list: Base[];
64
+ };
65
+ root(config: RootWidget): {
66
+ _name: string;
67
+ _view: string;
68
+ _icon: string | undefined;
69
+ container: boolean | undefined;
70
+ meta: {
71
+ draggable?: boolean;
72
+ visible?: boolean;
73
+ fixed?: boolean;
74
+ } | undefined;
75
+ schema: {
76
+ props: SchemaItem[] | undefined;
77
+ style: SchemaItem[] | undefined;
78
+ };
79
+ style: (vue.CSSProperties & WidgetPos) | undefined;
80
+ data: Record<string, any> | undefined;
81
+ };
53
82
  };
54
83
 
55
84
  export { widget, widgetType };
@@ -18,6 +18,13 @@ interface CWidget {
18
18
  attributes?: SchemaItem[];
19
19
  stylesheet?: SchemaItem[];
20
20
  }
21
+ interface RootWidget {
22
+ name?: IWidget['_name'];
23
+ defaultData?: IWidget['data'];
24
+ defaultStyle?: IWidget['style'];
25
+ attributes?: SchemaItem[];
26
+ stylesheet?: SchemaItem[];
27
+ }
21
28
  interface ColumnContainerWidget {
22
29
  name?: IWidget['_name'];
23
30
  icon?: IWidget['_icon'];
@@ -50,6 +57,28 @@ declare const widget: {
50
57
  name: string;
51
58
  list: Base[];
52
59
  };
60
+ widget(name: string, list: IWidget[]): {
61
+ type: widgetType;
62
+ name: string;
63
+ list: Base[];
64
+ };
65
+ root(config: RootWidget): {
66
+ _name: string;
67
+ _view: string;
68
+ _icon: string | undefined;
69
+ container: boolean | undefined;
70
+ meta: {
71
+ draggable?: boolean;
72
+ visible?: boolean;
73
+ fixed?: boolean;
74
+ } | undefined;
75
+ schema: {
76
+ props: SchemaItem[] | undefined;
77
+ style: SchemaItem[] | undefined;
78
+ };
79
+ style: (vue.CSSProperties & WidgetPos) | undefined;
80
+ data: Record<string, any> | undefined;
81
+ };
53
82
  };
54
83
 
55
84
  export { widget, widgetType };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  widget,
3
3
  widgetType
4
- } from "../chunk-VY2Z4X4S.js";
4
+ } from "../chunk-VRAKS4JU.js";
5
5
  import "../chunk-6FNC3XMI.js";
6
6
  export {
7
7
  widget,
package/dist/index.cjs CHANGED
@@ -127,6 +127,15 @@ var schema = {
127
127
  rules: normalizeRules(config)
128
128
  };
129
129
  },
130
+ color(config) {
131
+ return {
132
+ label: config.label,
133
+ key: config.key,
134
+ type: "colorPicker",
135
+ attrs: config.attrs,
136
+ rules: normalizeRules(config)
137
+ };
138
+ },
130
139
  custom(config) {
131
140
  return {
132
141
  label: config.label,
@@ -205,6 +214,24 @@ var widget = {
205
214
  name,
206
215
  list
207
216
  };
217
+ },
218
+ widget(name, list) {
219
+ return {
220
+ type: 0 /* WIDGET */,
221
+ name,
222
+ list
223
+ };
224
+ },
225
+ root(config) {
226
+ return this.create({
227
+ name: config.name || "\u9875\u9762",
228
+ type: "page",
229
+ config: { visible: false },
230
+ defaultData: config.defaultData,
231
+ defaultStyle: config.defaultStyle,
232
+ attributes: config.attributes,
233
+ stylesheet: config.stylesheet
234
+ });
208
235
  }
209
236
  };
210
237
 
package/dist/index.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-W776G2UQ.js";
5
5
  import {
6
6
  schema
7
- } from "./chunk-KTDOAEEU.js";
7
+ } from "./chunk-SIPKDBVZ.js";
8
8
  import {
9
9
  widget,
10
10
  widgetType
11
- } from "./chunk-VY2Z4X4S.js";
11
+ } from "./chunk-VRAKS4JU.js";
12
12
  import {
13
13
  createCopy,
14
14
  createDelete
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sepveneto/dnde-core",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "",
6
6
  "author": "sepveneto",
7
7
  "license": "MIT",