@esportsplus/ui 0.0.87 → 0.0.89

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 (65) hide show
  1. package/build/components/alert/index.d.ts +1 -1
  2. package/build/components/alert/index.js +8 -6
  3. package/build/components/field/checkbox.d.ts +1 -1
  4. package/build/components/field/checkbox.js +12 -7
  5. package/build/components/field/description.d.ts +1 -1
  6. package/build/components/field/description.js +5 -3
  7. package/build/components/field/error.d.ts +1 -1
  8. package/build/components/field/error.js +5 -3
  9. package/build/components/field/file.d.ts +1 -1
  10. package/build/components/field/file.js +18 -13
  11. package/build/components/field/index.d.ts +8 -8
  12. package/build/components/field/index.js +13 -8
  13. package/build/components/field/optional.d.ts +2 -2
  14. package/build/components/field/optional.js +13 -8
  15. package/build/components/field/select.d.ts +1 -1
  16. package/build/components/field/select.js +22 -17
  17. package/build/components/field/switch.d.ts +1 -1
  18. package/build/components/field/switch.js +8 -3
  19. package/build/components/field/text.d.ts +1 -1
  20. package/build/components/field/text.js +20 -15
  21. package/build/components/field/textarea.d.ts +1 -1
  22. package/build/components/field/textarea.js +8 -3
  23. package/build/components/field/title.d.ts +1 -1
  24. package/build/components/field/title.js +8 -6
  25. package/build/components/form/action.d.ts +4 -1
  26. package/build/components/form/action.js +35 -30
  27. package/build/components/form/index.d.ts +1 -1
  28. package/build/components/form/index.js +9 -4
  29. package/build/components/form/input.js +3 -1
  30. package/build/components/form/layout.d.ts +1 -1
  31. package/build/components/form/layout.js +7 -5
  32. package/build/components/form/types.js +2 -1
  33. package/build/components/index.js +24 -9
  34. package/build/components/overlay/index.d.ts +1 -1
  35. package/build/components/overlay/index.js +4 -2
  36. package/build/components/page/header.d.ts +1 -1
  37. package/build/components/page/header.js +7 -5
  38. package/build/components/page/index.d.ts +2 -2
  39. package/build/components/page/index.js +11 -4
  40. package/build/components/page/layout.d.ts +1 -1
  41. package/build/components/page/layout.js +4 -2
  42. package/build/components/root/index.js +9 -3
  43. package/build/components/root/queue.js +3 -11
  44. package/build/components/scrollbar/index.d.ts +5 -2
  45. package/build/components/scrollbar/index.js +20 -18
  46. package/build/components/site/index.d.ts +1 -1
  47. package/build/components/site/index.js +8 -6
  48. package/build/components/tooltip/index.d.ts +10 -3
  49. package/build/components/tooltip/index.js +45 -41
  50. package/build/components/tooltip/menu.d.ts +1 -1
  51. package/build/components/tooltip/menu.js +11 -9
  52. package/build/index.d.ts +0 -1
  53. package/build/index.js +17 -2
  54. package/build/types.d.ts +1 -0
  55. package/build/types.js +1 -0
  56. package/package.json +5 -6
  57. package/src/components/form/action.ts +6 -7
  58. package/src/components/root/queue.ts +10 -10
  59. package/src/components/scrollbar/index.ts +6 -6
  60. package/src/components/site/index.ts +1 -1
  61. package/src/components/tooltip/index.ts +14 -15
  62. package/src/index.ts +0 -3
  63. package/tsconfig.json +3 -2
  64. package/webpack.config.ts +28 -23
  65. package/src/types.ts +0 -5
package/build/index.js CHANGED
@@ -1,2 +1,17 @@
1
- import './types';
2
- export * from './components';
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
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components"), exports);
package/build/types.d.ts CHANGED
@@ -3,3 +3,4 @@ declare module '*.json';
3
3
  declare module '*.png';
4
4
  declare module '*.svg';
5
5
  declare module '*.txt';
6
+ export {};
package/build/types.js CHANGED
@@ -1 +1,2 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -2,13 +2,12 @@
2
2
  "author": "ICJR",
3
3
  "dependencies": {
4
4
  "@esportsplus/action": "^0.0.38",
5
- "@esportsplus/delegated-events": "^0.0.19",
6
- "@esportsplus/reactivity": "^0.1.17",
7
- "@esportsplus/template": "^0.1.8"
5
+ "@esportsplus/reactivity": "^0.1.18",
6
+ "@esportsplus/template": "^0.1.27"
8
7
  },
9
8
  "description": "UI",
10
9
  "devDependencies": {
11
- "@esportsplus/webpack": "^0.1.20",
10
+ "@esportsplus/webpack": "^0.1.30",
12
11
  "modern-normalize": "^2.0.0"
13
12
  },
