ywana-core8 0.1.10 → 0.1.12
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 +59 -25
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +5 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +59 -25
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +59 -25
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/table.js +2 -3
- package/src/incubator/planner.css +5 -0
- package/src/incubator/planner.js +36 -20
package/dist/index.modern.js
CHANGED
@@ -4227,12 +4227,15 @@ var DataTableFiltersRow = function DataTableFiltersRow(_ref4) {
|
|
4227
4227
|
var id = _ref5.id,
|
4228
4228
|
filterable = _ref5.filterable,
|
4229
4229
|
onFilter = _ref5.onFilter,
|
4230
|
+
_ref5$predictive = _ref5.predictive,
|
4231
|
+
predictive = _ref5$predictive === void 0 ? false : _ref5$predictive,
|
4230
4232
|
options = _ref5.options;
|
4231
4233
|
var value = form[id] ? form[id] : '';
|
4232
4234
|
var field = options ? /*#__PURE__*/React.createElement(DropDown, {
|
4233
4235
|
id: id,
|
4234
4236
|
value: value,
|
4235
4237
|
options: options,
|
4238
|
+
predictive: predictive,
|
4236
4239
|
onChange: function onChange(id, value) {
|
4237
4240
|
return changeFilter(id, value, onFilter);
|
4238
4241
|
},
|
@@ -5933,6 +5936,7 @@ var Planner2 = function Planner2(_ref) {
|
|
5933
5936
|
rowHeaderTitle = _ref.rowHeaderTitle,
|
5934
5937
|
EventRenderer = _ref.EventRenderer,
|
5935
5938
|
onSelectCell = _ref.onSelectCell,
|
5939
|
+
onCellDrop = _ref.onCellDrop,
|
5936
5940
|
_ref$hideEmptyRows = _ref.hideEmptyRows,
|
5937
5941
|
hideEmptyRows = _ref$hideEmptyRows === void 0 ? false : _ref$hideEmptyRows;
|
5938
5942
|
var _useState = useState([]),
|
@@ -5940,6 +5944,9 @@ var Planner2 = function Planner2(_ref) {
|
|
5940
5944
|
setDays = _useState[1];
|
5941
5945
|
var lastDay = new Date(to);
|
5942
5946
|
var today = new Date();
|
5947
|
+
var _useState2 = useState(null),
|
5948
|
+
dragOverCell = _useState2[0],
|
5949
|
+
setDragOverCell = _useState2[1];
|
5943
5950
|
useEffect(function () {
|
5944
5951
|
var day = new Date(from);
|
5945
5952
|
var nextDays = [];
|
@@ -5975,11 +5982,28 @@ var Planner2 = function Planner2(_ref) {
|
|
5975
5982
|
function selectCell(cell) {
|
5976
5983
|
if (onSelectCell) onSelectCell(cell);
|
5977
5984
|
}
|
5978
|
-
function
|
5979
|
-
|
5985
|
+
function onDragOver(event) {
|
5986
|
+
event.preventDefault();
|
5987
|
+
setDragOverCell(event.target.id);
|
5988
|
+
}
|
5989
|
+
function onDragLeave(event) {
|
5990
|
+
event.preventDefault();
|
5991
|
+
setDragOverCell(null);
|
5992
|
+
}
|
5993
|
+
function drop(event, _ref2) {
|
5994
|
+
var lane = _ref2.lane,
|
5995
|
+
date = _ref2.date;
|
5996
|
+
event.preventDefault();
|
5997
|
+
var data = event.dataTransfer.getData("text");
|
5998
|
+
if (onCellDrop) onCellDrop({
|
5999
|
+
data: data,
|
6000
|
+
lane: lane,
|
6001
|
+
date: date
|
6002
|
+
});
|
6003
|
+
setDragOverCell(null);
|
5980
6004
|
}
|
5981
|
-
var uniqueMonths = Array.from(new Set(days.map(function (
|
5982
|
-
var month =
|
6005
|
+
var uniqueMonths = Array.from(new Set(days.map(function (_ref3) {
|
6006
|
+
var month = _ref3.month;
|
5983
6007
|
return month;
|
5984
6008
|
})));
|
5985
6009
|
var monthWidths = uniqueMonths.map(function (month) {
|
@@ -6026,15 +6050,15 @@ var Planner2 = function Planner2(_ref) {
|
|
6026
6050
|
minWidth: rowHeaderWidth + "rem",
|
6027
6051
|
maxWidth: rowHeaderWidth + "rem"
|
6028
6052
|
}
|
6029
|
-
}, rowHeaderTitle), days.map(function (
|
6030
|
-
var day =
|
6031
|
-
weekday =
|
6032
|
-
month =
|
6033
|
-
|
6034
|
-
isToday =
|
6035
|
-
|
6036
|
-
isWeekend =
|
6037
|
-
isInCurrentWeek =
|
6053
|
+
}, rowHeaderTitle), days.map(function (_ref4) {
|
6054
|
+
var day = _ref4.day,
|
6055
|
+
weekday = _ref4.weekday,
|
6056
|
+
month = _ref4.month,
|
6057
|
+
_ref4$isToday = _ref4.isToday,
|
6058
|
+
isToday = _ref4$isToday === void 0 ? false : _ref4$isToday,
|
6059
|
+
_ref4$isWeekend = _ref4.isWeekend,
|
6060
|
+
isWeekend = _ref4$isWeekend === void 0 ? false : _ref4$isWeekend,
|
6061
|
+
isInCurrentWeek = _ref4.isInCurrentWeek;
|
6038
6062
|
var todayClass = isToday ? 'today' : '';
|
6039
6063
|
var weekendClass = isWeekend ? 'weekend' : '';
|
6040
6064
|
var currentWeekClass = isInCurrentWeek ? 'current-week' : '';
|
@@ -6058,10 +6082,10 @@ var Planner2 = function Planner2(_ref) {
|
|
6058
6082
|
if (laneEvents.length === 0) return null;
|
6059
6083
|
|
6060
6084
|
// find days with event for this lane in the period
|
6061
|
-
var daysWithEvents = days.filter(function (
|
6062
|
-
var day =
|
6063
|
-
monthNum =
|
6064
|
-
year =
|
6085
|
+
var daysWithEvents = days.filter(function (_ref5) {
|
6086
|
+
var day = _ref5.day,
|
6087
|
+
monthNum = _ref5.monthNum,
|
6088
|
+
year = _ref5.year;
|
6065
6089
|
return laneEvents.find(function (event) {
|
6066
6090
|
var eventDate = new Date(event.date);
|
6067
6091
|
return eventDate.getDate() === day && eventDate.getMonth() === monthNum - 1 && eventDate.getFullYear() === year;
|
@@ -6072,6 +6096,7 @@ var Planner2 = function Planner2(_ref) {
|
|
6072
6096
|
if (daysWithEvents.length === 0) return null;
|
6073
6097
|
}
|
6074
6098
|
return /*#__PURE__*/React.createElement("div", {
|
6099
|
+
key: "content-row-" + index,
|
6075
6100
|
className: "content-row " + lane.className,
|
6076
6101
|
style: {
|
6077
6102
|
width: totalDaysWidth + "rem"
|
@@ -6082,21 +6107,23 @@ var Planner2 = function Planner2(_ref) {
|
|
6082
6107
|
minWidth: rowHeaderWidth + "rem",
|
6083
6108
|
maxWidth: rowHeaderWidth + "rem"
|
6084
6109
|
}
|
6085
|
-
}, lane.title), days.map(function (
|
6086
|
-
var day =
|
6087
|
-
month =
|
6088
|
-
monthNum =
|
6089
|
-
year =
|
6090
|
-
isWeekend =
|
6110
|
+
}, lane.title), days.map(function (_ref6) {
|
6111
|
+
var day = _ref6.day,
|
6112
|
+
month = _ref6.month,
|
6113
|
+
monthNum = _ref6.monthNum,
|
6114
|
+
year = _ref6.year,
|
6115
|
+
isWeekend = _ref6.isWeekend;
|
6091
6116
|
var dayDate = new Date(year, monthNum - 1, day);
|
6092
6117
|
var dayEvents = laneEvents.filter(function (event) {
|
6093
6118
|
var eventDate = new Date(event.date);
|
6094
6119
|
return eventDate.getDate() === dayDate.getDate() && eventDate.getMonth() === dayDate.getMonth() && eventDate.getFullYear() === dayDate.getFullYear();
|
6095
6120
|
});
|
6096
6121
|
var weekendClass = isWeekend ? 'weekend' : '';
|
6122
|
+
var dragOverStyle = dragOverCell === "cell" + index + "_" + year + "-" + month + "-" + day ? 'drag-over' : '';
|
6097
6123
|
return /*#__PURE__*/React.createElement("div", {
|
6124
|
+
id: "cell" + index + "_" + year + "-" + month + "-" + day,
|
6098
6125
|
key: "content" + index + "_" + year + "-" + month + "-" + day,
|
6099
|
-
className: "content-cell " + weekendClass,
|
6126
|
+
className: "content-cell " + weekendClass + " " + dragOverStyle,
|
6100
6127
|
style: {
|
6101
6128
|
minWidth: dayWidth,
|
6102
6129
|
maxWidth: dayWidth
|
@@ -6107,7 +6134,14 @@ var Planner2 = function Planner2(_ref) {
|
|
6107
6134
|
date: dayDate
|
6108
6135
|
});
|
6109
6136
|
},
|
6110
|
-
|
6137
|
+
onDragOver: onDragOver,
|
6138
|
+
onDragLeave: onDragLeave,
|
6139
|
+
onDrop: function onDrop(event) {
|
6140
|
+
return drop(event, {
|
6141
|
+
lane: lane.id,
|
6142
|
+
date: dayDate
|
6143
|
+
});
|
6144
|
+
}
|
6111
6145
|
}, dayEvents.map(function (event, index) {
|
6112
6146
|
return /*#__PURE__*/React.createElement(EventRenderer, {
|
6113
6147
|
key: event.id + "-" + index,
|