js-mvc-framework
Advanced tools
Comparing version 1.2.21 to 1.2.22
@@ -30,3 +30,3 @@ import { Control } from '/dependencies/mvc-framework.js' | ||
controls: { | ||
// inspector: InspectorControl, | ||
inspector: InspectorControl, | ||
// https: HTTPSControl, | ||
@@ -64,5 +64,3 @@ // browserSync: BrowserSyncControl, | ||
"routers.location.default route": function route($event) { | ||
console.log(this) | ||
// console.log($event) | ||
// this.start() | ||
this.start() | ||
}, | ||
@@ -76,9 +74,6 @@ // "routers.location.default error": ($event) => { | ||
start: { value: function () { | ||
console.log(this.models.default.parse()) | ||
this.views.default.render(this.models.default.parse(), 'default') | ||
// console.log(this.views.default.querySelectors) | ||
// const controlViewParent = this.views.default.querySelectors['static-cms'] | ||
// // Inspector | ||
// // console.log(InspectorControl(...InspectorControl(controlViewParent))) | ||
// this.controls.inspector = new Control(...InspectorControl(controlViewParent)).start() | ||
const controlViewParent = this.views.default.querySelectors['static-cms'] | ||
// Inspector | ||
this.controls.inspector = new Control(...InspectorControl(controlViewParent)).start() | ||
// // this.controls.https = HTTPSControl(controlViewParent) | ||
@@ -85,0 +80,0 @@ // // this.controls.browserSync = BrowserSyncControl(controlViewParent) |
@@ -37,9 +37,9 @@ import { regularExpressions, recursiveAssign } from '../../../../../../../Coutil/index.js' | ||
let subschema | ||
if(schema?.contextType === 'array') { subschema = schema.context[0] } | ||
else if(schema?.contextType === 'object') { subschema = schema.context[propertyKey] } | ||
if(schema?.type === 'array') { subschema = schema.context[0] } | ||
else if(schema?.type === 'object') { subschema = schema.context[propertyKey] } | ||
else { subschema = undefined } | ||
// Subcontent | ||
let subcontent | ||
if(subschema?.contextType === 'array') { subcontent = [] } | ||
else if(subschema?.contextType === 'object') { subcontent = {} } | ||
if(subschema?.type === 'array') { subcontent = [] } | ||
else if(subschema?.type === 'object') { subcontent = {} } | ||
else { | ||
@@ -81,4 +81,4 @@ if(Number(propertyKey)) { subcontent = [] } | ||
let subschema | ||
if(schema?.contextType === 'array') { subschema = schema.context[0] } | ||
else if(schema?.contextType === 'object') { subschema = schema.context[propertyKey] } | ||
if(schema?.type === 'array') { subschema = schema.context[0] } | ||
else if(schema?.type === 'object') { subschema = schema.context[propertyKey] } | ||
else { subschema = undefined } | ||
@@ -134,4 +134,4 @@ propertyValue = new Content($value, subschema, Object.assign( | ||
let subschema | ||
if(schema?.contextType === 'array') { subschema = schema.context[0] } | ||
if(schema?.contextType === 'object') { subschema = schema.context[propertyKey] } | ||
if(schema?.type === 'array') { subschema = schema.context[0] } | ||
if(schema?.type === 'object') { subschema = schema.context[propertyKey] } | ||
else { subschema = undefined } | ||
@@ -138,0 +138,0 @@ const _path = (path !== null) |
@@ -40,4 +40,4 @@ import { recursiveAssign } from '../../../../../../Coutil/index.js' | ||
let subschema | ||
if(schema?.contextType === 'array') { subschema = schema.context[0] } | ||
else if(schema?.contextType === 'object') { subschema = schema.context[$sourcePropKey] } | ||
if(schema?.type === 'array') { subschema = schema.context[0] } | ||
else if(schema?.type === 'object') { subschema = schema.context[$sourcePropKey] } | ||
else { subschema = null } | ||
@@ -44,0 +44,0 @@ // Content |
@@ -29,4 +29,4 @@ import { typeOf } from '../../../../../../Coutil/index.js' | ||
let subschema | ||
if(schema.contextType === 'array') { subschema = schema.context[0] } | ||
else if(schema.contextType === 'object') { subschema = schema.context[propertyKey] } | ||
if(schema.type === 'array') { subschema = schema.context[0] } | ||
else if(schema.type === 'object') { subschema = schema.context[propertyKey] } | ||
else { subschema = undefined} | ||
@@ -33,0 +33,0 @@ const rootPropertyDescriptor = Object.getOwnPropertyDescriptor(root, propertyKey) || {} |
@@ -21,3 +21,7 @@ import { typeOf, recursiveAssign } from '../../Coutil/index.js' | ||
this.schema = $schema | ||
return this.proxy | ||
if( | ||
this.schema !== null && | ||
this.schema?.type !== this.type | ||
) { return undefined } | ||
else { return this.proxy } | ||
} | ||
@@ -24,0 +28,0 @@ get #properties() { return this.#_properties } |
@@ -46,4 +46,3 @@ import { recursiveAssign } from '../Coutil/index.js' | ||
this.#_content = new Content( | ||
// recursiveAssign({}, content, localStorageContent), | ||
content, | ||
recursiveAssign({}, content, localStorageContent), | ||
this.schema, | ||
@@ -50,0 +49,0 @@ this.options.content |
@@ -16,3 +16,3 @@ import { typeOf } from '../../Coutil/index.js' | ||
#properties | ||
#_contextType | ||
#_type | ||
#_context | ||
@@ -23,10 +23,10 @@ constructor($properties = {}, $options = {}) { | ||
this.options = Object.assign({}, Options, $options) | ||
this.context | ||
// this.context | ||
} | ||
get validationType() { return this.options.validationType } | ||
get contextType() { | ||
if(this.#_contextType !== undefined) return this.#_contextType | ||
if(Array.isArray(this.#properties)) { this.#_contextType = 'array' } | ||
else if(typeOf(this.#properties) === 'object') { this.#_contextType = 'object' } | ||
return this.#_contextType | ||
get type() { | ||
if(this.#_type !== undefined) return this.#_type | ||
if(Array.isArray(this.#properties)) { this.#_type = 'array' } | ||
else if(typeOf(this.#properties) === 'object') { this.#_type = 'object' } | ||
return this.#_type | ||
} | ||
@@ -36,7 +36,7 @@ get context() { | ||
let properties | ||
if(this.contextType === 'array') { | ||
if(this.type === 'array') { | ||
properties = this.#properties.slice(0, 1) | ||
this.#_context = [] | ||
} | ||
else if(this.contextType === 'object') { | ||
else if(this.type === 'object') { | ||
properties = this.#properties | ||
@@ -89,4 +89,4 @@ this.#_context = {} | ||
let validateProperties | ||
if(this.contextType === 'array') { validateProperties = [] } | ||
else if(this.contextType === 'object') { validateProperties = {} } | ||
if(this.type === 'array') { validateProperties = [] } | ||
else if(this.type === 'object') { validateProperties = {} } | ||
const Validation = { | ||
@@ -121,4 +121,4 @@ properties: validateProperties, | ||
let contextVal | ||
if(this.contextType === 'array') { contextVal = this.context[0] } | ||
else if(this.contextType === 'object') { contextVal = this.context[$key] } | ||
if(this.type === 'array') { contextVal = this.context[0] } | ||
else if(this.type === 'object') { contextVal = this.context[$key] } | ||
// Context Val: Undefined | ||
@@ -139,6 +139,4 @@ if(contextVal === undefined) { | ||
validation = contextVal.validate($val) | ||
// | ||
if(validation.valid === true) { propertyValidation.advance.push(validation) } | ||
else if(validation.valid === false) { propertyValidation.deadvance.push(validation) } | ||
// | ||
if(this.validationType === 'object') { propertyValidation.valid === validation.valid } | ||
@@ -145,0 +143,0 @@ else if(this.validationType === 'primitive') { |
@@ -13,5 +13,3 @@ export default class Validation extends EventTarget { | ||
} | ||
// Property: Type | ||
get type() { return this.#settings.type } | ||
// Property: Valid | ||
get valid() { return this.#_valid } | ||
@@ -23,3 +21,2 @@ set valid($valid) { | ||
} | ||
// Property: Message | ||
get message() { | ||
@@ -35,12 +32,7 @@ if(this.#_message !== undefined) return this.#_message | ||
} | ||
// Property: Context | ||
get context() { return this.#settings.context } | ||
// Property: Context Key | ||
get contextKey() { return this.#settings.contentKey } | ||
// Property: Context Val | ||
get contextVal() { return this.#settings.context[this.contentKey] } | ||
// Property: Content Key | ||
get contentKey() { return this.#settings.contentKey } | ||
// Property: Content Val | ||
get contentVal() { return this.#settings.contentVal } | ||
} |
export default { | ||
localStorage: undefined, | ||
schema: undefined, | ||
content: undefined, | ||
} |
{ | ||
"name": "js-mvc-framework", | ||
"author": "Thomas Patrick Welborn", | ||
"version": "1.2.21", | ||
"version": "1.2.22", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1658685
12714