@octane-xplat/date-picker 0.19.0 → 0.20.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.
@@ -7,50 +7,53 @@ export type StyleInput = string | Record<string, any> | null | undefined | reado
7
7
  * Authored keys win; array styles fold in order; a string style is appended
8
8
  * after the serialized defaults so its declarations override them too. */
9
9
  export function mergeStyle(
10
- base: Record<string, any>,
11
- style?: Record<string, any> | readonly (Record<string, any> | null | undefined)[] | null,
10
+ base: Record<string, any>,
11
+ style?: Record<string, any> | readonly (Record<string, any> | null | undefined)[] | null,
12
12
  ): Record<string, any>
13
13
 
14
14
  export function mergeStyle(
15
- base: Record<string, any>,
16
- style?: StyleInput,
15
+ base: Record<string, any>,
16
+ style?: StyleInput,
17
17
  ): string | Record<string, any>
18
18
 
19
19
  export function mergeStyle(
20
- base: Record<string, any>,
21
- style?: StyleInput,
20
+ base: Record<string, any>,
21
+ style?: StyleInput,
22
22
  ): string | Record<string, any> {
23
- if (style == null) {
24
- return base
25
- }
26
-
27
- let obj: Record<string, any> = { ...base }
28
- const strings: string[] = []
29
- const add = (s: StyleInput) => {
30
- if (s == null) {
31
- return
32
- }
33
- if (typeof s === 'string') {
34
- strings.push(s)
35
- } else if (Array.isArray(s)) {
36
- for (const part of s) {
37
- add(part)
38
- }
39
- } else {
40
- obj = { ...obj, ...s }
41
- }
42
- }
43
- add(style)
44
-
45
- if (strings.length === 0) {
46
- return obj
47
- }
48
-
49
- const prefix = Object.entries(obj)
50
- .filter(([, v]) => v != null)
51
- .map(([k, v]) => `${kebab(k)}:${v}`)
52
- .join(';')
53
- return [prefix, ...strings].filter(Boolean).join(';')
23
+ if (style == null) {
24
+ return base
25
+ }
26
+
27
+ let obj: Record<string, any> = { ...base }
28
+ const strings: string[] = []
29
+ const add = (s: StyleInput) => {
30
+ if (s == null) {
31
+ return
32
+ }
33
+
34
+ if (typeof s === 'string') {
35
+ strings.push(s)
36
+ } else if (Array.isArray(s)) {
37
+ for (const part of s) {
38
+ add(part)
39
+ }
40
+ } else {
41
+ obj = { ...obj, ...s }
42
+ }
43
+ }
44
+
45
+ add(style)
46
+
47
+ if (strings.length === 0) {
48
+ return obj
49
+ }
50
+
51
+ const prefix = Object.entries(obj)
52
+ .filter(([, v]) => v != null)
53
+ .map(([k, v]) => `${kebab(k)}:${v}`)
54
+ .join(';')
55
+
56
+ return [prefix, ...strings].filter(Boolean).join(';')
54
57
  }
55
58
 
56
59
  export type StyleProp = string | Record<string, any> | readonly StyleProp[] | null | undefined