@ledvance/base 1.3.34 → 1.3.35
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/localazy.json +2 -1
- package/package.json +1 -1
- package/src/components/AdvanceList.tsx +1 -0
- package/src/components/ApplyForDeviceItem.tsx +2 -1
- package/src/components/Card.tsx +3 -2
- package/src/components/SocketItem.tsx +1 -0
- package/src/components/Tag.tsx +8 -4
- package/src/components/ldvPickerView.tsx +4 -2
- package/src/config/dark-theme.ts +5 -0
- package/src/config/light-theme.ts +5 -0
- package/src/i18n/index.ts +11 -9
- package/src/i18n/strings.ts +677 -650
- package/src/utils/common.ts +19 -24
- package/translateKey.txt +1 -0
package/src/utils/common.ts
CHANGED
|
@@ -300,6 +300,11 @@ interface DialogProps {
|
|
|
300
300
|
onCancel?: () => void
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
// 获取文本的默认值
|
|
304
|
+
const getText = (text: string | undefined, defaultText: string | undefined, show: boolean) => {
|
|
305
|
+
return show ? text || defaultText || '' : '';
|
|
306
|
+
};
|
|
307
|
+
|
|
303
308
|
export function showDialog(props: DialogProps) {
|
|
304
309
|
const {
|
|
305
310
|
method,
|
|
@@ -312,31 +317,21 @@ export function showDialog(props: DialogProps) {
|
|
|
312
317
|
onConfirm,
|
|
313
318
|
onCancel
|
|
314
319
|
} = props
|
|
320
|
+
|
|
321
|
+
const defDialogProps = {
|
|
322
|
+
title,
|
|
323
|
+
confirmText: getText(confirmText, I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text'), showConfirmText),
|
|
324
|
+
cancelText: getText(cancelText, I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_no_text'), showCancelText),
|
|
325
|
+
subTitle,
|
|
326
|
+
onConfirm,
|
|
327
|
+
motionConfig: {
|
|
328
|
+
hideDuration: 0,
|
|
329
|
+
showDuration: 100
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const cancelProps = onCancel ? { onCancel } : {};
|
|
315
333
|
return (
|
|
316
|
-
method === 'confirm' ?
|
|
317
|
-
Dialog.confirm({
|
|
318
|
-
title: title,
|
|
319
|
-
cancelText: showCancelText && (cancelText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_no_text')) || '',
|
|
320
|
-
confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
|
|
321
|
-
subTitle,
|
|
322
|
-
onConfirm,
|
|
323
|
-
onCancel,
|
|
324
|
-
motionConfig: {
|
|
325
|
-
hideDuration: 0,
|
|
326
|
-
showDuration: 100
|
|
327
|
-
}
|
|
328
|
-
})
|
|
329
|
-
:
|
|
330
|
-
Dialog.alert({
|
|
331
|
-
title: title,
|
|
332
|
-
confirmText: showConfirmText && (confirmText || I18n.getLang('conflict_dialog_save_item_fixedtimecycle_answer_yes_text')) || '',
|
|
333
|
-
subTitle,
|
|
334
|
-
onConfirm,
|
|
335
|
-
motionConfig: {
|
|
336
|
-
hideDuration: 0,
|
|
337
|
-
showDuration: 100
|
|
338
|
-
}
|
|
339
|
-
})
|
|
334
|
+
method === 'confirm' ? Dialog.confirm({ ...defDialogProps, ...cancelProps }) : Dialog.alert(defDialogProps)
|
|
340
335
|
)
|
|
341
336
|
}
|
|
342
337
|
|
package/translateKey.txt
CHANGED