@esportsplus/ui 0.0.45 → 0.0.46

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.
@@ -1,10 +1,12 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const reactivity_1 = require("@esportsplus/reactivity");
4
+ const template_1 = require("@esportsplus/template");
3
5
  let modifiers = {
4
6
  error: 'red',
5
7
  info: 'black',
6
8
  success: 'green'
7
- }, state = reactive({
9
+ }, state = (0, reactivity_1.reactive)({
8
10
  active: false,
9
11
  messages: new Set,
10
12
  processing: false,
@@ -92,9 +94,9 @@ const processing = () => {
92
94
  };
93
95
  const success = (messages, seconds = 0) => activate('success', messages, seconds);
94
96
  const h = () => {
95
- return () => state.active || state.processing ? html `
97
+ return () => state.active || state.processing ? (0, template_1.html) `
96
98
  <div class='alert anchor anchor--ne ${() => state.active && '--active'} ${() => `alert--${state.state}`}'>
97
- ${() => !state.processing ? html `
99
+ ${() => !state.processing ? (0, template_1.html) `
98
100
  <div class="alert-close --flex-start --margin-right --margin-100" onclick='${deactivate}'>
99
101
  <div class='button --background-state ${() => `--background-${modifiers[state.type] || 'black'}`} --color-state --color-white --flex-center --padding-300'>
100
102
  <div class="icon --size-300">
@@ -114,12 +116,12 @@ const h = () => {
114
116
  <h5 class="page-title">
115
117
  ${() => state.type.charAt(0).toUpperCase() + state.type.slice(1)}
116
118
  </h5>
117
- ${() => state.type && [...state.messages].map((message) => html `
119
+ ${() => state.type && [...state.messages].map((message) => (0, template_1.html) `
118
120
  <p class='--margin-top --margin-border-width-500'>${message}</p>
119
121
  `)}
120
122
  </div>
121
123
 
122
- ${() => !state.processing && state.seconds ? html `
124
+ ${() => !state.processing && state.seconds ? (0, template_1.html) `
123
125
  <svg class='alert-timer' style='--animation-duration: ${state.seconds}s;'>
124
126
  <circle class="alert-timer-bg" cx="50%" cy="50%" r="40%" style='--border-color: var(--color-grey-500);' />
125
127
  <circle class="alert-timer-meter" cx="50%" cy="50%" r="40%" style='--border-color: var(--color-black-300);' />
@@ -147,4 +149,4 @@ const h = () => {
147
149
  ` : '';
148
150
  };
149
151
  const types = ['error', 'info', 'success'];
150
- export default { deactivate, error, html: h, info, processing, success, types };
152
+ exports.default = { deactivate, error, html: h, info, processing, success, types };
@@ -1,11 +1,16 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
- import description from './description';
4
- export default (data) => {
5
- let state = reactive({
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const reactivity_1 = require("@esportsplus/reactivity");
7
+ const template_1 = require("@esportsplus/template");
8
+ const description_1 = __importDefault(require("./description"));
9
+ exports.default = (data) => {
10
+ let state = (0, reactivity_1.reactive)({
6
11
  active: false
7
12
  });
8
- return html `
13
+ return (0, template_1.html) `
9
14
  <div
10
15
  class="field --flex-column ${data?.class || ''} ${() => state.active ? '--active' : ''}"
11
16
  onchange='${(e) => {
@@ -35,7 +40,7 @@ export default (data) => {
35
40
 
36
41
  ${data?.field?.content || ''}
37
42
 
38
- ${description(data)}
43
+ ${(0, description_1.default)(data)}
39
44
  </div>
40
45
  `;
41
46
  };
@@ -1,9 +1,11 @@
1
- import { html } from '@esportsplus/template';
2
- export default (data) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ exports.default = (data) => {
3
5
  if (!data?.description) {
4
6
  return '';
5
7
  }
6
- return html `
8
+ return (0, template_1.html) `
7
9
  <div class='field-description --margin-top --margin-300'>${data.description}</div>
8
10
  `;
9
11
  };
@@ -1,10 +1,12 @@
1
- import { html } from '@esportsplus/template';
2
- export default (data) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ exports.default = (data) => {
3
5
  return () => {
4
6
  if (!data.error) {
5
7
  return '';
6
8
  }
7
- return html `
9
+ return (0, template_1.html) `
8
10
  <div class='field-error --margin-top --margin-300 --text-bold'>${data.error}</div>
9
11
  `;
10
12
  };
@@ -1,6 +1,11 @@
1
- import checkbox from './checkbox';
2
- import optional from './optional';
3
- import select from './select';
4
- import s from './switch';
5
- import text from './text';
6
- export default { checkbox, optional, select, switch: s, text };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const checkbox_1 = __importDefault(require("./checkbox"));
7
+ const optional_1 = __importDefault(require("./optional"));
8
+ const select_1 = __importDefault(require("./select"));
9
+ const switch_1 = __importDefault(require("./switch"));
10
+ const text_1 = __importDefault(require("./text"));
11
+ exports.default = { checkbox: checkbox_1.default, optional: optional_1.default, select: select_1.default, switch: switch_1.default, text: text_1.default };
@@ -1,20 +1,25 @@
1
- import sel from './select';
2
- import s from './switch';
3
- import tex from './text';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const select_1 = __importDefault(require("./select"));
7
+ const switch_1 = __importDefault(require("./switch"));
8
+ const text_1 = __importDefault(require("./text"));
4
9
  const select = (data) => {
5
- return s(Object.assign(data, {
10
+ return (0, switch_1.default)(Object.assign(data, {
6
11
  class: `field--optional ${data?.class || ''}`,
7
12
  field: {
8
- content: sel(data.field)
13
+ content: (0, select_1.default)(data.field)
9
14
  }
10
15
  }));
11
16
  };
12
17
  const text = (data) => {
13
- return s(Object.assign(data, {
18
+ return (0, switch_1.default)(Object.assign(data, {
14
19
  class: `field--optional ${data?.class || ''}`,
15
20
  field: {
16
- content: tex(data.field)
21
+ content: (0, text_1.default)(data.field)
17
22
  }
18
23
  }));
19
24
  };
20
- export default { select, text };
25
+ exports.default = { select, text };
@@ -1,9 +1,14 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
- import { form, scrollbar, root } from '../../components';
4
- import description from './description';
5
- import error from './error';
6
- import title from './title';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const reactivity_1 = require("@esportsplus/reactivity");
7
+ const template_1 = require("@esportsplus/template");
8
+ const components_1 = require("../../components");
9
+ const description_1 = __importDefault(require("./description"));
10
+ const error_1 = __importDefault(require("./error"));
11
+ const title_1 = __importDefault(require("./title"));
7
12
  function parse(keys, selected) {
8
13
  let options = {};
9
14
  for (let key of keys) {
@@ -16,11 +21,11 @@ function parse(keys, selected) {
16
21
  };
17
22
  }
18
23
  function template(data, state) {
19
- let { attributes: a, html: h } = scrollbar({
24
+ let { attributes: a, html: h } = (0, components_1.scrollbar)({
20
25
  fixed: true,
21
26
  style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
22
27
  });
23
- return html `
28
+ return (0, template_1.html) `
24
29
  <div
25
30
  class='tooltip-content tooltip-content--${data?.tooltip?.direction || 's'} ${data?.tooltip?.class || ''} --flex-column --width-full'
26
31
  style='${data?.tooltip?.style || ''}'
@@ -42,7 +47,7 @@ function template(data, state) {
42
47
  }}'
43
48
  ${a}
44
49
  >
45
- ${Object.keys(data.options || {}).map((key) => html `
50
+ ${Object.keys(data.options || {}).map((key) => (0, template_1.html) `
46
51
  <div
47
52
  class='link ${data?.option?.class || ''} ${() => state.options[key] ? '--active' : ''} --flex-vertical' data-key='${key}'
48
53
  style='${data?.option?.style || ''}'
@@ -58,15 +63,15 @@ function template(data, state) {
58
63
  </div>
59
64
  `;
60
65
  }
61
- export default (data) => {
62
- let state = reactive(Object.assign({
66
+ exports.default = (data) => {
67
+ let state = (0, reactivity_1.reactive)(Object.assign({
63
68
  active: false,
64
69
  error: '',
65
70
  render: false,
66
71
  }, parse(Object.keys(data.options || {}), data.selected)));
67
- return html `
72
+ return (0, template_1.html) `
68
73
  <div class="field tooltip ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column" style='${data?.style || ''}'>
69
- ${title(data)}
74
+ ${(0, title_1.default)(data)}
70
75
 
71
76
  <label
72
77
  class="field-mask field-mask--select --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300 --padding-400"
@@ -74,7 +79,7 @@ export default (data) => {
74
79
  state.render = true;
75
80
  state.active = !state.active;
76
81
  if (state.active) {
77
- root.queue.onclick(() => state.active = false);
82
+ components_1.root.queue.onclick(() => state.active = false);
78
83
  }
79
84
  }}'
80
85
  style='${data?.mask?.style || ''}'
@@ -83,7 +88,7 @@ export default (data) => {
83
88
  class='field-tag field-tag--hidden'
84
89
  name='${data.name}'
85
90
  onclick='${() => { }}'
86
- onrender='${form.input.attributes(state)}'
91
+ onrender='${components_1.form.input.attributes(state)}'
87
92
  value='${() => state.selected}'
88
93
  >
89
94
 
@@ -96,8 +101,8 @@ export default (data) => {
96
101
  ${() => state.render ? template(data, state) : ''}
97
102
  </label>
98
103
 
99
- ${description(data)}
100
- ${error(state)}
104
+ ${(0, description_1.default)(data)}
105
+ ${(0, error_1.default)(state)}
101
106
  </div>
102
107
  `;
103
108
  };
@@ -1,6 +1,11 @@
1
- import checkbox from './checkbox';
2
- export default (data) => {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const checkbox_1 = __importDefault(require("./checkbox"));
7
+ exports.default = (data) => {
3
8
  data.mask = data.mask || {};
4
9
  data.mask.class = `field-mask--switch ${data.mask?.class || ''}`;
5
- return checkbox(data);
10
+ return (0, checkbox_1.default)(data);
6
11
  };
@@ -1,15 +1,20 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
- import { form } from '../../components';
4
- import description from './description';
5
- import error from './error';
6
- import title from './title';
7
- export default (data) => {
8
- let state = reactive({
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const reactivity_1 = require("@esportsplus/reactivity");
7
+ const template_1 = require("@esportsplus/template");
8
+ const components_1 = require("../../components");
9
+ const description_1 = __importDefault(require("./description"));
10
+ const error_1 = __importDefault(require("./error"));
11
+ const title_1 = __importDefault(require("./title"));
12
+ exports.default = (data) => {
13
+ let state = (0, reactivity_1.reactive)({
9
14
  active: false,
10
15
  error: ''
11
16
  });
12
- return html `
17
+ return (0, template_1.html) `
13
18
  <div
14
19
  class="field ${data?.class || ''} ${() => state.active ? '--active' : ''} --flex-column"
15
20
  onfocusin='${() => {
@@ -20,7 +25,7 @@ export default (data) => {
20
25
  }}'
21
26
  style='${data?.style || ''}'
22
27
  >
23
- ${title(data)}
28
+ ${(0, title_1.default)(data)}
24
29
 
25
30
  <label
26
31
  class='field-mask field-mask--input --flex-row ${data?.mask?.class || ''} ${(data?.title || (data?.class || '').indexOf('field--optional') !== -1) && '--margin-top'} --margin-300'
@@ -30,7 +35,7 @@ export default (data) => {
30
35
  class='field-tag --padding-400'
31
36
  name='${data?.name || ''}'
32
37
  placeholder='${data?.placeholder || ''}'
33
- onrender='${form.input.attributes(state)}'
38
+ onrender='${components_1.form.input.attributes(state)}'
34
39
  type='${data?.type || 'string'}'
35
40
  ${data?.value !== undefined ? `value='${data.value}'` : ''}
36
41
  >
@@ -38,8 +43,8 @@ export default (data) => {
38
43
  ${data?.mask?.content || ''}
39
44
  </label>
40
45
 
41
- ${description(data)}
42
- ${error(state)}
46
+ ${(0, description_1.default)(data)}
47
+ ${(0, error_1.default)(state)}
43
48
  </div>
44
49
  `;
45
50
  };
@@ -1,15 +1,17 @@
1
- import { html } from '@esportsplus/template';
2
- import { tooltip } from '../../components';
3
- export default (data) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ const components_1 = require("../../components");
5
+ exports.default = (data) => {
4
6
  if (!data?.title) {
5
7
  return '';
6
8
  }
7
- return html `
9
+ return (0, template_1.html) `
8
10
  <div class="field-title --flex-horizontal-space-between --flex-vertical">
9
11
  ${data.title}
10
12
 
11
- ${data?.required && html `
12
- <div class="bubble --background-primary --margin-left" ${tooltip.onhover()}>
13
+ ${data?.required && (0, template_1.html) `
14
+ <div class="bubble --background-primary --margin-left" ${components_1.tooltip.onhover()}>
13
15
  <span class="tooltip-message tooltip-message--w">Required</span>
14
16
  </div>
15
17
  `}
@@ -1,7 +1,12 @@
1
- import { response } from '@esportsplus/action';
2
- import { html } from '@esportsplus/template';
3
- import alert from '../../components/alert';
4
- import input from './input';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const action_1 = require("@esportsplus/action");
7
+ const template_1 = require("@esportsplus/template");
8
+ const alert_1 = __importDefault(require("../../components/alert"));
9
+ const input_1 = __importDefault(require("./input"));
5
10
  function parse(input) {
6
11
  let data = {};
7
12
  for (let path in input) {
@@ -14,8 +19,8 @@ function parse(input) {
14
19
  return data;
15
20
  }
16
21
  ;
17
- export default function (action) {
18
- return html({
22
+ function default_1(action) {
23
+ return (0, template_1.html)({
19
24
  onclick: function (event) {
20
25
  let trigger = event.target;
21
26
  if (trigger?.type !== 'submit') {
@@ -27,12 +32,12 @@ export default function (action) {
27
32
  onsubmit: async function (event) {
28
33
  event.preventDefault();
29
34
  let { errors } = await action({
30
- alert,
35
+ alert: alert_1.default,
31
36
  input: parse(Object.fromEntries(new FormData(this)?.entries())),
32
37
  processing: {
33
38
  end: (deactivate = true) => {
34
39
  if (deactivate) {
35
- alert.deactivate();
40
+ alert_1.default.deactivate();
36
41
  }
37
42
  event?.submitter?.classList.remove('button--processing');
38
43
  },
@@ -40,10 +45,10 @@ export default function (action) {
40
45
  event?.submitter?.classList.add('button--processing');
41
46
  }
42
47
  },
43
- response
48
+ response: action_1.response
44
49
  });
45
50
  for (let i = 0, n = errors.length; i < n; i++) {
46
- let { message, path } = errors[i], state = input.get(this[path]);
51
+ let { message, path } = errors[i], state = input_1.default.get(this[path]);
47
52
  if (!state) {
48
53
  continue;
49
54
  }
@@ -52,4 +57,5 @@ export default function (action) {
52
57
  }
53
58
  });
54
59
  }
60
+ exports.default = default_1;
55
61
  ;
@@ -1,4 +1,9 @@
1
- import action from './action';
2
- import input from './input';
3
- import layout from './layout';
4
- export default { action, input, layout };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const action_1 = __importDefault(require("./action"));
7
+ const input_1 = __importDefault(require("./input"));
8
+ const layout_1 = __importDefault(require("./layout"));
9
+ exports.default = { action: action_1.default, input: input_1.default, layout: layout_1.default };
@@ -1,3 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
1
3
  let cache = new WeakMap();
2
4
  const attributes = (reactive) => {
3
5
  return (element) => {
@@ -7,4 +9,4 @@ const attributes = (reactive) => {
7
9
  const get = (element) => {
8
10
  return element ? cache.get(element) : undefined;
9
11
  };
10
- export default { attributes, get };
12
+ exports.default = { attributes, get };
@@ -1,12 +1,14 @@
1
- import { html } from '@esportsplus/template';
2
- import { header } from '../../components/page';
3
- export default (data) => html `
4
- ${header(data)}
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ const page_1 = require("../../components/page");
5
+ exports.default = (data) => (0, template_1.html) `
6
+ ${(0, page_1.header)(data)}
5
7
 
6
8
  <form class='${data?.class}' ${data?.action || ''}>
7
9
  ${data?.content || ''}
8
10
 
9
- ${data?.button ? html `
11
+ ${data?.button ? (0, template_1.html) `
10
12
  <button class="button ${data?.button?.class || ''}" style='${data?.button?.style || ''}'>
11
13
  ${data?.button?.content || ''}
12
14
  </button>
@@ -1 +1,2 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,24 @@
1
- export { default as alert } from './alert';
2
- export { default as field } from './field';
3
- export { default as form } from './form';
4
- export { default as overlay } from './overlay';
5
- export { default as page } from './page';
6
- export { default as root } from './root';
7
- export { default as scrollbar } from './scrollbar';
8
- export { default as site } from './site';
9
- export { default as tooltip } from './tooltip';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.tooltip = exports.site = exports.scrollbar = exports.root = exports.page = exports.overlay = exports.form = exports.field = exports.alert = void 0;
7
+ var alert_1 = require("./alert");
8
+ Object.defineProperty(exports, "alert", { enumerable: true, get: function () { return __importDefault(alert_1).default; } });
9
+ var field_1 = require("./field");
10
+ Object.defineProperty(exports, "field", { enumerable: true, get: function () { return __importDefault(field_1).default; } });
11
+ var form_1 = require("./form");
12
+ Object.defineProperty(exports, "form", { enumerable: true, get: function () { return __importDefault(form_1).default; } });
13
+ var overlay_1 = require("./overlay");
14
+ Object.defineProperty(exports, "overlay", { enumerable: true, get: function () { return __importDefault(overlay_1).default; } });
15
+ var page_1 = require("./page");
16
+ Object.defineProperty(exports, "page", { enumerable: true, get: function () { return __importDefault(page_1).default; } });
17
+ var root_1 = require("./root");
18
+ Object.defineProperty(exports, "root", { enumerable: true, get: function () { return __importDefault(root_1).default; } });
19
+ var scrollbar_1 = require("./scrollbar");
20
+ Object.defineProperty(exports, "scrollbar", { enumerable: true, get: function () { return __importDefault(scrollbar_1).default; } });
21
+ var site_1 = require("./site");
22
+ Object.defineProperty(exports, "site", { enumerable: true, get: function () { return __importDefault(site_1).default; } });
23
+ var tooltip_1 = require("./tooltip");
24
+ Object.defineProperty(exports, "tooltip", { enumerable: true, get: function () { return __importDefault(tooltip_1).default; } });
@@ -1,5 +1,7 @@
1
- import { html } from '@esportsplus/template';
2
- export default (data = {}) => html `
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ exports.default = (data = {}) => (0, template_1.html) `
3
5
  <section class='overlay ${data?.class || ''}'>
4
6
  ${data?.content || ''}
5
7
  </section>
@@ -1,18 +1,20 @@
1
- import { html } from '@esportsplus/template';
2
- export default (data) => html `
3
- ${data?.suptitle ? html `
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ exports.default = (data) => (0, template_1.html) `
5
+ ${data?.suptitle ? (0, template_1.html) `
4
6
  <span class="page-suptitle --text-bold --text-crop --text-uppercase --text-200" style="--color-default: var(--color-primary-400);letter-spacing: 0.24px;">
5
7
  ${data?.suptitle}
6
8
  </span>
7
9
  ` : ''}
8
10
 
9
- ${data?.title ? html `
11
+ ${data?.title ? (0, template_1.html) `
10
12
  <h1 class="page-title --line-height-200 --margin-300 ${!data?.subtitle && '--text-crop-bottom'} ${data?.suptitle ? '--margin-top' : '--text-crop-top'}">
11
13
  ${data?.title}
12
14
  </h1>
13
15
  ` : ''}
14
16
 
15
- ${data?.subtitle ? html `
17
+ ${data?.subtitle ? (0, template_1.html) `
16
18
  <span class="page-subtitle --margin-top --margin-300 --text-crop-bottom">
17
19
  ${data?.subtitle}
18
20
  </span>
@@ -1,4 +1,11 @@
1
- import header from './header';
2
- import layout from './layout';
3
- export default { header, layout };
4
- export { header, layout };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.layout = exports.header = void 0;
7
+ const header_1 = __importDefault(require("./header"));
8
+ exports.header = header_1.default;
9
+ const layout_1 = __importDefault(require("./layout"));
10
+ exports.layout = layout_1.default;
11
+ exports.default = { header: header_1.default, layout: layout_1.default };
@@ -1,5 +1,7 @@
1
- import { html } from '@esportsplus/template';
2
- export default (data = {}) => html `
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ exports.default = (data = {}) => (0, template_1.html) `
3
5
  <section class='page ${data?.class}'>
4
6
  ${data?.content}
5
7
  </section>
@@ -1,3 +1,9 @@
1
- import queue from './queue';
2
- export default { queue };
3
- export { queue };
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.queue = void 0;
7
+ const queue_1 = __importDefault(require("./queue"));
8
+ exports.queue = queue_1.default;
9
+ exports.default = { queue: queue_1.default };
@@ -1,8 +1,13 @@
1
- import events from '@esportsplus/delegated-events';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const delegated_events_1 = __importDefault(require("@esportsplus/delegated-events"));
2
7
  let initialized = false, queue = [];
3
8
  const onclick = (fn) => {
4
9
  if (!initialized) {
5
- events.register(document.body, 'click', async () => {
10
+ delegated_events_1.default.register(document.body, 'click', async () => {
6
11
  if (!queue.length) {
7
12
  return;
8
13
  }
@@ -15,4 +20,4 @@ const onclick = (fn) => {
15
20
  }
16
21
  queue.push(fn);
17
22
  };
18
- export default { onclick };
23
+ exports.default = { onclick };
@@ -1,13 +1,15 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const reactivity_1 = require("@esportsplus/reactivity");
4
+ const template_1 = require("@esportsplus/template");
3
5
  let root = document.body, width;
4
- export default ({ fixed, style } = {}) => {
5
- let state = reactive({
6
+ exports.default = ({ fixed, style } = {}) => {
7
+ let state = (0, reactivity_1.reactive)({
6
8
  height: 100,
7
9
  translate: 0
8
10
  });
9
11
  return {
10
- attributes: html({
12
+ attributes: (0, template_1.html)({
11
13
  class: () => {
12
14
  return '--scrollbar';
13
15
  },
@@ -22,7 +24,7 @@ export default ({ fixed, style } = {}) => {
22
24
  state.translate = (this.scrollTop / this.clientHeight) * 100;
23
25
  }
24
26
  }),
25
- html: html `
27
+ html: (0, template_1.html) `
26
28
  <div
27
29
  class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
28
30
  style='${() => `
@@ -1,11 +1,13 @@
1
- import { html } from '@esportsplus/template';
2
- import { scrollbar } from '../../components';
3
- export default (data) => {
4
- let { attributes: a, html: h } = scrollbar({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const template_1 = require("@esportsplus/template");
4
+ const components_1 = require("../../components");
5
+ exports.default = (data) => {
6
+ let { attributes: a, html: h } = (0, components_1.scrollbar)({
5
7
  fixed: true,
6
8
  style: data?.scrollbar?.style || '--background-default: var(--color-black-400);'
7
9
  });
8
- return html `
10
+ return (0, template_1.html) `
9
11
  <section class='site ${data?.class || ''}' ${a}>
10
12
  ${data?.content || ''}
11
13
  ${h}
@@ -1,12 +1,17 @@
1
- import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
- import { root } from '../../components';
4
- import menu from './menu';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const reactivity_1 = require("@esportsplus/reactivity");
7
+ const template_1 = require("@esportsplus/template");
8
+ const components_1 = require("../../components");
9
+ const menu_1 = __importDefault(require("./menu"));
5
10
  const onclick = ({ active, toggle }) => {
6
- let state = reactive({
11
+ let state = (0, reactivity_1.reactive)({
7
12
  active: active || false
8
13
  });
9
- return html({
14
+ return (0, template_1.html)({
10
15
  class: () => {
11
16
  return `tooltip ${state.active ? '--active' : ''}`;
12
17
  },
@@ -17,14 +22,14 @@ const onclick = ({ active, toggle }) => {
17
22
  }
18
23
  state.active = active;
19
24
  if (active) {
20
- root.queue.onclick(() => state.active = false);
25
+ components_1.root.queue.onclick(() => state.active = false);
21
26
  }
22
27
  }
23
28
  });
24
29
  };
25
30
  const onhover = (active = false) => {
26
- let state = reactive({ active });
27
- return html({
31
+ let state = (0, reactivity_1.reactive)({ active });
32
+ return (0, template_1.html)({
28
33
  class: () => {
29
34
  return `tooltip ${state.active ? '--active' : ''}`;
30
35
  },
@@ -36,4 +41,4 @@ const onhover = (active = false) => {
36
41
  }
37
42
  });
38
43
  };
39
- export default { onclick, onhover, menu };
44
+ exports.default = { onclick, onhover, menu: menu_1.default };
@@ -1,10 +1,12 @@
1
- import { effect, reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const reactivity_1 = require("@esportsplus/reactivity");
4
+ const template_1 = require("@esportsplus/template");
3
5
  function template(data) {
4
- return html `
6
+ return (0, template_1.html) `
5
7
  <div class="tooltip-content tooltip-content--${data?.direction || 's'} --flex-column --width-full ${data?.class || ''}" style='${data?.style || ''}'>
6
- ${(data?.items || []).map(item => html `
7
- ${item?.border ? html `
8
+ ${(data?.items || []).map(item => (0, template_1.html) `
9
+ ${item?.border ? (0, template_1.html) `
8
10
  <div
9
11
  class="border ${item?.border?.class || ''}"
10
12
  style='
@@ -15,11 +17,11 @@ function template(data) {
15
17
  ` : ''}
16
18
 
17
19
  <${item?.url ? 'a' : 'div'}
18
- class='link --flex-vertical ${item?.class}' ${item?.onclick ? html({ onclick: item.onclick }) : ''}
20
+ class='link --flex-vertical ${item?.class}' ${item?.onclick ? (0, template_1.html)({ onclick: item.onclick }) : ''}
19
21
  style='${item?.style || ''}'
20
22
  ${item?.url ? `href='${item.url}' target='${item.target || '_blank'}'` : ''}
21
23
  >
22
- ${item?.svg ? html `
24
+ ${item?.svg ? (0, template_1.html) `
23
25
  <div class="icon --margin-right --margin-300" style='margin-left: var(--size-100)'>
24
26
  ${item.svg}
25
27
  </div>
@@ -33,11 +35,11 @@ function template(data) {
33
35
  </div>
34
36
  `;
35
37
  }
36
- export default (data) => {
37
- let state = reactive({
38
+ exports.default = (data) => {
39
+ let state = (0, reactivity_1.reactive)({
38
40
  render: false
39
41
  });
40
- effect(() => {
42
+ (0, reactivity_1.effect)(() => {
41
43
  if (!data.state.active || state.render) {
42
44
  return;
43
45
  }
package/build/entry.js CHANGED
@@ -1,10 +1,12 @@
1
- import { resolve } from '@esportsplus/webpack';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const webpack_1 = require("@esportsplus/webpack");
2
4
  const styles = (files, { font, fonts, normalizer } = {}) => {
3
- files.unshift(...resolve.glob(`./components/**/index.scss`));
4
- files.push(...resolve.glob(`./css-utilities/**/index.scss`));
5
+ files.unshift(...webpack_1.resolve.glob(`./components/**/index.scss`));
6
+ files.push(...webpack_1.resolve.glob(`./css-utilities/**/index.scss`));
5
7
  fonts = font ? [font] : fonts;
6
8
  if (fonts) {
7
- files.unshift(...resolve.glob(`../storage/fonts/{${fonts.join(',')}}/index.css`));
9
+ files.unshift(...webpack_1.resolve.glob(`../storage/fonts/{${fonts.join(',')}}/index.css`));
8
10
  }
9
11
  if (normalizer) {
10
12
  files.unshift('modern-normalize/modern-normalize.css');
@@ -12,8 +14,8 @@ const styles = (files, { font, fonts, normalizer } = {}) => {
12
14
  return files;
13
15
  };
14
16
  const variables = (files) => {
15
- files.unshift(...resolve.glob('./components/**/variables.scss'));
16
- files.push(...resolve.glob('./css-utilities/**/variables.scss'));
17
+ files.unshift(...webpack_1.resolve.glob('./components/**/variables.scss'));
18
+ files.push(...webpack_1.resolve.glob('./css-utilities/**/variables.scss'));
17
19
  return files;
18
20
  };
19
- export default { styles, variables };
21
+ exports.default = { styles, variables };
package/build/index.js CHANGED
@@ -1,3 +1,24 @@
1
- import './types';
2
- export * from './components';
3
- export { default as entry } from './entry';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.entry = void 0;
21
+ require("./types");
22
+ __exportStar(require("./components"), exports);
23
+ var entry_1 = require("./entry");
24
+ Object.defineProperty(exports, "entry", { enumerable: true, get: function () { return __importDefault(entry_1).default; } });
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "description": "UI",
10
10
  "devDependencies": {
11
- "@esportsplus/webpack": "^0.0.37"
11
+ "@esportsplus/webpack": "^0.0.38"
12
12
  },
13
13
  "main": "./build/index.js",
14
14
  "name": "@esportsplus/ui",
@@ -18,5 +18,5 @@
18
18
  "prepublishOnly": "npm run build"
19
19
  },
20
20
  "types": "./build/index.d.ts",
21
- "version": "0.0.45"
21
+ "version": "0.0.46"
22
22
  }