lupine.components 1.1.13 → 1.1.14

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 (92) hide show
  1. package/README.md +3 -3
  2. package/package.json +42 -42
  3. package/src/components/action-sheet.tsx +419 -419
  4. package/src/components/button-push-animation.tsx +147 -138
  5. package/src/components/button.tsx +55 -55
  6. package/src/components/desktop-footer.tsx +17 -17
  7. package/src/components/desktop-header.tsx +52 -52
  8. package/src/components/drag-refresh.tsx +129 -129
  9. package/src/components/editable-label.tsx +83 -83
  10. package/src/components/float-window.tsx +233 -233
  11. package/src/components/grid.tsx +18 -18
  12. package/src/components/html-load.tsx +41 -41
  13. package/src/components/html-var.tsx +81 -81
  14. package/src/components/index.ts +43 -44
  15. package/src/components/input-with-title.tsx +24 -24
  16. package/src/components/link-item.tsx +13 -13
  17. package/src/components/link-list.tsx +62 -62
  18. package/src/components/menu-bar.tsx +219 -219
  19. package/src/components/menu-item-props.tsx +13 -13
  20. package/src/components/menu-sidebar.tsx +325 -318
  21. package/src/components/message-box.tsx +44 -44
  22. package/src/components/meta-data.tsx +36 -36
  23. package/src/components/meta-description.tsx +12 -12
  24. package/src/components/mobile-components/icon-menu-item-props.ts +6 -6
  25. package/src/components/mobile-components/index.ts +8 -9
  26. package/src/components/mobile-components/mobile-footer-menu.tsx +95 -95
  27. package/src/components/mobile-components/mobile-header-component.tsx +101 -101
  28. package/src/components/mobile-components/mobile-header-title-icon.tsx +109 -101
  29. package/src/components/mobile-components/mobile-header-with-back.tsx +127 -117
  30. package/src/components/mobile-components/mobile-side-menu.tsx +154 -154
  31. package/src/components/mobile-components/mobile-top-sys-icon.tsx +18 -18
  32. package/src/components/mobile-components/mobile-top-sys-menu.tsx +62 -62
  33. package/src/components/modal.tsx +33 -33
  34. package/src/components/notice-message.tsx +118 -118
  35. package/src/components/page-title.tsx +6 -6
  36. package/src/components/paging-link.tsx +175 -175
  37. package/src/components/panel.tsx +21 -21
  38. package/src/components/popup-menu.tsx +289 -289
  39. package/src/components/progress.tsx +91 -91
  40. package/src/components/radio-label-component.tsx +36 -36
  41. package/src/components/redirect.tsx +19 -19
  42. package/src/components/resizable-splitter.tsx +128 -128
  43. package/src/components/select-angle-component.tsx +127 -127
  44. package/src/components/select-with-title.tsx +37 -37
  45. package/src/components/slide-tab-component.tsx +144 -149
  46. package/src/components/spinner.tsx +106 -100
  47. package/src/components/stars-component.tsx +66 -66
  48. package/src/components/svg.tsx +24 -24
  49. package/src/components/tabs.tsx +279 -279
  50. package/src/components/text-glow.tsx +37 -37
  51. package/src/components/text-scale.tsx +42 -42
  52. package/src/components/text-wave.tsx +55 -55
  53. package/src/components/theme-selector.tsx +28 -28
  54. package/src/components/toggle-base.tsx +269 -269
  55. package/src/components/toggle-switch.tsx +160 -160
  56. package/src/frames/index.ts +3 -3
  57. package/src/frames/responsive-frame.tsx +83 -83
  58. package/src/frames/slider-frame.tsx +111 -111
  59. package/src/frames/top-frame.tsx +30 -30
  60. package/src/index.ts +5 -5
  61. package/src/lib/back-action-helper.ts +54 -54
  62. package/src/lib/base62.ts +23 -23
  63. package/src/lib/blob-utils.ts +23 -23
  64. package/src/lib/calculate-text-width.ts +13 -13
  65. package/src/lib/date-utils.ts +317 -317
  66. package/src/lib/deep-merge.ts +37 -37
  67. package/src/lib/document-ready.ts +34 -34
  68. package/src/lib/dom-utils.ts +32 -32
  69. package/src/lib/download-file.ts +118 -118
  70. package/src/lib/download-link.ts +12 -12
  71. package/src/lib/download-stream.ts +19 -19
  72. package/src/lib/drag-util.ts +118 -118
  73. package/src/lib/dynamical-load.ts +134 -134
  74. package/src/lib/encode-html.ts +27 -27
  75. package/src/lib/find-parent-tag.ts +8 -8
  76. package/src/lib/format-bytes.ts +11 -11
  77. package/src/lib/index.ts +24 -24
  78. package/src/lib/lite-dom.ts +225 -225
  79. package/src/lib/message-hub.ts +103 -104
  80. package/src/lib/observable.ts +188 -188
  81. package/src/lib/path-utils.ts +42 -42
  82. package/src/lib/promise-timeout.ts +1 -1
  83. package/src/lib/simple-storage.ts +40 -40
  84. package/src/lib/stop-propagation.ts +7 -7
  85. package/src/lib/upload-file.ts +101 -101
  86. package/src/styles/base-themes.ts +17 -17
  87. package/src/styles/dark-themes.ts +99 -99
  88. package/src/styles/index.ts +5 -5
  89. package/src/styles/light-themes.ts +106 -106
  90. package/src/styles/media-query.ts +93 -93
  91. package/src/styles/shared-themes.ts +57 -57
  92. package/tsconfig.json +113 -113
