lupine.components 1.1.7 → 1.1.9

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.components",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
@@ -226,3 +226,45 @@ export class ActionSheetMessage {
226
226
  return handleClose;
227
227
  }
228
228
  }
229
+
230
+ export type ActionSheetInputProps = Omit<
231
+ ActionSheetShowProps,
232
+ 'children' | 'handleClicked' | 'closeEvent' | 'handleConfirmClicked'
233
+ > & {
234
+ defaultValue?: string;
235
+ handleConfirmValue: (value: string, close: ActionSheetCloseProps) => void;
236
+ };
237
+ export class ActionSheetInput {
238
+ static async show({
239
+ title,
240
+ defaultValue,
241
+ contentMaxHeight,
242
+ closeWhenClickOutside = true,
243
+ confirmButtonText = 'OK',
244
+ handleConfirmValue: handleConfirmValue,
245
+ cancelButtonText = 'Cancel',
246
+ }: ActionSheetInputProps): Promise<ActionSheetCloseProps> {
247
+ let value: string = defaultValue || '';
248
+ const handleClose = await ActionSheet.show({
249
+ title,
250
+ children: (
251
+ <div css={{ padding: '8px', borderTop: '1px solid var(--primary-border-color)' }}>
252
+ <input
253
+ class='input-base w-100p'
254
+ type='text'
255
+ value={value}
256
+ onInput={(e) => (value = (e.target as HTMLInputElement).value)}
257
+ />
258
+ </div>
259
+ ),
260
+ contentMaxHeight,
261
+ confirmButtonText,
262
+ handleConfirmClicked: (close) => {
263
+ handleConfirmValue(value, close);
264
+ },
265
+ cancelButtonText,
266
+ closeWhenClickOutside,
267
+ });
268
+ return handleClose;
269
+ }
270
+ }
@@ -9,7 +9,7 @@ export const InputWithTitle = (
9
9
  ) => {
10
10
  return (
11
11
  <div>
12
- <div>{title}</div>
12
+ <div style={{ paddingBottom: '4px' }}>{title}</div>
13
13
  <div>
14
14
  <input
15
15
  class={className}
@@ -4,6 +4,7 @@ import { stopPropagation } from '../lib';
4
4
  export type PopupMenuHookProps = {
5
5
  openMenu?: (event?: MouseEvent) => void;
6
6
  getValue?: () => string;
7
+ setLabel?: (label: string) => void;
7
8
  };
8
9
 
9
10
  // defaultValue=<i class='ifc-icon co-cil-hamburger-menu'></i>
@@ -231,6 +232,9 @@ export const PopupMenu = ({
231
232
  if (hook) {
232
233
  hook.openMenu = openMenu;
233
234
  hook.getValue = () => selectedValue;
235
+ hook.setLabel = (label: string) => {
236
+ ref.$('.popup-menu-item .popup-menu-text').innerText = label;
237
+ };
234
238
  }
235
239
  const itemClick = (event: any) => {
236
240
  stopPropagation(event);
@@ -169,6 +169,10 @@ export const Tabs = ({ pages, defaultIndex, topClassName, pagePadding, hook: ref
169
169
  display: 'flex',
170
170
  height: 'auto',
171
171
  'border-bottom': '1px solid grey',
172
+ 'overflow-x': 'auto',
173
+ 'overflow-y': 'hidden',
174
+ 'scrollbar-width': 'thin',
175
+ 'scrollbar-color': '#ababab4d #d5d5d552',
172
176
  '> div > .tab': {
173
177
  padding: '2px 3px',
174
178
  width: 'auto',