@@ -47812,6 +47812,76 @@ CUI.CodeInput = (function(superClass) {
47812
47812
})(CUI.Input);
47813
47813
47814
47814
47815
+ /***/ }),
47816
+
47817
+ /***/ "./elements/Input/ColorInput.coffee":
47818
+ /*!******************************************!*\
47819
+ !*** ./elements/Input/ColorInput.coffee ***!
47820
+ \******************************************/
47821
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
47822
+
47823
+ /* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee");
47824
+
47825
+ /*
47826
+ * coffeescript-ui - Coffeescript User Interface System (CUI)
47827
+ * Copyright (c) 2013 - 2025 Programmfabrik GmbH
47828
+ * MIT Licence
47829
+ * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
47830
+ */
47831
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
47832
+ hasProp = {}.hasOwnProperty;
47833
+
47834
+ CUI.ColorInput = (function(superClass) {
47835
+ extend(ColorInput, superClass);
47836
+
47837
+ function ColorInput() {
47838
+ return ColorInput.__super__.constructor.apply(this, arguments);
47839
+ }
47840
+
47841
+ ColorInput.prototype.initOpts = function() {
47842
+ return ColorInput.__super__.initOpts.call(this);
47843
+ };
47844
+
47845
+ ColorInput.prototype.readOpts = function() {
47846
+ this.opts.leftControlElement = new CUI.Button({
47847
+ onClick: (function(_this) {
47848
+ return function(ev, btn) {
47849
+ return _this.__input.focus();
47850
+ };
47851
+ })(this)
47852
+ });
47853
+ return ColorInput.__super__.readOpts.call(this);
47854
+ };
47855
+
47856
+ ColorInput.prototype.onDataChanged = function(ev, info) {
47857
+ ColorInput.__super__.onDataChanged.call(this, ev, info);
47858
+ return this.__toggleColor();
47859
+ };
47860
+
47861
+ ColorInput.prototype.initValue = function() {
47862
+ ColorInput.__super__.initValue.call(this);
47863
+ if (!this.__data[this._name] || this.__data[this._name].length === 0) {
47864
+ return this._leftControlElement.hide(true);
47865
+ } else {
47866
+ this._leftControlElement.DOM.style.backgroundColor = this.__data[this._name];
47867
+ return this._leftControlElement.show(true);
47868
+ }
47869
+ };
47870
+
47871
+ ColorInput.prototype.__toggleColor = function() {
47872
+ if (this.__input.value.length > 0 && this.__checkInputInternal()) {
47873
+ this._leftControlElement.DOM.style.backgroundColor = this.__input.value;
47874
+ return this._leftControlElement.show(true);
47875
+ } else {
47876
+ return this._leftControlElement.hide(true);
47877
+ }
47878
+ };
47879
+
47880
+ return ColorInput;
47881
+
47882
+ })(CUI.Input);
47883
+
47884
+
47815
47885
/***/ }),
47816
47886
47817
47887
/***/ "./elements/Input/EmailInput.coffee":
@@ -47874,6 +47944,77 @@ CUI.EmailInput = (function(superClass) {
47874
47944
})(CUI.Input);
47875
47945
47876
47946
47947
+ /***/ }),
47948
+
47949
+ /***/ "./elements/Input/IconInput.coffee":
47950
+ /*!*****************************************!*\
47951
+ !*** ./elements/Input/IconInput.coffee ***!
47952
+ \*****************************************/
47953
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
47954
+
47955
+ /* provided dependency */ var CUI = __webpack_require__(/*! ./base/CUI.coffee */ "./base/CUI.coffee");
47956
+
47957
+ /*
47958
+ * coffeescript-ui - Coffeescript User Interface System (CUI)
47959
+ * Copyright (c) 2013 - 2025 Programmfabrik GmbH
47960
+ * MIT Licence
47961
+ * https://github.com/programmfabrik/coffeescript-ui, http://www.coffeescript-ui.org
47962
+ */
47963
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
47964
+ hasProp = {}.hasOwnProperty;
47965
+
47966
+ CUI.IconInput = (function(superClass) {
47967
+ extend(IconInput, superClass);
47968
+
47969
+ function IconInput() {
47970
+ return IconInput.__super__.constructor.apply(this, arguments);
47971
+ }
47972
+
47973
+ IconInput.prototype.initOpts = function() {
47974
+ return IconInput.__super__.initOpts.call(this);
47975
+ };
47976
+
47977
+ IconInput.prototype.readOpts = function() {
47978
+ this.opts.leftControlElement = new CUI.Button({
47979
+ icon: "fa-star",
47980
+ onClick: (function(_this) {
47981
+ return function(ev, btn) {
47982
+ return _this.__input.focus();
47983
+ };
47984
+ })(this)
47985
+ });
47986
+ return IconInput.__super__.readOpts.call(this);
47987
+ };
47988
+
47989
+ IconInput.prototype.onDataChanged = function(ev, info) {
47990
+ IconInput.__super__.onDataChanged.call(this, ev, info);
47991
+ return this.__toggleIcon();
47992
+ };
47993
+
47994
+ IconInput.prototype.initValue = function() {
47995
+ IconInput.__super__.initValue.call(this);
47996
+ if (!this.__data[this._name] || this.__data[this._name].length === 0) {
47997
+ return this._leftControlElement.hide(true);
47998
+ } else {
47999
+ return this._leftControlElement.setIcon(this.__data[this._name]);
48000
+ }
48001
+ };
48002
+
48003
+ IconInput.prototype.__toggleIcon = function() {
48004
+ if (this.__input.value.length > 0) {
48005
+ this._leftControlElement.setIcon(this.__input.value);
48006
+ return this._leftControlElement.show(true);
48007
+ } else {
48008
+ this._leftControlElement.setIcon("");
48009
+ return this._leftControlElement.hide(true);
48010
+ }
48011
+ };
48012
+
48013
+ return IconInput;
48014
+
48015
+ })(CUI.Input);
48016
+
48017
+
47877
48018
/***/ }),
47878
48019
47879
48020
/***/ "./elements/Input/Input.coffee":
@@ -48083,6 +48224,11 @@ CUI.Input = (function(superClass) {
48083
48224
check: function(v) {
48084
48225
return v instanceof CUI.DOMElement;
48085
48226
}
48227
+ },
48228
+ leftControlElement: {
48229
+ check: function(v) {
48230
+ return v instanceof CUI.DOMElement;
48231
+ }
48086
48232
}
48087
48233
});
48088
48234
};
@@ -48953,6 +49099,10 @@ CUI.Input = (function(superClass) {
48953
49099
CUI.dom.addClass(this._controlElement, 'cui-input-control-element');
48954
49100
this.append(this._controlElement, this.getTemplateKeyForRender());
48955
49101
}
49102
+ if (this._leftControlElement) {
49103
+ CUI.dom.addClass(this._leftControlElement, 'cui-input-control-element');
49104
+ this.prepend(this._leftControlElement, this.getTemplateKeyForRender());
49105
+ }
48956
49106
ref = ["empty", "invalid", "valid"];
48957
49107
for (j = 0, len1 = ref.length; j < len1; j++) {
48958
49108
k = ref[j];
@@ -63703,6 +63853,10 @@ __webpack_require__(/*! ./elements/Input/NumberInput.coffee */ "./elements/Input
63703
63853
63704
63854
__webpack_require__(/*! ./elements/Input/EmailInput.coffee */ "./elements/Input/EmailInput.coffee");
63705
63855
63856
+ __webpack_require__(/*! ./elements/Input/IconInput.coffee */ "./elements/Input/IconInput.coffee");
63857
+
63858
+ __webpack_require__(/*! ./elements/Input/ColorInput.coffee */ "./elements/Input/ColorInput.coffee");
63859
+
63706
63860
__webpack_require__(/*! ./elements/Input/CodeInput.coffee */ "./elements/Input/CodeInput.coffee");
63707
63861
63708
63862
__webpack_require__(/*! ./elements/DateTime/DateTime.coffee */ "./elements/DateTime/DateTime.coffee");
0 commit comments