@@ -1,81 +1,81 @@
1
- import { RefProps, VNode } from 'lupine.web';
2
-
3
- export type HtmlVarValueProps = string | VNode<any> | (() => Promise<VNode<any>>);
4
- export type HtmlVarResult = { value: HtmlVarValueProps; ref: RefProps; node: VNode<any> };
5
- export class HtmlVar implements HtmlVarResult {
6
- private _value: HtmlVarValueProps;
7
- private _dirty = false;
8
- private _ref: RefProps;
9
- private resolve!: () => void;
10
- private promise: Promise<void>;
11
-
12
- constructor(initial?: HtmlVarValueProps) {
13
- this.promise = new Promise<void>((res) => {
14
- this.resolve = res;
15
- });
16
-
17
- this._value = initial || '';
18
- this._ref = {
19
- onLoad: async (el: Element) => {
20
- // in case new resolve is created while updating
21
- const res = this.resolve;
22
- if (this._dirty) {
23
- await this.update();
24
- }
25
- res();
26
- },
27
- };
28
- }
29
-
30
- private async update(): Promise<void> {
31
- const v = typeof this._value === 'function' ? await this._value() : this._value;
32
- await this._ref.mountInnerComponent!(v);
33
- this._dirty = false;
34
- this._value = '';
35
- }
36
-
37
- // need to wait before use ref.current
38
- async waitUpdate() {
39
- await this.promise;
40
- }
41
-
42
- set value(value: HtmlVarValueProps) {
43
- this._value = value;
44
- if (this._dirty) {
45
- return;
46
- }
47
-
48
- this._dirty = true;
49
- if (!this._ref.current) {
50
- return;
51
- }
52
- this.promise = new Promise<void>(async (res) => {
53
- this.resolve = res;
54
- await this.update();
55
- this.resolve();
56
- });
57
- }
58
-
59
- get value(): HtmlVarValueProps {
60
- return this._ref.current ? this._ref.current.innerHTML : this._value;
61
- }
62
-
63
- get ref(): RefProps {
64
- return this._ref;
65
- }
66
-
67
- get node(): VNode<any> {
68
- // if value is a function, it will be loaded later in onLoad
69
- const delayLoad = typeof this._value === 'function';
70
- this._dirty = delayLoad ? true : false;
71
- // the Fragment Tag will be present in the html if ref is assigned
72
- return {
73
- type: 'Fragment',
74
- props: {
75
- ref: this._ref,
76
- children: delayLoad ? '' : this._value,
77
- },
78
- html: [],
79
- };
80
- }
81
- }
1
+ import { RefProps, VNode } from 'lupine.web';
2
+
3
+ export type HtmlVarValueProps = string | VNode<any> | (() => Promise<VNode<any>>);
4
+ export type HtmlVarResult = { value: HtmlVarValueProps; ref: RefProps; node: VNode<any> };
5
+ export class HtmlVar implements HtmlVarResult {
6
+ private _value: HtmlVarValueProps;
7
+ private _dirty = false;
8
+ private _ref: RefProps;
9
+ private resolve!: () => void;
10
+ private promise: Promise<void>;
11
+
12
+ constructor(initial?: HtmlVarValueProps) {
13
+ this.promise = new Promise<void>((res) => {
14
+ this.resolve = res;
15
+ });
16
+
17
+ this._value = initial || '';
18
+ this._ref = {
19
+ onLoad: async (el: Element) => {
20
+ // in case new resolve is created while updating
21
+ const res = this.resolve;
22
+ if (this._dirty) {
23
+ await this.update();
24
+ }
25
+ res();
26
+ },
27
+ };
28
+ }
29
+
30
+ private async update(): Promise<void> {
31
+ const v = typeof this._value === 'function' ? await this._value() : this._value;
32
+ await this._ref.mountInnerComponent!(v);
33
+ this._dirty = false;
34
+ this._value = '';
35
+ }
36
+
37
+ // need to wait before use ref.current
38
+ async waitUpdate() {
39
+ await this.promise;
40
+ }
41
+
42
+ set value(value: HtmlVarValueProps) {
43
+ this._value = value;
44
+ if (this._dirty) {
45
+ return;
46
+ }
47
+
48
+ this._dirty = true;
49
+ if (!this._ref.current) {
50
+ return;
51
+ }
52
+ this.promise = new Promise<void>(async (res) => {
53
+ this.resolve = res;
54
+ await this.update();
55
+ this.resolve();
56
+ });
57
+ }
58
+
59
+ get value(): HtmlVarValueProps {
60
+ return this._ref.current ? this._ref.current.innerHTML : this._value;
61
+ }
62
+
63
+ get ref(): RefProps {
64
+ return this._ref;
65
+ }
66
+
67
+ get node(): VNode<any> {
68
+ // if value is a function, it will be loaded later in onLoad
69
+ const delayLoad = typeof this._value === 'function';
70
+ this._dirty = delayLoad ? true : false;
71
+ // the Fragment Tag will be present in the html if ref is assigned
72
+ return {
73
+ type: 'Fragment',
74
+ props: {
75
+ ref: this._ref,
76
+ children: delayLoad ? '' : this._value,
77
+ },
78
+ html: [],
79
+ };
80
+ }
81
+ }
@@ -1,44 +1,43 @@
1
-
2
- export * from './action-sheet';
3
- export * from './button-push-animation';
4
- export * from './button';
5
- export * from './drag-refresh';
6
- export * from './editable-label';
7
- export * from './float-window';
8
- export * from './grid';
9
- export * from './html-load';
10
- export * from './html-var';
11
- export * from './input-with-title';
12
- export * from './link-item';
13
- export * from './link-list';
14
- export * from './menu-bar';
15
- export * from './menu-item-props';
16
- export * from './menu-sidebar';
17
- export * from './message-box';
18
- export * from './meta-data';
19
- export * from './meta-description';
20
- export * from './modal';
21
- export * from './notice-message';
22
- export * from './page-title';
23
- export * from './paging-link';
24
- export * from './panel';
25
- export * from './popup-menu';
26
- export * from './progress';
27
- export * from './radio-label-component';
28
- export * from './redirect';
29
- export * from './resizable-splitter';
30
- export * from './select-angle-component';
31
- export * from './select-with-title';
32
- export * from './slide-tab-component';
33
- export * from './spinner';
34
- export * from './stars-component';
35
- export * from './svg';
36
- export * from './tabs';
37
- export * from './text-glow';
38
- export * from './text-scale';
39
- export * from './text-wave';
40
- export * from './theme-selector';
41
- export * from './toggle-base';
42
- export * from './toggle-switch';
43
-
44
- export * from './mobile-components';
1
+ export * from './action-sheet';
2
+ export * from './button-push-animation';
3
+ export * from './button';
4
+ export * from './drag-refresh';
5
+ export * from './editable-label';
6
+ export * from './float-window';
7
+ export * from './grid';
8
+ export * from './html-load';
9
+ export * from './html-var';
10
+ export * from './input-with-title';
11
+ export * from './link-item';
12
+ export * from './link-list';
13
+ export * from './menu-bar';
14
+ export * from './menu-item-props';
15
+ export * from './menu-sidebar';
16
+ export * from './message-box';
17
+ export * from './meta-data';
18
+ export * from './meta-description';
19
+ export * from './modal';
20
+ export * from './notice-message';
21
+ export * from './page-title';
22
+ export * from './paging-link';
23
+ export * from './panel';
24
+ export * from './popup-menu';
25
+ export * from './progress';
26
+ export * from './radio-label-component';
27
+ export * from './redirect';
28
+ export * from './resizable-splitter';
29
+ export * from './select-angle-component';
30
+ export * from './select-with-title';
31
+ export * from './slide-tab-component';
32
+ export * from './spinner';
33
+ export * from './stars-component';
34
+ export * from './svg';
35
+ export * from './tabs';
36
+ export * from './text-glow';
37
+ export * from './text-scale';
38
+ export * from './text-wave';
39
+ export * from './theme-selector';
40
+ export * from './toggle-base';
41
+ export * from './toggle-switch';
42
+
43
+ export * from './mobile-components';
@@ -1,24 +1,24 @@
1
- // used in MessageBox.show
2
- export const InputWithTitle = (
3
- title: string,
4
- defaultValue: string,
5
- onInputChanged?: (option: string) => void,
6
- onInputInputed?: (option: string) => void,
7
- className = 'input-base',
8
- width = '100%',
9
- ) => {
10
- return (
11
- <div>
12
- <div style={{ paddingBottom: '4px' }}>{title}</div>
13
- <div>
14
- <input
15
- class={className}
16
- style={{ width }}
17
- onChange={(e: any) => onInputChanged?.(e?.target?.value)}
18
- onInput={(e: any) => onInputInputed?.(e?.target?.value)}
19
- value={defaultValue}
20
- />
21
- </div>
22
- </div>
23
- );
24
- };
1
+ // used in MessageBox.show
2
+ export const InputWithTitle = (
3
+ title: string,
4
+ defaultValue: string,
5
+ onInputChanged?: (option: string) => void,
6
+ onInputInputed?: (option: string) => void,
7
+ className = 'input-base',
8
+ width = '100%'
9
+ ) => {
10
+ return (
11
+ <div>
12
+ <div style={{ paddingBottom: '4px' }}>{title}</div>
13
+ <div>
14
+ <input
15
+ class={className}
16
+ style={{ width }}
17
+ onChange={(e: any) => onInputChanged?.(e?.target?.value)}
18
+ onInput={(e: any) => onInputInputed?.(e?.target?.value)}
19
+ value={defaultValue}
20
+ />
21
+ </div>
22
+ </div>
23
+ );
24
+ };
@@ -1,13 +1,13 @@
1
- export type LinkItemProps = {
2
- className?: string;
3
- text: string;
4
- url: string;
5
- alt?: string;
6
- };
7
- export const LinkItem = (props: LinkItemProps) => {
8
- return (
9
- <a class={['link-item', props.className].join(' ')} href={props.url} alt={props.alt || props.text}>
10
- {props.text}
11
- </a>
12
- );
13
- };
1
+ export type LinkItemProps = {
2
+ className?: string;
3
+ text: string;
4
+ url: string;
5
+ alt?: string;
6
+ };
7
+ export const LinkItem = (props: LinkItemProps) => {
8
+ return (
9
+ <a class={['link-item', props.className].join(' ')} href={props.url} alt={props.alt || props.text}>
10
+ {props.text}
11
+ </a>
12
+ );
13
+ };
@@ -1,62 +1,62 @@
1
- import { LinkItem } from './link-item';
2
- import { NestMenuItemProps } from './menu-item-props';
3
-
4
- export type LinkListProps = {
5
- title: string;
6
- items: NestMenuItemProps[];
7
- className?: string;
8
- textColor?: string;
9
- backgroundColor?: string;
10
- titleBackgroundColor?: string;
11
- };
12
- export const LinkList = ({
13
- title,
14
- items,
15
- className,
16
- textColor = 'black',
17
- backgroundColor = '#d3d3d3',
18
- titleBackgroundColor = '#b6b6b6',
19
- }: LinkListProps) => {
20
- const css: any = {
21
- width: '100%',
22
- margin: 'auto',
23
- height: 'auto',
24
- backgroundColor,
25
- '.link-list-title, .link-list-top': {
26
- display: 'flex',
27
- width: '100%',
28
- flexWrap: 'wrap',
29
- padding: '0 16px',
30
- },
31
- '.link-list-title': {
32
- backgroundColor: titleBackgroundColor,
33
- },
34
- '.link-list-item': {
35
- display: 'inline-block',
36
- color: textColor,
37
- padding: '8px 16px 8px 0',
38
- textDecoration: 'none',
39
- },
40
- '.link-list-item:last-child': {
41
- paddingRight: 'unset',
42
- },
43
- '.link-list-title .link-list-item': {
44
- fontSize: '18px',
45
- },
46
- };
47
-
48
- return (
49
- <div css={css} class={['link-list-box', className].join(' ')}>
50
- {title && (
51
- <div class='link-list-title'>
52
- <div class='link-list-item'>{title}</div>
53
- </div>
54
- )}
55
- <div class='link-list-top'>
56
- {items.map((item) => {
57
- return <LinkItem className='link-list-item' url={item.url} alt={item.alt} text={item.text} />;
58
- })}
59
- </div>
60
- </div>
61
- );
62
- };
1
+ import { LinkItem } from './link-item';
2
+ import { NestMenuItemProps } from './menu-item-props';
3
+
4
+ export type LinkListProps = {
5
+ title: string;
6
+ items: NestMenuItemProps[];
7
+ className?: string;
8
+ textColor?: string;
9
+ backgroundColor?: string;
10
+ titleBackgroundColor?: string;
11
+ };
12
+ export const LinkList = ({
13
+ title,
14
+ items,
15
+ className,
16
+ textColor = 'black',
17
+ backgroundColor = '#d3d3d3',
18
+ titleBackgroundColor = '#b6b6b6',
19
+ }: LinkListProps) => {
20
+ const css: any = {
21
+ width: '100%',
22
+ margin: 'auto',
23
+ height: 'auto',
24
+ backgroundColor,
25
+ '.link-list-title, .link-list-top': {
26
+ display: 'flex',
27
+ width: '100%',
28
+ flexWrap: 'wrap',
29
+ padding: '0 16px',
30
+ },
31
+ '.link-list-title': {
32
+ backgroundColor: titleBackgroundColor,
33
+ },
34
+ '.link-list-item': {
35
+ display: 'inline-block',
36
+ color: textColor,
37
+ padding: '8px 16px 8px 0',
38
+ textDecoration: 'none',
39
+ },
40
+ '.link-list-item:last-child': {
41
+ paddingRight: 'unset',
42
+ },
43
+ '.link-list-title .link-list-item': {
44
+ fontSize: '18px',
45
+ },
46
+ };
47
+
48
+ return (
49
+ <div css={css} class={['link-list-box', className].join(' ')}>
50
+ {title && (
51
+ <div class='link-list-title'>
52
+ <div class='link-list-item'>{title}</div>
53
+ </div>
54
+ )}
55
+ <div class='link-list-top'>
56
+ {items.map((item) => {
57
+ return <LinkItem className='link-list-item' url={item.url} alt={item.alt} text={item.text} />;
58
+ })}
59
+ </div>
60
+ </div>
61
+ );
62
+ };