@indigina/ui-kit 1.0.44 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1921,6 +1921,103 @@
1921
1921
  },] }
1922
1922
  ];
1923
1923
 
1924
+ var KitToggleComponent = /** @class */ (function () {
1925
+ function KitToggleComponent() {
1926
+ /**
1927
+ * Defines whether the component will be in disabled state
1928
+ */
1929
+ this.disabled = false;
1930
+ /**
1931
+ * Defines a default value
1932
+ */
1933
+ this.defaultChecked = false;
1934
+ /**
1935
+ * Defines a value which going to be an info message type
1936
+ */
1937
+ this.messageType = exports.KitInputMessageType.DEFAULT;
1938
+ /**
1939
+ * Occurs as soon as toggle state is changed
1940
+ */
1941
+ this.changed = new core.EventEmitter();
1942
+ /**
1943
+ * Function that should be called every time the form control value changes
1944
+ */
1945
+ this.onChange = function (value) {
1946
+ };
1947
+ /**
1948
+ * Function that should be called when input lost focus and changed form control state to "touched"
1949
+ */
1950
+ this.onTouched = function () {
1951
+ };
1952
+ }
1953
+ /**
1954
+ * Function that is called when toggle state changed
1955
+ */
1956
+ KitToggleComponent.prototype.onInputStateChange = function (checked) {
1957
+ this.onChange(checked);
1958
+ this.changed.emit(checked);
1959
+ };
1960
+ KitToggleComponent.prototype.registerOnChange = function (fn) {
1961
+ this.onChange = fn;
1962
+ };
1963
+ KitToggleComponent.prototype.registerOnTouched = function (fn) {
1964
+ this.onTouched = fn;
1965
+ };
1966
+ KitToggleComponent.prototype.writeValue = function (value) {
1967
+ this.onChange(value);
1968
+ this.defaultChecked = value;
1969
+ };
1970
+ KitToggleComponent.prototype.setDisabledState = function (disabled) {
1971
+ this.disabled = disabled;
1972
+ };
1973
+ return KitToggleComponent;
1974
+ }());
1975
+ KitToggleComponent.decorators = [
1976
+ { type: core.Component, args: [{
1977
+ selector: 'kit-toggle',
1978
+ template: "<div class=\"kit-toggle\">\n <div class=\"display-flex flex-align-items-center\">\n <kendo-switch [checked]=\"defaultChecked\"\n [disabled]=\"disabled\"\n (valueChange)=\"onInputStateChange($event)\"\n ></kendo-switch>\n <kendo-label class=\"label\" [text]=\"label\"></kendo-label>\n </div>\n <kit-input-message *ngIf=\"messageText\"\n [type]=\"messageType\"\n [icon]=\"messageIcon\"\n [message]=\"messageText\"\n ></kit-input-message>\n</div>\n",
1979
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
1980
+ encapsulation: core.ViewEncapsulation.None,
1981
+ providers: [{
1982
+ provide: forms.NG_VALUE_ACCESSOR,
1983
+ useExisting: core.forwardRef(function () { return KitToggleComponent; }),
1984
+ multi: true,
1985
+ }],
1986
+ styles: [".display-flex{display:flex}.flex-align-items-center{align-items:center}.flex-justify-content-center{justify-content:center}.flex-justify-content-end{justify-content:flex-end}.display-block{display:block}.kit-toggle .label{color:#27282a;font-size:14px;font-weight:400;margin-left:20px}.kit-toggle .k-switch-container{align-items:center;background:#fff;border:2px solid;border-radius:20px;box-shadow:none;display:flex;width:100%}.kit-toggle .k-switch-handle{border:none;height:8px;width:8px}.kit-toggle .k-switch-label-off,.kit-toggle .k-switch-label-on{display:none}.kit-toggle .k-state-focused .k-switch-container{box-shadow:none}.kit-toggle .k-switch-off .k-switch-container{border-color:#c1c7d0}.kit-toggle .k-switch-off .k-switch-handle{background:#c1c7d0;left:2px}.kit-toggle .k-switch-on .k-switch-container{background:#fff;border-color:#006890}.kit-toggle .k-switch-on .k-switch-handle{background:#006890;left:calc(100% - 10px)}.kit-toggle .k-switch{height:16px;width:32px}.kit-toggle .k-switch .k-switch-container:hover{box-shadow:none}.kit-toggle .k-state-disabled{opacity:1}.kit-toggle .k-state-disabled.k-switch-off .k-switch-container{border-color:#e6e9ec}.kit-toggle .k-state-disabled.k-switch-off .k-switch-handle{background:#e6e9ec}.kit-toggle .k-state-disabled.k-switch-on .k-switch-container{border-color:#cce1e9}.kit-toggle .k-state-disabled.k-switch-on .k-switch-handle{background:#cce1e9}"]
1987
+ },] }
1988
+ ];
1989
+ KitToggleComponent.propDecorators = {
1990
+ label: [{ type: core.Input }],
1991
+ disabled: [{ type: core.Input }],
1992
+ defaultChecked: [{ type: core.Input }],
1993
+ messageIcon: [{ type: core.Input }],
1994
+ messageText: [{ type: core.Input }],
1995
+ messageType: [{ type: core.Input }],
1996
+ changed: [{ type: core.Output }]
1997
+ };
1998
+
1999
+ var KitToggleModule = /** @class */ (function () {
2000
+ function KitToggleModule() {
2001
+ }
2002
+ return KitToggleModule;
2003
+ }());
2004
+ KitToggleModule.decorators = [
2005
+ { type: core.NgModule, args: [{
2006
+ declarations: [
2007
+ KitToggleComponent,
2008
+ ],
2009
+ imports: [
2010
+ common.CommonModule,
2011
+ kendoAngularInputs.SwitchModule,
2012
+ kendoAngularLabel.LabelModule,
2013
+ KitInputMessageModule,
2014
+ ],
2015
+ exports: [
2016
+ KitToggleComponent,
2017
+ ],
2018
+ },] }
2019
+ ];
2020
+
1924
2021
  // KitButton
1925
2022
 
1926
2023
  /**
@@ -1967,6 +2064,8 @@
1967
2064
  exports.KitTextareaModule = KitTextareaModule;
1968
2065
  exports.KitTextboxComponent = KitTextboxComponent;
1969
2066
  exports.KitTextboxModule = KitTextboxModule;
2067
+ exports.KitToggleComponent = KitToggleComponent;
2068
+ exports.KitToggleModule = KitToggleModule;
1970
2069
  exports.KitUnitsTextboxComponent = KitUnitsTextboxComponent;
1971
2070
  exports.KitUnitsTextboxModule = KitUnitsTextboxModule;
1972
2071
  exports.ɵa = KitSvgSpriteComponent;