"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _utils = require("../_utils/utils");
var _locale = require("../../src/locale");
var _setters = require("../_setters");
var _formKeyType = require("../_utils/formKeyType");
var _loopData = _interopRequireDefault(require("../_com-props/loopData"));
var _componentKey = _interopRequireDefault(require("../_com-props/componentKey"));
var _componentName = _interopRequireDefault(require("../_com-props/componentName"));
var Meta = {
  componentName: "WebRenderer",
  title: (0, _locale.t)("web-renderer.title"),
  group: (0, _locale.t)("web-renderer.group"),
  category: "Business",
  props: [_loopData["default"], _componentKey["default"], _componentName["default"], {
    name: "webRendererGid",
    title: {
      label: (0, _locale.t)("web-renderer.webGid"),
      tip: (0, _locale.t)("web-renderer.webGidTip")
    },
    setter: _setters.CWebListSetter
  }, {
    name: 'apiParams',
    title: {
      label: (0, _locale.t)('modal-default.key_dTxjwIh3VhjR'),
      tip: (0, _locale.t)('modal-default.key_xfWtbCjOuQ0A')
    },
    setter: _setters.CTreeDataRelationSetter,
    condition: function condition(target) {
      var data = target.getProps().getPropValue('webRendererGid');
      return data.webType === "default" && data.webGid.length > 0 || data.webType === "custom";
    }
  }, {
    name: 'parentFlowEvent',
    title: {
      label: (0, _locale.t)('modal-default.key_dTxjwIh4VhjR'),
      tip: (0, _locale.t)('modal-default.key_dTxjwIh4VhjR')
    },
    setter: _setters.CParentFlowEventListSetter,
    condition: function condition(target) {
      var data = target.getProps().getPropValue('webRendererGid');
      return data.webType === "default" && data.webGid.length > 0 || data.webType === "custom";
    }
  }, {
    name: "loadingStyleSetting",
    title: {
      label: (0, _locale.t)("web-renderer.loadingStyleSetting"),
      tip: (0, _locale.t)("web-renderer.loadingStyleSetting")
    },
    setter: {
      componentName: "ObjectSetter",
      props: {
        config: {
          items: [{
            name: "backgroundImage",
            title: {
              label: (0, _locale.t)("web-renderer.loadingBackgroundImage"),
              tip: (0, _locale.t)("web-renderer.loadingBackgroundImage")
            },
            setter: "CUploadImageDefaultSetter"
          }, {
            name: "backgroundColor",
            title: {
              label: (0, _locale.t)("web-renderer.loadingBackgroundColor"),
              tip: (0, _locale.t)("web-renderer.loadingBackgroundColor")
            },
            setter: "ColorSetter",
            defaultValue: "#212226"
          }, {
            name: "backgroundSize",
            title: {
              label: (0, _locale.t)("web-renderer.loadingBackgroundSize"),
              tip: (0, _locale.t)("web-renderer.loadingBackgroundSize")
            },
            setter: {
              componentName: "RadioGroupSetter",
              props: {
                options: [{
                  title: (0, _locale.t)("web-renderer.backgroundSizeAuto"),
                  value: ""
                }, {
                  title: (0, _locale.t)("web-renderer.backgroundSizeContain"),
                  value: _formKeyType.BackgroundSize.Contain
                }, {
                  title: (0, _locale.t)("web-renderer.backgroundSizeCover"),
                  value: _formKeyType.BackgroundSize.Cover
                }]
              },
              initialValue: ""
            }
          }, {
            name: "src",
            title: {
              label: (0, _locale.t)("web-renderer.loadingImageSrc"),
              tip: (0, _locale.t)("web-renderer.loadingImageSrcTip")
            },
            setter: "CUploadImageDefaultSetter"
          }, {
            name: "width",
            title: {
              label: (0, _locale.t)("web-renderer.loadingImageWidth") + " (px)",
              tip: (0, _locale.t)("web-renderer.loadingImageWidth")
            },
            setter: {
              componentName: "NumberSetter",
              props: {
                step: 1,
                min: 0
              },
              initialValue: 40
            }
          }, {
            name: "height",
            title: {
              label: (0, _locale.t)("web-renderer.loadingImageHeight") + " (px)",
              tip: (0, _locale.t)("web-renderer.loadingImageHeight")
            },
            setter: {
              componentName: "NumberSetter",
              props: {
                step: 1,
                min: 0
              },
              initialValue: 40
            }
          }]
        }
      }
    }
  }, {
    name: 'componentVisibleSetting',
    title: {
      label: (0, _locale.t)('web-renderer.componentVisibleSetting'),
      tip: (0, _locale.t)('web-renderer.componentVisibleSetting')
    },
    setter: {
      componentName: "ObjectSetter",
      props: {
        config: {
          items: [{
            name: "walletVisible",
            title: {
              label: (0, _locale.t)("web-renderer.walletVisible"),
              tip: (0, _locale.t)("web-renderer.walletVisible")
            },
            defaultValue: true,
            display: 'accordion',
            setter: _setters.CDefaultValueSetter
          }, {
            name: "localeVisible",
            title: {
              label: (0, _locale.t)("web-renderer.localeVisible"),
              tip: (0, _locale.t)("web-renderer.localeVisible")
            },
            defaultValue: true,
            display: 'accordion',
            setter: _setters.CDefaultValueSetter
          }]
        }
      }
    }
  }],
  configure: {
    supports: {
      events: false,
      style: true,
      loop: false,
      condition: false
    }
  }
};
var snippets = [{
  title: (0, _locale.t)("web-renderer.title"),
  screenshot: "https://d3r48att5ocy3q.cloudfront.net/p/240617/26e9930090b64a20a044c4b1f19f9858.jpg",
  schema: {
    componentName: "WebRenderer",
    props: {
      componentKey: "cr_" + (0, _utils.uuid)()
    }
  }
}];
var _default = exports["default"] = (0, _extends2["default"])({}, Meta, {
  snippets: snippets
});