14
13
  "main": "build/index.js",
@@ -17,10 +16,10 @@
17
16
  "scripts": {
18
17
  "build": "npm run build:ts && npm run build:web",
19
18
  "build:ts": "tsc && tsc-alias",
20
- "build:web": "webpack",
19
+ "build:web": "webpack build --env=production=true",
21
20
  "-": "-",
22
21
  "prepublishOnly": "npm run build"
23
22
  },
24
23
  "types": "build/index.d.ts",
25
- "version": "0.0.87"
24
+ "version": "0.0.89"
26
25
  }
@@ -1,5 +1,4 @@
1
1
  import { response } from '@esportsplus/action';
2
- import { html } from '@esportsplus/template';
3
2
  import { Action } from './types';
4
3
  import alert from '~/components/alert';
5
4
  import input from './input';
@@ -24,8 +23,8 @@ function parse(input: Record<string, any>) {
24
23
 
25
24
 
26
25
  export default function(action: Action) {
27
- return html`
28
- onclick='${function(this: HTMLFormElement, event: Event) {
26
+ return {
27
+ onclick: function(this: HTMLFormElement, event: Event) {
29
28
  let trigger = event.target as HTMLButtonElement;
30
29
 
31
30
  if (trigger?.type !== 'submit') {
@@ -38,8 +37,8 @@ export default function(action: Action) {
38
37
  this.dispatchEvent(
39
38
  new SubmitEvent('submit', { cancelable: true, bubbles:true, submitter: trigger })
40
39
  );
41
- }}'
42
- onsubmit='${async function(this: HTMLFormElement, event: SubmitEvent) {
40
+ },
41
+ onsubmit: async function(this: HTMLFormElement, event: SubmitEvent) {
43
42
  // TODO: Figure out processing
44
43
  // - Could pass reactive value above and tie it to form layout handler
45
44
  event.preventDefault();
@@ -64,6 +63,6 @@ export default function(action: Action) {
64
63
 
65
64
  // TODO: replace with signal
66
65
  event?.submitter?.classList.remove('button--processing');
67
- }}'
68
- `;
66
+ }
67
+ };
69
68
  };
@@ -1,4 +1,4 @@
1
- import events from '@esportsplus/delegated-events';
1
+ // import events from '@esportsplus/delegated-events';
2
2
 
3
3
 
4
4
  let initialized = false,
@@ -7,17 +7,17 @@ let initialized = false,
7
7
 
8
8
  const onclick = (fn: VoidFunction) => {
9
9
  if (!initialized) {
10
- events.register(document.body, 'click', async () => {
11
- if (!queue.length) {
12
- return;
13
- }
10
+ // events.register(document.body, 'click', async () => {
11
+ // if (!queue.length) {
12
+ // return;
13
+ // }
14
14
 
15
- let items = queue.splice(0);
15
+ // let items = queue.splice(0);
16
16
 
17
- for (let i = 0, n = items.length; i < n; i++) {
18
- await items[i]();
19
- }
20
- });
17
+ // for (let i = 0, n = items.length; i < n; i++) {
18
+ // await items[i]();
19
+ // }
20
+ // });
21
21
  initialized = true;
22
22
  }
23
23
 
@@ -13,11 +13,11 @@ export default ({ fixed, style }: { fixed?: boolean, style?: string } = {}) => {
13
13
  });
14
14
 
15
15
  return {
16
- attributes: html`
17
- class='${() => {
16
+ attributes: {
17
+ class: () => {
18
18
  return '--scrollbar';
19
- }}'
20
- onscroll='${function(this: HTMLElement) {
19
+ },
20
+ onscroll: function(this: HTMLElement) {
21
21
  if (width === undefined) {
22
22
  width = this.offsetWidth - this.clientWidth;
23
23
 
@@ -28,8 +28,8 @@ export default ({ fixed, style }: { fixed?: boolean, style?: string } = {}) => {
28
28
 
29
29
  state.height = (this.clientHeight / this.scrollHeight) * 100;
30
30
  state.translate = (this.scrollTop / this.clientHeight) * 100;
31
- }}'
32
- `,
31
+ }
32
+ },
33
33
  html: html`
34
34
  <div
35
35
  class='scrollbar ${fixed ? 'scrollbar--fixed' : ''} ${() => state.height >= 100 ? 'scrollbar--hidden' : ''}'
@@ -18,7 +18,7 @@ export default (data: Data) => {
18
18
  });
19
19
 
20
20
  return html`
21
- <section class='site ${data?.class || ''}' ${a}>
21
+ <section class='site ${data?.class || ''}' ...${a}>
22
22
  ${data?.content || ''}
