Skip to content

Commit 8a1347c

Browse files
committed
Update dist
1 parent a6e5486 commit 8a1347c

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

dist/schema-form.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ return /******/ (function(modules) { // webpackBootstrap
10601060
this.$get = function () {
10611061

10621062
var service = {};
1063+
var typeDefault = this.defaults;
10631064

10641065
service.merge = function (schema, form, ignore, options, readonly, asyncTemplates) {
10651066
form = form || ['*'];
@@ -1068,7 +1069,7 @@ return /******/ (function(modules) { // webpackBootstrap
10681069
// Get readonly from root object
10691070
readonly = readonly || schema.readonly || schema.readOnly;
10701071

1071-
var stdForm = _jsonSchemaFormCore.schemaDefaults.defaultForm(schema, defaults, ignore, options);
1072+
var stdForm = _jsonSchemaFormCore.schemaDefaults.defaultForm(schema, typeDefault, ignore, options);
10721073

10731074
//simple case, we have a "*", just put the stdForm there
10741075
var idx = form.indexOf('*');
@@ -1086,7 +1087,14 @@ return /******/ (function(modules) { // webpackBootstrap
10861087
* Create form defaults from schema
10871088
*/
10881089
service.defaults = _jsonSchemaFormCore.schemaDefaults.defaultForm;
1090+
10891091
//Utility functions
1092+
/**
1093+
* Form defaults for schema by type
1094+
* As a form is generated from a schema these are the definitions of each json-schema type
1095+
*/
1096+
service.typeDefault = typeDefault;
1097+
10901098
/**
10911099
* Traverse a schema, applying a function(schema,path) on every sub schema
10921100
* i.e. every property of an object.
@@ -1114,8 +1122,9 @@ return /******/ (function(modules) { // webpackBootstrap
11141122
/*!
11151123
* json-schema-form
11161124
* @version 1.0.0-alpha.1
1125+
* @link https://github.com/json-schema-form/json-schema-form-core
11171126
* @license MIT
1118-
* Copyright 2016 JSON Schema Form
1127+
* Copyright (c) 2016 JSON Schema Form
11191128
*/
11201129
(function webpackUniversalModuleDefinition(root, factory) {
11211130
if(true)
@@ -1879,10 +1888,10 @@ return /******/ (function(modules) { // webpackBootstrap
18791888
var _ret = function () {
18801889
var f = stdFormObj(name, schema, options);
18811890
f.type = 'fieldset';
1891+
f.key = options.path;
18821892
f.items = [];
18831893
options.lookup[(0, _sfPath.stringify)(options.path)] = f;
18841894

1885-
console.log('fieldset', f, schema);
18861895
//recurse down into properties
18871896
if (schema.properties) {
18881897
Object.keys(schema.properties).forEach(function (key) {
@@ -1952,8 +1961,7 @@ return /******/ (function(modules) { // webpackBootstrap
19521961
number: [number],
19531962
integer: [integer],
19541963
boolean: [checkbox],
1955-
array: [array],
1956-
defaultForm: defaultForm
1964+
array: [checkboxes, array]
19571965
};
19581966
};
19591967

@@ -1965,6 +1973,7 @@ return /******/ (function(modules) { // webpackBootstrap
19651973
var lookup = {}; //Map path => form obj for fast lookup in merging
19661974
ignore = ignore || {};
19671975
globalOptions = globalOptions || {};
1976+
defaultSchemaTypes = defaultSchemaTypes || createDefaults();
19681977

19691978
if (schema.properties) {
19701979
Object.keys(schema.properties).forEach(function (key) {

0 commit comments

Comments
 (0)