form-driver 0.4.5 → 0.4.6

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.
package/es/m3.js CHANGED
@@ -20477,7 +20477,6 @@ var AWeight = /*#__PURE__*/function (_Viewer) {
20477
20477
 
20478
20478
  var _this;
20479
20479
 
20480
- console.log("AWeight props", props);
20481
20480
  _this = _Viewer.call(this, props) || this;
20482
20481
  _this.allSliderValuesChanged = []; // 添加防抖定时器
20483
20482
 
@@ -20489,21 +20488,21 @@ var AWeight = /*#__PURE__*/function (_Viewer) {
20489
20488
  _this.allValues = [];
20490
20489
  var schema = props.schema;
20491
20490
  _this._enumFields = MUtil.option(_this.props.schema);
20492
- console.log("this._enumFields", _this._enumFields);
20493
20491
  _this.totalWeight = schema.weight;
20494
20492
  _this.allValues = (_this$_enumFields$map = (_this$_enumFields = _this._enumFields) == null ? void 0 : _this$_enumFields.map(function (i) {
20495
- var _values$find;
20493
+ var _values$find$value, _values$find;
20496
20494
 
20497
20495
  var values = _Viewer.prototype.getValue.call(_assertThisInitialized(_this));
20498
20496
 
20499
- return values == null ? void 0 : (_values$find = values.find(function (v) {
20497
+ return (_values$find$value = values == null ? void 0 : (_values$find = values.find(function (v) {
20500
20498
  return i.value === v.label;
20501
- })) == null ? void 0 : _values$find.value;
20499
+ })) == null ? void 0 : _values$find.value) != null ? _values$find$value : 0;
20502
20500
  })) != null ? _this$_enumFields$map : new Array(_this._enumFields.length).fill(0);
20503
20501
  _this.state = {
20504
20502
  allSliderValues: _this.allValues,
20505
20503
  ctrlVersion: 1
20506
20504
  };
20505
+ console.log("this.state", _this.state);
20507
20506
  return _this;
20508
20507
  }
20509
20508
 
@@ -21868,12 +21867,15 @@ var ACascadePicker = /*#__PURE__*/function (_BaseViewer) {
21868
21867
  }),
21869
21868
  changeOnSelect: true,
21870
21869
  placeholder: _BaseViewer.prototype.getPlaceholder.call(this),
21870
+ onClear: function onClear() {
21871
+ _BaseViewer.prototype.changeValue.call(_this, []);
21872
+ },
21871
21873
  onChange: function onChange(v) {
21872
21874
  var vLabel = [];
21873
21875
  v.map(function (item) {
21874
21876
  var findItem;
21875
21877
  candidate.map(function (dataItem) {
21876
- findItem = findById(dataItem, item, 'label', 'value', 'children');
21878
+ findItem = findById(dataItem, item, "label", "value", "children");
21877
21879
 
21878
21880
  if (findItem != -1) {
21879
21881
  vLabel.push(findItem);
package/lib/m3.js CHANGED
@@ -20501,7 +20501,6 @@ var AWeight = /*#__PURE__*/function (_Viewer) {
20501
20501
 
20502
20502
  var _this;
20503
20503
 
20504
- console.log("AWeight props", props);
20505
20504
  _this = _Viewer.call(this, props) || this;
20506
20505
  _this.allSliderValuesChanged = []; // 添加防抖定时器
20507
20506
 
@@ -20513,21 +20512,21 @@ var AWeight = /*#__PURE__*/function (_Viewer) {
20513
20512
  _this.allValues = [];
20514
20513
  var schema = props.schema;
20515
20514
  _this._enumFields = MUtil.option(_this.props.schema);
20516
- console.log("this._enumFields", _this._enumFields);
20517
20515
  _this.totalWeight = schema.weight;
20518
20516
  _this.allValues = (_this$_enumFields$map = (_this$_enumFields = _this._enumFields) == null ? void 0 : _this$_enumFields.map(function (i) {
20519
- var _values$find;
20517
+ var _values$find$value, _values$find;
20520
20518
 
20521
20519
  var values = _Viewer.prototype.getValue.call(_assertThisInitialized__default["default"](_this));
20522
20520
 
20523
- return values == null ? void 0 : (_values$find = values.find(function (v) {
20521
+ return (_values$find$value = values == null ? void 0 : (_values$find = values.find(function (v) {
20524
20522
  return i.value === v.label;
20525
- })) == null ? void 0 : _values$find.value;
20523
+ })) == null ? void 0 : _values$find.value) != null ? _values$find$value : 0;
20526
20524
  })) != null ? _this$_enumFields$map : new Array(_this._enumFields.length).fill(0);
20527
20525
  _this.state = {
20528
20526
  allSliderValues: _this.allValues,
20529
20527
  ctrlVersion: 1
20530
20528
  };
20529
+ console.log("this.state", _this.state);
20531
20530
  return _this;
20532
20531
  }
20533
20532
 
@@ -21892,12 +21891,15 @@ var ACascadePicker = /*#__PURE__*/function (_BaseViewer) {
21892
21891
  }),
21893
21892
  changeOnSelect: true,
21894
21893
  placeholder: _BaseViewer.prototype.getPlaceholder.call(this),
21894
+ onClear: function onClear() {
21895
+ _BaseViewer.prototype.changeValue.call(_this, []);
21896
+ },
21895
21897
  onChange: function onChange(v) {
21896
21898
  var vLabel = [];
21897
21899
  v.map(function (item) {
21898
21900
  var findItem;
21899
21901
  candidate.map(function (dataItem) {
21900
- findItem = findById(dataItem, item, 'label', 'value', 'children');
21902
+ findItem = findById(dataItem, item, "label", "value", "children");
21901
21903
 
21902
21904
  if (findItem != -1) {
21903
21905
  vLabel.push(findItem);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "form-driver",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "An efficient framework for creating forms.",
5
5
  "license": "MIT",
6
6
  "authors": [
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { MFieldSchema } from '../../../framework/Schema';
2
+ import { MFieldSchema } from "../../../framework/Schema";
3
3
  import { BaseViewer } from "../../..";
4
4
  export declare function labelExpr(d: any, remote: MFieldSchema["remote"]): any;
5
5
  export declare function convert(node: {}, dataPath: any, valuePath: any, childPath: any): {};