23
23
  ${h}
24
24
  </section>
@@ -1,5 +1,4 @@
1
1
  import { reactive } from '@esportsplus/reactivity';
2
- import { html } from '@esportsplus/template';
3
2
  import { root } from '~/components';
4
3
  import menu from './menu';
5
4
 
@@ -38,11 +37,11 @@ const onclick = (data: { active?: boolean, menu?: Parameters<typeof menu>[0], to
38
37
  }
39
38
 
40
39
  return {
41
- attributes: html`
42
- class='${() => {
40
+ attributes: {
41
+ class: () => {
43
42
  return `tooltip ${state.active ? '--active' : ''}`;
44
- }}'
45
- onclick='${function(this: HTMLElement, e: Event) {
43
+ },
44
+ onclick: function(this: HTMLElement, e: Event) {
46
45
  let active = true,
47
46
  node = e.target as Node | null;
48
47
 
@@ -64,8 +63,8 @@ const onclick = (data: { active?: boolean, menu?: Parameters<typeof menu>[0], to
64
63
  scheduled = false;
65
64
  });
66
65
  }
67
- }}'
68
- `,
66
+ }
67
+ },
69
68
  content,
70
69
  state
71
70
  };
@@ -78,17 +77,17 @@ const onhover = (active: boolean = false) => {
78
77
  });
79
78
 
80
79
  return {
81
- attributes: html`
82
- class='${() => {
80
+ attributes: {
81
+ class: () => {
83
82
  return `tooltip ${state.active ? '--active' : ''}`;
84
- }}'
85
- onmouseover='${() => {
83
+ },
84
+ onmouseover: () => {
86
85
  state.active = true;
87
- }}'
88
- onmouseout='${() => {
86
+ },
87
+ onmouseout: () => {
89
88
  state.active = false;
90
- }}'
91
- `,
89
+ }
90
+ },
92
91
  state
93
92
  };
94
93
  };
package/src/index.ts CHANGED
@@ -1,4 +1 @@
1
- import './types';
2
-
3
-
4
1
  export * from './components';
package/tsconfig.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
+ "declaration": true,
4
5
  "declarationDir": "build",
5
6
  "outDir": "build"
6
7
  },
7
8
  "exclude": ["node_modules"],
8
- "extends": "@esportsplus/webpack/tsconfig.base.json",
9
+ "extends": "./node_modules/@esportsplus/typescript/tsconfig.base.json",
9
10
  "include": ["src"]
10
- }
11
+ }
package/webpack.config.ts CHANGED
@@ -1,28 +1,33 @@
1
1
  import { config, entry } from '@esportsplus/webpack';
2
2
 
3
3
 
4
- export default () => config.web({
5
- contenthash: false,
6
- entry: {
7
- css: {
8
- components: {
9
- styles: entry.css('src/components/**/index.scss'),
10
- variables: entry.css('src/components/**/variables.scss')
11
- },
12
- fonts: {
13
- montserrat: entry.css('storage/fonts/montserrat/index.css')
14
- },
15
- normalizer: entry.css('modern-normalize/modern-normalize.css'),
16
- utilities: {
17
- styles: entry.css('src/css-utilities/**/index.scss'),
18
- variables: entry.css('src/css-utilities/**/variables.scss')
4
+ export default (env: { production?: boolean | string }) => {
5
+ let production = env.production !== 'false';
6
+
7
+ return config.web({
8
+ cache: false,
9
+ contenthash: false,
10
+ entry: {
11
+ css: {
12
+ components: {
13
+ styles: entry.css('src/components/**/index.scss'),
14
+ variables: entry.css('src/components/**/variables.scss')
15
+ },
16
+ fonts: {
17
+ montserrat: entry.css('storage/fonts/montserrat/index.css')
18
+ },
19
+ normalizer: entry.css('modern-normalize/modern-normalize.css'),
20
+ utilities: {
21
+ styles: entry.css('src/css-utilities/**/index.scss'),
22
+ variables: entry.css('src/css-utilities/**/variables.scss')
23
+ }
19
24
  }
25
+ },
26
+ mode: production ? 'production': 'development',
27
+ // Temporary output until css root directory can be set through
28
+ // package.json or similar ( like 'main' key )
29
+ output: {
30
+ path: '.'
20
31
  }
21
- },
22
- mode: 'production',
23
- // Temporary output until css root directory can be set
24
- // through package.json or similar ( like 'main' key )
25
- output: {
26
- path: '.'
27
- }
28
- });
32
+ });
33
+ };
package/src/types.ts DELETED
@@ -1,5 +0,0 @@
1
- declare module '*.jpg';
2
- declare module '*.json';
3
- declare module '*.png';
4
- declare module '*.svg';
5
- declare module '*.txt';