@agnos-ui/svelte-bootstrap 0.3.1 → 0.4.0-next.1

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 (79) hide show
  1. package/components/accordion/Accordion.svelte +2 -8
  2. package/components/accordion/Accordion.svelte.d.ts +4 -2
  3. package/components/accordion/Item.svelte +14 -16
  4. package/components/accordion/Item.svelte.d.ts +6 -4
  5. package/components/accordion/ItemDefaultStructure.svelte +12 -14
  6. package/components/accordion/ItemDefaultStructure.svelte.d.ts +7 -5
  7. package/components/accordion/accordion.d.ts +7 -21
  8. package/components/accordion/accordion.gen.d.ts +343 -0
  9. package/components/accordion/accordion.gen.js +1 -0
  10. package/components/accordion/accordion.js +3 -3
  11. package/components/alert/Alert.svelte +5 -7
  12. package/components/alert/Alert.svelte.d.ts +4 -2
  13. package/components/alert/AlertDefaultStructure.svelte +2 -3
  14. package/components/alert/AlertDefaultStructure.svelte.d.ts +6 -4
  15. package/components/alert/alert.d.ts +5 -14
  16. package/components/alert/alert.gen.d.ts +119 -0
  17. package/components/alert/alert.gen.js +1 -0
  18. package/components/alert/alert.js +2 -3
  19. package/components/modal/Modal.svelte +6 -8
  20. package/components/modal/Modal.svelte.d.ts +3 -3
  21. package/components/modal/ModalDefaultHeader.svelte +2 -3
  22. package/components/modal/ModalDefaultHeader.svelte.d.ts +5 -5
  23. package/components/modal/ModalDefaultStructure.svelte +6 -7
  24. package/components/modal/ModalDefaultStructure.svelte.d.ts +5 -5
  25. package/components/modal/modal.d.ts +7 -15
  26. package/components/modal/modal.gen.d.ts +239 -0
  27. package/components/modal/modal.gen.js +1 -0
  28. package/components/modal/modal.js +3 -3
  29. package/components/pagination/Pagination.svelte +12 -14
  30. package/components/pagination/Pagination.svelte.d.ts +4 -2
  31. package/components/pagination/PaginationDefaultPages.svelte +15 -15
  32. package/components/pagination/PaginationDefaultPages.svelte.d.ts +6 -4
  33. package/components/pagination/PaginationDefaultStructure.svelte +42 -44
  34. package/components/pagination/PaginationDefaultStructure.svelte.d.ts +6 -4
  35. package/components/pagination/pagination.d.ts +5 -16
  36. package/components/pagination/pagination.gen.d.ts +394 -0
  37. package/components/pagination/pagination.gen.js +1 -0
  38. package/components/pagination/pagination.js +2 -3
  39. package/components/progressbar/Progressbar.svelte +5 -7
  40. package/components/progressbar/Progressbar.svelte.d.ts +4 -2
  41. package/components/progressbar/ProgressbarDefaultStructure.svelte +2 -3
  42. package/components/progressbar/ProgressbarDefaultStructure.svelte.d.ts +6 -4
  43. package/components/progressbar/progressbar.d.ts +5 -14
  44. package/components/progressbar/progressbar.gen.d.ts +126 -0
  45. package/components/progressbar/progressbar.gen.js +1 -0
  46. package/components/progressbar/progressbar.js +2 -3
  47. package/components/rating/Rating.svelte +3 -5
  48. package/components/rating/Rating.svelte.d.ts +6 -7
  49. package/components/rating/rating.d.ts +5 -12
  50. package/components/rating/rating.gen.d.ts +179 -0
  51. package/components/rating/rating.gen.js +1 -0
  52. package/components/rating/rating.js +2 -3
  53. package/components/select/Select.svelte +11 -8
  54. package/components/select/Select.svelte.d.ts +2 -2
  55. package/components/select/select.d.ts +5 -16
  56. package/components/select/select.gen.d.ts +293 -0
  57. package/components/select/select.gen.js +1 -0
  58. package/components/select/select.js +2 -3
  59. package/components/slider/Slider.svelte +6 -8
  60. package/components/slider/Slider.svelte.d.ts +4 -2
  61. package/components/slider/SliderDefaultHandle.svelte.d.ts +6 -4
  62. package/components/slider/SliderDefaultStructure.svelte +9 -10
  63. package/components/slider/SliderDefaultStructure.svelte.d.ts +6 -4
  64. package/components/slider/slider.d.ts +5 -18
  65. package/components/slider/slider.gen.d.ts +293 -0
  66. package/components/slider/slider.gen.js +1 -0
  67. package/components/slider/slider.js +2 -3
  68. package/components/toast/Toast.svelte +6 -15
  69. package/components/toast/Toast.svelte.d.ts +4 -2
  70. package/components/toast/ToastDefaultStructure.svelte +5 -6
  71. package/components/toast/ToastDefaultStructure.svelte.d.ts +6 -4
  72. package/components/toast/toast.d.ts +5 -14
  73. package/components/toast/toast.gen.d.ts +146 -0
  74. package/components/toast/toast.gen.js +1 -0
  75. package/components/toast/toast.js +2 -3
  76. package/config.d.ts +4 -6
  77. package/config.gen.d.ts +47 -0
  78. package/config.gen.js +1 -0
  79. package/package.json +6 -6
