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,101 +1,109 @@
1
- /*
2
- MobileHeaderTitleIcon can be used in MobileHeaderComponent's Center part.
3
- It has it's own Left and Right icons.
4
- */
5
- import { VNode, CssProps, HtmlVar, backActionHelper } from 'lupine.components';
6
-
7
- export const MobileHeadeIconHeight = '40px';
8
- export const MobileHeadeBackIcon = ({ onClick }: { onClick: (event: Event) => void }) => {
9
- return (
10
- <i
11
- class={'ifc-icon mg-arrow_back_ios_new_outlined mhti-back-icon'}
12
- data-back-action={backActionHelper.genBackActionId()}
13
- onClick={(event) => onClick(event)}
14
- ></i>
15
- );
16
- };
17
-
18
- export const MobileHeadeCloseIcon = ({ onClick }: { onClick: (event: Event) => void }) => {
19
- return <i class='ifc-icon ma-close mhti-close-icon' onClick={(event) => onClick(event)}></i>;
20
- };
21
-
22
- export const MobileHeaderEmptyIcon = () => {
23
- return <div class='mhti-empty-icon' style={{ width: '28px' }}></div>;
24
- };
25
-
26
- export interface MobileHeaderTitleIconProps {
27
- title: VNode<any> | string | HtmlVar;
28
- onBack?: (event: Event) => void;
29
- left?: VNode<any> | HtmlVar;
30
- right?: VNode<any> | HtmlVar;
31
- background?: string;
32
- color?: string;
33
- noShadow?: boolean;
34
- }
35
- // there may have a few MobileHeaderTitleIcon for different pages
36
- export const MobileHeaderTitleIcon = ({ title, onBack, left, right, background, color, noShadow }: MobileHeaderTitleIconProps) => {
37
- // const processBack = (event: Event) => {
38
- // if (onBack) {
39
- // onBack(event);
40
- // }
41
- // };
42
- // left = left || <MobileHeadeBackIcon onClick={processBack} />;
43
- // right = right || <MobileHeadeCloseIcon onClick={processBack} />;
44
- const css: CssProps = {
45
- display: 'flex',
46
- flexDirection: 'row',
47
- width: '100vw',
48
- padding: '6px 0',
49
- // backgroundColor: 'var(--activatable-bg-color-normal)',
50
- // boxShadow: 'var(--mobile-header-shadow)',
51
- color: color || 'var(--primary-color)',
52
- background: background || 'var(--activatable-bg-color-normal)',
53
- boxShadow: noShadow ? 'unset' : 'var(--mobile-header-shadow)',
54
- zIndex: 'var(--layer-inside)', // bring boxShadow to front
55
- '.mhti-title': {
56
- display: 'flex',
57
- fontSize: '1.3rem',
58
- flex: '1',
59
- color: 'var(--activatable-text-color-normal)',
60
- overflow: 'hidden',
61
- textOverflow: 'ellipsis',
62
- whiteSpace: 'nowrap',
63
- alignItems: 'center',
64
- justifyContent: 'center',
65
- },
66
- '.mhti-title > *': {
67
- display: 'flex',
68
- width: '100%',
69
- alignItems: 'center',
70
- justifyContent: 'center',
71
- },
72
- '.mhti-left, .mhti-right': {
73
- height: MobileHeadeIconHeight,
74
- display: 'flex',
75
- alignItems: 'center',
76
- justifyContent: 'center',
77
- cursor: 'pointer',
78
- fontSize: '16px',
79
- },
80
- '.mhti-left': {
81
- paddingLeft: '8px',
82
- },
83
- '.mhti-right': {
84
- paddingRight: '8px',
85
- },
86
- '.mhti-left i, .mhti-right i': {
87
- fontSize: '28px',
88
- },
89
- };
90
-
91
- const domLeft = left instanceof HtmlVar ? left : new HtmlVar(left);
92
- const domCenter = title instanceof HtmlVar ? title : new HtmlVar(title);
93
- const domRight = right instanceof HtmlVar ? right : new HtmlVar(right);
94
- return (
95
- <div css={css} class='mobile-header-title-icon-top'>
96
- <div class='mhti-left'>{domLeft.node}</div>
97
- <div class='mhti-title'>{domCenter.node}</div>
98
- <div class='mhti-right'>{domRight.node}</div>
99
- </div>
100
- );
101
- };
1
+ /*
2
+ MobileHeaderTitleIcon can be used in MobileHeaderComponent's Center part.
3
+ It has it's own Left and Right icons.
4
+ */
5
+ import { VNode, CssProps, HtmlVar, backActionHelper } from 'lupine.components';
6
+
7
+ export const MobileHeadeIconHeight = '40px';
8
+ export const MobileHeadeBackIcon = ({ onClick }: { onClick: (event: Event) => void }) => {
9
+ return (
10
+ <i
11
+ class={'ifc-icon mg-arrow_back_ios_new_outlined mhti-back-icon'}
12
+ data-back-action={backActionHelper.genBackActionId()}
13
+ onClick={(event) => onClick(event)}
14
+ ></i>
15
+ );
16
+ };
17
+
18
+ export const MobileHeadeCloseIcon = ({ onClick }: { onClick: (event: Event) => void }) => {
19
+ return <i class='ifc-icon ma-close mhti-close-icon' onClick={(event) => onClick(event)}></i>;
20
+ };
21
+
22
+ export const MobileHeaderEmptyIcon = () => {
23
+ return <div class='mhti-empty-icon' style={{ width: '28px' }}></div>;
24
+ };
25
+
26
+ export interface MobileHeaderTitleIconProps {
27
+ title: VNode<any> | string | HtmlVar;
28
+ onBack?: (event: Event) => void;
29
+ left?: VNode<any> | HtmlVar;
30
+ right?: VNode<any> | HtmlVar;
31
+ background?: string;
32
+ color?: string;
33
+ noShadow?: boolean;
34
+ }
35
+ // there may have a few MobileHeaderTitleIcon for different pages
36
+ export const MobileHeaderTitleIcon = ({
37
+ title,
38
+ onBack,
39
+ left,
40
+ right,
41
+ background,
42
+ color,
43
+ noShadow,
44
+ }: MobileHeaderTitleIconProps) => {
45
+ // const processBack = (event: Event) => {
46
+ // if (onBack) {
47
+ // onBack(event);
48
+ // }
49
+ // };
50
+ // left = left || <MobileHeadeBackIcon onClick={processBack} />;
51
+ // right = right || <MobileHeadeCloseIcon onClick={processBack} />;
52
+ const css: CssProps = {
53
+ display: 'flex',
54
+ flexDirection: 'row',
55
+ width: '100vw',
56
+ padding: '6px 0',
57
+ // backgroundColor: 'var(--activatable-bg-color-normal)',
58
+ // boxShadow: 'var(--mobile-header-shadow)',
59
+ color: color || 'var(--primary-color)',
60
+ background: background || 'var(--activatable-bg-color-normal)',
61
+ boxShadow: noShadow ? 'unset' : 'var(--mobile-header-shadow)',
62
+ zIndex: 'var(--layer-inside)', // bring boxShadow to front
63
+ '.mhti-title': {
64
+ display: 'flex',
65
+ fontSize: '1.3rem',
66
+ flex: '1',
67
+ color: 'var(--activatable-text-color-normal)',
68
+ overflow: 'hidden',
69
+ textOverflow: 'ellipsis',
70
+ whiteSpace: 'nowrap',
71
+ alignItems: 'center',
72
+ justifyContent: 'center',
73
+ },
74
+ '.mhti-title > *': {
75
+ display: 'flex',
76
+ width: '100%',
77
+ alignItems: 'center',
78
+ justifyContent: 'center',
79
+ },
80
+ '.mhti-left, .mhti-right': {
81
+ height: MobileHeadeIconHeight,
82
+ display: 'flex',
83
+ alignItems: 'center',
84
+ justifyContent: 'center',
85
+ cursor: 'pointer',
86
+ fontSize: '16px',
87
+ },
88
+ '.mhti-left': {
89
+ paddingLeft: '8px',
90
+ },
91
+ '.mhti-right': {
92
+ paddingRight: '8px',
93
+ },
94
+ '.mhti-left i, .mhti-right i': {
95
+ fontSize: '28px',
96
+ },
97
+ };
98
+
99
+ const domLeft = left instanceof HtmlVar ? left : new HtmlVar(left);
100
+ const domCenter = title instanceof HtmlVar ? title : new HtmlVar(title);
101
+ const domRight = right instanceof HtmlVar ? right : new HtmlVar(right);
102
+ return (
103
+ <div css={css} class='mobile-header-title-icon-top'>
104
+ <div class='mhti-left'>{domLeft.node}</div>
105
+ <div class='mhti-title'>{domCenter.node}</div>
106
+ <div class='mhti-right'>{domRight.node}</div>
107
+ </div>
108
+ );
109
+ };
@@ -1,117 +1,127 @@
1
- /*
2
- HeaderWithBackFrame is a full page frame with header for mobile sliders.
3
- It has Back icon at Left and Close icon at Right.
4
- */
5
- import { VNode, CssProps, RefProps, HtmlVar, backActionHelper } from 'lupine.components';
6
- import { MobileHeaderTitleIcon } from './mobile-header-title-icon';
7
-
8
- export const HeaderWithBackFrameHeight = '40px';
9
- export const HeaderWithBackFrameLeft = ({ onClick }: { onClick: (event: Event) => void }) => {
10
- return (
11
- <i
12
- class='ifc-icon mg-arrow_back_ios_new_outlined header-back-left-icon'
13
- data-back-action={backActionHelper.genBackActionId()}
14
- onClick={(event) => onClick(event)}
15
- ></i>
16
- );
17
- };
18
-
19
- export const HeaderWithBackFrameRight = ({ onClick }: { onClick: (event: Event) => void }) => {
20
- return <i class='ifc-icon ma-close header-back-right-icon' onClick={(event) => onClick(event)}></i>;
21
- };
22
-
23
- export const HeaderWithBackFrameEmpty = () => {
24
- return <div class='header-back-top-empty'></div>;
25
- };
26
-
27
- // there may have a few HeaderWithBackFrame one over another at the same time
28
- export const HeaderWithBackFrame = ({
29
- children,
30
- title,
31
- onBack,
32
- left,
33
- right,
34
- noHeader = false,
35
- background,
36
- color,
37
- noShadow,
38
- contentColor,
39
- contentBackground,
40
- }: {
41
- children: VNode<any>;
42
- title: VNode<any> | string | HtmlVar;
43
- onBack: (event: Event) => void;
44
- left?: VNode<any> | HtmlVar;
45
- right?: VNode<any> | HtmlVar;
46
- noHeader?: boolean;
47
- color?: string;
48
- background?: string;
49
- noShadow?: boolean;
50
- contentColor?: string;
51
- contentBackground?: string;
52
- }) => {
53
- left = left || <HeaderWithBackFrameLeft onClick={onBack} />;
54
- right = right || <HeaderWithBackFrameRight onClick={onBack} />;
55
- const css: CssProps = {
56
- display: 'flex',
57
- flexDirection: 'column',
58
- width: '100%',
59
- height: '100%',
60
- minHeight: '100%',
61
- background: background || 'var(--activatable-bg-color-normal)',
62
- '.header-back-top': {
63
- display: 'flex',
64
- flexDirection: 'row',
65
- width: '100vw',
66
- padding: '6px 0',
67
- backgroundColor: 'var(--activatable-bg-color-normal)',
68
- boxShadow: 'var(--mobile-header-shadow)',
69
- },
70
- '.header-back-content': {
71
- display: 'flex',
72
- flex: '1',
73
- flexDirection: 'column',
74
- overflowY: 'auto',
75
- scrollbarWidth: 'none',
76
- position: 'relative',
77
- color: contentColor || 'var(--primary-color)',
78
- background: contentBackground || 'var(--activatable-bg-color-normal)',
79
- '&::-webkit-scrollbar': {
80
- display: 'none',
81
- // height: '0',
82
- },
83
- },
84
- '.header-back-title': {
85
- fontSize: '15px',
86
- flex: '1',
87
- color: 'var(--activatable-text-color-normal)',
88
- overflow: 'hidden',
89
- textOverflow: 'ellipsis',
90
- whiteSpace: 'nowrap',
91
- },
92
- '.header-back-left, .header-back-right': {
93
- // width: HeaderWithBackFrameHeight,
94
- height: HeaderWithBackFrameHeight,
95
- display: 'flex',
96
- alignItems: 'center',
97
- justifyContent: 'center',
98
- cursor: 'pointer',
99
- fontSize: '16px',
100
- padding: '0 8px',
101
- },
102
- '.header-back-left i, .header-back-right i': {
103
- fontSize: '28px',
104
- },
105
- };
106
-
107
- const domLeft = left instanceof HtmlVar ? left : new HtmlVar(left);
108
- const domCenter = title instanceof HtmlVar ? title : new HtmlVar(title);
109
- const domRight = right instanceof HtmlVar ? right : new HtmlVar(right);
110
- const ref: RefProps = {};
111
- return (
112
- <div ref={ref} css={css} class='header-back-frame'>
113
- {!noHeader && <MobileHeaderTitleIcon onBack={onBack} left={domLeft} title={domCenter} right={domRight} background={background} color={color} noShadow={noShadow} />}
114
- <div class='header-back-content'>{children}</div>
115
- </div>
116
- );
117
- };
1
+ /*
2
+ HeaderWithBackFrame is a full page frame with header for mobile sliders.
3
+ It has Back icon at Left and Close icon at Right.
4
+ */
5
+ import { VNode, CssProps, RefProps, HtmlVar, backActionHelper } from 'lupine.components';
6
+ import { MobileHeaderTitleIcon } from './mobile-header-title-icon';
7
+
8
+ export const HeaderWithBackFrameHeight = '40px';
9
+ export const HeaderWithBackFrameLeft = ({ onClick }: { onClick: (event: Event) => void }) => {
10
+ return (
11
+ <i
12
+ class='ifc-icon mg-arrow_back_ios_new_outlined header-back-left-icon'
13
+ data-back-action={backActionHelper.genBackActionId()}
14
+ onClick={(event) => onClick(event)}
15
+ ></i>
16
+ );
17
+ };
18
+
19
+ export const HeaderWithBackFrameRight = ({ onClick }: { onClick: (event: Event) => void }) => {
20
+ return <i class='ifc-icon ma-close header-back-right-icon' onClick={(event) => onClick(event)}></i>;
21
+ };
22
+
23
+ export const HeaderWithBackFrameEmpty = () => {
24
+ return <div class='header-back-top-empty'></div>;
25
+ };
26
+
27
+ // there may have a few HeaderWithBackFrame one over another at the same time
28
+ export const HeaderWithBackFrame = ({
29
+ children,
30
+ title,
31
+ onBack,
32
+ left,
33
+ right,
34
+ noHeader = false,
35
+ background,
36
+ color,
37
+ noShadow,
38
+ contentColor,
39
+ contentBackground,
40
+ }: {
41
+ children: VNode<any>;
42
+ title: VNode<any> | string | HtmlVar;
43
+ onBack: (event: Event) => void;
44
+ left?: VNode<any> | HtmlVar;
45
+ right?: VNode<any> | HtmlVar;
46
+ noHeader?: boolean;
47
+ color?: string;
48
+ background?: string;
49
+ noShadow?: boolean;
50
+ contentColor?: string;
51
+ contentBackground?: string;
52
+ }) => {
53
+ left = left || <HeaderWithBackFrameLeft onClick={onBack} />;
54
+ right = right || <HeaderWithBackFrameRight onClick={onBack} />;
55
+ const css: CssProps = {
56
+ display: 'flex',
57
+ flexDirection: 'column',
58
+ width: '100%',
59
+ height: '100%',
60
+ minHeight: '100%',
61
+ background: background || 'var(--activatable-bg-color-normal)',
62
+ '.header-back-top': {
63
+ display: 'flex',
64
+ flexDirection: 'row',
65
+ width: '100vw',
66
+ padding: '6px 0',
67
+ backgroundColor: 'var(--activatable-bg-color-normal)',
68
+ boxShadow: 'var(--mobile-header-shadow)',
69
+ },
70
+ '.header-back-content': {
71
+ display: 'flex',
72
+ flex: '1',
73
+ flexDirection: 'column',
74
+ overflowY: 'auto',
75
+ scrollbarWidth: 'none',
76
+ position: 'relative',
77
+ color: contentColor || 'var(--primary-color)',
78
+ background: contentBackground || 'var(--activatable-bg-color-normal)',
79
+ '&::-webkit-scrollbar': {
80
+ display: 'none',
81
+ // height: '0',
82
+ },
83
+ },
84
+ '.header-back-title': {
85
+ fontSize: '15px',
86
+ flex: '1',
87
+ color: 'var(--activatable-text-color-normal)',
88
+ overflow: 'hidden',
89
+ textOverflow: 'ellipsis',
90
+ whiteSpace: 'nowrap',
91
+ },
92
+ '.header-back-left, .header-back-right': {
93
+ // width: HeaderWithBackFrameHeight,
94
+ height: HeaderWithBackFrameHeight,
95
+ display: 'flex',
96
+ alignItems: 'center',
97
+ justifyContent: 'center',
98
+ cursor: 'pointer',
99
+ fontSize: '16px',
100
+ padding: '0 8px',
101
+ },
102
+ '.header-back-left i, .header-back-right i': {
103
+ fontSize: '28px',
104
+ },
105
+ };
106
+
107
+ const domLeft = left instanceof HtmlVar ? left : new HtmlVar(left);
108
+ const domCenter = title instanceof HtmlVar ? title : new HtmlVar(title);
109
+ const domRight = right instanceof HtmlVar ? right : new HtmlVar(right);
110
+ const ref: RefProps = {};
111
+ return (
112
+ <div ref={ref} css={css} class='header-back-frame'>
113
+ {!noHeader && (
114
+ <MobileHeaderTitleIcon
115
+ onBack={onBack}
116
+ left={domLeft}
117
+ title={domCenter}
118
+ right={domRight}
119
+ background={background}
120
+ color={color}
121
+ noShadow={noShadow}
122
+ />
123
+ )}
124
+ <div class='header-back-content'>{children}</div>
125
+ </div>
126
+ );
127
+ };