frame.select 1.1.3 → 1.1.4

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/dist/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAInB,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,iBAAS,GAAG,sBA6LX;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,WAAW,CAAC;AAInB,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,iBAAS,GAAG,sBA4KX;AAED,eAAe,GAAG,CAAC"}
package/dist/App.js CHANGED
@@ -92,19 +92,19 @@ function App() {
92
92
  }));
93
93
  }
94
94
  const brandColumnHelper = createColumnHelper();
95
- const extraBrandColumns = [
95
+ const brandColumns = [
96
96
  brandColumnHelper.accessor((row) => row.description, {
97
97
  header: 'description',
98
98
  cell: (info) => React.createElement("div", null, info.getValue()),
99
99
  }),
100
100
  ];
101
- const brandColWidth = [
101
+ const extraBrandColumns = [
102
102
  {
103
- column: extraBrandColumns[0],
103
+ column: brandColumns[0],
104
104
  },
105
105
  ];
106
106
  const frameColumnHelper = createColumnHelper();
107
- const extraFrameColumns = [
107
+ const frameColumns = [
108
108
  frameColumnHelper.accessor((row) => row.length.toString(), {
109
109
  header: 'length',
110
110
  cell: (info) => React.createElement("div", null, info.getValue()),
@@ -115,17 +115,14 @@ function App() {
115
115
  cell: (info) => React.createElement("div", null, info.getValue()),
116
116
  }),
117
117
  ];
118
- const frameColWidth = [
118
+ const extraFrameColumns = [
119
119
  {
120
- column: extraFrameColumns[0],
120
+ column: frameColumns[0],
121
121
  },
122
122
  {
123
- column: extraFrameColumns[1],
123
+ column: frameColumns[1],
124
124
  },
125
125
  ];
126
- const onClickItem = (item) => {
127
- window.alert(`Item clicked: ${item.getValue()}\n${JSON.stringify(item.row.original)}`);
128
- };
129
126
  const onClickBrand = (cell, index) => {
130
127
  console.log(`cell: ${JSON.stringify(cell.row.original, null, 2)}`);
131
128
  const brand = brands.find((b) => b.name === cell.row.original.name);
@@ -137,9 +134,6 @@ function App() {
137
134
  const onClickFrame = (cell, index) => {
138
135
  window.alert(`Frame clicked: ${JSON.stringify(cell.row.original)} at index ${index}`);
139
136
  };
140
- // const onClickFrame = (frame: string, index: number) => {
141
- // window.alert(`Frame clicked: ${frame} at index ${index}`);
142
- // };
143
137
  const [filter, setFilter] = useState('');
144
138
  function filterMatches(item, fltr) {
145
139
  const match = item.name
@@ -147,20 +141,13 @@ function App() {
147
141
  .includes(fltr ? fltr.toLowerCase() : '');
148
142
  return match;
149
143
  }
150
- const tItemFilter = {
151
- property: 'name',
152
- filter,
153
- setFilter,
154
- filterMatches,
155
- placeholder: 'Filter Brands',
156
- };
157
- // const renderItem = (item: string) => <h4>{item}</h4>;
144
+ const renderItem = (item) => React.createElement("h4", null, item);
158
145
  return (React.createElement(React.Fragment, null,
159
146
  React.createElement("h1", null, "Brand List"),
160
147
  React.createElement(BrandList, { brandList: brands, onClick: onClickBrand,
161
148
  // renderItem={renderItem}
162
- extraColumns: brandColWidth }),
149
+ extraColumns: extraBrandColumns }),
163
150
  React.createElement("h2", null, "Frame List"),
164
- React.createElement(FrameList, { frameList: convertFrames(brand), onClick: onClickFrame, extraColumns: frameColWidth, style: { border: '1px solid black', padding: '10px' } })));
151
+ React.createElement(FrameList, { frameList: convertFrames(brand), onClick: onClickFrame, extraColumns: extraFrameColumns, style: { border: '1px solid black', padding: '10px' } })));
165
152
  }
166
153
  export default App;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as ItemList } from './components/ItemList';
2
2
  export type { TColumn, TItem, TItemFilter } from './components/itemTypes';
3
3
  export { BrandList } from './components/BrandList';
4
- export type { TBrandObj } from './components/types';
4
+ export { FrameList } from './components/FrameList';
5
+ export type { TBrandObj, TFrameObj } from './components/types';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as ItemList } from './components/ItemList';
2
2
  export { BrandList } from './components/BrandList';
3
+ export { FrameList } from './components/FrameList';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frame.select",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "A React component for selecting items from a list with a search bar.",
5
5
  "license": "MIT",
6
6
  "type": "module",