hamzus-ui 0.0.43 → 0.0.45

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/index.d.ts CHANGED
@@ -22,6 +22,9 @@ export { default as TextArea } from "./src/components/hamzus-ui/TextArea/TextAre
22
22
  export { default as Checkbox } from "./src/components/hamzus-ui/Checkboxes/Checkbox/Checkbox.svelte"
23
23
  export { default as Switch } from "./src/components/hamzus-ui/Switch/Switch.svelte"
24
24
 
25
+ // navigation
26
+ export * as Tabs from "./src/components/hamzus-ui/Tabs"
27
+
25
28
  // data
26
29
  export * as Table from "./src/components/hamzus-ui/Table"
27
30
  export { default as ProgressCircle } from "./src/components/hamzus-ui/ProgressCircle/ProgressCircle.svelte"
package/index.js CHANGED
@@ -17,6 +17,10 @@ export { default as DatePicker } from "./src/components/hamzus-ui/DatePicker/Dat
17
17
  export { default as TextArea } from "./src/components/hamzus-ui/TextArea/TextArea.svelte"
18
18
  export { default as Checkbox } from "./src/components/hamzus-ui/Checkboxes/Checkbox/Checkbox.svelte"
19
19
  export { default as Switch } from "./src/components/hamzus-ui/Switch/Switch.svelte"
20
+
21
+ // navigation
22
+ export * as Tabs from "./src/components/hamzus-ui/Tabs"
23
+
20
24
  // data
21
25
  export * as Table from "./src/components/hamzus-ui/Table"
22
26
  export { default as ProgressCircle } from "./src/components/hamzus-ui/ProgressCircle/ProgressCircle.svelte"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hamzus-ui",
3
- "version": "0.0.43",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "svelte": "index.js",
@@ -23,8 +23,6 @@
23
23
  return;
24
24
  }
25
25
 
26
- console.log("ripple");
27
-
28
26
  const ripple = document.createElement('span');
29
27
 
30
28
  const rect = button.getBoundingClientRect();
