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.
package/dist/index.cjs CHANGED
@@ -308,40 +308,6 @@ var AccordionSection = function AccordionSection(props) {
308
308
  })), open ? /*#__PURE__*/React__default["default"].createElement("main", null, children) : '');
309
309
  };
310
310
 
311
- /**
312
- * HTML Button
313
- */
314
-
315
- var Button = function Button(_ref) {
316
- var label = _ref.label,
317
- icon = _ref.icon,
318
- action = _ref.action,
319
- _ref$disabled = _ref.disabled,
320
- disabled = _ref$disabled === void 0 ? false : _ref$disabled,
321
- outlined = _ref.outlined,
322
- raised = _ref.raised;
323
-
324
- function click(event) {
325
- if (!disabled) {
326
- event.stopPropagation();
327
- event.preventDefault();
328
- if (action) action();
329
- }
330
- }
331
-
332
- var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
333
- if (disabled) style = style + " disabled";
334
- return /*#__PURE__*/React__default["default"].createElement("button", {
335
- className: "btn " + style,
336
- onClick: click
337
- }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
338
- icon: icon,
339
- size: "small",
340
- clickable: true,
341
- action: click
342
- }) : null, /*#__PURE__*/React__default["default"].createElement("span", null, label));
343
- };
344
-
345
311
  /**
346
312
  * Site Context
347
313
  */
@@ -390,6 +356,40 @@ var Text = function Text(_ref) {
390
356
  }, value) : '';
391
357
  };
392
358
 
359
+ /**
360
+ * HTML Button
361
+ */
362
+
363
+ var Button = function Button(_ref) {
364
+ var label = _ref.label,
365
+ icon = _ref.icon,
366
+ action = _ref.action,
367
+ _ref$disabled = _ref.disabled,
368
+ disabled = _ref$disabled === void 0 ? false : _ref$disabled,
369
+ outlined = _ref.outlined,
370
+ raised = _ref.raised;
371
+
372
+ function click(event) {
373
+ if (!disabled) {
374
+ event.stopPropagation();
375
+ event.preventDefault();
376
+ if (action) action();
377
+ }
378
+ }
379
+
380
+ var style = raised ? 'raised' : outlined ? 'outlined' : 'normal';
381
+ if (disabled) style = style + " disabled";
382
+ return /*#__PURE__*/React__default["default"].createElement("button", {
383
+ className: "btn " + style,
384
+ onClick: click
385
+ }, icon ? /*#__PURE__*/React__default["default"].createElement(Icon, {
386
+ icon: icon,
387
+ size: "small",
388
+ clickable: true,
389
+ action: click
390
+ }) : null, /*#__PURE__*/React__default["default"].createElement(Text, null, label));
391
+ };
392
+
393
393
  /**
394
394
  * CheckBox
395
395
  */
@@ -5947,7 +5947,6 @@ var CollectionTree = function CollectionTree(props) {
5947
5947
  }
5948
5948
 
5949
5949
  function group(items, by) {
5950
- console.log(schema, items, by);
5951
5950
  var options = schema[by] ? schema[by].options : null;
5952
5951
  return items.reduce(function (nodes, field) {
5953
5952
  var node = nodes.find(function (n) {
@@ -5955,13 +5954,21 @@ var CollectionTree = function CollectionTree(props) {
5955
5954
  });
5956
5955
 
5957
5956
  if (!node) {
5958
- var name = options ? options.find(function (option) {
5959
- return option.value === field[by];
5960
- }) : field[by];
5957
+ var name = field[by];
5958
+ var title = field[by];
5959
+
5960
+ if (options) {
5961
+ var opt = options.find(function (option) {
5962
+ return option.value === field[by];
5963
+ });
5964
+ if (opt) title = opt.label;
5965
+ }
5966
+
5961
5967
  node = {
5962
5968
  name: name,
5963
5969
  items: [],
5964
- field: by
5970
+ field: by,
5971
+ title: title
5965
5972
  };
5966
5973
  nodes.push(node);
5967
5974
  }
@@ -5982,7 +5989,7 @@ var CollectionTree = function CollectionTree(props) {
5982
5989
 
5983
5990
  function renderNodes(nodes) {
5984
5991
  return nodes.map(function (node) {
5985
- var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.name;
5992
+ var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.title;
5986
5993
  return /*#__PURE__*/React__default["default"].createElement(TreeNode, {
5987
5994
  key: node.name,
5988
5995
  icon: null,