framework7-svelte 8.0.0-beta.3 → 8.0.0-beta.5

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.
@@ -3,7 +3,7 @@ import { SvelteComponentTyped } from 'svelte';
3
3
 
4
4
 
5
5
  interface ActionsLabelProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['div']> {
6
- bold?: boolean;
6
+ strong?: boolean;
7
7
  onClick?: (event?: any) => void;
8
8
  children?: React.ReactNode;
9
9
  color?: string;
@@ -8,7 +8,7 @@ interface PopoverProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap['
8
8
  opened ?: boolean;
9
9
  animate ?: boolean;
10
10
  targetEl ?: string | object;
11
- angle ?: boolean;
11
+ arrow ?: boolean;
12
12
  backdrop ?: boolean;
13
13
  backdropEl ?: string | object;
14
14
  closeByBackdropClick ?: boolean;
@@ -15,7 +15,7 @@
15
15
  export let opened = undefined;
16
16
  export let animate = undefined;
17
17
  export let targetEl = undefined;
18
- export let angle = undefined;
18
+ export let arrow = undefined;
19
19
  export let backdrop = undefined;
20
20
  export let backdropEl = undefined;
21
21
  export let closeByBackdropClick = undefined;
@@ -95,7 +95,7 @@
95
95
  if (typeof closeByOutsideClick !== 'undefined')
96
96
  params.closeByOutsideClick = closeByOutsideClick;
97
97
  if (typeof closeOnEscape !== 'undefined') params.closeOnEscape = closeOnEscape;
98
- if (typeof angle !== 'undefined') params.angle = angle;
98
+ if (typeof arrow !== 'undefined') params.arrow = arrow;
99
99
  if (typeof backdrop !== 'undefined') params.backdrop = backdrop;
100
100
  if (typeof backdropEl !== 'undefined') params.backdropEl = backdropEl;
101
101
  if (typeof containerEl !== 'undefined') params.containerEl = containerEl;
@@ -116,7 +116,7 @@
116
116
  </script>
117
117
 
118
118
  <div class={classes} bind:this={el} {style} {...restProps($$restProps)}>
119
- <div class="popover-angle" />
119
+ <div class="popover-arrow" />
120
120
  <div class="popover-inner">
121
121
  <slot popover={f7Popover} />
122
122
  </div>
@@ -29,7 +29,7 @@ interface SearchbarProps extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap
29
29
  ignore ?: string;
30
30
  customSearch ?: boolean;
31
31
  removeDiacritics ?: boolean;
32
- hideDividers ?: boolean;
32
+ hideGroupTitles ?: boolean;
33
33
  hideGroups ?: boolean;
34
34
  init ?: boolean;
35
35
  color?: string;
@@ -41,7 +41,7 @@
41
41
  export let ignore = '.searchbar-ignore';
42
42
  export let customSearch = false;
43
43
  export let removeDiacritics = false;
44
- export let hideDividers = true;
44
+ export let hideGroupTitles = true;
45
45
  export let hideGroups = true;
46
46
  export let init = true;
47
47
 
@@ -135,7 +135,7 @@
135
135
  ignore,
136
136
  customSearch,
137
137
  removeDiacritics,
138
- hideDividers,
138
+ hideGroupTitles,
139
139
  hideGroups,
140
140
  expandable,
141
141
  inline,
@@ -6,6 +6,7 @@
6
6
  import { classNames, createEmitter, getComponentId } from '../shared/utils.js';
7
7
  import { f7ready, app } from '../shared/f7.js';
8
8
  import { useTab } from '../shared/use-tab.js';
9
+ import { getReactiveContext } from '../shared/get-reactive-context.js';
9
10
 
10
11
  const emit = createEmitter(createEventDispatcher, $$props);
11
12
 
@@ -16,10 +17,17 @@
16
17
 
17
18
  const RouterContext = getContext('RouterContext') || {};
18
19
 
20
+ let TabsSwipeableContext =
21
+ getReactiveContext('TabsSwipeableContext', (newValue) => {
22
+ TabsSwipeableContext = newValue || false;
23
+ }) || {};
24
+
19
25
  let el;
20
26
  let routerData = null;
21
27
  let initialTabContent = null;
22
28
 
29
+ $: isSwiper = TabsSwipeableContext;
30
+
23
31
  if (
24
32
  !routerData &&
25
33
  RouterContext &&
@@ -83,9 +91,18 @@
83
91
  });
84
92
  </script>
85
93
 
86
- <div {id} class={classes} bind:this={el} {...restProps($$restProps)}>
87
- {#if tabContent}
88
- <svelte:component this={tabContent.component} {...tabContent.props} />
89
- {/if}
90
- <slot />
91
- </div>
94
+ {#if isSwiper || TabsSwipeableContext}
95
+ <swiper-slide {id} class={classes} bind:this={el} {...restProps($$restProps)}>
96
+ {#if tabContent}
97
+ <svelte:component this={tabContent.component} {...tabContent.props} />
98
+ {/if}
99
+ <slot />
100
+ </swiper-slide>
101
+ {:else}
102
+ <div {id} class={classes} bind:this={el} {...restProps($$restProps)}>
103
+ {#if tabContent}
104
+ <svelte:component this={tabContent.component} {...tabContent.props} />
105
+ {/if}
106
+ <slot />
107
+ </div>
108
+ {/if}
@@ -1,9 +1,10 @@
1
1
  <script>
2
- import { onMount } from 'svelte';
2
+ import { onMount, tick } from 'svelte';
3
3
 
4
4
  import { restProps } from '../shared/rest-props.js';
5
5
  import { colorClasses } from '../shared/mixins.js';
6
6
  import { classNames } from '../shared/utils.js';
7
+ import { setReactiveContext } from '../shared/set-reactive-context.js';
7
8
 
8
9
  let className = undefined;
9
10
  export { className as class };
@@ -15,28 +16,46 @@
15
16
  let wrapEl;
16
17
 
17
18
  $: classes = classNames(className, colorClasses($$props));
18
- $: wrapClasses = classNames({
19
- 'tabs-animated-wrap': animated,
20
- 'tabs-swipeable-wrap': swipeable,
21
- });
19
+
22
20
  $: tabsClasses = classNames({
23
21
  tabs: true,
24
22
  'tabs-routable': routable,
25
23
  });
26
24
 
25
+ setReactiveContext('TabsSwipeableContext', () => true);
26
+
27
27
  onMount(() => {
28
28
  if (swipeable && swiperParams && wrapEl) {
29
- wrapEl.f7SwiperParams = swiperParams;
29
+ Object.assign(wrapEl, swiperParams);
30
+ wrapEl.initialize();
30
31
  }
32
+ tick().then(() => {
33
+ if (swipeable && wrapEl.swiper) {
34
+ wrapEl.swiper.update();
35
+ }
36
+ });
31
37
  });
32
38
  </script>
33
39
 
34
- {#if animated || swipeable}
35
- <div class={classNames(wrapClasses, classes)} bind:this={wrapEl} {...restProps($$restProps)}>
40
+ {#if animated}
41
+ <div
42
+ class={classNames('tabs-animated-wrap', classes)}
43
+ bind:this={wrapEl}
44
+ {...restProps($$restProps)}
45
+ >
36
46
  <div class={tabsClasses}>
37
47
  <slot />
38
48
  </div>
39
49
  </div>
50
+ {:else if swipeable}
51
+ <swiper-container
52
+ bind:this={wrapEl}
53
+ class={classNames(tabsClasses, classes)}
54
+ {...restProps($$restProps)}
55
+ init={swiperParams ? 'false' : 'true'}
56
+ >
57
+ <slot />
58
+ </swiper-container>
40
59
  {:else}
41
60
  <div class={classNames(tabsClasses, classes)} {...restProps($$restProps)}>
42
61
  <slot />
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Framework7 Svelte 8.0.0-beta.3
2
+ * Framework7 Svelte 8.0.0-beta.5
3
3
  * Build full featured iOS & Android apps using Framework7 & Svelte
4
4
  * https://framework7.io/svelte/
5
5
  *
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * Released under the MIT License
9
9
  *
10
- * Released on: March 9, 2023
10
+ * Released on: March 23, 2023
11
11
  */
12
12
  import Framework7Svelte from './shared/plugin.js';
13
13
  import { f7, f7ready, theme, app } from './shared/f7.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework7-svelte",
3
- "version": "8.0.0-beta.3",
3
+ "version": "8.0.0-beta.5",
4
4
  "description": "Build full featured iOS & Android apps using Framework7 & Svelte",
5
5
  "type": "module",
6
6
  "svelte": "./framework7-svelte.js",
@@ -46,5 +46,5 @@
46
46
  "type": "patreon",
47
47
  "url": "https://www.patreon.com/framework7"
48
48
  },
49
- "releaseDate": "March 9, 2023"
49
+ "releaseDate": "March 23, 2023"
50
50
  }