From 1337802a4168147c4e9c0bc8acfb8ef0c2f044ef Mon Sep 17 00:00:00 2001 From: rdmclin2 Date: Thu, 7 Sep 2023 15:53:40 +0800 Subject: [PATCH 01/10] :boom: feat: add keyManager list --- src/SortableList/container/StoreUpdater.tsx | 29 +++++++++++++++++++-- src/SortableList/demos/Basic.tsx | 2 +- src/SortableList/store/initialState.ts | 1 + src/SortableList/store/store.ts | 9 +++++-- src/SortableList/type/store.ts | 4 +++ 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/SortableList/container/StoreUpdater.tsx b/src/SortableList/container/StoreUpdater.tsx index d1e060d0..04a4de9e 100644 --- a/src/SortableList/container/StoreUpdater.tsx +++ b/src/SortableList/container/StoreUpdater.tsx @@ -1,3 +1,4 @@ +import { produce } from 'immer'; import { forwardRef, useImperativeHandle } from 'react'; import { createStoreUpdater } from 'zustand-utils'; import { useSortableList } from '..'; @@ -24,8 +25,32 @@ const StoreUpdater = forwardRef( const storeApi = useStoreApi(); const useStoreUpdater = createStoreUpdater(storeApi); - useStoreUpdater('value', initialValues, []); - useStoreUpdater('value', value); + // KeyManager 和 value & initialValues 同步。 + const KeyManagerUpdater = (state, key) => { + const { keyManager } = storeApi.getState(); + // value 为空处理 + const value = state[key] || []; + const manager = produce(keyManager, (draft) => { + value.forEach((__, index) => { + const key = draft[index]; + if (key === undefined) { + draft[index] = crypto.randomUUID(); + } + }); + return draft; + }); + + storeApi.setState({ keyManager: manager, [key]: value }); + }; + + useStoreUpdater('value', initialValues, [], (state) => { + KeyManagerUpdater(state, 'initialValues'); + }); + + useStoreUpdater('value', value, [value], (state) => { + KeyManagerUpdater(state, 'value'); + }); + useStoreUpdater('actions', actions); useStoreUpdater('getId', getId); useStoreUpdater('onChange', onChange); diff --git a/src/SortableList/demos/Basic.tsx b/src/SortableList/demos/Basic.tsx index b845ce74..f87727f4 100644 --- a/src/SortableList/demos/Basic.tsx +++ b/src/SortableList/demos/Basic.tsx @@ -13,7 +13,7 @@ const Demo = () => { const token = useTheme(); return ( - + ); }; diff --git a/src/SortableList/store/initialState.ts b/src/SortableList/store/initialState.ts index 7f8b516e..d7609c97 100644 --- a/src/SortableList/store/initialState.ts +++ b/src/SortableList/store/initialState.ts @@ -4,6 +4,7 @@ import { SortableItem, SortableListState } from '../type'; export const initialState: SortableListState = { activeId: null, value: [], + keyManager: [], hideRemove: false, onChange: undefined, renderItem: undefined, diff --git a/src/SortableList/store/store.ts b/src/SortableList/store/store.ts index e24b3f6c..3f37bbd5 100644 --- a/src/SortableList/store/store.ts +++ b/src/SortableList/store/store.ts @@ -44,11 +44,16 @@ const vanillaStore: StateCreator = (set, g }, // ===== 更新 listData 方法 ======= // dispatchListData: (payload) => { - const { value, onChange } = get(); + const { value, keyManager, onChange } = get(); const data = listDataReducer(value, payload); + // value 值变化的时候,keyManager 也需要变化 + const keys = listDataReducer(keyManager, payload); + + console.log('keys', keys); + if (data) { if (isEqual(value, data)) return; - set({ value: data }); + set({ value: data, keyManager: keys }); if (onChange) onChange(data, payload); } }, diff --git a/src/SortableList/type/store.ts b/src/SortableList/type/store.ts index 65c664e9..795b3529 100644 --- a/src/SortableList/type/store.ts +++ b/src/SortableList/type/store.ts @@ -34,6 +34,10 @@ export interface SortableListState { * 值 */ value?: SortableItemList; + /** + * 和 Value 值对应的 id 管理器 + */ + keyManager?: UniqueIdentifier[]; /** * 渲染额外区域 */ From b957f65cef491204041dcf7ac3850ad4c8656478 Mon Sep 17 00:00:00 2001 From: rdmclin2 Date: Thu, 7 Sep 2023 16:13:09 +0800 Subject: [PATCH 02/10] :recycle: chore: remove SortableItem type --- package.json | 1 - src/SortableList/container/StoreUpdater.tsx | 19 ++++----- src/SortableList/container/index.tsx | 6 +-- src/SortableList/demos/Basic.tsx | 2 +- src/SortableList/demos/controlled.tsx | 6 +-- src/SortableList/demos/creatorButtonProps.tsx | 2 +- src/SortableList/demos/data.ts | 6 +-- src/SortableList/demos/getId.tsx | 40 ------------------- src/SortableList/demos/getItemStyles.tsx | 9 +---- src/SortableList/hooks/useSortableList.ts | 16 ++++---- src/SortableList/index.ts | 7 +--- src/SortableList/store/initialState.ts | 7 +--- src/SortableList/type/action.ts | 6 +-- src/SortableList/type/component.ts | 20 +++------- src/SortableList/type/store.ts | 13 ++---- src/SortableList/utils/index.tsx | 7 ++-- 16 files changed, 46 insertions(+), 121 deletions(-) delete mode 100644 src/SortableList/demos/getId.tsx diff --git a/package.json b/package.json index 8d1d65b6..c344eb30 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,6 @@ "lodash.unionby": "^4.8.0", "lodash.uniq": "^4.5.0", "mockjs": "^1.1.0", - "object-hash": "^3.0.0", "polished": "^4.2.2", "prettier": "^2.8.8", "rc-util": "^5.37.0", diff --git a/src/SortableList/container/StoreUpdater.tsx b/src/SortableList/container/StoreUpdater.tsx index 04a4de9e..822d9b9d 100644 --- a/src/SortableList/container/StoreUpdater.tsx +++ b/src/SortableList/container/StoreUpdater.tsx @@ -40,17 +40,11 @@ const StoreUpdater = forwardRef( return draft; }); - storeApi.setState({ keyManager: manager, [key]: value }); + storeApi.setState({ keyManager: manager }); }; - useStoreUpdater('value', initialValues, [], (state) => { - KeyManagerUpdater(state, 'initialValues'); - }); - - useStoreUpdater('value', value, [value], (state) => { - KeyManagerUpdater(state, 'value'); - }); - + useStoreUpdater('value', initialValues, []); + useStoreUpdater('value', value); useStoreUpdater('actions', actions); useStoreUpdater('getId', getId); useStoreUpdater('onChange', onChange); @@ -61,6 +55,13 @@ const StoreUpdater = forwardRef( useStoreUpdater('creatorButtonProps', creatorButtonProps); useStoreUpdater('hideRemove', hideRemove); + // KeyManager 状态受控 + useStoreUpdater('initialValues', initialValues, [], (state) => { + KeyManagerUpdater(state, 'initialValues'); + }); + + useStoreUpdater('value', value, null, (state) => KeyManagerUpdater(state, 'value')); + // 将 store 传递到外部 const instance = useSortableList(); useImperativeHandle(ref, () => instance); diff --git a/src/SortableList/container/index.tsx b/src/SortableList/container/index.tsx index 0d6f2b43..22566345 100644 --- a/src/SortableList/container/index.tsx +++ b/src/SortableList/container/index.tsx @@ -1,6 +1,6 @@ import { forwardRef, memo, ReactNode } from 'react'; import { ConfigProvider } from '../../ConfigProvider'; -import type { SortableItem, StoreUpdaterProps } from '../type'; +import type { StoreUpdaterProps } from '../type'; import type { AppProps } from './App'; import App from './App'; import { SortableListProvider } from './Provider'; @@ -10,9 +10,7 @@ export { SortableListProvider } from './Provider'; export interface SortableListProps extends StoreUpdaterProps, AppProps {} -export const SortableList: ( - props: SortableListProps, -) => ReactNode = memo( +export const SortableList: (props: SortableListProps) => ReactNode = memo( forwardRef((props, ref) => { const { SHOW_STORE_IN_DEVTOOLS, className, style, ...res } = props; return ( diff --git a/src/SortableList/demos/Basic.tsx b/src/SortableList/demos/Basic.tsx index f87727f4..18ee24eb 100644 --- a/src/SortableList/demos/Basic.tsx +++ b/src/SortableList/demos/Basic.tsx @@ -7,7 +7,7 @@ import { SortableList } from '@ant-design/pro-editor'; import { useTheme } from 'antd-style'; import { Flexbox } from 'react-layout-kit'; -const list = [{ id: 'hello' }, { id: 'world' }]; +const list = ['hello', 'world']; const Demo = () => { const token = useTheme(); diff --git a/src/SortableList/demos/controlled.tsx b/src/SortableList/demos/controlled.tsx index b62f90ae..05def598 100644 --- a/src/SortableList/demos/controlled.tsx +++ b/src/SortableList/demos/controlled.tsx @@ -3,14 +3,14 @@ * description: onChange 会返回变更数据 * compact: true */ -import { SortableItem, SortableList } from '@ant-design/pro-editor'; +import { SortableList } from '@ant-design/pro-editor'; import { Button } from 'antd'; import { useTheme } from 'antd-style'; import { useState } from 'react'; import { Flexbox } from 'react-layout-kit'; const Demo = () => { - const [list, setList] = useState([{ id: 'hello' }, { id: 'world' }]); + const [list, setList] = useState(['hello', 'world']); const token = useTheme(); return ( @@ -25,7 +25,7 @@ const Demo = () => { - - - - -
  • -
    -
    - -
    -
    > renders column.tsx correctly 1`] = ` - productComment + closeType
    > renders column.tsx correctly 1`] = `
  • -
  • -
    -
    - -
    - -
    -
    - - - - - 文本 - -
    - -
    -
    -
    - - - - - orderStatus - -
    - -
    -
    -
    -
    -
    -
    - #1677FF -
    -
    -
    -
    - -
    -
    -
    -
  • -
  • -
    -
    - -
    - -
    -
    - - - - - 日期 - -
    - -
    -
    -
    - - - - - orderCreated - -
    - -
    -
    -
    -
    -
    -
    - #1677FF -
    -
    -
    -
    - -
    -
    -
    -
  • -
  • -
    -
    - -
    - -
    -
    - - - - - 文本 - -
    - -
    -
    -
    - - - - - detailPic - -
    - -
    -
    -
    -
    -
    -
    - #1677FF -
    -
    -
    -
    - -
    -
    -
    -
  • -
  • -
    -
    - -
    - -
    -
    - - - - - 文本 - -
    - -
    -
    -
    - - - - - closeReason - -
    - -
    -
    -
    -
    -
    -
    - #1677FF -
    -
    -
    -
    - -
    -
    -
    -
  • -
  • -
    -
    - -
    - -
    -
    - - - - - 文本 - -
    - -
    -
    -
    - - - - - closeType - -
    - -
    -
    -
    -
    -
    -
    - #1677FF -
    -
    -
    -
    - -
    -
    -
    -
  • - - -
    -
    - -`; - -exports[` > renders controlled.tsx correctly 1`] = ` -.emotion-0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - gap: 4px; -} - -.emotion-1 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 100%; - height: 24px; - font-size: 12px; - border-radius: 2px; - min-width: 48px; - color: rgba(0, 0, 0, 0.45); - padding-left: 8px; -} - -.emotion-4 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -.emotion-5 { - list-style: none; - display: grid; - grid-auto-rows: max-content; - grid-gap: 2px; - grid-template-columns: repeat(var(--columns, 1), 1fr); - width: 100%; - margin: 0; - padding: 0; - border-radius: 4px; - -webkit-transition: background-color 350ms ease; - transition: background-color 350ms ease; -} - -.emotion-6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - box-sizing: border-box; - -webkit-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -moz-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -ms-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform-origin: 0 0; - touch-action: manipulation; -} - -.emotion-6:not(:last-child) { - margin-bottom: 2px; -} - -.emotion-7 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - box-sizing: border-box; - padding: 1px 0; - color: rgba(0, 0, 0, 0.65); - font-size: 12px; - white-space: nowrap; - list-style: none; - border-radius: 4px; - outline: none; - -webkit-transform: scale(var(--scale, 1)); - -moz-transform: scale(var(--scale, 1)); - -ms-transform: scale(var(--scale, 1)); - transform: scale(var(--scale, 1)); - transform-origin: 50% 50%; - -webkit-transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - -webkit-tap-highlight-color: transparent; -} - -.emotion-7:focus-visible { - box-shadow: 0 0 4px 1px #4c9ffe,0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-7:not(.studio-sortable-list-item-withHandle) { - cursor: -webkit-grab; - cursor: grab; - -webkit-user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - touch-action: none; -} - -.emotion-7-dragging:not(.studio-sortable-list-item-dragOverlay) { - z-index: 0; - opacity: var(--dragging-opacity, 0.5); -} - -.emotion-7-dragging:not(.studio-sortable-list-item-dragOverlay):focus { - box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.emotion-9 { - position: relative; - width: 100%; -} - -.emotion-9:hover .studio-column-list-item-actions { - opacity: 1; -} - -.emotion-10 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; - position: absolute; - left: 0; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-10:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-10:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -.emotion-11 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - width: 100%; - gap: 4px; -} - -.emotion-12 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-size: 12px; - border-radius: 2px; - min-width: 48px; -} - -.emotion-13 { - padding-left: 13px; -} - -.emotion-14 .studio-select-selector { - padding-left: 13px; -} - -.emotion-17 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; -} - -.emotion-18 { - position: absolute; - top: 1px; - right: 1px; - -webkit-align-self: flex-end; - -ms-flex-item-align: flex-end; - align-self: flex-end; - overflow: hidden; - border-radius: 1px; - -webkit-backdrop-filter: blur(5px); - backdrop-filter: blur(5px); -} - -.emotion-19 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-19:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-19:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -
    -
    -
    - 列标题 -
    -
    - 值类型 -
    -
    - 字段 -
    -
    -
    -
      -
    • -
      -
      - -
      - -
      -
      - - - - - 圆形序号 - -
      - -
      -
      -
      - - - - - index - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - name - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - authCompany - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    - -
    -
    -
    -`; - -exports[` > renders creatorButtonProps.tsx correctly 1`] = ` -.emotion-0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - gap: 4px; -} - -.emotion-1 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 100%; - height: 24px; - font-size: 12px; - border-radius: 2px; - min-width: 48px; - color: rgba(0, 0, 0, 0.45); - padding-left: 8px; -} - -.emotion-4 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -.emotion-5 { - height: 24px; - padding-block: 2px; - margin-top: 4px; - margin-bottom: 4px; - color: rgba(0, 0, 0, 0.65); - background: rgba(0, 0, 0, 0.02); - border-color: transparent; -} - -.emotion-5:hover { - color: rgba(0, 0, 0, 0.88)!important; - background: rgba(0, 0, 0, 0.06)!important; - border-color: transparent!important; -} - -.emotion-5:focus { - color: rgba(0, 0, 0, 0.65); - background: rgba(0, 0, 0, 0.02); - border-color: transparent; - border-color: #1677ff!important; -} - -.emotion-6 { - list-style: none; - display: grid; - grid-auto-rows: max-content; - grid-gap: 2px; - grid-template-columns: repeat(var(--columns, 1), 1fr); - width: 100%; - margin: 0; - padding: 0; - border-radius: 4px; - -webkit-transition: background-color 350ms ease; - transition: background-color 350ms ease; -} - -.emotion-7 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - box-sizing: border-box; - -webkit-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -moz-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -ms-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform-origin: 0 0; - touch-action: manipulation; -} - -.emotion-7:not(:last-child) { - margin-bottom: 2px; -} - -.emotion-8 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - box-sizing: border-box; - padding: 1px 0; - color: rgba(0, 0, 0, 0.65); - font-size: 12px; - white-space: nowrap; - list-style: none; - border-radius: 4px; - outline: none; - -webkit-transform: scale(var(--scale, 1)); - -moz-transform: scale(var(--scale, 1)); - -ms-transform: scale(var(--scale, 1)); - transform: scale(var(--scale, 1)); - transform-origin: 50% 50%; - -webkit-transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - -webkit-tap-highlight-color: transparent; -} - -.emotion-8:focus-visible { - box-shadow: 0 0 4px 1px #4c9ffe,0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-8:not(.studio-sortable-list-item-withHandle) { - cursor: -webkit-grab; - cursor: grab; - -webkit-user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - touch-action: none; -} - -.emotion-8-dragging:not(.studio-sortable-list-item-dragOverlay) { - z-index: 0; - opacity: var(--dragging-opacity, 0.5); -} - -.emotion-8-dragging:not(.studio-sortable-list-item-dragOverlay):focus { - box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-9 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.emotion-10 { - position: relative; - width: 100%; -} - -.emotion-10:hover .studio-column-list-item-actions { - opacity: 1; -} - -.emotion-11 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; - position: absolute; - left: 0; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-11:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-11:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -.emotion-12 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - width: 100%; - gap: 4px; -} - -.emotion-13 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-size: 12px; - border-radius: 2px; - min-width: 48px; -} - -.emotion-14 { - padding-left: 13px; -} - -.emotion-15 .studio-select-selector { - padding-left: 13px; -} - -.emotion-18 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; -} - -.emotion-19 { - position: absolute; - top: 1px; - right: 1px; - -webkit-align-self: flex-end; - -ms-flex-item-align: flex-end; - align-self: flex-end; - overflow: hidden; - border-radius: 1px; - -webkit-backdrop-filter: blur(5px); - backdrop-filter: blur(5px); -} - -.emotion-20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-20:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-20:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -
    -
    -
    - 列标题 -
    -
    - 值类型 -
    -
    - 字段 -
    -
    -
    - -
      -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderId - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderNumber - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderMoney - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - productName - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - productComment - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderStatus - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 日期 - -
      - -
      -
      -
      - - - - - orderCreated - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - detailPic - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - closeReason - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - closeType - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    - -
    -
    -
    -`; - -exports[` > renders customCreate.tsx correctly 1`] = ` -.emotion-0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - width: 100%; -} - -.emotion-1 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-1:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-1:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -.emotion-2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - gap: 4px; -} - -.emotion-3 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 100%; - height: 24px; - font-size: 12px; - border-radius: 2px; - min-width: 48px; - color: rgba(0, 0, 0, 0.45); - padding-left: 8px; -} - -.emotion-6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -.emotion-7 { - list-style: none; - display: grid; - grid-auto-rows: max-content; - grid-gap: 2px; - grid-template-columns: repeat(var(--columns, 1), 1fr); - width: 100%; - margin: 0; - padding: 0; - border-radius: 4px; - -webkit-transition: background-color 350ms ease; - transition: background-color 350ms ease; -} - -.emotion-8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - box-sizing: border-box; - -webkit-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -moz-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - -ms-transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform: translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)); - transform-origin: 0 0; - touch-action: manipulation; -} - -.emotion-8:not(:last-child) { - margin-bottom: 2px; -} - -.emotion-9 { - position: relative; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-box-flex: 1; - -webkit-flex-grow: 1; - -ms-flex-positive: 1; - flex-grow: 1; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - justify-content: space-between; - box-sizing: border-box; - padding: 1px 0; - color: rgba(0, 0, 0, 0.65); - font-size: 12px; - white-space: nowrap; - list-style: none; - border-radius: 4px; - outline: none; - -webkit-transform: scale(var(--scale, 1)); - -moz-transform: scale(var(--scale, 1)); - -ms-transform: scale(var(--scale, 1)); - transform: scale(var(--scale, 1)); - transform-origin: 50% 50%; - -webkit-transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - transition: box-shadow 200ms cubic-bezier(0.18, 0.67, 0.6, 1.22); - -webkit-tap-highlight-color: transparent; -} - -.emotion-9:focus-visible { - box-shadow: 0 0 4px 1px #4c9ffe,0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-9:not(.studio-sortable-list-item-withHandle) { - cursor: -webkit-grab; - cursor: grab; - -webkit-user-select: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - touch-action: none; -} - -.emotion-9-dragging:not(.studio-sortable-list-item-dragOverlay) { - z-index: 0; - opacity: var(--dragging-opacity, 0.5); -} - -.emotion-9-dragging:not(.studio-sortable-list-item-dragOverlay):focus { - box-shadow: 0 0 0 calc(1px / var(--scale-x, 1)) rgba(0, 0, 0, 0.05) 0 1px calc(3px / var(--scale-x, 1)) 0 rgba(0, 0, 0, 0.15); -} - -.emotion-10 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.emotion-11 { - position: relative; - width: 100%; -} - -.emotion-11:hover .studio-column-list-item-actions { - opacity: 1; -} - -.emotion-12 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; - position: absolute; - left: 0; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -webkit-transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); - transition: color 600ms cubic-bezier(0.215, 0.61, 0.355, 1),scale 400ms cubic-bezier(0.215, 0.61, 0.355, 1),background-color 100ms cubic-bezier(0.215, 0.61, 0.355, 1); -} - -.emotion-12:hover { - color: rgba(0, 0, 0, 0.88)!important; -} - -.emotion-12:active { - scale: 0.8; - color: rgba(0, 0, 0, 0.88); -} - -.emotion-13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - width: 100%; - gap: 4px; -} - -.emotion-14 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - font-size: 12px; - border-radius: 2px; - min-width: 48px; -} - -.emotion-15 { - padding-left: 13px; -} - -.emotion-16 .studio-select-selector { - padding-left: 13px; -} - -.emotion-19 { - z-index: 10; - color: hsla(0, 0, 0, 0.45); - opacity: 0; -} - -.emotion-20 { - position: absolute; - top: 1px; - right: 1px; - -webkit-align-self: flex-end; - -ms-flex-item-align: flex-end; - align-self: flex-end; - overflow: hidden; - border-radius: 1px; - -webkit-backdrop-filter: blur(5px); - backdrop-filter: blur(5px); -} - -
    -
    -
    - 列配置项 -
    - -
    -
    -
    - 列标题 -
    -
    - 值类型 -
    -
    - 字段 -
    -
    -
    -
      -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderId - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderNumber - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    • -
      -
      - -
      - -
      -
      - - - - - 文本 - -
      - -
      -
      -
      - - - - - orderMoney - -
      - -
      -
      -
      - -
      -
      -
      -
    • -
    - -
    -
    -
    -`; - -exports[` > renders empty.tsx correctly 1`] = ` -.emotion-0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - gap: 4px; -} - -.emotion-1 { - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - width: 100%; - height: 24px; - font-size: 12px; - border-radius: 2px; - min-width: 48px; - color: rgba(0, 0, 0, 0.45); - padding-left: 8px; -} - -.emotion-4 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -
    -
    -
    - 列标题 -
    -
    - 值类型 -
    -
    - 字段 -
    -
    -
    -
    -
    - - - - - - - - - -
    -
    - 暂无数据 -
    -
    +