Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4089: Orderlist require dataKey #5732

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/doc/orderlist/basicdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function BasicDoc(props) {

const code = {
basic: `
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
`,
javascript: `
import React, { useState, useEffect } from 'react';
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function BasicDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
</div>
)
}
Expand Down Expand Up @@ -109,7 +109,7 @@ export default function BasicDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
</div>
)
}
Expand Down Expand Up @@ -140,7 +140,7 @@ export default function BasicDemo() {
</p>
</DocSectionText>
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
</div>
<DocSectionCode code={code} service={['ProductService']} />
</>
Expand Down
8 changes: 4 additions & 4 deletions components/doc/orderlist/dragdropdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function DragDropDoc(props) {

const code = {
basic: `
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate}
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate}
header="Products" dragdrop></OrderList>
`,
javascript: `
Expand Down Expand Up @@ -62,7 +62,7 @@ export default function BasicDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
</div>
)
}
Expand Down Expand Up @@ -110,7 +110,7 @@ export default function BasicDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
</div>
)
}
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function BasicDemo() {
</p>
</DocSectionText>
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" dragdrop></OrderList>
</div>
<DocSectionCode code={code} service={['ProductService']} />
</>
Expand Down
8 changes: 4 additions & 4 deletions components/doc/orderlist/filterdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function FilterDoc(props) {

const code = {
basic: `
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
`,
javascript: `
import React, { useState, useEffect } from 'react';
Expand Down Expand Up @@ -61,7 +61,7 @@ export default function FilterDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
</div>
)
}
Expand Down Expand Up @@ -109,7 +109,7 @@ export default function FilterDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
</div>
)
}
Expand Down Expand Up @@ -141,7 +141,7 @@ export default function FilterDemo() {
</p>
</DocSectionText>
<div className="card xl:flex xl:justify-content-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products" filter filterBy="name"></OrderList>
</div>
<DocSectionCode code={code} service={['ProductService']} />
</>
Expand Down
4 changes: 4 additions & 0 deletions components/doc/orderlist/pt/ptdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export function PTDoc(props) {
const code = {
basic: `
<OrderList
dataKey="id"
value={products}
onChange={(e) => setProducts(e.value)}
itemTemplate={itemTemplate}
Expand Down Expand Up @@ -74,6 +75,7 @@ export default function PTDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList
dataKey="id"
value={products}
onChange={(e) => setProducts(e.value)}
itemTemplate={itemTemplate}
Expand Down Expand Up @@ -134,6 +136,7 @@ export default function PTDemo() {
return (
<div className="card xl:flex xl:justify-content-center">
<OrderList
dataKey="id"
value={products}
onChange={(e) => setProducts(e.value)}
itemTemplate={itemTemplate}
Expand Down Expand Up @@ -173,6 +176,7 @@ export default function PTDemo() {
<DocSectionText {...props}></DocSectionText>
<div className="card xl:flex xl:justify-content-center">
<OrderList
dataKey="id"
value={products}
onChange={(e) => setProducts(e.value)}
itemTemplate={itemTemplate}
Expand Down
2 changes: 1 addition & 1 deletion components/doc/orderlist/theming/tailwinddoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default function UnstyledDemo() {
return (
<div className="card xl:flex xl:justify-center">
<OrderList value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
<OrderList dataKey="id" value={products} onChange={(e) => setProducts(e.value)} itemTemplate={itemTemplate} header="Products"></OrderList>
</div>
)
}
Expand Down
2 changes: 1 addition & 1 deletion components/lib/orderlist/orderlist.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export interface OrderListProps extends Omit<React.DetailedHTMLProps<React.HTMLA
/**
* Name of the field that uniquely identifies the a record in the data.
*/
dataKey?: string | undefined;
dataKey: string;
/**
* The breakpoint to define the maximum width boundary when responsiveness is enabled.
* @defaultValue '960px'.
Expand Down
Loading