@creative-web-solution/front-library 7.1.12 → 7.1.13
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/CHANGELOG.md +5 -0
- package/Modules/SkinSelect.ts +14 -12
- package/README.md +1 -1
- package/Types/SkinSelect.d.ts +12 -12
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/Modules/SkinSelect.ts
CHANGED
|
@@ -278,7 +278,7 @@ export default class SkinSelect implements FLib.SkinSelect.SkinSelect {
|
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
|
|
281
|
-
selectByValue( value: string | number ): this {
|
|
281
|
+
selectByValue( value: string | number, dispatchEvent = true ): this {
|
|
282
282
|
if ( this.#$select.disabled || this.#loading ) {
|
|
283
283
|
return this;
|
|
284
284
|
}
|
|
@@ -289,11 +289,11 @@ export default class SkinSelect implements FLib.SkinSelect.SkinSelect {
|
|
|
289
289
|
return this;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
return this.selectByIndex( IDX );
|
|
292
|
+
return this.selectByIndex( IDX, dispatchEvent );
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
|
|
296
|
-
selectByOption( optionOrItem: HTMLElement ): this {
|
|
296
|
+
selectByOption( optionOrItem: HTMLElement, dispatchEvent = true ): this {
|
|
297
297
|
if ( this.#$select.disabled || this.#loading ) {
|
|
298
298
|
return this;
|
|
299
299
|
}
|
|
@@ -304,14 +304,14 @@ export default class SkinSelect implements FLib.SkinSelect.SkinSelect {
|
|
|
304
304
|
return this;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
return this.selectByIndex( IDX );
|
|
307
|
+
return this.selectByIndex( IDX, dispatchEvent );
|
|
308
308
|
}
|
|
309
309
|
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
312
|
* Select an option
|
|
313
313
|
*/
|
|
314
|
-
selectByIndex( index: number ): this {
|
|
314
|
+
selectByIndex( index: number, dispatchEvent = true ): this {
|
|
315
315
|
|
|
316
316
|
if ( this.#$select.disabled || this.#loading ) {
|
|
317
317
|
return this;
|
|
@@ -334,9 +334,11 @@ export default class SkinSelect implements FLib.SkinSelect.SkinSelect {
|
|
|
334
334
|
} );
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
337
|
+
if ( dispatchEvent ) {
|
|
338
|
+
fire( this.#$select, {
|
|
339
|
+
"eventsName": "change"
|
|
340
|
+
} );
|
|
341
|
+
}
|
|
340
342
|
|
|
341
343
|
return this;
|
|
342
344
|
}
|
|
@@ -345,15 +347,15 @@ export default class SkinSelect implements FLib.SkinSelect.SkinSelect {
|
|
|
345
347
|
/**
|
|
346
348
|
* If arg is a number, it is considered as an option index, not a value.
|
|
347
349
|
*/
|
|
348
|
-
select( arg: number | string | HTMLElement ): this {
|
|
350
|
+
select( arg: number | string | HTMLElement, dispatchEvent = true ): this {
|
|
349
351
|
if ( typeof arg === 'number' ) {
|
|
350
|
-
return this.selectByIndex( arg );
|
|
352
|
+
return this.selectByIndex( arg, dispatchEvent );
|
|
351
353
|
}
|
|
352
354
|
else if ( typeof arg === 'string' ) {
|
|
353
|
-
return this.selectByValue( arg );
|
|
355
|
+
return this.selectByValue( arg, dispatchEvent );
|
|
354
356
|
}
|
|
355
357
|
else if ( typeof arg === 'object' ) {
|
|
356
|
-
return this.selectByOption( arg );
|
|
358
|
+
return this.selectByOption( arg, dispatchEvent );
|
|
357
359
|
}
|
|
358
360
|
|
|
359
361
|
return this;
|
package/README.md
CHANGED
package/Types/SkinSelect.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
declare declare namespace FLib {
|
|
2
2
|
namespace SkinSelect {
|
|
3
3
|
interface SkinSelect {
|
|
4
|
-
enable():
|
|
5
|
-
disable():
|
|
6
|
-
setInvalid():
|
|
7
|
-
setValid():
|
|
8
|
-
setLoading():
|
|
9
|
-
unsetLoading():
|
|
10
|
-
updateTitle():
|
|
11
|
-
select( param: number | string | HTMLElement ): this;
|
|
12
|
-
selectByIndex( index: number ): this;
|
|
13
|
-
selectByOption( optionOrItem: HTMLElement ): this;
|
|
14
|
-
selectByValue( value: string | number ): this;
|
|
15
|
-
updateOptions( optionsArray?: FLib.SkinSelect.OptionArray[] ):
|
|
4
|
+
enable(): this;
|
|
5
|
+
disable(): this;
|
|
6
|
+
setInvalid(): this;
|
|
7
|
+
setValid(): this;
|
|
8
|
+
setLoading(): this;
|
|
9
|
+
unsetLoading(): this;
|
|
10
|
+
updateTitle(): this;
|
|
11
|
+
select( param: number | string | HTMLElement, dispatchEvent?: bool ): this;
|
|
12
|
+
selectByIndex( index: number, dispatchEvent?: bool ): this;
|
|
13
|
+
selectByOption( optionOrItem: HTMLElement, dispatchEvent?: bool ): this;
|
|
14
|
+
selectByValue( value: string | number, dispatchEvent?: bool ): this;
|
|
15
|
+
updateOptions( optionsArray?: FLib.SkinSelect.OptionArray[] ): this;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@creative-web-solution/front-library",
|
|
3
3
|
"title": "Frontend library",
|
|
4
4
|
"description": "Frontend functions and modules",
|
|
5
|
-
"version": "7.1.
|
|
5
|
+
"version": "7.1.13",
|
|
6
6
|
"homepage": "https://github.com/creative-web-solution/front-library",
|
|
7
7
|
"author": "Creative Web Solution <contact@cws-studio.com> (https://www.cws-studio.com)",
|
|
8
8
|
"keywords": [],
|