ywana-core8 0.0.859 → 0.0.861

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.umd.js CHANGED
@@ -972,7 +972,7 @@
972
972
  setOpen(open);
973
973
  }, [open]);
974
974
  var toggle = function toggle() {
975
- setOpen(!open);
975
+ setOpen(!isOpen);
976
976
  };
977
977
  return /*#__PURE__*/React__default["default"].createElement("section", {
978
978
  className: "section " + className
@@ -1265,7 +1265,7 @@
1265
1265
  * Text Field
1266
1266
  */
1267
1267
  var TextField = function TextField(props) {
1268
- var site = React.useContext(SiteContext);
1268
+ React.useContext(SiteContext);
1269
1269
  var id = props.id,
1270
1270
  _props$type = props.type,
1271
1271
  type = _props$type === void 0 ? 'text' : _props$type,
@@ -1282,6 +1282,7 @@
1282
1282
  onChange = props.onChange,
1283
1283
  onEnter = props.onEnter,
1284
1284
  onClick = props.onClick,
1285
+ onFocus = props.onFocus,
1285
1286
  onBlur = props.onBlur;
1286
1287
  function onKeyPress(event) {
1287
1288
  var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
@@ -1296,13 +1297,7 @@
1296
1297
  if (onChange) onChange(id, value);
1297
1298
  }
1298
1299
  function focus() {
1299
- if (site && site.changeFocus) {
1300
- site.changeFocus({
1301
- lose: function lose() {
1302
- // DO NOTHING
1303
- }
1304
- });
1305
- }
1300
+ if (onFocus) onFocus();
1306
1301
  }
1307
1302
  function blur() {
1308
1303
  if (onBlur) onBlur();
@@ -2008,6 +2003,16 @@
2008
2003
  day: 'second'
2009
2004
  });
2010
2005
  break;
2006
+ case FORMATS$1.DATETIME:
2007
+ text = new Date(text).toLocaleString(locale, {
2008
+ year: 'numeric',
2009
+ month: 'numeric',
2010
+ day: 'numeric',
2011
+ hour: 'numeric',
2012
+ minute: 'numeric',
2013
+ second: 'numeric'
2014
+ });
2015
+ break;
2011
2016
  }
2012
2017
  }
2013
2018
  return /*#__PURE__*/React__default["default"].createElement("td", {
@@ -2388,6 +2393,21 @@
2388
2393
  className: "react-switch"
2389
2394
  }));
2390
2395
  };
2396
+ var Switch2 = function Switch2(props) {
2397
+ var checked = props.checked,
2398
+ onChange = props.onChange;
2399
+ function toggle() {
2400
+ onChange(!checked);
2401
+ }
2402
+ var icon = checked ? "toggle_on" : "toggle_off";
2403
+ return /*#__PURE__*/React__default["default"].createElement("div", {
2404
+ className: "switch"
2405
+ }, /*#__PURE__*/React__default["default"].createElement(Icon, {
2406
+ icon: icon,
2407
+ clickable: true,
2408
+ action: toggle
2409
+ }));
2410
+ };
2391
2411
 
2392
2412
  /**
2393
2413
  * Thumbnail
@@ -3691,23 +3711,11 @@
3691
3711
  var _useState12 = React.useState(),
3692
3712
  breadcrumb = _useState12[0],
3693
3713
  setBreadcrumb = _useState12[1];
3694
- var _useState13 = React.useState(),
3695
- focused = _useState13[0],
3696
- setFocused = _useState13[1];
3697
3714
  var value = {
3698
3715
  lang: lang,
3699
3716
  setLang: setLang,
3700
3717
  dictionary: dictionary,
3701
3718
  setDictionary: setDictionary,
3702
- focused: focused,
3703
- changeFocus: function changeFocus(next) {
3704
- if (focused) focused.lose();
3705
- setFocused(next);
3706
- },
3707
- clearFocus: function clearFocus() {
3708
- if (focused) focused.lose();
3709
- setFocused(null);
3710
- },
3711
3719
  sideNav: sideNav,
3712
3720
  setSideNav: setSideNav,
3713
3721
  showNav: showNav,
@@ -10461,6 +10469,7 @@
10461
10469
  DATE: 'date',
10462
10470
  DATERANGE: 'DATERANGE',
10463
10471
  TIME: 'time',
10472
+ DATETIME: 'datetime',
10464
10473
  EMAIL: 'email',
10465
10474
  HTML: 'HTML',
10466
10475
  URL: 'URL',
@@ -10498,7 +10507,7 @@
10498
10507
  var id = field.id;
10499
10508
  var value = values[id] || field["default"];
10500
10509
  return /*#__PURE__*/React__default["default"].createElement(DynamicFormField, {
10501
- key: id + "_" + value,
10510
+ key: id,
10502
10511
  field: field,
10503
10512
  value: value,
10504
10513
  onChange: change
@@ -10879,6 +10888,7 @@
10879
10888
  exports.SiteProvider = SiteProvider;
10880
10889
  exports.Stack = Stack;
10881
10890
  exports.Switch = Switch;
10891
+ exports.Switch2 = Switch2;
10882
10892
  exports.TASK_STATES = TASK_STATES;
10883
10893
  exports.TEXTFORMATS = TEXTFORMATS;
10884
10894
  exports.TYPES = TYPES$1;