@creative-web-solution/front-library 7.0.6 → 7.1.2

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.
Files changed (141) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/DOM/Class.ts +10 -12
  3. package/DOM/DocumentSize.ts +3 -1
  4. package/DOM/Filter.ts +0 -2
  5. package/DOM/Index.ts +1 -3
  6. package/DOM/Manipulation.ts +0 -3
  7. package/DOM/Matrix.ts +12 -12
  8. package/DOM/Offset.ts +4 -5
  9. package/DOM/OuterSize.ts +12 -12
  10. package/DOM/PageToDOM.ts +2 -2
  11. package/DOM/Position.ts +3 -3
  12. package/DOM/Size.ts +3 -7
  13. package/DOM/StrToDOM.ts +0 -1
  14. package/DOM/Styles.ts +3 -12
  15. package/DOM/Traversing.ts +0 -6
  16. package/DOM/WindowScroll.ts +3 -1
  17. package/DOM/WindowSize.ts +3 -1
  18. package/DOM/Wrap.ts +0 -1
  19. package/Events/DeviceOrientation.ts +27 -31
  20. package/Events/EventsManager.ts +10 -25
  21. package/Events/Gesture.ts +36 -37
  22. package/Events/HistoryController.ts +11 -17
  23. package/Events/ImageLoad.ts +35 -19
  24. package/Events/IntersectObserver.ts +15 -19
  25. package/Events/KeyboardHandler.ts +10 -8
  26. package/Events/MediaQueriesEvents.ts +53 -51
  27. package/Events/OnAnimationEnd.ts +5 -6
  28. package/Events/OnTransitionEnd.ts +3 -3
  29. package/Events/PubSub.ts +5 -8
  30. package/Events/TouchHover.ts +18 -21
  31. package/Events/WindowEvents.ts +26 -30
  32. package/Helpers/Colors.ts +7 -23
  33. package/Helpers/Cookie.ts +5 -12
  34. package/Helpers/Coordinates.ts +0 -7
  35. package/Helpers/Debounce.ts +3 -7
  36. package/Helpers/Defer.ts +1 -1
  37. package/Helpers/GetValue.ts +0 -2
  38. package/Helpers/Insert.ts +0 -1
  39. package/Helpers/Sequential.ts +0 -2
  40. package/Helpers/Slice.ts +0 -3
  41. package/Helpers/Throttle.ts +0 -1
  42. package/Helpers/TransitionHelpers.ts +95 -0
  43. package/Helpers/Type.ts +1 -14
  44. package/Helpers/Unique.ts +3 -3
  45. package/Helpers/UrlParser.ts +14 -23
  46. package/Helpers/Wait.ts +1 -1
  47. package/Modules/Accordion/Tab.ts +19 -17
  48. package/Modules/Accordion/index.ts +27 -19
  49. package/Modules/Autocomplete.ts +95 -101
  50. package/Modules/DragSlider.ts +72 -63
  51. package/Modules/GlobalState.ts +60 -53
  52. package/Modules/LoadGMap.ts +4 -7
  53. package/Modules/Notifications/Notification.ts +28 -32
  54. package/Modules/Notifications/index.ts +43 -36
  55. package/Modules/Popin/Popin.ts +100 -110
  56. package/Modules/Popin/PopinAccessibility.ts +8 -8
  57. package/Modules/Popin/PopinBackground.ts +12 -12
  58. package/Modules/Popin/PopinController.ts +24 -30
  59. package/Modules/Popin/Tools.ts +18 -19
  60. package/Modules/QuickTemplate.ts +4 -6
  61. package/Modules/ScrollSnap.ts +110 -104
  62. package/Modules/SkinCheckbox.ts +52 -38
  63. package/Modules/SkinFile.ts +63 -53
  64. package/Modules/SkinRadio.ts +63 -43
  65. package/Modules/SkinSelect.ts +117 -101
  66. package/Modules/Slider/Slide.ts +49 -52
  67. package/Modules/Slider/Slider.ts +100 -136
  68. package/Modules/Slider/SliderControls.ts +60 -59
  69. package/Modules/Tabs/Tab.ts +28 -24
  70. package/Modules/Tabs/index.ts +36 -26
  71. package/Modules/Validator/Date.ts +2 -1
  72. package/Modules/Validator/Equals.ts +1 -1
  73. package/Modules/Validator/Internal/Input.ts +366 -0
  74. package/Modules/Validator/Internal/InputValidator.ts +99 -0
  75. package/Modules/Validator/Internal/ValidatorFunctionsController.ts +58 -0
  76. package/Modules/Validator/Max.ts +1 -1
  77. package/Modules/Validator/Min.ts +1 -1
  78. package/Modules/Validator/MultiRequired.ts +5 -5
  79. package/Modules/Validator/Number.ts +1 -0
  80. package/Modules/Validator/Pattern.ts +1 -1
  81. package/Modules/Validator/Recaptcha.ts +1 -0
  82. package/Modules/Validator/Required.ts +3 -2
  83. package/Modules/Validator/ServerCheck.ts +23 -15
  84. package/Modules/Validator/Tools/GetQueryFromForm.ts +1 -6
  85. package/Modules/Validator/Tools/IsDate.ts +2 -3
  86. package/Modules/Validator/Tools/IsEmail.ts +2 -5
  87. package/Modules/Validator/Tools/IsEmpty.ts +0 -2
  88. package/Modules/Validator/Tools/IsNumber.ts +0 -2
  89. package/Modules/Validator/Tools/IsUrl.ts +1 -3
  90. package/Modules/Validator/Tools/Label.ts +5 -15
  91. package/Modules/Validator/Tools/RadioButton.ts +4 -10
  92. package/Modules/Validator/Url.ts +1 -0
  93. package/Modules/Validator/index.ts +36 -36
  94. package/Modules/YouTubePlayer.ts +18 -16
  95. package/README.md +1 -1
  96. package/Types/Accordion.d.ts +41 -0
  97. package/Types/Autocomplete.d.ts +94 -0
  98. package/Types/DOM.d.ts +69 -0
  99. package/Types/DragSlider.d.ts +56 -0
  100. package/Types/EventsHelpers.d.ts +390 -0
  101. package/Types/GLImageTransition.d.ts +47 -43
  102. package/Types/GlobalState.d.ts +9 -0
  103. package/Types/Helpers.d.ts +63 -0
  104. package/Types/Notifications.d.ts +48 -44
  105. package/Types/Popin.d.ts +113 -0
  106. package/Types/ScrollSnap.d.ts +66 -0
  107. package/Types/SkinCheckbox.d.ts +35 -0
  108. package/Types/SkinFile.d.ts +45 -0
  109. package/Types/SkinRadio.d.ts +37 -0
  110. package/Types/SkinSelect.d.ts +72 -0
  111. package/Types/Slider.d.ts +106 -0
  112. package/Types/Tabs.d.ts +33 -0
  113. package/Types/Validator.d.ts +99 -0
  114. package/Types/YouTubePlayer.d.ts +27 -0
  115. package/Types/index.d.ts +22 -21
  116. package/WebGL/GLImageTransition/GLImageTransition.ts +83 -80
  117. package/WebGL/GLImageTransition/Presets/Cellular.ts +11 -11
  118. package/WebGL/GLImageTransition/Presets/Fade.ts +2 -3
  119. package/WebGL/GLImageTransition/Presets/HorizontalMovingGrid.ts +9 -9
  120. package/WebGL/GLImageTransition/Presets/PresetSample.ts +11 -9
  121. package/WebGL/GLImageTransition/Presets/Solarisation.ts +7 -12
  122. package/package.json +1 -1
  123. package/Modules/Template.ts +0 -209
  124. package/Types/AccordionTypes.d.ts +0 -29
  125. package/Types/AutocompleteTypes.d.ts +0 -85
  126. package/Types/DOMTypes.d.ts +0 -62
  127. package/Types/DragSliderTypes.d.ts +0 -52
  128. package/Types/EventsHelpersTypes.d.ts +0 -370
  129. package/Types/GlobalStateTypes.d.ts +0 -5
  130. package/Types/HelpersTypes.d.ts +0 -23
  131. package/Types/MediaPreloaderTypes.d.ts +0 -12
  132. package/Types/PopinTypes.d.ts +0 -83
  133. package/Types/ScrollSnapTypes.d.ts +0 -62
  134. package/Types/SkinCheckboxTypes.d.ts +0 -23
  135. package/Types/SkinFileTypes.d.ts +0 -34
  136. package/Types/SkinRadioTypes.d.ts +0 -24
  137. package/Types/SkinSelectTypes.d.ts +0 -48
  138. package/Types/SliderTypes.d.ts +0 -97
  139. package/Types/TabsTypes.d.ts +0 -22
  140. package/Types/ValidatorTypes.d.ts +0 -61
  141. package/Types/YouTubePlayerTypes.d.ts +0 -23
