@esportsplus/ui 0.47.2 → 0.48.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 (51) hide show
  1. package/README.md +2 -3
  2. package/build/components/accordion/index.d.ts +16 -16
  3. package/build/components/accordion/index.js +13 -23
  4. package/build/components/alert/index.js +33 -64
  5. package/build/components/back/index.d.ts +8 -8
  6. package/build/components/back/index.js +8 -8
  7. package/build/components/button/index.d.ts +21 -21
  8. package/build/components/button/index.js +20 -36
  9. package/build/components/checkbox/index.js +19 -36
  10. package/build/components/clipboard/onclick.js +11 -21
  11. package/build/components/counter/index.js +28 -59
  12. package/build/components/ellipsis/index.js +5 -5
  13. package/build/components/form/action.js +8 -8
  14. package/build/components/highlight/index.d.ts +16 -16
  15. package/build/components/highlight/index.js +12 -22
  16. package/build/components/icon/index.d.ts +11 -11
  17. package/build/components/icon/index.js +6 -6
  18. package/build/components/input/index.js +16 -32
  19. package/build/components/loader/index.d.ts +16 -16
  20. package/build/components/loader/index.js +26 -48
  21. package/build/components/loading/index.js +5 -5
  22. package/build/components/range/index.js +19 -42
  23. package/build/components/scrollbar/index.d.ts +11 -11
  24. package/build/components/scrollbar/index.js +19 -35
  25. package/build/components/select/index.js +34 -63
  26. package/build/components/textarea/index.js +16 -32
  27. package/build/components/tooltip/menu.d.ts +11 -11
  28. package/build/components/tooltip/menu.js +20 -20
  29. package/build/components/tooltip/onclick.d.ts +1101 -1101
  30. package/build/components/tooltip/onclick.js +10 -22
  31. package/build/components/tooltip/onhover.d.ts +16 -16
  32. package/build/components/tooltip/onhover.js +11 -23
  33. package/build/components/typewriter/index.d.ts +11 -11
  34. package/build/components/typewriter/index.js +10 -22
  35. package/package.json +3 -4
  36. package/src/components/accordion/index.ts +1 -2
  37. package/src/components/alert/index.ts +1 -2
  38. package/src/components/button/index.ts +1 -2
  39. package/src/components/checkbox/index.ts +1 -2
  40. package/src/components/clipboard/onclick.ts +1 -2
  41. package/src/components/counter/index.ts +1 -2
  42. package/src/components/highlight/index.ts +1 -2
  43. package/src/components/input/index.ts +1 -2
  44. package/src/components/loader/index.ts +1 -2
  45. package/src/components/range/index.ts +1 -2
  46. package/src/components/scrollbar/index.ts +1 -2
  47. package/src/components/select/index.ts +1 -2
  48. package/src/components/textarea/index.ts +1 -2
  49. package/src/components/tooltip/onclick.ts +1 -2
  50. package/src/components/tooltip/onhover.ts +1 -2
  51. package/src/components/typewriter/index.ts +1 -2
@@ -1,82 +1,60 @@
1
- import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
+ import { reactive } from '@esportsplus/template';
3
3
  import { omit } from '@esportsplus/utilities';
4
4
  import template from '../../components/template/index.js';
5
5
  import './scss/index.scss';
6
- const template_a6aeaec5a75649bd8ec693d5230c50002d = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div class='loader-content'><div
6
+ const template_23a4f055a2904f1fa5d72b30cc2abc5023 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div class='loader-content'><div
7
7
  class='loader-logo text --flex-center --text-uppercase --text-600'
8
8
  style='color: var(--color-grey-500);'><!--$--></div></div>`);
9
- const template_a6aeaec5a75649bd8ec693d5230c50002i = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
9
+ const template_23a4f055a2904f1fa5d72b30cc2abc5028 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
10
10
  class='loader '><div
11
11
  class='loader '><!--$--></div></div>`);
12
- class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002b extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
13
- #load = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
14
- #remove = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
15
- #scale = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
16
- constructor() {
17
- super(null);
18
- }
19
- get load() {
20
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#load);
21
- }
22
- set load(_v0) {
23
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#load, _v0);
24
- }
25
- get remove() {
26
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#remove);
27
- }
28
- set remove(_v1) {
29
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#remove, _v1);
30
- }
31
- get scale() {
32
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#scale);
33
- }
34
- set scale(_v2) {
35
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#scale, _v2);
36
- }
37
- }
38
12
  const OMIT = ['loader-content', 'loader-logo'];
