lupine.api 1.1.57 → 1.1.59

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 (137) hide show
  1. package/README.md +3 -3
  2. package/admin/admin-about.tsx +12 -16
  3. package/admin/admin-config.tsx +47 -44
  4. package/admin/admin-css.tsx +3 -3
  5. package/admin/admin-db.tsx +75 -75
  6. package/admin/admin-frame-helper.tsx +364 -364
  7. package/admin/admin-frame.tsx +164 -164
  8. package/admin/admin-index.tsx +65 -65
  9. package/admin/admin-login.tsx +111 -111
  10. package/admin/admin-menu-edit.tsx +637 -637
  11. package/admin/admin-menu-list.tsx +87 -87
  12. package/admin/admin-page-edit.tsx +564 -564
  13. package/admin/admin-page-list.tsx +83 -83
  14. package/admin/admin-performance.tsx +28 -28
  15. package/admin/admin-release.tsx +427 -404
  16. package/admin/admin-resources.tsx +382 -382
  17. package/admin/admin-shell.tsx +89 -89
  18. package/admin/admin-table-data.tsx +146 -146
  19. package/admin/admin-table-list.tsx +230 -230
  20. package/admin/admin-test-animations.tsx +395 -395
  21. package/admin/admin-test-component.tsx +823 -808
  22. package/admin/admin-test-edit.tsx +319 -319
  23. package/admin/admin-test-themes.tsx +56 -56
  24. package/admin/admin-tokens.tsx +338 -338
  25. package/admin/design/admin-design.tsx +174 -174
  26. package/admin/design/block-grid.tsx +36 -36
  27. package/admin/design/block-grid1.tsx +21 -21
  28. package/admin/design/block-paragraph.tsx +19 -19
  29. package/admin/design/block-title.tsx +19 -19
  30. package/admin/design/design-block-box.tsx +140 -140
  31. package/admin/design/drag-data.tsx +24 -24
  32. package/admin/index.ts +9 -9
  33. package/admin/package.json +15 -15
  34. package/admin/tsconfig.json +127 -127
  35. package/dev/copy-folder.js +32 -32
  36. package/dev/cp-index-html.js +69 -69
  37. package/dev/file-utils.js +12 -12
  38. package/dev/index.js +18 -19
  39. package/dev/package.json +12 -12
  40. package/dev/plugin-ifelse.js +168 -168
  41. package/dev/plugin-ifelse.test.js +37 -37
  42. package/dev/run-cmd.js +14 -14
  43. package/dev/send-request.js +12 -12
  44. package/package.json +55 -55
  45. package/src/admin-api/admin-api-helper.ts +210 -205
  46. package/src/admin-api/admin-api.ts +65 -65
  47. package/src/admin-api/admin-auth.ts +152 -146
  48. package/src/admin-api/admin-config.ts +94 -84
  49. package/src/admin-api/admin-csv.ts +94 -94
  50. package/src/admin-api/admin-db.ts +269 -269
  51. package/src/admin-api/admin-menu.ts +135 -135
  52. package/src/admin-api/admin-page.ts +135 -135
  53. package/src/admin-api/admin-performance.ts +128 -128
  54. package/src/admin-api/admin-release.ts +703 -700
  55. package/src/admin-api/admin-resources.ts +318 -318
  56. package/src/admin-api/admin-token-helper.ts +82 -79
  57. package/src/admin-api/admin-tokens.ts +90 -90
  58. package/src/admin-api/index.ts +2 -2
  59. package/src/admin-api/web-config-api.ts +19 -19
  60. package/src/api/api-cache.ts +103 -103
  61. package/src/api/api-helper.ts +44 -44
  62. package/src/api/api-module.ts +67 -60
  63. package/src/api/api-router.ts +177 -177
  64. package/src/api/api-shared-storage.ts +64 -64
  65. package/src/api/async-storage.ts +5 -5
  66. package/src/api/debug-service.ts +56 -56
  67. package/src/api/encode-html.ts +27 -27
  68. package/src/api/handle-status.ts +75 -75
  69. package/src/api/index.ts +15 -16
  70. package/src/api/mini-web-socket.ts +270 -270
  71. package/src/api/server-content-type.ts +82 -82
  72. package/src/api/server-render.ts +235 -215
  73. package/src/api/shell-service.ts +74 -74
  74. package/src/api/simple-storage.ts +80 -80
  75. package/src/api/static-server.ts +128 -125
  76. package/src/api/to-client-delivery.ts +26 -26
  77. package/src/app/app-cache.ts +55 -55
  78. package/src/app/app-helper.ts +62 -62
  79. package/src/app/app-message.ts +109 -109
  80. package/src/app/app-shared-storage.ts +363 -363
  81. package/src/app/app-start.ts +136 -136
  82. package/src/app/cleanup-exit.ts +16 -16
  83. package/src/app/host-to-path.ts +38 -38
  84. package/src/app/index.ts +11 -11
  85. package/src/app/process-dev-requests.ts +130 -130
  86. package/src/app/web-listener.ts +294 -294
  87. package/src/app/web-processor.ts +47 -42
  88. package/src/app/web-server.ts +100 -100
  89. package/src/common-js/web-env.js +104 -104
  90. package/src/index.ts +7 -7
  91. package/src/lang/api-lang-en.ts +26 -26
  92. package/src/lang/api-lang-zh-cn.ts +27 -27
  93. package/src/lang/index.ts +2 -2
  94. package/src/lang/lang-helper.ts +76 -76
  95. package/src/lang/lang-props.ts +6 -6
  96. package/src/lib/db/db-helper.ts +23 -23
  97. package/src/lib/db/db-mysql.ts +249 -250
  98. package/src/lib/db/db-sqlite.ts +101 -101
  99. package/src/lib/db/db.spec.ts +28 -28
  100. package/src/lib/db/db.ts +325 -325
  101. package/src/lib/db/index.ts +5 -5
  102. package/src/lib/index.ts +3 -3
  103. package/src/lib/logger.spec.ts +214 -214
  104. package/src/lib/logger.ts +281 -281
  105. package/src/lib/runtime-require.ts +37 -37
  106. package/src/lib/utils/cookie-util.ts +34 -34
  107. package/src/lib/utils/crypto.ts +58 -58
  108. package/src/lib/utils/date-utils.ts +317 -317
  109. package/src/lib/utils/deep-merge.ts +37 -37
  110. package/src/lib/utils/delay.ts +12 -12
  111. package/src/lib/utils/file-setting.ts +55 -55
  112. package/src/lib/utils/format-bytes.ts +11 -11
  113. package/src/lib/utils/fs-utils.ts +158 -158
  114. package/src/lib/utils/get-env.ts +27 -27
  115. package/src/lib/utils/index.ts +12 -12
  116. package/src/lib/utils/is-type.ts +48 -48
  117. package/src/lib/utils/load-env.ts +14 -14
  118. package/src/lib/utils/pad.ts +6 -6
  119. package/src/models/api-base.ts +5 -5
  120. package/src/models/api-module-props.ts +10 -11
  121. package/src/models/api-router-props.ts +26 -26
  122. package/src/models/app-cache-props.ts +33 -33
  123. package/src/models/app-data-props.ts +10 -10
  124. package/src/models/app-helper-props.ts +6 -6
  125. package/src/models/app-shared-storage-props.ts +38 -38
  126. package/src/models/app-start-props.ts +18 -18
  127. package/src/models/async-storage-props.ts +13 -13
  128. package/src/models/db-config.ts +30 -30
  129. package/src/models/host-to-path-props.ts +12 -12
  130. package/src/models/index.ts +16 -16
  131. package/src/models/json-object.ts +8 -8
  132. package/src/models/locals-props.ts +36 -36
  133. package/src/models/logger-props.ts +84 -84
  134. package/src/models/simple-storage-props.ts +13 -14
  135. package/src/models/to-client-delivery-props.ts +6 -6
  136. package/tsconfig.json +115 -115
  137. package/dev/plugin-gen-versions.js +0 -20
