winduum 1.2.4 → 1.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "winduum",
3
- "version": "1.2.4",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "plugin/index.cjs",
@@ -3,6 +3,7 @@ export interface DefaultOptions {
3
3
  closable?: boolean | null
4
4
  modal?: boolean | null
5
5
  openClass?: string
6
+ contentSelector?: string
6
7
  scrollbarWidthProperty?: string
7
8
  }
8
9
 
@@ -6,6 +6,7 @@ import { animationsFinished, nextRepaint } from '../../common.js'
6
6
  export const defaultOptions = {
7
7
  openClass: 'visible',
8
8
  scrollbarWidthProperty: '--c-dialog-scrollbar-width',
9
+ contentSelector: '.c-dialog-content',
9
10
  remove: false
10
11
  }
11
12
 
@@ -22,7 +23,7 @@ export const dialogSelector = selector => document.querySelectorAll(selector)[do
22
23
  * @returns Promise<void>
23
24
  */
24
25
  export const dismissDialog = async (element, options = defaultOptions) => {
25
- await animationsFinished(element)
26
+ await animationsFinished(element.querySelector(options.contentSelector))
26
27
  element.inert = true
27
28
  element.classList.remove(options.openClass)
28
29
  element.dispatchEvent(new CustomEvent('c-dialog:dismiss'))
@@ -6,6 +6,7 @@ export interface ValidateFormOptions {
6
6
 
7
7
  export interface ValidateFieldOptions {
8
8
  validate?: boolean
9
+ validationMessage?: string
9
10
  selector?: string
10
11
  ignoreMatch?: RegExp
11
12
  validitySelector?: string
@@ -54,7 +54,7 @@ export const validateField = (element, options = {}) => {
54
54
  if (!element.querySelector(options.selector)) return
55
55
 
56
56
  const validationElement = element.querySelector(options.selector)
57
- const validationMessage = validationElement.dataset.validationMessage ?? validationElement.validationMessage
57
+ const validationMessage = options.validationMessage ?? validationElement.dataset.validationMessage ?? validationElement.validationMessage
58
58
  const infoParentElement = validationElement?.closest(options.infoParentSelector)
59
59
  const endParentElement = validationElement.closest(options.endParentSelector)
60
60
  const infoSelector = options.infoSelector + options.validitySelector
package/types/index.d.ts CHANGED
@@ -23,6 +23,8 @@ declare module 'winduum' {
23
23
  export const defaultConfig: PluginOptions
24
24
 
25
25
  export default function createPlugin(userConfig?: PluginOptions): Plugin
26
+
27
+ export {};
26
28
  }
27
29
 
28
30
  declare module 'winduum/src/components/carousel' {
@@ -66,6 +68,8 @@ declare module 'winduum/src/components/carousel' {
66
68
  export function paginationCarousel(element: HTMLElement | Element, options?: PaginationCarouselOptions): void
67
69
  export function autoplayCarousel(element: HTMLElement | Element, options?: AutoplayCarouselOptions): void
68
70
  export function dragCarousel(element: HTMLElement | Element, options?: DragCarouselOptions): void
71
+
72
+ export {};
69
73
  }
70
74
 
71
75
  declare module 'winduum/src/components/compare' {
@@ -77,6 +81,8 @@ declare module 'winduum/src/components/compare' {
77
81
  export function setPosition(event: Event, options?: SetPositionOptions): void
78
82
  export function setKeyboardStep(event: KeyboardEvent, step?: string): void
79
83
  export function setMouseStep(event: MouseEvent, step?: string): void
84
+
85
+ export {};
80
86
  }
81
87
 
82
88
  declare module 'winduum/src/components/details' {
@@ -89,13 +95,17 @@ declare module 'winduum/src/components/details' {
89
95
  export function showDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
90
96
  export function closeDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
91
97
  export function toggleDetails(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions): Promise<void>
98
+
99
+ export {};
92
100
  }
93
101
 
94
102
  declare module 'winduum/src/components/dialog' {
95
103
  export interface DefaultOptions {
96
104
  remove?: boolean | null
97
105
  closable?: boolean | null
106
+ modal?: boolean | null
98
107
  openClass?: string
108
+ contentSelector?: string
99
109
  scrollbarWidthProperty?: string
100
110
  }
101
111
 
@@ -118,6 +128,8 @@ declare module 'winduum/src/components/dialog' {
118
128
  export function closeDialog(element: HTMLDialogElement, options?: DefaultOptions): Promise<void>
119
129
  export function insertDialog(content: string, options?: InsertDialogOptions): Promise<void>
120
130
  export function fetchDialog({ url, insert }: FetchDialogOptions): Promise<void>
131
+
132
+ export {};
121
133
  }
122
134
 
123
135
  declare module 'winduum/src/components/drawer' {
@@ -134,6 +146,8 @@ declare module 'winduum/src/components/drawer' {
134
146
  export function showDrawer(element: HTMLElement | Element, distance?: number, direction?: 'left' | 'top'): void
135
147
  export function closeDrawer(element: HTMLElement | Element, distance?: number, direction?: 'left' | 'top'): void
136
148
  export function scrollDrawer(element: HTMLElement | Element, options?: ScrollDrawerOptions): void
149
+
150
+ export {};
137
151
  }
138
152
 
139
153
  declare module 'winduum/src/components/form' {
@@ -145,6 +159,7 @@ declare module 'winduum/src/components/form' {
145
159
 
146
160
  export interface ValidateFieldOptions {
147
161
  validate?: boolean
162
+ validationMessage?: string
148
163
  selector?: string
149
164
  ignoreMatch?: RegExp
150
165
  validitySelector?: string
@@ -163,6 +178,8 @@ declare module 'winduum/src/components/form' {
163
178
 
164
179
  export function validateForm(event: Event | SubmitEvent, options?: ValidateFormOptions): void
165
180
  export function validateField(element: HTMLElement | SubmitEvent, options?: ValidateFieldOptions): void
181
+
182
+ export {};
166
183
  }
167
184
 
168
185
  declare module 'winduum/src/components/tabs' {
@@ -172,6 +189,8 @@ declare module 'winduum/src/components/tabs' {
172
189
  }
173
190
 
174
191
  export function toggleTab(element: HTMLElement | Element, options?: ToggleTabOptions): void
192
+
193
+ export {};
175
194
  }
176
195
 
177
196
  declare module 'winduum/src/components/toaster' {
@@ -205,6 +224,8 @@ declare module 'winduum/src/components/toaster' {
205
224
  export function insertToaster(element: HTMLElement, options?: InsertToasterOptions): Promise<void>
206
225
  export function insertToast(element: HTMLElement, options?: InsertToastOptions): Promise<void>
207
226
  export function closeToaster(element: HTMLElement, options?: CloseToastOptions): Promise<void>
227
+
228
+ export {};
208
229
  }
209
230
 
210
231
  declare module 'winduum/src/components/popover' {
@@ -222,6 +243,8 @@ declare module 'winduum/src/components/popover' {
222
243
  export function showPopover(element: HTMLElement | Element, options?: ShowPopoverOptions): Promise<void>
223
244
  export function hidePopover(element: HTMLElement | Element): Promise<void>
224
245
  export function togglePopover(element: HTMLElement | Element, options?: ShowPopoverOptions): Promise<void>
246
+
247
+ export {};
225
248
  }
226
249
 
227
250
  declare module 'winduum/src/ui/range' {
@@ -244,14 +267,20 @@ declare module 'winduum/src/ui/range' {
244
267
  export function setTrackProperty(options: SetTrackPropertyOptions, track: 'start' | 'end'): void
245
268
  export function setValue(element: HTMLInputElement, options?: SetValueOptions): void
246
269
  export function setOutputValue(element: HTMLInputElement, outputElement: HTMLOutputElement | Element, options?: SetOutputOptions): void
270
+
271
+ export {};
247
272
  }
248
273
 
249
274
  declare module 'winduum/src/utilities/ripple' {
250
275
  export function showRipple(event: MouseEvent, element?: HTMLElement): void
276
+
277
+ export {};
251
278
  }
252
279
 
253
280
  declare module 'winduum/src/utilities/swap' {
254
281
  export function toggleSwap(element: HTMLElement): void
282
+
283
+ export {};
255
284
  }
256
285
 
257
286
  //# sourceMappingURL=index.d.ts.map
@@ -96,5 +96,6 @@
96
96
  null,
97
97
  null
98
98
  ],
99
- "mappings": ";;kBAEiBA,aAAaA;;;;;;;;;;;;;;;;;;;;cAoBjBC,aAAaA;;;;;;kBCtBTC,sBAAsBA;;;;;;;;kBAQtBC,yBAAyBA;;;;;;kBAMzBC,qBAAqBA;;;;;;;;kBAQrBC,uBAAuBA;;;;;kBAKvBC,mBAAmBA;;;;iBAIpBC,UAAUA;iBACVC,UAAUA;iBACVC,QAAQA;iBACRC,YAAYA;iBACZC,eAAeA;iBACfC,cAAcA;iBACdC,kBAAkBA;iBAClBC,gBAAgBA;iBAChBC,YAAYA;;;;kBCvCXC,kBAAkBA;;;;;iBAKnBC,WAAWA;iBACXC,eAAeA;iBACfC,YAAYA;;;;kBCPXC,cAAcA;;;;;cAKlBC,cAAcA;iBACXC,WAAWA;iBACXC,YAAYA;iBACZC,aAAaA;;;;kBCRZJ,cAAcA;;;;;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