39
13
  export default template.factory((attributes, content) => {
40
- let state = new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002b();
14
+ let state = reactive({
15
+ load: false,
16
+ remove: false,
17
+ scale: false
18
+ });
41
19
  return () => {
42
20
  if (state.remove) {
43
21
  return;
44
22
  }
45
23
  let i = 0;
46
24
  return (() => {
47
- let root_a6aeaec5a75649bd8ec693d5230c50002h = template_a6aeaec5a75649bd8ec693d5230c50002i(), element_a6aeaec5a75649bd8ec693d5230c50002j = root_a6aeaec5a75649bd8ec693d5230c50002h.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002k = element_a6aeaec5a75649bd8ec693d5230c50002j.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002l = element_a6aeaec5a75649bd8ec693d5230c50002k.firstChild;
48
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002j, ' ', () => state.load && 'loader--load');
49
- template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002j, 'animationend', (e) => {
25
+ let root_23a4f055a2904f1fa5d72b30cc2abc5027 = template_23a4f055a2904f1fa5d72b30cc2abc5028(), element_23a4f055a2904f1fa5d72b30cc2abc5029 = root_23a4f055a2904f1fa5d72b30cc2abc5027.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502a = element_23a4f055a2904f1fa5d72b30cc2abc5029.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502b = element_23a4f055a2904f1fa5d72b30cc2abc502a.firstChild;
26
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5029, ' ', () => state.load && 'loader--load');
27
+ template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc5029, 'animationend', (e) => {
50
28
  i++;
51
29
  if (e.animationName === 'move' && i > 1) {
52
30
  state.remove = true;
53
31
  }
54
32
  });
55
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002j, omit(attributes, OMIT));
56
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002k, ' ', () => state.load && 'loader--load');
57
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002k, !content && {
33
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5029, omit(attributes, OMIT));
34
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502a, ' ', () => state.load && 'loader--load');
35
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502a, !content && {
58
36
  onconnect: () => {
59
37
  state.load = true;
60
38
  }
61
39
  });
62
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002k, attributes.loader);
63
- template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002l, content && (() => {
64
- let root_a6aeaec5a75649bd8ec693d5230c50002c = template_a6aeaec5a75649bd8ec693d5230c50002d(), element_a6aeaec5a75649bd8ec693d5230c50002e = root_a6aeaec5a75649bd8ec693d5230c50002c.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002f = element_a6aeaec5a75649bd8ec693d5230c50002e.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002g = element_a6aeaec5a75649bd8ec693d5230c50002f.firstChild;
65
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002e, attributes['loader-content']);
66
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002f, attributes['loader-logo']);
67
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002f, '', () => state.scale && 'loader-logo--scale');
68
- template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002f, 'animationend', ({ animationName: name }) => {
40
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502a, attributes.loader);
41
+ template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502b, content && (() => {
42
+ let root_23a4f055a2904f1fa5d72b30cc2abc5022 = template_23a4f055a2904f1fa5d72b30cc2abc5023(), element_23a4f055a2904f1fa5d72b30cc2abc5024 = root_23a4f055a2904f1fa5d72b30cc2abc5022.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc5025 = element_23a4f055a2904f1fa5d72b30cc2abc5024.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc5026 = element_23a4f055a2904f1fa5d72b30cc2abc5025.firstChild;
43
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5024, attributes['loader-content']);
44
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5025, attributes['loader-logo']);
45
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5025, '', () => state.scale && 'loader-logo--scale');
46
+ template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc5025, 'animationend', ({ animationName: name }) => {
69
47
  if (name === 'scale') {
70
48
  state.load = true;
71
49
  }
72
50
  });
73
- template_a6aeaec5a75649bd8ec693d5230c50001.onconnect(element_a6aeaec5a75649bd8ec693d5230c50002f, () => {
51
+ template_23a4f055a2904f1fa5d72b30cc2abc501.onconnect(element_23a4f055a2904f1fa5d72b30cc2abc5025, () => {
74
52
  state.scale = true;
75
53
  });
76
- template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002g, content);
77
- return root_a6aeaec5a75649bd8ec693d5230c50002c;
54
+ template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc5026, content);
55
+ return root_23a4f055a2904f1fa5d72b30cc2abc5022;
78
56
  })());
