@csnext/cs-form
Advanced tools
Comparing version 0.0.109 to 0.0.110
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.0.110](https://github.com/TNOCS/csnext/compare/v0.0.109...v0.0.110) (2019-04-08) | ||
**Note:** Version bump only for package @csnext/cs-form | ||
## [0.0.109](https://github.com/TNOCS/csnext/compare/v0.0.108...v0.0.109) (2019-02-23) | ||
@@ -8,0 +16,0 @@ |
@@ -10,5 +10,6 @@ import Vue from 'vue'; | ||
deleteKeyFromObject(key: string, field: IFormFieldOptions): void; | ||
updateKey(key: string, field: IFormFieldOptions): void; | ||
addKeyObject(field: IFormFieldOptions): void; | ||
keyObjectChange(key: string): void; | ||
keyObjectChange(field: IFormFieldOptions, oldValue: string, newValue: string): void; | ||
mounted(): void; | ||
} |
@@ -7,2 +7,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) | ||
t[p[i]] = s[p[i]]; | ||
return t; | ||
}; | ||
import Vue from 'vue'; | ||
@@ -26,9 +35,22 @@ import Component from 'vue-class-component'; | ||
} | ||
updateKey(key, field) { | ||
console.log('Update key'); | ||
if (key !== undefined && | ||
field !== undefined && | ||
this.target !== undefined && | ||
field._key && | ||
this.target.hasOwnProperty(field._key)) { | ||
if (this.target[field._key].hasOwnProperty(key)) { | ||
// delete this.target[field._key][key]; | ||
this.$forceUpdate(); | ||
} | ||
} | ||
} | ||
addKeyObject(field) { | ||
if (!this.target || | ||
!field._key || | ||
!field.keyValuesType || | ||
!this.target.hasOwnProperty(field._key)) { | ||
!field.keyValuesType) { | ||
return; | ||
} | ||
// check if field already exists, if not create one | ||
if (this.target[field._key] === undefined) { | ||
@@ -49,4 +71,16 @@ this.target[field._key] = {}; | ||
} | ||
keyObjectChange(key) { | ||
console.log(key); | ||
keyObjectChange(field, oldValue, newValue) { | ||
let renameProp = (oldProp, newProp, _a) => { | ||
var _b = oldProp, old = _a[_b], others = __rest(_a, [typeof _b === "symbol" ? _b : _b + ""]); | ||
return (Object.assign({ [newProp]: old }, others)); | ||
}; | ||
if (!this.target || | ||
!field._key || | ||
!field.keyValuesType || | ||
!this.target.hasOwnProperty(field._key)) { | ||
return; | ||
} | ||
this.target[field._key] = renameProp(oldValue, newValue, this.target[field._key]); | ||
console.log('Key event'); | ||
console.log(oldValue + ' -> ' + newValue); | ||
} | ||
@@ -53,0 +87,0 @@ mounted() { |
@@ -26,2 +26,4 @@ import Vue from 'vue'; | ||
}; | ||
/** specify a single field to show, others are hidden */ | ||
field?: string; | ||
isKeyValueList(): boolean; | ||
@@ -28,0 +30,0 @@ formObject: IFormObject | undefined; |
@@ -94,23 +94,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.Form.fields.map(f => { | ||
if (f.type === 'keysobject') { | ||
console.log('keysobject'); | ||
console.log(f); | ||
} | ||
if (!f.group) { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f._key + '-group'; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} | ||
else { | ||
const group = this.fieldGroups.find(field => f.group === field.id); | ||
if (group) { | ||
group.fields.push(f); | ||
// show all fields, or optionally filter only specified field | ||
if (!this.field || this.field === f._key) { | ||
if (f.type === 'keysobject') { | ||
} | ||
else { | ||
if (!f.group) { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f.group; | ||
newGroup.id = f._key + '-group'; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} | ||
else { | ||
const group = this.fieldGroups.find(field => f.group === field.id); | ||
if (group) { | ||
group.fields.push(f); | ||
} | ||
else { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f.group; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} | ||
} | ||
} | ||
@@ -187,3 +188,4 @@ }); | ||
formdef: null, | ||
formkey: null | ||
formkey: null, | ||
field: null | ||
} | ||
@@ -190,0 +192,0 @@ }) |
@@ -0,4 +1,7 @@ | ||
import vue from 'vue'; | ||
import { CsForm } from './components/cs-form/cs-form'; | ||
// components | ||
export * from './components/cs-form/cs-form'; | ||
export * from './components/cs-form-field/cs-form-field'; | ||
vue.component('cs-form', CsForm); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@csnext/cs-form", | ||
"version": "0.0.109", | ||
"version": "0.0.110", | ||
"description": "cs-form", | ||
@@ -14,3 +14,3 @@ "main": "./lib/csform.cs.js", | ||
"build": "webpack --mode development", | ||
"clean": "del-cli dist lib" | ||
"clean": "del-cli dist lib node_modules" | ||
}, | ||
@@ -21,8 +21,8 @@ "publishConfig": { | ||
"dependencies": { | ||
"@csnext/cs-client": "^0.0.109", | ||
"@csnext/cs-core": "^0.0.109", | ||
"@csnext/cs-client": "^0.0.110", | ||
"@csnext/cs-core": "^0.0.110", | ||
"reflect-metadata": "^0.1.13" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^10.12.24", | ||
"@types/node": "^11.12.2", | ||
"postcss-loader": "^3.0.0", | ||
@@ -32,7 +32,7 @@ "raw-loader": "^1.0.0", | ||
"ts-loader": "^5.3.3", | ||
"typescript": "^3.3.3", | ||
"webpack": "~4.29.3", | ||
"webpack-cli": "^3.2.3" | ||
"typescript": "^3.4.1", | ||
"webpack": "~4.29.6", | ||
"webpack-cli": "^3.3.0" | ||
}, | ||
"gitHead": "788e710cc7ae12e85b155cd5c59acd8f527501bc" | ||
"gitHead": "01b7ffa04f95427e5580295039eb28eb32dc67bb" | ||
} |
@@ -41,2 +41,18 @@ import Vue from 'vue'; | ||
public updateKey(key: string, field: IFormFieldOptions) { | ||
console.log('Update key'); | ||
if ( | ||
key !== undefined && | ||
field !== undefined && | ||
this.target !== undefined && | ||
field._key && | ||
this.target.hasOwnProperty(field._key) | ||
) { | ||
if (this.target[field._key].hasOwnProperty(key)) { | ||
// delete this.target[field._key][key]; | ||
this.$forceUpdate(); | ||
} | ||
} | ||
} | ||
public addKeyObject(field: IFormFieldOptions) { | ||
@@ -46,7 +62,7 @@ if ( | ||
!field._key || | ||
!field.keyValuesType || | ||
!this.target.hasOwnProperty(field._key) | ||
!field.keyValuesType | ||
) { | ||
return; | ||
} | ||
// check if field already exists, if not create one | ||
if (this.target[field._key] === undefined) { | ||
@@ -69,4 +85,25 @@ this.target[field._key] = {}; | ||
keyObjectChange(key: string) { | ||
console.log(key); | ||
keyObjectChange(field: IFormFieldOptions, oldValue: string, newValue: string) { | ||
let renameProp = ( | ||
oldProp, | ||
newProp, | ||
{ [oldProp]: old, ...others } | ||
) => ({ | ||
[newProp]: old, | ||
...others | ||
}); | ||
if ( | ||
!this.target || | ||
!field._key || | ||
!field.keyValuesType || | ||
!this.target.hasOwnProperty(field._key) | ||
) { | ||
return; | ||
} | ||
this.target[field._key] = renameProp(oldValue, newValue, this.target[field._key]); | ||
console.log('Key event'); | ||
console.log(oldValue + ' -> ' + newValue); | ||
} | ||
@@ -73,0 +110,0 @@ |
@@ -29,3 +29,4 @@ import { Prop } from 'vue-property-decorator'; | ||
formdef: null, | ||
formkey: null | ||
formkey: null, | ||
field: null | ||
} as any | ||
@@ -47,3 +48,5 @@ }) | ||
public keys: { [key: string]: IFormObject } = {}; | ||
/** specify a single field to show, others are hidden */ | ||
public field?: string; | ||
public isKeyValueList(): boolean { | ||
@@ -120,22 +123,23 @@ return this.keys !== undefined && this.keys.length > 0; | ||
this.Form.fields.map(f => { | ||
if (f.type === 'keysobject') { | ||
console.log('keysobject'); | ||
console.log(f); | ||
} | ||
if (!f.group) { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f._key + '-group'; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} else { | ||
const group = this.fieldGroups.find( | ||
field => f.group === field.id | ||
); | ||
if (group) { | ||
group.fields.push(f); | ||
} else { | ||
// show all fields, or optionally filter only specified field | ||
if (!this.field || this.field === f._key) { | ||
if (f.type === 'keysobject') { | ||
} | ||
if (!f.group) { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f.group; | ||
newGroup.id = f._key + '-group'; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} else { | ||
const group = this.fieldGroups.find( | ||
field => f.group === field.id | ||
); | ||
if (group) { | ||
group.fields.push(f); | ||
} else { | ||
const newGroup = new FieldGroup(); | ||
newGroup.id = f.group; | ||
newGroup.fields.push(f); | ||
this.fieldGroups.push(newGroup); | ||
} | ||
} | ||
@@ -142,0 +146,0 @@ } |
import { CsFormField } from './components/cs-form-field/cs-form-field'; | ||
import Vue from 'vue'; | ||
import vue from 'vue'; | ||
import { CsForm } from './components/cs-form/cs-form'; | ||
@@ -8,1 +9,2 @@ // components | ||
vue.component('cs-form', CsForm); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
552312
3539
7
+ Added@csnext/cs-client@0.0.110(transitive)
+ Added@csnext/cs-core@0.0.110(transitive)
- Removed@csnext/cs-client@0.0.109(transitive)
- Removed@csnext/cs-core@0.0.109(transitive)
Updated@csnext/cs-client@^0.0.110
Updated@csnext/cs-core@^0.0.110