@@ -66,7 +66,6 @@
66
66
  if (position === 'before') {
67
67
  actualValue[tableId].columns[i].filterBefore = '';
68
68
  // si son filtre befoire n est pas set obn surtpimme le filtrer general
69
- console.log(actualValue[tableId].columns[i].filterAfter);
70
69
 
71
70
  if (!actualValue[tableId].columns[i].filterAfter) {
72
71
  actualValue[tableId].columns[i].filter = '';
@@ -115,7 +114,6 @@
115
114
  tableData.update((actualValue) => {
116
115
  actualValue[tableId].offset = actualValue[tableId].limit * parseInt(targetPage) - actualValue[tableId].limit;
117
116
 
118
- console.log(actualValue[tableId].offset);
119
117
 
120
118
  return actualValue;
121
119
  });
@@ -128,8 +126,6 @@
128
126
  const actualPage = Math.floor(table.offset / table.limit) + 1;
129
127
  // verifier si il est possible de passer a droite
130
128
  const totalPage = Math.ceil(table.totalOfRows / table.limit);
131
- console.log(actualPage);
132
- console.log(totalPage);
133
129
 
134
130
  // si la page actual est plus petit que le total de page alors on peut passer
135
131
  if (actualPage >= totalPage) {
@@ -138,7 +134,6 @@
138
134
 
139
135
  tableData.update((actualValue) => {
140
136
  actualValue[tableId].offset = actualValue[tableId].offset + actualValue[tableId].limit;
141
- console.log(actualValue[tableId].offset);
142
137
 
143
138
  return actualValue;
144
139
  });
@@ -28,7 +28,6 @@
28
28
  document.dispatchEvent(new Event('saveTableData'));
29
29
  }
30
30
  function handleFilter(columnName, newValue, position) {
31
- console.log(newValue);
32
31
 
33
32
  let foundedColumn = false;
34
33
  tableData.update((actualValue) => {
@@ -72,7 +72,6 @@
72
72
  document.dispatchEvent(new Event('saveTableData'));
73
73
  }
74
74
  function handleFilter(columnName, newValue, position) {
75
- console.log(newValue);
76
75
 
77
76
  let foundedColumn = false;
78
77
  tableData.update((actualValue) => {
@@ -0,0 +1,11 @@
1
+ <script>
2
+ import {activeTab} from "."
3
+
4
+ export let value = ""
5
+
6
+
7
+ </script>
8
+
9
+ {#if $activeTab === value}
10
+ <slot/>
11
+ {/if}
@@ -0,0 +1,47 @@
1
+ <script>
2
+ import TinyScrollArea from "@hamzus-ui/TinyScrollArea/TinyScrollArea.svelte";
3
+ import { activeTrigger } from ".";
4
+
5
+ let left = 0;
6
+ let width = 0;
7
+
8
+ $: if ($activeTrigger) {
9
+
10
+ // return
11
+ left = $activeTrigger.offsetLeft;
12
+ width = $activeTrigger.offsetWidth;
13
+ }
14
+ </script>
15
+
16
+ <TinyScrollArea style="display: flex;" proximity={0}>
17
+ <div class="tabs" style="--left:{left}px;--width:{width}px;">
18
+ <slot />
19
+ <span class="active-line"></span>
20
+ </div>
21
+ </TinyScrollArea>
22
+
23
+
24
+ <style>
25
+ .tabs {
26
+ min-width: 100%;
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: baseline;
30
+ column-gap: var(--pad-m);
31
+ padding-bottom: var(--pad-m);
32
+ position: relative;
33
+ }
34
+
35
+ .active-line {
36
+ position: absolute;
37
+ bottom: 0px;
38
+ left: var(--left);
39
+ width: var(--width);
40
+ height: 1px;
41
+ background-color: var(--accent);
42
+ z-index: 1;
43
+ transition-property: left, width;
44
+ transition-duration: 0.2s;
45
+ transition-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
46
+ }
47
+ </style>
@@ -0,0 +1,20 @@
1
+ <script>
2
+ import TinyScrollArea from '../TinyScrollArea/TinyScrollArea.svelte';
3
+ import Button from '../Button/Button.svelte';
4
+
5
+ import { page } from '$app/stores';
6
+ import { activeTrigger, activeTab } from '.';
7
+ import { onMount } from 'svelte';
8
+
9
+ export let value = '';
10
+
11
+
12
+ onMount(() => {
13
+ activeTab.set(value);
14
+ });
15
+
16
+ </script>
17
+
18
+ <slot name="list"/>
19
+ <slot/>
20
+
@@ -0,0 +1,36 @@
1
+ <script>
2
+ import Button from '../Button/Button.svelte';
3
+ import { onMount } from 'svelte';
4
+ import {activeTrigger, activeTab} from "."
5
+
6
+ export let value = "";
7
+ export let variant = 'ghost';
8
+ export let label = '';
9
+
10
+ let activeStyle = 'color:var(--font-1);background-color:var(--bg-2);';
11
+ let el;
12
+
13
+
14
+
15
+ $: if ($activeTab === value) {
16
+ activeTrigger.set(el)
17
+
18
+ }
19
+
20
+ function handleClick() {
21
+ activeTab.set(value)
22
+ }
23
+ </script>
24
+
25
+ <div bind:this={el} class="active">
26
+ <Button {variant} style={`flex-shrink:0;${$activeTab === value ? activeStyle : ''}`} {label} onClick={handleClick} {...$$restProps}>
27
+ <slot/>
28
+ </Button>
29
+ </div>
30
+
31
+ <style>
32
+ .active {
33
+ all: unset;
34
+ min-width: max-content;
35
+ }
36
+ </style>
@@ -0,0 +1,9 @@
1
+ import { writable } from 'svelte/store';
2
+
3
+ export { default as Root } from './Root.svelte';
4
+ export { default as List } from './List.svelte';
5
+ export { default as Trigger } from './Trigger.svelte';
6
+ export { default as Content } from './Content.svelte';
7
+
8
+ export const activeTab = writable(null)
9
+ export const activeTrigger = writable(null)
@@ -1,34 +0,0 @@
1
- <script>
2
- import Button from '../Button/Button.svelte';
3
- import { onMount } from 'svelte';
4
- export let activeButton = null;
5
- export let link = null;
6
- export let variant = 'ghost';
7
- export let style = "flex-shrink:0;{link.active ? activeStyle : ''}";
8
- export let label = 'exemple';
9
- export let onClick = (link) => {};
10
-
11
- let el;
12
-
13
- onMount(() => {
14
- if (link.active) {
15
- activeButton = el;
16
- }
17
- });
18
-
19
- function handleClick() {
20
- activeButton = el;
21
- onClick(link);
22
- }
23
- </script>
24
-
25
- <div bind:this={el} class="active">
26
- <Button {variant} {style} {label} onClick={handleClick} />
27
- </div>
28
-
29
- <style>
30
- .active {
31
- all: unset;
32
- min-width: max-content;
33
- }
34
- </style>
@@ -1,98 +0,0 @@
1
- <script>
2
- export let links = [];
3
-
4
- let activeStyle = 'color:var(--font-1);background-color:var(--bg-2);';
5
-
6
- import TinyScrollArea from '../TinyScrollArea/TinyScrollArea.svelte';
7
- import Button from '../Button/Button.svelte';
8
-
9
- import { page } from '$app/stores';
10
- import TabButton from './TabButton.svelte';
11
-
12
- let activeButton = null;
13
-
14
- let left = 0;
15
- let width = 0;
16
-
17
- $: if (activeButton) {
18
- // return
19
- left = activeButton.offsetLeft;
20
- width = activeButton.offsetWidth;
21
- }
22
-
23
- function handleClick(link) {
24
- if (link.onClick != undefined) {
25
- link.onClick(link);
26
- }
27
- }
28
- </script>
29
-
30
- <TinyScrollArea style="display: flex;" proximity={0}>
31
- <div class="tabs" style="--left:{left}px;--width:{width}px;">
32
- {#each links as link}
33
- {#if link.label}
34
- <!-- {#if link.active}
35
- <div bind:this={activeButton} class="active">
36
- <Button
37
- variant="ghost"
38
- style="flex-shrink:0;{link.active ? activeStyle : ''}"
39
- label={link.label}
40
- onClick={() => {
41
- handleClick(link);
42
- }}
43
- ></Button>
44
- </div>
45
- {:else}
46
- <Button
47
- variant="ghost"
48
- style="flex-shrink:0;{link.active ? activeStyle : ''}"
49
- label={link.label}
50
- onClick={() => {
51
- handleClick(link);
52
- }}
53
- ></Button>
54
- {/if} -->
55
- <TabButton
56
- bind:activeButton
57
- link={link}
58
- variant="ghost"
59
- style="flex-shrink:0;{link.active ? activeStyle : ''}"
60
- label={link.label}
61
- onClick={() => {
62
- handleClick(link);
63
- }}
64
- ></TabButton>
65
- <span class="active-line"></span>
66
- {/if}
67
- {/each}
68
- </div>
69
- </TinyScrollArea>
70
-
71
- <style>
72
- .tabs {
73
- min-width: 100%;
74
- display: flex;
75
- align-items: center;
76
- justify-content: baseline;
77
- column-gap: var(--pad-m);
78
- padding-bottom: var(--pad-m);
79
- position: relative;
80
- }
81
- .active {
82
- all: unset;
83
- min-width: max-content;
84
- }
85
-
86
- .active-line {
87
- position: absolute;
88
- bottom: 0px;
89
- left: var(--left);
90
- width: var(--width);
91
- height: 1px;
92
- background-color: var(--accent);
93
- z-index: 1;
94
- transition-property: left, width;
95
- transition-duration: 0.2s;
96
- transition-timing-function: cubic-bezier(0.17, 0.84, 0.44, 1);
97
- }
98
- </style>