yuyeon 0.0.24 → 0.0.25

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.
@@ -4,20 +4,20 @@ export function useLazy(eager, updated) {
4
4
  const tack = ref();
5
5
  tack.value = updated.value;
6
6
  const lazyValue = computed(() => {
7
- if (eager) return updated.value;
7
+ if (eager.value) return updated.value;
8
8
  return tack.value;
9
9
  });
10
10
  watch(updated, () => {
11
11
  if (!tick.value) {
12
12
  tack.value = updated.value;
13
13
  }
14
- if (!eager) {
14
+ if (!eager.value) {
15
15
  tick.value = true;
16
16
  }
17
17
  });
18
18
  function onAfterUpdate() {
19
19
  tack.value = updated.value;
20
- if (!eager) {
20
+ if (!eager.value) {
21
21
  tick.value = false;
22
22
  }
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"timing.mjs","names":["computed","ref","watch","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","arguments","length","undefined","options","tickDuration","tickInterval","timer","tickStart","drift","isWork","now","Date","realTick","tickDrift","nextInterval","window","setTimeout","start","stop","clearTimeout","reset"],"sources":["../../src/composables/timing.ts"],"sourcesContent":["import { Ref, computed, ref, watch } from 'vue';\n\nexport function useLazy(eager: boolean, updated: Ref<any>) {\n const tick = ref(false);\n const tack = ref();\n tack.value = updated.value;\n const lazyValue = computed(() => {\n if (eager) return updated.value;\n return tack.value;\n });\n watch(updated, () => {\n if (!tick.value) {\n tack.value = updated.value;\n }\n if (!eager) {\n tick.value = true;\n }\n });\n function onAfterUpdate() {\n tack.value = updated.value;\n if (!eager) {\n tick.value = false;\n }\n }\n return {\n entered: tick,\n lazyValue,\n onAfterUpdate,\n };\n}\n\nexport function useTimer(\n cb: () => void,\n duration = 1000,\n options?: { tickDuration: number },\n) {\n const { tickDuration } = options ?? {};\n let tickInterval = tickDuration ?? 100;\n let timer = -1;\n\n const tickStart = ref(0);\n const drift = ref(duration);\n const isWork = ref(false);\n\n function tick() {\n const now = Date.now();\n const realTick = now - tickStart.value;\n drift.value = drift.value - realTick;\n if (drift.value < 1) {\n cb();\n } else {\n const tickDrift = now - tickStart.value + tickInterval;\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\n tickStart.value = now;\n timer = window.setTimeout(tick, nextInterval);\n }\n }\n\n function start() {\n if (isWork.value) return;\n isWork.value = true;\n tickStart.value = Date.now();\n timer = window.setTimeout(tick, tickInterval);\n }\n\n function stop() {\n window.clearTimeout(timer);\n timer = -1;\n isWork.value = false;\n }\n\n function reset() {\n stop();\n drift.value = duration;\n }\n\n return {\n start,\n stop,\n reset,\n drift,\n isWork,\n }\n}\n"],"mappings":"AAAA,SAAcA,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAE/C,OAAO,SAASC,OAAOA,CAACC,KAAc,EAAEC,OAAiB,EAAE;EACzD,MAAMC,IAAI,GAAGL,GAAG,CAAC,KAAK,CAAC;EACvB,MAAMM,IAAI,GAAGN,GAAG,CAAC,CAAC;EAClBM,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;EAC1B,MAAMC,SAAS,GAAGT,QAAQ,CAAC,MAAM;IAC/B,IAAII,KAAK,EAAE,OAAOC,OAAO,CAACG,KAAK;IAC/B,OAAOD,IAAI,CAACC,KAAK;EACnB,CAAC,CAAC;EACFN,KAAK,CAACG,OAAO,EAAE,MAAM;IACnB,IAAI,CAACC,IAAI,CAACE,KAAK,EAAE;MACfD,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC5B;IACA,IAAI,CAACJ,KAAK,EAAE;MACVE,IAAI,CAACE,KAAK,GAAG,IAAI;IACnB;EACF,CAAC,CAAC;EACF,SAASE,aAAaA,CAAA,EAAG;IACvBH,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC1B,IAAI,CAACJ,KAAK,EAAE;MACVE,IAAI,CAACE,KAAK,GAAG,KAAK;IACpB;EACF;EACA,OAAO;IACLG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ChB,KAAK,GAAG,IAAI;IACnBc,SAAS,CAACd,KAAK,GAAGkB,IAAI,CAACD,GAAG,CAAC,CAAC;IAC5BJ,KAAK,GAAGS,MAAM,CAACC,UAAU,CAACzB,IAAI,EAAEc,YAAY,CAAC;EAC/C;EAEA,SAASa,IAAIA,CAAA,EAAG;IACdH,MAAM,CAACI,YAAY,CAACb,KAAK,CAAC;IAC1BA,KAAK,GAAG,CAAC,CAAC;IACVG,MAAM,CAAChB,KAAK,GAAG,KAAK;EACtB;EAEA,SAAS2B,KAAKA,CAAA,EAAG;IACfF,IAAI,CAAC,CAAC;IACNV,KAAK,CAACf,KAAK,GAAGM,QAAQ;EACxB;EAEA,OAAO;IACLkB,KAAK;IACLC,IAAI;IACJE,KAAK;IACLZ,KAAK;IACLC;EACF,CAAC;AACH"}
1
+ {"version":3,"file":"timing.mjs","names":["computed","ref","watch","useLazy","eager","updated","tick","tack","value","lazyValue","onAfterUpdate","entered","useTimer","cb","duration","arguments","length","undefined","options","tickDuration","tickInterval","timer","tickStart","drift","isWork","now","Date","realTick","tickDrift","nextInterval","window","setTimeout","start","stop","clearTimeout","reset"],"sources":["../../src/composables/timing.ts"],"sourcesContent":["import { Ref, computed, ref, watch } from 'vue';\n\nexport function useLazy(eager: Ref<boolean | undefined>, updated: Ref<any>) {\n const tick = ref(false);\n const tack = ref();\n tack.value = updated.value;\n const lazyValue = computed(() => {\n if (eager.value) return updated.value;\n return tack.value;\n });\n watch(updated, () => {\n if (!tick.value) {\n tack.value = updated.value;\n }\n if (!eager.value) {\n tick.value = true;\n }\n });\n function onAfterUpdate() {\n tack.value = updated.value;\n if (!eager.value) {\n tick.value = false;\n }\n }\n return {\n entered: tick,\n lazyValue,\n onAfterUpdate,\n };\n}\n\nexport function useTimer(\n cb: () => void,\n duration = 1000,\n options?: { tickDuration: number },\n) {\n const { tickDuration } = options ?? {};\n let tickInterval = tickDuration ?? 100;\n let timer = -1;\n\n const tickStart = ref(0);\n const drift = ref(duration);\n const isWork = ref(false);\n\n function tick() {\n const now = Date.now();\n const realTick = now - tickStart.value;\n drift.value = drift.value - realTick;\n if (drift.value < 1) {\n cb();\n } else {\n const tickDrift = now - tickStart.value + tickInterval;\n const nextInterval = tickDrift >= 1 ? tickDrift : tickInterval;\n tickStart.value = now;\n timer = window.setTimeout(tick, nextInterval);\n }\n }\n\n function start() {\n if (isWork.value) return;\n isWork.value = true;\n tickStart.value = Date.now();\n timer = window.setTimeout(tick, tickInterval);\n }\n\n function stop() {\n window.clearTimeout(timer);\n timer = -1;\n isWork.value = false;\n }\n\n function reset() {\n stop();\n drift.value = duration;\n }\n\n return {\n start,\n stop,\n reset,\n drift,\n isWork,\n }\n}\n"],"mappings":"AAAA,SAAcA,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAE/C,OAAO,SAASC,OAAOA,CAACC,KAA+B,EAAEC,OAAiB,EAAE;EAC1E,MAAMC,IAAI,GAAGL,GAAG,CAAC,KAAK,CAAC;EACvB,MAAMM,IAAI,GAAGN,GAAG,CAAC,CAAC;EAClBM,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;EAC1B,MAAMC,SAAS,GAAGT,QAAQ,CAAC,MAAM;IAC/B,IAAII,KAAK,CAACI,KAAK,EAAE,OAAOH,OAAO,CAACG,KAAK;IACrC,OAAOD,IAAI,CAACC,KAAK;EACnB,CAAC,CAAC;EACFN,KAAK,CAACG,OAAO,EAAE,MAAM;IACnB,IAAI,CAACC,IAAI,CAACE,KAAK,EAAE;MACfD,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC5B;IACA,IAAI,CAACJ,KAAK,CAACI,KAAK,EAAE;MAChBF,IAAI,CAACE,KAAK,GAAG,IAAI;IACnB;EACF,CAAC,CAAC;EACF,SAASE,aAAaA,CAAA,EAAG;IACvBH,IAAI,CAACC,KAAK,GAAGH,OAAO,CAACG,KAAK;IAC1B,IAAI,CAACJ,KAAK,CAACI,KAAK,EAAE;MAChBF,I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IACf,IAAIR,MAAM,CAAChB,KAAK,EAAE;IAClBgB,MAAM,CAAChB,KAAK,GAAG,IAAI;IACnBc,SAAS,CAACd,KAAK,GAAGkB,IAAI,CAACD,GAAG,CAAC,CAAC;IAC5BJ,KAAK,GAAGS,MAAM,CAACC,UAAU,CAACzB,IAAI,EAAEc,YAAY,CAAC;EAC/C;EAEA,SAASa,IAAIA,CAAA,EAAG;IACdH,MAAM,CAACI,YAAY,CAACb,KAAK,CAAC;IAC1BA,KAAK,GAAG,CAAC,CAAC;IACVG,MAAM,CAAChB,KAAK,GAAG,KAAK;EACtB;EAEA,SAAS2B,KAAKA,CAAA,EAAG;IACfF,IAAI,CAAC,CAAC;IACNV,KAAK,CAACf,KAAK,GAAGM,QAAQ;EACxB;EAEA,OAAO;IACLkB,KAAK;IACLC,IAAI;IACJE,KAAK;IACLZ,KAAK;IACLC;EACF,CAAC;AACH"}
@@ -1,119 +1,119 @@
1
- @use 'sass:list';
2
- @use 'settings/provided';
3
- @use 'settings/variables';
4
- @use 'palette';
5
-
6
- @use 'elevation';
7
-
8
- :root {
9
- box-sizing: border-box;
10
- }
11
-
12
- :root {
13
- --default-shadow: 0, 0, 0;
14
- --y-elevation-color: var(--y-theme-shadow, var(--default-shadow));
15
-
16
- @include elevation.styles();
17
- }
18
-
19
- .y-root {
20
- background: var(--y-theme-background);
21
- color: var(--y-theme-on-background);
22
- }
23
-
24
- .fade-enter-active,
25
- .fade-leave-cative {
26
- transition: opacity 240ms cubic-bezier(0.2, 0.28, 0.21, 1);
27
- }
28
-
29
- .fade-enter-from,
30
- .fade-leave-to {
31
- opacity: 0;
32
- }
33
-
34
- .slide-fade-enter-active,
35
- .slide-fade-leave-active {
36
- transition: transform 240ms variables.$basic-transition-timing-function,
37
- opacity 240ms linear;
38
- }
39
-
40
- .slide-fade-enter-from,
41
- .slide-fade-leave-to {
42
- transform: translateY(-20px) rotate3d(1, 0, 0, 10deg);
43
- opacity: 0;
44
- }
45
-
46
- .expand-v-transition {
47
- &-enter-active {
48
- transition-duration: 240ms;
49
- transition-timing-function: variables.$basic-transition-timing-function;
50
- transition-property: height;
51
- }
52
- &-leave-active {
53
- transition-duration: 240ms;
54
- transition-timing-function: variables.$basic-transition-timing-function;
55
- transition-property: height;
56
- }
57
- }
58
-
59
- .expand-h-transition {
60
- &-enter-active {
61
- transition-duration: 240ms;
62
- transition-timing-function: variables.$basic-transition-timing-function;
63
- transition-property: width;
64
- }
65
- &-leave-active {
66
- transition-duration: 240ms;
67
- transition-timing-function: variables.$basic-transition-timing-function;
68
- transition-property: width;
69
- }
70
- }
71
-
72
- .title {
73
- font-size: 20px;
74
- font-weight: bold;
75
- }
76
-
77
- .contain-paint {
78
- contain: paint;
79
- }
80
-
81
- @each $space-type-prefix, $space-type in provided.$space-types {
82
- @each $side-prefix, $sides-properties in provided.$box-side-combinations {
83
- @each $space-index, $space-size in variables.$space-list {
84
- .#{$space-type-prefix}#{$side-prefix}-#{$space-index} {
85
- @if (list.length($sides-properties) == 0) {
86
- #{$space-type}: #{$space-size};
87
- } @else {
88
- @each $prop in $sides-properties {
89
- #{$space-type}: {
90
- #{$prop}: #{$space-size};
91
- }
92
- }
93
- }
94
- }
95
- }
96
- }
97
- }
98
-
99
- @each $align in provided.$text-aligns {
100
- .text-#{$align} {
101
- text-align: #{$align};
102
- }
103
- }
104
-
105
- @each $weight in provided.$font-weights {
106
- .font-weight-#{$weight} {
107
- font-weight: $weight;
108
- }
109
- }
110
-
111
- @keyframes rotate {
112
- to {
113
- transform: rotate(360deg);
114
- }
115
- }
116
-
117
- .text-color--error {
118
- color: var(--y-theme-error);
119
- }
1
+ @use 'sass:list';
2
+ @use 'settings/provided';
3
+ @use 'settings/variables';
4
+ @use 'palette';
5
+
6
+ @use 'elevation';
7
+
8
+ :root {
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ :root {
13
+ --default-shadow: 0, 0, 0;
14
+ --y-elevation-color: var(--y-theme-shadow, var(--default-shadow));
15
+
16
+ @include elevation.styles();
17
+ }
18
+
19
+ .y-root {
20
+ background: var(--y-theme-background);
21
+ color: var(--y-theme-on-background);
22
+ }
23
+
24
+ .fade-enter-active,
25
+ .fade-leave-cative {
26
+ transition: opacity 240ms cubic-bezier(0.2, 0.28, 0.21, 1);
27
+ }
28
+
29
+ .fade-enter-from,
30
+ .fade-leave-to {
31
+ opacity: 0;
32
+ }
33
+
34
+ .slide-fade-enter-active,
35
+ .slide-fade-leave-active {
36
+ transition: transform 240ms variables.$basic-transition-timing-function,
37
+ opacity 240ms linear;
38
+ }
39
+
40
+ .slide-fade-enter-from,
41
+ .slide-fade-leave-to {
42
+ transform: translateY(-20px) rotate3d(1, 0, 0, 10deg);
43
+ opacity: 0;
44
+ }
45
+
46
+ .expand-v-transition {
47
+ &-enter-active {
48
+ transition-duration: 240ms;
49
+ transition-timing-function: variables.$basic-transition-timing-function;
50
+ transition-property: height;
51
+ }
52
+ &-leave-active {
53
+ transition-duration: 240ms;
54
+ transition-timing-function: variables.$basic-transition-timing-function;
55
+ transition-property: height;
56
+ }
57
+ }
58
+
59
+ .expand-h-transition {
60
+ &-enter-active {
61
+ transition-duration: 240ms;
62
+ transition-timing-function: variables.$basic-transition-timing-function;
63
+ transition-property: width;
64
+ }
65
+ &-leave-active {
66
+ transition-duration: 240ms;
67
+ transition-timing-function: variables.$basic-transition-timing-function;
68
+ transition-property: width;
69
+ }
70
+ }
71
+
72
+ .title {
73
+ font-size: 20px;
74
+ font-weight: bold;
75
+ }
76
+
77
+ .contain-paint {
78
+ contain: paint;
79
+ }
80
+
81
+ @each $space-type-prefix, $space-type in provided.$space-types {
82
+ @each $side-prefix, $sides-properties in provided.$box-side-combinations {
83
+ @each $space-index, $space-size in variables.$space-list {
84
+ .#{$space-type-prefix}#{$side-prefix}-#{$space-index} {
85
+ @if (list.length($sides-properties) == 0) {
86
+ #{$space-type}: #{$space-size};
87
+ } @else {
88
+ @each $prop in $sides-properties {
89
+ #{$space-type}: {
90
+ #{$prop}: #{$space-size};
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ }
97
+ }
98
+
99
+ @each $align in provided.$text-aligns {
100
+ .text-#{$align} {
101
+ text-align: #{$align};
102
+ }
103
+ }
104
+
105
+ @each $weight in provided.$font-weights {
106
+ .font-weight-#{$weight} {
107
+ font-weight: $weight;
108
+ }
109
+ }
110
+
111
+ @keyframes rotate {
112
+ to {
113
+ transform: rotate(360deg);
114
+ }
115
+ }
116
+
117
+ .text-color--error {
118
+ color: var(--y-theme-error);
119
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuyeon",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "keywords": [
5
5
  "UI Library",
6
6
  "Vue"
@@ -1,5 +1,5 @@
1
1
  import { Ref } from 'vue';
2
- export declare function useLazy(eager: boolean, updated: Ref<any>): {
2
+ export declare function useLazy(eager: Ref<boolean | undefined>, updated: Ref<any>): {
3
3
  entered: Ref<boolean>;
4
4
  lazyValue: import("vue").ComputedRef<any>;
5
5
  onAfterUpdate: () => void;