").addClass(SCROLLABLE_WRAPPER_CLASS);
var $content = this._$content = (0, _renderer2.default)("
").addClass(SCROLLABLE_CONTENT_CLASS);
if (_dom_adapter2.default.hasDocumentProperty("onbeforeactivate") && _browser2.default.msie && _browser2.default.version < 12) {
_events_engine2.default.on($element, _utils2.default.addNamespace("beforeactivate", SCROLLABLE), function(e) {
if (!(0, _renderer2.default)(e.target).is(_selectors2.default.focusable)) {
e.preventDefault()
}
})
}
$content.append($element.contents()).appendTo($container);
$container.appendTo($wrapper);
$wrapper.appendTo($element)
},
_dimensionChanged: function() {
this.update()
},
_attachNativeScrollbarsCustomizationCss: function() {
if ("desktop" === _devices2.default.real().deviceType && !(_window2.default.getNavigator().platform.indexOf("Mac") > -1 && _browser2.default.webkit)) {
this.$element().addClass(SCROLLABLE_CUSTOMIZABLE_SCROLLBARS_CLASS)
}
},
_initMarkup: function() {
this.callBase();
this._renderDirection()
},
_render: function() {
this._renderStrategy();
this._attachNativeScrollbarsCustomizationCss();
this._attachEventHandlers();
this._renderDisabledState();
this._createActions();
this.update();
this.callBase();
this._updateRtlPosition()
},
_updateRtlPosition: function() {
var _this = this;
this._updateBounds();
if (this.option("rtlEnabled") && this.option("direction") !== VERTICAL) {
_common2.default.deferUpdate(function() {
var containerElement = _this._container().get(0);
var maxLeftOffset = containerElement.scrollWidth - containerElement.clientWidth;
_common2.default.deferRender(function() {
_this.scrollTo({
left: maxLeftOffset
})
})
})
}
},
_updateBounds: function() {
this._strategy.updateBounds()
},
_attachEventHandlers: function() {
var strategy = this._strategy;
var initEventData = {
getDirection: strategy.getDirection.bind(strategy),
validate: this._validate.bind(this),
isNative: this.option("useNative"),
scrollTarget: this._$container
};
_events_engine2.default.off(this._$wrapper, "." + SCROLLABLE);
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.init, SCROLLABLE), initEventData, this._initHandler.bind(this));
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.start, SCROLLABLE), strategy.handleStart.bind(strategy));
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.move, SCROLLABLE), strategy.handleMove.bind(strategy));
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.end, SCROLLABLE), strategy.handleEnd.bind(strategy));
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.cancel, SCROLLABLE), strategy.handleCancel.bind(strategy));
_events_engine2.default.on(this._$wrapper, _utils2.default.addNamespace(_uiEventsEmitterGesture2.default.stop, SCROLLABLE), strategy.handleStop.bind(strategy));
_events_engine2.default.off(this._$container, "." + SCROLLABLE);
_events_engine2.default.on(this._$container, _utils2.default.addNamespace("scroll", SCROLLABLE), strategy.handleScroll.bind(strategy))
},
_validate: function(e) {
if (this._isLocked()) {
return false
}
this._updateIfNeed();
return this._strategy.validate(e)
},
_initHandler: function() {
var strategy = this._strategy;
strategy.handleInit.apply(strategy, arguments)
},
_renderDisabledState: function() {
this.$element().toggleClass(SCROLLABLE_DISABLED_CLASS, this.option("disabled"));
if (this.option("disabled")) {
this._lock()
} else {
this._unlock()
}
},
_renderDirection: function() {
this.$element().removeClass("dx-scrollable-" + HORIZONTAL).removeClass("dx-scrollable-" + VERTICAL).removeClass("dx-scrollable-" + BOTH).addClass("dx-scrollable-" + this.option("direction"))
},
_renderStrategy: function() {
this._createStrategy();
this._strategy.render();
this.$element().data(SCROLLABLE_STRATEGY, this._strategy)
},
_createStrategy: function() {
this._strategy = this.option("useNative") ? new _uiScrollable4.default(this) : new _uiScrollable2.default.SimulatedStrategy(this)
},
_createActions: function() {
this._strategy && this._strategy.createActions()
},
_clean: function() {
this._strategy && this._strategy.dispose()
},
_optionChanged: function(args) {
switch (args.name) {
case "onStart":
case "onEnd":
case "onStop":
case "onUpdated":
case "onScroll":
case "onBounce":
this._createActions();
break;
case "direction":
this._resetInactiveDirection();
this._invalidate();
break;
case "useNative":
this._setUseSimulatedScrollbar();
this._invalidate();
break;
case "inertiaEnabled":
case "scrollByContent":
case "scrollByThumb":
case "bounceEnabled":
case "useKeyboard":
case "showScrollbar":
case "useSimulatedScrollbar":
case "pushBackValue":
this._invalidate();
break;
case "disabled":
this._renderDisabledState();
this._strategy && this._strategy.disabledChanged();
break;
case "updateManually":
break;
case "width":
this.callBase(args);
this._updateRtlPosition();
break;
default:
this.callBase(args)
}
},
_resetInactiveDirection: function() {
var inactiveProp = this._getInactiveProp();
if (!inactiveProp || !_window2.default.hasWindow()) {
return
}
var scrollOffset = this.scrollOffset();
scrollOffset[inactiveProp] = 0;
this.scrollTo(scrollOffset)
},
_getInactiveProp: function() {
var direction = this.option("direction");
if (direction === VERTICAL) {
return "left"
}
if (direction === HORIZONTAL) {
return "top"
}
},
_location: function() {
return this._strategy.location()
},
_normalizeLocation: function(location) {
if (_type2.default.isPlainObject(location)) {
var left = _common2.default.ensureDefined(location.left, location.x);
var top = _common2.default.ensureDefined(location.top, location.y);
return {
left: _type2.default.isDefined(left) ? -left : void 0,
top: _type2.default.isDefined(top) ? -top : void 0
}
} else {
var direction = this.option("direction");
return {
left: direction !== VERTICAL ? -location : void 0,
top: direction !== HORIZONTAL ? -location : void 0
}
}
},
_isLocked: function() {
return this._locked
},
_lock: function() {
this._locked = true
},
_unlock: function() {
if (!this.option("disabled")) {
this._locked = false
}
},
_isDirection: function(direction) {
var current = this.option("direction");
if (direction === VERTICAL) {
return current !== HORIZONTAL
}
if (direction === HORIZONTAL) {
return current !== VERTICAL
}
return current === direction
},
_updateAllowedDirection: function() {
var allowedDirections = this._strategy._allowedDirections();
if (this._isDirection(BOTH) && allowedDirections.vertical && allowedDirections.horizontal) {
this._allowedDirectionValue = BOTH
} else {
if (this._isDirection(HORIZONTAL) && allowedDirections.horizontal) {
this._allowedDirectionValue = HORIZONTAL
} else {
if (this._isDirection(VERTICAL) && allowedDirections.vertical) {
this._allowedDirectionValue = VERTICAL
} else {
this._allowedDirectionValue = null
}
}
}
},
_allowedDirection: function() {
return this._allowedDirectionValue
},
_container: function() {
return this._$container
},
$content: function() {
return this._$content
},
content: function() {
return (0, _dom.getPublicElement)(this._$content)
},
scrollOffset: function() {
var location = this._location();
return {
top: -location.top,
left: -location.left
}
},
scrollTop: function() {
return this.scrollOffset().top
},
scrollLeft: function() {
return this.scrollOffset().left
},
clientHeight: function() {
return this._$container.height()
},
scrollHeight: function() {
return this.$content().outerHeight() - 2 * this._strategy.verticalOffset()
},
clientWidth: function() {
return this._$container.width()
},
scrollWidth: function() {
return this.$content().outerWidth()
},
update: function() {
if (!this._strategy) {
return
}
return (0, _deferred.when)(this._strategy.update()).done(function() {
this._updateAllowedDirection()
}.bind(this))
},
scrollBy: function(distance) {
distance = this._normalizeLocation(distance);
if (!distance.top && !distance.left) {
return
}
this._updateIfNeed();
this._strategy.scrollBy(distance)
},
scrollTo: function(targetLocation) {
targetLocation = this._normalizeLocation(targetLocation);
this._updateIfNeed();
var location = this._location();
if (!this.option("useNative")) {
targetLocation = this._strategy._applyScaleRatio(targetLocation);
location = this._strategy._applyScaleRatio(location)
}
var distance = this._normalizeLocation({
left: location.left - _common2.default.ensureDefined(targetLocation.left, location.left),
top: location.top - _common2.default.ensureDefined(targetLocation.top, location.top)
});
if (!distance.top && !distance.left) {
return
}
this._strategy.scrollBy(distance)
},
scrollToElement: function(element, offset) {
offset = offset || {};
var $element = (0, _renderer2.default)(element);
var elementInsideContent = this.$content().find(element).length;
var elementIsInsideContent = $element.parents("." + SCROLLABLE_CLASS).length - $element.parents("." + SCROLLABLE_CONTENT_CLASS).length === 0;
if (!elementInsideContent || !elementIsInsideContent) {
return
}
var scrollPosition = {
top: 0,
left: 0
};
var direction = this.option("direction");
if (direction !== VERTICAL) {
scrollPosition.left = this._scrollToElementPosition($element, HORIZONTAL, offset)
}
if (direction !== HORIZONTAL) {
scrollPosition.top = this._scrollToElementPosition($element, VERTICAL, offset)
}
this.scrollTo(scrollPosition)
},
_scrollToElementPosition: function($element, direction, offset) {
var isVertical = direction === VERTICAL;
var startOffset = (isVertical ? offset.top : offset.left) || 0;
var endOffset = (isVertical ? offset.bottom : offset.right) || 0;
var pushBackOffset = isVertical ? this._strategy.verticalOffset() : 0;
var elementPositionRelativeToContent = this._elementPositionRelativeToContent($element, isVertical ? "top" : "left");
var elementPosition = elementPositionRelativeToContent - pushBackOffset;
var elementSize = $element[isVertical ? "outerHeight" : "outerWidth"]();
var scrollLocation = isVertical ? this.scrollTop() : this.scrollLeft();
var clientSize = isVertical ? this.clientHeight() : this.clientWidth();
var startDistance = scrollLocation - elementPosition + startOffset;
var endDistance = scrollLocation - elementPosition - elementSize + clientSize - endOffset;
if (startDistance <= 0 && endDistance >= 0) {
return scrollLocation
}
return scrollLocation - (Math.abs(startDistance) > Math.abs(endDistance) ? endDistance : startDistance)
},
_elementPositionRelativeToContent: function($element, prop) {
var result = 0;
while (this._hasScrollContent($element)) {
result += $element.position()[prop];
$element = $element.offsetParent()
}
return result
},
_hasScrollContent: function($element) {
var $content = this.$content();
return $element.closest($content).length && !$element.is($content)
},
_updateIfNeed: function() {
if (!this.option("updateManually")) {
this.update()
}
}
});
(0, _component_registrator2.default)(SCROLLABLE, Scrollable);
module.exports = Scrollable;
module.exports.deviceDependentOptions = deviceDependentOptions
},
/*!***********************************************!*\
!*** ./artifacts/transpiled/ui/select_box.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
var isDefined = typeUtils.isDefined;
var isPromise = typeUtils.isPromise;
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement;
var Deferred = deferredUtils.Deferred;
var errors = __webpack_require__( /*! ../core/errors */ 21);
var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
var inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69);
var messageLocalization = __webpack_require__( /*! ../localization/message */ 13);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var DropDownList = __webpack_require__( /*! ./drop_down_editor/ui.drop_down_list */ 216);
var DISABLED_STATE_SELECTOR = ".dx-state-disabled";
var SELECTBOX_CLASS = "dx-selectbox";
var SELECTBOX_POPUP_CLASS = "dx-selectbox-popup";
var SELECTBOX_CONTAINER_CLASS = "dx-selectbox-container";
var SELECTBOX_POPUP_WRAPPER_CLASS = "dx-selectbox-popup-wrapper";
var SelectBox = DropDownList.inherit({
_supportedKeys: function() {
var that = this;
var parent = this.callBase();
var clearSelectBox = function(e) {
var isEditable = this._isEditable();
if (!isEditable) {
if (this.option("showClearButton")) {
e.preventDefault();
this.reset()
}
} else {
if (this._valueSubstituted()) {
this._preventFiltering = true
}
}
this._preventSubstitution = true
};
var searchIfNeeded = function() {
if (that.option("searchEnabled") && that._valueSubstituted()) {
that._searchHandler()
}
};
return extend({}, parent, {
tab: function() {
if (this.option("opened") && "instantly" === this.option("applyValueMode")) {
this._cleanInputSelection()
}
if (this._wasSearch()) {
this._clearFilter()
}
parent.tab && parent.tab.apply(this, arguments)
},
upArrow: function() {
if (parent.upArrow && parent.upArrow.apply(this, arguments)) {
if (!this.option("opened")) {
this._setNextValue(-1)
}
return true
}
},
downArrow: function() {
if (parent.downArrow && parent.downArrow.apply(this, arguments)) {
if (!this.option("opened")) {
this._setNextValue(1)
}
return true
}
},
leftArrow: function() {
searchIfNeeded();
parent.leftArrow && parent.leftArrow.apply(this, arguments)
},
rightArrow: function() {
searchIfNeeded();
parent.rightArrow && parent.rightArrow.apply(this, arguments)
},
home: function() {
searchIfNeeded();
parent.home && parent.home.apply(this, arguments)
},
end: function() {
searchIfNeeded();
parent.end && parent.end.apply(this, arguments)
},
escape: function() {
var result = parent.escape && parent.escape.apply(this, arguments);
this._cancelEditing();
return isDefined(result) ? result : true
},
enter: function(e) {
var isOpened = this.option("opened");
var inputText = this._input().val().trim();
var isCustomText = inputText && this._list && !this._list.option("focusedElement");
if (!inputText && this.option("value") && this.option("allowClearing")) {
this.option({
selectedItem: null,
value: null
});
this.close()
} else {
if (this.option("acceptCustomValue")) {
e.preventDefault();
if (isCustomText) {
this._valueChangeEventHandler(e);
if (isOpened) {
this._toggleOpenState()
}
}
return isOpened
}
if (parent.enter && parent.enter.apply(this, arguments)) {
return isOpened
}
}
},
space: function(e) {
var isOpened = this.option("opened");
var isSearchEnabled = this.option("searchEnabled");
var acceptCustomValue = this.option("acceptCustomValue");
if (!isOpened || isSearchEnabled || acceptCustomValue) {
return
}
e.preventDefault();
this._valueChangeEventHandler(e);
return true
},
backspace: clearSelectBox,
del: clearSelectBox
})
},
_getDefaultOptions: function() {
return extend(this.callBase(), {
placeholder: messageLocalization.format("Select"),
fieldTemplate: null,
valueChangeEvent: "change",
acceptCustomValue: false,
onCustomItemCreating: function(e) {
if (!isDefined(e.customItem)) {
e.customItem = e.text
}
},
showSelectionControls: false,
autocompletionEnabled: true,
allowClearing: true,
tooltipEnabled: false,
openOnFieldClick: true,
showDropDownButton: true,
displayCustomValue: false,
_isAdaptablePopupPosition: false,
useInkRipple: false,
useHiddenSubmitElement: true
})
},
_init: function() {
this.callBase();
this._initCustomItemCreatingAction()
},
_initMarkup: function() {
this.$element().addClass(SELECTBOX_CLASS);
this._renderTooltip();
this.option("useInkRipple") && this._renderInkRipple();
this.callBase();
this._$container.addClass(SELECTBOX_CONTAINER_CLASS)
},
_renderInkRipple: function() {
this._inkRipple = inkRipple.render()
},
_toggleActiveState: function($element, value, e) {
this.callBase.apply(this, arguments);
if (!this._inkRipple || this._isEditable()) {
return
}
var config = {
element: this._inputWrapper(),
event: e
};
if (value) {
this._inkRipple.showWave(config)
} else {
this._inkRipple.hideWave(config)
}
},
_createPopup: function() {
this.callBase();
this._popup.$element().addClass(SELECTBOX_POPUP_CLASS)
},
_popupWrapperClass: function() {
return this.callBase() + " " + SELECTBOX_POPUP_WRAPPER_CLASS
},
_cancelEditing: function() {
if (!this.option("searchEnabled") && this._list) {
this._focusListElement(null);
this._updateField(this.option("selectedItem"))
}
},
_renderOpenedState: function() {
this.callBase();
if (this.option("opened")) {
this._scrollToSelectedItem();
this._focusSelectedElement()
}
},
_focusSelectedElement: function() {
var searchValue = this._searchValue();
if (!searchValue) {
this._focusListElement(null);
return
}
var $listItems = this._list._itemElements();
var index = inArray(this.option("selectedItem"), this.option("items"));
var focusedElement = index >= 0 && !this._isCustomItemSelected() ? $listItems.eq(index) : null;
this._focusListElement(focusedElement)
},
_renderFocusedElement: function() {
if (!this._list) {
return
}
var searchValue = this._searchValue();
if (!searchValue || this.option("acceptCustomValue")) {
this._focusListElement(null);
return
}
var $listItems = this._list._itemElements();
var focusedElement = $listItems.not(DISABLED_STATE_SELECTOR).eq(0);
this._focusListElement(focusedElement)
},
_focusListElement: function(element) {
this._preventInputValueRender = true;
this._list.option("focusedElement", getPublicElement(element));
delete this._preventInputValueRender
},
_scrollToSelectedItem: function() {
this._list && this._list.scrollToItem(this._list.option("selectedItem"))
},
_listContentReadyHandler: function() {
this.callBase();
var isPaginate = this._dataSource && this._dataSource.paginate();
if (isPaginate && this._needPopupRepaint()) {
return
}
this._scrollToSelectedItem()
},
_renderValue: function() {
this._renderInputValue();
this._setSubmitValue();
return (new Deferred).resolve()
},
_renderInputValue: function() {
return this.callBase().always(function() {
this._renderInputValueAsync()
}.bind(this))
},
_renderInputValueAsync: function() {
this._renderTooltip();
this._renderInputValueImpl().always(function() {
this._refreshSelected()
}.bind(this))
},
_renderInputValueImpl: function() {
this._renderField();
return (new Deferred).resolve()
},
_setNextItem: function(step) {
var item = this._calcNextItem(step);
var value = this._valueGetter(item);
this._setValue(value)
},
_setNextValue: function(step) {
var dataSourceIsLoaded = this._dataSource.isLoaded() ? (new Deferred).resolve() : this._dataSource.load();
dataSourceIsLoaded.done(function() {
var selectedIndex = this._getSelectedIndex();
var hasPages = this._dataSource.pageSize();
var isLastPage = this._dataSource.isLastPage();
var isLastItem = selectedIndex === this._items().length - 1;
if (hasPages && !isLastPage && isLastItem && step > 0) {
if (!this._popup) {
this._createPopup()
}
if (!this._dataSource.isLoading()) {
this._list._loadNextPage().done(this._setNextItem.bind(this, step))
}
} else {
this._setNextItem(step)
}
}.bind(this))
},
_setSelectedItem: function(item) {
var isUnknownItem = !this._isCustomValueAllowed() && void 0 === item;
this.callBase(isUnknownItem ? null : item);
if (!isUnknownItem && (!this._isEditable() || this._isCustomItemSelected())) {
this._setListOption("selectedItem", this.option("selectedItem"))
}
},
_isCustomValueAllowed: function() {
return this.option("acceptCustomValue") || this.callBase()
},
_displayValue: function(item) {
item = !isDefined(item) && this._isCustomValueAllowed() ? this.option("value") : item;
return this.callBase(item)
},
_listConfig: function() {
var result = extend(this.callBase(), {
pageLoadMode: "scrollBottom",
onSelectionChanged: this._getSelectionChangeHandler(),
selectedItem: this.option("selectedItem"),
onFocusedItemChanged: this._listFocusedItemChangeHandler.bind(this)
});
if (this.option("showSelectionControls")) {
extend(result, {
showSelectionControls: true,
selectionByClick: true
})
}
return result
},
_listFocusedItemChangeHandler: function(e) {
if (this._preventInputValueRender) {
return
}
var list = e.component;
var focusedElement = $(list.option("focusedElement"));
var focusedItem = list._getItemData(focusedElement);
this._updateField(focusedItem)
},
_updateField: function(item) {
var fieldTemplate = this._getTemplateByOption("fieldTemplate");
if (!(fieldTemplate && this.option("fieldTemplate"))) {
this._renderDisplayText(this._displayGetter(item));
return
}
this._renderField()
},
_getSelectionChangeHandler: function() {
return this.option("showSelectionControls") ? this._selectionChangeHandler.bind(this) : commonUtils.noop
},
_selectionChangeHandler: function(e) {
each(e.addedItems || [], function(_, addedItem) {
this._setValue(this._valueGetter(addedItem))
}.bind(this))
},
_getActualSearchValue: function() {
return this._dataSource.searchValue()
},
_toggleOpenState: function(isVisible) {
if (this.option("disabled")) {
return
}
isVisible = arguments.length ? isVisible : !this.option("opened");
if (!isVisible) {
this._restoreInputText(true)
}
if (this._wasSearch() && isVisible) {
this._wasSearch(false);
var showDataImmediately = this.option("showDataBeforeSearch") || 0 === this.option("minSearchLength");
if (showDataImmediately && this._dataSource) {
if (this._searchTimer) {
return
}
var searchValue = this._getActualSearchValue();
searchValue && this._wasSearch(true);
this._filterDataSource(searchValue || null)
} else {
this._setListOption("items", [])
}
}
if (isVisible) {
this._scrollToSelectedItem()
}
this.callBase(isVisible)
},
_renderTooltip: function() {
if (this.option("tooltipEnabled")) {
this.$element().attr("title", this.option("displayValue"))
}
},
_renderDimensions: function() {
this.callBase();
this._setPopupOption("width")
},
_isValueEqualInputText: function() {
var initialSelectedItem = this.option("selectedItem");
var value = this._displayGetter(initialSelectedItem);
var displayValue = value ? String(value) : "";
var inputText = this._searchValue();
return displayValue === inputText
},
_popupHidingHandler: function() {
if (this._isValueEqualInputText()) {
this._cancelEditing()
}
this.callBase()
},
_restoreInputText: function(saveEditingValue) {
if (this.option("readOnly")) {
return
}
this._loadItemDeferred && this._loadItemDeferred.always(function() {
var initialSelectedItem = this.option("selectedItem");
if (this.option("acceptCustomValue")) {
if (!saveEditingValue) {
this._updateField(initialSelectedItem);
this._clearFilter()
}
return
}
if (this.option("searchEnabled")) {
if (!this._searchValue() && this.option("allowClearing")) {
this._clearTextValue();
return
}
}
if (this._isValueEqualInputText()) {
return
}
this._renderInputValue().always(function(selectedItem) {
var newSelectedItem = commonUtils.ensureDefined(selectedItem, initialSelectedItem);
this._setSelectedItem(newSelectedItem);
this._updateField(newSelectedItem);
this._clearFilter()
}.bind(this))
}.bind(this))
},
_focusOutHandler: function(e) {
if (!this._preventNestedFocusEvent(e)) {
this._clearSearchTimer();
this._restoreInputText();
var shouldCancelSearch = this._wasSearch() && !this.option("acceptCustomValue") && this.option("searchEnabled") && this.option("opened") && !this._isOverlayNestedTarget(e.relatedTarget);
if (shouldCancelSearch) {
this._searchCanceled()
}
}
this.callBase(e)
},
_isOverlayNestedTarget: function(target) {
return !!$(target).closest(".".concat(SELECTBOX_POPUP_WRAPPER_CLASS)).length
},
_clearTextValue: function() {
this.option("value", null)
},
_shouldOpenPopup: function() {
return this._needPassDataSourceToList()
},
_isFocused: function() {
var activeElement = domAdapter.getActiveElement();
return this.callBase() && $(activeElement).closest(this._input()).length > 0
},
_renderValueChangeEvent: function() {
if (this._isEditable()) {
this.callBase()
}
},
_isEditable: function() {
return this.option("acceptCustomValue") || this.option("searchEnabled")
},
_fieldRenderData: function() {
var $listFocused = this._list && this.option("opened") && $(this._list.option("focusedElement"));
if ($listFocused && $listFocused.length) {
return this._list._getItemData($listFocused)
}
return this.option("selectedItem")
},
_readOnlyPropValue: function() {
return !this._isEditable() || this.option("readOnly")
},
_isSelectedValue: function(value) {
return this._isValueEquals(value, this.option("value"))
},
_shouldCloseOnItemClick: function() {
return !(this.option("showSelectionControls") && "single" !== this.option("selectionMode"))
},
_listItemClickHandler: function(e) {
var previousValue = this._getCurrentValue();
this._focusListElement($(e.itemElement));
this._saveValueChangeEvent(e.event);
if (this._shouldClearFilter()) {
this._clearFilter()
}
this._completeSelection(this._valueGetter(e.itemData));
if (this._shouldCloseOnItemClick()) {
this.option("opened", false)
}
if (this.option("searchEnabled") && previousValue === this._valueGetter(e.itemData)) {
this._updateField(e.itemData)
}
},
_shouldClearFilter: function() {
return this._wasSearch()
},
_completeSelection: function(value) {
this._setValue(value)
},
_loadItem: function(value, cache) {
var that = this;
var deferred = new Deferred;
this.callBase(value, cache).done(function(item) {
deferred.resolve(item)
}.bind(this)).fail(function() {
var selectedItem = that.option("selectedItem");
if (that.option("acceptCustomValue") && value === that._valueGetter(selectedItem)) {
deferred.resolve(selectedItem)
} else {
deferred.reject()
}
}.bind(this));
return deferred.promise()
},
_loadInputValue: function(value, callback) {
this._loadItemDeferred = this._loadItem(value).always(callback);
return this._loadItemDeferred
},
_isCustomItemSelected: function() {
var selectedItem = this.option("selectedItem");
var searchValue = this._searchValue();
var selectedItemText = this._displayGetter(selectedItem);
return !selectedItemText || searchValue !== selectedItemText.toString()
},
_valueChangeEventHandler: function(e) {
if (this.option("acceptCustomValue") && this._isCustomItemSelected()) {
this._customItemAddedHandler(e)
}
},
_initCustomItemCreatingAction: function() {
this._customItemCreatingAction = this._createActionByOption("onCustomItemCreating")
},
_createCustomItem: function(text) {
var params = {
text: text
};
var actionResult = this._customItemCreatingAction(params);
var item = commonUtils.ensureDefined(actionResult, params.customItem);
if (isDefined(actionResult)) {
errors.log("W0015", "onCustomItemCreating", "customItem")
}
return item
},
_customItemAddedHandler: function(e) {
var searchValue = this._searchValue();
var item = this._createCustomItem(searchValue);
this._saveValueChangeEvent(e);
if (void 0 === item) {
this._renderValue();
throw errors.Error("E0121")
}
if (isPromise(item)) {
deferredUtils.fromPromise(item).done(this._setCustomItem.bind(this)).fail(this._setCustomItem.bind(this, null))
} else {
this._setCustomItem(item)
}
},
_setCustomItem: function(item) {
if (this._disposed) {
return
}
item = item || null;
this.option("selectedItem", item);
if (this._shouldClearFilter()) {
this._filterDataSource(null)
}
this._setValue(this._valueGetter(item));
this._renderDisplayText(this._displayGetter(item))
},
_clearValueHandler: function(e) {
this.callBase(e);
return false
},
_wasSearch: function(value) {
if (!arguments.length) {
return this._wasSearchValue
}
this._wasSearchValue = value
},
_searchHandler: function(e) {
if (this._preventFiltering) {
delete this._preventFiltering;
return
}
if (this._needPassDataSourceToList()) {
this._wasSearch(true)
}
this.callBase(e)
},
_dataSourceFiltered: function(searchValue) {
this.callBase();
if (null !== searchValue) {
this._renderInputSubstitution();
this._renderFocusedElement()
}
},
_valueSubstituted: function() {
var input = this._input().get(0);
var isAllSelected = 0 === input.selectionStart && input.selectionEnd === this._searchValue().length;
var inputHasSelection = input.selectionStart !== input.selectionEnd;
return this._wasSearch() && inputHasSelection && !isAllSelected
},
_shouldSubstitutionBeRendered: function() {
return this.option("autocompletionEnabled") && !this._preventSubstitution && this.option("searchEnabled") && !this.option("acceptCustomValue") && "startswith" === this.option("searchMode")
},
_renderInputSubstitution: function() {
if (!this._shouldSubstitutionBeRendered()) {
delete this._preventSubstitution;
return
}
var item = this._list && this._getPlainItems(this._list.option("items"))[0];
if (!item) {
return
}
var $input = this._input();
var valueLength = $input.val().length;
if (0 === valueLength) {
return
}
var inputElement = $input.get(0);
var displayValue = this._displayGetter(item).toString();
inputElement.value = displayValue;
this._caret({
start: valueLength,
end: displayValue.length
})
},
_cleanInputSelection: function() {
var inputElement = this._input().get(0);
var endPosition = inputElement.value.length;
inputElement.selectionStart = endPosition;
inputElement.selectionEnd = endPosition
},
_dispose: function() {
this._renderInputValueAsync = commonUtils.noop;
delete this._loadItemDeferred;
this.callBase()
},
_optionChanged: function(args) {
switch (args.name) {
case "_isAdaptablePopupPosition":
case "autocompletionEnabled":
break;
case "onCustomItemCreating":
this._initCustomItemCreatingAction();
break;
case "tooltipEnabled":
this._renderTooltip();
break;
case "displayCustomValue":
case "acceptCustomValue":
case "showSelectionControls":
case "useInkRipple":
this._invalidate();
break;
case "allowClearing":
break;
default:
this.callBase(args)
}
},
_clean: function() {
delete this._inkRipple;
this.callBase()
}
});
registerComponent("dxSelectBox", SelectBox);
module.exports = SelectBox
}, ,
/*!***************************************!*\
!*** ./artifacts/transpiled/color.js ***!
\***************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var standardColorNames = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "00ffff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000000",
blanchedalmond: "ffebcd",
blue: "0000ff",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "00ffff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgoldenrod: "b8860b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkkhaki: "bdb76b",
darkmagenta: "8b008b",
darkolivegreen: "556b2f",
darkorange: "ff8c00",
darkorchid: "9932cc",
darkred: "8b0000",
darksalmon: "e9967a",
darkseagreen: "8fbc8f",
darkslateblue: "483d8b",
darkslategray: "2f4f4f",
darkturquoise: "00ced1",
darkviolet: "9400d3",
deeppink: "ff1493",
deepskyblue: "00bfff",
dimgray: "696969",
dodgerblue: "1e90ff",
feldspar: "d19275",
firebrick: "b22222",
floralwhite: "fffaf0",
forestgreen: "228b22",
fuchsia: "ff00ff",
gainsboro: "dcdcdc",
ghostwhite: "f8f8ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
honeydew: "f0fff0",
hotpink: "ff69b4",
indianred: "cd5c5c",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgrey: "d3d3d3",
lightgreen: "90ee90",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslateblue: "8470ff",
lightslategray: "778899",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "00ff00",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "ff00ff",
maroon: "800000",
mediumaquamarine: "66cdaa",
mediumblue: "0000cd",
mediumorchid: "ba55d3",
mediumpurple: "9370d8",
mediumseagreen: "3cb371",
mediumslateblue: "7b68ee",
mediumspringgreen: "00fa9a",
mediumturquoise: "48d1cc",
mediumvioletred: "c71585",
midnightblue: "191970",
mintcream: "f5fffa",
mistyrose: "ffe4e1",
moccasin: "ffe4b5",
navajowhite: "ffdead",
navy: "000080",
oldlace: "fdf5e6",
olive: "808000",
olivedrab: "6b8e23",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
palegoldenrod: "eee8aa",
palegreen: "98fb98",
paleturquoise: "afeeee",
palevioletred: "d87093",
papayawhip: "ffefd5",
peachpuff: "ffdab9",
peru: "cd853f",
pink: "ffc0cb",
plum: "dda0dd",
powderblue: "b0e0e6",
purple: "800080",
rebeccapurple: "663399",
red: "ff0000",
rosybrown: "bc8f8f",
royalblue: "4169e1",
saddlebrown: "8b4513",
salmon: "fa8072",
sandybrown: "f4a460",
seagreen: "2e8b57",
seashell: "fff5ee",
sienna: "a0522d",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
snow: "fffafa",
springgreen: "00ff7f",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
thistle: "d8bfd8",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
violetred: "d02090",
wheat: "f5deb3",
white: "ffffff",
whitesmoke: "f5f5f5",
yellow: "ffff00",
yellowgreen: "9acd32"
};
var standardColorTypes = [{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process: function(colorString) {
return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10)]
}
}, {
re: /^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d*\.*\d+)\)$/,
process: function(colorString) {
return [parseInt(colorString[1], 10), parseInt(colorString[2], 10), parseInt(colorString[3], 10), parseFloat(colorString[4])]
}
}, {
re: /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/,
process: function(colorString) {
return [parseInt(colorString[1], 16), parseInt(colorString[2], 16), parseInt(colorString[3], 16)]
}
}, {
re: /^#([a-f0-9]{1})([a-f0-9]{1})([a-f0-9]{1})$/,
process: function(colorString) {
return [parseInt(colorString[1] + colorString[1], 16), parseInt(colorString[2] + colorString[2], 16), parseInt(colorString[3] + colorString[3], 16)]
}
}, {
re: /^hsv\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process: function(colorString) {
var h = parseInt(colorString[1], 10);
var s = parseInt(colorString[2], 10);
var v = parseInt(colorString[3], 10);
var rgb = hsvToRgb(h, s, v);
return [rgb[0], rgb[1], rgb[2], 1, [h, s, v]]
}
}, {
re: /^hsl\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process: function(colorString) {
var h = parseInt(colorString[1], 10);
var s = parseInt(colorString[2], 10);
var l = parseInt(colorString[3], 10);
var rgb = hslToRgb(h, s, l);
return [rgb[0], rgb[1], rgb[2], 1, null, [h, s, l]]
}
}];
function Color(value) {
this.baseColor = value;
var color;
if (value) {
color = String(value).toLowerCase().replace(/ /g, "");
color = standardColorNames[color] ? "#" + standardColorNames[color] : color;
color = parseColor(color)
}
if (!color) {
this.colorIsInvalid = true
}
color = color || {};
this.r = normalize(color[0]);
this.g = normalize(color[1]);
this.b = normalize(color[2]);
this.a = normalize(color[3], 1, 1);
if (color[4]) {
this.hsv = {
h: color[4][0],
s: color[4][1],
v: color[4][2]
}
} else {
this.hsv = toHsvFromRgb(this.r, this.g, this.b)
}
if (color[5]) {
this.hsl = {
h: color[5][0],
s: color[5][1],
l: color[5][2]
}
} else {
this.hsl = toHslFromRgb(this.r, this.g, this.b)
}
}
function parseColor(color) {
if ("transparent" === color) {
return [0, 0, 0, 0]
}
var i = 0;
var ii = standardColorTypes.length;
var str;
for (; i < ii; ++i) {
str = standardColorTypes[i].re.exec(color);
if (str) {
return standardColorTypes[i].process(str)
}
}
return null
}
function normalize(colorComponent, def, max) {
def = def || 0;
max = max || 255;
return colorComponent < 0 || isNaN(colorComponent) ? def : colorComponent > max ? max : colorComponent
}
function toHexFromRgb(r, g, b) {
return "#" + (16777216 | r << 16 | g << 8 | b).toString(16).slice(1)
}
function toHsvFromRgb(r, g, b) {
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var delta = max - min;
var H;
var S;
var V;
V = max;
S = 0 === max ? 0 : 1 - min / max;
if (max === min) {
H = 0
} else {
switch (max) {
case r:
H = 60 * ((g - b) / delta);
if (g < b) {
H += 360
}
break;
case g:
H = 60 * ((b - r) / delta) + 120;
break;
case b:
H = 60 * ((r - g) / delta) + 240
}
}
S *= 100;
V *= 100 / 255;
return {
h: Math.round(H),
s: Math.round(S),
v: Math.round(V)
}
}
function hsvToRgb(h, s, v) {
var r;
var g;
var b;
var index = Math.floor(h % 360 / 60);
var vMin = (100 - s) * v / 100;
var a = (v - vMin) * (h % 60 / 60);
var vInc = vMin + a;
var vDec = v - a;
switch (index) {
case 0:
r = v;
g = vInc;
b = vMin;
break;
case 1:
r = vDec;
g = v;
b = vMin;
break;
case 2:
r = vMin;
g = v;
b = vInc;
break;
case 3:
r = vMin;
g = vDec;
b = v;
break;
case 4:
r = vInc;
g = vMin;
b = v;
break;
case 5:
r = v;
g = vMin;
b = vDec
}
return [Math.round(2.55 * r), Math.round(2.55 * g), Math.round(2.55 * b)]
}
function calculateHue(r, g, b, delta) {
var max = Math.max(r, g, b);
switch (max) {
case r:
return (g - b) / delta + (g < b ? 6 : 0);
case g:
return (b - r) / delta + 2;
case b:
return (r - g) / delta + 4
}
}
function toHslFromRgb(r, g, b) {
r = convertTo01Bounds(r, 255);
g = convertTo01Bounds(g, 255);
b = convertTo01Bounds(b, 255);
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var maxMinSum = max + min;
var h;
var s;
var l = maxMinSum / 2;
if (max === min) {
h = s = 0
} else {
var delta = max - min;
if (l > .5) {
s = delta / (2 - maxMinSum)
} else {
s = delta / maxMinSum
}
h = calculateHue(r, g, b, delta);
h /= 6
}
return {
h: _round(360 * h),
s: _round(100 * s),
l: _round(100 * l)
}
}
function makeColorTint(colorPart, h) {
var colorTint = h;
if ("r" === colorPart) {
colorTint = h + 1 / 3
}
if ("b" === colorPart) {
colorTint = h - 1 / 3
}
return colorTint
}
function modifyColorTint(colorTint) {
if (colorTint < 0) {
colorTint += 1
}
if (colorTint > 1) {
colorTint -= 1
}
return colorTint
}
function hueToRgb(p, q, colorTint) {
colorTint = modifyColorTint(colorTint);
if (colorTint < 1 / 6) {
return p + 6 * (q - p) * colorTint
}
if (colorTint < .5) {
return q
}
if (colorTint < 2 / 3) {
return p + (q - p) * (2 / 3 - colorTint) * 6
}
return p
}
function hslToRgb(h, s, l) {
var r;
var g;
var b;
h = convertTo01Bounds(h, 360);
s = convertTo01Bounds(s, 100);
l = convertTo01Bounds(l, 100);
if (0 === s) {
r = g = b = l
} else {
var q = l < .5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hueToRgb(p, q, makeColorTint("r", h));
g = hueToRgb(p, q, makeColorTint("g", h));
b = hueToRgb(p, q, makeColorTint("b", h))
}
return [_round(255 * r), _round(255 * g), _round(255 * b)]
}
function convertTo01Bounds(n, max) {
n = Math.min(max, Math.max(0, parseFloat(n)));
if (Math.abs(n - max) < 1e-6) {
return 1
}
return n % max / parseFloat(max)
}
function isIntegerBetweenMinAndMax(number, min, max) {
min = min || 0;
max = max || 255;
if (number % 1 !== 0 || number < min || number > max || "number" !== typeof number || isNaN(number)) {
return false
}
return true
}
var _round = Math.round;
Color.prototype = {
constructor: Color,
highlight: function(step) {
step = step || 10;
return this.alter(step).toHex()
},
darken: function(step) {
step = step || 10;
return this.alter(-step).toHex()
},
alter: function(step) {
var result = new Color;
result.r = normalize(this.r + step);
result.g = normalize(this.g + step);
result.b = normalize(this.b + step);
return result
},
blend: function(blendColor, opacity) {
var other = blendColor instanceof Color ? blendColor : new Color(blendColor);
var result = new Color;
result.r = normalize(_round(this.r * (1 - opacity) + other.r * opacity));
result.g = normalize(_round(this.g * (1 - opacity) + other.g * opacity));
result.b = normalize(_round(this.b * (1 - opacity) + other.b * opacity));
return result
},
toHex: function() {
return toHexFromRgb(this.r, this.g, this.b)
},
getPureColor: function() {
var rgb = hsvToRgb(this.hsv.h, 100, 100);
return new Color("rgb(" + rgb.join(",") + ")")
},
isValidHex: function(hex) {
return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex)
},
isValidRGB: function(r, g, b) {
if (!isIntegerBetweenMinAndMax(r) || !isIntegerBetweenMinAndMax(g) || !isIntegerBetweenMinAndMax(b)) {
return false
}
return true
},
isValidAlpha: function(a) {
if (isNaN(a) || a < 0 || a > 1 || "number" !== typeof a) {
return false
}
return true
},
colorIsInvalid: false,
fromHSL: function(hsl) {
var color = new Color;
var rgb = hslToRgb(hsl.h, hsl.s, hsl.l);
color.r = rgb[0];
color.g = rgb[1];
color.b = rgb[2];
return color
}
};
module.exports = Color
},
/*!*****************************************************************!*\
!*** ./artifacts/transpiled/events/core/emitter_registrator.js ***!
\*****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
var Class = __webpack_require__( /*! ../../core/class */ 15);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
var wheelEvent = __webpack_require__( /*! ./wheel */ 124);
var MANAGER_EVENT = "dxEventManager";
var EMITTER_DATA = "dxEmitter";
var EventManager = Class.inherit({
ctor: function() {
this._attachHandlers();
this.reset();
this._proxiedCancelHandler = this._cancelHandler.bind(this);
this._proxiedAcceptHandler = this._acceptHandler.bind(this)
},
_attachHandlers: function() {
readyCallbacks.add(function() {
var document = domAdapter.getDocument();
eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.down, MANAGER_EVENT), this._pointerDownHandler.bind(this));
eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(pointerEvents.move, MANAGER_EVENT), this._pointerMoveHandler.bind(this));
eventsEngine.subscribeGlobal(document, eventUtils.addNamespace([pointerEvents.up, pointerEvents.cancel].join(" "), MANAGER_EVENT), this._pointerUpHandler.bind(this));
eventsEngine.subscribeGlobal(document, eventUtils.addNamespace(wheelEvent.name, MANAGER_EVENT), this._mouseWheelHandler.bind(this))
}.bind(this))
},
_eachEmitter: function(callback) {
var activeEmitters = this._activeEmitters || [];
var i = 0;
while (activeEmitters.length > i) {
var emitter = activeEmitters[i];
if (false === callback(emitter)) {
break
}
if (activeEmitters[i] === emitter) {
i++
}
}
},
_applyToEmitters: function(method, arg) {
this._eachEmitter(function(emitter) {
emitter[method].call(emitter, arg)
})
},
reset: function() {
this._eachEmitter(this._proxiedCancelHandler);
this._activeEmitters = []
},
resetEmitter: function(emitter) {
this._proxiedCancelHandler(emitter)
},
_pointerDownHandler: function(e) {
if (eventUtils.isMouseEvent(e) && e.which > 1) {
return
}
this._updateEmitters(e)
},
_updateEmitters: function(e) {
if (!this._isSetChanged(e)) {
return
}
this._cleanEmitters(e);
this._fetchEmitters(e)
},
_isSetChanged: function(e) {
var currentSet = this._closestEmitter(e);
var previousSet = this._emittersSet || [];
var setChanged = currentSet.length !== previousSet.length;
each(currentSet, function(index, emitter) {
setChanged = setChanged || previousSet[index] !== emitter;
return !setChanged
});
this._emittersSet = currentSet;
return setChanged
},
_closestEmitter: function(e) {
var that = this;
var result = [];
var $element = $(e.target);
function handleEmitter(_, emitter) {
if (!!emitter && emitter.validatePointers(e) && emitter.validate(e)) {
emitter.addCancelCallback(that._proxiedCancelHandler);
emitter.addAcceptCallback(that._proxiedAcceptHandler);
result.push(emitter)
}
}
while ($element.length) {
var emitters = dataUtils.data($element.get(0), EMITTER_DATA) || [];
each(emitters, handleEmitter);
$element = $element.parent()
}
return result
},
_acceptHandler: function(acceptedEmitter, e) {
var that = this;
this._eachEmitter(function(emitter) {
if (emitter !== acceptedEmitter) {
that._cancelEmitter(emitter, e)
}
})
},
_cancelHandler: function(canceledEmitter, e) {
this._cancelEmitter(canceledEmitter, e)
},
_cancelEmitter: function(emitter, e) {
var activeEmitters = this._activeEmitters;
if (e) {
emitter.cancel(e)
} else {
emitter.reset()
}
emitter.removeCancelCallback();
emitter.removeAcceptCallback();
var emitterIndex = inArray(emitter, activeEmitters);
if (emitterIndex > -1) {
activeEmitters.splice(emitterIndex, 1)
}
},
_cleanEmitters: function(e) {
this._applyToEmitters("end", e);
this.reset(e)
},
_fetchEmitters: function(e) {
this._activeEmitters = this._emittersSet.slice();
this._applyToEmitters("start", e)
},
_pointerMoveHandler: function(e) {
this._applyToEmitters("move", e)
},
_pointerUpHandler: function(e) {
this._updateEmitters(e)
},
_mouseWheelHandler: function(e) {
if (!this._allowInterruptionByMouseWheel()) {
return
}
e.pointers = [null];
this._pointerDownHandler(e);
this._adjustWheelEvent(e);
this._pointerMoveHandler(e);
e.pointers = [];
this._pointerUpHandler(e)
},
_allowInterruptionByMouseWheel: function() {
var allowInterruption = true;
this._eachEmitter(function(emitter) {
allowInterruption = emitter.allowInterruptionByMouseWheel() && allowInterruption;
return allowInterruption
});
return allowInterruption
},
_adjustWheelEvent: function(e) {
var closestGestureEmitter = null;
this._eachEmitter(function(emitter) {
if (!emitter.gesture) {
return
}
var direction = emitter.getDirection(e);
if ("horizontal" !== direction && !e.shiftKey || "vertical" !== direction && e.shiftKey) {
closestGestureEmitter = emitter;
return false
}
});
if (!closestGestureEmitter) {
return
}
var direction = closestGestureEmitter.getDirection(e);
var verticalGestureDirection = "both" === direction && !e.shiftKey || "vertical" === direction;
var prop = verticalGestureDirection ? "pageY" : "pageX";
e[prop] += e.delta
},
isActive: function(element) {
var result = false;
this._eachEmitter(function(emitter) {
result = result || emitter.getElement().is(element)
});
return result
}
});
var eventManager = new EventManager;
var EMITTER_SUBSCRIPTION_DATA = "dxEmitterSubscription";
var registerEmitter = function(emitterConfig) {
var emitterClass = emitterConfig.emitter;
var emitterName = emitterConfig.events[0];
var emitterEvents = emitterConfig.events;
each(emitterEvents, function(_, eventName) {
registerEvent(eventName, {
noBubble: !emitterConfig.bubble,
setup: function(element) {
var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA) || {};
var emitters = dataUtils.data(element, EMITTER_DATA) || {};
var emitter = emitters[emitterName] || new emitterClass(element);
subscriptions[eventName] = true;
emitters[emitterName] = emitter;
dataUtils.data(element, EMITTER_DATA, emitters);
dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA, subscriptions)
},
add: function(element, handleObj) {
var emitters = dataUtils.data(element, EMITTER_DATA);
var emitter = emitters[emitterName];
emitter.configure(extend({
delegateSelector: handleObj.selector
}, handleObj.data), handleObj.type)
},
teardown: function(element) {
var subscriptions = dataUtils.data(element, EMITTER_SUBSCRIPTION_DATA);
var emitters = dataUtils.data(element, EMITTER_DATA);
var emitter = emitters[emitterName];
delete subscriptions[eventName];
var disposeEmitter = true;
each(emitterEvents, function(_, eventName) {
disposeEmitter = disposeEmitter && !subscriptions[eventName];
return disposeEmitter
});
if (disposeEmitter) {
if (eventManager.isActive(element)) {
eventManager.resetEmitter(emitter)
}
emitter && emitter.dispose();
delete emitters[emitterName]
}
}
})
})
};
module.exports = registerEmitter
}, ,
/*!*****************************************************!*\
!*** ./artifacts/transpiled/core/utils/position.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _config = __webpack_require__( /*! ../config */ 31);
var _config2 = _interopRequireDefault(_config);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var getDefaultAlignment = function(isRtlEnabled) {
var rtlEnabled = null !== isRtlEnabled && void 0 !== isRtlEnabled ? isRtlEnabled : (0, _config2.default)().rtlEnabled;
return rtlEnabled ? "right" : "left"
};
exports.getDefaultAlignment = getDefaultAlignment
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/data/abstract_store.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Class = __webpack_require__( /*! ../core/class */ 15);
var abstract = Class.abstract;
var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
var errorsModule = __webpack_require__( /*! ./errors */ 36);
var dataUtils = __webpack_require__( /*! ./utils */ 41);
var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
var storeHelper = __webpack_require__( /*! ./store_helper */ 81);
var queryByOptions = storeHelper.queryByOptions;
var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
var storeImpl = {};
var Store = Class.inherit({
ctor: function(options) {
var that = this;
options = options || {};
each(["onLoaded", "onLoading", "onInserted", "onInserting", "onUpdated", "onUpdating", "onPush", "onRemoved", "onRemoving", "onModified", "onModifying"], function(_, optionName) {
if (optionName in options) {
that.on(optionName.slice(2).toLowerCase(), options[optionName])
}
});
this._key = options.key;
this._errorHandler = options.errorHandler;
this._useDefaultSearch = true
},
_customLoadOptions: function() {
return null
},
key: function() {
return this._key
},
keyOf: function(obj) {
if (!this._keyGetter) {
this._keyGetter = compileGetter(this.key())
}
return this._keyGetter(obj)
},
_requireKey: function() {
if (!this.key()) {
throw errorsModule.errors.Error("E4005")
}
},
load: function(options) {
var that = this;
options = options || {};
this.fireEvent("loading", [options]);
return this._withLock(this._loadImpl(options)).done(function(result) {
that.fireEvent("loaded", [result, options])
})
},
_loadImpl: function(options) {
return queryByOptions(this.createQuery(options), options).enumerate()
},
_withLock: function(task) {
var result = new Deferred;
task.done(function() {
var that = this;
var args = arguments;
dataUtils.processRequestResultLock.promise().done(function() {
result.resolveWith(that, args)
})
}).fail(function() {
result.rejectWith(this, arguments)
});
return result
},
createQuery: abstract,
totalCount: function(options) {
return this._totalCountImpl(options)
},
_totalCountImpl: function(options) {
return queryByOptions(this.createQuery(options), options, true).count()
},
byKey: function(key, extraOptions) {
return this._addFailHandlers(this._withLock(this._byKeyImpl(key, extraOptions)))
},
_byKeyImpl: abstract,
insert: function(values) {
var that = this;
that.fireEvent("modifying");
that.fireEvent("inserting", [values]);
return that._addFailHandlers(that._insertImpl(values).done(function(callbackValues, callbackKey) {
that.fireEvent("inserted", [callbackValues, callbackKey]);
that.fireEvent("modified")
}))
},
_insertImpl: abstract,
update: function(key, values) {
var that = this;
that.fireEvent("modifying");
that.fireEvent("updating", [key, values]);
return that._addFailHandlers(that._updateImpl(key, values).done(function() {
that.fireEvent("updated", [key, values]);
that.fireEvent("modified")
}))
},
_updateImpl: abstract,
push: function(changes) {
this._pushImpl(changes);
this.fireEvent("push", [changes])
},
_pushImpl: noop,
remove: function(key) {
var that = this;
that.fireEvent("modifying");
that.fireEvent("removing", [key]);
return that._addFailHandlers(that._removeImpl(key).done(function(callbackKey) {
that.fireEvent("removed", [callbackKey]);
that.fireEvent("modified")
}))
},
_removeImpl: abstract,
_addFailHandlers: function(deferred) {
return deferred.fail(this._errorHandler).fail(errorsModule._errorHandler)
}
}).include(EventsMixin);
Store.create = function(alias, options) {
if (!(alias in storeImpl)) {
throw errorsModule.errors.Error("E4020", alias)
}
return new storeImpl[alias](options)
};
Store.registerClass = function(type, alias) {
if (alias) {
storeImpl[alias] = type
}
return type
};
Store.inherit = function(inheritor) {
return function(members, alias) {
var type = inheritor.apply(this, [members]);
Store.registerClass(type, alias);
return type
}
}(Store.inherit);
module.exports = Store
},
/*!******************************************************!*\
!*** ./artifacts/transpiled/ui/validation_engine.js ***!
\******************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Class = __webpack_require__( /*! ../core/class */ 15);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
var EventsMixin = __webpack_require__( /*! ../core/events_mixin */ 82);
var errors = __webpack_require__( /*! ../core/errors */ 21);
var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
var numberLocalization = __webpack_require__( /*! ../localization/number */ 51);
var messageLocalization = __webpack_require__( /*! ../localization/message */ 13);
var BaseRuleValidator = Class.inherit({
NAME: "base",
defaultMessage: function(value) {
return messageLocalization.getFormatter("validation-" + this.NAME)(value)
},
defaultFormattedMessage: function(value) {
return messageLocalization.getFormatter("validation-" + this.NAME + "-formatted")(value)
},
_isValueEmpty: function(value) {
return !rulesValidators.required.validate(value, {})
},
validate: function(value, rule) {
var valueArray = Array.isArray(value) ? value : [value];
var result = true;
if (valueArray.length) {
valueArray.every(function(itemValue) {
result = this._validate(itemValue, rule);
return result
}, this)
} else {
result = this._validate(null, rule)
}
return result
}
});
var RequiredRuleValidator = BaseRuleValidator.inherit({
NAME: "required",
_validate: function(value, rule) {
if (!typeUtils.isDefined(value)) {
return false
}
if (false === value) {
return false
}
value = String(value);
if (rule.trim || !typeUtils.isDefined(rule.trim)) {
value = value.trim()
}
return "" !== value
}
});
var NumericRuleValidator = BaseRuleValidator.inherit({
NAME: "numeric",
_validate: function(value, rule) {
if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
if (rule.useCultureSettings && typeUtils.isString(value)) {
return !isNaN(numberLocalization.parse(value))
} else {
return typeUtils.isNumeric(value)
}
}
});
var RangeRuleValidator = BaseRuleValidator.inherit({
NAME: "range",
_validate: function(value, rule) {
if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
var validNumber = rulesValidators.numeric.validate(value, rule);
var validValue = typeUtils.isDefined(value) && "" !== value;
var number = validNumber ? parseFloat(value) : validValue && value.valueOf();
var min = rule.min;
var max = rule.max;
if (!(validNumber || typeUtils.isDate(value)) && !validValue) {
return false
}
if (typeUtils.isDefined(min)) {
if (typeUtils.isDefined(max)) {
return number >= min && number <= max
}
return number >= min
} else {
if (typeUtils.isDefined(max)) {
return number <= max
} else {
throw errors.Error("E0101")
}
}
}
});
var StringLengthRuleValidator = BaseRuleValidator.inherit({
NAME: "stringLength",
_validate: function(value, rule) {
value = typeUtils.isDefined(value) ? String(value) : "";
if (rule.trim || !typeUtils.isDefined(rule.trim)) {
value = value.trim()
}
if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
return rulesValidators.range.validate(value.length, extend({}, rule))
}
});
var CustomRuleValidator = BaseRuleValidator.inherit({
NAME: "custom",
validate: function(value, rule) {
if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
var validator = rule.validator;
var dataGetter = validator && typeUtils.isFunction(validator.option) && validator.option("dataGetter");
var data = typeUtils.isFunction(dataGetter) && dataGetter();
var params = {
value: value,
validator: validator,
rule: rule
};
if (data) {
params.data = data
}
return rule.validationCallback(params)
}
});
var CompareRuleValidator = BaseRuleValidator.inherit({
NAME: "compare",
_validate: function(value, rule) {
if (!rule.comparisonTarget) {
throw errors.Error("E0102")
}
if (rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
extend(rule, {
reevaluate: true
});
var otherValue = rule.comparisonTarget();
var type = rule.comparisonType || "==";
switch (type) {
case "==":
return value == otherValue;
case "!=":
return value != otherValue;
case "===":
return value === otherValue;
case "!==":
return value !== otherValue;
case ">":
return value > otherValue;
case ">=":
return value >= otherValue;
case "<":
return value < otherValue;
case "<=":
return value <= otherValue
}
}
});
var PatternRuleValidator = BaseRuleValidator.inherit({
NAME: "pattern",
_validate: function(value, rule) {
if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
var pattern = rule.pattern;
if (typeUtils.isString(pattern)) {
pattern = new RegExp(pattern)
}
return pattern.test(value)
}
});
var EmailRuleValidator = BaseRuleValidator.inherit({
NAME: "email",
_validate: function(value, rule) {
if (false !== rule.ignoreEmptyValue && this._isValueEmpty(value)) {
return true
}
return rulesValidators.pattern.validate(value, extend({}, rule, {
pattern: /^[\d\w._-]+@[\d\w._-]+\.[\w]+$/i
}))
}
});
var rulesValidators = {
required: new RequiredRuleValidator,
numeric: new NumericRuleValidator,
range: new RangeRuleValidator,
stringLength: new StringLengthRuleValidator,
custom: new CustomRuleValidator,
compare: new CompareRuleValidator,
pattern: new PatternRuleValidator,
email: new EmailRuleValidator
};
var GroupConfig = Class.inherit({
ctor: function(group) {
this.group = group;
this.validators = []
},
validate: function() {
var result = {
isValid: true,
brokenRules: [],
validators: []
};
each(this.validators, function(_, validator) {
var validatorResult = validator.validate();
result.isValid = result.isValid && validatorResult.isValid;
if (validatorResult.brokenRule) {
result.brokenRules.push(validatorResult.brokenRule)
}
result.validators.push(validator)
});
this.fireEvent("validated", [{
validators: result.validators,
brokenRules: result.brokenRules,
isValid: result.isValid
}]);
return result
},
reset: function() {
each(this.validators, function(_, validator) {
validator.reset()
})
}
}).include(EventsMixin);
var ValidationEngine = {
groups: [],
getGroupConfig: function(group) {
var result = commonUtils.grep(this.groups, function(config) {
return config.group === group
});
if (result.length) {
return result[0]
}
},
initGroups: function() {
this.groups = [];
this.addGroup()
},
addGroup: function(group) {
var config = this.getGroupConfig(group);
if (!config) {
config = new GroupConfig(group);
this.groups.push(config)
}
return config
},
removeGroup: function(group) {
var config = this.getGroupConfig(group);
var index = inArray(config, this.groups);
if (index > -1) {
this.groups.splice(index, 1)
}
return config
},
_setDefaultMessage: function(rule, validator, name) {
if (!typeUtils.isDefined(rule.message)) {
if (validator.defaultFormattedMessage && typeUtils.isDefined(name)) {
rule.message = validator.defaultFormattedMessage(name)
} else {
rule.message = validator.defaultMessage()
}
}
},
validate: function(value, rules, name) {
var result = {
name: name,
value: value,
brokenRule: null,
isValid: true,
validationRules: rules
};
var that = this;
each(rules || [], function(_, rule) {
var ruleValidator = rulesValidators[rule.type];
var ruleValidationResult;
if (ruleValidator) {
if (typeUtils.isDefined(rule.isValid) && rule.value === value && !rule.reevaluate) {
if (!rule.isValid) {
result.isValid = false;
result.brokenRule = rule;
return false
}
return true
}
rule.value = value;
ruleValidationResult = ruleValidator.validate(value, rule);
rule.isValid = ruleValidationResult;
if (!ruleValidationResult) {
result.isValid = false;
that._setDefaultMessage(rule, ruleValidator, name);
result.brokenRule = rule
}
if (!rule.isValid) {
return false
}
} else {
throw errors.Error("E0100")
}
});
return result
},
registerValidatorInGroup: function(group, validator) {
var groupConfig = ValidationEngine.addGroup(group);
if (inArray(validator, groupConfig.validators) < 0) {
groupConfig.validators.push(validator)
}
},
_shouldRemoveGroup: function(group, validatorsInGroup) {
var isDefaultGroup = void 0 === group;
var isValidationGroupInstance = group && "dxValidationGroup" === group.NAME;
return !isDefaultGroup && !isValidationGroupInstance && !validatorsInGroup.length
},
removeRegisteredValidator: function(group, validator) {
var config = ValidationEngine.getGroupConfig(group);
var validatorsInGroup = config && config.validators;
var index = inArray(validator, validatorsInGroup);
if (index > -1) {
validatorsInGroup.splice(index, 1);
if (this._shouldRemoveGroup(group, validatorsInGroup)) {
this.removeGroup(group)
}
}
},
validateGroup: function(group) {
var groupConfig = ValidationEngine.getGroupConfig(group);
if (!groupConfig) {
throw errors.Error("E0110")
}
return groupConfig.validate()
},
resetGroup: function(group) {
var groupConfig = ValidationEngine.getGroupConfig(group);
if (!groupConfig) {
throw errors.Error("E0110")
}
return groupConfig.reset()
}
};
ValidationEngine.initGroups();
module.exports = ValidationEngine
},
/*!*****************************************!*\
!*** ./artifacts/transpiled/ui/list.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var ListEdit = __webpack_require__( /*! ./list/ui.list.edit.search */ 508);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
registerComponent("dxList", ListEdit);
module.exports = ListEdit
},
/*!*************************************************************************!*\
!*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator_registry.js ***!
\*************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
exports.registry = {};
exports.register = function(option, type, decoratorClass) {
var decoratorsRegistry = exports.registry;
var decoratorConfig = {};
decoratorConfig[option] = decoratorsRegistry[option] ? decoratorsRegistry[option] : {};
decoratorConfig[option][type] = decoratorClass;
decoratorsRegistry = extend(decoratorsRegistry, decoratorConfig)
}
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/ui/check_box.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var devices = __webpack_require__( /*! ../core/devices */ 16);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var inkRipple = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69);
var Editor = __webpack_require__( /*! ./editor/editor */ 49);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
var clickEvent = __webpack_require__( /*! ../events/click */ 19);
var CHECKBOX_CLASS = "dx-checkbox";
var CHECKBOX_ICON_CLASS = "dx-checkbox-icon";
var CHECKBOX_CHECKED_CLASS = "dx-checkbox-checked";
var CHECKBOX_CONTAINER_CLASS = "dx-checkbox-container";
var CHECKBOX_TEXT_CLASS = "dx-checkbox-text";
var CHECKBOX_HAS_TEXT_CLASS = "dx-checkbox-has-text";
var CHECKBOX_INDETERMINATE_CLASS = "dx-checkbox-indeterminate";
var CHECKBOX_FEEDBACK_HIDE_TIMEOUT = 100;
var CheckBox = Editor.inherit({
_supportedKeys: function() {
var click = function(e) {
e.preventDefault();
this._clickAction({
event: e
})
};
return extend(this.callBase(), {
space: click
})
},
_getDefaultOptions: function() {
return extend(this.callBase(), {
hoverStateEnabled: true,
activeStateEnabled: true,
value: false,
text: "",
useInkRipple: false
})
},
_defaultOptionsRules: function() {
return this.callBase().concat([{
device: function() {
return "desktop" === devices.real().deviceType && !devices.isSimulator()
},
options: {
focusStateEnabled: true
}
}])
},
_canValueBeChangedByClick: function() {
return true
},
_feedbackHideTimeout: CHECKBOX_FEEDBACK_HIDE_TIMEOUT,
_initMarkup: function() {
this._renderSubmitElement();
this._$container = $("
").addClass(CHECKBOX_CONTAINER_CLASS);
this.setAria("role", "checkbox");
this.$element().addClass(CHECKBOX_CLASS);
this._renderValue();
this._renderIcon();
this._renderText();
this.option("useInkRipple") && this._renderInkRipple();
this.$element().append(this._$container);
this.callBase()
},
_render: function() {
this._renderClick();
this.callBase()
},
_renderSubmitElement: function() {
this._$submitElement = $("
").attr("type", "hidden").appendTo(this.$element())
},
_getSubmitElement: function() {
return this._$submitElement
},
_renderInkRipple: function() {
this._inkRipple = inkRipple.render({
waveSizeCoefficient: 2.5,
useHoldAnimation: false,
wavesNumber: 2,
isCentered: true
})
},
_renderInkWave: function(element, dxEvent, doRender, waveIndex) {
if (!this._inkRipple) {
return
}
var config = {
element: element,
event: dxEvent,
wave: waveIndex
};
if (doRender) {
this._inkRipple.showWave(config)
} else {
this._inkRipple.hideWave(config)
}
},
_updateFocusState: function(e, value) {
this.callBase.apply(this, arguments);
this._renderInkWave(this._$icon, e, value, 0)
},
_toggleActiveState: function($element, value, e) {
this.callBase.apply(this, arguments);
this._renderInkWave(this._$icon, e, value, 1)
},
_renderIcon: function() {
this._$icon = $("
").addClass(CHECKBOX_ICON_CLASS).prependTo(this._$container)
},
_renderText: function() {
var textValue = this.option("text");
if (!textValue) {
if (this._$text) {
this._$text.remove();
this.$element().removeClass(CHECKBOX_HAS_TEXT_CLASS)
}
return
}
if (!this._$text) {
this._$text = $("").addClass(CHECKBOX_TEXT_CLASS)
}
this._$text.text(textValue);
this._$container.append(this._$text);
this.$element().addClass(CHECKBOX_HAS_TEXT_CLASS)
},
_renderClick: function() {
var that = this;
var eventName = eventUtils.addNamespace(clickEvent.name, that.NAME);
that._clickAction = that._createAction(that._clickHandler);
eventsEngine.off(that.$element(), eventName);
eventsEngine.on(that.$element(), eventName, function(e) {
that._clickAction({
event: e
})
})
},
_clickHandler: function(args) {
var that = args.component;
that._saveValueChangeEvent(args.event);
that.option("value", !that.option("value"))
},
_renderValue: function() {
var $element = this.$element();
var checked = this.option("value");
var indeterminate = void 0 === checked;
$element.toggleClass(CHECKBOX_CHECKED_CLASS, Boolean(checked));
$element.toggleClass(CHECKBOX_INDETERMINATE_CLASS, indeterminate);
this._getSubmitElement().val(checked);
this.setAria("checked", indeterminate ? "mixed" : checked || "false")
},
_optionChanged: function(args) {
switch (args.name) {
case "useInkRipple":
this._invalidate();
break;
case "value":
this._renderValue();
this.callBase(args);
break;
case "text":
this._renderText();
this._renderDimensions();
break;
default:
this.callBase(args)
}
},
_clean: function() {
delete this._inkRipple;
this.callBase()
}
});
registerComponent("dxCheckBox", CheckBox);
module.exports = CheckBox
},
/*!*************************************************!*\
!*** ./artifacts/transpiled/ui/context_menu.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _ui = __webpack_require__( /*! ./context_menu/ui.context_menu */ 330);
var _ui2 = _interopRequireDefault(_ui);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
module.exports = _ui2.default
},
/*!*********************************************************!*\
!*** ./artifacts/transpiled/ui/shared/accessibility.js ***!
\*********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _utils = __webpack_require__( /*! ../../events/utils */ 8);
var _utils2 = _interopRequireDefault(_utils);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var FOCUS_STATE_CLASS = "dx-state-focused";
var FOCUS_DISABLED_CLASS = "dx-cell-focus-disabled";
var FOCUSED_ROW_SELECTOR = ".dx-row-focused";
var GRID_ROW_SELECTOR = ".dx-datagrid-rowsview .dx-row";
var GRID_CELL_SELECTOR = "".concat(GRID_ROW_SELECTOR, " > td");
var TREELIST_ROW_SELECTOR = ".dx-treelist-rowsview .dx-row";
var TREELIST_CELL_SELECTOR = "".concat(TREELIST_ROW_SELECTOR, " > td");
var viewItemSelectorMap = {
groupPanel: [".dx-datagrid-group-panel .dx-group-panel-item[tabindex]"],
columnHeaders: [".dx-datagrid-headers .dx-header-row > td.dx-datagrid-action", ".dx-treelist-headers .dx-header-row > td.dx-treelist-action"],
filterRow: [".dx-datagrid-headers .dx-datagrid-filter-row .dx-editor-cell .dx-texteditor-input", ".dx-treelist-headers .dx-treelist-filter-row .dx-editor-cell .dx-texteditor-input"],
rowsView: ["".concat(FOCUSED_ROW_SELECTOR), "".concat(GRID_ROW_SELECTOR, "[tabindex]"), "".concat(GRID_CELL_SELECTOR, "[tabindex]"), "".concat(GRID_CELL_SELECTOR), "".concat(TREELIST_ROW_SELECTOR, "[tabindex]"), "".concat(TREELIST_CELL_SELECTOR, "[tabindex]"), "".concat(TREELIST_CELL_SELECTOR)],
footer: [".dx-datagrid-total-footer .dx-datagrid-summary-item", ".dx-treelist-total-footer .dx-treelist-summary-item"],
filterPanel: [".dx-datagrid-filter-panel .dx-icon-filter", ".dx-treelist-filter-panel .dx-icon-filter"],
pager: [".dx-datagrid-pager [tabindex]", ".dx-treelist-pager [tabindex]"]
};
var isMouseDown = false;
var isHiddenFocusing = false;
var focusedElementInfo = null;
function processKeyDown(viewName, instance, event, action, $mainElement, executeKeyDown) {
var isHandled = fireKeyDownEvent(instance, event.originalEvent, executeKeyDown);
if (isHandled) {
return
}
var keyName = _utils2.default.normalizeKeyName(event);
if ("enter" === keyName || "space" === keyName) {
saveFocusedElementInfo(event.target, instance);
action && action({
event: event
})
} else {
if ("tab" === keyName) {
$mainElement.addClass(FOCUS_STATE_CLASS)
} else {
module.exports.selectView(viewName, instance, event)
}
}
}
function saveFocusedElementInfo(target, instance) {
var $target = (0, _renderer2.default)(target);
var ariaLabel = $target.attr("aria-label");
var $activeElements = getActiveAccessibleElements(ariaLabel, instance.element());
var targetIndex = $activeElements.index($target);
focusedElementInfo = (0, _extend.extend)({}, {
ariaLabel: ariaLabel,
index: targetIndex
}, {
viewInstance: instance
})
}
function getActiveAccessibleElements(ariaLabel, viewElement) {
var $viewElement = (0, _renderer2.default)(viewElement);
var $activeElements;
if (ariaLabel) {
$activeElements = $viewElement.find('[aria-label="'.concat(ariaLabel, '"][tabindex]'))
} else {
$activeElements = $viewElement.find("[tabindex]")
}
return $activeElements
}
function findFocusedViewElement(viewSelectors) {
for (var index in viewSelectors) {
var selector = viewSelectors[index];
var $focusViewElement = (0, _renderer2.default)(selector).first();
if ($focusViewElement.length) {
return $focusViewElement
}
}
}
function fireKeyDownEvent(instance, event, executeAction) {
var args = {
event: event,
handled: false
};
if (executeAction) {
executeAction(args)
} else {
instance._createActionByOption("onKeyDown")(args)
}
return args.handled
}
module.exports = {
hiddenFocus: function(element) {
isHiddenFocusing = true;
element.focus();
isHiddenFocusing = false
},
registerKeyboardAction: function(viewName, instance, $element, selector, action, executeKeyDown) {
if (instance.option("useLegacyKeyboardNavigation")) {
return
}
var $mainElement = (0, _renderer2.default)(instance.element());
_events_engine2.default.on($element, "keydown", selector, function(e) {
return processKeyDown(viewName, instance, e, action, $mainElement, executeKeyDown)
});
_events_engine2.default.on($element, "mousedown", selector, function() {
isMouseDown = true;
$mainElement.removeClass(FOCUS_STATE_CLASS)
});
_events_engine2.default.on($element, "focusin", selector, function() {
if (!isMouseDown && !isHiddenFocusing) {
$mainElement.addClass(FOCUS_STATE_CLASS)
}
isMouseDown = false
})
},
restoreFocus: function(instance) {
if (!instance.option("useLegacyKeyboardNavigation") && focusedElementInfo) {
var viewInstance = focusedElementInfo.viewInstance;
if (viewInstance) {
var $activeElements = getActiveAccessibleElements(focusedElementInfo.ariaLabel, viewInstance.element());
var $targetElement = $activeElements.eq(focusedElementInfo.index);
focusedElementInfo = null;
_events_engine2.default.trigger($targetElement, "focus")
}
}
},
selectView: function(viewName, instance, event) {
var keyName = _utils2.default.normalizeKeyName(event);
if (event.ctrlKey && ("upArrow" === keyName || "downArrow" === keyName)) {
var viewNames = Object.keys(viewItemSelectorMap);
var viewItemIndex = viewNames.indexOf(viewName);
while (viewItemIndex >= 0 && viewItemIndex < viewNames.length) {
viewItemIndex = "upArrow" === keyName ? --viewItemIndex : ++viewItemIndex;
var _viewName = viewNames[viewItemIndex];
var viewSelectors = viewItemSelectorMap[_viewName];
var $focusViewElement = findFocusedViewElement(viewSelectors);
if ($focusViewElement && $focusViewElement.length) {
$focusViewElement.attr("tabindex", instance.option("tabindex") || 0);
_events_engine2.default.trigger($focusViewElement, "focus");
$focusViewElement.removeClass(FOCUS_DISABLED_CLASS);
break
}
}
}
},
setTabIndex: function(instance, $element) {
if (!instance.option("useLegacyKeyboardnavigation")) {
$element.attr("tabindex", instance.option("tabindex") || 0)
}
}
}
}, , , , ,
/*!**********************************************************!*\
!*** ./artifacts/transpiled/ui/widget/empty_template.js ***!
\**********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
var EmptyTemplate = TemplateBase.inherit({
_renderCore: function() {
return $()
}
});
module.exports = EmptyTemplate
},
/*!**************************************************!*\
!*** ./artifacts/transpiled/data/odata/utils.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
var Class = __webpack_require__( /*! ../../core/class */ 15);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
var _Guid = __webpack_require__( /*! ../../core/guid */ 40);
var isDefined = typeUtils.isDefined;
var isPlainObject = typeUtils.isPlainObject;
var grep = __webpack_require__( /*! ../../core/utils/common */ 4).grep;
var Deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6).Deferred;
var errors = __webpack_require__( /*! ../errors */ 36).errors;
var dataUtils = __webpack_require__( /*! ../utils */ 41);
var GUID_REGEX = /^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$/;
var VERBOSE_DATE_REGEX = /^\/Date\((-?\d+)((\+|-)?(\d+)?)\)\/$/;
var ISO8601_DATE_REGEX = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[-+]{1}\d{2}(:?)(\d{2})?)?$/;
var JSON_VERBOSE_MIME_TYPE = "application/json;odata=verbose";
var makeArray = function(value) {
return "string" === typeUtils.type(value) ? value.split() : value
};
var hasDot = function(x) {
return /\./.test(x)
};
var pad = function(text, length, right) {
text = String(text);
while (text.length < length) {
text = right ? text + "0" : "0" + text
}
return text
};
function formatISO8601(date, skipZeroTime, skipTimezone) {
var bag = [];
var isZeroTime = function() {
return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1
};
var padLeft2 = function(text) {
return pad(text, 2)
};
bag.push(date.getFullYear());
bag.push("-");
bag.push(padLeft2(date.getMonth() + 1));
bag.push("-");
bag.push(padLeft2(date.getDate()));
if (!(skipZeroTime && isZeroTime())) {
bag.push("T");
bag.push(padLeft2(date.getHours()));
bag.push(":");
bag.push(padLeft2(date.getMinutes()));
bag.push(":");
bag.push(padLeft2(date.getSeconds()));
if (date.getMilliseconds()) {
bag.push(".");
bag.push(pad(date.getMilliseconds(), 3))
}
if (!skipTimezone) {
bag.push("Z")
}
}
return bag.join("")
}
function parseISO8601(isoString) {
var result = new Date(60 * new Date(0).getTimezoneOffset() * 1e3);
var chunks = isoString.replace("Z", "").split("T");
var date = /(\d{4})-(\d{2})-(\d{2})/.exec(chunks[0]);
var time = /(\d{2}):(\d{2}):(\d{2})\.?(\d{0,7})?/.exec(chunks[1]);
result.setFullYear(Number(date[1]));
result.setMonth(Number(date[2]) - 1);
result.setDate(Number(date[3]));
if (Array.isArray(time) && time.length) {
result.setHours(Number(time[1]));
result.setMinutes(Number(time[2]));
result.setSeconds(Number(time[3]));
var fractional = (time[4] || "").slice(0, 3);
fractional = pad(fractional, 3, true);
result.setMilliseconds(Number(fractional))
}
return result
}
function isAbsoluteUrl(url) {
return /^(?:[a-z]+:)?\/\//i.test(url)
}
function toAbsoluteUrl(basePath, relativePath) {
var part;
var baseParts = stripParams(basePath).split("/");
var relativeParts = relativePath.split("/");
function stripParams(url) {
var index = url.indexOf("?");
if (index > -1) {
return url.substr(0, index)
}
return url
}
baseParts.pop();
while (relativeParts.length) {
part = relativeParts.shift();
if (".." === part) {
baseParts.pop()
} else {
baseParts.push(part)
}
}
return baseParts.join("/")
}
var param = function(params) {
var result = [];
for (var name in params) {
result.push(name + "=" + params[name])
}
return result.join("&")
};
var ajaxOptionsForRequest = function(protocolVersion, request, options) {
request = extend({
async: true,
method: "get",
url: "",
params: {},
payload: null,
headers: {},
timeout: 3e4
}, request);
options = options || {};
var beforeSend = options.beforeSend;
if (beforeSend) {
beforeSend(request)
}
var method = (request.method || "get").toLowerCase();
var isGet = "get" === method;
var useJsonp = isGet && options.jsonp;
var params = extend({}, request.params);
var ajaxData = isGet ? params : formatPayload(request.payload);
var qs = !isGet && param(params);
var url = request.url;
var contentType = !isGet && JSON_VERBOSE_MIME_TYPE;
if (qs) {
url += (url.indexOf("?") > -1 ? "&" : "?") + qs
}
if (useJsonp) {
ajaxData.$format = "json"
}
return {
url: url,
data: ajaxData,
dataType: useJsonp ? "jsonp" : "json",
jsonp: useJsonp && "$callback",
method: method,
async: request.async,
timeout: request.timeout,
headers: request.headers,
contentType: contentType,
accepts: {
json: [JSON_VERBOSE_MIME_TYPE, "text/plain"].join()
},
xhrFields: {
withCredentials: options.withCredentials
}
};
function formatPayload(payload) {
return JSON.stringify(payload, function(key, value) {
if (!(this[key] instanceof Date)) {
return value
}
value = formatISO8601(this[key]);
switch (protocolVersion) {
case 2:
return value.substr(0, value.length - 1);
case 3:
case 4:
return value;
default:
throw errors.Error("E4002")
}
})
}
};
var sendRequest = function sendRequest(protocolVersion, request, options) {
var d = new Deferred;
var ajaxOptions = ajaxOptionsForRequest(protocolVersion, request, options);
ajax.sendRequest(ajaxOptions).always(function(obj, textStatus) {
var transformOptions = {
deserializeDates: options.deserializeDates,
fieldTypes: options.fieldTypes
};
var tuple = interpretJsonFormat(obj, textStatus, transformOptions, ajaxOptions);
var error = tuple.error;
var data = tuple.data;
var nextUrl = tuple.nextUrl;
var extra;
if (error) {
if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
d.reject(error)
}
} else {
if (options.countOnly) {
if (isFinite(tuple.count)) {
d.resolve(tuple.count)
} else {
d.reject(new errors.Error("E4018"))
}
} else {
if (nextUrl && !options.isPaged) {
if (!isAbsoluteUrl(nextUrl)) {
nextUrl = toAbsoluteUrl(ajaxOptions.url, nextUrl)
}
sendRequest(protocolVersion, {
url: nextUrl
}, options).fail(d.reject).done(function(nextData) {
d.resolve(data.concat(nextData))
})
} else {
if (isFinite(tuple.count)) {
extra = {
totalCount: tuple.count
}
}
d.resolve(data, extra)
}
}
}
});
return d.promise()
};
var formatDotNetError = function(errorObj) {
var message;
var currentError = errorObj;
if ("message" in errorObj) {
if (errorObj.message.value) {
message = errorObj.message.value
} else {
message = errorObj.message
}
}
while (currentError = currentError.innererror || currentError.internalexception) {
message = currentError.message;
if (currentError.internalexception && message.indexOf("inner exception") === -1) {
break
}
}
return message
};
var errorFromResponse = function(obj, textStatus, ajaxOptions) {
if ("nocontent" === textStatus) {
return null
}
var message = "Unknown error";
var response = obj;
var httpStatus = 200;
var errorData = {
requestOptions: ajaxOptions
};
if ("success" !== textStatus) {
httpStatus = obj.status;
message = dataUtils.errorMessageFromXhr(obj, textStatus);
try {
response = JSON.parse(obj.responseText)
} catch (x) {}
}
var errorObj = response && (response.then && response || response.error || response["odata.error"] || response["@odata.error"]);
if (errorObj) {
message = formatDotNetError(errorObj) || message;
errorData.errorDetails = errorObj;
if (200 === httpStatus) {
httpStatus = 500
}
var customCode = Number(errorObj.code);
if (isFinite(customCode) && customCode >= 400) {
httpStatus = customCode
}
}
if (httpStatus >= 400 || 0 === httpStatus) {
errorData.httpStatus = httpStatus;
return extend(Error(message), errorData)
}
return null
};
var interpretJsonFormat = function(obj, textStatus, transformOptions, ajaxOptions) {
var error = errorFromResponse(obj, textStatus, ajaxOptions);
var value;
if (error) {
return {
error: error
}
}
if (!isPlainObject(obj)) {
return {
data: obj
}
}
if ("d" in obj && (Array.isArray(obj.d) || typeUtils.isObject(obj.d))) {
value = interpretVerboseJsonFormat(obj, textStatus)
} else {
value = interpretLightJsonFormat(obj, textStatus)
}
transformTypes(value, transformOptions);
return value
};
var interpretVerboseJsonFormat = function(obj) {
var data = obj.d;
if (!isDefined(data)) {
return {
error: Error("Malformed or unsupported JSON response received")
}
}
if (isDefined(data.results)) {
data = data.results
}
return {
data: data,
nextUrl: obj.d.__next,
count: parseInt(obj.d.__count, 10)
}
};
var interpretLightJsonFormat = function(obj) {
var data = obj;
if (isDefined(data.value)) {
data = data.value
}
return {
data: data,
nextUrl: obj["@odata.nextLink"],
count: parseInt(obj["@odata.count"], 10)
}
};
var EdmLiteral = Class.inherit({
ctor: function(value) {
this._value = value
},
valueOf: function() {
return this._value
}
});
var transformTypes = function transformTypes(obj, options) {
options = options || {};
each(obj, function(key, value) {
if (null !== value && "object" === _typeof(value)) {
if ("results" in value) {
obj[key] = value.results
}
transformTypes(obj[key], options)
} else {
if ("string" === typeof value) {
var fieldTypes = options.fieldTypes;
var canBeGuid = !fieldTypes || "String" !== fieldTypes[key];
if (canBeGuid && GUID_REGEX.test(value)) {
obj[key] = new _Guid(value)
}
if (false !== options.deserializeDates) {
if (value.match(VERBOSE_DATE_REGEX)) {
var date = new Date(Number(RegExp.$1) + 60 * RegExp.$2 * 1e3);
obj[key] = new Date(date.valueOf() + 60 * date.getTimezoneOffset() * 1e3)
} else {
if (ISO8601_DATE_REGEX.test(value)) {
obj[key] = new Date(parseISO8601(obj[key]).valueOf())
}
}
}
}
}
})
};
var serializeDate = function(date) {
return "datetime'" + formatISO8601(date, true, true) + "'"
};
var serializeString = function(value) {
return "'" + value.replace(/'/g, "''") + "'"
};
var serializePropName = function(propName) {
if (propName instanceof EdmLiteral) {
return propName.valueOf()
}
return propName.replace(/\./g, "/")
};
var serializeValueV4 = function serializeValueV4(value) {
if (value instanceof Date) {
return formatISO8601(value, false, false)
}
if (value instanceof _Guid) {
return value.valueOf()
}
if (Array.isArray(value)) {
return "[" + value.map(function(item) {
return serializeValueV4(item)
}).join(",") + "]"
}
return serializeValueV2(value)
};
var serializeValueV2 = function(value) {
if (value instanceof Date) {
return serializeDate(value)
}
if (value instanceof _Guid) {
return "guid'" + value + "'"
}
if (value instanceof EdmLiteral) {
return value.valueOf()
}
if ("string" === typeof value) {
return serializeString(value)
}
return String(value)
};
var serializeValue = function(value, protocolVersion) {
switch (protocolVersion) {
case 2:
case 3:
return serializeValueV2(value);
case 4:
return serializeValueV4(value);
default:
throw errors.Error("E4002")
}
};
var serializeKey = function(key, protocolVersion) {
if (isPlainObject(key)) {
var parts = [];
each(key, function(k, v) {
parts.push(serializePropName(k) + "=" + serializeValue(v, protocolVersion))
});
return parts.join()
}
return serializeValue(key, protocolVersion)
};
var keyConverters = {
String: function(value) {
return value + ""
},
Int32: function(value) {
return Math.floor(value)
},
Int64: function(value) {
if (value instanceof EdmLiteral) {
return value
}
return new EdmLiteral(value + "L")
},
Guid: function(value) {
if (value instanceof _Guid) {
return value
}
return new _Guid(value)
},
Boolean: function(value) {
return !!value
},
Single: function(value) {
if (value instanceof EdmLiteral) {
return value
}
return new EdmLiteral(value + "f")
},
Decimal: function(value) {
if (value instanceof EdmLiteral) {
return value
}
return new EdmLiteral(value + "m")
}
};
var convertPrimitiveValue = function(type, value) {
if (null === value) {
return null
}
var converter = keyConverters[type];
if (!converter) {
throw errors.Error("E4014", type)
}
return converter(value)
};
var generateSelect = function(oDataVersion, select) {
if (!select) {
return
}
if (oDataVersion < 4) {
return serializePropName(select.join())
}
return grep(select, hasDot, true).join()
};
var generateExpand = function(oDataVersion, expand, select) {
var generatorV2 = function() {
var hash = {};
if (expand) {
iteratorUtils.each(makeArray(expand), function() {
hash[serializePropName(this)] = 1
})
}
if (select) {
iteratorUtils.each(makeArray(select), function() {
var path = this.split(".");
if (path.length < 2) {
return
}
path.pop();
hash[serializePropName(path.join("."))] = 1
})
}
return iteratorUtils.map(hash, function(k, v) {
return v
}).join()
};
var generatorV4 = function() {
var format = function(hash) {
var formatCore = function formatCore(hash) {
var result = "";
var selectValue = [];
var expandValue = [];
iteratorUtils.each(hash, function(key, value) {
if (Array.isArray(value)) {
[].push.apply(selectValue, value)
}
if (isPlainObject(value)) {
expandValue.push(key + formatCore(value))
}
});
if (selectValue.length || expandValue.length) {
result += "(";
if (selectValue.length) {
result += "$select=" + iteratorUtils.map(selectValue, serializePropName).join()
}
if (expandValue.length) {
if (selectValue.length) {
result += ";"
}
result += "$expand=" + iteratorUtils.map(expandValue, serializePropName).join()
}
result += ")"
}
return result
};
var result = [];
iteratorUtils.each(hash, function(key, value) {
result.push(key + formatCore(value))
});
return result.join()
};
var parseTree = function(exprs, root, stepper) {
var parseCore = function parseCore(exprParts, root, stepper) {
var result = stepper(root, exprParts.shift(), exprParts);
if (false === result) {
return
}
parseCore(exprParts, result, stepper)
};
iteratorUtils.each(exprs, function(_, x) {
parseCore(x.split("."), root, stepper)
})
};
var hash = {};
if (expand || select) {
if (expand) {
parseTree(makeArray(expand), hash, function(node, key, path) {
node[key] = node[key] || {};
if (!path.length) {
return false
}
return node[key]
})
}
if (select) {
parseTree(grep(makeArray(select), hasDot), hash, function(node, key, path) {
if (!path.length) {
node[key] = node[key] || [];
node[key].push(key);
return false
}
return node[key] = node[key] || {}
})
}
return format(hash)
}
};
if (oDataVersion < 4) {
return generatorV2()
}
return generatorV4()
};
exports.sendRequest = sendRequest;
exports.serializePropName = serializePropName;
exports.serializeValue = serializeValue;
exports.serializeKey = serializeKey;
exports.keyConverters = keyConverters;
exports.convertPrimitiveValue = convertPrimitiveValue;
exports.generateExpand = generateExpand;
exports.generateSelect = generateSelect;
exports.EdmLiteral = EdmLiteral;
exports.OData__internals = {
interpretJsonFormat: interpretJsonFormat
}
},
/*!*********************************************!*\
!*** ./artifacts/transpiled/core/action.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ./renderer */ 2);
var config = __webpack_require__( /*! ./config */ 31);
var window = __webpack_require__( /*! ./utils/window */ 7).getWindow();
var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
var each = __webpack_require__( /*! ./utils/iterator */ 3).each;
var Class = __webpack_require__( /*! ./class */ 15);
var errors = __webpack_require__( /*! ./errors */ 21);
var Action = Class.inherit({
ctor: function(action, config) {
config = config || {};
this._action = action;
this._context = config.context || window;
this._beforeExecute = config.beforeExecute;
this._afterExecute = config.afterExecute;
this._component = config.component;
this._validatingTargetName = config.validatingTargetName;
var excludeValidators = this._excludeValidators = {};
if (config.excludeValidators) {
for (var i = 0; i < config.excludeValidators.length; i++) {
excludeValidators[config.excludeValidators[i]] = true
}
}
},
execute: function() {
var e = {
action: this._action,
args: Array.prototype.slice.call(arguments),
context: this._context,
component: this._component,
validatingTargetName: this._validatingTargetName,
cancel: false,
handled: false
};
var beforeExecute = this._beforeExecute;
var afterExecute = this._afterExecute;
var argsBag = e.args[0] || {};
if ("jQueryEvent" in argsBag && !argsBag.event) {
throw "The jQueryEvent field is deprecated. Please, use the `event` field instead"
}
if (!("jQueryEvent" in argsBag) && argsBag.event && config().useJQuery) {
Object.defineProperty(argsBag, "jQueryEvent", {
get: function() {
errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
return argsBag.event
},
set: function(value) {
errors.log("W0003", "Handler argument", "jQueryEvent", "17.2", "Use the 'event' field instead");
argsBag.event = value
}
})
}
if (!this._validateAction(e)) {
return
}
beforeExecute && beforeExecute.call(this._context, e);
if (e.cancel) {
return
}
var result = this._executeAction(e);
if (argsBag.cancel) {
return
}
afterExecute && afterExecute.call(this._context, e);
return result
},
_validateAction: function(e) {
var excludeValidators = this._excludeValidators;
var executors = Action.executors;
for (var name in executors) {
if (!excludeValidators[name]) {
var executor = executors[name];
if (executor.validate) {
executor.validate(e)
}
if (e.cancel) {
return false
}
}
}
return true
},
_executeAction: function(e) {
var result;
var executors = Action.executors;
for (var name in executors) {
var executor = executors[name];
if (executor.execute) {
executor.execute(e)
}
if (e.handled) {
result = e.result;
break
}
}
return result
}
});
Action.executors = {};
Action.registerExecutor = function(name, executor) {
if (typeUtils.isPlainObject(name)) {
each(name, Action.registerExecutor);
return
}
Action.executors[name] = executor
};
Action.unregisterExecutor = function() {
var args = [].slice.call(arguments);
each(args, function() {
delete Action.executors[this]
})
};
Action.registerExecutor({
undefined: {
execute: function(e) {
if (!e.action) {
e.result = void 0;
e.handled = true
}
}
},
func: {
execute: function(e) {
if (typeUtils.isFunction(e.action)) {
e.result = e.action.call(e.context, e.args[0]);
e.handled = true
}
}
}
});
var createValidatorByTargetElement = function(condition) {
return function(e) {
if (!e.args.length) {
return
}
var args = e.args[0];
var element = args[e.validatingTargetName] || args.element;
if (element && condition($(element))) {
e.cancel = true
}
}
};
Action.registerExecutor({
disabled: {
validate: createValidatorByTargetElement(function($target) {
return $target.is(".dx-state-disabled, .dx-state-disabled *")
})
},
readOnly: {
validate: createValidatorByTargetElement(function($target) {
return $target.is(".dx-state-readonly, .dx-state-readonly *")
})
}
});
module.exports = Action
},
/*!*************************************************!*\
!*** ./artifacts/transpiled/animation/frame.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
var window = windowUtils.hasWindow() ? windowUtils.getWindow() : {};
var callOnce = __webpack_require__( /*! ../core/utils/call_once */ 63);
var FRAME_ANIMATION_STEP_TIME = 1e3 / 60;
var request = function(callback) {
return setTimeout(callback, FRAME_ANIMATION_STEP_TIME)
};
var cancel = function(requestID) {
clearTimeout(requestID)
};
var setAnimationFrameMethods = callOnce(function() {
var nativeRequest = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
var nativeCancel = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
if (nativeRequest && nativeCancel) {
request = nativeRequest;
cancel = nativeCancel
}
if (nativeRequest && !nativeCancel) {
var canceledRequests = {};
request = function(callback) {
var requestId = nativeRequest.call(window, function() {
try {
if (requestId in canceledRequests) {
return
}
callback.apply(this, arguments)
} finally {
delete canceledRequests[requestId]
}
});
return requestId
};
cancel = function(requestId) {
canceledRequests[requestId] = true
}
}
});
exports.requestAnimationFrame = function() {
setAnimationFrameMethods();
return request.apply(window, arguments)
};
exports.cancelAnimationFrame = function() {
setAnimationFrameMethods();
cancel.apply(window, arguments)
}
},
/*!***********************************************************************!*\
!*** ./artifacts/transpiled/ui/file_manager/ui.file_manager.utils.js ***!
\***********************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var PATH_SEPARATOR = "/";
var getFileExtension = function(path) {
var index = path.lastIndexOf(".");
return index !== -1 ? path.substr(index) : ""
};
var getName = function(path) {
var index = path.lastIndexOf(PATH_SEPARATOR);
return index !== -1 ? path.substr(index + PATH_SEPARATOR.length) : path
};
var getParentPath = function(path) {
var index = path.lastIndexOf(PATH_SEPARATOR);
return index !== -1 ? path.substr(0, index) : ""
};
var getPathParts = function(path, includeFullPath) {
var result = path.split(PATH_SEPARATOR);
if (includeFullPath) {
for (var i = 0; i < result.length; i++) {
result[i] = pathCombine(0 === i ? "" : result[i - 1], result[i])
}
}
return result
};
var pathCombine = function() {
var result = "";
(0, _iterator.each)(arguments, function(_, arg) {
if (arg) {
if (result) {
result += PATH_SEPARATOR
}
result += arg
}
});
return result
};
var getDisplayFileSize = function(byteSize) {
var sizesTitles = ["B", "KB", "MB", "GB", "TB"];
var index = 0;
var displaySize = byteSize;
while (displaySize >= 1024 && index <= sizesTitles.length - 1) {
displaySize /= 1024;
index++
}
displaySize = Math.round(10 * displaySize) / 10;
return "".concat(displaySize, " ").concat(sizesTitles[index])
};
module.exports.getFileExtension = getFileExtension;
module.exports.getName = getName;
module.exports.getParentPath = getParentPath;
module.exports.getPathParts = getPathParts;
module.exports.pathCombine = pathCombine;
module.exports.getDisplayFileSize = getDisplayFileSize
},
/*!***********************************************!*\
!*** ./artifacts/transpiled/ui/number_box.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./number_box/number_box */ 531)
},
/*!***********************************************************!*\
!*** ./artifacts/transpiled/ui/date_box/ui.date_utils.js ***!
\***********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var dateSerialization = __webpack_require__( /*! ../../core/utils/date_serialization */ 52);
var isDate = __webpack_require__( /*! ../../core/utils/type */ 1).isDate;
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var dateLocalization = __webpack_require__( /*! ../../localization/date */ 32);
var dateComponents = function() {
return ["year", "day", "month", "day"]
};
var ONE_MINUTE = 6e4;
var ONE_DAY = 60 * ONE_MINUTE * 24;
var ONE_YEAR = 365 * ONE_DAY;
var getStringFormat = function(format) {
var formatType = _typeof(format);
if ("string" === formatType) {
return "format"
}
if ("object" === formatType && void 0 !== format.type) {
return format.type
}
return null
};
var dateUtils = {
SUPPORTED_FORMATS: ["date", "time", "datetime"],
DATE_COMPONENT_TEXT_FORMATTER: function(value, name) {
var $container = $("").addClass("dx-dateview-formatter-container");
$("
").text(value).addClass("dx-dateview-value-formatter").appendTo($container);
$("").text(name).addClass("dx-dateview-name-formatter").appendTo($container);
return $container
},
ONE_MINUTE: ONE_MINUTE,
ONE_DAY: ONE_DAY,
ONE_YEAR: ONE_YEAR,
MIN_DATEVIEW_DEFAULT_DATE: new Date(1900, 0, 1),
MAX_DATEVIEW_DEFAULT_DATE: function() {
var newDate = new Date;
return new Date(newDate.getFullYear() + 50, newDate.getMonth(), newDate.getDate(), 23, 59, 59)
}(),
FORMATS_INFO: {
date: {
getStandardPattern: function() {
return "yyyy-MM-dd"
},
components: dateComponents()
},
time: {
getStandardPattern: function() {
return "HH:mm"
},
components: ["hours", "minutes", "seconds", "milliseconds"]
},
datetime: {
getStandardPattern: function() {
var standardPattern;
! function() {
var androidFormatPattern = "yyyy-MM-ddTHH:mmZ";
var testDateString = "2000-01-01T01:01Z";
var $input = $("").attr("type", "datetime");
$input.val(testDateString);
if ($input.val()) {
standardPattern = androidFormatPattern
}
}();
if (!standardPattern) {
standardPattern = "yyyy-MM-ddTHH:mm:ssZ"
}
dateUtils.FORMATS_INFO.datetime.getStandardPattern = function() {
return standardPattern
};
return standardPattern
},
components: dateComponents().concat(["hours", "minutes", "seconds", "milliseconds"])
},
"datetime-local": {
getStandardPattern: function() {
return "yyyy-MM-ddTHH:mm:ss"
},
components: dateComponents().concat(["hours", "minutes", "seconds"])
}
},
FORMATS_MAP: {
date: "shortdate",
time: "shorttime",
datetime: "shortdateshorttime"
},
SUBMIT_FORMATS_MAP: {
date: "date",
time: "time",
datetime: "datetime-local"
},
toStandardDateFormat: function(date, type) {
var pattern = dateUtils.FORMATS_INFO[type].getStandardPattern();
return dateSerialization.serializeDate(date, pattern)
},
fromStandardDateFormat: function(text) {
var date = dateSerialization.dateParser(text);
return isDate(date) ? date : void 0
},
getMaxMonthDay: function(year, month) {
return new Date(year, month + 1, 0).getDate()
},
mergeDates: function(oldValue, newValue, format) {
if (!newValue) {
return newValue || null
}
if (!oldValue || isNaN(oldValue.getTime())) {
var now = new Date(null);
oldValue = new Date(now.getFullYear(), now.getMonth(), now.getDate())
}
var result = new Date(oldValue.valueOf());
var formatInfo = dateUtils.FORMATS_INFO[format];
each(formatInfo.components, function() {
var componentInfo = dateUtils.DATE_COMPONENTS_INFO[this];
result[componentInfo.setter](newValue[componentInfo.getter]())
});
return result
},
getLongestCaptionIndex: function(captionArray) {
var longestIndex = 0;
var longestCaptionLength = 0;
var i;
for (i = 0; i < captionArray.length; ++i) {
if (captionArray[i].length > longestCaptionLength) {
longestIndex = i;
longestCaptionLength = captionArray[i].length
}
}
return longestIndex
},
formatUsesMonthName: function(format) {
return dateLocalization.formatUsesMonthName(format)
},
formatUsesDayName: function(format) {
return dateLocalization.formatUsesDayName(format)
},
getLongestDate: function(format, monthNames, dayNames) {
var stringFormat = getStringFormat(format);
var month = 9;
if (!stringFormat || dateUtils.formatUsesMonthName(stringFormat)) {
month = dateUtils.getLongestCaptionIndex(monthNames)
}
var longestDate = new Date(1888, month, 21, 23, 59, 59, 999);
if (!stringFormat || dateUtils.formatUsesDayName(stringFormat)) {
var date = longestDate.getDate() - longestDate.getDay() + dateUtils.getLongestCaptionIndex(dayNames);
longestDate.setDate(date)
}
return longestDate
},
normalizeTime: function(date) {
date.setSeconds(0);
date.setMilliseconds(0)
}
};
dateUtils.DATE_COMPONENTS_INFO = {
year: {
getter: "getFullYear",
setter: "setFullYear",
formatter: function(value, showNames, date) {
var formatDate = new Date(date.getTime());
formatDate.setFullYear(value);
return dateLocalization.format(formatDate, "yyyy")
},
startValue: void 0,
endValue: void 0
},
day: {
getter: "getDate",
setter: "setDate",
formatter: function(value, showNames, date) {
var formatDate = new Date(date.getTime());
formatDate.setDate(value);
if (!showNames) {
return dateLocalization.format(formatDate, "d")
}
return dateUtils.DATE_COMPONENT_TEXT_FORMATTER(value, dateLocalization.getDayNames()[formatDate.getDay()])
},
startValue: 1,
endValue: void 0
},
month: {
getter: "getMonth",
setter: "setMonth",
formatter: function(value, showNames) {
var monthName = dateLocalization.getMonthNames()[value];
return showNames ? dateUtils.DATE_COMPONENT_TEXT_FORMATTER(value + 1, monthName) : monthName
},
startValue: 0,
endValue: 11
},
hours: {
getter: "getHours",
setter: "setHours",
formatter: function(value) {
return dateLocalization.format(new Date(0, 0, 0, value), "hour")
},
startValue: 0,
endValue: 23
},
minutes: {
getter: "getMinutes",
setter: "setMinutes",
formatter: function(value) {
return dateLocalization.format(new Date(0, 0, 0, 0, value), "minute")
},
startValue: 0,
endValue: 59
},
seconds: {
getter: "getSeconds",
setter: "setSeconds",
formatter: function(value) {
return dateLocalization.format(new Date(0, 0, 0, 0, 0, value), "second")
},
startValue: 0,
endValue: 59
},
milliseconds: {
getter: "getMilliseconds",
setter: "setMilliseconds",
formatter: function(value) {
return dateLocalization.format(new Date(0, 0, 0, 0, 0, 0, value), "millisecond")
},
startValue: 0,
endValue: 999
}
};
module.exports = dateUtils
},
/*!***************************************************************************!*\
!*** ./artifacts/transpiled/ui/scheduler/ui.scheduler.publisher_mixin.js ***!
\***************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var publisherMixin = {
notifyObserver: function(subject, args) {
var observer = this.option("observer");
if (observer) {
observer.fire(subject, args)
}
},
invoke: function() {
var observer = this.option("observer");
if (observer) {
return observer.fire.apply(observer, arguments)
}
}
};
module.exports = publisherMixin
}, , , , , ,
/*!*************************************************************************!*\
!*** ./artifacts/transpiled/events/core/event_registrator_callbacks.js ***!
\*************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var MemorizedCallbacks = __webpack_require__( /*! ../../core/memorized_callbacks */ 177);
module.exports = new MemorizedCallbacks
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/events/core/emitter.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
var Class = __webpack_require__( /*! ../../core/class */ 15);
var Callbacks = __webpack_require__( /*! ../../core/utils/callbacks */ 26);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var Emitter = Class.inherit({
ctor: function(element) {
this._$element = $(element);
this._cancelCallback = Callbacks();
this._acceptCallback = Callbacks()
},
getElement: function() {
return this._$element
},
validate: function(e) {
return !eventUtils.isDxMouseWheelEvent(e)
},
validatePointers: function(e) {
return 1 === eventUtils.hasTouches(e)
},
allowInterruptionByMouseWheel: function() {
return true
},
configure: function(data) {
extend(this, data)
},
addCancelCallback: function(callback) {
this._cancelCallback.add(callback)
},
removeCancelCallback: function() {
this._cancelCallback.empty()
},
_cancel: function(e) {
this._cancelCallback.fire(this, e)
},
addAcceptCallback: function(callback) {
this._acceptCallback.add(callback)
},
removeAcceptCallback: function() {
this._acceptCallback.empty()
},
_accept: function(e) {
this._acceptCallback.fire(this, e)
},
_requestAccept: function(e) {
this._acceptRequestEvent = e
},
_forgetAccept: function() {
this._accept(this._acceptRequestEvent);
this._acceptRequestEvent = null
},
start: noop,
move: noop,
end: noop,
cancel: noop,
reset: function() {
if (this._acceptRequestEvent) {
this._accept(this._acceptRequestEvent)
}
},
_fireEvent: function(eventName, e, params) {
var eventData = extend({
type: eventName,
originalEvent: e,
target: this._getEmitterTarget(e),
delegateTarget: this.getElement().get(0)
}, params);
e = eventUtils.fireEvent(eventData);
if (e.cancel) {
this._cancel(e)
}
return e
},
_getEmitterTarget: function(e) {
return (this.delegateSelector ? $(e.target).closest(this.delegateSelector) : this.getElement()).get(0)
},
dispose: noop
});
module.exports = Emitter
},
/*!***************************************************!*\
!*** ./artifacts/transpiled/events/core/wheel.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
var registerEvent = __webpack_require__( /*! ./event_registrator */ 71);
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var EVENT_NAME = "dxmousewheel";
var EVENT_NAMESPACE = "dxWheel";
var getWheelEventName = callOnce(function() {
return domAdapter.hasDocumentProperty("onwheel") ? "wheel" : "mousewheel"
});
var wheel = {
setup: function(element) {
var $element = $(element);
eventsEngine.on($element, eventUtils.addNamespace(getWheelEventName(), EVENT_NAMESPACE), wheel._wheelHandler.bind(wheel))
},
teardown: function(element) {
eventsEngine.off(element, "." + EVENT_NAMESPACE)
},
_wheelHandler: function(e) {
var delta = this._getWheelDelta(e.originalEvent);
eventUtils.fireEvent({
type: EVENT_NAME,
originalEvent: e,
delta: delta,
pointerType: "mouse"
});
e.stopPropagation()
},
_getWheelDelta: function(event) {
return event.wheelDelta ? event.wheelDelta : 30 * -event.deltaY
}
};
registerEvent(EVENT_NAME, wheel);
exports.name = EVENT_NAME
},
/*!**************************************************************!*\
!*** ./artifacts/transpiled/events/core/emitter.feedback.js ***!
\**************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Class = __webpack_require__( /*! ../../core/class */ 15);
var commonUtils = __webpack_require__( /*! ../../core/utils/common */ 4);
var contains = __webpack_require__( /*! ../../core/utils/dom */ 12).contains;
var devices = __webpack_require__( /*! ../../core/devices */ 16);
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var pointerEvents = __webpack_require__( /*! ../pointer */ 23);
var Emitter = __webpack_require__( /*! ./emitter */ 123);
var registerEmitter = __webpack_require__( /*! ./emitter_registrator */ 95);
var ACTIVE_EVENT_NAME = "dxactive";
var INACTIVE_EVENT_NAME = "dxinactive";
var ACTIVE_TIMEOUT = 30;
var INACTIVE_TIMEOUT = 400;
var FeedbackEvent = Class.inherit({
ctor: function(timeout, fire) {
this._timeout = timeout;
this._fire = fire
},
start: function() {
var that = this;
this._schedule(function() {
that.force()
})
},
_schedule: function(fn) {
this.stop();
this._timer = setTimeout(fn, this._timeout)
},
stop: function() {
clearTimeout(this._timer)
},
force: function() {
if (this._fired) {
return
}
this.stop();
this._fire();
this._fired = true
},
fired: function() {
return this._fired
}
});
var activeFeedback;
var FeedbackEmitter = Emitter.inherit({
ctor: function() {
this.callBase.apply(this, arguments);
this._active = new FeedbackEvent(0, commonUtils.noop);
this._inactive = new FeedbackEvent(0, commonUtils.noop)
},
configure: function(data, eventName) {
switch (eventName) {
case ACTIVE_EVENT_NAME:
data.activeTimeout = data.timeout;
break;
case INACTIVE_EVENT_NAME:
data.inactiveTimeout = data.timeout
}
this.callBase(data)
},
start: function(e) {
if (activeFeedback) {
var activeChildExists = contains(this.getElement().get(0), activeFeedback.getElement().get(0));
var childJustActivated = !activeFeedback._active.fired();
if (activeChildExists && childJustActivated) {
this._cancel();
return
}
activeFeedback._inactive.force()
}
activeFeedback = this;
this._initEvents(e);
this._active.start()
},
_initEvents: function(e) {
var that = this;
var eventTarget = this._getEmitterTarget(e);
var mouseEvent = eventUtils.isMouseEvent(e);
var isSimulator = devices.isSimulator();
var deferFeedback = isSimulator || !mouseEvent;
var activeTimeout = commonUtils.ensureDefined(this.activeTimeout, ACTIVE_TIMEOUT);
var inactiveTimeout = commonUtils.ensureDefined(this.inactiveTimeout, INACTIVE_TIMEOUT);
this._active = new FeedbackEvent(deferFeedback ? activeTimeout : 0, function() {
that._fireEvent(ACTIVE_EVENT_NAME, e, {
target: eventTarget
})
});
this._inactive = new FeedbackEvent(deferFeedback ? inactiveTimeout : 0, function() {
that._fireEvent(INACTIVE_EVENT_NAME, e, {
target: eventTarget
});
activeFeedback = null
})
},
cancel: function(e) {
this.end(e)
},
end: function(e) {
var skipTimers = e.type !== pointerEvents.up;
if (skipTimers) {
this._active.stop()
} else {
this._active.force()
}
this._inactive.start();
if (skipTimers) {
this._inactive.force()
}
},
dispose: function() {
this._active.stop();
this._inactive.stop();
this.callBase()
},
lockInactive: function() {
this._active.force();
this._inactive.stop();
activeFeedback = null;
this._cancel();
return this._inactive.force.bind(this._inactive)
}
});
FeedbackEmitter.lock = function(deferred) {
var lockInactive = activeFeedback ? activeFeedback.lockInactive() : commonUtils.noop;
deferred.done(lockInactive)
};
registerEmitter({
emitter: FeedbackEmitter,
events: [ACTIVE_EVENT_NAME, INACTIVE_EVENT_NAME]
});
exports.lock = FeedbackEmitter.lock;
exports.active = ACTIVE_EVENT_NAME;
exports.inactive = INACTIVE_EVENT_NAME
},
/*!****************************************************!*\
!*** ./artifacts/transpiled/ui/collection/item.js ***!
\****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var Class = __webpack_require__( /*! ../../core/class */ 15);
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131);
var INVISIBLE_STATE_CLASS = "dx-state-invisible";
var DISABLED_STATE_CLASS = "dx-state-disabled";
var ITEM_CONTENT_PLACEHOLDER_CLASS = "dx-item-content-placeholder";
var forcibleWatcher = function(watchMethod, fn, callback) {
var filteredCallback = function() {
var oldValue;
return function(value) {
if (oldValue !== value) {
callback(value, oldValue);
oldValue = value
}
}
}();
return {
dispose: watchMethod(fn, filteredCallback),
force: function() {
filteredCallback(fn())
}
}
};
var CollectionItem = Class.inherit({
ctor: function($element, options, rawData) {
this._$element = $element;
this._options = options;
this._rawData = rawData;
publicComponentUtils.attachInstanceToElement($element, this, this._dispose);
this._render()
},
_render: function() {
var $placeholder = $("").addClass(ITEM_CONTENT_PLACEHOLDER_CLASS);
this._$element.append($placeholder);
this._watchers = [];
this._renderWatchers()
},
_renderWatchers: function() {
this._startWatcher("disabled", this._renderDisabled.bind(this));
this._startWatcher("visible", this._renderVisible.bind(this))
},
_startWatcher: function(field, render) {
var rawData = this._rawData;
var exprGetter = this._options.fieldGetter(field);
var watcher = forcibleWatcher(this._options.watchMethod(), function() {
return exprGetter(rawData)
}, function(value, oldValue) {
this._dirty = true;
render(value, oldValue)
}.bind(this));
this._watchers.push(watcher)
},
setDataField: function() {
this._dirty = false;
each(this._watchers, function(_, watcher) {
watcher.force()
});
if (this._dirty) {
return true
}
},
_renderDisabled: function(value, oldValue) {
this._$element.toggleClass(DISABLED_STATE_CLASS, !!value);
this._updateOwnerFocus(value)
},
_updateOwnerFocus: function(isDisabled) {
var ownerComponent = this._options.owner;
if (ownerComponent && isDisabled) {
ownerComponent._resetItemFocus(this._$element)
}
},
_renderVisible: function(value, oldValue) {
this._$element.toggleClass(INVISIBLE_STATE_CLASS, void 0 !== value && !value)
},
_dispose: function() {
each(this._watchers, function(_, watcher) {
watcher.dispose()
})
}
});
CollectionItem.getInstance = function($element) {
return publicComponentUtils.getInstanceByElement($element, this)
};
module.exports = CollectionItem
},
/*!*************************************************************!*\
!*** ./artifacts/transpiled/localization/globalize/core.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Globalize = __webpack_require__( /*! globalize */ 72);
var coreLocalization = __webpack_require__( /*! ../core */ 87);
if (Globalize && Globalize.load) {
var likelySubtags = {
supplemental: {
version: {
_cldrVersion: "28",
_unicodeVersion: "8.0.0",
_number: "$Revision: 11965 $"
},
likelySubtags: {
en: "en-Latn-US",
de: "de-Latn-DE",
ru: "ru-Cyrl-RU",
ja: "ja-Jpan-JP"
}
}
};
if (!Globalize.locale()) {
Globalize.load(likelySubtags);
Globalize.locale("en")
}
coreLocalization.inject({
locale: function(_locale) {
if (!_locale) {
return Globalize.locale().locale
}
Globalize.locale(_locale)
}
})
}
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/events/double_click.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
var Class = __webpack_require__( /*! ../core/class */ 15);
var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
var clickEvent = __webpack_require__( /*! ./click */ 19);
var eventUtils = __webpack_require__( /*! ./utils */ 8);
var DBLCLICK_EVENT_NAME = "dxdblclick";
var DBLCLICK_NAMESPACE = "dxDblClick";
var NAMESPACED_CLICK_EVENT = eventUtils.addNamespace(clickEvent.name, DBLCLICK_NAMESPACE);
var DBLCLICK_TIMEOUT = 300;
var DblClick = Class.inherit({
ctor: function() {
this._handlerCount = 0;
this._forgetLastClick()
},
_forgetLastClick: function() {
this._firstClickTarget = null;
this._lastClickTimeStamp = -DBLCLICK_TIMEOUT
},
add: function() {
if (this._handlerCount <= 0) {
eventsEngine.on(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT, this._clickHandler.bind(this))
}
this._handlerCount++
},
_clickHandler: function(e) {
var timeStamp = e.timeStamp || Date.now();
if (timeStamp - this._lastClickTimeStamp < DBLCLICK_TIMEOUT) {
eventUtils.fireEvent({
type: DBLCLICK_EVENT_NAME,
target: domUtils.closestCommonParent(this._firstClickTarget, e.target),
originalEvent: e
});
this._forgetLastClick()
} else {
this._firstClickTarget = e.target;
this._lastClickTimeStamp = timeStamp
}
},
remove: function() {
this._handlerCount--;
if (this._handlerCount <= 0) {
this._forgetLastClick();
eventsEngine.off(domAdapter.getDocument(), NAMESPACED_CLICK_EVENT)
}
}
});
registerEvent(DBLCLICK_EVENT_NAME, new DblClick);
exports.name = DBLCLICK_EVENT_NAME
},
/*!**************************************************!*\
!*** ./artifacts/transpiled/core/utils/error.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var extend = __webpack_require__( /*! ./extend */ 0).extend;
var consoleUtils = __webpack_require__( /*! ./console */ 73);
var stringUtils = __webpack_require__( /*! ./string */ 44);
var version = __webpack_require__( /*! ../version */ 157);
var ERROR_URL = "http://js.devexpress.com/error/" + version.split(".").slice(0, 2).join("_") + "/";
module.exports = function(baseErrors, errors) {
var exports = {
ERROR_MESSAGES: extend(errors, baseErrors),
Error: function() {
return makeError([].slice.call(arguments))
},
log: function(id) {
var method = "log";
if (/^E\d+$/.test(id)) {
method = "error"
} else {
if (/^W\d+$/.test(id)) {
method = "warn"
}
}
consoleUtils.logger[method]("log" === method ? id : combineMessage([].slice.call(arguments)))
}
};
var combineMessage = function(args) {
var id = args[0];
args = args.slice(1);
return formatMessage(id, formatDetails(id, args))
};
var formatDetails = function(id, args) {
args = [exports.ERROR_MESSAGES[id]].concat(args);
return stringUtils.format.apply(this, args).replace(/\.*\s*?$/, "")
};
var formatMessage = function(id, details) {
return stringUtils.format.apply(this, ["{0} - {1}. See:\n{2}", id, details, getErrorUrl(id)])
};
var makeError = function(args) {
var id = args[0];
args = args.slice(1);
var details = formatDetails(id, args);
var url = getErrorUrl(id);
var message = formatMessage(id, details);
return extend(new Error(message), {
__id: id,
__details: details,
url: url
})
};
var getErrorUrl = function(id) {
return ERROR_URL + id
};
return exports
}
},
/*!*************************************************************!*\
!*** ./artifacts/transpiled/core/utils/resize_callbacks.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var windowUtils = __webpack_require__( /*! ./window */ 7);
var domAdapter = __webpack_require__( /*! ../dom_adapter */ 11);
var Callbacks = __webpack_require__( /*! ./callbacks */ 26);
var readyCallbacks = __webpack_require__( /*! ./ready_callbacks */ 48);
var callOnce = __webpack_require__( /*! ./call_once */ 63);
var resizeCallbacks = function() {
var prevSize;
var callbacks = Callbacks();
var originalCallbacksAdd = callbacks.add;
var originalCallbacksRemove = callbacks.remove;
if (!windowUtils.hasWindow()) {
return callbacks
}
var formatSize = function() {
var window = windowUtils.getWindow();
return {
width: window.innerWidth,
height: window.innerHeight
}
};
var handleResize = function() {
var now = formatSize();
if (now.width === prevSize.width && now.height === prevSize.height) {
return
}
var changedDimension;
if (now.width === prevSize.width) {
changedDimension = "height"
}
if (now.height === prevSize.height) {
changedDimension = "width"
}
prevSize = now;
callbacks.fire(changedDimension)
};
var setPrevSize = callOnce(function() {
prevSize = formatSize()
});
var removeListener;
callbacks.add = function() {
var result = originalCallbacksAdd.apply(callbacks, arguments);
setPrevSize();
readyCallbacks.add(function() {
if (!removeListener && callbacks.has()) {
removeListener = domAdapter.listen(windowUtils.getWindow(), "resize", handleResize)
}
});
return result
};
callbacks.remove = function() {
var result = originalCallbacksRemove.apply(callbacks, arguments);
if (!callbacks.has() && removeListener) {
removeListener();
removeListener = void 0
}
return result
};
return callbacks
}();
module.exports = resizeCallbacks
},
/*!*************************************************************!*\
!*** ./artifacts/transpiled/core/utils/public_component.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var dataUtils = __webpack_require__( /*! ../../core/element_data */ 39);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var WeakMap = __webpack_require__( /*! ../polyfills/weak_map */ 176);
var isDefined = __webpack_require__( /*! ./type */ 1).isDefined;
var removeEvent = __webpack_require__( /*! ../remove_event */ 132);
var COMPONENT_NAMES_DATA_KEY = "dxComponents";
var ANONYMOUS_COMPONENT_DATA_KEY = "dxPrivateComponent";
var componentNames = new WeakMap;
var nextAnonymousComponent = 0;
var getName = exports.name = function(componentClass, newName) {
if (isDefined(newName)) {
componentNames.set(componentClass, newName);
return
}
if (!componentNames.has(componentClass)) {
var generatedName = ANONYMOUS_COMPONENT_DATA_KEY + nextAnonymousComponent++;
componentNames.set(componentClass, generatedName);
return generatedName
}
return componentNames.get(componentClass)
};
exports.attachInstanceToElement = function($element, componentInstance, disposeFn) {
var data = dataUtils.data($element.get(0));
var name = getName(componentInstance.constructor);
data[name] = componentInstance;
if (disposeFn) {
eventsEngine.one($element, removeEvent, function() {
disposeFn.call(componentInstance)
})
}
if (!data[COMPONENT_NAMES_DATA_KEY]) {
data[COMPONENT_NAMES_DATA_KEY] = []
}
data[COMPONENT_NAMES_DATA_KEY].push(name)
};
exports.getInstanceByElement = function($element, componentClass) {
var name = getName(componentClass);
return dataUtils.data($element.get(0), name)
}
},
/*!***************************************************!*\
!*** ./artifacts/transpiled/core/remove_event.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ./renderer */ 2);
var beforeCleanData = __webpack_require__( /*! ./element_data */ 39).beforeCleanData;
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var registerEvent = __webpack_require__( /*! ../events/core/event_registrator */ 71);
var eventName = "dxremove";
var eventPropName = "dxRemoveEvent";
beforeCleanData(function(elements) {
elements = [].slice.call(elements);
for (var i = 0; i < elements.length; i++) {
var $element = $(elements[i]);
if ($element.prop(eventPropName)) {
$element[0][eventPropName] = null;
eventsEngine.triggerHandler($element, eventName)
}
}
});
registerEvent(eventName, {
noBubble: true,
setup: function(element) {
$(element).prop(eventPropName, true)
}
});
module.exports = eventName
},
/*!************************************************!*\
!*** ./artifacts/transpiled/core/component.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread()
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) {
return
}
if ("string" === typeof o) {
return _arrayLikeToArray(o, minLen)
}
var n = Object.prototype.toString.call(o).slice(8, -1);
if ("Object" === n && o.constructor) {
n = o.constructor.name
}
if ("Map" === n || "Set" === n) {
return Array.from(o)
}
if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) {
return _arrayLikeToArray(o, minLen)
}
}
function _iterableToArray(iter) {
if ("undefined" !== typeof Symbol && null != iter[Symbol.iterator] || null != iter["@@iterator"]) {
return Array.from(iter)
}
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
return _arrayLikeToArray(arr)
}
}
function _arrayLikeToArray(arr, len) {
if (null == len || len > arr.length) {
len = arr.length
}
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i]
}
return arr2
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, descriptor.key, descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
var Config = __webpack_require__( /*! ./config */ 31);
var domAdapter = __webpack_require__( /*! ./dom_adapter */ 11);
var extend = __webpack_require__( /*! ./utils/extend */ 0).extend;
var Class = __webpack_require__( /*! ./class */ 15);
var Action = __webpack_require__( /*! ./action */ 111);
var errors = __webpack_require__( /*! ./errors */ 21);
var coreDataUtils = __webpack_require__( /*! ./utils/data */ 20);
var commonUtils = __webpack_require__( /*! ./utils/common */ 4);
var typeUtils = __webpack_require__( /*! ./utils/type */ 1);
var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
var Deferred = deferredUtils.Deferred;
var when = deferredUtils.when;
var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
var EventsMixin = __webpack_require__( /*! ./events_mixin */ 82);
var publicComponentUtils = __webpack_require__( /*! ./utils/public_component */ 131);
var devices = __webpack_require__( /*! ./devices */ 16);
var isFunction = typeUtils.isFunction;
var noop = commonUtils.noop;
var cachedGetters = {};
var cachedSetters = {};
var PostponedOperations = function() {
function PostponedOperations() {
_classCallCheck(this, PostponedOperations);
this._postponedOperations = {}
}
_createClass(PostponedOperations, [{
key: "add",
value: function(key, fn, postponedPromise) {
if (key in this._postponedOperations) {
postponedPromise && this._postponedOperations[key].promises.push(postponedPromise)
} else {
var completePromise = new Deferred;
this._postponedOperations[key] = {
fn: fn,
completePromise: completePromise,
promises: postponedPromise ? [postponedPromise] : []
}
}
return this._postponedOperations[key].completePromise.promise()
}
}, {
key: "callPostponedOperations",
value: function() {
for (var key in this._postponedOperations) {
var operation = this._postponedOperations[key];
if (typeUtils.isDefined(operation)) {
if (operation.promises && operation.promises.length) {
when.apply(void 0, _toConsumableArray(operation.promises)).done(operation.fn).then(operation.completePromise.resolve)
} else {
operation.fn().done(operation.completePromise.resolve)
}
}
}
this._postponedOperations = {}
}
}]);
return PostponedOperations
}();
var Component = Class.inherit({
_setDeprecatedOptions: function() {
this._deprecatedOptions = {}
},
_getDeprecatedOptions: function() {
return this._deprecatedOptions
},
_getOptionAliasesByName: function(optionName) {
var _this = this;
return Object.keys(this._deprecatedOptions).filter(function(aliasName) {
return optionName === _this._deprecatedOptions[aliasName].alias
})
},
_getDefaultOptions: function() {
return {
onInitialized: null,
onOptionChanged: null,
onDisposing: null,
defaultOptionsRules: null
}
},
_setDefaultOptions: function() {
this._options = this._getDefaultOptions()
},
_defaultOptionsRules: function() {
return []
},
_setOptionsByDevice: function(customRules) {
var rules = this._defaultOptionsRules();
if (Array.isArray(customRules)) {
rules = rules.concat(customRules)
}
var rulesOptions = this._convertRulesToOptions(rules);
extend(true, this._options, rulesOptions);
for (var fieldName in this._optionsByReference) {
if (Object.prototype.hasOwnProperty.call(rulesOptions, fieldName)) {
this._options[fieldName] = rulesOptions[fieldName]
}
}
},
_convertRulesToOptions: function(rules) {
var options = {};
var currentDevice = devices.current();
var deviceMatch = function(device, filter) {
var filterArray = [];
Array.prototype.push.call(filterArray, filter);
return 1 === filterArray.length && typeUtils.isEmptyObject(filterArray[0]) || commonUtils.findBestMatches(device, filterArray).length > 0
};
for (var i = 0; i < rules.length; i++) {
var rule = rules[i];
var deviceFilter = rule.device || {};
var match;
if (isFunction(deviceFilter)) {
match = deviceFilter(currentDevice)
} else {
match = deviceMatch(currentDevice, deviceFilter)
}
if (match) {
extend(options, rule.options)
}
}
return options
},
_isInitialOptionValue: function(name) {
var optionValue = this.option(name);
var initialOptionValue = this.initialOption(name);
var isInitialOption = isFunction(optionValue) && isFunction(initialOptionValue) ? optionValue.toString() === initialOptionValue.toString() : commonUtils.equalByValue(optionValue, initialOptionValue);
return isInitialOption
},
_setOptionsByReference: function() {
this._optionsByReference = {}
},
_getOptionsByReference: function() {
return this._optionsByReference
},
ctor: function(options) {
this.NAME = publicComponentUtils.name(this.constructor);
options = options || {};
if (options.eventsStrategy) {
this.setEventsStrategy(options.eventsStrategy)
}
this._options = {};
this._updateLockCount = 0;
this._optionChangedCallbacks = options._optionChangedCallbacks || Callbacks();
this._disposingCallbacks = options._disposingCallbacks || Callbacks();
this.postponedOperations = new PostponedOperations;
this.beginUpdate();
try {
this._suppressDeprecatedWarnings();
this._setOptionsByReference();
this._setDeprecatedOptions();
this._setDefaultOptions();
if (options && options.onInitializing) {
options.onInitializing.apply(this, [options])
}
this._setOptionsByDevice(options.defaultOptionsRules);
this._resumeDeprecatedWarnings();
this._initOptions(options)
} finally {
this.endUpdate()
}
},
_initOptions: function(options) {
this.option(options)
},
_optionValuesEqual: function(name, oldValue, newValue) {
oldValue = coreDataUtils.toComparable(oldValue, true);
newValue = coreDataUtils.toComparable(newValue, true);
if (oldValue && newValue && typeUtils.isRenderer(oldValue) && typeUtils.isRenderer(newValue)) {
return newValue.is(oldValue)
}
var oldValueIsNaN = oldValue !== oldValue;
var newValueIsNaN = newValue !== newValue;
if (oldValueIsNaN && newValueIsNaN) {
return true
}
if (null === oldValue || "object" !== _typeof(oldValue) || domAdapter.isElementNode(oldValue)) {
return oldValue === newValue
}
return false
},
_init: function() {
this._createOptionChangedAction();
this.on("disposing", function(args) {
this._disposingCallbacks.fireWith(this, [args])
}.bind(this))
},
_createOptionChangedAction: function() {
this._optionChangedAction = this._createActionByOption("onOptionChanged", {
excludeValidators: ["disabled", "readOnly"]
})
},
_createDisposingAction: function() {
this._disposingAction = this._createActionByOption("onDisposing", {
excludeValidators: ["disabled", "readOnly"]
})
},
_optionChanged: function(args) {
switch (args.name) {
case "onDisposing":
case "onInitialized":
break;
case "onOptionChanged":
this._createOptionChangedAction();
break;
case "defaultOptionsRules":
}
},
_dispose: function() {
this._optionChangedCallbacks.empty();
this._createDisposingAction();
this._disposingAction();
this._disposeEvents();
this._disposed = true
},
instance: function() {
return this
},
beginUpdate: function() {
this._updateLockCount++
},
endUpdate: function() {
this._updateLockCount = Math.max(this._updateLockCount - 1, 0);
if (!this._updateLockCount) {
this.postponedOperations.callPostponedOperations();
if (!this._initializing && !this._initialized) {
this._initializing = true;
try {
this._init()
} finally {
this._initializing = false;
this._updateLockCount++;
this._createActionByOption("onInitialized", {
excludeValidators: ["disabled", "readOnly"]
})();
this._updateLockCount--;
this._initialized = true
}
}
}
},
_logWarningIfDeprecated: function(option) {
var info = this._deprecatedOptions[option];
if (info && !this._deprecatedOptionsSuppressed) {
this._logDeprecatedWarning(option, info)
}
},
_logDeprecatedWarningCount: 0,
_logDeprecatedWarning: function(option, info) {
var message = info.message || "Use the '" + info.alias + "' option instead";
errors.log("W0001", this.NAME, option, info.since, message);
++this._logDeprecatedWarningCount
},
_suppressDeprecatedWarnings: function() {
this._deprecatedOptionsSuppressed = true
},
_resumeDeprecatedWarnings: function() {
this._deprecatedOptionsSuppressed = false
},
_optionChanging: noop,
_notifyOptionChanged: function(option, value, previousValue) {
var that = this;
if (this._initialized) {
var optionNames = [option].concat(that._getOptionAliasesByName(option));
for (var i = 0; i < optionNames.length; i++) {
var name = optionNames[i];
var args = {
name: name.split(/[.[]/)[0],
fullName: name,
value: value,
previousValue: previousValue
};
that._optionChangedCallbacks.fireWith(that, [extend(that._defaultActionArgs(), args)]);
that._optionChangedAction(extend({}, args));
if (!that._disposed && this._cancelOptionChange !== args.name) {
that._optionChanged(args)
}
}
}
},
initialOption: function(optionName) {
var currentOptions;
var currentInitialized = this._initialized;
if (!this._initialOptions) {
currentOptions = this._options;
this._options = {};
this._initialized = false;
this._setDefaultOptions();
this._setOptionsByDevice(currentOptions.defaultOptionsRules);
this._initialOptions = this._options;
this._options = currentOptions;
this._initialized = currentInitialized
}
return this._initialOptions[optionName]
},
_defaultActionConfig: function() {
return {
context: this,
component: this
}
},
_defaultActionArgs: function() {
return {
component: this
}
},
_createAction: function(actionSource, config) {
var that = this;
var action;
return function(e) {
if (!arguments.length) {
e = {}
}
if (!typeUtils.isPlainObject(e)) {
e = {
actionValue: e
}
}
action = action || new Action(actionSource, extend(config, that._defaultActionConfig()));
return action.execute.call(action, extend(e, that._defaultActionArgs()))
}
},
_createActionByOption: function(optionName, config) {
var that = this;
var action;
var eventName;
var actionFunc;
var result = function() {
if (!eventName) {
config = config || {};
if ("string" !== typeof optionName) {
throw errors.Error("E0008")
}
if (0 === optionName.indexOf("on")) {
eventName = that._getEventName(optionName)
}
if (0 !== optionName.indexOf("on")) {
throw Error("The '" + optionName + "' option name should start with 'on' prefix")
}
actionFunc = that.option(optionName)
}
if (!action && !actionFunc && !config.beforeExecute && !config.afterExecute && !that.hasEvent(eventName)) {
return
}
if (!action) {
var beforeExecute = config.beforeExecute;
config.beforeExecute = function(args) {
beforeExecute && beforeExecute.apply(that, arguments);
that.fireEvent(eventName, args.args)
};
that._suppressDeprecatedWarnings();
action = that._createAction(actionFunc, config);
that._resumeDeprecatedWarnings()
}
if (Config().wrapActionsBeforeExecute) {
var beforeActionExecute = that.option("beforeActionExecute") || noop;
var wrappedAction = beforeActionExecute(that, action, config) || action;
return wrappedAction.apply(that, arguments)
}
return action.apply(that, arguments)
};
if (!Config().wrapActionsBeforeExecute) {
var onActionCreated = that.option("onActionCreated") || noop;
result = onActionCreated(that, result, config) || result
}
return result
},
_getEventName: function(actionName) {
return actionName.charAt(2).toLowerCase() + actionName.substr(3)
},
hasActionSubscription: function(actionName) {
return !!this.option(actionName) || this.hasEvent(this._getEventName(actionName))
},
isOptionDeprecated: function(name) {
var deprecatedOptions = this._getDeprecatedOptions();
return Object.prototype.hasOwnProperty.call(deprecatedOptions, name)
},
_setOptionSilent: function(name, value) {
this._cancelOptionChange = name;
this.option(name, value);
this._cancelOptionChange = false
},
option: function() {
var normalizeOptionName = function(that, name) {
var deprecate;
if (name) {
if (!that._cachedDeprecateNames) {
that._cachedDeprecateNames = [];
for (var optionName in that._deprecatedOptions) {
that._cachedDeprecateNames.push(optionName)
}
}
for (var i = 0; i < that._cachedDeprecateNames.length; i++) {
if (that._cachedDeprecateNames[i] === name) {
deprecate = that._deprecatedOptions[name];
break
}
}
if (deprecate) {
that._logWarningIfDeprecated(name);
var alias = deprecate.alias;
if (alias) {
name = alias
}
}
}
return name
};
var getPreviousName = function(fullName) {
var splitNames = fullName.split(".");
splitNames.pop();
return splitNames.join(".")
};
var getFieldName = function(fullName) {
var splitNames = fullName.split(".");
return splitNames[splitNames.length - 1]
};
var getOptionValue = function(options, name, unwrapObservables) {
var getter = cachedGetters[name];
if (!getter) {
getter = cachedGetters[name] = coreDataUtils.compileGetter(name)
}
return getter(options, {
functionsAsIs: true,
unwrapObservables: unwrapObservables
})
};
var clearOptionsField = function(options, name) {
delete options[name];
var previousFieldName = getPreviousName(name);
var fieldName = getFieldName(name);
var fieldObject = previousFieldName ? getOptionValue(options, previousFieldName, false) : options;
if (fieldObject) {
delete fieldObject[fieldName]
}
};
var setOptionsField = function(options, fullName, value) {
var fieldName = "";
var fieldObject;
do {
if (fieldName) {
fieldName = "." + fieldName
}
fieldName = getFieldName(fullName) + fieldName;
fullName = getPreviousName(fullName);
fieldObject = fullName ? getOptionValue(options, fullName, false) : options
} while (!fieldObject);
fieldObject[fieldName] = value
};
var normalizeOptionValue = function(that, options, name, value) {
if (name) {
var alias = normalizeOptionName(that, name);
if (alias && alias !== name) {
setOptionsField(options, alias, value);
clearOptionsField(options, name)
}
}
};
var prepareOption = function prepareOption(that, options, name, value) {
if (typeUtils.isPlainObject(value)) {
for (var valueName in value) {
prepareOption(that, options, name + "." + valueName, value[valueName])
}
}
normalizeOptionValue(that, options, name, value)
};
var setOptionValue = function(that, name, value) {
if (!cachedSetters[name]) {
cachedSetters[name] = coreDataUtils.compileSetter(name)
}
var path = name.split(/[.[]/);
cachedSetters[name](that._options, value, {
functionsAsIs: true,
merge: !that._getOptionsByReference()[name],
unwrapObservables: path.length > 1 && !!that._getOptionsByReference()[path[0]]
})
};
var setOption = function(that, name, value) {
var previousValue = getOptionValue(that._options, name, false);
if (that._optionValuesEqual(name, previousValue, value)) {
return
}
if (that._initialized) {
that._optionChanging(name, previousValue, value)
}
setOptionValue(that, name, value);
that._notifyOptionChanged(name, value, previousValue)
};
return function(options, value) {
var that = this;
var name = options;
if (arguments.length < 2 && "object" !== typeUtils.type(name)) {
name = normalizeOptionName(that, name);
return getOptionValue(that._options, name)
}
if ("string" === typeof name) {
options = {};
options[name] = value
}
that.beginUpdate();
try {
var optionName;
for (optionName in options) {
prepareOption(that, options, optionName, options[optionName])
}
for (optionName in options) {
setOption(that, optionName, options[optionName])
}
} finally {
that.endUpdate()
}
}
}(),
_getOptionValue: function(name, context) {
var value = this.option(name);
if (isFunction(value)) {
return value.bind(context)()
}
return value
}
}).include(EventsMixin);
module.exports = Component;
module.exports.PostponedOperations = PostponedOperations
},
/*!******************************************************************!*\
!*** ./artifacts/transpiled/ui/widget/child_default_template.js ***!
\******************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var TemplateBase = __webpack_require__( /*! ./ui.template_base */ 74);
module.exports = TemplateBase.inherit({
ctor: function(name) {
this.name = name
}
})
},
/*!**************************************************!*\
!*** ./artifacts/transpiled/data/array_utils.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _type = __webpack_require__( /*! ../core/utils/type */ 1);
var _config = __webpack_require__( /*! ../core/config */ 31);
var _config2 = _interopRequireDefault(_config);
var _guid = __webpack_require__( /*! ../core/guid */ 40);
var _guid2 = _interopRequireDefault(_guid);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
var _errors = __webpack_require__( /*! ./errors */ 36);
var _object = __webpack_require__( /*! ../core/utils/object */ 47);
var _object2 = _interopRequireDefault(_object);
var _utils = __webpack_require__( /*! ./utils */ 41);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
function hasKey(target, keyOrKeys) {
var keys = "string" === typeof keyOrKeys ? keyOrKeys.split() : keyOrKeys.slice();
while (keys.length) {
var key = keys.shift();
if (key in target) {
return true
}
}
return false
}
function findItems(keyInfo, items, key, groupCount) {
if (groupCount) {
for (var i = 0; i < items.length; i++) {
var childItems = items[i].items || items[i].collapsedItems || [];
var result = findItems(keyInfo, childItems || [], key, groupCount - 1);
if (result) {
return result
}
}
} else {
if (indexByKey(keyInfo, items, key) >= 0) {
return items
}
}
}
function getItems(keyInfo, items, key, groupCount) {
if (groupCount) {
return findItems(keyInfo, items, key, groupCount) || []
}
return items
}
function generateDataByKeyMap(keyInfo, array) {
if (keyInfo.key() && !array._dataByKeyMap) {
var dataByKeyMap = {};
for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
dataByKeyMap[JSON.stringify(keyInfo.keyOf(array[i]))] = array[i]
}
array._dataByKeyMap = dataByKeyMap
}
}
function getCacheValue(array, key) {
if (array._dataByKeyMap) {
return array._dataByKeyMap[JSON.stringify(key)]
}
}
function getHasKeyCacheValue(array, key) {
if (array._dataByKeyMap) {
return array._dataByKeyMap[JSON.stringify(key)]
}
return true
}
function setDataByKeyMapValue(array, key, data) {
if (array._dataByKeyMap) {
array._dataByKeyMap[JSON.stringify(key)] = data
}
}
function applyBatch(keyInfo, array, batchData, groupCount, useInsertIndex) {
batchData.forEach(function(item) {
var items = "insert" === item.type ? array : getItems(keyInfo, array, item.key, groupCount);
generateDataByKeyMap(keyInfo, items);
switch (item.type) {
case "update":
update(keyInfo, items, item.key, item.data, true);
break;
case "insert":
insert(keyInfo, items, item.data, useInsertIndex && (0, _type.isDefined)(item.index) ? item.index : -1, true);
break;
case "remove":
remove(keyInfo, items, item.key, true)
}
})
}
function update(keyInfo, array, key, data, isBatch) {
var target;
var extendComplexObject = true;
var keyExpr = keyInfo.key();
if (keyExpr) {
if (hasKey(data, keyExpr) && !(0, _utils.keysEqual)(keyExpr, key, keyInfo.keyOf(data))) {
return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4017"))
}
target = getCacheValue(array, key);
if (!target) {
var index = indexByKey(keyInfo, array, key);
if (index < 0) {
return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4009"))
}
target = array[index]
}
} else {
target = key
}
_object2.default.deepExtendArraySafe(target, data, extendComplexObject);
if (!isBatch) {
if ((0, _config2.default)().useLegacyStoreResult) {
return (0, _utils.trivialPromise)(key, data)
} else {
return (0, _utils.trivialPromise)(target, key)
}
}
}
function insert(keyInfo, array, data, index, isBatch) {
var keyValue;
var keyExpr = keyInfo.key();
var obj = (0, _type.isPlainObject)(data) ? (0, _extend.extend)({}, data) : data;
if (keyExpr) {
keyValue = keyInfo.keyOf(obj);
if (void 0 === keyValue || "object" === _typeof(keyValue) && (0, _type.isEmptyObject)(keyValue)) {
if (Array.isArray(keyExpr)) {
throw _errors.errors.Error("E4007")
}
keyValue = obj[keyExpr] = String(new _guid2.default)
} else {
if (void 0 !== array[indexByKey(keyInfo, array, keyValue)]) {
return !isBatch && (0, _utils.rejectedPromise)(_errors.errors.Error("E4008"))
}
}
} else {
keyValue = obj
}
if (index >= 0) {
array.splice(index, 0, obj)
} else {
array.push(obj)
}
setDataByKeyMapValue(array, keyValue, obj);
if (!isBatch) {
return (0, _utils.trivialPromise)((0, _config2.default)().useLegacyStoreResult ? data : obj, keyValue)
}
}
function remove(keyInfo, array, key, isBatch) {
var index = indexByKey(keyInfo, array, key);
if (index > -1) {
array.splice(index, 1)
}
if (!isBatch) {
return (0, _utils.trivialPromise)(key)
}
}
function indexByKey(keyInfo, array, key) {
var keyExpr = keyInfo.key();
if (!getHasKeyCacheValue(array, key)) {
return -1
}
for (var i = 0, arrayLength = array.length; i < arrayLength; i++) {
if ((0, _utils.keysEqual)(keyExpr, keyInfo.keyOf(array[i]), key)) {
return i
}
}
return -1
}
module.exports.applyBatch = applyBatch;
module.exports.update = update;
module.exports.insert = insert;
module.exports.remove = remove;
module.exports.indexByKey = indexByKey
},
/*!*****************************************************************************!*\
!*** ./artifacts/transpiled/ui/file_manager/file_provider/file_provider.js ***!
\*****************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _data = __webpack_require__( /*! ../../../core/utils/data */ 20);
var _uiFile_manager = __webpack_require__( /*! ../ui.file_manager.utils */ 113);
var _common = __webpack_require__( /*! ../../../core/utils/common */ 4);
var _date_serialization = __webpack_require__( /*! ../../../core/utils/date_serialization */ 52);
var _iterator = __webpack_require__( /*! ../../../core/utils/iterator */ 3);
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, descriptor.key, descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
var DEFAULT_FILE_UPLOAD_CHUNK_SIZE = 2e5;
var FileProvider = function() {
function FileProvider(options) {
_classCallCheck(this, FileProvider);
options = (0, _common.ensureDefined)(options, {});
this._nameGetter = (0, _data.compileGetter)(this._getNameExpr(options));
this._isDirGetter = (0, _data.compileGetter)(this._getIsDirExpr(options));
this._sizeGetter = (0, _data.compileGetter)(options.sizeExpr || "size");
this._dateModifiedGetter = (0, _data.compileGetter)(options.dateModifiedExpr || "dateModified");
this._thumbnailGetter = (0, _data.compileGetter)(options.thumbnailExpr || "thumbnail")
}
_createClass(FileProvider, [{
key: "getFolders",
value: function(path) {
return this.getItems(path, "folder")
}
}, {
key: "getFiles",
value: function(path) {
return this.getItems(path, "file")
}
}, {
key: "getItems",
value: function(path, itemType) {
return []
}
}, {
key: "renameItem",
value: function(item, name) {}
}, {
key: "createFolder",
value: function(parentFolder, name) {}
}, {
key: "deleteItems",
value: function(items) {}
}, {
key: "moveItems",
value: function(items, destinationFolder) {}
}, {
key: "copyItems",
value: function(items, destinationFolder) {}
}, {
key: "initiateFileUpload",
value: function(uploadInfo) {}
}, {
key: "uploadFileChunk",
value: function(uploadInfo, chunk) {}
}, {
key: "finalizeFileUpload",
value: function(uploadInfo) {}
}, {
key: "abortFileUpload",
value: function(uploadInfo) {}
}, {
key: "getFileUploadChunkSize",
value: function() {
return DEFAULT_FILE_UPLOAD_CHUNK_SIZE
}
}, {
key: "_getItemsByType",
value: function(path, folders) {
return this.getItems(path).filter(function(item) {
return item.isDirectory === folders
})
}
}, {
key: "_convertDataObjectsToFileItems",
value: function(entries, path, itemType) {
var _this = this;
var useFolders = "folder" === itemType;
var result = [];
(0, _iterator.each)(entries, function(_, entry) {
var fileItem = _this._createFileItem(entry, path);
if (!itemType || fileItem.isDirectory === useFolders) {
result.push(fileItem)
}
});
return result
}
}, {
key: "_createFileItem",
value: function(dataObj, path) {
var fileItem = new FileManagerItem(path, this._nameGetter(dataObj), (!!this._isDirGetter(dataObj)));
fileItem.size = this._sizeGetter(dataObj);
if (void 0 === fileItem.size) {
fileItem.size = 0
}
fileItem.dateModified = (0, _date_serialization.deserializeDate)(this._dateModifiedGetter(dataObj));
if (void 0 === fileItem.dateModified) {
fileItem.dateModified = new Date
}
if (fileItem.isDirectory) {
fileItem.hasSubDirs = this._hasSubDirs(dataObj)
}
fileItem.thumbnail = this._thumbnailGetter(dataObj) || "";
fileItem.dataItem = dataObj;
return fileItem
}
}, {
key: "_hasSubDirs",
value: function(dataObj) {
return true
}
}, {
key: "_getNameExpr",
value: function(options) {
return options.nameExpr || "name"
}
}, {
key: "_getIsDirExpr",
value: function(options) {
return options.isDirectoryExpr || "isDirectory"
}
}]);
return FileProvider
}();
var FileManagerItem = function() {
function FileManagerItem(parentPath, name, isDirectory) {
_classCallCheck(this, FileManagerItem);
this.parentPath = parentPath;
this.name = name;
this.relativeName = (0, _uiFile_manager.pathCombine)(this.parentPath, name);
this.isDirectory = isDirectory || false;
this.size = 0;
this.dateModified = new Date;
this.thumbnail = "";
this.tooltipText = ""
}
_createClass(FileManagerItem, [{
key: "getExtension",
value: function() {
return this.isDirectory ? "" : (0, _uiFile_manager.getFileExtension)(this.name)
}
}, {
key: "getParent",
value: function() {
if (this.isRoot()) {
return null
}
return new FileManagerItem((0, _uiFile_manager.getParentPath)(this.parentPath), (0, _uiFile_manager.getName)(this.parentPath), true)
}
}, {
key: "isRoot",
value: function() {
return !this.relativeName
}
}, {
key: "equals",
value: function(item) {
return item && this.relativeName === item.relativeName
}
}, {
key: "createClone",
value: function() {
var result = new FileManagerItem(this.parentPath, this.name, this.isDirectory);
result.size = this.size;
result.dateModified = this.dateModified;
result.thumbnail = this.thumbnail;
result.tooltipText = this.tooltipText;
result.hasSubDirs = this.hasSubDirs;
result.dataItem = this.dataItem;
return result
}
}]);
return FileManagerItem
}();
module.exports.FileProvider = FileProvider;
module.exports.FileManagerItem = FileManagerItem
},
/*!********************************************!*\
!*** ./artifacts/transpiled/ui/popover.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
var window = windowUtils.getWindow();
var getPublicElement = __webpack_require__( /*! ../core/utils/dom */ 12).getPublicElement;
var domAdapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var browser = __webpack_require__( /*! ../core/utils/browser */ 25);
var translator = __webpack_require__( /*! ../animation/translator */ 27);
var positionUtils = __webpack_require__( /*! ../animation/position */ 77);
var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
var mathUtils = __webpack_require__( /*! ../core/utils/math */ 28);
var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
var Popup = __webpack_require__( /*! ./popup */ 46);
var POPOVER_CLASS = "dx-popover";
var POPOVER_WRAPPER_CLASS = "dx-popover-wrapper";
var POPOVER_ARROW_CLASS = "dx-popover-arrow";
var POPOVER_WITHOUT_TITLE_CLASS = "dx-popover-without-title";
var POSITION_FLIP_MAP = {
left: "right",
top: "bottom",
right: "left",
bottom: "top",
center: "center"
};
var WEIGHT_OF_SIDES = {
left: -1,
top: -1,
center: 0,
right: 1,
bottom: 1
};
var POSITION_ALIASES = {
top: {
my: "bottom center",
at: "top center",
collision: "fit flip"
},
bottom: {
my: "top center",
at: "bottom center",
collision: "fit flip"
},
right: {
my: "left center",
at: "right center",
collision: "flip fit"
},
left: {
my: "right center",
at: "left center",
collision: "flip fit"
}
};
var SIDE_BORDER_WIDTH_STYLES = {
left: "borderLeftWidth",
top: "borderTopWidth",
right: "borderRightWidth",
bottom: "borderBottomWidth"
};
var isFirefox = browser.mozilla;
var getEventName = function(that, optionName) {
var optionValue = that.option(optionName);
return getEventNameByOption(optionValue)
};
var getEventNameByOption = function(optionValue) {
return typeUtils.isObject(optionValue) ? optionValue.name : optionValue
};
var getEventDelay = function(that, optionName) {
var optionValue = that.option(optionName);
return typeUtils.isObject(optionValue) && optionValue.delay
};
var attachEvent = function(that, name) {
var target = that.option("target");
var isSelector = typeUtils.isString(target);
var event = getEventName(that, name + "Event");
if (!event || that.option("disabled")) {
return
}
var eventName = eventUtils.addNamespace(event, that.NAME);
var action = that._createAction(function() {
var delay = getEventDelay(that, name + "Event");
this._clearEventsTimeouts();
if (delay) {
this._timeouts[name] = setTimeout(function() {
that[name]()
}, delay)
} else {
that[name]()
}
}.bind(that), {
validatingTargetName: "target"
});
var handler = function(e) {
action({
event: e,
target: $(e.currentTarget)
})
};
var EVENT_HANDLER_NAME = "_" + name + "EventHandler";
if (isSelector) {
that[EVENT_HANDLER_NAME] = handler;
eventsEngine.on(domAdapter.getDocument(), eventName, target, handler)
} else {
var targetElement = getPublicElement($(target));
that[EVENT_HANDLER_NAME] = void 0;
eventsEngine.on(targetElement, eventName, handler)
}
};
var detachEvent = function(that, target, name, event) {
var eventName = event || getEventName(that, name + "Event");
if (!eventName) {
return
}
eventName = eventUtils.addNamespace(eventName, that.NAME);
var EVENT_HANDLER_NAME = "_" + name + "EventHandler";
if (that[EVENT_HANDLER_NAME]) {
eventsEngine.off(domAdapter.getDocument(), eventName, target, that[EVENT_HANDLER_NAME])
} else {
eventsEngine.off(getPublicElement($(target)), eventName)
}
};
var Popover = Popup.inherit({
_getDefaultOptions: function() {
return extend(this.callBase(), {
target: window,
shading: false,
position: "bottom",
closeOnOutsideClick: true,
animation: {
show: {
type: "fade",
from: 0,
to: 1
},
hide: {
type: "fade",
to: 0
}
},
showTitle: false,
width: "auto",
height: "auto",
dragEnabled: false,
resizeEnabled: false,
fullScreen: false,
closeOnTargetScroll: true,
arrowPosition: "",
arrowOffset: 0,
boundaryOffset: {
h: 10,
v: 10
}
})
},
_defaultOptionsRules: function() {
return [{
device: {
platform: "ios"
},
options: {
arrowPosition: {
boundaryOffset: {
h: 20,
v: -10
},
collision: "fit"
}
}
}, {
device: function() {
return !windowUtils.hasWindow()
},
options: {
animation: null
}
}]
},
_init: function() {
this.callBase();
this._renderArrow();
this._timeouts = {};
this.$element().addClass(POPOVER_CLASS);
this._wrapper().addClass(POPOVER_WRAPPER_CLASS)
},
_render: function() {
this.callBase.apply(this, arguments);
this._detachEvents(this.option("target"));
this._attachEvents()
},
_detachEvents: function(target) {
detachEvent(this, target, "show");
detachEvent(this, target, "hide")
},
_attachEvents: function() {
attachEvent(this, "show");
attachEvent(this, "hide")
},
_renderArrow: function() {
this._$arrow = $("
").addClass(POPOVER_ARROW_CLASS).prependTo(this.overlayContent())
},
_documentDownHandler: function(e) {
if (this._isOutsideClick(e)) {
return this.callBase(e)
}
return true
},
_isOutsideClick: function(e) {
return !$(e.target).closest(this.option("target")).length
},
_animate: function(animation) {
if (animation && animation.to && "object" === _typeof(animation.to)) {
extend(animation.to, {
position: this._getContainerPosition()
})
}
this.callBase.apply(this, arguments)
},
_stopAnimation: function() {
this.callBase.apply(this, arguments)
},
_renderTitle: function() {
this._wrapper().toggleClass(POPOVER_WITHOUT_TITLE_CLASS, !this.option("showTitle"));
this.callBase()
},
_renderPosition: function() {
this.callBase();
this._renderOverlayPosition()
},
_renderOverlayBoundaryOffset: commonUtils.noop,
_renderOverlayPosition: function() {
this._resetOverlayPosition();
this._updateContentSize();
var contentPosition = this._getContainerPosition();
var resultLocation = positionUtils.setup(this._$content, contentPosition);
var positionSide = this._getSideByLocation(resultLocation);
this._togglePositionClass("dx-position-" + positionSide);
this._toggleFlippedClass(resultLocation.h.flip, resultLocation.v.flip);
var isArrowVisible = this._isHorizontalSide() || this._isVerticalSide();
if (isArrowVisible) {
this._renderArrowPosition(positionSide)
}
},
_resetOverlayPosition: function() {
this._setContentHeight(true);
this._togglePositionClass("dx-position-" + this._positionSide);
translator.move(this._$content, {
left: 0,
top: 0
});
this._$arrow.css({
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
})
},
_updateContentSize: function() {
if (!this._$popupContent) {
return
}
var containerLocation = positionUtils.calculate(this._$content, this._getContainerPosition());
if (containerLocation.h.oversize > 0 && this._isHorizontalSide() && !containerLocation.h.fit) {
var newContainerWidth = this._$content.width() - containerLocation.h.oversize;
this._$content.width(newContainerWidth)
}
if (containerLocation.v.oversize > 0 && this._isVerticalSide() && !containerLocation.v.fit) {
var newOverlayContentHeight = this._$content.height() - containerLocation.v.oversize;
var newPopupContentHeight = this._$popupContent.height() - containerLocation.v.oversize;
this._$content.height(newOverlayContentHeight);
this._$popupContent.height(newPopupContentHeight)
}
},
_getContainerPosition: function() {
var offset = commonUtils.pairToObject(this._position.offset || "");
var hOffset = offset.h;
var vOffset = offset.v;
var isVerticalSide = this._isVerticalSide();
var isHorizontalSide = this._isHorizontalSide();
if (isVerticalSide || isHorizontalSide) {
var isPopoverInside = this._isPopoverInside();
var sign = (isPopoverInside ? -1 : 1) * WEIGHT_OF_SIDES[this._positionSide];
var arrowSize = isVerticalSide ? this._$arrow.height() : this._$arrow.width();
var arrowSizeCorrection = this._getContentBorderWidth(this._positionSide);
var arrowOffset = sign * (arrowSize - arrowSizeCorrection);
isVerticalSide ? vOffset += arrowOffset : hOffset += arrowOffset
}
return extend({}, this._position, {
offset: hOffset + " " + vOffset
})
},
_getContentBorderWidth: function(side) {
var borderWidth = this._$content.css(SIDE_BORDER_WIDTH_STYLES[side]);
return parseInt(borderWidth) || 0
},
_getSideByLocation: function(location) {
var isFlippedByVertical = location.v.flip;
var isFlippedByHorizontal = location.h.flip;
return this._isVerticalSide() && isFlippedByVertical || this._isHorizontalSide() && isFlippedByHorizontal || this._isPopoverInside() ? POSITION_FLIP_MAP[this._positionSide] : this._positionSide
},
_togglePositionClass: function(positionClass) {
this._$wrapper.removeClass("dx-position-left dx-position-right dx-position-top dx-position-bottom").addClass(positionClass)
},
_toggleFlippedClass: function(isFlippedHorizontal, isFlippedVertical) {
this._$wrapper.toggleClass("dx-popover-flipped-horizontal", isFlippedHorizontal).toggleClass("dx-popover-flipped-vertical", isFlippedVertical)
},
_renderArrowPosition: function(side) {
this._$arrow.css(POSITION_FLIP_MAP[side], -(this._isVerticalSide(side) ? this._$arrow.height() : this._$arrow.width()));
var axis = this._isVerticalSide(side) ? "left" : "top";
var sizeProperty = this._isVerticalSide(side) ? "outerWidth" : "outerHeight";
var $target = $(this._position.of);
var targetOffset = positionUtils.offset($target) || {
top: 0,
left: 0
};
var contentOffset = positionUtils.offset(this._$content);
var arrowSize = this._$arrow[sizeProperty]();
var contentLocation = contentOffset[axis];
var contentSize = this._$content[sizeProperty]();
var targetLocation = targetOffset[axis];
var targetSize = $target.get(0).preventDefault ? 0 : $target[sizeProperty]();
var min = Math.max(contentLocation, targetLocation);
var max = Math.min(contentLocation + contentSize, targetLocation + targetSize);
var arrowLocation;
if ("start" === this.option("arrowPosition")) {
arrowLocation = min - contentLocation
} else {
if ("end" === this.option("arrowPosition")) {
arrowLocation = max - contentLocation - arrowSize
} else {
arrowLocation = (min + max) / 2 - contentLocation - arrowSize / 2
}
}
var borderWidth = this._getContentBorderWidth(side);
var finalArrowLocation = mathUtils.fitIntoRange(arrowLocation - borderWidth + this.option("arrowOffset"), borderWidth, contentSize - arrowSize - 2 * borderWidth);
this._$arrow.css(axis, finalArrowLocation)
},
_isPopoverInside: function() {
var position = this._transformStringPosition(this.option("position"), POSITION_ALIASES);
var my = positionUtils.setup.normalizeAlign(position.my);
var at = positionUtils.setup.normalizeAlign(position.at);
return my.h === at.h && my.v === at.v
},
_setContentHeight: function(fullUpdate) {
if (fullUpdate) {
this.callBase()
}
},
_renderShadingPosition: function() {
if (this.option("shading")) {
this._$wrapper.css({
top: 0,
left: 0
})
}
},
_renderShadingDimensions: function() {
if (this.option("shading")) {
this._$wrapper.css({
width: "100%",
height: "100%"
})
}
},
_normalizePosition: function() {
var position = extend({}, this._transformStringPosition(this.option("position"), POSITION_ALIASES));
if (!position.of) {
position.of = this.option("target")
}
if (!position.collision) {
position.collision = "flip"
}
if (!position.boundaryOffset) {
position.boundaryOffset = this.option("boundaryOffset")
}
this._positionSide = this._getDisplaySide(position);
this._position = position
},
_getDisplaySide: function(position) {
var my = positionUtils.setup.normalizeAlign(position.my);
var at = positionUtils.setup.normalizeAlign(position.at);
var weightSign = WEIGHT_OF_SIDES[my.h] === WEIGHT_OF_SIDES[at.h] && WEIGHT_OF_SIDES[my.v] === WEIGHT_OF_SIDES[at.v] ? -1 : 1;
var horizontalWeight = Math.abs(WEIGHT_OF_SIDES[my.h] - weightSign * WEIGHT_OF_SIDES[at.h]);
var verticalWeight = Math.abs(WEIGHT_OF_SIDES[my.v] - weightSign * WEIGHT_OF_SIDES[at.v]);
return horizontalWeight > verticalWeight ? at.h : at.v
},
_resetContentHeight: function() {
this.callBase();
if (isFirefox) {
var originalOverflow = this._$popupContent.css("overflow");
this._$popupContent.css("overflow", "visible");
this._$popupContent.css("overflow", originalOverflow)
}
},
_isVerticalSide: function(side) {
side = side || this._positionSide;
return "top" === side || "bottom" === side
},
_isHorizontalSide: function(side) {
side = side || this._positionSide;
return "left" === side || "right" === side
},
_clearEventTimeout: function(name) {
clearTimeout(this._timeouts[name])
},
_clearEventsTimeouts: function() {
this._clearEventTimeout("show");
this._clearEventTimeout("hide")
},
_clean: function() {
this._detachEvents(this.option("target"));
this.callBase.apply(this, arguments)
},
_optionChanged: function(args) {
switch (args.name) {
case "boundaryOffset":
case "arrowPosition":
case "arrowOffset":
this._renderGeometry();
break;
case "fullScreen":
if (args.value) {
this.option("fullScreen", false)
}
break;
case "target":
args.previousValue && this._detachEvents(args.previousValue);
this.callBase(args);
break;
case "showEvent":
case "hideEvent":
var name = args.name.substring(0, 4);
var event = getEventNameByOption(args.previousValue);
this.hide();
detachEvent(this, this.option("target"), name, event);
attachEvent(this, name);
break;
case "visible":
this._clearEventTimeout(args.value ? "show" : "hide");
this.callBase(args);
break;
default:
this.callBase(args)
}
},
show: function(target) {
if (target) {
this.option("target", target)
}
return this.callBase()
}
});
registerComponent("dxPopover", Popover);
module.exports = Popover
},
/*!****************************************************************!*\
!*** ./artifacts/transpiled/ui/list/ui.list.edit.decorator.js ***!
\****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
var Class = __webpack_require__( /*! ../../core/class */ 15);
var swipeEvents = __webpack_require__( /*! ../../events/swipe */ 174);
var eventUtils = __webpack_require__( /*! ../../events/utils */ 8);
var LIST_EDIT_DECORATOR = "dxListEditDecorator";
var SWIPE_START_EVENT_NAME = eventUtils.addNamespace(swipeEvents.start, LIST_EDIT_DECORATOR);
var SWIPE_UPDATE_EVENT_NAME = eventUtils.addNamespace(swipeEvents.swipe, LIST_EDIT_DECORATOR);
var SWIPE_END_EVENT_NAME = eventUtils.addNamespace(swipeEvents.end, LIST_EDIT_DECORATOR);
var EditDecorator = Class.inherit({
ctor: function(list) {
this._list = list;
this._init()
},
_init: noop,
_shouldHandleSwipe: false,
_attachSwipeEvent: function(config) {
var swipeConfig = {
itemSizeFunc: function() {
if (this._clearSwipeCache) {
this._itemWidthCache = this._list.$element().width();
this._clearSwipeCache = false
}
return this._itemWidthCache
}.bind(this)
};
eventsEngine.on(config.$itemElement, SWIPE_START_EVENT_NAME, swipeConfig, this._itemSwipeStartHandler.bind(this));
eventsEngine.on(config.$itemElement, SWIPE_UPDATE_EVENT_NAME, this._itemSwipeUpdateHandler.bind(this));
eventsEngine.on(config.$itemElement, SWIPE_END_EVENT_NAME, this._itemSwipeEndHandler.bind(this))
},
_itemSwipeStartHandler: function(e) {
var $itemElement = $(e.currentTarget);
if ($itemElement.is(".dx-state-disabled, .dx-state-disabled *")) {
e.cancel = true;
return
}
clearTimeout(this._list._inkRippleTimer);
this._swipeStartHandler($itemElement, e)
},
_itemSwipeUpdateHandler: function(e) {
var $itemElement = $(e.currentTarget);
this._swipeUpdateHandler($itemElement, e)
},
_itemSwipeEndHandler: function(e) {
var $itemElement = $(e.currentTarget);
this._swipeEndHandler($itemElement, e);
this._clearSwipeCache = true
},
beforeBag: noop,
afterBag: noop,
_commonOptions: function() {
return {
activeStateEnabled: this._list.option("activeStateEnabled"),
hoverStateEnabled: this._list.option("hoverStateEnabled"),
focusStateEnabled: this._list.option("focusStateEnabled")
}
},
modifyElement: function(config) {
if (this._shouldHandleSwipe) {
this._attachSwipeEvent(config);
this._clearSwipeCache = true
}
},
afterRender: noop,
handleClick: noop,
handleKeyboardEvents: noop,
handleEnterPressing: noop,
handleContextMenu: noop,
_swipeStartHandler: noop,
_swipeUpdateHandler: noop,
_swipeEndHandler: noop,
visibilityChange: noop,
getExcludedSelectors: noop,
dispose: noop
});
module.exports = EditDecorator
},
/*!*****************************************!*\
!*** ./artifacts/transpiled/ui/form.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./form/ui.form */ 554)
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/ui/tree_view.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./tree_view/ui.tree_view.search */ 350)
},
/*!***************************************************************!*\
!*** ./artifacts/transpiled/ui/scheduler/utils.recurrence.js ***!
\***************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var errors = __webpack_require__( /*! ../../core/errors */ 21);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
var dateUtils = __webpack_require__( /*! ../../core/utils/date */ 22);
var toMs = dateUtils.dateToMilliseconds;
var leastDaysInWeek = 4;
var intervalMap = {
secondly: "seconds",
minutely: "minutes",
hourly: "hours",
daily: "days",
weekly: "weeks",
monthly: "months",
yearly: "years"
};
var dateSetterMap = {
bysecond: function(date, value) {
date.setSeconds(value)
},
byminute: function(date, value) {
date.setMinutes(value)
},
byhour: function(date, value) {
date.setHours(value)
},
bymonth: function(date, value) {
date.setMonth(value)
},
bymonthday: function(date, value) {
if (value < 0) {
var initialDate = new Date(date);
setDateByNegativeValue(initialDate, 1, -1);
var daysInMonth = initialDate.getDate();
if (daysInMonth >= Math.abs(value)) {
setDateByNegativeValue(date, 1, value)
} else {
setDateByNegativeValue(date, 2, value)
}
} else {
date.setDate(value);
correctDate(date, value)
}
},
byday: function(date, byDay, appointmentWeekStart, frequency, firstDayOfWeek) {
var appointmentDayOfWeek = date.getDay();
var weekStart = days[appointmentWeekStart];
byDay += byDay >= weekStart === weekStart > appointmentDayOfWeek ? 7 : 0;
date.setDate(date.getDate() - appointmentDayOfWeek + byDay)
},
byweekno: function(date, weekNumber, weekStart) {
var initialDate = new Date(date);
var firstYearDate = new Date(initialDate.setMonth(0, 1));
var dayShift = firstYearDate.getDay() - days[weekStart];
var firstDayOfYear = firstYearDate.getTime() - dayShift * toMs("day");
var newFirstYearDate = dayShift + 1;
if (newFirstYearDate > leastDaysInWeek) {
date.setTime(firstDayOfYear + 7 * weekNumber * toMs("day"))
} else {
date.setTime(firstDayOfYear + 7 * (weekNumber - 1) * toMs("day"))
}
var timezoneDiff = (date.getTimezoneOffset() - firstYearDate.getTimezoneOffset()) * toMs("minute");
timezoneDiff && date.setTime(date.getTime() + timezoneDiff)
},
byyearday: function(date, dayOfYear) {
date.setMonth(0, 1);
date.setDate(dayOfYear)
}
};
var setDateByNegativeValue = function(date, month, value) {
var initialDate = new Date(date);
date.setMonth(date.getMonth() + month);
if (date.getMonth() - initialDate.getMonth() > month) {
date.setDate(value + 1)
}
date.setDate(value + 1)
};
var dateGetterMap = {
bysecond: function(date) {
return date.getSeconds()
},
byminute: function(date) {
return date.getMinutes()
},
byhour: function(date) {
return date.getHours()
},
bymonth: function(date) {
return date.getMonth()
},
bymonthday: function(date) {
return date.getDate()
},
byday: function(date) {
return date.getDay()
},
byweekno: function(date, weekStart) {
var current = new Date(date);
var diff = leastDaysInWeek - current.getDay() + days[weekStart] - 1;
var dayInMilliseconds = toMs("day");
if (date.getDay() < days[weekStart]) {
diff -= 7
}
current.setHours(0, 0, 0);
current.setDate(current.getDate() + diff);
var yearStart = new Date(current.getFullYear(), 0, 1);
var timezoneDiff = (yearStart.getTimezoneOffset() - current.getTimezoneOffset()) * toMs("minute");
var daysFromYearStart = 1 + (current - yearStart + timezoneDiff) / dayInMilliseconds;
return Math.ceil(daysFromYearStart / 7)
},
byyearday: function(date) {
var yearStart = new Date(date.getFullYear(), 0, 0);
var timezoneDiff = date.getTimezoneOffset() - yearStart.getTimezoneOffset();
var diff = date - yearStart - timezoneDiff * toMs("minute");
var dayLength = toMs("day");
return Math.floor(diff / dayLength)
}
};
var ruleNames = ["freq", "interval", "byday", "byweekno", "byyearday", "bymonth", "bymonthday", "count", "until", "byhour", "byminute", "bysecond", "bysetpos", "wkst"];
var freqNames = ["DAILY", "WEEKLY", "MONTHLY", "YEARLY", "SECONDLY", "MINUTELY", "HOURLY"];
var days = {
SU: 0,
MO: 1,
TU: 2,
WE: 3,
TH: 4,
FR: 5,
SA: 6
};
var daysNames = {
0: "SU",
1: "MO",
2: "TU",
3: "WE",
4: "TH",
5: "FR",
6: "SA"
};
var getTimeZoneOffset = function() {
return (new Date).getTimezoneOffset()
};
var dateInRecurrenceRange = function(options) {
var result = [];
if (options.rule) {
result = getDatesByRecurrence(options)
}
return !!result.length
};
var normalizeInterval = function(rule) {
var interval = rule.interval;
var freq = rule.freq;
var intervalObject = {};
var intervalField = intervalMap[freq.toLowerCase()];
if ("MONTHLY" === freq && rule.byday) {
intervalField = intervalMap.daily
}
intervalObject[intervalField] = interval;
return intervalObject
};
var getDatesByRecurrenceException = function(ruleValues, date) {
var result = [];
for (var i = 0, len = ruleValues.length; i < len; i++) {
result[i] = getDateByAsciiString(ruleValues[i], date)
}
return result
};
var dateIsRecurrenceException = function(date, recurrenceException) {
var result = false;
if (!recurrenceException) {
return result
}
var splitDates = recurrenceException.split(",");
var exceptDates = getDatesByRecurrenceException(splitDates, date);
var shortFormat = /\d{8}$/;
for (var i = 0, len = exceptDates.length; i < len; i++) {
if (splitDates[i].match(shortFormat)) {
var diffs = getDatePartDiffs(date, exceptDates[i]);
if (0 === diffs.years && 0 === diffs.months && 0 === diffs.days) {
result = true
}
} else {
if (date.getTime() === exceptDates[i].getTime()) {
result = true
}
}
}
return result
};
var doNextIteration = function(date, startIntervalDate, endIntervalDate, recurrenceRule, iterationCount) {
var matchCountIsCorrect = true;
endIntervalDate = endIntervalDate.getTime();
if (recurrenceRule.until) {
if (recurrenceRule.until.getTime() < endIntervalDate) {
endIntervalDate = recurrenceRule.until.getTime()
}
}
if (recurrenceRule.count) {
if (iterationCount === recurrenceRule.count) {
matchCountIsCorrect = false
}
}
var dateInInterval = date.getTime() <= endIntervalDate;
return dateInInterval && matchCountIsCorrect
};
var getDatesByRecurrence = function(options) {
var result = [];
var recurrenceRule = getRecurrenceRule(options.rule);
var iterationResult = {};
var rule = recurrenceRule.rule;
var recurrenceStartDate = options.start;
if (!recurrenceRule.isValid || !rule.freq) {
return result
}
rule.interval = normalizeInterval(rule);
var dateRules = splitDateRules(rule, options.firstDayOfWeek);
var duration = options.end ? options.end.getTime() - options.start.getTime() : toMs("day");
var config = {
exception: options.exception,
min: options.min,
dateRules: dateRules,
rule: rule,
recurrenceStartDate: recurrenceStartDate,
recurrenceEndDate: options.end,
duration: duration
};
if (dateRules.length && rule.count) {
var iteration = 0;
getDatesByCount(dateRules, new Date(recurrenceStartDate), new Date(recurrenceStartDate), rule).forEach(function(currentDate, i) {
if (currentDate < options.max) {
iteration++;
iterationResult = pushToResult(iteration, iterationResult, currentDate, i, config, true)
}
})
} else {
getDatesByRules(dateRules, new Date(recurrenceStartDate), rule).forEach(function(currentDate, i) {
var iteration = 0;
while (doNextIteration(currentDate, recurrenceStartDate, options.max, rule, iteration)) {
iteration++;
iterationResult = pushToResult(iteration, iterationResult, currentDate, i, config);
currentDate = incrementDate(currentDate, recurrenceStartDate, rule, i)
}
})
}
if (rule.bysetpos) {
each(iterationResult, function(iterationIndex, iterationDates) {
iterationResult[iterationIndex] = filterDatesBySetPos(iterationDates, rule.bysetpos)
})
}
each(iterationResult, function(_, iterationDates) {
result = result.concat(iterationDates)
});
result.sort(function(a, b) {
return a - b
});
return result
};
var pushToResult = function(iteration, iterationResult, currentDate, i, config, verifiedField) {
if (!iterationResult[iteration]) {
iterationResult[iteration] = []
}
if (checkDate(currentDate, i, config, verifiedField)) {
iterationResult[iteration].push(currentDate)
}
return iterationResult
};
var checkDate = function(currentDate, i, config, verifiedField) {
if (!dateIsRecurrenceException(currentDate, config.exception)) {
var duration = dateUtils.sameDate(currentDate, config.recurrenceEndDate) && config.recurrenceEndDate.getTime() > currentDate.getTime() ? config.recurrenceEndDate.getTime() - currentDate.getTime() : config.duration;
if (currentDate.getTime() >= config.recurrenceStartDate.getTime() && currentDate.getTime() + duration > config.min.getTime()) {
return verifiedField || checkDateByRule(currentDate, [config.dateRules[i]], config.rule.wkst)
}
}
return false
};
var filterDatesBySetPos = function(dates, bySetPos) {
var resultArray = [];
bySetPos.split(",").forEach(function(index) {
index = Number(index);
var dateIndex = index > 0 ? index - 1 : dates.length + index;
if (dates[dateIndex]) {
resultArray.push(dates[dateIndex])
}
});
return resultArray
};
var correctDate = function(originalDate, date) {
if (originalDate.getDate() !== date) {
originalDate.setDate(date)
}
};
var incrementDate = function(date, originalStartDate, rule, iterationStep) {
var initialDate = new Date(date);
var needCorrect = true;
date = dateUtils.addInterval(date, rule.interval);
if ("MONTHLY" === rule.freq && !rule.byday) {
var expectedDate = originalStartDate.getDate();
if (rule.bymonthday) {
expectedDate = Number(rule.bymonthday.split(",")[iterationStep]);
if (expectedDate < 0) {
initialDate.setMonth(initialDate.getMonth() + 1, 1);
dateSetterMap.bymonthday(initialDate, expectedDate);
date = initialDate;
needCorrect = false
}
}
needCorrect && correctDate(date, expectedDate)
}
if ("YEARLY" === rule.freq) {
if (rule.byyearday) {
var dayNumber = Number(rule.byyearday.split(",")[iterationStep]);
dateSetterMap.byyearday(date, dayNumber)
}
var dateRules = splitDateRules(rule);
for (var field in dateRules[iterationStep]) {
dateSetterMap[field] && dateSetterMap[field](date, dateRules[iterationStep][field], rule.wkst)
}
}
return date
};
var getDatePartDiffs = function(date1, date2) {
return {
years: date1.getFullYear() - date2.getFullYear(),
months: date1.getMonth() - date2.getMonth(),
days: date1.getDate() - date2.getDate(),
hours: date1.getHours() - date2.getHours(),
minutes: date1.getMinutes() - date2.getMinutes(),
seconds: date1.getSeconds() - date2.getSeconds()
}
};
var getRecurrenceRule = function(recurrence) {
var result = {
rule: {},
isValid: false
};
if (recurrence) {
result.rule = parseRecurrenceRule(recurrence);
result.isValid = validateRRule(result.rule, recurrence)
}
return result
};
var loggedWarnings = [];
var validateRRule = function(rule, recurrence) {
if (brokenRuleNameExists(rule) || inArray(rule.freq, freqNames) === -1 || wrongCountRule(rule) || wrongIntervalRule(rule) || wrongDayOfWeek(rule) || wrongByMonthDayRule(rule) || wrongByMonth(rule) || wrongUntilRule(rule)) {
logBrokenRule(recurrence);
return false
}
return true
};
var wrongUntilRule = function(rule) {
var wrongUntil = false;
var until = rule.until;
if (void 0 !== until && !(until instanceof Date)) {
wrongUntil = true
}
return wrongUntil
};
var wrongCountRule = function(rule) {
var wrongCount = false;
var count = rule.count;
if (count && "string" === typeof count) {
wrongCount = true
}
return wrongCount
};
var wrongByMonthDayRule = function(rule) {
var wrongByMonthDay = false;
var byMonthDay = rule.bymonthday;
if (byMonthDay && isNaN(parseInt(byMonthDay))) {
wrongByMonthDay = true
}
return wrongByMonthDay
};
var wrongByMonth = function wrongByMonth(rule) {
var wrongByMonth = false;
var byMonth = rule.bymonth;
if (byMonth && isNaN(parseInt(byMonth))) {
wrongByMonth = true
}
return wrongByMonth
};
var wrongIntervalRule = function(rule) {
var wrongInterval = false;
var interval = rule.interval;
if (interval && "string" === typeof interval) {
wrongInterval = true
}
return wrongInterval
};
var wrongDayOfWeek = function(rule) {
var daysByRule = daysFromByDayRule(rule);
var brokenDaysExist = false;
each(daysByRule, function(_, day) {
if (!Object.prototype.hasOwnProperty.call(days, day)) {
brokenDaysExist = true;
return false
}
});
return brokenDaysExist
};
var brokenRuleNameExists = function(rule) {
var brokenRuleExists = false;
each(rule, function(ruleName) {
if (inArray(ruleName, ruleNames) === -1) {
brokenRuleExists = true;
return false
}
});
return brokenRuleExists
};
var logBrokenRule = function(recurrence) {
if (inArray(recurrence, loggedWarnings) === -1) {
errors.log("W0006", recurrence);
loggedWarnings.push(recurrence)
}
};
var parseRecurrenceRule = function(recurrence) {
var ruleObject = {};
var ruleParts = recurrence.split(";");
for (var i = 0, len = ruleParts.length; i < len; i++) {
var rule = ruleParts[i].split("=");
var ruleName = rule[0].toLowerCase();
var ruleValue = rule[1];
ruleObject[ruleName] = ruleValue
}
var count = parseInt(ruleObject.count);
if (!isNaN(count)) {
ruleObject.count = count
}
if (ruleObject.interval) {
var interval = parseInt(ruleObject.interval);
if (!isNaN(interval)) {
ruleObject.interval = interval
}
} else {
ruleObject.interval = 1
}
if (ruleObject.freq && ruleObject.until) {
ruleObject.until = getDateByAsciiString(ruleObject.until)
}
return ruleObject
};
var getDateByAsciiString = function(string, initialDate) {
if ("string" !== typeof string) {
return string
}
var arrayDate = string.match(/(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2}))?(Z)?/);
if (!arrayDate) {
return null
}
var isUTC = void 0 !== arrayDate[8];
var currentOffset = initialDate ? initialDate.getTimezoneOffset() : resultUtils.getTimeZoneOffset();
var date = new(Function.prototype.bind.apply(Date, prepareDateArrayToParse(arrayDate)));
currentOffset = 6e4 * currentOffset;
if (isUTC) {
date = new Date(date.getTime() - currentOffset)
}
return date
};
var prepareDateArrayToParse = function(arrayDate) {
arrayDate.shift();
if (void 0 === arrayDate[3]) {
arrayDate.splice(3)
} else {
arrayDate.splice(3, 1);
arrayDate.splice(6)
}
arrayDate[1]--;
arrayDate.unshift(null);
return arrayDate
};
var daysFromByDayRule = function(rule) {
var result = [];
if (rule.byday) {
if (Array.isArray(rule.byday)) {
result = rule.byday
} else {
result = rule.byday.split(",")
}
}
return result
};
var getAsciiStringByDate = function(date) {
var currentOffset = 6e4 * resultUtils.getTimeZoneOffset();
date = new Date(date.getTime() + currentOffset);
return date.getFullYear() + ("0" + (date.getMonth() + 1)).slice(-2) + ("0" + date.getDate()).slice(-2) + "T" + ("0" + date.getHours()).slice(-2) + ("0" + date.getMinutes()).slice(-2) + ("0" + date.getSeconds()).slice(-2) + "Z"
};
var splitDateRules = function(rule) {
var firstDayOfWeek = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null;
var result = [];
if (isDefined(firstDayOfWeek)) {
rule.fdow = firstDayOfWeek
}
if (!rule.wkst) {
rule.wkst = isDefined(firstDayOfWeek) ? daysNames[firstDayOfWeek] : "MO"
}
if (rule.byweekno && !rule.byday) {
var dayNames = Object.keys(days);
for (var i = 0; i < days[rule.wkst]; i++) {
dayNames.push(dayNames.shift())
}
rule.byday = dayNames.join(",")
}
for (var field in dateSetterMap) {
if (!rule[field]) {
continue
}
var ruleFieldValues = rule[field].split(",");
var ruleArray = getDateRuleArray(field, ruleFieldValues);
result = result.length ? extendObjectArray(ruleArray, result) : ruleArray
}
return result
};
var getDateRuleArray = function(field, values) {
var result = [];
for (var i = 0, length = values.length; i < length; i++) {
var dateRule = {};
dateRule[field] = handleRuleFieldValue(field, values[i]);
result.push(dateRule)
}
return result
};
var handleRuleFieldValue = function(field, value) {
var result = parseInt(value);
if ("bymonth" === field) {
result -= 1
}
if ("byday" === field) {
result = days[value]
}
return result
};
var extendObjectArray = function(firstArray, secondArray) {
var result = [];
for (var i = 0, firstArrayLength = firstArray.length; i < firstArrayLength; i++) {
for (var j = 0, secondArrayLength = secondArray.length; j < secondArrayLength; j++) {
result.push(extend({}, firstArray[i], secondArray[j]))
}
}
return result
};
var getDatesByRules = function(dateRules, startDate, rule) {
var result = [];
for (var i = 0, len = dateRules.length; i < len; i++) {
var current = dateRules[i];
var updatedDate = prepareDate(startDate, dateRules, rule.wkst);
for (var field in current) {
dateSetterMap[field] && dateSetterMap[field](updatedDate, current[field], rule.wkst, rule.freq, rule.fdow)
}
if (Array.isArray(updatedDate)) {
result = result.concat(updatedDate)
} else {
result.push(new Date(updatedDate))
}
}
if (!result.length) {
result.push(startDate)
}
return result
};
var getDatesByCount = function(dateRules, startDate, recurrenceStartDate, rule) {
var result = [];
var count = rule.count;
var counter = 0;
var date = prepareDate(startDate, dateRules, rule.wkst);
while (counter < count) {
var dates = getDatesByRules(dateRules, date, rule);
var checkedDates = [];
for (var i = 0; i < dates.length; i++) {
if (dates[i].getTime() >= recurrenceStartDate.getTime()) {
checkedDates.push(dates[i])
}
}
var length = checkedDates.length;
counter += length;
var delCount = counter - count;
if (counter > count) {
checkedDates.splice(length - delCount, delCount)
}
for (i = 0; i < checkedDates.length; i++) {
result.push(checkedDates[i])
}
var interval = rule.interval;
if ("days" === Object.keys(interval)[0]) {
interval = {
weeks: 1
}
}
date = dateUtils.addInterval(date, interval)
}
return result
};
var prepareDate = function(startDate, dateRules, weekStartRule) {
var date = new Date(startDate);
var day = date.getDay();
if (dateRules.length && isDefined(dateRules[0].byday)) {
date.setDate(date.getDate() - day + days[weekStartRule] - (day < days[weekStartRule] ? 7 : 0))
} else {
date.setDate(1)
}
return date
};
var checkDateByRule = function(date, rules, weekStart) {
var result = false;
for (var i = 0; i < rules.length; i++) {
var current = rules[i];
var currentRuleResult = true;
for (var field in current) {
var processNegative = "bymonthday" === field && current[field] < 0;
if (dateGetterMap[field] && !processNegative && current[field] !== dateGetterMap[field](date, weekStart)) {
currentRuleResult = false
}
}
result = result || currentRuleResult
}
return result || !rules.length
};
var getRecurrenceString = function(object) {
if (!object || !object.freq) {
return
}
var result = "";
for (var field in object) {
var value = object[field];
if ("interval" === field && value < 2) {
continue
}
if ("until" === field) {
value = getAsciiStringByDate(value)
}
result += field + "=" + value + ";"
}
result = result.substring(0, result.length - 1);
return result.toUpperCase()
};
var resultUtils = {
getRecurrenceString: getRecurrenceString,
getRecurrenceRule: getRecurrenceRule,
getAsciiStringByDate: getAsciiStringByDate,
getDatesByRecurrence: getDatesByRecurrence,
dateInRecurrenceRange: dateInRecurrenceRange,
getDateByAsciiString: getDateByAsciiString,
daysFromByDayRule: daysFromByDayRule,
getTimeZoneOffset: getTimeZoneOffset
};
module.exports = resultUtils
}, , , , , ,
/*!******************************************************!*\
!*** ./artifacts/transpiled/bundles/modules/core.js ***!
\******************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
var window = windowUtils.getWindow();
var DevExpress = window.DevExpress = window.DevExpress || {};
var errors = DevExpress.errors = __webpack_require__( /*! ../../core/errors */ 21);
if (DevExpress._DEVEXTREME_BUNDLE_INITIALIZED) {
throw errors.Error("E0024")
}
DevExpress._DEVEXTREME_BUNDLE_INITIALIZED = true;
DevExpress.clientExporter = __webpack_require__( /*! ../../exporter */ 170);
DevExpress.excelExporter = __webpack_require__( /*! ../../exporter/exceljs/excelExporter */ 441);
DevExpress.VERSION = __webpack_require__( /*! ../../core/version */ 157);
DevExpress.Class = __webpack_require__( /*! ../../core/class */ 15);
DevExpress.DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
DevExpress.Component = __webpack_require__( /*! ../../core/component */ 133);
DevExpress.registerComponent = __webpack_require__( /*! ../../core/component_registrator */ 9);
DevExpress.devices = __webpack_require__( /*! ../../core/devices */ 16);
DevExpress.Color = __webpack_require__( /*! ../../color */ 94);
var animationFrame = __webpack_require__( /*! ../../animation/frame */ 112);
DevExpress.EventsMixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
DevExpress.utils = {};
DevExpress.utils.requestAnimationFrame = animationFrame.requestAnimationFrame;
DevExpress.utils.cancelAnimationFrame = animationFrame.cancelAnimationFrame;
DevExpress.utils.initMobileViewport = __webpack_require__( /*! ../../mobile/init_mobile_viewport/init_mobile_viewport */ 446).initMobileViewport;
DevExpress.utils.extendFromObject = __webpack_require__( /*! ../../core/utils/extend */ 0).extendFromObject;
DevExpress.utils.createComponents = __webpack_require__( /*! ../../core/utils/dom */ 12).createComponents;
DevExpress.utils.triggerShownEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerShownEvent;
DevExpress.utils.triggerHidingEvent = __webpack_require__( /*! ../../core/utils/dom */ 12).triggerHidingEvent;
DevExpress.utils.resetActiveElement = __webpack_require__( /*! ../../core/utils/dom */ 12).resetActiveElement;
DevExpress.utils.findBestMatches = __webpack_require__( /*! ../../core/utils/common */ 4).findBestMatches;
DevExpress.createQueue = __webpack_require__( /*! ../../core/utils/queue */ 263).create;
DevExpress.utils.dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
DevExpress.utils.common = __webpack_require__( /*! ../../core/utils/common */ 4);
DevExpress.utils.date = __webpack_require__( /*! ../../core/utils/date */ 22);
DevExpress.utils.browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
DevExpress.utils.inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
DevExpress.utils.iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
DevExpress.utils.readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
DevExpress.utils.resizeCallbacks = __webpack_require__( /*! ../../core/utils/resize_callbacks */ 130);
DevExpress.utils.console = __webpack_require__( /*! ../../core/utils/console */ 73);
DevExpress.utils.string = __webpack_require__( /*! ../../core/utils/string */ 44);
DevExpress.utils.support = __webpack_require__( /*! ../../core/utils/support */ 43);
DevExpress.utils.ajax = __webpack_require__( /*! ../../core/utils/ajax */ 58);
DevExpress.viewPort = __webpack_require__( /*! ../../core/utils/view_port */ 78).value;
DevExpress.hideTopOverlay = __webpack_require__( /*! ../../mobile/hide_top_overlay */ 213);
DevExpress.formatHelper = __webpack_require__( /*! ../../format_helper */ 64);
DevExpress.config = __webpack_require__( /*! ../../core/config */ 31);
DevExpress.animationPresets = __webpack_require__( /*! ../../animation/presets/presets */ 179).presets;
DevExpress.fx = __webpack_require__( /*! ../../animation/fx */ 38);
DevExpress.TransitionExecutor = __webpack_require__( /*! ../../animation/transition_executor/transition_executor */ 281).TransitionExecutor;
DevExpress.AnimationPresetCollection = __webpack_require__( /*! ../../animation/presets/presets */ 179).PresetCollection;
DevExpress.events = __webpack_require__( /*! ../../events */ 282);
DevExpress.events.click = __webpack_require__( /*! ../../events/click */ 19);
DevExpress.events.utils = __webpack_require__( /*! ../../events/utils */ 8);
DevExpress.events.GestureEmitter = __webpack_require__( /*! ../../events/gesture/emitter.gesture */ 158);
DevExpress.localization = __webpack_require__( /*! ../../localization */ 449);
module.exports = DevExpress
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/events/hover.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
var Class = __webpack_require__( /*! ../core/class */ 15);
var devices = __webpack_require__( /*! ../core/devices */ 16);
var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
var eventUtils = __webpack_require__( /*! ./utils */ 8);
var pointerEvents = __webpack_require__( /*! ./pointer */ 23);
var HOVERSTART_NAMESPACE = "dxHoverStart";
var HOVERSTART = "dxhoverstart";
var POINTERENTER_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.enter, HOVERSTART_NAMESPACE);
var HOVEREND_NAMESPACE = "dxHoverEnd";
var HOVEREND = "dxhoverend";
var POINTERLEAVE_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(pointerEvents.leave, HOVEREND_NAMESPACE);
var Hover = Class.inherit({
noBubble: true,
ctor: function() {
this._handlerArrayKeyPath = this._eventNamespace + "_HandlerStore"
},
setup: function(element) {
dataUtils.data(element, this._handlerArrayKeyPath, {})
},
add: function(element, handleObj) {
var that = this;
var handler = function(e) {
that._handler(e)
};
eventsEngine.on(element, this._originalEventName, handleObj.selector, handler);
dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid] = handler
},
_handler: function(e) {
if (eventUtils.isTouchEvent(e) || devices.isSimulator()) {
return
}
eventUtils.fireEvent({
type: this._eventName,
originalEvent: e,
delegateTarget: e.delegateTarget
})
},
remove: function(element, handleObj) {
var handler = dataUtils.data(element, this._handlerArrayKeyPath)[handleObj.guid];
eventsEngine.off(element, this._originalEventName, handleObj.selector, handler)
},
teardown: function(element) {
dataUtils.removeData(element, this._handlerArrayKeyPath)
}
});
var HoverStart = Hover.inherit({
ctor: function() {
this._eventNamespace = HOVERSTART_NAMESPACE;
this._eventName = HOVERSTART;
this._originalEventName = POINTERENTER_NAMESPACED_EVENT_NAME;
this.callBase()
},
_handler: function(e) {
var pointers = e.pointers || [];
if (!pointers.length) {
this.callBase(e)
}
}
});
var HoverEnd = Hover.inherit({
ctor: function() {
this._eventNamespace = HOVEREND_NAMESPACE;
this._eventName = HOVEREND;
this._originalEventName = POINTERLEAVE_NAMESPACED_EVENT_NAME;
this.callBase()
}
});
registerEvent(HOVERSTART, new HoverStart);
registerEvent(HOVEREND, new HoverEnd);
exports.start = HOVERSTART;
exports.end = HOVEREND
},
/*!***************************************************!*\
!*** ./artifacts/transpiled/data/custom_store.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var dataUtils = __webpack_require__( /*! ./utils */ 41);
var arrayUtils = __webpack_require__( /*! ./array_utils */ 135);
var isFunction = __webpack_require__( /*! ../core/utils/type */ 1).isFunction;
var config = __webpack_require__( /*! ../core/config */ 31);
var errors = __webpack_require__( /*! ./errors */ 36).errors;
var Store = __webpack_require__( /*! ./abstract_store */ 98);
var arrayQuery = __webpack_require__( /*! ./array_query */ 155);
var queryByOptions = __webpack_require__( /*! ./store_helper */ 81).queryByOptions;
var deferredUtils = __webpack_require__( /*! ../core/utils/deferred */ 6);
var Deferred = deferredUtils.Deferred;
var when = deferredUtils.when;
var fromPromise = deferredUtils.fromPromise;
var TOTAL_COUNT = "totalCount";
var LOAD = "load";
var BY_KEY = "byKey";
var INSERT = "insert";
var UPDATE = "update";
var REMOVE = "remove";
function isPromise(obj) {
return obj && isFunction(obj.then)
}
function trivialPromise(value) {
return (new Deferred).resolve(value).promise()
}
function ensureRequiredFuncOption(name, obj) {
if (!isFunction(obj)) {
throw errors.Error("E4011", name)
}
}
function throwInvalidUserFuncResult(name) {
throw errors.Error("E4012", name)
}
function createUserFuncFailureHandler(pendingDeferred) {
function errorMessageFromXhr(promiseArguments) {
var xhr = promiseArguments[0];
var textStatus = promiseArguments[1];
if (!xhr || !xhr.getResponseHeader) {
return null
}
return dataUtils.errorMessageFromXhr(xhr, textStatus)
}
return function(arg) {
var error;
if (arg instanceof Error) {
error = arg
} else {
error = new Error(errorMessageFromXhr(arguments) || arg && String(arg) || "Unknown error")
}
if (error.message !== dataUtils.XHR_ERROR_UNLOAD) {
pendingDeferred.reject(error)
}
}
}
function invokeUserLoad(store, options) {
var userFunc = store._loadFunc;
var userResult;
ensureRequiredFuncOption(LOAD, userFunc);
userResult = userFunc.apply(store, [options]);
if (Array.isArray(userResult)) {
userResult = trivialPromise(userResult)
} else {
if (null === userResult || void 0 === userResult) {
userResult = trivialPromise([])
} else {
if (!isPromise(userResult)) {
throwInvalidUserFuncResult(LOAD)
}
}
}
return fromPromise(userResult)
}
function invokeUserTotalCountFunc(store, options) {
var userFunc = store._totalCountFunc;
var userResult;
if (!isFunction(userFunc)) {
throw errors.Error("E4021")
}
userResult = userFunc.apply(store, [options]);
if (!isPromise(userResult)) {
userResult = Number(userResult);
if (!isFinite(userResult)) {
throwInvalidUserFuncResult(TOTAL_COUNT)
}
userResult = trivialPromise(userResult)
}
return fromPromise(userResult)
}
function invokeUserByKeyFunc(store, key, extraOptions) {
var userFunc = store._byKeyFunc;
var userResult;
ensureRequiredFuncOption(BY_KEY, userFunc);
userResult = userFunc.apply(store, [key, extraOptions]);
if (!isPromise(userResult)) {
userResult = trivialPromise(userResult)
}
return fromPromise(userResult)
}
function runRawLoad(pendingDeferred, store, userFuncOptions, continuation) {
if (store.__rawData) {
continuation(store.__rawData)
} else {
var loadPromise = store.__rawDataPromise || invokeUserLoad(store, userFuncOptions);
if (store._cacheRawData) {
store.__rawDataPromise = loadPromise
}
loadPromise.always(function() {
delete store.__rawDataPromise
}).done(function(rawData) {
if (store._cacheRawData) {
store.__rawData = rawData
}
continuation(rawData)
}).fail(createUserFuncFailureHandler(pendingDeferred))
}
}
function runRawLoadWithQuery(pendingDeferred, store, options, countOnly) {
options = options || {};
var userFuncOptions = {};
if ("userData" in options) {
userFuncOptions.userData = options.userData
}
runRawLoad(pendingDeferred, store, userFuncOptions, function(rawData) {
var rawDataQuery = arrayQuery(rawData, {
errorHandler: store._errorHandler
});
var itemsQuery;
var totalCountQuery;
var waitList = [];
var items;
var totalCount;
if (!countOnly) {
itemsQuery = queryByOptions(rawDataQuery, options);
if (itemsQuery === rawDataQuery) {
items = rawData.slice(0)
} else {
waitList.push(itemsQuery.enumerate().done(function(asyncResult) {
items = asyncResult
}))
}
}
if (options.requireTotalCount || countOnly) {
totalCountQuery = queryByOptions(rawDataQuery, options, true);
if (totalCountQuery === rawDataQuery) {
totalCount = rawData.length
} else {
waitList.push(totalCountQuery.count().done(function(asyncResult) {
totalCount = asyncResult
}))
}
}
when.apply($, waitList).done(function() {
if (countOnly) {
pendingDeferred.resolve(totalCount)
} else {
if (options.requireTotalCount) {
pendingDeferred.resolve(items, {
totalCount: totalCount
})
} else {
pendingDeferred.resolve(items)
}
}
}).fail(function(x) {
pendingDeferred.reject(x)
})
})
}
function runRawLoadWithKey(pendingDeferred, store, key) {
runRawLoad(pendingDeferred, store, {}, function(rawData) {
var keyExpr = store.key();
var item;
for (var i = 0, len = rawData.length; i < len; i++) {
item = rawData[i];
if (dataUtils.keysEqual(keyExpr, store.keyOf(rawData[i]), key)) {
pendingDeferred.resolve(item);
return
}
}
pendingDeferred.reject(errors.Error("E4009"))
})
}
var CustomStore = Store.inherit({
ctor: function(options) {
options = options || {};
this.callBase(options);
this._useDefaultSearch = !!options.useDefaultSearch || "raw" === options.loadMode;
this._loadMode = options.loadMode;
this._cacheRawData = false !== options.cacheRawData;
this._loadFunc = options[LOAD];
this._totalCountFunc = options[TOTAL_COUNT];
this._byKeyFunc = options[BY_KEY];
this._insertFunc = options[INSERT];
this._updateFunc = options[UPDATE];
this._removeFunc = options[REMOVE]
},
createQuery: function() {
throw errors.Error("E4010")
},
clearRawDataCache: function() {
delete this.__rawData
},
_totalCountImpl: function(options) {
var d = new Deferred;
if ("raw" === this._loadMode && !this._totalCountFunc) {
runRawLoadWithQuery(d, this, options, true)
} else {
invokeUserTotalCountFunc(this, options).done(function(count) {
d.resolve(Number(count))
}).fail(createUserFuncFailureHandler(d));
d = this._addFailHandlers(d)
}
return d.promise()
},
_pushImpl: function(changes) {
if (this.__rawData) {
arrayUtils.applyBatch(this, this.__rawData, changes)
}
},
_loadImpl: function(options) {
var d = new Deferred;
if ("raw" === this._loadMode) {
runRawLoadWithQuery(d, this, options, false)
} else {
invokeUserLoad(this, options).done(function(data, extra) {
d.resolve(data, extra)
}).fail(createUserFuncFailureHandler(d));
d = this._addFailHandlers(d)
}
return d.promise()
},
_byKeyImpl: function(key, extraOptions) {
var d = new Deferred;
if (this._byKeyViaLoad()) {
this._requireKey();
runRawLoadWithKey(d, this, key)
} else {
invokeUserByKeyFunc(this, key, extraOptions).done(function(obj) {
d.resolve(obj)
}).fail(createUserFuncFailureHandler(d))
}
return d.promise()
},
_byKeyViaLoad: function() {
return "raw" === this._loadMode && !this._byKeyFunc
},
_insertImpl: function(values) {
var that = this;
var userFunc = that._insertFunc;
var userResult;
var d = new Deferred;
ensureRequiredFuncOption(INSERT, userFunc);
userResult = userFunc.apply(that, [values]);
if (!isPromise(userResult)) {
userResult = trivialPromise(userResult)
}
fromPromise(userResult).done(function(serverResponse) {
if (config().useLegacyStoreResult) {
d.resolve(values, serverResponse)
} else {
d.resolve(serverResponse || values, that.keyOf(serverResponse))
}
}).fail(createUserFuncFailureHandler(d));
return d.promise()
},
_updateImpl: function(key, values) {
var userFunc = this._updateFunc;
var userResult;
var d = new Deferred;
ensureRequiredFuncOption(UPDATE, userFunc);
userResult = userFunc.apply(this, [key, values]);
if (!isPromise(userResult)) {
userResult = trivialPromise(userResult)
}
fromPromise(userResult).done(function(serverResponse) {
if (config().useLegacyStoreResult) {
d.resolve(key, values)
} else {
d.resolve(serverResponse || values, key)
}
}).fail(createUserFuncFailureHandler(d));
return d.promise()
},
_removeImpl: function(key) {
var userFunc = this._removeFunc;
var userResult;
var d = new Deferred;
ensureRequiredFuncOption(REMOVE, userFunc);
userResult = userFunc.apply(this, [key]);
if (!isPromise(userResult)) {
userResult = trivialPromise()
}
fromPromise(userResult).done(function() {
d.resolve(key)
}).fail(createUserFuncFailureHandler(d));
return d.promise()
}
});
module.exports = CustomStore
},
/*!************************************************************!*\
!*** ./artifacts/transpiled/ui/widget/swatch_container.js ***!
\************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var viewPortUtils = __webpack_require__( /*! ../../core/utils/view_port */ 78);
var SWATCH_CONTAINER_CLASS_PREFIX = "dx-swatch-";
var getSwatchContainer = function(element) {
var $element = $(element);
var swatchContainer = $element.closest('[class^="'.concat(SWATCH_CONTAINER_CLASS_PREFIX, '"], [class*=" ').concat(SWATCH_CONTAINER_CLASS_PREFIX, '"]'));
var viewport = viewPortUtils.value();
if (!swatchContainer.length) {
return viewport
}
var swatchClassRegex = new RegExp("(\\s|^)(".concat(SWATCH_CONTAINER_CLASS_PREFIX, ".*?)(\\s|$)"));
var swatchClass = swatchContainer[0].className.match(swatchClassRegex)[2];
var viewportSwatchContainer = viewport.children("." + swatchClass);
if (!viewportSwatchContainer.length) {
viewportSwatchContainer = $("
").addClass(swatchClass).appendTo(viewport)
}
return viewportSwatchContainer
};
module.exports = {
getSwatchContainer: getSwatchContainer
}
},
/*!**********************************************************!*\
!*** ./artifacts/transpiled/events/gesture/swipeable.js ***!
\**********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var swipeEvents = __webpack_require__( /*! ../swipe */ 174);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var DOMComponent = __webpack_require__( /*! ../../core/dom_component */ 67);
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var publicComponentUtils = __webpack_require__( /*! ../../core/utils/public_component */ 131);
var DX_SWIPEABLE = "dxSwipeable";
var SWIPEABLE_CLASS = "dx-swipeable";
var ACTION_TO_EVENT_MAP = {
onStart: swipeEvents.start,
onUpdated: swipeEvents.swipe,
onEnd: swipeEvents.end,
onCancel: "dxswipecancel"
};
var Swipeable = DOMComponent.inherit({
_getDefaultOptions: function() {
return extend(this.callBase(), {
elastic: true,
immediate: false,
direction: "horizontal",
itemSizeFunc: null,
onStart: null,
onUpdated: null,
onEnd: null,
onCancel: null
})
},
_render: function() {
this.callBase();
this.$element().addClass(SWIPEABLE_CLASS);
this._attachEventHandlers()
},
_attachEventHandlers: function() {
this._detachEventHandlers();
if (this.option("disabled")) {
return
}
var NAME = this.NAME;
this._createEventData();
each(ACTION_TO_EVENT_MAP, function(actionName, eventName) {
var action = this._createActionByOption(actionName, {
context: this
});
eventName = eventUtils.addNamespace(eventName, NAME);
eventsEngine.on(this.$element(), eventName, this._eventData, function(e) {
return action({
event: e
})
})
}.bind(this))
},
_createEventData: function() {
this._eventData = {
elastic: this.option("elastic"),
itemSizeFunc: this.option("itemSizeFunc"),
direction: this.option("direction"),
immediate: this.option("immediate")
}
},
_detachEventHandlers: function() {
eventsEngine.off(this.$element(), "." + DX_SWIPEABLE)
},
_optionChanged: function(args) {
switch (args.name) {
case "disabled":
case "onStart":
case "onUpdated":
case "onEnd":
case "onCancel":
case "elastic":
case "immediate":
case "itemSizeFunc":
case "direction":
this._detachEventHandlers();
this._attachEventHandlers();
break;
case "rtlEnabled":
break;
default:
this.callBase(args)
}
}
});
publicComponentUtils.name(Swipeable, DX_SWIPEABLE);
module.exports = Swipeable
},
/*!*******************************************************!*\
!*** ./artifacts/transpiled/localization/currency.js ***!
\*******************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var numberLocalization = __webpack_require__( /*! ./number */ 51);
numberLocalization.inject({
_formatNumberCore: function(value, format, formatConfig) {
if ("currency" === format) {
formatConfig.precision = formatConfig.precision || 0;
var result = this.format(value, extend({}, formatConfig, {
type: "fixedpoint"
}));
var currencyPart = this.getCurrencySymbol().symbol.replace("$", "$$$$");
result = result.replace(/^(\D*)(\d.*)/, "$1" + currencyPart + "$2");
return result
}
return this.callBase.apply(this, arguments)
},
getCurrencySymbol: function() {
return {
symbol: "$"
}
},
getOpenXmlCurrencyFormat: function() {
return "$#,##0{0}_);\\($#,##0{0}\\)"
}
})
},
/*!**********************************************************************!*\
!*** ./artifacts/transpiled/core/component_registrator_callbacks.js ***!
\**********************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var MemorizedCallbacks = __webpack_require__( /*! ./memorized_callbacks */ 177);
module.exports = new MemorizedCallbacks
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/events/pointer/base.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
var domAdapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
var Class = __webpack_require__( /*! ../../core/class */ 15);
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var POINTER_EVENTS_NAMESPACE = "dxPointerEvents";
var BaseStrategy = Class.inherit({
ctor: function(eventName, originalEvents) {
this._eventName = eventName;
this._originalEvents = eventUtils.addNamespace(originalEvents, POINTER_EVENTS_NAMESPACE);
this._handlerCount = 0;
this.noBubble = this._isNoBubble()
},
_isNoBubble: function() {
var eventName = this._eventName;
return "dxpointerenter" === eventName || "dxpointerleave" === eventName
},
_handler: function(e) {
var delegateTarget = this._getDelegateTarget(e);
return this._fireEvent({
type: this._eventName,
pointerType: e.pointerType || eventUtils.eventSource(e),
originalEvent: e,
delegateTarget: delegateTarget,
timeStamp: browser.mozilla ? (new Date).getTime() : e.timeStamp
})
},
_getDelegateTarget: function(e) {
var delegateTarget;
if (this.noBubble) {
delegateTarget = e.delegateTarget
}
return delegateTarget
},
_fireEvent: function(args) {
return eventUtils.fireEvent(args)
},
_setSelector: function(handleObj) {
this._selector = this.noBubble && handleObj ? handleObj.selector : null
},
_getSelector: function() {
return this._selector
},
setup: function() {
return true
},
add: function(element, handleObj) {
if (this._handlerCount <= 0 || this.noBubble) {
element = this.noBubble ? element : domAdapter.getDocument();
this._setSelector(handleObj);
var that = this;
eventsEngine.on(element, this._originalEvents, this._getSelector(), function(e) {
that._handler(e)
})
}
if (!this.noBubble) {
this._handlerCount++
}
},
remove: function(handleObj) {
this._setSelector(handleObj);
if (!this.noBubble) {
this._handlerCount--
}
},
teardown: function(element) {
if (this._handlerCount && !this.noBubble) {
return
}
element = this.noBubble ? element : domAdapter.getDocument();
if (this._originalEvents !== "." + POINTER_EVENTS_NAMESPACE) {
eventsEngine.off(element, this._originalEvents, this._getSelector())
}
},
dispose: function(element) {
element = this.noBubble ? element : domAdapter.getDocument();
eventsEngine.off(element, this._originalEvents)
}
});
module.exports = BaseStrategy
},
/*!**************************************************!*\
!*** ./artifacts/transpiled/data/array_query.js ***!
\**************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Class = __webpack_require__( /*! ../core/class */ 15);
var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
var compileGetter = __webpack_require__( /*! ../core/utils/data */ 20).compileGetter;
var toComparable = __webpack_require__( /*! ../core/utils/data */ 20).toComparable;
var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
var errorsModule = __webpack_require__( /*! ./errors */ 36);
var dataUtils = __webpack_require__( /*! ./utils */ 41);
var Iterator = Class.inherit({
toArray: function() {
var result = [];
this.reset();
while (this.next()) {
result.push(this.current())
}
return result
},
countable: function() {
return false
}
});
var ArrayIterator = Iterator.inherit({
ctor: function(array) {
this.array = array;
this.index = -1
},
next: function() {
if (this.index + 1 < this.array.length) {
this.index++;
return true
}
return false
},
current: function() {
return this.array[this.index]
},
reset: function() {
this.index = -1
},
toArray: function() {
return this.array.slice(0)
},
countable: function() {
return true
},
count: function() {
return this.array.length
}
});
var WrappedIterator = Iterator.inherit({
ctor: function(iter) {
this.iter = iter
},
next: function() {
return this.iter.next()
},
current: function() {
return this.iter.current()
},
reset: function() {
return this.iter.reset()
}
});
var MapIterator = WrappedIterator.inherit({
ctor: function(iter, mapper) {
this.callBase(iter);
this.index = -1;
this.mapper = mapper
},
current: function() {
return this.mapper(this.callBase(), this.index)
},
next: function() {
var hasNext = this.callBase();
if (hasNext) {
this.index++
}
return hasNext
}
});
var defaultCompare = function(xValue, yValue) {
xValue = toComparable(xValue);
yValue = toComparable(yValue);
if (null === xValue && null !== yValue) {
return -1
}
if (null !== xValue && null === yValue) {
return 1
}
if (void 0 === xValue && void 0 !== yValue) {
return 1
}
if (void 0 !== xValue && void 0 === yValue) {
return -1
}
if (xValue < yValue) {
return -1
}
if (xValue > yValue) {
return 1
}
return 0
};
var SortIterator = Iterator.inherit({
ctor: function(iter, getter, desc, compare) {
if (!(iter instanceof MapIterator)) {
iter = new MapIterator(iter, this._wrap)
}
this.iter = iter;
this.rules = [{
getter: getter,
desc: desc,
compare: compare
}]
},
thenBy: function(getter, desc, compare) {
var result = new SortIterator(this.sortedIter || this.iter, getter, desc, compare);
if (!this.sortedIter) {
result.rules = this.rules.concat(result.rules)
}
return result
},
next: function() {
this._ensureSorted();
return this.sortedIter.next()
},
current: function() {
this._ensureSorted();
return this.sortedIter.current()
},
reset: function() {
delete this.sortedIter
},
countable: function() {
return this.sortedIter || this.iter.countable()
},
count: function() {
if (this.sortedIter) {
return this.sortedIter.count()
}
return this.iter.count()
},
_ensureSorted: function() {
var that = this;
if (that.sortedIter) {
return
}
iteratorUtils.each(that.rules, function() {
this.getter = compileGetter(this.getter)
});
that.sortedIter = new MapIterator(new ArrayIterator(this.iter.toArray().sort(function(x, y) {
return that._compare(x, y)
})), that._unwrap)
},
_wrap: function(record, index) {
return {
index: index,
value: record
}
},
_unwrap: function(wrappedItem) {
return wrappedItem.value
},
_compare: function(x, y) {
var xIndex = x.index;
var yIndex = y.index;
x = x.value;
y = y.value;
if (x === y) {
return xIndex - yIndex
}
for (var i = 0, rulesCount = this.rules.length; i < rulesCount; i++) {
var rule = this.rules[i];
var xValue = rule.getter(x);
var yValue = rule.getter(y);
var compare = rule.compare || defaultCompare;
var compareResult = compare(xValue, yValue);
if (compareResult) {
return rule.desc ? -compareResult : compareResult
}
}
return xIndex - yIndex
}
});
var compileCriteria = function() {
var compileGroup = function(crit) {
var ops = [];
var isConjunctiveOperator = false;
var isConjunctiveNextOperator = false;
iteratorUtils.each(crit, function() {
if (Array.isArray(this) || typeUtils.isFunction(this)) {
if (ops.length > 1 && isConjunctiveOperator !== isConjunctiveNextOperator) {
throw new errorsModule.errors.Error("E4019")
}
ops.push(compileCriteria(this));
isConjunctiveOperator = isConjunctiveNextOperator;
isConjunctiveNextOperator = true
} else {
isConjunctiveNextOperator = dataUtils.isConjunctiveOperator(this)
}
});
return function(d) {
var result = isConjunctiveOperator;
for (var i = 0; i < ops.length; i++) {
if (ops[i](d) !== isConjunctiveOperator) {
result = !isConjunctiveOperator;
break
}
}
return result
}
};
var toString = function(value) {
return typeUtils.isDefined(value) ? value.toString() : ""
};
var compileBinary = function(crit) {
crit = dataUtils.normalizeBinaryCriterion(crit);
var getter = compileGetter(crit[0]);
var op = crit[1];
var value = crit[2];
value = toComparable(value);
switch (op.toLowerCase()) {
case "=":
return compileEquals(getter, value);
case "<>":
return compileEquals(getter, value, true);
case ">":
return function(obj) {
return toComparable(getter(obj)) > value
};
case "<":
return function(obj) {
return toComparable(getter(obj)) < value
};
case ">=":
return function(obj) {
return toComparable(getter(obj)) >= value
};
case "<=":
return function(obj) {
return toComparable(getter(obj)) <= value
};
case "startswith":
return function(obj) {
return 0 === toComparable(toString(getter(obj))).indexOf(value)
};
case "endswith":
return function(obj) {
var getterValue = toComparable(toString(getter(obj)));
var searchValue = toString(value);
if (getterValue.length < searchValue.length) {
return false
}
var index = getterValue.lastIndexOf(value);
return index !== -1 && index === getterValue.length - value.length
};
case "contains":
return function(obj) {
return toComparable(toString(getter(obj))).indexOf(value) > -1
};
case "notcontains":
return function(obj) {
return toComparable(toString(getter(obj))).indexOf(value) === -1
}
}
throw errorsModule.errors.Error("E4003", op)
};
function compileEquals(getter, value, negate) {
return function(obj) {
obj = toComparable(getter(obj));
var result = useStrictComparison(value) ? obj === value : obj == value;
if (negate) {
result = !result
}
return result
}
}
function useStrictComparison(value) {
return "" === value || 0 === value || false === value
}
function compileUnary(crit) {
var op = crit[0];
var criteria = compileCriteria(crit[1]);
if ("!" === op) {
return function(obj) {
return !criteria(obj)
}
}
throw errorsModule.errors.Error("E4003", op)
}
return function(crit) {
if (typeUtils.isFunction(crit)) {
return crit
}
if (dataUtils.isGroupCriterion(crit)) {
return compileGroup(crit)
}
if (dataUtils.isUnaryOperation(crit)) {
return compileUnary(crit)
}
return compileBinary(crit)
}
}();
var FilterIterator = WrappedIterator.inherit({
ctor: function(iter, criteria) {
this.callBase(iter);
this.criteria = compileCriteria(criteria)
},
next: function() {
while (this.iter.next()) {
if (this.criteria(this.current())) {
return true
}
}
return false
}
});
var GroupIterator = Iterator.inherit({
ctor: function(iter, getter) {
this.iter = iter;
this.getter = getter
},
next: function() {
this._ensureGrouped();
return this.groupedIter.next()
},
current: function() {
this._ensureGrouped();
return this.groupedIter.current()
},
reset: function() {
delete this.groupedIter
},
countable: function() {
return !!this.groupedIter
},
count: function() {
return this.groupedIter.count()
},
_ensureGrouped: function() {
if (this.groupedIter) {
return
}
var hash = {};
var keys = [];
var iter = this.iter;
var getter = compileGetter(this.getter);
iter.reset();
while (iter.next()) {
var current = iter.current();
var key = getter(current);
if (key in hash) {
hash[key].push(current)
} else {
hash[key] = [current];
keys.push(key)
}
}
this.groupedIter = new ArrayIterator(iteratorUtils.map(keys, function(key) {
return {
key: key,
items: hash[key]
}
}))
}
});
var SelectIterator = WrappedIterator.inherit({
ctor: function(iter, getter) {
this.callBase(iter);
this.getter = compileGetter(getter)
},
current: function() {
return this.getter(this.callBase())
},
countable: function() {
return this.iter.countable()
},
count: function() {
return this.iter.count()
}
});
var SliceIterator = WrappedIterator.inherit({
ctor: function(iter, skip, take) {
this.callBase(iter);
this.skip = Math.max(0, skip);
this.take = Math.max(0, take);
this.pos = 0
},
next: function() {
if (this.pos >= this.skip + this.take) {
return false
}
while (this.pos < this.skip && this.iter.next()) {
this.pos++
}
this.pos++;
return this.iter.next()
},
reset: function() {
this.callBase();
this.pos = 0
},
countable: function() {
return this.iter.countable()
},
count: function() {
return Math.min(this.iter.count() - this.skip, this.take)
}
});
var arrayQueryImpl = function arrayQueryImpl(iter, queryOptions) {
queryOptions = queryOptions || {};
if (!(iter instanceof Iterator)) {
iter = new ArrayIterator(iter)
}
var handleError = function(error) {
var handler = queryOptions.errorHandler;
if (handler) {
handler(error)
}
errorsModule._errorHandler(error)
};
var aggregateCore = function(aggregator) {
var d = (new Deferred).fail(handleError);
var seed;
var step = aggregator.step;
var finalize = aggregator.finalize;
try {
iter.reset();
if ("seed" in aggregator) {
seed = aggregator.seed
} else {
seed = iter.next() ? iter.current() : NaN
}
var accumulator = seed;
while (iter.next()) {
accumulator = step(accumulator, iter.current())
}
d.resolve(finalize ? finalize(accumulator) : accumulator)
} catch (x) {
d.reject(x)
}
return d.promise()
};
var aggregate = function(seed, step, finalize) {
if (arguments.length < 2) {
return aggregateCore({
step: arguments[0]
})
}
return aggregateCore({
seed: seed,
step: step,
finalize: finalize
})
};
var standardAggregate = function(name) {
return aggregateCore(dataUtils.aggregators[name])
};
var select = function(getter) {
if (!typeUtils.isFunction(getter) && !Array.isArray(getter)) {
getter = [].slice.call(arguments)
}
return chainQuery(new SelectIterator(iter, getter))
};
var selectProp = function(name) {
return select(compileGetter(name))
};
var chainQuery = function(iter) {
return arrayQueryImpl(iter, queryOptions)
};
return {
toArray: function() {
return iter.toArray()
},
enumerate: function() {
var d = (new Deferred).fail(handleError);
try {
d.resolve(iter.toArray())
} catch (x) {
d.reject(x)
}
return d.promise()
},
sortBy: function(getter, desc, compare) {
return chainQuery(new SortIterator(iter, getter, desc, compare))
},
thenBy: function(getter, desc, compare) {
if (iter instanceof SortIterator) {
return chainQuery(iter.thenBy(getter, desc, compare))
}
throw errorsModule.errors.Error("E4004")
},
filter: function(criteria) {
if (!Array.isArray(criteria)) {
criteria = [].slice.call(arguments)
}
return chainQuery(new FilterIterator(iter, criteria))
},
slice: function(skip, take) {
if (void 0 === take) {
take = Number.MAX_VALUE
}
return chainQuery(new SliceIterator(iter, skip, take))
},
select: select,
groupBy: function(getter) {
return chainQuery(new GroupIterator(iter, getter))
},
aggregate: aggregate,
count: function() {
if (iter.countable()) {
var d = (new Deferred).fail(handleError);
try {
d.resolve(iter.count())
} catch (x) {
d.reject(x)
}
return d.promise()
}
return standardAggregate("count")
},
sum: function(getter) {
if (getter) {
return selectProp(getter).sum()
}
return standardAggregate("sum")
},
min: function(getter) {
if (getter) {
return selectProp(getter).min()
}
return standardAggregate("min")
},
max: function(getter) {
if (getter) {
return selectProp(getter).max()
}
return standardAggregate("max")
},
avg: function(getter) {
if (getter) {
return selectProp(getter).avg()
}
return standardAggregate("avg")
}
}
};
module.exports = arrayQueryImpl
},
/*!**********************************************************!*\
!*** ./artifacts/transpiled/data/odata/query_adapter.js ***!
\**********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var config = __webpack_require__( /*! ../../core/config */ 31);
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var queryAdapters = __webpack_require__( /*! ../query_adapters */ 181);
var odataUtils = __webpack_require__( /*! ./utils */ 110);
var serializePropName = odataUtils.serializePropName;
var errors = __webpack_require__( /*! ../errors */ 36).errors;
var dataUtils = __webpack_require__( /*! ../utils */ 41);
var isFunction = typeUtils.isFunction;
var DEFAULT_PROTOCOL_VERSION = 2;
var compileCriteria = function() {
var protocolVersion;
var forceLowerCase;
var fieldTypes;
var createBinaryOperationFormatter = function(op) {
return function(prop, val) {
return prop + " " + op + " " + val
}
};
var createStringFuncFormatter = function(op, reverse) {
return function(prop, val) {
var bag = [op, "("];
if (forceLowerCase) {
prop = prop.indexOf("tolower(") === -1 ? "tolower(" + prop + ")" : prop;
val = val.toLowerCase()
}
if (reverse) {
bag.push(val, ",", prop)
} else {
bag.push(prop, ",", val)
}
bag.push(")");
return bag.join("")
}
};
var formatters = {
"=": createBinaryOperationFormatter("eq"),
"<>": createBinaryOperationFormatter("ne"),
">": createBinaryOperationFormatter("gt"),
">=": createBinaryOperationFormatter("ge"),
"<": createBinaryOperationFormatter("lt"),
"<=": createBinaryOperationFormatter("le"),
startswith: createStringFuncFormatter("startswith"),
endswith: createStringFuncFormatter("endswith")
};
var formattersV2 = extend({}, formatters, {
contains: createStringFuncFormatter("substringof", true),
notcontains: createStringFuncFormatter("not substringof", true)
});
var formattersV4 = extend({}, formatters, {
contains: createStringFuncFormatter("contains"),
notcontains: createStringFuncFormatter("not contains")
});
var compileBinary = function(criteria) {
criteria = dataUtils.normalizeBinaryCriterion(criteria);
var op = criteria[1];
var formatters = 4 === protocolVersion ? formattersV4 : formattersV2;
var formatter = formatters[op.toLowerCase()];
if (!formatter) {
throw errors.Error("E4003", op)
}
var fieldName = criteria[0];
var value = criteria[2];
if (fieldTypes && fieldTypes[fieldName]) {
value = odataUtils.convertPrimitiveValue(fieldTypes[fieldName], value)
}
return formatter(serializePropName(fieldName), odataUtils.serializeValue(value, protocolVersion))
};
var compileUnary = function(criteria) {
var op = criteria[0];
var crit = compileCore(criteria[1]);
if ("!" === op) {
return "not (" + crit + ")"
}
throw errors.Error("E4003", op)
};
var compileGroup = function(criteria) {
var bag = [];
var groupOperator;
var nextGroupOperator;
iteratorUtils.each(criteria, function(index, criterion) {
if (Array.isArray(criterion)) {
if (bag.length > 1 && groupOperator !== nextGroupOperator) {
throw new errors.Error("E4019")
}
bag.push("(" + compileCore(criterion) + ")");
groupOperator = nextGroupOperator;
nextGroupOperator = "and"
} else {
nextGroupOperator = dataUtils.isConjunctiveOperator(this) ? "and" : "or"
}
});
return bag.join(" " + groupOperator + " ")
};
var compileCore = function(criteria) {
if (Array.isArray(criteria[0])) {
return compileGroup(criteria)
}
if (dataUtils.isUnaryOperation(criteria)) {
return compileUnary(criteria)
}
return compileBinary(criteria)
};
return function(criteria, version, types, filterToLower) {
fieldTypes = types;
forceLowerCase = typeUtils.isDefined(filterToLower) ? filterToLower : config().oDataFilterToLower;
protocolVersion = version;
return compileCore(criteria)
}
}();
var createODataQueryAdapter = function(queryOptions) {
var _sorting = [];
var _criteria = [];
var _expand = queryOptions.expand;
var _select;
var _skip;
var _take;
var _countQuery;
var _oDataVersion = queryOptions.version || DEFAULT_PROTOCOL_VERSION;
var hasSlice = function() {
return _skip || void 0 !== _take
};
var hasFunction = function hasFunction(criterion) {
for (var i = 0; i < criterion.length; i++) {
if (isFunction(criterion[i])) {
return true
}
if (Array.isArray(criterion[i]) && hasFunction(criterion[i])) {
return true
}
}
return false
};
var requestData = function() {
var result = {};
if (!_countQuery) {
if (_sorting.length) {
result.$orderby = _sorting.join(",")
}
if (_skip) {
result.$skip = _skip
}
if (void 0 !== _take) {
result.$top = _take
}
result.$select = odataUtils.generateSelect(_oDataVersion, _select) || void 0;
result.$expand = odataUtils.generateExpand(_oDataVersion, _expand, _select) || void 0
}
if (_criteria.length) {
var criteria = _criteria.length < 2 ? _criteria[0] : _criteria;
var fieldTypes = queryOptions && queryOptions.fieldTypes;
var filterToLower = queryOptions && queryOptions.filterToLower;
result.$filter = compileCriteria(criteria, _oDataVersion, fieldTypes, filterToLower)
}
if (_countQuery) {
result.$top = 0
}
if (queryOptions.requireTotalCount || _countQuery) {
if (4 !== _oDataVersion) {
result.$inlinecount = "allpages"
} else {
result.$count = "true"
}
}
return result
};
function tryLiftSelect(tasks) {
var selectIndex = -1;
for (var i = 0; i < tasks.length; i++) {
if ("select" === tasks[i].name) {
selectIndex = i;
break
}
}
if (selectIndex < 0 || !isFunction(tasks[selectIndex].args[0])) {
return
}
var nextTask = tasks[1 + selectIndex];
if (!nextTask || "slice" !== nextTask.name) {
return
}
tasks[1 + selectIndex] = tasks[selectIndex];
tasks[selectIndex] = nextTask
}
return {
optimize: function(tasks) {
tryLiftSelect(tasks)
},
exec: function(url) {
return odataUtils.sendRequest(_oDataVersion, {
url: url,
params: extend(requestData(), queryOptions && queryOptions.params)
}, {
beforeSend: queryOptions.beforeSend,
jsonp: queryOptions.jsonp,
withCredentials: queryOptions.withCredentials,
countOnly: _countQuery,
deserializeDates: queryOptions.deserializeDates,
fieldTypes: queryOptions.fieldTypes,
isPaged: isFinite(_take)
})
},
multiSort: function(args) {
var rules;
if (hasSlice()) {
return false
}
for (var i = 0; i < args.length; i++) {
var getter = args[i][0];
var desc = !!args[i][1];
var rule;
if ("string" !== typeof getter) {
return false
}
rule = serializePropName(getter);
if (desc) {
rule += " desc"
}
rules = rules || [];
rules.push(rule)
}
_sorting = rules
},
slice: function(skipCount, takeCount) {
if (hasSlice()) {
return false
}
_skip = skipCount;
_take = takeCount
},
filter: function(criterion) {
if (hasSlice()) {
return false
}
if (!Array.isArray(criterion)) {
criterion = [].slice.call(arguments)
}
if (hasFunction(criterion)) {
return false
}
if (_criteria.length) {
_criteria.push("and")
}
_criteria.push(criterion)
},
select: function(expr) {
if (_select || isFunction(expr)) {
return false
}
if (!Array.isArray(expr)) {
expr = [].slice.call(arguments)
}
_select = expr
},
count: function() {
_countQuery = true
}
}
};
queryAdapters.odata = createODataQueryAdapter;
exports.odata = createODataQueryAdapter
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/core/version.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = "19.1.16"
},
/*!****************************************************************!*\
!*** ./artifacts/transpiled/events/gesture/emitter.gesture.js ***!
\****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var devices = __webpack_require__( /*! ../../core/devices */ 16);
var styleUtils = __webpack_require__( /*! ../../core/utils/style */ 85);
var callOnce = __webpack_require__( /*! ../../core/utils/call_once */ 63);
var domUtils = __webpack_require__( /*! ../../core/utils/dom */ 12);
var readyCallbacks = __webpack_require__( /*! ../../core/utils/ready_callbacks */ 48);
var ready = readyCallbacks.add;
var mathUtils = __webpack_require__( /*! ../../core/utils/math */ 28);
var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
var isDefined = __webpack_require__( /*! ../../core/utils/type */ 1).isDefined;
var eventUtils = __webpack_require__( /*! ../utils */ 8);
var Emitter = __webpack_require__( /*! ../core/emitter */ 123);
var sign = mathUtils.sign;
var abs = Math.abs;
var SLEEP = 0;
var INITED = 1;
var STARTED = 2;
var TOUCH_BOUNDARY = 10;
var IMMEDIATE_TOUCH_BOUNDARY = 0;
var IMMEDIATE_TIMEOUT = 180;
var supportPointerEvents = function() {
return styleUtils.styleProp("pointer-events")
};
var setGestureCover = callOnce(function() {
var GESTURE_COVER_CLASS = "dx-gesture-cover";
var isDesktop = "generic" === devices.real().platform;
if (!supportPointerEvents() || !isDesktop) {
return noop
}
var $cover = $("
").addClass(GESTURE_COVER_CLASS).css("pointerEvents", "none");
eventsEngine.subscribeGlobal($cover, "dxmousewheel", function(e) {
e.preventDefault()
});
ready(function() {
$cover.appendTo("body")
});
return function(toggle, cursor) {
$cover.css("pointerEvents", toggle ? "all" : "none");
toggle && $cover.css("cursor", cursor)
}
});
var gestureCover = function(toggle, cursor) {
var gestureCoverStrategy = setGestureCover();
gestureCoverStrategy(toggle, cursor)
};
var GestureEmitter = Emitter.inherit({
gesture: true,
configure: function(data) {
this.getElement().css("msTouchAction", data.immediate ? "pinch-zoom" : "");
this.callBase(data)
},
allowInterruptionByMouseWheel: function() {
return this._stage !== STARTED
},
getDirection: function() {
return this.direction
},
_cancel: function() {
this.callBase.apply(this, arguments);
this._toggleGestureCover(false);
this._stage = SLEEP
},
start: function(e) {
if (e._needSkipEvent || eventUtils.needSkipEvent(e)) {
this._cancel(e);
return
}
this._startEvent = eventUtils.createEvent(e);
this._startEventData = eventUtils.eventData(e);
this._stage = INITED;
this._init(e);
this._setupImmediateTimer()
},
_setupImmediateTimer: function() {
clearTimeout(this._immediateTimer);
this._immediateAccepted = false;
if (!this.immediate) {
return
}
this._immediateTimer = setTimeout(function() {
this._immediateAccepted = true
}.bind(this), IMMEDIATE_TIMEOUT)
},
move: function(e) {
if (this._stage === INITED && this._directionConfirmed(e)) {
this._stage = STARTED;
this._resetActiveElement();
this._toggleGestureCover(true);
this._clearSelection(e);
this._adjustStartEvent(e);
this._start(this._startEvent);
if (this._stage === SLEEP) {
return
}
this._requestAccept(e);
this._move(e);
this._forgetAccept()
} else {
if (this._stage === STARTED) {
this._clearSelection(e);
this._move(e)
}
}
},
_directionConfirmed: function(e) {
var touchBoundary = this._getTouchBoundary(e);
var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
var deltaX = abs(delta.x);
var deltaY = abs(delta.y);
var horizontalMove = this._validateMove(touchBoundary, deltaX, deltaY);
var verticalMove = this._validateMove(touchBoundary, deltaY, deltaX);
var direction = this.getDirection(e);
var bothAccepted = "both" === direction && (horizontalMove || verticalMove);
var horizontalAccepted = "horizontal" === direction && horizontalMove;
var verticalAccepted = "vertical" === direction && verticalMove;
return bothAccepted || horizontalAccepted || verticalAccepted || this._immediateAccepted
},
_validateMove: function(touchBoundary, mainAxis, crossAxis) {
return mainAxis && mainAxis >= touchBoundary && (this.immediate ? mainAxis >= crossAxis : true)
},
_getTouchBoundary: function(e) {
return this.immediate || eventUtils.isDxMouseWheelEvent(e) ? IMMEDIATE_TOUCH_BOUNDARY : TOUCH_BOUNDARY
},
_adjustStartEvent: function(e) {
var touchBoundary = this._getTouchBoundary(e);
var delta = eventUtils.eventDelta(this._startEventData, eventUtils.eventData(e));
this._startEvent.pageX += sign(delta.x) * touchBoundary;
this._startEvent.pageY += sign(delta.y) * touchBoundary
},
_resetActiveElement: function() {
if ("ios" === devices.real().platform && this.getElement().find(":focus").length) {
domUtils.resetActiveElement()
}
},
_toggleGestureCover: function(toggle) {
this._toggleGestureCoverImpl(toggle)
},
_toggleGestureCoverImpl: function(toggle) {
var isStarted = this._stage === STARTED;
if (isStarted) {
gestureCover(toggle, this.getElement().css("cursor"))
}
},
_clearSelection: function(e) {
if (eventUtils.isDxMouseWheelEvent(e) || eventUtils.isTouchEvent(e)) {
return
}
domUtils.clearSelection()
},
end: function(e) {
this._toggleGestureCover(false);
if (this._stage === STARTED) {
this._end(e)
} else {
if (this._stage === INITED) {
this._stop(e)
}
}
this._stage = SLEEP
},
dispose: function() {
clearTimeout(this._immediateTimer);
this.callBase.apply(this, arguments);
this._toggleGestureCover(false)
},
_init: noop,
_start: noop,
_move: noop,
_stop: noop,
_end: noop
});
GestureEmitter.initialTouchBoundary = TOUCH_BOUNDARY;
GestureEmitter.touchBoundary = function(newBoundary) {
if (isDefined(newBoundary)) {
TOUCH_BOUNDARY = newBoundary;
return
}
return TOUCH_BOUNDARY
};
module.exports = GestureEmitter
},
/*!************************************************!*\
!*** ./artifacts/transpiled/ui/scroll_view.js ***!
\************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./scroll_view/ui.scroll_view */ 517)
},
/*!********************************************!*\
!*** ./artifacts/transpiled/ui/toolbar.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var themes = __webpack_require__( /*! ./themes */ 30);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var grep = __webpack_require__( /*! ../core/utils/common */ 4).grep;
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var arrayUtils = __webpack_require__( /*! ../core/utils/array */ 14);
var iteratorUtils = __webpack_require__( /*! ../core/utils/iterator */ 3);
var ActionSheetStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.action_sheet */ 571);
var DropDownMenuStrategy = __webpack_require__( /*! ./toolbar/ui.toolbar.strategy.drop_down_menu */ 572);
var ToolbarBase = __webpack_require__( /*! ./toolbar/ui.toolbar.base */ 289);
var ChildDefaultTemplate = __webpack_require__( /*! ./widget/child_default_template */ 134);
var STRATEGIES = {
actionSheet: ActionSheetStrategy,
dropDownMenu: DropDownMenuStrategy
};
var TOOLBAR_AUTO_HIDE_ITEM_CLASS = "dx-toolbar-item-auto-hide";
var TOOLBAR_AUTO_HIDE_TEXT_CLASS = "dx-toolbar-text-auto-hide";
var TOOLBAR_HIDDEN_ITEM = "dx-toolbar-item-invisible";
var Toolbar = ToolbarBase.inherit({
_getDefaultOptions: function() {
return extend(this.callBase(), {
menuItemTemplate: "menuItem",
submenuType: "dropDownMenu",
menuContainer: void 0
})
},
_defaultOptionsRules: function() {
var themeName = themes.current();
return this.callBase().concat([{
device: function() {
return themes.isIos7(themeName)
},
options: {
submenuType: "actionSheet"
}
}])
},
_dimensionChanged: function(dimension) {
if ("height" === dimension) {
return
}
this._menuStrategy.toggleMenuVisibility(false, true);
this.callBase();
this._menuStrategy.renderMenuItems()
},
_initTemplates: function() {
this.callBase();
this._defaultTemplates.actionSheetItem = new ChildDefaultTemplate("item", this)
},
_initMarkup: function() {
this.callBase();
this._renderMenu()
},
_postProcessRenderItems: function() {
this._hideOverflowItems();
this._menuStrategy._updateMenuVisibility();
this.callBase();
this._menuStrategy.renderMenuItems()
},
_renderItem: function(index, item, itemContainer, $after) {
var itemElement = this.callBase(index, item, itemContainer, $after);
if ("auto" === item.locateInMenu) {
itemElement.addClass(TOOLBAR_AUTO_HIDE_ITEM_CLASS)
}
if ("dxButton" === item.widget && "inMenu" === item.showText) {
itemElement.toggleClass(TOOLBAR_AUTO_HIDE_TEXT_CLASS)
}
return itemElement
},
_getItemsWidth: function() {
return this._getSummaryItemsWidth([this._$beforeSection, this._$centerSection, this._$afterSection])
},
_hideOverflowItems: function(elementWidth) {
var overflowItems = this.$element().find("." + TOOLBAR_AUTO_HIDE_ITEM_CLASS);
if (!overflowItems.length) {
return
}
elementWidth = elementWidth || this.$element().width();
$(overflowItems).removeClass(TOOLBAR_HIDDEN_ITEM);
var itemsWidth = this._getItemsWidth();
while (overflowItems.length && elementWidth < itemsWidth) {
var $item = overflowItems.eq(-1);
itemsWidth -= $item.outerWidth();
$item.addClass(TOOLBAR_HIDDEN_ITEM);
overflowItems.splice(-1, 1)
}
},
_getMenuItems: function() {
var that = this;
var menuItems = grep(this.option("items") || [], function(item) {
return that._isMenuItem(item)
});
var $hiddenItems = this._itemContainer().children("." + TOOLBAR_AUTO_HIDE_ITEM_CLASS + "." + TOOLBAR_HIDDEN_ITEM).not(".dx-state-invisible");
this._restoreItems = this._restoreItems || [];
var overflowItems = [].slice.call($hiddenItems).map(function(item) {
var itemData = that._getItemData(item);
var $itemContainer = $(item).children();
var $itemMarkup = $itemContainer.children();
return extend({
menuItemTemplate: function() {
that._restoreItems.push({
container: $itemContainer,
item: $itemMarkup
});
var $container = $("
").addClass(TOOLBAR_AUTO_HIDE_ITEM_CLASS);
return $container.append($itemMarkup)
}
}, itemData)
});
return arrayUtils.merge(overflowItems, menuItems)
},
_getToolbarItems: function() {
var that = this;
return grep(this.option("items") || [], function(item) {
return !that._isMenuItem(item)
})
},
_renderMenu: function() {
this._renderMenuStrategy();
this._menuStrategy.render()
},
_renderMenuStrategy: function() {
var strategyName = this.option("submenuType");
if (this._requireDropDownStrategy()) {
strategyName = "dropDownMenu"
}
var strategy = STRATEGIES[strategyName];
if (!(this._menuStrategy && this._menuStrategy.NAME === strategyName)) {
this._menuStrategy = new strategy(this)
}
},
_requireDropDownStrategy: function() {
var items = this.option("items") || [];
var result = false;
iteratorUtils.each(items, function(index, item) {
if ("auto" === item.locateInMenu) {
result = true
} else {
if ("always" === item.locateInMenu && item.widget) {
result = true
}
}
});
return result
},
_arrangeItems: function() {
if (this.$element().is(":hidden")) {
return
}
this._$centerSection.css({
margin: "0 auto",
"float": "none"
});
iteratorUtils.each(this._restoreItems || [], function(_, obj) {
$(obj.container).append(obj.item)
});
this._restoreItems = [];
var elementWidth = this.$element().width();
this._hideOverflowItems(elementWidth);
this.callBase(elementWidth)
},
_itemOptionChanged: function(item, property, value) {
if (this._isMenuItem(item)) {
this._menuStrategy.renderMenuItems()
} else {
if (this._isToolbarItem(item)) {
this.callBase(item, property, value)
} else {
this.callBase(item, property, value);
this._menuStrategy.renderMenuItems()
}
}
},
_isMenuItem: function(itemData) {
return "menu" === itemData.location || "always" === itemData.locateInMenu
},
_isToolbarItem: function(itemData) {
return void 0 === itemData.location || "never" === itemData.locateInMenu
},
_optionChanged: function(args) {
var name = args.name;
var value = args.value;
switch (name) {
case "submenuType":
this._invalidate();
break;
case "visible":
this.callBase.apply(this, arguments);
this._menuStrategy.handleToolbarVisibilityChange(value);
break;
case "menuItemTemplate":
this._changeMenuOption("itemTemplate", this._getTemplate(value));
break;
case "onItemClick":
this._changeMenuOption(name, value);
this.callBase.apply(this, arguments);
break;
case "menuContainer":
this._changeMenuOption("container", value);
break;
default:
this.callBase.apply(this, arguments)
}
},
_changeMenuOption: function(name, value) {
this._menuStrategy.widgetOption(name, value)
}
});
registerComponent("dxToolbar", Toolbar);
module.exports = Toolbar
},
/*!********************************************!*\
!*** ./artifacts/transpiled/ui/tooltip.js ***!
\********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./tooltip/tooltip */ 326);
module.exports.show = __webpack_require__( /*! ./tooltip/ui.tooltip */ 227).show;
module.exports.hide = __webpack_require__( /*! ./tooltip/ui.tooltip */ 227).hide
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/ui/shared/filtering.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var typeUtils = __webpack_require__( /*! ../../core/utils/type */ 1);
var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
var iteratorUtils = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var DEFAULT_DATE_INTERVAL = ["year", "month", "day"];
var DEFAULT_DATETIME_INTERVAL = ["year", "month", "day", "hour", "minute"];
module.exports = function() {
var getFilterSelector = function(column, target) {
var selector = column.dataField || column.selector;
if ("search" === target) {
selector = column.displayField || column.calculateDisplayValue || selector
}
return selector
};
var isZeroTime = function(date) {
return date.getHours() + date.getMinutes() + date.getSeconds() + date.getMilliseconds() < 1
};
var isDateType = function(dataType) {
return "date" === dataType || "datetime" === dataType
};
var getDateValues = function(dateValue) {
if (typeUtils.isDate(dateValue)) {
return [dateValue.getFullYear(), dateValue.getMonth(), dateValue.getDate(), dateValue.getHours(), dateValue.getMinutes(), dateValue.getSeconds()]
}
return iteratorUtils.map(("" + dateValue).split("/"), function(value, index) {
return 1 === index ? Number(value) - 1 : Number(value)
})
};
var getFilterExpressionByRange = function(filterValue, target) {
var column = this;
var endFilterValue;
var startFilterExpression;
var endFilterExpression;
var selector = getFilterSelector(column, target);
if (Array.isArray(filterValue) && typeUtils.isDefined(filterValue[0]) && typeUtils.isDefined(filterValue[1])) {
startFilterExpression = [selector, ">=", filterValue[0]];
endFilterExpression = [selector, "<=", filterValue[1]];
if (isDateType(column.dataType) && isZeroTime(filterValue[1])) {
endFilterValue = new Date(filterValue[1].getTime());
if ("date" === column.dataType) {
endFilterValue.setDate(filterValue[1].getDate() + 1)
}
endFilterExpression = [selector, "<", endFilterValue]
}
return [startFilterExpression, "and", endFilterExpression]
}
};
var getFilterExpressionForDate = function(filterValue, selectedFilterOperation, target) {
var column = this;
var dateStart;
var dateEnd;
var dateInterval;
var values = getDateValues(filterValue);
var selector = getFilterSelector(column, target);
if ("headerFilter" === target) {
dateInterval = module.exports.getGroupInterval(column)[values.length - 1]
} else {
if ("datetime" === column.dataType) {
dateInterval = "minute"
}
}
switch (dateInterval) {
case "year":
dateStart = new Date(values[0], 0, 1);
dateEnd = new Date(values[0] + 1, 0, 1);
break;
case "month":
dateStart = new Date(values[0], values[1], 1);
dateEnd = new Date(values[0], values[1] + 1, 1);
break;
case "quarter":
dateStart = new Date(values[0], 3 * values[1], 1);
dateEnd = new Date(values[0], 3 * values[1] + 3, 1);
break;
case "hour":
dateStart = new Date(values[0], values[1], values[2], values[3]);
dateEnd = new Date(values[0], values[1], values[2], values[3] + 1);
break;
case "minute":
dateStart = new Date(values[0], values[1], values[2], values[3], values[4]);
dateEnd = new Date(values[0], values[1], values[2], values[3], values[4] + 1);
break;
case "second":
dateStart = new Date(values[0], values[1], values[2], values[3], values[4], values[5]);
dateEnd = new Date(values[0], values[1], values[2], values[3], values[4], values[5] + 1);
break;
default:
dateStart = new Date(values[0], values[1], values[2]);
dateEnd = new Date(values[0], values[1], values[2] + 1)
}
switch (selectedFilterOperation) {
case "<":
return [selector, "<", dateStart];
case "<=":
return [selector, "<", dateEnd];
case ">":
return [selector, ">=", dateEnd];
case ">=":
return [selector, ">=", dateStart];
case "<>":
return [
[selector, "<", dateStart], "or", [selector, ">=", dateEnd]
];
default:
return [
[selector, ">=", dateStart], "and", [selector, "<", dateEnd]
]
}
};
var getFilterExpressionForNumber = function(filterValue, selectedFilterOperation, target) {
var column = this;
var selector = getFilterSelector(column, target);
var groupInterval = module.exports.getGroupInterval(column);
if ("headerFilter" === target && groupInterval && typeUtils.isDefined(filterValue)) {
var values = ("" + filterValue).split("/");
var value = Number(values[values.length - 1]);
var interval = groupInterval[values.length - 1];
var startFilterValue = [selector, ">=", value];
var endFilterValue = [selector, "<", value + interval];
var condition = [startFilterValue, "and", endFilterValue];
return condition
}
return [selector, selectedFilterOperation || "=", filterValue]
};
return {
defaultCalculateFilterExpression: function(filterValue, selectedFilterOperation, target) {
var column = this;
var selector = getFilterSelector(column, target);
var isSearchByDisplayValue = column.calculateDisplayValue && "search" === target;
var dataType = isSearchByDisplayValue && column.lookup && column.lookup.dataType || column.dataType;
var filter = null;
if (("headerFilter" === target || "filterBuilder" === target) && null === filterValue) {
filter = [selector, selectedFilterOperation || "=", null];
if ("string" === dataType) {
filter = [filter, "=" === selectedFilterOperation ? "or" : "and", [selector, selectedFilterOperation || "=", ""]]
}
} else {
if ("string" === dataType && (!column.lookup || isSearchByDisplayValue)) {
filter = [selector, selectedFilterOperation || "contains", filterValue]
} else {
if ("between" === selectedFilterOperation) {
return getFilterExpressionByRange.apply(column, [filterValue, target])
} else {
if (isDateType(dataType) && typeUtils.isDefined(filterValue)) {
return getFilterExpressionForDate.apply(column, arguments)
} else {
if ("number" === dataType) {
return getFilterExpressionForNumber.apply(column, arguments)
} else {
if ("object" !== dataType) {
filter = [selector, selectedFilterOperation || "=", filterValue]
}
}
}
}
}
}
return filter
},
getGroupInterval: function(column) {
var index;
var result = [];
var dateIntervals = ["year", "month", "day", "hour", "minute", "second"];
var groupInterval = column.headerFilter && column.headerFilter.groupInterval;
var interval = "quarter" === groupInterval ? "month" : groupInterval;
if (isDateType(column.dataType) && null !== groupInterval) {
result = "datetime" === column.dataType ? DEFAULT_DATETIME_INTERVAL : DEFAULT_DATE_INTERVAL;
index = inArray(interval, dateIntervals);
if (index >= 0) {
result = dateIntervals.slice(0, index);
result.push(groupInterval);
return result
}
return result
} else {
if (typeUtils.isDefined(groupInterval)) {
return Array.isArray(groupInterval) ? groupInterval : [groupInterval]
}
}
}
}
}()
},
/*!************************************************************************!*\
!*** ./artifacts/transpiled/ui/grid_core/ui.grid_core.columns_view.js ***!
\************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _element_data = __webpack_require__( /*! ../../core/element_data */ 39);
var _element_data2 = _interopRequireDefault(_element_data);
var _pointer = __webpack_require__( /*! ../../events/pointer */ 23);
var _pointer2 = _interopRequireDefault(_pointer);
var _click = __webpack_require__( /*! ../../events/click */ 19);
var _click2 = _interopRequireDefault(_click);
var _double_click = __webpack_require__( /*! ../../events/double_click */ 128);
var _double_click2 = _interopRequireDefault(_double_click);
var _browser = __webpack_require__( /*! ../../core/utils/browser */ 25);
var _browser2 = _interopRequireDefault(_browser);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
var _style = __webpack_require__( /*! ../../core/utils/style */ 85);
var _style2 = _interopRequireDefault(_style);
var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _type2 = _interopRequireDefault(_type);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var _iterator2 = _interopRequireDefault(_iterator);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
var _position = __webpack_require__( /*! ../../core/utils/position */ 97);
var _uiGrid_core = __webpack_require__( /*! ./ui.grid_core.modules */ 37);
var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core);
var _uiGrid_core3 = __webpack_require__( /*! ./ui.grid_core.utils */ 35);
var _uiGrid_core4 = __webpack_require__( /*! ./ui.grid_core.column_state_mixin */ 335);
var _uiGrid_core5 = _interopRequireDefault(_uiGrid_core4);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var SCROLL_CONTAINER_CLASS = "scroll-container";
var GROUP_SPACE_CLASS = "group-space";
var CONTENT_CLASS = "content";
var TABLE_CLASS = "table";
var TABLE_FIXED_CLASS = "table-fixed";
var CONTENT_FIXED_CLASS = "content-fixed";
var ROW_CLASS = "dx-row";
var FIXED_COL_CLASS = "dx-col-fixed";
var GROUP_ROW_CLASS = "dx-group-row";
var DETAIL_ROW_CLASS = "dx-master-detail-row";
var FILTER_ROW_CLASS = "filter-row";
var CELL_UPDATED_ANIMATION_CLASS = "cell-updated-animation";
var HIDDEN_COLUMNS_WIDTH = "0.0001px";
var CELL_HINT_VISIBLE = "dxCellHintVisible";
var FORM_FIELD_ITEM_CONTENT_CLASS = "dx-field-item-content";
var appendElementTemplate = {
render: function(options) {
options.container.append(options.content)
}
};
var subscribeToRowEvents = function(that, $table) {
var touchTarget;
var touchCurrentTarget;
var timeoutId;
function clearTouchTargets(timeout) {
return setTimeout(function() {
touchTarget = touchCurrentTarget = null
}, timeout)
}
_events_engine2.default.on($table, "touchstart touchend", ".dx-row", function(e) {
clearTimeout(timeoutId);
if ("touchstart" === e.type) {
touchTarget = e.target;
touchCurrentTarget = e.currentTarget;
timeoutId = clearTouchTargets(1e3)
} else {
timeoutId = clearTouchTargets()
}
});
_events_engine2.default.on($table, [_click2.default.name, _double_click2.default.name, _pointer2.default.down].join(" "), ".dx-row", {
useNative: that._isNativeClick()
}, that.createAction(function(e) {
var event = e.event;
if (touchTarget) {
event.target = touchTarget;
event.currentTarget = touchCurrentTarget
}
if (!(0, _renderer2.default)(event.target).closest("a").length) {
e.rowIndex = that.getRowIndex(event.currentTarget);
if (e.rowIndex >= 0) {
e.rowElement = (0, _dom.getPublicElement)((0, _renderer2.default)(event.currentTarget));
e.columns = that.getColumns();
if (event.type === _pointer2.default.down) {
that._rowPointerDown(e)
} else {
if (event.type === _click2.default.name) {
that._rowClick(e)
} else {
that._rowDblClick(e)
}
}
}
}
}))
};
var getWidthStyle = function(width) {
if ("auto" === width) {
return ""
}
return _type2.default.isNumeric(width) ? width + "px" : width
};
var setCellWidth = function(cell, column, width) {
cell.style.width = cell.style.maxWidth = "auto" === column.width ? "" : width
};
var copyAttributes = function(element, newElement) {
if (!element || !newElement) {
return
}
var oldAttributes = element.attributes;
var newAttributes = newElement.attributes;
var i;
for (i = 0; i < oldAttributes.length; i++) {
var name = oldAttributes[i].nodeName;
if (!newElement.hasAttribute(name)) {
element.removeAttribute(name)
}
}
for (i = 0; i < newAttributes.length; i++) {
element.setAttribute(newAttributes[i].nodeName, newAttributes[i].nodeValue)
}
};
exports.ColumnsView = _uiGrid_core2.default.View.inherit(_uiGrid_core5.default).inherit({
_createScrollableOptions: function() {
var that = this;
var scrollingOptions = that.option("scrolling");
var useNativeScrolling = that.option("scrolling.useNative");
var options = (0, _extend.extend)({
pushBackValue: 0
}, scrollingOptions, {
direction: "both",
bounceEnabled: false,
useKeyboard: false
});
if (void 0 === useNativeScrolling) {
useNativeScrolling = true
}
if ("auto" === useNativeScrolling) {
delete options.useNative;
delete options.useSimulatedScrollbar
} else {
options.useNative = !!useNativeScrolling;
options.useSimulatedScrollbar = !useNativeScrolling
}
return options
},
_updateCell: function($cell, parameters) {
if (parameters.rowType) {
this._cellPrepared($cell, parameters)
}
},
_createCell: function(options) {
var column = options.column;
var alignment = column.alignment || (0, _position.getDefaultAlignment)(this.option("rtlEnabled"));
var cell = _dom_adapter2.default.createElement("td");
cell.style.textAlign = alignment;
var $cell = (0, _renderer2.default)(cell);
if ("data" === options.rowType && column.headerId && !column.type) {
if (this.component.option("showColumnHeaders")) {
this.setAria("describedby", column.headerId, $cell)
}
}
if (column.cssClass) {
$cell.addClass(column.cssClass)
}
if ("expand" === column.command) {
$cell.addClass(column.cssClass);
$cell.addClass(this.addWidgetPrefix(GROUP_SPACE_CLASS))
}
if (column.colspan > 1) {
$cell.attr("colSpan", column.colspan)
} else {
if (!column.isBand && "auto" !== column.visibleWidth && !this.option("legacyRendering") && this.option("columnAutoWidth")) {
if (column.width || column.minWidth) {
cell.style.minWidth = getWidthStyle(column.minWidth || column.width)
}
if (column.width) {
setCellWidth(cell, column, getWidthStyle(column.width))
}
}
}
if (_browser2.default.mozilla && options.column.fixed) {
$cell.addClass(FIXED_COL_CLASS)
}
return $cell
},
_createRow: function(rowObject) {
var $element = (0, _renderer2.default)("
").addClass(ROW_CLASS);
this.setAria("role", "row", $element);
return $element
},
_createTable: function(columns, isAppend) {
var that = this;
var $table = (0, _renderer2.default)("").addClass(that.addWidgetPrefix(TABLE_CLASS)).addClass(that.addWidgetPrefix(TABLE_FIXED_CLASS));
if (columns && !isAppend) {
$table.append(that._createColGroup(columns));
if (_browser2.default.safari) {
$table.append((0, _renderer2.default)("").append(""))
}
that.setAria("role", "presentation", $table)
} else {
that.setAria("hidden", true, $table)
}
this.setAria("role", "presentation", (0, _renderer2.default)("
").appendTo($table));
if (isAppend) {
return $table
}
if (_browser2.default.mozilla) {
_events_engine2.default.on($table, "mousedown", "td", function(e) {
if (e.ctrlKey) {
e.preventDefault()
}
})
}
if (that.option("cellHintEnabled")) {
_events_engine2.default.on($table, "mousemove", ".dx-row > td", this.createAction(function(args) {
var e = args.event;
var $element = (0, _renderer2.default)(e.target);
var $cell = (0, _renderer2.default)(e.currentTarget);
var $row = $cell.parent();
var isDataRow = $row.hasClass("dx-data-row");
var isHeaderRow = $row.hasClass("dx-header-row");
var isGroupRow = $row.hasClass(GROUP_ROW_CLASS);
var isMasterDetailRow = $row.hasClass(DETAIL_ROW_CLASS);
var isFilterRow = $row.hasClass(that.addWidgetPrefix(FILTER_ROW_CLASS));
var visibleColumns = that._columnsController.getVisibleColumns();
var rowOptions = $row.data("options");
var columnIndex = $cell.index();
var cellOptions = rowOptions && rowOptions.cells && rowOptions.cells[columnIndex];
var column = cellOptions ? cellOptions.column : visibleColumns[columnIndex];
var msieCorrection = _browser2.default.msie ? 1 : 0;
if (!isMasterDetailRow && !isFilterRow && (!isDataRow || isDataRow && column && !column.cellTemplate) && (!isHeaderRow || isHeaderRow && column && !column.headerCellTemplate) && (!isGroupRow || isGroupRow && column && (void 0 === column.groupIndex || !column.groupCellTemplate))) {
if ($element.data(CELL_HINT_VISIBLE)) {
$element.removeAttr("title");
$element.data(CELL_HINT_VISIBLE, false)
}
var difference = $element[0].scrollWidth - $element[0].clientWidth - msieCorrection;
if (difference > 0 && !_type2.default.isDefined($element.attr("title"))) {
$element.attr("title", $element.text());
$element.data(CELL_HINT_VISIBLE, true)
}
}
}))
}
var getOptions = function(event) {
var $cell = (0, _renderer2.default)(event.currentTarget);
var $fieldItemContent = (0, _renderer2.default)(event.target).closest("." + FORM_FIELD_ITEM_CONTENT_CLASS);
var rowOptions = $cell.parent().data("options");
var options = rowOptions && rowOptions.cells && rowOptions.cells[$cell.index()];
if (!$cell.closest("table").is(event.delegateTarget)) {
return
}
var resultOptions = (0, _extend.extend)({}, options, {
cellElement: (0, _dom.getPublicElement)($cell),
event: event,
eventType: event.type
});
if ($fieldItemContent.length) {
var formItemOptions = $fieldItemContent.data("dx-form-item");
if (formItemOptions.column) {
resultOptions.column = formItemOptions.column;
resultOptions.columnIndex = that._columnsController.getVisibleIndex(resultOptions.column.index)
}
}
return resultOptions
};
_events_engine2.default.on($table, "mouseover", ".dx-row > td", function(e) {
var options = getOptions(e);
options && that.executeAction("onCellHoverChanged", options)
});
_events_engine2.default.on($table, "mouseout", ".dx-row > td", function(e) {
var options = getOptions(e);
options && that.executeAction("onCellHoverChanged", options)
});
_events_engine2.default.on($table, _click2.default.name, ".dx-row > td", function(e) {
var options = getOptions(e);
options && that.executeAction("onCellClick", options)
});
_events_engine2.default.on($table, _double_click2.default.name, ".dx-row > td", function(e) {
var options = getOptions(e);
options && that.executeAction("onCellDblClick", options)
});
subscribeToRowEvents(that, $table);
return $table
},
_isNativeClick: _common.noop,
_rowPointerDown: _common.noop,
_rowClick: _common.noop,
_rowDblClick: _common.noop,
_createColGroup: function(columns) {
var colgroupElement = (0, _renderer2.default)("");
for (var i = 0; i < columns.length; i++) {
var colspan = columns[i].colspan || 1;
for (var j = 0; j < colspan; j++) {
colgroupElement.append(this._createCol(columns[i]))
}
}
return colgroupElement
},
_createCol: function(column) {
var width = column.visibleWidth || column.width;
if ("adaptiveHidden" === width) {
width = HIDDEN_COLUMNS_WIDTH
}
var col = (0, _renderer2.default)("");
_style2.default.setWidth(col, width);
return col
},
renderDelayedTemplates: function() {
var delayedTemplates = this._delayedTemplates;
var syncTemplates = delayedTemplates.filter(function(template) {
return !template.async
});
var asyncTemplates = delayedTemplates.filter(function(template) {
return template.async
});
this._delayedTemplates = [];
this._renderDelayedTemplatesCore(syncTemplates);
this._renderDelayedTemplatesCoreAsync(asyncTemplates)
},
_renderDelayedTemplatesCoreAsync: function(templates) {
var that = this;
if (templates.length) {
(0, _window.getWindow)().setTimeout(function() {
that._renderDelayedTemplatesCore(templates, true)
})
}
},
_renderDelayedTemplatesCore: function(templates, isAsync) {
var date = new Date;
while (templates.length) {
var templateParameters = templates.shift();
var options = templateParameters.options;
var model = options.model;
var doc = _dom_adapter2.default.getDocument();
if (!isAsync || (0, _renderer2.default)(options.container).closest(doc).length) {
templateParameters.template.render(options);
if (model && model.column) {
this._updateCell(options.container, model)
}
}
if (isAsync && new Date - date > 30) {
this._renderDelayedTemplatesCoreAsync(templates);
break
}
}
},
_processTemplate: function(template) {
var that = this;
var renderingTemplate;
if (template && template.render && !_type2.default.isRenderer(template)) {
renderingTemplate = {
allowRenderToDetachedContainer: template.allowRenderToDetachedContainer,
render: function(options) {
template.render(options.container, options.model)
}
}
} else {
if (_type2.default.isFunction(template)) {
renderingTemplate = {
render: function(options) {
var renderedTemplate = template((0, _dom.getPublicElement)(options.container), options.model);
if (renderedTemplate && (renderedTemplate.nodeType || _type2.default.isRenderer(renderedTemplate))) {
options.container.append(renderedTemplate)
}
}
}
} else {
var templateID = _type2.default.isString(template) ? template : (0, _renderer2.default)(template).attr("id");
if (!templateID) {
renderingTemplate = that.getTemplate(template)
} else {
if (!that._templatesCache[templateID]) {
that._templatesCache[templateID] = that.getTemplate(template)
}
renderingTemplate = that._templatesCache[templateID]
}
}
}
return renderingTemplate
},
renderTemplate: function(container, template, options, allowRenderToDetachedContainer) {
var that = this;
var renderingTemplate = that._processTemplate(template, options);
var column = options.column;
var isDataRow = "data" === options.rowType;
if (renderingTemplate) {
options.component = that.component;
var async = column && (column.renderAsync && isDataRow || that.option("renderAsync") && (false !== column.renderAsync && (column.command || column.showEditorAlways) && isDataRow || "filter" === options.rowType));
if ((renderingTemplate.allowRenderToDetachedContainer || allowRenderToDetachedContainer) && !async) {
renderingTemplate.render({
container: container,
model: options
});
return true
} else {
that._delayedTemplates.push({
template: renderingTemplate,
options: {
container: container,
model: options
},
async: async
})
}
}
return false
},
_getBodies: function(tableElement) {
return (0, _renderer2.default)(tableElement).children("tbody").not(".dx-header").not(".dx-footer")
},
_wrapRowIfNeed: function($table, $row) {
var $tBodies = this.option("rowTemplate") && this._getBodies(this._tableElement || $table);
if ($tBodies && $tBodies.filter("." + ROW_CLASS).length) {
var $tbody = (0, _renderer2.default)("").addClass($row.attr("class"));
this.setAria("role", "presentation", $tbody);
return $tbody.append($row)
}
return $row
},
_appendRow: function($table, $row, appendTemplate) {
appendTemplate = appendTemplate || appendElementTemplate;
appendTemplate.render({
content: $row,
container: $table
})
},
_resizeCore: function() {
var scrollLeft = this._scrollLeft;
if (scrollLeft >= 0) {
this._scrollLeft = 0;
this.scrollTo({
left: scrollLeft
})
}
},
_renderCore: function(e) {
var $root = this.element().parent();
if (!$root || $root.parent().length) {
this.renderDelayedTemplates(e)
}
},
_renderTable: function(options) {
options = options || {};
options.columns = this._columnsController.getVisibleColumns();
var changeType = options.change && options.change.changeType;
var $table = this._createTable(options.columns, "append" === changeType || "prepend" === changeType || "update" === changeType);
this._renderRows($table, options);
return $table
},
_renderRows: function($table, options) {
var that = this;
var rows = that._getRows(options.change);
var columnIndices = options.change && options.change.columnIndices || [];
var changeTypes = options.change && options.change.changeTypes || [];
for (var i = 0; i < rows.length; i++) {
that._renderRow($table, (0, _extend.extend)({
row: rows[i],
columnIndices: columnIndices[i],
changeType: changeTypes[i]
}, options))
}
},
_renderRow: function($table, options) {
if (!options.columnIndices) {
options.row.cells = []
}
var $row = this._createRow(options.row);
var $wrappedRow = this._wrapRowIfNeed($table, $row);
if ("remove" !== options.changeType) {
this._renderCells($row, options)
}
this._appendRow($table, $wrappedRow);
var rowOptions = (0, _extend.extend)({
columns: options.columns
}, options.row);
this._addWatchMethod(rowOptions, options.row);
this._rowPrepared($wrappedRow, rowOptions, options.row)
},
_renderCells: function($row, options) {
var that = this;
var columnIndex = 0;
var row = options.row;
var columns = options.columns;
for (var i = 0; i < columns.length; i++) {
if (!options.columnIndices || options.columnIndices.indexOf(i) >= 0) {
that._renderCell($row, (0, _extend.extend)({
column: columns[i],
columnIndex: columnIndex,
value: row.values && row.values[columnIndex],
oldValue: row.oldValues && row.oldValues[columnIndex]
}, options))
}
if (columns[i].colspan > 1) {
columnIndex += columns[i].colspan
} else {
columnIndex++
}
}
},
_updateCells: function($rowElement, $newRowElement, columnIndices) {
var $cells = $rowElement.children();
var $newCells = $newRowElement.children();
var highlightChanges = this.option("highlightChanges");
var cellUpdatedClass = this.addWidgetPrefix(CELL_UPDATED_ANIMATION_CLASS);
columnIndices.forEach(function(columnIndex, index) {
var $cell = $cells.eq(columnIndex);
var $newCell = $newCells.eq(index);
$cell.replaceWith($newCell);
if (highlightChanges && !$newCell.hasClass("dx-command-expand")) {
$newCell.addClass(cellUpdatedClass)
}
});
copyAttributes($rowElement.get(0), $newRowElement.get(0))
},
_setCellAriaAttributes: function($cell, cellOptions) {
if ("freeSpace" !== cellOptions.rowType) {
this.setAria("selected", false, $cell);
this.setAria("role", "gridcell", $cell);
this.setAria("colindex", cellOptions.columnIndex + 1, $cell)
}
},
_renderCell: function($row, options) {
var that = this;
var cellOptions = that._getCellOptions(options);
if (options.columnIndices) {
if (options.row.cells) {
options.row.cells[cellOptions.columnIndex] = cellOptions
}
} else {
options.row.cells.push(cellOptions)
}
var $cell = that._createCell(cellOptions);
that._setCellAriaAttributes($cell, cellOptions);
that._renderCellContent($cell, cellOptions);
$row.get(0).appendChild($cell.get(0));
return $cell
},
_renderCellContent: function($cell, options) {
var template = this._getCellTemplate(options);
if (!template || this.renderTemplate($cell, template, options)) {
this._updateCell($cell, options)
}
},
_getCellTemplate: function() {},
_getRows: function() {
return []
},
_getCellOptions: function(options) {
var cellOptions = {
column: options.column,
columnIndex: options.columnIndex,
rowType: options.row.rowType
};
this._addWatchMethod(cellOptions);
return cellOptions
},
_addWatchMethod: function(options, source) {
if (!this.option("repaintChangesOnly")) {
return
}
var watchers = [];
source = source || options;
source.watch = source.watch || function(getter, updateFunc) {
var oldValue = getter(source.data);
var watcher = function() {
var newValue = getter(source.data);
if (JSON.stringify(oldValue) !== JSON.stringify(newValue)) {
updateFunc(newValue, oldValue);
oldValue = newValue
}
};
watchers.push(watcher);
var stopWatch = function() {
var index = watchers.indexOf(watcher);
if (index >= 0) {
watchers.splice(index, 1)
}
};
return stopWatch
};
source.update = source.update || function(row) {
this.data = options.data = row.data;
this.rowIndex = options.rowIndex = row.rowIndex;
this.dataIndex = options.dataIndex = row.dataIndex;
this.isExpanded = options.isExpanded = row.isExpanded;
if (options.row) {
options.row = row
}
watchers.forEach(function(watcher) {
watcher()
})
};
if (source !== options) {
options.watch = source.watch.bind(source)
}
return options
},
_cellPrepared: function(cell, options) {
options.cellElement = (0, _dom.getPublicElement)((0, _renderer2.default)(cell));
this.executeAction("onCellPrepared", options)
},
_rowPrepared: function($row, options) {
_element_data2.default.data($row.get(0), "options", options);
options.rowElement = (0, _dom.getPublicElement)($row);
this.executeAction("onRowPrepared", options)
},
_columnOptionChanged: function(e) {
var optionNames = e.optionNames;
if ((0, _uiGrid_core3.checkChanges)(optionNames, ["width", "visibleWidth"])) {
var visibleColumns = this._columnsController.getVisibleColumns();
var widths = _iterator2.default.map(visibleColumns, function(column) {
var width = column.visibleWidth || column.width;
return _type2.default.isDefined(width) ? width : "auto"
});
this.setColumnWidths({
widths: widths,
optionNames: optionNames
});
return
}
if (!this._requireReady) {
this.render()
}
},
getCellIndex: function($cell) {
var cellIndex = $cell.length ? $cell[0].cellIndex : -1;
return cellIndex
},
getTableElements: function() {
return this._tableElement || (0, _renderer2.default)()
},
_getTableElement: function() {
return this._tableElement
},
_setTableElement: function(tableElement) {
this._tableElement = tableElement
},
optionChanged: function(args) {
this.callBase(args);
switch (args.name) {
case "cellHintEnabled":
case "onCellPrepared":
case "onRowPrepared":
case "onCellHoverChanged":
this._invalidate(true, true);
args.handled = true
}
},
init: function() {
var that = this;
that._scrollLeft = -1;
that._columnsController = that.getController("columns");
that._dataController = that.getController("data");
that._delayedTemplates = [];
that._templatesCache = {};
that.createAction("onCellClick");
that.createAction("onRowClick");
that.createAction("onCellDblClick");
that.createAction("onRowDblClick");
that.createAction("onCellHoverChanged", {
excludeValidators: ["disabled", "readOnly"]
});
that.createAction("onCellPrepared", {
excludeValidators: ["disabled", "readOnly"],
category: "rendering"
});
that.createAction("onRowPrepared", {
excludeValidators: ["disabled", "readOnly"],
category: "rendering",
afterExecute: function(e) {
that._afterRowPrepared(e)
}
});
that._columnsController.columnsChanged.add(that._columnOptionChanged.bind(that));
that._dataController && that._dataController.changed.add(that._handleDataChanged.bind(that))
},
_afterRowPrepared: _common.noop,
_handleDataChanged: function() {},
callbackNames: function() {
return ["scrollChanged"]
},
_updateScrollLeftPosition: function() {
var scrollLeft = this._scrollLeft;
if (scrollLeft >= 0) {
this._scrollLeft = 0;
this.scrollTo({
left: scrollLeft
})
}
},
scrollTo: function(pos) {
var $element = this.element();
var $scrollContainer = $element && $element.children("." + this.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).not("." + this.addWidgetPrefix(CONTENT_FIXED_CLASS));
if (_type2.default.isDefined(pos) && _type2.default.isDefined(pos.left) && this._scrollLeft !== pos.left) {
this._scrollLeft = pos.left;
$scrollContainer && $scrollContainer.scrollLeft(pos.left)
}
},
_wrapTableInScrollContainer: function($table) {
var _this = this;
var $scrollContainer = (0, _renderer2.default)("");
_events_engine2.default.on($scrollContainer, "scroll", function() {
var scrollLeft = $scrollContainer.scrollLeft();
if (scrollLeft !== _this._scrollLeft) {
_this.scrollChanged.fire({
left: scrollLeft
}, _this.name)
}
});
$scrollContainer.addClass(this.addWidgetPrefix(CONTENT_CLASS)).addClass(this.addWidgetPrefix(SCROLL_CONTAINER_CLASS)).append($table).appendTo(this.element());
this.setAria("role", "presentation", $scrollContainer);
return $scrollContainer
},
_updateContent: function($newTableElement) {
this._setTableElement($newTableElement);
this._wrapTableInScrollContainer($newTableElement)
},
_findContentElement: _common.noop,
_getWidths: function($cellElements) {
var result = [];
var legacyRendering = this.option("legacyRendering");
var width;
if ($cellElements) {
_iterator2.default.each($cellElements, function(index, item) {
width = item.offsetWidth;
if (item.getBoundingClientRect) {
var clientRect = item.getBoundingClientRect();
if (clientRect.width > width - 1) {
width = legacyRendering ? Math.ceil(clientRect.width) : clientRect.width
}
}
result.push(width)
})
}
return result
},
getColumnWidths: function($tableElement) {
var that = this;
var result = [];
var $rows;
var $cells;
(this.option("forceApplyBindings") || _common.noop)();
$tableElement = $tableElement || that._getTableElement();
if ($tableElement) {
$rows = $tableElement.children("tbody").children();
for (var i = 0; i < $rows.length; i++) {
var $row = $rows.eq(i);
var isRowVisible = "none" !== $row.get(0).style.display && !$row.hasClass("dx-state-invisible");
if (!$row.is("." + GROUP_ROW_CLASS) && !$row.is("." + DETAIL_ROW_CLASS) && isRowVisible) {
$cells = $row.children("td");
break
}
}
result = that._getWidths($cells)
}
return result
},
getVisibleColumnIndex: function(columnIndex, rowIndex) {
return columnIndex
},
setColumnWidths: function(_ref) {
var widths = _ref.widths,
$tableElement = _ref.$tableElement,
columns = _ref.columns,
fixed = _ref.fixed;
var $cols;
var width;
var minWidth;
var columnIndex;
var columnAutoWidth = this.option("columnAutoWidth");
var legacyRendering = this.option("legacyRendering");
$tableElement = $tableElement || this._getTableElement();
if ($tableElement && $tableElement.length && widths) {
columnIndex = 0;
$cols = $tableElement.children("colgroup").children("col");
_style2.default.setWidth($cols, "auto");
columns = columns || this.getColumns(null, $tableElement);
for (var i = 0; i < columns.length; i++) {
if (!legacyRendering && columnAutoWidth && !fixed) {
width = columns[i].width;
if (width && !columns[i].command) {
width = columns[i].visibleWidth || width;
width = getWidthStyle(width);
minWidth = getWidthStyle(columns[i].minWidth || width);
var $rows = $rows || $tableElement.children().children(".dx-row").not("." + GROUP_ROW_CLASS).not("." + DETAIL_ROW_CLASS);
for (var rowIndex = 0; rowIndex < $rows.length; rowIndex++) {
var visibleIndex = this.getVisibleColumnIndex(i, rowIndex);
var cell = $rows[rowIndex].cells[visibleIndex];
if (cell) {
setCellWidth(cell, columns[i], width);
cell.style.minWidth = minWidth
}
}
}
}
if (columns[i].colspan) {
columnIndex += columns[i].colspan;
continue
}
width = widths[columnIndex];
if ("adaptiveHidden" === width) {
width = HIDDEN_COLUMNS_WIDTH
}
if ("number" === typeof width) {
width = width.toFixed(3) + "px"
}
_style2.default.setWidth($cols.eq(columnIndex), _type2.default.isDefined(width) ? width : "auto");
columnIndex++
}
}
},
getCellElements: function(rowIndex) {
return this._getCellElementsCore(rowIndex)
},
_getCellElementsCore: function(rowIndex) {
var $row = this._getRowElements().eq(rowIndex);
return $row.children()
},
_getCellElement: function(rowIndex, columnIdentifier) {
var that = this;
var $cell;
var $cells = that.getCellElements(rowIndex);
var columnVisibleIndex = that._getVisibleColumnIndex($cells, rowIndex, columnIdentifier);
if ($cells.length && columnVisibleIndex >= 0) {
$cell = $cells.eq(columnVisibleIndex)
}
if ($cell && $cell.length) {
return $cell
}
},
_getRowElement: function(rowIndex) {
var that = this;
var $rowElement = (0, _renderer2.default)();
var $tableElements = that.getTableElements();
_iterator2.default.each($tableElements, function(_, tableElement) {
$rowElement = $rowElement.add(that._getRowElements((0, _renderer2.default)(tableElement)).eq(rowIndex))
});
if ($rowElement.length) {
return $rowElement
}
},
getCellElement: function(rowIndex, columnIdentifier) {
return (0, _dom.getPublicElement)(this._getCellElement(rowIndex, columnIdentifier))
},
getRowElement: function(rowIndex) {
var $rows = this._getRowElement(rowIndex);
var elements = [];
if ($rows && !(0, _dom.getPublicElement)($rows).get) {
for (var i = 0; i < $rows.length; i++) {
elements.push($rows[i])
}
} else {
elements = $rows
}
return elements
},
_getVisibleColumnIndex: function($cells, rowIndex, columnIdentifier) {
if (_type2.default.isString(columnIdentifier)) {
var columnIndex = this._columnsController.columnOption(columnIdentifier, "index");
return this._columnsController.getVisibleIndex(columnIndex)
}
return columnIdentifier
},
getColumnElements: function() {},
getColumns: function(rowIndex) {
return this._columnsController.getVisibleColumns(rowIndex)
},
getCell: function(cellPosition, rows) {
var $rows = rows || this._getRowElements();
var $cells;
if ($rows.length > 0 && cellPosition.rowIndex >= 0) {
if ("virtual" !== this.option("scrolling.mode")) {
cellPosition.rowIndex = cellPosition.rowIndex < $rows.length ? cellPosition.rowIndex : $rows.length - 1
}
$cells = this.getCellElements(cellPosition.rowIndex);
if ($cells && $cells.length > 0) {
return $cells.eq($cells.length > cellPosition.columnIndex ? cellPosition.columnIndex : $cells.length - 1)
}
}
},
getRowsCount: function() {
var tableElement = this._getTableElement();
if (tableElement && 1 === tableElement.length) {
return tableElement[0].rows.length
}
return 0
},
_getRowElements: function(tableElement) {
tableElement = tableElement || this._getTableElement();
if (tableElement) {
var tBodies = this.option("rowTemplate") && tableElement.find("> tbody." + ROW_CLASS);
return tBodies && tBodies.length ? tBodies : tableElement.find("> tbody > ." + ROW_CLASS + ", > ." + ROW_CLASS)
}
return (0, _renderer2.default)()
},
getRowIndex: function($row) {
return this._getRowElements().index($row)
},
getBoundingRect: function() {},
getName: function() {},
setScrollerSpacing: function(width) {
var that = this;
var $element = that.element();
var rtlEnabled = that.option("rtlEnabled");
$element && $element.css(rtlEnabled ? {
paddingLeft: width
} : {
paddingRight: width
})
},
isScrollbarVisible: function(isHorizontal) {
var $element = this.element();
var $tableElement = this._tableElement;
if ($element && $tableElement) {
return isHorizontal ? $tableElement.outerWidth() - $element.width() > 0 : $tableElement.outerHeight() - $element.height() > 0
}
return false
}
})
}, , , ,
/*!*****************************************************************!*\
!*** ./artifacts/transpiled/ui/widget/ui.keyboard_processor.js ***!
\*****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _class = __webpack_require__( /*! ../../core/class */ 15);
var _class2 = _interopRequireDefault(_class);
var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var _utils = __webpack_require__( /*! ../../events/utils */ 8);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var COMPOSITION_START_EVENT = "compositionstart";
var COMPOSITION_END_EVENT = "compositionend";
var KEYDOWN_EVENT = "keydown";
var NAMESPACE = "KeyboardProcessor";
var KeyboardProcessor = _class2.default.inherit({
_keydown: (0, _utils.addNamespace)(KEYDOWN_EVENT, NAMESPACE),
_compositionStart: (0, _utils.addNamespace)(COMPOSITION_START_EVENT, NAMESPACE),
_compositionEnd: (0, _utils.addNamespace)(COMPOSITION_END_EVENT, NAMESPACE),
ctor: function(options) {
var _this = this;
options = options || {};
if (options.element) {
this._element = (0, _renderer2.default)(options.element)
}
if (options.focusTarget) {
this._focusTarget = options.focusTarget
}
this._handler = options.handler;
this._context = options.context;
this._childProcessors = [];
if (this._element) {
this._processFunction = function(e) {
var isNotFocusTarget = _this._focusTarget && _this._focusTarget !== e.target && (0, _array.inArray)(e.target, _this._focusTarget) < 0;
var shouldSkipProcessing = _this._isComposingJustFinished && 229 === e.which || _this._isComposing || isNotFocusTarget;
_this._isComposingJustFinished = false;
if (!shouldSkipProcessing) {
_this.process(e)
}
};
this._toggleProcessingWithContext = this.toggleProcessing.bind(this);
_events_engine2.default.on(this._element, this._keydown, this._processFunction);
_events_engine2.default.on(this._element, this._compositionStart, this._toggleProcessingWithContext);
_events_engine2.default.on(this._element, this._compositionEnd, this._toggleProcessingWithContext)
}
},
dispose: function() {
if (this._element) {
_events_engine2.default.off(this._element, this._keydown, this._processFunction);
_events_engine2.default.off(this._element, this._compositionStart, this._toggleProcessingWithContext);
_events_engine2.default.off(this._element, this._compositionEnd, this._toggleProcessingWithContext)
}
this._element = void 0;
this._handler = void 0;
this._context = void 0;
this._childProcessors = void 0
},
clearChildren: function() {
this._childProcessors = []
},
push: function(child) {
if (!this._childProcessors) {
this.clearChildren()
}
this._childProcessors.push(child);
return child
},
attachChildProcessor: function() {
var childProcessor = new KeyboardProcessor;
this._childProcessors.push(childProcessor);
return childProcessor
},
reinitialize: function(childHandler, childContext) {
this._context = childContext;
this._handler = childHandler;
return this
},
process: function(e) {
var args = {
keyName: (0, _utils.normalizeKeyName)(e),
key: e.key,
code: e.code,
ctrl: e.ctrlKey,
location: e.location,
metaKey: e.metaKey,
shift: e.shiftKey,
alt: e.altKey,
which: e.which,
originalEvent: e
};
var handlerResult = this._handler && this._handler.call(this._context, args);
if (handlerResult && this._childProcessors) {
(0, _iterator.each)(this._childProcessors, function(index, childProcessor) {
childProcessor.process(e)
})
}
},
toggleProcessing: function(_ref) {
var type = _ref.type;
this._isComposing = type === COMPOSITION_START_EVENT;
this._isComposingJustFinished = !this._isComposing
}
});
module.exports = KeyboardProcessor
},
/*!****************************************************!*\
!*** ./artifacts/transpiled/events/contextmenu.js ***!
\****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var support = __webpack_require__( /*! ../core/utils/support */ 43);
var devices = __webpack_require__( /*! ../core/devices */ 16);
var Class = __webpack_require__( /*! ../core/class */ 15);
var registerEvent = __webpack_require__( /*! ./core/event_registrator */ 71);
var eventUtils = __webpack_require__( /*! ./utils */ 8);
var holdEvent = __webpack_require__( /*! ./hold */ 88);
var CONTEXTMENU_NAMESPACE = "dxContexMenu";
var CONTEXTMENU_NAMESPACED_EVENT_NAME = eventUtils.addNamespace("contextmenu", CONTEXTMENU_NAMESPACE);
var HOLD_NAMESPACED_EVENT_NAME = eventUtils.addNamespace(holdEvent.name, CONTEXTMENU_NAMESPACE);
var CONTEXTMENU_EVENT_NAME = "dxcontextmenu";
var ContextMenu = Class.inherit({
setup: function(element) {
var $element = $(element);
eventsEngine.on($element, CONTEXTMENU_NAMESPACED_EVENT_NAME, this._contextMenuHandler.bind(this));
if (support.touch || devices.isSimulator()) {
eventsEngine.on($element, HOLD_NAMESPACED_EVENT_NAME, this._holdHandler.bind(this))
}
},
_holdHandler: function(e) {
if (eventUtils.isMouseEvent(e) && !devices.isSimulator()) {
return
}
this._fireContextMenu(e)
},
_contextMenuHandler: function(e) {
this._fireContextMenu(e)
},
_fireContextMenu: function(e) {
return eventUtils.fireEvent({
type: CONTEXTMENU_EVENT_NAME,
originalEvent: e
})
},
teardown: function(element) {
eventsEngine.off(element, "." + CONTEXTMENU_NAMESPACE)
}
});
registerEvent(CONTEXTMENU_EVENT_NAME, new ContextMenu);
exports.name = CONTEXTMENU_EVENT_NAME
},
/*!*************************************************************************!*\
!*** ./artifacts/transpiled/ui/drop_down_editor/ui.drop_down_editor.js ***!
\*************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _async_template_mixin = __webpack_require__( /*! ../shared/async_template_mixin */ 286);
var _async_template_mixin2 = _interopRequireDefault(_async_template_mixin);
var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _guid = __webpack_require__( /*! ../../core/guid */ 40);
var _guid2 = _interopRequireDefault(_guid);
var _component_registrator = __webpack_require__( /*! ../../core/component_registrator */ 9);
var _component_registrator2 = _interopRequireDefault(_component_registrator);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
var _selectors = __webpack_require__( /*! ../widget/selectors */ 66);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
var _dom = __webpack_require__( /*! ../../core/utils/dom */ 12);
var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17);
var _ui2 = _interopRequireDefault(_ui);
var _position = __webpack_require__( /*! ../../animation/position */ 77);
var _position2 = __webpack_require__( /*! ../../core/utils/position */ 97);
var _ui3 = __webpack_require__( /*! ./ui.drop_down_button */ 498);
var _ui4 = _interopRequireDefault(_ui3);
var _message = __webpack_require__( /*! ../../localization/message */ 13);
var _utils = __webpack_require__( /*! ../../events/utils */ 8);
var _text_box = __webpack_require__( /*! ../text_box */ 89);
var _text_box2 = _interopRequireDefault(_text_box);
var _click = __webpack_require__( /*! ../../events/click */ 19);
var _click2 = _interopRequireDefault(_click);
var _devices = __webpack_require__( /*! ../../core/devices */ 16);
var _devices2 = _interopRequireDefault(_devices);
var _function_template = __webpack_require__( /*! ../widget/function_template */ 83);
var _function_template2 = _interopRequireDefault(_function_template);
var _popup = __webpack_require__( /*! ../popup */ 46);
var _popup2 = _interopRequireDefault(_popup);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var DROP_DOWN_EDITOR_CLASS = "dx-dropdowneditor";
var DROP_DOWN_EDITOR_INPUT_WRAPPER = "dx-dropdowneditor-input-wrapper";
var DROP_DOWN_EDITOR_BUTTON_ICON = "dx-dropdowneditor-icon";
var DROP_DOWN_EDITOR_OVERLAY = "dx-dropdowneditor-overlay";
var DROP_DOWN_EDITOR_OVERLAY_FLIPPED = "dx-dropdowneditor-overlay-flipped";
var DROP_DOWN_EDITOR_ACTIVE = "dx-dropdowneditor-active";
var DROP_DOWN_EDITOR_FIELD_CLICKABLE = "dx-dropdowneditor-field-clickable";
var DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER = "dx-dropdowneditor-field-template-wrapper";
var isIOs = "ios" === _devices2.default.current().platform;
var DropDownEditor = _text_box2.default.inherit({
_supportedKeys: function() {
return (0, _extend.extend)({}, this.callBase(), {
tab: function(e) {
if (!this.option("opened")) {
return
}
if ("instantly" === this.option("applyValueMode")) {
this.close();
return
}
var $focusableElement = e.shiftKey ? this._getLastPopupElement() : this._getFirstPopupElement();
$focusableElement && _events_engine2.default.trigger($focusableElement, "focus");
e.preventDefault()
},
escape: function(e) {
if (this.option("opened")) {
e.preventDefault()
}
this.close();
return true
},
upArrow: function(e) {
e.preventDefault();
e.stopPropagation();
if (e.altKey) {
this.close();
return false
}
return true
},
downArrow: function(e) {
e.preventDefault();
e.stopPropagation();
if (e.altKey) {
this._validatedOpening();
return false
}
return true
},
enter: function(e) {
if (this.option("opened")) {
e.preventDefault();
this._valueChangeEventHandler(e)
}
return true
}
})
},
_getDefaultButtons: function() {
return this.callBase().concat([{
name: "dropDown",
Ctor: _ui4.default
}])
},
_getDefaultOptions: function() {
return (0, _extend.extend)(this.callBase(), {
value: null,
onOpened: null,
onClosed: null,
opened: false,
acceptCustomValue: true,
applyValueMode: "instantly",
deferRendering: true,
activeStateEnabled: true,
dropDownButtonTemplate: "dropDownButton",
fieldTemplate: null,
openOnFieldClick: false,
showDropDownButton: true,
buttons: void 0,
dropDownOptions: {},
popupPosition: this._getDefaultPopupPosition(),
onPopupInitialized: null,
applyButtonText: (0, _message.format)("OK"),
cancelButtonText: (0, _message.format)("Cancel"),
buttonsLocation: "default",
showPopupTitle: false,
useHiddenSubmitElement: false
})
},
_getDefaultPopupPosition: function(isRtlEnabled) {
var position = (0, _position2.getDefaultAlignment)(isRtlEnabled);
return {
offset: {
h: 0,
v: -1
},
my: position + " top",
at: position + " bottom",
collision: "flip flip"
}
},
_defaultOptionsRules: function() {
return this.callBase().concat([{
device: function(_device) {
var isGeneric = "generic" === _device.platform;
return isGeneric
},
options: {
popupPosition: {
offset: {
v: 0
}
}
}
}])
},
_inputWrapper: function() {
return this.$element().find("." + DROP_DOWN_EDITOR_INPUT_WRAPPER)
},
_init: function() {
this.callBase();
this._initVisibilityActions();
this._initPopupInitializedAction();
this._updatePopupPosition(this.option("rtlEnabled"));
this._initInnerOptionCache("dropDownOptions")
},
_updatePopupPosition: function(isRtlEnabled) {
var _this$_getDefaultPopu = this._getDefaultPopupPosition(isRtlEnabled),
my = _this$_getDefaultPopu.my,
at = _this$_getDefaultPopu.at;
var currentPosition = this.option("popupPosition");
this.option("popupPosition", (0, _extend.extend)({}, currentPosition, {
my: my,
at: at
}))
},
_initVisibilityActions: function() {
this._openAction = this._createActionByOption("onOpened", {
excludeValidators: ["disabled", "readOnly"]
});
this._closeAction = this._createActionByOption("onClosed", {
excludeValidators: ["disabled", "readOnly"]
})
},
_initPopupInitializedAction: function() {
this._popupInitializedAction = this._createActionByOption("onPopupInitialized", {
excludeValidators: ["disabled", "readOnly"]
})
},
_initMarkup: function() {
this._renderSubmitElement();
this.callBase();
this.$element().addClass(DROP_DOWN_EDITOR_CLASS);
this.setAria("role", "combobox")
},
_render: function() {
this.callBase();
this._renderOpenHandler();
this._attachFocusOutHandler();
this._renderOpenedState()
},
_renderContentImpl: function() {
if (!this.option("deferRendering")) {
this._createPopup()
}
},
_renderInput: function() {
this.callBase();
this.$element().wrapInner((0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_INPUT_WRAPPER));
this._$container = this.$element().children().eq(0);
this._setDefaultAria()
},
_setDefaultAria: function() {
this.setAria({
haspopup: "true",
autocomplete: "list"
})
},
_readOnlyPropValue: function() {
return !this.option("acceptCustomValue") || this.callBase()
},
_cleanFocusState: function() {
this.callBase();
if (this.option("fieldTemplate")) {
this._detachFocusEvents()
}
},
_getFieldTemplate: function() {
return this.option("fieldTemplate") && this._getTemplateByOption("fieldTemplate")
},
_renderMask: function() {
if (this.option("fieldTemplate")) {
return
}
this.callBase()
},
_renderField: function() {
var fieldTemplate = this._getFieldTemplate();
fieldTemplate && this._renderTemplatedField(fieldTemplate, this._fieldRenderData())
},
_renderPlaceholder: function() {
var hasFieldTemplate = !!this._getFieldTemplate();
if (!hasFieldTemplate) {
this.callBase()
}
},
_renderValue: function() {
if (this.option("useHiddenSubmitElement")) {
this._setSubmitValue()
}
var promise = this.callBase();
promise.always(this._renderField.bind(this))
},
_renderTemplatedField: function(fieldTemplate, data) {
var _this = this;
var isFocused = (0, _selectors.focused)(this._input());
var $container = this._$container;
this._disposeKeyboardProcessor();
var beforeButtonsContainerParent = this._$beforeButtonsContainer && this._$beforeButtonsContainer[0].parentNode;
var afterButtonsContainerParent = this._$afterButtonsContainer && this._$afterButtonsContainer[0].parentNode;
beforeButtonsContainerParent && beforeButtonsContainerParent.removeChild(this._$beforeButtonsContainer[0]);
afterButtonsContainerParent && afterButtonsContainerParent.removeChild(this._$afterButtonsContainer[0]);
this._detachFocusEvents();
$container.empty();
var $templateWrapper = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_FIELD_TEMPLATE_WRAPPER).appendTo($container);
fieldTemplate.render({
model: data,
container: (0, _dom.getPublicElement)($templateWrapper),
onRendered: function() {
var $input = _this._input();
if (!$input.length) {
throw _ui2.default.Error("E1010")
}
_this._refreshEvents();
_this._refreshValueChangeEvent();
_this._renderFocusState();
isFocused && _events_engine2.default.trigger($input, "focus")
}
});
$container.prepend(this._$beforeButtonsContainer);
$container.append(this._$afterButtonsContainer)
},
_fieldRenderData: function() {
return this.option("value")
},
_initTemplates: function() {
this.callBase();
this._defaultTemplates.dropDownButton = new _function_template2.default(function(options) {
var $icon = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_BUTTON_ICON);
(0, _renderer2.default)(options.container).append($icon)
}, this)
},
_renderOpenHandler: function() {
var $inputWrapper = this._inputWrapper();
var eventName = (0, _utils.addNamespace)(_click2.default.name, this.NAME);
var openOnFieldClick = this.option("openOnFieldClick");
_events_engine2.default.off($inputWrapper, eventName);
_events_engine2.default.on($inputWrapper, eventName, this._getInputClickHandler(openOnFieldClick));
this.$element().toggleClass(DROP_DOWN_EDITOR_FIELD_CLICKABLE, openOnFieldClick);
if (openOnFieldClick) {
this._openOnFieldClickAction = this._createAction(this._openHandler.bind(this))
}
},
_attachFocusOutHandler: function() {
var _this2 = this;
if (isIOs) {
this._detachFocusOutEvents();
_events_engine2.default.on(this._inputWrapper(), (0, _utils.addNamespace)("focusout", this.NAME), function(event) {
var newTarget = event.relatedTarget;
var popupWrapper = _this2.content ? (0, _renderer2.default)(_this2.content()).closest("." + DROP_DOWN_EDITOR_OVERLAY) : _this2._$popup;
if (newTarget && _this2.option("opened")) {
var isNewTargetOutside = 0 === (0, _renderer2.default)(newTarget).closest("." + DROP_DOWN_EDITOR_OVERLAY, popupWrapper).length;
if (isNewTargetOutside) {
_this2.close()
}
}
})
}
},
_detachFocusOutEvents: function() {
isIOs && _events_engine2.default.off(this._inputWrapper(), (0, _utils.addNamespace)("focusout", this.NAME))
},
_getInputClickHandler: function(openOnFieldClick) {
var _this3 = this;
return openOnFieldClick ? function(e) {
_this3._executeOpenAction(e)
} : function(e) {
_this3._focusInput()
}
},
_openHandler: function() {
this._toggleOpenState()
},
_executeOpenAction: function(e) {
this._openOnFieldClickAction({
event: e
})
},
_keyboardEventBindingTarget: function() {
return this._input()
},
_focusInput: function() {
if (this.option("disabled")) {
return false
}
if (this.option("focusStateEnabled") && !(0, _selectors.focused)(this._input())) {
_events_engine2.default.trigger(this._input(), "focus")
}
return true
},
_toggleOpenState: function(isVisible) {
if (!this._focusInput()) {
return
}
if (!this.option("readOnly")) {
isVisible = arguments.length ? isVisible : !this.option("opened");
this.option("opened", isVisible)
}
},
_renderOpenedState: function() {
var opened = this.option("opened");
if (opened) {
this._createPopup()
}
this.$element().toggleClass(DROP_DOWN_EDITOR_ACTIVE, opened);
this._setPopupOption("visible", opened);
this.setAria({
expanded: opened
});
this.setAria("owns", (opened || void 0) && this._popupContentId, this.$element())
},
_createPopup: function() {
if (this._$popup) {
return
}
this._$popup = (0, _renderer2.default)("
").addClass(DROP_DOWN_EDITOR_OVERLAY).addClass(this.option("customOverlayCssClass")).appendTo(this.$element());
this._renderPopup();
this._renderPopupContent()
},
_renderPopupContent: _common.noop,
_renderPopup: function() {
this._popup = this._createComponent(this._$popup, _popup2.default, (0, _extend.extend)(this._popupConfig(), this._getInnerOptionsCache("dropDownOptions")));
this._popup.on({
showing: this._popupShowingHandler.bind(this),
shown: this._popupShownHandler.bind(this),
hiding: this._popupHidingHandler.bind(this),
hidden: this._popupHiddenHandler.bind(this)
});
this._popup.option("onContentReady", this._contentReadyHandler.bind(this));
this._contentReadyHandler();
this._setPopupContentId(this._popup.$content());
this._bindInnerWidgetOptions(this._popup, "dropDownOptions")
},
_setPopupContentId: function($popupContent) {
this._popupContentId = "dx-" + new _guid2.default;
this.setAria("id", this._popupContentId, $popupContent)
},
_contentReadyHandler: _common.noop,
_popupConfig: function() {
return {
onInitialized: this._popupInitializedHandler(),
position: (0, _extend.extend)(this.option("popupPosition"), {
of: this.$element()
}),
showTitle: this.option("showPopupTitle"),
width: "auto",
height: "auto",
shading: false,
closeOnTargetScroll: true,
closeOnOutsideClick: this._closeOutsideDropDownHandler.bind(this),
animation: {
show: {
type: "fade",
duration: 0,
from: 0,
to: 1
},
hide: {
type: "fade",
duration: 400,
from: 1,
to: 0
}
},
deferRendering: false,
focusStateEnabled: false,
showCloseButton: false,
toolbarItems: this._getPopupToolbarItems(),
onPositioned: this._popupPositionedHandler.bind(this),
fullScreen: false,
contentTemplate: null
}
},
_popupInitializedHandler: function() {
var _this4 = this;
if (!this.option("onPopupInitialized")) {
return
}
return function(e) {
_this4._popupInitializedAction({
popup: e.component
})
}
},
_popupPositionedHandler: function(e) {
e.position && this._popup.overlayContent().toggleClass(DROP_DOWN_EDITOR_OVERLAY_FLIPPED, e.position.v.flip)
},
_popupShowingHandler: _common.noop,
_popupHidingHandler: function() {
this.option("opened", false)
},
_popupShownHandler: function() {
this._openAction();
if (this._$validationMessage) {
this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition())
}
},
_popupHiddenHandler: function() {
this._closeAction();
if (this._$validationMessage) {
this._$validationMessage.dxOverlay("option", "position", this._getValidationMessagePosition())
}
},
_getValidationMessagePosition: function() {
var positionRequest = "below";
if (this._popup && this._popup.option("visible")) {
var _setupPosition = (0, _position.setup)(this.$element()),
myTop = _setupPosition.top;
var _setupPosition2 = (0, _position.setup)(this._popup.$content()),
popupTop = _setupPosition2.top;
positionRequest = myTop + this.option("popupPosition").offset.v > popupTop ? "below" : "above"
}
return this.callBase(positionRequest)
},
_closeOutsideDropDownHandler: function(_ref) {
var target = _ref.target;
var $target = (0, _renderer2.default)(target);
var dropDownButton = this.getButton("dropDown");
var $dropDownButton = dropDownButton && dropDownButton.$element();
var isInputClicked = !!$target.closest(this.$element()).length;
var isDropDownButtonClicked = !!$target.closest($dropDownButton).length;
var isOutsideClick = !isInputClicked && !isDropDownButtonClicked;
return isOutsideClick
},
_clean: function() {
delete this._openOnFieldClickAction;
if (this._$popup) {
this._$popup.remove();
delete this._$popup;
delete this._popup
}
this.callBase()
},
_setPopupOption: function(optionName, value) {
this._setWidgetOption("_popup", arguments)
},
_validatedOpening: function() {
if (!this.option("readOnly")) {
this._toggleOpenState(true)
}
},
_getPopupToolbarItems: function() {
return "useButtons" === this.option("applyValueMode") ? this._popupToolbarItemsConfig() : []
},
_getFirstPopupElement: function() {
return this._popup._wrapper().find(".dx-popup-done.dx-button")
},
_getLastPopupElement: function() {
return this._popup._wrapper().find(".dx-popup-cancel.dx-button")
},
_popupElementTabHandler: function(e) {
var $element = (0, _renderer2.default)(e.currentTarget);
if (e.shiftKey && $element.is(this._getFirstPopupElement()) || !e.shiftKey && $element.is(this._getLastPopupElement())) {
_events_engine2.default.trigger(this._input(), "focus");
e.preventDefault()
}
},
_popupElementEscHandler: function() {
_events_engine2.default.trigger(this._input(), "focus");
this.close()
},
_popupButtonInitializedHandler: function(e) {
e.component.registerKeyHandler("tab", this._popupElementTabHandler.bind(this));
e.component.registerKeyHandler("escape", this._popupElementEscHandler.bind(this))
},
_popupToolbarItemsConfig: function() {
var buttonsConfig = [{
shortcut: "done",
options: {
onClick: this._applyButtonHandler.bind(this),
text: this.option("applyButtonText"),
onInitialized: this._popupButtonInitializedHandler.bind(this)
}
}, {
shortcut: "cancel",
options: {
onClick: this._cancelButtonHandler.bind(this),
text: this.option("cancelButtonText"),
onInitialized: this._popupButtonInitializedHandler.bind(this)
}
}];
return this._applyButtonsLocation(buttonsConfig)
},
_applyButtonsLocation: function(buttonsConfig) {
var buttonsLocation = this.option("buttonsLocation");
var resultConfig = buttonsConfig;
if ("default" !== buttonsLocation) {
var position = (0, _common.splitPair)(buttonsLocation);
(0, _iterator.each)(resultConfig, function(_, element) {
(0, _extend.extend)(element, {
toolbar: position[0],
location: position[1]
})
})
}
return resultConfig
},
_applyButtonHandler: function() {
this.close();
this.option("focusStateEnabled") && this.focus()
},
_cancelButtonHandler: function() {
this.close();
this.option("focusStateEnabled") && this.focus()
},
_updatePopupWidth: _common.noop,
_popupOptionChanged: function(args) {
var options = this._getOptionsFromContainer(args);
this._setPopupOption(options);
if (Object.keys(options).indexOf("width") !== -1 && void 0 === options.width) {
this._updatePopupWidth()
}
},
_renderSubmitElement: function() {
if (this.option("useHiddenSubmitElement")) {
this._$submitElement = (0, _renderer2.default)("
").attr("type", "hidden").appendTo(this.$element())
}
},
_setSubmitValue: function() {
this._getSubmitElement().val(this.option("value"))
},
_getSubmitElement: function() {
if (this.option("useHiddenSubmitElement")) {
return this._$submitElement
} else {
return this.callBase()
}
},
_dispose: function() {
this._detachFocusOutEvents();
this.callBase()
},
_optionChanged: function(args) {
switch (args.name) {
case "opened":
this._renderOpenedState();
break;
case "onOpened":
case "onClosed":
this._initVisibilityActions();
break;
case "onPopupInitialized":
this._initPopupInitializedAction();
break;
case "fieldTemplate":
if ((0, _type.isDefined)(args.value)) {
this._renderField()
} else {
this._invalidate()
}
break;
case "acceptCustomValue":
case "openOnFieldClick":
this._invalidate();
break;
case "dropDownButtonTemplate":
case "showDropDownButton":
this._updateButtons(["dropDown"]);
break;
case "dropDownOptions":
this._popupOptionChanged(args);
this._cacheInnerOptions("dropDownOptions", args.value);
break;
case "popupPosition":
case "deferRendering":
break;
case "applyValueMode":
case "applyButtonText":
case "cancelButtonText":
case "buttonsLocation":
this._setPopupOption("toolbarItems", this._getPopupToolbarItems());
break;
case "showPopupTitle":
this._setPopupOption("showTitle", args.value);
break;
case "useHiddenSubmitElement":
if (this._$submitElement) {
this._$submitElement.remove();
this._$submitElement = void 0
}
this._renderSubmitElement();
break;
case "rtlEnabled":
this._updatePopupPosition(args.value);
this.callBase(args);
break;
default:
this.callBase(args)
}
},
open: function() {
this.option("opened", true)
},
close: function() {
this.option("opened", false)
},
field: function() {
return (0, _dom.getPublicElement)(this._input())
},
content: function() {
return this._popup ? this._popup.content() : null
}
}).include(_async_template_mixin2.default);
(0, _component_registrator2.default)("dxDropDownEditor", DropDownEditor);
module.exports = DropDownEditor
},
/*!******************************************!*\
!*** ./artifacts/transpiled/exporter.js ***!
\******************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var fileSaver = __webpack_require__( /*! ./exporter/file_saver */ 207).fileSaver;
var excelCreator = __webpack_require__( /*! ./exporter/excel_creator */ 431);
var imageCreator = __webpack_require__( /*! ./exporter/image_creator */ 262);
var svgCreator = __webpack_require__( /*! ./exporter/svg_creator */ 438);
var _isFunction = __webpack_require__( /*! ./core/utils/type */ 1).isFunction;
var Deferred = __webpack_require__( /*! ./core/utils/deferred */ 6).Deferred;
exports.export = function(data, options, getData) {
if (!data) {
return (new Deferred).resolve()
}
var exportingAction = options.exportingAction;
var exportedAction = options.exportedAction;
var fileSavingAction = options.fileSavingAction;
var eventArgs = {
fileName: options.fileName,
format: options.format,
cancel: false
};
_isFunction(exportingAction) && exportingAction(eventArgs);
if (!eventArgs.cancel) {
return getData(data, options, function(blob) {
_isFunction(exportedAction) && exportedAction();
if (_isFunction(fileSavingAction)) {
eventArgs.data = blob;
fileSavingAction(eventArgs)
}
if (!eventArgs.cancel) {
fileSaver.saveAs(eventArgs.fileName, options.format, blob, options.proxyUrl, options.forceProxy)
}
})
}
return (new Deferred).resolve()
};
exports.fileSaver = fileSaver;
exports.excel = {
creator: excelCreator.ExcelCreator,
getData: excelCreator.getData,
formatConverter: __webpack_require__( /*! ./exporter/excel_format_converter */ 178)
};
exports.excel.__internals = excelCreator.__internals;
exports.image = {
creator: imageCreator.imageCreator,
getData: imageCreator.getData,
testFormats: imageCreator.testFormats
};
exports.pdf = {
getData: __webpack_require__( /*! ./exporter/pdf_creator */ 440).getData
};
exports.svg = {
creator: svgCreator.svgCreator,
getData: svgCreator.getData
}
},
/*!*************************************************!*\
!*** ./artifacts/transpiled/core/utils/size.js ***!
\*************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var window = __webpack_require__( /*! ../../core/utils/window */ 7).getWindow();
var typeUtils = __webpack_require__( /*! ../utils/type */ 1);
var SPECIAL_HEIGHT_VALUES = ["auto", "none", "inherit", "initial"];
var getSizeByStyles = function(elementStyles, styles) {
var result = 0;
styles.forEach(function(style) {
result += parseFloat(elementStyles[style]) || 0
});
return result
};
var getElementBoxParams = function(name, elementStyles) {
var beforeName = "width" === name ? "Left" : "Top";
var afterName = "width" === name ? "Right" : "Bottom";
return {
padding: getSizeByStyles(elementStyles, ["padding" + beforeName, "padding" + afterName]),
border: getSizeByStyles(elementStyles, ["border" + beforeName + "Width", "border" + afterName + "Width"]),
margin: getSizeByStyles(elementStyles, ["margin" + beforeName, "margin" + afterName])
}
};
var getBoxSizingOffset = function(name, elementStyles, boxParams) {
var size = elementStyles[name];
if ("border-box" === elementStyles.boxSizing && size.length && "%" !== size[size.length - 1]) {
return boxParams.border + boxParams.padding
}
return 0
};
var getSize = function(element, name, include) {
var elementStyles = window.getComputedStyle(element);
var boxParams = getElementBoxParams(name, elementStyles);
var clientRect = element.getClientRects().length;
var boundingClientRect = element.getBoundingClientRect()[name];
var result = clientRect ? boundingClientRect : 0;
if (result <= 0) {
result = parseFloat(elementStyles[name] || element.style[name]) || 0;
result -= getBoxSizingOffset(name, elementStyles, boxParams)
} else {
result -= boxParams.padding + boxParams.border
}
if (include.paddings) {
result += boxParams.padding
}
if (include.borders) {
result += boxParams.border
}
if (include.margins) {
result += boxParams.margin
}
return result
};
var getContainerHeight = function(container) {
return typeUtils.isWindow(container) ? container.innerHeight : container.offsetHeight
};
var parseHeight = function(value, container) {
if (value.indexOf("px") > 0) {
value = parseInt(value.replace("px", ""))
} else {
if (value.indexOf("%") > 0) {
value = parseInt(value.replace("%", "")) * getContainerHeight(container) / 100
} else {
if (!isNaN(value)) {
value = parseInt(value)
}
}
}
return value
};
var getHeightWithOffset = function(value, offset, container) {
if (!value) {
return null
}
if (SPECIAL_HEIGHT_VALUES.indexOf(value) > -1) {
return offset ? null : value
}
if (typeUtils.isString(value)) {
value = parseHeight(value, container)
}
if (typeUtils.isNumeric(value)) {
return Math.max(0, value + offset)
}
var operationString = offset < 0 ? " - " : " ";
return "calc(" + value + operationString + Math.abs(offset) + "px)"
};
var addOffsetToMaxHeight = function(value, offset, container) {
var maxHeight = getHeightWithOffset(value, offset, container);
return null !== maxHeight ? maxHeight : "none"
};
var addOffsetToMinHeight = function(value, offset, container) {
var minHeight = getHeightWithOffset(value, offset, container);
return null !== minHeight ? minHeight : 0
};
var getVerticalOffsets = function(element, withMargins) {
if (!element) {
return 0
}
var boxParams = getElementBoxParams("height", window.getComputedStyle(element));
return boxParams.padding + boxParams.border + (withMargins ? boxParams.margin : 0)
};
var getVisibleHeight = function(element) {
if (element) {
var boundingClientRect = element.getBoundingClientRect();
if (boundingClientRect.height) {
return boundingClientRect.height
}
}
return 0
};
exports.getSize = getSize;
exports.getElementBoxParams = getElementBoxParams;
exports.addOffsetToMaxHeight = addOffsetToMaxHeight;
exports.addOffsetToMinHeight = addOffsetToMinHeight;
exports.getVerticalOffsets = getVerticalOffsets;
exports.getVisibleHeight = getVisibleHeight;
exports.parseHeight = parseHeight
},
/*!****************************************************************!*\
!*** ./artifacts/transpiled/ui/validation/validation_mixin.js ***!
\****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var ValidationMixin = {
_findGroup: function() {
var group = this.option("validationGroup");
var $dxGroup;
if (!group) {
$dxGroup = this.$element().parents(".dx-validationgroup").first();
if ($dxGroup.length) {
group = $dxGroup.dxValidationGroup("instance")
} else {
group = this._modelByElement(this.$element())
}
}
return group
}
};
module.exports = ValidationMixin
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/ui/resizable.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var commonUtils = __webpack_require__( /*! ../core/utils/common */ 4);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var inArray = __webpack_require__( /*! ../core/utils/array */ 14).inArray;
var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
var typeUtils = __webpack_require__( /*! ../core/utils/type */ 1);
var windowUtils = __webpack_require__( /*! ../core/utils/window */ 7);
var translator = __webpack_require__( /*! ../animation/translator */ 27);
var fitIntoRange = __webpack_require__( /*! ../core/utils/math */ 28).fitIntoRange;
var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67);
var eventUtils = __webpack_require__( /*! ../events/utils */ 8);
var dragEvents = __webpack_require__( /*! ../events/drag */ 56);
var isPlainObject = typeUtils.isPlainObject;
var isFunction = typeUtils.isFunction;
var domUtils = __webpack_require__( /*! ../core/utils/dom */ 12);
var RESIZABLE = "dxResizable";
var RESIZABLE_CLASS = "dx-resizable";
var RESIZABLE_RESIZING_CLASS = "dx-resizable-resizing";
var RESIZABLE_HANDLE_CLASS = "dx-resizable-handle";
var RESIZABLE_HANDLE_TOP_CLASS = "dx-resizable-handle-top";
var RESIZABLE_HANDLE_BOTTOM_CLASS = "dx-resizable-handle-bottom";
var RESIZABLE_HANDLE_LEFT_CLASS = "dx-resizable-handle-left";
var RESIZABLE_HANDLE_RIGHT_CLASS = "dx-resizable-handle-right";
var RESIZABLE_HANDLE_CORNER_CLASS = "dx-resizable-handle-corner";
var DRAGSTART_START_EVENT_NAME = eventUtils.addNamespace(dragEvents.start, RESIZABLE);
var DRAGSTART_EVENT_NAME = eventUtils.addNamespace(dragEvents.move, RESIZABLE);
var DRAGSTART_END_EVENT_NAME = eventUtils.addNamespace(dragEvents.end, RESIZABLE);
var SIDE_BORDER_WIDTH_STYLES = {
left: "borderLeftWidth",
top: "borderTopWidth",
right: "borderRightWidth",
bottom: "borderBottomWidth"
};
var Resizable = DOMComponent.inherit({
_getDefaultOptions: function() {
return extend(this.callBase(), {
handles: "all",
step: "1",
stepPrecision: "simple",
area: void 0,
minWidth: 30,
maxWidth: 1 / 0,
minHeight: 30,
maxHeight: 1 / 0,
onResizeStart: null,
onResize: null,
onResizeEnd: null,
roundStepValue: true
})
},
_init: function() {
this.callBase();
this.$element().addClass(RESIZABLE_CLASS)
},
_initMarkup: function() {
this.callBase();
this._renderHandles()
},
_render: function() {
this.callBase();
this._renderActions()
},
_renderActions: function() {
this._resizeStartAction = this._createActionByOption("onResizeStart");
this._resizeEndAction = this._createActionByOption("onResizeEnd");
this._resizeAction = this._createActionByOption("onResize")
},
_renderHandles: function() {
var handles = this.option("handles");
if ("none" === handles) {
return
}
var directions = "all" === handles ? ["top", "bottom", "left", "right"] : handles.split(" ");
each(directions, function(index, handleName) {
this._renderHandle(handleName)
}.bind(this));
inArray("bottom", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-bottom-right");
inArray("bottom", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-bottom-left");
inArray("top", directions) + 1 && inArray("right", directions) + 1 && this._renderHandle("corner-top-right");
inArray("top", directions) + 1 && inArray("left", directions) + 1 && this._renderHandle("corner-top-left")
},
_renderHandle: function(handleName) {
var $element = this.$element();
var $handle = $("
");
$handle.addClass(RESIZABLE_HANDLE_CLASS).addClass(RESIZABLE_HANDLE_CLASS + "-" + handleName).appendTo($element);
this._attachEventHandlers($handle)
},
_attachEventHandlers: function($handle) {
if (this.option("disabled")) {
return
}
var handlers = {};
handlers[DRAGSTART_START_EVENT_NAME] = this._dragStartHandler.bind(this);
handlers[DRAGSTART_EVENT_NAME] = this._dragHandler.bind(this);
handlers[DRAGSTART_END_EVENT_NAME] = this._dragEndHandler.bind(this);
eventsEngine.on($handle, handlers, {
direction: "both",
immediate: true
})
},
_dragStartHandler: function(e) {
var $element = this.$element();
if ($element.is(".dx-state-disabled, .dx-state-disabled *")) {
e.cancel = true;
return
}
this._toggleResizingClass(true);
this._movingSides = this._getMovingSides(e);
this._elementLocation = translator.locate($element);
var elementRect = $element.get(0).getBoundingClientRect();
this._elementSize = {
width: elementRect.width,
height: elementRect.height
};
this._renderDragOffsets(e);
this._resizeStartAction({
event: e,
width: this._elementSize.width,
height: this._elementSize.height,
handles: this._movingSides
});
e.targetElements = null
},
_toggleResizingClass: function(value) {
this.$element().toggleClass(RESIZABLE_RESIZING_CLASS, value)
},
_renderDragOffsets: function(e) {
var area = this._getArea();
if (!area) {
return
}
var $handle = $(e.target).closest("." + RESIZABLE_HANDLE_CLASS);
var handleWidth = $handle.outerWidth();
var handleHeight = $handle.outerHeight();
var handleOffset = $handle.offset();
var areaOffset = area.offset;
var scrollOffset = this._getAreaScrollOffset();
e.maxLeftOffset = handleOffset.left - areaOffset.left - scrollOffset.scrollX;
e.maxRightOffset = areaOffset.left + area.width - handleOffset.left - handleWidth + scrollOffset.scrollX;
e.maxTopOffset = handleOffset.top - areaOffset.top - scrollOffset.scrollY;
e.maxBottomOffset = areaOffset.top + area.height - handleOffset.top - handleHeight + scrollOffset.scrollY
},
_getBorderWidth: function($element, direction) {
if (typeUtils.isWindow($element.get(0))) {
return 0
}
var borderWidth = $element.css(SIDE_BORDER_WIDTH_STYLES[direction]);
return parseInt(borderWidth) || 0
},
_dragHandler: function(e) {
var $element = this.$element();
var sides = this._movingSides;
var location = this._elementLocation;
var size = this._elementSize;
var offset = this._getOffset(e);
var width = size.width + offset.x * (sides.left ? -1 : 1);
var height = size.height + offset.y * (sides.top ? -1 : 1);
if (offset.x || "strict" === this.option("stepPrecision")) {
this._renderWidth(width)
}
if (offset.y || "strict" === this.option("stepPrecision")) {
this._renderHeight(height)
}
var elementRect = $element.get(0).getBoundingClientRect();
var offsetTop = offset.y - ((elementRect.height || height) - height);
var offsetLeft = offset.x - ((elementRect.width || width) - width);
translator.move($element, {
top: location.top + (sides.top ? offsetTop : 0),
left: location.left + (sides.left ? offsetLeft : 0)
});
this._resizeAction({
event: e,
width: this.option("width") || width,
height: this.option("height") || height,
handles: this._movingSides
});
domUtils.triggerResizeEvent($element)
},
_getOffset: function(e) {
var offset = e.offset;
var steps = commonUtils.pairToObject(this.option("step"), !this.option("roundStepValue"));
var sides = this._getMovingSides(e);
var strictPrecision = "strict" === this.option("stepPrecision");
if (!sides.left && !sides.right) {
offset.x = 0
}
if (!sides.top && !sides.bottom) {
offset.y = 0
}
return strictPrecision ? this._getStrictOffset(offset, steps, sides) : this._getSimpleOffset(offset, steps)
},
_getSimpleOffset: function(offset, steps) {
return {
x: offset.x - offset.x % steps.h,
y: offset.y - offset.y % steps.v
}
},
_getStrictOffset: function(offset, steps, sides) {
var location = this._elementLocation;
var size = this._elementSize;
var xPos = sides.left ? location.left : location.left + size.width;
var yPos = sides.top ? location.top : location.top + size.height;
var newXShift = (xPos + offset.x) % steps.h;
var newYShift = (yPos + offset.y) % steps.v;
var sign = Math.sign || function(x) {
x = +x;
if (0 === x || isNaN(x)) {
return x
}
return x > 0 ? 1 : -1
};
var separatorOffset = function(steps, offset) {
return (1 + .2 * sign(offset)) % 1 * steps
};
var isSmallOffset = function(offset, steps) {
return Math.abs(offset) < .2 * steps
};
var newOffsetX = offset.x - newXShift;
var newOffsetY = offset.y - newYShift;
if (newXShift > separatorOffset(steps.h, offset.x)) {
newOffsetX += steps.h
}
if (newYShift > separatorOffset(steps.v, offset.y)) {
newOffsetY += steps.v
}
return {
x: (sides.left || sides.right) && !isSmallOffset(offset.x, steps.h) ? newOffsetX : 0,
y: (sides.top || sides.bottom) && !isSmallOffset(offset.y, steps.v) ? newOffsetY : 0
}
},
_getMovingSides: function(e) {
var $target = $(e.target);
var hasCornerTopLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-left");
var hasCornerTopRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-top-right");
var hasCornerBottomLeftClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-left");
var hasCornerBottomRightClass = $target.hasClass(RESIZABLE_HANDLE_CORNER_CLASS + "-bottom-right");
return {
top: $target.hasClass(RESIZABLE_HANDLE_TOP_CLASS) || hasCornerTopLeftClass || hasCornerTopRightClass,
left: $target.hasClass(RESIZABLE_HANDLE_LEFT_CLASS) || hasCornerTopLeftClass || hasCornerBottomLeftClass,
bottom: $target.hasClass(RESIZABLE_HANDLE_BOTTOM_CLASS) || hasCornerBottomLeftClass || hasCornerBottomRightClass,
right: $target.hasClass(RESIZABLE_HANDLE_RIGHT_CLASS) || hasCornerTopRightClass || hasCornerBottomRightClass
}
},
_getArea: function() {
var area = this.option("area");
if (isFunction(area)) {
area = area.call(this)
}
if (isPlainObject(area)) {
return this._getAreaFromObject(area)
}
return this._getAreaFromElement(area)
},
_getAreaScrollOffset: function() {
var area = this.option("area");
var isElement = !isFunction(area) && !isPlainObject(area);
var scrollOffset = {
scrollY: 0,
scrollX: 0
};
if (isElement) {
var areaElement = $(area)[0];
if (typeUtils.isWindow(areaElement)) {
scrollOffset.scrollX = areaElement.pageXOffset;
scrollOffset.scrollY = areaElement.pageYOffset
}
}
return scrollOffset
},
_getAreaFromObject: function(area) {
var result = {
width: area.right - area.left,
height: area.bottom - area.top,
offset: {
left: area.left,
top: area.top
}
};
this._correctAreaGeometry(result);
return result
},
_getAreaFromElement: function(area) {
var $area = $(area);
var result;
if ($area.length) {
result = {
width: $area.innerWidth(),
height: $area.innerHeight(),
offset: extend({
top: 0,
left: 0
}, typeUtils.isWindow($area[0]) ? {} : $area.offset())
};
this._correctAreaGeometry(result, $area)
}
return result
},
_correctAreaGeometry: function(result, $area) {
var areaBorderLeft = $area ? this._getBorderWidth($area, "left") : 0;
var areaBorderTop = $area ? this._getBorderWidth($area, "top") : 0;
result.offset.left += areaBorderLeft + this._getBorderWidth(this.$element(), "left");
result.offset.top += areaBorderTop + this._getBorderWidth(this.$element(), "top");
result.width -= this.$element().outerWidth() - this.$element().innerWidth();
result.height -= this.$element().outerHeight() - this.$element().innerHeight()
},
_dragEndHandler: function(e) {
var $element = this.$element();
this._resizeEndAction({
event: e,
width: $element.outerWidth(),
height: $element.outerHeight(),
handles: this._movingSides
});
this._toggleResizingClass(false)
},
_renderWidth: function(width) {
this.option("width", fitIntoRange(width, this.option("minWidth"), this.option("maxWidth")))
},
_renderHeight: function(height) {
this.option("height", fitIntoRange(height, this.option("minHeight"), this.option("maxHeight")))
},
_optionChanged: function(args) {
switch (args.name) {
case "disabled":
case "handles":
this._invalidate();
break;
case "minWidth":
case "maxWidth":
windowUtils.hasWindow() && this._renderWidth(this.$element().outerWidth());
break;
case "minHeight":
case "maxHeight":
windowUtils.hasWindow() && this._renderHeight(this.$element().outerHeight());
break;
case "onResize":
case "onResizeStart":
case "onResizeEnd":
this._renderActions();
break;
case "area":
case "stepPrecision":
case "step":
case "roundStepValue":
break;
default:
this.callBase(args)
}
},
_clean: function() {
this.$element().find("." + RESIZABLE_HANDLE_CLASS).remove()
}
});
registerComponent(RESIZABLE, Resizable);
module.exports = Resizable
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/events/swipe.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var eventUtils = __webpack_require__( /*! ./utils */ 8);
var GestureEmitter = __webpack_require__( /*! ./gesture/emitter.gesture */ 158);
var registerEmitter = __webpack_require__( /*! ./core/emitter_registrator */ 95);
var SWIPE_START_EVENT = "dxswipestart";
var SWIPE_EVENT = "dxswipe";
var SWIPE_END_EVENT = "dxswipeend";
var HorizontalStrategy = {
defaultItemSizeFunc: function() {
return this.getElement().width()
},
getBounds: function() {
return [this._maxLeftOffset, this._maxRightOffset]
},
calcOffsetRatio: function(e) {
var endEventData = eventUtils.eventData(e);
return (endEventData.x - (this._savedEventData && this._savedEventData.x || 0)) / this._itemSizeFunc().call(this, e)
},
isFastSwipe: function(e) {
var endEventData = eventUtils.eventData(e);
return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.x - this._tickData.x) >= endEventData.time - this._tickData.time
}
};
var VerticalStrategy = {
defaultItemSizeFunc: function() {
return this.getElement().height()
},
getBounds: function() {
return [this._maxTopOffset, this._maxBottomOffset]
},
calcOffsetRatio: function(e) {
var endEventData = eventUtils.eventData(e);
return (endEventData.y - (this._savedEventData && this._savedEventData.y || 0)) / this._itemSizeFunc().call(this, e)
},
isFastSwipe: function(e) {
var endEventData = eventUtils.eventData(e);
return this.FAST_SWIPE_SPEED_LIMIT * Math.abs(endEventData.y - this._tickData.y) >= endEventData.time - this._tickData.time
}
};
var STRATEGIES = {
horizontal: HorizontalStrategy,
vertical: VerticalStrategy
};
var SwipeEmitter = GestureEmitter.inherit({
TICK_INTERVAL: 300,
FAST_SWIPE_SPEED_LIMIT: 10,
ctor: function(element) {
this.callBase(element);
this.direction = "horizontal";
this.elastic = true
},
_getStrategy: function() {
return STRATEGIES[this.direction]
},
_defaultItemSizeFunc: function() {
return this._getStrategy().defaultItemSizeFunc.call(this)
},
_itemSizeFunc: function() {
return this.itemSizeFunc || this._defaultItemSizeFunc
},
_init: function(e) {
this._tickData = eventUtils.eventData(e)
},
_start: function(e) {
this._savedEventData = eventUtils.eventData(e);
e = this._fireEvent(SWIPE_START_EVENT, e);
if (!e.cancel) {
this._maxLeftOffset = e.maxLeftOffset;
this._maxRightOffset = e.maxRightOffset;
this._maxTopOffset = e.maxTopOffset;
this._maxBottomOffset = e.maxBottomOffset
}
},
_move: function(e) {
var strategy = this._getStrategy();
var moveEventData = eventUtils.eventData(e);
var offset = strategy.calcOffsetRatio.call(this, e);
offset = this._fitOffset(offset, this.elastic);
if (moveEventData.time - this._tickData.time > this.TICK_INTERVAL) {
this._tickData = moveEventData
}
this._fireEvent(SWIPE_EVENT, e, {
offset: offset
});
e.preventDefault()
},
_end: function(e) {
var strategy = this._getStrategy();
var offsetRatio = strategy.calcOffsetRatio.call(this, e);
var isFast = strategy.isFastSwipe.call(this, e);
var startOffset = offsetRatio;
var targetOffset = this._calcTargetOffset(offsetRatio, isFast);
startOffset = this._fitOffset(startOffset, this.elastic);
targetOffset = this._fitOffset(targetOffset, false);
this._fireEvent(SWIPE_END_EVENT, e, {
offset: startOffset,
targetOffset: targetOffset
})
},
_fitOffset: function(offset, elastic) {
var strategy = this._getStrategy();
var bounds = strategy.getBounds.call(this);
if (offset < -bounds[0]) {
return elastic ? (-2 * bounds[0] + offset) / 3 : -bounds[0]
}
if (offset > bounds[1]) {
return elastic ? (2 * bounds[1] + offset) / 3 : bounds[1]
}
return offset
},
_calcTargetOffset: function(offsetRatio, isFast) {
var result;
if (isFast) {
result = Math.ceil(Math.abs(offsetRatio));
if (offsetRatio < 0) {
result = -result
}
} else {
result = Math.round(offsetRatio)
}
return result
}
});
registerEmitter({
emitter: SwipeEmitter,
events: [SWIPE_START_EVENT, SWIPE_EVENT, SWIPE_END_EVENT]
});
exports.swipe = SWIPE_EVENT;
exports.start = SWIPE_START_EVENT;
exports.end = SWIPE_END_EVENT
}, ,
/*!*********************************************************!*\
!*** ./artifacts/transpiled/core/polyfills/weak_map.js ***!
\*********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
var windowUtils = __webpack_require__( /*! ../../core/utils/window */ 7);
var weakMap = windowUtils.hasWindow() ? windowUtils.getWindow().WeakMap : WeakMap;
if (!weakMap) {
weakMap = function() {
var keys = [];
var values = [];
this.set = function(key, value) {
var index = inArray(key, keys);
if (index === -1) {
keys.push(key);
values.push(value)
} else {
values[index] = value
}
};
this.get = function(key) {
var index = inArray(key, keys);
if (index === -1) {
return
}
return values[index]
};
this.has = function(key) {
var index = inArray(key, keys);
if (index === -1) {
return false
}
return true
};
this.delete = function(key) {
var index = inArray(key, keys);
if (index === -1) {
return
}
keys.splice(index, 1);
values.splice(index, 1)
}
}
}
module.exports = weakMap
},
/*!**********************************************************!*\
!*** ./artifacts/transpiled/core/memorized_callbacks.js ***!
\**********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var each = __webpack_require__( /*! ../core/utils/iterator */ 3).each;
var Callbacks = __webpack_require__( /*! ./utils/callbacks */ 26);
var MemorizedCallbacks = function() {
var memory = [];
var callbacks = Callbacks();
this.add = function(fn) {
each(memory, function(_, item) {
fn.apply(fn, item)
});
callbacks.add(fn)
};
this.remove = function(fn) {
callbacks.remove(fn)
};
this.fire = function() {
memory.push(arguments);
callbacks.fire.apply(callbacks, arguments)
}
};
module.exports = MemorizedCallbacks
},
/*!*****************************************************************!*\
!*** ./artifacts/transpiled/exporter/excel_format_converter.js ***!
\*****************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _string = __webpack_require__( /*! ../core/utils/string */ 44);
var _string2 = _interopRequireDefault(_string);
var _number = __webpack_require__( /*! ../localization/number */ 51);
var _number2 = _interopRequireDefault(_number);
var _date = __webpack_require__( /*! ../localization/date */ 32);
var _date2 = _interopRequireDefault(_date);
var _type = __webpack_require__( /*! ../core/utils/type */ 1);
var _date3 = __webpack_require__( /*! ../localization/ldml/date.format */ 208);
var _language_codes = __webpack_require__( /*! ../localization/language_codes */ 279);
__webpack_require__( /*! ../localization/currency */ 152);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var ARABIC_ZERO_CODE = 1632;
var DEFINED_NUMBER_FORMTATS = {
thousands: "#,##0{0},"K"",
millions: "#,##0{0},,"M"",
billions: "#,##0{0},,,"B"",
trillions: "#,##0{0},,,,"T"",
percent: "0{0}%",
decimal: "#{0}",
fixedpoint: "#,##0{0}",
exponential: "0{0}E+00",
currency: " "
};
var PERIOD_REGEXP = /a+/g;
var DAY_REGEXP = /E/g;
var DO_REGEXP = /dE+/g;
var STANDALONE_MONTH_REGEXP = /L/g;
var HOUR_REGEXP = /h/g;
var SLASH_REGEXP = /\//g;
var SQUARE_OPEN_BRACKET_REGEXP = /\[/g;
var SQUARE_CLOSE_BRACKET_REGEXP = /]/g;
var ANY_REGEXP = /./g;
var excelFormatConverter = module.exports = {
_applyPrecision: function(format, precision) {
var result;
var i;
if (precision > 0) {
result = "decimal" !== format ? "." : "";
for (i = 0; i < precision; i++) {
result += "0"
}
return result
}
return ""
},
_hasArabicDigits: function(text) {
var code;
for (var i = 0; i < text.length; i++) {
code = text.charCodeAt(i);
if (code >= ARABIC_ZERO_CODE && code < ARABIC_ZERO_CODE + 10) {
return true
}
}
return false
},
_convertDateFormatToOpenXml: function(format) {
return format.replace(SLASH_REGEXP, "\\/").split("'").map(function(datePart, index) {
if (index % 2 === 0) {
return datePart.replace(PERIOD_REGEXP, "AM/PM").replace(DO_REGEXP, "d").replace(DAY_REGEXP, "d").replace(STANDALONE_MONTH_REGEXP, "M").replace(HOUR_REGEXP, "H").replace(SQUARE_OPEN_BRACKET_REGEXP, "\\[").replace(SQUARE_CLOSE_BRACKET_REGEXP, "\\]")
}
if (datePart) {
return datePart.replace(ANY_REGEXP, "\\$&")
}
return "'"
}).join("")
},
_convertDateFormat: function(format) {
var formattedValue = (_date2.default.format(new Date(2009, 8, 8, 6, 5, 4), format) || "").toString();
var result = (0, _date3.getFormat)(function(value) {
return _date2.default.format(value, format)
});
if (result) {
result = this._convertDateFormatToOpenXml(result);
result = this._getLanguageInfo(formattedValue) + result
}
return result
},
_getLanguageInfo: function(defaultPattern) {
var languageID = (0, _language_codes.getLanguageId)();
var languageIDStr = languageID ? languageID.toString(16) : "";
var languageInfo = "";
if (this._hasArabicDigits(defaultPattern)) {
while (languageIDStr.length < 3) {
languageIDStr = "0" + languageIDStr
}
languageInfo = "[$-2010" + languageIDStr + "]"
} else {
if (languageIDStr) {
languageInfo = "[$-" + languageIDStr + "]"
}
}
return languageInfo
},
_convertNumberFormat: function(format, precision, currency) {
var result;
var excelFormat;
if ("currency" === format) {
excelFormat = _number2.default.getOpenXmlCurrencyFormat(currency)
} else {
excelFormat = DEFINED_NUMBER_FORMTATS[format.toLowerCase()]
}
if (excelFormat) {
result = _string2.default.format(excelFormat, this._applyPrecision(format, precision))
}
return result
},
convertFormat: function(format, precision, type, currency) {
if ((0, _type.isDefined)(format)) {
if ("date" === type) {
return excelFormatConverter._convertDateFormat(format)
} else {
if ((0, _type.isString)(format) && DEFINED_NUMBER_FORMTATS[format.toLowerCase()]) {
return excelFormatConverter._convertNumberFormat(format, precision, currency)
}
}
}
}
}
},
/*!***********************************************************!*\
!*** ./artifacts/transpiled/animation/presets/presets.js ***!
\***********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var Component = __webpack_require__( /*! ../../core/component */ 133);
var each = __webpack_require__( /*! ../../core/utils/iterator */ 3).each;
var extend = __webpack_require__( /*! ../../core/utils/extend */ 0).extend;
var devices = __webpack_require__( /*! ../../core/devices */ 16);
var fx = __webpack_require__( /*! ../fx */ 38);
var directionPostfixes = {
forward: " dx-forward",
backward: " dx-backward",
none: " dx-no-direction",
undefined: " dx-no-direction"
};
var optionPrefix = "preset_";
var AnimationPresetCollection = Component.inherit({
ctor: function() {
this.callBase.apply(this, arguments);
this._registeredPresets = [];
this.resetToDefaults()
},
_getDefaultOptions: function() {
return extend(this.callBase(), {
defaultAnimationDuration: 400,
defaultAnimationDelay: 0,
defaultStaggerAnimationDuration: 300,
defaultStaggerAnimationDelay: 40,
defaultStaggerAnimationStartDelay: 500
})
},
_defaultOptionsRules: function() {
return this.callBase().concat([{
device: function(_device) {
return _device.phone
},
options: {
defaultStaggerAnimationDuration: 350,
defaultStaggerAnimationDelay: 50,
defaultStaggerAnimationStartDelay: 0
}
}, {
device: function() {
return devices.current().android || devices.real.android
},
options: {
defaultAnimationDelay: 100
}
}])
},
_getPresetOptionName: function(animationName) {
return optionPrefix + animationName
},
_createAndroidSlideAnimationConfig: function(throughOpacity, widthMultiplier) {
var that = this;
var createBaseConfig = function(configModifier) {
return {
type: "slide",
delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
}
};
return {
enter: function($element, configModifier) {
var width = $element.parent().width() * widthMultiplier;
var direction = configModifier.direction;
var config = createBaseConfig(configModifier);
config.to = {
left: 0,
opacity: 1
};
if ("forward" === direction) {
config.from = {
left: width,
opacity: throughOpacity
}
} else {
if ("backward" === direction) {
config.from = {
left: -width,
opacity: throughOpacity
}
} else {
config.from = {
left: 0,
opacity: 0
}
}
}
return fx.createAnimation($element, config)
},
leave: function($element, configModifier) {
var width = $element.parent().width() * widthMultiplier;
var direction = configModifier.direction;
var config = createBaseConfig(configModifier);
config.from = {
left: 0,
opacity: 1
};
if ("forward" === direction) {
config.to = {
left: -width,
opacity: throughOpacity
}
} else {
if ("backward" === direction) {
config.to = {
left: width,
opacity: throughOpacity
}
} else {
config.to = {
left: 0,
opacity: 0
}
}
}
return fx.createAnimation($element, config)
}
}
},
_createOpenDoorConfig: function() {
var that = this;
var createBaseConfig = function(configModifier) {
return {
type: "css",
extraCssClasses: "dx-opendoor-animation",
delay: void 0 === configModifier.delay ? that.option("defaultAnimationDelay") : configModifier.delay,
duration: void 0 === configModifier.duration ? that.option("defaultAnimationDuration") : configModifier.duration
}
};
return {
enter: function($element, configModifier) {
var direction = configModifier.direction;
var config = createBaseConfig(configModifier);
config.delay = "none" === direction ? config.delay : config.duration;
config.from = "dx-enter dx-opendoor-animation" + directionPostfixes[direction];
config.to = "dx-enter-active";
return fx.createAnimation($element, config)
},
leave: function($element, configModifier) {
var direction = configModifier.direction;
var config = createBaseConfig(configModifier);
config.from = "dx-leave dx-opendoor-animation" + directionPostfixes[direction];
config.to = "dx-leave-active";
return fx.createAnimation($element, config)
}
}
},
_createWinPopConfig: function() {
var that = this;
var baseConfig = {
type: "css",
extraCssClasses: "dx-win-pop-animation",
duration: that.option("defaultAnimationDuration")
};
return {
enter: function($element, configModifier) {
var config = baseConfig;
var direction = configModifier.direction;
config.delay = "none" === direction ? that.option("defaultAnimationDelay") : that.option("defaultAnimationDuration") / 2;
config.from = "dx-enter dx-win-pop-animation" + directionPostfixes[direction];
config.to = "dx-enter-active";
return fx.createAnimation($element, config)
},
leave: function($element, configModifier) {
var config = baseConfig;
var direction = configModifier.direction;
config.delay = that.option("defaultAnimationDelay");
config.from = "dx-leave dx-win-pop-animation" + directionPostfixes[direction];
config.to = "dx-leave-active";
return fx.createAnimation($element, config)
}
}
},
resetToDefaults: function() {
this.clear();
this.registerDefaultPresets();
this.applyChanges()
},
clear: function(name) {
var that = this;
var newRegisteredPresets = [];
each(this._registeredPresets, function(index, preset) {
if (!name || name === preset.name) {
that.option(that._getPresetOptionName(preset.name), void 0)
} else {
newRegisteredPresets.push(preset)
}
});
this._registeredPresets = newRegisteredPresets;
this.applyChanges()
},
registerPreset: function(name, config) {
this._registeredPresets.push({
name: name,
config: config
})
},
applyChanges: function() {
var that = this;
var customRules = [];
each(this._registeredPresets, function(index, preset) {
var rule = {
device: preset.config.device,
options: {}
};
rule.options[that._getPresetOptionName(preset.name)] = preset.config.animation;
customRules.push(rule)
});
this._setOptionsByDevice(customRules)
},
getPreset: function(name) {
var result = name;
while ("string" === typeof result) {
result = this.option(this._getPresetOptionName(result))
}
return result
},
registerDefaultPresets: function() {
this.registerPreset("pop", {
animation: {
extraCssClasses: "dx-android-pop-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("openDoor", {
animation: this._createOpenDoorConfig()
});
this.registerPreset("win-pop", {
animation: this._createWinPopConfig()
});
this.registerPreset("fade", {
animation: {
extraCssClasses: "dx-fade-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("slide", {
device: function() {
return devices.current().android || devices.real.android
},
animation: this._createAndroidSlideAnimationConfig(1, 1)
});
this.registerPreset("slide", {
device: function() {
return !devices.current().android && !devices.real.android
},
animation: {
extraCssClasses: "dx-slide-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("ios7-slide", {
animation: {
extraCssClasses: "dx-ios7-slide-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("overflow", {
animation: {
extraCssClasses: "dx-overflow-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("ios7-toolbar", {
device: function() {
return !devices.current().android && !devices.real.android
},
animation: {
extraCssClasses: "dx-ios7-toolbar-animation",
delay: this.option("defaultAnimationDelay"),
duration: this.option("defaultAnimationDuration")
}
});
this.registerPreset("ios7-toolbar", {
device: function() {
return devices.current().android || devices.real.android
},
animation: this._createAndroidSlideAnimationConfig(0, .4)
});
this.registerPreset("stagger-fade", {
animation: {
extraCssClasses: "dx-fade-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-slide", {
animation: {
extraCssClasses: "dx-slide-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-fade-slide", {
animation: {
extraCssClasses: "dx-fade-slide-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-drop", {
animation: {
extraCssClasses: "dx-drop-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-fade-drop", {
animation: {
extraCssClasses: "dx-fade-drop-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-fade-rise", {
animation: {
extraCssClasses: "dx-fade-rise-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-3d-drop", {
animation: {
extraCssClasses: "dx-3d-drop-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
});
this.registerPreset("stagger-fade-zoom", {
animation: {
extraCssClasses: "dx-fade-zoom-animation",
staggerDelay: this.option("defaultStaggerAnimationDelay"),
duration: this.option("defaultStaggerAnimationDuration"),
delay: this.option("defaultStaggerAnimationStartDelay")
}
})
}
});
exports.PresetCollection = AnimationPresetCollection;
var animationPresets = new AnimationPresetCollection;
exports.presets = animationPresets
},
/*!************************************************************!*\
!*** ./artifacts/transpiled/integration/angular/module.js ***!
\************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var angular = __webpack_require__( /*! angular */ 270);
module.exports = angular.module("dx", [])
},
/*!*****************************************************!*\
!*** ./artifacts/transpiled/data/query_adapters.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = {}
},
/*!****************************************************************************************!*\
!*** ./artifacts/transpiled/ui/collection/ui.collection_widget.edit.strategy.plain.js ***!
\****************************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
var inArray = __webpack_require__( /*! ../../core/utils/array */ 14).inArray;
var EditStrategy = __webpack_require__( /*! ./ui.collection_widget.edit.strategy */ 469);
var PlainEditStrategy = EditStrategy.inherit({
_getPlainItems: function() {
return this._collectionWidget.option("items") || []
},
getIndexByItemData: function(itemData) {
var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
if (keyOf) {
return this.getIndexByKey(keyOf(itemData))
} else {
return inArray(itemData, this._getPlainItems())
}
},
getItemDataByIndex: function(index) {
return this._getPlainItems()[index]
},
deleteItemAtIndex: function(index) {
this._getPlainItems().splice(index, 1)
},
itemsGetter: function() {
return this._getPlainItems()
},
getKeysByItems: function(items) {
var keyOf = this._collectionWidget.keyOf.bind(this._collectionWidget);
var result = items;
if (keyOf) {
result = [];
for (var i = 0; i < items.length; i++) {
result.push(keyOf(items[i]))
}
}
return result
},
getIndexByKey: function(key) {
var cache = this._cache;
var keys = cache && cache.keys || this.getKeysByItems(this._getPlainItems());
if (cache && !cache.keys) {
cache.keys = keys
}
if ("object" === _typeof(key)) {
for (var i = 0, length = keys.length; i < length; i++) {
if (this._equalKeys(key, keys[i])) {
return i
}
}
} else {
return keys.indexOf(key)
}
return -1
},
getItemsByKeys: function(keys, items) {
return (items || keys).slice()
},
moveItemAtIndexToIndex: function(movingIndex, destinationIndex) {
var items = this._getPlainItems();
var movedItemData = items[movingIndex];
items.splice(movingIndex, 1);
items.splice(destinationIndex, 0, movedItemData)
},
_isItemIndex: function(index) {
return "number" === typeof index && Math.round(index) === index
},
_getNormalizedItemIndex: function(itemElement) {
return this._collectionWidget._itemElements().index(itemElement)
},
_normalizeItemIndex: function(index) {
return index
},
_denormalizeItemIndex: function(index) {
return index
},
_getItemByNormalizedIndex: function(index) {
return index > -1 ? this._collectionWidget._itemElements().eq(index) : null
},
_itemsFromSameParent: function() {
return true
}
});
module.exports = PlainEditStrategy
},
/*!***************************************************************!*\
!*** ./artifacts/transpiled/localization/globalize/number.js ***!
\***************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
__webpack_require__( /*! ./core */ 127);
var Globalize = __webpack_require__( /*! globalize */ 72);
var numberLocalization = __webpack_require__( /*! ../number */ 51);
var errors = __webpack_require__( /*! ../../core/errors */ 21);
__webpack_require__( /*! globalize/number */ 72);
if (Globalize && Globalize.formatNumber) {
var enNumbers = {
main: {
en: {
identity: {
version: {
_cldrVersion: "28",
_number: "$Revision: 11972 $"
},
language: "en"
},
numbers: {
defaultNumberingSystem: "latn",
otherNumberingSystems: {
"native": "latn"
},
minimumGroupingDigits: "1",
"symbols-numberSystem-latn": {
decimal: ".",
group: ",",
list: ";",
percentSign: "%",
plusSign: "+",
minusSign: "-",
exponential: "E",
superscriptingExponent: "\xd7",
perMille: "\u2030",
infinity: "\u221e",
nan: "NaN",
timeSeparator: ":"
},
"decimalFormats-numberSystem-latn": {
standard: "#,##0.###",
"long": {
decimalFormat: {
"1000-count-one": "0 thousand",
"1000-count-other": "0 thousand",
"10000-count-one": "00 thousand",
"10000-count-other": "00 thousand",
"100000-count-one": "000 thousand",
"100000-count-other": "000 thousand",
"1000000-count-one": "0 million",
"1000000-count-other": "0 million",
"10000000-count-one": "00 million",
"10000000-count-other": "00 million",
"100000000-count-one": "000 million",
"100000000-count-other": "000 million",
"1000000000-count-one": "0 billion",
"1000000000-count-other": "0 billion",
"10000000000-count-one": "00 billion",
"10000000000-count-other": "00 billion",
"100000000000-count-one": "000 billion",
"100000000000-count-other": "000 billion",
"1000000000000-count-one": "0 trillion",
"1000000000000-count-other": "0 trillion",
"10000000000000-count-one": "00 trillion",
"10000000000000-count-other": "00 trillion",
"100000000000000-count-one": "000 trillion",
"100000000000000-count-other": "000 trillion"
}
},
"short": {
decimalFormat: {
"1000-count-one": "0K",
"1000-count-other": "0K",
"10000-count-one": "00K",
"10000-count-other": "00K",
"100000-count-one": "000K",
"100000-count-other": "000K",
"1000000-count-one": "0M",
"1000000-count-other": "0M",
"10000000-count-one": "00M",
"10000000-count-other": "00M",
"100000000-count-one": "000M",
"100000000-count-other": "000M",
"1000000000-count-one": "0B",
"1000000000-count-other": "0B",
"10000000000-count-one": "00B",
"10000000000-count-other": "00B",
"100000000000-count-one": "000B",
"100000000000-count-other": "000B",
"1000000000000-count-one": "0T",
"1000000000000-count-other": "0T",
"10000000000000-count-one": "00T",
"10000000000000-count-other": "00T",
"100000000000000-count-one": "000T",
"100000000000000-count-other": "000T"
}
}
},
"scientificFormats-numberSystem-latn": {
standard: "#E0"
},
"percentFormats-numberSystem-latn": {
standard: "#,##0%"
},
"currencyFormats-numberSystem-latn": {
currencySpacing: {
beforeCurrency: {
currencyMatch: "[:^S:]",
surroundingMatch: "[:digit:]",
insertBetween: "\xa0"
},
afterCurrency: {
currencyMatch: "[:^S:]",
surroundingMatch: "[:digit:]",
insertBetween: "\xa0"
}
},
standard: "\xa4#,##0.00",
accounting: "\xa4#,##0.00;(\xa4#,##0.00)",
"short": {
standard: {
"1000-count-one": "\xa40K",
"1000-count-other": "\xa40K",
"10000-count-one": "\xa400K",
"10000-count-other": "\xa400K",
"100000-count-one": "\xa4000K",
"100000-count-other": "\xa4000K",
"1000000-count-one": "\xa40M",
"1000000-count-other": "\xa40M",
"10000000-count-one": "\xa400M",
"10000000-count-other": "\xa400M",
"100000000-count-one": "\xa4000M",
"100000000-count-other": "\xa4000M",
"1000000000-count-one": "\xa40B",
"1000000000-count-other": "\xa40B",
"10000000000-count-one": "\xa400B",
"10000000000-count-other": "\xa400B",
"100000000000-count-one": "\xa4000B",
"100000000000-count-other": "\xa4000B",
"1000000000000-count-one": "\xa40T",
"1000000000000-count-other": "\xa40T",
"10000000000000-count-one": "\xa400T",
"10000000000000-count-other": "\xa400T",
"100000000000000-count-one": "\xa4000T",
"100000000000000-count-other": "\xa4000T"
}
},
"unitPattern-count-one": "{0} {1}",
"unitPattern-count-other": "{0} {1}"
},
"miscPatterns-numberSystem-latn": {
atLeast: "{0}+",
range: "{0}\u2013{1}"
}
}
}
}
};
if ("en" === Globalize.locale().locale) {
Globalize.load(enNumbers);
Globalize.locale("en")
}
var formattersCache = {};
var getFormatter = function(format) {
var formatter;
var formatCacheKey;
if ("object" === _typeof(format)) {
formatCacheKey = Globalize.locale().locale + ":" + JSON.stringify(format)
} else {
formatCacheKey = Globalize.locale().locale + ":" + format
}
formatter = formattersCache[formatCacheKey];
if (!formatter) {
formatter = formattersCache[formatCacheKey] = Globalize.numberFormatter(format)
}
return formatter
};
var globalizeNumberLocalization = {
_formatNumberCore: function(value, format, formatConfig) {
if ("exponential" === format) {
return this.callBase.apply(this, arguments)
}
return getFormatter(this._normalizeFormatConfig(format, formatConfig, value))(value)
},
_normalizeFormatConfig: function(format, formatConfig, value) {
var config;
if ("decimal" === format) {
config = {
minimumIntegerDigits: formatConfig.precision || 1,
useGrouping: false,
minimumFractionDigits: 0,
maximumFractionDigits: 20,
round: value < 0 ? "ceil" : "floor"
}
} else {
config = this._getPrecisionConfig(formatConfig.precision)
}
if ("percent" === format) {
config.style = "percent"
}
return config
},
_getPrecisionConfig: function(precision) {
var config;
if (null === precision) {
config = {
minimumFractionDigits: 0,
maximumFractionDigits: 20
}
} else {
config = {
minimumFractionDigits: precision || 0,
maximumFractionDigits: precision || 0
}
}
return config
},
format: function(value, _format) {
if ("number" !== typeof value) {
return value
}
_format = this._normalizeFormat(_format);
if (!_format || "function" !== typeof _format && !_format.type && !_format.formatter) {
return getFormatter(_format)(value)
}
return this.callBase.apply(this, arguments)
},
parse: function(text, format) {
if (!text) {
return
}
if (format && (format.parser || "string" === typeof format)) {
return this.callBase.apply(this, arguments)
}
if (format) {
errors.log("W0011")
}
var result = Globalize.parseNumber(text);
if (isNaN(result)) {
result = this.callBase.apply(this, arguments)
}
return result
}
};
numberLocalization.inject(globalizeNumberLocalization)
}
},
/*!*********************************************************************************!*\
!*** ./artifacts/transpiled/ui/text_box/texteditor_button_collection/button.js ***!
\*********************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, descriptor.key, descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
var TextEditorButton = function() {
function TextEditorButton(name, editor, options) {
_classCallCheck(this, TextEditorButton);
this.instance = null;
this.$container = null;
this.$placeMarker = null;
this.editor = editor;
this.name = name;
this.options = options || {}
}
_createClass(TextEditorButton, [{
key: "_addPlaceMarker",
value: function($container) {
this.$placeMarker = (0, _renderer2.default)("
").appendTo($container)
}
}, {
key: "_addToContainer",
value: function($element) {
var $placeMarker = this.$placeMarker,
$container = this.$container;
$placeMarker ? $placeMarker.replaceWith($element) : $element.appendTo($container)
}
}, {
key: "_attachEvents",
value: function() {
throw "Not implemented"
}
}, {
key: "_create",
value: function() {
throw "Not implemented"
}
}, {
key: "_isRendered",
value: function() {
return !!this.instance
}
}, {
key: "_isVisible",
value: function() {
var editor = this.editor,
options = this.options;
return options.visible || !editor.option("readOnly")
}
}, {
key: "_isDisabled",
value: function() {
throw "Not implemented"
}
}, {
key: "_shouldRender",
value: function() {
return this._isVisible() && !this._isRendered()
}
}, {
key: "dispose",
value: function() {
var instance = this.instance,
$placeMarker = this.$placeMarker;
if (instance) {
instance.dispose ? instance.dispose() : instance.remove();
this.instance = null
}
$placeMarker && $placeMarker.remove()
}
}, {
key: "render",
value: function() {
var $container = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.$container;
this.$container = $container;
if (this._isVisible()) {
var _this$_create = this._create(),
instance = _this$_create.instance,
$element = _this$_create.$element;
this.instance = instance;
this._attachEvents(instance, $element)
} else {
this._addPlaceMarker($container)
}
}
}, {
key: "update",
value: function() {
if (this._shouldRender()) {
this.render()
}
return !!this.instance
}
}]);
return TextEditorButton
}();
exports.default = TextEditorButton
},
/*!*********************************************************************!*\
!*** ./artifacts/transpiled/ui/scroll_view/ui.scrollable.native.js ***!
\*********************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _events_engine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _utils = __webpack_require__( /*! ../../events/utils */ 8);
var _utils2 = _interopRequireDefault(_utils);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var _devices = __webpack_require__( /*! ../../core/devices */ 16);
var _devices2 = _interopRequireDefault(_devices);
var _class = __webpack_require__( /*! ../../core/class */ 15);
var _class2 = _interopRequireDefault(_class);
var _ui = __webpack_require__( /*! ./ui.scrollbar */ 299);
var _ui2 = _interopRequireDefault(_ui);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var SCROLLABLE_NATIVE = "dxNativeScrollable";
var SCROLLABLE_NATIVE_CLASS = "dx-scrollable-native";
var SCROLLABLE_SCROLLBAR_SIMULATED = "dx-scrollable-scrollbar-simulated";
var SCROLLABLE_SCROLLBARS_HIDDEN = "dx-scrollable-scrollbars-hidden";
var VERTICAL = "vertical";
var HORIZONTAL = "horizontal";
var HIDE_SCROLLBAR_TIMEOUT = 500;
var NativeStrategy = _class2.default.inherit({
ctor: function(scrollable) {
this._init(scrollable)
},
_init: function(scrollable) {
this._component = scrollable;
this._$element = scrollable.$element();
this._$container = scrollable._$container;
this._$content = scrollable._$content;
this._direction = scrollable.option("direction");
this._useSimulatedScrollbar = scrollable.option("useSimulatedScrollbar");
this._showScrollbar = scrollable.option("showScrollbar");
this.option = scrollable.option.bind(scrollable);
this._createActionByOption = scrollable._createActionByOption.bind(scrollable);
this._isLocked = scrollable._isLocked.bind(scrollable);
this._isDirection = scrollable._isDirection.bind(scrollable);
this._allowedDirection = scrollable._allowedDirection.bind(scrollable)
},
render: function() {
this._renderPushBackOffset();
var device = _devices2.default.real();
var deviceType = device.platform;
this._$element.addClass(SCROLLABLE_NATIVE_CLASS).addClass(SCROLLABLE_NATIVE_CLASS + "-" + deviceType).toggleClass(SCROLLABLE_SCROLLBARS_HIDDEN, !this._showScrollbar);
if (this._showScrollbar && this._useSimulatedScrollbar) {
this._renderScrollbars()
}
},
updateBounds: _common.noop,
_renderPushBackOffset: function() {
var pushBackValue = this.option("pushBackValue");
if (!pushBackValue && !this._component._lastPushBackValue) {
return
}
this._$content.css({
paddingTop: pushBackValue,
paddingBottom: pushBackValue
});
this._component._lastPushBackValue = pushBackValue
},
_renderScrollbars: function() {
this._scrollbars = {};
this._hideScrollbarTimeout = 0;
this._$element.addClass(SCROLLABLE_SCROLLBAR_SIMULATED);
this._renderScrollbar(VERTICAL);
this._renderScrollbar(HORIZONTAL)
},
_renderScrollbar: function(direction) {
if (!this._isDirection(direction)) {
return
}
this._scrollbars[direction] = new _ui2.default((0, _renderer2.default)("
").appendTo(this._$element), {
direction: direction,
expandable: this._component.option("scrollByThumb")
})
},
handleInit: _common.noop,
handleStart: function() {
this._disablePushBack = true
},
handleMove: function(e) {
if (this._isLocked()) {
e.cancel = true;
return
}
if (this._allowedDirection()) {
e.originalEvent.isScrollingEvent = true
}
},
handleEnd: function() {
this._disablePushBack = false
},
handleCancel: _common.noop,
handleStop: _common.noop,
_eachScrollbar: function(callback) {
callback = callback.bind(this);
(0, _iterator.each)(this._scrollbars || {}, function(direction, scrollbar) {
callback(scrollbar, direction)
})
},
createActions: function() {
this._scrollAction = this._createActionByOption("onScroll");
this._updateAction = this._createActionByOption("onUpdated")
},
_createActionArgs: function() {
var location = this.location();
var containerElement = this._$container.get(0);
return {
event: this._eventForUserAction,
scrollOffset: {
top: -location.top,
left: -location.left
},
reachedLeft: this._isDirection(HORIZONTAL) ? location.left >= 0 : void 0,
reachedRight: this._isDirection(HORIZONTAL) ? Math.abs(location.left) >= containerElement.scrollWidth - containerElement.clientWidth : void 0,
reachedTop: this._isDirection(VERTICAL) ? location.top >= 0 : void 0,
reachedBottom: this._isDirection(VERTICAL) ? Math.abs(location.top) >= containerElement.scrollHeight - containerElement.clientHeight - 2 * this.option("pushBackValue") : void 0
}
},
handleScroll: function(e) {
if (!this._isScrollLocationChanged()) {
e.stopImmediatePropagation();
return
}
this._eventForUserAction = e;
this._moveScrollbars();
this._scrollAction(this._createActionArgs());
this._lastLocation = this.location();
this._pushBackFromBoundary()
},
_pushBackFromBoundary: function() {
var pushBackValue = this.option("pushBackValue");
if (!pushBackValue || this._disablePushBack) {
return
}
var scrollOffset = this._containerSize.height - this._contentSize.height;
var scrollTopPos = this._$container.scrollTop();
var scrollBottomPos = scrollOffset + scrollTopPos - 2 * pushBackValue;
if (!scrollTopPos) {
this._$container.scrollTop(pushBackValue)
} else {
if (!scrollBottomPos) {
this._$container.scrollTop(pushBackValue - scrollOffset)
}
}
},
_isScrollLocationChanged: function() {
var currentLocation = this.location();
var lastLocation = this._lastLocation || {};
var isTopChanged = lastLocation.top !== currentLocation.top;
var isLeftChanged = lastLocation.left !== currentLocation.left;
return isTopChanged || isLeftChanged
},
_moveScrollbars: function() {
this._eachScrollbar(function(scrollbar) {
scrollbar.moveTo(this.location());
scrollbar.option("visible", true)
});
this._hideScrollbars()
},
_hideScrollbars: function() {
clearTimeout(this._hideScrollbarTimeout);
this._hideScrollbarTimeout = setTimeout(function() {
this._eachScrollbar(function(scrollbar) {
scrollbar.option("visible", false)
})
}.bind(this), HIDE_SCROLLBAR_TIMEOUT)
},
location: function() {
return {
left: -this._$container.scrollLeft(),
top: this.option("pushBackValue") - this._$container.scrollTop()
}
},
disabledChanged: _common.noop,
update: function() {
this._update();
this._updateAction(this._createActionArgs())
},
_update: function() {
this._updateDimensions();
this._updateScrollbars()
},
_updateDimensions: function() {
this._containerSize = {
height: this._$container.height(),
width: this._$container.width()
};
this._componentContentSize = {
height: this._component.$content().height(),
width: this._component.$content().width()
};
this._contentSize = {
height: this._$content.height(),
width: this._$content.width()
};
this._pushBackFromBoundary()
},
_updateScrollbars: function() {
this._eachScrollbar(function(scrollbar, direction) {
var dimension = direction === VERTICAL ? "height" : "width";
scrollbar.option({
containerSize: this._containerSize[dimension],
contentSize: this._componentContentSize[dimension]
});
scrollbar.update()
})
},
_allowedDirections: function() {
return {
vertical: this._isDirection(VERTICAL) && this._contentSize.height > this._containerSize.height,
horizontal: this._isDirection(HORIZONTAL) && this._contentSize.width > this._containerSize.width
}
},
dispose: function() {
var className = this._$element.get(0).className;
var scrollableNativeRegexp = new RegExp(SCROLLABLE_NATIVE_CLASS + "\\S*", "g");
if (scrollableNativeRegexp.test(className)) {
this._$element.removeClass(className.match(scrollableNativeRegexp).join(" "))
}
_events_engine2.default.off(this._$element, "." + SCROLLABLE_NATIVE);
_events_engine2.default.off(this._$container, "." + SCROLLABLE_NATIVE);
this._removeScrollbars();
clearTimeout(this._hideScrollbarTimeout)
},
_removeScrollbars: function() {
this._eachScrollbar(function(scrollbar) {
scrollbar.$element().remove()
})
},
scrollBy: function(distance) {
var location = this.location();
this._$container.scrollTop(Math.round(-location.top - distance.top + this.option("pushBackValue")));
this._$container.scrollLeft(Math.round(-location.left - distance.left))
},
validate: function(e) {
if (this.option("disabled")) {
return false
}
if (_utils2.default.isDxMouseWheelEvent(e) && this._isScrolledInMaxDirection(e)) {
return false
}
return !!this._allowedDirection()
},
_isScrolledInMaxDirection: function(e) {
var container = this._$container.get(0);
var result;
if (e.delta > 0) {
result = e.shiftKey ? !container.scrollLeft : !container.scrollTop
} else {
if (e.shiftKey) {
result = container.clientWidth + container.scrollLeft >= container.scrollWidth
} else {
result = container.clientHeight + container.scrollTop >= container.scrollHeight
}
}
return result
},
getDirection: function() {
return this._allowedDirection()
},
verticalOffset: function() {
return this.option("pushBackValue")
}
});
module.exports = NativeStrategy
},
/*!***********************************************!*\
!*** ./artifacts/transpiled/ui/load_panel.js ***!
\***********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var noop = __webpack_require__( /*! ../core/utils/common */ 4).noop;
var messageLocalization = __webpack_require__( /*! ../localization/message */ 13);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var LoadIndicator = __webpack_require__( /*! ./load_indicator */ 90);
var Overlay = __webpack_require__( /*! ./overlay */ 59);
var Deferred = __webpack_require__( /*! ../core/utils/deferred */ 6).Deferred;
var themes = __webpack_require__( /*! ./themes */ 30);
var LOADPANEL_CLASS = "dx-loadpanel";
var LOADPANEL_WRAPPER_CLASS = "dx-loadpanel-wrapper";
var LOADPANEL_INDICATOR_CLASS = "dx-loadpanel-indicator";
var LOADPANEL_MESSAGE_CLASS = "dx-loadpanel-message";
var LOADPANEL_CONTENT_CLASS = "dx-loadpanel-content";
var LOADPANEL_CONTENT_WRAPPER_CLASS = "dx-loadpanel-content-wrapper";
var LOADPANEL_PANE_HIDDEN_CLASS = "dx-loadpanel-pane-hidden";
var LoadPanel = Overlay.inherit({
_supportedKeys: function() {
return extend(this.callBase(), {
escape: noop
})
},
_getDefaultOptions: function() {
return extend(this.callBase(), {
message: messageLocalization.format("Loading"),
width: 222,
height: 90,
animation: null,
showIndicator: true,
indicatorSrc: "",
showPane: true,
delay: 0,
closeOnBackButton: false,
resizeEnabled: false,
focusStateEnabled: false
})
},
_defaultOptionsRules: function() {
return this.callBase().concat([{
device: {
platform: "generic"
},
options: {
shadingColor: "transparent"
}
}, {
device: function() {
return themes.isMaterial()
},
options: {
message: "",
width: 60,
height: 60,
maxHeight: 60,
maxWidth: 60
}
}])
},
_init: function() {
this.callBase.apply(this, arguments)
},
_initOptions: function() {
this.callBase.apply(this, arguments);
this.option("templatesRenderAsynchronously", false)
},
_render: function() {
this.callBase();
this.$element().addClass(LOADPANEL_CLASS);
this._wrapper().addClass(LOADPANEL_WRAPPER_CLASS)
},
_renderContentImpl: function() {
this.callBase();
this.$content().addClass(LOADPANEL_CONTENT_CLASS);
this._$contentWrapper = $("
").addClass(LOADPANEL_CONTENT_WRAPPER_CLASS);
this._$contentWrapper.appendTo(this._$content);
this._togglePaneVisible();
this._cleanPreviousContent();
this._renderLoadIndicator();
this._renderMessage()
},
_show: function() {
var delay = this.option("delay");
if (!delay) {
return this.callBase()
}
var deferred = new Deferred;
var callBase = this.callBase.bind(this);
this._clearShowTimeout();
this._showTimeout = setTimeout(function() {
callBase().done(function() {
deferred.resolve()
})
}, delay);
return deferred.promise()
},
_hide: function() {
this._clearShowTimeout();
return this.callBase()
},
_clearShowTimeout: function() {
clearTimeout(this._showTimeout)
},
_renderMessage: function() {
if (!this._$contentWrapper) {
return
}
var message = this.option("message");
if (!message) {
return
}
var $message = $("
").addClass(LOADPANEL_MESSAGE_CLASS).text(message);
this._$contentWrapper.append($message)
},
_renderLoadIndicator: function() {
if (!this._$contentWrapper || !this.option("showIndicator")) {
return
}
this._$indicator = $("
").addClass(LOADPANEL_INDICATOR_CLASS).appendTo(this._$contentWrapper);
this._createComponent(this._$indicator, LoadIndicator, {
indicatorSrc: this.option("indicatorSrc")
})
},
_cleanPreviousContent: function() {
this.$content().find("." + LOADPANEL_MESSAGE_CLASS).remove();
this.$content().find("." + LOADPANEL_INDICATOR_CLASS).remove()
},
_togglePaneVisible: function() {
this.$content().toggleClass(LOADPANEL_PANE_HIDDEN_CLASS, !this.option("showPane"))
},
_optionChanged: function(args) {
switch (args.name) {
case "delay":
break;
case "message":
case "showIndicator":
this._cleanPreviousContent();
this._renderLoadIndicator();
this._renderMessage();
break;
case "showPane":
this._togglePaneVisible();
break;
case "indicatorSrc":
if (this._$indicator) {
this._createComponent(this._$indicator, LoadIndicator, {
indicatorSrc: this.option("indicatorSrc")
})
}
break;
default:
this.callBase(args)
}
},
_dispose: function() {
this._clearShowTimeout();
this.callBase()
}
});
registerComponent("dxLoadPanel", LoadPanel);
module.exports = LoadPanel
},
/*!********************************************************************************!*\
!*** ./artifacts/transpiled/ui/collection/ui.collection_widget.live_update.js ***!
\********************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _uiCollection_widget = __webpack_require__( /*! ./ui.collection_widget.edit */ 53);
var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _array_utils = __webpack_require__( /*! ../../data/array_utils */ 135);
var _array_utils2 = _interopRequireDefault(_array_utils);
var _utils = __webpack_require__( /*! ../../data/utils */ 41);
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
var _array_compare = __webpack_require__( /*! ../../core/utils/array_compare */ 302);
var _dom_adapter = __webpack_require__( /*! ../../core/dom_adapter */ 11);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
})
} else {
obj[key] = value
}
return obj
}
var PRIVATE_KEY_FIELD = "__dx_key__";
exports.default = _uiCollection_widget2.default.inherit({
_getDefaultOptions: function() {
return (0, _extend.extend)(this.callBase(), {
repaintChangesOnly: false
})
},
ctor: function() {
var _this = this;
this.callBase.apply(this, arguments);
this._customizeStoreLoadOptions = function(e) {
var dataSource = _this._dataSource;
if (dataSource && !dataSource.isLoaded()) {
_this._correctionIndex = 0
}
if (_this._correctionIndex && e.storeLoadOptions) {
e.storeLoadOptions.skip += _this._correctionIndex
}
}, this._dataSource && this._dataSource.on("customizeStoreLoadOptions", this._customizeStoreLoadOptions)
},
reload: function() {
this._correctionIndex = 0
},
_init: function() {
this.callBase();
this._refreshItemsCache();
this._correctionIndex = 0
},
_findItemElementByKey: function(key) {
var _this2 = this;
var result = (0, _renderer2.default)();
var keyExpr = this.key();
this.itemElements().each(function(_, item) {
var $item = (0, _renderer2.default)(item);
var itemData = _this2._getItemData($item);
if (keyExpr ? (0, _utils.keysEqual)(keyExpr, _this2.keyOf(itemData), key) : _this2._isItemEquals(itemData, key)) {
result = $item;
return false
}
});
return result
},
_dataSourceChangedHandler: function(newItems, e) {
e && e.changes ? this._modifyByChanges(e.changes) : this.callBase(newItems, e)
},
_isItemEquals: function(item1, item2) {
if (item1 && item1[PRIVATE_KEY_FIELD]) {
item1 = item1.data
}
try {
return JSON.stringify(item1) === JSON.stringify(item2)
} catch (e) {
return item1 === item2
}
},
_partialRefresh: function() {
var _this3 = this;
if (this.option("repaintChangesOnly")) {
var keyOf = function(data) {
if (data && void 0 !== data[PRIVATE_KEY_FIELD]) {
return data[PRIVATE_KEY_FIELD]
}
return _this3.keyOf(data)
};
var result = (0, _array_compare.findChanges)(this._itemsCache, this._editStrategy.itemsGetter(), keyOf, this._isItemEquals);
if (result && this._itemsCache.length) {
this._modifyByChanges(result, true);
this._renderEmptyMessage();
return true
} else {
this._refreshItemsCache()
}
}
return false
},
_refreshItemsCache: function() {
if (this.option("repaintChangesOnly")) {
var items = this._editStrategy.itemsGetter();
try {
this._itemsCache = (0, _extend.extend)(true, [], items);
if (!this.key()) {
this._itemsCache = this._itemsCache.map(function(itemCache, index) {
var _ref;
return _ref = {}, _defineProperty(_ref, PRIVATE_KEY_FIELD, items[index]), _defineProperty(_ref, "data", itemCache), _ref
})
}
} catch (e) {
this._itemsCache = (0, _extend.extend)([], items)
}
}
},
_dispose: function() {
this._dataSource && this._dataSource.off("customizeStoreLoadOptions", this._customizeStoreLoadOptions);
this.callBase()
},
_updateByChange: function(keyInfo, items, change, isPartialRefresh) {
var _this4 = this;
if (isPartialRefresh) {
this._renderItem(change.index, change.data, null, this._findItemElementByKey(change.key))
} else {
var changedItem = items[_array_utils2.default.indexByKey(keyInfo, items, change.key)];
if (changedItem) {
_array_utils2.default.update(keyInfo, items, change.key, change.data).done(function() {
_this4._renderItem(items.indexOf(changedItem), changedItem, null, _this4._findItemElementByKey(change.key))
})
}
}
},
_insertByChange: function(keyInfo, items, change, isPartialRefresh) {
var _this5 = this;
(0, _deferred.when)(isPartialRefresh || _array_utils2.default.insert(keyInfo, items, change.data, change.index)).done(function() {
_this5._beforeItemElementInserted(change);
_this5._renderItem((0, _type.isDefined)(change.index) ? change.index : items.length, change.data);
_this5._afterItemElementInserted();
_this5._correctionIndex++
})
},
_updateSelectionAfterRemoveByChange: function(removeIndex) {
var selectedIndex = this.option("selectedIndex");
if (selectedIndex > removeIndex) {
this.option("selectedIndex", selectedIndex - 1)
} else {
if (selectedIndex === removeIndex && 1 === this.option("selectedItems").length) {
this.option("selectedItems", [])
} else {
this._normalizeSelectedItems()
}
}
},
_beforeItemElementInserted: function(change) {
var selectedIndex = this.option("selectedIndex");
if (change.index <= selectedIndex) {
this.option("selectedIndex", selectedIndex + 1)
}
},
_afterItemElementInserted: _common.noop,
_removeByChange: function(keyInfo, items, change, isPartialRefresh) {
var _this6 = this;
var index = isPartialRefresh ? change.index : _array_utils2.default.indexByKey(keyInfo, items, change.key);
var removedItem = isPartialRefresh ? change.oldItem : items[index];
if (removedItem) {
var $removedItemElement = this._findItemElementByKey(change.key);
var deletedActionArgs = this._extendActionArgs($removedItemElement);
this._waitDeletingPrepare($removedItemElement).done(function() {
if (isPartialRefresh) {
_this6._updateIndicesAfterIndex(index - 1);
_this6._afterItemElementDeleted($removedItemElement, deletedActionArgs);
_this6._updateSelectionAfterRemoveByChange(index)
} else {
_this6._deleteItemElementByIndex(index);
_this6._afterItemElementDeleted($removedItemElement, deletedActionArgs)
}
});
this._correctionIndex--
}
},
_modifyByChanges: function(changes, isPartialRefresh) {
var _this7 = this;
var items = this._editStrategy.itemsGetter();
var keyInfo = {
key: this.key.bind(this),
keyOf: this.keyOf.bind(this)
};
var dataSource = this._dataSource;
var paginate = dataSource && dataSource.paginate();
var group = dataSource && dataSource.group();
if (paginate || group) {
changes = changes.filter(function(item) {
return "insert" !== item.type || void 0 !== item.index
})
}
changes.forEach(function(change) {
return _this7["_".concat(change.type, "ByChange")](keyInfo, items, change, isPartialRefresh)
});
this._renderedItemsCount = items.length;
this._refreshItemsCache();
this._fireContentReadyAction()
},
_appendItemToContainer: function($container, $itemFrame, index) {
var nextSiblingElement = $container.children(this._itemSelector()).get(index);
(0, _dom_adapter.insertElement)($container.get(0), $itemFrame.get(0), nextSiblingElement)
},
_optionChanged: function(args) {
switch (args.name) {
case "items":
var isItemsUpdated = this._partialRefresh(args.value);
if (!isItemsUpdated) {
this.callBase(args)
}
break;
case "dataSource":
if (!this.option("repaintChangesOnly") || !args.value) {
this.option("items", [])
}
this.callBase(args);
break;
case "repaintChangesOnly":
break;
default:
this.callBase(args)
}
}
})
},
/*!****************************************!*\
!*** ./artifacts/transpiled/ui/box.js ***!
\****************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
function _typeof(obj) {
"@babel/helpers - typeof";
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
return typeof obj
} : function(obj) {
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj
}, _typeof(obj)
}
var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
var _component_registrator2 = _interopRequireDefault(_component_registrator);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
var _common = __webpack_require__( /*! ../core/utils/common */ 4);
var _window = __webpack_require__( /*! ../core/utils/window */ 7);
var _window2 = _interopRequireDefault(_window);
var _inflector = __webpack_require__( /*! ../core/utils/inflector */ 33);
var _inflector2 = _interopRequireDefault(_inflector);
var _type = __webpack_require__( /*! ../core/utils/type */ 1);
var _style = __webpack_require__( /*! ../core/utils/style */ 85);
var _style2 = _interopRequireDefault(_style);
var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
var _browser = __webpack_require__( /*! ../core/utils/browser */ 25);
var _browser2 = _interopRequireDefault(_browser);
var _item = __webpack_require__( /*! ./collection/item */ 126);
var _item2 = _interopRequireDefault(_item);
var _devices = __webpack_require__( /*! ../core/devices */ 16);
var _devices2 = _interopRequireDefault(_devices);
var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.edit */ 53);
var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, descriptor.key, descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
function _get() {
if ("undefined" !== typeof Reflect && Reflect.get) {
_get = Reflect.get.bind()
} else {
_get = function(target, property, receiver) {
var base = _superPropBase(target, property);
if (!base) {
return
}
var desc = Object.getOwnPropertyDescriptor(base, property);
if (desc.get) {
return desc.get.call(arguments.length < 3 ? target : receiver)
}
return desc.value
}
}
return _get.apply(this, arguments)
}
function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _getPrototypeOf(object);
if (null === object) {
break
}
}
return object
}
function _inherits(subClass, superClass) {
if ("function" !== typeof superClass && null !== superClass) {
throw new TypeError("Super expression must either be null or a function")
}
subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) {
_setPrototypeOf(subClass, superClass)
}
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) {
o.__proto__ = p;
return o
};
return _setPrototypeOf(o, p)
}
function _createSuper(Derived) {
var hasNativeReflectConstruct = _isNativeReflectConstruct();
return function() {
var result, Super = _getPrototypeOf(Derived);
if (hasNativeReflectConstruct) {
var NewTarget = _getPrototypeOf(this).constructor;
result = Reflect.construct(Super, arguments, NewTarget)
} else {
result = Super.apply(this, arguments)
}
return _possibleConstructorReturn(this, result)
}
}
function _possibleConstructorReturn(self, call) {
if (call && ("object" === _typeof(call) || "function" === typeof call)) {
return call
} else {
if (void 0 !== call) {
throw new TypeError("Derived constructors may only return object or undefined")
}
}
return _assertThisInitialized(self)
}
function _assertThisInitialized(self) {
if (void 0 === self) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
}
return self
}
function _isNativeReflectConstruct() {
if ("undefined" === typeof Reflect || !Reflect.construct) {
return false
}
if (Reflect.construct.sham) {
return false
}
if ("function" === typeof Proxy) {
return true
}
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
return true
} catch (e) {
return false
}
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(o) {
return o.__proto__ || Object.getPrototypeOf(o)
};
return _getPrototypeOf(o)
}
var BOX_CLASS = "dx-box";
var BOX_SELECTOR = ".dx-box";
var BOX_ITEM_CLASS = "dx-box-item";
var BOX_ITEM_DATA_KEY = "dxBoxItemData";
var MINSIZE_MAP = {
row: "minWidth",
col: "minHeight"
};
var MAXSIZE_MAP = {
row: "maxWidth",
col: "maxHeight"
};
var SHRINK = 1;
var FLEX_JUSTIFY_CONTENT_MAP = {
start: "flex-start",
end: "flex-end",
center: "center",
"space-between": "space-between",
"space-around": "space-around"
};
var FLEX_ALIGN_ITEMS_MAP = {
start: "flex-start",
end: "flex-end",
center: "center",
stretch: "stretch"
};
var FLEX_DIRECTION_MAP = {
row: "row",
col: "column"
};
var setFlexProp = function(element, prop, value) {
value = _style2.default.normalizeStyleProp(prop, value);
element.style[_style2.default.styleProp(prop)] = value;
if (!_window2.default.hasWindow()) {
if ("" === value || !(0, _type.isDefined)(value)) {
return
}
var cssName = _inflector2.default.dasherize(prop);
var styleExpr = cssName + ": " + value + ";";
if (!element.attributes.style) {
element.setAttribute("style", styleExpr)
} else {
if (element.attributes.style.value.indexOf(styleExpr) < 0) {
element.attributes.style.value += " " + styleExpr
}
}
}
};
var BOX_EVENTNAMESPACE = "dxBox";
var UPDATE_EVENT = "dxupdate." + BOX_EVENTNAMESPACE;
var FALLBACK_BOX_ITEM = "dx-box-fallback-item";
var FALLBACK_WRAP_MAP = {
row: "nowrap",
col: "normal"
};
var FALLBACK_MAIN_SIZE_MAP = {
row: "width",
col: "height"
};
var FALLBACK_CROSS_SIZE_MAP = {
row: "height",
col: "width"
};
var FALLBACK_PRE_MARGIN_MAP = {
row: "marginLeft",
col: "marginTop"
};
var FALLBACK_POST_MARGIN_MAP = {
row: "marginRight",
col: "marginBottom"
};
var FALLBACK_CROSS_PRE_MARGIN_MAP = {
row: "marginTop",
col: "marginLeft"
};
var FALLBACK_CROSS_POST_MARGIN_MAP = {
row: "marginBottom",
col: "marginRight"
};
var MARGINS_RTL_FLIP_MAP = {
marginLeft: "marginRight",
marginRight: "marginLeft"
};
var BoxItem = function(_CollectionWidgetItem) {
_inherits(BoxItem, _CollectionWidgetItem);
var _super = _createSuper(BoxItem);
function BoxItem() {
_classCallCheck(this, BoxItem);
return _super.apply(this, arguments)
}
_createClass(BoxItem, [{
key: "_renderVisible",
value: function(value, oldValue) {
_get(_getPrototypeOf(BoxItem.prototype), "_renderVisible", this).call(this, value);
if ((0, _type.isDefined)(oldValue)) {
this._options.fireItemStateChangedAction({
name: "visible",
state: value,
oldState: oldValue
})
}
}
}]);
return BoxItem
}(_item2.default);
var FlexLayoutStrategy = function() {
function FlexLayoutStrategy($element, option) {
_classCallCheck(this, FlexLayoutStrategy);
this._$element = $element;
this._option = option;
this.initSize = _common.noop;
this.update = _common.noop
}
_createClass(FlexLayoutStrategy, [{
key: "renderBox",
value: function() {
this._$element.css({
display: _style2.default.stylePropPrefix("flexDirection") + "flex"
});
setFlexProp(this._$element.get(0), "flexDirection", FLEX_DIRECTION_MAP[this._option("direction")])
}
}, {
key: "renderAlign",
value: function() {
this._$element.css({
justifyContent: this._normalizedAlign()
})
}
}, {
key: "_normalizedAlign",
value: function() {
var align = this._option("align");
return align in FLEX_JUSTIFY_CONTENT_MAP ? FLEX_JUSTIFY_CONTENT_MAP[align] : align
}
}, {
key: "renderCrossAlign",
value: function() {
this._$element.css({
alignItems: this._normalizedCrossAlign()
})
}
}, {
key: "_normalizedCrossAlign",
value: function() {
var crossAlign = this._option("crossAlign");
return crossAlign in FLEX_ALIGN_ITEMS_MAP ? FLEX_ALIGN_ITEMS_MAP[crossAlign] : crossAlign
}
}, {
key: "renderItems",
value: function($items) {
var flexPropPrefix = _style2.default.stylePropPrefix("flexDirection");
var direction = this._option("direction");
(0, _iterator.each)($items, function() {
var $item = (0, _renderer2.default)(this);
var item = $item.data(BOX_ITEM_DATA_KEY);
$item.css({
display: flexPropPrefix + "flex"
}).css(MAXSIZE_MAP[direction], item.maxSize || "none").css(MINSIZE_MAP[direction], item.minSize || "0");
setFlexProp($item.get(0), "flexBasis", item.baseSize || 0);
setFlexProp($item.get(0), "flexGrow", item.ratio);
setFlexProp($item.get(0), "flexShrink", (0, _type.isDefined)(item.shrink) ? item.shrink : SHRINK);
$item.children().each(function(_, itemContent) {
(0, _renderer2.default)(itemContent).css({
width: "auto",
height: "auto",
display: _style2.default.stylePropPrefix("flexDirection") + "flex",
flexBasis: 0
});
setFlexProp(itemContent, "flexGrow", 1);
setFlexProp(itemContent, "flexDirection", (0, _renderer2.default)(itemContent)[0].style.flexDirection || "column")
})
})
}
}]);
return FlexLayoutStrategy
}();
var FallbackLayoutStrategy = function() {
function FallbackLayoutStrategy($element, option) {
_classCallCheck(this, FallbackLayoutStrategy);
this._$element = $element;
this._option = option
}
_createClass(FallbackLayoutStrategy, [{
key: "renderBox",
value: function() {
this._$element.css({
fontSize: 0,
whiteSpace: FALLBACK_WRAP_MAP[this._option("direction")],
verticalAlign: "top"
});
_events_engine2.default.off(this._$element, UPDATE_EVENT);
_events_engine2.default.on(this._$element, UPDATE_EVENT, this.update.bind(this))
}
}, {
key: "renderAlign",
value: function() {
var $items = this._$items;
if (!$items) {
return
}
var align = this._option("align");
var totalItemSize = this.totalItemSize;
var direction = this._option("direction");
var boxSize = this._$element[FALLBACK_MAIN_SIZE_MAP[direction]]();
var freeSpace = boxSize - totalItemSize;
var shift = 0;
this._setItemsMargins($items, direction, 0);
switch (align) {
case "start":
break;
case "end":
shift = freeSpace;
$items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift);
break;
case "center":
shift = .5 * freeSpace;
$items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift);
$items.last().css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), shift);
break;
case "space-between":
shift = .5 * freeSpace / ($items.length - 1);
this._setItemsMargins($items, direction, shift);
$items.first().css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), 0);
$items.last().css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), 0);
break;
case "space-around":
shift = .5 * freeSpace / $items.length;
this._setItemsMargins($items, direction, shift)
}
}
}, {
key: "_setItemsMargins",
value: function($items, direction, shift) {
$items.css(this._chooseMarginSide(FALLBACK_PRE_MARGIN_MAP[direction]), shift).css(this._chooseMarginSide(FALLBACK_POST_MARGIN_MAP[direction]), shift)
}
}, {
key: "renderCrossAlign",
value: function() {
var $items = this._$items;
if (!$items) {
return
}
var crossAlign = this._option("crossAlign");
var direction = this._option("direction");
var size = this._$element[FALLBACK_CROSS_SIZE_MAP[direction]]();
var that = this;
switch (crossAlign) {
case "start":
break;
case "end":
(0, _iterator.each)($items, function() {
var $item = (0, _renderer2.default)(this);
var itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]]();
var shift = size - itemSize;
$item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift)
});
break;
case "center":
(0, _iterator.each)($items, function() {
var $item = (0, _renderer2.default)(this);
var itemSize = $item[FALLBACK_CROSS_SIZE_MAP[direction]]();
var shift = .5 * (size - itemSize);
$item.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), shift).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), shift)
});
break;
case "stretch":
$items.css(that._chooseMarginSide(FALLBACK_CROSS_PRE_MARGIN_MAP[direction]), 0).css(that._chooseMarginSide(FALLBACK_CROSS_POST_MARGIN_MAP[direction]), 0).css(FALLBACK_CROSS_SIZE_MAP[direction], "100%")
}
}
}, {
key: "_chooseMarginSide",
value: function(value) {
if (!this._option("rtlEnabled")) {
return value
}
return MARGINS_RTL_FLIP_MAP[value] || value
}
}, {
key: "renderItems",
value: function($items) {
var _this = this;
this._$items = $items;
var direction = this._option("direction");
var totalRatio = 0;
var totalWeightedShrink = 0;
var totalBaseSize = 0;
(0, _iterator.each)($items, function(_, item) {
var $item = (0, _renderer2.default)(item);
$item.css({
display: "inline-block",
verticalAlign: "top"
});
$item[FALLBACK_MAIN_SIZE_MAP[direction]]("auto");
$item.removeClass(FALLBACK_BOX_ITEM);
var itemData = $item.data(BOX_ITEM_DATA_KEY);
var ratio = itemData.ratio || 0;
var size = _this._baseSize($item);
var shrink = (0, _type.isDefined)(itemData.shrink) ? itemData.shrink : SHRINK;
totalRatio += ratio;
totalWeightedShrink += shrink * size;
totalBaseSize += size
});
var freeSpaceSize = this._boxSize() - totalBaseSize;
var itemSize = function($item) {
var itemData = $item.data(BOX_ITEM_DATA_KEY);
var size = _this._baseSize($item);
var factor = freeSpaceSize >= 0 ? itemData.ratio || 0 : ((0, _type.isDefined)(itemData.shrink) ? itemData.shrink : SHRINK) * size;
var totalFactor = freeSpaceSize >= 0 ? totalRatio : totalWeightedShrink;
var shift = totalFactor ? Math.round(freeSpaceSize * factor / totalFactor) : 0;
return size + shift
};
var totalItemSize = 0;
(0, _iterator.each)($items, function(_, item) {
var $item = (0, _renderer2.default)(item);
var itemData = (0, _renderer2.default)(item).data(BOX_ITEM_DATA_KEY);
var size = itemSize($item);
totalItemSize += size;
$item.css(MAXSIZE_MAP[direction], itemData.maxSize || "none").css(MINSIZE_MAP[direction], itemData.minSize || "0").css(FALLBACK_MAIN_SIZE_MAP[direction], size);
$item.addClass(FALLBACK_BOX_ITEM)
});
this.totalItemSize = totalItemSize
}
}, {
key: "_baseSize",
value: function(item) {
var itemData = (0, _renderer2.default)(item).data(BOX_ITEM_DATA_KEY);
return null == itemData.baseSize ? 0 : "auto" === itemData.baseSize ? this._contentSize(item) : this._parseSize(itemData.baseSize)
}
}, {
key: "_contentSize",
value: function(item) {
return (0, _renderer2.default)(item)[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]()
}
}, {
key: "_parseSize",
value: function(size) {
return String(size).match(/.+%$/) ? .01 * parseFloat(size) * this._boxSizeValue : size
}
}, {
key: "_boxSize",
value: function(value) {
if (!arguments.length) {
this._boxSizeValue = this._boxSizeValue || this._totalBaseSize();
return this._boxSizeValue
}
this._boxSizeValue = value
}
}, {
key: "_totalBaseSize",
value: function() {
var _this2 = this;
var result = 0;
(0, _iterator.each)(this._$items, function(_, item) {
result += _this2._baseSize(item)
});
return result
}
}, {
key: "initSize",
value: function() {
this._boxSize(this._$element[FALLBACK_MAIN_SIZE_MAP[this._option("direction")]]())
}
}, {
key: "update",
value: function() {
if (!this._$items || this._$element.is(":hidden")) {
return
}
this._$items.detach();
this.initSize();
this._$element.append(this._$items);
this.renderItems(this._$items);
this.renderAlign();
this.renderCrossAlign();
var element = this._$element.get(0);
this._$items.find(BOX_SELECTOR).each(function() {
if (element === (0, _renderer2.default)(this).parent().closest(BOX_SELECTOR).get(0)) {
_events_engine2.default.triggerHandler(this, UPDATE_EVENT)
}
})
}
}]);
return FallbackLayoutStrategy
}();
var Box = function(_CollectionWidget) {
_inherits(Box, _CollectionWidget);
var _super2 = _createSuper(Box);
function Box() {
_classCallCheck(this, Box);
return _super2.apply(this, arguments)
}
_createClass(Box, [{
key: "_getDefaultOptions",
value: function() {
return (0, _extend.extend)(_get(_getPrototypeOf(Box.prototype), "_getDefaultOptions", this).call(this), {
direction: "row",
align: "start",
crossAlign: "stretch",
activeStateEnabled: false,
focusStateEnabled: false,
onItemStateChanged: void 0,
_layoutStrategy: "flex",
_queue: void 0
})
}
}, {
key: "_defaultOptionsRules",
value: function() {
return _get(_getPrototypeOf(Box.prototype), "_defaultOptionsRules", this).call(this).concat([{
device: function device() {
var device = _devices2.default.real();
var isOldAndroid = "android" === device.platform && (device.version[0] < 4 || 4 === device.version[0] && device.version[1] < 4);
var isOldIos = "ios" === device.platform && device.version[0] < 7;
return "win" === device.platform || _browser2.default.msie || isOldAndroid || isOldIos
},
options: {
_layoutStrategy: "fallback"
}
}])
}
}, {
key: "_itemClass",
value: function() {
return BOX_ITEM_CLASS
}
}, {
key: "_itemDataKey",
value: function() {
return BOX_ITEM_DATA_KEY
}
}, {
key: "_itemElements",
value: function() {
return this._itemContainer().children(this._itemSelector())
}
}, {
key: "_init",
value: function() {
_get(_getPrototypeOf(Box.prototype), "_init", this).call(this);
this.$element().addClass("".concat(BOX_CLASS, "-").concat(this.option("_layoutStrategy")));
this._initLayout();
this._initBoxQueue()
}
}, {
key: "_initLayout",
value: function() {
this._layout = "fallback" === this.option("_layoutStrategy") ? new FallbackLayoutStrategy(this.$element(), this.option.bind(this)) : new FlexLayoutStrategy(this.$element(), this.option.bind(this))
}
}, {
key: "_initBoxQueue",
value: function() {
this._queue = this.option("_queue") || []
}
}, {
key: "_queueIsNotEmpty",
value: function() {
return this.option("_queue") ? false : !!this._queue.length
}
}, {
key: "_pushItemToQueue",
value: function($item, config) {
this._queue.push({
$item: $item,
config: config
})
}
}, {
key: "_shiftItemFromQueue",
value: function() {
return this._queue.shift()
}
}, {
key: "_initMarkup",
value: function() {
this.$element().addClass(BOX_CLASS);
this._layout.renderBox();
_get(_getPrototypeOf(Box.prototype), "_initMarkup", this).call(this);
this._renderAlign();
this._renderActions()
}
}, {
key: "_renderActions",
value: function() {
this._onItemStateChanged = this._createActionByOption("onItemStateChanged")
}
}, {
key: "_renderAlign",
value: function() {
this._layout.renderAlign();
this._layout.renderCrossAlign()
}
}, {
key: "_renderItems",
value: function(items) {
var _this3 = this;
this._layout.initSize();
_get(_getPrototypeOf(Box.prototype), "_renderItems", this).call(this, items);
while (this._queueIsNotEmpty()) {
var item = this._shiftItemFromQueue();
this._createComponent(item.$item, Box, (0, _extend.extend)({
_layoutStrategy: this.option("_layoutStrategy"),
itemTemplate: this.option("itemTemplate"),
itemHoldTimeout: this.option("itemHoldTimeout"),
onItemHold: this.option("onItemHold"),
onItemClick: this.option("onItemClick"),
onItemContextMenu: this.option("onItemContextMenu"),
onItemRendered: this.option("onItemRendered"),
_queue: this._queue
}, item.config))
}
this._layout.renderItems(this._itemElements());
clearTimeout(this._updateTimer);
this._updateTimer = setTimeout(function() {
if (!_this3._isUpdated) {
_this3._layout.update()
}
_this3._isUpdated = false;
_this3._updateTimer = null
})
}
}, {
key: "_renderItemContent",
value: function(args) {
var $itemNode = args.itemData && args.itemData.node;
if ($itemNode) {
return this._renderItemContentByNode(args, $itemNode)
}
return _get(_getPrototypeOf(Box.prototype), "_renderItemContent", this).call(this, args)
}
}, {
key: "_postprocessRenderItem",
value: function(args) {
var boxConfig = args.itemData.box;
if (!boxConfig) {
return
}
this._pushItemToQueue(args.itemContent, boxConfig)
}
}, {
key: "_createItemByTemplate",
value: function(itemTemplate, args) {
if (args.itemData.box) {
return itemTemplate.source ? itemTemplate.source() : (0, _renderer2.default)()
}
return _get(_getPrototypeOf(Box.prototype), "_createItemByTemplate", this).call(this, itemTemplate, args)
}
}, {
key: "_visibilityChanged",
value: function(visible) {
if (visible) {
this._dimensionChanged()
}
}
}, {
key: "_dimensionChanged",
value: function() {
if (this._updateTimer) {
return
}
this._isUpdated = true;
this._layout.update()
}
}, {
key: "_dispose",
value: function() {
clearTimeout(this._updateTimer);
_get(_getPrototypeOf(Box.prototype), "_dispose", this).apply(this, arguments)
}
}, {
key: "_itemOptionChanged",
value: function(item, property, value, oldValue) {
if ("visible" === property) {
this._onItemStateChanged({
name: property,
state: value,
oldState: false !== oldValue
})
}
_get(_getPrototypeOf(Box.prototype), "_itemOptionChanged", this).call(this, item, property, value)
}
}, {
key: "_optionChanged",
value: function(args) {
switch (args.name) {
case "_layoutStrategy":
case "_queue":
case "direction":
this._invalidate();
break;
case "align":
this._layout.renderAlign();
break;
case "crossAlign":
this._layout.renderCrossAlign();
break;
default:
_get(_getPrototypeOf(Box.prototype), "_optionChanged", this).call(this, args)
}
}
}, {
key: "_itemOptions",
value: function() {
var _this4 = this;
var options = _get(_getPrototypeOf(Box.prototype), "_itemOptions", this).call(this);
options.fireItemStateChangedAction = function(e) {
_this4._onItemStateChanged(e)
};
return options
}
}, {
key: "repaint",
value: function() {
this._dimensionChanged()
}
}]);
return Box
}(_uiCollection_widget2.default);
Box.ItemClass = BoxItem;
(0, _component_registrator2.default)("dxBox", Box);
module.exports = Box
},
/*!*********************************************!*\
!*** ./artifacts/transpiled/ui/date_box.js ***!
\*********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
module.exports = __webpack_require__( /*! ./date_box/ui.date_box */ 537)
},
/*!******************************************************************!*\
!*** ./artifacts/transpiled/ui/date_box/ui.date_box.strategy.js ***!
\******************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../../core/renderer */ 2);
var eventsEngine = __webpack_require__( /*! ../../events/core/events_engine */ 5);
var noop = __webpack_require__( /*! ../../core/utils/common */ 4).noop;
var Class = __webpack_require__( /*! ../../core/class */ 15);
var dateLocalization = __webpack_require__( /*! ../../localization/date */ 32);
var abstract = Class.abstract;
var DateBoxStrategy = Class.inherit({
ctor: function(dateBox) {
this.dateBox = dateBox
},
widgetOption: function() {
return this._widget && this._widget.option.apply(this._widget, arguments)
},
_renderWidget: function(element) {
element = element || $("
");
this._widget = this._createWidget(element);
this._widget.$element().appendTo(this._getWidgetContainer())
},
_createWidget: function(element) {
var widgetName = this._getWidgetName();
var widgetOptions = this._getWidgetOptions();
return this.dateBox._createComponent(element, widgetName, widgetOptions)
},
_getWidgetOptions: abstract,
_getWidgetName: abstract,
getDefaultOptions: function() {
return {
mode: "text"
}
},
getDisplayFormat: abstract,
supportedKeys: noop,
customizeButtons: noop,
attachKeyboardEvents: function(keyboardProcessor) {
this._widgetKeyboardProcessor = keyboardProcessor.attachChildProcessor()
},
getParsedText: function(text, format) {
var value = dateLocalization.parse(text, format);
return value ? value : dateLocalization.parse(text)
},
renderInputMinMax: noop,
renderOpenedState: function() {
this._updateValue()
},
popupConfig: abstract,
renderPopupContent: function() {
var popup = this._getPopup();
this._renderWidget();
var $popupContent = popup.$content().parent();
eventsEngine.off($popupContent, "mousedown");
eventsEngine.on($popupContent, "mousedown", this._preventFocusOnPopup.bind(this))
},
getFirstPopupElement: noop,
getLastPopupElement: noop,
_preventFocusOnPopup: function(e) {
e.preventDefault()
},
_getWidgetContainer: function() {
return this._getPopup().$content()
},
_getPopup: function() {
return this.dateBox._popup
},
popupShowingHandler: noop,
popupHiddenHandler: noop,
_updateValue: function() {
this._widget && this._widget.option("value", this.dateBoxValue())
},
_valueChangedHandler: function(args) {
if (this.dateBox.option("opened") && "instantly" === this.dateBox.option("applyValueMode")) {
this.dateBoxValue(args.value)
}
},
useCurrentDateByDefault: noop,
getDefaultDate: function() {
return new Date
},
textChangedHandler: noop,
renderValue: function() {
if (this.dateBox.option("opened")) {
this._updateValue()
}
},
getValue: function() {
return this._widget.option("value")
},
isAdaptivityChanged: function() {
return false
},
dispose: function() {
var popup = this._getPopup();
if (popup) {
popup.$content().empty()
}
},
dateBoxValue: function() {
if (arguments.length) {
return this.dateBox.dateValue.apply(this.dateBox, arguments)
} else {
return this.dateBox.dateOption.apply(this.dateBox, ["value"])
}
}
});
module.exports = DateBoxStrategy
},
/*!************************************************************************!*\
!*** ./artifacts/transpiled/ui/drawer/ui.drawer.rendering.strategy.js ***!
\************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _fx = __webpack_require__( /*! ../../animation/fx */ 38);
var _fx2 = _interopRequireDefault(_fx);
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) {
descriptor.writable = true
}
Object.defineProperty(target, descriptor.key, descriptor)
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) {
_defineProperties(Constructor.prototype, protoProps)
}
if (staticProps) {
_defineProperties(Constructor, staticProps)
}
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor
}
var animation = {
moveTo: function(config) {
var $element = config.$element;
var position = config.position;
var direction = config.direction || "left";
var toConfig = {};
var animationType;
if ("right" === direction) {
toConfig.transform = "translate(" + position + "px, 0px)";
animationType = "custom"
}
if ("left" === direction) {
toConfig.left = position;
animationType = "slide"
}
if ("top" === direction || "bottom" === direction) {
toConfig.top = position;
animationType = "slide"
}
_fx2.default.animate($element, {
type: animationType,
to: toConfig,
duration: config.duration,
complete: config.complete
})
},
margin: function margin(config) {
var $element = config.$element;
var margin = config.margin;
var direction = config.direction || "left";
var toConfig = {};
toConfig["margin" + (0, _inflector.camelize)(direction, true)] = margin;
_fx2.default.animate($element, {
to: toConfig,
duration: config.duration,
complete: config.complete
})
},
fade: function($element, config, duration, completeAction) {
_fx2.default.animate($element, {
type: "fade",
to: config.to,
from: config.from,
duration: duration,
complete: completeAction
})
},
size: function size(config) {
var $element = config.$element;
var size = config.size;
var direction = config.direction || "left";
var marginTop = config.marginTop || 0;
var duration = config.duration;
var toConfig = {};
if ("right" === direction || "left" === direction) {
toConfig.width = size
} else {
toConfig.height = size
}
if ("bottom" === direction) {
toConfig.marginTop = marginTop
}
_fx2.default.animate($element, {
to: toConfig,
duration: duration,
complete: config.complete
})
},
complete: function($element) {
_fx2.default.stop($element, true)
}
};
var DrawerStrategy = function() {
function DrawerStrategy(drawer) {
_classCallCheck(this, DrawerStrategy);
this._drawer = drawer
}
_createClass(DrawerStrategy, [{
key: "getDrawerInstance",
value: function() {
return this._drawer
}
}, {
key: "renderPanel",
value: function(template, whenPanelRendered) {
template && template.render({
container: this.getDrawerInstance().content(),
onRendered: function() {
whenPanelRendered.resolve()
}
})
}
}, {
key: "renderPosition",
value: function(offset, animate) {
var drawer = this.getDrawerInstance();
var revealMode = drawer.option("revealMode");
this.prepareAnimationDeferreds(animate);
var config = this.getPositionRenderingConfig(offset);
if (this.useDefaultAnimation()) {
this.defaultPositionRendering(config, offset, animate)
} else {
if ("slide" === revealMode) {
this.slidePositionRendering(config, offset, animate)
}
if ("expand" === revealMode) {
this.expandPositionRendering(config, offset, animate)
}
}
}
}, {
key: "prepareAnimationDeferreds",
value: function(animate) {
var drawer = this.getDrawerInstance();
this._contentAnimation = new _deferred.Deferred;
this._panelAnimation = new _deferred.Deferred;
this._shaderAnimation = new _deferred.Deferred;
drawer._animations.push(this._contentAnimation, this._panelAnimation, this._shaderAnimation);
if (animate) {
_deferred.when.apply(_renderer2.default, drawer._animations).done(function() {
drawer._animationCompleteHandler()
})
} else {
drawer.resizeContent()
}
}
}, {
key: "getPositionRenderingConfig",
value: function(offset) {
var drawer = this.getDrawerInstance();
return {
direction: drawer.getDrawerPosition(),
$panel: (0, _renderer2.default)(drawer.content()),
$content: (0, _renderer2.default)(drawer.viewContent()),
defaultAnimationConfig: this._defaultAnimationConfig(),
size: this._getPanelSize(offset)
}
}
}, {
key: "useDefaultAnimation",
value: function() {
return false
}
}, {
key: "_elementsAnimationCompleteHandler",
value: function() {
this._contentAnimation.resolve();
this._panelAnimation.resolve()
}
}, {
key: "_defaultAnimationConfig",
value: function() {
var _this = this;
return {
complete: function() {
_this._elementsAnimationCompleteHandler()
}
}
}
}, {
key: "_getPanelOffset",
value: function(offset) {
var drawer = this.getDrawerInstance();
var size = drawer.isHorizontalDirection() ? drawer.getRealPanelWidth() : drawer.getRealPanelHeight();
if (offset) {
return -(size - drawer.getMaxSize())
} else {
return -(size - drawer.getMinSize())
}
}
}, {
key: "_getPanelSize",
value: function(offset) {
return offset ? this.getDrawerInstance().getMaxSize() : this.getDrawerInstance().getMinSize()
}
}, {
key: "renderShaderVisibility",
value: function(offset, animate, duration) {
var _this2 = this;
var fadeConfig = this._getFadeConfig(offset);
var drawer = this.getDrawerInstance();
if (animate) {
animation.fade((0, _renderer2.default)(drawer._$shader), fadeConfig, duration, function() {
_this2._drawer._toggleShaderVisibility(offset);
_this2._shaderAnimation.resolve()
})
} else {
drawer._toggleShaderVisibility(offset);
drawer._$shader.css("opacity", fadeConfig.to)
}
}
}, {
key: "_getFadeConfig",
value: function(offset) {
if (offset) {
return {
to: 1,
from: 0
}
} else {
return {
to: 0,
from: 1
}
}
}
}, {
key: "getPanelContent",
value: function() {
return (0, _renderer2.default)(this.getDrawerInstance().content())
}
}, {
key: "getWidth",
value: function() {
return this.getDrawerInstance().$element().get(0).getBoundingClientRect().width
}
}, {
key: "setPanelSize",
value: function(keepMaxSize) {
var drawer = this.getDrawerInstance();
var panelSize = this._getPanelSize(drawer.option("opened"));
if (drawer.isHorizontalDirection()) {
(0, _renderer2.default)(drawer.content()).width(keepMaxSize ? drawer.getRealPanelWidth() : panelSize)
} else {
(0, _renderer2.default)(drawer.content()).height(keepMaxSize ? drawer.getRealPanelHeight() : panelSize)
}
}
}, {
key: "needOrderContent",
value: function() {
return false
}
}]);
return DrawerStrategy
}();
module.exports = DrawerStrategy;
module.exports.animation = animation
},
/*!***************************************************!*\
!*** ./artifacts/transpiled/ui/drop_down_menu.js ***!
\***************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var $ = __webpack_require__( /*! ../core/renderer */ 2);
var window = __webpack_require__( /*! ../core/utils/window */ 7).getWindow();
var devices = __webpack_require__( /*! ../core/devices */ 16);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var Widget = __webpack_require__( /*! ./widget/ui.widget */ 18);
var Button = __webpack_require__( /*! ./button */ 34);
var Popover = __webpack_require__( /*! ./popover */ 137);
var DataHelperMixin = __webpack_require__( /*! ../data_helper */ 84);
var List = __webpack_require__( /*! ./list */ 100);
var themes = __webpack_require__( /*! ./themes */ 30);
var ChildDefaultTemplate = __webpack_require__( /*! ./widget/child_default_template */ 134);
var DROP_DOWN_MENU_CLASS = "dx-dropdownmenu";
var DROP_DOWN_MENU_POPUP_CLASS = "dx-dropdownmenu-popup";
var DROP_DOWN_MENU_POPUP_WRAPPER_CLASS = "dx-dropdownmenu-popup-wrapper";
var DROP_DOWN_MENU_LIST_CLASS = "dx-dropdownmenu-list";
var DROP_DOWN_MENU_BUTTON_CLASS = "dx-dropdownmenu-button";
var POPUP_OPTION_MAP = {
popupWidth: "width",
popupHeight: "height",
popupMaxHeight: "maxHeight",
popupAutoResizeEnabled: "autoResizeEnabled"
};
var BUTTON_OPTION_MAP = {
buttonIcon: "icon",
buttonText: "text",
buttonWidth: "width",
buttonHeight: "height",
buttonTemplate: "template"
};
var DropDownMenu = Widget.inherit({
_supportedKeys: function() {
var extension = {};
if (!this.option("opened") || !this._list.option("focusedElement")) {
extension = this._button._supportedKeys()
}
return extend(this.callBase(), extension, {
tab: function() {
this._popup && this._popup.hide()
}
})
},
_getDefaultOptions: function() {
return extend(this.callBase(), {
items: [],
onItemClick: null,
dataSource: null,
itemTemplate: "item",
buttonText: "",
buttonIcon: "overflow",
buttonWidth: void 0,
buttonHeight: void 0,
buttonTemplate: "content",
onButtonClick: null,
usePopover: false,
popupWidth: "auto",
popupHeight: "auto",
activeStateEnabled: true,
hoverStateEnabled: true,
opened: false,
deferRendering: false,
popupPosition: {
my: "top center",
at: "bottom center",
collision: "fit flip",
offset: {
v: 1
}
},
popupAnimation: void 0,
onItemRendered: null,
menuWidget: List,
popupMaxHeight: void 0,
closeOnClick: true,
useInkRipple: false,
container: void 0,
popupAutoResizeEnabled: false
})
},
_defaultOptionsRules: function() {
return this.callBase().concat([{
device: {
platform: "ios"
},
options: {
usePopover: true
}
}, {
device: {
platform: "generic"
},
options: {
popupPosition: {
offset: {
v: 4
}
}
}
}, {
device: function() {
return "desktop" === devices.real().deviceType && !devices.isSimulator()
},
options: {
focusStateEnabled: true
}
}, {
device: {
platform: "android"
},
options: {
popupPosition: {
my: "top " + (this.option("rtlEnabled") ? "left" : "right"),
at: "top " + (this.option("rtlEnabled") ? "left" : "right"),
collision: "flipfit"
},
popupAnimation: {
show: {
type: "pop",
duration: 200,
from: {
scale: 0
},
to: {
scale: 1
}
},
hide: {
type: "pop",
duration: 200,
from: {
scale: 1
},
to: {
scale: 0
}
}
}
}
}, {
device: function() {
return themes.isMaterial()
},
options: {
useInkRipple: true
}
}])
},
_initOptions: function(options) {
if ("android" === devices.current().platform) {
if (!options.popupPosition) {
options.popupPosition = {
at: (options.usePopover ? "bottom " : "top ") + (options.rtlEnabled ? "left" : "right")
}
}
}
this.callBase(options)
},
_dataSourceOptions: function() {
return {
paginate: false
}
},
_init: function() {
this.callBase();
this.$element().addClass(DROP_DOWN_MENU_CLASS);
this._initDataSource();
this._initItemClickAction();
this._initButtonClickAction()
},
_initItemClickAction: function() {
this._itemClickAction = this._createActionByOption("onItemClick")
},
_initButtonClickAction: function() {
this._buttonClickAction = this._createActionByOption("onButtonClick")
},
_initTemplates: function() {
this.callBase();
this._defaultTemplates.content = new ChildDefaultTemplate("content", this)
},
_initMarkup: function() {
this._renderButton();
this.callBase()
},
_render: function() {
this.callBase();
this.setAria({
role: "menubar",
haspopup: true,
expanded: this.option("opened")
})
},
_renderContentImpl: function() {
if (this.option("opened")) {
this._renderPopup()
}
},
_clean: function() {
this._cleanFocusState();
if (this._popup) {
this._popup.$element().remove();
delete this._$popup
}
},
_renderButton: function() {
var $button = this.$element().addClass(DROP_DOWN_MENU_BUTTON_CLASS);
var config = this._buttonOptions();
this._button = this._createComponent($button, Button, config)
},
_toggleActiveState: function($element, value, e) {
this._button._toggleActiveState($element, value, e)
},
_buttonOptions: function() {
return {
text: this.option("buttonText"),
icon: this.option("buttonIcon"),
width: this.option("buttonWidth"),
height: this.option("buttonHeight"),
useInkRipple: this.option("useInkRipple"),
template: this.option("buttonTemplate"),
focusStateEnabled: false,
onClick: function(e) {
this.option("opened", !this.option("opened"));
this._buttonClickAction(e)
}.bind(this)
}
},
_toggleMenuVisibility: function(opened) {
var state = void 0 === opened ? !this._popup.option("visible") : opened;
if (opened) {
this._renderPopup()
}
this._popup.toggle(state);
this.setAria("expanded", state)
},
_renderPopup: function() {
if (this._$popup) {
return
}
var $popup = this._$popup = $("
").appendTo(this.$element());
var config = this._popupOptions();
this._popup = this._createComponent($popup, Popover, config)
},
_popupOptions: function() {
var usePopup = !this.option("usePopover");
return {
onInitialized: function(args) {
args.component._wrapper().addClass(DROP_DOWN_MENU_POPUP_WRAPPER_CLASS).toggleClass(DROP_DOWN_MENU_POPUP_CLASS, usePopup)
},
visible: this.option("opened"),
deferRendering: false,
contentTemplate: function(contentElement) {
this._renderList(contentElement)
}.bind(this),
position: this.option("popupPosition"),
animation: this.option("popupAnimation"),
onOptionChanged: function(args) {
if ("visible" === args.name) {
this.option("opened", args.value)
}
}.bind(this),
target: this.$element(),
height: this.option("popupHeight"),
width: this.option("popupWidth"),
maxHeight: this.option("popupMaxHeight"),
container: this.option("container"),
autoResizeEnabled: this.option("popupAutoResizeEnabled")
}
},
_renderList: function(contentElement) {
var $content = $(contentElement);
var listConfig = this._listOptions();
$content.addClass(DROP_DOWN_MENU_LIST_CLASS);
this._list = this._createComponent($content, this.option("menuWidget"), listConfig);
this._list._getAriaTarget = function() {
return this.$element()
}.bind(this);
this._setListDataSource();
var listMaxHeight = .5 * $(window).height();
if ($content.height() > listMaxHeight) {
$content.height(listMaxHeight)
}
},
_listOptions: function() {
return {
_keyboardProcessor: this._listProcessor,
pageLoadMode: "scrollBottom",
indicateLoading: false,
noDataText: "",
itemTemplate: this.option("itemTemplate"),
onItemClick: function(e) {
if (this.option("closeOnClick")) {
this.option("opened", false)
}
this._itemClickAction(e)
}.bind(this),
tabIndex: -1,
focusStateEnabled: this.option("focusStateEnabled"),
activeStateEnabled: this.option("activeStateEnabled"),
onItemRendered: this.option("onItemRendered"),
_itemAttributes: {
role: "menuitem"
}
}
},
_setListDataSource: function() {
if (this._list) {
this._list.option("dataSource", this._dataSource || this.option("items"))
}
delete this._deferRendering
},
_attachKeyboardEvents: function() {
this.callBase.apply(this, arguments);
this._listProcessor = this._keyboardProcessor && this._keyboardProcessor.attachChildProcessor();
if (this._list) {
this._list.option("_keyboardProcessor", this._listProcessor)
}
},
_cleanFocusState: function() {
this.callBase.apply(this, arguments);
delete this._listProcessor
},
_toggleVisibility: function(visible) {
this.callBase(visible);
this._button.option("visible", visible)
},
_optionChanged: function(args) {
var name = args.name;
var value = args.value;
switch (name) {
case "items":
case "dataSource":
if (this.option("deferRendering") && !this.option("opened")) {
this._deferRendering = true
} else {
this._refreshDataSource();
this._setListDataSource()
}
break;
case "itemTemplate":
if (this._list) {
this._list.option(name, this._getTemplate(value))
}
break;
case "onItemClick":
this._initItemClickAction();
break;
case "onButtonClick":
this._buttonClickAction();
break;
case "buttonIcon":
case "buttonText":
case "buttonWidth":
case "buttonHeight":
case "buttonTemplate":
this._button.option(BUTTON_OPTION_MAP[name], value);
this._renderPopup();
break;
case "popupWidth":
case "popupHeight":
case "popupMaxHeight":
case "popupAutoResizeEnabled":
this._popup.option(POPUP_OPTION_MAP[name], value);
break;
case "usePopover":
case "menuWidget":
case "useInkRipple":
this._invalidate();
break;
case "focusStateEnabled":
case "activeStateEnabled":
if (this._list) {
this._list.option(name, value)
}
this.callBase(args);
break;
case "onItemRendered":
if (this._list) {
this._list.option(name, value)
}
break;
case "opened":
if (this._deferRendering) {
this._refreshDataSource();
this._setListDataSource()
}
this._toggleMenuVisibility(value);
break;
case "deferRendering":
case "popupPosition":
case "closeOnClick":
break;
case "container":
this._popup && this._popup.option(args.name, args.value);
break;
default:
this.callBase(args)
}
},
open: function() {
this.option("opened", true)
},
close: function() {
this.option("opened", false)
}
}).include(DataHelperMixin);
registerComponent("dxDropDownMenu", DropDownMenu);
module.exports = DropDownMenu
},
/*!**********************************************!*\
!*** ./artifacts/transpiled/ui/validator.js ***!
\**********************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var dataUtils = __webpack_require__( /*! ../core/element_data */ 39);
var Callbacks = __webpack_require__( /*! ../core/utils/callbacks */ 26);
var errors = __webpack_require__( /*! ./widget/ui.errors */ 17);
var DOMComponent = __webpack_require__( /*! ../core/dom_component */ 67);
var extend = __webpack_require__( /*! ../core/utils/extend */ 0).extend;
var map = __webpack_require__( /*! ../core/utils/iterator */ 3).map;
var ValidationMixin = __webpack_require__( /*! ./validation/validation_mixin */ 172);
var ValidationEngine = __webpack_require__( /*! ./validation_engine */ 99);
var DefaultAdapter = __webpack_require__( /*! ./validation/default_adapter */ 556);
var registerComponent = __webpack_require__( /*! ../core/component_registrator */ 9);
var VALIDATOR_CLASS = "dx-validator";
var Validator = DOMComponent.inherit({
_getDefaultOptions: function() {
return extend(this.callBase(), {
validationRules: []
})
},
_init: function() {
this.callBase();
this._initGroupRegistration();
this._skipValidation = false;
this.focused = Callbacks();
this._initAdapter()
},
_initGroupRegistration: function() {
var group = this._findGroup();
if (!this._groupWasInit) {
this.on("disposing", function(args) {
ValidationEngine.removeRegisteredValidator(args.component._validationGroup, args.component)
})
}
if (!this._groupWasInit || this._validationGroup !== group) {
ValidationEngine.removeRegisteredValidator(this._validationGroup, this);
this._groupWasInit = true;
this._validationGroup = group;
ValidationEngine.registerValidatorInGroup(group, this)
}
},
_setOptionsByReference: function() {
this.callBase();
extend(this._optionsByReference, {
validationGroup: true
})
},
_initAdapter: function() {
var that = this;
var element = that.$element()[0];
var dxStandardEditor = dataUtils.data(element, "dx-validation-target");
var adapter = that.option("adapter");
if (!adapter) {
if (dxStandardEditor) {
adapter = new DefaultAdapter(dxStandardEditor, this);
adapter.validationRequestsCallbacks.add(function(args) {
if (that._skipValidation) {
return
}
that.validate(args)
});
this.option("adapter", adapter);
return
}
throw errors.Error("E0120")
}
var callbacks = adapter.validationRequestsCallbacks;
if (callbacks) {
if (Array.isArray(callbacks)) {
callbacks.push(function(args) {
that.validate(args)
})
} else {
errors.log("W0014", "validationRequestsCallbacks", "jQuery.Callbacks", "17.2", "Use the array instead");
callbacks.add(function(args) {
that.validate(args)
})
}
}
},
_initMarkup: function() {
this.$element().addClass(VALIDATOR_CLASS);
this.callBase()
},
_toggleRTLDirection: function(isRtl) {
var _this$option$editor$o, _this$option, _this$option$editor;
var rtlEnabled = null !== (_this$option$editor$o = null === (_this$option = this.option("adapter")) || void 0 === _this$option ? void 0 : null === (_this$option$editor = _this$option.editor) || void 0 === _this$option$editor ? void 0 : _this$option$editor.option("rtlEnabled")) && void 0 !== _this$option$editor$o ? _this$option$editor$o : isRtl;
this.callBase(rtlEnabled)
},
_visibilityChanged: function(visible) {
if (visible) {
this._initGroupRegistration()
}
},
_optionChanged: function(args) {
switch (args.name) {
case "validationGroup":
this._initGroupRegistration();
return;
case "validationRules":
this._resetValidationRules();
void 0 !== this.option("isValid") && this.validate();
return;
case "adapter":
this._initAdapter();
break;
default:
this.callBase(args)
}
},
_getValidationRules: function() {
if (!this._validationRules) {
this._validationRules = map(this.option("validationRules"), function(rule) {
return extend({}, rule, {
validator: this
})
}.bind(this))
}
return this._validationRules
},
_resetValidationRules: function() {
delete this._validationRules
},
validate: function(args) {
var that = this;
var adapter = that.option("adapter");
var name = that.option("name");
var bypass = adapter.bypass && adapter.bypass();
var value = args && void 0 !== args.value ? args.value : adapter.getValue();
var currentError = adapter.getCurrentValidationError && adapter.getCurrentValidationError();
var rules = this._getValidationRules();
var result;
if (bypass) {
result = {
isValid: true
}
} else {
if (currentError && currentError.editorSpecific) {
currentError.validator = this;
result = {
isValid: false,
brokenRule: currentError
}
} else {
result = ValidationEngine.validate(value, rules, name)
}
}
this._applyValidationResult(result, adapter);
return result
},
reset: function() {
var that = this;
var adapter = that.option("adapter");
var result = {
isValid: true,
brokenRule: null
};
this._skipValidation = true;
adapter.reset();
this._skipValidation = false;
this._resetValidationRules();
this._applyValidationResult(result, adapter)
},
_applyValidationResult: function(result, adapter) {
var validatedAction = this._createActionByOption("onValidated", {
excludeValidators: ["readOnly"]
});
result.validator = this;
adapter.applyValidationResults && adapter.applyValidationResults(result);
this.option({
isValid: result.isValid
});
validatedAction(result)
},
focus: function() {
var adapter = this.option("adapter");
adapter && adapter.focus && adapter.focus()
}
}).include(ValidationMixin);
registerComponent("dxValidator", Validator);
module.exports = Validator
},
/*!*****************************************!*\
!*** ./artifacts/transpiled/ui/tabs.js ***!
\*****************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _devices = __webpack_require__( /*! ../core/devices */ 16);
var _devices2 = _interopRequireDefault(_devices);
var _component_registrator = __webpack_require__( /*! ../core/component_registrator */ 9);
var _component_registrator2 = _interopRequireDefault(_component_registrator);
var _button = __webpack_require__( /*! ./button */ 34);
var _button2 = _interopRequireDefault(_button);
var _utils = __webpack_require__( /*! ./widget/utils.ink_ripple */ 69);
var _utils2 = _interopRequireDefault(_utils);
var _utils3 = __webpack_require__( /*! ../events/utils */ 8);
var _extend = __webpack_require__( /*! ../core/utils/extend */ 0);
var _type = __webpack_require__( /*! ../core/utils/type */ 1);
var _pointer = __webpack_require__( /*! ../events/pointer */ 23);
var _pointer2 = _interopRequireDefault(_pointer);
var _iterator = __webpack_require__( /*! ../core/utils/iterator */ 3);
var _item = __webpack_require__( /*! ./tabs/item */ 314);
var _item2 = _interopRequireDefault(_item);
var _themes = __webpack_require__( /*! ./themes */ 30);
var _themes2 = _interopRequireDefault(_themes);
var _hold = __webpack_require__( /*! ../events/hold */ 88);
var _hold2 = _interopRequireDefault(_hold);
var _ui = __webpack_require__( /*! ./scroll_view/ui.scrollable */ 91);
var _ui2 = _interopRequireDefault(_ui);
var _uiCollection_widget = __webpack_require__( /*! ./collection/ui.collection_widget.live_update */ 187);
var _uiCollection_widget2 = _interopRequireDefault(_uiCollection_widget);
var _icon = __webpack_require__( /*! ../core/utils/icon */ 60);
var _bindable_template = __webpack_require__( /*! ./widget/bindable_template */ 65);
var _bindable_template2 = _interopRequireDefault(_bindable_template);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var TABS_CLASS = "dx-tabs";
var TABS_WRAPPER_CLASS = "dx-tabs-wrapper";
var TABS_EXPANDED_CLASS = "dx-tabs-expanded";
var TABS_STRETCHED_CLASS = "dx-tabs-stretched";
var TABS_SCROLLABLE_CLASS = "dx-tabs-scrollable";
var TABS_NAV_BUTTONS_CLASS = "dx-tabs-nav-buttons";
var OVERFLOW_HIDDEN_CLASS = "dx-overflow-hidden";
var TABS_ITEM_CLASS = "dx-tab";
var TABS_ITEM_SELECTED_CLASS = "dx-tab-selected";
var TABS_NAV_BUTTON_CLASS = "dx-tabs-nav-button";
var TABS_LEFT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-left";
var TABS_RIGHT_NAV_BUTTON_CLASS = "dx-tabs-nav-button-right";
var TABS_ITEM_TEXT_CLASS = "dx-tab-text";
var TABS_ITEM_DATA_KEY = "dxTabData";
var BUTTON_NEXT_ICON = "chevronnext";
var BUTTON_PREV_ICON = "chevronprev";
var FEEDBACK_HIDE_TIMEOUT = 100;
var FEEDBACK_DURATION_INTERVAL = 5;
var FEEDBACK_SCROLL_TIMEOUT = 300;
var TAB_OFFSET = 30;
var Tabs = _uiCollection_widget2.default.inherit({
_activeStateUnit: "." + TABS_ITEM_CLASS,
_getDefaultOptions: function() {
return (0, _extend.extend)(this.callBase(), {
hoverStateEnabled: true,
showNavButtons: true,
scrollByContent: true,
scrollingEnabled: true,
selectionMode: "single",
activeStateEnabled: true,
selectionRequired: false,
selectOnFocus: true,
loopItemFocus: false,
useInkRipple: false,
badgeExpr: function(data) {
return data ? data.badge : void 0
}
})
},
_defaultOptionsRules: function() {
var themeName = _themes2.default.current();
return this.callBase().concat([{
device: function() {
return "generic" !== _devices2.default.real().platform
},
options: {
showNavButtons: false
}
}, {
device: {
platform: "generic"
},
options: {
scrollByContent: false
}
}, {
device: function() {
return "desktop" === _devices2.default.real().deviceType && !_devices2.default.isSimulator()
},
options: {
focusStateEnabled: true
}
}, {
device: function() {
return _themes2.default.isMaterial(themeName)
},
options: {
useInkRipple: true,
selectOnFocus: false
}
}])
},
_init: function() {
this.callBase();
this.setAria("role", "tablist");
this.$element().addClass(TABS_CLASS);
this._renderWrapper();
this._renderMultiple();
this._feedbackHideTimeout = FEEDBACK_HIDE_TIMEOUT
},
_initTemplates: function() {
this.callBase();
this._defaultTemplates.item = new _bindable_template2.default(function($container, data) {
if ((0, _type.isPlainObject)(data)) {
this._prepareDefaultItemTemplate(data, $container)
} else {
$container.text(String(data))
}
var $iconElement = (0, _icon.getImageContainer)(data.icon);
$container.wrapInner((0, _renderer2.default)("
").addClass(TABS_ITEM_TEXT_CLASS));
$iconElement && $iconElement.prependTo($container)
}.bind(this), ["text", "html", "icon"], this.option("integrationOptions.watchMethod"))
},
_itemClass: function() {
return TABS_ITEM_CLASS
},
_selectedItemClass: function() {
return TABS_ITEM_SELECTED_CLASS
},
_itemDataKey: function() {
return TABS_ITEM_DATA_KEY
},
_initMarkup: function() {
this.callBase();
this.setAria("role", "tab", this.itemElements());
this.option("useInkRipple") && this._renderInkRipple();
this.$element().addClass(OVERFLOW_HIDDEN_CLASS)
},
_render: function() {
this.callBase();
this._renderScrolling()
},
_renderScrolling: function() {
var removeClasses = [TABS_STRETCHED_CLASS, TABS_EXPANDED_CLASS, OVERFLOW_HIDDEN_CLASS];
this.$element().removeClass(removeClasses.join(" "));
if (this.option("scrollingEnabled") && this._isItemsWidthExceeded()) {
if (!this._scrollable) {
this._renderScrollable();
this._renderNavButtons()
}
this._scrollable.update();
this._updateNavButtonsVisibility();
if (this.option("rtlEnabled")) {
this._scrollable.scrollTo({
left: this._scrollable.scrollWidth() - this._scrollable.clientWidth()
})
}
this._scrollToItem(this.option("selectedItem"))
}
if (!(this.option("scrollingEnabled") && this._isItemsWidthExceeded())) {
this._cleanScrolling();
if (this._needStretchItems() && !this._isItemsWidthExceeded()) {
this.$element().addClass(TABS_STRETCHED_CLASS)
}
this.$element().removeClass(TABS_NAV_BUTTONS_CLASS).addClass(TABS_EXPANDED_CLASS)
}
},
_isItemsWidthExceeded: function() {
var tabItemsWidth = this._getSummaryItemsWidth(this._getVisibleItems(), true);
return tabItemsWidth - 1 > this.$element().width()
},
_needStretchItems: function() {
var $visibleItems = this._getVisibleItems();
var elementWidth = this.$element().width();
var itemsWidth = [];
(0, _iterator.each)($visibleItems, function(_, item) {
itemsWidth.push((0, _renderer2.default)(item).outerWidth(true))
});
var maxTabWidth = Math.max.apply(null, itemsWidth);
return maxTabWidth > elementWidth / $visibleItems.length
},
_cleanNavButtons: function() {
if (!this._leftButton || !this._rightButton) {
return
}
this._leftButton.$element().remove();
this._rightButton.$element().remove();
this._leftButton = null;
this._rightButton = null
},
_cleanScrolling: function() {
if (!this._scrollable) {
return
}
this._$wrapper.appendTo(this.$element());
this._scrollable.$element().remove();
this._scrollable = null;
this._cleanNavButtons()
},
_renderInkRipple: function() {
this._inkRipple = _utils2.default.render()
},
_toggleActiveState: function($element, value, e) {
this.callBase.apply(this, arguments);
if (!this._inkRipple) {
return
}
var config = {
element: $element,
event: e
};
if (value) {
this._inkRipple.showWave(config)
} else {
this._inkRipple.hideWave(config)
}
},
_renderMultiple: function() {
if ("multiple" === this.option("selectionMode")) {
this.option("selectOnFocus", false)
}
},
_renderWrapper: function() {
this._$wrapper = (0, _renderer2.default)("").addClass(TABS_WRAPPER_CLASS);
this.$element().append(this._$wrapper)
},
_itemContainer: function() {
return this._$wrapper
},
_renderScrollable: function() {
var $itemContainer = this.$element().wrapInner((0, _renderer2.default)("
").addClass(TABS_SCROLLABLE_CLASS)).children();
this._scrollable = this._createComponent($itemContainer, _ui2.default, {
direction: "horizontal",
showScrollbar: false,
useKeyboard: false,
useNative: false,
scrollByContent: this.option("scrollByContent"),
onScroll: this._updateNavButtonsVisibility.bind(this)
});
this.$element().append(this._scrollable.$element())
},
_scrollToItem: function(itemData) {
if (!this._scrollable) {
return
}
var $item = this._editStrategy.getItemElement(itemData);
this._scrollable.scrollToElement($item)
},
_renderNavButtons: function() {
this.$element().toggleClass(TABS_NAV_BUTTONS_CLASS, this.option("showNavButtons"));
if (!this.option("showNavButtons")) {
return
}
var rtlEnabled = this.option("rtlEnabled");
this._leftButton = this._createNavButton(-TAB_OFFSET, rtlEnabled ? BUTTON_NEXT_ICON : BUTTON_PREV_ICON);
var $leftButton = this._leftButton.$element();
$leftButton.addClass(TABS_LEFT_NAV_BUTTON_CLASS);
this.$element().prepend($leftButton);
this._rightButton = this._createNavButton(TAB_OFFSET, rtlEnabled ? BUTTON_PREV_ICON : BUTTON_NEXT_ICON);
var $rightButton = this._rightButton.$element();
$rightButton.addClass(TABS_RIGHT_NAV_BUTTON_CLASS);
this.$element().append($rightButton)
},
_updateNavButtonsVisibility: function() {
this._leftButton && this._leftButton.option("disabled", this._scrollable.scrollLeft() <= 0);
this._rightButton && this._rightButton.option("disabled", this._scrollable.scrollLeft() >= Math.round(this._scrollable.scrollWidth() - this._scrollable.clientWidth()))
},
_updateScrollPosition: function(offset, duration) {
this._scrollable.update();
this._scrollable.scrollBy(offset / duration)
},
_createNavButton: function(offset, icon) {
var that = this;
var holdAction = that._createAction(function() {
that._holdInterval = setInterval(function() {
that._updateScrollPosition(offset, FEEDBACK_DURATION_INTERVAL)
}, FEEDBACK_DURATION_INTERVAL)
});
var holdEventName = (0, _utils3.addNamespace)(_hold2.default.name, "dxNavButton");
var pointerUpEventName = (0, _utils3.addNamespace)(_pointer2.default.up, "dxNavButton");
var pointerOutEventName = (0, _utils3.addNamespace)(_pointer2.default.out, "dxNavButton");
var navButton = this._createComponent((0, _renderer2.default)("
").addClass(TABS_NAV_BUTTON_CLASS), _button2.default, {
focusStateEnabled: false,
icon: icon,
onClick: function() {
that._updateScrollPosition(offset, 1)
},
integrationOptions: {}
});
var $navButton = navButton.$element();
_events_engine2.default.on($navButton, holdEventName, {
timeout: FEEDBACK_SCROLL_TIMEOUT
}, function(e) {
holdAction({
event: e
})
}.bind(this));
_events_engine2.default.on($navButton, pointerUpEventName, function() {
that._clearInterval()
});
_events_engine2.default.on($navButton, pointerOutEventName, function() {
that._clearInterval()
});
return navButton
},
_clearInterval: function() {
if (this._holdInterval) {
clearInterval(this._holdInterval)
}
},
_updateSelection: function(addedSelection) {
this._scrollable && this._scrollable.scrollToElement(this.itemElements().eq(addedSelection[0]), {
left: 1,
right: 1
})
},
_visibilityChanged: function(visible) {
if (visible) {
this._dimensionChanged()
}
},
_dimensionChanged: function() {
this._renderScrolling()
},
_itemSelectHandler: function(e) {
if ("single" === this.option("selectionMode") && this.isItemSelected(e.currentTarget)) {
return
}
this.callBase(e)
},
_clean: function() {
this._cleanScrolling();
this.callBase()
},
_optionChanged: function(args) {
switch (args.name) {
case "useInkRipple":
case "scrollingEnabled":
case "showNavButtons":
this._invalidate();
break;
case "scrollByContent":
this._scrollable && this._scrollable.option(args.name, args.value);
break;
case "width":
this.callBase(args);
this._dimensionChanged();
break;
case "selectionMode":
this._renderMultiple();
this.callBase(args);
break;
case "badgeExpr":
this._invalidate();
break;
default:
this.callBase(args)
}
},
_afterItemElementInserted: function() {
this.callBase();
this._renderScrolling()
},
_afterItemElementDeleted: function($item, deletedActionArgs) {
this.callBase($item, deletedActionArgs);
this._renderScrolling()
}
});
Tabs.ItemClass = _item2.default;
(0, _component_registrator2.default)("dxTabs", Tabs);
module.exports = Tabs;
module.exports.getTabsExpandedClass = TABS_EXPANDED_CLASS
},
/*!*******************************************************************************!*\
!*** ./artifacts/transpiled/ui/data_grid/ui.data_grid.data_source_adapter.js ***!
\*******************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _uiGrid_core = __webpack_require__( /*! ../grid_core/ui.grid_core.data_source_adapter */ 337);
var _uiGrid_core2 = _interopRequireDefault(_uiGrid_core);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var dataSourceAdapterType = _uiGrid_core2.default;
module.exports = {
extend: function(extender) {
dataSourceAdapterType = dataSourceAdapterType.inherit(extender)
},
create: function(component) {
return new dataSourceAdapterType(component)
}
}
},
/*!*********************************************************!*\
!*** ./artifacts/transpiled/ui/filter_builder/utils.js ***!
\*********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
var _errors = __webpack_require__( /*! ../../data/errors */ 36);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _data = __webpack_require__( /*! ../../core/utils/data */ 20);
var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17);
var _ui2 = _interopRequireDefault(_ui);
var _filtering = __webpack_require__( /*! ../shared/filtering */ 162);
var _filtering2 = _interopRequireDefault(_filtering);
var _format_helper = __webpack_require__( /*! ../../format_helper */ 64);
var _format_helper2 = _interopRequireDefault(_format_helper);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
var _inflector2 = _interopRequireDefault(_inflector);
var _between = __webpack_require__( /*! ./between */ 630);
var _between2 = _interopRequireDefault(_between);
var _message = __webpack_require__( /*! ../../localization/message */ 13);
var _message2 = _interopRequireDefault(_message);
var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45);
var _ui3 = __webpack_require__( /*! ./ui.filter_operations_dictionary */ 631);
var _ui4 = _interopRequireDefault(_ui3);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var DEFAULT_DATA_TYPE = "string";
var EMPTY_MENU_ICON = "icon-none";
var AND_GROUP_OPERATION = "and";
var EQUAL_OPERATION = "=";
var NOT_EQUAL_OPERATION = "<>";
var DATATYPE_OPERATIONS = {
number: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"],
string: ["contains", "notcontains", "startswith", "endswith", "=", "<>", "isblank", "isnotblank"],
date: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"],
datetime: ["=", "<>", "<", ">", "<=", ">=", "isblank", "isnotblank"],
"boolean": ["=", "<>", "isblank", "isnotblank"],
object: ["isblank", "isnotblank"]
};
var DEFAULT_FORMAT = {
date: "shortDate",
datetime: "shortDateShortTime"
};
var LOOKUP_OPERATIONS = ["=", "<>", "isblank", "isnotblank"];
var AVAILABLE_FIELD_PROPERTIES = ["caption", "customizeText", "dataField", "dataType", "editorTemplate", "falseText", "editorOptions", "filterOperations", "format", "lookup", "trueText", "calculateFilterExpression", "name"];
function getFormattedValueText(field, value) {
var fieldFormat = field.format || DEFAULT_FORMAT[field.dataType];
return _format_helper2.default.format(value, fieldFormat)
}
function isNegationGroup(group) {
return group && group.length > 1 && "!" === group[0] && !isCondition(group)
}
function getGroupCriteria(group) {
return isNegationGroup(group) ? group[1] : group
}
function setGroupCriteria(group, criteria) {
if (isNegationGroup(group)) {
group[1] = criteria
} else {
group = criteria
}
return group
}
function convertGroupToNewStructure(group, value) {
var isNegationValue = function(value) {
return value.indexOf("!") !== -1
};
var convertGroupToNegationGroup = function(group) {
var criteria = group.slice(0);
group.length = 0;
group.push("!", criteria)
};
var convertNegationGroupToGroup = function(group) {
var criteria = getGroupCriteria(group);
group.length = 0;
[].push.apply(group, criteria)
};
if (isNegationValue(value)) {
if (!isNegationGroup(group)) {
convertGroupToNegationGroup(group)
}
} else {
if (isNegationGroup(group)) {
convertNegationGroupToGroup(group)
}
}
}
function setGroupValue(group, value) {
convertGroupToNewStructure(group, value);
var criteria = getGroupCriteria(group);
var i;
var getNormalizedGroupValue = function(value) {
return value.indexOf("!") === -1 ? value : value.substring(1)
};
var changeCriteriaValue = function(criteria, value) {
for (i = 0; i < criteria.length; i++) {
if (!Array.isArray(criteria[i])) {
criteria[i] = value
}
}
};
value = getNormalizedGroupValue(value);
changeCriteriaValue(criteria, value);
return group
}
function getGroupMenuItem(group, availableGroups) {
var groupValue = getGroupValue(group);
return availableGroups.filter(function(item) {
return item.value === groupValue
})[0]
}
function getCriteriaOperation(criteria) {
if (isCondition(criteria)) {
return AND_GROUP_OPERATION
}
var value = "";
for (var i = 0; i < criteria.length; i++) {
var item = criteria[i];
if (!Array.isArray(item)) {
if (value && value !== item) {
throw new _errors.errors.Error("E4019")
}
if ("!" !== item) {
value = item
}
}
}
return value
}
function getGroupValue(group) {
var criteria = getGroupCriteria(group);
var value = getCriteriaOperation(criteria);
if (!value) {
value = AND_GROUP_OPERATION
}
if (criteria !== group) {
value = "!" + value
}
return value
}
function getDefaultFilterOperations(field) {
return field.lookup && LOOKUP_OPERATIONS || DATATYPE_OPERATIONS[field.dataType || DEFAULT_DATA_TYPE]
}
function containItems(entity) {
return Array.isArray(entity) && entity.length
}
function getFilterOperations(field) {
var result = containItems(field.filterOperations) ? field.filterOperations : getDefaultFilterOperations(field);
return (0, _extend.extend)([], result)
}
function getCaptionByOperation(operation, filterOperationDescriptions) {
var operationName = _ui4.default.getNameByFilterOperation(operation);
return filterOperationDescriptions && filterOperationDescriptions[operationName] ? filterOperationDescriptions[operationName] : operationName
}
function getOperationFromAvailable(operation, availableOperations) {
for (var i = 0; i < availableOperations.length; i++) {
if (availableOperations[i].value === operation) {
return availableOperations[i]
}
}
throw new _ui2.default.Error("E1048", operation)
}
function getCustomOperation(customOperations, name) {
var filteredOperations = customOperations.filter(function(item) {
return item.name === name
});
return filteredOperations.length ? filteredOperations[0] : null
}
function getAvailableOperations(field, filterOperationDescriptions, customOperations) {
var filterOperations = getFilterOperations(field);
customOperations.forEach(function(customOperation) {
if (!field.filterOperations && filterOperations.indexOf(customOperation.name) === -1) {
var dataTypes = customOperation && customOperation.dataTypes;
if (dataTypes && dataTypes.indexOf(field.dataType || DEFAULT_DATA_TYPE) >= 0) {
filterOperations.push(customOperation.name)
}
}
});
return filterOperations.map(function(operation) {
var customOperation = getCustomOperation(customOperations, operation);
if (customOperation) {
return {
icon: customOperation.icon || EMPTY_MENU_ICON,
text: customOperation.caption || _inflector2.default.captionize(customOperation.name),
value: customOperation.name,
isCustom: true
}
} else {
return {
icon: _ui4.default.getIconByFilterOperation(operation) || EMPTY_MENU_ICON,
text: getCaptionByOperation(operation, filterOperationDescriptions),
value: operation
}
}
})
}
function getDefaultOperation(field) {
return field.defaultFilterOperation || getFilterOperations(field)[0]
}
function createCondition(field, customOperations) {
var condition = [field.dataField, "", ""];
var filterOperation = getDefaultOperation(field);
updateConditionByOperation(condition, filterOperation, customOperations);
return condition
}
function removeItem(group, item) {
var criteria = getGroupCriteria(group);
var index = criteria.indexOf(item);
criteria.splice(index, 1);
if (1 !== criteria.length) {
criteria.splice(index, 1)
}
return group
}
function createEmptyGroup(value) {
return value.indexOf("not") !== -1 ? ["!", [value.substring(3).toLowerCase()]] : [value]
}
function isEmptyGroup(group) {
var criteria = getGroupCriteria(group);
if (isCondition(criteria)) {
return false
}
var hasConditions = criteria.some(function(item) {
return isCondition(item)
});
return !hasConditions
}
function addItem(item, group) {
var criteria = getGroupCriteria(group);
var groupValue = getGroupValue(criteria);
1 === criteria.length ? criteria.unshift(item) : criteria.push(item, groupValue);
return group
}
function getField(dataField, fields) {
for (var i = 0; i < fields.length; i++) {
if (fields[i].name === dataField) {
return fields[i]
}
if (fields[i].dataField.toLowerCase() === dataField.toLowerCase()) {
return fields[i]
}
}
var extendedFields = getItems(fields, true).filter(function(item) {
return item.dataField.toLowerCase() === dataField.toLowerCase()
});
if (extendedFields.length > 0) {
return extendedFields[0]
}
throw new _ui2.default.Error("E1047", dataField)
}
function isGroup(criteria) {
if (!Array.isArray(criteria)) {
return false
}
return criteria.length < 2 || Array.isArray(criteria[0]) || Array.isArray(criteria[1])
}
function isCondition(criteria) {
if (!Array.isArray(criteria)) {
return false
}
return criteria.length > 1 && !Array.isArray(criteria[0]) && !Array.isArray(criteria[1])
}
function convertToInnerGroup(group, customOperations) {
var groupOperation = getCriteriaOperation(group).toLowerCase() || AND_GROUP_OPERATION;
var innerGroup = [];
for (var i = 0; i < group.length; i++) {
if (isGroup(group[i])) {
innerGroup.push(convertToInnerStructure(group[i], customOperations));
innerGroup.push(groupOperation)
} else {
if (isCondition(group[i])) {
innerGroup.push(convertToInnerCondition(group[i], customOperations));
innerGroup.push(groupOperation)
}
}
}
if (0 === innerGroup.length) {
innerGroup.push(groupOperation)
}
return innerGroup
}
function conditionHasCustomOperation(condition, customOperations) {
var customOperation = getCustomOperation(customOperations, condition[1]);
return customOperation && customOperation.name === condition[1]
}
function convertToInnerCondition(condition, customOperations) {
if (conditionHasCustomOperation(condition, customOperations)) {
return condition
}
if (condition.length < 3) {
condition[2] = condition[1];
condition[1] = EQUAL_OPERATION
}
return condition
}
function convertToInnerStructure(value, customOperations) {
if (!value) {
return [AND_GROUP_OPERATION]
}
value = (0, _extend.extend)(true, [], value);
if (isCondition(value)) {
return [convertToInnerCondition(value, customOperations), AND_GROUP_OPERATION]
}
if (isNegationGroup(value)) {
return ["!", isCondition(value[1]) ? [convertToInnerCondition(value[1], customOperations), AND_GROUP_OPERATION] : isNegationGroup(value[1]) ? [convertToInnerStructure(value[1], customOperations), AND_GROUP_OPERATION] : convertToInnerGroup(value[1], customOperations)]
}
return convertToInnerGroup(value, customOperations)
}
function getNormalizedFields(fields) {
return fields.reduce(function(result, field) {
if ((0, _type.isDefined)(field.dataField)) {
var normalizedField = {};
for (var key in field) {
if (field[key] && AVAILABLE_FIELD_PROPERTIES.indexOf(key) > -1) {
normalizedField[key] = field[key]
}
}
normalizedField.defaultCalculateFilterExpression = _filtering2.default.defaultCalculateFilterExpression;
if (!(0, _type.isDefined)(normalizedField.dataType)) {
normalizedField.dataType = DEFAULT_DATA_TYPE
}
result.push(normalizedField)
}
return result
}, [])
}
function getConditionFilterExpression(condition, fields, customOperations, target) {
var field = getField(condition[0], fields);
var filterExpression = convertToInnerCondition(condition, customOperations);
var customOperation = customOperations.length && getCustomOperation(customOperations, filterExpression[1]);
if (customOperation && customOperation.calculateFilterExpression) {
return customOperation.calculateFilterExpression.apply(customOperation, [filterExpression[2], field, target])
} else {
if (field.createFilterExpression) {
return field.createFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target])
} else {
if (field.calculateFilterExpression) {
return field.calculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target])
} else {
return field.defaultCalculateFilterExpression.apply(field, [filterExpression[2], filterExpression[1], target])
}
}
}
}
function getFilterExpression(value, fields, customOperations, target) {
if (!(0, _type.isDefined)(value)) {
return null
}
if (isNegationGroup(value)) {
var filterExpression = getFilterExpression(value[1], fields, customOperations, target);
return ["!", filterExpression]
}
var criteria = getGroupCriteria(value);
if (isCondition(criteria)) {
return getConditionFilterExpression(criteria, fields, customOperations, target) || null
} else {
var _filterExpression;
var groupValue = getGroupValue(criteria);
var result = [];
for (var i = 0; i < criteria.length; i++) {
if (isGroup(criteria[i])) {
_filterExpression = getFilterExpression(criteria[i], fields, customOperations, target);
if (_filterExpression) {
i && result.push(groupValue);
result.push(_filterExpression)
}
} else {
if (isCondition(criteria[i])) {
_filterExpression = getConditionFilterExpression(criteria[i], fields, customOperations, target);
if (_filterExpression) {
i && result.push(groupValue);
result.push(_filterExpression)
}
}
}
}
return result.length ? result : null
}
}
function getNormalizedFilter(group) {
var criteria = getGroupCriteria(group);
var i;
if (0 === criteria.length) {
return null
}
var itemsForRemove = [];
for (i = 0; i < criteria.length; i++) {
if (isGroup(criteria[i])) {
var normalizedGroupValue = getNormalizedFilter(criteria[i]);
if (normalizedGroupValue) {
criteria[i] = normalizedGroupValue
} else {
itemsForRemove.push(criteria[i])
}
} else {
if (isCondition(criteria[i])) {
if (!isValidCondition(criteria[i])) {
itemsForRemove.push(criteria[i])
}
}
}
}
for (i = 0; i < itemsForRemove.length; i++) {
removeItem(criteria, itemsForRemove[i])
}
if (1 === criteria.length) {
return null
}
criteria.splice(criteria.length - 1, 1);
if (1 === criteria.length) {
group = setGroupCriteria(group, criteria[0])
}
if (0 === group.length) {
return null
}
return group
}
function getCurrentLookupValueText(field, value, handler) {
if ("" === value) {
handler("");
return
}
var lookup = field.lookup;
if (lookup.items) {
handler(lookup.calculateCellValue(value) || "")
} else {
var dataSource = new _data_source.DataSource(lookup.dataSource);
dataSource.loadSingle(lookup.valueExpr, value).done(function(result) {
result ? handler(lookup.displayExpr ? (0, _data.compileGetter)(lookup.displayExpr)(result) : result) : handler("")
}).fail(function() {
handler("")
})
}
}
function getPrimitiveValueText(field, value, customOperation, target) {
var valueText;
if (true === value) {
valueText = field.trueText || _message2.default.format("dxDataGrid-trueText")
} else {
if (false === value) {
valueText = field.falseText || _message2.default.format("dxDataGrid-falseText")
} else {
valueText = getFormattedValueText(field, value)
}
}
if (field.customizeText) {
valueText = field.customizeText.call(field, {
value: value,
valueText: valueText,
target: target
})
}
if (customOperation && customOperation.customizeText) {
valueText = customOperation.customizeText.call(customOperation, {
value: value,
valueText: valueText,
field: field,
target: target
})
}
return valueText
}
function getArrayValueText(field, value, customOperation, target) {
return value.map(function(v) {
return getPrimitiveValueText(field, v, customOperation, target)
})
}
function checkDefaultValue(value) {
return "" === value || null === value
}
function getCurrentValueText(field, value, customOperation) {
var target = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "filterBuilder";
if (checkDefaultValue(value)) {
return ""
}
if (Array.isArray(value)) {
var result = new _deferred.Deferred;
_deferred.when.apply(this, getArrayValueText(field, value, customOperation, target)).done(function() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key]
}
var text = args.some(function(item) {
return !checkDefaultValue(item)
}) ? args.map(function(item) {
return !checkDefaultValue(item) ? item : "?"
}) : "";
result.resolve(text)
});
return result
} else {
return getPrimitiveValueText(field, value, customOperation, target)
}
}
function itemExists(plainItems, parentId) {
return plainItems.some(function(item) {
return item.dataField === parentId
})
}
function pushItemAndCheckParent(originalItems, plainItems, item) {
var dataField = item.dataField;
if (hasParent(dataField)) {
item.parentId = getParentIdFromItemDataField(dataField);
if (!itemExists(plainItems, item.parentId) && !itemExists(originalItems, item.parentId)) {
pushItemAndCheckParent(originalItems, plainItems, {
id: item.parentId,
dataType: "object",
dataField: item.parentId,
caption: generateCaptionByDataField(item.parentId, true),
filterOperations: ["isblank", "isnotblank"]
})
}
}
plainItems.push(item)
}
function generateCaptionByDataField(dataField, allowHierarchicalFields) {
var caption = "";
if (allowHierarchicalFields) {
dataField = dataField.substring(dataField.lastIndexOf(".") + 1)
} else {
if (hasParent(dataField)) {
dataField.split(".").forEach(function(field, index, arr) {
caption += _inflector2.default.captionize(field);
if (index !== arr.length - 1) {
caption += "."
}
});
return caption
}
}
return _inflector2.default.captionize(dataField)
}
function getItems(fields, allowHierarchicalFields) {
var items = [];
for (var i = 0; i < fields.length; i++) {
var item = (0, _extend.extend)(true, {
caption: generateCaptionByDataField(fields[i].dataField, allowHierarchicalFields)
}, fields[i]);
item.id = item.name || item.dataField;
if (allowHierarchicalFields) {
pushItemAndCheckParent(fields, items, item)
} else {
items.push(item)
}
}
return items
}
function hasParent(dataField) {
return dataField.lastIndexOf(".") !== -1
}
function getParentIdFromItemDataField(dataField) {
return dataField.substring(0, dataField.lastIndexOf("."))
}
function getCaptionWithParents(item, plainItems) {
if (hasParent(item.dataField)) {
var parentId = getParentIdFromItemDataField(item.dataField);
for (var i = 0; i < plainItems.length; i++) {
if (plainItems[i].dataField === parentId) {
return getCaptionWithParents(plainItems[i], plainItems) + "." + item.caption
}
}
}
return item.caption
}
function updateConditionByOperation(condition, operation, customOperations) {
var customOperation = getCustomOperation(customOperations, operation);
if (customOperation) {
if (false === customOperation.hasValue) {
condition[1] = operation;
condition.length = 2
} else {
condition[1] = operation;
condition[2] = ""
}
return condition
}
if ("isblank" === operation) {
condition[1] = EQUAL_OPERATION;
condition[2] = null
} else {
if ("isnotblank" === operation) {
condition[1] = NOT_EQUAL_OPERATION;
condition[2] = null
} else {
customOperation = getCustomOperation(customOperations, condition[1]);
if (customOperation || 2 === condition.length || null === condition[2]) {
condition[2] = ""
}
condition[1] = operation
}
}
return condition
}
function getOperationValue(condition) {
var caption;
if (null === condition[2]) {
if (condition[1] === EQUAL_OPERATION) {
caption = "isblank"
} else {
caption = "isnotblank"
}
} else {
caption = condition[1]
}
return caption
}
function isValidCondition(condition) {
return "" !== condition[2]
}
function getMergedOperations(customOperations, betweenCaption) {
var result = (0, _extend.extend)(true, [], customOperations);
var betweenIndex = -1;
result.some(function(customOperation, index) {
if ("between" === customOperation.name) {
betweenIndex = index;
return true
}
});
if (betweenIndex !== -1) {
result[betweenIndex] = (0, _extend.extend)(_between2.default.getConfig(betweenCaption), result[betweenIndex])
} else {
result.unshift(_between2.default.getConfig(betweenCaption))
}
return result
}
function isMatchedCondition(filter, addedFilterDataField) {
return filter[0] === addedFilterDataField
}
function removeFieldConditionsFromFilter(filter, dataField) {
if (!filter || 0 === filter.length) {
return null
}
if (isCondition(filter)) {
var hasMatchedCondition = isMatchedCondition(filter, dataField);
return !hasMatchedCondition ? filter : null
} else {
return syncConditionIntoGroup(filter, [dataField], false)
}
}
function syncConditionIntoGroup(filter, addedFilter, canPush) {
var result = [];
filter.forEach(function(item) {
if (isCondition(item)) {
if (isMatchedCondition(item, addedFilter[0])) {
if (canPush) {
result.push(addedFilter);
canPush = false
} else {
result.splice(result.length - 1, 1)
}
} else {
result.push(item)
}
} else {
(result.length || isGroup(item)) && result.push(item)
}
});
if (0 === result.length) {
return null
}
if (canPush) {
result.push(AND_GROUP_OPERATION);
result.push(addedFilter)
}
return 1 === result.length ? result[0] : result
}
function syncFilters(filter, addedFilter) {
if (null === filter || 0 === filter.length) {
return addedFilter
}
if (isCondition(filter)) {
if (isMatchedCondition(filter, addedFilter[0])) {
return addedFilter
} else {
return [filter, AND_GROUP_OPERATION, addedFilter]
}
}
var groupValue = getGroupValue(filter);
if (groupValue !== AND_GROUP_OPERATION) {
return [addedFilter, "and", filter]
}
return syncConditionIntoGroup(filter, addedFilter, true)
}
function getMatchedConditions(filter, dataField) {
if (null === filter || 0 === filter.length) {
return []
}
if (isCondition(filter)) {
if (isMatchedCondition(filter, dataField)) {
return [filter]
} else {
return []
}
}
var groupValue = getGroupValue(filter);
if (groupValue !== AND_GROUP_OPERATION) {
return []
}
var result = filter.filter(function(item) {
return isCondition(item) && isMatchedCondition(item, dataField)
});
return result
}
function filterHasField(filter, dataField) {
if (null === filter || 0 === filter.length) {
return false
}
if (isCondition(filter)) {
return filter[0] === dataField
}
return filter.some(function(item) {
return (isCondition(item) || isGroup(item)) && filterHasField(item, dataField)
})
}
exports.isValidCondition = isValidCondition;
exports.isEmptyGroup = isEmptyGroup;
exports.getOperationFromAvailable = getOperationFromAvailable;
exports.updateConditionByOperation = updateConditionByOperation;
exports.getCaptionWithParents = getCaptionWithParents;
exports.getItems = getItems;
exports.setGroupValue = setGroupValue;
exports.getGroupMenuItem = getGroupMenuItem;
exports.getGroupValue = getGroupValue;
exports.getAvailableOperations = getAvailableOperations;
exports.removeItem = removeItem;
exports.createCondition = createCondition;
exports.createEmptyGroup = createEmptyGroup;
exports.addItem = addItem;
exports.getField = getField;
exports.isGroup = isGroup;
exports.isCondition = isCondition;
exports.getNormalizedFields = getNormalizedFields;
exports.getNormalizedFilter = getNormalizedFilter;
exports.getGroupCriteria = getGroupCriteria;
exports.convertToInnerStructure = convertToInnerStructure;
exports.getDefaultOperation = getDefaultOperation;
exports.getCurrentValueText = getCurrentValueText;
exports.getCurrentLookupValueText = getCurrentLookupValueText;
exports.getFilterOperations = getFilterOperations;
exports.getCaptionByOperation = getCaptionByOperation;
exports.getOperationValue = getOperationValue;
exports.getFilterExpression = getFilterExpression;
exports.getCustomOperation = getCustomOperation;
exports.getMergedOperations = getMergedOperations;
exports.syncFilters = syncFilters;
exports.getMatchedConditions = getMatchedConditions;
exports.filterHasField = filterHasField;
exports.removeFieldConditionsFromFilter = removeFieldConditionsFromFilter
},
/*!***********************************************************!*\
!*** ./artifacts/transpiled/ui/pivot_grid/data_source.js ***!
\***********************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _data_source = __webpack_require__( /*! ../../data/data_source/data_source */ 45);
var _abstract_store = __webpack_require__( /*! ../../data/abstract_store */ 98);
var _abstract_store2 = _interopRequireDefault(_abstract_store);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _extend = __webpack_require__( /*! ../../core/utils/extend */ 0);
var _array = __webpack_require__( /*! ../../core/utils/array */ 14);
var _iterator = __webpack_require__( /*! ../../core/utils/iterator */ 3);
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
var _class = __webpack_require__( /*! ../../core/class */ 15);
var _class2 = _interopRequireDefault(_class);
var _events_mixin = __webpack_require__( /*! ../../core/events_mixin */ 82);
var _events_mixin2 = _interopRequireDefault(_events_mixin);
var _inflector = __webpack_require__( /*! ../../core/utils/inflector */ 33);
var _local_store = __webpack_require__( /*! ./local_store */ 683);
var _remote_store = __webpack_require__( /*! ./remote_store */ 684);
var _remote_store2 = _interopRequireDefault(_remote_store);
var _xmla_store = __webpack_require__( /*! ./xmla_store/xmla_store */ 380);
var _uiPivot_grid = __webpack_require__( /*! ./ui.pivot_grid.summary_display_modes */ 685);
var _uiPivot_grid2 = __webpack_require__( /*! ./ui.pivot_grid.utils */ 75);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var DESCRIPTION_NAME_BY_AREA = {
row: "rows",
column: "columns",
data: "values",
filter: "filters"
};
var STATE_PROPERTIES = ["area", "areaIndex", "sortOrder", "filterType", "filterValues", "sortBy", "sortBySummaryField", "sortBySummaryPath", "expanded", "summaryType", "summaryDisplayMode"];
var CALCULATED_PROPERTIES = ["format", "selector", "customizeText", "caption"];
var ALL_CALCULATED_PROPERTIES = CALCULATED_PROPERTIES.concat(["allowSorting", "allowSortingBySummary", "allowFiltering", "allowExpandAll"]);
function createCaption(field) {
var caption = field.dataField || field.groupName || "";
var summaryType = (field.summaryType || "").toLowerCase();
if ((0, _type.isString)(field.groupInterval)) {
caption += "_" + field.groupInterval
}
if (summaryType && "custom" !== summaryType) {
summaryType = summaryType.replace(/^./, summaryType[0].toUpperCase());
if (caption.length) {
summaryType = " (" + summaryType + ")"
}
} else {
summaryType = ""
}
return (0, _inflector.titleize)(caption) + summaryType
}
function resetFieldState(field, properties) {
var initialProperties = field._initProperties || {};
(0, _iterator.each)(properties, function(_, prop) {
if (Object.prototype.hasOwnProperty.call(initialProperties, prop)) {
field[prop] = initialProperties[prop]
}
})
}
function updateCalculatedFieldProperties(field, calculatedProperties) {
resetFieldState(field, calculatedProperties);
if (!(0, _type.isDefined)(field.caption)) {
(0, _uiPivot_grid2.setFieldProperty)(field, "caption", createCaption(field))
}
}
function areExpressionsUsed(dataFields) {
return dataFields.some(function(field) {
return field.summaryDisplayMode || field.calculateSummaryValue
})
}
function isRunningTotalUsed(dataFields) {
return dataFields.some(function(field) {
return !!field.runningTotal
})
}
function isDataExists(data) {
return data.rows.length || data.columns.length || data.values.length
}
module.exports = _class2.default.inherit(function() {
var findHeaderItem = function(headerItems, path) {
if (headerItems._cacheByPath) {
return headerItems._cacheByPath[path.join(".")] || null
}
};
var getHeaderItemsLastIndex = function getHeaderItemsLastIndex(headerItems, grandTotalIndex) {
var lastIndex = -1;
if (headerItems) {
for (var i = 0; i < headerItems.length; i++) {
var headerItem = headerItems[i];
if (void 0 !== headerItem.index) {
lastIndex = Math.max(lastIndex, headerItem.index)
}
if (headerItem.children) {
lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.children))
} else {
if (headerItem.collapsedChildren) {
lastIndex = Math.max(lastIndex, getHeaderItemsLastIndex(headerItem.collapsedChildren))
}
}
}
}
if ((0, _type.isDefined)(grandTotalIndex)) {
lastIndex = Math.max(lastIndex, grandTotalIndex)
}
return lastIndex
};
var updateHeaderItemChildren = function(headerItems, headerItem, children, grandTotalIndex) {
var applyingHeaderItemsCount = getHeaderItemsLastIndex(children) + 1;
var emptyIndex = getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1;
var index;
var applyingItemIndexesToCurrent = [];
var needIndexUpdate = false;
var d = new _deferred.Deferred;
if (headerItem.children && headerItem.children.length === children.length) {
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (void 0 !== child.index) {
if (void 0 === headerItem.children[i].index) {
child.index = applyingItemIndexesToCurrent[child.index] = emptyIndex++;
headerItem.children[i] = child
} else {
applyingItemIndexesToCurrent[child.index] = headerItem.children[i].index
}
}
}
} else {
needIndexUpdate = true;
for (index = 0; index < applyingHeaderItemsCount; index++) {
applyingItemIndexesToCurrent[index] = emptyIndex++
}
headerItem.children = children
}(0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItem.children, function(items) {
if (needIndexUpdate) {
items[0].index = applyingItemIndexesToCurrent[items[0].index]
}
})).done(function() {
d.resolve(applyingItemIndexesToCurrent)
});
return d
};
var updateHeaderItems = function(headerItems, newHeaderItems, grandTotalIndex) {
var d = new _deferred.Deferred;
var emptyIndex = grandTotalIndex >= 0 && getHeaderItemsLastIndex(headerItems, grandTotalIndex) + 1;
var applyingItemIndexesToCurrent = [];
(0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItems, function(items) {
delete items[0].collapsedChildren
})).done(function() {
(0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(newHeaderItems, function(newItems, index) {
var newItem = newItems[0];
if (newItem.index >= 0) {
var headerItem = findHeaderItem(headerItems, (0, _uiPivot_grid2.createPath)(newItems));
if (headerItem && headerItem.index >= 0) {
applyingItemIndexesToCurrent[newItem.index] = headerItem.index
} else {
if (emptyIndex) {
var path = (0, _uiPivot_grid2.createPath)(newItems.slice(1));
headerItem = findHeaderItem(headerItems, path);
var parentItems = path.length ? headerItem && headerItem.children : headerItems;
if (parentItems) {
parentItems[index] = newItem;
newItem.index = applyingItemIndexesToCurrent[newItem.index] = emptyIndex++
}
}
}
}
})).done(function() {
d.resolve(applyingItemIndexesToCurrent)
})
});
return d
};
var updateDataSourceCells = function(dataSource, newDataSourceCells, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) {
var rowIndex;
var columnIndex;
var dataSourceCells = dataSource.values;
if (newDataSourceCells) {
for (var newRowIndex = 0; newRowIndex <= newDataSourceCells.length; newRowIndex++) {
var newRowCells = newDataSourceCells[newRowIndex];
rowIndex = newRowItemIndexesToCurrent[newRowIndex];
if (!(0, _type.isDefined)(rowIndex)) {
rowIndex = dataSource.grandTotalRowIndex
}
if (newRowCells && (0, _type.isDefined)(rowIndex)) {
if (!dataSourceCells[rowIndex]) {
dataSourceCells[rowIndex] = []
}
for (var newColumnIndex = 0; newColumnIndex <= newRowCells.length; newColumnIndex++) {
var newCell = newRowCells[newColumnIndex];
columnIndex = newColumnItemIndexesToCurrent[newColumnIndex];
if (!(0, _type.isDefined)(columnIndex)) {
columnIndex = dataSource.grandTotalColumnIndex
}
if ((0, _type.isDefined)(newCell) && (0, _type.isDefined)(columnIndex)) {
dataSourceCells[rowIndex][columnIndex] = newCell
}
}
}
}
}
};
function createLocalOrRemoteStore(dataSourceOptions, notifyProgress) {
var StoreConstructor = dataSourceOptions.remoteOperations || dataSourceOptions.paginate ? _remote_store2.default : _local_store.LocalStore;
return new StoreConstructor((0, _extend.extend)((0, _data_source.normalizeDataSourceOptions)(dataSourceOptions), {
onChanged: null,
onLoadingChanged: null,
onProgressChanged: notifyProgress
}))
}
function createStore(dataSourceOptions, notifyProgress) {
var store;
if ((0, _type.isPlainObject)(dataSourceOptions) && dataSourceOptions.load) {
store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress)
} else {
if (dataSourceOptions && !dataSourceOptions.store) {
dataSourceOptions = {
store: dataSourceOptions
}
}
var storeOptions = dataSourceOptions.store;
if ("xmla" === storeOptions.type) {
store = new _xmla_store.XmlaStore(storeOptions)
} else {
if ((0, _type.isPlainObject)(storeOptions) && storeOptions.type || storeOptions instanceof _abstract_store2.default || Array.isArray(storeOptions)) {
store = createLocalOrRemoteStore(dataSourceOptions, notifyProgress)
} else {
if (storeOptions instanceof _class2.default) {
store = storeOptions
}
}
}
}
return store
}
function equalFields(fields, prevFields, count) {
for (var i = 0; i < count; i++) {
if (!fields[i] || !prevFields[i] || fields[i].index !== prevFields[i].index) {
return false
}
}
return true
}
function getExpandedPaths(dataSource, loadOptions, dimensionName, prevLoadOptions) {
var result = [];
var fields = loadOptions && loadOptions[dimensionName] || [];
var prevFields = prevLoadOptions && prevLoadOptions[dimensionName] || [];
(0, _uiPivot_grid2.foreachTree)(dataSource[dimensionName], function(items) {
var item = items[0];
var path = (0, _uiPivot_grid2.createPath)(items);
if (item.children && fields[path.length - 1] && !fields[path.length - 1].expanded) {
if (path.length < fields.length && (!prevLoadOptions || equalFields(fields, prevFields, path.length))) {
result.push(path.slice())
}
}
}, true);
return result
}
function setFieldProperties(field, srcField, skipInitPropertySave, properties) {
if (srcField) {
(0, _iterator.each)(properties, function(_, name) {
if (skipInitPropertySave) {
field[name] = srcField[name]
} else {
if (("summaryType" === name || "summaryDisplayMode" === name) && void 0 === srcField[name]) {
return
}(0, _uiPivot_grid2.setFieldProperty)(field, name, srcField[name])
}
})
} else {
resetFieldState(field, properties)
}
return field
}
function getFieldsState(fields, properties) {
var result = [];
(0, _iterator.each)(fields, function(_, field) {
result.push(setFieldProperties({
dataField: field.dataField,
name: field.name
}, field, true, properties))
});
return result
}
function getFieldStateId(field) {
if (field.name) {
return field.name
}
return field.dataField + ""
}
function getFieldsById(fields, id) {
var result = [];
(0, _iterator.each)(fields || [], function(_, field) {
if (getFieldStateId(field) === id) {
result.push(field)
}
});
return result
}
function setFieldsStateCore(stateFields, fields) {
stateFields = stateFields || [];
(0, _iterator.each)(fields, function(index, field) {
setFieldProperties(field, stateFields[index], false, STATE_PROPERTIES);
updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES)
});
return fields
}
function setFieldsState(stateFields, fields) {
stateFields = stateFields || [];
var fieldsById = {};
var id;
(0, _iterator.each)(fields, function(_, field) {
id = getFieldStateId(field);
if (!fieldsById[id]) {
fieldsById[id] = getFieldsById(fields, getFieldStateId(field))
}
});
(0, _iterator.each)(fieldsById, function(id, fields) {
setFieldsStateCore(getFieldsById(stateFields, id), fields)
});
return fields
}
function getFieldsByGroup(fields, groupingField) {
return fields.filter(function(field) {
return field.groupName === groupingField.groupName && (0, _type.isNumeric)(field.groupIndex) && false !== field.visible
}).map(function(field) {
return (0, _extend.extend)(field, {
areaIndex: groupingField.areaIndex,
area: groupingField.area,
expanded: (0, _type.isDefined)(field.expanded) ? field.expanded : groupingField.expanded,
dataField: field.dataField || groupingField.dataField,
dataType: field.dataType || groupingField.dataType,
sortBy: field.sortBy || groupingField.sortBy,
sortOrder: field.sortOrder || groupingField.sortOrder,
sortBySummaryField: field.sortBySummaryField || groupingField.sortBySummaryField,
sortBySummaryPath: field.sortBySummaryPath || groupingField.sortBySummaryPath,
visible: field.visible || groupingField.visible,
showTotals: (0, _type.isDefined)(field.showTotals) ? field.showTotals : groupingField.showTotals,
showGrandTotals: (0, _type.isDefined)(field.showGrandTotals) ? field.showGrandTotals : groupingField.showGrandTotals
})
}).sort(function(a, b) {
return a.groupIndex - b.groupIndex
})
}
function sortFieldsByAreaIndex(fields) {
fields.sort(function(field1, field2) {
return field1.areaIndex - field2.areaIndex || field1.groupIndex - field2.groupIndex
})
}
function isAreaField(field, area) {
var canAddFieldInArea = "data" === area || false !== field.visible;
return field.area === area && !(0, _type.isDefined)(field.groupIndex) && canAddFieldInArea
}
function getFieldId(field, retrieveFieldsOptionValue) {
var groupName = field.groupName || "";
return (field.dataField || groupName) + (field.groupInterval ? groupName + field.groupInterval : "NOGROUP") + (retrieveFieldsOptionValue ? "" : groupName)
}
function mergeFields(fields, storeFields, retrieveFieldsOptionValue) {
var result = [];
var fieldsDictionary = {};
var removedFields = {};
var mergedGroups = [];
var dataTypes = (0, _uiPivot_grid2.getFieldsDataType)(fields);
if (storeFields) {
(0, _iterator.each)(storeFields, function(_, field) {
fieldsDictionary[getFieldId(field, retrieveFieldsOptionValue)] = field
});
(0, _iterator.each)(fields, function(_, field) {
var fieldKey = getFieldId(field, retrieveFieldsOptionValue);
var storeField = fieldsDictionary[fieldKey] || removedFields[fieldKey];
var mergedField;
if (storeField) {
if (storeField._initProperties) {
resetFieldState(storeField, ALL_CALCULATED_PROPERTIES)
}
mergedField = (0, _extend.extend)({}, storeField, field, {
_initProperties: null
})
} else {
fieldsDictionary[fieldKey] = mergedField = field
}(0, _extend.extend)(mergedField, {
dataType: dataTypes[field.dataField]
});
delete fieldsDictionary[fieldKey];
removedFields[fieldKey] = storeField;
result.push(mergedField)
});
if (retrieveFieldsOptionValue) {
(0, _iterator.each)(fieldsDictionary, function(_, field) {
result.push(field)
})
}
} else {
result = fields
}
result.push.apply(result, mergedGroups);
return result
}
function getFields(that) {
var result = new _deferred.Deferred;
var store = that._store;
var storeFields = store && store.getFields(that._fields);
(0, _deferred.when)(storeFields).done(function(storeFields) {
that._storeFields = storeFields;
var mergedFields = mergeFields(that._fields, storeFields, that._retrieveFields);
result.resolve(mergedFields)
}).fail(result.reject);
return result
}
function getSliceIndex(items, path) {
var index = null;
var pathValue = (path || []).join(".");
if (pathValue.length) {
(0, _uiPivot_grid2.foreachTree)(items, function(items) {
var item = items[0];
var itemPath = (0, _uiPivot_grid2.createPath)(items).join(".");
var textPath = (0, _iterator.map)(items, function(item) {
return item.text
}).reverse().join(".");
if (pathValue === itemPath || item.key && textPath === pathValue) {
index = items[0].index;
return false
}
})
}
return index
}
function getFieldSummaryValueSelector(field, dataSource, loadOptions, dimensionName) {
var values = dataSource.values;
var sortBySummaryFieldIndex = (0, _uiPivot_grid2.findField)(loadOptions.values, field.sortBySummaryField);
var areRows = "rows" === dimensionName;
var sortByDimension = areRows ? dataSource.columns : dataSource.rows;
var grandTotalIndex = areRows ? dataSource.grandTotalRowIndex : dataSource.grandTotalColumnIndex;
var sortBySummaryPath = field.sortBySummaryPath || [];
var sliceIndex = sortBySummaryPath.length ? getSliceIndex(sortByDimension, sortBySummaryPath) : grandTotalIndex;
if (values && values.length && sortBySummaryFieldIndex >= 0 && (0, _type.isDefined)(sliceIndex)) {
return function(field) {
var rowIndex = areRows ? field.index : sliceIndex;
var columnIndex = areRows ? sliceIndex : field.index;
var value = ((values[rowIndex] || [
[]
])[columnIndex] || [])[sortBySummaryFieldIndex];
return (0, _type.isDefined)(value) ? value : null
}
}
}
function getMemberForSortBy(sortBy, getAscOrder) {
var member = "text";
if ("none" === sortBy) {
member = "index"
} else {
if (getAscOrder || "displayText" !== sortBy) {
member = "value"
}
}
return member
}
function getSortingMethod(field, dataSource, loadOptions, dimensionName, getAscOrder) {
var sortOrder = getAscOrder ? "asc" : field.sortOrder;
var sortBy = getMemberForSortBy(field.sortBy, getAscOrder);
var defaultCompare = field.sortingMethod ? function(a, b) {
return field.sortingMethod(a, b)
} : (0, _uiPivot_grid2.getCompareFunction)(function(item) {
return item[sortBy]
});
var summaryValueSelector = !getAscOrder && getFieldSummaryValueSelector(field, dataSource, loadOptions, dimensionName);
var summaryCompare = summaryValueSelector && (0, _uiPivot_grid2.getCompareFunction)(summaryValueSelector);
var sortingMethod = function(a, b) {
var result = summaryCompare && summaryCompare(a, b) || defaultCompare(a, b);
return "desc" === sortOrder ? -result : result
};
return sortingMethod
}
function sortDimension(dataSource, loadOptions, dimensionName, getAscOrder) {
var fields = loadOptions[dimensionName] || [];
var baseIndex = loadOptions.headerName === dimensionName ? loadOptions.path.length : 0;
var sortingMethodByLevel = [];
(0, _uiPivot_grid2.foreachDataLevel)(dataSource[dimensionName], function(item, index) {
var field = fields[index] || {};
var sortingMethod = sortingMethodByLevel[index] = sortingMethodByLevel[index] || getSortingMethod(field, dataSource, loadOptions, dimensionName, getAscOrder);
item.sort(sortingMethod)
}, baseIndex)
}
function sort(loadOptions, dataSource, getAscOrder) {
sortDimension(dataSource, loadOptions, "rows", getAscOrder);
sortDimension(dataSource, loadOptions, "columns", getAscOrder)
}
function formatHeaderItems(data, loadOptions, headerName) {
return (0, _uiPivot_grid2.foreachTreeAsync)(data[headerName], function(items) {
var item = items[0];
item.text = item.text || (0, _uiPivot_grid2.formatValue)(item.value, loadOptions[headerName][(0, _uiPivot_grid2.createPath)(items).length - 1])
})
}
function formatHeaders(loadOptions, data) {
return (0, _deferred.when)(formatHeaderItems(data, loadOptions, "columns"), formatHeaderItems(data, loadOptions, "rows"))
}
function updateCache(headerItems) {
var d = new _deferred.Deferred;
var cacheByPath = {};
(0, _deferred.when)((0, _uiPivot_grid2.foreachTreeAsync)(headerItems, function(items) {
var path = (0, _uiPivot_grid2.createPath)(items).join(".");
cacheByPath[path] = items[0]
})).done(d.resolve);
headerItems._cacheByPath = cacheByPath;
return d
}
function _getAreaFields(fields, area) {
var areaFields = [];
(0, _iterator.each)(fields, function() {
if (isAreaField(this, area)) {
areaFields.push(this)
}
});
return areaFields
}
exports.sort = sort;
return {
ctor: function(options) {
options = options || {};
var that = this;
var store = createStore(options, function(progress) {
that.fireEvent("progressChanged", [progress])
});
that._store = store;
that._paginate = !!options.paginate;
that._pageSize = options.pageSize || 40;
that._data = {
rows: [],
columns: [],
values: []
};
that._loadingCount = 0;
that._isFieldsModified = false;
(0, _iterator.each)(["changed", "loadError", "loadingChanged", "progressChanged", "fieldsPrepared", "expandValueChanging"], function(_, eventName) {
var optionName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
if (Object.prototype.hasOwnProperty.call(options, optionName)) {
this.on(eventName, options[optionName])
}
}.bind(this));
that._retrieveFields = (0, _type.isDefined)(options.retrieveFields) ? options.retrieveFields : true;
that._fields = options.fields || [];
that._descriptions = options.descriptions ? (0, _extend.extend)(that._createDescriptions(), options.descriptions) : void 0;
if (!store) {
(0, _extend.extend)(true, that._data, options.store || options)
}
},
getData: function() {
return this._data
},
getAreaFields: function(area, collectGroups) {
var areaFields = [];
if (collectGroups || "data" === area) {
areaFields = _getAreaFields(this._fields, area);
sortFieldsByAreaIndex(areaFields)
} else {
var descriptions = this._descriptions || {};
areaFields = descriptions[DESCRIPTION_NAME_BY_AREA[area]] || []
}
return areaFields
},
fields: function(_fields) {
var that = this;
if (_fields) {
that._fields = mergeFields(_fields, that._storeFields, that._retrieveFields);
that._fieldsPrepared(that._fields)
}
return that._fields
},
field: function field(id, options) {
var that = this;
var fields = that._fields;
var field = fields && fields[(0, _type.isNumeric)(id) ? id : (0, _uiPivot_grid2.findField)(fields, id)];
if (field && options) {
(0, _iterator.each)(options, function(optionName, optionValue) {
var isInitialization = (0, _array.inArray)(optionName, STATE_PROPERTIES) < 0;
(0, _uiPivot_grid2.setFieldProperty)(field, optionName, optionValue, isInitialization);
if ("sortOrder" === optionName) {
var levels = field.levels || [];
for (var i = 0; i < levels.length; i++) {
levels[i][optionName] = optionValue
}
}
});
updateCalculatedFieldProperties(field, CALCULATED_PROPERTIES);
that._descriptions = that._createDescriptions(field);
that._isFieldsModified = true;
that.fireEvent("fieldChanged", [field])
}
return field
},
getFieldValues: function(index, applyFilters, options) {
var that = this;
var field = this._fields && this._fields[index];
var store = this.store();
var loadFields = [];
var loadOptions = {
columns: loadFields,
rows: [],
values: this.getAreaFields("data"),
filters: applyFilters ? this._fields.filter(function(f) {
return f !== field && f.area && f.filterValues && f.filterValues.length
}) : [],
skipValues: true
};
var searchValue;
var d = new _deferred.Deferred;
if (options) {
searchValue = options.searchValue;
loadOptions.columnSkip = options.skip;
loadOptions.columnTake = options.take
}
if (field && store) {
(0, _iterator.each)(field.levels || [field], function() {
loadFields.push((0, _extend.extend)({}, this, {
expanded: true,
filterValues: null,
sortOrder: "asc",
sortBySummaryField: null,
searchValue: searchValue
}))
});
store.load(loadOptions).done(function(data) {
if (loadOptions.columnSkip) {
data.columns = data.columns.slice(loadOptions.columnSkip)
}
if (loadOptions.columnTake) {
data.columns = data.columns.slice(0, loadOptions.columnTake)
}
formatHeaders(loadOptions, data);
if (!loadOptions.columnTake) {
that._sort(loadOptions, data)
}
d.resolve(data.columns)
}).fail(d)
} else {
d.reject()
}
return d
},
reload: function() {
return this.load({
reload: true
})
},
filter: function() {
var store = this._store;
return store.filter.apply(store, arguments)
},
load: function(options) {
var that = this;
var d = new _deferred.Deferred;
options = options || {};
that.beginLoading();
d.fail(function(e) {
that.fireEvent("loadError", [e])
}).always(function() {
that.endLoading()
});
function loadTask() {
that._delayedLoadTask = void 0;
if (!that._descriptions) {
(0, _deferred.when)(getFields(that)).done(function(fields) {
that._fieldsPrepared(fields);
that._loadCore(options, d)
}).fail(d.reject).fail(that._loadErrorHandler)
} else {
that._loadCore(options, d)
}
}
if (that.store()) {
that._delayedLoadTask = (0, _common.executeAsync)(loadTask)
} else {
loadTask()
}
return d
},
createDrillDownDataSource: function(params) {
return this._store.createDrillDownDataSource(this._descriptions, params)
},
_createDescriptions: function(currentField) {
var that = this;
var fields = that.fields();
var descriptions = {
rows: [],
columns: [],
values: [],
filters: []
};
(0, _iterator.each)(["row", "column", "data", "filter"], function(_, areaName) {
(0, _array.normalizeIndexes)(_getAreaFields(fields, areaName), "areaIndex", currentField)
});
(0, _iterator.each)(fields || [], function(_, field) {
var descriptionName = DESCRIPTION_NAME_BY_AREA[field.area];
var dimension = descriptions[descriptionName];
var groupName = field.groupName;
if (groupName && !(0, _type.isNumeric)(field.groupIndex)) {
field.levels = getFieldsByGroup(fields, field)
}
if (!dimension || groupName && (0, _type.isNumeric)(field.groupIndex) || false === field.visible && "data" !== field.area && "filter" !== field.area) {
return
}
if (field.levels && dimension !== descriptions.filters && dimension !== descriptions.values) {
dimension.push.apply(dimension, field.levels);
if (field.filterValues && field.filterValues.length) {
descriptions.filters.push(field)
}
} else {
dimension.push(field)
}
});
(0, _iterator.each)(descriptions, function(_, fields) {
sortFieldsByAreaIndex(fields)
});
var indices = {};
(0, _iterator.each)(descriptions.values, function(_, field) {
var expression = field.calculateSummaryValue;
if ((0, _type.isFunction)(expression)) {
var summaryCell = (0, _uiPivot_grid.createMockSummaryCell)(descriptions, fields, indices);
expression(summaryCell)
}
});
return descriptions
},
_fieldsPrepared: function(fields) {
var that = this;
that._fields = fields;
(0, _iterator.each)(fields, function(index, field) {
field.index = index;
updateCalculatedFieldProperties(field, ALL_CALCULATED_PROPERTIES)
});
var currentFieldState = getFieldsState(fields, ["caption"]);
that.fireEvent("fieldsPrepared", [fields]);
for (var i = 0; i < fields.length; i++) {
if (fields[i].caption !== currentFieldState[i].caption) {
(0, _uiPivot_grid2.setFieldProperty)(fields[i], "caption", fields[i].caption, true)
}
}
that._descriptions = that._createDescriptions()
},
isLoading: function() {
return this._loadingCount > 0
},
state: function(_state, skipLoading) {
var that = this;
if (arguments.length) {
_state = (0, _extend.extend)({
rowExpandedPaths: [],
columnExpandedPaths: []
}, _state);
if (!that._descriptions) {
that.beginLoading();
(0, _deferred.when)(getFields(that)).done(function(fields) {
that._fields = setFieldsState(_state.fields, fields);
that._fieldsPrepared(fields);
!skipLoading && that.load(_state)
}).always(function() {
that.endLoading()
})
} else {
that._fields = setFieldsState(_state.fields, that._fields);
that._descriptions = that._createDescriptions();
!skipLoading && that.load(_state)
}
} else {
return {
fields: getFieldsState(that._fields, STATE_PROPERTIES),
columnExpandedPaths: getExpandedPaths(that._data, that._descriptions, "columns"),
rowExpandedPaths: getExpandedPaths(that._data, that._descriptions, "rows")
}
}
},
beginLoading: function() {
this._changeLoadingCount(1)
},
endLoading: function() {
this._changeLoadingCount(-1)
},
_changeLoadingCount: function(increment) {
var oldLoading = this.isLoading();
this._loadingCount += increment;
var newLoading = this.isLoading();
if (oldLoading ^ newLoading) {
this.fireEvent("loadingChanged", [newLoading])
}
},
_hasPagingValues: function(options, area, oppositeIndex) {
var takeField = area + "Take";
var skipField = area + "Skip";
var values = this._data.values;
var items = this._data[area + "s"];
var oppositeArea = "row" === area ? "column" : "row";
var indices = [];
if (options.path && options.area === area) {
var headerItem = findHeaderItem(items, options.path);
items = headerItem && headerItem.children;
if (!items) {
return false
}
}
if (options.oppositePath && options.area === oppositeArea) {
var _headerItem = findHeaderItem(items, options.oppositePath);
items = _headerItem && _headerItem.children;
if (!items) {
return false
}
}
for (var i = options[skipField]; i < options[skipField] + options[takeField]; i++) {
if (items[i]) {
indices.push(items[i].index)
}
}
return indices.every(function(index) {
if (void 0 !== index) {
if ("row" === area) {
return (values[index] || [])[oppositeIndex]
} else {
return (values[oppositeIndex] || [])[index]
}
}
})
},
_processPagingCacheByArea: function(options, pageSize, area) {
var takeField = area + "Take";
var skipField = area + "Skip";
var items = this._data[area + "s"];
var oppositeArea = "row" === area ? "column" : "row";
var item;
if (options[takeField]) {
if (options.path && options.area === area) {
var headerItem = findHeaderItem(items, options.path);
items = headerItem && headerItem.children || []
}
if (options.oppositePath && options.area === oppositeArea) {
var _headerItem2 = findHeaderItem(items, options.oppositePath);
items = _headerItem2 && _headerItem2.children || []
}
do {
item = items[options[skipField]];
if (item && void 0 !== item.index) {
if (this._hasPagingValues(options, oppositeArea, item.index)) {
options[skipField]++;
options[takeField]--
} else {
break
}
}
} while (item && void 0 !== item.index && options[takeField]);
if (options[takeField]) {
var start = Math.floor(options[skipField] / pageSize) * pageSize;
var end = Math.ceil((options[skipField] + options[takeField]) / pageSize) * pageSize;
options[skipField] = start;
options[takeField] = end - start
}
}
},
_processPagingCache: function(storeLoadOptions) {
var pageSize = this._pageSize;
if (pageSize < 0) {
return
}
for (var i = 0; i < storeLoadOptions.length; i++) {
this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "row");
this._processPagingCacheByArea(storeLoadOptions[i], pageSize, "column")
}
},
_loadCore: function(options, deferred) {
var that = this;
var store = this._store;
var descriptions = this._descriptions;
var reload = options.reload || this.paginate() && that._isFieldsModified;
var paginate = this.paginate();
var headerName = DESCRIPTION_NAME_BY_AREA[options.area];
options = options || {};
if (store) {
(0, _extend.extend)(options, descriptions);
options.columnExpandedPaths = options.columnExpandedPaths || getExpandedPaths(this._data, options, "columns", that._lastLoadOptions);
options.rowExpandedPaths = options.rowExpandedPaths || getExpandedPaths(this._data, options, "rows", that._lastLoadOptions);
if (paginate) {
options.pageSize = this._pageSize
}
if (headerName) {
options.headerName = headerName
}
that.beginLoading();
deferred.always(function() {
that.endLoading()
});
var storeLoadOptions = [options];
that.fireEvent("customizeStoreLoadOptions", [storeLoadOptions, reload]);
if (!reload) {
that._processPagingCache(storeLoadOptions)
}
storeLoadOptions = storeLoadOptions.filter(function(options) {
return !(options.rows.length && 0 === options.rowTake) && !(options.columns.length && 0 === options.columnTake)
});
if (!storeLoadOptions.length) {
that._update(deferred);
return
}
var results = storeLoadOptions.map(function(options) {
return store.load(options)
});
_deferred.when.apply(null, results).done(function() {
var results = arguments;
for (var i = 0; i < results.length; i++) {
var _options = storeLoadOptions[i];
var data = results[i];
var isLast = i === results.length - 1;
if (_options.path) {
that.applyPartialDataSource(_options.area, _options.path, data, isLast ? deferred : false, _options.oppositePath)
} else {
if (paginate && !reload && isDataExists(that._data)) {
that.mergePartialDataSource(data, isLast ? deferred : false)
} else {
(0, _extend.extend)(that._data, data);
that._lastLoadOptions = _options;
that._update(isLast ? deferred : false)
}
}
}
}).fail(deferred.reject)
} else {
that._update(deferred)
}
},
_sort: function(descriptions, data, getAscOrder) {
var store = this._store;
if (store && !this._paginate) {
sort(descriptions, data, getAscOrder)
}
},
paginate: function() {
return this._paginate && this._store && this._store.supportPaging()
},
isEmpty: function() {
var dataFields = this.getAreaFields("data");
var data = this.getData();
return !dataFields.length || !data.values.length
},
_update: function(deferred) {
var that = this;
var descriptions = that._descriptions;
var loadedData = that._data;
var dataFields = descriptions.values;
var expressionsUsed = areExpressionsUsed(dataFields);
(0, _deferred.when)(formatHeaders(descriptions, loadedData), updateCache(loadedData.rows), updateCache(loadedData.columns)).done(function() {
if (expressionsUsed) {
that._sort(descriptions, loadedData, expressionsUsed);
!that.isEmpty() && (0, _uiPivot_grid.applyDisplaySummaryMode)(descriptions, loadedData)
}
that._sort(descriptions, loadedData);
!that.isEmpty() && isRunningTotalUsed(dataFields) && (0, _uiPivot_grid.applyRunningTotal)(descriptions, loadedData);
that._data = loadedData;
false !== deferred && (0, _deferred.when)(deferred).done(function() {
that._isFieldsModified = false;
that.fireEvent("changed");
if ((0, _type.isDefined)(that._data.grandTotalRowIndex)) {
loadedData.grandTotalRowIndex = that._data.grandTotalRowIndex
}
if ((0, _type.isDefined)(that._data.grandTotalColumnIndex)) {
loadedData.grandTotalColumnIndex = that._data.grandTotalColumnIndex
}
});
deferred && deferred.resolve(that._data)
});
return deferred
},
store: function() {
return this._store
},
collapseHeaderItem: function(area, path) {
var that = this;
var headerItems = "column" === area ? that._data.columns : that._data.rows;
var headerItem = findHeaderItem(headerItems, path);
var field = that.getAreaFields(area)[path.length - 1];
if (headerItem && headerItem.children) {
that.fireEvent("expandValueChanging", [{
area: area,
path: path,
expanded: false
}]);
if (field) {
field.expanded = false
}
headerItem.collapsedChildren = headerItem.children;
delete headerItem.children;
that._update();
if (that.paginate()) {
that.load()
}
return true
}
return false
},
collapseAll: function(id) {
var _this = this;
var dataChanged = false;
var field = this.field(id) || {};
var areaOffsets = [(0, _array.inArray)(field, this.getAreaFields(field.area))];
field.expanded = false;
if (field && field.levels) {
areaOffsets = [];
field.levels.forEach(function(f) {
areaOffsets.push((0, _array.inArray)(f, _this.getAreaFields(field.area)));
f.expanded = false
})
}(0, _uiPivot_grid2.foreachTree)(this._data[field.area + "s"], function(items) {
var item = items[0];
var path = (0, _uiPivot_grid2.createPath)(items);
if (item && item.children && areaOffsets.indexOf(path.length - 1) !== -1) {
item.collapsedChildren = item.children;
delete item.children;
dataChanged = true
}
}, true);
dataChanged && this._update()
},
expandAll: function(id) {
var field = this.field(id);
if (field && field.area) {
field.expanded = true;
if (field && field.levels) {
field.levels.forEach(function(f) {
f.expanded = true
})
}
this.load()
}
},
expandHeaderItem: function(area, path) {
var that = this;
var headerItems = "column" === area ? that._data.columns : that._data.rows;
var headerItem = findHeaderItem(headerItems, path);
if (headerItem && !headerItem.children) {
var hasCache = !!headerItem.collapsedChildren;
var options = {
area: area,
path: path,
expanded: true,
needExpandData: !hasCache
};
that.fireEvent("expandValueChanging", [options]);
if (hasCache) {
headerItem.children = headerItem.collapsedChildren;
delete headerItem.collapsedChildren;
that._update()
} else {
if (this.store()) {
that.load(options)
}
}
return hasCache
}
return false
},
mergePartialDataSource: function(dataSource, deferred) {
var that = this;
var loadedData = that._data;
if (dataSource && dataSource.values) {
dataSource.rows = dataSource.rows || [];
dataSource.columns = dataSource.columns || [];
var newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalColumnIndex);
var newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex);
(0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(function(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) {
if (newRowItemIndexesToCurrent.length || newColumnItemIndexesToCurrent.length) {
updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent)
}
that._update(deferred)
})
}
},
applyPartialDataSource: function(area, path, dataSource, deferred, oppositePath) {
var that = this;
var loadedData = that._data;
var headerItems = "column" === area ? loadedData.columns : loadedData.rows;
var oppositeHeaderItems = "column" === area ? loadedData.rows : loadedData.columns;
var newRowItemIndexesToCurrent;
var newColumnItemIndexesToCurrent;
if (dataSource && dataSource.values) {
dataSource.rows = dataSource.rows || [];
dataSource.columns = dataSource.columns || [];
var headerItem = findHeaderItem(headerItems, path);
var oppositeHeaderItem = oppositePath && findHeaderItem(oppositeHeaderItems, oppositePath);
if (headerItem) {
if ("column" === area) {
newColumnItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.columns, loadedData.grandTotalColumnIndex);
if (oppositeHeaderItem) {
newRowItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.rows, loadedData.grandTotalRowIndex)
} else {
newRowItemIndexesToCurrent = updateHeaderItems(loadedData.rows, dataSource.rows, loadedData.grandTotalRowIndex)
}
} else {
newRowItemIndexesToCurrent = updateHeaderItemChildren(headerItems, headerItem, dataSource.rows, loadedData.grandTotalRowIndex);
if (oppositeHeaderItem) {
newColumnItemIndexesToCurrent = updateHeaderItemChildren(oppositeHeaderItems, oppositeHeaderItem, dataSource.columns, loadedData.grandTotalColumnIndex)
} else {
newColumnItemIndexesToCurrent = updateHeaderItems(loadedData.columns, dataSource.columns, loadedData.grandTotalColumnIndex)
}
}(0, _deferred.when)(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent).done(function(newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent) {
if ("row" === area && newRowItemIndexesToCurrent.length || "column" === area && newColumnItemIndexesToCurrent.length) {
updateDataSourceCells(loadedData, dataSource.values, newRowItemIndexesToCurrent, newColumnItemIndexesToCurrent)
}
that._update(deferred)
})
}
}
},
dispose: function() {
var that = this;
var delayedLoadTask = that._delayedLoadTask;
this._disposeEvents();
if (delayedLoadTask) {
delayedLoadTask.abort()
}
this._isDisposed = true
},
isDisposed: function() {
return !!this._isDisposed
}
}
}()).include(_events_mixin2.default);
module.exports.sort = exports.sort
},
/*!*******************************************************************************************!*\
!*** ./artifacts/transpiled/ui/scheduler/workspaces/ui.scheduler.work_space.indicator.js ***!
\*******************************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../../../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _uiScheduler = __webpack_require__( /*! ./ui.scheduler.work_space */ 384);
var _uiScheduler2 = _interopRequireDefault(_uiScheduler);
var _component_registrator = __webpack_require__( /*! ../../../core/component_registrator */ 9);
var _component_registrator2 = _interopRequireDefault(_component_registrator);
var _date = __webpack_require__( /*! ../../../core/utils/date */ 22);
var _date2 = _interopRequireDefault(_date);
var _extend = __webpack_require__( /*! ../../../core/utils/extend */ 0);
var _window = __webpack_require__( /*! ../../../core/utils/window */ 7);
var _window2 = _interopRequireDefault(_window);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var toMs = _date2.default.dateToMilliseconds;
var SCHEDULER_DATE_TIME_INDICATOR_CLASS = "dx-scheduler-date-time-indicator";
var TIME_PANEL_CURRENT_TIME_CELL_CLASS = "dx-scheduler-time-panel-current-time-cell";
var HEADER_CURRENT_TIME_CELL_CLASS = "dx-scheduler-header-panel-current-time-cell";
var SchedulerWorkSpaceIndicator = _uiScheduler2.default.inherit({
_getToday: function() {
var date = this.option("indicatorTime") || new Date;
return this.invoke("convertDateByTimezone", date) || date
},
_needRenderDateTimeIndicator: function() {
var today = this._getToday();
var endViewDate = _date2.default.trimTime(this.getEndViewDate());
return _date2.default.dateInRange(today, this._firstViewDate, new Date(endViewDate.getTime() + toMs("day")))
},
needRenderDateTimeIndication: function() {
if (!_window2.default.hasWindow()) {
return false
}
var today = this._getToday();
return today >= _date2.default.trimTime(new Date(this.getStartViewDate()))
},
_renderDateTimeIndication: function() {
if (this.needRenderDateTimeIndication()) {
if (this.option("shadeUntilCurrentTime")) {
this._shader.render(this)
}
if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) {
var groupCount = this._getGroupCount() || 1;
var $container = this._dateTableScrollable.$content();
var height = this.getIndicationHeight();
var rtlOffset = this._getRtlOffset(this.getCellWidth());
if (height > 0) {
this._renderIndicator(height, rtlOffset, $container, groupCount)
}
}
}
},
_renderIndicator: function(height, rtlOffset, $container, groupCount) {
for (var i = 0; i < groupCount; i++) {
var $indicator = this._createIndicator($container);
$indicator.width(this.getCellWidth());
this._groupedStrategy.shiftIndicator($indicator, height, rtlOffset, i)
}
},
_createIndicator: function($container) {
var $indicator = (0, _renderer2.default)("
").addClass(SCHEDULER_DATE_TIME_INDICATOR_CLASS);
$container.append($indicator);
return $indicator
},
_getRtlOffset: function(width) {
return this.option("rtlEnabled") ? this._dateTableScrollable.$content().get(0).getBoundingClientRect().width - this.getTimePanelWidth() - width : 0
},
_setIndicationUpdateInterval: function() {
if (!this.option("showCurrentTimeIndicator") || 0 === this.option("indicatorUpdateInterval")) {
return
}
this._clearIndicatorUpdateInterval();
this._indicatorInterval = setInterval(function() {
this._refreshDateTimeIndication()
}.bind(this), this.option("indicatorUpdateInterval"))
},
_clearIndicatorUpdateInterval: function() {
if (this._indicatorInterval) {
clearInterval(this._indicatorInterval);
delete this._indicatorInterval
}
},
_isVerticalShader: function() {
return true
},
getIndicationWidth: function(groupIndex) {
var maxWidth = this.getCellWidth() * this._getCellCount();
var difference = this._getIndicatorDuration();
if (difference > this._getCellCount()) {
difference = this._getCellCount()
}
var width = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference);
return maxWidth < width ? maxWidth : width
},
getIndicatorOffset: function(groupIndex) {
var difference = this._getIndicatorDuration() - 1;
var offset = difference * this.getRoundedCellWidth(groupIndex, groupIndex * this._getCellCount(), difference);
return offset
},
_getIndicatorDuration: function() {
var today = this._getToday();
var firstViewDate = new Date(this._firstViewDate);
var timeDiff = today.getTime() - firstViewDate.getTime();
if ("workWeek" === this.option("type")) {
timeDiff -= this._getWeekendsCount(Math.round(timeDiff / toMs("day"))) * toMs("day")
}
return Math.ceil((timeDiff + 1) / toMs("day"))
},
getIndicationHeight: function() {
var today = this._getToday();
var cellHeight = this.getCellHeight();
var date = new Date(this._firstViewDate);
if (this._needRenderDateTimeIndicator()) {
date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate())
}
var duration = today.getTime() - date.getTime();
var cellCount = duration / this.getCellDuration();
return cellCount * cellHeight
},
_dispose: function() {
this._clearIndicatorUpdateInterval();
this.callBase.apply(this, arguments)
},
_refreshDateTimeIndication: function() {
this._cleanDateTimeIndicator();
this._shader && this._shader.clean();
this._renderDateTimeIndication()
},
_isCurrentTime: function(date) {
if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) {
var today = this._getToday();
var result = false;
date = new Date(date);
date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());
var startCellDate = new Date(date);
var endCellDate = new Date(date);
if (_date2.default.sameDate(today, date)) {
startCellDate = startCellDate.setMilliseconds(date.getMilliseconds() - this.getCellDuration() + 1);
endCellDate = endCellDate.setMilliseconds(date.getMilliseconds() + this.getCellDuration());
result = _date2.default.dateInRange(today, startCellDate, endCellDate)
}
return result
}
},
_isCurrentTimeHeaderCell: function(headerIndex) {
var result = false;
if (this.option("showCurrentTimeIndicator") && this._needRenderDateTimeIndicator()) {
var date = this._getDateByIndex(headerIndex);
var now = this.option("indicatorTime") || new Date;
result = _date2.default.sameDate(date, now)
}
return result
},
_getTimeCellClass: function(i) {
var startViewDate = this._getTimeCellDate(i);
var cellClass = this.callBase(i);
if (this._isCurrentTime(startViewDate)) {
return cellClass + " " + TIME_PANEL_CURRENT_TIME_CELL_CLASS
}
return cellClass
},
_getHeaderPanelCellClass: function(i) {
var cellClass = this.callBase(i);
if (this._isCurrentTimeHeaderCell(i)) {
return cellClass + " " + HEADER_CURRENT_TIME_CELL_CLASS
}
return cellClass
},
_cleanView: function() {
this.callBase();
this._cleanDateTimeIndicator()
},
_dimensionChanged: function() {
this.callBase();
this._refreshDateTimeIndication()
},
_cleanDateTimeIndicator: function() {
this.$element().find("." + SCHEDULER_DATE_TIME_INDICATOR_CLASS).remove()
},
_cleanWorkSpace: function() {
this.callBase();
this._renderDateTimeIndication();
this._setIndicationUpdateInterval()
},
_optionChanged: function(args) {
switch (args.name) {
case "showCurrentTimeIndicator":
case "indicatorTime":
this._cleanWorkSpace();
break;
case "indicatorUpdateInterval":
this._setIndicationUpdateInterval();
break;
case "showAllDayPanel":
this.callBase(args);
this._refreshDateTimeIndication();
break;
case "allDayExpanded":
this.callBase(args);
this._refreshDateTimeIndication();
break;
case "crossScrollingEnabled":
this.callBase(args);
this._refreshDateTimeIndication();
break;
case "shadeUntilCurrentTime":
this._refreshDateTimeIndication();
break;
default:
this.callBase(args)
}
},
_getDefaultOptions: function() {
return (0, _extend.extend)(this.callBase(), {
showCurrentTimeIndicator: true,
indicatorTime: new Date,
indicatorUpdateInterval: 5 * toMs("minute"),
shadeUntilCurrentTime: true
})
}
});
(0, _component_registrator2.default)("dxSchedulerWorkSpace", SchedulerWorkSpaceIndicator);
module.exports = SchedulerWorkSpaceIndicator
},
/*!************************************************************************!*\
!*** ./artifacts/transpiled/ui/file_manager/ui.file_manager.common.js ***!
\************************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _deferred = __webpack_require__( /*! ../../core/utils/deferred */ 6);
var _common = __webpack_require__( /*! ../../core/utils/common */ 4);
var _type = __webpack_require__( /*! ../../core/utils/type */ 1);
var _type2 = _interopRequireDefault(_type);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var ErrorCode = {
NoAccess: 0,
FileExists: 1,
FileNotFound: 2,
DirectoryExists: 3,
Other: 32767
};
var whenSome = function(arg, onSuccess, onError) {
onSuccess = onSuccess || _common.noop;
onError = onError || _common.noop;
if (!Array.isArray(arg)) {
arg = [arg]
}
var deferreds = arg.map(function(item, index) {
return (0, _deferred.when)(item).then(function() {
_type2.default.isFunction(onSuccess) && onSuccess()
}, function(error) {
if (!error) {
error = {}
}
error.index = index;
_type2.default.isFunction(onError) && onError(error)
})
});
return _deferred.when.apply(null, deferreds)
};
module.exports = whenSome;
module.exports.ErrorCode = ErrorCode
},
/*!*************************************************************!*\
!*** ./artifacts/transpiled/ui/diagram/diagram_importer.js ***!
\*************************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getDiagram = void 0;
var _ui = __webpack_require__( /*! ../widget/ui.errors */ 17);
var _ui2 = _interopRequireDefault(_ui);
var _window = __webpack_require__( /*! ../../core/utils/window */ 7);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var diagram;
function getDiagram() {
if (!diagram) {
diagram = requestDiagram()
}
return diagram
}
function requestDiagram() {
var window = (0, _window.getWindow)();
var diagram = window && window.DevExpress && window.DevExpress.diagram || __webpack_require__( /*! devexpress-diagram */ 745);
if (!diagram) {
throw _ui2.default.Error("E1041", "devexpress-diagram")
}
return diagram
}
exports.getDiagram = getDiagram
}, , , , , , ,
/*!*****************************************************!*\
!*** ./artifacts/transpiled/exporter/file_saver.js ***!
\*****************************************************/
/*! dynamic exports provided */
/*! all exports used */
function(module, exports, __webpack_require__) {
var _renderer = __webpack_require__( /*! ../core/renderer */ 2);
var _renderer2 = _interopRequireDefault(_renderer);
var _dom_adapter = __webpack_require__( /*! ../core/dom_adapter */ 11);
var _dom_adapter2 = _interopRequireDefault(_dom_adapter);
var _window = __webpack_require__( /*! ../core/utils/window */ 7);
var _window2 = _interopRequireDefault(_window);
var _events_engine = __webpack_require__( /*! ../events/core/events_engine */ 5);
var _events_engine2 = _interopRequireDefault(_events_engine);
var _ui = __webpack_require__( /*! ../ui/widget/ui.errors */ 17);
var _ui2 = _interopRequireDefault(_ui);
var _type = __webpack_require__( /*! ../core/utils/type */ 1);
var _type2 = _interopRequireDefault(_type);
var _console = __webpack_require__( /*! ../core/utils/console */ 73);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
}
}
var window = _window2.default.getWindow();
var navigator = _window2.default.getNavigator();
var FILE_EXTESIONS = {
EXCEL: "xlsx",
CSS: "css",
PNG: "png",
JPEG: "jpeg",
GIF: "gif",
SVG: "svg",
PDF: "pdf"
};
var MIME_TYPES = exports.MIME_TYPES = {
CSS: "text/css",
EXCEL: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
PNG: "image/png",
JPEG: "image/jpeg",
GIF: "image/gif",
SVG: "image/svg+xml",
PDF: "application/pdf"
};
exports.fileSaver = {
_revokeObjectURLTimeout: 3e4,
_getDataUri: function(format, data) {
return "data:" + MIME_TYPES[format] + ";base64," + data
},
_linkDownloader: function(fileName, href) {
var exportLinkElement = _dom_adapter2.default.createElement("a");
exportLinkElement.download = fileName;
exportLinkElement.href = href;
exportLinkElement.target = "_blank";
return exportLinkElement
},
_formDownloader: function(proxyUrl, fileName, contentType, data) {
var formAttributes = {
method: "post",
action: proxyUrl,
enctype: "multipart/form-data"
};
var exportForm = (0, _renderer2.default)("