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.cjs CHANGED
@@ -979,7 +979,7 @@ var Section = function Section(props) {
979
979
  setOpen(open);
980
980
  }, [open]);
981
981
  var toggle = function toggle() {
982
- setOpen(!open);
982
+ setOpen(!isOpen);
983
983
  };
984
984
  return /*#__PURE__*/React__default["default"].createElement("section", {
985
985
  className: "section " + className
@@ -1272,7 +1272,7 @@ var Content = /*#__PURE__*/function () {
1272
1272
  * Text Field
1273
1273
  */
1274
1274
  var TextField = function TextField(props) {
1275
- var site = React.useContext(SiteContext);
1275
+ React.useContext(SiteContext);
1276
1276
  var id = props.id,
1277
1277
  _props$type = props.type,
1278
1278
  type = _props$type === void 0 ? 'text' : _props$type,
@@ -1289,6 +1289,7 @@ var TextField = function TextField(props) {
1289
1289
  onChange = props.onChange,
1290
1290
  onEnter = props.onEnter,
1291
1291
  onClick = props.onClick,
1292
+ onFocus = props.onFocus,
1292
1293
  onBlur = props.onBlur;
1293
1294
  function onKeyPress(event) {
1294
1295
  var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
@@ -1303,13 +1304,7 @@ var TextField = function TextField(props) {
1303
1304
  if (onChange) onChange(id, value);
1304
1305
  }
1305
1306
  function focus() {
1306
- if (site && site.changeFocus) {
1307
- site.changeFocus({
1308
- lose: function lose() {
1309
- // DO NOTHING
1310
- }
1311
- });
1312
- }
1307
+ if (onFocus) onFocus();
1313
1308
  }
1314
1309
  function blur() {
1315
1310
  if (onBlur) onBlur();
@@ -2015,6 +2010,16 @@ var EntityCellViewer = function EntityCellViewer(_ref5) {
2015
2010
  day: 'second'
2016
2011
  });
2017
2012
  break;
2013
+ case FORMATS$1.DATETIME:
2014
+ text = new Date(text).toLocaleString(locale, {
2015
+ year: 'numeric',
2016
+ month: 'numeric',
2017
+ day: 'numeric',
2018
+ hour: 'numeric',
2019
+ minute: 'numeric',
2020
+ second: 'numeric'
2021
+ });
2022
+ break;
2018
2023
  }
2019
2024
  }
2020
2025
  return /*#__PURE__*/React__default["default"].createElement("td", {
@@ -2395,6 +2400,21 @@ var Switch = function Switch(props) {
2395
2400
  className: "react-switch"
2396
2401
  }));
2397
2402
  };
2403
+ var Switch2 = function Switch2(props) {
2404
+ var checked = props.checked,
2405
+ onChange = props.onChange;
2406
+ function toggle() {
2407
+ onChange(!checked);
2408
+ }
2409
+ var icon = checked ? "toggle_on" : "toggle_off";
2410
+ return /*#__PURE__*/React__default["default"].createElement("div", {
2411
+ className: "switch"
2412
+ }, /*#__PURE__*/React__default["default"].createElement(Icon, {
2413
+ icon: icon,
2414
+ clickable: true,
2415
+ action: toggle
2416
+ }));
2417
+ };
2398
2418
 
2399
2419
  /**
2400
2420
  * Thumbnail
@@ -3698,23 +3718,11 @@ var SiteProvider = function SiteProvider(_ref) {
3698
3718
  var _useState12 = React.useState(),
3699
3719
  breadcrumb = _useState12[0],
3700
3720
  setBreadcrumb = _useState12[1];
3701
- var _useState13 = React.useState(),
3702
- focused = _useState13[0],
3703
- setFocused = _useState13[1];
3704
3721
  var value = {
3705
3722
  lang: lang,
3706
3723
  setLang: setLang,
3707
3724
  dictionary: dictionary,
3708
3725
  setDictionary: setDictionary,
3709
- focused: focused,
3710
- changeFocus: function changeFocus(next) {
3711
- if (focused) focused.lose();
3712
- setFocused(next);
3713
- },
3714
- clearFocus: function clearFocus() {
3715
- if (focused) focused.lose();
3716
- setFocused(null);
3717
- },
3718
3726
  sideNav: sideNav,
3719
3727
  setSideNav: setSideNav,
3720
3728
  showNav: showNav,
@@ -10468,6 +10476,7 @@ var FORMATS = {
10468
10476
  DATE: 'date',
10469
10477
  DATERANGE: 'DATERANGE',
10470
10478
  TIME: 'time',
10479
+ DATETIME: 'datetime',
10471
10480
  EMAIL: 'email',
10472
10481
  HTML: 'HTML',
10473
10482
  URL: 'URL',
@@ -10505,7 +10514,7 @@ var DynamicForm = function DynamicForm(props) {
10505
10514
  var id = field.id;
10506
10515
  var value = values[id] || field["default"];
10507
10516
  return /*#__PURE__*/React__default["default"].createElement(DynamicFormField, {
10508
- key: id + "_" + value,
10517
+ key: id,
10509
10518
  field: field,
10510
10519
  value: value,
10511
10520
  onChange: change
@@ -10886,6 +10895,7 @@ exports.SiteContext = SiteContext;
10886
10895
  exports.SiteProvider = SiteProvider;
10887
10896
  exports.Stack = Stack;
10888
10897
  exports.Switch = Switch;
10898
+ exports.Switch2 = Switch2;
10889
10899
  exports.TASK_STATES = TASK_STATES;
10890
10900
  exports.TEXTFORMATS = TEXTFORMATS;
10891
10901
  exports.TYPES = TYPES$1;