From 718beee739ae507b972d48ef98030eb565dddba0 Mon Sep 17 00:00:00 2001 From: grainsoft Date: Tue, 2 Dec 2025 02:06:05 +0200 Subject: [PATCH] updates --- src/utils/AppendOptions.js | 22 ++++++--------------- src/utils/Form.js | 4 +--- src/utils/Options.js | 4 +--- src/utils/form-validator/FormValidator.js | 4 +--- src/utils/form-validator/InputError.js | 4 +--- src/widgets/autocomplete/Autocomplete.js | 4 +--- src/widgets/cancelable/Cancelable.js | 4 +--- src/widgets/date-picker/DatePicker.js | 4 +--- src/widgets/dropdown/Dropdown.js | 4 +--- src/widgets/lightbox/Lightbox.js | 4 +--- src/widgets/pin-box/PinBox.js | 4 +--- src/widgets/popover/Popover.js | 4 +--- src/widgets/popup/Popup.js | 4 +--- src/widgets/table/Table.js | 4 +--- src/widgets/two-datepicker/TwoDatepicker.js | 4 +--- src/widgets/uploader/Uploader.js | 4 +--- 16 files changed, 21 insertions(+), 61 deletions(-) diff --git a/src/utils/AppendOptions.js b/src/utils/AppendOptions.js index 257bb9a..1a4bf00 100644 --- a/src/utils/AppendOptions.js +++ b/src/utils/AppendOptions.js @@ -1,25 +1,15 @@ -//import { Ut } from "."; +import { Ut } from "."; export class AppendOptions { constructor(target, data, opts) { - + opts = opts || {}; if (opts.clear) { - this.dxHtml(''); - } - - if (typeof data === 'string') { - Object.entries(JSON.parse(data)).forEach(([k, v]) => target.append(new Option(v, k))); - } - else { - - for (let id in data) { - target.append(new Option(data[id], id)); - } + this.replaceChildren(); } + + Ut.each(Ut.isStr(data) ? JSON.parse(data) : data, (val, id) => target.append(new Option(val, id)) ); } -} - -// Ut.extendNodeUx(AppendOptions); \ No newline at end of file +} \ No newline at end of file diff --git a/src/utils/Form.js b/src/utils/Form.js index 0cb0b8c..7341f29 100644 --- a/src/utils/Form.js +++ b/src/utils/Form.js @@ -55,6 +55,4 @@ export class Form extends FormValidator { }); }; } -} - -//Ut.extendNodeUx(Form); \ No newline at end of file +} \ No newline at end of file diff --git a/src/utils/Options.js b/src/utils/Options.js index 26f1a6b..b7bbcb0 100644 --- a/src/utils/Options.js +++ b/src/utils/Options.js @@ -122,6 +122,4 @@ export class Options { this.target.dxHtml(''); } } -} - -//Ut.extendNodeUx(Options); \ No newline at end of file +} \ No newline at end of file diff --git a/src/utils/form-validator/FormValidator.js b/src/utils/form-validator/FormValidator.js index f49d575..29be3e7 100644 --- a/src/utils/form-validator/FormValidator.js +++ b/src/utils/form-validator/FormValidator.js @@ -220,6 +220,4 @@ export class FormValidator extends Validator { this.target.dxOff('submit.form click.form keydown.form click.ui'); this.target.dxRemoveData('form'); } -} - -// Ut.extendNodeUx(FormValidator); \ No newline at end of file +} \ No newline at end of file diff --git a/src/utils/form-validator/InputError.js b/src/utils/form-validator/InputError.js index b0bbfe2..e6c3566 100644 --- a/src/utils/form-validator/InputError.js +++ b/src/utils/form-validator/InputError.js @@ -40,6 +40,4 @@ export class InputError { this.fieldWrapper.classList.remove('form-field-error'); this.fieldWrapper.dxFind('.sp-label-error')?.remove(); } -} - -//Ut.extendNodeUx(InputError); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/autocomplete/Autocomplete.js b/src/widgets/autocomplete/Autocomplete.js index 5661c98..ac73fff 100644 --- a/src/widgets/autocomplete/Autocomplete.js +++ b/src/widgets/autocomplete/Autocomplete.js @@ -320,6 +320,4 @@ export class Autocomplete { Ut.trigger(this.opts.onDestroy, this); } -} - -//Ut.extendNodeUx(Autocomplete); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/cancelable/Cancelable.js b/src/widgets/cancelable/Cancelable.js index fbf5ff9..27127b2 100644 --- a/src/widgets/cancelable/Cancelable.js +++ b/src/widgets/cancelable/Cancelable.js @@ -66,6 +66,4 @@ export class Cancelable { return this.target; } -} - -//Ut.extendNodeUx(Cancelable); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/date-picker/DatePicker.js b/src/widgets/date-picker/DatePicker.js index ab4c077..429091e 100644 --- a/src/widgets/date-picker/DatePicker.js +++ b/src/widgets/date-picker/DatePicker.js @@ -1123,6 +1123,4 @@ export class DatePicker { return this.target; } -} - -//Ut.extendNodeUx(DatePicker); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/dropdown/Dropdown.js b/src/widgets/dropdown/Dropdown.js index bd741e9..e7e949a 100644 --- a/src/widgets/dropdown/Dropdown.js +++ b/src/widgets/dropdown/Dropdown.js @@ -176,6 +176,4 @@ export class Dropdown { return this.target; } -} - -//Ut.extendNodeUx(Dropdown); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/lightbox/Lightbox.js b/src/widgets/lightbox/Lightbox.js index 986fc7a..908875e 100644 --- a/src/widgets/lightbox/Lightbox.js +++ b/src/widgets/lightbox/Lightbox.js @@ -322,6 +322,4 @@ export class Lightbox { this.target.dxRemoveData('lightbox'); } -} - -//Ut.extendNodeUx(Lightbox); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/pin-box/PinBox.js b/src/widgets/pin-box/PinBox.js index 2d93d2e..a65ec14 100644 --- a/src/widgets/pin-box/PinBox.js +++ b/src/widgets/pin-box/PinBox.js @@ -124,6 +124,4 @@ export class PinBox { this.target.dxRemoveData('pinbox'); Ut.trigger(this.opts.destroy, this); } -} - -//Ut.extendNodeUx(PinBox); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/popover/Popover.js b/src/widgets/popover/Popover.js index 8119dfb..9bb5f97 100644 --- a/src/widgets/popover/Popover.js +++ b/src/widgets/popover/Popover.js @@ -177,6 +177,4 @@ export class Alert { constructor(target, msg) { new Popover(target, msg, { color: 'red', timeout: 3000 }); } -} - -//Ut.extendNodeUx(Popover, Alert); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/popup/Popup.js b/src/widgets/popup/Popup.js index 137ad4b..e1f4260 100644 --- a/src/widgets/popup/Popup.js +++ b/src/widgets/popup/Popup.js @@ -243,6 +243,4 @@ export class Popup { this.card.ui.dxCss({ top: '-25%', opacity: 0 }); } -} - -//Ut.extendNodeUx(Popup); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/table/Table.js b/src/widgets/table/Table.js index c66042d..2b8e3f8 100644 --- a/src/widgets/table/Table.js +++ b/src/widgets/table/Table.js @@ -647,6 +647,4 @@ export class Table { setFooterToolbar(content) { this.toolbarFooter.dxHtml(content); } -} - -//Ut.extendNodeUx(Table); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/two-datepicker/TwoDatepicker.js b/src/widgets/two-datepicker/TwoDatepicker.js index 07a247a..1a3a584 100644 --- a/src/widgets/two-datepicker/TwoDatepicker.js +++ b/src/widgets/two-datepicker/TwoDatepicker.js @@ -293,6 +293,4 @@ export class TwoDatePicker { Stack.delete(this); } -} - -//Ut.extendNodeUx(TwoDatePicker); \ No newline at end of file +} \ No newline at end of file diff --git a/src/widgets/uploader/Uploader.js b/src/widgets/uploader/Uploader.js index f2b810b..e855518 100644 --- a/src/widgets/uploader/Uploader.js +++ b/src/widgets/uploader/Uploader.js @@ -695,6 +695,4 @@ export class Uploader { Ut.trigger(this.events.destroy, this) } -} - -//Ut.extendNodeUx(Uploader); \ No newline at end of file +} \ No newline at end of file