79
- return root_a6aeaec5a75649bd8ec693d5230c50002h;
57
+ return root_23a4f055a2904f1fa5d72b30cc2abc5027;
80
58
  })();
81
59
  };
82
60
  });
@@ -1,12 +1,12 @@
1
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
2
  import './scss/index.scss';
3
- const template_a6aeaec5a75649bd8ec693d5230c50002n = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
3
+ const template_23a4f055a2904f1fa5d72b30cc2abc502d = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
4
4
  class='loading --border-width-700 --size-800'
5
5
  style='--border-color: var(--color-border-500);'></div>`);
6
6
  export default (attributes) => {
7
7
  return (() => {
8
- let root_a6aeaec5a75649bd8ec693d5230c50002m = template_a6aeaec5a75649bd8ec693d5230c50002n(), element_a6aeaec5a75649bd8ec693d5230c50002o = root_a6aeaec5a75649bd8ec693d5230c50002m.firstChild;
9
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002o, attributes);
10
- return root_a6aeaec5a75649bd8ec693d5230c50002m;
8
+ let root_23a4f055a2904f1fa5d72b30cc2abc502c = template_23a4f055a2904f1fa5d72b30cc2abc502d(), element_23a4f055a2904f1fa5d72b30cc2abc502e = root_23a4f055a2904f1fa5d72b30cc2abc502c.firstChild;
9
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502e, attributes);
10
+ return root_23a4f055a2904f1fa5d72b30cc2abc502c;
11
11
  })();
12
12
  };
@@ -1,61 +1,38 @@
1
- import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
- import { root } from '@esportsplus/reactivity';
3
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
+ import { reactive, root } from '@esportsplus/template';
4
3
  import form from '../../components/form/index.js';
5
4
  import './scss/index.scss';
6
- const template_a6aeaec5a75649bd8ec693d5230c50002r = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<input
5
+ const template_23a4f055a2904f1fa5d72b30cc2abc502g = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<input
7
6
  class='range --border-state --border-black'
8
7
  type='range'
9
8
  />`);
10
- class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002p extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
11
- #active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
12
- #error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
13
- #value = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](0);
14
- constructor() {
15
- super(null);
16
- }
17
- get active() {
18
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
19
- }
20
- set active(_v0) {
21
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
22
- }
23
- get error() {
24
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
25
- }
26
- set error(_v1) {
27
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
28
- }
29
- get value() {
30
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#value);
31
- }
32
- set value(_v2) {
33
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#value, _v2);
34
- }
35
- }
36
9
  export default function (attributes) {
37
- let { max, min } = attributes, state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002p();
10
+ let { max, min } = attributes, state = attributes.state || reactive({
11
+ active: false,
12
+ error: '',
13
+ value: 0
14
+ });
38
15
  if (attributes?.value) {
39
16
  state.value = Number(attributes.value);
40
17
  }
41
18
  return (() => {
42
- let root_a6aeaec5a75649bd8ec693d5230c50002q = template_a6aeaec5a75649bd8ec693d5230c50002r(), element_a6aeaec5a75649bd8ec693d5230c50002s = root_a6aeaec5a75649bd8ec693d5230c50002q.firstChild;
43
- template_a6aeaec5a75649bd8ec693d5230c50001.setStyle(element_a6aeaec5a75649bd8ec693d5230c50002s, ';', () => `--thumb-position: ${((state.value - min) / (max - min)) * 100}%`);
44
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002s, this?.attributes);
45
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002s, attributes);
46
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002s, '', () => state.active && '--active');
47
- template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002s, 'focusin', () => {
19
+ let root_23a4f055a2904f1fa5d72b30cc2abc502f = template_23a4f055a2904f1fa5d72b30cc2abc502g(), element_23a4f055a2904f1fa5d72b30cc2abc502h = root_23a4f055a2904f1fa5d72b30cc2abc502f.firstChild;
20
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setStyle(element_23a4f055a2904f1fa5d72b30cc2abc502h, ';', () => `--thumb-position: ${((state.value - min) / (max - min)) * 100}%`);
21
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502h, this?.attributes);
22
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502h, attributes);
23
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502h, '', () => state.active && '--active');
24
+ template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'focusin', () => {
48
25
  state.active = true;
49
26
  });
50
- template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002s, 'focusout', () => {
27
+ template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'focusout', () => {
51
28
  state.active = false;
52
29
  });