@@ -3,25 +3,19 @@ import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes, classDirectiv
3
3
  import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';
4
4
  import { callWidgetFactory } from "../../config";
5
5
  import { createAccordion, setAccordionApi } from "./accordion";
6
- export let itemVisible = void 0;
7
6
  const widget = callWidgetFactory({
8
7
  factory: createAccordion,
9
8
  widgetName: "accordion",
10
9
  $$slots,
11
10
  $$props,
12
- events: {
13
- onItemVisibleChange: (event) => {
14
- itemVisible = event;
15
- }
16
- }
11
+ events: {}
17
12
  });
18
13
  export const api = widget.api;
19
14
  const {
20
15
  directives: { accordionDirective }
21
16
  } = widget;
22
17
  setAccordionApi(widget.api);
23
- $:
24
- widget.patchChangedProps($$props);
18
+ $: widget.patchChangedProps($$props);
25
19
  </script>
26
20
 
27
21
  <div use:__AgnosUISveltePreprocess__classDirective={"accordion"} use:accordionDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(accordionDirective, [__AgnosUISveltePreprocess__classDirective, "accordion"])}>
@@ -1,4 +1,4 @@
1
- import { SvelteComponentTyped } from "svelte";
1
+ import { SvelteComponent } from "svelte";
2
2
  import type { AccordionApi, AccordionProps, AccordionSlots } from './accordion';
