mirror of
https://github.com/smartxworks/sunmao-ui.git
synced 2024-11-27 08:39:59 +08:00
add dayjs
This commit is contained in:
parent
21ef34082b
commit
ae90ca1675
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { flatten } from 'lodash-es';
|
||||
import { FormControl, FormLabel, Input, VStack } from '@chakra-ui/react';
|
||||
import { FormControl, FormLabel, Input, Textarea, VStack } from '@chakra-ui/react';
|
||||
import { EmotionJSX } from '@emotion/react/types/jsx-namespace';
|
||||
import { TSchema } from '@sinclair/typebox';
|
||||
import { Application } from '@meta-ui/core';
|
||||
@ -27,7 +27,7 @@ export const renderField = (properties: {
|
||||
}) => {
|
||||
const { value, type, fullKey, selectedId } = properties;
|
||||
if (typeof value !== 'object') {
|
||||
const ref = React.createRef<HTMLInputElement>();
|
||||
const ref = React.createRef<HTMLTextAreaElement>();
|
||||
const onBlur = () => {
|
||||
const operation = type
|
||||
? new ModifyTraitPropertyOperation(selectedId, type, fullKey, ref.current?.value)
|
||||
@ -37,7 +37,7 @@ export const renderField = (properties: {
|
||||
return (
|
||||
<FormControl key={`${selectedId}-${fullKey}`}>
|
||||
<FormLabel>{fullKey}</FormLabel>
|
||||
<Input ref={ref} onBlur={onBlur} defaultValue={value as string} />
|
||||
<Textarea ref={ref} onBlur={onBlur} defaultValue={value as string} />
|
||||
</FormControl>
|
||||
);
|
||||
} else {
|
||||
|
@ -96,7 +96,7 @@ export const Editor = () => {
|
||||
<Tab>UI Tree</Tab>
|
||||
<Tab>State</Tab>
|
||||
</TabList>
|
||||
<TabPanels flex="1">
|
||||
<TabPanels flex="1" overflow="auto">
|
||||
<TabPanel p={0}>
|
||||
<StructureTree
|
||||
app={app}
|
||||
|
@ -1,11 +1,17 @@
|
||||
import { toNumber, mapValues, isArray, isPlainObject, set } from 'lodash-es';
|
||||
import dayjs from 'dayjs';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
import isLeapYear from 'dayjs/plugin/isLeapYear';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import LocalizedFormat from 'dayjs/plugin/LocalizedFormat';
|
||||
import { reactive } from '@vue/reactivity';
|
||||
import { watch } from '../utils/watchReactivity';
|
||||
import { LIST_ITEM_EXP, LIST_ITEM_INDEX_EXP } from '../constants';
|
||||
|
||||
dayjs.extend(relativeTime);
|
||||
dayjs.extend(isLeapYear);
|
||||
dayjs.extend(LocalizedFormat);
|
||||
dayjs.locale('zh-cn');
|
||||
|
||||
type ExpChunk = {
|
||||
expression: string;
|
||||
|
Loading…
Reference in New Issue
Block a user