53
- template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50002s, 'input', (e) => {
30
+ template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'input', (e) => {
54
31
  state.value = Number(e.target.value);
55
32
  });
56
- template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50002s, form.input.onrender(state));
57
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50002s, 'value', root(() => attributes?.value || state.value || 0));
58
- return root_a6aeaec5a75649bd8ec693d5230c50002q;
33
+ template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc502h, form.input.onrender(state));
34
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502h, 'value', root(() => attributes?.value || state.value || 0));
35
+ return root_23a4f055a2904f1fa5d72b30cc2abc502f;
59
36
  })();
60
37
  }
61
38
  ;
@@ -1,4 +1,4 @@
1
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
2
  import { Attributes } from '@esportsplus/template';
3
3
  import './scss/index.scss';
4
4
  type A = Attributes & {
@@ -8,20 +8,20 @@ type A = Attributes & {
8
8
  declare const _default: {
9
9
  (): ReturnType<(this: {
10
10
  attributes?: A | undefined;
11
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
12
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
11
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
12
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
13
13
  <T extends A>(attributes: T): ReturnType<(this: {
14
14
  attributes?: A | undefined;
15
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
16
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
17
- <T extends template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>(content: T): ReturnType<(this: {
15
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
16
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
17
+ <T extends template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>(content: T): ReturnType<(this: {
18
18
  attributes?: A | undefined;
19
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
20
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
21
- (attributes: A, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>): ReturnType<(this: {
19
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
20
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
21
+ (attributes: A, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>): ReturnType<(this: {
22
22
  attributes?: A | undefined;
23
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
24
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>;
23
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
24
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>;
25
25
  };
26
26
  export default _default;
27
27
  export type { A as Attributes };
@@ -1,42 +1,26 @@
1
- import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
+ import { reactive } from '@esportsplus/template';
3
3
  import { omit } from '@esportsplus/utilities';
4
4
  import template from '../../components/template/index.js';
5
5
  import './scss/index.scss';
6
- const template_a6aeaec5a75649bd8ec693d5230c50002v = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
6
+ const template_23a4f055a2904f1fa5d72b30cc2abc502j = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
7
7
  class='scrollbar-container'><div
8
8
  class='scrollbar-container-content'><!--$--></div><div
9
9
  class='scrollbar'></div></div>`);
10
- class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002t extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
11
- #height = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](100);
12
- #translate = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](0);
13
- constructor() {
14
- super(null);
15
- }
16
- get height() {
17
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#height);
18
- }
19
- set height(_v0) {
20
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#height, _v0);
21
- }
22
- get translate() {
23
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#translate);
24
- }
25
- set translate(_v1) {
26
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#translate, _v1);
27
- }
28
- }
29
10
  const OMIT = ['scrollbar', 'scrollbar-container-content'];
30
11
  let root = document.body, width;
31
12
  export default template.factory(function (attributes, content) {
32
- let state = new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50002t();
13
+ let state = reactive({
14
+ height: 100,
15
+ translate: 0
16
+ });
33
17
  return (() => {
34
- let root_a6aeaec5a75649bd8ec693d5230c50002u = template_a6aeaec5a75649bd8ec693d5230c50002v(), element_a6aeaec5a75649bd8ec693d5230c50002w = root_a6aeaec5a75649bd8ec693d5230c50002u.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002x = element_a6aeaec5a75649bd8ec693d5230c50002w.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50002y = element_a6aeaec5a75649bd8ec693d5230c50002x.firstChild, element_a6aeaec5a75649bd8ec693d5230c50002z = element_a6aeaec5a75649bd8ec693d5230c50002x.nextElementSibling;
35
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002w, this?.attributes && omit(this.attributes, OMIT));
36
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002w, omit(attributes, OMIT));
37
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002x, this?.attributes?.['scrollbar-container-content']);
38
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002x, attributes['scrollbar-container-content']);
39
- template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50002x, 'scroll', function () {
18
+ let root_23a4f055a2904f1fa5d72b30cc2abc502i = template_23a4f055a2904f1fa5d72b30cc2abc502j(), element_23a4f055a2904f1fa5d72b30cc2abc502k = root_23a4f055a2904f1fa5d72b30cc2abc502i.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502l = element_23a4f055a2904f1fa5d72b30cc2abc502k.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502m = element_23a4f055a2904f1fa5d72b30cc2abc502l.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502n = element_23a4f055a2904f1fa5d72b30cc2abc502l.nextElementSibling;
19
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502k, this?.attributes && omit(this.attributes, OMIT));
20
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502k, omit(attributes, OMIT));
21
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502l, this?.attributes?.['scrollbar-container-content']);
22
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502l, attributes['scrollbar-container-content']);
23
+ template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc502l, 'scroll', function () {
40
24
  if (width === undefined) {
41
25
  width = this.offsetWidth - this.clientWidth;
42
26
  if (width && width !== 17) {
@@ -46,14 +30,14 @@ export default template.factory(function (attributes, content) {
46
30
  state.height = (this.clientHeight / this.scrollHeight) * 100;
47
31
  state.translate = (this.scrollTop / this.clientHeight) * 100;
48
32
  });
49
- template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c50002y, content);
50
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002z, this?.attributes?.scrollbar);
51
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50002z, attributes.scrollbar);
52
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50002z, '', () => state.height >= 100 && 'scrollbar--hidden');
53
- template_a6aeaec5a75649bd8ec693d5230c50001.setStyle(element_a6aeaec5a75649bd8ec693d5230c50002z, '', () => `
33
+ template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502m, content);
34
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502n, this?.attributes?.scrollbar);
35
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502n, attributes.scrollbar);
36
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502n, '', () => state.height >= 100 && 'scrollbar--hidden');
37
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setStyle(element_23a4f055a2904f1fa5d72b30cc2abc502n, '', () => `
54
38
  --translate: translate3d(0, ${state.translate}%, 0);
55
39
  --height: ${state.height}%;
56
40
  `);
57
- return root_a6aeaec5a75649bd8ec693d5230c50002u;
41
+ return root_23a4f055a2904f1fa5d72b30cc2abc502i;
58
42
  })();
59
43
  });
@@ -1,50 +1,16 @@
1
- import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
+ import { reactive } from '@esportsplus/template';
3
3
  import { EMPTY_ARRAY, omit, toArray } from '@esportsplus/utilities';
4
4
  import form from '../../components/form/index.js';
5
5
  import root from '../../components/root/index.js';
6
6
  import scrollbar from '../../components/scrollbar/index.js';
7
7
  import template from '../../components/template/index.js';
8
8
  import './scss/index.scss';
9
- const template_a6aeaec5a75649bd8ec693d5230c500032 = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
9
+ const template_23a4f055a2904f1fa5d72b30cc2abc502p = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
10
10
  class='link select-option '><!--$--></div>`);
11
- const template_a6aeaec5a75649bd8ec693d5230c500036 = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<div
11
+ const template_23a4f055a2904f1fa5d72b30cc2abc502t = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<div
12
12
  class='select tooltip '><!--$--><div class='select-arrow'></div><input class='select-tag'
13
13
  /><!--$--></div>`);
14
- class ReactiveObject_a6aeaec5a75649bd8ec693d5230c500030 extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
15
- #active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
16
- #error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
17
- #render = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
18
- #selected;
19
- constructor(_p0) {
20
- super(null);
21
- this.#selected = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](_p0);
22
- }
23
- get active() {
24
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
25
- }
26
- set active(_v0) {
27
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
28
- }
29
- get error() {
30
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
31
- }
32
- set error(_v1) {
33
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
34
- }
35
- get render() {
36
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#render);
37
- }
38
- set render(_v2) {
39
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#render, _v2);
40
- }
41
- get selected() {
42
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#selected);
43
- }
44
- set selected(_v3) {
45
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#selected, _v3);
46
- }
47
- }
48
14
  const OMIT = [
49
15
  'arrow',
50
16
  'options',
@@ -81,19 +47,24 @@ function set(current, value) {
81
47
  }
82
48
  }
83
49
  const select = template.factory(function (attributes, content) {
84
- let { options, option } = attributes, state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c500030(attributes.selected || Object.keys(options)[0]);
50
+ let { options, option } = attributes, state = attributes.state || reactive({
51
+ active: false,
52
+ error: '',
53
+ render: false,
54
+ selected: attributes.selected || Object.keys(options)[0]
55
+ });
85
56
  return (() => {
86
- let root_a6aeaec5a75649bd8ec693d5230c500035 = template_a6aeaec5a75649bd8ec693d5230c500036(), element_a6aeaec5a75649bd8ec693d5230c500037 = root_a6aeaec5a75649bd8ec693d5230c500035.firstChild, element_a6aeaec5a75649bd8ec693d5230c500038 = element_a6aeaec5a75649bd8ec693d5230c500037.firstChild, element_a6aeaec5a75649bd8ec693d5230c500039 = element_a6aeaec5a75649bd8ec693d5230c500037.firstElementChild, element_a6aeaec5a75649bd8ec693d5230c50003a = element_a6aeaec5a75649bd8ec693d5230c500039.nextElementSibling, element_a6aeaec5a75649bd8ec693d5230c50003b = element_a6aeaec5a75649bd8ec693d5230c500038.nextSibling.nextSibling.nextSibling;
87
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500037, ' ', () => state.active && '--active');
88
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500037, this?.attributes && omit(this.attributes, OMIT));
89
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500037, omit(attributes, OMIT));
90
- template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c500037, 'click', () => {
57
+ let root_23a4f055a2904f1fa5d72b30cc2abc502s = template_23a4f055a2904f1fa5d72b30cc2abc502t(), element_23a4f055a2904f1fa5d72b30cc2abc502u = root_23a4f055a2904f1fa5d72b30cc2abc502s.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502v = element_23a4f055a2904f1fa5d72b30cc2abc502u.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502w = element_23a4f055a2904f1fa5d72b30cc2abc502u.firstElementChild, element_23a4f055a2904f1fa5d72b30cc2abc502x = element_23a4f055a2904f1fa5d72b30cc2abc502w.nextElementSibling, element_23a4f055a2904f1fa5d72b30cc2abc502y = element_23a4f055a2904f1fa5d72b30cc2abc502v.nextSibling.nextSibling.nextSibling;
58
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502u, ' ', () => state.active && '--active');
59
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502u, this?.attributes && omit(this.attributes, OMIT));
60
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502u, omit(attributes, OMIT));
61
+ template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502u, 'click', () => {
91
62
  if (state.render) {
92
63
  set(state, !state.active);
93
64
  }
94
65
  state.render = true;
95
66
  });
96
- new template_a6aeaec5a75649bd8ec693d5230c50001.EffectSlot(element_a6aeaec5a75649bd8ec693d5230c500038, content ? (() => content(state)) : (() => {
67
+ new template_23a4f055a2904f1fa5d72b30cc2abc501.EffectSlot(element_23a4f055a2904f1fa5d72b30cc2abc502v, content ? (() => content(state)) : (() => {
97
68
  let selected = options[state.selected];
98
69
  if (!selected) {
99
70
  return '-';
@@ -103,17 +74,17 @@ const select = template.factory(function (attributes, content) {
103
74
  }
104
75
  return selected;
105
76
  }));
106
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500039, this?.attributes?.arrow);
107
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500039, attributes.arrow);
108
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003a, 'name', attributes.name);
109
- template_a6aeaec5a75649bd8ec693d5230c50001.delegate(element_a6aeaec5a75649bd8ec693d5230c50003a, 'click', () => { });
110
- template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50003a, form.input.onrender(state));
111
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003a, 'value', () => state.selected);
112
- new template_a6aeaec5a75649bd8ec693d5230c50001.EffectSlot(element_a6aeaec5a75649bd8ec693d5230c50003b, () => {
77
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502w, this?.attributes?.arrow);
78
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502w, attributes.arrow);
79
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'name', attributes.name);
80
+ template_23a4f055a2904f1fa5d72b30cc2abc501.delegate(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'click', () => { });
81
+ template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc502x, form.input.onrender(state));
82
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502x, 'value', () => state.selected);
83
+ new template_23a4f055a2904f1fa5d72b30cc2abc501.EffectSlot(element_23a4f055a2904f1fa5d72b30cc2abc502y, () => {
113
84
  if (!state.render) {
114
85
  return;
115
86
  }
116
- let keys = Object.keys(options), selected = reactivity_a6aeaec5a75649bd8ec693d5230c50000.signal(Object.fromEntries(keys.map(key => [key, false])));
87
+ let keys = Object.keys(options), selected = reactive(Object.fromEntries(keys.map(key => [key, false])));
117
88
  return sb({
118
89
  ...this?.attributes?.['tooltip-content'] || EMPTY_ARRAY,
119
90
  ...attributes['tooltip-content'],
@@ -138,8 +109,8 @@ const select = template.factory(function (attributes, content) {
138
109
  let previous = state.selected;
139
110
  set(state, false);
140
111
  state.selected = key;
141
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[key] = true;
142
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[previous] = false;
112
+ selected[key] = true;
113
+ selected[previous] = false;
143
114
  },
144
115
  onconnect: () => {
145
116
  set(state, true);
@@ -152,17 +123,17 @@ const select = template.factory(function (attributes, content) {
152
123
  content = content.content;
153
124
  }
154
125
  return (() => {
155
- let root_a6aeaec5a75649bd8ec693d5230c500031 = template_a6aeaec5a75649bd8ec693d5230c500032(), element_a6aeaec5a75649bd8ec693d5230c500033 = root_a6aeaec5a75649bd8ec693d5230c500031.firstChild, element_a6aeaec5a75649bd8ec693d5230c500034 = element_a6aeaec5a75649bd8ec693d5230c500033.firstChild;
156
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c500033, ' ', () => reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(selected)[key] && '--active');
157
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500033, this?.attributes?.option);
158
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c500033, option);
159
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c500033, 'data-key', key);
160
- template_a6aeaec5a75649bd8ec693d5230c50001.slot(element_a6aeaec5a75649bd8ec693d5230c500034, content);
161
- return root_a6aeaec5a75649bd8ec693d5230c500031;
126
+ let root_23a4f055a2904f1fa5d72b30cc2abc502o = template_23a4f055a2904f1fa5d72b30cc2abc502p(), element_23a4f055a2904f1fa5d72b30cc2abc502q = root_23a4f055a2904f1fa5d72b30cc2abc502o.firstChild, element_23a4f055a2904f1fa5d72b30cc2abc502r = element_23a4f055a2904f1fa5d72b30cc2abc502q.firstChild;
127
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc502q, ' ', () => selected[key] && '--active');
128
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502q, this?.attributes?.option);
129
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc502q, option);
130
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc502q, 'data-key', key);
131
+ template_23a4f055a2904f1fa5d72b30cc2abc501.slot(element_23a4f055a2904f1fa5d72b30cc2abc502r, content);
132
+ return root_23a4f055a2904f1fa5d72b30cc2abc502o;
162
133
  })();
