gd-bs 6.0.4 → 6.0.6
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.
- package/build/components/form/control.js +23 -20
- package/build/components/modal/templates.js +1 -1
- package/build/components/offcanvas/templates.js +1 -1
- package/dist/gd-bs-icons.js +1 -1
- package/dist/gd-bs-icons.min.js +1 -1
- package/dist/gd-bs.js +1 -1
- package/dist/gd-bs.min.js +1 -1
- package/package.json +1 -1
- package/src/components/form/control.ts +24 -20
- package/src/components/form/custom.ts +3 -2
- package/src/components/modal/templates.ts +1 -1
- package/src/components/offcanvas/templates.ts +1 -1
|
@@ -96,6 +96,9 @@ var FormControl = /** @class */ (function () {
|
|
|
96
96
|
var _this = this;
|
|
97
97
|
// Parse the custom classes to add
|
|
98
98
|
var className = [(this._props.className || ""), (this._props.controlClassName || "")].join(" ").trim();
|
|
99
|
+
// Set the value
|
|
100
|
+
var formValue = this._formProps.value ? this._formProps.value[this._props.name] : null;
|
|
101
|
+
var value = typeof (this._props.value) === "undefined" ? formValue : this._props.value;
|
|
99
102
|
// Render the control based on the type
|
|
100
103
|
switch (this._props.type) {
|
|
101
104
|
// Checkbox
|
|
@@ -114,7 +117,7 @@ var FormControl = /** @class */ (function () {
|
|
|
114
117
|
renderRow: cbProps.renderRow,
|
|
115
118
|
title: this._props.title,
|
|
116
119
|
type: checkboxGroup_1.CheckboxGroupTypes.Checkbox,
|
|
117
|
-
value:
|
|
120
|
+
value: value
|
|
118
121
|
});
|
|
119
122
|
break;
|
|
120
123
|
// Color Picker
|
|
@@ -129,7 +132,7 @@ var FormControl = /** @class */ (function () {
|
|
|
129
132
|
placeholder: this._props.placeholder,
|
|
130
133
|
title: this._props.title,
|
|
131
134
|
type: inputGroup_1.InputGroupTypes.ColorPicker,
|
|
132
|
-
value:
|
|
135
|
+
value: value
|
|
133
136
|
});
|
|
134
137
|
break;
|
|
135
138
|
// Datalist
|
|
@@ -144,7 +147,7 @@ var FormControl = /** @class */ (function () {
|
|
|
144
147
|
items: this._props.items,
|
|
145
148
|
onChange: this._props.onChange,
|
|
146
149
|
title: this._props.title,
|
|
147
|
-
value:
|
|
150
|
+
value: value
|
|
148
151
|
});
|
|
149
152
|
break;
|
|
150
153
|
// Dropdown
|
|
@@ -159,7 +162,7 @@ var FormControl = /** @class */ (function () {
|
|
|
159
162
|
onChange: this._props.onChange,
|
|
160
163
|
onMenuRendering: this._props.onMenuRendering,
|
|
161
164
|
title: this._props.title,
|
|
162
|
-
value:
|
|
165
|
+
value: value
|
|
163
166
|
});
|
|
164
167
|
break;
|
|
165
168
|
// Email
|
|
@@ -174,7 +177,7 @@ var FormControl = /** @class */ (function () {
|
|
|
174
177
|
placeholder: this._props.placeholder,
|
|
175
178
|
title: this._props.title,
|
|
176
179
|
type: inputGroup_1.InputGroupTypes.Email,
|
|
177
|
-
value:
|
|
180
|
+
value: value
|
|
178
181
|
});
|
|
179
182
|
break;
|
|
180
183
|
// File
|
|
@@ -189,7 +192,7 @@ var FormControl = /** @class */ (function () {
|
|
|
189
192
|
placeholder: this._props.placeholder,
|
|
190
193
|
title: this._props.title,
|
|
191
194
|
type: inputGroup_1.InputGroupTypes.File,
|
|
192
|
-
value:
|
|
195
|
+
value: value
|
|
193
196
|
});
|
|
194
197
|
break;
|
|
195
198
|
// List Box
|
|
@@ -201,7 +204,7 @@ var FormControl = /** @class */ (function () {
|
|
|
201
204
|
items: this._props.items,
|
|
202
205
|
onChange: this._props.onChange,
|
|
203
206
|
placeholder: this._props.placeholder,
|
|
204
|
-
value:
|
|
207
|
+
value: value
|
|
205
208
|
});
|
|
206
209
|
break;
|
|
207
210
|
// Multi-Checkbox
|
|
@@ -221,7 +224,7 @@ var FormControl = /** @class */ (function () {
|
|
|
221
224
|
renderRow: cbMultiProps.renderRow,
|
|
222
225
|
title: this._props.title,
|
|
223
226
|
type: checkboxGroup_1.CheckboxGroupTypes.Checkbox,
|
|
224
|
-
value:
|
|
227
|
+
value: value
|
|
225
228
|
});
|
|
226
229
|
break;
|
|
227
230
|
// Multi-Dropdown
|
|
@@ -237,7 +240,7 @@ var FormControl = /** @class */ (function () {
|
|
|
237
240
|
onChange: this._props.onChange,
|
|
238
241
|
onMenuRendering: this._props.onMenuRendering,
|
|
239
242
|
title: this._props.title,
|
|
240
|
-
value:
|
|
243
|
+
value: value
|
|
241
244
|
});
|
|
242
245
|
break;
|
|
243
246
|
// Multi-List Box
|
|
@@ -250,7 +253,7 @@ var FormControl = /** @class */ (function () {
|
|
|
250
253
|
multi: true,
|
|
251
254
|
onChange: this._props.onChange,
|
|
252
255
|
placeholder: this._props.placeholder,
|
|
253
|
-
value:
|
|
256
|
+
value: value
|
|
254
257
|
});
|
|
255
258
|
break;
|
|
256
259
|
// Multi-Radio
|
|
@@ -268,7 +271,7 @@ var FormControl = /** @class */ (function () {
|
|
|
268
271
|
renderRow: this._props.renderRow,
|
|
269
272
|
title: this._props.title,
|
|
270
273
|
type: checkboxGroup_1.CheckboxGroupTypes.Radio,
|
|
271
|
-
value:
|
|
274
|
+
value: value
|
|
272
275
|
});
|
|
273
276
|
break;
|
|
274
277
|
// Multi-Switch
|
|
@@ -286,7 +289,7 @@ var FormControl = /** @class */ (function () {
|
|
|
286
289
|
renderRow: this._props.renderRow,
|
|
287
290
|
title: this._props.title,
|
|
288
291
|
type: checkboxGroup_1.CheckboxGroupTypes.Switch,
|
|
289
|
-
value:
|
|
292
|
+
value: value
|
|
290
293
|
});
|
|
291
294
|
break;
|
|
292
295
|
// Password
|
|
@@ -301,7 +304,7 @@ var FormControl = /** @class */ (function () {
|
|
|
301
304
|
placeholder: this._props.placeholder,
|
|
302
305
|
title: this._props.title,
|
|
303
306
|
type: inputGroup_1.InputGroupTypes.Password,
|
|
304
|
-
value:
|
|
307
|
+
value: value
|
|
305
308
|
});
|
|
306
309
|
break;
|
|
307
310
|
// Radio
|
|
@@ -318,7 +321,7 @@ var FormControl = /** @class */ (function () {
|
|
|
318
321
|
renderRow: this._props.renderRow,
|
|
319
322
|
title: this._props.title,
|
|
320
323
|
type: checkboxGroup_1.CheckboxGroupTypes.Radio,
|
|
321
|
-
value:
|
|
324
|
+
value: value
|
|
322
325
|
});
|
|
323
326
|
break;
|
|
324
327
|
// Range
|
|
@@ -336,7 +339,7 @@ var FormControl = /** @class */ (function () {
|
|
|
336
339
|
step: this._props.step,
|
|
337
340
|
title: this._props.title,
|
|
338
341
|
type: inputGroup_1.InputGroupTypes.Range,
|
|
339
|
-
value:
|
|
342
|
+
value: value
|
|
340
343
|
});
|
|
341
344
|
break;
|
|
342
345
|
// Read Only
|
|
@@ -350,7 +353,7 @@ var FormControl = /** @class */ (function () {
|
|
|
350
353
|
placeholder: this._props.placeholder,
|
|
351
354
|
title: this._props.title,
|
|
352
355
|
type: inputGroup_1.InputGroupTypes.TextField,
|
|
353
|
-
value:
|
|
356
|
+
value: value
|
|
354
357
|
});
|
|
355
358
|
break;
|
|
356
359
|
// Switch
|
|
@@ -367,7 +370,7 @@ var FormControl = /** @class */ (function () {
|
|
|
367
370
|
renderRow: this._props.renderRow,
|
|
368
371
|
title: this._props.title,
|
|
369
372
|
type: checkboxGroup_1.CheckboxGroupTypes.Switch,
|
|
370
|
-
value:
|
|
373
|
+
value: value
|
|
371
374
|
});
|
|
372
375
|
break;
|
|
373
376
|
// Text Area
|
|
@@ -383,7 +386,7 @@ var FormControl = /** @class */ (function () {
|
|
|
383
386
|
rows: this._props.rows,
|
|
384
387
|
title: this._props.title,
|
|
385
388
|
type: inputGroup_1.InputGroupTypes.TextArea,
|
|
386
|
-
value:
|
|
389
|
+
value: value
|
|
387
390
|
});
|
|
388
391
|
break;
|
|
389
392
|
// Text Field
|
|
@@ -398,7 +401,7 @@ var FormControl = /** @class */ (function () {
|
|
|
398
401
|
placeholder: this._props.placeholder,
|
|
399
402
|
title: this._props.title,
|
|
400
403
|
type: inputGroup_1.InputGroupTypes.TextField,
|
|
401
|
-
value:
|
|
404
|
+
value: value
|
|
402
405
|
});
|
|
403
406
|
break;
|
|
404
407
|
// Custom Type
|
|
@@ -410,7 +413,7 @@ var FormControl = /** @class */ (function () {
|
|
|
410
413
|
var custom = custom_1.CustomControls.getByType(this._props.type);
|
|
411
414
|
if (custom && typeof (custom) === "function") {
|
|
412
415
|
// Execute the event
|
|
413
|
-
this._custom = custom(this._props);
|
|
416
|
+
this._custom = custom(this._props, this._formProps);
|
|
414
417
|
}
|
|
415
418
|
break;
|
|
416
419
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HTML = void 0;
|
|
4
|
-
exports.HTML = "\n<div class=\"modal\" tabindex=\"-1\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <
|
|
4
|
+
exports.HTML = "\n<div class=\"modal\" tabindex=\"-1\" aria-hidden=\"true\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <div class=\"modal-title fs-5\"></div>\n <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" area-label=\"Close\"></button>\n </div>\n <div class=\"modal-body\"></div>\n <div class=\"modal-footer\"></div>\n </div>\n </div>\n</div>".trim();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.HTML = void 0;
|
|
4
|
-
exports.HTML = "\n<div class=\"offcanvas\" tabindex=\"-1\">\n <div class=\"offcanvas-header\">\n <div></div>\n <button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>\n </div>\n <div class=\"offcanvas-body\"></div>\n</div>".trim();
|
|
4
|
+
exports.HTML = "\n<div class=\"offcanvas\" tabindex=\"-1\">\n <div class=\"offcanvas-header\">\n <div class=\"fs-5\"></div>\n <button type=\"button\" class=\"btn-close text-reset\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\"></button>\n </div>\n <div class=\"offcanvas-body\"></div>\n</div>".trim();
|