Skip to content
Permalink
Browse files

rebuild package.log.json, dist, esm folder to release

  • Loading branch information...
Ho Kim Cuc Ho Kim Cuc
Ho Kim Cuc authored and Ho Kim Cuc committed Jul 31, 2019
1 parent 306e3d5 commit 177a705e736579d3e3e687c617971591ff25650e

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -12,7 +12,6 @@ declare type DateTimeProps = ControlProps & {
declare class DateTime extends Control {
protected _props: DateTimeProps;
protected element: HTMLElement;
private _textInputsContainer;
private _dateTextInput;
private _timeTextInput;
private _dateErrorDiv;
@@ -24,7 +23,6 @@ declare class DateTime extends Control {
render(): HTMLElement;
rerender(changedAttr: string[]): void;
private _renderContainer;
private _renderTextInputsContainer;
private _renderDateInputErrorLabel;
private _renderDateTextInput;
private _renderTimeTextInput;
@@ -103,7 +103,6 @@ var DateTime = /** @class */ (function (_super) {
else {
this._dateTextInput.value = '';
}
// this._props.onChange && this._props.onChange(this._props.value)
}
if (changedAttr.indexOf('timeTextInput') !== -1) {
this._timeTextInput.value = format(this._time, 'HH:mm');
@@ -137,13 +136,6 @@ var DateTime = /** @class */ (function (_super) {
var container = document.createElement('div');
container.classList.add('date-time-container');
this.element = container;
this._renderTextInputsContainer();
container.appendChild(this._textInputsContainer);
};
DateTime.prototype._renderTextInputsContainer = function () {
var textInputsContainer = document.createElement('div');
textInputsContainer.classList.add('text-input-container');
this._textInputsContainer = textInputsContainer;
};
DateTime.prototype._renderDateInputErrorLabel = function () {
var dateError = document.createElement('div');
@@ -188,9 +180,7 @@ var DateTime = /** @class */ (function (_super) {
_this._calendar.hide();
}
};
//
this._dateTextInput = dateTextInput;
this._textInputsContainer.appendChild(dateTextInput);
};
DateTime.prototype._renderTimeTextInput = function () {
var timeTextInputContainer = document.createElement('div');
@@ -363,32 +353,38 @@ var DateTime = /** @class */ (function (_super) {
this._timeTextInput.setSelectionRange(0, 2);
};
DateTime.prototype._renderDate = function () {
var dateContainer = document.createElement('div');
dateContainer.className = 'date-container';
// render date text input
this._renderDateTextInput();
// render date input error
dateContainer.appendChild(this._dateTextInput);
this._renderDateInputErrorLabel();
this._textInputsContainer.appendChild(this._dateErrorDiv);
dateContainer.appendChild(this._dateErrorDiv);
// render calendar
var calendar = new Calendar({
date: this._props.value,
onClickOutside: this._onClickOutside,
onDateClick: this._onCalendarDateClick,
locale: this._locale
});
this._textInputsContainer.appendChild(calendar.render());
dateContainer.appendChild(calendar.render());
this._calendar = calendar;
this.element.appendChild(dateContainer);
return this.element;
};
DateTime.prototype._renderTime = function () {
var _this = this;
var timeContainer = document.createElement('div');
timeContainer.className = 'time-container';
// render time text input
this._renderTimeTextInput();
this._textInputsContainer.appendChild(this._timeTextInput);
timeContainer.appendChild(this._timeTextInput);
// render time picker
var timePicker = new TimePicker({ onTimeClick: function (date) { return _this._onTimeClick(date); } });
this._timePicker = timePicker;
this._textInputsContainer.appendChild(timePicker.render());
//
timeContainer.appendChild(timePicker.render());
this.element.appendChild(timeContainer);
return this.element;
};
DateTime.prototype._renderDateTime = function () {
@@ -54,15 +54,15 @@ var Table = /** @class */ (function (_super) {
}
};
Table.prototype._renderCells = function () {
var _this = this;
var table = this._props;
var rowsEl = [].slice.call(this.element.querySelectorAll('.kuc-table-tbody > .kuc-table-tr'));
var columns = [].slice.call(this._props.columns);
for (var _i = 0, _a = rowsEl.entries(); _i < _a.length; _i++) {
var _b = _a[_i], rowIndex = _b[0], rowEl = _b[1];
var rowData = this._props.data[rowIndex];
var updateRowData = this.updateRowData.bind(this, rowIndex);
for (var _c = 0, _d = columns.entries(); _c < _d.length; _c++) {
var _e = _d[_c], columnIndex = _e[0], cell = _e[1].cell;
rowsEl.forEach(function (rowEl, rowIndex) {
var rowData = _this._props.data[rowIndex];
var updateRowData = _this.updateRowData.bind(_this, rowIndex);
columns.forEach(function (_a, columnIndex) {
var cell = _a.cell;
var cellTemplate = cell;
if (cellTemplate) {
var cellElement = rowEl.childNodes[columnIndex];
@@ -77,14 +77,16 @@ var Table = /** @class */ (function (_super) {
columnIndex: columnIndex,
updateRowData: updateRowData
});
cellElement.appendChild(element);
if (element) {
cellElement.appendChild(element);
}
cellElement['__tableCellInstance'] = cellInstance;
}
cellInstance = cellElement['__tableCellInstance'];
cellInstance.update({ table: table, rowData: rowData, rowIndex: rowIndex, columnIndex: columnIndex, element: element });
}
}
}
});
});
};
Table.prototype._isObject = function (item) {
return (item && typeof item === 'object' && !Array.isArray(item));
@@ -5,6 +5,7 @@ declare type TextProps = ControlProps & {
};
declare class Text extends Control {
protected _props: TextProps;
private _onChange;
constructor(params: TextProps);
render(): HTMLElement;
rerender(changedAttr?: string[]): void;
@@ -8,6 +8,7 @@ var Text = /** @class */ (function (_super) {
_this._props = tslib_1.__assign({}, _this._props, {
value: ''
});
_this._onChange = function () { };
if (typeof params === 'object' && params !== null && typeof params.isDisabled !== 'boolean') {
delete params.isDisabled;
}
@@ -20,6 +21,10 @@ var Text = /** @class */ (function (_super) {
if (_this._props.value) {
_this.element.value = _this._props.value;
}
_this.element.onchange = function (e) {
_this._props.value = e.target.value;
_this._onChange(e);
};
return _this;
}
Text.prototype.render = function () {
@@ -42,6 +47,10 @@ var Text = /** @class */ (function (_super) {
};
Text.prototype.on = function (eventName, callback) {
var _this = this;
if (eventName === 'change') {
this._onChange = callback;
return;
}
this.element.addEventListener(eventName, function (e) {
if (_this._props.isDisabled)
return;
@@ -61,7 +61,7 @@ var TextArea = /** @class */ (function (_super) {
if (!changedAttr)
return;
if (changedAttr.indexOf('value') !== -1) {
this.textAreaEl.innerText = this._props.value;
this.textAreaEl.value = this._props.value;
}
if (changedAttr.indexOf('isDisabled') !== -1) {
if (this._props.isDisabled) {
@@ -3,9 +3,7 @@ export default function HueSpectrum(props) {
var w = props.width;
var h = props.height;
var container = useRef(null);
// const container = createRef<HTMLDivElement>();
var hueCanvas = useRef(null);
// const hueCanvas = createRef<HTMLCanvasElement>();
var _a = useState(false), hasInitLayout = _a[0], setHasInitLayout = _a[1];
var _b = useState(false), isMouseDown = _b[0], setIsMouseDown = _b[1];
var _c = useState(), containerEl = _c[0], setContainerEl = _c[1];
@@ -51,19 +49,20 @@ export default function HueSpectrum(props) {
}
function handleMouseUp(e) {
triggerSelect(e.clientY);
initContainerEl();
setIsMouseDown(false);
}
function handleMouseMove(e) {
if (isMouseDown) {
triggerSelect(e.clientY);
initContainerEl();
}
}
function handleMouseLeave() {
setIsMouseDown(false);
}
useEffect(function () {
initLayout();
initContainerEl();
});
return (React.createElement("div", { ref: container },
React.createElement("canvas", { ref: hueCanvas, width: w, height: h, style: { cursor: "crosshair" }, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave })));
@@ -48,19 +48,20 @@ export default function SaturationSpectrum(props) {
}
function handleMouseUp(e) {
triggerSelect(e.clientX, e.clientY);
initContainerEl();
setIsMouseDown(false);
}
function handleMouseMove(e) {
if (isMouseDown) {
triggerSelect(e.clientX, e.clientY);
initContainerEl();
}
}
function handleMouseLeave() {
setIsMouseDown(false);
}
useEffect(function () {
fillSatSpectrumCanvas();
initContainerEl();
});
return (React.createElement("div", { ref: container },
React.createElement("canvas", { ref: satCanvas, width: w, height: h, style: { cursor: "crosshair" }, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseMove: handleMouseMove, onMouseLeave: handleMouseLeave })));
@@ -77,11 +77,13 @@ function ColorPicker(props) {
onChange: handlePickerChange,
onCancel: function () {
setPickerDisplay(false);
setFocus(false);
setHexString(props.color || "#FF0000");
props.onChange && props.onChange(props.color || "#FF0000");
},
onSubmit: function (newHexString) {
setPickerDisplay(false);
setFocus(false);
setHexString(newHexString);
props.onChange && props.onChange(newHexString);
},
@@ -8,14 +8,15 @@ import TimePicker from './components/TimePicker';
import '../../css/font.css';
var DateTime = function (_a) {
var _b = _a.value, value = _b === void 0 ? new Date() : _b, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isVisible, isVisible = _d === void 0 ? true : _d, _e = _a.onChange, onChange = _e === void 0 ? function (newDate) { } : _e, _f = _a.locale, locale = _f === void 0 ? 'ja' : _f, _g = _a.dateFormat, dateFormat = _g === void 0 ? 'MM/dd/YYYY' : _g, _h = _a.type, type = _h === void 0 ? 'datetime' : _h, _j = _a.timeFormat, timeFormat = _j === void 0 ? 'HH:mm' : _j;
var _k = useState('none'), pickerDisplay = _k[0], setPickerDisplay = _k[1];
var _l = useState(false), showPickerError = _l[0], setShowPickerError = _l[1];
var _m = useState(''), dateError = _m[0], setDateError = _m[1];
var _o = useState('none'), timePickerDisplay = _o[0], setTimePickerDisplay = _o[1];
var _p = useState(format(value, dateFormat)), inputValue = _p[0], setInputValue = _p[1];
var _q = useState(format(value, timeFormat)), timeValue = _q[0], setTimeValue = _q[1];
var _r = useState(true), hasSelection = _r[0], setHasSelection = _r[1];
var _s = useState(new Date(value)), timeDateValue = _s[0], setTimeDateValue = _s[1];
var _k = useState(value), defaultValue = _k[0], setDefaultValue = _k[1];
var _l = useState('none'), pickerDisplay = _l[0], setPickerDisplay = _l[1];
var _m = useState(false), showPickerError = _m[0], setShowPickerError = _m[1];
var _o = useState(''), dateError = _o[0], setDateError = _o[1];
var _p = useState('none'), timePickerDisplay = _p[0], setTimePickerDisplay = _p[1];
var _q = useState(format(value, dateFormat)), inputValue = _q[0], setInputValue = _q[1];
var _r = useState(format(value, timeFormat)), timeValue = _r[0], setTimeValue = _r[1];
var _s = useState(true), hasSelection = _s[0], setHasSelection = _s[1];
var _t = useState(new Date(value)), timeDateValue = _t[0], setTimeDateValue = _t[1];
var wrapperRef = createRef();
var calendarRef = createRef();
var timeRef = createRef();
@@ -99,6 +100,12 @@ var DateTime = function (_a) {
}
};
useEffect(function () {
if (defaultValue !== value) {
setDefaultValue(value);
setInputValue(format(value, dateFormat));
setTimeValue(format(value, timeFormat));
setTimeDateValue(new Date(value));
}
var newTimeDateValue = new Date(timeDateValue);
var setNewTimeDateValue = false;
if (value.getDate() !== timeDateValue.getDate()) {

0 comments on commit 177a705

Please sign in to comment.
You can’t perform that action at this time.