163
134
  }));
164
135
  });
165
- return root_a6aeaec5a75649bd8ec693d5230c500035;
136
+ return root_23a4f055a2904f1fa5d72b30cc2abc502s;
166
137
  })();
167
138
  });
168
139
  export default select;
@@ -1,46 +1,30 @@
1
- import * as reactivity_a6aeaec5a75649bd8ec693d5230c50000 from '@esportsplus/reactivity';
2
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
+ import { reactive } from '@esportsplus/template';
3
3
  import { omit } from '@esportsplus/utilities';
4
4
  import form from '../../components/form/index.js';
5
5
  import './scss/index.scss';
6
- const template_a6aeaec5a75649bd8ec693d5230c50003e = template_a6aeaec5a75649bd8ec693d5230c50001.template(`<textarea
6
+ const template_23a4f055a2904f1fa5d72b30cc2abc5030 = template_23a4f055a2904f1fa5d72b30cc2abc501.template(`<textarea
7
7
  class='textarea'></textarea>`);
8
- class ReactiveObject_a6aeaec5a75649bd8ec693d5230c50003c extends reactivity_a6aeaec5a75649bd8ec693d5230c50000.ReactiveObject {
9
- #active = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL](false);
10
- #error = this[reactivity_a6aeaec5a75649bd8ec693d5230c50000.SIGNAL]('');
11
- constructor() {
12
- super(null);
13
- }
14
- get active() {
15
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#active);
16
- }
17
- set active(_v0) {
18
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#active, _v0);
19
- }
20
- get error() {
21
- return reactivity_a6aeaec5a75649bd8ec693d5230c50000.read(this.#error);
22
- }
23
- set error(_v1) {
24
- reactivity_a6aeaec5a75649bd8ec693d5230c50000.write(this.#error, _v1);
25
- }
26
- }
27
8
  const OMIT = ['state'];
28
9
  export default function (attributes) {
29
- let state = attributes.state || new ReactiveObject_a6aeaec5a75649bd8ec693d5230c50003c();
10
+ let state = attributes.state || reactive({
11
+ active: false,
12
+ error: ''
13
+ });
30
14
  return (() => {
31
- let root_a6aeaec5a75649bd8ec693d5230c50003d = template_a6aeaec5a75649bd8ec693d5230c50003e(), element_a6aeaec5a75649bd8ec693d5230c50003f = root_a6aeaec5a75649bd8ec693d5230c50003d.firstChild;
32
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50003f, this?.attributes && omit(this.attributes, OMIT));
33
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperties(element_a6aeaec5a75649bd8ec693d5230c50003f, omit(attributes, OMIT));
34
- template_a6aeaec5a75649bd8ec693d5230c50001.setClass(element_a6aeaec5a75649bd8ec693d5230c50003f, '', () => state.active && '--active');
35
- template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50003f, 'focusin', () => {
15
+ let root_23a4f055a2904f1fa5d72b30cc2abc502z = template_23a4f055a2904f1fa5d72b30cc2abc5030(), element_23a4f055a2904f1fa5d72b30cc2abc5031 = root_23a4f055a2904f1fa5d72b30cc2abc502z.firstChild;
16
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5031, this?.attributes && omit(this.attributes, OMIT));
17
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperties(element_23a4f055a2904f1fa5d72b30cc2abc5031, omit(attributes, OMIT));
18
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setClass(element_23a4f055a2904f1fa5d72b30cc2abc5031, '', () => state.active && '--active');
19
+ template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'focusin', () => {
36
20
  state.active = true;
37
21
  });
38
- template_a6aeaec5a75649bd8ec693d5230c50001.on(element_a6aeaec5a75649bd8ec693d5230c50003f, 'focusout', () => {
22
+ template_23a4f055a2904f1fa5d72b30cc2abc501.on(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'focusout', () => {
39
23
  state.active = false;
40
24
  });
41
- template_a6aeaec5a75649bd8ec693d5230c50001.onrender(element_a6aeaec5a75649bd8ec693d5230c50003f, form.input.onrender(state));
42
- template_a6aeaec5a75649bd8ec693d5230c50001.setProperty(element_a6aeaec5a75649bd8ec693d5230c50003f, 'value', attributes?.value || '');
43
- return root_a6aeaec5a75649bd8ec693d5230c50003d;
25
+ template_23a4f055a2904f1fa5d72b30cc2abc501.onrender(element_23a4f055a2904f1fa5d72b30cc2abc5031, form.input.onrender(state));
26
+ template_23a4f055a2904f1fa5d72b30cc2abc501.setProperty(element_23a4f055a2904f1fa5d72b30cc2abc5031, 'value', attributes?.value || '');
27
+ return root_23a4f055a2904f1fa5d72b30cc2abc502z;
44
28
  })();
45
29
  }
46
30
  ;
@@ -1,4 +1,4 @@
1
- import * as template_a6aeaec5a75649bd8ec693d5230c50001 from '@esportsplus/template';
1
+ import * as template_23a4f055a2904f1fa5d72b30cc2abc501 from '@esportsplus/template';
2
2
  import { Attributes, Renderable } from '@esportsplus/template';
3
3
  type A = Attributes & {
4
4
  options: (Attributes & {
@@ -16,19 +16,19 @@ type A = Attributes & {
16
16
  declare const _default: {
17
17
  (): ReturnType<(this: {
18
18
  attributes?: A | undefined;
19
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
20
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => Renderable<any>>;
19
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
20
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
21
21
  <T extends A>(attributes: T): ReturnType<(this: {
22
22
  attributes?: A | undefined;
23
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
24
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => Renderable<any>>;
25
- <T extends template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>>(content: T): ReturnType<(this: {
23
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
24
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
25
+ <T extends template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>>(content: T): ReturnType<(this: {
26
26
  attributes?: A | undefined;
27
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
28
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => Renderable<any>>;
29
- (attributes: A, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>): ReturnType<(this: {
27
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
28
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
29
+ (attributes: A, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>): ReturnType<(this: {
30
30
  attributes?: A | undefined;
31
- content?: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>;
32
- }, attributes: Readonly<A>, content: template_a6aeaec5a75649bd8ec693d5230c50001.Renderable<any>) => Renderable<any>>;
31
+ content?: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>;
32
+ }, attributes: Readonly<A>, content: template_23a4f055a2904f1fa5d72b30cc2abc501.Renderable<any>) => Renderable<any>>;
33
33
  };
34
34
  export default _default;