jsl-ui 9.19.9 → 9.20.1

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.
@@ -4,6 +4,7 @@ import { IDatePickerOptions } from "../../ui/date.picker";
4
4
  import { INumberInputOptions } from "../../ui/number.input";
5
5
  import { IAutoSuggestOptions } from "../../ui/auto.suggest";
6
6
  export interface IFormFieldOptions {
7
+ disabled?: boolean;
7
8
  id?: string;
8
9
  label: string;
9
10
  type?: "text" | "password" | "date" | "number" | "autosuggest";
@@ -35,7 +35,8 @@ var FormFieldComponent = /** @class */ (function () {
35
35
  class: "form-field__input",
36
36
  blur: this.setInActive,
37
37
  focus: this.setActive,
38
- input: this.onInput
38
+ input: this.onInput,
39
+ disabled: this.options.disabled ? "disabled" : undefined
39
40
  }
40
41
  }
41
42
  ]
@@ -31,7 +31,7 @@ export declare class TabsComponent implements IJSLComponent {
31
31
  EnableAll(): void;
32
32
  DisableAll(): void;
33
33
  GetByID(id: string): ITabItemOption;
34
- closeTabIndex(index: number): void;
34
+ closeTabIndex(index: number): boolean;
35
35
  onInit(renderer: JSLRender): void;
36
36
  SetSelectedTab(index: number): void;
37
37
  private toNode;
@@ -8,6 +8,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
8
8
  return to.concat(ar || Array.prototype.slice.call(from));
9
9
  };
10
10
  import "./TabsStyle.scss";
11
+ import { refresh } from "jsl-render";
11
12
  import { helper } from "../../core/helper";
12
13
  var TabsComponent = /** @class */ (function () {
13
14
  function TabsComponent(options) {
@@ -80,10 +81,17 @@ var TabsComponent = /** @class */ (function () {
80
81
  {
81
82
  tag: "div", attr: {
82
83
  class: "close-button", click: function (evt) {
83
- var _a;
84
+ var _a, _b, _c;
84
85
  if ((_a = _this.options.tabs[currIndex].enabled) !== null && _a !== void 0 ? _a : true) {
85
86
  evt.stopPropagation();
86
- _this.closeTabIndex(currIndex);
87
+ if (_this.closeTabIndex(currIndex)) {
88
+ if (_this.options.tabs.length <= ((_b = _this.State.selectedIndex) !== null && _b !== void 0 ? _b : _this.options.selectedIndex)) {
89
+ _this.SetSelectedTab(((_c = _this.State.selectedIndex) !== null && _c !== void 0 ? _c : _this.options.selectedIndex) - 1);
90
+ }
91
+ if (_this.options.onSelect) {
92
+ _this.options.onSelect(currIndex);
93
+ }
94
+ }
87
95
  }
88
96
  }
89
97
  }, content: "X"
@@ -108,13 +116,23 @@ var TabsComponent = /** @class */ (function () {
108
116
  for (var i = 0; i < this.options.tabs.length; i++) {
109
117
  this.options.tabs[i].enabled = true;
110
118
  }
111
- this.renderer.refresh();
119
+ if (this.renderer != null) {
120
+ this.renderer.refresh();
121
+ }
122
+ else {
123
+ refresh();
124
+ }
112
125
  };
113
126
  TabsComponent.prototype.DisableAll = function () {
114
127
  for (var i = 0; i < this.options.tabs.length; i++) {
115
128
  this.options.tabs[i].enabled = false;
116
129
  }
117
- this.renderer.refresh();
130
+ if (this.renderer != null) {
131
+ this.renderer.refresh();
132
+ }
133
+ else {
134
+ refresh();
135
+ }
118
136
  };
119
137
  TabsComponent.prototype.GetByID = function (id) {
120
138
  return this.options.tabs.filter(function (f) { return f.id === id; })[0];
@@ -124,7 +142,7 @@ var TabsComponent = /** @class */ (function () {
124
142
  // console.log("closing tab index " + index);
125
143
  if (this.options.tabs[index].onClosing) {
126
144
  if (this.options.tabs[index].onClosing() === false) {
127
- return;
145
+ return false;
128
146
  }
129
147
  }
130
148
  var currIdx = 0;
@@ -132,6 +150,7 @@ var TabsComponent = /** @class */ (function () {
132
150
  if (this.options.tabs.length <= ((_a = this.State.selectedIndex) !== null && _a !== void 0 ? _a : this.options.selectedIndex)) {
133
151
  this.SetSelectedTab(((_b = this.State.selectedIndex) !== null && _b !== void 0 ? _b : this.options.selectedIndex) - 1);
134
152
  }
153
+ return true;
135
154
  };
136
155
  // public onCreate(node: IJSLVNode) {
137
156
  // this.ref = node.dom as HTMLDivElement;
@@ -149,7 +168,12 @@ var TabsComponent = /** @class */ (function () {
149
168
  }
150
169
  this.options.selectedIndex = index;
151
170
  this.State.selectedIndex = index;
152
- this.renderer.refresh();
171
+ if (this.renderer != null) {
172
+ this.renderer.refresh();
173
+ }
174
+ else {
175
+ refresh();
176
+ }
153
177
  };
154
178
  TabsComponent.prototype.toNode = function (content, tag) {
155
179
  if (content == null) {