godown 1.1.0 → 1.1.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 (90) hide show
  1. package/conf.d.ts +1 -1
  2. package/conf.d.ts.map +1 -1
  3. package/deps.d.ts +4 -4
  4. package/deps.js +4 -4
  5. package/effect/ov-effect.d.ts +3 -3
  6. package/effect/ro-effect.js +6 -6
  7. package/effect/tw-effect.js +6 -6
  8. package/group/avatar-group.d.ts +3 -3
  9. package/group/avatar-group.d.ts.map +1 -1
  10. package/group/avatar-group.js +12 -23
  11. package/input-form/base-input.d.ts +2 -2
  12. package/input-form/base-input.d.ts.map +1 -1
  13. package/input-form/base-input.js +13 -13
  14. package/input-form/exp-input.d.ts +3 -3
  15. package/input-form/exp-input.d.ts.map +1 -1
  16. package/input-form/exp-input.js +5 -4
  17. package/input-form/label-input.d.ts +3 -3
  18. package/input-form/label-input.d.ts.map +1 -1
  19. package/input-form/label-input.js +5 -5
  20. package/input-form/search-input.d.ts.map +1 -1
  21. package/input-form/search-input.js +23 -18
  22. package/input-form/select-input.js +1 -1
  23. package/input-form/split-input.d.ts.map +1 -1
  24. package/input-form/split-input.js +5 -2
  25. package/input-form/std.js +1 -1
  26. package/input-form/switch-input.d.ts +1 -1
  27. package/input-form/switch-input.d.ts.map +1 -1
  28. package/input-form/switch-input.js +12 -15
  29. package/items/alert-item.js +1 -1
  30. package/items/avatar-anchor.d.ts +1 -1
  31. package/items/avatar-anchor.d.ts.map +1 -1
  32. package/items/avatar-anchor.js +8 -7
  33. package/items/dialog-item.js +8 -8
  34. package/items/link-a.d.ts +1 -1
  35. package/items/link-a.js +1 -1
  36. package/items/load-track.d.ts +1 -1
  37. package/items/load-track.js +1 -1
  38. package/items/super-a.d.ts +2 -2
  39. package/items/super-a.d.ts.map +1 -1
  40. package/items/super-a.js +3 -1
  41. package/layout/div-line.d.ts +2 -2
  42. package/layout/div-line.js +3 -3
  43. package/layout/drag-box.d.ts +2 -2
  44. package/layout/drag-box.js +13 -13
  45. package/layout/nav-aside.d.ts +2 -2
  46. package/layout/nav-aside.js +3 -3
  47. package/layout/nav-layout.d.ts +2 -2
  48. package/layout/nav-layout.js +6 -6
  49. package/layout/std.js +1 -1
  50. package/package.json +3 -3
  51. package/react/effect.js +7 -7
  52. package/react/group.js +5 -5
  53. package/react/input-form.js +14 -14
  54. package/react/items.js +9 -9
  55. package/react/layout.js +7 -7
  56. package/react/view.js +7 -7
  57. package/view/details-expand.js +1 -1
  58. package/view/down-drop.d.ts +2 -2
  59. package/view/down-drop.js +7 -7
  60. package/view/menu-list.d.ts +0 -1
  61. package/view/menu-list.d.ts.map +1 -1
  62. package/view/menu-list.js +12 -11
  63. package/view/react/effect.d.ts +10 -0
  64. package/view/react/effect.d.ts.map +1 -0
  65. package/view/react/effect.js +32 -0
  66. package/view/react/group.d.ts +5 -0
  67. package/view/react/group.d.ts.map +1 -0
  68. package/view/react/group.js +18 -0
  69. package/view/react/index.d.ts +7 -0
  70. package/view/react/index.d.ts.map +1 -0
  71. package/view/react/index.js +6 -0
  72. package/view/react/input-form.d.ts +33 -0
  73. package/view/react/input-form.d.ts.map +1 -0
  74. package/view/react/input-form.js +64 -0
  75. package/view/react/items.d.ts +9 -0
  76. package/view/react/items.d.ts.map +1 -0
  77. package/view/react/items.js +38 -0
  78. package/view/react/layout.d.ts +7 -0
  79. package/view/react/layout.d.ts.map +1 -0
  80. package/view/react/layout.js +28 -0
  81. package/view/react/view.d.ts +7 -0
  82. package/view/react/view.d.ts.map +1 -0
  83. package/view/react/view.js +28 -0
  84. package/view/route-view.d.ts +4 -4
  85. package/view/route-view.js +1 -1
  86. package/view/scroll-x.d.ts.map +1 -1
  87. package/view/scroll-x.js +18 -9
  88. package/with.d.ts +7 -2
  89. package/with.d.ts.map +1 -1
  90. package/with.js +6 -6
package/view/scroll-x.js CHANGED
@@ -8,26 +8,35 @@ import { css, define, html } from "../deps.js";
8
8
  import STD from "./std.js";
