| 12345678910111213141516171819202122232425262728293031323334353637 |
- /**
- * DevExtreme (integration/knockout/components.js)
- * Version: 19.1.16
- * Build date: Tue Oct 18 2022
- *
- * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
- * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
- */
- "use strict";
- var ko = require("knockout");
- var iconUtils = require("../../core/utils/icon");
- ko.bindingHandlers.dxControlsDescendantBindings = {
- init: function(_, valueAccessor) {
- return {
- controlsDescendantBindings: ko.unwrap(valueAccessor())
- }
- }
- };
- ko.bindingHandlers.dxIcon = {
- init: function(element, valueAccessor) {
- var options = ko.utils.unwrapObservable(valueAccessor()) || {};
- var iconElement = iconUtils.getImageContainer(options);
- ko.virtualElements.emptyNode(element);
- if (iconElement) {
- ko.virtualElements.prepend(element, iconElement.get(0))
- }
- },
- update: function(element, valueAccessor) {
- var options = ko.utils.unwrapObservable(valueAccessor()) || {};
- var iconElement = iconUtils.getImageContainer(options);
- ko.virtualElements.emptyNode(element);
- if (iconElement) {
- ko.virtualElements.prepend(element, iconElement.get(0))
- }
- }
- };
- ko.virtualElements.allowedBindings.dxIcon = true;
|