@@ -1,808 +1,823 @@
1
- import {
2
- RefProps,
3
- FloatWindow,
4
- NotificationMessage,
5
- notificationColorFromValue,
6
- PopupMenuWithButton,
7
- PopupMenuWithLabel,
8
- ToggleSwitch,
9
- ToggleSwitchSize,
10
- ModalWindow,
11
- MessageBox,
12
- MessageBoxButtonProps,
13
- NotificationColor,
14
- SelectWithTitle,
15
- InputWithTitle,
16
- Button,
17
- ButtonSize,
18
- ButtonHookProps,
19
- ActionSheetMessage,
20
- ActionSheetSelect,
21
- } from 'lupine.components';
22
-
23
- const TestWindows = () => {
24
- const doModal = (closeWhenClickOutside: boolean) => {
25
- ModalWindow.show({
26
- title: 'Save Menu',
27
- buttons: ['Ok', 'Cancel'],
28
- closeWhenClickOutside,
29
- contentMinWidth: '50%',
30
- handleClicked: (index: number, close: () => void) => {
31
- close();
32
- },
33
- children: <div>test Modal</div>,
34
- });
35
- };
36
-
37
- const list: string[] = ['Success', 'Info', 'Warning', 'Alert', '', 'Permanent'];
38
- const handleSelected = (value: string) => {
39
- const level = notificationColorFromValue(value);
40
- const permanent = value === 'Permanent';
41
- NotificationMessage.sendMessage('Selected: ' + value, level, permanent);
42
- };
43
-
44
- return (
45
- <div>
46
- <div class='row-box mb-s'>
47
- <button class='button-base mr-m mb-s' onClick={() => doModal(true)}>
48
- Modal (close click outside)
49
- </button>
50
- <button class='button-base mr-m mb-s' onClick={() => doModal(false)}>
51
- Test Modal
52
- </button>
53
- <button
54
- class='button-base mr-m mb-s'
55
- onClick={() =>
56
- FloatWindow.show({
57
- title: 'Title',
58
- buttons: ['OK'],
59
- handleClicked: (index: number, close) => {
60
- close();
61
- },
62
- children: <div>This is float window (modal).</div>,
63
- })
64
- }
65
- >
66
- Float Window
67
- </button>
68
- <button
69
- class='button-base mr-m mb-s'
70
- onClick={() =>
71
- FloatWindow.show({
72
- title: 'Title',
73
- buttons: ['OK'],
74
- handleClicked: (index: number, close) => {
75
- close();
76
- },
77
- children: <div>This is float window (no modal).</div>,
78
- noModal: true,
79
- })
80
- }
81
- >
82
- Float Window (no modal)
83
- </button>
84
- <button
85
- class='button-base mr-m mb-s'
86
- onClick={() =>
87
- MessageBox.show({
88
- title: 'Title',
89
- buttonType: MessageBoxButtonProps.YesNo,
90
- contentMinWidth: '200px',
91
- handleClicked: (index: number, close) => {
92
- close();
93
- },
94
- children: <div>YesNo dialog.</div>,
95
- })
96
- }
97
- >
98
- MessageBox
99
- </button>
100
-
101
- <button
102
- class='button-base mr-m mb-s'
103
- onClick={() => {
104
- const options = [
105
- { option: 'Option 1', value: '1' },
106
- { option: 'Option 2', value: '2', selected: true },
107
- { option: 'Option 3', value: '3' },
108
- ];
109
- const content = SelectWithTitle('Select an option', options, (option: string) => {
110
- NotificationMessage.sendMessage('You selected: ' + option, NotificationColor.Success);
111
- });
112
- MessageBox.show({
113
- title: 'Title',
114
- buttonType: MessageBoxButtonProps.OkCancel,
115
- contentMinWidth: '300px',
116
- handleClicked: (index: number, close) => {
117
- close();
118
- },
119
- children: content,
120
- });
121
- }}
122
- >
123
- Select an option (Select)
124
- </button>
125
-
126
- <button
127
- class='button-base mr-m mb-s'
128
- onClick={() => {
129
- const options = [
130
- { option: 'Option 1', value: '1' },
131
- { option: 'Option 2', value: '2' },
132
- { option: 'Option 3', value: '3', selected: true },
133
- ];
134
- const content = SelectWithTitle(
135
- 'Select an option',
136
- options,
137
- (option: string) => {
138
- NotificationMessage.sendMessage('You selected: ' + option, NotificationColor.Success);
139
- },
140
- 3
141
- );
142
- MessageBox.show({
143
- title: 'Title',
144
- buttonType: MessageBoxButtonProps.OkCancel,
145
- contentMinWidth: '300px',
146
- handleClicked: (index: number, close) => {
147
- close();
148
- },
149
- children: content,
150
- });
151
- }}
152
- >
153
- Select an option (List)
154
- </button>
155
-
156
- <button
157
- class='button-base mr-m mb-s'
158
- onClick={() => {
159
- const content = InputWithTitle('Enter a value', 'default value', (value: string) => {
160
- NotificationMessage.sendMessage('You entered: ' + value, NotificationColor.Success);
161
- });
162
- MessageBox.show({
163
- title: 'Title',
164
- buttonType: MessageBoxButtonProps.OkCancel,
165
- contentMinWidth: '300px',
166
- handleClicked: (index: number, close) => {
167
- close();
168
- },
169
- children: content,
170
- });
171
- }}
172
- >
173
- Input a value
174
- </button>
175
-
176
- <button
177
- class='button-base mr-m mb-s'
178
- onClick={() => {
179
- ActionSheetSelect.show({
180
- title: 'Title',
181
- options: ['Option 1', 'Option 2', 'Option 3'],
182
- handleClicked: (index: number, close) => {
183
- NotificationMessage.sendMessage('You selected: ' + index, NotificationColor.Success);
184
- close();
185
- },
186
- });
187
- }}
188
- >
189
- ActionSheet Option
190
- </button>
191
-
192
- <button
193
- class='button-base mr-m mb-s'
194
- onClick={() => {
195
- ActionSheetMessage.show({
196
- title: 'Title',
197
- message: 'This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message.',
198
- });
199
- }}
200
- >
201
- ActionSheet Message
202
- </button>
203
- </div>
204
-
205
- <br />
206
- <div class='row-box mb-s h3 bold'>PopupMenu</div>
207
- <div class='row-box mb-s'>
208
- <PopupMenuWithButton
209
- label='Test PopupMenu'
210
- list={list}
211
- defaultValue={''}
212
- noUpdateLabel={true}
213
- handleSelected={handleSelected}
214
- ></PopupMenuWithButton>
215
- <PopupMenuWithLabel
216
- label='Test PopupMenu'
217
- list={list}
218
- defaultValue={''}
219
- noUpdateLabel={true}
220
- handleSelected={handleSelected}
221
- ></PopupMenuWithLabel>
222
- </div>
223
- </div>
224
- );
225
- };
226
-
227
- const TestColors = () => {
228
- return (
229
- <div class='w-100p mb-s'>
230
- <div class='row-box'>
231
- <div class='success-text mb-s w-50p'>Success color</div>
232
- <div class='success-bg mb-s w-50p'>Success background color</div>
233
- </div>
234
-
235
- <div class='row-box'>
236
- <div class='info-text mb-s w-50p'>Information color</div>
237
- <div class='info-bg mb-s w-50p'>Information background color</div>
238
- </div>
239
-
240
- <div class='row-box'>
241
- <div class='warning-text mb-s w-50p'>Warning color</div>
242
- <div class='warning-bg mb-s w-50p'>Warning background color</div>
243
- </div>
244
-
245
- <div class='row-box'>
246
- <div class='error-text mb-s w-50p'>Alert color</div>
247
- <div class='error-bg mb-s w-50p'>Alert background color</div>
248
- </div>
249
- <div class='row-box'>
250
- <button
251
- class='button-base mr-m'
252
- onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Success)}
253
- >
254
- Success
255
- </button>
256
- <button
257
- class='button-base mr-m'
258
- onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Info)}
259
- >
260
- Info
261
- </button>
262
- <button
263
- class='button-base mr-m'
264
- onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Warning)}
265
- >
266
- Warning
267
- </button>
268
- <button
269
- class='button-base mr-m'
270
- onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Error)}
271
- >
272
- Error
273
- </button>
274
- <button
275
- class='button-base mr-m'
276
- onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Error, true)}
277
- >
278
- Permanent
279
- </button>
280
- </div>
281
- </div>
282
- );
283
- };
284
-
285
- const TestTextFontSize = () => {
286
- return (
287
- <div>
288
- <div class='row-box mb-s h3 bold'>Class Text Sizes with bold</div>
289
- <div class='page-title bold mb-s'>page-title=h2, This is the page title</div>
290
- <div class='page-subtitle bold mb-s'>page-subtitle=h3-5, Subtitle</div>
291
- <div class='h3 bold mb-s'>h3 bold, Paragraph title</div>
292
- <div class='h3-5 bold mb-s'>h3-5 bold, Paragraph title</div>
293
- <div class='h4 bold mb-s'>h4 bold, Paragraph title</div>
294
- <div class='h4-5 bold mb-s'>h4-5 bold, Paragraph title</div>
295
- <div class='h5 bold mb-s'>h5 bold, Paragraph title</div>
296
- <div class='page-paragraph mb-s'>page-paragraph=h4, Paragraph</div>
297
- <div class='page-paragraph-s mb-s'>page-paragraph-s=h5, Smaller paragraph</div>
298
-
299
- <br />
300
- <div class='row-box mb-s h3 bold'>Tag Text Sizes</div>
301
-
302
- <div class='h1-l mb-s'>class h1-l, sample text</div>
303
- <h1 class='mb-s'>tag h1, sample text</h1>
304
- <div class='h1 mb-s'>class h1, sample text</div>
305
-
306
- <h2 class='mb-s'>tag h2, sample text</h2>
307
- <div class='h2 mb-s'>class h2, sample text</div>
308
-
309
- <h3 class='mb-s'>tag h3, sample text</h3>
310
- <div class='h3 mb-s'>class h3, sample text</div>
311
- <div class='h3-5 mb-s'>class h3-5, sample text</div>
312
-
313
- <h4 class='mb-s'>tag h4, sample text</h4>
314
- <div class='h4 mb-s'>class h4, sample text</div>
315
- <div class='h4-5 mb-s'>class h4-5, sample text</div>
316
-
317
- <h5 class='mb-s'>tag h5, sample text</h5>
318
- <div class='h5 mb-s'>class h5, sample text</div>
319
-
320
- <h6 class='mb-s'>tag h6, sample text</h6>
321
- <div class='h6 mb-s'>class h6, sample text</div>
322
- <div class='h6-s mb-s'>class h6-s, sample text</div>
323
- </div>
324
- );
325
- };
326
-
327
- const TestButtons = () => {
328
- const doModal = (closeWhenClickOutside: boolean) => {
329
- ModalWindow.show({
330
- title: 'Save Menu',
331
- buttons: ['Ok', 'Cancel'],
332
- closeWhenClickOutside,
333
- contentMinWidth: '50%',
334
- handleClicked: (index: number, close: () => void) => {
335
- close();
336
- },
337
- children: <div>test Modal</div>,
338
- });
339
- };
340
-
341
- const list: string[] = ['Success', 'Info', 'Warning', 'Alert', '', 'Permanent'];
342
- const handleSelected = (value: string) => {
343
- const level = notificationColorFromValue(value);
344
- const permanent = value === 'Permanent';
345
- NotificationMessage.sendMessage('Selected: ' + value, level, permanent);
346
- };
347
-
348
- // Basic HTML Buttons
349
- const basicButton1: RefProps = {};
350
- const basicButton2: RefProps = {};
351
- const onBasicButtonClick = () => {
352
- basicButton1.current.disabled = !basicButton1.current.disabled;
353
- basicButton2.current.disabled = !basicButton2.current.disabled;
354
- };
355
-
356
- // Lupine Button
357
- const buttonHook1: ButtonHookProps = {};
358
- const buttonHook2: ButtonHookProps = {};
359
- const onButtonClick = () => {
360
- buttonHook1.setEnabled?.(!buttonHook1.getEnabled?.());
361
- buttonHook2.setEnabled?.(!buttonHook2.getEnabled?.());
362
- };
363
- return (
364
- <div>
365
- <div class='row-box mb-s h3 bold'>Basic HTML Buttons</div>
366
- <div class='row-box mb-s'>
367
- <button class='button-base button-ss mr-m' disabled={true} onClick={onBasicButtonClick} ref={basicButton1}>
368
- Button
369
- </button>
370
- <button class='button-base button-s mr-m' disabled={true} onClick={onBasicButtonClick} ref={basicButton2}>
371
- Button
372
- </button>
373
- <button class='button-base button-m mr-m' onClick={onBasicButtonClick}>
374
- Button
375
- </button>
376
- <button class='button-base button-l mr-m' onClick={onBasicButtonClick}>
377
- Button
378
- </button>
379
- <button class='button-base button-ll mr-m' onClick={onBasicButtonClick}>
380
- Button
381
- </button>
382
- </div>
383
-
384
- <div class='row-box mb-s h3 bold'>Lupine Buttons</div>
385
- <div class='row-box mb-s'>
386
- <Button text='Test 1' size={ButtonSize.SmallLarge} disabled={true} class='mr-m' onClick={onButtonClick} hook={buttonHook1} />
387
- <Button text='Test 2' size={ButtonSize.Small} disabled={true} class='mr-m' hook={buttonHook2} onClick={onButtonClick} />
388
- <Button text='Click Me' size={ButtonSize.Medium} class='mr-m' css={{ color: 'red' }} onClick={onButtonClick} />
389
- <Button text='Button' size={ButtonSize.Large} class='mr-m' onClick={onButtonClick} />
390
- <Button text='Button' size={ButtonSize.LargeLarge} class='mr-m' onClick={onButtonClick} />
391
- </div>
392
- </div>
393
- );
394
- };
395
-
396
- const TestInputs = () => {
397
- return (
398
- <div>
399
- <div class='row-box mb-s h3 bold'>Basic Inputs</div>
400
- <div class='row-box mb-s'>
401
- <div class='pr-m'>Input Label:</div>
402
- <input type='text' class='input-base input-ss' placeholder='Placeholder' />
403
- <input type='text' class='input-base input-ss' value='Text value' />
404
- </div>
405
- <div class='row-box mb-s'>
406
- <div class='pr-m'>Input Label:</div>
407
- <input type='text' class='input-base input-s' placeholder='Placeholder' />
408
- <input type='text' class='input-base input-s' value='Text value' />
409
- </div>
410
- <div class='row-box mb-s'>
411
- <div class='pr-m'>Input Label:</div>
412
- <input type='text' class='input-base' placeholder='Placeholder' />
413
- <input type='text' class='input-base' value='Text value' />
414
- </div>
415
- <div class='row-box mb-s'>
416
- <div class='pr-m'>Input Label:</div>
417
- <input type='text' class='input-base input-l' placeholder='Placeholder' />
418
- <input type='text' class='input-base input-l' value='Text value' />
419
- </div>
420
- <div class='row-box mb-s'>
421
- <div class='pr-m'>Input Label:</div>
422
- <input type='text' class='input-base input-ll' placeholder='Placeholder' />
423
- <input type='text' class='input-base input-ll' value='Text value' />
424
- </div>
425
-
426
- <div class='row-box mb-s h3 bold'>Readonly / Disabled</div>
427
- <div class='row-box mb-s'>
428
- <div class='pr-m'>Readonly:</div>
429
- <input type='text' class='input-base' placeholder='Placeholder' readonly={true} />
430
- <input type='text' class='input-base' value='Text value' readonly={true} />
431
- </div>
432
- <div class='row-box mb-s'>
433
- <div class='pr-m'>Disabled:</div>
434
- <input type='text' class='input-base' placeholder='Placeholder' disabled={true} />
435
- <input type='text' class='input-base' value='Text value' disabled={true} />
436
- </div>
437
-
438
- <div class='row-box mb-s h3 bold'>Select</div>
439
- <div class='row-box mb-s'>
440
- <div class='pr-m'>Select:</div>
441
- <select id='menutarget' class='input-base' size={1}>
442
- <option value='0'>Parent Window</option>
443
- <option value='1'>New Window</option>
444
- </select>
445
- </div>
446
- <div class='row-box mb-s'>
447
- <div class='pr-m'>Disabled:</div>
448
- <select id='menutarget' class='input-base' size={1} disabled={true}>
449
- <option value='0'>Parent Window</option>
450
- <option value='1'>New Window</option>
451
- </select>
452
- </div>
453
-
454
- <div class='row-box mb-s h3 bold'>Radio</div>
455
- <div class='row-box mb-s'>
456
- <div class='pr-m'>Radio box:</div>
457
- <label class='input-label label-ss pr-m'>
458
- <input class='input-base input-ss' type='radio' name='itemtype-ss' />
459
- Text
460
- </label>
461
-
462
- <label class='input-label label-ss pr-m'>
463
- <input class='input-base input-ss' type='radio' name='itemtype-ss' checked />
464
- Checked
465
- </label>
466
-
467
- {/* checkbox and radio don't have readonly attribute */}
468
- <label class='input-label label-ss disabled pr-m'>
469
- <input class='input-base input-ss' type='radio' name='itemtype-ss_rc' disabled={true} />
470
- Disabled
471
- </label>
472
- <label class='input-label label-ss disabled pr-m'>
473
- <input class='input-base input-ss' type='radio' name='itemtype-ss_rc' checked disabled={true} />
474
- Disabled checked
475
- </label>
476
- </div>
477
-
478
- <div class='row-box mb-s'>
479
- <div class='pr-m'>Radio box:</div>
480
- <label class='input-label label-s pr-m'>
481
- <input class='input-base input-s' type='radio' name='itemtype-s' />
482
- Text
483
- </label>
484
-
485
- <label class='input-label label-s pr-m'>
486
- <input class='input-base input-s' type='radio' name='itemtype-s' checked />
487
- Checked
488
- </label>
489
-
490
- {/* checkbox and radio don't have readonly attribute */}
491
- <label class='input-label label-s disabled pr-m'>
492
- <input class='input-base input-s' type='radio' name='itemtype-s_rc' disabled={true} />
493
- Disabled
494
- </label>
495
- <label class='input-label label-s disabled pr-m'>
496
- <input class='input-base input-s' type='radio' name='itemtype-s_rc' checked disabled={true} />
497
- Disabled checked
498
- </label>
499
- </div>
500
-
501
- <div class='row-box mb-s'>
502
- <div class='pr-m'>Radio box:</div>
503
- <label class='input-label pr-m'>
504
- <input class='input-base' type='radio' name='itemtype' />
505
- Text
506
- </label>
507
-
508
- <label class='input-label pr-m'>
509
- <input class='input-base' type='radio' name='itemtype' checked />
510
- Checked
511
- </label>
512
-
513
- {/* checkbox and radio don't have readonly attribute */}
514
- <label class='input-label disabled pr-m'>
515
- <input class='input-base' type='radio' name='itemtype_rc' disabled={true} />
516
- Disabled
517
- </label>
518
- <label class='input-label disabled pr-m'>
519
- <input class='input-base' type='radio' name='itemtype_rc' checked disabled={true} />
520
- Disabled checked
521
- </label>
522
- </div>
523
-
524
- <div class='row-box mb-s'>
525
- <div class='pr-m'>Radio box:</div>
526
- <label class='input-label label-l pr-m'>
527
- <input class='input-base input-l' type='radio' name='itemtype-l' />
528
- Text
529
- </label>
530
-
531
- <label class='input-label label-l pr-m'>
532
- <input class='input-base input-l' type='radio' name='itemtype-l' checked />
533
- Checked
534
- </label>
535
-
536
- {/* checkbox and radio don't have readonly attribute */}
537
- <label class='input-label label-l disabled pr-m'>
538
- <input class='input-base input-l' type='radio' name='itemtype-l_rc' disabled={true} />
539
- Disabled
540
- </label>
541
- <label class='input-label label-l disabled pr-m'>
542
- <input class='input-base input-l' type='radio' name='itemtype-l_rc' checked disabled={true} />
543
- Disabled checked
544
- </label>
545
- </div>
546
-
547
- <div class='row-box mb-s'>
548
- <div class='pr-m'>Radio box:</div>
549
- <label class='input-label label-ll pr-m'>
550
- <input class='input-base input-ll' type='radio' name='itemtype-ll' />
551
- Text
552
- </label>
553
-
554
- <label class='input-label label-ll pr-m'>
555
- <input class='input-base input-ll' type='radio' name='itemtype-ll' checked />
556
- Checked
557
- </label>
558
-
559
- {/* checkbox and radio don't have readonly attribute */}
560
- <label class='input-label label-ll disabled pr-m'>
561
- <input class='input-base input-ll' type='radio' name='itemtype-ll_rc' disabled={true} />
562
- Disabled
563
- </label>
564
- <label class='input-label label-ll disabled pr-m'>
565
- <input class='input-base input-ll' type='radio' name='itemtype-ll_rc' checked disabled={true} />
566
- Disabled checked
567
- </label>
568
- </div>
569
-
570
- <div class='row-box mb-s h3 bold'>Checkbox</div>
571
- <div class='row-box mb-s'>
572
- <div class='pr-m'>Checkbox:</div>
573
- <label class='input-label label-ss pr-m'>
574
- <input class='input-base input-ss' type='checkbox' />
575
- Text
576
- </label>
577
-
578
- <label class='input-label label-ss pr-m'>
579
- <input class='input-base input-ss' type='checkbox' checked />
580
- Checked
581
- </label>
582
-
583
- {/* checkbox and radio don't have readonly attribute */}
584
- <label class='input-label label-ss disabled pr-m'>
585
- <input class='input-base input-ss' type='checkbox' disabled={true} />
586
- Disabled
587
- </label>
588
- <label class='input-label label-ss disabled pr-m'>
589
- <input class='input-base input-ss' type='checkbox' checked disabled={true} />
590
- Disabled checked
591
- </label>
592
- </div>
593
-
594
- <div class='row-box mb-s'>
595
- <div class='pr-m'>Checkbox:</div>
596
- <label class='input-label label-s pr-m'>
597
- <input class='input-base input-s' type='checkbox' />
598
- Text
599
- </label>
600
-
601
- <label class='input-label label-s pr-m'>
602
- <input class='input-base input-s' type='checkbox' checked />
603
- Checked
604
- </label>
605
-
606
- {/* checkbox and radio don't have readonly attribute */}
607
- <label class='input-label label-s disabled pr-m'>
608
- <input class='input-base input-s' type='checkbox' disabled={true} />
609
- Disabled
610
- </label>
611
- <label class='input-label label-s disabled pr-m'>
612
- <input class='input-base input-s' type='checkbox' checked disabled={true} />
613
- Disabled checked
614
- </label>
615
- </div>
616
-
617
- <div class='row-box mb-s'>
618
- <div class='pr-m'>Checkbox:</div>
619
- <label class='input-label pr-m'>
620
- <input class='input-base' type='checkbox' />
621
- Text
622
- </label>
623
-
624
- <label class='input-label pr-m'>
625
- <input class='input-base' type='checkbox' checked />
626
- Checked
627
- </label>
628
-
629
- {/* checkbox and radio don't have readonly attribute */}
630
- <label class='input-label disabled pr-m'>
631
- <input class='input-base' type='checkbox' disabled={true} />
632
- Disabled
633
- </label>
634
- <label class='input-label disabled pr-m'>
635
- <input class='input-base' type='checkbox' checked disabled={true} />
636
- Disabled checked
637
- </label>
638
- </div>
639
-
640
- <div class='row-box mb-s'>
641
- <div class='pr-m'>Checkbox:</div>
642
- <label class='input-label label-l pr-m'>
643
- <input class='input-base input-l' type='checkbox' />
644
- Text
645
- </label>
646
-
647
- <label class='input-label label-l pr-m'>
648
- <input class='input-base input-l' type='checkbox' checked />
649
- Checked
650
- </label>
651
-
652
- {/* checkbox and radio don't have readonly attribute */}
653
- <label class='input-label label-l disabled pr-m'>
654
- <input class='input-base input-l' type='checkbox' disabled={true} />
655
- Disabled
656
- </label>
657
- <label class='input-label label-l disabled pr-m'>
658
- <input class='input-base input-l' type='checkbox' checked disabled={true} />
659
- Disabled checked
660
- </label>
661
- </div>
662
-
663
- <div class='row-box mb-s'>
664
- <div class='pr-m'>Checkbox:</div>
665
- <label class='input-label label-ll pr-m'>
666
- <input class='input-base input-ll' type='checkbox' />
667
- Text
668
- </label>
669
-
670
- <label class='input-label label-ll pr-m'>
671
- <input class='input-base input-ll' type='checkbox' checked />
672
- Checked
673
- </label>
674
-
675
- {/* checkbox and radio don't have readonly attribute */}
676
- <label class='input-label label-ll disabled pr-m'>
677
- <input class='input-base input-ll' type='checkbox' disabled={true} />
678
- Disabled
679
- </label>
680
- <label class='input-label label-ll disabled pr-m'>
681
- <input class='input-base input-ll' type='checkbox' checked disabled={true} />
682
- Disabled checked
683
- </label>
684
- </div>
685
-
686
- <div class='row-box mb-s h3 bold'>Input field</div>
687
- <div class='row-box mb-s'>
688
- <div class='input-field w-100p'>
689
- <input class='input-base w-100p f-subject' type='text' required placeholder=' ' />
690
- <span>Subject *</span>
691
- </div>
692
- <div class='input-field w-100p'>
693
- <textarea class='input-base w-100p msg-area f-message' required placeholder=' '></textarea>
694
- <span>Message *</span>
695
- </div>
696
- </div>
697
-
698
- <div class='row-box mb-s h3 bold'>List</div>
699
- <div class='row-box mb-s'>
700
- <div class='row-box flex-1 mr-m'>
701
- <div class='list-box'>
702
- <select class='input-base w-100p h-100p list' id='menulist' size={8}>
703
- <option value='0 0 0 0 index.php?st_p1=&amp;st_p2=&amp;st_m1=home Web No Coding Home'>Home</option>
704
- <option>Help</option>
705
- <option disabled={true}>Beginners</option>
706
- <option>----for Beginners</option>
707
- <option>----Template</option>
708
- </select>
709
- </div>
710
- </div>
711
- <div class='row-box flex-1'>
712
- <div class='list-box'>
713
- <select class='input-base w-100p h-100p list' id='menulist' size={8} disabled={true}>
714
- <option value='0 0 0 0 index.php?st_p1=&amp;st_p2=&amp;st_m1=home Web No Coding Home'>Disabled</option>
715
- <option>Help</option>
716
- <option>Beginners</option>
717
- <option>----for Beginners</option>
718
- <option>----Template</option>
719
- </select>
720
- </div>
721
- </div>
722
- </div>
723
- </div>
724
- );
725
- };
726
-
727
- export const TestComponentPage = () => {
728
- return (
729
- <div>
730
- <div class='row-box mb-s'>
731
- <TestWindows />
732
- </div>
733
- <div class='row-box mb-s'>
734
- <TestColors />
735
- </div>
736
- <div class='row-box mb-s'>
737
- <TestTextFontSize />
738
- </div>
739
- <div class='row-box mb-s'>
740
- <TestButtons />
741
- </div>
742
- <div class='row-box mb-s'>
743
- <TestInputs />
744
- </div>
745
-
746
- <div class='row-box mb-s h3 bold'>Toggle Switch</div>
747
- <div class='row-box mb-s'>
748
- <ToggleSwitch checked={true} size={ToggleSwitchSize.SmallSmall} />
749
- <ToggleSwitch checked={false} size={ToggleSwitchSize.SmallSmall} />
750
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} />
751
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Small} />
752
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Medium} />
753
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Medium} />
754
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} />
755
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} />
756
- </div>
757
-
758
- <div class='row-box mb-s h3 bold'>Toggle Switch with text</div>
759
- <div class='row-box mb-s'>
760
- <ToggleSwitch
761
- checked={true}
762
- size={ToggleSwitchSize.SmallSmall}
763
- text={{ on: 'On', off: 'Off' }}
764
- textWidth='50px'
765
- />
766
- <ToggleSwitch
767
- checked={false}
768
- size={ToggleSwitchSize.SmallSmall}
769
- text={{ on: 'Enable', off: 'Disable' }}
770
- textWidth='50px'
771
- />
772
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} text={{ on: 'On', off: 'Off' }} textWidth='50px' />
773
- <ToggleSwitch
774
- checked={false}
775
- size={ToggleSwitchSize.Small}
776
- text={{ on: 'Enable', off: 'Disable' }}
777
- textWidth='50px'
778
- />
779
- <ToggleSwitch
780
- checked={true}
781
- size={ToggleSwitchSize.Medium}
782
- text={{ on: 'Set', off: 'Not Set' }}
783
- textWidth='60px'
784
- />
785
- <ToggleSwitch
786
- checked={false}
787
- size={ToggleSwitchSize.Medium}
788
- text={{ on: 'Show', off: 'Hide' }}
789
- textWidth='60px'
790
- />
791
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} text={{ on: 'Yes', off: 'No' }} />
792
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} text={{ on: 'Up', off: 'Down' }} />
793
- </div>
794
-
795
- <div class='row-box mb-s h3 bold'>Toggle Switch Disabled</div>
796
- <div class='row-box mb-s'>
797
- <ToggleSwitch checked={true} size={ToggleSwitchSize.SmallSmall} disabled={true} />
798
- <ToggleSwitch checked={false} size={ToggleSwitchSize.SmallSmall} disabled={true} />
799
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} disabled={true} />
800
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Small} disabled={true} />
801
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Medium} disabled={true} />
802
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Medium} disabled={true} />
803
- <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} disabled={true} />
804
- <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} disabled={true} />
805
- </div>
806
- </div>
807
- );
808
- };
1
+ import {
2
+ RefProps,
3
+ FloatWindow,
4
+ NotificationMessage,
5
+ notificationColorFromValue,
6
+ PopupMenuWithButton,
7
+ PopupMenuWithLabel,
8
+ ToggleSwitch,
9
+ ToggleSwitchSize,
10
+ ModalWindow,
11
+ MessageBox,
12
+ MessageBoxButtonProps,
13
+ NotificationColor,
14
+ SelectWithTitle,
15
+ InputWithTitle,
16
+ Button,
17
+ ButtonSize,
18
+ ButtonHookProps,
19
+ ActionSheetMessage,
20
+ ActionSheetSelect,
21
+ } from 'lupine.components';
22
+
23
+ const TestWindows = () => {
24
+ const doModal = (closeWhenClickOutside: boolean) => {
25
+ ModalWindow.show({
26
+ title: 'Save Menu',
27
+ buttons: ['Ok', 'Cancel'],
28
+ closeWhenClickOutside,
29
+ contentMinWidth: '50%',
30
+ handleClicked: (index: number, close: () => void) => {
31
+ close();
32
+ },
33
+ children: <div>test Modal</div>,
34
+ });
35
+ };
36
+
37
+ const list: string[] = ['Success', 'Info', 'Warning', 'Alert', '', 'Permanent'];
38
+ const handleSelected = (value: string) => {
39
+ const level = notificationColorFromValue(value);
40
+ const permanent = value === 'Permanent';
41
+ NotificationMessage.sendMessage('Selected: ' + value, level, permanent);
42
+ };
43
+
44
+ return (
45
+ <div>
46
+ <div class='row-box mb-s'>
47
+ <button class='button-base mr-m mb-s' onClick={() => doModal(true)}>
48
+ Modal (close click outside)
49
+ </button>
50
+ <button class='button-base mr-m mb-s' onClick={() => doModal(false)}>
51
+ Test Modal
52
+ </button>
53
+ <button
54
+ class='button-base mr-m mb-s'
55
+ onClick={() =>
56
+ FloatWindow.show({
57
+ title: 'Title',
58
+ buttons: ['OK'],
59
+ handleClicked: (index: number, close) => {
60
+ close();
61
+ },
62
+ children: <div>This is float window (modal).</div>,
63
+ })
64
+ }
65
+ >
66
+ Float Window
67
+ </button>
68
+ <button
69
+ class='button-base mr-m mb-s'
70
+ onClick={() =>
71
+ FloatWindow.show({
72
+ title: 'Title',
73
+ buttons: ['OK'],
74
+ handleClicked: (index: number, close) => {
75
+ close();
76
+ },
77
+ children: <div>This is float window (no modal).</div>,
78
+ noModal: true,
79
+ })
80
+ }
81
+ >
82
+ Float Window (no modal)
83
+ </button>
84
+ <button
85
+ class='button-base mr-m mb-s'
86
+ onClick={() =>
87
+ MessageBox.show({
88
+ title: 'Title',
89
+ buttonType: MessageBoxButtonProps.YesNo,
90
+ contentMinWidth: '200px',
91
+ handleClicked: (index: number, close) => {
92
+ close();
93
+ },
94
+ children: <div>YesNo dialog.</div>,
95
+ })
96
+ }
97
+ >
98
+ MessageBox
99
+ </button>
100
+
101
+ <button
102
+ class='button-base mr-m mb-s'
103
+ onClick={() => {
104
+ const options = [
105
+ { option: 'Option 1', value: '1' },
106
+ { option: 'Option 2', value: '2', selected: true },
107
+ { option: 'Option 3', value: '3' },
108
+ ];
109
+ const content = SelectWithTitle('Select an option', options, (option: string) => {
110
+ NotificationMessage.sendMessage('You selected: ' + option, NotificationColor.Success);
111
+ });
112
+ MessageBox.show({
113
+ title: 'Title',
114
+ buttonType: MessageBoxButtonProps.OkCancel,
115
+ contentMinWidth: '300px',
116
+ handleClicked: (index: number, close) => {
117
+ close();
118
+ },
119
+ children: content,
120
+ });
121
+ }}
122
+ >
123
+ Select an option (Select)
124
+ </button>
125
+
126
+ <button
127
+ class='button-base mr-m mb-s'
128
+ onClick={() => {
129
+ const options = [
130
+ { option: 'Option 1', value: '1' },
131
+ { option: 'Option 2', value: '2' },
132
+ { option: 'Option 3', value: '3', selected: true },
133
+ ];
134
+ const content = SelectWithTitle(
135
+ 'Select an option',
136
+ options,
137
+ (option: string) => {
138
+ NotificationMessage.sendMessage('You selected: ' + option, NotificationColor.Success);
139
+ },
140
+ 3
141
+ );
142
+ MessageBox.show({
143
+ title: 'Title',
144
+ buttonType: MessageBoxButtonProps.OkCancel,
145
+ contentMinWidth: '300px',
146
+ handleClicked: (index: number, close) => {
147
+ close();
148
+ },
149
+ children: content,
150
+ });
151
+ }}
152
+ >
153
+ Select an option (List)
154
+ </button>
155
+
156
+ <button
157
+ class='button-base mr-m mb-s'
158
+ onClick={() => {
159
+ const content = InputWithTitle('Enter a value', 'default value', (value: string) => {
160
+ NotificationMessage.sendMessage('You entered: ' + value, NotificationColor.Success);
161
+ });
162
+ MessageBox.show({
163
+ title: 'Title',
164
+ buttonType: MessageBoxButtonProps.OkCancel,
165
+ contentMinWidth: '300px',
166
+ handleClicked: (index: number, close) => {
167
+ close();
168
+ },
169
+ children: content,
170
+ });
171
+ }}
172
+ >
173
+ Input a value
174
+ </button>
175
+
176
+ <button
177
+ class='button-base mr-m mb-s'
178
+ onClick={() => {
179
+ ActionSheetSelect.show({
180
+ title: 'Title',
181
+ options: ['Option 1', 'Option 2', 'Option 3'],
182
+ handleClicked: (index: number, close) => {
183
+ NotificationMessage.sendMessage('You selected: ' + index, NotificationColor.Success);
184
+ close();
185
+ },
186
+ });
187
+ }}
188
+ >
189
+ ActionSheet Option
190
+ </button>
191
+
192
+ <button
193
+ class='button-base mr-m mb-s'
194
+ onClick={() => {
195
+ ActionSheetMessage.show({
196
+ title: 'Title',
197
+ message:
198
+ 'This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message. This is a long Message.',
199
+ });
200
+ }}
201
+ >
202
+ ActionSheet Message
203
+ </button>
204
+ </div>
205
+
206
+ <br />
207
+ <div class='row-box mb-s h3 bold'>PopupMenu</div>
208
+ <div class='row-box mb-s'>
209
+ <PopupMenuWithButton
210
+ label='Test PopupMenu'
211
+ list={list}
212
+ defaultValue={''}
213
+ noUpdateLabel={true}
214
+ handleSelected={handleSelected}
215
+ ></PopupMenuWithButton>
216
+ <PopupMenuWithLabel
217
+ label='Test PopupMenu'
218
+ list={list}
219
+ defaultValue={''}
220
+ noUpdateLabel={true}
221
+ handleSelected={handleSelected}
222
+ ></PopupMenuWithLabel>
223
+ </div>
224
+ </div>
225
+ );
226
+ };
227
+
228
+ const TestColors = () => {
229
+ return (
230
+ <div class='w-100p mb-s'>
231
+ <div class='row-box'>
232
+ <div class='success-text mb-s w-50p'>Success color</div>
233
+ <div class='success-bg mb-s w-50p'>Success background color</div>
234
+ </div>
235
+
236
+ <div class='row-box'>
237
+ <div class='info-text mb-s w-50p'>Information color</div>
238
+ <div class='info-bg mb-s w-50p'>Information background color</div>
239
+ </div>
240
+
241
+ <div class='row-box'>
242
+ <div class='warning-text mb-s w-50p'>Warning color</div>
243
+ <div class='warning-bg mb-s w-50p'>Warning background color</div>
244
+ </div>
245
+
246
+ <div class='row-box'>
247
+ <div class='error-text mb-s w-50p'>Alert color</div>
248
+ <div class='error-bg mb-s w-50p'>Alert background color</div>
249
+ </div>
250
+ <div class='row-box'>
251
+ <button
252
+ class='button-base mr-m'
253
+ onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Success)}
254
+ >
255
+ Success
256
+ </button>
257
+ <button
258
+ class='button-base mr-m'
259
+ onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Info)}
260
+ >
261
+ Info
262
+ </button>
263
+ <button
264
+ class='button-base mr-m'
265
+ onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Warning)}
266
+ >
267
+ Warning
268
+ </button>
269
+ <button
270
+ class='button-base mr-m'
271
+ onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Error)}
272
+ >
273
+ Error
274
+ </button>
275
+ <button
276
+ class='button-base mr-m'
277
+ onClick={() => NotificationMessage.sendMessage('Test Message.', NotificationColor.Error, true)}
278
+ >
279
+ Permanent
280
+ </button>
281
+ </div>
282
+ </div>
283
+ );
284
+ };
285
+
286
+ const TestTextFontSize = () => {
287
+ return (
288
+ <div>
289
+ <div class='row-box mb-s h3 bold'>Class Text Sizes with bold</div>
290
+ <div class='page-title bold mb-s'>page-title=h2, This is the page title</div>
291
+ <div class='page-subtitle bold mb-s'>page-subtitle=h3-5, Subtitle</div>
292
+ <div class='h3 bold mb-s'>h3 bold, Paragraph title</div>
293
+ <div class='h3-5 bold mb-s'>h3-5 bold, Paragraph title</div>
294
+ <div class='h4 bold mb-s'>h4 bold, Paragraph title</div>
295
+ <div class='h4-5 bold mb-s'>h4-5 bold, Paragraph title</div>
296
+ <div class='h5 bold mb-s'>h5 bold, Paragraph title</div>
297
+ <div class='page-paragraph mb-s'>page-paragraph=h4, Paragraph</div>
298
+ <div class='page-paragraph-s mb-s'>page-paragraph-s=h5, Smaller paragraph</div>
299
+
300
+ <br />
301
+ <div class='row-box mb-s h3 bold'>Tag Text Sizes</div>
302
+
303
+ <div class='h1-l mb-s'>class h1-l, sample text</div>
304
+ <h1 class='mb-s'>tag h1, sample text</h1>
305
+ <div class='h1 mb-s'>class h1, sample text</div>
306
+
307
+ <h2 class='mb-s'>tag h2, sample text</h2>
308
+ <div class='h2 mb-s'>class h2, sample text</div>
309
+
310
+ <h3 class='mb-s'>tag h3, sample text</h3>
311
+ <div class='h3 mb-s'>class h3, sample text</div>
312
+ <div class='h3-5 mb-s'>class h3-5, sample text</div>
313
+
314
+ <h4 class='mb-s'>tag h4, sample text</h4>
315
+ <div class='h4 mb-s'>class h4, sample text</div>
316
+ <div class='h4-5 mb-s'>class h4-5, sample text</div>
317
+
318
+ <h5 class='mb-s'>tag h5, sample text</h5>
319
+ <div class='h5 mb-s'>class h5, sample text</div>
320
+
321
+ <h6 class='mb-s'>tag h6, sample text</h6>
322
+ <div class='h6 mb-s'>class h6, sample text</div>
323
+ <div class='h6-s mb-s'>class h6-s, sample text</div>
324
+ </div>
325
+ );
326
+ };
327
+
328
+ const TestButtons = () => {
329
+ const doModal = (closeWhenClickOutside: boolean) => {
330
+ ModalWindow.show({
331
+ title: 'Save Menu',
332
+ buttons: ['Ok', 'Cancel'],
333
+ closeWhenClickOutside,
334
+ contentMinWidth: '50%',
335
+ handleClicked: (index: number, close: () => void) => {
336
+ close();
337
+ },
338
+ children: <div>test Modal</div>,
339
+ });
340
+ };
341
+
342
+ const list: string[] = ['Success', 'Info', 'Warning', 'Alert', '', 'Permanent'];
343
+ const handleSelected = (value: string) => {
344
+ const level = notificationColorFromValue(value);
345
+ const permanent = value === 'Permanent';
346
+ NotificationMessage.sendMessage('Selected: ' + value, level, permanent);
347
+ };
348
+
349
+ // Basic HTML Buttons
350
+ const basicButton1: RefProps = {};
351
+ const basicButton2: RefProps = {};
352
+ const onBasicButtonClick = () => {
353
+ basicButton1.current.disabled = !basicButton1.current.disabled;
354
+ basicButton2.current.disabled = !basicButton2.current.disabled;
355
+ };
356
+
357
+ // Lupine Button
358
+ const buttonHook1: ButtonHookProps = {};
359
+ const buttonHook2: ButtonHookProps = {};
360
+ const onButtonClick = () => {
361
+ buttonHook1.setEnabled?.(!buttonHook1.getEnabled?.());
362
+ buttonHook2.setEnabled?.(!buttonHook2.getEnabled?.());
363
+ };
364
+ return (
365
+ <div>
366
+ <div class='row-box mb-s h3 bold'>Basic HTML Buttons</div>
367
+ <div class='row-box mb-s'>
368
+ <button class='button-base button-ss mr-m' disabled={true} onClick={onBasicButtonClick} ref={basicButton1}>
369
+ Button
370
+ </button>
371
+ <button class='button-base button-s mr-m' disabled={true} onClick={onBasicButtonClick} ref={basicButton2}>
372
+ Button
373
+ </button>
374
+ <button class='button-base button-m mr-m' onClick={onBasicButtonClick}>
375
+ Button
376
+ </button>
377
+ <button class='button-base button-l mr-m' onClick={onBasicButtonClick}>
378
+ Button
379
+ </button>
380
+ <button class='button-base button-ll mr-m' onClick={onBasicButtonClick}>
381
+ Button
382
+ </button>
383
+ </div>
384
+
385
+ <div class='row-box mb-s h3 bold'>Lupine Buttons</div>
386
+ <div class='row-box mb-s'>
387
+ <Button
388
+ text='Test 1'
389
+ size={ButtonSize.SmallLarge}
390
+ disabled={true}
391
+ class='mr-m'
392
+ onClick={onButtonClick}
393
+ hook={buttonHook1}
394
+ />
395
+ <Button
396
+ text='Test 2'
397
+ size={ButtonSize.Small}
398
+ disabled={true}
399
+ class='mr-m'
400
+ hook={buttonHook2}
401
+ onClick={onButtonClick}
402
+ />
403
+ <Button text='Click Me' size={ButtonSize.Medium} class='mr-m' css={{ color: 'red' }} onClick={onButtonClick} />
404
+ <Button text='Button' size={ButtonSize.Large} class='mr-m' onClick={onButtonClick} />
405
+ <Button text='Button' size={ButtonSize.LargeLarge} class='mr-m' onClick={onButtonClick} />
406
+ </div>
407
+ </div>
408
+ );
409
+ };
410
+
411
+ const TestInputs = () => {
412
+ return (
413
+ <div>
414
+ <div class='row-box mb-s h3 bold'>Basic Inputs</div>
415
+ <div class='row-box mb-s'>
416
+ <div class='pr-m'>Input Label:</div>
417
+ <input type='text' class='input-base input-ss' placeholder='Placeholder' />
418
+ <input type='text' class='input-base input-ss' value='Text value' />
419
+ </div>
420
+ <div class='row-box mb-s'>
421
+ <div class='pr-m'>Input Label:</div>
422
+ <input type='text' class='input-base input-s' placeholder='Placeholder' />
423
+ <input type='text' class='input-base input-s' value='Text value' />
424
+ </div>
425
+ <div class='row-box mb-s'>
426
+ <div class='pr-m'>Input Label:</div>
427
+ <input type='text' class='input-base' placeholder='Placeholder' />
428
+ <input type='text' class='input-base' value='Text value' />
429
+ </div>
430
+ <div class='row-box mb-s'>
431
+ <div class='pr-m'>Input Label:</div>
432
+ <input type='text' class='input-base input-l' placeholder='Placeholder' />
433
+ <input type='text' class='input-base input-l' value='Text value' />
434
+ </div>
435
+ <div class='row-box mb-s'>
436
+ <div class='pr-m'>Input Label:</div>
437
+ <input type='text' class='input-base input-ll' placeholder='Placeholder' />
438
+ <input type='text' class='input-base input-ll' value='Text value' />
439
+ </div>
440
+
441
+ <div class='row-box mb-s h3 bold'>Readonly / Disabled</div>
442
+ <div class='row-box mb-s'>
443
+ <div class='pr-m'>Readonly:</div>
444
+ <input type='text' class='input-base' placeholder='Placeholder' readonly={true} />
445
+ <input type='text' class='input-base' value='Text value' readonly={true} />
446
+ </div>
447
+ <div class='row-box mb-s'>
448
+ <div class='pr-m'>Disabled:</div>
449
+ <input type='text' class='input-base' placeholder='Placeholder' disabled={true} />
450
+ <input type='text' class='input-base' value='Text value' disabled={true} />
451
+ </div>
452
+
453
+ <div class='row-box mb-s h3 bold'>Select</div>
454
+ <div class='row-box mb-s'>
455
+ <div class='pr-m'>Select:</div>
456
+ <select id='menutarget' class='input-base' size={1}>
457
+ <option value='0'>Parent Window</option>
458
+ <option value='1'>New Window</option>
459
+ </select>
460
+ </div>
461
+ <div class='row-box mb-s'>
462
+ <div class='pr-m'>Disabled:</div>
463
+ <select id='menutarget' class='input-base' size={1} disabled={true}>
464
+ <option value='0'>Parent Window</option>
465
+ <option value='1'>New Window</option>
466
+ </select>
467
+ </div>
468
+
469
+ <div class='row-box mb-s h3 bold'>Radio</div>
470
+ <div class='row-box mb-s'>
471
+ <div class='pr-m'>Radio box:</div>
472
+ <label class='input-label label-ss pr-m'>
473
+ <input class='input-base input-ss' type='radio' name='itemtype-ss' />
474
+ Text
475
+ </label>
476
+
477
+ <label class='input-label label-ss pr-m'>
478
+ <input class='input-base input-ss' type='radio' name='itemtype-ss' checked />
479
+ Checked
480
+ </label>
481
+
482
+ {/* checkbox and radio don't have readonly attribute */}
483
+ <label class='input-label label-ss disabled pr-m'>
484
+ <input class='input-base input-ss' type='radio' name='itemtype-ss_rc' disabled={true} />
485
+ Disabled
486
+ </label>
487
+ <label class='input-label label-ss disabled pr-m'>
488
+ <input class='input-base input-ss' type='radio' name='itemtype-ss_rc' checked disabled={true} />
489
+ Disabled checked
490
+ </label>
491
+ </div>
492
+
493
+ <div class='row-box mb-s'>
494
+ <div class='pr-m'>Radio box:</div>
495
+ <label class='input-label label-s pr-m'>
496
+ <input class='input-base input-s' type='radio' name='itemtype-s' />
497
+ Text
498
+ </label>
499
+
500
+ <label class='input-label label-s pr-m'>
501
+ <input class='input-base input-s' type='radio' name='itemtype-s' checked />
502
+ Checked
503
+ </label>
504
+
505
+ {/* checkbox and radio don't have readonly attribute */}
506
+ <label class='input-label label-s disabled pr-m'>
507
+ <input class='input-base input-s' type='radio' name='itemtype-s_rc' disabled={true} />
508
+ Disabled
509
+ </label>
510
+ <label class='input-label label-s disabled pr-m'>
511
+ <input class='input-base input-s' type='radio' name='itemtype-s_rc' checked disabled={true} />
512
+ Disabled checked
513
+ </label>
514
+ </div>
515
+
516
+ <div class='row-box mb-s'>
517
+ <div class='pr-m'>Radio box:</div>
518
+ <label class='input-label pr-m'>
519
+ <input class='input-base' type='radio' name='itemtype' />
520
+ Text
521
+ </label>
522
+
523
+ <label class='input-label pr-m'>
524
+ <input class='input-base' type='radio' name='itemtype' checked />
525
+ Checked
526
+ </label>
527
+
528
+ {/* checkbox and radio don't have readonly attribute */}
529
+ <label class='input-label disabled pr-m'>
530
+ <input class='input-base' type='radio' name='itemtype_rc' disabled={true} />
531
+ Disabled
532
+ </label>
533
+ <label class='input-label disabled pr-m'>
534
+ <input class='input-base' type='radio' name='itemtype_rc' checked disabled={true} />
535
+ Disabled checked
536
+ </label>
537
+ </div>
538
+
539
+ <div class='row-box mb-s'>
540
+ <div class='pr-m'>Radio box:</div>
541
+ <label class='input-label label-l pr-m'>
542
+ <input class='input-base input-l' type='radio' name='itemtype-l' />
543
+ Text
544
+ </label>
545
+
546
+ <label class='input-label label-l pr-m'>
547
+ <input class='input-base input-l' type='radio' name='itemtype-l' checked />
548
+ Checked
549
+ </label>
550
+
551
+ {/* checkbox and radio don't have readonly attribute */}
552
+ <label class='input-label label-l disabled pr-m'>
553
+ <input class='input-base input-l' type='radio' name='itemtype-l_rc' disabled={true} />
554
+ Disabled
555
+ </label>
556
+ <label class='input-label label-l disabled pr-m'>
557
+ <input class='input-base input-l' type='radio' name='itemtype-l_rc' checked disabled={true} />
558
+ Disabled checked
559
+ </label>
560
+ </div>
561
+
562
+ <div class='row-box mb-s'>
563
+ <div class='pr-m'>Radio box:</div>
564
+ <label class='input-label label-ll pr-m'>
565
+ <input class='input-base input-ll' type='radio' name='itemtype-ll' />
566
+ Text
567
+ </label>
568
+
569
+ <label class='input-label label-ll pr-m'>
570
+ <input class='input-base input-ll' type='radio' name='itemtype-ll' checked />
571
+ Checked
572
+ </label>
573
+
574
+ {/* checkbox and radio don't have readonly attribute */}
575
+ <label class='input-label label-ll disabled pr-m'>
576
+ <input class='input-base input-ll' type='radio' name='itemtype-ll_rc' disabled={true} />
577
+ Disabled
578
+ </label>
579
+ <label class='input-label label-ll disabled pr-m'>
580
+ <input class='input-base input-ll' type='radio' name='itemtype-ll_rc' checked disabled={true} />
581
+ Disabled checked
582
+ </label>
583
+ </div>
584
+
585
+ <div class='row-box mb-s h3 bold'>Checkbox</div>
586
+ <div class='row-box mb-s'>
587
+ <div class='pr-m'>Checkbox:</div>
588
+ <label class='input-label label-ss pr-m'>
589
+ <input class='input-base input-ss' type='checkbox' />
590
+ Text
591
+ </label>
592
+
593
+ <label class='input-label label-ss pr-m'>
594
+ <input class='input-base input-ss' type='checkbox' checked />
595
+ Checked
596
+ </label>
597
+
598
+ {/* checkbox and radio don't have readonly attribute */}
599
+ <label class='input-label label-ss disabled pr-m'>
600
+ <input class='input-base input-ss' type='checkbox' disabled={true} />
601
+ Disabled
602
+ </label>
603
+ <label class='input-label label-ss disabled pr-m'>
604
+ <input class='input-base input-ss' type='checkbox' checked disabled={true} />
605
+ Disabled checked
606
+ </label>
607
+ </div>
608
+
609
+ <div class='row-box mb-s'>
610
+ <div class='pr-m'>Checkbox:</div>
611
+ <label class='input-label label-s pr-m'>
612
+ <input class='input-base input-s' type='checkbox' />
613
+ Text
614
+ </label>
615
+
616
+ <label class='input-label label-s pr-m'>
617
+ <input class='input-base input-s' type='checkbox' checked />
618
+ Checked
619
+ </label>
620
+
621
+ {/* checkbox and radio don't have readonly attribute */}
622
+ <label class='input-label label-s disabled pr-m'>
623
+ <input class='input-base input-s' type='checkbox' disabled={true} />
624
+ Disabled
625
+ </label>
626
+ <label class='input-label label-s disabled pr-m'>
627
+ <input class='input-base input-s' type='checkbox' checked disabled={true} />
628
+ Disabled checked
629
+ </label>
630
+ </div>
631
+
632
+ <div class='row-box mb-s'>
633
+ <div class='pr-m'>Checkbox:</div>
634
+ <label class='input-label pr-m'>
635
+ <input class='input-base' type='checkbox' />
636
+ Text
637
+ </label>
638
+
639
+ <label class='input-label pr-m'>
640
+ <input class='input-base' type='checkbox' checked />
641
+ Checked
642
+ </label>
643
+
644
+ {/* checkbox and radio don't have readonly attribute */}
645
+ <label class='input-label disabled pr-m'>
646
+ <input class='input-base' type='checkbox' disabled={true} />
647
+ Disabled
648
+ </label>
649
+ <label class='input-label disabled pr-m'>
650
+ <input class='input-base' type='checkbox' checked disabled={true} />
651
+ Disabled checked
652
+ </label>
653
+ </div>
654
+
655
+ <div class='row-box mb-s'>
656
+ <div class='pr-m'>Checkbox:</div>
657
+ <label class='input-label label-l pr-m'>
658
+ <input class='input-base input-l' type='checkbox' />
659
+ Text
660
+ </label>
661
+
662
+ <label class='input-label label-l pr-m'>
663
+ <input class='input-base input-l' type='checkbox' checked />
664
+ Checked
665
+ </label>
666
+
667
+ {/* checkbox and radio don't have readonly attribute */}
668
+ <label class='input-label label-l disabled pr-m'>
669
+ <input class='input-base input-l' type='checkbox' disabled={true} />
670
+ Disabled
671
+ </label>
672
+ <label class='input-label label-l disabled pr-m'>
673
+ <input class='input-base input-l' type='checkbox' checked disabled={true} />
674
+ Disabled checked
675
+ </label>
676
+ </div>
677
+
678
+ <div class='row-box mb-s'>
679
+ <div class='pr-m'>Checkbox:</div>
680
+ <label class='input-label label-ll pr-m'>
681
+ <input class='input-base input-ll' type='checkbox' />
682
+ Text
683
+ </label>
684
+
685
+ <label class='input-label label-ll pr-m'>
686
+ <input class='input-base input-ll' type='checkbox' checked />
687
+ Checked
688
+ </label>
689
+
690
+ {/* checkbox and radio don't have readonly attribute */}
691
+ <label class='input-label label-ll disabled pr-m'>
692
+ <input class='input-base input-ll' type='checkbox' disabled={true} />
693
+ Disabled
694
+ </label>
695
+ <label class='input-label label-ll disabled pr-m'>
696
+ <input class='input-base input-ll' type='checkbox' checked disabled={true} />
697
+ Disabled checked
698
+ </label>
699
+ </div>
700
+
701
+ <div class='row-box mb-s h3 bold'>Input field</div>
702
+ <div class='row-box mb-s'>
703
+ <div class='input-field w-100p'>
704
+ <input class='input-base w-100p f-subject' type='text' required placeholder=' ' />
705
+ <span>Subject *</span>
706
+ </div>
707
+ <div class='input-field w-100p'>
708
+ <textarea class='input-base w-100p msg-area f-message' required placeholder=' '></textarea>
709
+ <span>Message *</span>
710
+ </div>
711
+ </div>
712
+
713
+ <div class='row-box mb-s h3 bold'>List</div>
714
+ <div class='row-box mb-s'>
715
+ <div class='row-box flex-1 mr-m'>
716
+ <div class='list-box'>
717
+ <select class='input-base w-100p h-100p list' id='menulist' size={8}>
718
+ <option value='0 0 0 0 index.php?st_p1=&amp;st_p2=&amp;st_m1=home Web No Coding Home'>Home</option>
719
+ <option>Help</option>
720
+ <option disabled={true}>Beginners</option>
721
+ <option>----for Beginners</option>
722
+ <option>----Template</option>
723
+ </select>
724
+ </div>
725
+ </div>
726
+ <div class='row-box flex-1'>
727
+ <div class='list-box'>
728
+ <select class='input-base w-100p h-100p list' id='menulist' size={8} disabled={true}>
729
+ <option value='0 0 0 0 index.php?st_p1=&amp;st_p2=&amp;st_m1=home Web No Coding Home'>Disabled</option>
730
+ <option>Help</option>
731
+ <option>Beginners</option>
732
+ <option>----for Beginners</option>
733
+ <option>----Template</option>
734
+ </select>
735
+ </div>
736
+ </div>
737
+ </div>
738
+ </div>
739
+ );
740
+ };
741
+
742
+ export const TestComponentPage = () => {
743
+ return (
744
+ <div>
745
+ <div class='row-box mb-s'>
746
+ <TestWindows />
747
+ </div>
748
+ <div class='row-box mb-s'>
749
+ <TestColors />
750
+ </div>
751
+ <div class='row-box mb-s'>
752
+ <TestTextFontSize />
753
+ </div>
754
+ <div class='row-box mb-s'>
755
+ <TestButtons />
756
+ </div>
757
+ <div class='row-box mb-s'>
758
+ <TestInputs />
759
+ </div>
760
+
761
+ <div class='row-box mb-s h3 bold'>Toggle Switch</div>
762
+ <div class='row-box mb-s'>
763
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.SmallSmall} />
764
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.SmallSmall} />
765
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} />
766
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Small} />
767
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Medium} />
768
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Medium} />
769
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} />
770
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} />
771
+ </div>
772
+
773
+ <div class='row-box mb-s h3 bold'>Toggle Switch with text</div>
774
+ <div class='row-box mb-s'>
775
+ <ToggleSwitch
776
+ checked={true}
777
+ size={ToggleSwitchSize.SmallSmall}
778
+ text={{ on: 'On', off: 'Off' }}
779
+ textWidth='50px'
780
+ />
781
+ <ToggleSwitch
782
+ checked={false}
783
+ size={ToggleSwitchSize.SmallSmall}
784
+ text={{ on: 'Enable', off: 'Disable' }}
785
+ textWidth='50px'
786
+ />
787
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} text={{ on: 'On', off: 'Off' }} textWidth='50px' />
788
+ <ToggleSwitch
789
+ checked={false}
790
+ size={ToggleSwitchSize.Small}
791
+ text={{ on: 'Enable', off: 'Disable' }}
792
+ textWidth='50px'
793
+ />
794
+ <ToggleSwitch
795
+ checked={true}
796
+ size={ToggleSwitchSize.Medium}
797
+ text={{ on: 'Set', off: 'Not Set' }}
798
+ textWidth='60px'
799
+ />
800
+ <ToggleSwitch
801
+ checked={false}
802
+ size={ToggleSwitchSize.Medium}
803
+ text={{ on: 'Show', off: 'Hide' }}
804
+ textWidth='60px'
805
+ />
806
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} text={{ on: 'Yes', off: 'No' }} />
807
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} text={{ on: 'Up', off: 'Down' }} />
808
+ </div>
809
+
810
+ <div class='row-box mb-s h3 bold'>Toggle Switch Disabled</div>
811
+ <div class='row-box mb-s'>
812
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.SmallSmall} disabled={true} />
813
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.SmallSmall} disabled={true} />
814
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Small} disabled={true} />
815
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Small} disabled={true} />
816
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Medium} disabled={true} />
817
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Medium} disabled={true} />
818
+ <ToggleSwitch checked={true} size={ToggleSwitchSize.Large} disabled={true} />
819
+ <ToggleSwitch checked={false} size={ToggleSwitchSize.Large} disabled={true} />
820
+ </div>
821
+ </div>
822
+ );
823
+ };