@@ -1,47 +1,51 @@
1
- type GLImageTransitionFitType = 'cover' | 'contains';
1
+ declare namespace FLib {
2
+ namespace GLImageTransition {
3
+ type FitType = 'cover' | 'contains';
2
4
 
3
- interface GLImageTransitionPreset {
4
- fsSource: string;
5
- addUniform?( GL: WebGLRenderingContext, SHADER_PROGRAM: WebGLProgram ): void;
6
- updateUniform?( GL: WebGLRenderingContext ): void;
7
- onTransitionStart?();
8
- onTransitionEnd?();
9
- }
5
+ interface Preset {
6
+ fsSource: string;
7
+ addUniform?( GL: WebGLRenderingContext, SHADER_PROGRAM: WebGLProgram ): void;
8
+ updateUniform?( GL: WebGLRenderingContext ): void;
9
+ onTransitionStart?();
10
+ onTransitionEnd?();
11
+ }
10
12
 
11
13
 
12
- type GLImageTransitionOptionsType = {
13
- preset?: GLImageTransitionPreset;
14
- /** @default document.body */
15
- $wrapper?: HTMLElement;
16
- /** @default webgl */
17
- context?: string;
18
- /** @default cover */
19
- fitMode?: GLImageTransitionFitType;
20
- /**
21
- * Transition duration in second
22
- * @default 1
23
- */
24
- duration?: number;
25
- /**
26
- * 0 <= color <= 1
27
- * @default [0, 0, 0, 1]
28
- */
29
- backgroundColor?: number[];
30
- /**
31
- * Color displayed instead of the texture when an error occured on image loading. 0 <= color <= 1
32
- * @default [0, 0, 1, 1]
33
- */
34
- dummyTextureColor?: number[];
35
- canvasCssClass?: string;
36
- /**
37
- * Should the canvas size respond to the browser's size change
38
- * @default false
39
- */
40
- fluid?: boolean;
41
- /** Called juste before the loading start */
42
- onImageLoading?: ( url: string, isInit: boolean ) => void;
43
- /** Called once the loading is done */
44
- onImageLoaded?: ( url: string, isInit: boolean ) => void;
45
- /** Called on image loading error */
46
- onImageError?: ( url: string, isInit: boolean ) => void;
14
+ type Options = {
15
+ preset: Preset;
16
+ /** @defaultValue document.body */
17
+ $wrapper: HTMLElement;
18
+ /** @defaultValue webgl */
19
+ context: string;
20
+ /** @defaultValue cover */
21
+ fitMode: FitType;
22
+ /**
23
+ * Transition duration in second
24
+ * @defaultValue 1
25
+ */
26
+ duration: number;
27
+ /**
28
+ * 0 &lt;= color &lt;= 1
29
+ * @defaultValue [0, 0, 0, 1]
30
+ */
31
+ backgroundColor: number[];
32
+ /**
33
+ * Color displayed instead of the texture when an error occured on image loading. 0 &lt;= color &lt;= 1
34
+ * @defaultValue [0, 0, 1, 1]
35
+ */
36
+ dummyTextureColor: number[];
37
+ canvasCssClass?: string;
38
+ /**
39
+ * Should the canvas size respond to the browser's size change
40
+ * @defaultValue false
41
+ */
42
+ fluid: boolean;
43
+ /** Called juste before the loading start */
44
+ onImageLoading?: ( url: string, isInit: boolean ) => void;
45
+ /** Called once the loading is done */
46
+ onImageLoaded?: ( url: string, isInit: boolean ) => void;
47
+ /** Called on image loading error */
48
+ onImageError?: ( url: string, isInit: boolean ) => void;
49
+ }
50
+ }
47
51
  }
@@ -0,0 +1,9 @@
1
+ declare namespace FLib {
2
+ namespace GlobalState {
3
+ type Options = {
4
+ alwaysDispatch: boolean;
5
+ dispatchEvents: boolean;
6
+ };
7
+ type Callback = ( value: any, properyName: string, storeName: string ) => void;
8
+ }
9
+ }
@@ -0,0 +1,63 @@
1
+ declare namespace FLib {
2
+ namespace Helpers {
3
+ namespace Color {
4
+ type RenderType = 'obj' | 'hex' | 'rgba';
5
+
6
+ type Color = {
7
+ r: number;
8
+ g: number;
9
+ b: number;
10
+ a: number;
11
+ hr: string;
12
+ hg: string;
13
+ hb: string;
14
+ ha: string;
15
+ }
16
+ }
17
+
18
+ namespace Cookie {
19
+ type Options = {
20
+ days: number | null;
21
+ /** Default value is true if the location protocol is https */
22
+ secure: boolean;
23
+ /** Default: window.location.hostname */
24
+ domain: string;
25
+ /** Default: / */
26
+ path: string;
27
+ }
28
+ }
29
+
30
+ interface UrlParser {
31
+ absolute: string;
32
+ absolute2: string;
33
+ anchor: string;
34
+ authority: string;
35
+ directory: string;
36
+ file: string;
37
+ full: string;
38
+ full2: string;
39
+ host: string;
40
+ location;
41
+ password: string;
42
+ path: string;
43
+ port: string;
44
+ protocol: string;
45
+ query: string;
46
+ queryKey: Record<string, string>;
47
+ relative: string;
48
+ relative2: string;
49
+ source: string;
50
+ user: string;
51
+ userInfo: string;
52
+ isAnchor: boolean;
53
+ isSameDomain: boolean;
54
+
55
+ init( url: string ): void;
56
+ setAnchor( anchor: string ): this;
57
+ getParam( key: string ): string;
58
+ setParam( keys: string | Record<string, string>, value?: string ): this;
59
+ removeParam( keys: string | string[] ): this
60
+ removeAll(): this;
61
+ }
62
+ }
63
+ }
@@ -1,47 +1,51 @@
1
- type NotificationType = 'info' | 'success' | 'warning' | 'danger';
1
+ declare namespace FLib {
2
+ namespace Notifications {
3
+ type Type = 'info' | 'success' | 'warning' | 'danger';
2
4
 
3
- type NotificationsOptionsType = {
4
- /** @default document.body */
5
- $wrapper?: HTMLElement;
6
- onClick?: ( notification: Notification ) => void;
7
- /**
8
- * In second
9
- * @default 5
10
- */
11
- autoCloseDelay?: number;
12
- templates?: {
13
- /** @default <div class="notifications"><div class="list"></div></div> */
14
- notifications: string;
15
- /** @default <div class="notification"></div> */
16
- notification : string;
17
- };
18
- selectors?: {
19
- /** @default .notifications */
20
- notifications?: string;
21
- /** @default .notification */
22
- notification?: string;
23
- /** @default .list */
24
- list?: string;
25
- };
26
- cssClass?: {
27
- /** @default open */
28
- open?: string;
29
- /** @default success */
30
- success?: string;
31
- /** @default danger */
32
- danger?: string;
33
- /** @default warning */
34
- warning?: string;
35
- /** @default info */
36
- info?: string;
37
- };
38
- animations?: {
39
- show?: ( $notification, options ) => Promise
40
- hide?: ( $notification, options ) => Promise
41
- };
42
- }
5
+ type Options = {
6
+ /** @defaultValue document.body */
7
+ $wrapper: HTMLElement;
8
+ onClick: ( notification ) => void;
9
+ /**
10
+ * In second
11
+ * @defaultValue 5
12
+ */
13
+ autoCloseDelay: number;
14
+ templates: {
15
+ /** @defaultValue <div class="notifications"><div class="list"></div></div> */
16
+ notifications: string;
17
+ /** @defaultValue <div class="notification"></div> */
18
+ notification : string;
19
+ };
20
+ selectors: {
21
+ /** @defaultValue .notifications */
22
+ notifications: string;
23
+ /** @defaultValue .notification */
24
+ notification: string;
25
+ /** @defaultValue .list */
26
+ list: string;
27
+ };
28
+ cssClass: {
29
+ /** @defaultValue open */
30
+ open: string;
31
+ /** @defaultValue success */
32
+ success: string;
33
+ /** @defaultValue danger */
34
+ danger: string;
35
+ /** @defaultValue warning */
36
+ warning: string;
37
+ /** @defaultValue info */
38
+ info: string;
39
+ };
40
+ animations: {
41
+ show: ( $notification, options ) => Promise<any>
42
+ hide: ( $notification, options ) => Promise<any>
43
+ };
44
+ }
43
45
 
44
- type NotificationOptionsType = {
45
- closeDelay?: number | false;
46
- onClick?: ( e: Event ) => void;
46
+ type NotificationOptions = {
47
+ closeDelay?: number | false;
48
+ onClick?: ( e: Event ) => void;
49
+ }
50
+ }
47
51
  }
@@ -0,0 +1,113 @@
1
+ declare namespace FLib {
2
+ namespace Popin {
3
+ type AnimationFunction = ( $element: HTMLElement ) => Promise<void>;
4
+ type ResponseType = 'arrayBuffer' | 'blob' | 'json' | 'text' | 'formData';
5
+
6
+ interface Controller {
7
+ load( url: string, data: RequestInit, type?: FLib.Popin.ResponseType ): Promise<void>
8
+ loadForm( $form: HTMLFormElement ): Promise<void>
9
+ loadLink( $link: HTMLAnchorElement ): Promise<void>
10
+ set( html: string, openFirst?: boolean ): Promise<void>
11
+ clear(): void;
12
+ close(): Promise<void>;
13
+ open(): Promise<void>;
14
+ destroy(): this;
15
+ }
16
+
17
+ interface Background {
18
+ isOpened: boolean;
19
+ open(): Promise<any>;
20
+ close(): Promise<any>;
21
+ destroy(): void;
22
+ }
23
+
24
+ interface TemplatesOptions {
25
+ /** @defaultValue `<div class="popin-loader"></div>` */
26
+ popinLoader: string;
27
+ /** @defaultValue `<div class="popin"><div class="popin-content"></div></div>` */
28
+ popin: string;
29
+ /** @defaultValue `<div class="bg-popin"></div>` */
30
+ bgLayer: string;
31
+ /** @defaultValue `"<div class="error">{{ message }}</div>"` */
32
+ errorMessage: string;
33
+ }
34
+
35
+ interface SelectorsOptions {
36
+ /** @defaultValue .popin */
37
+ popin: string;
38
+ /** @defaultValue .popin-content */
39
+ popinContent: string;
40
+ /** @defaultValue a[data-popin] */
41
+ links: string;
42
+ /** @defaultValue form[data-popin] */
43
+ forms: string;
44
+ /** @defaultValue button[data-close-popin] */
45
+ btClosePopin: string;
46
+ /** @defaultValue data-onload-popin */
47
+ openOnLoadAttribute: string;
48
+ }
49
+
50
+ interface AnimationsOptions {
51
+ /** @defaultValue `$bg => { $bg.style.display = 'block'; return Promise.resolve(); }` */
52
+ openBg: AnimationFunction;
53
+ /** @defaultValue `$bg => { $bg.style.display = 'none'; return Promise.resolve(); }` */
54
+ closeBg: AnimationFunction;
55
+ /** @defaultValue `$popin => { $popin.style.display = 'block'; $popin.style.opacity = 0; return Promise.resolve(); }` */
56
+ initOpenPopin: AnimationFunction;
57
+ /** @defaultValue `$popin => { $popin.style.opacity = 1; return Promise.resolve(); }` */
58
+ openPopin: AnimationFunction;
59
+ /** @defaultValue `$popin => { $popin.style.display = 'none'; return Promise.resolve(); }` */
60
+ closePopin: AnimationFunction;
61
+ /** @defaultValue `$loader => { $loader.style.display = 'block'; return Promise.resolve(); }` */
62
+ openLoader: AnimationFunction;
63
+ /** @defaultValue `$loader => { $loader.style.display = 'none'; return Promise.resolve(); }` */
64
+ closeLoader: AnimationFunction;
65
+ }
66
+
67
+ interface Options {
68
+ /** @defaultValue false */
69
+ modal: boolean;
70
+ /** @defaultValue 20 */
71
+ marginHeight: number;
72
+ /** @defaultValue false */
73
+ autoResize: boolean;
74
+ /** @defaultValue "Error while loading.." */
75
+ errorMessage: string;
76
+ /** @defaultValue true */
77
+ enableKeyboard: boolean;
78
+ onOpen?: ( $popin: HTMLElement ) => void;
79
+ onClose?: ( $popin: HTMLElement ) => void;
80
+ onLoad: ( $popin: HTMLElement ) => Promise<void>;
81
+ /** @defaultValue `() => 'text'` */
82
+ setLinkResponseType: ( url: string, $link: HTMLAnchorElement ) => ResponseType;
83
+ /** @defaultValue `() => 'text'` */
84
+ setFormResponseType: ( $form: HTMLElement ) => ResponseType;
85
+ /** @defaultValue `() => true` */
86
+ checkValidity: ( $form: HTMLElement ) => boolean | Promise<void>;
87
+ /** @defaultValue `(body) => { return { success: true, data: body }` */
88
+ normalize: ( body, response, isHttpError: boolean ) => { success: boolean, data };
89
+ /**
90
+ * If false, ajax http error (404, 500, ...) should be handled in the normalize function
91
+ * @defaultValue true
92
+ */
93
+ autoHandleAjaxError: boolean;
94
+ templates: TemplatesOptions;
95
+ selectors: SelectorsOptions;
96
+ animations: AnimationsOptions;
97
+ }
98
+
99
+
100
+ interface ControllerOptions {
101
+ controller: Controller;
102
+ background: Background;
103
+ }
104
+
105
+
106
+ interface OptionsInit extends Partial<Options> {
107
+ templates?: Partial<TemplatesOptions>;
108
+ selectors?: Partial<SelectorsOptions>;
109
+ animations?: Partial<AnimationsOptions>;
110
+
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,66 @@
1
+ declare namespace FLib {
2
+ namespace ScrollSnap {
3
+ type SnapType = 'scroll' | 'api';
4
+
5
+ type DirectionType = 'h' | 'v';
6
+
7
+ type ScrollPropertyType = 'scrollLeft' | 'scrollTop';
8
+
9
+ type SizePropertyType = 'scrollWidth' | 'scrollHeight';
10
+
11
+
12
+ type Item = {
13
+ coord: number;
14
+ index: number;
15
+ isFirst: boolean;
16
+ isLast: boolean;
17
+ $item: HTMLElement;
18
+ }
19
+
20
+ type ScrollToCallback = ( snapItem: Item, snapItemType: SnapType ) => void;
21
+ type Callback = ( item: CallbackParam ) => void;
22
+
23
+ type CallbackParam = {
24
+ $scroller: HTMLElement;
25
+ snapItem: Item;
26
+ /** If the event comes after a scroll: scroll. If it comes after a function call (like next, previous, ...): api. */
27
+ type: SnapType;
28
+ scrollerSize: number;
29
+ offsetSize: number;
30
+ }
31
+
32
+ type RefreshOption = {
33
+ /** Selector or DOMList of the items */
34
+ snapTo?: string | NodeList;
35
+ /** Item to put on the left */
36
+ $itemToSnapOn?: HTMLElement;
37
+ $offsetElement?: HTMLElement;
38
+ offset?: {
39
+ top?: number;
40
+ left?: number;
41
+ };
42
+ direction?: DirectionType;
43
+ }
44
+
45
+ type Options = {
46
+ /** @defaultValue locked */
47
+ lockedClass?: string;
48
+ /** @defaultValue 2 */
49
+ minItemsToActivate?: number;
50
+ /** @defaultValue h */
51
+ direction?: DirectionType;
52
+ /** Internal function using GSAP and scrollTo plugin to set the scroll. Can be override to use another library */
53
+ _setScroll?: ( $scroller: HTMLElement, x: number, y: number ) => void;
54
+ $offsetElement?: HTMLElement;
55
+ offset?: {
56
+ top?: number;
57
+ left?: number;
58
+ };
59
+ onSnapStart?: Callback;
60
+ onSnapEnd?: Callback;
61
+ onReachStart?: Callback;
62
+ onReachEnd?: Callback;
63
+ snapTo?: string | NodeList;
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,35 @@
1
+ declare namespace FLib {
2
+ namespace SkinCheckbox {
3
+ interface SkinCheckbox {
4
+ check(): this;
5
+ uncheck(): this;
6
+ enable(): this;
7
+ disable(): this;
8
+ setInvalid(): this;
9
+ setValid(): this;
10
+ }
11
+
12
+ type Options = {
13
+ /** @defaultValue <span class="cb-skin"></span> */
14
+ wrap: string;
15
+ /** @defaultValue invalid */
16
+ invalidClass: string;
17
+ /** @defaultValue disabled */
18
+ disabledClass: string;
19
+ /** @defaultValue checked */
20
+ checkedClass: string;
21
+ }
22
+
23
+ type AllOptions = Options & {
24
+ selector: string;
25
+ }
26
+
27
+ type CustomCheckbox = HTMLInputElement & {
28
+ __skinAPI?: SkinCheckbox
29
+ }
30
+
31
+ type CustomCheckboxParent = HTMLElement & {
32
+ __skinAPI?: SkinCheckbox
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,45 @@
1
+ declare namespace FLib {
2
+ namespace SkinFile {
3
+ interface SkinFile {
4
+ enable(): this;
5
+ disable(): this;
6
+ setInvalid(): this;
7
+ setValid(): this;
8
+ }
9
+
10
+ type Options = {
11
+ /** @defaultValue .file-skin */
12
+ selector: string;
13
+ /** @defaultValue <div class="file-skin"></div> */
14
+ wrap: string;
15
+ /** @defaultValue .file-info */
16
+ fileInfoSelector: string;
17
+ /** @defaultValue <div class="file-info"></div> */
18
+ fileInfo: string;
19
+ /** @defaultValue true */
20
+ autoHideFileInfo: boolean;
21
+ /** @defaultValue .file-reset */
22
+ resetButtonSelector: string;
23
+ /** @defaultValue <span class="file-reset">&times;</span> */
24
+ resetButton: string;
25
+ /** @defaultValue disabled */
26
+ disabledClass: string;
27
+ /** @defaultValue invalid */
28
+ invalidClass: string;
29
+ /** @defaultValue selected */
30
+ selectedClass: string;
31
+ }
32
+
33
+ type AllOptions = Options & {
34
+ selector: string;
35
+ }
36
+
37
+ type CustomInputFile = HTMLInputElement & {
38
+ __skinAPI?: SkinFile
39
+ }
40
+
41
+ type CustomInputFileParent = HTMLElement & {
42
+ __skinAPI?: SkinFile
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,37 @@
1
+ declare namespace FLib {
2
+ namespace SkinRadio {
3
+ interface SkinRadio {
4
+ check(): this;
5
+ uncheck(): this;
6
+ enable(): this;
7
+ disable(): this;
8
+ setInvalid(): this;
9
+ setValid(): this;
10
+ }
11
+
12
+ type Options = {
13
+ /** @defaultValue <span class="rb-skin"></span> */
14
+ wrap: string;
15
+ /** @defaultValue invalid */
16
+ invalidClass: string;
17
+ /** @defaultValue disabled */
18
+ disabledClass: string;
19
+ /** @defaultValue checked */
20
+ checkedClass: string;
21
+ }
22
+
23
+ type AllOptions = Options & {
24
+ selector: string;
25
+ }
26
+
27
+ type CustomRadioButton = HTMLInputElement & {
28
+ __skinAPI?: SkinRadioButton;
29
+ __$radioGroup?: NodeListOf<CustomRadioButton>;
30
+ }
31
+
32
+ type CustomRadioButtonParent = HTMLElement & {
33
+ __skinAPI?: SkinRadioButton;
34
+ __$radioGroup?: NodeListOf<CustomRadioButton>;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,72 @@
1
+ declare declare namespace FLib {
2
+ namespace SkinSelect {
3
+ interface SkinSelect {
4
+ enable(): this;
5
+ disable(): this;
6
+ setInvalid(): this;
7
+ setValid(): this;
8
+ setLoading(): this
9
+ unsetLoading(): this
10
+ updateTitle(): this
11
+ select( optionOrIndex: HTMLElement | number ): this
12
+ updateOptions( optionsArray?: FLib.SkinSelect.OptionArray[] ): this
13
+ }
14
+
15
+
16
+ type Options = {
17
+ /**
18
+ * If true, skin event the option list
19
+ * @defaultValue false
20
+ */
21
+ full: boolean;
22
+ /** @defaultValue [] */
23
+ extraClass: string[];
24
+ /** @defaultValue select-skin */
25
+ className: string;
26
+ /** @defaultValue select-itm */
27
+ itemClassName: string;
28
+ /** @defaultValue select */
29
+ selectWrapClassName: string;
30
+ /** @defaultValue select-layer */
31
+ layerClassName: string;
32
+ /** @defaultValue select-list */
33
+ listClassName: string;
34
+ /** @defaultValue hover */
35
+ hoverItemClass: string;
36
+ /** @defaultValue show */
37
+ openedListClass: string;
38
+ /** @defaultValue on */
39
+ activeOptionClass: string;
40
+ /** @defaultValue disabled */
41
+ disabledClass: string;
42
+ /** @defaultValue invalid */
43
+ invalidClass: string;
44
+ /** @defaultValue loading */
45
+ loadingClass: string;
46
+ listTpl: {
47
+ /** @defaultValue `<div class="{{ layerClassName }}"><ul class="{{ listClassName }}">{{ items }}</ul></div>` */
48
+ wrapper: string;
49
+ /** @defaultValue `<li class="{{ itemClassName }}{{ onClass }}" data-value="{{ value }}">{{ text }}</li>` */
50
+ item: string;
51
+ };
52
+ }
53
+
54
+ type AllOptions = Options & {
55
+ selector: string;
56
+ }
57
+
58
+ type CustomSelect = HTMLSelectElement & {
59
+ __skinAPI?: SkinSelect;
60
+ }
61
+
62
+ type CustomSelectParent = HTMLElement & {
63
+ __skinAPI?: SkinSelect;
64
+ }
65
+
66
+ type OptionArray = {
67
+ text: string;
68
+ value: string;
69
+ selected?: boolean;
70
+ }
71
+ }
72
+ }