9
9
  let ScrollX = class ScrollX extends STD {
10
10
  get _section() {
11
- return this.shadowRoot.querySelector('section');
11
+ return this.shadowRoot.querySelector("section");
12
12
  }
13
13
  render() {
14
14
  return html `<section><main><span><slot></slot></span></main></section>`;
15
15
  }
16
16
  firstUpdated() {
17
- this._section.addEventListener('scroll', (e) => {
18
- this.dispatchEvent(new CustomEvent('scroll', { detail: e.target.scrollTop }));
17
+ this._section.addEventListener("scroll", (e) => {
18
+ this.dispatchEvent(new CustomEvent("scroll", { detail: e.target.scrollTop }));
19
19
  });
20
20
  this.resize();
21
- window.addEventListener('resize', () => {
21
+ window.addEventListener("resize", () => {
22
22
  this.resize();
23
23
  });
24
24
  }
25
25
  resize() {
26
- var _a;
27
- if (!this.style.height)
28
- this.style.height = `${((_a = this.querySelector('*')) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0}px`;
29
- this._section.style.width = getComputedStyle(this).height;
30
- this._section.style.height = getComputedStyle(this).width;
26
+ const child = this.firstElementChild;
27
+ if (!child)
28
+ return;
29
+ const ClientHeight = child.clientHeight || 0;
30
+ if (ClientHeight) {
31
+ this._section.style.width = ClientHeight + "px";
32
+ this._section.style.height = getComputedStyle(this).width;
33
+ }
34
+ else {
35
+ const ComputedHeight = getComputedStyle(child).height;
36
+ this.style.height = ComputedHeight;
37
+ this._section.style.width = ComputedHeight;
38
+ this._section.style.height = getComputedStyle(this).width;
39
+ }
31
40
  }
32
41
  };
33
42
  ScrollX.styles = css `
package/with.d.ts CHANGED
@@ -4,7 +4,7 @@ export declare const define: (name: string, options?: ElementDefinitionOptions)
4
4
  * @param target Appended target element or use document.querySelector(target) or document.body
5
5
  * @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
6
6
  */
7
- export declare const append: (target: string | object, args: {
7
+ export declare const append: (target?: string | object, args?: string | {
8
8
  tag: any;
9
9
  props?: any;
10
10
  children?: any;
@@ -14,7 +14,12 @@ export declare const append: (target: string | object, args: {
14
14
  * Create element from args
15
15
  * @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
16
16
  */
17
- export declare const create: (args: any) => any;
17
+ export declare const create: (args?: string | {
18
+ tag: any;
19
+ props?: any;
20
+ children?: any;
21
+ html?: any;
22
+ }) => any;
18
23
  /**
19
24
  * Create element with args append to target
20
25
  * @param map Map of key:selector, value:args
package/with.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../src/with.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,SAAU,MAAM,YAAY,wBAAwB,mBAAmB,wBAAwB,SAOjH,CAAC;AACF;;;;EAIE;AACF,eAAO,MAAM,MAAM,WAAY,MAAM,GAAG,MAAM,QAAQ;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;CAAE,SAK3G,CAAC;AACF;;;EAGE;AACF,eAAO,MAAM,MAAM,oBAqBlB,CAAC;AACF;;;EAGE;AACF,eAAO,MAAM,KAAK,oBAuBjB,CAAC"}
1
+ {"version":3,"file":"with.d.ts","sourceRoot":"","sources":["../src/with.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,MAAM,SAAU,MAAM,YAAY,wBAAwB,mBAAmB,wBAAwB,SAOjH,CAAC;AACF;;;;EAIE;AACF,eAAO,MAAM,MAAM,YAAY,MAAM,GAAG,MAAM,SAAiB,MAAM,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;CAAE,SAK7H,CAAC;AACF;;;EAGE;AACF,eAAO,MAAM,MAAM,UAAU,MAAM,GAAG;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,KAAK,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;CAAE,QAqB3F,CAAC;AACF;;;EAGE;AACF,eAAO,MAAM,KAAK,oBAuBjB,CAAC"}
package/with.js CHANGED
@@ -13,10 +13,10 @@ export const define = (name, options) => (constructor) => {
13
13
  * @param target Appended target element or use document.querySelector(target) or document.body
14
14
  * @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
15
15
  */
16
- export const append = (target, args) => {
16
+ export const append = (target = "body", args = "div") => {
17
17
  if (!args)
18
18
  return;
19
- target = (typeof target === 'string' ? document.querySelector(target) : target) || document.body;
19
+ target = (typeof target === "string" ? document.querySelector(target) : target) || document.body;
20
20
  const element = create(args);
21
21
  target.appendChild(element);
22
22
  };
@@ -24,14 +24,14 @@ export const append = (target, args) => {
24
24
  * Create element from args
25
25
  * @param args tag:tag name, props:attribute, children:appended chindren, html:innerHTML
26
26
  */
27
- export const create = (args) => {
28
- const tag = (typeof args === 'string' ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
27
+ export const create = (args = "div") => {
28
+ const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
29
29
  const { props, children, html } = args || {};
30
30
  const element = document.createElement(tag);
31
31
  if (props) {
32
32
  Object.keys(props).forEach((prop) => {
33
33
  // element[prop] = props[prop];
34
- element.setAttribute(prop, props[prop] === true ? '' : props[prop]);
34
+ element.setAttribute(prop, props[prop] === true ? "" : props[prop]);
35
35
  });
36
36
  }
37
37
  ;
@@ -59,7 +59,7 @@ export const retag = (map) => {
59
59
  for (let [key, args] of map) {
60
60
  for (let i = document.querySelectorAll(key).length - 1; i >= 0; i--) {
61
61
  const element = document.querySelectorAll(key)[i];
62
- const tag = (typeof args === 'string' ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
62
+ const tag = (typeof args === "string" ? args : args === null || args === void 0 ? void 0 : args.tag) || "div";
63
63
  let props = args.props || {};
64
64
  const { children, html = "" } = args;
65
65
  [...element.attributes].reduce((acc, attr) => {