3
3
  declare const __propDef: {
4
4
  props: {
@@ -10,12 +10,14 @@ declare const __propDef: {
10
10
  slots: {
11
11
  default: Record<string, never>;
12
12
  } & AccordionSlots;
13
+ exports?: {} | undefined;
14
+ bindings?: string | undefined;
13
15
  };
14
16
  type AccordionProps_ = typeof __propDef.props;
15
17
  export { AccordionProps_ as AccordionProps };
16
18
  export type AccordionEvents = typeof __propDef.events;
17
19
  type AccordionSlots_ = typeof __propDef.slots;
18
20
  export { AccordionSlots_ as AccordionSlots };
19
- export default class Accordion extends SvelteComponentTyped<AccordionProps_, AccordionEvents, AccordionSlots_> {
21
+ export default class Accordion extends SvelteComponent<AccordionProps_, AccordionEvents, AccordionSlots_> {
20
22
  get api(): AccordionApi;
21
23
  }
@@ -8,46 +8,44 @@ import { onMount } from "svelte";
8
8
  import ItemDefaultStructure from "./ItemDefaultStructure.svelte";
9
9
  import { getAccordionApi } from "./accordion";
10
10
  const defaultConfig = {
11
- slotItemStructure: ItemDefaultStructure
11
+ structure: ItemDefaultStructure
12
12
  };
13
13
  </script>
14
14
 
15
15
  <script>const accordionApi = getAccordionApi();
16
16
  const { registerItem } = accordionApi;
17
- export let itemVisible = void 0;
17
+ export let visible = void 0;
18
18
  const widget = callWidgetFactory({
19
19
  factory: registerItem,
20
20
  $$slots,
21
21
  $$props,
22
22
  defaultConfig,
23
23
  events: {
24
- onItemVisibleChange: (event) => {
25
- itemVisible = event;
24
+ onVisibleChange: (event) => {
25
+ visible = event;
26
26
  }
27
27
  }
28
28
  });
29
29
  const {
30
- stores: { slotItemStructure$ },
31
- directives: { accordionItemDirective },
30
+ stores: { structure$ },
31
+ directives: { itemDirective },
32
32
  state$
33
33
  } = widget;
34
34
  export const api = widget.api;
35
- $:
36
- widget.patchChangedProps($$props);
37
- $:
38
- slotContext = { widget: toSlotContextWidget(widget), state: $state$ };
35
+ $: widget.patchChangedProps($$props);
36
+ $: slotContext = { widget: toSlotContextWidget(widget), state: $state$ };
39
37
  onMount(() => {
40
38
  widget.api.initDone();
41
39
  });
42
40
  </script>
43
41
 
44
- <div use:__AgnosUISveltePreprocess__classDirective={"accordion-item"} use:accordionItemDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(accordionItemDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-item"])}>
45
- <Slot slotContent={$slotItemStructure$} props={slotContext} let:component let:props>
46
- <svelte:fragment slot="slot" let:props><slot name="itemStructure" {...props} /></svelte:fragment>
42
+ <div use:__AgnosUISveltePreprocess__classDirective={"accordion-item"} use:itemDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(itemDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-item"])}>
43
+ <Slot slotContent={$structure$} props={slotContext} let:component let:props>
44
+ <svelte:fragment slot="slot" let:props><slot name="structure" {...props} /></svelte:fragment>
47
45
  <svelte:component this={component} {...props}>
48
- <svelte:fragment slot="itemBody" let:state let:widget><slot name="itemBody" {state} {widget} /></svelte:fragment>
49
- <svelte:fragment slot="itemHeader" let:state let:widget><slot name="itemHeader" {state} {widget} /></svelte:fragment>
50
- <svelte:fragment slot="itemStructure" let:state let:widget><slot name="itemStructure" {state} {widget} /></svelte:fragment>
46
+ <svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
47
+ <svelte:fragment slot="header" let:state let:widget><slot name="header" {state} {widget} /></svelte:fragment>
48
+ <svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
51
49
  </svelte:component>
52
50
  </Slot>
53
51
  </div>
@@ -1,5 +1,5 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { AccordionItemApi, AccordionItemProps, AccordionSlots } from './accordion';
1
+ import { SvelteComponent } from "svelte";
2
+ import type { AccordionItemApi, AccordionItemProps, AccordionItemSlots } from './accordion';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  api?: AccordionItemApi | undefined;
@@ -7,12 +7,14 @@ declare const __propDef: {
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  };
10
- slots: AccordionSlots;
10
+ slots: AccordionItemSlots;
11
+ exports?: {} | undefined;
12
+ bindings?: string | undefined;
11
13
  };
12
14
  export type ItemProps = typeof __propDef.props;
13
15
  export type ItemEvents = typeof __propDef.events;
14
16
  export type ItemSlots = typeof __propDef.slots;
15
- export default class Item extends SvelteComponentTyped<ItemProps, ItemEvents, ItemSlots> {
17
+ export default class Item extends SvelteComponent<ItemProps, ItemEvents, ItemSlots> {
16
18
  get api(): AccordionItemApi;
17
19
  }
18
20
  export {};
@@ -5,20 +5,18 @@ import { Slot } from "@agnos-ui/svelte-headless/slot";
5
5
  export let state;
6
6
  export let widget;
7
7
  const re = new RegExp("^h[1-6]$");
8
- $:
9
- slotContext = { widget, state };
10
- $:
11
- headingTag = re.test(state.itemHeadingTag) ? state.itemHeadingTag : "h2";
8
+ $: slotContext = { widget, state };
9
+ $: headingTag = re.test(state.headingTag) ? state.headingTag : "h2";
12
10
  </script>
13
11
 
14
12
  <svelte:element this={headingTag} use:__AgnosUISveltePreprocess__classDirective={"accordion-header"} use:slotContext.widget.directives.headerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(slotContext.widget.directives.headerDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-header"])}>
15
13
  <button use:slotContext.widget.directives.buttonDirective use:__AgnosUISveltePreprocess__classDirective={"accordion-button"} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(slotContext.widget.directives.buttonDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-button"])}>
16
- <Slot slotContent={state.slotItemHeader} props={slotContext} let:component let:props>
17
- <svelte:fragment slot="slot" let:props><slot name="itemHeader" {...props} /></svelte:fragment>
14
+ <Slot slotContent={state.header} props={slotContext} let:component let:props>
15
+ <svelte:fragment slot="slot" let:props><slot name="header" {...props} /></svelte:fragment>
18
16
  <svelte:component this={component} {...props}>
19
- <svelte:fragment slot="itemBody" let:state let:widget><slot name="itemBody" {state} {widget} /></svelte:fragment>
20
- <svelte:fragment slot="itemHeader" let:state let:widget><slot name="itemHeader" {state} {widget} /></svelte:fragment>
21
- <svelte:fragment slot="itemStructure" let:state let:widget><slot name="itemStructure" {state} {widget} /></svelte:fragment>
17
+ <svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
18
+ <svelte:fragment slot="header" let:state let:widget><slot name="header" {state} {widget} /></svelte:fragment>
19
+ <svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
22
20
  </svelte:component>
23
21
  </Slot>
24
22
  </button>
@@ -26,12 +24,12 @@ $:
26
24
  {#if state.shouldBeInDOM}
27
25
  <div use:__AgnosUISveltePreprocess__classDirective={"accordion-collapse"} use:widget.directives.bodyContainerDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.bodyContainerDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-collapse"])}>
28
26
  <div use:__AgnosUISveltePreprocess__classDirective={"accordion-body"} use:widget.directives.bodyDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(widget.directives.bodyDirective, [__AgnosUISveltePreprocess__classDirective, "accordion-body"])}>
29
- <Slot slotContent={state.slotItemBody} props={slotContext} let:component let:props>
30
- <svelte:fragment slot="slot" let:props><slot name="itemBody" {...props} /></svelte:fragment>
27
+ <Slot slotContent={state.children} props={slotContext} let:component let:props>
28
+ <svelte:fragment slot="slot" let:props><slot {...props} /></svelte:fragment>
31
29
  <svelte:component this={component} {...props}>
32
- <svelte:fragment slot="itemBody" let:state let:widget><slot name="itemBody" {state} {widget} /></svelte:fragment>
33
- <svelte:fragment slot="itemHeader" let:state let:widget><slot name="itemHeader" {state} {widget} /></svelte:fragment>
34
- <svelte:fragment slot="itemStructure" let:state let:widget><slot name="itemStructure" {state} {widget} /></svelte:fragment>
30
+ <svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
31
+ <svelte:fragment slot="header" let:state let:widget><slot name="header" {state} {widget} /></svelte:fragment>
32
+ <svelte:fragment slot="structure" let:state let:widget><slot name="structure" {state} {widget} /></svelte:fragment>
35
33
  </svelte:component>
36
34
  </Slot>
37
35
  </div>
@@ -1,15 +1,17 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { AccordionItemContext, AccordionSlots } from './accordion';
1
+ import { SvelteComponent } from "svelte";
2
+ import type { AccordionItemSlots } from './accordion';
3
3
  declare const __propDef: {
4
- props: AccordionItemContext;
4
+ props: WidgetSlotContext<Widget<import("./accordion.gen").AccordionItemProps, import("./accordion.gen").AccordionItemState, import("./accordion.gen").AccordionItemApi, import("./accordion.gen").AccordionItemActions, import("./accordion.gen").AccordionItemDirectives>>;
5
5
  events: {
6
6
  [evt: string]: CustomEvent<any>;
7
7
  };
8
- slots: AccordionSlots;
8
+ slots: AccordionItemSlots;
9
+ exports?: {} | undefined;
10
+ bindings?: string | undefined;
9
11
  };
10
12
  export type ItemDefaultStructureProps = typeof __propDef.props;
11
13
  export type ItemDefaultStructureEvents = typeof __propDef.events;
12
14
  export type ItemDefaultStructureSlots = typeof __propDef.slots;
13
- export default class ItemDefaultStructure extends SvelteComponentTyped<ItemDefaultStructureProps, ItemDefaultStructureEvents, ItemDefaultStructureSlots> {
15
+ export default class ItemDefaultStructure extends SvelteComponent<ItemDefaultStructureProps, ItemDefaultStructureEvents, ItemDefaultStructureSlots> {
14
16
  }
15
17
  export {};
@@ -1,26 +1,12 @@
1
- export * from '@agnos-ui/core-bootstrap/components/accordion';
2
- import type { AdaptSlotContentProps, AdaptWidgetSlots, WidgetFactory, WidgetProps, WidgetState, WidgetPropsSlots, PropType } from '@agnos-ui/svelte-headless/types';
3
- import type { AccordionWidget as CoreWidget, AccordionItemWidget as CoreItemWidget, AccordionItemContext as CoreItemContext } from '@agnos-ui/core-bootstrap/components/accordion';
4
- export interface AccordionWidget extends AdaptWidgetSlots<CoreWidget> {
5
- }
6
- export interface AccordionProps extends WidgetProps<AccordionWidget> {
7
- }
8
- export interface AccordionState extends WidgetState<AccordionWidget> {
9
- }
10
- export interface AccordionApi extends PropType<AccordionWidget, 'api'> {
11
- }
12
- export interface AccordionItemWidget extends AdaptWidgetSlots<CoreItemWidget> {
13
- }
14
- export interface AccordionItemProps extends WidgetProps<AccordionItemWidget> {
15
- }
16
- export interface AccordionItemState extends WidgetState<AccordionItemWidget> {
17
- }
18
- export interface AccordionItemApi extends PropType<AccordionItemWidget, 'api'> {
19
- }
1
+ import type { WidgetFactory, WidgetPropsSlots } from '@agnos-ui/svelte-headless/types';
2
+ import type { AccordionWidget, AccordionApi, AccordionProps, AccordionItemProps, AccordionItemWidget } from './accordion.gen';
3
+ export type * from './accordion.gen';
4
+ export declare const createAccordion: WidgetFactory<AccordionWidget>;
5
+ export declare const getAccordionDefaultConfig: () => AccordionProps;
6
+ export declare const createAccordionItem: WidgetFactory<AccordionItemWidget>;
20
7
  export interface AccordionSlots extends WidgetPropsSlots<AccordionProps> {
21
8
  }
22
- export interface AccordionItemContext extends AdaptSlotContentProps<CoreItemContext> {
9
+ export interface AccordionItemSlots extends WidgetPropsSlots<AccordionItemProps> {
23
10
  }
24
- export declare const createAccordion: WidgetFactory<AccordionWidget>;
25
11
  export declare function setAccordionApi(accordionApi: AccordionApi): void;
26
12
  export declare function getAccordionApi(): AccordionApi;
@@ -0,0 +1,343 @@
1
+ import type { WidgetSlotContext, SlotContent, Widget, PropsConfig, Directive } from '@agnos-ui/svelte-headless/types';
2
+ import type { TransitionFn } from '@agnos-ui/svelte-headless/services/transitions/baseTransitions';
3
+ export type AccordionItemContext = WidgetSlotContext<AccordionItemWidget>;
4
+ export interface AccordionState {
5
+ /**
6
+ * Array containing all the accordion-items contained in the accordion.
7
+ */
8
+ itemWidgets: AccordionItemWidget[];
9
+ /**
10
+ * CSS classes to be applied on the widget main container
11
+ */
12
+ className: string;
13
+ /**
14
+ * Structure of the accordion-item. The default item structure is: accordion-item
15
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
16
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
17
+ * The itemTransition is applied on this element.
18
+ *
19
+ * It is a prop of the accordion-item.
20
+ */
21
+ itemStructure: SlotContent<AccordionItemContext>;
22
+ }
23
+ export interface AccordionProps {
24
+ /**
25
+ * If `true`, only one accordion-item at the time can stay open.
26
+ */
27
+ closeOthers: boolean;
28
+ /**
29
+ * An event fired when an item is shown.
30
+ *
31
+ * Event payload is the id of the item.
32
+ */
33
+ onItemShown: (itemId: string) => void;
34
+ /**
35
+ * An event fired when an item is hidden.
36
+ *
37
+ * Event payload is the id of the item.
38
+ */
39
+ onItemHidden: (itemId: string) => void;
40
+ /**
41
+ * If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
42
+ */
43
+ itemDestroyOnHide: boolean;
44
+ /**
45
+ * If `true`, accordion-item will be animated.
46
+ */
47
+ itemAnimated: boolean;
48
+ /**
49
+ * The transition to use for the accordion-item body-container when the accordion-item is toggled.
50
+ */
51
+ itemTransition: TransitionFn;
52
+ /**
53
+ * CSS classes to add on the accordion-item DOM element.
54
+ */
55
+ itemClassName: string;
56
+ /**
57
+ * CSS classes to add on the accordion-item header DOM element.
58
+ */
59
+ itemHeaderClassName: string;
60
+ /**
61
+ * CSS classes to add on the accordion-item toggle button DOM element.
62
+ */
63
+ itemButtonClassName: string;
64
+ /**
65
+ * CSS classes to add on the accordion-item body container DOM element.
66
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
67
+ */
68
+ itemBodyContainerClassName: string;
69
+ /**
70
+ * CSS classes to add on the accordion-item body DOM element.
71
+ */
72
+ itemBodyClassName: string;
73
+ /**
74
+ * The html tag to use for the accordion-item-header.
75
+ */
76
+ itemHeadingTag: string;
77
+ /**
78
+ * CSS classes to be applied on the widget main container
79
+ */
80
+ className: string;
81
+ /**
82
+ * Structure of the accordion-item. The default item structure is: accordion-item
83
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
84
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
85
+ * The itemTransition is applied on this element.
86
+ *
87
+ * It is a prop of the accordion-item.
88
+ */
89
+ itemStructure: SlotContent<AccordionItemContext>;
90
+ }
91
+ export type AccordionWidget = Widget<AccordionProps, AccordionState, AccordionApi, object, AccordionDirectives>;
92
+ export interface AccordionItemState {
93
+ /**
94
+ * If `true` the content of the accordion-item collapse should be in DOM. Its value depends on the
95
+ * value of the `visible` and `destroyOnHide`.
96
+ */
97
+ shouldBeInDOM: boolean;
98
+ /**
99
+ * If `true`, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
100
+ */
101
+ visible: boolean;
102
+ /**
103
+ * If `true`, the accordion-item will be disabled.
104
+ * It will not react to user's clicks, but still will be possible to toggle programmatically.
105
+ */
106
+ disabled: boolean;
107
+ /**
108
+ * The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
109
+ */
110
+ id: string;
111
+ /**
112
+ * CSS classes to add on the accordion-item header DOM element.
113
+ */
114
+ headerClassName: string;
115
+ /**
116
+ * CSS classes to add on the accordion-item collapse DOM element.
117
+ */
118
+ buttonClassName: string;
119
+ /**
120
+ * CSS classes to add on the accordion-item body container DOM element.
121
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
122
+ */
123
+ bodyContainerClassName: string;
124
+ /**
125
+ * CSS classes to add on the accordion-item body DOM element.
126
+ */
127
+ bodyClassName: string;
128
+ /**
129
+ * The html tag to use for the accordion-item-header.
130
+ */
131
+ headingTag: string;
132
+ /**
133
+ * CSS classes to be applied on the widget main container
134
+ */
135
+ className: string;
136
+ /**
137
+ * Structure of the accordion-item. The default item structure is: accordion-item
138
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
139
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
140
+ * The itemTransition is applied on this element.
141
+ *
142
+ * It is a prop of the accordion-item.
143
+ */
144
+ structure: SlotContent<AccordionItemContext>;
145
+ /**
146
+ * Content present in the accordion body.
147
+ *
148
+ * It is a prop of the accordion-item.
149
+ */
150
+ children: SlotContent<AccordionItemContext>;
151
+ /**
152
+ * Content present in the accordion button inside the accordion header.
153
+ *
154
+ * It is a prop of the accordion-item.
155
+ */
156
+ header: SlotContent<AccordionItemContext>;
157
+ }
158
+ export interface AccordionItemProps {
159
+ /**
160
+ * If `true`, accordion-item will be animated.
161
+ */
162
+ animated: boolean;
163
+ /**
164
+ * The transition to use for the accordion-item body-container when the accordion-item is toggled.
165
+ */
166
+ transition: TransitionFn;
167
+ /**
168
+ * If `true`, the accordion-item body container will be removed from the DOM when the accordion-item is collapsed. It will be just hidden otherwise.
169
+ */
170
+ destroyOnHide: boolean;
171
+ /**
172
+ * An event fired when an item is shown.
173
+ */
174
+ onShown: () => void;
175
+ /**
176
+ * An event fired when an item is hidden.
177
+ */
178
+ onHidden: () => void;
179
+ /**
180
+ * An event fired when the `visible` value changes.
181
+ *
182
+ * Event payload is the new value of visible.
183
+ */
184
+ onVisibleChange: (visible: boolean) => void;
185
+ /**
186
+ * If `true`, the accordion-item will be visible (expanded). Otherwise, it will be hidden (collapsed).
187
+ */
188
+ visible: boolean;
189
+ /**
190
+ * If `true`, the accordion-item will be disabled.
191
+ * It will not react to user's clicks, but still will be possible to toggle programmatically.
192
+ */
193
+ disabled: boolean;
194
+ /**
195
+ * The id of the accordion-item. It can be used for controlling the accordion-item via the accordion api.
196
+ */
197
+ id: string;
198
+ /**
199
+ * CSS classes to add on the accordion-item header DOM element.
200
+ */
201
+ headerClassName: string;
202
+ /**
203
+ * CSS classes to add on the accordion-item collapse DOM element.
204
+ */
205
+ buttonClassName: string;
206
+ /**
207
+ * CSS classes to add on the accordion-item body container DOM element.
208
+ * The accordion-item body container is the DOM element on what the itemTransition is applied.
209
+ */
210
+ bodyContainerClassName: string;
211
+ /**
212
+ * CSS classes to add on the accordion-item body DOM element.
213
+ */
214
+ bodyClassName: string;
215
+ /**
216
+ * The html tag to use for the accordion-item-header.
217
+ */
218
+ headingTag: string;
219
+ /**
220
+ * CSS classes to be applied on the widget main container
221
+ */
222
+ className: string;
223
+ /**
224
+ * Structure of the accordion-item. The default item structure is: accordion-item
225
+ * contains accordion header and accordion-item body container; the accordion header contains the accordion button
226
+ * (that contains `header`), while the accordion-item body container contains the accordion body (that contains `children`).
227
+ * The itemTransition is applied on this element.
228
+ *
229
+ * It is a prop of the accordion-item.
230
+ */
231
+ structure: SlotContent<AccordionItemContext>;
232
+ /**
233
+ * Content present in the accordion body.
234
+ *
235
+ * It is a prop of the accordion-item.
236
+ */
237
+ children: SlotContent<AccordionItemContext>;
238
+ /**
239
+ * Content present in the accordion button inside the accordion header.
240
+ *
241
+ * It is a prop of the accordion-item.
242
+ */
243
+ header: SlotContent<AccordionItemContext>;
244
+ }
245
+ export type AccordionItemWidget = Widget<AccordionItemProps, AccordionItemState, AccordionItemApi, AccordionItemActions, AccordionItemDirectives>;
246
+ export interface AccordionApi {
247
+ /**
248
+ * Given the itemId, will expand the corresponding accordion-item.
249
+ *
250
+ * If the itemId is not valid, nothing will happen.
251
+ */
252
+ expand(itemId: string): void;
253
+ /**
254
+ * Given the itemId, will collapse the corresponding accordion-item.
255
+ *
256
+ * If the itemId is not valid, nothing will happen.
257
+ */
258
+ collapse(itemId: string): void;
259
+ /**
260
+ * Given the itemId, will toggle the corresponding accordion-item.
261
+ *
262
+ * If the itemId is not valid, nothing will happen.
263
+ */
264
+ toggle(itemId: string): void;
265
+ /**
266
+ * It will expand all the items in the accordion.
267
+ *
268
+ * If `closeOthers` is `true` it will expand only the last accordion-item.
269
+ */
270
+ expandAll(): void;
271
+ /**
272
+ * It will collapse all the accordion-items in the accordion.
273
+ */
274
+ collapseAll(): void;
275
+ /**
276
+ * Creates a new accordionItem.
277
+ */
278
+ registerItem(itemConfig?: PropsConfig<AccordionItemProps>): AccordionItemWidget;
279
+ }
280
+ export interface AccordionDirectives {
281
+ /**
282
+ * Directive to put on the accordion DOM element
283
+ */
284
+ accordionDirective: Directive;
285
+ }
286
+ export interface AccordionItemActions {
287
+ /**
288
+ * Action to be called when the user clicks on the accordion-item button. If the accordion-item is disabled nothing will happen.
289
+ */
290
+ click(): void;
291
+ }
292
+ export interface AccordionItemApi {
293
+ /**
294
+ * It will collapse the accordion-item.
295
+ */
296
+ collapse(): void;
297
+ /**
298
+ * It will expand the accordion-item.
299
+ */
300
+ expand(): void;
301
+ /**
302
+ * It will toggle the accordion-item.
303
+ */
304
+ toggle(): void;
305
+ /**
306
+ * Method to be called after the initialization to allow animations.
307
+ */
308
+ initDone(): void;
309
+ }
310
+ export interface AccordionItemDirectives {
311
+ /**
312
+ * Directive to use in special cases, if the accordion header does not use a button element to control the collapsing.
313
+ */
314
+ toggleDirective: Directive;
315
+ /**
316
+ * Directive to put on the button element that will control the collapsing of the accordion-item.
317
+ */
318
+ buttonDirective: Directive;
319
+ /**
320
+ * Directive to put on the accordion-item header that will contain the button element.
321
+ */
322
+ headerDirective: Directive;
323
+ /**
324
+ * Directive to put on the accordion-item body.
325
+ */
326
+ bodyDirective: Directive;
327
+ /**
328
+ * Directive to apply the itemTransition
329
+ */
330
+ transitionDirective: Directive;
331
+ /**
332
+ * Directive to apply aria attributes to the expanded body panel
333
+ */
334
+ bodyContainerAttrsDirective: Directive;
335
+ /**
336
+ * Directive to be put on the accordion-item body container. It will handle the animation.
337
+ */
338
+ bodyContainerDirective: Directive;
339
+ /**
340
+ * Directive to be put on the accordion-item. It will handle adding the accordion-item to the accordion.
341
+ */
342
+ itemDirective: Directive;
343
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,7 @@
1
- export * from '@agnos-ui/core-bootstrap/components/accordion';
2
- import { createAccordion as coreCreateAccordion } from '@agnos-ui/core-bootstrap/components/accordion';
3
- // factory
1
+ import { createAccordion as coreCreateAccordion, getAccordionDefaultConfig as coreGetAccordionDefaultConfig, createAccordionItem as coreCreateAccordionItem, } from '@agnos-ui/core-bootstrap/components/accordion';
4
2
  export const createAccordion = coreCreateAccordion;
3
+ export const getAccordionDefaultConfig = coreGetAccordionDefaultConfig;
4
+ export const createAccordionItem = coreCreateAccordionItem;
5
5
  // context
6
6
  import { getContext, setContext } from 'svelte';
7
7
  const contextInjectionKey = Symbol('accordion-api');
@@ -6,7 +6,7 @@ import { createAlert } from "./alert";
6
6
  import { callWidgetFactory } from "../../config";
7
7
  import AlertDefaultStructure from "./AlertDefaultStructure.svelte";
8
8
  const defaultConfig = {
9
- slotStructure: AlertDefaultStructure
9
+ structure: AlertDefaultStructure
10
10
  };
11
11
  </script>
12
12
 
@@ -25,14 +25,12 @@ const defaultConfig = {
25
25
  export let visible = void 0;
26
26
  export const api = widget.api;
27
27
  const {
28
- stores: { slotStructure$, hidden$ },
28
+ stores: { structure$, hidden$ },
29
29
  directives: { transitionDirective },
30
30
  state$
31
31
  } = widget;
32
- $:
33
- widget.patchChangedProps($$props);
34
- $:
35
- slotContext = { widget, state: $state$ };
32
+ $: widget.patchChangedProps($$props);
33
+ $: slotContext = { widget, state: $state$ };
36
34
  </script>
37
35
 
38
36
  {#if !$hidden$}
@@ -41,7 +39,7 @@ $:
41
39
  use:__AgnosUISveltePreprocess__classDirective={"au-alert alert alert-"+($state$.type)+" "+($state$.className)+" "+($state$.dismissible ? 'alert-dismissible' : '')}
42
40
  use:transitionDirective {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(transitionDirective, [__AgnosUISveltePreprocess__classDirective, "au-alert alert alert-"+($state$.type)+" "+($state$.className)+" "+($state$.dismissible ? 'alert-dismissible' : '')])}
43
41
  >
44
- <Slot slotContent={$slotStructure$} props={slotContext} let:component let:props>
42
+ <Slot slotContent={$structure$} props={slotContext} let:component let:props>
45
43
  <svelte:fragment slot="slot" let:props><slot name="structure" {...props} /></svelte:fragment>
46
44
  <svelte:component this={component} {...props}>
47
45
  <svelte:fragment let:state let:widget><slot {state} {widget} /></svelte:fragment>
@@ -1,4 +1,4 @@
1
- import { SvelteComponentTyped } from "svelte";
1
+ import { SvelteComponent } from "svelte";
2
2
  import { type AlertApi, type AlertProps, type AlertSlots } from './alert';
3
3
  declare const __propDef: {
4
4
  props: {
@@ -8,12 +8,14 @@ declare const __propDef: {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  };
10
10
  slots: AlertSlots;
11
+ exports?: {} | undefined;
12
+ bindings?: string | undefined;
11
13
  };
12
14
  type AlertProps_ = typeof __propDef.props;
13
15
  export { AlertProps_ as AlertProps };
14
16
  export type AlertEvents = typeof __propDef.events;
15
17
  type AlertSlots_ = typeof __propDef.slots;
16
18
  export { AlertSlots_ as AlertSlots };
17
- export default class Alert extends SvelteComponentTyped<AlertProps_, AlertEvents, AlertSlots_> {
19
+ export default class Alert extends SvelteComponent<AlertProps_, AlertEvents, AlertSlots_> {
18
20
  get api(): AlertApi;
19
21
  }