@base-framework/base 3.0.90 → 3.0.92

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.
@@ -0,0 +1,280 @@
1
+ /**
2
+ * ModelService
3
+ *
4
+ * This will create a new model service.
5
+ *
6
+ * @class
7
+ */
8
+ export class ModelService {
9
+ /**
10
+ * This will extend the model service.
11
+ *
12
+ * @param {object} child
13
+ * @returns {object}
14
+ */
15
+ static extend(child: object): object;
16
+ /**
17
+ * This will create a model service.
18
+ *
19
+ * @constructor
20
+ * @param {object} model
21
+ */
22
+ constructor(model: object);
23
+ /**
24
+ * @member {object} model
25
+ */
26
+ model: any;
27
+ /**
28
+ * @member {string} objectType The return type.
29
+ */
30
+ objectType: string;
31
+ /**
32
+ * @member {string} url
33
+ */
34
+ url: string;
35
+ /**
36
+ * @member {function} validateCallBack
37
+ */
38
+ validateCallBack: any;
39
+ /**
40
+ * This will initialize the model service.
41
+ *
42
+ * @protected
43
+ * @returns {void}
44
+ */
45
+ protected init(): void;
46
+ /**
47
+ * This will check if the model is valid.
48
+ *
49
+ * @returns {boolean}
50
+ */
51
+ isValid(): boolean;
52
+ /**
53
+ * This should be overriden to validate the model
54
+ * before submitting.
55
+ *
56
+ * @returns {boolean}
57
+ */
58
+ validate(): boolean;
59
+ /**
60
+ * This can be overriden to add default params
61
+ * with each request.
62
+ *
63
+ * @protected
64
+ * @returns {string}
65
+ */
66
+ protected getDefaultParams(): string;
67
+ /**
68
+ * This will setup the request params.
69
+ *
70
+ * @protected
71
+ * @param {(string|object)} params
72
+ * @returns {(string|object)}
73
+ */
74
+ protected setupParams(params: (string | object)): (string | object);
75
+ /**
76
+ * This will convert an object to a string.
77
+ *
78
+ * @protected
79
+ * @param {object} object
80
+ * @returns {string}
81
+ */
82
+ protected objectToString(object: object): string;
83
+ /**
84
+ * This will add the params.
85
+ *
86
+ * @protected
87
+ * @param {*} params
88
+ * @param {*} addingParams
89
+ * @returns {(string|object)}
90
+ */
91
+ protected addParams(params: any, addingParams: any): (string | object);
92
+ /**
93
+ * This will get the model by id.
94
+ *
95
+ * @param {string} [instanceParams]
96
+ * @param {function} [callBack]
97
+ * @returns {object}
98
+ */
99
+ get(instanceParams?: string, callBack?: Function): object;
100
+ /**
101
+ * This will get the object from the response.
102
+ *
103
+ * @protected
104
+ * @param {object} response
105
+ * @returns {object}
106
+ */
107
+ protected getObject(response: object): object;
108
+ /**
109
+ * This will return a string with the model data json encoded.
110
+ *
111
+ * @protected
112
+ * @returns {string}
113
+ */
114
+ protected setupObjectData(): string;
115
+ /**
116
+ * This will add or update the model.
117
+ *
118
+ * @param {string} [instanceParams]
119
+ * @param {function} [callBack]
120
+ * @returns {object}
121
+ */
122
+ setup(instanceParams?: string, callBack?: Function): object;
123
+ /**
124
+ * This will add the model.
125
+ *
126
+ * @param {string} [instanceParams]
127
+ * @param {function} [callBack]
128
+ * @returns {object}
129
+ */
130
+ add(instanceParams?: string, callBack?: Function): object;
131
+ /**
132
+ * This will update the model.
133
+ *
134
+ * @param {string} [instanceParams]
135
+ * @param {function} [callBack]
136
+ * @returns {object}
137
+ */
138
+ update(instanceParams?: string, callBack?: Function): object;
139
+ /**
140
+ * This will delete the model.
141
+ *
142
+ * @param {string} [instanceParams]
143
+ * @param {function} [callBack]
144
+ * @returns {object}
145
+ */
146
+ delete(instanceParams?: string, callBack?: Function): object;
147
+ /**
148
+ * This will list rows of the model.
149
+ *
150
+ * @param {string} instanceParams
151
+ * @param {function} callBack
152
+ * @param {number} start
153
+ * @param {number} count
154
+ * @param {string} filter
155
+ * @returns {object}
156
+ */
157
+ all(instanceParams: string, callBack: Function, start: number, count: number, filter: string): object;
158
+ /**
159
+ * This will get the url.
160
+ *
161
+ * @protected
162
+ * @param {string} url
163
+ * @returns {string}
164
+ */
165
+ protected getUrl(url: string): string;
166
+ /**
167
+ * This will make an ajax request.
168
+ *
169
+ * @protected
170
+ * @param {string} url
171
+ * @param {string} method
172
+ * @param {(string|object)} params
173
+ * @param {function} callBack
174
+ * @param {function} [requestCallBack]
175
+ * @returns {object}
176
+ */
177
+ protected setupRequest(url: string, method: string, params: (string | object), callBack: Function, requestCallBack?: Function): object;
178
+ /**
179
+ * This will check if the data is a form data object.
180
+ *
181
+ * @protected
182
+ * @param {*} data
183
+ * @returns {boolean}
184
+ */
185
+ protected _isFormData(data: any): boolean;
186
+ /**
187
+ * This will make an ajax request.
188
+ *
189
+ * @protected
190
+ * @param {(string|object)} params
191
+ * @param {string} instanceParams
192
+ * @param {function} callBack
193
+ * @param {function} [requestCallBack]
194
+ * @returns {object}
195
+ */
196
+ protected request(params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
197
+ /**
198
+ * This will make a GET request.
199
+ *
200
+ * @protected
201
+ * @param {string} url
202
+ * @param {(string|object)} params
203
+ * @param {string} instanceParams
204
+ * @param {function} callBack
205
+ * @param {function} [requestCallBack]
206
+ * @returns {object}
207
+ */
208
+ protected _get(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
209
+ /**
210
+ * This will make a POST request.
211
+ *
212
+ * @protected
213
+ * @param {string} url
214
+ * @param {(string|object)} params
215
+ * @param {string} instanceParams
216
+ * @param {function} callBack
217
+ * @param {function} [requestCallBack]
218
+ * @returns {object}
219
+ */
220
+ protected _post(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
221
+ /**
222
+ * This will make a PUT request.
223
+ *
224
+ * @protected
225
+ * @param {string} url
226
+ * @param {(string|object)} params
227
+ * @param {string} instanceParams
228
+ * @param {function} callBack
229
+ * @param {function} [requestCallBack]
230
+ * @returns {object}
231
+ */
232
+ protected _put(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
233
+ /**
234
+ * This will make a PATCH request.
235
+ *
236
+ * @protected
237
+ * @param {string} url
238
+ * @param {(string|object)} params
239
+ * @param {string} instanceParams
240
+ * @param {function} callBack
241
+ * @param {function} [requestCallBack]
242
+ * @returns {object}
243
+ */
244
+ protected _patch(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
245
+ /**
246
+ * This will make a DELETE request.
247
+ *
248
+ * @protected
249
+ * @param {string} url
250
+ * @param {(string|object)} params
251
+ * @param {string} instanceParams
252
+ * @param {function} callBack
253
+ * @param {function} [requestCallBack]
254
+ * @returns {object}
255
+ */
256
+ protected _delete(url: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
257
+ /**
258
+ * This will make an ajax request.
259
+ *
260
+ * @protected
261
+ * @param {string} url
262
+ * @param {string} method
263
+ * @param {(string|object)} params
264
+ * @param {string} instanceParams
265
+ * @param {function} callBack
266
+ * @param {function} [requestCallBack]
267
+ * @returns {object}
268
+ */
269
+ protected _request(url: string, method: string, params: (string | object), instanceParams: string, callBack: Function, requestCallBack?: Function): object;
270
+ /**
271
+ * This will get the response.
272
+ *
273
+ * @protected
274
+ * @param {object} response
275
+ * @param {function} callBack
276
+ * @param {object} xhr
277
+ * @returns {void}
278
+ */
279
+ protected getResponse(response: object, callBack: Function, xhr: object): void;
280
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Model
3
+ *
4
+ * This will extend Data to add a model that can specify
5
+ * a service that connects to a remote source.
6
+ *
7
+ * @class
8
+ * @extends Data
9
+ */
10
+ export class Model extends Data {
11
+ /**
12
+ * This will extend the model to a child model.
13
+ *
14
+ * @param {object} [settings]
15
+ * @returns {object}
16
+ */
17
+ static extend(settings?: object): object;
18
+ /**
19
+ * @member {object|null} xhr
20
+ */
21
+ xhr: any;
22
+ /**
23
+ * This adds a method to call if you want the model
24
+ * to do something when its initialized.
25
+ *
26
+ * @protected
27
+ * @returns {void}
28
+ */
29
+ protected initialize(): void;
30
+ service: typeof ModelService;
31
+ }
32
+ import { Data } from '../deep-data/deep-data.js';
33
+ import { ModelService } from './model-service.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SimpleData
3
+ *
4
+ * This will extend Data to add a simple data object
5
+ * that doesn't allow deep nested data.
6
+ *
7
+ * @class
8
+ * @augments BasicData
9
+ */
10
+ export class SimpleData extends BasicData {
11
+ }
12
+ import { BasicData } from './basic-data.js';
@@ -8,7 +8,7 @@
8
8
  */
9
9
  export class OneWayConnection extends Connection {
10
10
  /**
11
- * @member {object} source
11
+ * @member {object|null} source
12
12
  */
13
13
  source: OneWaySource;
14
14
  /**
@@ -10,15 +10,16 @@ export class TwoWayConnection extends Connection {
10
10
  /**
11
11
  * This will create a two way connection.
12
12
  *
13
+ * @param {object} pubSub
13
14
  * @constructor
14
15
  */
15
- constructor(pubSub: any);
16
+ constructor(pubSub: object);
16
17
  /**
17
- * @member {object} element
18
+ * @member {object|null} element
18
19
  */
19
20
  element: ElementSource;
20
21
  /**
21
- * @member {object} data
22
+ * @member {object|null} data
22
23
  */
23
24
  data: DataSource;
24
25
  /**
@@ -0,0 +1,39 @@
1
+ /**
2
+ * HtmlToString
3
+ *
4
+ * This will render html to a string.
5
+ *
6
+ * @class
7
+ */
8
+ export class HtmlToString {
9
+ /**
10
+ * This will create a node string.
11
+ *
12
+ * @param {string} tag
13
+ * @param {object} attrs
14
+ * @param {string} children
15
+ * @returns {string}
16
+ */
17
+ static create(tag: string, attrs?: object, children?: string): string;
18
+ /**
19
+ * This will create a text node.
20
+ *
21
+ * @param {array} attrs
22
+ * @returns {string}
23
+ */
24
+ static createAttributes(attrs?: any[]): string;
25
+ /**
26
+ * This will create a text node.
27
+ *
28
+ * @param {string} text
29
+ * @returns {string}
30
+ */
31
+ static createText(text: string): string;
32
+ /**
33
+ * This will create a comment node.
34
+ *
35
+ * @param {string} text
36
+ * @returns {string}
37
+ */
38
+ static createComment(text: string): string;
39
+ }
@@ -6,5 +6,61 @@
6
6
  * @class
7
7
  */
8
8
  export class BrowserRender extends Render {
9
+ /**
10
+ * This will build an element or component.
11
+ *
12
+ * @protected
13
+ * @param {object} obj
14
+ * @param {object} container
15
+ * @param {object} [parent] The component adding the layout.
16
+ * @returns {void}
17
+ */
18
+ protected buildElement(obj: object, container: object, parent?: object): void;
19
+ /**
20
+ * This will create an element.
21
+ *
22
+ * @protected
23
+ * @param {object} obj
24
+ * @param {object} container
25
+ * @param {object} [parent] The component adding the layout.
26
+ * @returns {void}
27
+ */
28
+ protected createElement(obj: object, container: object, parent?: object): void;
29
+ /**
30
+ * This will add the element directives.
31
+ *
32
+ * @param {object} ele
33
+ * @param {array} directives
34
+ * @param {object} parent
35
+ * @returns {void}
36
+ */
37
+ setDirectives(ele: object, directives: any[], parent: object): void;
38
+ /**
39
+ * This will handle an attr directive.
40
+ *
41
+ * @protected
42
+ * @param {object} ele
43
+ * @param {object} attrDirective
44
+ * @param {object} parent
45
+ * @returns {void}
46
+ */
47
+ protected handleDirective(ele: object, attrDirective: object, parent: object): void;
48
+ /**
49
+ * This will cache an element ot the parent.
50
+ *
51
+ * @param {object} ele
52
+ * @param {object} propName
53
+ * @param {object} parent
54
+ */
55
+ cache(ele: object, propName: object, parent: object): void;
56
+ /**
57
+ * This will create a node.
58
+ *
59
+ * @param {object} settings
60
+ * @param {object} container
61
+ * @param {object} parent
62
+ * @returns {object}
63
+ */
64
+ createNode(settings: object, container: object, parent: object): object;
9
65
  }
10
66
  import { Render } from './render.js';
@@ -9,9 +9,9 @@ export class RenderController {
9
9
  /**
10
10
  * This will check if we are in the browser.
11
11
  *
12
- * @returns boolean
12
+ * @returns {boolean}
13
13
  */
14
- static browserIsSupported(): Window & typeof globalThis;
14
+ static browserIsSupported(): boolean;
15
15
  /**
16
16
  * This will create a History Object based on navigation support
17
17
  *
@@ -7,12 +7,28 @@
7
7
  */
8
8
  export class Render {
9
9
  /**
10
- * This will create a node.
10
+ * This will render the layout
11
11
  *
12
- * @param {object} settings
12
+ * @param {object} obj The JSON layout.
13
+ * @param {object} [container] The parent receiving the layout.
14
+ * @param {object} [parent] The component adding the layout.
15
+ * @returns {*} The layout result
16
+ */
17
+ build(obj: object, container?: object, parent?: object): any;
18
+ /**
19
+ * This will create a component.
20
+ *
21
+ * @param {object} obj
13
22
  * @param {object} container
14
23
  * @param {object} parent
15
- * @returns {object}
24
+ * @returns {void}
25
+ */
26
+ createComponent(obj: object, container: object, parent: object): void;
27
+ /**
28
+ * This will remove all the children from an element.
29
+ *
30
+ * @param {object} ele
31
+ * @returns {void}
16
32
  */
17
- createNode(settings: object, container: object, parent: object): object;
33
+ removeAll(ele: object): void;
18
34
  }
@@ -6,5 +6,31 @@
6
6
  * @class
7
7
  */
8
8
  export class ServerRender extends Render {
9
+ /**
10
+ * This will build an element or component and return an HTML string.
11
+ *
12
+ * @protected
13
+ * @param {object} obj
14
+ * @param {object} [parent] The component adding the layout.
15
+ * @returns {*}
16
+ */
17
+ protected buildElement(obj: object, parent?: object): any;
18
+ /**
19
+ * This will create an element and return an HTML string.
20
+ *
21
+ * @protected
22
+ * @param {object} obj
23
+ * @param {object} [parent] The component adding the layout.
24
+ * @returns {string} The HTML string.
25
+ */
26
+ protected createElement(obj: object, parent?: object): string;
27
+ /**
28
+ * This will create a node.
29
+ *
30
+ * @param {object} settings
31
+ * @param {string} childrenHtml
32
+ * @returns {object}
33
+ */
34
+ createNode(settings: object, childrenHtml: string): object;
9
35
  }
10
36
  import { Render } from './render.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/base",
3
- "version": "3.0.90",
3
+ "version": "3.0.92",
4
4
  "description": "This is a javascript framework.",
5
5
  "main": "/dist/base.js",
6
6
  "scripts": {