ywana-core8 0.0.618 → 0.0.621

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.
@@ -300,40 +300,6 @@ var AccordionSection = function AccordionSection(props) {
300
300
  })), open ? /*#__PURE__*/React.createElement("main", null, children) : '');
301
301
  };
302
302
 
303
- /**
304
- * HTML Button
305
- */
306
-
307
- var Button = function Button(_ref) {
308
- var label = _ref.label,
309
- icon = _ref.icon,
310
- action = _ref.action,
311
- _ref$disabled = _ref.disabled,
312
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
313
- outlined = _ref.outlined,
314
- raised = _ref.raised;
315
-
316
- function click(event) {
317
- if (!disabled) {
318
- event.stopPropagation();
319
- event.preventDefault();
320
- if (action) action();
321
- }
322
- }
323
-
324
- var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
325
- if (disabled) style = style + " disabled";
326
- return /*#__PURE__*/React.createElement("button", {
327
- className: "btn " + style,
328
- onClick: click
329
- }, icon ? /*#__PURE__*/React.createElement(Icon, {
330
- icon: icon,
331
- size: "small",
332
- clickable: true,
333
- action: click
334
- }) : null, /*#__PURE__*/React.createElement("span", null, label));
335
- };
336
-
337
303
  /**
338
304
  * Site Context
339
305
  */
@@ -382,6 +348,40 @@ var Text = function Text(_ref) {
382
348
  }, value) : '';
383
349
  };
384
350
 
351
+ /**
352
+ * HTML Button
353
+ */
354
+
355
+ var Button = function Button(_ref) {
356
+ var label = _ref.label,
357
+ icon = _ref.icon,
358
+ action = _ref.action,
359
+ _ref$disabled = _ref.disabled,
360
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
361
+ outlined = _ref.outlined,
362
+ raised = _ref.raised;
363
+
364
+ function click(event) {
365
+ if (!disabled) {
366
+ event.stopPropagation();
367
+ event.preventDefault();
368
+ if (action) action();
369
+ }
370
+ }
371
+
372
+ var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
373
+ if (disabled) style = style + " disabled";
374
+ return /*#__PURE__*/React.createElement("button", {
375
+ className: "btn " + style,
376
+ onClick: click
377
+ }, icon ? /*#__PURE__*/React.createElement(Icon, {
378
+ icon: icon,
379
+ size: "small",
380
+ clickable: true,
381
+ action: click
382
+ }) : null, /*#__PURE__*/React.createElement(Text, null, label));
383
+ };
384
+
385
385
  /**
386
386
  * CheckBox
387
387
  */
@@ -5939,7 +5939,6 @@ var CollectionTree = function CollectionTree(props) {
5939
5939
  }
5940
5940
 
5941
5941
  function group(items, by) {
5942
- console.log(schema, items, by);
5943
5942
  var options = schema[by] ? schema[by].options : null;
5944
5943
  return items.reduce(function (nodes, field) {
5945
5944
  var node = nodes.find(function (n) {
@@ -5947,13 +5946,21 @@ var CollectionTree = function CollectionTree(props) {
5947
5946
  });
5948
5947
 
5949
5948
  if (!node) {
5950
- var name = options ? options.find(function (option) {
5951
- return option.value === field[by];
5952
- }) : field[by];
5949
+ var name = field[by];
5950
+ var title = field[by];
5951
+
5952
+ if (options) {
5953
+ var opt = options.find(function (option) {
5954
+ return option.value === field[by];
5955
+ });
5956
+ if (opt) title = opt.label;
5957
+ }
5958
+
5953
5959
  node = {
5954
5960
  name: name,
5955
5961
  items: [],
5956
- field: by
5962
+ field: by,
5963
+ title: title
5957
5964
  };
5958
5965
  nodes.push(node);
5959
5966
  }
@@ -5974,7 +5981,7 @@ var CollectionTree = function CollectionTree(props) {
5974
5981
 
5975
5982
  function renderNodes(nodes) {
5976
5983
  return nodes.map(function (node) {
5977
- var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.name;
5984
+ var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.title;
5978
5985
  return /*#__PURE__*/React.createElement(TreeNode, {
5979
5986
  key: node.name,
5980
5987
  icon: null,